/* ===== Steve's Video Studio — same family as Steve's Signed & Sealed and Oreo Boards =====
   Instrument Sans for the interface, Newsreader for names and page titles, Reaching Millions "Midnight blend" colors
   (references/brand/tokens.css): a midnight header bar with the compass-and-dragon medallion hanging below it, an ivory page, white cards. Fonts are self-hosted (SIL OFL) so the app works offline. */
@font-face { font-family: "Instrument Sans"; src: url(/fonts/InstrumentSans.woff2) format("woff2"); font-weight: 400 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Newsreader"; src: url(/fonts/Newsreader.woff2) format("woff2"); font-weight: 500 700; font-style: normal; font-display: swap; }

/* ---------- theme tokens ----------
   Light is the :root default. Dark lives twice on purpose: under [data-theme=dark] (Account > Appearance > Dark) and in a
   prefers-color-scheme media block that [data-theme=light] opts out of ("Match my device" removes the attribute).
   The inline script in index.html sets data-theme before first paint. The viewer pages (/v/, /p/, /e/) carry their own
   dark tokens (--sh-*, --lp-*) and never read these. */
:root {
  /* Reaching Millions brand tokens, copied verbatim from references/brand/tokens.css ("Midnight blend", 2026-11-06).
     Every app token below maps onto these; tints are color-mix() of them, never a new hex. Amber (--warn*) is a
     status color, not brand, and keeps its own values. */
  --rm-midnight: #070D1A; --rm-panel: #0E1626; --rm-blue: #0070E5; --rm-blue-hover: #005BC0;
  --rm-crimson: #C8102E; --rm-crimson-on-dark: #E0283F; --rm-mint: #3DDBB0; --rm-mint-text: #0A7A5F; --rm-mint-wash: #DDF6EE;
  --rm-silver: #A6ACB2; --rm-ivory: #F7F4EC; --rm-white: #FFFFFF;
  --rm-ink: #0B1220; --rm-muted: #5D6577; --rm-ink-on-dark: #E6EAF2; --rm-muted-on-dark: #9AA6B8; --rm-line: #E3E0D8; --rm-line-on-dark: #1F2A40;

  /* light: ivory page, white cards, blue for action, mint for done, crimson for record / errors (always with a word) */
  --brand: var(--rm-blue); --brand-ink: var(--rm-blue-hover); --brand-hover: var(--rm-blue-hover); --brand-deep: var(--rm-blue-hover);
  --brand-wash: color-mix(in srgb, var(--rm-blue) 9%, var(--rm-white)); --brand-line: color-mix(in srgb, var(--rm-blue) 30%, var(--rm-white));
  --bg: var(--rm-ivory); --paper: var(--rm-white); --raise: color-mix(in srgb, var(--rm-ivory) 55%, var(--rm-white)); --card: var(--paper);
  --ink: var(--rm-ink); --ink-2: color-mix(in srgb, var(--rm-ink) 78%, var(--rm-muted)); --muted: var(--rm-muted); --line: var(--rm-line);
  --line-strong: color-mix(in srgb, var(--rm-silver) 70%, var(--rm-line)); --line-hover: color-mix(in srgb, var(--rm-silver) 60%, var(--rm-muted));
  --ok: var(--rm-mint-text); --ok-wash: var(--rm-mint-wash); --ok-line: color-mix(in srgb, var(--rm-mint) 45%, var(--rm-white));
  --warn: #8A5A00; --warn-wash: #FFF5E0; --warn-line: #F0DCAE; --warn-hover: #FFEBC2; --warn-line-hover: #E8C77F;
  --bad: var(--rm-crimson); --bad-wash: color-mix(in srgb, var(--rm-crimson) 8%, var(--rm-white)); --bad-line: color-mix(in srgb, var(--rm-crimson) 28%, var(--rm-white));
  --bad-fill: var(--rm-crimson); --bad-hover: color-mix(in srgb, var(--rm-crimson) 85%, var(--rm-ink)); --rec: var(--rm-crimson); --rec-fill: var(--rm-crimson);
  --chip-bg: color-mix(in srgb, var(--rm-line) 60%, var(--rm-white)); --chip-bg-2: color-mix(in srgb, var(--rm-line) 70%, var(--rm-white));
  --tab-on: var(--rm-white); --track: var(--rm-line); --badge-bg: var(--rm-white); --seg-hover: rgba(255, 255, 255, .6);
  --count-bg: color-mix(in srgb, var(--rm-ink) 7%, transparent); --count-on-bg: rgba(255, 255, 255, .18);
  --sel: color-mix(in srgb, var(--rm-blue) 22%, var(--rm-white)); --sel-warm: #ffd9a8;
  --word-hover: color-mix(in srgb, var(--rm-blue) 7%, var(--rm-white)); --word-on: color-mix(in srgb, var(--rm-blue) 20%, var(--rm-white));
  --cut-ink: var(--rm-muted);
  --scroll-thumb: var(--rm-silver); --placeholder: color-mix(in srgb, var(--rm-muted) 85%, var(--rm-silver));
  --focus: var(--rm-blue); --focus-soft: color-mix(in srgb, var(--rm-blue) 18%, transparent);
  --toast-bg: var(--rm-midnight); --toast-ink: var(--rm-ink-on-dark);
  --login-glow: color-mix(in srgb, var(--rm-blue) 10%, var(--rm-ivory));
  --shimmer-a: color-mix(in srgb, var(--rm-line) 60%, var(--rm-white)); --shimmer-b: color-mix(in srgb, var(--rm-ivory) 50%, var(--rm-white));
  /* the header bar is midnight in BOTH modes, with light text on it */
  --bar-bg: var(--rm-midnight); --bar-ink: var(--rm-ink-on-dark); --bar-muted: var(--rm-muted-on-dark); --bar-line: var(--rm-line-on-dark);
  --bar-chip: var(--rm-panel); --bar-tab-on: color-mix(in srgb, var(--rm-ink-on-dark) 14%, var(--rm-panel));
  --bar-accent: color-mix(in srgb, var(--rm-blue) 62%, var(--rm-ink-on-dark)); --bar-rec: var(--rm-crimson-on-dark);
  --font-body: "Instrument Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: "Newsreader", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, monospace;
  --radius: 16px; --radius-sm: 10px;
  --shadow-1: 0 1px 2px rgba(11, 18, 32, .05), 0 1px 1px rgba(11, 18, 32, .03);
  --shadow-2: 0 1px 2px rgba(11, 18, 32, .04), 0 6px 20px rgba(11, 18, 32, .07);
  --shadow-3: 0 2px 6px rgba(11, 18, 32, .06), 0 24px 60px rgba(11, 18, 32, .18);
  --topbar-shadow: 0 1px 0 rgba(7, 13, 26, .08), 0 8px 24px rgba(7, 13, 26, .12); --badge-shadow: 0 2px 4px rgba(7, 13, 26, .12), 0 12px 28px rgba(7, 13, 26, .22);
  --ease: cubic-bezier(.16, 1, .3, 1); --fast: 160ms;
  --gut: max(20px, env(safe-area-inset-left, 0px));
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme=light]) {
    --brand-ink: color-mix(in srgb, var(--rm-blue) 62%, var(--rm-ink-on-dark)); --brand-deep: color-mix(in srgb, var(--rm-blue) 40%, var(--rm-ink-on-dark));
    --brand-wash: color-mix(in srgb, var(--rm-blue) 18%, var(--rm-panel)); --brand-line: color-mix(in srgb, var(--rm-blue) 45%, var(--rm-panel));
    --bg: var(--rm-midnight); --paper: var(--rm-panel); --raise: color-mix(in srgb, var(--rm-ink-on-dark) 5%, var(--rm-panel));
    --ink: var(--rm-ink-on-dark); --ink-2: color-mix(in srgb, var(--rm-ink-on-dark) 70%, var(--rm-muted-on-dark)); --muted: var(--rm-muted-on-dark); --line: var(--rm-line-on-dark);
    --line-strong: color-mix(in srgb, var(--rm-muted-on-dark) 35%, var(--rm-line-on-dark)); --line-hover: color-mix(in srgb, var(--rm-muted-on-dark) 60%, var(--rm-line-on-dark));
    --ok: var(--rm-mint); --ok-wash: color-mix(in srgb, var(--rm-mint) 13%, var(--rm-midnight)); --ok-line: color-mix(in srgb, var(--rm-mint) 35%, var(--rm-midnight));
    --warn: #F5B84A; --warn-wash: #2E2209; --warn-line: #6B4F14; --warn-hover: #3A2B0B; --warn-line-hover: #8A6420;
    --bad: color-mix(in srgb, var(--rm-crimson-on-dark) 62%, var(--rm-ink-on-dark)); --bad-wash: color-mix(in srgb, var(--rm-crimson-on-dark) 16%, var(--rm-midnight));
    --bad-line: color-mix(in srgb, var(--rm-crimson-on-dark) 45%, var(--rm-panel)); --bad-fill: var(--rm-crimson); --rec: var(--rm-crimson-on-dark);
    --chip-bg: color-mix(in srgb, var(--rm-ink-on-dark) 7%, var(--rm-panel)); --chip-bg-2: color-mix(in srgb, var(--rm-ink-on-dark) 7%, var(--rm-panel));
    --tab-on: color-mix(in srgb, var(--rm-ink-on-dark) 14%, var(--rm-panel)); --track: var(--rm-line-on-dark); --badge-bg: var(--rm-panel); --seg-hover: rgba(255, 255, 255, .06);
    --count-bg: rgba(255, 255, 255, .1); --count-on-bg: color-mix(in srgb, var(--rm-midnight) 16%, transparent);
    --sel: color-mix(in srgb, var(--rm-blue) 40%, var(--rm-panel)); --sel-warm: #6B4A14;
    --word-hover: color-mix(in srgb, var(--rm-blue) 15%, var(--rm-panel)); --word-on: color-mix(in srgb, var(--rm-blue) 40%, var(--rm-panel));
    --cut-ink: color-mix(in srgb, var(--rm-muted-on-dark) 75%, var(--rm-ink-on-dark));
    --scroll-thumb: color-mix(in srgb, var(--rm-muted-on-dark) 30%, var(--rm-line-on-dark)); --placeholder: var(--rm-muted-on-dark);
    --focus: color-mix(in srgb, var(--rm-blue) 62%, var(--rm-ink-on-dark)); --focus-soft: color-mix(in srgb, var(--rm-blue) 40%, transparent);
    --toast-bg: color-mix(in srgb, var(--rm-ink-on-dark) 14%, var(--rm-panel)); --toast-ink: var(--rm-ink-on-dark);
    --login-glow: color-mix(in srgb, var(--rm-blue) 20%, var(--rm-midnight));
    --shimmer-a: var(--rm-panel); --shimmer-b: color-mix(in srgb, var(--rm-ink-on-dark) 6%, var(--rm-panel));
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .35), 0 1px 1px rgba(0, 0, 0, .25);
    --shadow-2: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .4);
    --shadow-3: 0 2px 6px rgba(0, 0, 0, .4), 0 24px 60px rgba(0, 0, 0, .6);
    --topbar-shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .3); --badge-shadow: 0 2px 4px rgba(0, 0, 0, .4), 0 12px 28px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}
:root[data-theme=dark] {
  --brand-ink: color-mix(in srgb, var(--rm-blue) 62%, var(--rm-ink-on-dark)); --brand-deep: color-mix(in srgb, var(--rm-blue) 40%, var(--rm-ink-on-dark));
  --brand-wash: color-mix(in srgb, var(--rm-blue) 18%, var(--rm-panel)); --brand-line: color-mix(in srgb, var(--rm-blue) 45%, var(--rm-panel));
  --bg: var(--rm-midnight); --paper: var(--rm-panel); --raise: color-mix(in srgb, var(--rm-ink-on-dark) 5%, var(--rm-panel));
  --ink: var(--rm-ink-on-dark); --ink-2: color-mix(in srgb, var(--rm-ink-on-dark) 70%, var(--rm-muted-on-dark)); --muted: var(--rm-muted-on-dark); --line: var(--rm-line-on-dark);
  --line-strong: color-mix(in srgb, var(--rm-muted-on-dark) 35%, var(--rm-line-on-dark)); --line-hover: color-mix(in srgb, var(--rm-muted-on-dark) 60%, var(--rm-line-on-dark));
  --ok: var(--rm-mint); --ok-wash: color-mix(in srgb, var(--rm-mint) 13%, var(--rm-midnight)); --ok-line: color-mix(in srgb, var(--rm-mint) 35%, var(--rm-midnight));
  --warn: #F5B84A; --warn-wash: #2E2209; --warn-line: #6B4F14; --warn-hover: #3A2B0B; --warn-line-hover: #8A6420;
  --bad: color-mix(in srgb, var(--rm-crimson-on-dark) 62%, var(--rm-ink-on-dark)); --bad-wash: color-mix(in srgb, var(--rm-crimson-on-dark) 16%, var(--rm-midnight));
  --bad-line: color-mix(in srgb, var(--rm-crimson-on-dark) 45%, var(--rm-panel)); --bad-fill: var(--rm-crimson); --rec: var(--rm-crimson-on-dark);
  --chip-bg: color-mix(in srgb, var(--rm-ink-on-dark) 7%, var(--rm-panel)); --chip-bg-2: color-mix(in srgb, var(--rm-ink-on-dark) 7%, var(--rm-panel));
  --tab-on: color-mix(in srgb, var(--rm-ink-on-dark) 14%, var(--rm-panel)); --track: var(--rm-line-on-dark); --badge-bg: var(--rm-panel); --seg-hover: rgba(255, 255, 255, .06);
  --count-bg: rgba(255, 255, 255, .1); --count-on-bg: color-mix(in srgb, var(--rm-midnight) 16%, transparent);
  --sel: color-mix(in srgb, var(--rm-blue) 40%, var(--rm-panel)); --sel-warm: #6B4A14;
  --word-hover: color-mix(in srgb, var(--rm-blue) 15%, var(--rm-panel)); --word-on: color-mix(in srgb, var(--rm-blue) 40%, var(--rm-panel));
  --cut-ink: color-mix(in srgb, var(--rm-muted-on-dark) 75%, var(--rm-ink-on-dark));
  --scroll-thumb: color-mix(in srgb, var(--rm-muted-on-dark) 30%, var(--rm-line-on-dark)); --placeholder: var(--rm-muted-on-dark);
  --focus: color-mix(in srgb, var(--rm-blue) 62%, var(--rm-ink-on-dark)); --focus-soft: color-mix(in srgb, var(--rm-blue) 40%, transparent);
  --toast-bg: color-mix(in srgb, var(--rm-ink-on-dark) 14%, var(--rm-panel)); --toast-ink: var(--rm-ink-on-dark);
  --login-glow: color-mix(in srgb, var(--rm-blue) 20%, var(--rm-midnight));
  --shimmer-a: var(--rm-panel); --shimmer-b: color-mix(in srgb, var(--rm-ink-on-dark) 6%, var(--rm-panel));
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .35), 0 1px 1px rgba(0, 0, 0, .25);
  --shadow-2: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .4);
  --shadow-3: 0 2px 6px rgba(0, 0, 0, .4), 0 24px 60px rgba(0, 0, 0, .6);
  --topbar-shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .3); --badge-shadow: 0 2px 4px rgba(0, 0, 0, .4), 0 12px 28px rgba(0, 0, 0, .5);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 400 16px/1.5 var(--font-body); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
::selection { background: var(--sel); color: var(--ink); }
:where(a) { color: var(--brand-ink); text-underline-offset: 3px; }
h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }
.muted { color: var(--muted); }
.err { color: var(--bad); min-height: 1.4em; margin: 8px 0 0; font-size: 14px; }
.warn { color: var(--warn); background: var(--warn-wash); border-radius: var(--radius-sm); padding: 10px 14px; }
.ic { width: 20px; height: 20px; flex: none; }
:where(#shell, #login) :focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
:where(#shell) ::-webkit-scrollbar { width: 10px; height: 10px; }
:where(#shell) ::-webkit-scrollbar-thumb { background: var(--scroll-thumb); border-radius: 99px; border: 3px solid transparent; background-clip: padding-box; }

/* ---------- controls (owner screens + login; zero specificity so each page can refine) ---------- */
:where(#shell, #login) :where(button, .btn) {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; margin: 0; padding: 0 18px;
  font: 600 15px/1.2 var(--font-body); color: #fff; text-decoration: none; white-space: nowrap; cursor: pointer;
  background: var(--brand); border: 1px solid var(--brand); border-radius: var(--radius-sm);
  box-shadow: 0 1px 2px rgba(0, 60, 130, .18), inset 0 1px 0 rgba(255, 255, 255, .14);
  transition: background var(--fast) var(--ease), border-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease), transform 90ms ease;
}
:where(#shell, #login) :where(button, .btn):hover { background: var(--brand-hover); border-color: var(--brand-hover); }
:where(#shell, #login) :where(button, .btn):active { transform: translateY(1px); }
:where(#shell, #login) :where(button:disabled) { opacity: .55; cursor: default; transform: none; }
:where(#shell) :where(button.ghost, a.ghost, .btn.ghost) { background: var(--paper); color: var(--ink); border-color: var(--line-strong); box-shadow: var(--shadow-1); }
:where(#shell) :where(button.ghost, a.ghost, .btn.ghost):hover { background: var(--raise); border-color: var(--line-hover); }
:where(#shell) :where(button.armed) { background: var(--bad-fill); border-color: var(--bad-fill); color: #fff; }
:where(#shell, #login) :where(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]), select, textarea) {
  font: inherit; font-size: 16px; color: var(--ink); background: var(--paper); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  min-height: 44px; padding: 10px 12px; transition: border-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}
:where(#shell, #login) :where(input, select, textarea):focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px var(--focus-soft); }
:where(#shell) ::placeholder { color: var(--placeholder); }
:where(#shell) progress { width: 100%; height: 8px; border: 0; border-radius: 99px; background: var(--track); overflow: hidden; accent-color: var(--brand); }
:where(#shell) progress::-webkit-progress-bar { background: var(--track); border-radius: 99px; }
:where(#shell) progress::-webkit-progress-value { background: var(--brand); border-radius: 99px; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--brand-line); border-top-color: var(--brand); animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- the header: medallion, name, tabs ---------- */
.topbar { position: relative; z-index: 20; display: flex; align-items: center; gap: 28px; height: 84px; padding: 0 var(--gut) 0 148px;
  background: var(--bar-bg); color: var(--bar-ink); border-bottom: 1px solid var(--bar-line); box-shadow: var(--topbar-shadow);
  padding-top: env(safe-area-inset-top, 0px); height: calc(84px + env(safe-area-inset-top, 0px)); }
.tb-brand { display: flex; align-items: center; text-decoration: none; color: var(--bar-ink); flex: none; }
.tb-badge { position: absolute; left: max(24px, env(safe-area-inset-left, 0px)); top: calc(12px + env(safe-area-inset-top, 0px)); width: 104px; height: 104px; border-radius: 50%;
  background: var(--badge-bg); display: grid; place-items: center; border: 1px solid var(--line);
  box-shadow: var(--badge-shadow); transition: transform 300ms var(--ease); }
.tb-brand:hover .tb-badge { transform: rotate(-8deg); }
.tb-mark { width: 82px; height: 82px; display: block; }
.tb-name { font: 600 1.7rem/1 var(--font-display); letter-spacing: -0.015em; font-optical-sizing: auto; white-space: nowrap; }
.tb-tabs { display: flex; gap: 4px; padding: 4px; background: var(--bar-chip); border-radius: 12px; }
.tb-tab { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 9px; color: var(--bar-muted);
  font-weight: 600; font-size: 15px; text-decoration: none; white-space: nowrap; transition: color var(--fast) var(--ease), background var(--fast) var(--ease); }
.tb-tab .ic { width: 18px; height: 18px; }
.tb-tab:hover { color: var(--bar-ink); }
.tb-tab.on { color: var(--bar-ink); background: var(--bar-tab-on); box-shadow: 0 1px 2px rgba(0, 0, 0, .3); }
.tb-tab.on .ic { color: var(--bar-accent); }
.tb-tab[data-tab="record"] .ic { color: var(--bar-rec); }
.tb-tab:focus-visible, .tb-brand:focus-visible, .tb-out:focus-visible, .tb-acct:focus-visible { outline: 2px solid var(--bar-accent); outline-offset: 2px; }
.tb-out { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px; border: 0; border-radius: 9px;
  background: transparent; color: var(--bar-muted); font: 600 14px/1 var(--font-body); cursor: pointer; }
.tb-out:hover { color: var(--bar-ink); background: var(--bar-chip); }
.tb-out .ic { width: 18px; height: 18px; }
/* Account: same quiet weight as Sign out, just before it. */
.tb-acct { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px; border-radius: 9px;
  color: var(--bar-muted); font: 600 14px/1 var(--font-body); text-decoration: none; }
.tb-acct:hover { color: var(--bar-ink); background: var(--bar-chip); }
.tb-acct.on { color: var(--bar-ink); }
.tb-acct.on .ic { color: var(--bar-accent); }
.tb-acct .ic { width: 18px; height: 18px; }
.tb-acct + .tb-out { margin-left: 0; }

/* ---------- page frame ---------- */
/* top room: the medallion hangs 32px below the header band */
#shell { padding: 56px var(--gut) calc(56px + env(safe-area-inset-bottom, 0px)); }
.page { max-width: 1160px; margin: 0 auto; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 24px; margin: 0 0 28px; }
.page-title { margin: 0; font: 600 clamp(2rem, 3.4vw, 2.6rem)/1.05 var(--font-display); letter-spacing: -0.02em; font-optical-sizing: auto; }
.page-sub { margin: 8px 0 0; color: var(--muted); font-size: 15.5px; max-width: 60ch; }
.page-sub:empty { display: none; }
.empty { text-align: center; padding: 56px 20px; background: var(--paper); border: 1px dashed var(--line-strong); border-radius: var(--radius); }
.empty-icon { display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--brand-wash); color: var(--brand-ink); margin-bottom: 14px; }
.empty-icon .ic { width: 26px; height: 26px; }
.empty-title { margin: 0 0 6px; font: 600 1.35rem/1.2 var(--font-display); }
.empty p.muted { max-width: 46ch; margin: 0 auto 20px; }
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); max-width: calc(100% - 32px); z-index: 50;
  background: var(--toast-bg); color: var(--toast-ink); padding: 12px 18px; border-radius: 12px; box-shadow: var(--shadow-3); font-weight: 500; animation: toast-in .3s var(--ease) both; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 10px); } }

/* ---------- sign in ---------- */
body.is-login { background: radial-gradient(1200px 600px at 50% -10%, var(--login-glow) 0%, var(--bg) 60%); }
.login { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 72px 20px 40px; }
.login-card { position: relative; width: min(400px, 100%); padding: 72px 32px 28px; text-align: center; background: var(--paper); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow-3); }
.login-badge { position: absolute; left: 50%; top: 0; transform: translate(-50%, -50%); width: 112px; height: 112px; border-radius: 50%; background: var(--badge-bg); display: grid; place-items: center;
  border: 1px solid var(--line); box-shadow: var(--badge-shadow); }
.login-badge img { width: 88px; height: 88px; }
.login-card h1 { margin: 0; font: 600 1.85rem/1.1 var(--font-display); letter-spacing: -0.015em; }
.login-sub { margin: 8px 0 26px; color: var(--muted); }
.login-card form { display: grid; gap: 10px; text-align: left; }
.login-label { font-size: 14px; font-weight: 600; color: var(--ink-2); }
.login-card input, .login-card button { width: 100%; }
.login-card button { min-height: 48px; margin-top: 6px; font-size: 16px; }
.login-card .err { text-align: center; margin: 2px 0 0; }
.login-team { display: grid; gap: 10px; }
.login-team[hidden] { display: none; }
.join-form .err:empty { display: none; }
.login-card button.login-switch { min-height: 44px; margin-top: 0; font-size: 14px; color: var(--muted); background: transparent; border-color: transparent; box-shadow: none; }
#vs-update button { margin-left: 8px; min-height: 44px; min-width: 44px; }

/* ---------- record ---------- */
.rec-page { max-width: 1000px; }
.rec { display: grid; gap: 18px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
:where(#shell) .tile { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-height: 168px; padding: 22px 20px; text-align: left; white-space: normal;
  background: var(--paper); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-2);
  transition: transform 220ms var(--ease), box-shadow 220ms var(--ease), border-color var(--fast) var(--ease); }
:where(#shell) .tile:hover { background: var(--paper); border-color: var(--brand-line); transform: translateY(-2px); box-shadow: var(--shadow-3); }
.tile-ic { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: var(--brand-wash); color: var(--brand-ink); }
.tile-ic .ic { width: 26px; height: 26px; }
.tile[data-mode="both"] .tile-ic { background: var(--brand); color: #fff; }
.tile strong { margin-top: 18px; font: 600 1.25rem/1.15 var(--font-display); letter-spacing: -.01em; }
.tile > span:last-of-type { color: var(--muted); font: 400 14px/1.4 var(--font-body); }
.row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px; }
.row label { flex: 1 1 220px; display: flex; flex-direction: column; gap: 6px; }
.row label > span { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.rec-devices { padding: 18px 20px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
.rec-hint, .rec-note { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--muted); font-size: 14px; flex: 1 1 100%; }
.rec-hint .ic, .rec-note .ic { width: 18px; height: 18px; color: var(--brand-ink); }
.rec-note { padding: 12px 16px; background: var(--brand-wash); color: var(--ink-2); border-radius: var(--radius-sm); }
.stage { position: relative; background: var(--rm-midnight); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-3); outline: 3px solid transparent; outline-offset: 3px; transition: outline-color .3s var(--ease); }
.stage.is-live { outline-color: color-mix(in srgb, var(--rec) 55%, transparent); }
.preview { display: block; width: 100%; max-height: 60vh; object-fit: contain; background: var(--rm-midnight); }
/* The Screen + Camera preview is a canvas: size it by its own aspect so the page never stretches it. */
canvas.preview { width: auto; height: auto; max-width: 100%; margin: 0 auto; touch-action: none; }
canvas.preview.over-bubble { cursor: grab; }
canvas.preview.dragging { cursor: grabbing; }
.count { position: absolute; inset: 0; display: grid; place-items: center; font: 600 132px/1 var(--font-display); color: #fff; background: color-mix(in srgb, var(--rm-midnight) 45%, transparent); animation: count .9s var(--ease) both; }
@keyframes count { from { opacity: 0; transform: scale(1.15); } }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
:where(#shell) button.big { min-height: 52px; padding: 0 30px; font-size: 17px; border-radius: 12px; }
:where(#shell) button.stop { background: var(--rec-fill); border-color: var(--rec-fill); }
:where(#shell) button.stop:hover { background: var(--bad-hover); border-color: var(--bad-hover); }
.stop-sq { width: 12px; height: 12px; border-radius: 3px; background: currentColor; }
/* while recording, the controls stay pinned in view: Stop is never below the fold */
.rec-live { position: sticky; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 5; padding: 10px 10px 10px 18px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-2); }
.rec-live button.stop { margin-left: auto; }
.live { display: inline-flex; align-items: center; gap: 8px; color: var(--rec); font: 700 13px/1 var(--font-body); letter-spacing: .08em; }
.live i { width: 10px; height: 10px; border-radius: 50%; background: var(--rec); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; transform: scale(.8); } }
.timer { font: 600 22px/1 var(--font-mono); font-variant-numeric: tabular-nums; color: var(--ink); }
.timer.paused { color: var(--muted); }
.rec-title { display: grid; gap: 6px; }
.rec-title > span { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.rec-title input { width: 100%; font-size: 17px; }
.rec-progress { display: grid; gap: 12px; padding: 24px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-2); }
.rec-progress p { margin: 0; font-weight: 600; color: var(--ink); }
.rec-wait { display: flex; align-items: center; gap: 12px; margin: 0; padding: 24px; font-weight: 600; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }

/* drafts that never finished uploading (library strip) */
.drafts:empty { display: none; }
.drafts h2 { font-size: 15px; font-weight: 600; margin: 0 0 10px; color: var(--ink-2); }
.drafts { margin-bottom: 24px; }
.draft { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; padding: 14px 16px; background: var(--warn-wash); border: 1px solid var(--warn-line); border-radius: var(--radius-sm); margin-bottom: 8px; }
.draft strong { flex: 1 1 100%; }
.draft .muted { font-size: 14px; }

/* ---------- phone ---------- */
@media (max-width: 760px) {
  .topbar { flex-wrap: wrap; height: auto; gap: 0; padding: env(safe-area-inset-top, 0px) var(--gut) 0 96px; min-height: calc(64px + env(safe-area-inset-top, 0px)); }
  .tb-brand { height: 64px; }
  .topbar { padding-left: 88px; }
  .tb-badge { left: max(14px, env(safe-area-inset-left, 0px)); top: calc(7px + env(safe-area-inset-top, 0px)); width: 60px; height: 60px; }
  .tb-mark { width: 48px; height: 48px; }
  .tb-name { font-size: 1.3rem; }
  .tb-out { order: 2; margin-left: auto; padding: 0 10px; }
  .tb-out span { display: none; }
  .tb-acct { order: 2; margin-left: auto; padding: 0 10px; min-width: 44px; justify-content: center; }
  .tb-acct span { display: none; }
  .tb-acct + .tb-out { margin-left: 0; }
  .tb-tabs { order: 3; flex: 1 1 100%; margin: 8px calc(12px - var(--gut)) 10px -76px; }
  .tb-tab { flex: 1; justify-content: center; padding: 0 8px; font-size: 14px; gap: 6px; }
  #shell { padding-top: 26px; }
  .page-head { margin-bottom: 20px; }
  .tiles { grid-template-columns: 1fr 1fr; gap: 10px; }
  :where(#shell) .tile { min-height: 132px; padding: 16px; }
  .tile strong { margin-top: 12px; font-size: 1.08rem; }
  .rec-live { padding-left: 14px; gap: 10px; }
  .rec-live button.stop { flex: 1 1 100%; }
}
@media (max-width: 380px) { .tb-tab .ic { display: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before { animation: none !important; transition: none !important; } }


/* ===== share page (viewer, dark by default) ===== */
.share-body {
  /* the brand's dark palette (--rm-* on :root): midnight page, panel cards, blue controls; --sh-brand-hi is the blue lifted for text/icons on dark */
  --sh-bg: var(--rm-midnight); --sh-panel: var(--rm-panel); --sh-raise: color-mix(in srgb, var(--rm-ink-on-dark) 7%, var(--rm-panel)); --sh-line: var(--rm-line-on-dark);
  --sh-ink: var(--rm-ink-on-dark); --sh-muted: var(--rm-muted-on-dark); --sh-ctlbar: color-mix(in srgb, var(--rm-panel) 60%, var(--rm-midnight));
  --sh-brand: var(--rm-blue); --sh-brand-hover: var(--rm-blue-hover); --sh-brand-hi: color-mix(in srgb, var(--rm-blue) 62%, var(--rm-ink-on-dark));
  --sh-bad: color-mix(in srgb, var(--rm-crimson-on-dark) 62%, var(--rm-ink-on-dark)); --sh-radius: 16px; --sh-gut: max(16px, env(safe-area-inset-left, 0px));
  background: var(--sh-bg); color: var(--sh-ink); color-scheme: dark;
}
.share-body .sh-title { font-family: var(--font-display); font-weight: 600; letter-spacing: -.02em; }
.share-body .sh-end-kicker, .share-body .sh-card h1, .share-body .sh-gate-title { font-family: var(--font-display); font-weight: 600; }
.share { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; padding: 0 var(--sh-gut); padding-bottom: env(safe-area-inset-bottom, 0px); overflow-x: hidden; }
:where(.share) button, :where(.share) input, :where(.share) select { width: auto; margin: 0; font: inherit; color: inherit; }
:where(.share) a { color: inherit; }
.sh-muted { color: var(--sh-muted); }
.sh-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px; max-width: 1360px; width: 100%; margin: 0 auto; padding: calc(18px + env(safe-area-inset-top, 0px)) 0 18px; }
.sh-head { --mk: 68px; }
.sh-mark { height: var(--mk); width: auto; flex: none; } /* the Reaching Millions wordmark (viewers never see the owner compass); an <img> baseline is its bottom edge, so the headline sits on it */
/* the greeting: the title's font at ~88% of its size (title = clamp(22px, 2.6vw, 32px)) */
/* the wordmark's "Reaching Millions" baseline sits 13.2% of its height above the image's bottom edge (descenders below), so lift the greeting onto it */
.share-body .sh-headline { position: relative; top: calc(var(--mk) * -0.132); margin: 0; line-height: 1.2; font-family: var(--font-display); font-size: clamp(19px, 2.3vw, 28px); font-weight: 600; letter-spacing: -.01em; color: var(--sh-muted); }
.sh-main { flex: 1; width: 100%; max-width: 1360px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 400px); gap: 28px; align-items: start; }
.sh-left { min-width: 0; }
.sh-title { font-size: clamp(22px, 2.6vw, 32px); line-height: 1.2; font-weight: 700; letter-spacing: -.015em; margin: 0 0 16px; overflow-wrap: anywhere; }
.sh-desc { color: var(--sh-muted); margin: 18px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.sh-foot { text-align: center; color: var(--sh-muted); font-size: 13px; padding: 40px 0 28px; }

/* player */
/* Rounded on all four corners with the video clipped to match (isolation + translateZ make Safari clip a composited
   <video> to the radius); the plain dark shadow it always had, no glow (Steve 2026-11-08). */
.sh-player { --sh-pr: 18px; background: #000; border-radius: var(--sh-pr); overflow: hidden; isolation: isolate; transform: translateZ(0);
  box-shadow: 0 24px 60px -24px rgba(0, 0, 0, .8), 0 0 0 1px var(--sh-line); }
.sh-player > .sh-stage { border-radius: var(--sh-pr) var(--sh-pr) 0 0; }
.sh-player > .sh-stage:last-child { border-radius: var(--sh-pr); }
.sh-player > .sh-controls { border-radius: 0 0 var(--sh-pr) var(--sh-pr); }
.sh-player:fullscreen { --sh-pr: 0px; transform: none; display: flex; flex-direction: column; }
.sh-player:fullscreen .sh-stage { flex: 1; aspect-ratio: auto; max-height: none; }
.sh-stage { position: relative; aspect-ratio: 16 / 9; max-height: 72vh; width: 100%; background: #000; overflow: hidden; }
.sh-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.sh-video::cue { font-size: 1.05em; background: rgba(0, 0, 0, .72); }
.sh-bigplay { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 84px; height: 84px; border-radius: 50%; border: 0; padding: 0; background: var(--sh-brand); color: #fff; display: grid; place-items: center; cursor: pointer; box-shadow: 0 10px 40px rgba(0, 112, 229, .5); transition: transform .15s ease, opacity .2s ease; }
.sh-bigplay .ic { width: 38px; height: 38px; margin-left: 4px; }
.sh-bigplay:hover { transform: translate(-50%, -50%) scale(1.06); }
.sh-player.started .sh-bigplay { opacity: 0; pointer-events: none; }
.sh-player.started:not(.is-playing) .sh-bigplay { opacity: .92; pointer-events: auto; }
.sh-controls { display: flex; align-items: center; gap: 4px; padding: 6px 8px; background: var(--sh-ctlbar); border-top: 1px solid var(--sh-line); }
.sh-ctl { flex: none; width: 44px; height: 44px; border: 0; border-radius: 10px; background: transparent; display: grid; place-items: center; cursor: pointer; padding: 0; }
.sh-ctl:hover { background: var(--sh-raise); }
.sh-ctl:disabled, .sh-scrub:disabled { opacity: .35; cursor: default; background: transparent; }
.sh-ctl[aria-pressed="true"] { color: var(--sh-brand-hi); }
.ic { width: 22px; height: 22px; flex: none; }
.sh-time { flex: none; font: 600 13px/1 var(--font-body); color: var(--sh-muted); padding: 0 6px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sh-scrub { flex: 1; min-width: 40px; height: 44px; accent-color: var(--sh-brand); background: transparent; cursor: pointer; padding: 0; border: 0; }
.sh-speed { flex: none; height: 44px; min-width: 56px; padding: 0 8px; border-radius: 8px; border: 1px solid var(--sh-line); background: var(--sh-panel); font-size: 13px; cursor: pointer; }
.sh-stage-msg { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; padding: 24px; background: color-mix(in srgb, var(--rm-midnight) 86%, transparent); }
.sh-stage-msg p { margin: 0; font-weight: 600; }
.sh-stage-msg .sh-muted { font-weight: 400; }
.sh-stage-msg .sh-btn { margin-top: 10px; }

/* buttons */
.sh-btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 12px 20px; border-radius: 12px; border: 1px solid var(--sh-line); background: var(--sh-raise); color: var(--sh-ink); font-weight: 600; text-decoration: none; cursor: pointer; line-height: 1.2; transition: background .15s ease, transform .1s ease, border-color .15s ease; }
.sh-btn:active { transform: translateY(1px); }
.sh-btn-primary { background: var(--sh-brand); border-color: var(--sh-brand); color: #fff; }
.sh-btn-primary:hover { background: var(--sh-brand-hover); border-color: var(--sh-brand-hover); }
.sh-btn-quiet:hover, .sh-btn-ghost:hover { border-color: var(--sh-brand-hi); }
.sh-btn-ghost { background: transparent; }
.sh-btn-block { width: 100% !important; }
.sh-btn-lg { min-height: 56px; padding: 14px 26px; font-size: 17px; }
.sh-btn-sm { min-height: 44px; padding: 8px 14px; font-size: 14px; }
.sh-btn:focus-visible, .sh-ctl:focus-visible, .sh-tab:focus-visible, .sh-chapter:focus-visible, .sh-stamp:focus-visible, .sh-bigplay:focus-visible { outline: 2px solid var(--sh-brand-hi); outline-offset: 2px; }
.sh-cta span { overflow-wrap: anywhere; }
.seal { width: 26px; height: 26px; flex: none; border-radius: 50%; }
.sh-btn-primary .seal { background: #fff; padding: 1px; }
.sh-player:has(.sh-cta-card) .sh-bigplay { opacity: 0 !important; pointer-events: none !important; }
.sh-pinned { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 16px; }
.sh-dl-row { display: flex; margin-top: 14px; }
.sh-download { text-decoration: none; }
.sh-pinned .sh-btn { flex: 1 1 220px; }

/* timed CTA card (lower third) */
.sh-overlay { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; padding: 0 16px 16px; pointer-events: none; }
.sh-cta-card { pointer-events: auto; position: relative; display: flex; align-items: center; gap: 16px; max-width: 560px; width: 100%; padding: 14px 52px 14px 18px; border-radius: 14px; background: color-mix(in srgb, var(--rm-panel) 92%, transparent); border: 1px solid rgba(255, 255, 255, .12); box-shadow: 0 12px 40px rgba(0, 0, 0, .5); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); animation: sh-rise .35s ease both; }
.sh-cta-card-label { flex: 1; margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.sh-cta-card .sh-btn { flex: none; }
.sh-x { position: absolute; top: 50%; right: 4px; transform: translateY(-50%); width: 44px; height: 44px; border: 0; border-radius: 10px; background: transparent; color: var(--sh-muted); display: grid; place-items: center; cursor: pointer; padding: 0; }
.sh-x .ic { width: 18px; height: 18px; }
@keyframes sh-rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* end screen */
.sh-end { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; background: radial-gradient(120% 90% at 50% 0%, color-mix(in srgb, var(--rm-blue) 28%, transparent), color-mix(in srgb, var(--rm-midnight) 96%, transparent) 60%); animation: sh-fade .35s ease both; }
.sh-end-inner { display: flex; flex-direction: column; align-items: center; gap: 18px; text-align: center; max-width: 520px; width: 100%; }
.sh-end-kicker { margin: 0; font-size: clamp(20px, 3vw, 28px); font-weight: 700; letter-spacing: -.01em; }
.sh-end-ctas { display: flex; flex-direction: column; gap: 12px; width: 100%; }
@keyframes sh-fade { from { opacity: 0; } to { opacity: 1; } }

/* gate */
.sh-gate { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; gap: 10px; padding: 24px max(24px, calc(50% - 190px)); background: color-mix(in srgb, var(--rm-midnight) 90%, transparent); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.sh-gate-title { margin: 0; font-size: 20px; font-weight: 700; }
.sh-gate-sub { margin: 0 0 6px; font-size: 14px; }
.sh-input { width: 100% !important; min-height: 48px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--sh-line); background: var(--sh-panel); font-size: 16px; }
.sh-input:focus { outline: 2px solid var(--sh-brand); outline-offset: 0; border-color: transparent; }
.sh-err { color: var(--sh-bad); min-height: 1.3em; margin: 0; font-size: 14px; }

/* side: tabs + panels */
.sh-side { position: sticky; top: calc(16px + env(safe-area-inset-top, 0px)); display: flex; flex-direction: column; background: var(--sh-panel); border: 1px solid var(--sh-line); border-radius: var(--sh-radius); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); min-height: 360px; overflow: hidden; margin-top: 54px; }
.sh-tabs { display: flex; gap: 4px; padding: 6px; border-bottom: 1px solid var(--sh-line); flex: none; }
.sh-tab { flex: 1; min-height: 44px; border: 0; border-radius: 10px; background: transparent; color: var(--sh-muted); font-weight: 600; cursor: pointer; }
.sh-tab[aria-selected="true"] { background: var(--sh-raise); color: var(--sh-ink); }
.sh-panel { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 16px 18px 24px; -webkit-overflow-scrolling: touch; }
.sh-search { position: sticky; top: -16px; z-index: 1; display: flex; align-items: center; gap: 8px; margin: -16px -18px 12px; padding: 12px 18px; background: var(--sh-panel); border-bottom: 1px solid var(--sh-line); color: var(--sh-muted); }
.sh-search-input { flex: 1; min-width: 0; min-height: 44px; border: 0; background: transparent; font-size: 16px; color: var(--sh-ink) !important; outline: none; padding: 0; }
.sh-search-count { font-size: 12px; white-space: nowrap; }
.sh-para { margin: 0 0 16px; line-height: 1.75; font-size: 15.5px; color: color-mix(in srgb, var(--rm-ink-on-dark) 85%, var(--rm-muted-on-dark)); }
.sh-stamp { display: flex; align-items: center; min-height: 44px; min-width: 44px; margin: -10px 0 -8px; padding: 0; border: 0; background: none; font: 600 12px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--sh-brand-hi); cursor: pointer; }
.w { cursor: pointer; border-radius: 4px; padding: 1px 0; transition: background .12s ease, color .12s ease; }
.w:hover { background: rgba(255, 255, 255, .08); }
.w.on { background: rgba(0, 112, 229, .32); color: #fff; box-shadow: 0 0 0 2px rgba(0, 112, 229, .32); }
.w.hit { background: rgba(255, 196, 0, .28); color: #fff; }
.sh-nohits { text-align: center; padding: 20px 0; }
.sh-pending { text-align: center; padding: 40px 12px; }
.sh-pending-title { font-weight: 700; margin: 14px 0 4px; }
.sh-pending .sh-muted { margin: 0; font-size: 14px; }
.sh-dots { display: inline-flex; gap: 6px; }
.sh-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--sh-brand); animation: sh-dot 1.2s ease-in-out infinite; }
.sh-dots i:nth-child(2) { animation-delay: .15s; } .sh-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes sh-dot { 0%, 80%, 100% { opacity: .25; transform: scale(.8); } 40% { opacity: 1; transform: scale(1); } }
.sh-notes-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.sh-notes-tag { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--sh-brand-hi); }
.sh-panel h3 { font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--sh-muted); margin: 22px 0 8px; }
.sh-summary { margin: 0; line-height: 1.65; overflow-wrap: anywhere; }
.sh-list { margin: 0; padding-left: 20px; line-height: 1.6; }
.sh-list li { margin-bottom: 6px; overflow-wrap: anywhere; }
.sh-actions { list-style: none; padding-left: 0; }
.sh-actions li { position: relative; padding-left: 28px; }
.sh-actions li::before { content: ""; position: absolute; left: 0; top: .3em; width: 16px; height: 16px; border-radius: 5px; border: 2px solid var(--sh-brand-hi); }
.sh-chapters { list-style: none; margin: 0; padding: 0; }
.sh-chapter { display: flex; align-items: baseline; gap: 12px; width: 100% !important; min-height: 44px; padding: 10px 10px; border: 0; border-radius: 10px; background: transparent; text-align: left; cursor: pointer; }
.sh-chapter:hover { background: var(--sh-raise); }
.sh-chapter-t { flex: none; font: 600 12px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--sh-brand-hi); min-width: 3.5em; }

/* message pages (password, 404, offline) */
.sh-center { display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; padding: 6vh 0; }
.sh-card { width: 100%; max-width: 420px; padding: 32px 28px; text-align: center; background: var(--sh-panel); border: 1px solid var(--sh-line); border-radius: 20px; box-shadow: 0 24px 60px -30px rgba(0, 0, 0, .9); }
.sh-card h1 { font-size: 22px; margin: 16px 0 8px; }
.sh-card > p { margin: 0 0 20px; line-height: 1.55; }
.sh-card-mark { width: 56px; height: 56px; }
.sh-card-icon { width: 56px; height: 56px; margin: 0 auto; border-radius: 50%; display: grid; place-items: center; background: rgba(0, 112, 229, .16); color: var(--sh-brand-hi); }
.sh-card-icon .ic { width: 26px; height: 26px; }
.sh-form { display: flex; flex-direction: column; gap: 10px; }

/* loading skeleton */
.sk { background: linear-gradient(90deg, var(--sh-panel) 0%, var(--sh-raise) 50%, var(--sh-panel) 100%); background-size: 200% 100%; animation: sh-shimmer 1.4s linear infinite; border-radius: 10px; }
.sk-line { display: inline-block; height: 14px; margin: 0 0 14px; }
.sh-headline .sk-line { margin: 0; max-width: 60vw; }
.sk-title { height: 30px; width: 55%; margin-bottom: 16px; }
.sh-stage.sk { border-radius: var(--sh-radius); }
.sk-bar { height: 52px; margin-top: 16px; width: 40%; }
@keyframes sh-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.sh-offscreen { position: fixed; left: -9999px; top: 0; }

@media (prefers-reduced-motion: reduce) { .share *, .share *::before { animation: none !important; transition: none !important; } }

/* phone + tablet: transcript below the player */
@media (max-width: 899px) {
  .sh-main { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .sh-side { position: static; margin-top: 0; max-height: 70vh; max-height: 70dvh; min-height: 300px; }
  .sh-stage { max-height: none; }
}
@media (max-width: 560px) {
  .sh-head { padding-bottom: 12px; }
  .sh-title { margin-bottom: 12px; }
  .sh-player { --sh-pr: 12px; }
  /* the doubled logo and the greeting don't fit side by side on a phone: the greeting goes under the logo, left-aligned */
  .sh-head { flex-wrap: wrap; }
  .sh-headline { flex-basis: 100%; }
  .share-body .sh-headline { top: 0; } /* under the logo on a phone: no lift */
  .sh-bigplay { width: 68px; height: 68px; }
  .sh-bigplay .ic { width: 30px; height: 30px; }
  .sh-controls { gap: 0; padding: 4px; flex-wrap: wrap; }
  .sh-time { font-size: 12px; padding: 0 4px; }
  .sh-scrub { order: -1; flex-basis: 100%; height: 32px; padding: 0 8px; }
  .sh-ctl-hide-xs { display: none; }
  .sh-speed { margin-left: auto; }
  .sh-overlay { padding: 0 8px 8px; }
  .sh-overlay { justify-content: flex-end; }
  .sh-cta-card { width: auto; padding: 6px 44px 6px 6px; gap: 0; }
  .sh-cta-card-label { display: none; }
  .sh-cta-card .sh-btn { min-height: 44px; padding: 8px 14px; font-size: 14px; }
  .sh-cta-card .sh-btn .ic { display: none; }
  .sh-cta-card .seal { width: 22px; height: 22px; }
  .sh-end-kicker { font-size: 18px; }
  .sh-end .sh-btn-lg { min-height: 48px; padding: 10px 18px; font-size: 15px; }
  .sh-end-inner { gap: 10px; }
  .sh-gate { gap: 8px; padding: 14px 18px; }
  .sh-gate-title { font-size: 17px; }
  .sh-stage.has-gate { aspect-ratio: auto; min-height: 330px; }
  .sh-stage.has-end { aspect-ratio: auto; min-height: 300px; }
  .sh-gate-sub { display: none; }
  .sh-gate .sh-input, .sh-gate .sh-btn { min-height: 44px; padding-top: 8px; padding-bottom: 8px; }
}


/* ===== owner edit page /edit/<id> (light) ===== */
.ed-body #shell { padding-top: 52px; }
.ed { max-width: 1440px; margin: 0 auto; }
.ed button, .ed input, .ed select, .ed textarea { width: auto; margin: 0; font: inherit; }
.ed input[type=text], .ed input[type=url], .ed input[type=email], .ed input[type=number], .ed textarea, .ed select { min-height: 40px; padding: 8px 11px; font-size: 15px; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--paper); color: var(--ink); }
.ed textarea { width: 100%; resize: vertical; line-height: 1.45; }
.ed input:focus, .ed textarea:focus, .ed select:focus { outline: none; box-shadow: 0 0 0 3px var(--focus-soft); border-color: var(--focus); }
.ed button { min-height: 40px; padding: 0 14px; font-size: 14.5px; border-radius: 9px; }
.ed button.ghost, .ed .ghost { background: var(--paper); color: var(--ink); border: 1px solid var(--line-strong); box-shadow: var(--shadow-1); }
.ed button.ghost:hover, .ed .ghost:hover { background: var(--raise); border-color: var(--line-hover); }
.ed button.armed { background: var(--bad-fill); border-color: var(--bad-fill); color: #fff; }
.ed-small { font-size: 14px; min-height: 40px; }
.ed-small .ic { width: 17px; height: 17px; }
.ed-loading, .ed-missing { max-width: 520px; margin: 12vh auto; text-align: center; }
.ed-head { display: grid; grid-template-columns: 1fr auto; gap: 8px 20px; align-items: center; margin-bottom: 22px; }
.ed-back { grid-column: 1 / -1; justify-self: start; display: inline-flex; align-items: center; gap: 4px; margin-left: -4px; padding: 4px 8px 4px 4px; border-radius: 8px; font-size: 14px; font-weight: 600; color: var(--muted); text-decoration: none; }
.ed-back:hover { color: var(--ink); background: var(--chip-bg-2); }
.ed-back .ic { width: 18px; height: 18px; }
.ed-titlerow { display: flex; align-items: center; gap: 12px; min-width: 0; flex-wrap: wrap; }
.ed-title { font: 600 clamp(1.6rem, 2.6vw, 2.2rem)/1.1 var(--font-display); margin: 0; overflow-wrap: anywhere; letter-spacing: -.015em; }
.ed-headactions { display: flex; gap: 8px; flex-wrap: wrap; }
.ed-headactions a { display: inline-flex; align-items: center; gap: 8px; padding: 0 14px; border-radius: 9px; text-decoration: none; font-size: 14px; font-weight: 600; }
.ed-statusrow { grid-column: 1 / -1; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.ed-status { margin: 0; font-size: 14px; color: var(--muted); }
.ed-share-flags { grid-column: 1 / -1; margin: 0; font-size: 14px; }
.ed-status.bad { color: var(--bad); }
.ed-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; padding: 4px 11px; border-radius: 999px; background: var(--chip-bg); color: var(--muted); white-space: nowrap; }
.ed-chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.ed-chip[data-status=ready] { background: var(--ok-wash); color: var(--ok); }
.ed-chip[data-status=transcribing], .ed-chip[data-status=noting], .ed-chip[data-status=uploading] { background: var(--brand-wash); color: var(--brand-deep); }
.ed-chip[data-status=transcribing]::before, .ed-chip[data-status=noting]::before, .ed-chip[data-status=uploading]::before { animation: pulse 1.4s ease-in-out infinite; }
.ed-chip[data-status=failed] { background: var(--bad-wash); color: var(--bad); }
.ed-chip[data-status=ai-capped] { background: var(--warn-wash); color: var(--warn); }
.ed-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(360px, 1fr); gap: 28px; align-items: start; }
.ed-left { min-width: 0; position: sticky; top: calc(12px + env(safe-area-inset-top, 0px)); }
.ed-right { min-width: 0; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-2); overflow: hidden; }
.ed-stage { background: var(--rm-midnight); border-radius: var(--radius); overflow: hidden; aspect-ratio: 16 / 9; box-shadow: var(--shadow-3); }
.ed-video { display: block; width: 100%; height: 100%; object-fit: contain; background: #000; }
.ed-controls { display: flex; align-items: center; gap: 14px; margin-top: 14px; }
.ed-play { min-width: 76px; min-height: 40px; }
.ed-time { font: 600 14px/1 var(--font-body); font-variant-numeric: tabular-nums; color: var(--muted); white-space: nowrap; }
.ed-scrubwrap { flex: 1; position: relative; padding-bottom: 8px; min-width: 0; }
.ed .ed-scrub { width: 100%; padding: 0; border: 0; margin: 0; accent-color: var(--brand); height: 28px; }
.ed-marks { position: absolute; left: 0; right: 0; bottom: 0; height: 6px; }
.ed-marks i { position: absolute; top: 0; height: 6px; border-radius: 3px; background: var(--brand); opacity: .75; }
.ed-marks i.sign { background: var(--ok); }
.ed-trim { margin-top: 16px; padding: 14px 16px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-1); }
.ed-trim-head { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; font-size: 14px; margin-bottom: 6px; }
.ed-trim-track { position: relative; height: 34px; }
.ed-trim-track::before { content: ''; position: absolute; left: 0; right: 0; top: 13px; height: 8px; border-radius: 4px; background: var(--track); }
.ed-trim-cuts i { position: absolute; top: 13px; height: 8px; background: repeating-linear-gradient(-45deg, var(--rm-crimson) 0 3px, var(--rm-crimson-on-dark) 3px 6px); border-radius: 2px; }
.ed-trim-in { position: absolute; inset: 0; width: 100%; height: 34px; margin: 0; padding: 0; background: none; pointer-events: none; -webkit-appearance: none; appearance: none; border: 0; }
.ed-trim-in::-webkit-slider-runnable-track { background: transparent; height: 34px; }
.ed-trim-in::-moz-range-track { background: transparent; }
.ed-trim-in::-webkit-slider-thumb { -webkit-appearance: none; pointer-events: auto; width: 14px; height: 30px; margin-top: 2px; border-radius: 4px; background: var(--brand); border: 2px solid var(--paper); box-shadow: 0 1px 4px rgba(0,0,0,.3); cursor: ew-resize; }
.ed-trim-in::-moz-range-thumb { pointer-events: auto; width: 14px; height: 30px; border-radius: 4px; background: var(--brand); border: 2px solid var(--paper); cursor: ew-resize; }
.ed-inline-err { margin: 6px 0 0; min-height: 0; }
.ed-tabs { display: flex; gap: 4px; margin: 10px; padding: 4px; background: var(--chip-bg); border-radius: 12px; overflow-x: auto; scrollbar-width: none; }
.ed .ed-tab { flex: 1; background: transparent; color: var(--muted); border: 0; border-radius: 9px; box-shadow: none; padding: 0 12px; min-height: 38px; font-weight: 600; font-size: 14.5px; white-space: nowrap; }
.ed .ed-tab:hover { background: transparent; color: var(--ink); }
.ed .ed-tab[aria-selected="true"] { color: var(--ink); background: var(--tab-on); box-shadow: var(--shadow-1), 0 0 0 1px color-mix(in srgb, var(--rm-ink) 4%, transparent); }
.ed-panel { padding: 8px 20px 22px; max-height: calc(100vh - 210px); overflow-y: auto; container-type: inline-size; }
/* Narrow panel (phone, or a squeezed desktop): each viewer row becomes a stacked card with inline labels. */
@container (max-width: 520px) {
  .ed-table thead { display: none; }
  .ed-table, .ed-table tbody, .ed-table tr, .ed-table td { display: block; width: auto; }
  .ed-table tr { padding: 10px 0; border-bottom: 1px solid var(--line); }
  .ed-table td { border: 0; padding: 3px 0; }
  .ed-table td[data-label]:not(.ed-who-td) { display: grid; grid-template-columns: 7.5em 1fr; gap: 8px; }
  .ed-table td[data-label]:not(.ed-who-td)::before { content: attr(data-label); color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; padding-top: 2px; }
}
.ed-panel h3 { font: 600 1.15rem/1.2 var(--font-display); margin: 6px 0 10px; }
.ed-hint { font-size: 13px; margin: 8px 0 10px; }
.ed-tools, .ed-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ed-row-fill > input { flex: 1 1 160px; min-width: 0; }
.ed-selbar { position: sticky; top: -8px; z-index: 2; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 10px; margin: 0 0 10px; background: var(--paper); border: 1px solid var(--brand-ink); border-radius: 10px; box-shadow: var(--shadow-2); }
.ed-sel-label { font-size: 14px; font-weight: 600; margin-right: auto; }
.ed-words { font-size: 16.5px; line-height: 1.8; color: var(--ink-2); }
.ed-para { margin: 0 0 14px; }
.ed-stamp { font: 600 12px/1 var(--font-body); font-variant-numeric: tabular-nums; color: var(--brand-ink); background: var(--brand-wash); padding: 2px 6px; border-radius: 5px; margin-right: 6px; user-select: none; }
.ed-words .w { border-radius: 4px; cursor: text; padding: 1px 0; }
.ed-words .w:hover { background: var(--word-hover); }
.ed-words .w.on { background: var(--word-on); }
.ed-words .w.cut { text-decoration: line-through; text-decoration-color: var(--bad); color: var(--cut-ink); background: var(--bad-wash); }
.ed-words .w.fixed { border-bottom: 2px dotted var(--brand-ink); }
.ed-words ::selection { background: var(--sel-warm); }
.ed-fix { width: 9em; padding: 2px 6px !important; font-size: 15px; }
.ed-review { padding: 14px; margin-bottom: 14px; background: var(--raise); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.ed-review-head { margin: 0 0 8px; font-weight: 600; font-size: 14px; }
.ed-fillers { display: grid; gap: 4px; max-height: 260px; overflow-y: auto; margin-bottom: 10px; }
.ed-filler { display: flex; gap: 10px; align-items: center; font-size: 14px; padding: 6px 4px; border-radius: 6px; cursor: pointer; }
.ed-filler:hover { background: var(--paper); }
.ed-filler input { width: 18px; height: 18px; flex: none; }
.ed-filler-t { font: 600 12px/1 var(--font-body); font-variant-numeric: tabular-nums; color: var(--muted); flex: none; }
.ed-empty { text-align: center; padding: 28px 8px; }
.ed-empty-title { font: 600 1.15rem/1.2 var(--font-display); margin: 0 0 4px; }
.ed-empty-line { margin: 4px 0 12px; }
.ed-form { display: grid; gap: 12px; padding-bottom: 18px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.ed-form:last-of-type { border-bottom: 0; }
.ed-field { display: grid; gap: 5px; font-size: 14px; }
.ed-field > span:first-child { color: var(--ink-2); font-weight: 600; font-size: 13px; }
.ed-help { margin: -6px 0 0; font-size: 13px; }
.ed-notes-head, .ed-viewers-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.ed-viewers-head h3 { margin: 0; }
.ed-tag { font-size: 12px; font-weight: 600; color: var(--brand-deep); background: var(--brand-wash); padding: 3px 10px; border-radius: 999px; }
.ed-tag-warn { color: var(--warn); background: var(--warn-wash); }
.ed-note-msg { margin: 8px 0 0; color: var(--ok); font-size: 14px; }
.ed-chapters { display: grid; gap: 6px; }
.ed-ch { display: grid; grid-template-columns: 5.5em 1fr auto; gap: 6px; }
.ed-short { width: 6.5em; }
.ed-cta-list { display: grid; gap: 8px; margin-bottom: 12px; }
.ed-cta { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--paper); box-shadow: var(--shadow-1); }
.ed-cta-main { display: grid; gap: 2px; min-width: 0; font-size: 14px; }
.ed-cta-url { overflow-wrap: anywhere; font-size: 13px; }
.ed-cta-warn { flex-basis: 100%; order: 3; margin: 0; padding: 6px 10px; font-size: 13px; }
.ed-cta-type { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--brand-ink); }
.ed-cta-type.t-sign { color: var(--ok); }
.ed-cta-form { margin-top: 14px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--raise); }
.ed-recipient-result { display: grid; gap: 8px; padding: 14px; margin: -6px 0 18px; border: 1px solid var(--brand-line); background: var(--brand-wash); border-radius: var(--radius-sm); }
.ed-recipient-result .ed-link, .ed-recipient-result .ed-msg { width: 100%; font-size: 14px; }
.ed-table-wrap { overflow-x: auto; }
.ed-table { border-collapse: collapse; width: 100%; font-size: 14px; }
.ed-table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 8px 6px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.ed-table td { padding: 12px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.ed-table tr.unopened td { color: var(--muted); }
.ed-who-td { width: 38%; }
.ed-who, .ed-cell { display: grid; gap: 2px; justify-items: start; overflow-wrap: anywhere; }
.ed-who-actions { margin-top: 6px; }
.ed-cell { grid-auto-flow: row; }
.ed-trunc { margin: 0 0 10px; font-size: 14px; }
.ed-sub { font-size: 12px; }
.ed-badge { justify-self: start; font-size: 11.5px; font-weight: 600; color: var(--warn); background: var(--warn-wash); padding: 1px 8px; border-radius: 999px; }
.ed-pct { white-space: nowrap; }
.ed-clicks { overflow-wrap: anywhere; }
.ed-bar { display: inline-block; width: 60px; height: 6px; border-radius: 99px; background: var(--track); margin-right: 8px; vertical-align: middle; overflow: hidden; }
.ed-bar i { display: block; height: 100%; background: var(--brand); }
.ed-anon { margin: 10px 0 0; }
.ed-thumb { width: 100%; max-width: 320px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 10px; background: #000; }
.ed-filebtn { position: relative; display: inline-flex; align-items: center; padding: 8px 14px; border-radius: 9px; cursor: pointer; overflow: hidden; }
.ed-filebtn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.ed-check { display: flex; gap: 10px; align-items: center; font-size: 15px; min-height: 40px; }
.ed-check input { width: 20px; height: 20px; accent-color: var(--brand); flex: none; }
.ed-check-off { color: var(--muted); }
.ed .ed-delete { color: var(--bad); }
.ed-retry { min-height: 36px; }
@media (max-width: 900px) {
  .ed-grid { grid-template-columns: minmax(0, 1fr); }
  .ed-left { position: static; }
  .ed-panel { max-height: none; padding: 6px 16px 18px; }
  .ed-body #shell { padding-top: 22px; }
  .ed-head { grid-template-columns: minmax(0, 1fr); }
}
/* Watched cell: bar + % on one line, the "watched an earlier cut" note on its own line below (as a grid column it was
   squeezed to one letter per line). */
.ed-cell:has(.ed-bar) { display: flex; flex-wrap: wrap; align-items: center; justify-content: start; gap: 2px 0; }
.ed-cell .ed-stale { flex: 1 0 100%; overflow-wrap: normal; word-break: normal; }
.ed-table td[data-label="Watched"] { min-width: 9.5em; }


/* ===== library "/" ===== */
.lib-record .ic { width: 18px; height: 18px; }
:where(#shell) .lib-record { min-height: 50px; padding: 0 24px; font-size: 16px; border-radius: 12px; }
.lib-record .ic circle:last-child { fill: #fff; }

/* Recent views (top of home) + Who watched (/views): one row per view */
.lib-activity { margin: 0 0 28px; }
.lib-activity:empty { display: none; }
.lib-activity-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 0 10px; }
.lib-h2 { margin: 0; font: 600 1.3rem/1.2 var(--font-display); letter-spacing: -.01em; }
.lib-seeall { font-weight: 600; font-size: 14px; text-decoration: none; }
.lib-seeall::after { content: " →"; }
.lib-seeall:hover { text-decoration: underline; }
.lib-views { list-style: none; margin: 0; padding: 0; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-2); overflow: hidden; }
.lib-views li + li { border-top: 1px solid var(--line); }
.lib-view { display: grid; grid-template-columns: 40px minmax(0, 1.6fr) minmax(140px, 1fr) minmax(0, 1.2fr) 72px; align-items: center; gap: 16px;
  min-height: 64px; padding: 12px 18px; color: var(--ink); text-decoration: none; transition: background var(--fast) var(--ease); }
.lib-view:hover { background: var(--raise); }
.lib-view:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.vw-avatar { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--brand-wash); color: var(--brand-deep); font: 600 17px/1 var(--font-display); }
.vw-avatar.anon { background: var(--chip-bg); color: var(--muted); }
.vw-avatar .ic { width: 18px; height: 18px; }
.is-done .vw-avatar { background: var(--ok-wash); color: var(--ok); box-shadow: inset 0 0 0 1px var(--ok-line); }
.vw-who { display: grid; gap: 2px; min-width: 0; }
.vw-name { display: flex; align-items: baseline; gap: 8px; min-width: 0; font-weight: 600; }
.vw-name > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vw-flag { flex: none; font-size: 12px; font-weight: 500; color: var(--warn); }
.vw-video { font-size: 14px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vw-progress { display: flex; align-items: center; gap: 10px; }
.vw-bar { flex: 1; height: 6px; border-radius: 99px; background: var(--track); overflow: hidden; }
.vw-bar i { display: block; height: 100%; border-radius: 99px; background: var(--brand); }
.vw-pct { flex: none; min-width: 3.4em; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.is-done .vw-pct { color: var(--ok); }
.is-done .vw-bar i { background: var(--ok); }
.vw-clicks { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.vw-click { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; padding: 3px 10px 3px 8px; border-radius: 99px; background: var(--ok-wash); color: var(--ok); font-size: 13px; font-weight: 600; }
.vw-click .ic { width: 14px; height: 14px; }
.vw-click span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vw-ago { justify-self: end; font-size: 13px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* search + archived toggle */
.lib-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 0 0 20px; }
.lib-searchrow { flex: 1 1 320px; position: relative; display: flex; align-items: center; }
.lib-searchrow > .ic { position: absolute; left: 14px; width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
:where(#shell) .lib-search { width: 100%; min-height: 48px; padding-left: 42px; border-radius: 12px; border-color: var(--line); box-shadow: var(--shadow-1); }
.lib-toggle:empty { display: none; }
:where(#shell) .lib-small { min-height: 44px; padding: 0 14px; font-size: 14px; border-radius: 9px; }
.lib-small .ic { width: 17px; height: 17px; }
.lib-hits { margin-bottom: 8px; }
.lib-hits:empty { display: none; }
.lib-hits > .lib-h2 { margin: 0 0 12px; font-size: 1.15rem; }
.lib-hit { display: grid; gap: 4px; padding: 14px 16px; margin-bottom: 8px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-sm); color: var(--ink); text-decoration: none; overflow-wrap: anywhere; box-shadow: var(--shadow-1); }
.lib-hit:hover { border-color: var(--brand-line); }
.lib-hit .muted { font-size: 14px; }

/* the grid of videos */
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 22px; }
.lib-card { position: relative; display: flex; flex-direction: column; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-2);
  transition: transform 260ms var(--ease), box-shadow 260ms var(--ease); }
.lib-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-3); }
.lib-card.is-archived { opacity: .72; }
.lib-thumb { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden;
  background: radial-gradient(120% 120% at 0% 100%, var(--rm-midnight) 0%, var(--rm-blue-hover) 55%, var(--rm-blue) 100%); }
.lib-thumb::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, color-mix(in srgb, var(--rm-midnight) 35%, transparent), transparent 45%); pointer-events: none; }
.lib-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 500ms var(--ease); }
.lib-card:hover .lib-thumb img { transform: scale(1.03); }
.lib-play { position: absolute; left: 50%; top: 50%; z-index: 1; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; color: var(--brand);
  background: rgba(255, 255, 255, .94); box-shadow: 0 6px 20px color-mix(in srgb, var(--rm-midnight) 30%, transparent); transform: translate(-50%, -50%) scale(.85); opacity: 0; transition: opacity 220ms var(--ease), transform 220ms var(--ease); }
.lib-play .ic { width: 24px; height: 24px; margin-left: 3px; }
.lib-thumb:hover .lib-play, .lib-thumb:focus-visible .lib-play { opacity: 1; transform: translate(-50%, -50%) scale(1); }
/* no thumbnail yet (thumbs.js makes one from the stored video): the gradient carries a quiet play mark */
.lib-thumb.is-nothumb .lib-play { opacity: .55; }
.lib-thumb.is-nothumb:hover .lib-play, .lib-thumb.is-nothumb:focus-visible .lib-play { opacity: 1; }
.lib-dur { position: absolute; right: 10px; bottom: 10px; z-index: 1; padding: 4px 7px; border-radius: 6px; background: color-mix(in srgb, var(--rm-midnight) 72%, transparent); color: #fff; font: 600 12px/1 var(--font-body); font-variant-numeric: tabular-nums; }
.lib-body { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px 16px; flex: 1; }
.lib-name { color: var(--ink); font: 600 1.18rem/1.25 var(--font-display); letter-spacing: -.005em; text-decoration: none; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lib-name:hover { color: var(--brand-deep); }
.lib-meta { font-size: 14px; }
.lib-status { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.lib-status:empty { display: none; }
.lib-actions { display: flex; gap: 8px; margin-top: auto; padding-top: 12px; }
:where(#shell) .lib-more { min-width: 44px; padding: 0; }
.lib-copy.is-copied { color: var(--ok); border-color: var(--ok-line); }
.lib-menu { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 10px; border-top: 1px solid var(--line); margin-top: 6px; animation: menu-in .2s var(--ease) both; }
.lib-menu[hidden] { display: none; }
@keyframes menu-in { from { opacity: 0; transform: translateY(-4px); } }
:where(#shell) .lib-danger { color: var(--bad); }
.lib-chip { display: inline-flex; align-items: center; min-height: 26px; padding: 3px 10px; border-radius: 99px; font-size: 12.5px; font-weight: 600; text-decoration: none; background: var(--brand-wash); color: var(--brand-deep); border: 0; }
.lib-chip-warn { background: var(--warn-wash); color: var(--warn); }
.lib-chip-bad { background: var(--bad-wash); color: var(--bad); }
:where(#shell) .lib-chipbtn { min-height: 44px; padding: 0 16px; font-size: 14px; background: var(--warn-wash); color: var(--warn); border: 1px solid var(--warn-line); box-shadow: none; }
:where(#shell) .lib-chipbtn:hover { background: var(--warn-hover); border-color: var(--warn-line-hover); }
.lib-msg { font-size: 13px; }
.lib-err { margin: 0; font-size: 13px; color: var(--bad); }
.lib-empty { grid-column: 1 / -1; }
.lib-none { grid-column: 1 / -1; text-align: center; padding: 32px 0; }

/* ===== Who watched /views ===== */
.vw .page-head { margin-bottom: 20px; }
.vw-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 24px; }
:where(#shell) .vw-chip { min-height: 44px; padding: 0 14px; gap: 8px; border-radius: 99px; font-size: 14px; background: var(--paper); color: var(--ink-2); border-color: var(--line-strong); box-shadow: none; }
:where(#shell) .vw-chip:hover { background: var(--raise); border-color: var(--line-hover); }
:where(#shell) .vw-chip.on { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.vw-count { min-width: 1.6em; padding: 1px 6px; border-radius: 99px; background: var(--count-bg); font-size: 12px; font-variant-numeric: tabular-nums; }
.vw-chip.on .vw-count { background: var(--count-on-bg); }
.vw-day + .vw-day { margin-top: 28px; }
.vw-dayhead { margin: 0 0 10px; font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.vw-none { text-align: center; padding: 32px 0; }
.vw-skel { height: 64px; margin-bottom: 1px; background: linear-gradient(90deg, var(--shimmer-a) 0%, var(--shimmer-b) 50%, var(--shimmer-a) 100%); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; }
.vw-skel:first-child { border-radius: var(--radius) var(--radius) 0 0; } .vw-skel:last-child { border-radius: 0 0 var(--radius) var(--radius); }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

@media (max-width: 760px) {
  .lib-view { grid-template-columns: 40px minmax(0, 1fr) auto; grid-template-areas: "av who ago" "av prog prog" "av clk clk"; gap: 6px 12px; padding: 12px 14px; }
  .vw-avatar { grid-area: av; align-self: start; }
  .vw-who { grid-area: who; }
  .vw-ago { grid-area: ago; align-self: start; padding-top: 2px; }
  .vw-progress { grid-area: prog; }
  .vw-clicks { grid-area: clk; }
  .vw-clicks:empty { display: none; }
  .lib-grid { grid-template-columns: 1fr; gap: 16px; }
  :where(#shell) .lib-record { width: 100%; }
  .lib-top > div { flex: 1 1 100%; }
  .lib-play { opacity: 1; transform: translate(-50%, -50%) scale(.85); }
}

/* Wave A: editor — upload that never finished, personal-link copy, disabled share page link */
.ed-upload-stuck { grid-column: 1 / -1; margin: 0; padding: 12px 14px; border-radius: 10px; font-size: 14.5px; }
.ed-upload-stuck .ed-row { margin-top: 10px; align-items: center; }
.ed-upload-stuck .btn { display: inline-flex; align-items: center; text-decoration: none; padding: 0 14px; border-radius: 9px; font-weight: 600; }
.ed-headactions a.ed-disabled { opacity: .45; pointer-events: none; }
.ed-headactions { align-items: center; }
.ed-public-hint { flex-basis: 100%; margin: 0; font-size: 13px; }
.ed-person-form { grid-column: 1 / -1; }
.ed-person-form .ed-row { display: flex; gap: 8px; flex-wrap: wrap; }
.ed-person-form input { flex: 1 1 200px; min-width: 0; }
.ed button:disabled { opacity: .5; cursor: not-allowed; }

/* Phone held sideways: fit the video to the screen height so the play button and the controls stay on screen.
   The title drops below the player (scroll for it); the transcript is below that, as on portrait. */
@media (orientation: landscape) and (max-height: 500px) {
  .sh-head { padding-top: calc(6px + env(safe-area-inset-top, 0px)); padding-bottom: 6px; }
  .sh-head { --mk: 24px; }
  .sh-mark { height: var(--mk); width: auto; } /* phone held sideways: the stage height below budgets 40px for this header, so the logo stays compact */
  .share-body .sh-headline { font-size: 15px; } /* phone held sideways: the header has a 40px budget */
  .sh-main { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .sh-left { display: flex; flex-direction: column; }
  .sh-left .sh-player { order: -1; }
  .sh-title { margin-top: 12px; }
  .sh-side { position: static; max-height: none; }
  .sh-player:not(:fullscreen) .sh-stage { aspect-ratio: auto; max-height: none; height: calc(100vh - 40px - 60px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)); height: calc(100svh - 40px - 60px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)); min-height: 120px; }
  .sh-stage.has-gate, .sh-stage.has-end { min-height: 0; }
}


/* ===== fix wave E: tap targets, tab bar, toast, focus rings ===== */
.ed-toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 60; max-width: min(92vw, 520px); padding: 12px 18px; border-radius: 12px; background: var(--toast-bg); color: var(--toast-ink); font-size: 14.5px; font-weight: 600; line-height: 1.35; box-shadow: var(--shadow-3); }
.ed-toast.bad { background: var(--bad-fill); color: #fff; }
.ed-toast[hidden] { display: none; }
.ed .ed-tab { min-height: 44px; }
.ed a:focus-visible, .ed button:focus-visible, .ed summary:focus-visible, .ed select:focus-visible, .ed input[type=checkbox]:focus-visible, .ed input[type=file]:focus-visible, .ed input[type=range]:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.ed-check:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 8px; }
.ed-check { min-height: 44px; align-items: center; }
.share a:focus-visible, .share button:focus-visible, .share select:focus-visible, .share input[type=range]:focus-visible, .share-body a:focus-visible, .share-body button:focus-visible, .share-body select:focus-visible, .share-body input[type=range]:focus-visible { outline: 2px solid var(--sh-brand-hi); outline-offset: 2px; }
.sh-search:focus-within { outline: 2px solid var(--sh-brand-hi); outline-offset: 2px; border-radius: 10px; }
@media (max-width: 560px) {
  /* Owner pages on a phone: every control at least 44 x 44. */
  .ed button, .ed-small, .ed-play, .ed input[type=text], .ed input[type=url], .ed input[type=email], .ed input[type=number], .ed input[type=password], .ed input[type=search], .ed textarea, .ed select { min-height: 44px; }
  .ed-headactions a { min-height: 44px; }
  .ed-back { min-height: 44px; padding: 4px 12px 4px 4px; }
  .ed .ed-scrub { height: 44px; }
  .ed-trim-track, .ed-trim-in { height: 44px; }
  .ed-trim-track::before, .ed-trim-cuts i { top: 18px; }
  .ed-trim-in::-webkit-slider-runnable-track { height: 44px; }
  .ed-trim-in::-webkit-slider-thumb { width: 22px; height: 44px; margin-top: 0; }
  .ed-trim-in::-moz-range-thumb { width: 22px; height: 44px; }
  .ed-marks { bottom: 6px; }
  .tb-out { min-width: 44px; justify-content: center; }
  .lib-seeall { display: inline-flex; align-items: center; min-height: 44px; padding: 0 4px; color: var(--brand-deep); }
  /* Five tabs, one row, no scrolling: Settings (where the Alerts switch lives) is always on screen. */
  .ed-tabs { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 2px; margin: 10px 8px; padding: 3px; overflow: visible; }
  .ed .ed-tab { min-height: 44px; padding: 0 2px; font-size: 12.5px; letter-spacing: -.01em; text-overflow: clip; }
  /* Share page */
  .sh-scrub { height: 44px; }
  .sh-controls { padding: 2px 4px; }
}
@media (max-width: 560px) {
  a.lib-name { display: flex; align-items: center; min-height: 44px; }
  a.lib-chip { display: inline-flex; align-items: center; min-height: 44px; }
}

/* ---------- account (/account): owner-wide settings ---------- */
.acct { max-width: 640px; }
.acct-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-1); padding: 24px; }
.acct-card h2 { margin: 0 0 4px; font: 600 1.35rem/1.2 var(--font-display); }
.acct-card > p.muted { margin: 0 0 18px; font-size: 14.5px; }
.acct-form { display: grid; gap: 14px; }
.acct-field { display: grid; gap: 6px; }
.acct-field > label { font-size: 14px; font-weight: 600; color: var(--ink-2); }
.acct-field input { width: 100%; min-height: 48px; }
.acct-field input[aria-invalid=true] { border-color: var(--bad); }
.acct-field .err, .acct-form > .err { margin: 0; min-height: 0; }
.acct-field .err:empty, .acct-form > .err:empty { display: none; }
.acct-form button[type=submit] { justify-self: start; min-height: 48px; }
.acct-card + .acct-card { margin-top: 18px; }
/* Appearance: Light / Dark / Match my device */
.acct-theme { margin: 0; padding: 0; border: 0; min-width: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.acct-opts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.acct-opt { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 10px 14px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--paper); color: var(--ink); font-weight: 600; cursor: pointer; transition: border-color var(--fast) var(--ease), background var(--fast) var(--ease); }
.acct-opt:hover { border-color: var(--line-hover); }
.acct-opt:has(input:checked) { border-color: var(--focus); background: var(--brand-wash); }
.acct-opt:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.acct-opt input { width: 20px; height: 20px; margin: 0; accent-color: var(--brand); flex: none; }
.acct-opt .ic { width: 18px; height: 18px; color: var(--muted); }
.acct-opt small { display: block; font-weight: 400; font-size: 12.5px; color: var(--muted); }
@media (max-width: 560px) { .acct-opts { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 560px) {
  .acct-card { padding: 18px 16px; }
  .acct-form button[type=submit] { justify-self: stretch; }
}

/* ===== the Library tab (/library) + an item (/library/<id>): course videos, see lib-home.js / lib-item.js ===== */
.lb-top { align-items: flex-start; }
.lb-topacts { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
:where(#shell) .lb-upload { min-height: 50px; padding: 0 22px; font-size: 16px; border-radius: 12px; }
.lb-upload .ic { width: 18px; height: 18px; }
.lb-storage { margin: 6px 0 0; font-size: 14px; font-variant-numeric: tabular-nums; }
.lb-storage.is-high { color: var(--warn); font-weight: 600; }
.lb-siteswarn { margin: 0 0 18px; }
.lb-panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-1); padding: 18px 20px; margin: 0 0 18px; display: grid; gap: 10px; }
.lb-panel > .lib-h2 { margin: 0 0 2px; }
.lb-panel p { margin: 0; }
.lb-sitesta, .lb-sitesrow textarea { width: 100%; font-family: var(--font-mono) !important; font-size: 14px !important; }
.lb-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.lb-msg { font-size: 14px; }
.lb-small { font-size: 14px; }
.lb-note { font-size: 13.5px; color: var(--muted); border-left: 3px solid var(--brand-line); padding: 2px 0 2px 12px; }
.lb-seg { display: inline-flex; gap: 4px; padding: 4px; background: var(--chip-bg-2); border-radius: 12px; margin: 0 0 18px; }
:where(#shell) .lb-segbtn { min-height: 44px; padding: 0 18px; background: transparent; color: var(--muted); border: 0; box-shadow: none; border-radius: 9px; }
:where(#shell) .lb-segbtn:hover { background: var(--seg-hover); color: var(--ink); border: 0; }
:where(#shell) .lb-segbtn.on { background: var(--tab-on); color: var(--ink); box-shadow: var(--shadow-1); }
.lb-folders { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
:where(#shell) .lb-fchip { max-width: 100%; min-width: 0; }
.lb-fname-t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* a phone: one swipeable row of folders, long names cut with an ellipsis (the full name is the chip's title) */
@media (max-width: 560px) {
  .lb-folders { flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; padding-bottom: 2px; }
  .lb-folders::-webkit-scrollbar { display: none; }
  :where(#shell) .lb-fchip { flex: none; max-width: min(78vw, 300px); }
}
:where(#shell) .lb-fchip { min-height: 44px; padding: 0 14px; gap: 7px; font-size: 14px; background: var(--paper); color: var(--ink-2); border: 1px solid var(--line-strong); box-shadow: none; border-radius: 99px; }
:where(#shell) .lb-fchip:hover { background: var(--raise); border-color: var(--line-hover); }
:where(#shell) .lb-fchip.on { background: var(--brand-wash); color: var(--brand-deep); border-color: var(--brand-line); }
.lb-fic { width: 16px !important; height: 16px !important; }
.lb-fcount { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
:where(#shell) .lb-fadd { border-style: dashed; color: var(--muted); }
.lb-fnew { display: inline-flex; gap: 6px; align-items: center; }
.lb-fname { width: 180px; }
.lb-ups { display: grid; gap: 10px; margin: 0 0 18px; }
.lb-ups:empty { display: none; }
.lb-up { display: grid; gap: 8px; padding: 14px 16px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow-1); }
.lb-up.is-done { border-color: var(--ok-line); }
.lb-up.is-bad { border-color: var(--bad-line); }
.lb-up.is-bad .lb-upmsg { color: var(--bad); }
.lb-uphead { display: flex; justify-content: space-between; gap: 12px; min-width: 0; }
.lb-upname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-uppct { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--brand-deep); }
.lb-upmsg { font-size: 14px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.lb-upwarn { color: var(--warn); }
.lb-pending { border-style: dashed; }
.lb-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
/* the Courses box on every card: ticked = in Courses, unticked = in Meetings (private) */
.lb-course { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; min-height: 44px; padding: 0 6px; font-size: 13px; cursor: pointer; user-select: none; } /* 44 px: a thumb-sized target on the phone */
.lb-course input { width: 20px; height: 20px; margin: 0; accent-color: var(--accent, #0070E5); cursor: pointer; }
.lb-course input:disabled { cursor: not-allowed; }
.lb-course.is-busy { opacity: .6; }
.lb-course .lb-course-msg { color: var(--bad, #b42318); }
.lb-priv { gap: 5px; }
.lb-chip-ic { width: 14px !important; height: 14px !important; }
.lb-priv-link { background: var(--ok-wash); color: var(--ok); }
.lb-priv-password { background: var(--warn-wash); color: var(--warn); }
.lb-priv-private { background: var(--chip-bg); color: var(--ink-2); }
.lb-reorder { display: flex; gap: 6px; margin-top: auto; padding-top: 10px; }
:where(#shell) .lb-mv { min-height: 44px; min-width: 44px; padding: 0; border-radius: 9px; }
.lb-empty .btn, .lb-empty button { margin-top: 4px; }

.lb-back { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; margin: -10px 0 6px; font-weight: 600; text-decoration: none; }
.lb-back .ic { width: 18px; height: 18px; }
.lbi-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin: 0 0 22px; }
.lbi-title { overflow-wrap: anywhere; }
.lbi-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.lb-preview { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: #000; box-shadow: var(--shadow-2); margin: 0 0 18px; }
.lb-preview iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.lb-preview-empty { display: grid; place-items: center; color: #fff; }
.lb-linkrow { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.lb-link { flex: 1 1 260px; min-width: 0; padding: 11px 12px; border-radius: var(--radius-sm); background: var(--raise); border: 1px solid var(--line); font-size: 13.5px; overflow-wrap: anywhere; }
.lb-code { width: 100%; font-family: var(--font-mono) !important; font-size: 12.5px !important; color: var(--ink-2) !important; background: var(--raise) !important; resize: vertical; }
.lb-field { display: grid; gap: 6px; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.lb-field input, .lb-field textarea, .lb-field select { width: 100%; font-weight: 400; }
.lb-radios { display: grid; gap: 8px; }
.lb-radio { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; min-height: 44px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); cursor: pointer; transition: border-color var(--fast) var(--ease), background var(--fast) var(--ease); }
.lb-radio:hover { border-color: var(--line-hover); }
.lb-radio.on { border-color: var(--brand-ink); background: var(--brand-wash); }
.lb-radio.is-off { opacity: .5; cursor: default; }
.lb-radio input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--brand); flex: none; }
.lb-radiotext { display: grid; gap: 2px; font-size: 14px; }
.lb-radiotext strong { font-size: 15px; }
.lb-sitesrow { display: grid; gap: 8px; }
.lb-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.lb-tile { display: grid; gap: 2px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--raise); border: 1px solid var(--line); }
.lb-tile strong { font: 600 1.6rem/1.1 var(--font-display); font-variant-numeric: tabular-nums; }
.lb-tile span { font-size: 13px; }
.lb-files { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.lb-files li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.lb-files li a { font-weight: 600; overflow-wrap: anywhere; }
.lb-files li span { font-size: 13.5px; flex: 1; }
.lb-danger { padding-top: 8px; border-top: 1px solid var(--line); }
/* item page: embed options, the make-shareable button, the bitrate warning, the drop-off graph */
.lb-eo { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--raise); }
.lb-eo-sum { cursor: pointer; min-height: 44px; display: flex; align-items: center; padding: 0 14px; font-weight: 600; font-size: 14.5px; color: var(--ink-2); }
.lb-eo[open] .lb-eo-sum { border-bottom: 1px solid var(--line); }
.lb-eo > p, .lb-eo > span { display: block; padding: 0 14px 12px; }
.lb-eo-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 4px 16px; padding: 10px 14px; }
.lb-eo-opt { min-height: 44px; }
.lb-eo-field { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 15px; }
.lb-eo-start { width: 7em; min-height: 44px; }
.lb-eo-color { width: 56px; min-height: 44px; padding: 2px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong); background: var(--paper); cursor: pointer; }
.lb-bitrate { margin: 0; }
.lb-eng { margin: 6px 0 0; display: grid; gap: 6px; }
.lb-eng-cap { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; font-size: 14px; }
.lb-eng-cap .muted { font-size: 13.5px; }
.lb-eng-plot { position: relative; height: 120px; border-radius: var(--radius-sm); background: var(--raise); border: 1px solid var(--line); overflow: hidden; }
.lb-eng-svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.lb-eng-area { fill: var(--brand-wash); }
.lb-eng-line { fill: none; stroke: var(--brand); stroke-width: 2; }
.lb-eng-grid { stroke: var(--line); stroke-width: .5; vector-effect: non-scaling-stroke; }
.lb-eng-y { position: absolute; right: 8px; font-size: 11.5px; color: var(--muted); }
.lb-eng-y0 { top: 4px; } .lb-eng-y1 { bottom: 4px; }
.lb-eng-x { display: flex; justify-content: space-between; font-size: 12.5px; font-variant-numeric: tabular-nums; }
@media (max-width: 900px) {
  .lbi-grid { grid-template-columns: minmax(0, 1fr); }
  .lb-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .lb-topacts { width: 100%; }
  :where(#shell) .lb-upload { flex: 1; }
  .lb-panel { padding: 16px; }
}
/* four tabs on a 390-px phone: labels only, a little tighter */
@media (max-width: 460px) {
  .tb-tab .ic { display: none; }
  .tb-tab { padding: 0 4px; font-size: 13.5px; }
}

/* ---------- account: team ---------- */
.acct-team { list-style: none; margin: 0 0 18px; padding: 0; display: grid; gap: 10px; }
.acct-team[hidden] { display: none; }
.acct-member { display: grid; gap: 8px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.acct-member-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.acct-member-head .muted { font-size: 14px; }
.acct-member-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.acct-member .err:empty { display: none; }
.acct-reset { display: flex; flex-wrap: wrap; gap: 8px; }
.acct-reset[hidden] { display: none; }
.acct-reset input { flex: 1 1 200px; min-height: 44px; }
.acct-invite { display: grid; gap: 12px; margin-bottom: 18px; }
.acct-invite-out { display: grid; gap: 8px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.acct-invite-out[hidden], .acct-invite .acct-team[hidden] { display: none; }
.acct-invite-out input { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px; }
.acct-sub { margin: 8px 0 10px; font-size: 1rem; }

/* ---- fix wave P2: the password-length hint, the slow-connection copy ---- */
.lb-pwfield { display: grid; gap: 6px; }
.lb-pwhint { margin: 0; color: var(--warn); background: var(--warn-wash); border: 1px solid var(--warn-line); border-radius: var(--radius-sm); padding: 8px 12px; }
.lb-lowrow { display: grid; gap: 8px; margin-top: 4px; }
.lb-low { margin: 0; }
.lb-low.is-ready { color: var(--ok); }
.lb-uplow { margin: 4px 0 0; }
.lb-uplow-off { color: var(--warn); }

/* ---- the editor (/editor/<id>, public/studio.js) ---- */
.st-headrow { display: grid; gap: 6px; margin: 0 0 18px; }
.st-headrow p { margin: 0; }
.st-title { margin: 0; font: 600 clamp(1.6rem, 2.6vw, 2.1rem)/1.1 var(--font-display); letter-spacing: -0.015em; overflow-wrap: anywhere; }
/* video left, transcript right; the transcript is as tall as the video column and scrolls inside it */
.st-top { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(280px, 1fr); gap: 20px; align-items: stretch; margin: 0 0 14px; }
.st-left { display: grid; gap: 12px; align-content: start; }
.st-stage { position: relative; aspect-ratio: 16 / 9; background: #000; border-radius: var(--radius); overflow: hidden; }
.st-video, .st-overlay { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.st-overlay[hidden] { display: none; }
.st-controls { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.st-play { display: inline-flex; align-items: center; gap: 6px; }
.st-time { font-variant-numeric: tabular-nums; color: var(--ink-2); font-size: 14px; }
.st-preview-toggle { margin-left: auto; }
.st-inline { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }
.st-script { position: relative; margin: 0; padding: 0; min-height: 260px; }
.st-script-in { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 8px; padding: 16px 18px; min-height: 0; }
.st-script-head { display: grid; gap: 4px; }
.st-words { flex: 1 1 auto; min-height: 0; overflow-y: auto; position: relative; font-size: 16px; line-height: 1.75; color: var(--ink-2); user-select: none; -webkit-user-select: none; touch-action: pan-y; padding-right: 4px; }
.st-words-note:empty { display: none; }
.st-para { margin: 0 0 12px; }
.st-stamp { font: 600 12px/1 var(--font-body); font-variant-numeric: tabular-nums; color: var(--brand-ink); background: var(--brand-wash); padding: 2px 6px; border-radius: 5px; margin-right: 4px; }
.st-w { border-radius: 4px; padding: 1px 0; cursor: pointer; transition: background .1s ease, color .1s ease; }
.st-w:hover { background: var(--word-hover); }
.st-w.on { background: var(--word-on); color: var(--ink); }
.st-w.sel { background: var(--sel); color: var(--ink); box-shadow: 0 0 0 1px color-mix(in srgb, var(--brand) 35%, transparent); }
.st-w.cut { color: var(--cut-ink); text-decoration: line-through; text-decoration-color: var(--bad); text-decoration-thickness: 1.5px; opacity: .7; }
.st-w.cut:hover { opacity: 1; background: var(--bad-wash); }
.st-w.cut.sel { opacity: 1; }
.st-selbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 6px 8px; border-radius: var(--radius-sm); background: var(--brand-wash); border: 1px solid var(--brand-line); }
.st-sel-label { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; margin-right: 4px; }
.st-selbar .is-on { background: var(--brand); color: #fff; border-color: var(--brand); }
/* the bar */
.st-tl { display: grid; gap: 8px; margin: 0 0 18px; }
.st-tlbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-height: 40px; }
.st-tlspace { flex: 1 1 auto; }
.st-addslide { display: inline-flex; align-items: center; gap: 6px; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; background: var(--ok-wash); color: var(--ok); border: 1px dashed var(--ok); font-weight: 600; }
.st-addslide:active { cursor: grabbing; }
.st-addslide-plus { font-size: 18px; line-height: 1; }
.st-ghost { position: fixed; left: 0; top: 0; z-index: 80; pointer-events: none; margin: -18px 0 0 0; padding: 6px 12px; border-radius: 8px; background: var(--ok); color: var(--paper); font: 600 13px/1.2 var(--font-body); box-shadow: var(--shadow-3); opacity: .85; white-space: nowrap; }
.st-ghost.is-over { opacity: 1; }
.st-zoom { display: inline-flex; align-items: center; gap: 4px; }
.st-zoombtn { min-width: 38px; min-height: 34px; padding: 0 10px; font-size: 20px; line-height: 1; font-weight: 600; }
.st-zoom-label { min-width: 7.5em; text-align: center; font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.st-scroll { overflow-x: auto; overflow-y: hidden; border-radius: 10px; background: var(--track); scrollbar-width: thin; }
.st-track { position: relative; width: 100%; min-width: 100%; padding: 0 0 6px; outline: none; }
.st-track:focus-visible { box-shadow: inset 0 0 0 2px var(--focus); }
.st-ruler { position: relative; height: 22px; cursor: pointer; touch-action: none; border-bottom: 1px solid var(--line-strong); }
.st-tick { position: absolute; top: 3px; padding-left: 4px; border-left: 1px solid var(--line-strong); font: 500 11px/16px var(--font-body); color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; pointer-events: none; }
.st-lane { position: relative; margin: 6px 0 0; }
.st-lane > i, .st-lane > b { position: absolute; top: 0; bottom: 0; display: block; }
.st-vlane { height: 46px; cursor: text; touch-action: pan-x; }
.st-kept { left: 0; right: 0; background: var(--brand-line); border-radius: 6px; }
.st-cut { background: repeating-linear-gradient(135deg, var(--line-strong) 0 6px, var(--paper) 6px 12px); cursor: pointer; }
.st-selr { background: color-mix(in srgb, var(--brand) 30%, transparent); box-shadow: inset 0 0 0 2px var(--brand); border-radius: 3px; pointer-events: none; }
.st-mark { background: color-mix(in srgb, var(--bad) 35%, transparent); pointer-events: none; }
.st-handle { width: 14px; margin-left: -7px; cursor: ew-resize; touch-action: none; z-index: 2; }
.st-handle::before { content: ""; position: absolute; top: -2px; bottom: -2px; left: 4px; width: 6px; border-radius: 3px; background: var(--brand); box-shadow: 0 0 0 2px var(--paper); }
.st-slane { height: 34px; cursor: pointer; background: color-mix(in srgb, var(--paper) 45%, transparent); border-radius: 6px; }
.st-lanehint { position: absolute; left: 10px; top: 0; bottom: 0; display: flex; align-items: center; font-size: 12px; color: var(--muted); pointer-events: none; white-space: nowrap; }
.st-slideblk { position: absolute; top: 2px; bottom: 2px; min-width: 14px; border-radius: 6px; background: var(--ok-wash); border: 1.5px solid var(--ok); color: var(--ok); cursor: grab; touch-action: none; display: flex; align-items: center; overflow: hidden; box-sizing: border-box; }
.st-slideblk.is-cover { border-style: dashed; }
.st-slideblk.is-sel { background: var(--ok); color: var(--paper); box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--ok); z-index: 1; }
.st-slideblk.is-drop { background: color-mix(in srgb, var(--rm-mint) 35%, transparent); border-style: dashed; pointer-events: none; }
.st-slidelabel { flex: 1 1 auto; min-width: 0; padding: 0 4px; font: 600 12px/1 var(--font-body); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.st-grip { flex: 0 0 10px; align-self: stretch; cursor: ew-resize; background: color-mix(in srgb, var(--ok) 22%, transparent); }
.st-slideblk.is-sel .st-grip { background: rgba(255, 255, 255, .3); }
.st-head { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--ink); pointer-events: none; z-index: 3; }
.st-head::before { content: ""; position: absolute; top: 0; left: -5px; border: 6px solid transparent; border-top-color: var(--ink); }
.st-err:empty { display: none; }
@media (hover: none) { .st-keys { display: none; } }
.st-panels { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 0 18px; align-items: start; }
.st-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.st-row > input[type=text] { flex: 1 1 160px; min-width: 0; }
.st-btn { display: inline-flex; align-items: center; gap: 6px; }
.st-small { min-height: 30px; padding: 0 10px; font-size: 13px; }
.st-small-text { font-size: 13px; margin: 0; }
.st-num { width: 4.5em; }
.st-select { max-width: 100%; }
.st-slides { grid-template-columns: minmax(0, 1fr); }
.st-slideform select { width: 100%; }
.st-slideform { min-width: 0; display: grid; gap: 8px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--ok-wash); border: 1px solid color-mix(in srgb, var(--ok) 30%, transparent); }
.st-slidehead { margin: 0; font-weight: 600; color: var(--ok); }
.st-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.st-list li { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 14px; }
.st-list li > button.link { background: none; border: 0; padding: 4px 0; min-height: 0; color: var(--ink); text-align: left; font: inherit; cursor: pointer; text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; overflow-wrap: anywhere; }
.st-check { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; cursor: pointer; }
.st-check input { margin-top: 3px; }
.st-sum { font-weight: 600; }
.st-msg { margin: 0; font-size: 14px; }
.st-result:empty { display: none; }
.lbi-editrow { margin: 10px 0 18px; }
.ed-editor { white-space: nowrap; }
@media (max-width: 900px) {
  .st-top { grid-template-columns: minmax(0, 1fr); }
  .st-script { min-height: 0; }
  .st-script-in { position: static; max-height: 46vh; }
  .st-preview-toggle { margin-left: 0; }
  .st-zoom-label { min-width: 0; }
}
