@font-face{font-family:'Nunito';font-style:normal;font-weight:400 900;font-display:swap;src:url(/static/fonts/nunito-cyrillic-ext.woff2) format('woff2');unicode-range:U+0460-052F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}
@font-face{font-family:'Nunito';font-style:normal;font-weight:400 900;font-display:swap;src:url(/static/fonts/nunito-cyrillic.woff2) format('woff2');unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}
@font-face{font-family:'Nunito';font-style:normal;font-weight:400 900;font-display:swap;src:url(/static/fonts/nunito-latin-ext.woff2) format('woff2');unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}
@font-face{font-family:'Nunito';font-style:normal;font-weight:400 900;font-display:swap;src:url(/static/fonts/nunito-latin.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}

:root {
  --sidebar-w: 256px;
  --topbar-h: 56px;
  --on-accent: var(--dreams-ink);
  --sb-thumb: color-mix(in srgb, var(--ink) 22%, transparent);
  --sb-thumb-hover: color-mix(in srgb, var(--ink) 38%, transparent);
  --thumb-bg: color-mix(in srgb, var(--ink) 5%, var(--card));
  --tile-shadow: 0 1px 1px color-mix(in srgb, var(--ink) 10%, transparent), 0 0 1px color-mix(in srgb, var(--ink) 18%, transparent);
}

/* No browser chrome anywhere: thin scrollbars in our tokens, in both themes */
* { scrollbar-width: thin; scrollbar-color: var(--sb-thumb) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { border: 2px solid transparent; border-radius: var(--r-pill); background: var(--sb-thumb) padding-box; }
::-webkit-scrollbar-thumb:hover { background: var(--sb-thumb-hover) padding-box; }
::-webkit-scrollbar-corner { background: transparent; }
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration { -webkit-appearance: none; appearance: none; }

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  background: var(--page-glow);
  color: var(--ink);
  font-family: var(--ff);
  font-size: var(--fs-base);
  line-height: 1.45;
  overflow-x: hidden;
}
a { color: var(--violet-2); text-decoration: none; }
a:hover { color: var(--violet); }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: none; box-shadow: var(--ring); }
[hidden] { display: none !important; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.icon {
  width: 1em; height: 1em; flex: 0 0 auto;
  fill: none; stroke: currentColor; stroke-width: 1.9;
  stroke-linecap: round; stroke-linejoin: round;
}
code, .mono { font-family: var(--ff-mono); }
code { font-size: 0.92em; }

/* Buttons and fields */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 34px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: var(--r-1);
  background: var(--card); color: var(--ink-2);
  font-size: var(--fs-md); font-weight: 700; white-space: nowrap;
  transition: background-color var(--d1) var(--ease), border-color var(--d1) var(--ease);
}
.btn:hover { background: var(--hover-tint); color: var(--ink); }
.btn .icon { font-size: 15px; }
.btn.primary { border-color: transparent; background: var(--violet); color: var(--on-accent); }
.btn.primary:hover { background: var(--violet-2); color: var(--on-accent); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--hover-tint); }
.btn.danger { color: var(--bad); }
.btn.danger:hover { background: var(--bad-bg); }
.btn.danger-fill { border-color: transparent; background: var(--bad); color: var(--on-accent); }
.btn.danger-fill:hover { filter: brightness(1.08); }
.btn[disabled] { opacity: 0.5; cursor: default; }
.icon-btn {
  width: 34px; height: 34px; display: inline-grid; place-items: center; flex: 0 0 auto; padding: 0;
  border: 1px solid transparent; border-radius: var(--r-1);
  background: transparent; color: var(--ico);
}
.icon-btn:hover { background: var(--hover-tint); color: var(--ink); }
.icon-btn .icon { font-size: 17px; }
.icon-btn.danger:hover { color: var(--bad); background: var(--bad-bg); }
.icon-btn.armed, .icon-btn.armed:hover { color: var(--on-accent); background: var(--bad); }
.icon-btn[disabled] { opacity: 0.4; cursor: default; }
.field {
  width: 100%; min-height: 36px; padding: 7px 10px;
  border: 1px solid var(--line); border-radius: var(--r-1);
  background: var(--input-bg); color: var(--ink);
  font-size: var(--fs-md);
}
.field:focus { outline: none; border-color: var(--chip-on-ring); box-shadow: var(--ring); }
.field::placeholder { color: var(--ink-4); }
.field[readonly] { background: var(--card-2); }
.eyebrow {
  margin: 0 0 6px; color: var(--ink-4);
  font-size: var(--fs-cap); font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase;
}
.muted { color: var(--ink-3); }
.small { font-size: var(--fs-sm); }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row.nowrap { flex-wrap: nowrap; }
.row.center { justify-content: center; }
.grow { flex: 1; min-width: 0; }
.stack { display: grid; gap: 10px; }
.stack.tight { gap: 6px; }
.notice { margin: 0; padding: 10px 12px; border-radius: var(--r-1); font-size: var(--fs-md); }
.notice.bad { color: var(--bad); background: var(--bad-bg); }
.notice.warn { color: var(--warn); background: var(--warn-bg); }
.field-label { display: grid; gap: 6px; font-size: var(--fs-sm); font-weight: 700; color: var(--ink-3); }
.two-lines { display: grid; gap: 1px; min-width: 0; }
.two-lines > * { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.two-lines small { font-size: var(--fs-xs); }
.never {
  display: inline-block; padding: 0 6px; border-radius: var(--r-pill); background: var(--none-bg);
  color: var(--ink-3); font-size: var(--fs-xs); font-weight: 600; white-space: nowrap;
}
.contact { margin: 18px 0 0; color: var(--ink-3); font-size: var(--fs-sm); }

/* Every visible checkbox and radio is drawn by us */
input[type="checkbox"]:not(.sr-only), input[type="radio"]:not(.sr-only) {
  appearance: none; -webkit-appearance: none;
  width: 18px; height: 18px; flex: 0 0 auto; margin: 0;
  display: inline-grid; place-items: center;
  border: 1.5px solid var(--line-strong); border-radius: 5px; background: var(--input-bg);
  cursor: pointer; vertical-align: middle;
}
input[type="radio"]:not(.sr-only) { border-radius: var(--r-pill); }
input[type="checkbox"]:not(.sr-only)::after {
  content: ""; width: 9px; height: 5px; margin-top: -2px;
  border-left: 2px solid var(--on-accent); border-bottom: 2px solid var(--on-accent);
  transform: rotate(-45deg); opacity: 0;
}
input[type="checkbox"]:not(.sr-only):checked { border-color: var(--violet); background: var(--violet); }
input[type="checkbox"]:not(.sr-only):checked::after { opacity: 1; }
input[type="checkbox"]:focus-visible, input[type="radio"]:focus-visible { box-shadow: var(--ring); }

.choice { display: flex; flex-wrap: wrap; gap: 6px; }
.choice label {
  position: relative; display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: var(--r-pill); cursor: pointer;
  font-size: var(--fs-md); font-weight: 700; color: var(--ink-2);
}
.choice label span { display: inline-flex; align-items: center; gap: 6px; }
.choice input:not(.sr-only) { position: absolute; opacity: 0; pointer-events: none; }
.choice label:has(input:checked) { border-color: var(--chip-on-ring); background: var(--chip-on-bg); color: var(--badge-ink); }
.choice label:has(input:focus-visible) { box-shadow: var(--ring); }

.tone-violet { --tone-g: var(--t-violet); }
.avatar {
  width: 28px; height: 28px; display: inline-grid; place-items: center; flex: 0 0 auto;
  border-radius: var(--r-pill); background: var(--tone-g, var(--t-violet));
  color: var(--on-accent); font-size: 10px; font-weight: 800; letter-spacing: 0.02em;
}
.avatar.sm { width: 24px; height: 24px; font-size: 9px; }
.avatar.lg { width: 32px; height: 32px; font-size: 11px; }
.avatar.round-mark { background: var(--none-bg); color: var(--ink-2); }
.avatar.round-mark .icon { font-size: 14px; }

/* Shell */
.app-shell {
  min-height: 100dvh;
  display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
}
.sidebar {
  position: sticky; top: 0; height: 100dvh; z-index: var(--z-drawer);
  display: flex; flex-direction: column; gap: 4px;
  padding: 14px 12px 12px;
  border-right: 1px solid var(--line); background: var(--card);
  overflow-y: auto;
}
.brand {
  display: flex; align-items: center; gap: 10px; padding: 2px 4px 12px;
  color: var(--ink); font-size: var(--fs-lg); font-weight: 800; letter-spacing: -0.02em;
}
.brand:hover { color: var(--ink); }
.brand-mark {
  width: 28px; height: 28px; flex: 0 0 auto; display: inline-grid; place-items: center;
  border-radius: 7px; background: var(--g-brand); color: var(--on-accent);
}
.brand-mark .icon { font-size: 16px; stroke-width: 2.2; }
.nav { display: grid; gap: 2px; }
.nav a {
  min-height: 36px; display: flex; align-items: center; gap: 10px; padding: 0 10px;
  border-radius: var(--r-1); color: var(--ink-2); font-size: var(--fs-md); font-weight: 700;
}
.nav a:hover { background: var(--hover-tint); color: var(--ink); }
.nav a.active { color: var(--badge-ink); background: var(--badge-bg); }
.nav .icon { font-size: 16px; color: var(--ico-soft); }
.nav a.active .icon { color: currentColor; }
.nav-search { display: none !important; }
.meter {
  margin-top: auto; display: grid; gap: 6px; padding: 10px 10px 12px;
  color: var(--ink-3); font-size: var(--fs-sm); font-weight: 600;
}
.meter-head { display: flex; align-items: center; gap: 8px; }
.meter-head .icon { font-size: 15px; color: var(--ico); }
.meter-bar { display: block; height: 6px; border-radius: var(--r-pill); background: var(--none-bg); overflow: hidden; }
.meter-bar span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--g-brand); }
.meter-bar span.high { background: var(--warn); }
.profile {
  margin-top: auto; display: flex; align-items: center; gap: 8px; padding: 8px;
  border-radius: var(--r-2); background: var(--card-2);
}
.meter:not([hidden]) + .profile { margin-top: 0; }
.profile-copy { display: grid; min-width: 0; flex: 1; }
.profile-copy b { overflow: hidden; font-size: var(--fs-sm); text-overflow: ellipsis; white-space: nowrap; }
.profile-copy small { color: var(--ink-4); font-size: var(--fs-cap); }
.profile form { margin: 0; }
@media (min-width: 721px) { .profile .icon-btn { width: 30px; height: 30px; } }
.profile .icon-btn.active { color: var(--badge-ink); background: var(--badge-bg); }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: var(--z-sticky);
  min-height: var(--topbar-h); display: flex; align-items: center; gap: 12px;
  padding: 10px 20px; border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--card) 88%, transparent);
  backdrop-filter: blur(10px);
}
.menu-toggle { display: none; }
.theme-toggle .theme-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .theme-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .theme-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .theme-sun { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .theme-moon { display: block; }
}
.page { width: 100%; max-width: 1280px; margin: 0 auto; padding: 22px 24px 120px; outline: none; }
.loading { padding: 24px 0; }
.page-note { margin: -8px 0 14px; font-size: var(--fs-sm); }

/* Breadcrumbs */
.crumbs { flex: 1; min-width: 0; display: flex; align-items: center; gap: 2px; overflow: hidden; }
.crumb {
  min-width: 0; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  padding: 4px 6px; border: 0; border-radius: var(--r-1); background: none;
  color: var(--ink-3); font-size: var(--fs-md); font-weight: 700;
}
a.crumb:hover, button.crumb:hover { background: var(--hover-tint); color: var(--ink); }
.crumb.current { color: var(--ink); font-size: var(--fs-base); font-weight: 800; flex-shrink: 1; max-width: 100%; }
.crumb-sep { color: var(--ink-4); font-size: 13px; }

.top-search { position: relative; display: flex; align-items: center; width: min(300px, 32vw); flex: 0 0 auto; margin: 0; }
.top-search > .icon { position: absolute; left: 10px; font-size: 15px; color: var(--ink-4); pointer-events: none; }
.top-search .field { min-height: 34px; padding-left: 32px; padding-right: 30px; }
.key-hint {
  position: absolute; right: 8px; min-width: 18px; height: 18px; display: inline-grid; place-items: center;
  border: 1px solid var(--line); border-radius: 5px; color: var(--ink-4);
  font-family: var(--ff-mono); font-size: var(--fs-xs); pointer-events: none;
}
.top-search .field:focus ~ .key-hint { display: none; }
.search-link { display: none; }

/* Page head and toolbar */
.folder-head { display: flex; align-items: center; gap: 12px 16px; flex-wrap: wrap; margin-bottom: 16px; }
.folder-head h1 {
  flex: 1 1 200px; min-width: 0; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: var(--fs-2xl); font-weight: 800; letter-spacing: -0.03em;
}
.folder-head .crumbs { flex: 1 1 200px; }
.toolbar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.toolbar-gap { width: 6px; }
.tb-more { display: none; }
.toolbar .sort-select { width: 160px; flex: 0 0 auto; }
.sort-select .dselect-button { min-height: 34px; }
.section-title { margin: 22px 0 10px; color: var(--ink-3); font-size: var(--fs-sm); font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }
.root-section:first-of-type .section-title { margin-top: 4px; }

/* Selection bar */
.selbar {
  position: sticky; top: calc(var(--topbar-h) + 8px); z-index: calc(var(--z-sticky) - 1);
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 0 12px; padding: 6px 8px;
  border: 1px solid var(--chip-on-ring); border-radius: var(--r-2);
  background: color-mix(in srgb, var(--card) 92%, var(--violet)); box-shadow: var(--tile-shadow);
}
.selbar b { font-size: var(--fs-md); }
.selbar .toolbar-gap { flex: 1; }

/* Items: tiles and rows */
.items.grid { display: grid; gap: 14px; }
.grid-part { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 14px; }
.grid-part.folders { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.item { position: relative; min-width: 0; }
.items.grid .item {
  border: 1px solid var(--line); border-radius: var(--r-3); background: var(--card);
  box-shadow: var(--tile-shadow); transition: box-shadow var(--d1) var(--ease), transform var(--d1) var(--ease);
}
.items.grid .item:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.items.grid .item.selected { border-color: var(--violet); box-shadow: 0 0 0 1px var(--violet); }
.item-main { display: grid; min-width: 0; color: var(--ink); border-radius: inherit; }
.item-main:hover { color: var(--ink); }
.items.grid .item-copy { display: grid; gap: 2px; padding: 9px 12px 11px; min-width: 0; }
.item-name {
  min-width: 0; overflow: hidden; font-size: var(--fs-md); font-weight: 700; line-height: 1.35; overflow-wrap: anywhere;
}
.items.grid .item-name { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; min-height: 2.7em; }
.item-sub { min-width: 0; overflow: hidden; color: var(--ink-4); font-size: var(--fs-xs); text-overflow: ellipsis; white-space: nowrap; }
.item-thumb {
  position: relative; display: grid; place-items: center; overflow: hidden;
  background: var(--thumb-bg); color: var(--ink-3);
}
.item-thumb.large { aspect-ratio: 4 / 3; border-radius: var(--r-3) var(--r-3) 0 0; }
.item-thumb.large .icon { font-size: 38px; stroke-width: 1.4; }
.item-thumb.small { width: 36px; height: 36px; flex: 0 0 auto; border-radius: var(--r-1); }
.item-thumb.small .icon { font-size: 18px; }
.item-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.item-thumb.kind-folder { background: color-mix(in srgb, var(--violet) 12%, var(--card)); color: var(--violet-2); }
.item-thumb.kind-video { color: var(--s-blue); }
.item-thumb.kind-image { color: var(--s-teal); }
.item-thumb.kind-audio { color: var(--s-amber); }
.item-thumb.kind-archive { color: var(--s-indigo); }
.item-thumb.kind-app { color: var(--s-green); }
.item-thumb.kind-pdf { color: var(--s-red); }
.item-thumb.kind-html { color: var(--s-rose); }
.item-thumb.has-image { background: var(--none-bg); }
.play-mark {
  position: absolute; right: 8px; bottom: 8px; width: 26px; height: 26px; display: grid; place-items: center;
  border-radius: var(--r-pill); background: color-mix(in srgb, var(--dreams-obsidian) 62%, transparent); color: var(--dreams-ink);
}
.items.grid .play-mark .icon { font-size: 12px; stroke-width: 2.4; fill: currentColor; }
/* folders in the grid are compact: an icon and a name, like the left column of a drive */
.items.grid .item.is-folder .item-main { grid-template-columns: 44px minmax(0, 1fr); align-items: center; gap: 12px; padding: 10px 40px 10px 10px; }
.items.grid .item.is-folder .item-thumb.large { width: 44px; height: 44px; aspect-ratio: auto; border-radius: var(--r-2); }
.items.grid .item.is-folder .item-thumb.large .icon { font-size: 22px; stroke-width: 1.9; }
.items.grid .item.is-folder .item-copy { padding: 0; }
.items.grid .item.is-folder .item-name { min-height: 0; -webkit-line-clamp: 1; }
.items.grid .item.is-folder .item-check { top: 50%; left: 23px; margin-top: -9px; }
.items.grid .item.is-folder .item-more { top: 50%; margin-top: -15px; }
.item-check { position: absolute; z-index: 1; }
.items.grid .item-check { top: 9px; left: 9px; opacity: 0; box-shadow: 0 0 0 3px color-mix(in srgb, var(--card) 70%, transparent); }
.items.grid .item:hover .item-check, .items.grid .item-check:focus-visible, .items.grid .item-check:checked,
.items.grid.selecting .item-check { opacity: 1; }
.item-more { position: absolute; }
.items.grid .item-more {
  top: 6px; right: 6px; width: 30px; height: 30px; opacity: 0;
  background: color-mix(in srgb, var(--card) 88%, transparent); color: var(--ink-2);
}
.items.grid .item:hover .item-more, .items.grid .item-more:focus-visible, .item-more[aria-expanded="true"] { opacity: 1; }
.items.grid .item-dl { opacity: 1; }
@media (hover: none) {
  .items.grid .item-more { opacity: 1; }
}

.items.rows { display: grid; border: 1px solid var(--line); border-radius: var(--r-3); background: var(--card); overflow: hidden; }
.items.rows .item, .rows-head {
  display: grid; align-items: center; gap: 12px; min-height: 52px; padding: 6px 10px 6px 12px;
  grid-template-columns: 22px minmax(0, 1fr) 90px 110px minmax(0, 170px) 34px;
  border-top: 1px solid var(--line);
}
.items.rows.no-select .item, .no-select .rows-head { grid-template-columns: minmax(0, 1fr) 90px 110px minmax(0, 170px) 34px; }
.items.rows.no-authors .item, .no-authors .rows-head { grid-template-columns: 22px minmax(0, 1fr) 90px 110px 34px; }
.items.rows.no-select.no-authors .item, .no-select.no-authors .rows-head { grid-template-columns: minmax(0, 1fr) 90px 110px 34px; }
.rows-head { min-height: 36px; border-top: 0; color: var(--ink-4); font-size: var(--fs-xs); font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; }
.items.rows .item:hover { background: var(--hover-tint); }
.items.rows .item.selected { background: var(--chip-on-bg); }
.items.rows .item-check, .items.rows .item-more { position: static; }
.items.rows .item-main { display: flex; align-items: center; gap: 12px; min-height: 40px; }
.items.rows .item-copy { display: grid; min-width: 0; }
.items.rows .item-name { white-space: nowrap; text-overflow: ellipsis; }
.items.rows .item-sub { display: none; }
.col { min-width: 0; overflow: hidden; color: var(--ink-3); font-size: var(--fs-sm); text-overflow: ellipsis; white-space: nowrap; }
.col-size { text-align: right; font-variant-numeric: tabular-nums; }

/* Drop overlay over the folder */
.drop-overlay {
  position: fixed; inset: 0; z-index: var(--z-sheet); display: grid; place-items: center; padding: 24px;
  background: color-mix(in srgb, var(--violet) 14%, var(--scrim)); pointer-events: none;
}
.drop-card {
  display: grid; justify-items: center; gap: 8px; width: min(440px, 100%); padding: 32px 24px; text-align: center;
  border: 2px dashed var(--violet); border-radius: var(--r-4); background: var(--card); box-shadow: var(--shadow);
}
.drop-card b { font-size: var(--fs-lg); overflow-wrap: anywhere; }
.drop-card small { color: var(--ink-3); }

.empty {
  display: grid; justify-items: center; gap: 10px; padding: 48px 24px; text-align: center;
  border: 1px dashed var(--line-strong); border-radius: var(--r-4); background: var(--card);
}
.empty h2 { margin: 6px 0 0; font-size: var(--fs-xl); }
.empty p { max-width: 460px; margin: 0; color: var(--ink-3); }
.empty-mark {
  width: 56px; height: 56px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 16px;
  background: var(--g-brand); color: var(--on-accent);
}
.empty-mark .icon { font-size: 26px; stroke-width: 2.1; }
.empty-mark.small { width: 44px; height: 44px; border-radius: 12px; }
.empty-mark.small .icon { font-size: 22px; }

/* Popovers and menus */
.pop {
  position: fixed; z-index: calc(var(--z-sheet) + 2); width: 260px; max-width: calc(100vw - 16px);
  max-height: min(70dvh, 560px); overflow-y: auto;
  padding: 6px; border: 1px solid var(--line); border-radius: var(--r-3);
  background: var(--card); box-shadow: var(--shadow);
}
.pop-head { display: flex; align-items: center; gap: 8px; margin: 2px 2px 6px 8px; }
.pop-head b { flex: 1; font-size: var(--fs-md); }
.pop-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1px; }
.pop-item {
  min-height: 36px; display: flex; align-items: center; gap: 10px; padding: 4px 10px; width: 100%;
  border: 0; border-radius: var(--r-1); background: transparent; text-align: left;
  font-size: var(--fs-md); color: var(--ink-2);
}
.pop-item .icon { font-size: 16px; color: var(--ico); }
.pop-item:hover, .pop-item:focus-visible { background: var(--hover-tint); color: var(--ink); }
.pop-item.danger, .pop-item.danger .icon { color: var(--bad); }
.pop-rule { height: 1px; margin: 4px 6px; background: var(--line); }
.pop-item .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Dialogs */
.dialog {
  width: min(480px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 0;
  border: 1px solid var(--line); border-radius: var(--r-4);
  background: var(--card); color: var(--ink); box-shadow: var(--shadow);
}
.dialog.wide { width: min(640px, calc(100vw - 32px)); }
.dialog.narrow { width: min(420px, calc(100vw - 32px)); }
.dialog::backdrop { background: var(--scrim); }
.dialog-form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; padding: 18px 20px 20px; margin: 0; }
.dialog-form > * { min-width: 0; }
.dialog-head { display: flex; align-items: center; gap: 10px; }
.dialog-head h2 { flex: 1; min-width: 0; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-xl); }
.dialog-head .icon-btn { margin-right: -8px; }
.dialog .actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.dialog-text { margin: 0; color: var(--ink-2); overflow-wrap: anywhere; }

.picker-crumbs { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; min-height: 32px; }
.picker-list {
  display: grid; gap: 1px; max-height: min(360px, 50dvh); overflow-y: auto; padding: 4px;
  border: 1px solid var(--line); border-radius: var(--r-2); background: var(--card-2);
}
.picker-row {
  min-height: 38px; display: flex; align-items: center; gap: 10px; padding: 0 10px;
  border: 0; border-radius: var(--r-1); background: transparent; color: var(--ink-2); text-align: left;
}
.picker-row .icon { font-size: 16px; color: var(--violet-2); }
.picker-row .icon:last-child { color: var(--ink-4); }
.picker-row:hover { background: var(--hover-tint); color: var(--ink); }
.picker-row[disabled] { opacity: 0.45; cursor: default; }
.picker-row .grow { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker-note { margin: 0; padding: 10px; font-size: var(--fs-sm); }

.access-summary, .access-mine { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--ink-2); font-weight: 700; }
.access-summary .icon, .access-mine .icon { color: var(--ico); font-size: 16px; }
.add-person { display: flex; gap: 8px; }
.add-person .field { flex: 1; }
.add-person .level-select { width: 150px; flex: 0 0 auto; }
.level-label { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.level-word { color: var(--ink-3); font-size: var(--fs-sm); font-weight: 700; }
.people-results { display: grid; gap: 1px; max-height: 240px; overflow-y: auto; padding: 4px; border: 1px solid var(--line); border-radius: var(--r-2); }
.grant-list { display: grid; }
.grant-row { display: flex; align-items: center; gap: 10px; min-height: 48px; border-top: 1px solid var(--line); }
.grant-list .grant-row:first-child { border-top: 0; }
.grant-who { flex: 1; min-width: 0; display: grid; }
.grant-who b, .grant-who small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grant-who b { font-size: var(--fs-md); }
.grant-who small { color: var(--ink-4); font-size: var(--fs-xs); }
.grant-row .level-select { width: 150px; flex: 0 0 auto; }
.grant-row .level-select .dselect-button { min-height: 32px; }
.grant-level { color: var(--ink-3); font-size: var(--fs-sm); font-weight: 700; }
.grant-group .eyebrow { margin-top: 6px; }

.share-form { display: flex; gap: 10px; align-items: start; }
.field-hint { color: var(--ink-4); font-size: var(--fs-xs); font-weight: 600; }
.share-form .field-label:first-child { width: 150px; flex: 0 0 auto; }
.share-hint { margin: -4px 0 0; }
.share-made .field { flex: 1; min-width: 0; }
.share-list { display: grid; }
.share-row { display: flex; align-items: center; gap: 10px; min-height: 52px; border-top: 1px solid var(--line); }
.share-list > .share-row:first-child { border-top: 0; }
.share-kind { width: 32px; height: 32px; display: grid; place-items: center; flex: 0 0 auto; border-radius: var(--r-1); background: var(--badge-bg); color: var(--badge-ink); }
.share-copy { display: grid; min-width: 0; }
.share-copy b, .share-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.share-copy b { font-size: var(--fs-md); }
.share-copy small { color: var(--ink-4); font-size: var(--fs-xs); }
.share-node { display: inline-flex; align-items: center; gap: 6px; min-width: 0; color: var(--ink-3); font-size: var(--fs-xs); font-weight: 700; }
.share-node span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.share-row.is-revoked, .share-row.is-expired, .share-row.is-paused { opacity: 0.55; }

/* Pages: lists of rows */
.list-panel { display: grid; border: 1px solid var(--line); border-radius: var(--r-3); background: var(--card); overflow: hidden; }
.list-panel:has(> .empty) { border: 0; background: none; }
.list-panel > .share-row, .list-panel > .list-row { padding: 6px 12px; }
.list-row { display: flex; align-items: center; gap: 12px; min-height: 54px; border-top: 1px solid var(--line); }
.list-panel > .list-row:first-child, .list-panel > .share-row:first-child { border-top: 0; }
.list-row.is-off { opacity: 0.55; }
.list-panel > p { margin: 0; padding: 14px; }
.kind-mark { color: var(--ink-3); }
.purge { white-space: nowrap; }
.search-hit { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; color: var(--ink); }
.search-hit:hover { color: var(--ink); }
.search-hit:hover b { text-decoration: underline; }
.list-panel > .audit-row { align-items: flex-start; padding-top: 10px; padding-bottom: 10px; }
.audit-time { width: 96px; flex: 0 0 auto; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.audit-who { width: 160px; flex: 0 0 auto; display: grid; justify-items: start; gap: 2px; min-width: 0; font-size: var(--fs-md); font-weight: 700; }
.audit-name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.key-badge { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; }
.key-badge span { overflow: hidden; text-overflow: ellipsis; }
.key-badge .icon { font-size: 11px; }
.audit .two-lines small { white-space: normal; overflow-wrap: anywhere; }
.audit-ip { font-family: var(--ff-mono); font-size: var(--fs-xs); }
.audit + .row { margin-top: 14px; }
.panel { margin-bottom: 14px; padding: 16px; border: 1px solid var(--line); border-radius: var(--r-3); background: var(--card); display: grid; gap: 10px; }
.key-form .field { max-width: 420px; }
.key-options .choice label { min-height: 30px; font-size: var(--fs-sm); }

/* Restore bar: a queue lost with a reload */
.restore-host { display: grid; gap: 8px; width: 100%; }
#restore { max-width: 1280px; margin: 14px auto 0; padding: 0 24px; }
.share-main .restore-host { margin: 0 0 12px; }
.restore-bar {
  display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 14px;
  border: 1px solid color-mix(in srgb, var(--warn) 45%, transparent); border-radius: var(--r-2);
  background: var(--warn-bg); color: var(--ink);
}
.restore-bar > .icon { color: var(--warn); font-size: 18px; }
.restore-bar .grow { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: var(--fs-md); }
.restore-bar .btn { min-height: 32px; }

/* Upload panel, lower right */
.up-panel {
  position: fixed; right: 20px; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); z-index: var(--z-pop);
  width: min(420px, calc(100vw - 32px)); display: grid;
  border: 1px solid var(--line); border-radius: var(--r-3); background: var(--card); box-shadow: var(--shadow);
  overflow: hidden;
}
.up-head { display: flex; align-items: center; gap: 4px; padding: 8px 6px 8px 12px; }
.up-icon { width: 30px; height: 30px; display: grid; place-items: center; flex: 0 0 auto; margin-right: 6px; border-radius: var(--r-1); background: var(--badge-bg); color: var(--badge-ink); }
.up-panel.is-done .up-icon { background: var(--ok-bg); color: var(--ok); }
.up-panel.is-errors .up-icon, .up-panel.is-offline .up-icon, .up-panel.is-busy .up-icon, .up-panel.is-paused .up-icon { background: var(--warn-bg); color: var(--warn); }
.up-sum { flex: 1; min-width: 0; display: grid; }
.up-title { font-size: var(--fs-md); }
.up-line { overflow: hidden; color: var(--ink-3); font-size: var(--fs-xs); text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.up-head .icon-btn { width: 30px; height: 30px; }
.up-bar { height: 3px; background: var(--none-bg); }
.up-bar span { display: block; width: 0; height: 100%; background: var(--violet); transition: width var(--d2) var(--ease); }
.up-panel.is-done .up-bar span { background: var(--ok); }
.up-panel.is-paused .up-bar span, .up-panel.is-offline .up-bar span, .up-panel.is-busy .up-bar span { background: var(--warn); }
.up-list { max-height: min(46dvh, 380px); overflow-y: auto; margin: 0; padding: 4px 0; list-style: none; border-top: 1px solid var(--line); }
.up-row { display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 2px 6px 2px 14px; }
.up-row-icon { display: grid; place-items: center; color: var(--ink-4); }
.up-row-icon .icon { font-size: 16px; }
.up-row.is-uploading .up-row-icon { color: var(--violet-2); }
.up-row.is-uploading .up-row-icon .icon { animation: spin 1.1s linear infinite; }
.up-row.is-done .up-row-icon, .up-row.is-skipped .up-row-icon, .up-row-icon.is-done { color: var(--ok); }
.up-row.is-error .up-row-icon, .up-row.is-error .up-row-state { color: var(--bad); }
.up-row.is-waiting .up-row-icon, .up-row.is-waiting .up-row-state { color: var(--warn); }
.up-row-copy { flex: 1; min-width: 0; display: grid; }
.up-name, .up-row-state { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-name { font-size: var(--fs-md); font-weight: 600; }
.up-row-state { color: var(--ink-4); font-size: var(--fs-xs); font-variant-numeric: tabular-nums; }
.up-row .icon-btn { width: 30px; height: 30px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Viewer */
.viewer {
  width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: var(--dreams-obsidian); color: var(--dreams-ink);
}
.viewer::backdrop { background: var(--dreams-obsidian); }
.viewer[open] { display: flex; flex-direction: column; }
.viewer-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px 10px 20px; }
.viewer-title { flex: 1; min-width: 0; display: grid; }
.viewer-name { overflow: hidden; font-size: var(--fs-base); text-overflow: ellipsis; white-space: nowrap; }
.viewer-meta { color: color-mix(in srgb, var(--dreams-ink) 60%, transparent); font-size: var(--fs-xs); }
.viewer-head .icon-btn { color: var(--dreams-ink); }
.viewer-head .icon-btn:hover { background: color-mix(in srgb, var(--dreams-ink) 12%, transparent); color: var(--dreams-ink); }
.viewer-head .btn { border-color: color-mix(in srgb, var(--dreams-ink) 22%, transparent); background: transparent; color: var(--dreams-ink); }
.viewer-head .btn:hover { background: color-mix(in srgb, var(--dreams-ink) 12%, transparent); color: var(--dreams-ink); }
.viewer-body { position: relative; flex: 1; min-height: 0; display: flex; align-items: center; }
.viewer-stage { flex: 1; min-width: 0; height: 100%; display: grid; place-items: center; padding: 8px 64px 24px; overflow: auto; }
.viewer-stage > * { grid-area: 1 / 1; }
.viewer-image, .viewer-video { max-width: 100%; max-height: calc(100dvh - 100px); object-fit: contain; border-radius: var(--r-1); }
.viewer-image { transition: opacity var(--d1) var(--ease); }
.viewer-image.loading { opacity: 0; }
.viewer-spinner { display: grid; place-items: center; color: color-mix(in srgb, var(--dreams-ink) 70%, transparent); pointer-events: none; }
.viewer-spinner .icon { font-size: 36px; animation: spin 1.1s linear infinite; }
.viewer-video { background: #000; }
.viewer-audio { display: grid; justify-items: center; gap: 18px; width: min(520px, 100%); }
.viewer-audio audio { width: 100%; }
.viewer-text {
  width: min(960px, 100%); max-height: calc(100dvh - 130px); margin: 0; padding: 18px; overflow: auto;
  border-radius: var(--r-2); background: var(--card); color: var(--ink);
  font-family: var(--ff-mono); font-size: var(--fs-sm); line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere;
}
.viewer-cut { margin: 8px 0 0; color: color-mix(in srgb, var(--dreams-ink) 60%, transparent); }
.viewer-card {
  display: grid; justify-items: center; gap: 10px; width: min(380px, 100%); padding: 32px 24px; text-align: center;
  border-radius: var(--r-4); background: var(--card); color: var(--ink);
}
.viewer-card b { font-size: var(--fs-lg); }
.viewer-card-mark { width: 64px; height: 64px; display: grid; place-items: center; border-radius: 18px; background: var(--g-brand); color: var(--on-accent); }
.viewer-card-mark .icon { font-size: 30px; }
.viewer-nav {
  position: absolute; top: 50%; z-index: 1; width: 44px; height: 64px; display: grid; place-items: center;
  margin-top: -32px; border: 0; border-radius: var(--r-2);
  background: color-mix(in srgb, var(--dreams-ink) 8%, transparent); color: var(--dreams-ink);
}
.viewer-nav:hover { background: color-mix(in srgb, var(--dreams-ink) 18%, transparent); }
.viewer-nav .icon { font-size: 24px; }
.viewer-nav.prev { left: 10px; }
.viewer-nav.next { right: 10px; }

.toast {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  z-index: calc(var(--z-sheet) + 5); transform: translateX(-50%);
  display: flex; align-items: center; max-width: min(520px, calc(100vw - 32px)); padding: 10px 16px;
  border-radius: var(--r-2); background: var(--ink); color: var(--card);
  font-size: var(--fs-md); font-weight: 700; box-shadow: var(--shadow);
}
.toast-action {
  margin-left: 12px; padding: 3px 10px; border: 0; border-radius: var(--r-1); flex: 0 0 auto;
  background: color-mix(in srgb, var(--card) 18%, transparent); color: inherit; font: inherit;
}
.toast-action:hover { background: color-mix(in srgb, var(--card) 28%, transparent); }

/* Login, 404 and share states */
.login-shell { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.share-page .login-shell { min-height: calc(100dvh - 60px); }
.login-card {
  width: min(420px, 100%); padding: 38px 32px; text-align: center;
  border: 1px solid var(--line); border-radius: 20px; background: var(--card); box-shadow: var(--shadow);
}
.login-card .brand-mark { width: 64px; height: 64px; margin: 0 auto 22px; border-radius: 15px; }
.login-card .brand-mark .icon { font-size: 34px; }
.login-card .muted-mark { background: var(--none-bg); color: var(--ink-3); }
.login-card h1 { margin: 0; font-size: 34px; letter-spacing: -0.04em; }
.login-card h1.small-title { font-size: var(--fs-2xl); letter-spacing: -0.02em; }
.login-card .lead { margin: 12px 0 26px; color: var(--ink-3); line-height: 1.55; }
.login-card .notice { margin: 14px 0 0; }
.login-card .btn { width: 100%; min-height: 44px; }
.login-theme { position: fixed; top: 16px; right: 16px; }

/* Our drop-down list (select.js): never the browser's <select> */
.dselect { position: relative; display: inline-block; min-width: 0; width: 100%; }
.dselect-button { display: flex; align-items: center; gap: 8px; text-align: left; cursor: pointer; }
.dselect-button:disabled { cursor: default; opacity: 0.6; }
.dselect-button .dselect-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dselect-button .dselect-text.placeholder { color: var(--ink-4); }
.dselect-button .icon { font-size: 14px; color: var(--ink-3); transition: transform var(--d1) var(--ease); }
.dselect.open .dselect-button { border-color: var(--chip-on-ring); box-shadow: var(--ring); }
.dselect.open .dselect-button .icon { transform: rotate(180deg); }
.dselect-pop {
  position: fixed; z-index: calc(var(--z-sheet) + 3); max-width: min(420px, calc(100vw - 16px));
  display: grid; gap: 6px; padding: 6px;
  border: 1px solid var(--line); border-radius: var(--r-2); background: var(--card); box-shadow: var(--shadow);
}
.dselect-list { position: relative; max-height: min(320px, 50dvh); overflow-y: auto; margin: 0; padding: 0; list-style: none; outline: none; }
.dselect-list [role="option"] {
  position: relative; min-height: 34px; display: flex; align-items: center; gap: 10px; padding: 4px 10px;
  border-radius: var(--r-1); color: var(--ink-2); font-size: var(--fs-md); cursor: pointer;
}
.dselect-list [role="option"] .grow { flex: 1; min-width: 0; }
.dselect-list [role="option"] small { color: var(--ink-4); font-size: var(--fs-xs); }
.dselect-list [role="option"].active { background: var(--hover-tint); color: var(--ink); }
.dselect-list [role="option"][aria-selected="true"] { color: var(--badge-ink); font-weight: 700; }
.dselect-list [role="option"][aria-selected="true"]::after {
  content: ""; width: 9px; height: 5px; margin: -3px 2px 0 0; flex: 0 0 auto;
  border-left: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg);
}
.dselect-list:focus-visible { box-shadow: none; }
.dselect-list:focus-visible [role="option"].active { box-shadow: inset 0 0 0 1px var(--chip-on-ring); }
.level-select .dselect-list [role="option"] { flex-direction: column; align-items: flex-start; gap: 0; padding: 6px 30px 6px 10px; }
.level-select .dselect-list [role="option"][aria-selected="true"]::after { position: absolute; right: 12px; top: 15px; margin: 0; }

/* Public link page */
.share-bar {
  position: sticky; top: 0; z-index: var(--z-sticky); display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--card) 88%, transparent); backdrop-filter: blur(10px);
}
.share-bar .brand { padding: 0; }
.share-main { width: 100%; max-width: 1180px; margin: 0 auto; padding: 22px 24px 120px; }
.share-head { margin-bottom: 18px; }
.share-title { display: flex; align-items: center; gap: 14px; min-width: 0; }
.share-title > div { min-width: 0; }
.share-title h1 { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-2xl); letter-spacing: -0.03em; }
.share-facts { margin: 2px 0 0; font-size: var(--fs-sm); }
.share-facts:empty { display: none; }
.share-name { max-width: 360px; margin-bottom: 14px; }
.drop-zone {
  display: grid; justify-items: center; gap: 8px; padding: 44px 20px; text-align: center; cursor: pointer;
  border: 2px dashed var(--line-strong); border-radius: var(--r-4); background: var(--card);
  transition: border-color var(--d1) var(--ease), background-color var(--d1) var(--ease);
}
.drop-zone:hover, .drop-zone.over { border-color: var(--violet); background: color-mix(in srgb, var(--violet) 6%, var(--card)); }
.drop-zone b { font-size: var(--fs-lg); }
.drop-zone .row { margin-top: 8px; }
.got { margin-top: 22px; }
.got .section-title { margin: 0; }
.got-list { margin-top: 8px; }
.one-file { display: grid; justify-items: center; gap: 10px; padding: 24px 0; text-align: center; }
.one-file-preview {
  width: min(560px, 100%); aspect-ratio: 16 / 10; display: grid; place-items: center; overflow: hidden; padding: 0;
  border: 1px solid var(--line); border-radius: var(--r-4); background: var(--thumb-bg); color: var(--ink-3);
}
.one-file-preview img { width: 100%; height: 100%; object-fit: contain; }
.one-file-preview > .icon { font-size: 64px; stroke-width: 1.3; }
.one-file-name { max-width: 100%; font-size: var(--fs-lg); overflow-wrap: anywhere; }

/* Laptop: the sidebar folds into a strip of icons and slides out over the page on demand */
.rail-toggle { display: none; }
@media (max-width: 1439px) and (min-width: 1025px) {
  :root { --sidebar-w: 68px; }
  .rail-toggle { display: inline-grid; margin: 0 auto 6px; }
  .rail-close-icon { display: none; }
  body:not(.rail-open) .sidebar { padding: 14px 10px 12px; align-items: center; }
  body:not(.rail-open) :is(.brand span:not(.brand-mark), .nav a span, .profile-copy, .sidebar .theme-toggle, .meter-text, .meter-bar) { display: none; }
  body:not(.rail-open) .nav a { justify-content: center; padding: 0; width: 44px; }
  body:not(.rail-open) .meter { padding: 8px 0; justify-items: center; }
  body:not(.rail-open) .profile { padding: 4px; background: transparent; flex-direction: column; }
  body.rail-open .sidebar {
    position: fixed; inset: 0 auto 0 0; width: 280px; box-shadow: var(--shadow);
    animation: rail-in var(--d2) var(--ease);
  }
  body.rail-open .rail-toggle { position: absolute; top: 12px; right: 10px; margin: 0; }
  body.rail-open .rail-open-icon { display: none; }
  body.rail-open .rail-close-icon { display: block; }
  body.rail-open .brand { padding-right: 44px; }
  body.rail-open::after { content: ""; position: fixed; inset: 0; z-index: calc(var(--z-drawer) - 1); background: var(--scrim); }
}
@keyframes rail-in { from { transform: translateX(-40px); opacity: 0.6; } }

/* Tablet and phone: the sidebar becomes a drawer */
@media (max-width: 1024px) {
  .app-shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; width: min(300px, 86vw); height: 100dvh;
    transform: translateX(-102%); transition: transform var(--d2) var(--ease);
    box-shadow: var(--shadow);
  }
  body.drawer-open .sidebar { transform: none; }
  body.drawer-open::after { content: ""; position: fixed; inset: 0; z-index: calc(var(--z-drawer) - 1); background: var(--scrim); }
  .menu-toggle { display: inline-grid; }
  .top-search { display: none; }
  .search-link { display: inline-grid; }
}

@media (max-width: 720px) {
  :root { --topbar-h: 52px; }
  .topbar { padding: 6px 10px; gap: 4px; }
  .page, .share-main { padding: 16px 16px 140px; }
  #restore { padding: 0 16px; }
  .folder-head h1, .share-title h1 { font-size: var(--fs-xl); }
  .btn-label { display: none; }
  .toolbar .btn.primary .btn-label { display: inline; }
  .toolbar .btn { padding: 0 11px; }
  .toolbar .sort-select { width: 136px; }
  .icon-btn { width: 40px; height: 40px; }
  .btn { min-height: 40px; }
  .items.grid, .grid-part { gap: 10px; }
  .grid-part, .grid-part.folders { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .items.grid .item-check { opacity: 1; }
  .items.grid:not(.selecting) .item.is-folder .item-check { opacity: 0; }
  .items.rows .item, .rows-head { grid-template-columns: 22px minmax(0, 1fr) 40px; gap: 10px; }
  .items.rows.no-select .item { grid-template-columns: minmax(0, 1fr) 40px; }
  .items.rows .col { display: none; }
  .items.rows .item-sub { display: block; }
  .rows-head { display: none !important; }
  .crumbs .crumb:not(.current) { max-width: 96px; }
  .crumbs.deep > :nth-child(n+3):nth-last-child(n+4) { display: none; }
  .up-panel { right: 8px; left: 8px; width: auto; bottom: calc(8px + env(safe-area-inset-bottom, 0px)); }
  .toast { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
  .viewer-stage { padding: 4px 4px 72px; }
  .viewer-nav { top: auto; bottom: 12px; margin: 0; width: 48px; height: 48px; }
  .viewer-head { padding: 6px 6px 6px 14px; }
  .viewer-head .btn { padding: 0 10px; }
  .share-form { flex-direction: column; align-items: stretch; }
  .share-form .field-label:first-child { width: auto; }
  .add-person { flex-direction: column; }
  .add-person .level-select, .grant-row .level-select { width: 130px; }
  .audit-row { flex-wrap: wrap; }
  .audit-time, .audit-who { width: auto; }
  .audit-ip { display: none; }
  .trash-row { flex-wrap: wrap; }
  .trash-row .purge { order: 5; width: 100%; padding-left: 48px; }
  .dselect-list [role="option"] { min-height: 44px; }
  .restore-bar { flex-wrap: wrap; }
  .restore-bar .grow { flex: 1 1 0; }
  .restore-bar .restore-again { order: 5; flex: 1 0 100%; }
  .grid-part.folders { grid-template-columns: minmax(0, 1fr); }
  .tb-extra { display: none !important; }
  .tb-more { display: inline-grid; }
  .level-label { justify-content: space-between; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
