/* wonefiles UI design tokens — branding lands via --brand-* overrides from
   /api/v1/branding; light/dark follows the OS; motion respects the user.
   Design target: docs/design/*.png (light theme, #2563eb accent). */
:root {
  --brand-accent: #2563eb;
  --brand-accent-dim: #dbe7fd;
  --brand-accent-text: #ffffff;
  --bg: #f7f8fa;
  --surface: #ffffff;
  --surface-2: #f0f3f8;
  --text: #1a1d23;
  --text-dim: #5b6472;
  --border: #dde1e7;
  --danger: #b3261e;
  --ok: #1a7f37;
  --warn: #9a6700;
  --radius: 10px;
  --gap: 16px;
  --row-h: 44px;
  --shadow: 0 8px 28px rgba(20, 25, 35, 0.16);
  font-size: 16px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14171c;
    --surface: #1d2128;
    --surface-2: #262b34;
    --text: #e8eaf0;
    --text-dim: #9aa3b2;
    --border: #333a47;
    --brand-accent-dim: #1e3a75;
    --shadow: 0 8px 28px rgba(0, 0, 0, 0.5);
  }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.45;
}
a { color: var(--brand-accent); }
button, input, select { font: inherit; color: inherit; }
button {
  background: var(--brand-accent);
  color: var(--brand-accent-text);
  border: 0;
  border-radius: 8px;
  padding: 8px 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
button.secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}
button.ghost { background: transparent; color: var(--brand-accent); padding: 4px 8px; }
button.danger { background: var(--danger); }
button.icon { background: transparent; color: var(--text-dim); border: 0; padding: 4px 8px; }
button:disabled { opacity: 0.5; cursor: not-allowed; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible,
[tabindex]:focus-visible, tr.focused {
  outline: 3px solid var(--brand-accent);
  outline-offset: 2px;
}
input, select {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
}
input[type=checkbox], input[type=radio] { width: 1.05em; height: 1.05em; accent-color: var(--brand-accent); }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--gap);
}
.muted { color: var(--text-dim); }
.chip {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 0.8em;
  border: 1px solid var(--border);
}
.chip.clean, .chip.received, .chip.approved { color: var(--ok); border-color: var(--ok); }
.chip.quarantine, .chip.pending, .chip.warn { color: var(--warn); border-color: var(--warn); }
.chip.rejected, .chip.failed { color: var(--danger); border-color: var(--danger); }
.chip.needs_review, .chip.waived { color: var(--text-dim); }
.chip.accent { color: var(--brand-accent); border-color: var(--brand-accent); background: var(--brand-accent-dim); }

/* access pills (file table, mockup: Team / Private / Link shared) */
.acc-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 10px; border-radius: 999px; font-size: 0.78rem;
  border: 1px solid var(--border); color: var(--text-dim); white-space: nowrap;
}
.acc-pill.team { color: var(--brand-accent); border-color: var(--brand-accent); background: var(--brand-accent-dim); }
.acc-pill.link { color: var(--ok); border-color: var(--ok); }
.acc-pill.warn { color: var(--warn); border-color: var(--warn); }

/* content-safety: owner-only scanner degraded banner (addendum §4) */
.degraded-banner {
  padding: 8px 16px;
  border-bottom: 1px solid var(--warn);
  color: var(--warn);
  background: color-mix(in srgb, var(--warn) 10%, transparent);
  font-size: 0.85rem;
  text-align: center;
}

/* ---------- login ---------- */
.view-login-wrap {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: var(--gap);
}
.login-card { width: min(380px, 100%); text-align: center; }
.login-card img { height: 56px; margin-bottom: 8px; }
.login-card h1 { font-size: 1.4rem; margin: 4px 0 2px; }
.login-card form { text-align: left; margin-top: 14px; display: grid; gap: 10px; }
.login-card button[type=submit] { width: 100%; justify-content: center; padding: 10px; }

/* ---------- setup wizard ---------- */
.setup-wrap { min-height: 100%; display: grid; grid-template-columns: 300px 1fr; }
.setup-rail {
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.setup-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 28px; }
.setup-brand img { height: 34px; }
.setup-brand .tag { font-size: 0.8rem; color: var(--text-dim); }
.setup-step { display: flex; align-items: center; gap: 12px; padding: 10px 4px; color: var(--text-dim); position: relative; }
.setup-step .num {
  width: 30px; height: 30px; border-radius: 50%;
  border: 2px solid var(--border);
  display: grid; place-items: center;
  font-weight: 600; background: var(--surface);
  flex-shrink: 0;
}
.setup-step.active { color: var(--text); font-weight: 600; }
.setup-step.active .num { border-color: var(--brand-accent); background: var(--brand-accent); color: var(--brand-accent-text); }
.setup-step.done .num { border-color: var(--brand-accent); color: var(--brand-accent); }
.setup-step:not(:last-child)::after {
  content: ""; position: absolute; left: 18px; top: 44px; bottom: -8px;
  border-left: 2px solid var(--border);
}
.setup-rail .foot { margin-top: auto; color: var(--text-dim); font-size: 0.85rem; display: flex; gap: 8px; align-items: center; }
.setup-main { padding: 40px 48px 120px; overflow-y: auto; }
.setup-eyebrow { text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-dim); font-size: 0.8rem; }
.setup-main h1 { font-size: 2rem; margin: 6px 0 2px; }
.setup-main .sub { color: var(--text-dim); margin-top: 0; }
.setup-cards { display: flex; gap: var(--gap); margin: 20px 0; flex-wrap: wrap; }
.choice-card {
  flex: 1 1 240px; max-width: 340px;
  border: 2px solid var(--border); border-radius: var(--radius);
  padding: 16px; cursor: pointer; background: var(--surface);
  display: grid; gap: 4px;
}
.choice-card[aria-checked=true] { border-color: var(--brand-accent); background: var(--brand-accent-dim); }
.choice-card .title { font-weight: 650; display: flex; align-items: center; gap: 8px; }
.choice-card .radio-dot {
  width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--text-dim);
  display: inline-grid; place-items: center; flex-shrink: 0;
}
.choice-card[aria-checked=true] .radio-dot { border-color: var(--brand-accent); }
.choice-card[aria-checked=true] .radio-dot::after {
  content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--brand-accent);
}
.choice-card .desc { color: var(--text-dim); font-size: 0.9rem; }
.setup-feats { display: flex; gap: 28px; color: var(--text-dim); flex-wrap: wrap; }
.setup-feats span::before { content: "✓"; color: var(--brand-accent); margin-right: 8px; }
.setup-footer {
  position: fixed; bottom: 0; left: 300px; right: 0;
  background: var(--surface); border-top: 1px solid var(--border);
  padding: 14px 48px; display: flex; align-items: center; gap: 12px;
}
.setup-footer .steppos { margin-right: auto; color: var(--text-dim); font-size: 0.9rem; }
.setup-footer .end { margin-left: auto; }
.setup-footer button { padding: 10px 18px; }
.policy-box { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); max-width: 720px; }
.policy-tabs { display: flex; border-bottom: 1px solid var(--border); }
.policy-tabs button { border-radius: 0; background: transparent; color: var(--text-dim); border-bottom: 3px solid transparent; }
.policy-tabs button[aria-selected=true] { color: var(--brand-accent); border-bottom-color: var(--brand-accent); }
.policy-tabs .savecopy { margin-left: auto; }
.policy-body { padding: 18px 20px; max-height: 320px; overflow-y: auto; }
.policy-body h2 { margin-top: 0; }
.notice {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--brand-accent-dim); border-radius: 8px;
  padding: 12px 14px; margin: 14px 0; max-width: 720px;
}
.form-grid { display: grid; gap: 12px; max-width: 380px; }
.form-grid label { display: grid; gap: 4px; font-size: 0.9rem; color: var(--text-dim); }
.setup-2col { display: flex; gap: 32px; flex-wrap: wrap; }
.setup-2col > section { flex: 1 1 320px; max-width: 480px; }
.setup-2col h2 { font-size: 1.05rem; display: flex; gap: 8px; align-items: center; }
.storage-line { display: flex; gap: 10px; align-items: center; }
.storage-line code { background: var(--surface-2); border-radius: 6px; padding: 6px 10px; flex: 1; overflow-wrap: anywhere; }
.ok-dot { color: var(--ok); }
.bad-dot { color: var(--danger); }
.finish-check { list-style: none; padding: 0; display: grid; gap: 8px; max-width: 520px; }
.finish-check li::before { content: "✓"; color: var(--ok); margin-right: 10px; font-weight: 700; }
.summary-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 32px; max-width: 560px; }
.summary-grid dt { color: var(--text-dim); }
.summary-grid dd { margin: 0; font-weight: 600; }
.progress-track { background: var(--border); border-radius: 999px; height: 8px; overflow: hidden; }
.progress-fill { background: var(--brand-accent); height: 100%; border-radius: 999px; }

/* ---------- app shell ---------- */
.app-shell { display: grid; grid-template-columns: 264px 1fr; grid-template-rows: 64px 1fr; height: 100vh; }
.topbar {
  grid-column: 1 / -1; display: flex; align-items: center; gap: 14px;
  background: var(--surface); border-bottom: 1px solid var(--border);
  padding: 0 20px;
}
.topbar .brand { display: flex; align-items: center; gap: 10px; font-weight: 700; min-width: 224px; }
.topbar .brand img { height: 30px; }
.search-box { flex: 1; max-width: 560px; position: relative; }
.search-box input { width: 100%; padding: 9px 90px 9px 36px; border-radius: 10px; background: var(--surface-2); border-color: transparent; }
.search-box input:focus { border-color: var(--brand-accent); background: var(--surface); }
.search-box .kbd-hint {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  color: var(--text-dim); font-size: 0.78rem; border: 1px solid var(--border);
  border-radius: 6px; padding: 1px 7px; background: var(--surface);
}
.search-box .mag { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-dim); }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; background: var(--brand-accent);
  color: var(--brand-accent-text); display: grid; place-items: center; font-weight: 650; font-size: 0.85rem;
}
.sidebar {
  background: var(--surface); border-right: 1px solid var(--border);
  overflow-y: auto; padding: 14px 12px; display: flex; flex-direction: column; gap: 2px;
}
.sidebar .ws {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; margin-bottom: 10px;
  border-radius: 8px; font-weight: 650; cursor: default;
}
.sidebar .ws .ws-icon { font-size: 1.15rem; }
.sidebar .ws .ws-text { flex: 1; min-width: 0; }
.sidebar .ws .sub { font-weight: 400; font-size: 0.8rem; color: var(--text-dim); }
.ws-chev { color: var(--text-dim); margin-left: auto; }
.saved-line { display: flex; align-items: center; gap: 8px; color: var(--text-dim); font-size: 0.86rem; margin: 2px 0 0; }
.saved-line .ok-dot { font-size: 0.7rem; }
.saved-line button { margin-left: 8px; }
.crumbs .ws-crumb { color: var(--text-dim); }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 9px 12px;
  border-radius: 8px; color: var(--text); text-decoration: none; cursor: pointer;
  border: 0; background: transparent; width: 100%; text-align: left; font-weight: 500;
}
.nav-item:hover { background: var(--surface-2); }
.nav-item.active { background: var(--brand-accent-dim); color: var(--brand-accent); font-weight: 650; }
.nav-item .count, .tab-count { margin-left: auto; font-size: 0.8rem; background: var(--brand-accent); color: var(--brand-accent-text); border-radius: 999px; padding: 0 8px; }
.tab-count { margin-left: 6px; }
.nav-section { text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.72rem; color: var(--text-dim); padding: 14px 12px 4px; }
.drive-card { margin: 14px 6px 4px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 0.86rem; }
.drive-card .drive-status { display: flex; align-items: center; gap: 6px; color: var(--text-dim); font-size: 0.8rem; margin-top: 2px; }
.drive-card .drive-status .ok-dot, .drive-card .drive-status .bad-dot { font-size: 0.65rem; }
.drive-card .meter { margin-top: 6px; }
.drive-card .meter-label { color: var(--text-dim); font-size: 0.78rem; margin-top: 8px; }
.sidebar .tail { margin-top: auto; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 8px; width: 100%; background: transparent; border: 0; color: var(--text); text-align: left; }
.user-chip:hover { background: var(--surface-2); }
.main-area { overflow-y: auto; padding: 22px 28px; position: relative; }
.main-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 4px; }
.main-head h1 { font-size: 1.5rem; margin: 0; }
.main-head .actions { margin-left: auto; display: flex; gap: 10px; }
.crumbs { color: var(--text-dim); font-size: 0.9rem; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.crumbs button { background: transparent; color: var(--text-dim); border: 0; padding: 2px 4px; }
.crumbs button:hover, .crumbs button[aria-current] { color: var(--brand-accent); }
.crumbs .drop-hint { outline: 2px dashed var(--brand-accent); border-radius: 6px; }

/* folder cards */
.folder-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; margin: 18px 0 6px; }
.folder-card {
  display: flex; align-items: center; gap: 12px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); color: var(--text); padding: 14px 18px;
  cursor: pointer; text-align: left;
}
.folder-card:hover { border-color: var(--brand-accent); }
.folder-card .fc-icon { font-size: 1.4rem; flex-shrink: 0; }
.folder-card .fc-text { flex: 1; min-width: 0; display: grid; gap: 2px; }
.folder-card .fname { font-weight: 600; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder-card .fmeta { color: var(--text-dim); font-size: 0.82rem; }
.folder-card .fc-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.folder-card .fc-chev { color: var(--text-dim); font-size: 1.1rem; }
.folder-card.drop-target-ok { outline: 3px solid var(--brand-accent); background: var(--brand-accent-dim); }

/* type tabs + table toolbar */
.list-toolbar { display: flex; align-items: center; gap: 10px; margin: 14px 0 8px; flex-wrap: wrap; }
.type-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); }
.type-tabs button {
  background: transparent; color: var(--text-dim); border: 0; border-radius: 0;
  padding: 8px 14px; border-bottom: 3px solid transparent; font-weight: 500;
}
.type-tabs button[aria-selected=true] { color: var(--brand-accent); border-bottom-color: var(--brand-accent); }
.list-toolbar .spacer { flex: 1; }

/* file table (virtualized) */
.file-table-wrap { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.file-thead, .file-row {
  display: grid;
  grid-template-columns: 36px minmax(220px, 3fr) minmax(110px, 1fr) minmax(130px, 1fr) 90px minmax(110px, 1fr) 40px;
  align-items: center; gap: 8px; padding: 0 14px;
}
.file-thead { height: 40px; color: var(--text-dim); font-size: 0.85rem; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.file-thead .sortable { cursor: pointer; user-select: none; background: transparent; border: 0; color: inherit; padding: 0; font-size: inherit; display: flex; gap: 4px; align-items: center; }
.file-thead .sortable:hover { color: var(--text); }
.file-viewport { overflow-y: auto; position: relative; }
.file-canvas { position: relative; }
.file-row { height: var(--row-h); position: absolute; left: 0; right: 0; border-bottom: 1px solid var(--border); background: var(--surface); }
.file-row:hover { background: var(--surface-2); }
.file-row.selected { background: var(--brand-accent-dim); }
.file-row[aria-selected=true] .fav-star { visibility: visible; }
.file-row .name-cell { display: flex; align-items: center; gap: 10px; min-width: 0; }
.file-row .name-cell .fname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-row .ftype { flex-shrink: 0; width: 26px; height: 26px; display: grid; place-items: center; }
.file-row .fav-star { visibility: hidden; background: transparent; border: 0; color: var(--warn); cursor: pointer; padding: 0 4px; font-size: 1rem; }
.file-row .fav-star.on { visibility: visible; }
.file-row .row-menu { background: transparent; border: 0; color: var(--text-dim); cursor: pointer; }
.file-row.drop-target-ok { outline: 3px solid var(--brand-accent); outline-offset: -3px; }
.file-count-line { color: var(--text-dim); font-size: 0.85rem; padding: 10px 4px; display: flex; justify-content: space-between; align-items: center; }

/* skeletons */
.skel-row { height: var(--row-h); border-bottom: 1px solid var(--border); display: flex; align-items: center; padding: 0 14px; }
.skel-bar { height: 12px; border-radius: 6px; background: var(--surface-2); width: 60%; }
@keyframes skel-pulse { 50% { opacity: 0.45; } }
.skel-bar { animation: skel-pulse 1.2s ease-in-out infinite; }
.empty-state { text-align: center; color: var(--text-dim); padding: 60px 20px; }
.empty-state .big { font-size: 2rem; display: block; margin-bottom: 8px; }

/* details panel */
.details-panel {
  position: fixed; top: 64px; right: 0; bottom: 0; width: 380px;
  background: var(--surface); border-left: 1px solid var(--border);
  overflow-y: auto; padding: 20px; z-index: 30;
}
.details-panel .dp-head { display: flex; align-items: center; justify-content: space-between; }
.details-panel h2 { font-size: 1rem; margin: 0; color: var(--text-dim); font-weight: 600; }
.preview-box {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface-2); min-height: 180px;
  display: grid; place-items: center; overflow: hidden; margin: 14px 0;
}
.preview-box img, .preview-box video { max-width: 100%; max-height: 260px; display: block; }
.preview-box .picon { font-size: 3rem; color: var(--text-dim); padding: 40px; }
.dp-title { font-size: 1.1rem; font-weight: 650; overflow-wrap: anywhere; }
.dp-sub { color: var(--text-dim); font-size: 0.85rem; margin-bottom: 12px; }
.dp-actions { display: flex; gap: 10px; margin-bottom: 16px; }
.dp-actions button { flex: 1; justify-content: center; }
.meta-rows { display: grid; gap: 8px; margin-bottom: 16px; }
.meta-rows .mrow { display: flex; gap: 12px; align-items: center; font-size: 0.9rem; }
.meta-rows .mrow .k { color: var(--text-dim); width: 90px; flex-shrink: 0; display: flex; gap: 6px; align-items: center; }
.dp-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 12px; }
.dp-tabs button { background: transparent; color: var(--text-dim); border: 0; border-radius: 0; border-bottom: 3px solid transparent; }
.dp-tabs button[aria-selected=true] { color: var(--brand-accent); border-bottom-color: var(--brand-accent); }
.activity-feed { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.activity-feed li { padding: 8px 0 8px 20px; border-left: 3px solid var(--brand-accent); margin-left: 6px; position: relative; }
.activity-feed li::before {
  content: ""; position: absolute; left: -8px; top: 14px;
  width: 9px; height: 9px; border-radius: 50%; background: var(--brand-accent);
}
.activity-feed .when { color: var(--text-dim); font-size: 0.8rem; display: block; }

/* toasts */
.toast-stack { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); display: grid; gap: 10px; z-index: 100; width: min(480px, calc(100vw - 32px)); }
.toast {
  display: flex; align-items: center; gap: 14px;
  background: var(--text); color: var(--bg);
  border-radius: 10px; padding: 12px 16px; box-shadow: var(--shadow);
}
.toast .tmsg { flex: 1; overflow-wrap: anywhere; }
.toast button { background: transparent; color: var(--brand-accent-dim); border: 0; font-weight: 650; padding: 4px 8px; }
@media (prefers-color-scheme: dark) {
  .toast { background: #e8eaf0; color: #14171c; }
  .toast button { color: var(--brand-accent); }
}
.toast.err button { color: inherit; }

/* dialogs + context menu + sheets */
.modal-back { position: fixed; inset: 0; background: rgba(15, 18, 24, 0.45); display: grid; place-items: center; z-index: 90; padding: 20px; }
.modal { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; width: min(440px, 100%); }
.modal h2 { margin: 0 0 6px; font-size: 1.15rem; }
.modal .m-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.ctx-menu {
  position: fixed; z-index: 110; background: var(--surface);
  border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow);
  padding: 6px; min-width: 190px; display: grid;
}
.ctx-menu button { background: transparent; color: var(--text); border: 0; text-align: left; padding: 9px 12px; border-radius: 6px; display: flex; gap: 10px; align-items: center; }
.ctx-menu button:hover { background: var(--surface-2); }
.ctx-menu button.dangerous { color: var(--danger); }
.ctx-menu hr { border: 0; border-top: 1px solid var(--border); margin: 4px 0; width: 100%; }
.bulk-bar {
  position: sticky; bottom: 16px; margin: 12px auto 0; width: fit-content;
  display: flex; gap: 10px; align-items: center;
  background: var(--text); color: var(--bg); border-radius: 999px; padding: 8px 18px;
  box-shadow: var(--shadow); z-index: 40;
}
.bulk-bar button { background: transparent; color: inherit; border: 1px solid transparent; }
.bulk-bar button:hover { border-color: var(--bg); }
@media (prefers-color-scheme: dark) { .bulk-bar { background: #e8eaf0; color: #14171c; } }

/* drag ghost + marquee */
.drag-ghost {
  position: fixed; top: -1000px; left: -1000px;
  background: var(--brand-accent); color: var(--brand-accent-text);
  border-radius: 8px; padding: 8px 14px; font-size: 0.9rem; max-width: 320px;
}
.marquee { position: fixed; border: 1.5px dashed var(--brand-accent); background: color-mix(in srgb, var(--brand-accent) 12%, transparent); z-index: 50; pointer-events: none; }

/* request view */
.req-tabs { margin: 10px 0 4px; }
.req-cards { display: flex; gap: 14px; flex-wrap: wrap; margin: 16px 0 20px; }
.req-card { display: flex; align-items: center; gap: 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); padding: 14px 18px; min-width: 240px; cursor: pointer; text-align: left; }
.req-card[aria-current=true] { border-color: var(--brand-accent); outline: 2px solid var(--brand-accent); }
.req-card .rc-icon { font-size: 1.3rem; }
.req-card .rc-chev { color: var(--text-dim); margin-left: auto; font-size: 1.1rem; }
.req-card .t { font-weight: 650; display: block; }
.req-card .d { color: var(--text-dim); font-size: 0.82rem; }
.kind-picker { display: grid; gap: 8px; }
.kind-picker .choice-card { max-width: none; padding: 10px 14px; }
.req-progress { margin: 10px 0 16px; max-width: 640px; }
.link-banner { display: flex; align-items: center; gap: 12px; background: var(--brand-accent-dim); border-radius: 8px; padding: 10px 14px; max-width: 640px; margin-bottom: 14px; flex-wrap: wrap; }
.link-banner .grow { flex: 1; }
table.plain { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
table.plain th { text-align: left; color: var(--text-dim); font-size: 0.82rem; font-weight: 600; padding: 10px 14px; background: var(--surface-2); }
table.plain td { padding: 10px 14px; border-top: 1px solid var(--border); }

/* bottom sheet (mobile) */
.bottom-sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 95;
  background: var(--surface); border-radius: 16px 16px 0 0; box-shadow: var(--shadow);
  padding: 14px 20px 22px; display: grid; gap: 4px;
}
.bottom-sheet::before { content: ""; width: 42px; height: 4px; border-radius: 999px; background: var(--border); margin: 0 auto 8px; }
.bottom-sheet button { background: transparent; color: var(--text); text-align: left; padding: 12px 8px; border: 0; font-size: 1.02rem; }

/* folder tree */
.folder-tree { display: block; margin-top: 6px; }
.folder-tree ul { list-style: none; margin: 0; padding-left: 16px; }
.folder-tree > ul { padding-left: 0; }
.tree-node {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 8px; border-radius: 6px; cursor: pointer; min-height: 30px;
}
.tree-node:hover { background: var(--surface-2); }
.tree-node[aria-selected=true] { background: var(--brand-accent-dim); color: var(--brand-accent); font-weight: 600; }
.tree-node .twisty { background: transparent; border: 0; padding: 0; width: 18px; color: var(--text-dim); flex-shrink: 0; }
.tree-node .ticon { flex-shrink: 0; }
.tree-node .tlabel { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-node.drop-target-ok { outline: 3px solid var(--brand-accent); background: var(--brand-accent-dim); }

/* guest upload page shell */
.guest-wrap { max-width: 560px; margin: 10vh auto; padding: 0 16px; }

/* ---------- responsive ---------- */
.mobile-nav { display: none; }
@media (max-width: 720px) {
  .app-shell { grid-template-columns: 1fr; grid-template-rows: 56px 1fr 60px; }
  .sidebar { display: none; }
  .topbar .brand { min-width: 0; }
  .topbar .brand .bname { display: none; }
  .main-area { padding: 14px; }
  .mobile-nav {
    display: flex; background: var(--surface); border-top: 1px solid var(--border);
    justify-content: space-around; align-items: center;
  }
  .mobile-nav button { background: transparent; border: 0; color: var(--text-dim); display: grid; justify-items: center; font-size: 0.7rem; padding: 4px; }
  .mobile-nav button.active { color: var(--brand-accent); }
  .mobile-nav .mi { font-size: 1.3rem; }
  .file-thead, .file-row { grid-template-columns: 32px minmax(140px, 3fr) minmax(100px, 1fr) 80px 36px; }
  .file-thead .c-owner, .file-row .c-owner, .file-thead .c-access, .file-row .c-access { display: none; }
  .details-panel { width: 100%; top: 56px; }
  .setup-wrap { grid-template-columns: 1fr; }
  .setup-rail { flex-direction: row; overflow-x: auto; padding: 12px; gap: 0; }
  .setup-brand, .setup-rail .foot { display: none; }
  .setup-step { padding: 6px 8px; }
  .setup-step .lbl { display: none; }
  .setup-step.active .lbl { display: inline; }
  .setup-step:not(:last-child)::after { display: none; }
  .setup-main { padding: 20px 18px 110px; }
  .setup-footer { left: 0; padding: 12px 16px; }
}
