:root {
  color-scheme: dark;
  --ink: #f6f7fb;
  --muted: #a3acb9;
  --line: rgba(255, 255, 255, 0.13);
  --panel: rgba(19, 21, 29, 0.9);
  --panel-strong: rgba(13, 15, 21, 0.95);
  --field: rgba(8, 10, 15, 0.74);
  --accent: #8cc7ff;
  --accent-dark: #5aa7f0;
  --rose: #e88bb4;
  --frost: #d5dbe7;
  --accent-rgb: 140, 199, 255;
  --rose-rgb: 232, 139, 180;
  --page-start: #08090d;
  --page-mid: #11131a;
  --page-end: #181218;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.42);
}

html[data-theme="ocean"] {
  --accent: #67d4ff;
  --accent-dark: #2f9fd1;
  --rose: #6ee7d8;
  --frost: #d8f3ff;
  --accent-rgb: 103, 212, 255;
  --rose-rgb: 110, 231, 216;
  --page-start: #060a0f;
  --page-mid: #0b1520;
  --page-end: #071c22;
}

html[data-theme="forest"] {
  --accent: #8ee89f;
  --accent-dark: #45bf68;
  --rose: #e2d36e;
  --frost: #d9f5df;
  --accent-rgb: 142, 232, 159;
  --rose-rgb: 226, 211, 110;
  --page-start: #070b08;
  --page-mid: #0e1711;
  --page-end: #15180b;
}

html[data-theme="orange"] {
  --accent: #ffb15f;
  --accent-dark: #e5842c;
  --rose: #ff7a8a;
  --frost: #ffe2bd;
  --accent-rgb: 255, 177, 95;
  --rose-rgb: 255, 122, 138;
  --page-start: #0c0906;
  --page-mid: #17100b;
  --page-end: #1b1114;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-height: 100%;
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 18%, rgba(var(--accent-rgb), 0.15), transparent 25rem),
    radial-gradient(circle at 88% 12%, rgba(var(--rose-rgb), 0.12), transparent 24rem),
    radial-gradient(circle at 55% 95%, rgba(213, 219, 231, 0.07), transparent 28rem),
    linear-gradient(135deg, var(--page-start) 0%, var(--page-mid) 48%, var(--page-end) 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

::selection {
  color: #071019;
  background: var(--accent);
}

button,
input,
textarea,
select {
  font: inherit;
}

a {
  color: inherit;
}

.sr-only {
  position: absolute;
  overflow: hidden;
  width: 1px;
  height: 1px;
  padding: 0;
  border: 0;
  margin: -1px;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.shell {
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 48px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 48px;
}

.brand,
.ghost-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 750;
}

.top-actions {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 42px;
  place-items: center;
  flex: 0 0 auto;
}

.brand-logo {
  display: block;
  width: 34px;
  height: 42px;
  object-fit: contain;
}

.status-pill,
.ghost-link,
.language-switch select {
  min-height: 34px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.05);
}

.language-switch select {
  min-width: 74px;
  cursor: pointer;
  outline: none;
}

.language-switch select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.16);
}

.theme-switch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px;
  background: rgba(255, 255, 255, 0.05);
}

.theme-swatch {
  width: 26px;
  height: 26px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: linear-gradient(135deg, var(--swatch-accent), var(--swatch-rose));
  cursor: pointer;
}

.theme-swatch.is-active {
  border-color: rgba(255, 255, 255, 0.76);
  box-shadow:
    0 0 0 2px rgba(var(--accent-rgb), 0.32),
    inset 0 0 0 2px rgba(7, 16, 25, 0.24);
}

.mode-switch {
  display: inline-flex;
  gap: 8px;
  margin: 4px 0 14px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
}

.mode-button {
  min-height: 34px;
  border: 0;
  border-radius: 999px;
  padding: 7px 14px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-weight: 800;
}

.mode-button.is-active {
  color: #071019;
  background: linear-gradient(135deg, var(--accent), var(--rose));
}

.mode-note {
  min-height: 44px;
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.55;
}

.ghost-link.is-active {
  color: var(--ink);
  border-color: rgba(var(--accent-rgb), 0.36);
  background: rgba(var(--accent-rgb), 0.1);
}

.upload-layout,
.download-layout,
.list-layout,
.auth-panel,
.nearby-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(360px, 1fr);
  gap: 44px;
  align-items: center;
  min-height: calc(100vh - 128px);
  padding: 52px 0 24px;
}

.download-layout {
  align-items: start;
}

.list-layout {
  grid-template-columns: minmax(280px, 0.48fr) minmax(0, 1fr);
  align-items: start;
}

.auth-panel {
  align-items: center;
}

.nearby-layout {
  grid-template-columns: minmax(280px, 0.42fr) minmax(0, 1fr);
  align-items: start;
}

.nearby-panels {
  display: grid;
  gap: 18px;
}

.device-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
  margin-top: 24px;
}

.intro,
.transfer-summary,
.list-hero {
  max-width: 560px;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 18px;
  font-size: clamp(3rem, 8vw, 6rem);
  line-height: 0.92;
  letter-spacing: 0;
}

.download-layout h1 {
  font-size: clamp(2.5rem, 7vw, 5.2rem);
}

.list-layout h1 {
  font-size: clamp(2.2rem, 3.8vw, 3rem);
  line-height: 1;
}

.lede {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1.65;
}

.transfer-panel,
.download-panel,
.list-panel {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.dropzone {
  position: relative;
  display: grid;
  min-height: 220px;
  place-items: center;
  padding: 28px;
  border: 2px dashed rgba(var(--accent-rgb), 0.34);
  border-radius: 8px;
  color: var(--muted);
  background:
    linear-gradient(135deg, rgba(var(--accent-rgb), 0.1), rgba(var(--rose-rgb), 0.08)),
    rgba(255, 255, 255, 0.035);
  cursor: pointer;
  text-align: center;
  transition: border-color 160ms ease, transform 160ms ease, background 160ms ease;
}

.dropzone:hover,
.dropzone.is-dragging {
  border-color: var(--accent);
  background:
    linear-gradient(135deg, rgba(var(--accent-rgb), 0.16), rgba(var(--rose-rgb), 0.12)),
    rgba(255, 255, 255, 0.06);
  transform: translateY(-1px);
}

.dropzone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.drop-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  margin-bottom: 12px;
  border-radius: 50%;
  color: #071019;
  background: linear-gradient(145deg, var(--accent), var(--rose));
  font-size: 0;
  line-height: 0;
}

.drop-icon::before,
.drop-icon::after {
  position: absolute;
  content: "";
  border-radius: 999px;
  background: currentColor;
}

.drop-icon::before {
  width: 22px;
  height: 5px;
}

.drop-icon::after {
  width: 5px;
  height: 22px;
}

.drop-title {
  display: block;
  color: var(--ink);
  font-size: 1.35rem;
  font-weight: 800;
}

.drop-meta {
  display: block;
  margin-top: 6px;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 0.62fr;
  gap: 14px;
}

.field {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.field span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.field-help {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.field input,
.field textarea,
.field select,
.copy-row input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  color: var(--ink);
  background: var(--field);
  outline: none;
}

.field input::placeholder,
.field textarea::placeholder {
  color: #66717d;
}

.field textarea {
  resize: vertical;
  line-height: 1.45;
}

.field input:focus,
.field textarea:focus,
.field select:focus,
.copy-row input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.16);
}

.primary-button,
.copy-row button,
.download-button,
.secondary-button,
.danger-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  color: #071019;
  background: linear-gradient(135deg, var(--accent), var(--rose));
  cursor: pointer;
  font-weight: 800;
  text-decoration: none;
}

.primary-button {
  width: 100%;
  margin-top: 18px;
}

.primary-button.icon-button {
  width: 48px;
  justify-self: end;
}

.primary-button:hover,
.copy-row button:hover,
.download-button:hover,
.secondary-button:hover {
  background: linear-gradient(135deg, var(--accent-dark), var(--frost));
}

.primary-button[disabled],
.secondary-button[disabled],
.danger-button[disabled] {
  cursor: wait;
  opacity: 0.72;
}

.secondary-button {
  min-width: 112px;
  padding: 0 14px;
}

.ghost-button {
  min-width: 104px;
  padding: 0 14px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
}

.ghost-button:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.1);
}

.danger-button {
  min-width: 132px;
  padding: 0 14px;
  color: #fff4f6;
  background: linear-gradient(135deg, #c83f64, #8f2d4b);
}

.danger-button:hover {
  background: linear-gradient(135deg, #e5537a, #a43859);
}

.file-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.file-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 58px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
}

.file-name {
  overflow: hidden;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-size,
.file-type {
  color: var(--muted);
  font-size: 0.86rem;
}

.download-button {
  min-width: 116px;
  padding: 0 14px;
}

.button-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
}

.icon-button,
.download-button.icon-button,
.secondary-button.icon-button,
.danger-button.icon-button,
.ghost-button.icon-button {
  width: 48px;
  min-width: 48px;
  padding: 0;
}

.list-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.settings-panel {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 0.9fr) auto auto;
  gap: 12px;
  align-items: end;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.utility-panel {
  margin-top: 18px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 18px;
}

.inline-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.auth-form {
  align-self: start;
}

.search-field {
  margin-top: 0;
}

.file-table {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.file-table-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, auto);
  grid-template-areas:
    "main actions"
    "context actions"
    "date actions";
  gap: 6px 18px;
  align-items: center;
  min-height: 64px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
}

.file-table-row.has-no-context,
.admin-row.has-no-context {
  grid-template-areas:
    "main actions"
    "date actions";
}

.admin-table {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.admin-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(168px, auto);
  grid-template-areas:
    "select main actions"
    "select context actions"
    "select date actions";
  gap: 6px 18px;
  align-items: center;
  min-height: 64px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
}

.file-table-main {
  grid-area: main;
  min-width: 0;
}

.file-table-name,
.file-table-transfer {
  display: block;
  overflow: hidden;
  text-decoration: none;
  overflow-wrap: anywhere;
  text-overflow: clip;
}

.file-table-name {
  color: var(--ink);
  font-weight: 800;
  line-height: 1.3;
}

.file-table-transfer {
  grid-area: context;
  color: var(--accent);
  font-weight: 750;
}

.file-table-transfer.is-folder-path {
  width: fit-content;
  max-width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 3px 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.035);
  font-size: 0.78rem;
  font-weight: 750;
}

.file-table-meta,
.file-table-date {
  color: var(--muted);
  font-size: 0.86rem;
}

.file-table-date {
  grid-area: date;
}

.file-table-actions {
  grid-area: actions;
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.admin-row .file-table-actions {
  min-width: 104px;
}

.admin-row.has-no-context {
  grid-template-areas:
    "select main actions"
    "select date actions";
}

.row-select {
  grid-area: select;
  display: grid;
  width: 28px;
  min-height: 48px;
  place-items: start center;
  padding-top: 4px;
}

.row-select input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.compact-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.compact-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 56px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.04);
}

.compact-title {
  overflow: hidden;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compact-meta {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.compact-actions {
  display: inline-flex;
  gap: 8px;
}

.nearby-inbox-row {
  align-items: stretch;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.nearby-inbox-row:hover,
.nearby-inbox-row:focus-within {
  border-color: rgba(var(--accent-rgb), 0.58);
  background: rgba(var(--accent-rgb), 0.1);
  box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), 0.22);
}

.nearby-inbox-open {
  display: grid;
  gap: 4px;
  min-width: 0;
  border: 0;
  padding: 0;
  color: inherit;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.nearby-inbox-open:hover .compact-title,
.nearby-inbox-open:focus-visible .compact-title {
  color: var(--accent);
}

.nearby-inbox-open:focus-visible {
  border-radius: 6px;
  outline: 2px solid rgba(var(--accent-rgb), 0.52);
  outline-offset: 4px;
}

.device-row {
  grid-template-columns: minmax(0, 1fr);
  width: 100%;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.device-row > span {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  gap: 18px;
  align-items: baseline;
  min-width: 0;
}

.device-row .compact-meta {
  white-space: nowrap;
}

.device-title {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-width: 0;
}

.device-name-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.device-selected-mark {
  position: relative;
  display: inline-flex;
  width: 22px;
  height: 22px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(var(--accent-rgb), 0.28);
  border-radius: 999px;
  opacity: 0.45;
}

.device-selected-mark::after {
  width: 9px;
  height: 5px;
  border-bottom: 2px solid #071019;
  border-left: 2px solid #071019;
  content: "";
  opacity: 0;
  transform: rotate(-45deg) translate(1px, -1px);
}

.device-row.is-selected {
  border-color: rgba(var(--accent-rgb), 0.86);
  background: rgba(var(--accent-rgb), 0.14);
  box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), 0.42);
}

.device-row.is-selected .device-selected-mark {
  border-color: transparent;
  background: linear-gradient(145deg, var(--accent), var(--rose));
  opacity: 1;
}

.device-row.is-selected .device-selected-mark::after {
  opacity: 1;
}

.preview-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.68);
}

.preview-modal {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(920px, 100%);
  max-height: min(760px, calc(100vh - 40px));
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--panel-strong);
  box-shadow: var(--shadow);
}

.preview-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.preview-title {
  overflow: hidden;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-body {
  min-height: 260px;
  overflow: auto;
  padding: 16px;
}

.preview-body img,
.preview-body iframe,
.preview-body video {
  display: block;
  width: 100%;
  min-height: 62vh;
  border: 0;
  object-fit: contain;
}

.preview-body video {
  max-height: 62vh;
  background: #000;
}

.preview-body pre {
  margin: 0;
  color: var(--ink);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: 0.9rem/1.55 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.nearby-preview-modal {
  width: min(1040px, 100%);
}

.nearby-preview-body {
  display: grid;
  grid-template-columns: minmax(220px, 0.35fr) minmax(0, 1fr);
  gap: 14px;
  overflow: hidden;
}

.nearby-preview-files,
.nearby-preview-pane {
  overflow: auto;
  min-width: 0;
}

.nearby-preview-files {
  display: grid;
  align-content: start;
  gap: 8px;
  border-right: 1px solid var(--line);
  padding-right: 14px;
}

.nearby-preview-help {
  margin: 0 0 4px;
}

.preview-file-item {
  display: grid;
  gap: 4px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  text-align: left;
}

.preview-file-item:hover,
.preview-file-item.is-active {
  border-color: rgba(var(--accent-rgb), 0.72);
  background: rgba(var(--accent-rgb), 0.12);
}

.preview-file-name {
  overflow: hidden;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nearby-preview-pane {
  display: grid;
  align-content: start;
  gap: 12px;
}

.nearby-preview-pane img,
.nearby-preview-pane iframe,
.nearby-preview-pane video {
  min-height: min(62vh, 620px);
}

.nearby-preview-empty {
  min-height: 220px;
}

.secondary-button.is-compact {
  min-width: 92px;
}

.danger-button.is-compact {
  min-width: 122px;
}

.secondary-button.is-compact.icon-button,
.danger-button.is-compact.icon-button {
  min-width: 48px;
}

.empty-state {
  min-height: 92px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.035);
}

.progress {
  overflow: hidden;
  height: 8px;
  margin-top: 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.progress-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--rose), var(--frost));
  transition: width 160ms ease;
}

.result {
  display: grid;
  gap: 8px;
  margin-top: 16px;
  color: var(--muted);
  font-weight: 700;
}

.copy-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px;
  gap: 10px;
}

.form-note {
  min-height: 22px;
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.form-note.is-error {
  color: #ff8fb3;
}

.session-note {
  min-height: 42px;
  margin: 0 0 16px;
  border: 1px solid rgba(var(--accent-rgb), 0.28);
  border-radius: 8px;
  padding: 11px 12px;
  color: var(--ink);
  background: rgba(var(--accent-rgb), 0.08);
  line-height: 1.45;
}

.session-note.is-error {
  border-color: rgba(255, 143, 179, 0.32);
  color: #ffb5ca;
  background: rgba(200, 63, 100, 0.12);
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 30px 0 0;
}

.meta-grid div {
  min-height: 82px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.045);
}

.meta-grid dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.meta-grid dd {
  margin: 8px 0 0;
  font-size: 1.1rem;
  font-weight: 850;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.panel-heading h2 {
  margin: 0;
  font-size: 1.2rem;
}

.panel-heading span {
  color: var(--muted);
  font-size: 0.9rem;
}

@media (max-width: 860px) {
  .shell {
    width: min(100% - 24px, 680px);
    padding-top: 18px;
  }

  .upload-layout,
  .download-layout,
  .list-layout,
  .auth-panel,
  .nearby-layout {
    grid-template-columns: 1fr;
    gap: 28px;
    min-height: auto;
    padding-top: 42px;
  }

  h1 {
    font-size: clamp(2.65rem, 17vw, 4.6rem);
  }

  .field-grid,
  .meta-grid {
    grid-template-columns: 1fr;
  }

  .file-table-row {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "main"
      "context"
      "date"
      "actions";
  }

  .admin-row {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "select"
      "main"
      "context"
      "date"
      "actions";
  }

  .file-table-row.has-no-context,
  .admin-row.has-no-context {
    grid-template-areas:
      "select"
      "main"
      "date"
      "actions";
  }

  .file-table-actions,
  .admin-row .file-table-actions {
    justify-content: stretch;
    min-width: 0;
    width: 100%;
  }

  .nearby-preview-body {
    grid-template-columns: 1fr;
    overflow: auto;
  }

  .nearby-preview-files {
    max-height: 220px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding-right: 0;
    padding-bottom: 14px;
  }
}

@media (max-width: 520px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .status-pill {
    max-width: 170px;
    text-align: right;
  }

  .transfer-panel,
  .download-panel {
    padding: 16px;
  }

  .dropzone {
    min-height: 190px;
  }

  .copy-row,
  .file-row,
  .list-toolbar,
  .settings-panel,
  .inline-form,
  .device-panel,
  .compact-row,
  .file-table-row,
  .admin-row {
    grid-template-columns: 1fr;
  }

  .download-button,
  .secondary-button,
  .danger-button,
  .ghost-button {
    width: 100%;
  }

  .icon-button,
  .primary-button.icon-button,
  .download-button.icon-button,
  .secondary-button.icon-button,
  .danger-button.icon-button,
  .ghost-button.icon-button {
    width: 48px;
    min-width: 48px;
  }

  .device-row > span {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .file-table-actions {
    display: flex;
    justify-content: flex-start;
  }

  .file-table-actions .secondary-button:not(.icon-button) {
    width: auto;
    flex: 1;
  }

  .file-table-actions .icon-button,
  .file-row .icon-button {
    width: 48px;
    min-width: 48px;
    flex: 0 0 48px;
  }

  .mode-switch {
    width: 100%;
  }

  .mode-button {
    flex: 1;
  }
}
