/* ─────────────────────────────────────────────────────────────
   AllFiles — design system (user app, admin panel, share page, Nearby Send)
   Look: A + B + C combined — brand gradient accents, clean white cards on a soft grey page,
   big titles, pill search, filter chips, list/table files, pill tab bar. Icons: Phosphor.
   Themes: auto (system) / light / dark via <html data-theme>
   Breakpoints: 210 · 310 · 360 · 480 · 650 · 880 · 960 · 1130 · 1400 · 1800 · 2000
   ───────────────────────────────────────────────────────────── */

:root {
  --font: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Plus Jakarta Sans", Inter, system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Consolas, monospace;

  --accent: #5b5bf6; --accent-2: #8b5cf6; --accent-3: #22d3ee;
  --grad: linear-gradient(135deg, #4f46e5 0%, #8b5cf6 58%, #22d3ee 130%);
  --grad-soft: linear-gradient(135deg, rgba(91,91,246,.14), rgba(139,92,246,.10) 60%, rgba(34,211,238,.10));
  --ok: #10b981; --warn: #d97706; --bad: #ef4444;

  --bg: #f2f3f8; --bg-2: #eceef5;
  --surface: #ffffff; --surface-2: #f6f7fb; --surface-3: #eef0f6;
  --soft: #eceeff; --track: #e6e8f0;
  --glass: rgba(255,255,255,.82); --glass-line: rgba(255,255,255,.7);
  --line: #e8eaf0; --line-2: #dcdfe8;
  --text: #0f172a; --text-2: #5b6475; --muted: #8b93a5;
  --shadow-1: 0 1px 2px rgba(15,23,42,.04);
  --shadow-2: 0 10px 28px -12px rgba(30,27,75,.20), 0 2px 6px rgba(15,23,42,.04);
  --shadow-3: 0 28px 70px -20px rgba(30,27,75,.35);
  --glow: 0 14px 28px -12px rgba(91,91,246,.75);
  --ring: 0 0 0 4px rgba(91,91,246,.16);
  --scrim: rgba(15,23,42,.42);

  --r-xs: 8px; --r-sm: 12px; --r: 16px; --r-lg: 20px; --r-xl: 28px;
  --gut: 16px;
  --side-w: 256px;
  --top-h: 60px;
  --bnav-h: 70px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --ease: cubic-bezier(.2,.8,.2,1);
  --spring: cubic-bezier(.34,1.56,.64,1);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0b0c12; --bg-2: #101119;
  --surface: #161821; --surface-2: #1b1e28; --surface-3: #232735;
  --soft: #25264a; --track: #262a36; --accent: #8b8cff;
  --glass: rgba(22,24,33,.84); --glass-line: rgba(255,255,255,.06);
  --line: #252833; --line-2: #323644;
  --text: #eef1f8; --text-2: #aab2c3; --muted: #7c8497; --warn: #fbbf24;
  --shadow-1: 0 1px 2px rgba(0,0,0,.4);
  --shadow-2: 0 12px 30px -10px rgba(0,0,0,.6), 0 2px 8px rgba(0,0,0,.35);
  --shadow-3: 0 30px 80px -16px rgba(0,0,0,.75);
  --ring: 0 0 0 4px rgba(139,140,255,.25);
  --scrim: rgba(2,4,10,.66);
  --grad-soft: linear-gradient(135deg, rgba(139,140,255,.20), rgba(139,92,246,.14) 60%, rgba(34,211,238,.12));
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
    --bg: #0b0c12; --bg-2: #101119;
    --surface: #161821; --surface-2: #1b1e28; --surface-3: #232735;
    --soft: #25264a; --track: #262a36; --accent: #8b8cff;
    --glass: rgba(22,24,33,.84); --glass-line: rgba(255,255,255,.06);
    --line: #252833; --line-2: #323644;
    --text: #eef1f8; --text-2: #aab2c3; --muted: #7c8497; --warn: #fbbf24;
    --shadow-1: 0 1px 2px rgba(0,0,0,.4);
    --shadow-2: 0 12px 30px -10px rgba(0,0,0,.6), 0 2px 8px rgba(0,0,0,.35);
    --shadow-3: 0 30px 80px -16px rgba(0,0,0,.75);
    --ring: 0 0 0 4px rgba(139,140,255,.25);
    --scrim: rgba(2,4,10,.66);
    --grad-soft: linear-gradient(135deg, rgba(139,140,255,.20), rgba(139,92,246,.14) 60%, rgba(34,211,238,.12));
    color-scheme: dark;
  }
}

/* ── Base ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body {
  margin: 0; min-height: 100dvh; background: var(--bg); color: var(--text);
  font: 400 14.5px/1.5 var(--font); letter-spacing: -.006em;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
h1, h2, h3, .display { font-family: var(--font-display); text-wrap: balance; }
p, small, li, .muted, .tiny { text-wrap: pretty; }
.dialog-title, .empty h3, .empty p { text-wrap: balance; }
/* A short centered line with a small icon in front: the icon sits inline with the first word, so a wrap never leaves it floating. */
.fine-print { text-align: center; color: var(--muted); font-size: 12.5px; line-height: 1.5; margin: 28px auto 0; max-width: 46ch; text-wrap: balance; }
.fine-print .ic-sm { display: inline-block; width: 14px; height: 14px; vertical-align: -2px; margin-right: 5px; }
a { color: var(--accent); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
img, svg { display: block; }
::selection { background: rgba(91,91,246,.22); }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--r-xs); }

.ic { width: 20px; height: 20px; flex: none; }
.ic-sm { width: 16px; height: 16px; flex: none; }
.ic-lg { width: 26px; height: 26px; flex: none; }
.muted { color: var(--muted); }
.tiny { font-size: 12px; }
.mono { font-family: var(--mono); font-size: 12.5px; word-break: break-all; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.spacer, .sp { flex: 1; }

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  --bh: 42px;
  position: relative; overflow: hidden; isolation: isolate;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: var(--bh); padding: 0 16px; border-radius: 12px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--text);
  font-weight: 600; font-size: 14px; white-space: nowrap; user-select: none;
  transition: transform .15s var(--ease), box-shadow .2s, background .2s, border-color .2s, opacity .2s;
}
.btn:hover { border-color: var(--accent); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn .ic { width: 18px; height: 18px; }
.btn.primary { border: 0; color: #fff; background: var(--grad); box-shadow: var(--glow), inset 0 1px 0 rgba(255,255,255,.22); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.solid-acc { border: 0; color: #fff; background: var(--accent); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-3); color: var(--text); }
.btn.soft { background: var(--surface-3); border-color: transparent; }
.btn.soft:hover { background: var(--soft); color: var(--accent); }
.btn.danger { color: var(--bad); }
.btn.danger:hover { border-color: var(--bad); background: rgba(239,68,68,.08); }
.btn.danger.solid { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.sm { --bh: 36px; padding: 0 12px; font-size: 13.5px; border-radius: 11px; }
.btn.xs { --bh: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 9px; gap: 5px; }
.btn.xs .ic, .btn.xs .ic-sm { width: 15px; height: 15px; }
.btn.block { width: 100%; }
.btn.lg { --bh: 52px; font-size: 15.5px; border-radius: 15px; }
.btn.busy { opacity: .6; pointer-events: none; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 12px; border: 0; background: transparent; color: var(--text-2);
  display: inline-grid; place-items: center; position: relative; overflow: hidden; flex: none;
  transition: background .2s, color .2s, transform .15s;
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.icon-btn:active { transform: scale(.92); }
.icon-btn.sm { width: 34px; height: 34px; border-radius: 10px; }
.icon-btn.on { background: var(--soft); color: var(--accent); }
.icon-btn.danger { color: var(--bad); }
.ripple { position: absolute; border-radius: 50%; transform: scale(0); background: currentColor; opacity: .16; pointer-events: none; animation: ripple .6s var(--ease); z-index: -1; }
@keyframes ripple { to { transform: scale(2.6); opacity: 0; } }
@keyframes gradShift { 0%,100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }

/* ── Inputs ───────────────────────────────────────────────── */
.field { display: grid; gap: 7px; }
.field > span { font-size: 13px; font-weight: 600; color: var(--text-2); }
.input {
  width: 100%; height: 48px; padding: 0 15px; border-radius: 14px; outline: none;
  border: 1.5px solid var(--line-2); background: var(--surface); color: var(--text); font-size: 15px;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.input:focus { border-color: var(--accent); box-shadow: var(--ring); }
.input::placeholder { color: var(--muted); }
select.input { cursor: pointer; }
.input-wrap { position: relative; }
.input-wrap .input { padding-right: 48px; }
.input-wrap .icon-btn { position: absolute; right: 4px; top: 4px; }

/* pill search box */
.search {
  display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 6px 0 16px; min-width: 0;
  border-radius: 23px; background: var(--surface); border: 1px solid var(--line); transition: border-color .2s, box-shadow .2s;
}
.search:focus-within { border-color: var(--accent); box-shadow: var(--ring); }
.search input { border: 0; outline: 0; background: transparent; flex: 1; min-width: 0; height: 100%;
  -webkit-appearance: none; appearance: none; border-radius: 0; padding: 0; font-size: 15px; }
/* the box itself shows focus — the input inside must not draw a second ring */
.search input:focus, .search input:focus-visible { outline: none; box-shadow: none; border-radius: 0; }
.search input::-webkit-search-decoration, .search input::-webkit-search-cancel-button,
.search input::-webkit-search-results-button, .search input::-webkit-search-results-decoration { -webkit-appearance: none; display: none; }
.search input::placeholder { color: var(--muted); }
.search > .ic, .search > .ic-sm { color: var(--muted); flex: none; width: 19px; height: 19px; }
.search:focus-within > .ic, .search:focus-within > .ic-sm { color: var(--accent); }
.search kbd { font: 600 11.5px var(--font); color: var(--muted); border: 1px solid var(--line-2); border-radius: 6px; padding: 1px 7px; margin-right: 8px; }
.search-tool { width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--soft); color: var(--accent); display: grid; place-items: center; flex: none; }
.search-tool .ic { width: 18px; height: 18px; }

/* segmented control */
.seg { display: inline-flex; padding: 3px; border-radius: 13px; background: var(--track); gap: 2px; max-width: 100%; }
.seg button {
  border: 0; background: transparent; height: 34px; padding: 0 12px; border-radius: 10px; color: var(--text-2);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-weight: 600; font-size: 13px; white-space: nowrap;
}
.seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(15,23,42,.1); }
.seg.block { display: flex; width: 100%; }
.seg.block button { flex: 1; }
.switch { position: relative; width: 46px; height: 28px; flex: none; }
.switch input { opacity: 0; position: absolute; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch i { position: absolute; inset: 0; border-radius: 99px; background: var(--track); border: 1px solid var(--line-2); transition: .25s; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-1); transition: .3s var(--spring); }
.switch input:checked + i { background: var(--accent); border-color: var(--accent); }
.switch input:checked + i::after { transform: translateX(18px); }

/* filter chips */
.chips { display: flex; gap: 7px; overflow-x: auto; scrollbar-width: none; padding: 1px 0; }
.chips::-webkit-scrollbar { display: none; }
.chips button {
  height: 34px; padding: 0 14px; border-radius: 11px; border: 1px solid var(--line); background: var(--surface);
  color: var(--text-2); font-weight: 600; font-size: 13px; white-space: nowrap; flex: none;
}
.chips button.on { background: var(--text); border-color: var(--text); color: var(--bg); }

/* ── Boot / splash ────────────────────────────────────────── */
.boot { position: fixed; inset: 0; display: grid; place-items: center; background: var(--bg); z-index: 100; transition: opacity .4s; }
.boot.out { opacity: 0; pointer-events: none; }
.boot img { width: 72px; height: 72px; border-radius: 22px; animation: bootPulse 1.4s var(--ease) infinite; box-shadow: 0 20px 50px -12px rgba(91,91,246,.6); }
@keyframes bootPulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.06); } }

/* ── Login ────────────────────────────────────────────────── */
.auth { min-height: 100dvh; display: grid; place-items: center; padding: 28px var(--gut); position: relative; overflow: hidden; }
.blob { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .45; animation: float 18s ease-in-out infinite; pointer-events: none; }
.blob.b1 { width: 380px; height: 380px; background: #5b5bf6; top: -140px; left: -110px; }
.blob.b2 { width: 320px; height: 320px; background: #22d3ee; bottom: -140px; right: -90px; animation-delay: -5s; opacity: .3; }
.blob.b3 { width: 260px; height: 260px; background: #a855f7; top: 45%; left: 62%; animation-delay: -9s; opacity: .28; }
@keyframes float { 0%,100% { transform: translate(0,0) scale(1); } 33% { transform: translate(40px,-30px) scale(1.08); } 66% { transform: translate(-30px,30px) scale(.95); } }
.auth-col { width: 100%; max-width: 420px; position: relative; z-index: 1; }
.auth-card {
  position: relative; width: 100%; max-width: 420px; padding: 32px 28px 26px; border-radius: var(--r-xl);
  background: var(--glass); backdrop-filter: blur(24px) saturate(1.4); -webkit-backdrop-filter: blur(24px) saturate(1.4);
  border: 1px solid var(--line); box-shadow: var(--shadow-3); animation: riseIn .6s var(--spring) both;
}
.auth-logo { width: 60px; height: 60px; border-radius: 18px; margin-bottom: 18px; box-shadow: 0 16px 36px -10px rgba(91,91,246,.7); animation: popIn .5s .1s var(--spring) both; }
.auth h1 { font-size: 27px; line-height: 1.2; margin: 0 0 6px; letter-spacing: -.03em; font-weight: 800; }
.auth p.lead { margin: 0 0 22px; color: var(--text-2); }
.auth form { display: grid; gap: 15px; }
.auth .hint { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--text-2); background: var(--soft); border-radius: 14px; padding: 12px 14px; }
.auth .hint .ic { color: var(--accent); margin-top: 1px; }
.auth .err { color: var(--bad); font-size: 13.5px; font-weight: 600; min-height: 20px; margin: -6px 0 -4px; }
.trust { display: flex; justify-content: center; gap: 18px; flex-wrap: wrap; margin-top: 22px; color: var(--muted); font-size: 12.5px; }
.trust span { display: inline-flex; align-items: center; gap: 6px; }
.trust .ic-sm { color: var(--accent); }
.shake { animation: shake .45s; }
@keyframes shake { 20%,60% { transform: translateX(-8px); } 40%,80% { transform: translateX(8px); } }
@keyframes riseIn { from { opacity: 0; transform: translateY(24px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes popIn { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: none; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ── App shell ────────────────────────────────────────────── */
.shell { min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr); }
.side { display: none; }
.main { min-width: 0; display: flex; flex-direction: column; min-height: 100dvh; overflow-x: clip; }
.top {
  position: sticky; top: 0; z-index: 20; height: var(--top-h);
  display: flex; align-items: center; gap: 8px; padding: 0 var(--gut);
  background: var(--glass); backdrop-filter: blur(20px) saturate(1.6); -webkit-backdrop-filter: blur(20px) saturate(1.6);
  border-bottom: 1px solid transparent;
}
.top.scrolled { border-bottom-color: var(--line); }
.brand { display: flex; align-items: center; gap: 10px; font: 800 17.5px var(--font-display); letter-spacing: -.02em; min-width: 0; color: var(--text); }
.brand img { width: 32px; height: 32px; border-radius: 10px; box-shadow: 0 6px 16px -6px rgba(91,91,246,.7); flex: none; }
.brand span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top .top-search { display: none; }
.avatar {
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--grad); color: #fff; font: 800 15px var(--font-display); border: 0;
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--soft);
  transition: transform .18s var(--ease);
}
.avatar:hover { transform: scale(1.05); }
.avatar:active { transform: scale(.95); }
.avatar.lg { width: 72px; height: 72px; font-size: 28px; box-shadow: 0 16px 34px -14px rgba(91,91,246,.8); }
.content { flex: 1; padding: 8px var(--gut) calc(var(--bnav-h) + var(--safe-b) + 96px); width: 100%; margin: 0 auto; }

/* Bottom tab bar (phones & small tablets) — flat and stable.
   The active tab gets a filled icon in a soft pill; nothing ever moves when you tap. */
.bnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  height: calc(var(--bnav-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr);
  background: var(--surface); border-top: 1px solid var(--line);
}
.bnav a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  min-width: 0; padding: 0 2px; position: relative; text-align: center;
  color: var(--muted); font-size: 11.5px; font-weight: 600; text-decoration: none;
  -webkit-tap-highlight-color: transparent; outline: none;
}
.bnav .tp { width: 58px; height: 32px; border-radius: 16px; display: grid; place-items: center; position: relative; flex: none; }
.bnav a .ic { width: 23px; height: 23px; flex: none; }
.bnav .ic.fill { display: none; }
.bnav a.on { color: var(--text); font-weight: 700; }
.bnav a.on .tp { background: var(--soft); color: var(--accent); }
.bnav a.on .ic.fill { display: block; }
.bnav a.on:has(.ic.fill) .ic:not(.fill) { display: none; }
.bnav a > .ic { width: 23px; height: 23px; }            /* admin tab bar: icon without a pill */
.bnav a.on > .ic { color: var(--accent); }
.bnav a .tl, .bnav a > span:not(.tp):not(.ripple) { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.2; }
.bnav .ripple { display: none; }   /* never let a tap add anything inside a tab */
.bnav a:focus, .bnav a:focus-visible, .bnav a:active { box-shadow: none; transform: none; }
.badge {
  position: absolute; top: -3px; right: 6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px;
  background: var(--bad); color: #fff; font-size: 10.5px; font-weight: 800; display: grid; place-items: center; font-style: normal;
  box-shadow: 0 0 0 2px var(--surface);
}
.bnav a > .badge { top: 8px; right: calc(50% - 22px); }

/* Extended "+ New" button */
.fab {
  position: fixed; right: max(var(--gut), 16px); bottom: calc(var(--bnav-h) + var(--safe-b) + 16px); z-index: 31;
  height: 54px; padding: 0 22px 0 18px; border-radius: 18px; border: 0; color: #fff; display: flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: 15px; background: var(--grad); box-shadow: var(--glow), inset 0 1px 0 rgba(255,255,255,.25);
  transition: transform .2s var(--ease);
}
.fab:active { transform: scale(.95); }
.fab .ic { width: 22px; height: 22px; }
body[data-route="account"] .fab, body[data-route="uploads"] .fab, body[data-route="trash"] .fab, body[data-route="vault"] .fab { display: none; }

/* Mini upload pill above the tab bar */
.upill {
  position: fixed; left: var(--gut); bottom: calc(var(--bnav-h) + var(--safe-b) + 22px); z-index: 29;
  display: flex; align-items: center; gap: 10px; padding: 8px 14px 8px 8px; border-radius: 99px; max-width: calc(100% - 170px);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-2); color: var(--text); font-size: 13px; font-weight: 600;
  animation: fadeUp .35s var(--ease);
}
.upill .ring { width: 30px; height: 30px; flex: none; }
.upill span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Progress ring & bars ─────────────────────────────────── */
.ring circle { fill: none; stroke-width: 4; }
.ring .track { stroke: var(--track); }
.ring .val { stroke: url(#gradStroke); stroke-linecap: round; transition: stroke-dashoffset .5s var(--ease); transform: rotate(-90deg); transform-origin: 50% 50%; }
.bar { height: 7px; border-radius: 99px; background: var(--track); overflow: hidden; position: relative; }
.bar i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, #4f46e5, #8b5cf6, #22d3ee); transition: width .5s var(--ease); position: relative; }
.bar.live i::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.45), transparent); animation: shimmer 1.4s infinite; }
.bar.warn i { background: #f59e0b; }
.bar.bad i { background: var(--bad); }
.bar.ok i { background: var(--ok); }
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

/* ── Page header / toolbar ────────────────────────────────── */
.toolbar { display: flex; align-items: center; gap: 8px; margin: 6px 0 14px; flex-wrap: wrap; }
.crumbs { display: flex; align-items: center; gap: 2px; min-width: 0; flex: 1 1 0; font: 800 28px/1.15 var(--font-display); letter-spacing: -.03em; }
.trail { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; margin: 6px 2px -4px; font-size: 13px; font-weight: 600; color: var(--muted); }
.trail a { color: var(--text-2); padding: 2px 4px; border-radius: 6px; }
.trail a:hover { background: var(--surface-3); }
.trail .ic-sm { width: 13px; height: 13px; color: var(--muted); }
.crumbs a, .crumbs b { color: var(--text-2); padding: 2px 4px; border-radius: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 60vw; }
.crumbs a { font-size: 17px; font-weight: 700; }
.crumbs a:hover { background: var(--surface-3); color: var(--text); }
.crumbs b { color: var(--text); display: inline-flex; align-items: center; gap: 8px; }
.crumbs .ic-sm { color: var(--muted); }
.crumbs .icon-btn { margin-left: -8px; }
.toolbar .search { flex: 1 1 100%; order: 3; }
.tb-tools { display: flex; align-items: center; gap: 6px; }
.section-title, .shd {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 20px 2px 10px;
  font: 800 16px var(--font-display); letter-spacing: -.01em; color: var(--text);
}
.section-title .ic-sm { color: var(--muted); }
.shd a, .shd button.link { font: 700 13px var(--font); color: var(--accent); background: none; border: 0; display: inline-flex; align-items: center; gap: 5px; padding: 0; }
.shd .count { color: var(--muted); font-weight: 700; font-family: var(--font); font-size: 13px; margin-left: 6px; }
.shd > span { display: inline-flex; align-items: center; }

/* usage card (ring + today's usage) */
.usecard { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); margin: 12px 0 0; }
.usecard > div { flex: 1; min-width: 0; }
.usecard b { display: block; font-size: 14px; }
.usecard b span { color: var(--muted); font-weight: 500; white-space: nowrap; }
.usecard small { display: flex; gap: 5px; align-items: flex-start; line-height: 1.35; color: var(--text-2); font-size: 12px; margin-top: 2px; }
.usecard small .ic-sm { color: var(--ok); width: 14px; height: 14px; flex: none; margin-top: 1px; }
.usecard a { font-weight: 700; font-size: 13px; }
.uring { flex: none; transform: rotate(-90deg); }
.usecard.compact { gap: 10px; padding: 11px 12px; }
.usecard.compact b { font-size: 13.5px; }
.usecard.compact small { font-size: 11.5px; }
.uring circle { fill: none; }
.uring .t { stroke: var(--track); }
.uring .v { stroke: url(#gradStroke); stroke-linecap: round; transition: stroke-dashoffset .5s var(--ease); }

/* quick actions */
.qa { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 12px 0 0; }
.qa button {
  border: 1px solid var(--line); background: var(--surface); border-radius: 16px; padding: 11px 4px 10px;
  display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--text-2);
  transition: border-color .2s, transform .15s;
}
.qa button:active { transform: scale(.97); }
.qa button b { font-weight: 600; }
.qa button small { display: none; }
.qa-ic { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; color: var(--c); background: color-mix(in srgb, var(--c) 15%, transparent); flex: none; }
.qa-ic .ic { width: 24px; height: 24px; }
.home-chips { margin: 16px 0 0; }

/* ── Files ────────────────────────────────────────────────── */
.grid { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card {
  position: relative; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line);
  transition: box-shadow .2s, border-color .2s, background .2s;
  animation: fadeUp .35s var(--ease) both; animation-delay: calc(min(var(--i, 0), 12) * 25ms); cursor: pointer; min-width: 0;
  -webkit-user-select: none; user-select: none;
}
@media (hover: hover) and (pointer: fine) {
  .card:hover { box-shadow: var(--shadow-2); border-color: var(--line-2); }
}
.card:active { transform: scale(.99); }
.fcard { padding: 10px; display: flex; flex-direction: column; gap: 9px; }
.thumb {
  aspect-ratio: 16 / 11; border-radius: 12px; display: grid; place-items: center; position: relative; overflow: hidden;
  background: color-mix(in srgb, var(--tc, var(--accent)) 13%, transparent); color: var(--tc, var(--accent));
}
.thumb .ic { width: 36%; height: 36%; max-width: 48px; max-height: 48px; }
.thumb .ext { position: absolute; left: 7px; bottom: 7px; font-size: 10px; font-weight: 800; letter-spacing: .04em; padding: 1px 6px; border-radius: 6px; background: var(--tc, var(--accent)); color: #fff; text-transform: uppercase; }
.folder .thumb { color: var(--accent); background: var(--soft); }
.fbody { display: grid; gap: 2px; min-width: 0; }
.fname { font-weight: 600; font-size: 14px; line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; word-break: break-word; }
.fmeta { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 5px; flex-wrap: nowrap; min-width: 0; white-space: nowrap; overflow: hidden; }
.fmeta > * { flex: none; }
.fmeta > .exp { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 359px) { .fmeta .m-date { display: none; } }
/* Meta that may wrap (admin rows): every item carries its own "·" in front; the row is shifted left by one
   dot width and that strip is clipped, so the dot of whichever item starts a line is never seen. */
.fmeta.wrap { flex-wrap: wrap; gap: 2px 0; white-space: normal; overflow: visible; margin-left: -14px; clip-path: inset(0 0 0 14px); }
.fmeta.wrap > .mi { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
.fmeta.wrap > .mi::before { content: "·"; width: 14px; text-align: center; flex: none; }
.exp { color: var(--warn); font-weight: 600; display: inline-flex; align-items: center; gap: 3px; font-style: normal; white-space: nowrap; }
.exp .ic-sm { width: 13px; height: 13px; flex: none; }
.kebab { position: absolute; top: 6px; right: 6px; width: 34px; height: 34px; border-radius: 10px; border: 0; display: grid; place-items: center;
  background: transparent; color: var(--muted); transition: .2s; z-index: 2; }
.kebab:hover { color: var(--text); background: var(--surface-3); }
.kebab .ic-sm { width: 20px; height: 20px; }
.fcol, .factions, .lhead { display: none; }
.grid:not(.list) .fmeta .m-date { display: none; }   /* tiles: size · time left on one line */
.card.partial .thumb::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(45deg, transparent 0 10px, rgba(127,127,127,.07) 10px 20px); }
.card .bar { height: 5px; margin-top: 4px; }
.card.sel { background: var(--soft); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }

/* folders row: compact tiles */
.folds { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.folds .fcard { flex-direction: row; align-items: center; gap: 11px; padding: 11px 38px 11px 11px; }
.folds .thumb { aspect-ratio: auto; width: 40px; height: 40px; border-radius: 12px; flex: none; }
.folds .thumb .ic { width: 24px; height: 24px; }
.folds .fname { -webkit-line-clamp: 1; font-size: 14px; }
.folds .kebab { top: 50%; transform: translateY(-50%); right: 4px; }

/* list mode: one grouped card with rows (phones) → a table (laptops) */
.grid.list { grid-template-columns: minmax(0, 1fr); gap: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.grid.list .card { border: 0; border-radius: 0; border-top: 1px solid var(--line); animation: none; }
.grid.list .card:first-child { border-top: 0; }
.grid.list .fcard { flex-direction: row; align-items: center; padding: 10px 46px 10px 12px; gap: 12px; }
.grid.list .thumb { aspect-ratio: 1; width: 44px; border-radius: 13px; flex: none; }
.grid.list .thumb .ic { width: 24px; height: 24px; }
.grid.list .thumb .ext { display: none; }
.grid.list .fbody { flex: 1; }
.grid.list .fname { -webkit-line-clamp: 1; font-size: 14.5px; }
.grid.list .kebab { top: 50%; transform: translateY(-50%); }
.grid.list .card:hover { box-shadow: none; background: var(--surface-2); }
.grid.list .card.sel { background: var(--soft); }

/* skeleton */
.skel { border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); padding: 12px; }
.skel i { display: block; border-radius: 10px; background: linear-gradient(90deg, var(--surface-3), var(--surface-2), var(--surface-3)); background-size: 200% 100%; animation: skel 1.3s infinite; }
@keyframes skel { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* empty state */
.empty { text-align: center; padding: 52px 20px; animation: fadeUp .45s var(--ease); }
.empty-art { width: 96px; height: 96px; margin: 0 auto 20px; border-radius: 28px; display: grid; place-items: center; position: relative;
  background: var(--soft); color: var(--accent); box-shadow: 0 16px 34px -18px rgba(91,91,246,.6); }
.empty-art::before { content: ""; position: absolute; inset: -10px; border-radius: 34px; border: 1.5px solid color-mix(in srgb, var(--accent) 22%, transparent); animation: haloPulse 3.2s ease-in-out infinite; }
.empty-art .ic { width: 46px; height: 46px; }
@keyframes haloPulse { 0%,100% { transform: scale(1); opacity: .6; } 50% { transform: scale(1.08); opacity: .12; } }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.empty h3 { margin: 0 0 8px; font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.empty p { margin: 0 auto 22px; color: var(--text-2); max-width: 360px; line-height: 1.55; }
.empty .row-btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* view transitions when moving between folders */
.view-enter { animation: viewIn .32s var(--ease) both; }
.view-back { animation: viewBack .32s var(--ease) both; }
@keyframes viewIn { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: none; } }
@keyframes viewBack { from { opacity: 0; transform: translateX(-18px); } to { opacity: 1; transform: none; } }

/* search results update while typing: no entrance animation per keystroke, just a quiet dim while loading */
.results { transition: opacity .15s; }
.results.busy { opacity: .55; }
.results .card, .results .empty { animation: none; }

/* drop overlay */
.dropzone {
  position: fixed; inset: 12px; z-index: 60; border-radius: var(--r-xl); border: 2.5px dashed var(--accent);
  background: color-mix(in srgb, var(--bg) 72%, transparent); backdrop-filter: blur(10px);
  display: grid; place-items: center; text-align: center; animation: fadeIn .2s; pointer-events: none;
}
.dropzone .ic { width: 64px; height: 64px; color: var(--accent); margin: 0 auto 12px; }
.dropzone b { font: 800 22px var(--font-display); display: block; }

/* details panel (laptops) */
.detail { display: none; }

/* ── Uploads ──────────────────────────────────────────────── */
.upsum { margin: 4px 0 14px; border-radius: 20px; padding: 16px; color: #fff; background: var(--grad); box-shadow: 0 18px 34px -18px rgba(79,70,229,.9); }
.upsum-h { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; }
.upsum-h small { font-weight: 600; opacity: .92; }
.upsum-h b { font: 800 30px/1 var(--font-display); }
.upsum .spb { height: 8px; border-radius: 8px; background: rgba(255,255,255,.28); margin: 10px 0; overflow: hidden; }
.upsum .spb i { display: block; height: 100%; background: #fff; border-radius: 8px; transition: width .5s var(--ease); }
.upsum-f { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 12.5px; font-weight: 600; }
.upsum-f > span { display: flex; align-items: center; gap: 5px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.upsum-f button { background: rgba(255,255,255,.2); border: 0; color: #fff; height: 30px; padding: 0 11px; border-radius: 10px; font-weight: 700; font-size: 12.5px; display: flex; align-items: center; gap: 5px; flex: none; }
.upsum-f .ic-sm { width: 14px; height: 14px; }
.useg { margin-bottom: 12px; }
.jobs { display: grid; gap: 10px; }
.job {
  display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 4px 12px; align-items: center; padding: 12px;
  border-radius: 18px; background: var(--surface); border: 1px solid var(--line); animation: fadeUp .35s var(--ease) both;
}
.job .thumb { aspect-ratio: 1; width: 44px; border-radius: 13px; }
.job .thumb .ic { width: 24px; height: 24px; }
.job .thumb .ext { display: none; }
.job-top { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; min-width: 0; }
.job-name { font-weight: 600; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.job-size { color: var(--muted); font-size: 12.5px; flex: none; }
.job .bar { margin: 8px 0 6px; height: 6px; }
.job-meta { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.job-meta .st { font-weight: 600; color: var(--text-2); }
.job.error .st, .job.blocked .st { color: var(--bad); }
.job-why { margin: 6px 0 0; font-size: 12.5px; line-height: 1.45; color: var(--text-2); text-wrap: pretty; }
.job.paused .st { color: var(--warn); }
.job.done .st { color: var(--ok); }
.job-actions { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.job-actions:empty { display: none; }

/* floating upload tray (laptops) */
.tray {
  position: fixed; right: 22px; bottom: 22px; z-index: 40; width: 380px; max-height: min(460px, 70vh);
  display: flex; flex-direction: column; border-radius: var(--r-lg); overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-3); animation: riseIn .4s var(--spring);
}
.tray-head { display: flex; align-items: center; gap: 10px; padding: 12px 12px 12px 16px; font-weight: 700; color: #fff; background: var(--grad); }
.tray-head .icon-btn { color: #fff; }
.tray-head .icon-btn:hover { background: rgba(255,255,255,.18); }
.tray-head span { flex: 1; }
.tray-body { overflow: auto; padding: 10px; display: grid; gap: 8px; }
.tray .job { padding: 10px; grid-template-columns: 38px minmax(0, 1fr); border-radius: 14px; }
.tray .job .thumb { width: 38px; }
.tray.min .tray-body { display: none; }

/* ── Account ──────────────────────────────────────────────── */
.stack { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
.stack > * { min-width: 0; }
.side .seg { flex-wrap: nowrap; }
.side .seg button { flex: 1; padding: 0 6px; }
.panel { border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); padding: 18px; animation: fadeUp .4s var(--ease) both; animation-delay: calc(var(--i, 0) * 50ms); }
.panel h3 { margin: 0 0 14px; font-size: 16px; font-weight: 800; letter-spacing: -.01em; display: flex; align-items: center; gap: 9px; }
.panel h3 .ic { color: var(--accent); }
.profile { display: flex; align-items: center; gap: 16px; }
.profile h2 { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -.02em; word-break: break-word; }
.usage { display: grid; gap: 16px; }
.usage-row { display: grid; gap: 7px; }
.usage-row .lbl { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; }
.usage-row .lbl b { font-weight: 700; }
.kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.kv div { padding: 12px 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); min-width: 0; }
.kv span { display: block; font-size: 12px; color: var(--muted); }
.kv b { font: 800 18px var(--font-display); letter-spacing: -.01em; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.row:not(.row ~ .row) { border-top: 0; }   /* first row of any tag (a <label> row was losing its line) */
.row > div { min-width: 0; }
.row small { display: block; color: var(--muted); }
.cta { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; background: var(--grad); color: #fff; border: 0; box-shadow: 0 18px 40px -18px rgba(91,91,246,.8); }
.cta > .ic { flex: none; }
.cta > div { flex: 1 1 180px; min-width: 0; }
.cta b { font-size: 15.5px; }
.cta p { margin: 3px 0 0; opacity: .92; font-size: 13.5px; line-height: 1.4; }
.cta .btn { background: rgba(255,255,255,.2); color: #fff; border-color: rgba(255,255,255,.35); margin-left: auto; }
.cta .btn:hover { background: rgba(255,255,255,.32); border-color: rgba(255,255,255,.5); }
@media (max-width: 460px) { .cta .btn { margin-left: 0; flex: 1 1 100%; } }
.note { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; background: color-mix(in srgb, #f59e0b 12%, transparent); color: var(--text); font-size: 13.5px; }
.note .ic { color: #f59e0b; margin-top: 1px; }

/* ── Sheets, dialogs, menus, toasts ───────────────────────── */
.scrim { position: fixed; inset: 0; z-index: 70; background: var(--scrim); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); animation: fadeIn .22s; }
.scrim.out { animation: fadeOut .22s forwards; }
@keyframes fadeOut { to { opacity: 0; } }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 71; max-height: 90dvh; overflow: auto;
  padding: 8px 16px calc(18px + var(--safe-b)); border-radius: 28px 28px 0 0;
  background: var(--surface); box-shadow: var(--shadow-3); animation: sheetUp .38s var(--ease);
}
.sheet.out { animation: sheetDown .24s var(--ease) forwards; }
.sheet .grab { width: 40px; height: 5px; border-radius: 99px; background: var(--line-2); margin: 2px auto 14px; }
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: none; } }
@keyframes sheetDown { to { transform: translateY(100%); } }
.sheet-head { display: flex; align-items: center; gap: 12px; padding: 2px 4px 14px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.sheet-head .thumb { width: 52px; aspect-ratio: 1; border-radius: 15px; flex: none; }
.sheet-head .thumb .ic { width: 28px; height: 28px; }
.sheet-head .thumb .ext { display: none; }
.sheet-head b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15.5px; }
.sheet-head .muted { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.sheet-head > div { min-width: 0; }
/* round quick actions at the top of a sheet */
.sacts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 12px 0 8px; }
.sacts button { border: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; color: var(--text-2); padding: 4px 0; }
.sacts .sa-c { width: 52px; height: 52px; border-radius: 50%; background: var(--soft); color: var(--accent); display: grid; place-items: center; transition: transform .15s; }
.sacts .sa-c .ic { width: 24px; height: 24px; }
.sacts button:active .sa-c { transform: scale(.92); }
.acts { display: grid; gap: 0; }
.act {
  display: flex; align-items: center; gap: 14px; padding: 12px 10px; border-radius: 14px; border: 0; background: transparent;
  text-align: left; width: 100%; font-weight: 600; color: var(--text); transition: background .15s; position: relative; overflow: hidden;
}
.act:hover { background: var(--surface-2); }
.act > .ic { color: var(--text-2); }
.act > span:not(.qa-ic) { flex: 1; min-width: 0; }
.act .chev { color: var(--muted); width: 16px; height: 16px; }
.act .qa-ic { width: 40px; height: 40px; border-radius: 12px; }
.act .qa-ic .ic { width: 22px; height: 22px; }
.act.danger, .act.danger > .ic { color: var(--bad); }
.act small { display: block; color: var(--muted); font-weight: 500; font-size: 12.5px; }
.dialog-title { font: 800 19px var(--font-display); letter-spacing: -.02em; margin: 2px 4px 6px; }
.dialog-text { color: var(--text-2); margin: 0 4px 18px; }
.dialog-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }
.dialog-actions .btn { flex: 1 1 120px; }
.tree { display: grid; gap: 2px; max-height: 46dvh; overflow: auto; margin: 6px 0; padding: 4px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.tree button { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 11px; border: 0; background: transparent; text-align: left; font-weight: 600; color: var(--text); }
.tree button:hover { background: var(--surface-3); }
.tree button.on { background: var(--soft); color: var(--accent); box-shadow: inset 0 0 0 1.5px var(--accent); }
.tree button .ic { color: var(--accent); }
.details { display: grid; gap: 0; }
.details div { display: flex; justify-content: space-between; gap: 14px; padding: 11px 4px; border-top: 1px solid var(--line); font-size: 14px; }
.details div:first-child { border-top: 0; }
.details span { color: var(--muted); flex: none; }
.details b { font-weight: 600; text-align: right; min-width: 0; overflow-wrap: anywhere; }
.linkbox { display: flex; gap: 8px; align-items: center; padding: 6px 6px 6px 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); margin: 10px 0; }
.linkbox code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--mono); font-size: 12.5px; color: var(--text-2); }
.qrbox { width: 196px; height: 196px; margin: 6px auto 12px; background: #fff; border-radius: 16px; display: grid; place-items: center; padding: 8px; border: 1px solid var(--line); }

.toasts { position: fixed; top: calc(12px + env(safe-area-inset-top, 0px)); left: 50%; transform: translateX(-50%); z-index: 90; display: grid; gap: 8px; width: min(420px, calc(100% - 24px)); pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 16px; pointer-events: auto;
  background: var(--text); color: var(--bg); box-shadow: var(--shadow-2); font-weight: 600; font-size: 14px;
  animation: toastIn .35s var(--ease);
}
.toast .ic { color: #34d399; }
.toast.bad .ic { color: #f87171; }
.toast .btn { background: rgba(127,127,127,.25); color: inherit; border-color: transparent; }
.toast.out { animation: toastOut .3s var(--ease) forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-14px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-12px) scale(.97); } }
.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Bulk selection ───────────────────────────────────────── */
.selbar {
  position: sticky; bottom: calc(var(--bnav-h) + var(--safe-b) + 10px); z-index: 28; margin: 12px var(--gut) 0;
  display: flex; align-items: center; gap: 4px; padding: 7px 8px; border-radius: 18px;
  background: var(--text); color: var(--bg); box-shadow: var(--shadow-3); animation: fadeUp .25s var(--ease);
}
.selbar b { font-size: 14px; padding: 0 4px; white-space: nowrap; }
body.selmode .fab { display: none; }   /* the bar's buttons sit where the + button is */
.selbar .icon-btn { color: inherit; }
.selbar .icon-btn:hover { background: rgba(127,127,127,.22); }
.selbar .icon-btn.danger { color: #f87171; }
body.selmode .card.fcard { cursor: pointer; }
body.selmode [data-file] .kebab { pointer-events: none; opacity: .3; }
body.selmode [data-file]::after {
  content: ""; position: absolute; top: 50%; left: 8px; transform: translateY(-50%); width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid var(--line-2); background: var(--surface); z-index: 3; transition: .15s;
}
body.selmode .grid:not(.list) [data-file]::after { top: 16px; left: 16px; transform: none; }
body.selmode .grid.list [data-file] .thumb { visibility: hidden; }
.card.picked { background: var(--soft); }
.grid:not(.list) .card.picked { outline: 2px solid var(--accent); outline-offset: -1px; }
.card.picked::after { background: var(--accent) !important; border-color: var(--accent) !important;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>") !important;
  background-repeat: no-repeat !important; background-position: center !important; }
body.selmode [data-file] .factions { display: none !important; }

/* ── Gallery lightbox ─────────────────────────────────────── */
.gallery { position: fixed; inset: 0; z-index: 80; background: rgba(6,7,12,.96); backdrop-filter: blur(8px); display: flex; flex-direction: column; animation: fadeIn .2s; }
.g-top { display: flex; align-items: center; gap: 8px; padding: 12px 14px; padding-top: calc(12px + env(safe-area-inset-top, 0px)); color: #fff; }
.g-top .icon-btn { color: #fff; }
.g-top .icon-btn:hover { background: rgba(255,255,255,.14); }
.g-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60vw; }
.g-stage { flex: 1; display: grid; place-items: center; min-height: 0; padding: 0 8px; position: relative; }
.g-media { max-width: 100%; max-height: 100%; border-radius: 10px; object-fit: contain; animation: fadeIn .25s; }
video.g-media { background: #000; width: auto; }
.g-load { position: absolute; color: #fff; opacity: .6; }
.g-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; width: 48px; height: 48px; border-radius: 50%; border: 0;
  background: rgba(255,255,255,.14); color: #fff; display: grid; place-items: center; transition: .2s; }
.g-nav:hover { background: rgba(255,255,255,.26); }
.g-nav.prev { left: 12px; } .g-nav.next { right: 12px; }
.g-count { text-align: center; color: rgba(255,255,255,.7); font-size: 13px; padding: 12px; padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
@media (max-width: 640px) { .g-nav { width: 40px; height: 40px; background: rgba(255,255,255,.1); } }

/* Vault */
.lockbadge { position: absolute; top: 8px; left: 8px; width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center;
  background: var(--grad); color: #fff; z-index: 2; }
.lockbadge .ic-sm { width: 13px; height: 13px; }
.grid.list .lockbadge { top: 6px; left: 42px; width: 18px; height: 18px; border-radius: 6px; }
.grid.list .lockbadge .ic-sm { width: 11px; height: 11px; }
.vault-note { display: flex; gap: 8px; align-items: flex-start; line-height: 1.45; color: var(--text-2); font-size: 13px; margin: -4px 2px 14px; }
.vault-note .ic-sm { color: var(--ok); flex: none; margin-top: 2px; }

/* Trash rows */
.trash-acts { display: flex; gap: 6px; flex: none; }
.grid.list .fcard.trashrow { padding-right: 12px; }

/* ─────────────────────────────────────────────────────────────
   Responsive
   ───────────────────────────────────────────────────────────── */

/* 210 – 309: tiny phones / watches */
@media (max-width: 309px) {
  :root { --gut: 10px; --top-h: 54px; --bnav-h: 60px; }
  body { font-size: 14px; }
  .brand span { display: none; }
  .bnav .tl { display: none; }
  .bnav .tp { width: 46px; }
  .fab { padding: 0; width: 50px; height: 50px; justify-content: center; border-radius: 16px; right: 10px; }
  .fab span { display: none; }
  .grid:not(.list), .folds { grid-template-columns: minmax(0, 1fr); }
  .crumbs { font-size: 22px; }
  .qa { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .auth-card { padding: 24px 16px; border-radius: 22px; }
  .auth h1 { font-size: 22px; }
  .kv { grid-template-columns: minmax(0, 1fr); }
  .btn { padding: 0 12px; }
  .upill { max-width: calc(100% - 80px); }
  .trust { display: none; }
  .profile { flex-direction: column; text-align: center; }
  .cta { flex-direction: column; text-align: center; }
  .cta .btn { margin: 0; }
  .seg button span { display: none; }
  .panel { padding: 14px; }
  .sacts .sa-c { width: 44px; height: 44px; }
}
/* 310 – 359 */
@media (min-width: 310px) and (max-width: 359px) {
  :root { --gut: 12px; }
  .bnav .tp { width: 48px; }
  .fab { padding: 0 16px 0 14px; }
  .qa button { font-size: 11px; }
  .auth-card { padding: 28px 20px; }
}
@media (max-width: 359px) { .bnav-5 .tl { display: none; } .folds { grid-template-columns: minmax(0, 1fr); } }
/* 480 – 649: large phones */
@media (min-width: 480px) {
  :root { --gut: 20px; }
  .grid:not(.list) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .auth-card { padding: 38px 34px 30px; }
}
/* 650 – 879: small tablets — sheets become centred dialogs */
@media (min-width: 650px) {
  :root { --gut: 24px; }
  .grid:not(.list) { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
  .folds { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sheet {
    left: 50%; right: auto; bottom: auto; top: 50%; width: min(460px, calc(100% - 40px)); max-height: 86dvh;
    border-radius: var(--r-xl); padding: 20px; transform: translate(-50%, -50%); animation: dialogIn .3s var(--ease);
  }
  .sheet.out { animation: dialogOut .2s var(--ease) forwards; }
  .sheet .grab { display: none; }
  .kv { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .toasts { top: auto; bottom: 24px; }
  .qa button { flex-direction: row; justify-content: flex-start; text-align: left; padding: 12px; gap: 11px; font-size: 13.5px; }
  .qa button b { color: var(--text); font-weight: 700; display: block; }
  .qa button small { display: block; color: var(--muted); font-size: 12px; font-weight: 500; }
  @keyframes dialogIn { from { opacity: 0; transform: translate(-50%, -47%) scale(.97); } to { opacity: 1; transform: translate(-50%, -50%); } }
  @keyframes dialogOut { to { opacity: 0; transform: translate(-50%, -48%) scale(.97); } }
}
/* 880+: sidebar, no tab bar; list view becomes a table */
@media (min-width: 880px) {
  :root { --side-w: 84px; --top-h: 68px; }
  .shell { grid-template-columns: var(--side-w) minmax(0, 1fr); }
  .bnav, .upill, .fab { display: none; }
  .content { padding-bottom: 60px; padding-top: 4px; }
  .side {
    display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; height: 100dvh; padding: 18px 12px; overflow-y: auto;
    border-right: 1px solid var(--line); background: var(--surface); z-index: 25;
  }
  .side .brand { justify-content: center; margin-bottom: 16px; }
  .side .brand span, .side .nav span, .side .new-btn span, .side .side-foot, .side .nav-sec { display: none; }
  .side .new-btn { width: 56px; height: 56px; padding: 0; margin: 0 auto 12px; border-radius: 18px; }
  .nav { display: grid; gap: 3px; }
  .nav a {
    display: flex; align-items: center; justify-content: center; gap: 12px; height: 44px; border-radius: 22px;
    color: var(--text-2); font-weight: 600; position: relative; transition: background .2s, color .2s;
  }
  .nav a:hover { background: var(--surface-3); color: var(--text); }
  .nav a .ic.fill { display: none; }
  .nav a.on { background: var(--soft); color: var(--accent); font-weight: 700; }
  .nav a.on .ic.fill { display: block; }
  .nav a.on:has(.ic.fill) .ic:not(.fill) { display: none; }
  .nav .badge { top: 4px; right: 8px; }
  .nav-sec { font-size: 11px; font-weight: 700; color: var(--muted); letter-spacing: .07em; margin: 14px 14px 4px; text-transform: uppercase; }
  .top { border-bottom: 1px solid var(--line); background: var(--glass); }
  .top .brand, .top [data-search-btn] { display: none; }
  .top .top-search { display: flex; width: min(560px, 60%); }
  .toolbar .search { display: none; }
  .crumbs { flex: 1 1 0; font-size: 30px; }
  .grid:not(.list) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .home-hero { display: none; }
  .qa { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 4px; }
  .qa button { border-radius: 16px; }
  .home-chips { margin: 24px 0 0; }
  .shd.files-h { margin-top: 22px; }
  /* list → table */
  .lhead { display: grid; }
  .grid.list:not(.rlist) .fcard, .lhead {
    grid-template-columns: 34px minmax(0, 1fr) 96px 120px 112px 92px 36px; align-items: center; gap: 14px;
  }
  .grid.list:not(.rlist) .fcard { display: grid; padding: 9px 12px; }
  .grid.list:not(.rlist) .thumb { width: 34px; border-radius: 10px; }
  .grid.list:not(.rlist) .thumb .ic { width: 20px; height: 20px; }
  .grid.list:not(.rlist) .fmeta .m-size, .grid.list:not(.rlist) .fmeta .m-date, .grid.list:not(.rlist) .fmeta .exp, .grid.list:not(.rlist) .fmeta .dot { display: none; }
  .grid.list:not(.rlist) .fmeta:empty { display: none; }
  .grid.list .fcol { display: block; font-size: 13.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .grid.list .factions { display: flex; gap: 2px; justify-content: flex-end; opacity: 0; transition: opacity .15s; }
  .grid.list .card:hover .factions, .grid.list .card.sel .factions { opacity: 1; }
  .grid.list:not(.rlist) .kebab { position: static; transform: none; }
  .grid.list .fcard.folder .fcol { display: block; }
  .lhead { padding: 10px 12px; font-size: 12px; font-weight: 700; color: var(--muted); border-bottom: 1px solid var(--line); background: var(--surface); }
  .lhead span:first-child { grid-column: 1 / 3; }
  .grid.list .lhead + .card { border-top: 0; }
  body.selmode .grid.list [data-file]::after { left: 18px; }
  .usecard.home-use { display: none; }
}
@media (min-width: 880px) and (max-width: 1129px) {
  .grid.list:not(.rlist) .fcard, .lhead { grid-template-columns: 34px minmax(0, 1fr) 84px 108px 76px 36px; }
  .grid.list:not(.rlist) .fcard > span.fcol:nth-of-type(2), .lhead > span:nth-child(3) { display: none; }
  .qa button small { display: none; }
}
/* 960+: full sidebar with labels */
@media (min-width: 960px) {
  :root { --side-w: 256px; }
  .side { padding: 20px 14px; }
  .side .brand { justify-content: flex-start; padding: 0 8px; }
  .side .brand span, .side .nav span, .side .new-btn span { display: inline; }
  .side .nav-sec { display: block; }
  .side .new-btn { width: 100%; height: 48px; padding: 0 18px; justify-content: flex-start; border-radius: 15px; margin: 0 0 10px; }
  .nav a { justify-content: flex-start; padding: 0 14px; }
  .nav .badge { position: static; margin-left: auto; box-shadow: none; }
  .side .side-foot { display: grid; gap: 10px; margin-top: auto; padding-top: 14px; }
}
/* 1130+: laptops — right-hand details panel */
@media (min-width: 1130px) {
  :root { --gut: 28px; }
  .grid:not(.list) { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
  .content { max-width: 1320px; }
  body.has-detail .shell { grid-template-columns: var(--side-w) minmax(0, 1fr) 320px; }
  body.has-detail .detail {
    display: flex; flex-direction: column; gap: 12px; position: sticky; top: 0; height: 100dvh; overflow-y: auto;
    background: var(--surface); border-left: 1px solid var(--line); padding: 18px 20px; animation: fadeIn .2s;
  }
  body.has-detail .detail > * { flex-shrink: 0; }   /* a tall panel scrolls; it must not squash the Open button or preview */
}
/* 1400+: desktops */
@media (min-width: 1400px) {
  :root { --side-w: 268px; }
  .grid:not(.list) { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .content { max-width: 1480px; }
}
/* 1800+: large desktops */
@media (min-width: 1800px) {
  :root { --gut: 40px; }
  .grid:not(.list) { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; }
  .content { max-width: 1760px; }
  .folds { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
/* 2000+: 2K / 4K */
@media (min-width: 2000px) {
  :root { --side-w: 300px; --top-h: 76px; }
  body { font-size: 15.5px; }
  .grid:not(.list) { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 18px; }
  .content { max-width: 2100px; }
  .tray { width: 420px; }
}
/* phones: jobs full width; the tray is for wide screens only */
@media (max-width: 879px) { .tray { display: none; } }
/* short landscape phones */
@media (max-height: 460px) and (orientation: landscape) and (max-width: 959px) {
  .sheet { max-height: 94dvh; }
  .auth { place-items: start center; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* details panel contents */
.det-h { display: flex; align-items: center; justify-content: space-between; }
.det-h b { font: 800 16px var(--font-display); }
.det-prev { height: 170px; border-radius: 18px; display: grid; place-items: center; overflow: hidden; color: var(--tc, var(--accent)); background: color-mix(in srgb, var(--tc, var(--accent)) 13%, transparent); }
.det-prev .ic { width: 60px; height: 60px; }
.det-prev { cursor: pointer; position: relative; }
.shimmer-l::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(127,127,127,.18), transparent); animation: shimmer 1.3s infinite; }
.det-prev img { width: 100%; height: 100%; object-fit: cover; }
.det-name { font-size: 16px; font-weight: 700; overflow-wrap: anywhere; line-height: 1.3; }
.det-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.det-btns .btn { padding: 0 10px; }
.det-kv div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 13px; }
.det-kv div:first-child { border-top: 0; }
.det-kv div > span { color: var(--muted); }   /* child only — must not grey out the .exp inside the value */
.det-kv b { font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.det-qr { display: flex; align-items: center; gap: 12px; }
.det-qr .qrmini { width: 88px; height: 88px; background: #fff; border-radius: 12px; padding: 5px; border: 1px solid var(--line); flex: none; display: grid; place-items: center; }
.det-qr small { color: var(--muted); }

/* ── Share page ───────────────────────────────────────────── */
.share-page { place-items: center; }
.share-brand { justify-content: center; margin: 0 0 16px; animation: fadeUp .5s var(--ease) both; }
.share-card { padding: 22px; }
.share-card .media { width: 100%; max-height: 56vh; border-radius: var(--r); background: #000; display: block; margin-bottom: 16px; object-fit: contain; box-shadow: var(--shadow-2); }
.share-card audio.media { background: transparent; box-shadow: none; margin-top: -4px; }
.share-hero { position: relative; margin-bottom: 18px; border-radius: var(--r-lg); outline: none; }
.share-hero.can-view { cursor: pointer; }
.share-hero:focus-visible { box-shadow: var(--ring); }
.share-hero .thumb { aspect-ratio: 16 / 9; border-radius: var(--r-lg); margin: 0; }
.sh-media { position: relative; aspect-ratio: 16 / 9; border-radius: var(--r-lg); overflow: hidden; background: var(--surface-3); display: grid; place-items: center; }
.sh-media img { width: 100%; height: 100%; object-fit: cover; }
.sh-video { background: #000; }
.sh-video video { width: 100%; height: 100%; object-fit: cover; }
.sh-audio { background: linear-gradient(135deg, #1d1a3a, #312e81 60%, #0e7490); }
.sh-disc { width: 112px; height: 112px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: conic-gradient(from 210deg, #4f46e5, #8b5cf6, #22d3ee, #4f46e5); box-shadow: 0 18px 40px -14px rgba(0,0,0,.6), inset 0 0 0 8px rgba(255,255,255,.1); }
.sh-disc .ic { width: 50px; height: 50px; }
.sh-play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 66px; height: 66px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(12,12,20,.55); color: #fff; backdrop-filter: blur(6px); transition: transform .2s var(--ease); }
.sh-play .ic { width: 30px; height: 30px; margin-left: 3px; }
.sh-audio .sh-play { left: auto; right: 14px; top: auto; bottom: 14px; transform: none; width: 48px; height: 48px; }
.sh-audio .sh-play .ic { width: 22px; height: 22px; }
.share-hero.can-view:hover .sh-play { transform: translate(-50%, -50%) scale(1.07); }
.share-hero.can-view:hover .sh-audio .sh-play { transform: scale(1.07); }
.sh-chip { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); display: inline-flex; gap: 6px; align-items: center; padding: 6px 12px; border-radius: 99px;
  background: rgba(15,23,42,.72); color: #fff; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.share-cta { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); gap: 10px; margin-top: 18px; }
.share-cta.single { grid-template-columns: minmax(0, 1fr); }
.share-cta .btn { width: 100%; }
.share-hero .thumb .ic { width: 64px; height: 64px; max-width: none; max-height: none; }
.share-hero .thumb .ext { left: 14px; bottom: 14px; font-size: 12px; padding: 3px 9px; }
.share-name { font-size: 22px; line-height: 1.25; margin: 0 0 8px; letter-spacing: -.02em; overflow-wrap: anywhere; }
.share-facts { display: flex; gap: 8px; flex-wrap: wrap; }
.share-facts span { padding: 4px 10px; border-radius: 99px; background: var(--surface-3); font-size: 12.5px; color: var(--text-2); }
.share-row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 12px; }
.share-sum { margin-top: 16px; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.share-sum summary { cursor: pointer; font-weight: 600; font-size: 13.5px; color: var(--text-2); }
.share-sum code { display: block; margin: 10px 0 6px; }
.share-foot { text-align: center; color: var(--muted); font-size: 12.5px; margin: 18px 0 0; }
/* AllFiles Pro */
.pro-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 99px; font-size: 11.5px; font-weight: 800; letter-spacing: .03em;
  color: #fff; background: linear-gradient(135deg, #f59e0b, #f97316); vertical-align: middle; text-decoration: none; }
.pro-chip .ic-sm { width: 13px; height: 13px; }
.pro-up { font-weight: 800; color: #ea7a0c !important; }
.pro-warn { color: #ea7a0c; font-weight: 700; }
.pro-card { border: 1.5px solid color-mix(in srgb, #f59e0b 45%, var(--line)); background: linear-gradient(160deg, color-mix(in srgb, #f59e0b 9%, var(--surface)), var(--surface) 55%); }
.pro-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.pro-top b { font-size: 17px; flex: 1; min-width: 150px; }
.pro-price { font-size: 26px; font-weight: 800; letter-spacing: -.02em; } .pro-price small { font-size: 13px; font-weight: 600; color: var(--muted); }
.pro-list { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 8px; }
.pro-list li { display: flex; align-items: flex-start; gap: 8px; font-size: 14px; color: var(--text-2); }
.pro-list li .ic-sm { color: var(--ok); flex: none; margin-top: 2px; }
.pro-note { font-size: 12.5px; color: var(--muted); margin: 10px 0 0; line-height: 1.5; }
@media (min-width: 700px) { .pro-list { grid-template-columns: 1fr 1fr; } }

/* Tools sheet (phones: the Tools tab) */
.tools-head { display: flex; flex-direction: column; gap: 2px; padding: 0 4px 14px; }
.tools-head b { font-size: 18px; }
.tools-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 0 2px 6px; }
.tool-tile { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 6px 12px; border-radius: 18px;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--text); font-size: 12.5px; font-weight: 700; text-align: center; text-decoration: none; }
.tool-tile:active { transform: scale(.97); }
.tool-tile i { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; color: #fff; box-shadow: 0 6px 14px rgba(40, 30, 90, .18); }
.tool-tile i .ic { width: 22px; height: 22px; }
.tool-tile em { position: absolute; top: 7px; right: 7px; font-style: normal; font-size: 9.5px; font-weight: 800; letter-spacing: .02em; color: #fff; background: #6d4df2; padding: 2px 6px; border-radius: 99px; }
.tool-tile .t1 { background: linear-gradient(135deg, #7c3aed, #6366f1); } .tool-tile .t2 { background: linear-gradient(135deg, #0ea5e9, #22d3ee); }
.tool-tile .t3 { background: linear-gradient(135deg, #f59e0b, #f97316); } .tool-tile .t4 { background: linear-gradient(135deg, #10b981, #34d399); }
.tool-tile .t5 { background: linear-gradient(135deg, #ec4899, #f472b6); } .tool-tile .t6 { background: linear-gradient(135deg, #64748b, #94a3b8); }
.tool-tile .t7 { background: linear-gradient(135deg, #8b5cf6, #c084fc); } .tool-tile .t8 { background: linear-gradient(135deg, #14b8a6, #2dd4bf); }
.tool-tile .t9 { background: linear-gradient(135deg, #ef4444, #f87171); }
@media (min-width: 650px) { .tools-grid { grid-template-columns: repeat(3, 120px); justify-content: center; } }

/* Pages for long lists (K.pager) */
.pager { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; margin: 18px 0 8px; }
.pg-n { min-width: 36px; height: 36px; padding: 0 8px; border-radius: 11px; border: 1px solid var(--line); background: var(--surface); color: var(--text);
  font: 650 13.5px/1 var(--font); display: inline-grid; place-items: center; cursor: pointer; transition: background .15s, border-color .15s, color .15s; }
.pg-n:hover:not(:disabled):not(.on) { border-color: var(--line-2); background: var(--surface-2); }
.pg-n.on { background: var(--grad); border-color: transparent; color: #fff; box-shadow: var(--glow); cursor: default; }
.pg-n:disabled { opacity: .4; cursor: default; }
.pg-gap { color: var(--muted); padding: 0 2px; }
.pg-info { flex-basis: 100%; text-align: center; color: var(--muted); font-size: 12px; margin-top: 2px; }
.pg-top { display: block; height: 0; }
@media (max-width: 420px) { .pg-n { min-width: 32px; height: 34px; padding: 0 6px; border-radius: 10px; } .pager { gap: 4px; } }

/* Human check card (K.human) */
.human-box { position: fixed; inset: 0; z-index: 9999; display: grid; place-items: center; padding: 16px; background: rgba(12, 12, 28, .45); backdrop-filter: blur(3px); }
.human-box[hidden] { display: none; }
.human-card { width: min(360px, 100%); padding: 20px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 20px 60px rgba(20, 16, 60, .25); text-align: center; }
.human-card b { font-size: 17px; } .human-card p { margin: 6px 0 14px; color: var(--muted); font-size: 13.5px; }
.human-w { display: flex; justify-content: center; min-height: 65px; }

/* Share-page download box (design A): progress ring + one clear main action */
.dlbox { margin-top: 14px; animation: fadeUp .3s var(--ease); }
.dl-card { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); }
.dl-ring { --c: #6d4df2; width: 64px; height: 64px; flex: none; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--c) calc(var(--v) * 1%), var(--surface-3) 0); transition: background .4s var(--ease); }
.dl-ring > i { width: 50px; height: 50px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font-style: normal; }
.dl-ring b { font-size: 13.5px; font-weight: 800; letter-spacing: -.02em; }
.dl-ring .dl-ic { display: none; }
.dl-ring .dl-ic svg { width: 24px; height: 24px; stroke-width: 3; }
.dlbox.done .dl-ring { --c: var(--ok); --v: 100 !important; } .dlbox.done .dl-ring b { display: none; } .dlbox.done .dl-ring .dl-ic-ok { display: grid; color: var(--ok); }
.dlbox.error .dl-ring { --c: var(--bad); --v: 100 !important; } .dlbox.error .dl-ring b { display: none; } .dlbox.error .dl-ring .dl-ic-bad { display: grid; color: var(--bad); }
.dlbox.paused .dl-ring { --c: #a99cf0; }
.dlbox.warn .dl-ring { --c: var(--warn); }
.dlbox.checking .dl-ring { background: conic-gradient(var(--c) 0 25%, var(--surface-3) 0); animation: dlspin 1s linear infinite; }
.dlbox.checking .dl-ring b { animation: dlspin 1s linear infinite reverse; }
@keyframes dlspin { to { transform: rotate(360deg); } }
.dl-txt { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.dl-txt b { font-size: 15.5px; font-weight: 750; color: var(--text); }
.dl-txt span { font-size: 13px; color: var(--muted); line-height: 1.45; overflow-wrap: anywhere; }
.dlbox.error .dl-txt b { color: var(--bad); }
.dlbtns { display: flex; gap: 8px; margin-top: 12px; }
.dlbtns .btn { min-height: 46px; border-radius: 14px; font-weight: 700; white-space: nowrap; }
.dlbtns .btn.grow { flex: 1 1 0; }
.dlbtns .btn.dl-danger { color: var(--bad); }
.dl-foot { margin: 10px 0 0; text-align: center; font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.dl-foot:empty { display: none; }
.dl-foot a { color: var(--muted); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.dl-foot a:hover { color: var(--text-2); }
.dlbox.warn .dl-foot { color: var(--warn); }
@media (max-width: 380px) { .dl-card { gap: 12px; padding: 12px; } .dl-ring { width: 56px; height: 56px; } .dl-ring > i { width: 44px; height: 44px; } .dlbtns .btn { padding-inline: 12px; } }
@media (max-width: 309px) { .share-card { padding: 16px; } .share-name { font-size: 18px; } }

/* legacy column helpers kept for the admin panel */
.bnav-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.bnav-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }

/* Very small phones: Restore keeps only its icon so the file name and time left have room */
@media (max-width: 379px) { .trash-acts .lbl { display: none; } .trash-acts .btn.xs { padding-inline: 9px; } }
/* Tablets: four quick actions in a row leave ~100px for text, so the one-line hints wrapped into three
   ragged lines. Show just the title there; the hints come back when the tiles are wide enough (1130+). */
@media (min-width: 650px) and (max-width: 1129px) { .qa button small { display: none; } .qa button b { white-space: nowrap; } }
.note, .note > span, .note > div { text-wrap: pretty; }

/* ── Phase 1: stars, tags, recent, smart search, duplicates, zip, bundles ── */
.fstar { display: inline-flex; vertical-align: -2px; margin-right: 4px; color: #f59e0b; }
.fstar .ic-sm { width: 14px; height: 14px; }
.tdot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--c); flex: none; box-shadow: 0 0 0 2px color-mix(in srgb, var(--c) 22%, transparent); }
.tdot.lg { width: 14px; height: 14px; margin-right: 4px; }
.tdots { display: inline-flex; gap: 3px; align-items: center; margin-right: 2px; }
.tdots i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.folder .thumb[style*="--fc"] { color: var(--fc); background: color-mix(in srgb, var(--fc) 15%, transparent); }
.page-sub { margin: -8px 2px 16px; color: var(--muted); font-size: 13.5px; }

/* sidebar tags */
.nav-sec-row { display: flex; align-items: center; justify-content: space-between; }
.nav-add { width: 24px; height: 24px; border-radius: 8px; border: 0; background: transparent; color: var(--muted); display: grid; place-items: center; }
.nav-add:hover { background: var(--surface-3); color: var(--text); }
.side-tags { display: grid; gap: 2px; }
.side-tags a small { margin-left: auto; color: var(--muted); font-size: 12px; font-weight: 600; }
.side-tags a .tdot { margin: 0 3px; }
.side-hint { display: flex; align-items: center; gap: 8px; margin: 2px 6px; padding: 8px 10px; border: 1px dashed var(--line); border-radius: 12px; background: transparent; color: var(--muted); font-size: 12.5px; font-weight: 600; text-align: left; }
.side-hint:hover { color: var(--accent); border-color: var(--accent); }
@media (min-width: 880px) and (max-width: 959px) { .side-tags a small, .side-hint { display: none; } }

/* phone home: shortcut row */
.shortcuts { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 14px -2px 0; padding: 2px; }
.shortcuts::-webkit-scrollbar { display: none; }
.shortcuts a { flex: none; display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); color: var(--text); font-weight: 600; font-size: 13px; white-space: nowrap; }
.shortcuts a .ic-sm { color: var(--accent); width: 16px; height: 16px; }
.shortcuts a:active { transform: scale(.97); }
@media (min-width: 880px) { .shortcuts { display: none; } }

/* details panel: star + tags */
.det-star.on { color: #f59e0b; }
.det-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tchip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--line); color: var(--text-2); font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.tchip:hover { color: var(--text); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.tchip.add { border-style: dashed; background: transparent; color: var(--accent); }
.tchip .ic-sm { width: 14px; height: 14px; }

/* tags sheet */
.tagpick { display: grid; gap: 4px; max-height: 44vh; overflow-y: auto; margin: 4px 0 12px; }
.tagrow { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px; border: 1px solid transparent; background: var(--surface-2); color: var(--text); font-weight: 600; text-align: left; }
.tagrow span:not(.tick) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tagrow .tick { width: 22px; height: 22px; border-radius: 7px; border: 1.5px solid var(--line); display: grid; place-items: center; color: transparent; flex: none; }
.tagrow.on { border-color: color-mix(in srgb, var(--accent) 35%, transparent); background: var(--soft); }
.tagrow.on .tick { background: var(--accent); border-color: var(--accent); color: #fff; }
.tagnew { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.tagnew .swatches { grid-column: 1 / -1; grid-row: 2; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatches button { width: 28px; height: 28px; border-radius: 50%; border: 0; background: var(--c); box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px transparent; transition: box-shadow .15s; display: grid; place-items: center; color: var(--muted); }
.swatches button.on { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--c); }
.swatches button.none { background: var(--surface-2); border: 1.5px dashed var(--line); }
.swatches.lg { justify-content: center; gap: 12px; padding: 12px 0 6px; }
.swatches.lg button { width: 40px; height: 40px; }

/* smart search */
.sfbar { display: flex; gap: 7px; overflow-x: auto; scrollbar-width: none; padding: 1px 0 2px; margin-bottom: 12px; }
.sfbar::-webkit-scrollbar { display: none; }
.sfc { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 10px 0 13px; border-radius: 11px; border: 1px solid var(--line); background: var(--surface); color: var(--text-2); font-weight: 600; font-size: 13px; white-space: nowrap; }
.sfc .ic-sm { width: 14px; height: 14px; color: var(--muted); }
.sfc.on { background: var(--soft); border-color: color-mix(in srgb, var(--accent) 35%, transparent); color: var(--accent); }
.sfc.on .ic-sm { color: currentColor; }
.sfc .x { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 6px; margin-right: -4px; }
.sfc .x:hover { background: color-mix(in srgb, var(--accent) 15%, transparent); }
.sfc[data-sf-star].on .ic-sm { color: #f59e0b; }
.sf-tips { display: flex; flex-wrap: wrap; gap: 8px; padding: 18px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); }
.sf-tips b { flex: 1 1 100%; font-size: 14px; }
.sf-tips small { flex: 1 1 100%; color: var(--muted); margin-top: 4px; }
.sfopts .act .ic.ok { color: transparent; }
.sfopts .act.on { background: var(--soft); color: var(--accent); }
.sfopts .act.on .ic.ok { color: var(--accent); }

/* duplicates */
.dupsum { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.dupsum b { display: block; font-size: 16px; }
.dupsum small { color: var(--muted); font-size: 13px; line-height: 1.45; text-wrap: pretty; }
.dupbar { position: sticky; top: calc(var(--top-h, 60px) + 6px); z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 10px 10px 16px; margin-bottom: 12px;
  border-radius: 16px; background: var(--glass, var(--surface)); backdrop-filter: blur(12px); border: 1px solid var(--line); font-size: 13.5px; }
.dupgrp { margin-bottom: 10px; padding: 14px; }
.dup-h { display: flex; align-items: center; gap: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.dup-h .thumb { width: 44px; aspect-ratio: 1; border-radius: 13px; flex: none; }
.dup-h .thumb .ext { display: none; }
.dup-h > div { min-width: 0; }
.dup-h b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dup-h small { color: var(--muted); }
.duprow { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-top: 1px solid var(--line); cursor: pointer; }
.dup-h + .duprow { border-top: 0; }
.duprow input { width: 20px; height: 20px; accent-color: var(--bad); flex: none; }
.duprow .grow { flex: 1; min-width: 0; }
.duprow .t { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.duprow .s { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.duprow .s .ic-sm { width: 13px; height: 13px; flex: none; }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 99px; font-size: 11.5px; font-weight: 700; background: var(--surface-3); color: var(--text-2); flex: none; }
.pill.ok { background: rgba(16,185,129,.13); color: var(--ok); }
.pill.bad { background: rgba(239,68,68,.12); color: var(--bad); }

/* rows (account: links) */
.rows { display: grid; }
.rowi { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.rowi:first-child { border-top: 0; }
.rowi .grow { flex: 1; min-width: 0; }
.rowi .t { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rowi .s { font-size: 12.5px; color: var(--muted); }
.qa-ic.sm { width: 36px; height: 36px; border-radius: 11px; }
.qa-ic.sm .ic { width: 20px; height: 20px; }

/* zip progress sheet */
.zip-top { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.zip-top > div { min-width: 0; }
.zip-top b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15.5px; }
.zip-top small { color: var(--muted); }
.zip-ic { width: 48px; height: 48px; border-radius: 15px; display: grid; place-items: center; flex: none; color: #8b5cf6; background: color-mix(in srgb, #8b5cf6 14%, transparent); }
.zip-ic .ic { width: 28px; height: 28px; }
.zipbox .job-meta { margin-top: 10px; }
.bar.bad i { background: var(--bad); }

/* bundle page */
.bundle-col { max-width: 760px; }
.bundle-head { display: flex; align-items: center; gap: 14px; }
.bundle-head > div { min-width: 0; }
.bundle-head .share-name { margin: 0 0 6px; text-align: left; }
.bundle-head .share-facts { justify-content: flex-start; }
.bundle-ic { width: 60px; height: 60px; border-radius: 18px; display: grid; place-items: center; flex: none; color: var(--accent); background: var(--soft); }
.bundle-ic .ic { width: 34px; height: 34px; }
.bundle-list { margin-top: 18px; text-align: left; }
.bgal { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-bottom: 8px; }
.bgal-t { aspect-ratio: 1; border: 0; padding: 0; border-radius: 12px; overflow: hidden; background: var(--surface-2); display: grid; place-items: center; color: var(--muted); position: relative; }
.bgal-t img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s var(--ease); }
.bgal-t:hover img { transform: scale(1.04); }
.bgal-t .ic { width: 30px; height: 30px; }
.blist { display: grid; }
.brow { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-top: 1px solid var(--line); cursor: pointer; border-radius: 10px; }
.brow:first-child { border-top: 0; }
.brow:hover { background: var(--surface-2); }
.brow .thumb { width: 42px; aspect-ratio: 1; border-radius: 12px; flex: none; }
.brow .thumb .ext { display: none; }
.brow .fbody { flex: 1; }
.brow .fname { -webkit-line-clamp: 1; }
@media (min-width: 640px) { .bgal { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; } }
@media (max-width: 420px) { .bundle-head { align-items: flex-start; } .bundle-ic { width: 48px; height: 48px; border-radius: 15px; } .bundle-ic .ic { width: 28px; height: 28px; } }

/* sidebar "Tags +" stays on one line; laptop table: tag dots sit right after the name, not on a line of their own */
@media (min-width: 960px) { .side .nav-sec.nav-sec-row { display: flex; } }
@media (min-width: 880px) {
  .grid.list:not(.rlist) .fbody { display: flex; align-items: center; gap: 8px; }
  .grid.list:not(.rlist) .fbody .fname { flex: 0 1 auto; min-width: 0; }
  .grid.list:not(.rlist) .fbody .fmeta { flex: none; }
  .grid.list:not(.rlist) .fbody .bar { flex: 1 1 60px; margin-top: 0; }
}
.dupbar > span { display: grid; line-height: 1.3; min-width: 0; }
.dupbar > span small { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
/* narrow phones: all seven selection buttons fit on one line */
@media (max-width: 419px) { .selbar { gap: 0; padding: 6px; } .selbar .icon-btn { width: 36px; height: 36px; } .selbar b { font-size: 13px; padding: 0 2px; } }
@media (max-width: 339px) { .selbar [data-sel-all] { display: none; } }

/* ── Phase 2: sharing — send, link names, collections, links page, stats, branding ── */
.sendacts { padding: 14px 0 6px; }
.sendacts .sa-c.wa { background: color-mix(in srgb, #25d366 16%, transparent); color: #1faa55; }
.field > span em { font-style: normal; font-weight: 500; color: var(--muted); font-size: 12px; margin-left: 4px; }
.slugin { display: flex; align-items: stretch; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); overflow: hidden; transition: border-color .15s, box-shadow .15s; }
.slugin:focus-within { border-color: var(--accent); box-shadow: var(--ring); }
.slugin em { font-style: normal; display: flex; align-items: center; padding: 0 2px 0 12px; color: var(--muted); font-size: 13px; white-space: nowrap; max-width: 55%; overflow: hidden; text-overflow: ellipsis; direction: rtl; }
.slugin .input { border: 0; box-shadow: none !important; background: transparent; padding-left: 2px; min-width: 0; flex: 1; }
.form-2 { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 440px) { .form-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.row.compact { border: 0; padding: 4px 0; cursor: pointer; }
textarea.input { resize: vertical; min-height: 64px; line-height: 1.45; padding-top: 10px; font: inherit; }
.cfiles { display: grid; gap: 4px; max-height: 200px; overflow-y: auto; }
.cfile { display: flex; align-items: center; gap: 10px; padding: 6px 4px 6px 6px; border-radius: 12px; background: var(--surface-2); }
.cfile .thumb { width: 32px; aspect-ratio: 1; border-radius: 9px; flex: none; }
.cfile .thumb .ext { display: none; }
.cfile .thumb .ic { width: 18px; height: 18px; }
.cfile span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; font-weight: 600; }

/* shared links page */
.lrows { display: grid; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); overflow: hidden; }
.lrow { display: flex; align-items: center; gap: 12px; padding: 12px 8px 12px 14px; border-top: 1px solid var(--line); cursor: pointer; position: relative; animation: fadeUp .35s var(--ease) both; animation-delay: calc(var(--i, 0) * 35ms); }
.lrow:first-child { border-top: 0; }
.lrow:hover { background: var(--surface-2); }
.lrow > .thumb { width: 40px; aspect-ratio: 1; border-radius: 12px; flex: none; }
.lrow > .thumb .ext { display: none; }
.lrow .grow { flex: 1; min-width: 0; }
.lrow .t { font-weight: 700; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lrow .s { display: flex; gap: 10px; align-items: center; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; }
.lrow .s span { display: inline-flex; align-items: center; gap: 3px; flex: none; }
.lrow .s .u { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--accent); font-weight: 600; }
.lrow .s .ic-sm { width: 13px; height: 13px; }
.lst { display: grid; text-align: center; min-width: 58px; flex: none; }
.lst b { font: 800 17px var(--font-display); }
.lst small { font-size: 11px; color: var(--muted); font-weight: 600; }
.lrow .kebab { position: static; transform: none; flex: none; }
@media (max-width: 559px) { .lst + .lst { display: none; } .lst { min-width: 44px; } }

/* link stats */
.shead { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; padding: 14px 16px; }
.shead .grow { flex: 1; min-width: 0; display: grid; }
.shead b { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shead a { display: inline-flex; align-items: center; gap: 4px; color: var(--accent); font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kpis { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 12px; }
@media (min-width: 760px) { .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.kpi { padding: 14px 16px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); animation: fadeUp .4s var(--ease) both; animation-delay: calc(var(--i, 0) * 50ms); }
.kpi span { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.kpi span .ic { width: 16px; height: 16px; color: var(--accent); }
.kpi b { display: block; font: 800 28px/1.15 var(--font-display); margin-top: 6px; letter-spacing: -.02em; }
.kpi b.sm { font-size: 18px; margin-top: 10px; }
.schart h3 { flex-wrap: wrap; }
.legend { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); font-weight: 600; font-family: var(--font); }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-left: 8px; }
.legend i.v, .c2b i.v { background: var(--accent); }
.legend i.d, .c2b i.d { background: #10b981; }
.chart2 { display: flex; align-items: flex-end; gap: 3px; height: 150px; }
.c2 { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; gap: 4px; }
.c2b { flex: 1; display: flex; align-items: flex-end; justify-content: center; gap: 1px; border-radius: 6px; background: color-mix(in srgb, var(--track) 55%, transparent); padding: 0 1px; }
.c2b i { flex: 1; max-width: 12px; border-radius: 4px 4px 1px 1px; min-height: 0; transition: height .5s var(--ease); }
.c2 small { height: 14px; font-size: 10.5px; color: var(--muted); text-align: center; }
.sgrid { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); margin-top: 12px; }
@media (min-width: 760px) { .sgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.sbar { padding: 7px 0; }
.sbar-l { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; margin-bottom: 5px; }
.sbar-l span { display: inline-flex; align-items: center; gap: 6px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.sbar-l em { font-style: normal; color: var(--muted); font-weight: 500; }
.sbar-l .ic-sm { color: var(--muted); }
.bar.thin { height: 6px; }
.sub2 { margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--line); }
.ev { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--soft); color: var(--accent); }
.ev.download, .ev.zip { background: color-mix(in srgb, #10b981 14%, transparent); color: #10b981; }
.ev.preview { background: var(--surface-3); color: var(--muted); }
.rowi small.muted { flex: none; font-size: 12px; }

/* branding editor (Account) */
.brand-ed { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .brand-ed { grid-template-columns: minmax(0, 1fr) 300px; align-items: start; } }
.logo-row { display: flex; align-items: center; gap: 10px; }
.logo-prev { width: 52px; height: 52px; border-radius: 14px; background: var(--surface-2); border: 1px dashed var(--line); display: grid; place-items: center; color: var(--muted); overflow: hidden; flex: none; }
.logo-prev img { width: 100%; height: 100%; object-fit: contain; }
.logo-row label.btn { cursor: pointer; }
.swatch-custom { width: 28px; height: 28px; border-radius: 50%; overflow: hidden; background: conic-gradient(#ef4444, #f59e0b, #10b981, #0ea5e9, #6366f1, #ec4899, #ef4444); position: relative; cursor: pointer; }
.swatch-custom input { opacity: 0; position: absolute; inset: 0; width: 100%; height: 100%; cursor: pointer; }
.brand-prev { position: sticky; top: 90px; }
.brand-prev > small { display: block; margin-bottom: 6px; }
.bp { border-radius: 18px; padding: 14px; background: linear-gradient(160deg, color-mix(in srgb, var(--bc) 18%, var(--bg)), var(--bg)); border: 1px solid var(--line); }
.bp-h { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 2px 0 12px; font: 800 15px var(--font-display); }
.bp-h img { width: 28px; height: 28px; border-radius: 8px; object-fit: contain; }
.bp-card { background: var(--surface); border-radius: 14px; padding: 14px; text-align: center; display: grid; justify-items: center; gap: 4px; box-shadow: var(--shadow-1, 0 4px 14px -8px rgba(0,0,0,.2)); }
.bp-thumb { width: 64px; height: 50px; border-radius: 12px; display: grid; place-items: center; color: var(--bc); background: color-mix(in srgb, var(--bc) 14%, transparent); margin-bottom: 4px; }
.bp-thumb .ic { width: 28px; height: 28px; }
.bp-card small { color: var(--muted); font-size: 11.5px; }
.bp-card p { margin: 6px 0 2px; font-size: 12px; color: var(--text-2); background: var(--surface-2); border-radius: 10px; padding: 8px 10px; white-space: pre-wrap; text-wrap: pretty; }
.bp-btn { margin-top: 8px; display: inline-flex; align-items: center; gap: 5px; padding: 7px 16px; border-radius: 10px; background: var(--bc); color: #fff; font-weight: 700; font-size: 12.5px; }
.bp-link { font-size: 12px; font-weight: 700; color: var(--bc); margin-top: 4px; }

/* share pages: owner branding, descriptions, folders */
.brand-own { justify-content: center; }
.brand-own img { width: 40px; height: 40px; border-radius: 12px; object-fit: contain; background: var(--surface); box-shadow: 0 6px 16px -8px rgba(0,0,0,.35); }
.brand-card { margin-top: 14px; padding: 14px 16px; border-radius: 16px; background: var(--soft); text-align: center; display: grid; gap: 10px; justify-items: center; }
.brand-card p { margin: 0; font-size: 14px; line-height: 1.5; color: var(--text); text-wrap: pretty; }
.brand-card .btn small { font-weight: 500; color: var(--muted); margin-left: 4px; }
.bundle-desc { margin: 12px 0 0; color: var(--text-2); font-size: 14.5px; line-height: 1.55; text-align: left; white-space: normal; text-wrap: pretty; }
.bcrumbs { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin: 0 0 6px; font-size: 13.5px; color: var(--muted); }
.bcrumbs a { color: var(--accent); font-weight: 600; display: inline-flex; align-items: center; gap: 5px; }
.bcrumbs b { color: var(--text); }
.bfolds { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); margin-bottom: 6px; }
.bfold { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: var(--surface-2); color: var(--text); border: 1px solid var(--line); }
.bfold:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.bfold > span:nth-child(2) { flex: 1; min-width: 0; display: grid; }
.bfold b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.bfold small { color: var(--muted); font-size: 12px; }
.bf-ic { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; color: var(--accent); background: var(--soft); flex: none; }
.bf-ic .ic { width: 20px; height: 20px; }
.bgal-t.file { display: grid; place-items: center; align-content: center; gap: 6px; padding: 10px; color: var(--tc, var(--accent)); background: color-mix(in srgb, var(--tc, var(--accent)) 12%, var(--surface-2)); }
.bgal-t.file .ic { width: 34px; height: 34px; }
.bgal-t.file small { font-size: 11px; color: var(--text-2); font-weight: 600; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* grid lists never grow wider than the screen (an auto track sizes to the longest name) */
.lrows, .rows, .blist, .cfiles, .tagpick, .side-tags { grid-template-columns: minmax(0, 1fr); }
.bfolds { grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr)); }
@media (max-width: 639px) { .stats-tb .tb-tools { flex: 1 1 100%; order: 3; } .stats-tb .tb-tools .seg { display: flex; width: 100%; } .stats-tb .tb-tools .seg button { flex: 1; } }

/* file versions */
.vlist { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; margin-top: 8px; }
.vrow { display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 12px; border-radius: 14px; background: var(--surface-2); }
.vrow.cur { background: var(--soft); }
.vn { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; font: 800 12.5px var(--font-display); background: var(--surface); color: var(--text-2); }
.vrow.cur .vn { background: var(--accent); color: #fff; }
.vrow .grow { flex: 1; min-width: 0; }
.vrow .t { font-weight: 700; font-size: 14px; }
.vrow .s { font-size: 12.5px; color: var(--muted); }
.vacts { display: flex; align-items: center; gap: 2px; flex: none; }
@media (max-width: 400px) { .vacts .btn.xs { padding: 0 9px; font-size: 0; gap: 0; } .vacts .btn.xs .ic-sm { margin: 0; } }

/* notes: editor sheet + Pastebin-style view on the share page */
.note-ed { display: grid; gap: 10px; }
.note-top { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.note-title { font-weight: 700; font-size: 16px; }
.note-type { width: auto; max-width: 150px; }
.note-text { width: 100%; min-height: 46vh; resize: vertical; padding: 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text);
  font: 13.5px/1.6 ui-monospace, "SF Mono", "Cascadia Code", Consolas, monospace; tab-size: 2; outline: none; }
.note-text:focus { border-color: var(--accent); box-shadow: var(--ring); background: var(--surface); }
.note-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.note-where { margin: -2px 2px 0; }
@media (min-width: 650px) { .sheet.note-sheet { width: min(860px, 94vw); max-width: none; } .note-text { min-height: 52vh; } }
@media (max-width: 649px) { .sheet.note-sheet { max-height: 94dvh; } .note-text { min-height: 44dvh; }
  .note-foot { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); } .note-foot > span { display: none; } .note-foot > span.muted { display: block; grid-column: 1 / -1; order: -2; }
  .note-foot [data-a=share] { grid-column: 1 / -1; order: -1; } }
.share-hero.paste-hero { height: auto; min-height: 0; background: none; padding: 0; cursor: default; aspect-ratio: auto; display: block; }
.paste { border-radius: 16px; overflow: hidden; border: 1px solid var(--line); background: #0d1017; text-align: left; }
.paste-bar { display: flex; align-items: center; gap: 6px; padding: 8px 8px 8px 14px; background: #151a24; color: #aeb7c7; font-size: 12.5px; font-weight: 600; }
.paste-lang { display: inline-flex; align-items: center; gap: 6px; }
.pb { display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 10px; border-radius: 9px; border: 0; background: rgba(255,255,255,.07); color: #d6deeb; font-size: 12.5px; font-weight: 600; }
.pb:hover, .pb.on { background: rgba(255,255,255,.14); }
.paste-body { max-height: 62vh; overflow: auto; min-height: 90px; }
.paste-body.doc { background: #fff; }
.paste-body.doc .doc-page { margin: 0; box-shadow: none; border-radius: 0; max-width: none; padding: 20px 22px; --z: 1; }
.paste.wrap .code-src { white-space: pre-wrap; word-break: break-word; }
.paste.wrap .code-ln { display: none; }

/* secret messages */
.secret-card { text-align: center; }
.secret-intro h1 { font-size: 22px; margin: 4px 0 8px; }
.secret-intro p { color: var(--text-2); margin: 0 0 16px; line-height: 1.5; }
.secret-intro .input { margin: 0 0 10px; text-align: center; }
.secret-intro .err { color: var(--bad); font-weight: 600; font-size: 13.5px; min-height: 0; margin-bottom: 10px; }
.secret-intro .err:empty { display: none; }
.secret-intro .muted .ic-sm { display: inline-block; vertical-align: -3px; margin-right: 4px; }
.secret-ic { width: 88px; height: 88px; margin: 4px auto 14px; border-radius: 26px; display: grid; place-items: center; color: #ef4444; background: color-mix(in srgb, #ef4444 13%, transparent); }
.secret-ic .ic { width: 46px; height: 46px; }
.secret-out { text-align: left; }
.secret-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.secret-top .pill .ic-sm { width: 13px; height: 13px; }
.secret-text { margin: 0; padding: 16px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); white-space: pre-wrap; word-break: break-word;
  font: 15px/1.55 var(--font); color: var(--text); max-height: 55vh; overflow: auto; user-select: all; }
.pill.warn { background: color-mix(in srgb, #f59e0b 16%, transparent); color: #b45309; }
.srow { cursor: default; }
.srow .pill { flex: none; }
@media (max-width: 459px) { .srow .pill { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } }

/* watermark sheet */
.wm-prev { display: grid; place-items: center; background: repeating-conic-gradient(var(--surface-2) 0 25%, var(--surface) 0 50%) 0 0 / 16px 16px; border-radius: 14px; padding: 8px; margin: 4px 0 12px; }
.wm-prev canvas { max-width: 100%; max-height: 34vh; width: auto; height: auto; border-radius: 8px; box-shadow: 0 6px 18px -8px rgba(0,0,0,.35); }
input[type=range] { width: 100%; accent-color: var(--accent); height: 36px; }

/* security: two-step login + devices */
.code-in { font: 700 22px/1 ui-monospace, "SF Mono", Consolas, monospace; letter-spacing: .18em; text-align: center; }
.steps { margin: 4px 0 12px; padding-left: 20px; display: grid; gap: 6px; font-size: 14px; color: var(--text-2); line-height: 1.45; }
.bcodes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 12px 0 4px; }
.bcodes code { font: 700 15px ui-monospace, Consolas, monospace; text-align: center; padding: 10px; border-radius: 12px; background: var(--surface-2); border: 1px dashed var(--line); letter-spacing: .06em; user-select: all; }
.devs .rowi { padding: 10px 0; }
.dev-ic { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); color: var(--text-2); flex: none; }
.devs .t .pill { margin-left: 6px; vertical-align: 1px; }
.row-btns { display: inline-flex; gap: 6px; flex-wrap: wrap; }

button.link { background: none; border: 0; padding: 0; color: var(--accent); font-weight: 600; font-size: 13.5px; cursor: pointer; }
button.link:hover { text-decoration: underline; }
@media (max-width: 479px) { .hide-xs { display: none; } }

/* activity log */
.actlist { margin-bottom: 6px; }
.arow { cursor: default; padding: 11px 14px; align-items: flex-start; }
.arow .t2 { font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; text-wrap: pretty; }
.arow .t2 b { font-weight: 700; }
.arow small { flex: none; padding-top: 2px; }
.ev.act-ok { background: color-mix(in srgb, #10b981 14%, transparent); color: #10b981; }
.ev.act-bad { background: color-mix(in srgb, var(--bad) 12%, transparent); color: var(--bad); }
.ev.act-warn { background: color-mix(in srgb, #f59e0b 15%, transparent); color: #d97706; }
.ev.act-acc { background: var(--soft); color: var(--accent); }

/* teams: space switcher, team bar, members */
.sw-av { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; flex: none; font: 800 14px var(--font-display); color: #fff; background: linear-gradient(135deg, #64748b, #94a3b8); }
.sw-av.team { background: linear-gradient(135deg, #0ea5e9, #6366f1); }
.sw-av.add { background: var(--soft); color: var(--accent); }
.sw-av.lg { width: 48px; height: 48px; border-radius: 14px; font-size: 20px; }
.space-sw { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); background: var(--surface); border-radius: 14px; padding: 7px 10px 7px 7px; color: var(--text); text-align: left; min-width: 0; }
.space-sw:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.space-sw .sw-t { display: grid; min-width: 0; flex: 1; }
.space-sw .sw-t b { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.space-sw .sw-t small { font-size: 11.5px; color: var(--muted); }
.space-sw > .ic-sm { color: var(--muted); flex: none; }
.space-sw.sw-side { margin: 0 0 12px; width: 100%; }
.space-sw.sw-top { padding: 4px 8px 4px 4px; gap: 7px; max-width: 46vw; margin-left: 6px; }
.space-sw.sw-top .sw-av { width: 26px; height: 26px; border-radius: 8px; font-size: 12px; }
.space-sw.sw-top .sw-t b { font-size: 13px; }
@media (min-width: 880px) { .space-sw.sw-top { display: none; } }
@media (min-width: 880px) and (max-width: 959px) { .space-sw.sw-side { padding: 6px; justify-content: center; } .space-sw.sw-side .sw-t, .space-sw.sw-side > .ic-sm { display: none; } }
.team-bar { display: flex; align-items: center; gap: 10px; margin: 10px var(--gut) 0; padding: 9px 12px; border-radius: 14px; font-size: 13.5px;
  background: linear-gradient(90deg, color-mix(in srgb, #0ea5e9 13%, transparent), color-mix(in srgb, #6366f1 12%, transparent)); border: 1px solid color-mix(in srgb, #6366f1 22%, transparent); }
.team-bar > span:nth-child(2) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-bar .tb-av { width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center; font: 800 12px var(--font-display); color: #fff; background: linear-gradient(135deg, #0ea5e9, #6366f1); flex: none; }
.spaces .act.on { background: var(--soft); }
.spaces .act .sw-av { width: 38px; height: 38px; }
.tmembers { margin-top: 6px; }
.tmembers .input.sm { width: auto; height: 34px; padding: 0 8px; flex: none; }
.tadd { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; margin-top: 12px; }
.tadd .input { height: 42px; }
@media (max-width: 479px) { .tadd { grid-template-columns: minmax(0, 1fr) auto; } .tadd .btn { grid-column: 1 / -1; } }
.role-help { margin: 12px 0 4px; padding-left: 18px; font-size: 12.5px; color: var(--muted); display: grid; gap: 3px; }
/* view-only members: no create / change buttons */
body.role-viewer .fab, body.role-viewer .new-btn, body.role-viewer .qa, body.role-viewer [data-upload], body.role-viewer [data-newfolder],
body.role-viewer [data-sel-delete], body.role-viewer [data-empty-trash] { display: none !important; }
/* the sidebar scrolls instead of squashing its items (it holds more now: tags, tools, spaces) */
.side > * { flex-shrink: 0; }
.spaces .act > span.sw-av, .act > span.sw-av { flex: none; }
.auth-tools { display: flex; align-items: center; justify-content: center; gap: 7px; margin: 14px auto 0; padding: 9px 14px; border-radius: 99px; font-size: 13px; font-weight: 600;
  color: var(--accent); background: color-mix(in srgb, var(--surface) 70%, transparent); border: 1px solid var(--line); width: fit-content; max-width: 100%; text-align: center; text-decoration: none; }
.auth-tools:hover { border-color: var(--accent); }
.auth-tools .ic-sm { flex: none; }

.team-open { margin-top: 16px; }
.team-foot { margin-top: 8px; justify-content: center; }
.brand-save { align-items: center; flex-wrap: wrap; }
.brand-save [data-berr]:empty { display: none; }
.brand-save [data-berr] { flex: 1 1 100%; text-align: right; }
.brand-save [data-bdirty] { margin-right: auto; color: #d97706; font-weight: 600; }
