/* Demotape in the Second Eight brand (DT-1). The tokens are secondeight.net's own (v28-site src/styles/tokens.css):
   paper and ink, hairlines, one orange signal for small accents; Aspekta for text, Geist Mono only for small
   uppercase labels, timestamps, counters and clocks; radii 6 (controls), 10 (cards, media), 14 (panels).
   Light and dark follow the system until the theme pill picks one (assets/theme.js). Untitled UI icons. */

@font-face {
  font-family: "Aspekta";
  src: url("/assets/fonts/AspektaVF.woff2") format("woff2");
  font-weight: 50 1000;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("/assets/fonts/GeistMono-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  /* secondeight.net */
  --paper: #F3F3EF; --paper-2: #E9E9E4; --ink: #0D0D0D; --ink-2: #1B1B1B; --signal: #FF4C00;
  --bg: var(--paper); --bg-2: var(--paper-2); --fg: var(--ink);
  --mute: #64645E;
  --line-c: rgba(13, 13, 13, 0.08);
  /* the booking card's surface on the site: a panel a touch lighter than the paper */
  --panel: color-mix(in srgb, #fff 55%, var(--paper));
  --panel-2: color-mix(in srgb, var(--ink) 3%, var(--paper));
  --r-ctl: 6px; --r-card: 10px; --r-panel: 14px; --pill-h: 26px;
  --m: clamp(16px, 2.5vw, 44px);
  --f-sans: "Aspekta", system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --f-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* the app's own names, on the brand values */
  --fill: color-mix(in srgb, var(--fg) 4%, transparent);
  --fill-2: color-mix(in srgb, var(--fg) 7%, transparent);
  --fill-3: color-mix(in srgb, var(--fg) 11%, transparent);
  --line: var(--line-c);
  --line-2: color-mix(in srgb, var(--fg) 14%, transparent);
  --hair: inset 0 0 0 1px var(--line-c);
  --text: var(--fg);
  --text-2: color-mix(in srgb, var(--fg) 78%, var(--bg));
  --text-3: var(--mute);
  --text-4: color-mix(in srgb, var(--mute) 80%, var(--bg));
  --rec: var(--signal);
  --ok: var(--fg);
  --warn: #B23A00;   /* the signal, darkened for AA text on paper */
  --err: #B42318;
  --shadow: 0 1px 2px rgba(13, 13, 13, 0.05);

  --r-sm: var(--r-ctl);
  --r-md: var(--r-ctl);
  --r-lg: var(--r-card);
  --r-xl: var(--r-panel);
  --font: var(--f-sans);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --gap: 20px;
  --vh: 100vh;
}
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: var(--ink); --bg-2: var(--ink-2); --fg: var(--paper);
  --mute: #96968F;
  --line-c: rgba(243, 243, 239, 0.1);
  --panel: color-mix(in srgb, #fff 4%, var(--ink));
  --panel-2: color-mix(in srgb, #fff 2%, var(--ink));
  --warn: #FF7A3D;
  --err: #FF8A80;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}
/* before the script has run: the system's choice */
@media (prefers-color-scheme: dark) {
  html:not([data-theme]) {
    color-scheme: dark;
    --bg: var(--ink); --bg-2: var(--ink-2); --fg: var(--paper);
    --mute: #96968F;
    --line-c: rgba(243, 243, 239, 0.1);
    --panel: color-mix(in srgb, #fff 4%, var(--ink));
    --panel-2: color-mix(in srgb, #fff 2%, var(--ink));
    --warn: #FF7A3D;
    --err: #FF8A80;
  }
}
@supports (height: 100dvh) {
  :root { --vh: 100dvh; }
}

*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg);
  color: var(--fg);
  font: 450 14px/1.55 var(--f-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  transition: background-color 0.3s var(--ease), color 0.3s var(--ease);
}
h1, h2, h3 { font-weight: 500; }
b, strong, th { font-weight: 500; }
h4, h5, h6, button, input, select, textarea, label { font-weight: inherit; }
img, video { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
::selection { background: var(--signal); color: var(--ink); }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; }
.muted { color: var(--text-3); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.i { flex: none; display: block; }
/* Digits of live numbers (timers): Geist Mono has equal figures; the boxes keep older markup steady. */
.dg { display: inline-block; width: 0.62em; text-align: center; }
/* Small uppercase labels, timestamps, counters and clocks, as on secondeight.net. */
.mono { font-family: var(--f-mono); font-size: 11.5px; font-weight: 400; text-transform: uppercase; letter-spacing: 0.04em; line-height: 1.2; }

/* ---------- The Second Eight mark (as in the site nav) and the theme pill ---------- */
.logo-mark { width: 14.06px; height: 20.57px; overflow: visible; color: var(--fg); }
.mark { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: var(--r-ctl); color: var(--fg); flex: none; transition: background 0.2s var(--ease); }
@media (hover: hover) { a.mark:hover { background: var(--fill-2); } }
.theme-toggle {
  display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border: 0; border-radius: var(--r-ctl);
  background: var(--panel); color: var(--fg); box-shadow: var(--hair); font-size: 13px; font-weight: 500; line-height: 1; white-space: nowrap;
  transition: background 0.2s var(--ease);
}
@media (hover: hover) { .theme-toggle:hover { background: color-mix(in srgb, var(--panel), var(--fg) 6%); } }
.theme-dot { width: 7px; height: 7px; border-radius: 50%; border: 1px solid currentColor; flex: none; }
html[data-theme="dark"] .theme-dot { background: currentColor; }
.app-bar { position: relative; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: var(--m) var(--m) 0; }

/* ---------- No ambient glow and no glass: flat paper, hairlines ---------- */
.ambient { display: none; }
.glass { position: relative; background: var(--panel); border-radius: var(--r-panel); box-shadow: var(--hair), var(--shadow); }
.divider { height: 1px; background: var(--line); flex: none; }

/* ---------- Controls ---------- */
/* Buttons as on secondeight.net: slightly rounded (6 px), primary is ink on paper (paper on ink in dark). */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 36px; padding: 0 15px; border: 0; border-radius: var(--r-ctl);
  background: var(--panel); color: var(--text); box-shadow: var(--hair);
  font-size: 14px; font-weight: 500; line-height: 1; white-space: nowrap;
  transition: background 0.18s var(--ease), color 0.18s var(--ease), transform 0.18s var(--ease), opacity 0.18s, box-shadow 0.18s;
}
@media (hover: hover) { .btn:hover { background: color-mix(in srgb, var(--panel), var(--fg) 7%); } }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.4; pointer-events: none; }
.btn .i { width: 18px; height: 18px; }
.btn.primary { background: var(--fg); color: var(--bg); box-shadow: none; }
@media (hover: hover) { .btn.primary:hover { background: color-mix(in srgb, var(--fg) 86%, var(--bg)); } }
.btn.ghost { background: transparent; color: var(--text-2); box-shadow: none; }
@media (hover: hover) { .btn.ghost:hover { background: var(--fill-2); color: var(--text); } }
@media (hover: hover) { .btn.danger:hover { color: var(--err); } }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn.lg { height: 48px; padding: 0 20px; font-size: 15px; }
.btn.block { width: 100%; }
.btn.icon { width: 36px; padding: 0; background: transparent; color: var(--text-2); box-shadow: none; }
@media (hover: hover) { .btn.icon:hover { background: var(--fill-2); color: var(--text); } }
.btn.icon.sm { width: 32px; height: 32px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--signal); flex: none; }
.dot.live { animation: pulse 1.4s ease-in-out infinite; }
.dot.held { background: var(--mute); animation: none; }
@keyframes pulse { 50% { opacity: 0.35; } }

.pill {
  display: inline-flex; align-items: center; gap: 6px; height: var(--pill-h); padding: 0 10px;
  border-radius: var(--r-ctl); background: transparent; color: var(--text-2); box-shadow: var(--hair);
  font-size: 12.5px; white-space: nowrap;
}
.pill .i { width: 14px; height: 14px; }
.pill.ok { color: var(--text); }
.pill.warn { color: var(--warn); }
.pill.rec { color: var(--fg); box-shadow: inset 0 0 0 1px var(--signal); }

/* Fields as in the site's booking form: flat, a hairline, the ink line on focus. */
.input, .select, .textarea {
  width: 100%; height: 42px; padding: 0 14px; border: 0; border-radius: var(--r-ctl);
  background: var(--bg); color: var(--text); font-size: 14px; box-shadow: inset 0 0 0 1px var(--line-2);
  transition: box-shadow 0.15s, background 0.15s;
}
.textarea { height: auto; padding: 11px 14px; resize: none; line-height: 1.5; }
.input::placeholder, .textarea::placeholder { color: var(--text-4); }
@media (hover: hover) { .input:hover, .select:hover, .textarea:hover { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--fg) 26%, transparent); } }
.input:focus, .select:focus, .textarea:focus { outline: none; box-shadow: inset 0 0 0 1px var(--fg); }
.input:focus-visible, .select:focus-visible, .textarea:focus-visible { outline: none; box-shadow: inset 0 0 0 1px var(--fg), 0 0 0 3px color-mix(in srgb, var(--signal) 28%, transparent); }
.select {
  appearance: none; -webkit-appearance: none; padding-right: 38px; cursor: pointer;
  background-repeat: no-repeat; background-position: right 13px center; background-size: 16px;
  /* Untitled UI chevron-down */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364645E' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}
.select option { background: var(--bg); color: var(--fg); }
.label { font-family: var(--f-mono); font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.04em; line-height: 1.3; color: var(--text-3); }
.field { display: grid; gap: 8px; }

/* Segmented control: the site's pill group, a filled ink thumb for the current one. */
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: var(--r-ctl); background: var(--panel); box-shadow: var(--hair); }
.seg button { height: 30px; padding: 0 12px; border: 0; border-radius: 4px; background: transparent; color: var(--text-3); font-size: 13px; font-weight: 500; transition: background 0.2s var(--ease), color 0.2s var(--ease); }
@media (hover: hover) { .seg button:hover { color: var(--text); } }
.seg button.on { background: var(--fg); color: var(--bg); }

.progress { height: 3px; border-radius: 3px; background: var(--fill-2); overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: var(--fg); border-radius: inherit; transition: width 0.3s var(--ease); }

.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); z-index: 100;
  --tx: -50%; transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 10px; padding: 11px 16px; border-radius: var(--r-ctl);
  background: var(--fg); color: var(--bg); box-shadow: 0 6px 20px rgba(13, 13, 13, 0.18);
  font-size: 13.5px; font-weight: 500; max-width: calc(100vw - 32px);
  animation: rise 0.25s var(--ease);
}
.toast .i { width: 16px; height: 16px; color: var(--signal); }
.toast { pointer-events: none; } /* never in the way of a click */
body.rec .toast { bottom: calc(100px + env(safe-area-inset-bottom, 0px)); } /* above the recording dock */

.modal {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px;
  background: color-mix(in srgb, var(--ink) 40%, transparent);
  animation: fade 0.2s var(--ease);
}
.modal .sheet { width: min(640px, 100%); max-height: calc(var(--vh) - 32px); overflow: auto; padding: 24px; display: grid; gap: 16px; border-radius: var(--r-panel); background: var(--panel); animation: rise 0.25s var(--ease); }
.modal .sheet.glass { box-shadow: var(--hair), 0 24px 60px -30px rgba(13, 13, 13, 0.35); }
.sheet:focus { outline: none; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sheet-head h2 { margin: 0; font-size: 22px; letter-spacing: -0.02em; }
.sheet .row-end { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; align-items: center; }
.sheet .row-end .grow { flex: 1; }
.sheet-form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }

@keyframes rise { from { opacity: 0; transform: translate(var(--tx, 0), 8px); } to { opacity: 1; transform: translate(var(--tx, 0), 0); } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.brand { display: inline-flex; align-items: center; gap: 12px; font-size: 15px; font-weight: 500; letter-spacing: -0.01em; line-height: 1; color: var(--text); }
.brand .mark { width: 32px; height: 32px; margin-left: -9px; }

.note { font-size: 13px; line-height: 1.5; color: var(--text-2); display: flex; gap: 10px; align-items: flex-start; margin: 0; }
.note .i { width: 16px; height: 16px; margin-top: 1px; color: var(--text-3); }
.err { color: var(--err); font-size: 13px; line-height: 1.5; margin: 0; display: flex; gap: 10px; align-items: flex-start; }
.err:empty { display: none; }
.err .i { width: 16px; height: 16px; margin-top: 1px; }

/* Meta lines (length, date, size): separated by a thin middle dot. */
.meta { font-size: 13px; color: var(--text-3); display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.meta > span + span::before { content: "·"; margin-right: 8px; color: var(--text-4); }
/* Meta rows as in the site's project sidebar: a mono label, a sans value. */
.meta-rows { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 0; margin: 0; }
.meta-rows dt, .meta-rows dd { margin: 0; padding: 9px 0; border-top: 1px solid var(--line); }
.meta-rows dt { padding-right: 28px; font-family: var(--f-mono); font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.04em; line-height: 20px; color: var(--text-3); }
.meta-rows dd { font-size: 14px; line-height: 20px; color: var(--text); min-width: 0; overflow-wrap: anywhere; }

.av { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 11.5px; font-weight: 500; color: #fff; flex: none; }
.ts {
  display: inline-flex; align-items: center; height: 22px; padding: 0 7px; border: 0; border-radius: 4px;
  background: var(--fill-2); color: var(--text); font-family: var(--f-mono); font-size: 11.5px; letter-spacing: 0.02em;
}
@media (hover: hover) { button.ts:hover { background: var(--fill-3); } }
.ts.cut { color: var(--text-3); background: transparent; }

/* ---------- Library ---------- */
body.lib { height: var(--vh); overflow: hidden; }
.lib-shell {
  position: relative; z-index: 1; height: var(--vh);
  display: grid; grid-template-columns: 300px minmax(0, 1fr) 360px; gap: var(--gap);
  padding: var(--gap) max(var(--gap), env(safe-area-inset-right)) var(--gap) max(var(--gap), env(safe-area-inset-left));
}
.lib-shell.nopanel { grid-template-columns: 300px minmax(0, 1fr); }
.side { display: flex; flex-direction: column; min-height: 0; overflow: hidden; animation: rise 0.35s var(--ease); }
.side-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 70px; padding: 0 16px 0 24px; flex: none; }
.side-nav { padding: 12px 14px; display: grid; gap: 2px; flex: none; }
.nav-row {
  display: flex; align-items: center; gap: 12px; height: 40px; padding: 0 10px; border: 0; border-radius: var(--r-ctl);
  background: transparent; color: var(--text); font-size: 14px; text-align: left; width: 100%;
  transition: background 0.15s var(--ease);
}
.nav-row .i { width: 20px; height: 20px; color: var(--text-3); }
.nav-row .count { margin-left: auto; font-family: var(--f-mono); font-size: 11.5px; color: var(--text-3); }
@media (hover: hover) { .nav-row:hover { background: var(--fill); } }
.nav-row.on { background: var(--fill-2); font-weight: 500; }
.nav-row.on .i { color: var(--text); }
.side-list { flex: 1; min-height: 0; overflow: auto; padding: 8px 14px 12px; display: grid; align-content: start; grid-auto-rows: max-content; gap: 2px; }
.side-list .section { padding: 10px 10px 6px; font-family: var(--f-mono); font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-3); display: flex; justify-content: space-between; align-items: center; gap: 4px; min-height: 40px; }
.side-list .section .grow { flex: 1; }
.side-list .section .btn.sm { height: 30px; padding: 0 10px; }
.side-list .section.picking { position: sticky; top: -8px; z-index: 2; display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 2px; background: var(--panel); box-shadow: var(--hair); border-radius: var(--r-ctl); padding: 4px 4px 4px 10px; font-family: var(--f-sans); text-transform: none; letter-spacing: 0; font-size: 13px; }
.side-list.picking { scroll-padding-top: 96px; }
.side-list .pick-row { display: flex; align-items: center; gap: 4px; min-height: 34px; }
.side-list .pick-row .grow { flex: 1; }
.side-list .pick-row .btn.sm:first-child { margin-left: -10px; }
.side-list .section.picking .count { color: var(--text); }
.vrow.picking { grid-template-columns: 18px 66px minmax(0, 1fr) auto; min-height: 44px; }
.vrow.picked { background: var(--fill-2); box-shadow: inset 0 0 0 1px var(--fg); }
.pickbox { width: 18px; height: 18px; margin: 0; accent-color: var(--fg); pointer-events: none; }
.btn.danger-fill { background: var(--signal); color: var(--ink); box-shadow: none; }
@media (hover: hover) { .btn.danger-fill:hover { background: color-mix(in srgb, var(--signal) 86%, var(--ink)); } }
.side-list > .note { padding: 8px 10px; }
.vrow {
  display: grid; grid-template-columns: 66px minmax(0, 1fr) auto; align-items: center; gap: 12px;
  padding: 8px; border-radius: var(--r-md); border: 0; background: transparent; text-align: left; width: 100%;
  transition: background 0.15s var(--ease);
}
@media (hover: hover) { .vrow:hover { background: var(--fill); } }
.vrow.on { background: var(--fill-2); }
.vrow .thumb { width: 66px; aspect-ratio: 16 / 10; border-radius: 4px; overflow: hidden; background: var(--fill-2); position: relative; }
.vrow .thumb img { width: 100%; height: 100%; object-fit: cover; }
.vrow .thumb .i { position: absolute; inset: 0; margin: auto; width: 16px; height: 16px; color: var(--text-3); }
.vrow .t { min-width: 0; display: grid; gap: 2px; }
.vrow .t b { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vrow .t .m { display: flex; align-items: center; gap: 10px; min-width: 0; font-size: 12.5px; color: var(--text-3); white-space: nowrap; }
.vrow .t .m > span:first-child { overflow: hidden; text-overflow: ellipsis; }
.vrow .t .cc { display: inline-flex; align-items: center; gap: 4px; flex: none; color: var(--text-2); }
.vrow .t .cc .i { width: 12px; height: 12px; }
.vrow .flag { width: 7px; height: 7px; border-radius: 50%; background: var(--signal); }
.vrow .flag.rec { background: var(--signal); }
.side-foot { flex: none; padding: 14px 14px 16px; display: grid; gap: 12px; }
.storage { display: grid; gap: 8px; padding: 0 10px; }
.storage .top { margin: 0; font-size: 12.5px; color: var(--text-3); }
.storage .full { margin: 0; font-size: 12.5px; color: var(--warn); }
.storage.warn .top { color: var(--warn); }
.storage.warn .progress i { background: var(--warn); }
.side-foot .acct { display: flex; gap: 4px; align-items: center; }
.side-foot .acct .grow { flex: 1; }
.back { display: none; align-self: flex-start; margin: 0 0 -8px -6px; }

/* Stage: the recording, its link and settings. Comments live in the panel on the right. */
.stage {
  position: relative; min-width: 0; min-height: 0; overflow: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column; gap: 22px; animation: fade 0.5s var(--ease);
  scrollbar-width: none;
}
.stage::-webkit-scrollbar { display: none; }
.stage > * { flex: none; }
.stage-center { flex: 1 0 auto; display: grid; place-items: center; padding: 24px 0; }
.frame { position: relative; width: 100%; border-radius: var(--r-card); overflow: hidden; background: #000; }
.empty-stage { text-align: center; display: grid; justify-items: center; gap: 16px; max-width: 440px; }
.empty-stage h1 { margin: 0; font-size: 40px; letter-spacing: -0.04em; line-height: 1.02; }
.empty-stage p { margin: 0; color: var(--text-2); font-size: 15px; }
.empty-stage > .i { width: 28px; height: 28px; color: var(--text-3); }

.v-info { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; min-width: 0; } /* above the player's shadow */
.v-head { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 0 2px; min-width: 0; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.title-input {
  display: block; width: calc(100% + 16px); min-width: 0; border: 0; background: transparent; padding: 4px 8px; margin: -4px -8px; border-radius: var(--r-ctl);
  font-size: clamp(26px, 2.4vw, 36px); font-weight: 500; letter-spacing: -0.035em; line-height: 1.15; color: var(--text);
  text-overflow: ellipsis; transition: background 0.15s var(--ease);
}
@media (hover: hover) { .title-input:hover { background: var(--fill); } }
.title-input:focus { outline: none; background: var(--bg); box-shadow: inset 0 0 0 1px var(--fg); }
.sharebar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.linkcard { flex: 1 1 340px; min-width: 0; display: flex; align-items: center; gap: 6px; padding: 5px 5px 5px 16px; border-radius: var(--r-ctl); background: var(--bg); box-shadow: inset 0 0 0 1px var(--line-2); }
.linkcard .u { flex: 1; min-width: 0; font-size: 13.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 14px; }
.card { padding: 20px 22px 22px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; align-content: start; min-width: 0; }
.card h3 { margin: 0; display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 22px; font-family: var(--f-mono); font-size: 11.5px; font-weight: 400; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-3); }
.card .seg { display: flex; width: 100%; }
.card .seg button { flex: 1; padding: 0 6px; }
.capline { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; min-height: 36px; padding: 0 4px; font-size: 13.5px; color: var(--text-2); }
.capline > .i { width: 16px; height: 16px; color: var(--text-3); flex: none; }
.capline .ct { min-width: 0; }
.capline .grow { flex: 1; }
.pwrow { display: flex; gap: 8px; }
.pwrow .input { flex: 1; min-width: 0; height: 36px; }
.pwacts { display: flex; flex-wrap: wrap; gap: 6px; }
.pwacts .grow { flex: 1; }
/* Summary card (library) */
.sumcard .sumtext { margin: 0; font-size: 14px; line-height: 1.55; color: var(--text-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.sumcard .sumbusy { align-items: center; }
.sumcard .note > .i { width: 16px; height: 16px; flex: none; margin-top: 2px; }
.sumcard .stale { color: var(--warn); }
.sumcard .linkbtn { border: 0; padding: 0; background: none; color: inherit; font-size: inherit; text-decoration: underline; text-underline-offset: 3px; }
.sumlist { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 2px; margin: 0 -10px; }
.sumchaps { display: grid; gap: 6px; }
.sumchap { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 8px; }
.sumchap .input { height: 36px; }

.pwshow { margin: 0; font-size: 14px; color: var(--text-2); overflow-wrap: anywhere; }
.pwshow .pw { color: var(--text); }
.viewers { display: grid; gap: 14px; }
.viewer { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 11px; align-items: start; }
.viewer .vt { display: grid; gap: 7px; min-width: 0; }
.viewer .vt .top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; min-width: 0; }
.viewer .vt b { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.viewer .vt span { font-size: 12.5px; color: var(--text-3); white-space: nowrap; }
.viewer .progress { height: 2px; }
.solo { width: min(520px, 100%); padding: 28px; display: grid; gap: 16px; border-radius: var(--r-xl); animation: rise 0.35s var(--ease); }
.solo h1 { margin: 0; font-size: 30px; letter-spacing: -0.035em; line-height: 1.2; overflow-wrap: anywhere; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Gate (login / setup) ---------- */
.gate-wrap { position: relative; z-index: 1; min-height: var(--vh); display: grid; place-items: center; padding: 20px; }
.gate { width: min(440px, 100%); padding: 32px; display: grid; gap: 20px; border-radius: var(--r-xl); animation: rise 0.35s var(--ease); }
.gate h1 { margin: 0 0 10px; font-size: clamp(34px, 3.4vw, 44px); letter-spacing: -0.045em; line-height: 0.98; }
.gate p { margin: 0; color: var(--text-2); }
.gate .badge { display: none; } /* the site's forms have no icon badges */
.gate .badge .i { width: 22px; height: 22px; }

/* ---------- Player (share page and library) ---------- */
.player { position: relative; background: #000; user-select: none; -webkit-user-select: none; }
.player video { width: 100%; max-height: 72vh; margin: 0 auto; background: #000; }
.stage .player video { max-height: 64vh; }
/* A dark glass lens: the white glyph stays readable over white pages as well as dark ones. */
.player .big {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 72px; height: 72px; border: 0; border-radius: var(--r-card); display: grid; place-items: center; color: var(--ink);
  background: var(--paper); box-shadow: 0 6px 24px rgba(13, 13, 13, 0.22);
  transition: transform 0.2s var(--ease), background 0.2s;
}
@media (hover: hover) { .player .big:hover { transform: translate(-50%, -50%) scale(1.05); } }
.player .big .i { width: 26px; height: 26px; margin-left: 3px; fill: currentColor; }
.player .bar {
  position: absolute; left: 12px; right: 12px; bottom: 12px; padding: 6px 10px 6px 6px;
  display: grid; gap: 2px; border-radius: var(--r-card); color: var(--paper);
  background: rgba(13, 13, 13, 0.8);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
}
.player.idle.playing .bar { opacity: 0; transform: translateY(6px); pointer-events: none; }
.player.idle.playing { cursor: none; }
/* Captions: above the control bar while it shows, lower when it hides. At most two lines. */
.player .caption {
  position: absolute; left: 50%; bottom: 104px; transform: translateX(-50%); z-index: 1; max-width: 84%; width: max-content;
  padding: 4px 10px; border-radius: var(--r-ctl); background: rgba(13, 13, 13, 0.72); color: var(--paper); text-align: center;
  font-size: clamp(13px, 2.4cqw, 22px); line-height: 1.35; pointer-events: none;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden;
  transition: bottom 0.25s var(--ease);
}
.player.idle.playing .caption { bottom: 20px; }
.player .speed.cc[aria-pressed="false"] { color: rgba(255, 255, 255, 0.45); background: rgba(255, 255, 255, 0.05); }
.player .row { display: flex; align-items: center; gap: 4px; }
.player .row .grow { flex: 1; }
.player .pbtn { width: 36px; height: 36px; border: 0; border-radius: var(--r-ctl); background: transparent; color: var(--paper); display: grid; place-items: center; padding: 0; }
@media (hover: hover) { .player .pbtn:hover { background: rgba(255, 255, 255, 0.14); } }
.player .pbtn .i { width: 20px; height: 20px; }
.player .time { font-family: var(--f-mono); font-size: 12px; letter-spacing: 0.02em; color: rgba(243, 243, 239, 0.92); padding: 0 6px; white-space: nowrap; }
.player .chap { min-width: 0; font-size: 12.5px; color: rgba(243, 243, 239, 0.7); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player .chap::before { content: "·"; margin: 0 8px 0 0; }
.player .speed { height: 28px; min-width: 44px; padding: 0 10px; border: 0; border-radius: var(--r-ctl); background: rgba(243, 243, 239, 0.12); color: var(--paper); font-family: var(--f-mono); font-size: 11.5px; letter-spacing: 0.02em; }
@media (hover: hover) { .player .speed:hover { background: rgba(255, 255, 255, 0.22); } }
.scrub { position: relative; height: 20px; margin: 0 6px; cursor: pointer; touch-action: none; }
.scrub .track { position: absolute; inset: 0; pointer-events: none; }
.scrub .rail, .scrub .buf, .scrub .fill { position: absolute; left: 0; top: 8px; height: 4px; border-radius: 4px; }
.scrub .rail { right: 0; background: rgba(255, 255, 255, 0.2); }
.scrub .buf { background: rgba(255, 255, 255, 0.3); width: 0; }
.scrub .fill { background: var(--paper); width: 0; }
.scrub .knob { position: absolute; top: 4px; left: 0; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; background: var(--paper); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4); transform: scale(0); transition: transform 0.15s var(--ease); }
.scrub.drag .knob, .scrub:focus-visible .knob { transform: scale(1); }
@media (hover: hover) { .scrub:hover .knob { transform: scale(1); } }
.scrub .mk { position: absolute; top: 5px; width: 10px; height: 10px; margin-left: -5px; padding: 0; border: 2px solid var(--ink); border-radius: 50%; background: var(--signal); z-index: 2; }
.scrub .mk::after { content: ""; position: absolute; inset: -8px; } /* easier to hit */
@media (hover: hover) { .scrub .mk:hover { transform: scale(1.3); } }
.scrub .mk.resolved { background: #96968F; }
.scrub .tip { position: absolute; bottom: 26px; transform: translateX(-50%); max-width: 260px; padding: 6px 10px; border-radius: var(--r-ctl); background: var(--ink); color: var(--paper); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.player .processing { aspect-ratio: 16 / 9; display: grid; place-items: center; text-align: center; padding: 24px; color: var(--text-2); }
.player .processing .i { width: 26px; height: 26px; margin: 0 auto 12px; color: var(--paper); }
.player .processing { color: rgba(243, 243, 239, 0.8); }
/* Full screen: the video fills the screen, controls float over it. */
.player:fullscreen { display: grid; place-items: center; width: 100%; height: 100%; }
.player:fullscreen video { width: 100%; height: 100%; max-height: none; object-fit: contain; aspect-ratio: auto !important; }
.player:fullscreen .bar { left: 50%; right: auto; width: min(900px, calc(100% - 48px)); transform: translateX(-50%); bottom: 24px; }
.player:fullscreen.idle.playing .bar { transform: translate(-50%, 6px); }

/* ---------- Share page ---------- */
body.share { min-height: var(--vh); }
.s-main {
  position: relative; z-index: 1; max-width: 1600px; margin: 0 auto;
  padding: max(var(--gap), env(safe-area-inset-top)) max(var(--gap), env(safe-area-inset-right)) max(var(--gap), env(safe-area-inset-bottom)) max(var(--gap), env(safe-area-inset-left));
  display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: var(--gap); align-items: start;
}
.s-main.single { grid-template-columns: minmax(0, 1fr); max-width: 1100px; }
.s-stage { display: grid; gap: 18px; min-width: 0; animation: fade 0.5s var(--ease); }
.s-stage .frame { border-radius: var(--r-card); }
.s-head { position: relative; display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; padding: 0 4px; }
.s-title { margin: 0; font-size: clamp(30px, 3.2vw, 52px); letter-spacing: -0.045em; line-height: 1; text-wrap: balance; overflow-wrap: anywhere; }
.s-sub { margin-top: 10px; }
.s-summary { margin: 14px 0 0; max-width: 72ch; color: var(--text-2); font-size: 15px; line-height: 1.55; overflow-wrap: anywhere; }
/* Chapters (share page) */
.s-chapters { position: relative; display: grid; gap: 6px; padding: 0 4px; }
.s-chapters .chd { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 32px; }
.s-chapters h2 { margin: 0; font-family: var(--f-mono); font-size: 11.5px; font-weight: 400; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-3); }
.s-chapters .chall { display: none; }
.chlist { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 4px; }
.chrow { display: flex; align-items: center; gap: 10px; min-width: 0; min-height: 40px; padding: 6px 10px; border: 0; border-radius: var(--r-md); background: transparent; color: var(--text-2); text-align: left; font-size: 14px; }
.chrow .ts { flex: none; pointer-events: none; }
.chrow .tt { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (hover: hover) { .chrow:hover { background: var(--fill); color: var(--text); } }
.chrow.on { background: var(--fill-2); color: var(--text); }
.chrow.on .ts { background: var(--fg); color: var(--bg); }
.thead { margin: 14px 10px 4px; font-family: var(--f-mono); font-size: 11.5px; font-weight: 400; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-3); }
.thead:first-child { margin-top: 4px; }
.s-message { position: relative; z-index: 1; max-width: 560px; margin: 16vh auto 0; padding: 0 var(--gap); display: grid; gap: 14px; }
.s-message h1 { margin: 0; font-size: clamp(40px, 5vw, 64px); letter-spacing: -0.045em; line-height: 0.98; }
.s-message p { margin: 0; color: var(--text-2); font-size: 16px; }
.s-foot { position: relative; color: var(--text-3); font-size: 12.5px; padding: 0 4px; margin: 0; }
.msg-icon { display: none; }

/* Comments panel (share page and library). */
.cpanel { position: sticky; top: var(--gap); display: flex; flex-direction: column; height: calc(var(--vh) - 2 * var(--gap) - 56px); min-height: 440px; border-radius: var(--r-xl); animation: rise 0.35s 0.05s var(--ease) both; }
.chead { display: flex; align-items: center; justify-content: space-between; gap: 10px; height: 62px; padding: 0 14px 0 22px; flex: none; }
.chead h2 { margin: 0; font-size: 18px; letter-spacing: -0.02em; display: flex; align-items: baseline; gap: 10px; }
.chead h2 .count { font-family: var(--f-mono); font-size: 11.5px; font-weight: 400; color: var(--text-3); }
.clist { flex: 1; overflow: auto; padding: 8px; display: grid; align-content: start; gap: 2px; }
/* Comments and Transcript tabs (only when a video has captions). */
.ptabs { flex: none; padding: 12px 12px 0; }
.ptabs .seg { display: flex; width: 100%; }
.ptabs .seg button { flex: 1; }
.cpanel[data-tab="transcript"] > :not(.ptabs):not(.tpane) { display: none; }
.cpanel:not([data-tab="transcript"]) > .tpane { display: none; }
.tpane { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.tsearch { flex: none; padding: 12px 12px 4px; }
.tsearch .input { height: 38px; }
.tlist { position: relative; flex: 1; overflow: auto; padding: 6px 8px 10px; display: grid; align-content: start; gap: 2px; grid-template-columns: minmax(0, 1fr); }
.tline { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: baseline; padding: 8px 10px; border: 0; border-radius: var(--r-md); background: transparent; color: var(--text-2); text-align: left; font-size: 14px; line-height: 1.5; }
.tline .ts { pointer-events: none; }
@media (hover: hover) { .tline:hover { background: var(--fill); color: var(--text); } }
.tline.on { background: var(--fill-2); color: var(--text); }
.tline.on .ts { background: var(--fg); color: var(--bg); }
.cempty { padding: 44px 24px; text-align: center; color: var(--text-3); display: grid; justify-items: center; gap: 10px; font-size: 13.5px; }
.cempty .i { width: 22px; height: 22px; color: var(--text-4); }
.c { padding: 12px 14px; border-radius: var(--r-md); display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 5px 12px; transition: background 0.2s var(--ease); }
@media (hover: hover) { .c:hover { background: var(--fill); } }
.c.flash { background: var(--fill-3); box-shadow: inset 2px 0 0 var(--signal); }
.c.resolved { opacity: 0.7; }
.c.resolved .text { color: var(--text-3); }
.c .top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; min-height: 26px; }
.c .name { font-size: 14px; font-weight: 500; min-width: 0; overflow-wrap: anywhere; } /* a long name or an email typed as a name wraps */
.c .owner { font-size: 12.5px; color: var(--text-3); }
.c .when { font-family: var(--f-mono); font-size: 11.5px; color: var(--text-3); margin-left: auto; }
.c .text { grid-column: 2; white-space: pre-wrap; word-break: break-word; font-size: 14px; color: var(--text); line-height: 1.55; }
.c .acts { grid-column: 2; display: flex; gap: 2px; margin: 2px 0 0 -8px; opacity: 0; transition: opacity 0.15s; }
.c:focus-within .acts, .c.replying > .acts { opacity: 1; }
@media (hover: hover) { .c:hover .acts { opacity: 1; } }
@media (hover: none) { .c .acts { opacity: 1; } }
.c .acts button { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 9px; border: 0; border-radius: var(--r-ctl); background: transparent; color: var(--text-3); font-size: 13px; }
@media (hover: hover) { .c .acts button:hover { background: var(--fill-2); color: var(--text); } }
.c .acts .i { width: 15px; height: 15px; }
.c .replies { grid-column: 2; display: grid; gap: 2px; margin-top: 6px; }
.c .replies .c { padding: 8px 0 4px; }
@media (hover: hover) { .c .replies .c:hover { background: none; } }
.replyform { grid-column: 2; display: grid; gap: 8px; margin-top: 6px; }
.replyform .foot { display: flex; gap: 6px; justify-content: flex-end; }
.composer { flex: none; padding: 12px; display: grid; gap: 8px; }
.composer .box { border-radius: var(--r-card); background: var(--bg); box-shadow: inset 0 0 0 1px var(--line-2); transition: box-shadow 0.15s, background 0.15s; }
.composer .box:focus-within { box-shadow: inset 0 0 0 1px var(--fg); }
.composer .box textarea { width: 100%; min-height: 66px; max-height: 200px; border: 0; background: transparent; padding: 13px 16px 4px; resize: none; font-size: 14px; line-height: 1.5; color: var(--text); }
.composer .box textarea:focus { outline: none; }
.composer .box ::placeholder { color: var(--text-4); }
/* The viewer's name: a field of its own with a live avatar preview, so first-time viewers see it. */
.namefield { display: grid; grid-template-columns: 26px minmax(0, 1fr); align-items: center; gap: 12px; padding: 10px 14px; border-radius: var(--r-card); background: var(--bg); box-shadow: inset 0 0 0 1px var(--line-2); transition: box-shadow 0.15s; }
.namefield:focus-within { box-shadow: inset 0 0 0 1px var(--fg); }
.namefield.need { box-shadow: inset 0 0 0 1px var(--signal); }
.namefield label { display: grid; gap: 3px; min-width: 0; }
.namefield input { width: 100%; min-width: 0; padding: 0; border: 0; outline: none; background: transparent; font-size: 15px; color: var(--text); }
.namefield input::placeholder { color: var(--text-4); }
.composer .foot { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 10px; }
.composer .foot .grow { flex: 1; }
.tchip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px 0 9px; border: 0; border-radius: var(--r-ctl); background: var(--fill-2); color: var(--fg); font-family: var(--f-mono); font-size: 12px; letter-spacing: 0.02em; }
.tchip:not(.off) .i { color: var(--signal); }
.tchip .i { width: 14px; height: 14px; }
.tchip .ic { display: inline-flex; }
.tchip.off { color: var(--text-3); background: transparent; box-shadow: var(--hair); }
.send { width: 34px; height: 34px; border: 0; border-radius: var(--r-ctl); background: var(--fg); color: var(--bg); display: grid; place-items: center; transition: transform 0.15s var(--ease), opacity 0.15s; }
.send:disabled { opacity: 0.3; }
.send:not(:disabled):active { transform: scale(0.94); }
.send .i { width: 16px; height: 16px; }
.composer .who { font-size: 12.5px; color: var(--text-3); display: flex; gap: 8px; align-items: center; padding: 0 6px; }
.composer .who span { min-width: 0; overflow-wrap: anywhere; }
.composer .who button { border: 0; background: none; color: var(--text-2); font-size: 12.5px; padding: 0; text-decoration: underline; text-underline-offset: 3px; }
.toggle { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-3); cursor: pointer; user-select: none; }
.toggle input { appearance: none; -webkit-appearance: none; width: 34px; height: 20px; border-radius: var(--r-ctl); background: var(--fill-3); position: relative; margin: 0; cursor: pointer; transition: background 0.2s; }
.toggle input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 4px; background: var(--bg); box-shadow: 0 1px 2px rgba(13, 13, 13, 0.2); transition: transform 0.2s var(--ease); }
.toggle input:checked { background: var(--fg); }
.toggle input:checked::after { transform: translateX(14px); }

/* ---------- Recorder ---------- */
body.rec { height: var(--vh); overflow: hidden; }
.rec-shell { position: relative; z-index: 1; height: var(--vh); display: grid; grid-template-columns: 370px minmax(0, 1fr); gap: var(--gap); padding: var(--gap); }
.rec-panel { display: flex; flex-direction: column; min-height: 0; overflow: auto; border-radius: var(--r-xl); animation: rise 0.35s var(--ease); }
.rec-panel .body { padding: 22px 26px 26px; display: grid; gap: 20px; }
.rec-panel .seg { display: flex; width: 100%; }
.rec-panel .note.warn { color: var(--warn); }
.ctl-note { display: grid; gap: 2px; }
#trim-line { align-items: center; }
#trim-line .btn { margin-left: 4px; }
.rec-panel .seg button { flex: 1; }
.rec-panel h1 { margin: 0; font-size: 34px; letter-spacing: -0.045em; line-height: 1; }
.rec-panel .lede { margin: 10px 0 0; color: var(--text-2); }
.src-row { display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 14px; border-radius: var(--r-ctl); background: var(--bg); box-shadow: inset 0 0 0 1px var(--line-2); }
.src-row .i { width: 20px; height: 20px; color: var(--text-2); }
.src-row .grow { flex: 1; min-width: 0; }
.src-row .grow b { display: block; font-weight: 500; }
.src-row .grow span { display: block; font-size: 12.5px; color: var(--text-3); }
.mic-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.level { height: 3px; border-radius: 3px; background: var(--fill-2); overflow: hidden; }
.level i { display: block; height: 100%; width: 0; background: var(--fg); transition: width 0.06s linear; }
.rec-stage { position: relative; min-width: 0; min-height: 0; display: grid; place-items: center; }
.rec-stage .frame { max-width: 100%; }
.rec-stage video { width: 100%; max-height: calc(var(--vh) - 2 * var(--gap)); background: #000; }
/* Area select: the chip on the preview, and the recorded box with the outside dimmed. */
.rec-stage #preview-frame { position: relative; }
.area-clip { position: absolute; overflow: hidden; pointer-events: none; }
.area-box { position: absolute; outline: 1px solid rgba(255, 255, 255, 0.9); box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.55); }
.area-tools { position: absolute; z-index: 3; display: flex; gap: 6px; transform: translateY(-100%); }
.chip {
  display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px 0 10px; border: 0; border-radius: var(--r-ctl);
  color: var(--ink); font-size: 13px; font-weight: 500; background: var(--paper); box-shadow: 0 2px 10px rgba(13, 13, 13, 0.25);
}
.chip .i { width: 16px; height: 16px; }
.chip.icon { width: 32px; padding: 0; justify-content: center; }
@media (hover: hover) { .chip:hover { background: var(--paper-2); } }
.chip:disabled { opacity: 0.4; pointer-events: none; }
.dock-area { margin-left: 4px; padding: 2px 8px; border-radius: 4px; background: var(--fill-2); color: var(--text-2); font-family: var(--f-mono); font-size: 11px; }
/* The area editor fills the stage. */
.rec-stage.editing { place-items: stretch; }
.area-ed { display: flex; flex-direction: column; gap: 12px; width: 100%; height: calc(var(--vh) - 2 * var(--gap)); min-height: 0; animation: fade 0.3s var(--ease); }
.ae-view { position: relative; flex: 1; min-height: 0; border-radius: var(--r-card); overflow: hidden; background: #000; touch-action: none; user-select: none; cursor: crosshair; }
.rec-stage .ae-view video { position: absolute; inset: 12px; width: calc(100% - 24px); height: calc(100% - 24px); max-height: none; object-fit: contain; pointer-events: none; }
.ae-clip { position: absolute; overflow: hidden; pointer-events: none; }
.ae-shade { position: absolute; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.55); }
.ae-box { position: absolute; outline: 1px solid #fff; cursor: move; }
.ae-box.whole { cursor: crosshair; }
.ae-box:focus-visible { outline: 1px solid #fff; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.35); }
/* Handles: 24 px to grab, 10 px to see. */
.ae-h { position: absolute; width: 24px; height: 24px; margin: -12px 0 0 -12px; z-index: 1; }
.ae-h::after { content: ""; position: absolute; left: 7px; top: 7px; width: 10px; height: 10px; border-radius: 2px; background: #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.45); }
.ae-nw { left: 0; top: 0; cursor: nwse-resize; }
.ae-n { left: 50%; top: 0; cursor: ns-resize; }
.ae-ne { left: 100%; top: 0; cursor: nesw-resize; }
.ae-e { left: 100%; top: 50%; cursor: ew-resize; }
.ae-se { left: 100%; top: 100%; cursor: nwse-resize; }
.ae-s { left: 50%; top: 100%; cursor: ns-resize; }
.ae-sw { left: 0; top: 100%; cursor: nesw-resize; }
.ae-w { left: 0; top: 50%; cursor: ew-resize; }
.ae-mag { position: absolute; z-index: 4; width: 132px; height: 132px; border-radius: 10px; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.6), 0 10px 30px rgba(0, 0, 0, 0.5); pointer-events: none; image-rendering: pixelated; }
.ae-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 8px 10px; border-radius: var(--r-lg); }
.ae-bar .grow { flex: 1; }
.ae-size { display: flex; align-items: baseline; gap: 8px; padding: 0 6px; }
.ae-dim { font-family: var(--f-mono); font-size: 14px; }
.ae-pos { font-family: var(--f-mono); font-size: 11.5px; color: var(--text-3); }
.ae-tips { display: grid; gap: 6px; padding: 0 4px; }
.ae-tips .note .i { width: 16px; height: 16px; flex: none; margin-top: 2px; }
/* Camera bubble: the setup controls and the preview over the screen. */
.cam-head, .nf-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.cam-opts { display: grid; gap: 10px; }
.nf-right { display: inline-flex; align-items: center; gap: 10px; }
.cam-row { display: flex; align-items: center; gap: 10px; }
.cam-row .seg { flex: 1; display: flex; }
.cam-row .seg button { flex: 1; padding: 0 8px; }
.corners { display: grid; grid-template-columns: repeat(2, 18px); gap: 4px; flex: none; padding: 5px; border-radius: var(--r-ctl); background: var(--bg); box-shadow: inset 0 0 0 1px var(--line-2); }
.corners button { width: 18px; height: 14px; padding: 0; border: 0; border-radius: 3px; background: var(--fill-2); position: relative; }
.corners button::after { content: ""; position: absolute; width: 6px; height: 6px; border-radius: 50%; background: var(--text-3); }
.corners button[data-c="tl"]::after { left: 2px; top: 2px; }
.corners button[data-c="tr"]::after { right: 2px; top: 2px; }
.corners button[data-c="bl"]::after { left: 2px; bottom: 2px; }
.corners button[data-c="br"]::after { right: 2px; bottom: 2px; }
.corners button.on { background: var(--fg); }
.corners button.on::after { background: var(--signal); }
@media (pointer: coarse) {
  .corners { grid-template-columns: repeat(2, 28px); }
  .corners button { width: 28px; height: 22px; }
}
.rec-stage video.cam-bubble {
  position: absolute; z-index: 2; width: auto; max-height: none; aspect-ratio: 1; border-radius: 50%; object-fit: cover;
  transform: scaleX(-1); background: #000; box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.85), 0 8px 24px rgba(0, 0, 0, 0.45);
}
.rec-empty { text-align: center; display: grid; justify-items: center; gap: 12px; color: var(--text-3); }
.rec-empty .i { width: 30px; height: 30px; }
.rec-empty b { color: var(--text); font-size: 18px; font-weight: 500; }
.rec-live { position: relative; z-index: 1; height: var(--vh); display: grid; place-items: center; text-align: center; }
.rec-live .clock { font-size: clamp(88px, 14vw, 180px); font-weight: 500; line-height: 1; letter-spacing: -0.05em; }
.rec-live .state { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text-2); margin-bottom: 18px; }
.rec-live .up { margin-top: 20px; font-size: 13px; color: var(--text-3); }
.dock {
  position: fixed; left: 50%; bottom: calc(28px + env(safe-area-inset-bottom, 0px)); z-index: 5;
  --tx: -50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 6px; padding: 6px; border-radius: var(--r-card);
  animation: rise 0.3s var(--ease);
}
.dock .timer { display: inline-flex; align-items: center; gap: 10px; padding: 0 12px 0 14px; font-family: var(--f-mono); font-size: 14px; }
.dock .sep { width: 1px; height: 22px; background: var(--line-2); }
.dock .btn.icon.confirm { width: auto; padding: 0 14px 0 11px; color: var(--ink); background: var(--signal); }
@media (hover: hover) { .dock .btn.icon.confirm:hover { background: color-mix(in srgb, var(--signal) 86%, var(--ink)); color: var(--ink); } }
.done { position: relative; z-index: 1; min-height: var(--vh); display: grid; place-items: center; padding: var(--gap); }
.done .card { width: min(540px, 100%); padding: 30px; display: grid; gap: 18px; border-radius: var(--r-xl); animation: rise 0.35s var(--ease); }
.done h1 { margin: 0; font-size: 36px; letter-spacing: -0.045em; line-height: 1; }
.done .sub { margin: 10px 0 0; color: var(--text-2); }
.done .linkbig { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 16px; border-radius: var(--r-ctl); background: var(--bg); box-shadow: inset 0 0 0 1px var(--line-2); }
.done .linkbig span { flex: 1; min-width: 0; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.done .row { display: flex; gap: 8px; flex-wrap: wrap; }
.countdown { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: color-mix(in srgb, var(--bg) 92%, transparent); color: var(--fg); font-size: clamp(140px, 22vw, 260px); font-weight: 500; line-height: 1; letter-spacing: -0.06em; }

/* Floating controller (Document Picture-in-Picture window). */
/* One compact glass row: in an entire-screen recording it is part of the video. */
body.pip {
  margin: 0; min-height: 100vh; display: flex; align-items: center; gap: 2px; padding: 0 8px 0 14px; overflow: hidden;
  background: var(--panel); box-shadow: var(--hair);
}
body.pip .timer { display: inline-flex; align-items: center; gap: 9px; font-family: var(--f-mono); font-size: 14px; flex: 1; min-width: 0; }
body.pip .clock { transition: opacity 0.2s; }
body.pip .clock.dim { opacity: 0.5; }
body.pip .btn.icon.sm { width: 34px; height: 34px; }
body.pip .btn.icon.stop { color: var(--signal); }
body.pip .btn.icon.off { color: var(--text-3); }
body.pip .btn.icon.confirm { color: var(--ink); background: var(--signal); }
body.pip .up { font-family: var(--f-sans); font-size: 11.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.pip .up.warn { color: var(--warn); }

/* ---------- Trim ---------- */
/* ---------- Editor (library): trim, cuts, cut by text, remove pauses ---------- */
.editor { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; padding: 16px 18px 20px; border-radius: var(--r-xl); min-width: 0; animation: rise 0.3s var(--ease); }
.ed-top { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.ed-top .grow { flex: 1; }
.ed-title { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.ed-title h2 { margin: 0; font-size: 24px; letter-spacing: -0.03em; }
.ed-len { font-family: var(--f-mono); font-size: 12px; color: var(--text-2); }
.ed-video { display: grid; gap: 10px; justify-items: start; }
.ed-video .frame { width: 100%; }
.ed-video .player video { max-height: 46vh; }
.ed-work { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.ed-tl { display: grid; gap: 10px; min-width: 0; }
.ed-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; }
.ed-tools .grow { flex: 1; }
.ed-tools .seg button { padding: 0 10px; }
.tl-time { font-family: var(--f-mono); font-size: 12px; color: var(--text-3); padding: 0 4px; }
.tl-scroll { position: relative; height: 96px; overflow-x: auto; overflow-y: hidden; border-radius: var(--r-ctl); background: var(--bg); box-shadow: inset 0 0 0 1px var(--line-2); outline: none; color: var(--fg); }
.tl-scroll:focus-visible { box-shadow: inset 0 0 0 2px var(--signal); }
.tl-wave { position: sticky; left: 0; top: 0; display: block; width: 100%; height: 72px; margin-top: 12px; pointer-events: none; }
.tl-inner { position: absolute; left: 0; top: 0; bottom: 0; cursor: text; touch-action: pan-x; }
.tl-out { position: absolute; top: 0; bottom: 0; background: color-mix(in srgb, var(--bg) 72%, transparent); pointer-events: none; }
.tl-cuts { position: absolute; inset: 0; pointer-events: none; }
.tl-cut {
  position: absolute; top: 8px; bottom: 8px; border-radius: 4px; pointer-events: auto; cursor: pointer;
  background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--bg) 82%, transparent) 0 6px, color-mix(in srgb, var(--fg) 18%, var(--bg)) 6px 12px);
  box-shadow: inset 0 0 0 1px var(--line-2);
}
.tl-cut.on { box-shadow: inset 0 0 0 1.5px var(--fg); }
/* Cuts made by Remove pauses: a lighter hatch. */
.tl-cut.pause { background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--bg) 60%, transparent) 0 4px, color-mix(in srgb, var(--fg) 12%, transparent) 4px 8px); }
.tl-cut.pause.on { box-shadow: inset 0 0 0 1.5px var(--fg); }
.ed-words .pchip { display: inline-flex; align-items: center; height: 20px; margin: 0 4px; padding: 0 7px; border: 0; border-radius: 4px; background: var(--fill-2); color: var(--text-3); font-family: var(--f-mono); font-size: 11px; line-height: 1; text-decoration: line-through; vertical-align: 1px; cursor: pointer; }
@media (hover: hover) { .ed-words .pchip:hover { background: var(--fill-3); color: var(--text); } }
.tl-edge { position: absolute; top: -4px; bottom: -4px; width: 10px; cursor: ew-resize; }
.tl-edge::after { content: ""; position: absolute; left: 3px; top: 0; bottom: 0; width: 4px; border-radius: 2px; background: var(--fg); }
.tl-edge.a { left: -5px; }
.tl-edge.b { right: -5px; }
.tl-sel { position: absolute; top: 4px; bottom: 4px; border-radius: 4px; background: color-mix(in srgb, var(--signal) 14%, transparent); box-shadow: inset 0 0 0 1px var(--signal); pointer-events: none; }
.tl-head { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--signal); pointer-events: none; }
.tl-h { position: absolute; top: 0; bottom: 0; width: 14px; margin-left: -7px; cursor: ew-resize; outline: none; }
.tl-h::after { content: ""; position: absolute; left: 4px; top: 6px; bottom: 6px; width: 6px; border-radius: 3px; background: var(--fg); box-shadow: 0 0 0 1px var(--bg); }
.tl-h:focus-visible::after { box-shadow: 0 0 0 2px var(--signal); }
.tl-pop { position: absolute; top: 50%; transform: translate(-50%, -50%); z-index: 3; }
.tl-pop .btn { box-shadow: 0 4px 14px rgba(13, 13, 13, 0.25); }
.ed-pauses { min-height: 30px; display: flex; align-items: center; }
.ed-note { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); }
.ed-text { display: grid; gap: 10px; min-width: 0; }
.ed-text h3, .ed-phonecuts h3 { margin: 0; font-family: var(--f-mono); font-size: 11.5px; font-weight: 400; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-3); }
.ed-wordbar { display: flex; align-items: center; gap: 10px; min-height: 30px; font-size: 13px; color: var(--text-2); }
.ed-wordbar .muted { color: var(--text-3); }
.ed-words { max-height: 300px; overflow: auto; padding: 10px 12px; border-radius: var(--r-ctl); background: var(--bg); box-shadow: inset 0 0 0 1px var(--line-2); font-size: 14px; line-height: 1.9; color: var(--text); user-select: none; -webkit-user-select: none; }
.ed-words .w { padding: 2px 2px; border-radius: 4px; cursor: pointer; }
.ed-words .w + .w::before { content: " "; }
@media (hover: hover) { .ed-words .w:hover { background: var(--fill-2); } }
.ed-words .w.cut { color: var(--text-4); text-decoration: line-through; }
.ed-words .w.sel { background: color-mix(in srgb, var(--signal) 22%, transparent); color: var(--fg); }
.ed-words .cempty { padding: 24px 12px; }
.ed-phonecuts, .ed-phone { display: none; }
.ed-cutlist { display: grid; gap: 4px; }
.ed-cutrow { display: flex; align-items: center; gap: 10px; padding: 6px 4px 6px 10px; border-radius: var(--r-ctl); background: var(--fill); font-size: 14px; }
.ed-cutrow .grow { flex: 1; }
.ed-cutrow > .i { width: 16px; height: 16px; color: var(--text-3); }
@media (max-width: 1100px) {
  .ed-work { grid-template-columns: minmax(0, 1fr); }
}
/* Editing is for a computer; a phone shows the video and the cuts to restore. */
@media (max-width: 860px) {
  .editor .ed-work, .editor .ed-video .toggle { display: none; }
  .editor .ed-phonecuts, .editor .ed-phone { display: grid; gap: 10px; }
  .editor .ed-phone { display: flex; }
  .editor .ed-top .icon { display: none; }
  .editor .ed-title { flex-basis: 100%; }
}

/* Single-column grids never grow past their container (inputs have a wide intrinsic size). */
.field, .modal .sheet, .card, .solo, .gate, .s-stage, .s-message, .composer, .replyform, .rec-panel .body,
.clist, .side-list, .side-nav, .viewers, .c .replies { grid-template-columns: minmax(0, 1fr); }

/* ---------- Responsive ---------- */
/* Wide library: the stage and the comments are columns of the shell. This is the default rather
   than a min-width query, so no window width (125% zoom gives fractions) falls between layouts. */
.lib-shell .main-col { display: contents; }
.lib-shell .cpanel { position: relative; top: auto; height: auto; min-height: 0; }
@media (max-width: 1240px) {
  .lib-shell, .lib-shell.nopanel { grid-template-columns: 280px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
  .lib-shell .main-col { display: flex; flex-direction: column; gap: var(--gap); min-height: 0; overflow: auto; overscroll-behavior: contain; }
  .lib-shell .main-col .stage { flex: none; overflow: visible; min-height: auto; }
  .lib-shell .main-col .stage-center { min-height: calc(var(--vh) - 2 * var(--gap)); }
  .lib-shell .cpanel { position: relative; top: auto; height: auto; min-height: 0; flex: none; }
  .lib-shell .cpanel .clist { overflow: visible; }
  .stage .player video { max-height: 58vh; }
}
@media (max-width: 860px) {
  :root { --gap: 12px; }
  body.lib, body.rec { height: auto; overflow: auto; }
  .lib-shell, .lib-shell.nopanel { height: auto; min-height: var(--vh); grid-template-columns: minmax(0, 1fr); padding-top: max(var(--gap), env(safe-area-inset-top)); padding-bottom: max(var(--gap), env(safe-area-inset-bottom)); }
  .lib-shell .main-col { overflow: visible; }
  .lib-shell .main-col .stage-center { min-height: 60vh; }
  .side { max-height: none; }
  .side-list { overflow: visible; }
  .lib-shell.viewing .side { display: none; }
  .back { display: inline-flex; }
  .lib-shell:not(.viewing) .main-col { display: none; }
  .rec-shell { height: auto; grid-template-columns: minmax(0, 1fr); }
  .rec-stage { order: -1; }
  .s-main { grid-template-columns: minmax(0, 1fr); }
  .s-chapters .chall { display: inline-flex; }
  .chlist { grid-template-columns: minmax(0, 1fr); }
  .s-chapters:not(.open) .chrow:not(.on) { display: none; }
  .cpanel { position: relative; top: auto; height: auto; min-height: 0; }
  .clist { max-height: none; overflow: visible; }
  /* On a phone the comment box sits right under the video, above the thread. */
  .cpanel .divider { display: none; }
  .cpanel .chead { order: -2; border-bottom: 1px solid var(--line); }
  .cpanel .composer { order: -1; border-bottom: 1px solid var(--line); }
  .cpanel .ptabs { order: -3; }
  .tlist { overflow: visible; }
  .player .big { width: 60px; height: 60px; }
  .player .big .i { width: 22px; height: 22px; }
  .s-title { font-size: 26px; }
}
/* A narrow player (a phone, a small window, a landscape phone beside the comments) gets one
   compact row of controls, so they cover as little of the video as possible. The media query
   repeats it for browsers without container queries. */
.player { container: player / inline-size; }
@container player (max-width: 560px) {
  .player .bar { left: 8px; right: 8px; bottom: 8px; padding: 3px 4px; border-radius: var(--r-ctl); display: flex; align-items: center; gap: 2px; }
  .player .row { display: contents; }
  .player .row .grow, .player .pbtn.mute, .player .chap { display: none; }
  .player .pbtn.play { order: 1; }
  .player .time { order: 2; font-size: 11.5px; padding: 0 4px 0 2px; }
  .player .scrub { order: 3; flex: 1; margin: 0 6px; }
  .player .speed { order: 4; min-width: 38px; padding: 0 8px; height: 30px; }
  .player .pbtn.full { order: 5; }
  .player .scrub .tip { bottom: 30px; }
  .player .caption { bottom: 58px; }
  .player.idle.playing .caption { bottom: 14px; }
  .player .big { width: 60px; height: 60px; }
  .player .big .i { width: 22px; height: 22px; }
}
@media (max-width: 560px) {
  .player .bar { left: 8px; right: 8px; bottom: 8px; padding: 3px 4px; border-radius: var(--r-ctl); display: flex; align-items: center; gap: 2px; }
  .player .row { display: contents; }
  .player .row .grow, .player .pbtn.mute, .player .chap { display: none; }
  .player .pbtn.play { order: 1; }
  .player .time { order: 2; font-size: 11.5px; padding: 0 4px 0 2px; }
  .player .scrub { order: 3; flex: 1; margin: 0 6px; }
  .player .speed { order: 4; min-width: 38px; padding: 0 8px; height: 30px; }
  .player .pbtn.full { order: 5; }
  .player .scrub .tip { bottom: 30px; }
  .player .caption { bottom: 58px; }
  .player.idle.playing .caption { bottom: 14px; }
}
/* Touch screens: bigger targets, the seek handle always visible, and 16 px text fields (smaller
   text makes iPhone zoom in on focus). */
@media (pointer: coarse) {
  .scrub { height: 28px; }
  .scrub .rail, .scrub .buf, .scrub .fill { top: 12px; }
  .scrub .knob { top: 8px; transform: scale(1); }
  .scrub .mk { top: 9px; }
  .scrub .mk::after { inset: -12px; }
  .player .pbtn { width: 42px; height: 42px; }
  .player .speed { height: 32px; }
  .ts { height: 28px; padding: 0 10px; }
  .c .acts button { height: 36px; }
  .input, .textarea, .select, .namefield input, .composer .box textarea { font-size: 16px; }
  .btn.sm { height: 36px; }
  .btn.icon.sm { width: 36px; height: 36px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .player .bar { background: rgba(13, 13, 13, 0.92); }
}

/* ---------- Brand layout: the header bar, the watch page's title and meta rows, avatars ---------- */
.av.owner { background: var(--fg); color: var(--bg); }
body.share .app-bar { max-width: 1600px; margin: 0 auto; padding: max(var(--m), env(safe-area-inset-top)) max(var(--gap), env(safe-area-inset-right)) 0 max(var(--gap), env(safe-area-inset-left)); }
body.share .app-bar .mark { margin-left: -9px; }
body.share .s-main { padding-top: 20px; }
.s-stage { gap: 28px; }
.s-head { align-items: flex-start; padding: 6px 4px 0; gap: 20px 32px; }
#s-head-text { flex: 1 1 520px; min-width: 0; max-width: 820px; }
.s-summary { margin: 18px 0 0; font-size: 17px; line-height: 1.5; color: var(--text-2); }
.s-sub.meta-rows { margin-top: 26px; max-width: 520px; }
.meta-rows dd:last-of-type, .meta-rows dt:last-of-type { border-bottom: 1px solid var(--line); }
.s-head > .pill { margin-top: 10px; }
.s-chapters { gap: 10px; }
.s-foot { color: var(--text-3); font-size: 13px; }
.cpanel { top: calc(var(--m) + 56px); height: calc(var(--vh) - var(--m) - 56px - var(--gap) - 20px); }
.c .av { margin-top: 1px; }
/* Sign-in: the mark and the theme pill sit above the form, as the site's header does. */
body.lib .gate-bar { display: none; position: absolute; left: 0; right: 0; top: 0; }
body.lib .gate-bar .mark { margin-left: -9px; }
body.lib:has(#gate:not([hidden])) .gate-bar { display: flex; }
.gate p { font-size: 15px; line-height: 1.5; }
.side-acts { display: inline-flex; align-items: center; gap: 4px; }
.side-acts .theme-toggle { height: 32px; padding: 0 12px; }
.side-foot .acct .theme-toggle { height: 32px; padding: 0 12px; margin-right: 2px; }
.side-head { height: 72px; padding: 0 14px 0 24px; }
.side-head .brand .mark { margin-left: -9px; }
@media (max-width: 860px) {
  .cpanel { top: auto; height: auto; }
  .s-title { font-size: 32px; }
  .s-sub.meta-rows { margin-top: 20px; }
}
.card h3 .toggle, .card h3 .btn, .card h3 button { font-family: var(--f-sans); text-transform: none; letter-spacing: 0; font-size: 13px; }
