/* ============================================================================================================
   uploadly app — design system v1 (2026-10-27)
   One stylesheet for every Worker page. Two complete themes on the same components:
     .theme-light  the client portal (/c) — calm, paper + white, Stripe / Mercury
     .theme-dark   the uploader queue (/va) and admin (/admin) — ink, dense, Linear
   Brand: brand/final/BRAND.md + tokens.css ("the u-tick"). Rules that shape this file:
     · blue is the brand; green ONLY for live / checked; yellow = needs a look; red = real failures only;
       Frontier orange never appears here (its chevron is drawn in the text colour).
     · the status tick (symbol #tick) is spent only on "Live · checked". Done steps, copy buttons, checkboxes and
       feature rows never tick (checkboxes fill a square, done steps fill the node).
     · sentence case; ALL CAPS only in mono overlines (IBM Plex Mono); tabular figures for every time, price and count.
     · nothing spins, pulses or glows; things rise or settle (ease-out), 120–320 ms.
   ============================================================================================================ */

/* ---------- fonts — Switzer (ITF, Fontshare free licence) for headlines + UI, IBM Plex Mono (OFL) for data ----------
   Self-hosted woff2 in fonts/ (copies of ~/uploadly/fonts). No Inter, no Geist anywhere: the logo is an outlined SVG.
   Switzer's figures are tabular by default (all digits 576u), so times and prices line up without a tnum feature.
   Switzer has no → / ↵ glyphs: those fall through to the metric-matched Arial fallback below (same size, same baseline). */
@font-face { font-family: 'Switzer'; font-style: normal; font-weight: 400; font-display: swap; src: url('/m/switzer-400.woff2') format('woff2'); }
@font-face { font-family: 'Switzer'; font-style: normal; font-weight: 500; font-display: swap; src: url('/m/switzer-500.woff2') format('woff2'); }
@font-face { font-family: 'Switzer'; font-style: normal; font-weight: 600; font-display: swap; src: url('/m/switzer-600.woff2') format('woff2'); }
@font-face { font-family: 'Switzer'; font-style: normal; font-weight: 700; font-display: swap; src: url('/m/switzer-700.woff2') format('woff2'); }
@font-face { font-family: 'Switzer'; font-style: normal; font-weight: 800; font-display: swap; src: url('/m/switzer-800.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url('/m/plexmono-400.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 500; font-display: swap; src: url('/m/plexmono-500.woff2') format('woff2'); }
/* metric-matched fallbacks (fontTools: Switzer avg lowercase advance .5104 em vs Arial .4895 → 104.27 %; asc 980 / desc 250 / gap 90) */
@font-face { font-family: 'Switzer Fallback'; src: local('Arial'), local('ArialMT'); size-adjust: 104.27%;
  ascent-override: 93.99%; descent-override: 23.98%; line-gap-override: 8.63%; }
@font-face { font-family: 'Plex Mono Fallback'; src: local('Menlo'), local('Courier New'); size-adjust: 100%;
  ascent-override: 102.5%; descent-override: 27.5%; line-gap-override: 0%; }

/* ---------- brand tokens (verbatim from brand/final/tokens.css) ---------- */
:root {
  --upload-blue: #2D5BFF; --deep-blue: #1238D6; --sky: #4777FF; --haze: #C8D6FF;
  --ink: #0A0D16; --ink-2: #121726; --ink-3: #171D2E; --paper: #F5F7FB; --white: #FFFFFF;
  --muted: #8A93A8; --muted-light: #687185; --line-light: #E3E7EF; --border-dark: #5B6683; --border-light: #868FA4;
  --live: #2EE58C; --live-deep: #018049; --live-tint: #E9F7F0;
  --attention: #FFC83D; --attention-light: #8F6C03; --alert: #FF4D4F; --alert-light: #DB2431;

  --font-display: 'Switzer', 'Switzer Fallback', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-text: 'Switzer', 'Switzer Fallback', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --w-display: 700;   /* Switzer Bold for every headline, tile value and price (800 clots at 24–40 px) */
  --font-mono: 'IBM Plex Mono', 'Plex Mono Fallback', ui-monospace, 'SF Mono', Menlo, monospace;

  --r-xs: 6px; --r-sm: 8px; --r-md: 10px; --r-lg: 14px; --r-xl: 20px; --r-pill: 999px;
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 64px;
  --ease-out: cubic-bezier(.16,1,.3,1); --ease-in-out: cubic-bezier(.65,0,.35,1); --ease-tick: cubic-bezier(.3,1.35,.6,1);
  --dur-xs: 120ms; --dur-s: 200ms; --dur-m: 320ms;
  --container: 1200px; --gutter: 32px;
}

/* ---------- theme: light (client portal) ----------
   Every colour is a brand token or color-mix() of two brand tokens (tools/contrast.py measures each text/surface pair). */
.theme-light {
  color-scheme: light;
  --bg: var(--paper); --bg-2: color-mix(in srgb, var(--ink) 3%, var(--paper));
  --surface: var(--white); --surface-2: color-mix(in srgb, var(--paper) 60%, var(--white)); --surface-3: var(--white); --sunk: var(--paper); --hover: var(--paper);
  --line: var(--line-light); --line-2: color-mix(in srgb, var(--line-light) 72%, var(--border-light)); --border-input: var(--border-light); --border-input-hover: var(--muted-light);
  --text: var(--ink); --text-2: color-mix(in srgb, var(--ink) 40%, var(--muted-light)); --text-3: var(--muted-light);
  --text-4: var(--muted-light);   /* AA: nothing lighter than muted-light passes 4.5 on paper, so the 4th level is weight/size, not colour */
  --skel: color-mix(in srgb, var(--line-light) 70%, var(--paper));
  --accent: var(--upload-blue); --accent-hover: color-mix(in srgb, var(--upload-blue) 82%, var(--deep-blue)); --accent-press: var(--deep-blue); --accent-text: var(--upload-blue);
  --accent-tint: color-mix(in srgb, var(--upload-blue) 7%, var(--white)); --accent-tint-2: color-mix(in srgb, var(--upload-blue) 12%, var(--white));
  --accent-line: color-mix(in srgb, var(--upload-blue) 30%, var(--white));
  --ok: var(--live-deep); --ok-tint: var(--live-tint); --ok-line: color-mix(in srgb, var(--live-deep) 28%, var(--white)); --ok-fill: var(--live-deep); --on-ok: var(--white);
  --warn: var(--attention-light); --warn-tint: color-mix(in srgb, var(--attention) 10%, var(--white)); --warn-line: color-mix(in srgb, var(--attention) 48%, var(--white));
  --warn-fill: var(--attention); --on-warn: var(--ink);
  --bad: var(--alert-light); --bad-tint: color-mix(in srgb, var(--alert-light) 4%, var(--white)); --bad-line: color-mix(in srgb, var(--alert-light) 28%, var(--white));
  --avatar-bg: color-mix(in srgb, var(--upload-blue) 12%, var(--white)); --avatar-fg: color-mix(in srgb, var(--upload-blue) 55%, var(--deep-blue));
  --focus: 0 0 0 2px var(--white), 0 0 0 4px var(--upload-blue);
  --ring: 0 0 0 3px rgba(45,91,255,.16);
  --scrim: rgba(10,13,22,.32);
  --shadow-card: 0 1px 2px rgba(10,13,22,.04), 0 2px 6px -2px rgba(10,13,22,.04);
  --shadow-raised: 0 1px 2px rgba(10,13,22,.05), 0 8px 24px -10px rgba(10,13,22,.14);
  --shadow-pop: 0 2px 4px rgba(10,13,22,.06), 0 16px 40px -8px rgba(10,13,22,.18);
  --shadow-btn: 0 1px 2px rgba(10,13,22,.06);
  --topbar-bg: rgba(255,255,255,.86);
  --select-chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23687185' stroke-width='2'%3E%3Cpath d='M8 9.5l4-4 4 4M8 14.5l4 4 4-4'/%3E%3C/svg%3E");
}

/* ---------- theme: dark ink (uploader + admin) — surfaces are ink / ink-2 / ink-3 exactly ---------- */
.theme-dark {
  color-scheme: dark;
  --bg: var(--ink); --bg-2: var(--ink);
  --surface: var(--ink-2); --surface-2: var(--ink-3); --surface-3: var(--ink-3); --sunk: var(--ink); --hover: rgba(200,214,255,.045);
  --line: rgba(200,214,255,.075); --line-2: rgba(200,214,255,.13); --border-input: var(--border-dark); --border-input-hover: color-mix(in srgb, var(--border-dark) 55%, var(--muted));
  --text: var(--paper); --text-2: color-mix(in srgb, var(--paper) 45%, var(--muted)); --text-3: var(--muted);
  --text-4: color-mix(in srgb, var(--muted) 70%, var(--border-dark));   /* 4.60 on ink-3, 4.89 on ink-2 */
  --skel: rgba(200,214,255,.06);
  --accent: var(--upload-blue); --accent-hover: color-mix(in srgb, var(--upload-blue) 50%, var(--sky)); --accent-press: var(--deep-blue);
  --accent-text: color-mix(in srgb, var(--sky) 78%, var(--haze));   /* sky lifted: 5.37 on ink-3, 5.10 on the blue tint (plain sky fails there) */
  --accent-tint: color-mix(in srgb, var(--upload-blue) 13%, var(--ink-2)); --accent-tint-2: color-mix(in srgb, var(--upload-blue) 20%, var(--ink-2));
  --accent-line: rgba(71,119,255,.42);
  --ok: var(--live); --ok-tint: color-mix(in srgb, var(--live) 9%, var(--ink-2)); --ok-line: rgba(46,229,140,.30); --ok-fill: var(--live); --on-ok: var(--ink);
  --warn: var(--attention); --warn-tint: color-mix(in srgb, var(--attention) 8%, var(--ink-2)); --warn-line: rgba(255,200,61,.34); --warn-fill: var(--attention); --on-warn: var(--ink);
  --bad: var(--alert); --bad-tint: color-mix(in srgb, var(--alert) 9%, var(--ink-2)); --bad-line: rgba(255,77,79,.38);
  --avatar-bg: rgba(71,119,255,.18); --avatar-fg: color-mix(in srgb, var(--haze) 70%, var(--sky));
  --focus: 0 0 0 2px var(--ink), 0 0 0 4px var(--upload-blue);
  --ring: 0 0 0 3px rgba(71,119,255,.26);
  --scrim: rgba(10,13,22,.66);
  --shadow-card: inset 0 1px 0 rgba(255,255,255,.025);
  --shadow-raised: inset 0 1px 0 rgba(255,255,255,.04), 0 16px 40px -16px rgba(0,0,0,.7);
  --shadow-pop: inset 0 1px 0 rgba(255,255,255,.05), 0 24px 60px -12px rgba(0,0,0,.72);
  --shadow-btn: inset 0 1px 0 rgba(255,255,255,.04);
  --topbar-bg: rgba(10,13,22,.82);
  --select-chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238A93A8' stroke-width='2'%3E%3Cpath d='M8 9.5l4-4 4 4M8 14.5l4 4 4-4'/%3E%3C/svg%3E");
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; font-synthesis: none; background: var(--bg); color: var(--text); font: 400 14px/1.5 var(--font-text);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }
.theme-dark body, body.theme-dark { font-size: 13px; }
::selection { background: rgba(45,91,255,.22); }
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }
img, svg { display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
p { margin: 0; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; }
hr { border: 0; border-top: 1px solid var(--line); margin: 0; }
.i { width: 16px; height: 16px; flex: none; }
.i-sm { width: 14px; height: 14px; } .i-lg { width: 20px; height: 20px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* type */
.display { font: var(--w-display) 40px/1.08 var(--font-display); letter-spacing: -.028em; }
.h1 { font: var(--w-display) 28px/1.14 var(--font-display); letter-spacing: -.022em; }
.h2 { font: var(--w-display) 24px/1.2 var(--font-display); letter-spacing: -.018em; }
.h3 { font: 600 16px/1.35 var(--font-text); letter-spacing: -.006em; }
.h4 { font: 600 14px/1.4 var(--font-text); }
.lead { font-size: 16px; line-height: 1.55; color: var(--text-2); }
.overline { font: 500 11px/1.2 var(--font-mono); letter-spacing: .06em; word-spacing: -.15em; text-transform: uppercase; color: var(--text-3); }
.mono { font-family: var(--font-mono); font-weight: 500; font-size: .93em; letter-spacing: 0; }
.num, .mono, .tile-value, .proof, td { font-variant-numeric: tabular-nums; }
.t2 { color: var(--text-2); } .t3 { color: var(--text-3); } .t4 { color: var(--text-4); }
.small { font-size: 13px; } .xs { font-size: 12px; }
.strong { font-weight: 600; color: var(--text); }
.ok-text { color: var(--ok); } .warn-text { color: var(--warn); } .bad-text { color: var(--bad); } .accent-text { color: var(--accent-text); }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.proof { font: 500 13px/1.45 var(--font-mono); color: var(--text-3); letter-spacing: -.01em; word-spacing: -.22em; }   /* Plex Mono spaces are 0.6 em: tighten so the groups stay groups */
.proof i { font-style: normal; color: var(--text-4); padding: 0 .22em; }
kbd, .kbd { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 4px; font: 500 11px/1 var(--font-mono);
  color: var(--text-3); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line-2); }

/* layout */
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }
.stack > * + * { margin-top: var(--s-4); }
.row { display: flex; align-items: center; gap: var(--s-3); min-width: 0; }
.row-wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-4); }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-4); }
.grid-split { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: var(--s-4); align-items: start; }
.divider-v { width: 1px; align-self: stretch; background: var(--line); }

/* ============================================================================================================
   TOP BAR — the tile + product area · section nav · who
   ============================================================================================================ */
.topbar { position: sticky; top: 0; z-index: 20; background: var(--topbar-bg); border-bottom: 1px solid var(--line);
  backdrop-filter: saturate(160%) blur(16px); -webkit-backdrop-filter: saturate(160%) blur(16px); }
.topbar-in { display: flex; align-items: center; gap: 28px; height: 64px; }
.theme-dark .topbar-in { height: 56px; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--text); flex: none; }
.brand:hover { text-decoration: none; }
/* App chrome = the tile alone. BRAND §3.2: the horizontal lockup needs ≥ 208 px on light / ≥ 260 px on ink, a top bar has ~120.
   The word beside it is the product area in Switzer (never "uploadly" typeset as a logo, §3.4.1). One mark per view (§7). */
.brand .mark { width: 28px; height: 28px; flex: none; }
.theme-dark .brand .mark { width: 26px; height: 26px; }
.brand-ctx { display: inline-flex; align-items: center; gap: 12px; font: 500 14px/1 var(--font-text); color: var(--text-2); white-space: nowrap; }
.brand-ctx::before { content: ''; width: 1px; height: 18px; background: var(--line-2); }
.brand-tag { font: 500 11px/1 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--text-3);
  padding: 4px 8px; border-radius: 6px; box-shadow: inset 0 0 0 1px var(--line-2); }
.nav { display: flex; align-items: stretch; gap: 2px; height: 100%; min-width: 0; }
.nav a { position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 0 12px; color: var(--text-3); font-weight: 500; white-space: nowrap;
  transition: color var(--dur-xs); }
.nav a:hover { color: var(--text); text-decoration: none; }
.nav a.on { color: var(--text); }
.nav a.on::after { content: ''; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2px; border-radius: 2px 2px 0 0; background: var(--accent); }
.theme-dark .nav { align-items: center; }
.theme-dark .nav a { height: 32px; padding: 0 12px; border-radius: 8px; }
.theme-dark .nav a.on { background: rgba(200,214,255,.07); box-shadow: inset 0 0 0 1px rgba(200,214,255,.06); }
.theme-dark .nav a.on::after { display: none; }
.nav .count { font: 500 12px/1 var(--font-mono); color: var(--text-3); padding: 4px 6px; border-radius: 6px; background: var(--surface-2); }
.nav a.on .count { color: var(--text); background: rgba(200,214,255,.1); }
.theme-light .nav a.on .count { background: var(--accent-tint); color: var(--accent-text); }
.nav .count.hot { background: var(--warn-fill); color: var(--on-warn); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 14px; flex: none; }
.who { display: inline-flex; align-items: center; gap: 10px; color: var(--text-2); font-weight: 500; }
.who .sub { color: var(--text-3); font-weight: 400; }
.clock { font: 500 13px/1 var(--font-mono); color: var(--text-2); display: inline-flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px;
  background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.clock .t3 { color: var(--text-3); }
/* second row on phones: the nav scrolls inside itself, never the page */
.subnav { display: none; }

/* ============================================================================================================
   PAGE HEADER
   ============================================================================================================ */
.page-head { display: flex; align-items: flex-end; gap: 24px; padding: 40px 0 28px; }
.page-head .overline { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.page-head .lead { margin-top: 10px; max-width: 640px; }
.page-head-actions { margin-left: auto; display: flex; gap: 10px; flex: none; }
.theme-dark .page-head { padding: 28px 0 20px; }
.theme-dark .page-head .h1 { font-size: 28px; }
.crumbs { display: flex; align-items: center; gap: 6px; color: var(--text-3); font-size: 13px; margin-bottom: 8px; }
.crumbs .i { width: 14px; height: 14px; }

.section { margin-top: 40px; }
.section-h { display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.section-h .h2 + .t3, .section-h .h3 + .t3 { font-size: 13px; }
.section-h .actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.theme-dark .section { margin-top: 32px; }
.theme-dark .section-h { margin-bottom: 12px; align-items: center; }
.theme-dark .section-h .h3 { font-size: 14px; }

/* ============================================================================================================
   BUTTONS — primary (blue), secondary, ghost, danger · sm / md / lg / xl · icon
   ============================================================================================================ */
.btn { --h: 36px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: var(--h); padding: 0 14px; border-radius: 9px;
  border: 1px solid transparent; font: 500 14px/1 var(--font-text); white-space: nowrap; cursor: pointer; text-decoration: none; user-select: none;
  transition: background-color var(--dur-xs), border-color var(--dur-xs), color var(--dur-xs), box-shadow var(--dur-s), transform var(--dur-xs); }
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(.5px); }
.btn .i { width: 16px; height: 16px; }
.btn-primary { color: var(--white); background: linear-gradient(180deg, color-mix(in srgb, var(--upload-blue) 90%, var(--white)) 0%, var(--upload-blue) 100%); border-color: color-mix(in srgb, var(--upload-blue) 80%, var(--deep-blue));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 1px 2px rgba(18,56,214,.28), 0 4px 12px -4px rgba(45,91,255,.45); }
.btn-primary:hover { background: linear-gradient(180deg, color-mix(in srgb, var(--upload-blue) 95%, var(--white)) 0%, var(--accent-hover) 100%); }
.btn-primary:active { background: var(--deep-blue); border-color: var(--deep-blue); box-shadow: none; }
.theme-dark .btn-primary { border-color: color-mix(in srgb, var(--upload-blue) 60%, var(--sky)); box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 6px 18px -8px rgba(45,91,255,.8); }
.btn-secondary { color: var(--text); background: var(--surface); border-color: var(--line-2); box-shadow: var(--shadow-btn); }
.btn-secondary:hover { background: var(--hover); border-color: var(--border-input); }
.theme-dark .btn-secondary { background: rgba(200,214,255,.055); border-color: rgba(200,214,255,.12); }
.theme-dark .btn-secondary:hover { background: rgba(200,214,255,.09); border-color: rgba(200,214,255,.2); }
.btn-ghost { color: var(--text-2); background: transparent; }
.btn-ghost:hover { color: var(--text); background: var(--hover); }
.btn-danger { color: var(--bad); background: var(--surface); border-color: var(--bad-line); }
.btn-danger:hover { background: var(--bad-tint); }
.theme-dark .btn-danger { background: transparent; }
.btn-warn { color: var(--on-warn); background: var(--warn-fill); border-color: transparent; font-weight: 600; box-shadow: inset 0 1px 0 rgba(255,255,255,.35); }
.btn-warn:hover { filter: brightness(1.04); }
.btn[disabled], .btn.is-disabled { opacity: 1; cursor: not-allowed; color: var(--text-4); background: var(--surface-2); border-color: var(--line); box-shadow: none; }
.btn-sm { --h: 30px; padding: 0 10px; font-size: 13px; border-radius: 8px; gap: 6px; }
.btn-sm .i { width: 14px; height: 14px; }
.btn-xs { --h: 26px; padding: 0 8px; font-size: 13px; border-radius: 7px; gap: 6px; }
.btn-xs .i { width: 13px; height: 13px; }
.btn-lg { --h: 42px; padding: 0 20px; font-size: 16px; border-radius: 10px; }
.btn-xl { --h: 48px; padding: 0 24px; font-size: 16px; font-weight: 600; border-radius: 11px; }
.btn-icon { width: var(--h); padding: 0; }
.btn-block { width: 100%; }
.btn .kbd { margin-left: 4px; background: rgba(255,255,255,.16); color: inherit; box-shadow: none; }
.btn-secondary .kbd, .btn-ghost .kbd { background: var(--surface-2); color: var(--text-3); box-shadow: inset 0 0 0 1px var(--line); }
.btn.is-copied { color: var(--text); background: var(--surface-2); border-color: var(--line-2); box-shadow: none; }   /* neutral: green is only for live */
.linkbtn { background: none; border: 0; padding: 0; color: var(--accent-text); font-weight: 500; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.linkbtn .i { width: 14px; height: 14px; }

/* ============================================================================================================
   FORMS — field, input, select, textarea, checkbox (fills a square: no ticks), radio cards, segmented, switch
   ============================================================================================================ */
.field { display: grid; gap: 6px; min-width: 0; }
.label { font: 500 13px/1.3 var(--font-text); color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.label .opt { font-weight: 400; color: var(--text-3); }
.hint { font-size: 13px; line-height: 1.45; color: var(--text-3); }
.hint b { color: var(--text-2); font-weight: 500; }
.error-text { font-size: 13px; color: var(--bad); display: flex; gap: 6px; align-items: center; }
.input, .select, .textarea { width: 100%; height: 36px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--border-input); background: var(--surface);
  color: var(--text); font: 400 14px/1.2 var(--font-text); outline: none; transition: border-color var(--dur-xs), box-shadow var(--dur-s); }
.theme-dark .input, .theme-dark .select, .theme-dark .textarea { background-color: rgba(200,214,255,.035); font-size: 13px; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--border-input-hover); }
.input:focus, .select:focus, .textarea:focus, .input.is-focus { border-color: var(--accent); box-shadow: var(--ring); }
.input::placeholder, .textarea::placeholder { color: var(--text-4); }
.input.mono { font: 500 13px/1 var(--font-mono); }
.input.is-error { border-color: var(--bad); box-shadow: 0 0 0 3px var(--bad-tint); }
.input[readonly] { background: var(--surface-2); color: var(--text-2); }
.select { appearance: none; -webkit-appearance: none; padding-right: 32px; background-image: var(--select-chev); background-repeat: no-repeat;
  background-position: right 9px center; background-size: 16px; cursor: pointer; }
.textarea { height: auto; min-height: 84px; padding: 10px 12px; line-height: 1.5; resize: vertical; }
.input-sm { height: 30px; font-size: 13px; padding: 0 10px; }
.select.input-sm { padding-right: 28px; background-position: right 7px center; }
.input-wrap { position: relative; }
.input-wrap > .i { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.input-wrap > .input { padding-left: 32px; }
.input-wrap > .kbd { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); }
.form-row { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); align-items: start; }

.check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; color: var(--text-2); }
.check input { appearance: none; -webkit-appearance: none; margin: 0; width: 16px; height: 16px; border-radius: 4px; border: 1px solid var(--border-input);
  background: var(--surface); display: grid; place-items: center; cursor: pointer; flex: none; }
.check input::before { content: ''; width: 8px; height: 8px; border-radius: 1.5px; background: var(--white); transform: scale(0); transition: transform var(--dur-xs) var(--ease-out); }
.check input:checked { background: var(--accent); border-color: var(--accent); }
.check input:checked::before { transform: scale(1); }

.number { display: inline-flex; align-items: stretch; height: 36px; border: 1px solid var(--border-input); border-radius: 8px; overflow: hidden; background: var(--surface); }
.number button { width: 32px; border: 0; background: transparent; color: var(--text-3); cursor: pointer; display: grid; place-items: center; }
.number button:hover { background: var(--hover); color: var(--text); }
.number button .i { width: 14px; height: 14px; }
.number output, .number input { width: 40px; text-align: center; border: 0; border-left: 1px solid var(--line); border-right: 1px solid var(--line); background: transparent;
  font: 500 14px/34px var(--font-mono); outline: none; }
.number-sm { height: 30px; } .number-sm output { line-height: 28px; font-size: 13px; width: 34px; } .number-sm button { width: 28px; }

.seg { display: inline-flex; padding: 4px; gap: 2px; border-radius: 10px; background: var(--sunk); box-shadow: inset 0 0 0 1px var(--line); }
.seg button, .seg a { height: 28px; padding: 0 12px; border: 0; border-radius: 7px; background: transparent; color: var(--text-3); font: 500 13px/1 var(--font-text);
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer; white-space: nowrap; }
.seg button:hover, .seg a:hover { color: var(--text); text-decoration: none; }
.seg .on { color: var(--text); background: var(--surface); box-shadow: 0 1px 2px rgba(10,13,22,.08), 0 0 0 1px var(--line-2); }
.theme-dark .seg .on { background: color-mix(in srgb, var(--haze) 6%, var(--ink-3)); box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 0 0 1px rgba(200,214,255,.08); }
.seg .count { font: 500 12px/1 var(--font-mono); color: var(--text-4); }
.seg[data-scroll-x] { max-width: 100%; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.seg[data-scroll-x]::-webkit-scrollbar { display: none; }
.seg .on .count { color: var(--text-3); }

.choice { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.choice-card { position: relative; display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 10px; padding: 12px 14px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--line-2); background: var(--surface); transition: border-color var(--dur-xs), box-shadow var(--dur-s), background var(--dur-xs); }
.choice-card:hover { border-color: var(--border-input); }
.choice-card .dot { width: 16px; height: 16px; margin-top: 2px; border-radius: 50%; border: 1px solid var(--border-input); display: grid; place-items: center; background: var(--surface); }
.choice-card b { display: block; font-weight: 600; font-size: 14px; color: var(--text); }
.choice-card span { display: block; font-size: 13px; line-height: 1.45; color: var(--text-3); margin-top: 2px; }
.choice-card.on { border-color: var(--accent); box-shadow: var(--ring); background: var(--surface); }
.choice-card.on .dot { border-color: var(--accent); background: var(--accent); }
.choice-card.on .dot::after { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--white); }

.switch { position: relative; width: 32px; height: 18px; border-radius: 99px; background: var(--line-2); border: 0; cursor: pointer; flex: none; transition: background var(--dur-s); }
.switch::after { content: ''; position: absolute; left: 2px; top: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--white); box-shadow: 0 1px 2px rgba(10,13,22,.25);
  transition: transform var(--dur-s) var(--ease-out); }
.switch.on { background: var(--accent); }
.switch.on::after { transform: translateX(14px); }

/* time-window picker — "Make public between [12:00] and [17:00]" with a 24-hour rail of the window */
.winpick { display: grid; gap: 12px; padding: 14px 16px; border-radius: 12px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.winpick-line { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 14px; color: var(--text-2); }
.winpick-line .select { width: 100px; font: 500 14px/1 var(--font-mono); }
.winpick-line .tz { display: inline-flex; align-items: center; gap: 6px; color: var(--text-3); font-size: 13px; }
.dayrail { position: relative; }
.dayrail-track { position: relative; height: 26px; border-radius: 6px; background:
  repeating-linear-gradient(90deg, transparent 0 calc(100% / 24 - 1px), var(--line) calc(100% / 24 - 1px) calc(100% / 24)), var(--surface);
  box-shadow: inset 0 0 0 1px var(--line-2); overflow: hidden; }
.dayrail-win { position: absolute; top: 3px; bottom: 3px; border-radius: 4px; background: var(--accent-tint-2); box-shadow: inset 0 0 0 1.5px var(--accent);
  display: flex; align-items: center; justify-content: center; font: 500 12px/1 var(--font-mono); color: var(--accent-text); }
.dayrail-pin { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: var(--text); border-radius: 2px; }
.dayrail-ticks { display: flex; justify-content: space-between; margin-top: 6px; font: 500 11px/1 var(--font-mono); color: var(--text-4); }

/* ============================================================================================================
   CARDS + STAT TILES
   ============================================================================================================ */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-card); min-width: 0; }
.card-h { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); min-height: 58px; }
.card-h .h3, .card-h .h4 { display: flex; align-items: center; gap: 8px; }
.card-h .actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.card-b { padding: 20px; }
.card-f { display: flex; align-items: center; gap: 10px; padding: 12px 20px; border-top: 1px solid var(--line); background: var(--surface-2);
  border-radius: 0 0 var(--r-lg) var(--r-lg); }
.card-flush { padding: 0; }
.card-sub { font-size: 13px; color: var(--text-3); }
.theme-dark .card { border-radius: 12px; }
.theme-dark .card-h { padding: 12px 16px; min-height: 48px; }
.theme-dark .card-b { padding: 16px; }
.theme-dark .card-f { padding: 10px 16px; border-radius: 0 0 12px 12px; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.tiles-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.tiles-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.tile { position: relative; padding: 16px 20px 16px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-card); min-width: 0; }
.tile-label { display: flex; align-items: center; gap: 8px; font: 500 13px/1.3 var(--font-text); color: var(--text-3); }
.tile-label .i { width: 14px; height: 14px; }
.tile-value { margin-top: 10px; font: var(--w-display) 28px/1 var(--font-display); letter-spacing: -.02em; color: var(--text); display: flex; align-items: baseline; gap: 6px; }
.tile-value small { font: 500 13px/1 var(--font-text); color: var(--text-3); letter-spacing: 0; }
.tile-value.mono { font: 500 24px/1 var(--font-mono); letter-spacing: -.02em; }
.tile-meta { margin-top: 8px; font-size: 13px; color: var(--text-3); line-height: 1.4; }
.tile-meta b { color: var(--text-2); font-weight: 500; }
.theme-dark .tile { padding: 14px 16px 14px; border-radius: 10px; }
.theme-dark .tile-value { font: 600 24px/1 var(--font-text); letter-spacing: -.02em; margin-top: 10px; }
.tile.is-ok .tile-value { color: var(--ok); }
.tile.is-warn { border-color: var(--warn-line); }
.tile.is-warn .tile-value { color: var(--warn); }
.tile.is-bad { border-color: var(--bad-line); }
.tile.is-bad .tile-value { color: var(--bad); }
.tile.is-accent { border-color: var(--accent-line); background: linear-gradient(180deg, var(--accent-tint), transparent 70%), var(--surface); }
.tile.is-accent .tile-value { color: var(--accent-text); }
.tile-group { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; box-shadow: var(--shadow-card); }
.tile-group .tile { border: 0; border-radius: 0; box-shadow: none; }
.meter { position: relative; height: 4px; margin-top: 12px; border-radius: 99px; background: var(--line-2); overflow: hidden; }
.meter i { position: absolute; inset: 0 auto 0 0; border-radius: 99px; background: var(--accent); }
.meter .target { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--text-3); border-radius: 1px; }
.meter.is-ok i { background: var(--ok-fill); }
.spark { display: flex; align-items: flex-end; gap: 4px; height: 26px; margin-top: 10px; }
.spark i { flex: 1; min-width: 3px; border-radius: 2px 2px 0 0; background: var(--accent-tint-2); }
.spark i.on { background: var(--accent); }

/* ============================================================================================================
   STATUS PILLS — the ladder: waiting · uploading · scheduled · by hand · live·checking · live·checked · problem · missed
   ============================================================================================================ */
.pill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px 0 8px; border-radius: var(--r-pill); font: 500 13px/1 var(--font-text);
  white-space: nowrap; color: var(--text-2); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line-2); vertical-align: middle; }
.pill .i { width: 14px; height: 14px; }
.pill .tick-i { width: 13px; height: 13px; }
.pill .sep { color: var(--text-4); margin: 0 -1px; }
.pill .mono { font-size: 12px; }
.pill-sm { height: 20px; font-size: 12px; padding: 0 8px 0 6px; gap: 6px; }
.pill-sm .i { width: 12px; height: 12px; }
.pill.no-icon { padding: 0 10px; }
.pill--waiting { color: var(--text-3); background: transparent; box-shadow: inset 0 0 0 1px var(--line-2); }
.pill--uploading { color: var(--accent-text); background: var(--accent-tint); box-shadow: inset 0 0 0 1px var(--accent-line); }
.pill--scheduled { color: var(--text-2); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-2); }
.pill--scheduled .i { color: var(--text-3); }
.pill--hand { color: var(--text); background: var(--surface); box-shadow: inset 0 0 0 1px var(--border-input); }
.pill--hand .i { color: var(--text-2); }
.pill--live { color: var(--ok); background: var(--ok-tint); box-shadow: inset 0 0 0 1px var(--ok-line); }
.pill--checked { color: var(--ok); background: var(--ok-tint); box-shadow: inset 0 0 0 1px var(--ok-line); }
.pill--problem { color: var(--warn); background: var(--warn-tint); box-shadow: inset 0 0 0 1px var(--warn-line); }
.pill--missed { color: var(--bad); background: var(--bad-tint); box-shadow: inset 0 0 0 1px var(--bad-line); }
.pill--accent { color: var(--accent-text); background: var(--accent-tint); box-shadow: inset 0 0 0 1px var(--accent-line); }
.pill--solid-warn { color: var(--on-warn); background: var(--warn-fill); box-shadow: none; font-weight: 600; }
.pill--solid-ink { color: var(--surface); background: var(--text); box-shadow: none; }
.pill--quiet { color: var(--text-3); background: transparent; box-shadow: inset 0 0 0 1px var(--line); }
.theme-light .pill--live, .theme-light .pill--checked { color: var(--live-deep); }
/* status dots for compact tables */
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--text-4); flex: none; }
.dot.ok { background: var(--ok-fill); } .dot.warn { background: var(--warn-fill); } .dot.bad { background: var(--bad); } .dot.accent { background: var(--accent); }
.dot.ring { background: transparent; box-shadow: inset 0 0 0 1.5px var(--text-4); }

/* the u-tick status mark: a person checked this video after it went live. Never next to a channel name or avatar. */
.tick-i { width: 16px; height: 16px; color: var(--ok); flex: none; }
.checked { display: inline-grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 8px; align-items: center; min-width: 0; }
.checked .tick-i { grid-row: span 2; align-self: start; margin-top: 1px; width: 17px; height: 17px; }
.checked-t { font-weight: 600; color: var(--ok); font-size: 14px; line-height: 1.3; }
.checked .proof { grid-column: 2; }

/* avatar: a person's initial. Never put the mark or the tick beside it. */
.avatar { width: 24px; height: 24px; border-radius: 50%; display: inline-grid; place-items: center; flex: none; font: 600 11px/1 var(--font-text);
  color: var(--avatar-fg); background: var(--avatar-bg); letter-spacing: 0; }
.avatar-lg { width: 32px; height: 32px; font-size: 13px; }
.avatar-sm { width: 20px; height: 20px; font-size: 11px; }
.person { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }

/* channel identity: name + handle, plain text (no tile, no tick next to it — BRAND §3.4.6) */
.channel { display: inline-grid; min-width: 0; }
.channel b { font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.channel span { font: 500 12px/1.3 var(--font-mono); color: var(--text-3); }
.code { font: 500 12px/1 var(--font-mono); color: var(--text-2); padding: 4px 6px; border-radius: 6px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); white-space: nowrap; }
.code-plain { font: 500 13px/1.3 var(--font-mono); color: var(--text-2); }

/* ============================================================================================================
   TABLES — data table in a card; numeric right; mobile = stacked rows (.table-stack)
   ============================================================================================================ */
.table-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-card); overflow: hidden; }
.theme-dark .table-card { border-radius: 12px; }
.table-scroll { overflow-x: auto; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.theme-dark .table { font-size: 13px; }
.table th { text-align: left; font: 500 11px/1.2 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); padding: 12px 16px;
  background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; color: var(--text-2); }
.theme-dark .table td { padding: 10px 14px; }
.theme-dark .table th { padding: 10px 14px; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background var(--dur-xs); }
.table tbody tr:hover td { background: var(--hover); }
.table .num, .table th.num { text-align: right; }
.table-fixed { table-layout: fixed; }
.proof .nb { white-space: nowrap; }
.table td.strong, .table td b { color: var(--text); font-weight: 500; }
.table .cell-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.table .cell-title b { display: block; color: var(--text); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.table .cell-title small { display: block; font-size: 13px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.table .cell-title small a { font-size: 12px; }
.table .actions { text-align: right; white-space: nowrap; }
.table .actions .btn + .btn { margin-left: 6px; }
.table tr.is-flag td:first-child { box-shadow: inset 2px 0 0 var(--warn-fill); }
.table tr.is-bad td:first-child { box-shadow: inset 2px 0 0 var(--bad); }
.table-foot { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line); background: var(--surface-2); font-size: 13px; color: var(--text-3); }

/* ============================================================================================================
   CALLOUTS (incidents) + PATH + LIMITS
   ============================================================================================================ */
/* incidents + notices: a 3 px status rule on the left and the bare icon in the status colour (BRAND §6: no badge shapes round icons) */
.callout { --rule: var(--line-2); --ic: var(--text-3); display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; gap: 12px; align-items: start;
  padding: 16px 20px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); box-shadow: inset 3px 0 0 var(--rule), var(--shadow-card); }
.callout + .callout { margin-top: 10px; }
.callout-ic { display: grid; place-items: center; height: 20px; color: var(--ic); }
.callout-ic .i { width: 18px; height: 18px; }
.callout-t { font-weight: 600; font-size: 14px; color: var(--text); line-height: 1.4; }
.callout-d { margin-top: 4px; font-size: 14px; color: var(--text-2); line-height: 1.5; }
.callout-meta { margin-top: 10px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; }
.callout-actions { display: flex; gap: 8px; align-items: center; }
.callout--attention { --rule: var(--warn-fill); --ic: var(--warn); }
.callout--alert { --rule: var(--bad); --ic: var(--bad); }
.callout--info { --rule: var(--accent); --ic: var(--accent-text); }
.callout--ok { --rule: var(--ok-fill); --ic: var(--ok); }
.callout-compact { grid-template-columns: 16px minmax(0, 1fr) auto; padding: 12px 14px 12px 16px; gap: 10px; align-items: center; box-shadow: inset 3px 0 0 var(--rule); }
.callout-compact .callout-ic .i { width: 16px; height: 16px; }
.callout-compact .callout-t { font-weight: 500; font-size: 14px; }

.path { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; font: 500 13px/1 var(--font-text); color: var(--text-2); }
.path span { padding: 6px 8px; border-radius: 6px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line-2); color: var(--text); white-space: nowrap; }
.path .i { width: 13px; height: 13px; color: var(--text-4); }
.path .em { background: var(--accent-tint); box-shadow: inset 0 0 0 1px var(--accent-line); color: var(--accent-text); }

.limits { display: grid; gap: 10px; }
.limits li { display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: 10px; align-items: start; font-size: 14px; color: var(--text-2); line-height: 1.45; }
.limits .i { width: 16px; height: 16px; color: var(--text-3); margin-top: 1px; }
.limits b { color: var(--text); font-weight: 500; }
ul.clean { list-style: none; margin: 0; padding: 0; }

/* ============================================================================================================
   ONBOARDING STEPPER — done steps fill the node (never a tick); the current step rings blue
   ============================================================================================================ */
.setup-h { display: flex; align-items: center; gap: 16px; padding: 20px 24px; border-bottom: 1px solid var(--line); }
.setup-progress { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; width: 180px; margin-left: auto; }
.setup-progress i { height: 4px; border-radius: 99px; background: var(--line-2); }
.setup-progress i.done { background: var(--accent); }
.setup-progress i.now { background: linear-gradient(90deg, var(--accent) 45%, var(--line-2) 45%); }
.steps { list-style: none; margin: 0; padding: 6px 0; counter-reset: step; }
.step { position: relative; display: grid; grid-template-columns: 28px minmax(0, 1fr); column-gap: 16px; padding: 14px 24px 14px; }
.step::before { content: ''; position: absolute; left: 35px; top: 46px; bottom: -14px; width: 2px; background: var(--line); border-radius: 2px; }
.step:last-child::before { display: none; }
.step.is-done::before { background: var(--accent-line); }
.step-node { position: relative; z-index: 1; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font: 500 13px/1 var(--font-mono);
  color: var(--text-3); background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--line-2); }
.step.is-done .step-node { color: var(--white); background: var(--accent); box-shadow: none; }
.step.is-current .step-node { color: var(--accent-text); background: var(--surface); box-shadow: inset 0 0 0 2px var(--accent), 0 0 0 4px var(--accent-tint); }
.step-h { display: flex; align-items: center; gap: 10px; min-height: 28px; flex-wrap: wrap; }
.step-t { font-weight: 600; font-size: 16px; color: var(--text); letter-spacing: -.005em; }
.step.is-todo .step-t { color: var(--text-2); }
.step-state { font: 500 11px/1 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.step.is-done .step-state { color: var(--accent-text); }
.step.is-current .step-state { color: var(--accent-text); }
.step-sum { font-size: 14px; color: var(--text-3); margin-top: 2px; }
.step-h .actions { margin-left: auto; display: flex; gap: 8px; }
.step-b { grid-column: 2; margin-top: 14px; display: grid; gap: 16px; min-width: 0; }

/* the secret / key reveal: shown once */
.secret { border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface-2); overflow: hidden; }
.secret-h { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); font-weight: 600; font-size: 14px; }
.secret-h .i { color: var(--text-2); }
.secret-h .pill { margin-left: auto; }
.secret-row { display: grid; grid-template-columns: 120px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 10px 14px; }
.secret-row + .secret-row { border-top: 1px solid var(--line); }
.secret-row .k { font: 500 11px/1.2 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.secret-val { font: 500 13px/1.4 var(--font-mono); color: var(--text); word-break: break-all; padding: 8px 10px; border-radius: 7px; background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line-2); }
.secret-val.masked { letter-spacing: .14em; color: var(--text-3); }
.secret-f { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px 12px; font-size: 13px; color: var(--text-3); line-height: 1.45; border-top: 1px solid var(--line); }
.secret-f .i { width: 14px; height: 14px; margin-top: 2px; color: var(--text-3); }
.secret.is-new { border-color: var(--accent-line); box-shadow: var(--ring); }

/* ============================================================================================================
   TOASTS + EMPTY STATES
   ============================================================================================================ */
.toasts { position: fixed; z-index: 40; right: 24px; top: 76px; display: grid; gap: 10px; width: 380px; max-width: calc(100vw - 32px); }
.toast { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 14px 14px 14px 14px; border-radius: 14px;
  background: var(--surface-3); border: 1px solid var(--line-2); box-shadow: var(--shadow-pop); }
.theme-dark .toast { background: var(--ink-3); border-color: rgba(200,214,255,.12); }
.toast .tick-i, .toast .i { width: 18px; height: 18px; margin-top: 1px; }
.toast-t { font-weight: 600; font-size: 14px; color: var(--text); line-height: 1.35; }
.toast-d { font-size: 13px; color: var(--text-2); margin-top: 2px; }
.toast .proof { margin-top: 6px; font-size: 12px; }
.toast-time { font: 500 12px/1.35 var(--font-mono); color: var(--text-3); }
.toast--attention .i { color: var(--warn); }
.toast--plain { grid-template-columns: 20px minmax(0, 1fr) auto; align-items: center; }

.empty { display: grid; justify-items: center; text-align: center; gap: 6px; padding: 40px 24px; }
.empty-ic { color: var(--text-3); margin-bottom: 6px; }
.empty-ic .i { width: 24px; height: 24px; }
.empty-t { font-weight: 600; font-size: 16px; color: var(--text); }
.empty-d { font-size: 14px; color: var(--text-3); max-width: 380px; line-height: 1.5; }
.empty .btn { margin-top: 10px; }

/* ============================================================================================================
   THUMBNAILS (CSS art of the fictional channels) + FILE CHIP
   ============================================================================================================ */
.th { --tw: 72px; position: relative; display: block; width: var(--tw); aspect-ratio: 16 / 9; border-radius: 6px; overflow: hidden; flex: none; color: var(--white);
  font: var(--w-display) calc(var(--tw) * .14)/1 var(--font-display); letter-spacing: -.02em; box-shadow: inset 0 0 0 1px rgba(255,255,255,.08), 0 0 0 1px rgba(10,13,22,.06); }
.th::after { position: absolute; left: 8%; bottom: 10%; text-shadow: 0 1px 4px rgba(0,0,0,.55); white-space: nowrap; }
.th-sm { --tw: 56px; border-radius: 5px; } .th-md { --tw: 112px; } .th-lg { --tw: 248px; width: 100%; border-radius: 10px; }
.th-badge { position: absolute; right: 5px; top: 5px; padding: 2px 6px; border-radius: 4px; background: rgba(10,13,22,.78); color: var(--white); font: 500 11px/1 var(--font-mono); letter-spacing: .04em; }
.file { display: inline-flex; align-items: center; gap: 10px; min-width: 0; padding: 8px 10px 8px 10px; border-radius: 10px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line-2); }
.file .i { color: var(--accent-text); }
.file b { font: 500 13px/1.2 var(--font-mono); color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file small { font: 500 12px/1.2 var(--font-mono); color: var(--text-3); white-space: nowrap; }

/* ============================================================================================================
   UPLOADER — mode banners (SCHEDULE / PUBLISH BY HAND / MAKE PUBLIC NOW / LATE), time rail, video card, copy rows
   ============================================================================================================ */
.mode { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 24px; align-items: start; padding: 16px; border-radius: 12px;
  background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line-2); }
.mode > * { min-width: 0; }
.mode-full { grid-column: 1 / -1; }
/* the overline carries the bare icon in the banner's colour — no icon tiles */
.mode-k { display: flex; align-items: center; gap: 8px; font: 500 11px/1 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); }
.mode-k .i { width: 16px; height: 16px; }
.mode-t { margin-top: 10px; font: 600 20px/1.3 var(--font-text); letter-spacing: -.01em; color: var(--text); }
.mode-t .mono { font-size: 20px; letter-spacing: -.01em; }
.mode-d { margin-top: 6px; font-size: 13px; color: var(--text-2); line-height: 1.5; }
.mode-d b { color: var(--text); font-weight: 600; }
.mode-local { margin-top: 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 13px; color: var(--text-2); line-height: 1.4; }
.mode-local b { font: 500 13px/1.3 var(--font-mono); color: var(--text); }
.mode-side { text-align: right; }
.mode-count { font: 600 26px/1 var(--font-text); letter-spacing: -.02em; color: var(--text); }
.mode-count-l { margin-top: 6px; font-size: 12px; color: var(--text-3); }
.mode--schedule { background: linear-gradient(90deg, rgba(45,91,255,.11), rgba(45,91,255,.03)); box-shadow: inset 0 0 0 1px var(--accent-line); }
.mode--schedule .mode-k { color: var(--accent-text); }
.mode--hand { background: linear-gradient(90deg, rgba(255,200,61,.09), rgba(255,200,61,.02)); box-shadow: inset 0 0 0 1px var(--warn-line); }
.mode--hand .mode-k { color: var(--warn); }
.mode--now { background: var(--warn-fill); box-shadow: 0 10px 30px -14px rgba(255,200,61,.55); }
.mode--now .mode-k, .mode--now .mode-t, .mode--now .mode-d, .mode--now .mode-d b, .mode--now .mode-count, .mode--now .mode-local, .mode--now .mode-local b { color: var(--ink); }
.mode--now .mode-count-l { color: rgba(10,13,22,.72); }
.mode--late { background: linear-gradient(90deg, rgba(255,77,79,.14), rgba(255,77,79,.04)); box-shadow: inset 0 0 0 1px var(--bad-line); }
.mode--late .mode-k { color: var(--bad); }
.mode--quiet .mode-k { color: var(--text-3); }
/* the collapsed card's one-line banner */
.mode-compact { align-items: center; padding: 12px 14px; }
.mode-compact .mode-t { margin-top: 8px; font-size: 16px; }
.mode-compact .mode-t .mono { font-size: 16px; }
.mode-compact .mode-local { margin-top: 6px; }

/* Studio's schedule box, field by field, in the order Studio wants them — the HEADLINE of a scheduled card (Studio's values) */
.studio-box { display: grid; grid-template-columns: 1.35fr 1fr .65fr; gap: 1px; margin-top: 12px; border-radius: 10px; overflow: hidden; background: var(--accent-line);
  box-shadow: 0 0 0 1px var(--accent-line); }
.studio-box > div { background: var(--surface); padding: 12px 14px; min-width: 0; display: grid; gap: 8px; position: relative; }
.studio-box .k { display: flex; align-items: center; gap: 6px; font: 500 11px/1 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); }
.studio-box .k i { font-style: normal; display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 4px; background: var(--accent); color: var(--white); font-size: 11px; line-height: 1; letter-spacing: 0; }
.studio-box .v { font: 500 20px/1.15 var(--font-mono); letter-spacing: -.01em; color: var(--text); overflow-wrap: anywhere; }   /* never ellipsised: the uploader types exactly this */
.studio-box .v small { white-space: nowrap; }
.studio-box .v small { font: 500 12px/1 var(--font-mono); letter-spacing: 0; color: var(--text-3); margin-left: 6px; }

/* time rail: the window, the deadline and NOW on one line (uploader's own time) */
.rail { margin-top: 14px; }
.mode .rail { margin-top: 32px; }
.mode-local + .rail { margin-top: 36px; }
.rail-track { position: relative; height: 8px; border-radius: 99px; background: var(--line-2); }
.rail-win { position: absolute; top: 0; bottom: 0; border-radius: 99px; background: rgba(255,200,61,.28); box-shadow: inset 0 0 0 1px rgba(255,200,61,.6); }
.rail-win.is-open { background: var(--warn-fill); box-shadow: none; }
.rail-sched { position: absolute; top: 0; bottom: 0; border-radius: 99px; background: var(--accent-tint-2); box-shadow: inset 0 0 0 1px var(--accent-line); }
.rail-done { position: absolute; top: 0; bottom: 0; left: 0; border-radius: 99px; background: rgba(200,214,255,.16); }
.rail-now { position: absolute; top: -6px; width: 2px; height: 20px; margin-left: -1px; background: var(--text); border-radius: 2px; }
.rail-now::before { content: attr(data-t); position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%); padding: 4px 6px; border-radius: 5px;
  background: var(--text); color: var(--bg); font: 500 11px/1 var(--font-mono); white-space: nowrap; }
.rail-mark { position: absolute; top: -3px; width: 14px; height: 14px; margin-left: -8px; border-radius: 50%; background: var(--surface); box-shadow: inset 0 0 0 2px var(--accent); }
.rail-mark.due { box-shadow: inset 0 0 0 2px var(--warn); }
.rail-labels { position: relative; height: 30px; margin-top: 8px; font: 500 12px/1.3 var(--font-mono); color: var(--text-3); }
.rail-labels span { position: absolute; transform: translateX(-50%); white-space: nowrap; text-align: center; }
.rail-labels span b { display: block; color: var(--text); font-weight: 500; }
.rail-labels span.l { transform: none; text-align: left; } .rail-labels span.r { transform: translateX(-100%); text-align: right; }
.mode--now .rail-track { background: rgba(10,13,22,.16); }
.mode--now .rail-win { background: var(--ink); box-shadow: none; }
.mode--now .rail-now { background: var(--white); box-shadow: 0 0 0 2px var(--ink); }
.mode--now .rail-now::before { background: var(--ink); color: var(--attention); }
.mode--now .rail-labels { color: rgba(10,13,22,.7); }
.mode--now .rail-labels span b { color: var(--ink); }

.vcard { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-card); min-width: 0; }
.vcard + .vcard { margin-top: 12px; }
.vcard-h { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px 16px; }
.vcard-h .th { --tw: 88px; }
.vcard-t { min-width: 0; }
.vcard-ch { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.vcard-ch b { font: 600 16px/1.25 var(--font-text); letter-spacing: -.01em; color: var(--text); white-space: nowrap; }
.vcard-ch span { font: 500 12px/1 var(--font-mono); color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vcard-title { margin-top: 4px; font-size: 14px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vcard-meta { margin-top: 6px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.vcard-state { display: grid; justify-items: end; gap: 6px; }
.vcard-due { font: 500 12px/1 var(--font-mono); color: var(--text-3); white-space: nowrap; }
.vcard-due.hot { color: var(--warn); } .vcard-due.late { color: var(--bad); }
.vcard-sec { padding: 0 16px 16px; display: grid; gap: 12px; }
.vcard-profile { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 14px; border-radius: 10px;
  background: var(--sunk); box-shadow: inset 0 0 0 1px var(--line-2); }
.vcard-profile .k { font: 500 11px/1 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); }
.vcard-profile .v { font: 500 20px/1 var(--font-mono); color: var(--text); letter-spacing: -.01em; margin-top: 6px; }
.vcard-profile .rule { font-size: 13px; color: var(--text-2); line-height: 1.45; border-left: 1px solid var(--line-2); padding-left: 14px; }
.vcard-profile .rule b { color: var(--text); font-weight: 600; }
.vcard-steps { display: flex; gap: 0; counter-reset: s; border-radius: 10px; overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); }
.vcard-steps li { flex: 1; list-style: none; display: flex; align-items: center; gap: 8px; padding: 10px 12px; font-size: 13px; color: var(--text-3); white-space: nowrap;
  border-right: 1px solid var(--line); min-width: 0; }
.vcard-steps li:last-child { border-right: 0; }
.vcard-steps li::before { counter-increment: s; content: counter(s); display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; flex: none;
  font: 500 11px/1 var(--font-mono); color: var(--text-3); box-shadow: inset 0 0 0 1px var(--line-2); }
.vcard-steps li.done { color: var(--text-2); }
.vcard-steps li.done::before { background: var(--text-3); color: var(--bg); box-shadow: none; }
.vcard-steps li.now { color: var(--text); background: var(--accent-tint); }
.vcard-steps li.now::before { background: var(--accent); color: var(--white); box-shadow: none; }
.vcard-body { display: grid; grid-template-columns: 248px minmax(0, 1fr); gap: 16px; align-items: start; }
.vcard-media { display: grid; gap: 10px; }
.vcard-media .th-lg { border-radius: 10px; }
.abthumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.abthumbs .th { --tw: 78px; width: 100%; border-radius: 6px; }
.abthumbs figure { margin: 0; position: relative; }
.abthumbs figcaption { margin-top: 4px; font: 500 11px/1 var(--font-mono); color: var(--text-3); text-align: center; }
.vcard-f { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: end; padding: 14px 16px; border-top: 1px solid var(--line);
  background: var(--surface-2); border-radius: 0 0 14px 14px; }
.vcard.is-now { border-color: rgba(255,200,61,.55); box-shadow: 0 0 0 1px rgba(255,200,61,.3), 0 20px 50px -24px rgba(255,200,61,.35); }
.vcard.is-problem { border-color: var(--warn-line); }
.vcard.is-late { border-color: var(--bad-line); }
.vcard.is-active { border-color: var(--accent-line); box-shadow: 0 0 0 1px rgba(71,119,255,.18), var(--shadow-raised); }
.vcard-quiet .vcard-h { opacity: .9; }

.copyrows { display: grid; border-radius: 10px; box-shadow: inset 0 0 0 1px var(--line-2); overflow: hidden; background: var(--sunk); }
.copyrow { display: grid; grid-template-columns: 112px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 10px 10px 10px 12px; border-top: 1px solid var(--line); }
.copyrow:first-child { border-top: 0; }
.copyrow .k { display: flex; align-items: center; gap: 8px; padding-top: 4px; font: 500 11px/1.2 var(--font-mono); letter-spacing: .09em; text-transform: uppercase; color: var(--text-3); }
.copyrow .k .i { width: 13px; height: 13px; }
.copyrow .v { font-size: 14px; line-height: 1.5; color: var(--text); min-width: 0; overflow-wrap: anywhere; }
.copyrow .v.title { font-weight: 600; font-size: 14px; }
.copyrow .v.long { position: relative; max-height: 92px; overflow: hidden; color: var(--text-2); white-space: pre-line; font-size: 13px; }
.copyrow .v.long::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 30px; background: linear-gradient(transparent, var(--sunk)); }
.copyrow .v.tags { font: 500 13px/1.6 var(--font-mono); color: var(--text-2); }
.copyrow .more { display: inline-flex; margin-top: 6px; }
.copyrow.ab .k { color: var(--accent-text); }
.copyrow .btn { margin-top: -1px; }
.settings { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--line); border-radius: 10px; overflow: hidden; box-shadow: 0 0 0 1px var(--line-2); }
.settings > div { background: var(--sunk); padding: 10px 12px; min-width: 0; }
.settings .k { font: 500 11px/1 var(--font-mono); letter-spacing: .09em; text-transform: uppercase; color: var(--text-3); }
.settings .v { margin-top: 6px; font-size: 13px; color: var(--text); font-weight: 500; }
.settings .v.yes { color: var(--warn); }
.note { display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--warn-tint);
  box-shadow: inset 0 0 0 1px var(--warn-line); font-size: 13px; color: var(--text-2); line-height: 1.5; }
.note .i { color: var(--warn); margin-top: 2px; }
.note b { color: var(--text); font-weight: 600; }
.problem-form { display: grid; grid-template-columns: 290px minmax(0, 1fr) auto; gap: 10px; align-items: end; padding: 12px; border-radius: 10px;
  background: var(--warn-tint); box-shadow: inset 0 0 0 1px var(--warn-line); }

.group-h { display: flex; align-items: center; gap: 12px; margin: 28px 0 12px; }
.group-h .prof { display: inline-flex; align-items: center; gap: 10px; }
.group-h .prof .k { font: 500 11px/1 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); }
.group-h .prof .v { font: 500 16px/1 var(--font-mono); color: var(--text); padding: 6px 10px; border-radius: 7px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line-2); }
.group-h .t3 { font-size: 13px; }
.group-h::after { content: ''; flex: 1; height: 1px; background: var(--line); order: 9; }
.group-h .actions { order: 10; display: flex; gap: 8px; }

.pin-zone { border-radius: 16px; padding: 14px; background: linear-gradient(180deg, rgba(255,200,61,.08), rgba(255,200,61,.02)); box-shadow: inset 0 0 0 1px rgba(255,200,61,.28); }
.pin-zone--late { background: linear-gradient(180deg, rgba(255,77,79,.09), rgba(255,77,79,.02)); box-shadow: inset 0 0 0 1px var(--bad-line); }
.pin-zone--soon { background: linear-gradient(180deg, rgba(255,200,61,.05), rgba(255,200,61,.01)); }
.pin-zone-h { display: flex; align-items: center; gap: 10px; padding: 2px 4px 12px; }
.pin-zone-h .h3 { font-size: 14px; }
.pin-zone-h .overline { color: var(--warn); }

.donelist { display: grid; }
.done-row { display: grid; grid-template-columns: 56px minmax(0, 1fr) 376px 156px; gap: 16px; align-items: center; padding: 12px 16px;
  border-top: 1px solid var(--line); }
.done-row:first-child { border-top: 0; }
.done-row .t b { display: block; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.done-row .t small { display: block; font-size: 13px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.done-row .t small a { font: 500 12px/1 var(--font-mono); }
.done-row .proof { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12px; }
.done-row > .bonus { justify-self: end; }
.bonus { display: inline-grid; justify-items: end; gap: 4px; font: 500 13px/1 var(--font-mono); white-space: nowrap; text-align: right; }
.bonus small { font: 400 12px/1.3 var(--font-text); color: var(--text-3); white-space: normal; }
.bonus.got { color: var(--text); }
.bonus.got b { padding: 4px 6px; border-radius: 6px; background: var(--accent-tint); color: var(--accent-text); box-shadow: inset 0 0 0 1px var(--accent-line); font-weight: 600; }
.bonus.miss b { color: var(--bad); font-weight: 600; }
.bonus.pending { color: var(--text-3); }


/* the status ladder for one video (client: next upload) — brand §7: scheduled → uploading → live → live · checked */
.ladder { display: grid; gap: 0; }
.ladder li { position: relative; display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: 12px; padding-bottom: 16px; }
.ladder li:last-child { padding-bottom: 0; }
.ladder li::before { content: ''; position: absolute; left: 7px; top: 22px; bottom: 2px; width: 2px; border-radius: 2px; background: var(--line); }
.ladder li:last-child::before { display: none; }
.ladder li.done::before { background: var(--accent); }
/* nodes are plain dots on the line (no icons in circles); the status tick replaces the last dot only once it is true */
.ladder-n { width: 16px; height: 16px; margin-top: 3px; display: grid; place-items: center; }
.ladder-n::after { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); box-shadow: inset 0 0 0 2px var(--line-2); }
.ladder li.done .ladder-n::after { background: var(--accent); box-shadow: none; }
.ladder li.now .ladder-n::after { width: 12px; height: 12px; background: var(--surface); box-shadow: inset 0 0 0 3px var(--accent), 0 0 0 4px var(--accent-tint); }
.ladder li.checked .ladder-n::after { display: none; }
.ladder li.checked .tick-i { width: 16px; height: 16px; color: var(--ok); }
.ladder b { display: block; font-weight: 500; font-size: 14px; color: var(--text); line-height: 1.3; margin-top: 2px; }
.ladder li:not(.done):not(.now):not(.checked) b { color: var(--text-3); }
.ladder .proof { display: block; font-size: 12px; margin-top: 2px; }
.ladder.is-guide li:not(.done):not(.now):not(.checked) b { color: var(--text); }   /* an explainer, not a status: plain nodes, normal text */


.when { display: grid; gap: 2px; }
.when b { font: 500 14px/1.3 var(--font-mono); color: var(--text); white-space: nowrap; }
.when span { font-size: 13px; color: var(--text-3); white-space: nowrap; }
.price { font: var(--w-display) 20px/1 var(--font-display); letter-spacing: -.015em; color: var(--text); white-space: nowrap; }
.price small { font: 500 13px/1 var(--font-text); color: var(--text-3); letter-spacing: 0; }
.path-sm { font-size: 12px; gap: 4px; }
.path-sm span { padding: 4px 6px; }
.path-sm .i { width: 11px; height: 11px; }
.dayrail-win { justify-content: flex-start; padding-left: 8px; white-space: nowrap; overflow: hidden; }

/* rail column (sticky aside) */
.with-aside { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; }
.aside { position: sticky; top: 88px; display: grid; gap: 14px; }
.theme-dark .with-aside { grid-template-columns: minmax(0, 1fr) 312px; gap: 24px; }
.theme-dark .aside { top: 76px; gap: 12px; }

/* earnings card */
.earn-total { font: var(--w-display) 40px/1 var(--font-display); letter-spacing: -.028em; color: var(--text); }
.theme-dark .earn-total { font: 600 28px/1 var(--font-text); letter-spacing: -.03em; }
.earn-lines { display: grid; gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line-2); }
.earn-line { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; font-size: 13px; color: var(--text-2); }
.earn-line span:last-child { font: 500 13px/1.4 var(--font-mono); color: var(--text); }
.earn-line.bonus-l span:first-child::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 2px; background: var(--accent); margin-right: 8px; vertical-align: 1px; }
.earn-line.base-l span:first-child::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 2px; background: var(--text-3); margin-right: 8px; vertical-align: 1px; }
.stackbar { display: flex; height: 6px; border-radius: 99px; overflow: hidden; margin-top: 14px; background: var(--line-2); gap: 2px; }
.stackbar i { display: block; height: 100%; }

/* ============================================================================================================
   ADMIN — sidebar shell, warnings, record grid
   ============================================================================================================ */
.shell { --side: 236px; display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100vh;
  background: linear-gradient(90deg, var(--ink) 0 calc(var(--side) - 1px), var(--line) calc(var(--side) - 1px) var(--side), transparent var(--side)); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px; padding: 16px 12px; background: transparent; }
.sidebar .brand { padding: 6px 8px 20px; }
.side-label { padding: 14px 10px 6px; font: 500 11px/1 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--text-4); }
.side-link { display: flex; align-items: center; gap: 10px; height: 32px; padding: 0 10px; border-radius: 8px; color: var(--text-2); font-weight: 500; font-size: 14px; }
.side-link .i { color: var(--text-3); }
.side-link:hover { background: var(--hover); color: var(--text); text-decoration: none; }
.side-link.on { background: rgba(200,214,255,.075); color: var(--text); box-shadow: inset 0 0 0 1px rgba(200,214,255,.06); }
.side-link.on .i { color: var(--sky); }
.side-link .count { margin-left: auto; font: 500 12px/1 var(--font-mono); color: var(--text-3); }
.side-link .count.hot { color: var(--ink); background: var(--warn-fill); padding: 4px 6px; border-radius: 6px; }
.side-link .count.bad { color: var(--ink); background: var(--bad); padding: 4px 6px; border-radius: 6px; }
.side-foot { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px 8px 4px; border-top: 1px solid var(--line); color: var(--text-2); font-size: 13px; }
.main { min-width: 0; }
.hide-desktop { display: none !important; }
.main-top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 14px; height: 56px; padding: 0 28px; border-bottom: 1px solid var(--line);
  background: var(--topbar-bg); backdrop-filter: saturate(160%) blur(16px); -webkit-backdrop-filter: saturate(160%) blur(16px); }
.main-top .crumbs { margin: 0; font-size: 14px; }
.main-top .crumbs b { color: var(--text); font-weight: 500; }
.main-in { padding: 0 28px 64px; max-width: 1240px; }
.view { display: none; }
.view.on { display: block; }

.warnlist { display: grid; }
.warn-row { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 12px 16px; border-top: 1px solid var(--line); font-size: 14px; color: var(--text-2); line-height: 1.5; }
.warn-row:first-child { border-top: 0; }
.warn-row .i { color: var(--warn); margin-top: 2px; }
.warn-row.info .i { color: var(--text-3); }
.warn-row b { color: var(--text); font-weight: 500; }
.warn-row .act { white-space: nowrap; }

/* "every day, every channel": the delivery record — one square per slot */
.record { display: grid; gap: 8px; }
.record-row { display: grid; grid-template-columns: 150px minmax(0, 1fr) 64px; gap: 14px; align-items: center; }
.record-row .name { font-size: 13px; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.record-row .sum { font: 500 12px/1 var(--font-mono); color: var(--text-3); text-align: right; }
.cells { display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); gap: 4px; }
.cells i { display: block; height: 22px; border-radius: 4px; background: var(--sunk); box-shadow: inset 0 0 0 1px var(--line); position: relative; }
.cells i.c { background: var(--ok-tint); box-shadow: inset 0 0 0 1px var(--ok-line); }
.cells i.c::after { content: ''; position: absolute; inset: 0; margin: auto; width: 11px; height: 11px; background: var(--ok);
  -webkit-mask: var(--tick-mask) center / contain no-repeat; mask: var(--tick-mask) center / contain no-repeat; }
.cells i.c2::before { content: ''; position: absolute; right: 2px; top: 2px; width: 4px; height: 4px; border-radius: 1px; background: var(--ok); }
.cells i.s { background: var(--surface); box-shadow: inset 0 0 0 1px var(--border-input); }
.cells i.p { background: var(--warn-tint); box-shadow: inset 0 0 0 1px var(--warn-line); }
.cells i.p::after { content: ''; position: absolute; inset: 0; margin: auto; width: 6px; height: 6px; border-radius: 50%; background: var(--warn-fill); }
.cells i.n { background: transparent; box-shadow: inset 0 0 0 1px var(--line); background-image: repeating-linear-gradient(135deg, transparent 0 4px, var(--line) 4px 5px); }
.cells i.today { box-shadow: inset 0 0 0 1.5px var(--accent); }
.record-days { display: grid; grid-template-columns: 150px minmax(0, 1fr) 64px; gap: 14px; }
.record-days .cells i { height: auto; background: none; box-shadow: none; font: 500 11px/1 var(--font-mono); color: var(--text-4); text-align: center; font-style: normal; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--text-3); }
.legend span { display: inline-flex; align-items: center; gap: 8px; }
.legend .cells { display: inline-grid; grid-template-columns: 14px; }
.legend .cells i { height: 14px; width: 14px; border-radius: 3px; }
.legend .cells i.c::after { width: 8px; height: 8px; }
:root { --tick-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3.9 9.8L3.9 15.4C3.9 18.3 6 20 9.7 20C12.2 20 14.5 18.7 15.2 16.7L20.4 3L16.4 3L11.7 15.4C11.4 16.2 10.7 16.7 9.8 16.7C8.5 16.7 7.7 15.9 7.7 14.6L7.7 9.8Z'/%3E%3C/svg%3E"); }

/* small list rows inside cards (next uploads, uploader load) */
.list-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 20px; border-top: 1px solid var(--line); }
.list-row:first-child { border-top: 0; }
.theme-dark .list-row { padding: 10px 16px; }
.kv { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 16px; font-size: 14px; }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; color: var(--text); text-align: right; font-variant-numeric: tabular-nums; }

/* footer note */
.foot { margin: 56px 0 40px; padding-top: 24px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; align-items: center; gap: 10px 24px; font-size: 13px; color: var(--text-3); }
.foot b { color: var(--text-2); font-weight: 600; }

/* locked page */
.locked { min-height: 100vh; display: grid; place-items: center; padding: 48px 20px; background: var(--glow-floor, none), var(--ink); position: relative; overflow: hidden; }
.locked::before { content: ''; position: absolute; inset: auto -20% -42% -20%; height: 80%; background: radial-gradient(50% 50% at 50% 50%, rgba(45,91,255,.32) 0%, rgba(18,56,214,.12) 45%, transparent 72%); pointer-events: none; }
.locked::after { content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: linear-gradient(rgba(200,214,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(200,214,255,.035) 1px, transparent 1px);
  background-size: 48px 48px; -webkit-mask: radial-gradient(60% 60% at 50% 45%, var(--ink) 0%, transparent 75%); mask: radial-gradient(60% 60% at 50% 45%, var(--ink) 0%, transparent 75%); }
.locked-card { position: relative; z-index: 1; width: 100%; max-width: 440px; padding: 40px 32px 32px; border-radius: 20px; background: rgba(18,23,38,.72);
  border: 1px solid rgba(200,214,255,.12); box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 40px 100px -30px rgba(0,0,0,.8);
  backdrop-filter: blur(24px) saturate(160%); -webkit-backdrop-filter: blur(24px) saturate(160%); }
.locked-card .mark { width: 48px; height: 48px; }
.locked-card .h1 { margin-top: 28px; font-size: 28px; }
.locked-card .lead { margin-top: 10px; font-size: 16px; }
.locked-sep { height: 1px; background: var(--line); margin: 28px 0 20px; }
.locked-foot { position: relative; z-index: 1; margin-top: 28px; display: flex; justify-content: center; gap: 20px; font-size: 13px; color: var(--text-3); }
.locked-wrap { display: grid; justify-items: center; }

/* ============================================================================================================
   v2 COMPONENTS — chips, inline field messages, conflict lock, confirm popover, sheet, skeleton, page states,
   banners, key rows, price delta, admin detail layout
   ============================================================================================================ */
/* chip: a short fact attached to a line ("Different day in Studio: Tue 27 Oct") */
.chip { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 6px; font: 500 12px/1 var(--font-text); white-space: nowrap;
  color: var(--text-2); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line-2); vertical-align: middle; }
.chip .i { width: 13px; height: 13px; }
.chip--attention { color: var(--warn); background: var(--warn-tint); box-shadow: inset 0 0 0 1px var(--warn-line); }
.chip--bad { color: var(--bad); background: var(--bad-tint); box-shadow: inset 0 0 0 1px var(--bad-line); }
.chip--accent { color: var(--accent-text); background: var(--accent-tint); box-shadow: inset 0 0 0 1px var(--accent-line); }
.mode--now .chip { color: var(--ink); background: rgba(10,13,22,.08); box-shadow: inset 0 0 0 1px rgba(10,13,22,.2); }

/* inline field messages: the API's own words under the field, never only a toast */
.field-msg { display: flex; gap: 6px; align-items: flex-start; font-size: 13px; line-height: 1.45; color: var(--text-3); }
.field-msg .i { width: 14px; height: 14px; margin-top: 2px; flex: none; }
.field-msg.is-error { color: var(--bad); }
.field-msg.is-warn { color: var(--warn); }
.field.is-error .input, .field.is-error .select, .input.is-error, .select.is-error { border-color: var(--bad); box-shadow: 0 0 0 3px var(--bad-tint); }

/* a card someone else holds: dimmed, one line says who and since when */
.vcard.is-locked { border-color: var(--line-2); }
.vcard.is-locked .vcard-h > *:not(.vcard-state) { opacity: .6; }
.lockline { display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 10px;
  background: var(--surface-2); box-shadow: inset 3px 0 0 var(--warn-fill), inset 0 0 0 1px var(--line-2); font-size: 14px; color: var(--text-2); }
.lockline .i { width: 16px; height: 16px; color: var(--warn); }
.lockline b { color: var(--text); font-weight: 600; }

/* confirm popover: money and destructive actions ask once, saying exactly what happens */
.pop-wrap { position: relative; display: inline-flex; }
.pop { position: absolute; z-index: 15; right: 0; top: calc(100% + 8px); width: 320px; padding: 14px; border-radius: 12px; text-align: left; white-space: normal;
  background: var(--surface-3); border: 1px solid var(--line-2); box-shadow: var(--shadow-pop); }
.pop-up { top: auto; bottom: calc(100% + 8px); }
.pop-t { font-weight: 600; font-size: 14px; color: var(--text); line-height: 1.4; }
.pop-d { margin-top: 4px; font-size: 13px; color: var(--text-2); line-height: 1.5; }
.pop-d b { color: var(--text); font-weight: 600; }
.pop-amount { margin-top: 10px; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 10px 12px; border-radius: 8px; background: var(--sunk);
  box-shadow: inset 0 0 0 1px var(--line); font-size: 13px; color: var(--text-3); }
.pop-amount b { font: var(--w-display) 22px/1 var(--font-display); letter-spacing: -.02em; color: var(--text); }
.pop-f { margin-top: 12px; display: flex; justify-content: flex-end; gap: 8px; }
.inline-confirm { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--line-2); font-size: 13px; color: var(--text-2); }
.inline-confirm b { color: var(--text); font-weight: 600; }
.inline-confirm .btns { margin-left: auto; display: flex; gap: 8px; }

/* sheet: a panel from the right for create flows (admin: New client, New uploader) */
.scrim { position: fixed; inset: 0; z-index: 50; background: var(--scrim); }
.sheet { position: fixed; z-index: 51; top: 0; right: 0; bottom: 0; width: 480px; max-width: 100%; display: flex; flex-direction: column;
  background: var(--surface); border-left: 1px solid var(--line-2); box-shadow: var(--shadow-pop); }
.sheet-h { display: flex; align-items: flex-start; gap: 12px; padding: 20px 24px 16px; border-bottom: 1px solid var(--line); }
.sheet-h .overline { margin-bottom: 8px; }
.sheet-h .btn-icon { margin-left: auto; }
.sheet-b { flex: 1; overflow: auto; padding: 20px 24px; display: grid; gap: 16px; align-content: start; }
.sheet-f { display: flex; align-items: center; gap: 10px; padding: 14px 24px; border-top: 1px solid var(--line); background: var(--surface-2); }
.sheet-f .hint { margin-right: auto; }

/* skeleton: static blocks (nothing shimmers or pulses — BRAND §10) + one visible line saying what is loading */
.sk { display: block; border-radius: 6px; background: var(--skel); }
.sk-line { height: 12px; } .sk-title { height: 24px; border-radius: 8px; } .sk-pill { height: 22px; width: 92px; border-radius: 99px; }
.sk-th { width: 56px; aspect-ratio: 16 / 9; border-radius: 5px; flex: none; }
.sk-card { border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-card); }
.theme-dark .sk-card { border-radius: 12px; }
.loading-line { display: inline-flex; align-items: center; gap: 8px; font: 500 12px/1 var(--font-mono); color: var(--text-3); }
.loading-line .i { width: 14px; height: 14px; color: var(--accent-text); }

/* page states: API error, offline, session ended — one calm block, the next step, the raw message in mono for support */
.state { display: grid; justify-items: start; gap: 8px; padding: 28px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--shadow-card); max-width: 560px; }
.state-ic { color: var(--text-3); margin-bottom: 4px; }
.state-ic .i { width: 24px; height: 24px; }
.state--error .state-ic { color: var(--bad); }
.state-t { font: 600 20px/1.3 var(--font-text); letter-spacing: -.01em; color: var(--text); }
.state-d { font-size: 14px; line-height: 1.55; color: var(--text-2); max-width: 460px; }
.state-code { margin-top: 4px; font: 500 12px/1.5 var(--font-mono); color: var(--text-3); padding: 8px 10px; border-radius: 8px; background: var(--sunk);
  box-shadow: inset 0 0 0 1px var(--line); }
.state .row { margin-top: 10px; }

/* page banner: account-wide facts (past due, paused, canceled, offline) under the header */
.banner { --rule: var(--line-2); --ic: var(--text-3); display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 14px 18px;
  border-radius: 12px; background: var(--surface); border: 1px solid var(--line); box-shadow: inset 3px 0 0 var(--rule), var(--shadow-card); }
.banner + .banner { margin-top: 10px; }
.banner > .i { width: 18px; height: 18px; color: var(--ic); align-self: start; margin-top: 1px; }
.banner-t { font-weight: 600; font-size: 14px; color: var(--text); line-height: 1.4; }
.banner-d { margin-top: 2px; font-size: 13px; color: var(--text-2); line-height: 1.5; }
.banner-d b { color: var(--text); font-weight: 600; }
.banner .actions { display: flex; gap: 8px; }
.banner--alert { --rule: var(--bad); --ic: var(--bad); }
.banner--attention { --rule: var(--warn-fill); --ic: var(--warn); }
.banner--accent { --rule: var(--accent); --ic: var(--accent-text); }
.offline-bar { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 16px; font-size: 13px; color: var(--ink);
  background: var(--warn-fill); }
.offline-bar .i { width: 14px; height: 14px; }

/* key / link rows: the resting state of a secret — set or not, when it was made, one action. The value itself only ever
   appears once, in .secret.is-new, right after it was made. */
.keyrow { display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 10px;
  background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.keyrow + .keyrow { margin-top: 8px; }
.keyrow > .i { width: 16px; height: 16px; color: var(--text-3); }
.keyrow-t { font-weight: 500; font-size: 14px; color: var(--text); }
.keyrow-s { margin-top: 2px; font: 400 13px/1.4 var(--font-text); color: var(--text-3); }
.keyrow-s .dot { margin-right: 6px; vertical-align: 1px; }

/* the price change a slot makes, next to the stepper, before Save */
.delta { display: inline-flex; align-items: baseline; gap: 6px; font: 600 14px/1 var(--font-text); color: var(--accent-text); white-space: nowrap; }
.delta small { font: 400 12px/1 var(--font-text); color: var(--text-3); }
.edit-panel { display: grid; gap: 16px; padding: 20px; border-top: 1px solid var(--line); background: var(--surface-2); }
.edit-row { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 16px; align-items: center; }
.edit-row > .label { align-self: start; padding-top: 8px; }
.edit-f { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding-top: 4px; }

/* client setup: finished steps fold into one quiet line, open steps stay open */
.done-steps { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 14px 24px; border-top: 1px solid var(--line); font-size: 13px; color: var(--text-3); }
.done-steps span { display: inline-flex; align-items: center; gap: 8px; }
.done-steps span::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }

/* admin: record detail (client) — main column + facts column */
.detail { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.detail-side { display: grid; gap: 12px; position: sticky; top: 72px; }
.detail-main { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; min-width: 0; }
.facts { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px 16px; margin: 0; font-size: 13px; }
.facts dt { color: var(--text-3); }
.facts dd { margin: 0; color: var(--text); text-align: right; min-width: 0; overflow-wrap: anywhere; }
.table .input-sm, .table .select.input-sm { min-width: 0; }
.cell-stack { display: grid; gap: 6px; min-width: 0; }
.lookup { display: flex; gap: 6px; align-items: flex-start; font-size: 12px; line-height: 1.4; color: var(--text-3); }
.lookup .i { width: 13px; height: 13px; margin-top: 1px; flex: none; }
.lookup.is-bad { color: var(--bad); }
.lookup b { color: var(--text); font-weight: 600; }
.backups { display: flex; flex-wrap: wrap; gap: 6px; }
.tagx { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 4px 0 8px; border-radius: 7px; background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--line-2); font-size: 13px; color: var(--text); }
.tagx button { width: 20px; height: 20px; display: grid; place-items: center; border: 0; border-radius: 5px; background: transparent; color: var(--text-3); cursor: pointer; }
.tagx button:hover { background: var(--hover); color: var(--text); }
.tagx .i { width: 12px; height: 12px; }
.log-who { font: 500 12px/1 var(--font-mono); color: var(--text-2); padding: 4px 6px; border-radius: 6px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); white-space: nowrap; }
.table-card.has-pop { overflow: visible; }
.table-card.has-pop th:first-child { border-top-left-radius: 12px; } .table-card.has-pop th:last-child { border-top-right-radius: 12px; }
.vcard-f-4 { grid-template-columns: minmax(0, 1fr) auto auto auto; }
.form-row.form-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.log-who.sys { color: var(--text-3); background: transparent; }

/* ============================================================================================================
   MOTION (product): a card arriving rises 6px and settles; the tick draws once on a verified row. Nothing loops.
   ============================================================================================================ */
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.rise { animation: rise var(--dur-m) var(--ease-out) both; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ============================================================================================================
   RESPONSIVE — 1100 (aside folds under), 760 (tablet), 600 (phone: 16 px gutter, stacked tables, nav row)
   ============================================================================================================ */
@media (max-width: 1100px) {
  .detail { grid-template-columns: minmax(0, 1fr); }
  .detail-side { position: static; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
  .tiles-6, .tiles-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .with-aside, .theme-dark .with-aside { grid-template-columns: minmax(0, 1fr); }
  .aside { position: static; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
  .shell { --side: 64px; }
  .sidebar .brand-ctx { display: none; }
  .sidebar .brand { padding-left: 6px; }
  .sidebar .side-link span, .sidebar .side-label, .sidebar .side-link .count, .side-foot .who-t { display: none; }
}
@media (max-width: 760px) {
  :root { --gutter: 20px; }
  .vcard-body { grid-template-columns: minmax(0, 1fr); }
  .vcard-media { grid-template-columns: 1fr 1fr; align-items: start; }
  .settings { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2, .grid-3, .grid-split { grid-template-columns: minmax(0, 1fr); }
  .tile-group-4 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .done-row { grid-template-columns: 56px minmax(0, 1fr) auto; }
  .done-row .proof-cell { grid-column: 2 / -1; grid-row: 2; }
}
@media (max-width: 600px) {
  :root { --gutter: 16px; }
  body { font-size: 14px; }
  .topbar-in, .theme-dark .topbar-in { height: 56px; gap: 12px; }
  .topbar .nav { display: none; }
  .subnav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; padding: 0 var(--gutter) 10px; margin-top: -2px; }
  .subnav::-webkit-scrollbar { display: none; }
  .subnav a { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 8px; color: var(--text-3); font-weight: 500; font-size: 14px;
    box-shadow: inset 0 0 0 1px var(--line); white-space: nowrap; }
  .subnav a.on { color: var(--text); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-2); }
  .theme-dark .subnav a.on { background: rgba(200,214,255,.07); }
  .subnav .count { font: 500 11px/1 var(--font-mono); color: var(--text-3); }
  .subnav .count.hot { background: var(--warn-fill); color: var(--ink); padding: 4px 6px; border-radius: 5px; }
  .brand-ctx { display: none; }
  .who .who-t, .clock .t3, .hide-phone { display: none !important; }
  .page-head { flex-direction: column; align-items: stretch; gap: 16px; padding: 24px 0 20px; }
  .page-head-actions { margin-left: 0; flex-wrap: wrap; }
  .page-head-actions .btn { flex: 1; }
  .display { font-size: 28px; }
  .h1, .theme-dark .page-head .h1 { font-size: 24px; }
  .h2 { font-size: 20px; }
  .section { margin-top: 32px; }
  .section-h { flex-wrap: wrap; }
  .card-h { padding: 14px 16px; flex-wrap: wrap; }
  .card-b { padding: 16px; }
  .card-f { padding: 12px 16px; flex-wrap: wrap; }
  .tiles, .tiles-6, .tiles-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tile { padding: 14px 14px; }
  .tile-value { font-size: 24px; }
  .theme-dark .tile-value { font-size: 20px; }
  .callout { grid-template-columns: 18px minmax(0, 1fr); padding: 14px 14px 14px 16px; gap: 10px; }
  .callout-actions { grid-column: 1 / -1; }
  .callout-actions .btn { flex: 1; }
  .choice { grid-template-columns: minmax(0, 1fr); }
  .step { grid-template-columns: 28px minmax(0, 1fr); column-gap: 12px; padding: 14px 16px; }
  .step::before { display: none; }
  .step-b { grid-column: 1 / -1; }
  .step-h .actions { margin-left: 0; width: 100%; }
  .setup-h { padding: 16px; flex-wrap: wrap; }
  .setup-progress { width: 100%; margin-left: 0; }
  .secret-row { grid-template-columns: minmax(0, 1fr) auto; }
  .secret-row .k { grid-column: 1 / -1; }
  /* tables → stacked rows */
  .table-stack thead { display: none; }
  .table-stack, .table-stack tbody, .table-stack tr, .table-stack td { display: block; width: 100%; }
  .table-stack tr { padding: 12px 16px; border-bottom: 1px solid var(--line); }
  .table-stack tr:last-child { border-bottom: 0; }
  .table-stack td { padding: 4px 0; border: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; text-align: right; }
  .table-stack td[data-l]::before { content: attr(data-l); font: 500 11px/1.2 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); text-align: left; flex: none; }
  .table-stack td.lead-cell { display: block; text-align: left; padding: 0 0 8px; }
  .table-stack td.lead-cell::before { display: none; }
  .table-stack td.actions { justify-content: flex-end; padding-top: 8px; }
  .table-stack .cell-title { min-width: 0; }
  .table-stack tbody tr:hover td { background: none; }
  .table-stack tr.is-flag td:first-child, .table-stack tr.is-bad td:first-child { box-shadow: none; }
  .table-stack tr.is-flag { box-shadow: inset 3px 0 0 var(--warn-fill); }
  .table-stack tr.is-bad { box-shadow: inset 3px 0 0 var(--bad); }
  .winpick-line .select { width: 96px; }
  .dw-l { display: none; }
  .table-stack td.stack-block { display: block; text-align: left; padding-top: 8px; }
  .vcard-h { grid-template-columns: minmax(0, 1fr); padding: 14px; gap: 10px; }
  .vcard-state { display: flex; justify-items: start; align-items: center; gap: 10px; flex-wrap: wrap; }
  .vcard-media { grid-template-columns: minmax(0, 1fr); }
  .rail-labels span.l, .rail-labels span.r:not(:has(b)) { display: none; }
  .vcard-h > .th { display: none; }
  .vcard-sec { padding: 0 14px 14px; }
  .vcard-profile { grid-template-columns: minmax(0, 1fr) auto; }
  .vcard-profile .rule { grid-column: 1 / -1; border-left: 0; padding-left: 0; border-top: 1px solid var(--line-2); padding-top: 10px; }
  .vcard-steps { display: grid; grid-template-columns: 1fr 1fr; }
  .vcard-steps li { border-bottom: 1px solid var(--line); }
  .vcard-steps li:nth-child(2n) { border-right: 0; }
  .vcard-steps li:nth-last-child(-n+2) { border-bottom: 0; }
  .vcard-f { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); padding: 14px; }
  .vcard-f .field { grid-column: 1 / -1; }
  .mode { grid-template-columns: minmax(0, 1fr); padding: 14px; gap: 10px; }
  .mode-side { text-align: left; display: flex; align-items: baseline; gap: 10px; }
  .mode-t, .mode-t .mono { font-size: 16px; }
  .studio-box .v { font-size: 16px; }
  .studio-box { grid-template-columns: 1.5fr 1fr; }
  .studio-box > div:first-child { grid-column: 1 / -1; }
  .copyrow { grid-template-columns: minmax(0, 1fr) auto; }
  .copyrow .k { grid-column: 1 / -1; padding-top: 0; }
  .settings { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .problem-form { grid-template-columns: minmax(0, 1fr); }
  .group-h { flex-wrap: wrap; }
  .group-h::after { display: none; }
  .done-row { grid-template-columns: minmax(0, 1fr) auto; padding: 12px 14px; }
  .done-row > .th { display: none; }
  .done-row .proof-cell { grid-column: 1 / -1; }
  .pin-zone { padding: 10px; border-radius: 14px; }
  .toasts { left: 16px; right: 16px; top: auto; bottom: 16px; width: auto; }
  .record-row, .record-days { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .record-days > span:first-child, .record-days > span:last-child { display: none; }
  .record-row .sum { text-align: left; }
  .cells { gap: 4px; }
  .cells i { height: 18px; }
  .shell { grid-template-columns: minmax(0, 1fr); background: none; }
  .table-stack td:empty { display: none; }
  .sidebar { display: none; }
  .hide-desktop { display: inline-flex !important; }
  .main-top .crumbs { display: none; }
  .main-top { padding: 0 var(--gutter); }
  .main-in { padding: 0 var(--gutter) 48px; }
  .foot { margin-top: 40px; }
  .locked-card { padding: 28px 24px 24px; }
  .pop { position: static; width: 100%; margin-top: 8px; }
  .pop-wrap { display: grid; justify-items: end; width: 100%; }
  .sheet { width: 100%; border-left: 0; }
  .sheet-h, .sheet-b { padding-left: 16px; padding-right: 16px; }
  .sheet-f { padding: 12px 16px; flex-wrap: wrap; }
  .banner { grid-template-columns: 18px minmax(0, 1fr); padding: 14px 14px 14px 16px; }
  .banner .actions { grid-column: 1 / -1; }
  .banner .actions .btn { flex: 1; }
  .edit-row { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .edit-row > .label { padding-top: 0; }
  .edit-panel { padding: 16px; }
  .state { padding: 20px; }
  .lockline { grid-template-columns: 16px minmax(0, 1fr); }
  .lockline > .btn { grid-column: 1 / -1; }
  .done-steps { padding: 12px 16px; }
  .keyrow { grid-template-columns: 16px minmax(0, 1fr); }
  .keyrow > .btn, .keyrow > .pop-wrap { grid-column: 1 / -1; }
  .vcard-f-4 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .vcard-f-4 > .btn-primary { grid-column: 1 / -1; }
  .form-row.form-3 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .winpick-line .tz { flex-basis: 100%; }
  .callout > div, .callout-t { min-width: 0; overflow-wrap: anywhere; }
}
.field-msg b { color: var(--text-2); font-weight: 600; }

/* headlines keep one family: a time inside a headline is Switzer (tabular by default), not mono */
.mode-t .mono, .h1 .mono, .h2 .mono, .display .mono, .pin-t .mono { font-family: inherit; font-weight: inherit; font-size: inherit; letter-spacing: -.01em; }
.price-sm { font: 600 15px/1 var(--font-text); letter-spacing: -.01em; color: var(--text); white-space: nowrap; }
.price-sm small { font: 500 13px/1 var(--font-text); color: var(--text-3); letter-spacing: 0; }


/* ---------- port additions (src/pages/ui.js PORT_CSS) ---------- */
[hidden] { display: none !important; }
.th { background: var(--surface-2); }
.th img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.vcard .vcard-f + [id^="prob"]:not(:empty) { padding: 0 16px 16px; }
.problem-form { margin-top: 0; }
.edit-tr > td { padding: 0 !important; }
.form-err { margin-top: 4px; }
.keyrow .pop-wrap { margin-left: auto; }
.done-row > .undo { grid-column: -2 / -1; justify-self: end; margin-top: -10px; }
@media (max-width: 600px) { .done-row > .undo { grid-column: 1 / -1; margin-top: -6px; } }
.add-panel { border-top: 1px solid var(--line); }
.table td.actions.wrap { white-space: normal; }
.table-fixed .when span { white-space: normal; }
.mode--now .btn-secondary { color: var(--ink); background: rgba(10,13,22,.08); border-color: rgba(10,13,22,.25); box-shadow: none; }
.table td.actions.wrap .btn { margin: 2px 0 2px 6px; }
section[id], .group-h[id], .page-head[id], #setup { scroll-margin-top: 80px; }
.vcard-body.no-media { grid-template-columns: minmax(0, 1fr); }
#keynew { margin-bottom: 28px; }
.keynew-f { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 12px 14px; border-top: 1px solid var(--line); }
#apinew { margin-bottom: 16px; }
/* a confirm pop-up inside a table card: let it hang out (the card's overflow:hidden scrolled the rows away to show it) */
.table-card:has(.pop) { overflow: visible; }
.api-foot { flex-wrap: wrap; }
.api-foot .mono { word-break: break-all; }
/* /login (pages/login.js): the locked page's ink card with one field */
.login-card { max-width: 460px; }
.login-over { margin-top: 28px; }
.login-card .h1 { margin-top: 10px; }
.login-form { display: grid; gap: 14px; margin-top: 28px; }
.login-form .input { height: 46px; padding: 0 14px; border-radius: 10px; font-size: 14px; }
.login-form .btn-lg { --h: 46px; }
.login-form .btn .i { width: 18px; height: 18px; }
.login-help { margin-top: 16px; font-size: 13px; color: var(--text-3); }
.login-join { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--text-2); }
.login-join b { color: var(--accent-text); font-weight: 600; }
.login-join .i { width: 16px; height: 16px; color: var(--accent-text); transition: transform var(--dur-s, .2s); }
.login-join:hover { text-decoration: none; }
.login-join:hover .i { transform: translateX(3px); }
@media (max-width: 480px) { .locked-foot { flex-wrap: wrap; gap: 4px 12px; text-align: center; padding: 0 12px; } .locked-foot > span:nth-child(2) { display: none; } .locked-foot > span:last-child { flex-basis: 100%; } }
