/* Reem Drive — Apple Files proportions, Reem's yellow only on upload; see DESIGN.md */
@font-face { font-family: "Graphik Arabic"; src: url("fonts/graphik-arabic-regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Graphik Arabic"; src: url("fonts/graphik-arabic-medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Graphik Arabic"; src: url("fonts/graphik-arabic-semibold.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Graphik Arabic"; src: url("fonts/graphik-arabic-bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  color-scheme: light;
  --paper-top: #FBFAF7;
  --paper: #F3F1EC;
  --surface: #FFFFFF;
  --surface-2: #F7F5F1;
  --sunken: #ECE9E3;
  --ink: #1D1A22;
  --ink-2: #47424F;
  --ink-3: #696372;
  --line: rgba(29, 26, 34, 0.10);
  --line-strong: rgba(29, 26, 34, 0.18);
  --accent: #F4FF16;
  --accent-press: #E2ED00;
  --accent-ink: #1D1A22;
  --tray: #1D1A22;
  --tray-ink: #F6F4F8;
  --tray-ink-2: #B9B3C1;
  --danger: #B8251A;
  --ok: #1F7A45;
  --shadow-card: 0 1px 2px rgba(29, 26, 34, 0.06), 0 6px 18px -8px rgba(29, 26, 34, 0.16);
  --shadow-float: 0 2px 6px rgba(29, 26, 34, 0.10), 0 18px 40px -12px rgba(29, 26, 34, 0.32);
  --scrim: rgba(22, 19, 26, 0.42);

  --font: "Graphik Arabic", -apple-system, "SF Arabic", "Geeza Pro", system-ui, sans-serif;
  --t-caption: 13px;
  --t-body: 15px;
  --t-callout: 17px;
  --t-title3: 20px;
  --t-title1: 28px;
  --t-large: 34px;

  --r-chip: 999px;
  --r-card: 14px;
  --r-row: 12px;
  --r-modal: 20px;
  --r-field: 10px;

  --gutter: 16px;
  --tap: 44px;
  --sidebar: 280px;

  --d-fast: 125ms;
  --d-base: 180ms;
  --d-slow: 350ms;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --safe-b: env(safe-area-inset-bottom, 0px);
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --paper-top: #1F1A25;
    --paper: #15121A;
    --surface: #221E29;
    --surface-2: #1C1922;
    --sunken: #2B2633;
    --ink: #F4F2F6;
    --ink-2: #CCC6D3;
    --ink-3: #A39CAB;
    --line: rgba(255, 255, 255, 0.09);
    --line-strong: rgba(255, 255, 255, 0.16);
    --tray: #2C2734;
    --danger: #FF7468;
    --ok: #5BD08C;
    --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 22px -10px rgba(0, 0, 0, 0.6);
    --shadow-float: 0 2px 8px rgba(0, 0, 0, 0.5), 0 22px 48px -12px rgba(0, 0, 0, 0.7);
    --scrim: rgba(0, 0, 0, 0.6);
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  font-size: var(--t-body);
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
  background-image: radial-gradient(120% 60% at 70% -10%, var(--paper-top) 0%, transparent 60%);
  background-attachment: fixed;
  font-feature-settings: "tnum" 0;
}
* { scrollbar-width: none; }
*::-webkit-scrollbar { display: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 6px; }
.num { font-feature-settings: "tnum" 1; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
svg.i { width: 22px; height: 22px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap); padding: 0 18px; border-radius: var(--r-chip);
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  font-weight: 600; font-size: var(--t-body); text-decoration: none;
  transition: transform var(--d-fast) var(--ease), background var(--d-base) var(--ease);
}
.btn:active { transform: scale(0.97); }
.btn.primary { background: var(--ink); color: var(--paper); border-color: transparent; }
.btn.upload {
  background: var(--accent); color: var(--accent-ink); border-color: rgba(29, 26, 34, 0.16);
  box-shadow: var(--shadow-float); font-weight: 700; padding: 0 22px 0 20px; min-height: 52px; font-size: var(--t-callout);
}
.btn.upload:active { background: var(--accent-press); }
.btn.danger { color: var(--danger); }
.btn.quiet { background: transparent; border-color: transparent; padding: 0 10px; }
.btn.block { width: 100%; }
.icon-btn {
  display: inline-grid; place-items: center; width: var(--tap); height: var(--tap);
  border-radius: 50%; border: 0; background: transparent; color: var(--ink);
}
.icon-btn:active { background: var(--sunken); }

/* ---------- login ---------- */
.login { min-height: 100dvh; display: grid; place-items: center; padding: var(--gutter); }
.login form {
  width: min(380px, 100%); background: var(--surface); border-radius: var(--r-modal);
  border: 1px solid var(--line); box-shadow: var(--shadow-float); padding: 32px 24px 24px;
  display: grid; gap: 14px;
}
.login h1 { margin: 0; font-size: var(--t-title1); font-weight: 700; line-height: 1.2; }
.login p { margin: 0 0 6px; color: var(--ink-2); }
.mark { width: 52px; height: 52px; border-radius: 14px; background: var(--accent); display: grid; place-items: center; color: var(--accent-ink); border: 1px solid rgba(29,26,34,.14); }
.mark svg.i { width: 28px; height: 28px; stroke-width: 2; }

/* ---------- fields ---------- */
.field { display: grid; gap: 6px; }
.field > span { font-size: var(--t-caption); color: var(--ink-2); font-weight: 500; }
.input, .textarea, .select {
  width: 100%; min-height: var(--tap); padding: 10px 14px; border-radius: var(--r-field);
  border: 1px solid var(--line-strong); background: var(--surface-2); font-size: 16px; /* 16px stops iOS zoom */
  transition: border-color var(--d-base) var(--ease), background var(--d-base) var(--ease);
}
.input:focus, .textarea:focus, .select:focus { outline: none; border-color: var(--ink); background: var(--surface); }
.textarea { min-height: 112px; resize: vertical; line-height: 1.6; }
.select { appearance: none; -webkit-appearance: none; padding-left: 38px; background-repeat: no-repeat; background-position: 14px 50%; background-size: 12px 8px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%23696372' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.form-error { color: var(--danger); font-size: var(--t-caption); min-height: 1.2em; margin: 0; }
.hint { color: var(--ink-3); font-size: var(--t-caption); margin: 0; }

/* ---------- shell ---------- */
.shell { min-height: 100dvh; }
.sidebar { display: none; }
.main { padding: 0 var(--gutter) calc(150px + var(--safe-b)); max-width: 1400px; margin: 0 auto; }

.topbar { position: sticky; top: 0; z-index: 5; margin: 0 calc(-1 * var(--gutter)); padding: 8px var(--gutter) 0;
  background: color-mix(in srgb, var(--paper) 86%, transparent); backdrop-filter: saturate(1.4) blur(18px); -webkit-backdrop-filter: saturate(1.4) blur(18px); }
.topbar-row { display: flex; align-items: center; gap: 4px; min-height: var(--tap); }
.back { display: inline-flex; align-items: center; gap: 2px; border: 0; background: none; color: var(--ink-2); font-weight: 500; padding: 0 4px; min-height: var(--tap); max-width: 60%; }
.back svg { transform: scaleX(-1); }
.topbar-row .spacer { flex: 1; }
.title-row { display: flex; align-items: flex-end; gap: 8px; padding: 2px 0 10px; }
.large-title { margin: 0; font-size: var(--t-large); font-weight: 700; line-height: 1.15; letter-spacing: -0.01em; overflow-wrap: anywhere; flex: 1; }
.count { color: var(--ink-3); font-size: var(--t-body); padding-bottom: 6px; white-space: nowrap; }

.search { position: relative; margin-bottom: 10px; }
.search svg { position: absolute; inset-inline-start: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-3); width: 18px; height: 18px; }
.search input { width: 100%; min-height: 40px; border-radius: 12px; border: 0; background: var(--sunken); padding: 8px 40px 8px 12px; font-size: 16px; }
.search input:focus { outline: 2px solid var(--ink); outline-offset: 0; }
.search .clear { position: absolute; inset-inline-end: 4px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 12px; margin: 0 calc(-1 * var(--gutter)); padding-inline: var(--gutter); }
.chip { flex: none; min-height: 34px; padding: 0 14px; border-radius: var(--r-chip); border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-2); font-size: var(--t-caption); font-weight: 500; display: inline-flex; align-items: center; gap: 6px; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.chip .n { color: inherit; opacity: 0.7; }
.chip.sort { margin-inline-start: auto; }

.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 18px 0 10px; }
.section-head h2 { margin: 0; font-size: var(--t-title3); font-weight: 700; }
.section-head .btn { min-height: 36px; padding: 0 12px; font-size: var(--t-caption); }

/* ---------- folders ---------- */
.folders { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.folder {
  position: relative; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 10px;
  min-height: 64px; padding: 10px 12px 10px 6px; border-radius: var(--r-row);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-card);
  text-align: start; color: var(--ink); text-decoration: none;
  transition: transform var(--d-fast) var(--ease), border-color var(--d-base) var(--ease);
}
.folder:active { transform: scale(0.98); }
.folder.drop { border-color: var(--ink); background: var(--surface-2); }
.folder-glyph { width: 40px; height: 32px; color: var(--ink-2); }
.folder-glyph path:first-child { fill: var(--sunken); }
.folder b { display: block; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.folder small { color: var(--ink-3); font-size: var(--t-caption); }
.folder .more { position: absolute; inset-inline-end: 0; top: 0; width: 36px; height: 36px; color: var(--ink-3); }

/* ---------- video grid: row order kept, every poster whole inside a square cell (Apple Files) ---------- */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 14px; }
.card { position: relative; cursor: pointer; text-align: center; outline: none; }
.card .frame { aspect-ratio: 5 / 4; display: flex; align-items: flex-end; justify-content: center; }
.card .poster {
  position: relative; width: min(100%, calc(var(--ar, 1.7778) * 100%)); aspect-ratio: var(--ar, 1.7778);
  border-radius: var(--r-card); overflow: hidden; background: var(--sunken);
  border: 1px solid var(--line); box-shadow: var(--shadow-card);
  transition: transform var(--d-base) var(--ease), box-shadow var(--d-base) var(--ease);
}
.card:active .poster { transform: scale(0.98); }
@media (hover: hover) { .card:hover .poster { transform: translateY(-2px); box-shadow: var(--shadow-float); } }
.card:focus-visible .poster { outline: 2px solid var(--ink); outline-offset: 3px; }
.card .poster img { display: block; width: 100%; height: 100%; object-fit: cover; }
.card .poster .ph { position: absolute; inset: 0; display: grid; place-items: center; color: var(--ink-3); }
.card .dur { position: absolute; inset-inline-end: 8px; bottom: 8px; padding: 1px 7px; border-radius: 6px; background: rgba(20, 17, 24, 0.72); color: #fff; font-size: 12px; font-weight: 600; }
.card h3 { margin: 8px 2px 0; font-size: var(--t-body); font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .meta { margin: 2px 2px 0; color: var(--ink-3); font-size: var(--t-caption); }
.card .tagline { margin: 4px 2px 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; }
.card .tagline span { font-size: 12px; color: var(--ink-2); background: var(--sunken); border-radius: 6px; padding: 0 6px; }
.card .check { position: absolute; top: 6px; inset-inline-start: 6px; z-index: 2; width: 28px; height: 28px; border-radius: 50%; border: 2px solid #fff; background: rgba(20,17,24,.35); display: none; place-items: center; color: #fff; }
.selecting .card .check { display: grid; }
.card.selected .check { background: var(--ink); border-color: var(--accent); }
.card.selected .poster { outline: 3px solid var(--ink); outline-offset: 2px; }

.empty { text-align: center; padding: 56px 16px; color: var(--ink-2); }
.empty h2 { color: var(--ink); font-size: var(--t-title3); margin: 0 0 6px; }
.empty p { margin: 0 auto 18px; max-width: 30ch; }

/* ---------- floating upload + bottom bar (phone) ---------- */
.fab { position: fixed; z-index: 20; left: 50%; transform: translateX(-50%); bottom: calc(76px + var(--safe-b)); }
.tabbar {
  position: fixed; z-index: 15; inset-inline: 0; bottom: 0; display: grid; grid-template-columns: repeat(3, 1fr);
  padding: 6px 8px calc(6px + var(--safe-b)); border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: saturate(1.4) blur(18px); -webkit-backdrop-filter: saturate(1.4) blur(18px);
}
.tabbar a { display: grid; justify-items: center; gap: 2px; min-height: 48px; padding-top: 4px; color: var(--ink-3); text-decoration: none; font-size: 11px; font-weight: 500; }
.tabbar a[aria-current="page"] { color: var(--ink); }
.tabbar a[aria-current="page"] svg { stroke-width: 2.1; }

.selectbar { position: fixed; z-index: 25; inset-inline: 12px; bottom: calc(12px + var(--safe-b)); display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 12px; border-radius: 18px; background: var(--tray); color: var(--tray-ink); box-shadow: var(--shadow-float); }
.selectbar b { flex: 1; padding-inline-start: 6px; font-weight: 600; }
.selectbar .btn { background: transparent; color: var(--tray-ink); border-color: rgba(255,255,255,.18); min-height: 40px; }
.selectbar .btn.danger { color: #FF8A80; }

/* ---------- upload tray ---------- */
.tray { position: fixed; z-index: 30; inset-inline: 12px; bottom: calc(140px + var(--safe-b)); max-height: 46dvh; overflow-y: auto; border-radius: 18px; background: var(--tray); color: var(--tray-ink); box-shadow: var(--shadow-float); }
.tray header { position: sticky; top: 0; display: flex; align-items: center; gap: 8px; padding: 12px 8px 8px 16px; background: var(--tray); }
.tray header b { flex: 1; font-weight: 600; }
.tray header .icon-btn { color: var(--tray-ink); width: 36px; height: 36px; }
.tray.min .rows { display: none; }
.up { padding: 10px 16px 12px; border-top: 1px solid rgba(255, 255, 255, 0.08); }
.up-top { display: flex; align-items: center; gap: 8px; }
.up-name { flex: 1; font-weight: 500; overflow-wrap: anywhere; line-height: 1.35; }
.up .icon-btn { color: var(--tray-ink); width: 36px; height: 36px; }
.bar { height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.14); overflow: hidden; margin-top: 8px; }
.bar i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 3px; transition: width var(--d-slow) linear; transform-origin: right; }
.up-info { display: flex; justify-content: space-between; gap: 8px; margin-top: 6px; color: var(--tray-ink-2); font-size: 12px; }
.up.done .bar i { background: #7BE3A4; }
.up.error .up-info { color: #FF9C94; }

/* ---------- modal (always centred) ---------- */
.modal-root { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 12px; background: var(--scrim); animation: fade var(--d-base) var(--ease); }
.modal {
  width: min(560px, 100%); max-height: calc(100dvh - 24px); overflow-y: auto; border-radius: var(--r-modal);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-float);
  animation: rise var(--d-slow) var(--ease);
}
.modal.wide { width: min(980px, 100%); }
.modal-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 8px; padding: 14px 10px 10px 18px; background: var(--surface); }
.modal-head h2 { flex: 1; margin: 0; font-size: var(--t-title3); font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.modal-body { padding: 4px 18px 18px; display: grid; gap: 14px; }
.modal-foot { position: sticky; bottom: 0; display: flex; gap: 10px; justify-content: flex-start; padding: 12px 18px calc(14px + var(--safe-b)); background: var(--surface); border-top: 1px solid var(--line); }
.modal-foot .btn { flex: 1; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(12px) scale(0.98); } }

.player { background: #000; border-radius: 14px; overflow: hidden; }
.player video { display: block; width: 100%; max-height: 62dvh; background: #000; }
.facts { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--ink-3); font-size: var(--t-caption); margin: 0; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.actions .btn { min-height: 40px; font-size: var(--t-caption); padding: 0 14px; }
.share-box { display: flex; gap: 8px; align-items: center; padding: 10px 12px; border-radius: var(--r-field); background: var(--surface-2); border: 1px solid var(--line); }
.share-box code { flex: 1; font-family: var(--font); font-size: var(--t-caption); direction: ltr; overflow-wrap: anywhere; }

.tag-input { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: var(--tap); padding: 6px 8px; border-radius: var(--r-field); border: 1px solid var(--line-strong); background: var(--surface-2); }
.tag-input:focus-within { border-color: var(--ink); background: var(--surface); }
.tag-input input { flex: 1; min-width: 120px; border: 0; background: transparent; font-size: 16px; padding: 4px; }
.tag-input input:focus { outline: none; }
.tag { display: inline-flex; align-items: center; gap: 2px; padding: 2px 4px 2px 10px; border-radius: 999px; background: var(--ink); color: var(--paper); font-size: var(--t-caption); }
.tag button { border: 0; background: none; color: inherit; width: 22px; height: 22px; display: grid; place-items: center; opacity: .8; }
.tag button svg { width: 14px; height: 14px; }
.suggest { display: flex; flex-wrap: wrap; gap: 6px; }
.suggest button { border: 1px dashed var(--line-strong); background: none; border-radius: 999px; padding: 2px 10px; font-size: var(--t-caption); color: var(--ink-2); }

.file-list { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.file-list li { display: flex; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: var(--r-field); background: var(--surface-2); border: 1px solid var(--line); font-size: var(--t-caption); }
.file-list li span:first-child { overflow-wrap: anywhere; font-weight: 500; }
.dropzone { display: grid; place-items: center; gap: 8px; text-align: center; padding: 28px 16px; border-radius: 16px; border: 1.5px dashed var(--line-strong); background: var(--surface-2); color: var(--ink-2); }
.dropzone.over { border-color: var(--ink); background: var(--sunken); }
.dropzone b { color: var(--ink); font-size: var(--t-callout); }

.tree { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.tree button { width: 100%; text-align: start; display: flex; align-items: center; gap: 8px; min-height: var(--tap); border: 0; border-radius: 10px; background: none; padding: 0 10px; }
.tree button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.tree button:disabled { opacity: .4; }

.disk { display: grid; gap: 6px; font-size: var(--t-caption); color: var(--ink-2); }
.disk .meter { height: 6px; border-radius: 3px; background: var(--sunken); overflow: hidden; }
.disk .meter i { display: block; height: 100%; background: var(--ink-2); }
.disk.low { color: var(--danger); }
.disk.low .meter i { background: var(--danger); }
.disk-line { margin: 28px 0 0; }

.toast { position: fixed; z-index: 60; left: 50%; transform: translateX(-50%); bottom: calc(150px + var(--safe-b)); display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 18px; border-radius: 14px; background: var(--tray); color: var(--tray-ink); box-shadow: var(--shadow-float); animation: rise var(--d-base) var(--ease); max-width: calc(100% - 24px); }
.toast button { border: 0; background: rgba(255,255,255,.12); color: var(--accent); font-weight: 700; border-radius: 10px; min-height: 36px; padding: 0 12px; }

.trash-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r-row); background: var(--surface); border: 1px solid var(--line); margin-bottom: 8px; }
.trash-row img, .trash-row .thumb { width: 72px; aspect-ratio: 16/9; object-fit: cover; border-radius: 8px; background: var(--sunken); flex: none; }
.trash-row div { flex: 1; min-width: 0; }
.trash-row b { display: block; overflow-wrap: anywhere; font-weight: 600; }
.trash-row small { color: var(--ink-3); }

/* ---------- desktop: sidebar + wider grid ---------- */
@media (min-width: 900px) {
  .shell { display: grid; grid-template-columns: var(--sidebar) 1fr; }
  .sidebar {
    display: flex; flex-direction: column; gap: 6px; position: sticky; top: 0; height: 100dvh; overflow-y: auto;
    padding: 20px 14px; border-inline-end: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 55%, transparent);
  }
  .brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; font-weight: 700; font-size: var(--t-callout); }
  .brand .mark { width: 34px; height: 34px; border-radius: 10px; }
  .brand .mark svg.i { width: 20px; height: 20px; }
  .side-upload { margin: 0 4px 14px; }
  .nav a, .nav button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 38px; padding: 0 10px; border-radius: 10px; color: var(--ink-2); text-decoration: none; border: 0; background: none; text-align: start; font-weight: 500; }
  .nav a:hover, .nav button:hover { background: var(--sunken); color: var(--ink); }
  .nav a[aria-current="page"] { background: var(--ink); color: var(--paper); }
  .nav a.drop { outline: 2px solid var(--ink); }
  .nav svg.i { width: 19px; height: 19px; }
  .nav .n { margin-inline-start: auto; color: inherit; opacity: .6; font-size: var(--t-caption); }
  .nav-sub { padding-inline-start: 18px; }
  .side-gap { height: 14px; }
  .side-label { margin: 16px 10px 4px; font-size: var(--t-caption); color: var(--ink-3); font-weight: 600; }
  .sidebar .disk { margin-top: auto; padding: 16px 8px 4px; }
  .main { padding: 0 32px 64px; width: 100%; }
  .topbar { margin: 0 -32px; padding: 14px 32px 0; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 26px 20px; }
  .fab, .tabbar, .disk-line { display: none; }
  .tray { inset-inline: auto 24px; width: 400px; bottom: 24px; }
  .selectbar { inset-inline: auto; left: 50%; transform: translateX(-50%); width: min(620px, calc(100% - 340px)); margin-right: calc(var(--sidebar) / 2); }
  .toast { bottom: 28px; }
  .modal.wide .modal-body { grid-template-columns: 1.35fr 1fr; align-items: start; }
}

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