:root {
  color-scheme: dark;
  --page: #0d1117;
  --surface: #121820;
  --surface-raised: #171e27;
  --surface-hover: #19232c;
  --line: #27323d;
  --line-strong: #344250;
  --text: #e8edf2;
  --muted: #93a1af;
  --subtle: #697887;
  --accent: #18b887;
  --accent-hover: #20c997;
  --accent-soft: rgb(24 184 135 / 0.12);
  --accent-text: #071b15;
  --brand-blue: #257bd0;
  --private: #e3aa4e;
  --private-soft: rgb(227 170 78 / 0.11);
  --danger: #ff6b7a;
  --danger-soft: rgb(255 107 122 / 0.12);
  --radius: 8px;
  font-family: "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
  font-feature-settings: "tnum" 1;
}

.one-time-card {
  display: grid;
  gap: 20px;
  width: min(100%, 620px);
  margin: 32px auto;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.one-time-card p { color: var(--muted); overflow-wrap: anywhere; }
.one-time-card button { min-height: 44px; white-space: normal; }

* {
  box-sizing: border-box;
}

html {
  background: var(--page);
}

body {
  min-width: 320px;
  min-height: 100dvh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(900px 420px at 50% -280px, rgb(24 184 135 / 0.055), transparent 72%),
    var(--page);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button {
  white-space: nowrap;
}

button:focus-visible,
input:focus-visible,
a:focus-visible,
.table-scroll:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

h1,
h2,
p {
  margin: 0;
}

.shell {
  width: min(calc(100% - 48px), 1240px);
  margin-inline: auto;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

main {
  padding-block: 28px 72px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--line);
  background: rgb(13 17 23 / 0.88);
  backdrop-filter: blur(10px);
}

.topbar-inner {
  display: flex;
  width: min(calc(100% - 48px), 1240px);
  min-height: 72px;
  margin-inline: auto;
  align-items: center;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: "Segoe UI Variable Display", "Segoe UI", sans-serif;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1;
  color: #fff;
}

.brand-logo {
  width: 56px;
  height: 56px;
  padding: 0;
  background: transparent;
  object-fit: contain;
  filter: drop-shadow(0 5px 12px rgb(0 116 255 / 0.2));
}

.workspace-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  margin-bottom: 16px;
}

.workspace-heading .search-field {
  margin-left: auto;
}

.search-field {
  display: flex;
  width: min(100%, 300px);
  height: 36px;
  align-items: center;
  gap: 8px;
  padding: 0 11px;
  color: var(--muted);
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: #10161d;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.search-field:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.search-field svg {
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.search-field input {
  min-width: 0;
  width: 100%;
  padding: 0;
  color: var(--text);
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 13px;
}

.search-field input::placeholder {
  color: var(--subtle);
}

.eyebrow {
  margin-bottom: 7px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

h1 {
  font-family: "Segoe UI Variable Display", "Segoe UI", sans-serif;
  font-size: 20px;
  font-weight: 660;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.brand-accent {
  color: var(--brand-blue);
}

.file-count {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 10px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-raised);
  transform: translateY(2px);
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.primary-button,
.secondary-button,
.download-button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 5px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 620;
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}

.primary-button,
.download-button {
  color: var(--accent-text);
  background: var(--accent);
}

.primary-button:hover,
.primary-button:hover {
  background: var(--accent-hover);
}

.secondary-button {
  gap: 7px;
  color: var(--text);
  border-color: var(--line-strong);
  background: var(--surface-raised);
}

.secondary-button:hover:not(:disabled) {
  border-color: #465868;
  background: var(--surface-hover);
}

.secondary-button:active:not(:disabled),
.download-button:active:not(:disabled) {
  transform: translateY(1px);
}

.secondary-button svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.table-frame {
  overflow: hidden;
  border: 1px solid #2c3945;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 22px 58px -40px rgb(0 0 0 / 0.95);
}

.table-scroll {
  overflow-x: auto;
}

.file-table {
  width: 100%;
  min-width: 790px;
  border-collapse: collapse;
  table-layout: fixed;
}

.name-column {
  width: auto;
}

.size-column-width {
  width: 120px;
}

.status-column-width {
  width: 130px;
}

.action-column-width {
  width: 138px;
}

.file-table th {
  height: 44px;
  padding: 0 18px;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  background: #151d26;
  font-size: 11px;
  font-weight: 680;
  letter-spacing: 0.055em;
  text-align: left;
  text-transform: uppercase;
}

.file-table td {
  height: 64px;
  padding: 9px 18px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  font-size: 13px;
  vertical-align: middle;
}

.file-table tbody:last-of-type tr:last-child td,
.file-table tbody[hidden] + tbody:last-of-type tr:last-child td {
  border-bottom: 0;
}

.file-table tbody.file-data-row-group tr {
  transition: background-color 120ms ease;
}

.file-table tbody.file-data-row-group tr:hover {
  background: var(--surface-hover);
}

.size-column,
.size-cell {
  text-align: right !important;
}

.action-column,
.action-cell {
  text-align: right !important;
}

.file-identity {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 12px;
}

.file-type {
  display: grid;
  flex: 0 0 30px;
  place-items: center;
  width: 30px;
  height: 30px;
  color: #93a1af;
}

.file-type svg {
  width: 30px;
  height: 30px;
  fill: currentColor;
}

.file-type .body {
  opacity: 0.34;
}

.file-type .fold {
  opacity: 0.62;
}

.file-type .letter {
  fill: #0e141b;
  font-family: "Segoe UI", system-ui, sans-serif;
  font-weight: 700;
}

.type-doc {
  color: #4a8ee0;
}

.type-sheet {
  color: #2ab673;
}

.type-slide {
  color: #e2603d;
}

.type-pdf {
  color: #ef4d4d;
}

.type-image {
  color: #a879f0;
}

.type-video {
  color: #e05fa8;
}

.type-audio {
  color: #22b8cf;
}

.type-archive {
  color: #e3aa4e;
}

.type-disc {
  color: #4ec9e3;
}

.type-app {
  color: #7c86f0;
}

.type-code {
  color: var(--accent);
}

.type-torrent {
  color: #4dd4ac;
}

.file-text {
  min-width: 0;
}

.file-name {
  display: block;
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  font-weight: 610;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-extension {
  display: block;
  margin-top: 2px;
  color: var(--subtle);
  font-size: 11px;
}

.size-cell {
  color: #c4ced8 !important;
  font-variant-numeric: tabular-nums;
}

.status-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.status-label {
  color: var(--accent);
}

.status-label.missing {
  color: var(--danger);
}

.status-label.missing .status-dot {
  background: var(--danger);
  box-shadow: 0 0 0 4px var(--danger-soft);
}

.download-button {
  min-width: 98px;
  min-height: 30px;
  gap: 6px;
  padding: 0 11px;
  font-size: 12.5px;
  color: var(--accent);
  border-color: rgb(24 184 135 / 0.48);
  background: var(--accent-soft);
}

.download-button:hover:not(:disabled) {
  color: var(--accent-text);
  border-color: var(--accent);
  background: var(--accent);
}

.download-button.private {
  color: var(--private);
  border-color: rgb(227 170 78 / 0.48);
  background: var(--private-soft);
}

.download-button.private:hover:not(:disabled) {
  color: #211608;
  border-color: var(--private);
  background: var(--private);
}

.download-icon {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.unavailable-row .file-identity,
.unavailable-row .size-cell {
  opacity: 0.55;
}

.table-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  color: var(--subtle);
  border-top: 1px solid var(--line);
  background: #10161d;
  font-size: 11px;
  letter-spacing: 0.035em;
}

.skeleton {
  display: inline-block;
  height: 10px;
  border-radius: 3px;
  background: #222c36;
  animation: pulse 1.25s ease-in-out infinite alternate;
}

.file-skeleton {
  width: min(72%, 270px);
  height: 12px;
}

.file-skeleton.short {
  width: min(54%, 210px);
}

.size-skeleton {
  width: 56px;
}

.text-skeleton {
  width: 76px;
}

.button-skeleton {
  width: 98px;
  height: 30px;
}

@keyframes pulse {
  to {
    background: #2c3945;
  }
}

.table-message {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 190px;
  color: var(--muted);
}

.table-message > div {
  display: grid;
  gap: 3px;
  min-width: 240px;
}

.table-message strong {
  color: var(--text);
  font-size: 14px;
  font-weight: 630;
}

.table-message span:not(.message-symbol) {
  font-size: 12px;
}

.message-symbol {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: var(--accent);
  border: 1px solid rgb(24 184 135 / 0.28);
  border-radius: 5px;
  background: var(--accent-soft);
  font-size: 12px;
  font-weight: 700;
}

.error-symbol {
  color: var(--danger);
  border-color: rgb(255 107 122 / 0.28);
  background: var(--danger-soft);
}

dialog {
  width: min(calc(100% - 32px), 440px);
  padding: 0;
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 28px 90px rgb(0 0 0 / 0.7);
}

dialog::backdrop {
  background: rgb(4 8 12 / 0.72);
}

#password-form {
  padding: 24px;
}

.dialog-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}

.dialog-heading > div {
  min-width: 0;
}

.dialog-heading h2 {
  font-size: 19px;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.dialog-heading #password-file-name {
  overflow: hidden;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icon-button {
  flex: 0 0 30px;
  width: 30px;
  min-height: 30px;
  padding: 0;
  color: var(--muted);
  border-color: transparent;
  background: transparent;
  font-size: 22px;
  font-weight: 350;
}

.icon-button:hover {
  color: var(--text);
  background: var(--surface-raised);
}

.field {
  display: grid;
  gap: 8px;
}

.field label {
  color: #cbd4dd;
  font-size: 12px;
  font-weight: 620;
}

.field input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  color: var(--text);
  caret-color: var(--accent);
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: #10161d;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.field input:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.field-error {
  min-height: 18px;
  color: var(--danger);
  font-size: 12px;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.dialog-actions button {
  min-width: 96px;
}

[hidden] {
  display: none !important;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 30;
  padding: 10px 14px;
  color: var(--text);
  border: 1px solid rgb(24 184 135 / 0.38);
  border-radius: 6px;
  background: #14231f;
  box-shadow: 0 12px 36px rgb(0 0 0 / 0.45);
  font-size: 12px;
  font-weight: 620;
}

@media (max-width: 640px) {
  .shell,
  .topbar-inner {
    width: min(calc(100% - 24px), 1240px);
  }

  .topbar-inner {
    min-height: 62px;
  }

  .brand {
    gap: 9px;
    font-size: 23px;
  }

  .brand-logo {
    width: 46px;
    height: 46px;
  }

  .workspace-heading .search-field {
    order: 3;
    width: 100%;
    margin-left: 0;
  }

  main {
    padding-block: 22px 48px;
  }

  .table-frame {
    border-radius: 6px;
  }

  .table-message {
    justify-content: flex-start;
    min-height: 160px;
  }

  #password-form {
    padding: 20px;
  }

}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
