/* ============================================================================
   AVideoRouter interface. Every value here comes from tokens.css — see
   UI-STRICTURES.md. Do not introduce a literal colour, font size, spacing value
   or radius in this file or in a template.
   ========================================================================== */
@import url("/public/tokens.css");

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--surface-page);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-weight: 400;
  /* §15.1 — no horizontal page scroll at any width */
  overflow-x: hidden;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- §15.4 focus floor: a visible ring on every interactive element --- */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
  border-radius: var(--r-control);
}

/* ---------- §16 motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

/* ============================================================================
   Typography (§2). Nothing between these sizes. 10px is banned.
   ========================================================================== */
h1, .title-1 {
  font-size: var(--fs-title-1); line-height: var(--lh-title-1);
  font-weight: 700; letter-spacing: -.02em;
  margin: 0 0 var(--sp-4); color: var(--text-primary);
}
h2, .title-2 {
  font-size: var(--fs-title-2); line-height: var(--lh-title-2);
  font-weight: 650; letter-spacing: 0;
  margin: 0 0 var(--sp-3); color: var(--text-primary);
}
h3, .title-3 {
  font-size: var(--fs-title-3); line-height: var(--lh-title-3);
  font-weight: 600; margin: 0 0 var(--sp-2); color: var(--text-primary);
}
.display {
  font-size: var(--fs-display); line-height: var(--lh-display);
  font-weight: 700; letter-spacing: -.02em;
}
.small { font-size: var(--fs-small); line-height: var(--lh-small); }
/* §2 — micro is for all-caps group labels and nothing else */
.micro {
  font-size: var(--fs-micro); line-height: var(--lh-micro);
  font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: var(--text-tertiary);
}
/* Help text is secondary, never tertiary. Tertiary is timestamps and counts. */
.muted { color: var(--text-secondary); }
.meta  { color: var(--text-tertiary); font-size: var(--fs-small); line-height: var(--lh-small); }
.mono  { font-family: var(--font-mono); font-size: var(--fs-small); }
.nowrap { white-space: nowrap; }
/* §4 — reading text is capped, not the full container width */
.measure { max-width: var(--measure); }

/* ============================================================================
   App shell
   ========================================================================== */
nav {
  display: flex; align-items: center; gap: var(--sp-1);
  padding: var(--sp-2) var(--gutter);
  background: var(--surface-raised);
  border-bottom: 1px solid var(--line-default);
  min-height: var(--header-h);
  flex-wrap: wrap;
}
nav .brand {
  font-size: var(--fs-title-3); line-height: var(--lh-title-3);
  font-weight: 700; margin-right: var(--sp-4); color: var(--text-primary);
}
nav a.tab {
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-control);
  color: var(--text-secondary);
  font-size: var(--fs-small); line-height: var(--lh-small);
  position: relative;
  transition: background-color var(--dur-hover) var(--ease), color var(--dur-hover) var(--ease);
}
/* §8.3 — active and hover must differ by two properties, not one.
   Hover: raised surface only. Active: wash + brand indicator + primary text. */
nav a.tab:hover { background: var(--surface-sunken); color: var(--text-primary); text-decoration: none; }
nav a.tab.active {
  background: var(--brand-wash); color: var(--text-primary); font-weight: 600;
}
nav a.tab.active::after {
  content: ""; position: absolute; left: var(--sp-3); right: var(--sp-3); bottom: -1px;
  height: 2px; background: var(--brand); border-radius: var(--r-pill);
}

main {
  /* §4 — one content container, the same on every route. No page overrides it. */
  max-width: var(--container-app);
  margin: var(--sp-6) auto;
  padding: 0 var(--gutter);
}

/* Dense tables stay inside .table-wrap, which scrolls on its own; the page
   itself never scrolls sideways. */
td.trunc { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ============================================================================
   Cards (§5) — 12 radius, hairline border, one soft shadow in light only
   ========================================================================== */
.card {
  background: var(--surface-raised);
  border: 1px solid var(--line-subtle);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
  padding: var(--sp-6);
  margin-bottom: var(--sp-4);   /* §3 — gap between cards is 16 */
}
@media (max-width: 720px) {
  .card { padding: var(--sp-5); }  /* 20 on mobile */
}
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: var(--sp-4); }
.row { display: flex; gap: var(--sp-3); flex-wrap: wrap; align-items: flex-end; }

/* §9 — page template: title once, then an optional one-line description */
.page-desc {
  font-size: var(--fs-small); line-height: var(--lh-small);
  color: var(--text-secondary); margin: 0 0 var(--sp-6); max-width: var(--measure);
}

/* ============================================================================
   Forms (§11)
   ========================================================================== */
label {
  display: block;
  font-size: var(--fs-body); line-height: var(--lh-body);
  color: var(--text-primary);
  margin: 0 0 var(--sp-2);     /* label to field is 8 */
}
label .req { color: var(--danger); margin-left: var(--sp-1); }

input, select, textarea {
  width: 100%;
  padding: var(--sp-2) var(--sp-3);   /* 12 horizontal, 8 vertical */
  min-height: 44px;                    /* §15.5 tap target */
  border-radius: var(--r-control);
  border: 1px solid var(--line-default);
  background: var(--surface-page);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  transition: border-color var(--dur-hover) var(--ease);
}
input:hover, select:hover, textarea:hover { border-color: var(--line-strong); }

/* §11 bans the browser's own select chrome. Rebuilding every dropdown as a
   custom listbox would rewrite working flows, so the native control is kept for
   its behaviour and keyboard support while its chrome is replaced: the arrow is
   an inline SVG (not a text glyph, per §6) tinted by the theme.
   The stroke hex is spelled out because a data URI cannot resolve var(); the two
   values are --text-secondary in light and dark. Change them together. */
select {
  appearance: none; -webkit-appearance: none;
  padding-right: var(--sp-8);
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--sp-3) center;
}
:root[data-theme="dark"] select {
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23aab8c9' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}
select::-ms-expand { display: none; }

/* §11 — field width follows content. Only sentences get the full width. */
.field { flex: 1 1 180px; }
.field-narrow { flex: 0 0 240px; max-width: 240px; }
input[type="number"], input[type="date"], input[type="time"] { max-width: 240px; }

/* §11 — help text under the field, small, secondary, 6px off the field */
.help {
  display: block; margin-top: 6px;
  font-size: var(--fs-small); line-height: var(--lh-small);
  color: var(--text-secondary);
}
/* §11 — validation under the field, in danger, with an icon */
.err-text {
  display: flex; gap: var(--sp-1); align-items: center; margin-top: 6px;
  font-size: var(--fs-small); line-height: var(--lh-small); color: var(--danger);
}
.fieldset { margin-bottom: var(--sp-5); }  /* field group to next group is 20 */

/* ============================================================================
   Buttons (§7) — three variants, two sizes, exactly one primary per region
   ========================================================================== */
button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  min-height: 44px; padding: var(--sp-2) var(--sp-4);
  border-radius: var(--r-control);
  border: 1px solid var(--line-default);
  background: transparent;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: var(--fs-body); line-height: var(--lh-body); font-weight: 500;
  cursor: pointer;
  transition: background-color var(--dur-hover) var(--ease), border-color var(--dur-hover) var(--ease),
              color var(--dur-hover) var(--ease);
}
button:hover, .btn:hover { background: var(--surface-sunken); text-decoration: none; }

/* primary — the one action the user came to the screen to do */
button.primary, .btn.primary {
  background: var(--brand); border-color: var(--brand); color: var(--brand-contrast); font-weight: 600;
}
button.primary:hover, .btn.primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
button.primary:active, .btn.primary:active { background: var(--brand-active); border-color: var(--brand-active); }

/* ghost — table rows and toolbars */
button.ghost, .btn.ghost { border-color: transparent; color: var(--text-secondary); }
button.ghost:hover, .btn.ghost:hover { background: var(--surface-sunken); color: var(--text-primary); }

/* danger — destructive confirmation only */
button.danger, .btn.danger { border-color: var(--line-default); color: var(--danger); }
button.danger:hover, .btn.danger:hover { background: var(--danger-wash); border-color: var(--danger); }
button.danger.primary, .btn.danger.primary {
  background: var(--danger); border-color: var(--danger); color: var(--text-inverse);
}

/* §7 — 36px compact for toolbars and table rows, 44px default */
button.compact, .btn.compact {
  min-height: 36px; padding: var(--sp-1) var(--sp-3);
  font-size: var(--fs-small); line-height: var(--lh-small);
}
button:disabled, .btn:disabled { opacity: .5; cursor: default; }
button:disabled:hover { background: transparent; }

/* ============================================================================
   Tables
   ========================================================================== */
table { width: 100%; border-collapse: collapse; font-size: var(--fs-small); line-height: var(--lh-small); }
th, td { text-align: left; padding: var(--sp-2) var(--sp-3); border-bottom: 1px solid var(--line-subtle); vertical-align: top; }
th {
  color: var(--text-tertiary); font-weight: 600; white-space: nowrap;
  font-size: var(--fs-micro); line-height: var(--lh-micro); letter-spacing: .06em; text-transform: uppercase;
}
tr:hover td { background: var(--surface-sunken); }
.table-wrap { overflow-x: auto; }

/* ============================================================================
   Badges (§5 — pills are 999)
   ========================================================================== */
.badge {
  display: inline-block; padding: 2px var(--sp-2);
  border-radius: var(--r-pill);
  font-size: var(--fs-small); line-height: var(--lh-small); font-weight: 500;
  background: var(--surface-sunken); color: var(--text-secondary); white-space: nowrap;
}
.badge.ok   { background: var(--success-wash); color: var(--success); }
.badge.warn { background: var(--warning-wash); color: var(--warning); }
.badge.err  { background: var(--danger-wash);  color: var(--danger); }
.badge.info { background: var(--info-wash);    color: var(--info); }
/* On the auth cards the badge carries a full sentence, not a one-word chip. */
.login-box .badge {
  display: block; white-space: normal; padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-control);
}

/* ============================================================================
   Empty state (§10) — one component, used everywhere
   ========================================================================== */
.empty {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: var(--sp-12) var(--sp-6); gap: var(--sp-2);
}
.empty svg { width: 32px; height: 32px; color: var(--text-tertiary); margin-bottom: var(--sp-2); }
.empty .what {
  font-size: var(--fs-title-3); line-height: var(--lh-title-3);
  font-weight: 600; color: var(--text-primary);
}
.empty .why {
  font-size: var(--fs-small); line-height: var(--lh-small);
  color: var(--text-secondary); max-width: var(--measure);
}
.empty > button, .empty > .btn { margin-top: var(--sp-2); }

/* ============================================================================
   Stat tiles (§14) — equal height, label + value, money no different in colour
   ========================================================================== */
.stat {
  display: flex; flex-direction: column; justify-content: flex-start;
  gap: var(--sp-1); height: 100%; text-align: left;
}
.stat .num {
  font-size: var(--fs-title-1); line-height: var(--lh-title-1);
  font-weight: 700; color: var(--text-primary); letter-spacing: -.02em;
}
.stat .lbl {
  color: var(--text-tertiary);
  font-size: var(--fs-micro); line-height: var(--lh-micro);
  font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
}
.stat .chg { font-size: var(--fs-small); line-height: var(--lh-small); color: var(--text-secondary); }
.grid.stats { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); align-items: stretch; }
.grid.stats > .card { margin-bottom: 0; }

/* ============================================================================
   Progress bar
   ========================================================================== */
.pbar {
  width: 130px; height: 8px; border-radius: var(--r-pill);
  background: var(--surface-sunken);
  overflow: hidden; display: inline-block; vertical-align: middle;
}
/* §15.6 — a bar at 0% renders empty. No min-width, no fill at zero. */
.pbar > span {
  display: block; height: 100%; background: var(--brand); width: 0;
  transition: width var(--dur-panel) var(--ease);
}
.pbar.indet > span { width: 35%; animation: indet 1.1s infinite ease-in-out; }
@keyframes indet { 0% { margin-left: -35%; } 100% { margin-left: 100%; } }

/* ============================================================================
   Context bar (impersonation / staff notice)
   ========================================================================== */
.ctxbar { padding: var(--sp-2) var(--gutter); font-size: var(--fs-small); line-height: var(--lh-small); }
.ctxbar.on {
  background: var(--info-wash); border-bottom: 1px solid var(--info); color: var(--text-primary);
}
.ctxbar.staff {
  background: var(--warning-wash); border-bottom: 1px solid var(--warning); color: var(--text-primary);
}
.ctxbar a { font-weight: 600; }

/* ---------- inline copy button (ghost, compact) ---------- */
button.copy {
  min-height: 28px; padding: 0 var(--sp-2);
  font-size: var(--fs-small); line-height: var(--lh-small);
  vertical-align: middle; min-width: 46px;
  border-color: transparent; color: var(--text-secondary);
}
button.copy:hover { background: var(--surface-sunken); color: var(--text-primary); }
button.copy.copied { color: var(--success); border-color: var(--success); }

/* ---------- toast ---------- */
#toast {
  position: fixed; bottom: var(--sp-5); right: var(--sp-5);
  padding: var(--sp-3) var(--sp-4); border-radius: var(--r-control);
  background: var(--surface-overlay); border: 1px solid var(--line-default);
  box-shadow: var(--shadow-overlay);
  color: var(--text-primary);
  display: none; max-width: 420px; z-index: 10;
}
#toast.ok  { border-color: var(--success); }
#toast.err { border-color: var(--danger); }

/* ============================================================================
   Paid-feature marker + upsell modal
   ========================================================================== */
.navlock { margin-left: var(--sp-1); color: var(--brand); font-weight: 700; }
#upsell-ov {
  position: fixed; inset: 0; background: var(--scrim);
  display: none; align-items: center; justify-content: center; z-index: 100;
}
.upsell-box {
  background: var(--surface-overlay); border: 1px solid var(--line-default);
  border-radius: var(--r-card); box-shadow: var(--shadow-overlay);
  padding: var(--sp-6); max-width: 420px; width: calc(100% - var(--sp-8));
}

.login-box { max-width: 360px; margin: 12vh auto; }

/* ============================================================================
   Top-up modal
   ========================================================================== */
.modal-backdrop {
  position: fixed; inset: 0; background: var(--scrim);
  display: none; align-items: flex-start; justify-content: center; z-index: 50;
  padding: 6vh var(--sp-4);
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--surface-overlay); border: 1px solid var(--line-default);
  border-radius: var(--r-card); box-shadow: var(--shadow-overlay);
  width: 100%; max-width: 440px; max-height: 84vh; overflow-y: auto; padding: var(--sp-6);
}
.modal-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: var(--sp-1); }
.modal-head h2 { margin: 0; }
.modal-close {
  border: none; background: none; color: var(--text-secondary);
  min-height: 36px; padding: 0 var(--sp-1);
}
.pack {
  width: 100%; text-align: left; display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); margin-top: var(--sp-3);
  border-radius: var(--r-control);
  border: 1px solid var(--line-default); background: var(--surface-page); cursor: pointer;
  min-height: 44px;
}
/* The radio-card pattern: tinted wash plus border on the chosen card. This is
   the product's selection language — reuse it anywhere selection exists. */
.pack:hover, .pack.selected { border-color: var(--brand); background: var(--brand-wash); }
.pack .videos { font-size: var(--fs-body); line-height: var(--lh-body); font-weight: 700; color: var(--text-primary); }
.pack .videos small {
  display: block; font-weight: 400; color: var(--text-secondary);
  font-size: var(--fs-small); line-height: var(--lh-small); margin-top: 2px;
}
.pack .amt { text-align: right; white-space: nowrap; }
.pack .amt .total { font-size: var(--fs-title-3); line-height: var(--lh-title-3); font-weight: 700; color: var(--text-primary); }
.pack .amt .brk {
  display: block; font-size: var(--fs-small); line-height: var(--lh-small);
  color: var(--text-secondary); margin-top: 2px;
}

/* ---------- password show/hide + copy ---------- */
.pw-wrap { position: relative; display: inline-block; width: 100%; }
/* Room on the right for the copy button and the eye button, side by side. */
.pw-wrap > input { width: 100%; padding-right: 80px; }
.pw-eye, .pw-copy {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: none; border: 0; cursor: pointer;
  min-height: 36px; padding: 0 var(--sp-2); margin: 0;
  opacity: .6; color: var(--text-secondary);
}
.pw-eye { right: var(--sp-1); }
.pw-copy { right: calc(var(--sp-1) + 36px); }
.pw-eye:hover, .pw-copy:hover { opacity: 1; background: none; }
.pw-copy.ok { opacity: 1; color: var(--success); }
.pw-eye svg, .pw-copy svg { width: 18px; height: 18px; display: block; }

/* A quiet "generate a value" action under a secret field (e.g. webhook secret). */
.pw-gen {
  margin-top: var(--sp-2);
  background: none; border: 0; padding: 0; min-height: auto;
  color: var(--brand); font-size: var(--fs-small); line-height: var(--lh-small);
  cursor: pointer; text-align: left;
}
.pw-gen:hover { background: none; color: var(--brand-hover); text-decoration: underline; }

/* ---------- contextual help button ---------- */
.help-fab {
  position: fixed; right: var(--sp-4); bottom: var(--sp-4); z-index: 40;
  width: 44px; height: 44px; border-radius: var(--r-pill);
  display: flex; align-items: center; justify-content: center;
  background: var(--brand); color: var(--brand-contrast);
  text-decoration: none; box-shadow: var(--shadow-overlay);
  transition: background-color var(--dur-hover) var(--ease), transform var(--dur-hover) var(--ease);
}
.help-fab svg { width: 20px; height: 20px; }
.help-fab:hover { background: var(--brand-hover); transform: translateY(-2px); text-decoration: none; }

/* ---------- icons (§6) — Lucide, 16 in controls, 20 in nav rows, stroke 1.75 -- */
.icon {
  width: 16px; height: 16px; flex: none;
  stroke: currentColor; stroke-width: 1.75; fill: none;
  stroke-linecap: round; stroke-linejoin: round;
  vertical-align: middle;
}
.icon-20 { width: 20px; height: 20px; }

/* ---------- brand mark ---------- */
nav .brand .brand-a { color: var(--brand); }

/* ---------- §7 sizing by context ----------
   Table rows and toolbars take the 36px compact size without every template
   having to opt in; the 44px default stays for standalone page actions. */
td button, td .btn, th button,
.row > button, .row > .btn {
  min-height: 36px; padding: var(--sp-1) var(--sp-3);
  font-size: var(--fs-small); line-height: var(--lh-small);
}
/* §15.5 — on touch, the floor is 44x44 regardless of the visual size above. */
@media (pointer: coarse) {
  button, .btn, td button, td .btn, .row > button, .row > .btn, button.copy, .pw-eye, .pw-copy, .modal-close {
    min-height: 44px;
  }
  .pw-gen { min-height: 32px; }
}

/* ---------- status marks in table cells ---------- */
.ok-mark { color: var(--success); display: inline-flex; align-items: center; }
/* Accessible label for an icon-only cell (§6 — icon-only controls carry a name) */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ---------- callout (a recommendation inside a form card) ---------- */
.callout {
  border-left: 3px solid var(--brand);
  padding-left: var(--sp-3);
  margin: var(--sp-3) 0;
}

/* ============================================================================
   App shell (§8). The nav is this product's header: sticky, brand on the left,
   destinations in the middle, theme and account on the right. Below 900px the
   destinations become an off-canvas drawer behind a hamburger — they never
   stack above the content.
   ========================================================================== */
nav { position: sticky; top: 0; z-index: 30; flex-wrap: nowrap; }
.nav-tabs { display: flex; align-items: center; gap: var(--sp-1); flex-wrap: wrap; flex: 1 1 auto; min-width: 0; }
.nav-end { display: flex; align-items: center; gap: var(--sp-2); margin-left: auto; flex: none; }
.nav-burger { display: none; border-color: transparent; color: var(--text-secondary); padding: 0 var(--sp-2); }
.nav-burger:hover { background: var(--surface-sunken); color: var(--text-primary); }
.nav-scrim { display: none; }

/* ---------- account menu ---------- */
.acct { position: relative; }
.acct-btn {
  display: inline-flex; align-items: center; gap: var(--sp-1);
  min-height: 36px; padding: 0 var(--sp-1) 0 var(--sp-1);
  border-color: transparent; color: var(--text-secondary);
}
.acct-btn:hover { background: var(--surface-sunken); color: var(--text-primary); }
.acct-initial {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: var(--r-pill);
  background: var(--brand-wash); color: var(--brand);
  font-size: var(--fs-small); line-height: 1; font-weight: 700;
}
.acct-menu {
  position: absolute; right: 0; top: calc(100% + var(--sp-2));
  min-width: 220px; padding: var(--sp-2);
  background: var(--surface-overlay); border: 1px solid var(--line-default);
  border-radius: var(--r-card); box-shadow: var(--shadow-overlay); z-index: 40;
}
.acct-menu[hidden] { display: none; }
.acct-who {
  display: flex; flex-direction: column; gap: 2px;
  padding: var(--sp-2) var(--sp-3) var(--sp-3);
  border-bottom: 1px solid var(--line-subtle); margin-bottom: var(--sp-2);
}
.acct-name { font-size: var(--fs-small); line-height: var(--lh-small); font-weight: 600; color: var(--text-primary); }
.acct-mail { font-size: var(--fs-small); line-height: var(--lh-small); color: var(--text-tertiary); word-break: break-all; }
.acct-form { margin: 0; }
.acct-item {
  display: flex; align-items: center; width: 100%; text-align: left;
  min-height: 36px; padding: 0 var(--sp-3); border: 0; background: none;
  border-radius: var(--r-control);
  color: var(--text-primary); font-size: var(--fs-small); line-height: var(--lh-small);
}
.acct-item:hover { background: var(--surface-sunken); text-decoration: none; }
.acct-signout { color: var(--danger); }

/* ---------- §8.4 mobile: a drawer, never a stack above the content ---------- */
@media (max-width: 900px) {
  .nav-burger { display: inline-flex; }
  .nav-tabs {
    position: fixed; top: 0; left: 0; bottom: 0; width: 264px; max-width: 86vw;
    flex-direction: column; align-items: stretch; flex-wrap: nowrap;
    gap: 2px; padding: var(--sp-4) var(--sp-3);
    background: var(--surface-raised); border-right: 1px solid var(--line-default);
    box-shadow: var(--shadow-overlay);
    transform: translateX(-100%);
    transition: transform var(--dur-panel) var(--ease);
    overflow-y: auto; z-index: 45;
  }
  .nav-tabs.open { transform: translateX(0); }
  .nav-tabs a.tab { padding: var(--sp-3); min-height: 44px; display: flex; align-items: center; }
  /* the active indicator moves to the leading edge in a vertical list */
  .nav-tabs a.tab.active::after {
    left: 0; right: auto; top: var(--sp-2); bottom: var(--sp-2);
    width: 2px; height: auto;
  }
  .nav-scrim.open { display: block; position: fixed; inset: 0; background: var(--scrim); z-index: 44; }
}
