/* ================================================================
   Ear Drama: the web stylesheet
   Mobile-first. Custom properties for theming. WCAG AA.
================================================================ */

/* ---- Design tokens ----
   Every value below comes from
   design-tokens.json: change it there, run `node tools/design_tokens.mjs`,
   and every platform follows (see the make-it-look-like-itself skill). */
/* BEGIN design-tokens. Generated from design-tokens.json by tools/design_tokens.mjs. Do not edit by hand. */
@font-face { font-family: "Big Shoulders"; src: url("../fonts/big-shoulders.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Public Sans"; src: url("../fonts/public-sans.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Public Sans"; src: url("../fonts/public-sans-italic.woff2") format("woff2"); font-weight: 100 900; font-style: italic; font-display: swap; }
:root {
  color-scheme: light;
  --color-primary: #131316;
  --color-on-primary: #FFFFFF;
  --color-background: #FFFFFF;
  --color-surface: #F4F4F5;
  --color-surface-alt: #E8E8EB;
  --color-text: #131316;
  --color-scrim: #131316;
  --color-text-muted: #5C5C66;
  --color-border: #D8D8DD;
  --color-secondary: #0B6E99;
  --color-on-secondary: #FFFFFF;
  --color-link: #0B6E99;
  --color-record: #B0152F;
  --color-on-record: #FFFFFF;
  --color-success: #1D7A4A;
  --color-warning: #8A5300;
  --color-error: #C2410C;
  --color-error-surface: #FDEEE8;
  --color-genre-drama: #9D547C;
  --color-genre-mystery: #2459A5;
  --color-genre-scifi: #007C88;
  --color-genre-western: #864E37;
  --color-genre-comedy: #816B01;
  --color-genre-news: #504C3E;
  --color-genre-documentary: #2F6100;
  --color-genre-serial: #5A3983;
  --color-on-genre-drama: #FFFFFF;
  --color-on-genre-mystery: #FFFFFF;
  --color-on-genre-scifi: #FFFFFF;
  --color-on-genre-western: #FFFFFF;
  --color-on-genre-comedy: #FFFFFF;
  --color-on-genre-news: #FFFFFF;
  --color-on-genre-documentary: #FFFFFF;
  --color-on-genre-serial: #FFFFFF;
  --color-board-drama: #86426F;
  --color-board-mystery: #375C9B;
  --color-board-scifi: #006A79;
  --color-board-western: #8B492A;
  --color-board-comedy: #795700;
  --color-board-news: #615D53;
  --color-board-documentary: #296E38;
  --color-board-serial: #684D92;
  --color-on-board-drama: #FFFFFF;
  --color-on-board-mystery: #FFFFFF;
  --color-on-board-scifi: #FFFFFF;
  --color-on-board-western: #FFFFFF;
  --color-on-board-comedy: #FFFFFF;
  --color-on-board-news: #FFFFFF;
  --color-on-board-documentary: #FFFFFF;
  --color-on-board-serial: #FFFFFF;
  --color-mark-yellow: #FBE38E;
  --color-mark-green: #CDEBC5;
  --color-mark-blue: #CFE2F8;
  --color-mark-pink: #F7D2E3;
  --color-radio-surround: #120E0B;
  --color-radio-pool: #2E241B;
  --color-radio-ink: #F2EDE6;
  --color-radio-ink-muted: #C9BFB2;
  --color-radio-raised: #2A221B;
  --color-print-ground: #EDEDED;
  --color-print-edge: rgba(19, 19, 22, 0.18);
  --font-display: "Big Shoulders", "Arial Narrow", system-ui, sans-serif;
  --font-body: "Public Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --type-page-title-size: 1.75rem;
  --type-page-title-weight: 700;
  --type-page-title-family: var(--font-display);
  --type-section-header-size: 1.25rem;
  --type-section-header-weight: 700;
  --type-section-header-family: var(--font-display);
  --type-body-strong-size: 1rem;
  --type-body-strong-weight: 600;
  --type-body-size: 1rem;
  --type-body-weight: 400;
  --type-caption-size: 0.8125rem;
  --type-caption-weight: 400;
  --type-tabular-size: 0.875rem;
  --type-tabular-weight: 400;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;
  --radius-control: 8px;
  --radius-card: 12px;
}
html[data-theme="dark"] {
  color-scheme: dark;
  --color-primary: #F2F2F4;
  --color-on-primary: #0F0F11;
  --color-background: #0F0F11;
  --color-surface: #19191C;
  --color-surface-alt: #232327;
  --color-text: #F2F2F4;
  --color-scrim: #000000;
  --color-text-muted: #C4C4CC;
  --color-border: #34343A;
  --color-secondary: #6CC0E0;
  --color-on-secondary: #06141B;
  --color-link: #6CC0E0;
  --color-record: #E3384B;
  --color-on-record: #120708;
  --color-success: #5CC593;
  --color-warning: #E8B04B;
  --color-error: #FF9466;
  --color-error-surface: #3A1F16;
  --color-genre-drama: #F89DC9;
  --color-genre-mystery: #8EBBFF;
  --color-genre-scifi: #44D5D7;
  --color-genre-western: #C99580;
  --color-genre-comedy: #D4C27E;
  --color-genre-news: #B4B3B3;
  --color-genre-documentary: #7CB45A;
  --color-genre-serial: #AA87DE;
  --color-on-genre-drama: #0F0F11;
  --color-on-genre-mystery: #0F0F11;
  --color-on-genre-scifi: #0F0F11;
  --color-on-genre-western: #0F0F11;
  --color-on-genre-comedy: #0F0F11;
  --color-on-genre-news: #0F0F11;
  --color-on-genre-documentary: #0F0F11;
  --color-on-genre-serial: #0F0F11;
  --color-board-drama: #5F2A4D;
  --color-board-mystery: #223F6F;
  --color-board-scifi: #004854;
  --color-board-western: #623018;
  --color-board-comedy: #543B00;
  --color-board-news: #424038;
  --color-board-documentary: #154C22;
  --color-board-serial: #473368;
  --color-on-board-drama: #F2F2F4;
  --color-on-board-mystery: #F2F2F4;
  --color-on-board-scifi: #F2F2F4;
  --color-on-board-western: #F2F2F4;
  --color-on-board-comedy: #F2F2F4;
  --color-on-board-news: #F2F2F4;
  --color-on-board-documentary: #F2F2F4;
  --color-on-board-serial: #F2F2F4;
  --color-mark-yellow: #5C4A10;
  --color-mark-green: #1F4A2B;
  --color-mark-blue: #1D3D63;
  --color-mark-pink: #5B2743;
  --color-radio-surround: #120E0B;
  --color-radio-pool: #2E241B;
  --color-radio-ink: #F2EDE6;
  --color-radio-ink-muted: #C9BFB2;
  --color-radio-raised: #2A221B;
  --color-print-ground: #2A2A2E;
  --color-print-edge: rgba(242, 242, 244, 0.16);
}
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) {
    color-scheme: dark;
    --color-primary: #F2F2F4;
    --color-on-primary: #0F0F11;
    --color-background: #0F0F11;
    --color-surface: #19191C;
    --color-surface-alt: #232327;
    --color-text: #F2F2F4;
    --color-scrim: #000000;
    --color-text-muted: #C4C4CC;
    --color-border: #34343A;
    --color-secondary: #6CC0E0;
    --color-on-secondary: #06141B;
    --color-link: #6CC0E0;
    --color-record: #E3384B;
    --color-on-record: #120708;
    --color-success: #5CC593;
    --color-warning: #E8B04B;
    --color-error: #FF9466;
    --color-error-surface: #3A1F16;
    --color-genre-drama: #F89DC9;
    --color-genre-mystery: #8EBBFF;
    --color-genre-scifi: #44D5D7;
    --color-genre-western: #C99580;
    --color-genre-comedy: #D4C27E;
    --color-genre-news: #B4B3B3;
    --color-genre-documentary: #7CB45A;
    --color-genre-serial: #AA87DE;
    --color-on-genre-drama: #0F0F11;
    --color-on-genre-mystery: #0F0F11;
    --color-on-genre-scifi: #0F0F11;
    --color-on-genre-western: #0F0F11;
    --color-on-genre-comedy: #0F0F11;
    --color-on-genre-news: #0F0F11;
    --color-on-genre-documentary: #0F0F11;
    --color-on-genre-serial: #0F0F11;
    --color-board-drama: #5F2A4D;
    --color-board-mystery: #223F6F;
    --color-board-scifi: #004854;
    --color-board-western: #623018;
    --color-board-comedy: #543B00;
    --color-board-news: #424038;
    --color-board-documentary: #154C22;
    --color-board-serial: #473368;
    --color-on-board-drama: #F2F2F4;
    --color-on-board-mystery: #F2F2F4;
    --color-on-board-scifi: #F2F2F4;
    --color-on-board-western: #F2F2F4;
    --color-on-board-comedy: #F2F2F4;
    --color-on-board-news: #F2F2F4;
    --color-on-board-documentary: #F2F2F4;
    --color-on-board-serial: #F2F2F4;
    --color-mark-yellow: #5C4A10;
    --color-mark-green: #1F4A2B;
    --color-mark-blue: #1D3D63;
    --color-mark-pink: #5B2743;
    --color-radio-surround: #120E0B;
    --color-radio-pool: #2E241B;
    --color-radio-ink: #F2EDE6;
    --color-radio-ink-muted: #C9BFB2;
    --color-radio-raised: #2A221B;
    --color-print-ground: #2A2A2E;
    --color-print-edge: rgba(242, 242, 244, 0.16);
  }
}
[data-genre="drama"] { --genre-accent: var(--color-genre-drama); --genre-on-accent: var(--color-on-genre-drama); --genre-board: var(--color-board-drama); --genre-on: var(--color-on-board-drama); }
[data-genre="mystery"] { --genre-accent: var(--color-genre-mystery); --genre-on-accent: var(--color-on-genre-mystery); --genre-board: var(--color-board-mystery); --genre-on: var(--color-on-board-mystery); }
[data-genre="scifi"] { --genre-accent: var(--color-genre-scifi); --genre-on-accent: var(--color-on-genre-scifi); --genre-board: var(--color-board-scifi); --genre-on: var(--color-on-board-scifi); }
[data-genre="western"] { --genre-accent: var(--color-genre-western); --genre-on-accent: var(--color-on-genre-western); --genre-board: var(--color-board-western); --genre-on: var(--color-on-board-western); }
[data-genre="comedy"] { --genre-accent: var(--color-genre-comedy); --genre-on-accent: var(--color-on-genre-comedy); --genre-board: var(--color-board-comedy); --genre-on: var(--color-on-board-comedy); }
[data-genre="news"] { --genre-accent: var(--color-genre-news); --genre-on-accent: var(--color-on-genre-news); --genre-board: var(--color-board-news); --genre-on: var(--color-on-board-news); }
[data-genre="documentary"] { --genre-accent: var(--color-genre-documentary); --genre-on-accent: var(--color-on-genre-documentary); --genre-board: var(--color-board-documentary); --genre-on: var(--color-on-board-documentary); }
[data-genre="serial"] { --genre-accent: var(--color-genre-serial); --genre-on-accent: var(--color-on-genre-serial); --genre-board: var(--color-board-serial); --genre-on: var(--color-on-board-serial); }
/* END design-tokens */

/* Every color, size, weight, space, and radius below is a token from the block
   above. A palette change is a design-tokens.json change only: nothing here
   names a color. */

/* Layout (not part of the look) */
:root {
  --sidebar-width: 220px;
  --tap: 44px;
  --date-col: 6.25rem;
}

/* Genre accents: ONE hook per genre, the data-genre attribute, read through
   --genre-accent. The token block sets each catalog genre's hue (Decision 064);
   a genre it does not name stays neutral. :where() keeps this fallback below
   the generated rules. Content only, never chrome (WEB-DESIGN §6.1a). */
:where([data-genre]) { --genre-accent: var(--color-border); }

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }

/*
 * Body flex-column: the only reliable way to keep content out of Safari's
 * Dynamic Island in iOS Safari browser mode. NO viewport-fit=cover, NO
 * position:fixed overlays. The player bar and the tab bar are flex children
 * pinned by document flow; <main> is the one scroll container.
 */
body {
  font-family: var(--font-body);
  font-size: var(--type-body-size);
  line-height: 1.45;
  color: var(--color-text);
  background: var(--color-background);
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
ul { list-style: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* ---- Accessibility ---- */
.skip-link {
  position: absolute; top: -100%; left: 0; z-index: 10;
  padding: var(--space-2) var(--space-4); background: var(--color-secondary); color: var(--color-on-secondary);
  font-weight: var(--type-body-strong-weight);
}
.skip-link:focus { top: 0; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
:focus-visible { outline: 2px solid var(--color-link); outline-offset: 2px; }
h1:focus, main:focus { outline: none; }

/* ---- The six-level type ramp ---- */
.view-heading { font-family: var(--type-page-title-family); font-size: var(--type-page-title-size); font-weight: var(--type-page-title-weight); line-height: 1.15; }
.section-header { font-family: var(--type-section-header-family); font-size: var(--type-section-header-size); font-weight: var(--type-section-header-weight); line-height: 1.25; }
.body-strong { font-size: var(--type-body-strong-size); font-weight: var(--type-body-strong-weight); }
.body { font-size: var(--type-body-size); font-weight: var(--type-body-weight); }
.caption { font-size: var(--type-caption-size); font-weight: var(--type-caption-weight); color: var(--color-text-muted); }
.tabular { font-size: var(--type-tabular-size); font-weight: var(--type-tabular-weight); font-variant-numeric: tabular-nums; }

/* ---- Shell ---- */
.shell { flex: 1; min-height: 0; display: flex; }
.sidebar { display: none; }
#main-content { flex: 1; min-width: 0; overflow-y: auto; overscroll-behavior: contain; }

.view { padding: var(--space-4); max-width: 960px; margin: 0 auto; }
/* `hidden` always wins: an author `display` (e.g. .btn's inline-flex) otherwise beats the
   browser's own [hidden] rule, and Now Playing's Next story and transcript buttons showed
   while hidden (found 2026-10-28). */
[hidden] { display: none !important; }
.view[hidden] { display: none; }
.view > .view-heading, .page-head .view-heading { margin-bottom: var(--space-3); }

.tabbar {
  flex-shrink: 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr);
  border-top: 1px solid var(--color-border); background: var(--color-surface);
}
.tab {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  min-height: 52px; padding: var(--space-1) 0 var(--space-2); text-decoration: none;
  font-size: var(--type-caption-size); color: var(--color-text-muted);
}
.tab svg, .nav-item svg { width: 24px; height: 24px; fill: currentColor; }
.tab.active { color: var(--color-secondary); font-weight: var(--type-body-strong-weight); }

@media (min-width: 768px) {
  .tabbar { display: none; }
  .sidebar {
    display: flex; flex-direction: column; gap: var(--space-1); flex-shrink: 0; width: var(--sidebar-width);
    padding: var(--space-4) var(--space-3); border-right: 1px solid var(--color-border); background: var(--color-surface);
    overflow-y: auto;
  }
  .sidebar-title { font-family: var(--type-section-header-family); font-size: var(--type-section-header-size); font-weight: var(--type-section-header-weight); padding: 0 var(--space-3) var(--space-4); }
  .nav-item {
    display: flex; align-items: center; gap: var(--space-3); min-height: var(--tap); padding: 0 var(--space-3);
    border-radius: var(--radius-control); text-decoration: none; font-weight: var(--type-body-strong-weight);
  }
  .nav-item:hover { background: var(--color-surface-alt); }
  .nav-item.active { background: var(--color-secondary); color: var(--color-on-secondary); }
  .view { padding: var(--space-6) var(--space-8); }
}

/* ---- Buttons and fields ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: var(--tap); padding: 0 var(--space-4);
  font-weight: var(--type-body-strong-weight); font-size: var(--type-body-size);
  border: 1px solid var(--color-border); border-radius: var(--radius-control);
  background: var(--color-background); cursor: pointer; text-decoration: none;
}
.btn svg { width: 20px; height: 20px; fill: currentColor; }
.btn:hover { background: var(--color-surface-alt); }
.btn-primary { background: var(--color-primary); border-color: var(--color-primary); color: var(--color-on-primary); }
.btn-primary:hover { background: var(--color-primary); opacity: 0.86; }
.btn-record { background: var(--color-record); border-color: var(--color-record); color: var(--color-on-record); }
.btn-record:hover { background: var(--color-record); filter: brightness(1.08); }
.btn-accent { background: var(--color-secondary); border-color: var(--color-secondary); color: var(--color-on-secondary); }
.btn-accent:hover { background: var(--color-secondary); filter: brightness(1.08); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--color-link); }
.btn[aria-pressed="true"] { border-color: var(--color-secondary); color: var(--color-secondary); }
.btn-live[aria-pressed="true"] { border-color: var(--color-primary); color: var(--color-primary); }
.btn:disabled { opacity: 0.5; cursor: default; }

.icon-btn {
  display: inline-grid; place-items: center; flex-shrink: 0;
  width: var(--tap); height: var(--tap); border: 0; border-radius: 50%;
  background: transparent; cursor: pointer;
}
.icon-btn svg { width: 24px; height: 24px; fill: currentColor; }
.icon-btn svg text { fill: currentColor; }
.icon-btn:hover:not(:disabled) { background: var(--color-surface-alt); }
.icon-btn:disabled { opacity: 0.35; cursor: default; }
.icon-btn-primary { background: var(--color-primary); color: var(--color-on-primary); }
.icon-btn-primary:hover:not(:disabled) { background: var(--color-primary); opacity: 0.86; }
.icon-btn-lg { width: 64px; height: 64px; }
.icon-btn-lg svg { width: 32px; height: 32px; }
.i-pause { display: none !important; }
.is-playing .i-pause { display: block !important; }
.is-playing .i-play { display: none !important; }
.i-inline { width: 20px; height: 20px; fill: currentColor; }

.field-input {
  width: 100%; min-height: var(--tap); padding: 0 var(--space-3);
  border: 1px solid var(--color-border); border-radius: var(--radius-control);
  background: var(--color-background); font-size: var(--type-body-size);
}
select {
  min-height: var(--tap); padding: 0 var(--space-2); max-width: 100%;
  border: 1px solid var(--color-border); border-radius: var(--radius-control); background: var(--color-background);
}

/* ---- Segmented scope (a season, a library section): a scope, not a push ---- */
.segmented { display: flex; gap: var(--space-1); margin: var(--space-2) 0 var(--space-3); }
.segmented button {
  flex-shrink: 0; min-height: 36px; padding: 0 var(--space-3);
  border: 1px solid var(--color-border); border-radius: 999px; background: var(--color-background);
  font-size: var(--type-tabular-size); font-variant-numeric: tabular-nums; cursor: pointer;
}
.segmented button[aria-pressed="true"] { background: var(--color-text); border-color: var(--color-text); color: var(--color-background); }
.segmented-scroll { overflow-x: auto; scrollbar-width: none; padding-bottom: var(--space-1); }
.segmented-scroll::-webkit-scrollbar { display: none; }

/* ---- States ---- */
.state { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-3); padding: var(--space-4) 0; }
.state[role="status"] { align-items: center; }
.state-problem { padding: var(--space-4); border: 1px solid var(--color-error); border-radius: var(--radius-card); background: var(--color-error-surface); }
.state-problem .body { color: var(--color-error); }
/* Offline is a degraded mode, not a failure: neutral, never the error color. */
.state-offline { border-color: var(--color-border); background: var(--color-surface); }
.state-offline .body { color: var(--color-text); }
.spinner {
  width: 24px; height: 24px; border: 3px solid var(--color-border);
  border-top-color: var(--color-secondary); border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Blocks and shelves ---- */
.block { margin-bottom: var(--space-6); }
.block > .section-header, .block-head { margin-bottom: var(--space-2); }
.block-head > .btn-ghost { margin-right: calc(-1 * var(--space-4)); }
.block-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3); }
.shelf { margin-bottom: var(--space-6); }
.shelf > .section-header { margin-bottom: var(--space-2); }
.rail {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(200px, 72%);
  gap: var(--space-3); overflow-x: auto; scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--space-4); margin-left: calc(-1 * var(--space-4)); margin-right: calc(-1 * var(--space-4)); padding: 0 var(--space-4) var(--space-2);
  scrollbar-width: thin;
}
.rail > li { scroll-snap-align: start; min-width: 0; }
@media (min-width: 768px) {
  .rail { grid-auto-columns: 220px; margin-left: 0; margin-right: 0; padding-left: 0; padding-right: 0; scroll-padding-inline: 0; }
}

/* Person rows (not yet the grammar's): a 56 px tile, the name, one line. */
.series-list > li { border-bottom: 1px solid var(--color-border); }
.series-row:not(.g-row) a { display: flex; align-items: center; gap: var(--space-3); min-height: var(--tap); padding: var(--space-3) 0; text-decoration: none; }
.series-row a:hover .body-strong { text-decoration: underline; }

/* ---- The grammar (WEB-DESIGN §6.4b): one skeleton per object, whatever it carries ---- */
/* The window: one square slot on the print ground with a hairline; the title block on the board. */
.g-window {
  position: relative; display: block; aspect-ratio: 1; overflow: hidden; flex: none;
  border-radius: 4px; background: var(--color-print-ground);
}
.g-window::after { content: ""; position: absolute; top: 0; right: 0; bottom: 0; left: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px var(--color-print-edge); pointer-events: none; }
.g-window[data-fill="block"] { background: var(--genre-board, var(--color-surface-alt)); color: var(--genre-on, var(--color-text)); }
.g-window[data-fill="block"]::after { box-shadow: inset 0 0 0 1px var(--color-print-edge); }
/* Every color-mix() sits in @supports after a plain fallback: the TV build runs Chromium 85 (tools/test_tv_compat.py). */
@supports (color: color-mix(in srgb, red 50%, blue)) { .g-window[data-fill="block"]::after { box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 32%, transparent); } }
.g-window img { position: absolute; display: block; max-width: none; object-fit: fill; }
.g-round { border-radius: 50%; }
/* A person's shows: small tiles under the head board, then the order and the episodes. */
.shelf-after-head { margin-top: var(--space-4); }
.g-rail.g-rail-small { grid-auto-columns: 148px; }
@media (min-width: 768px) { .g-rail.g-rail-small { grid-auto-columns: 160px; } }
.g-window[data-fill="whole"] img { top: 6%; right: 6%; bottom: 6%; left: 6%; width: 88%; height: 88%; object-fit: contain; }
/* The label (§6.4r): drawn from the item's own data (js/label-core.js), filling the window as a picture
   would, with the picture's hairline edge; its colors are the token variables the spec names. */
.lb { display: block; width: 100%; height: 100%; }
.lb text { font-weight: 700; }
.lb .lb-display { font-family: var(--font-display); }
.lb .lb-body { font-family: var(--font-body); }
.lb-overlay { position: absolute; top: 0; left: 0; pointer-events: none; }
.g-window[data-art="label"]::after { box-shadow: inset 0 0 0 1px var(--color-print-edge); }
/* The run strip: the broadcast years on the fixed 1930 to 1962 axis, in the board's one color. */
.g-strip { display: block; width: 100%; height: 18px; color: inherit; }
.g-strip rect { fill: currentColor; }
.g-axis { stroke: currentColor; stroke-opacity: 0.3; stroke-width: 1px; vector-effect: non-scaling-stroke; }

/* The show tile: tiles in one shelf share their slot tracks, so every name, strip and fact line sits on one line. */
.g-rail { grid-template-rows: repeat(4, auto); row-gap: 0; }
.g-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); grid-auto-rows: auto;
  column-gap: var(--space-3); row-gap: 0; padding: 0; margin: 0; list-style: none;
}
.g-grid > .g-tile-li { margin-bottom: var(--space-3); }
.g-tile-li { grid-row: span 4; display: grid; grid-template-rows: subgrid; }
.g-tile {
  grid-row: span 4; display: grid; grid-template-rows: subgrid; row-gap: 6px; padding: 6px 6px 10px;
  border-radius: var(--radius-card); background: var(--genre-board, var(--color-surface-alt));
  color: var(--genre-on, var(--color-text)); text-decoration: none;
}
.g-tile:hover { filter: brightness(1.08); }
.g-name {
  align-self: start; padding: 0 4px; font-family: var(--font-display); font-weight: var(--type-section-header-weight);
  font-size: var(--type-section-header-size); line-height: 1.05; text-transform: uppercase;
  text-wrap: balance; overflow-wrap: normal; word-break: normal; hyphens: manual;
}
.g-name[data-step="1"] { font-size: var(--type-body-strong-size); }
.g-name[data-step="2"] { font-size: var(--type-caption-size); }
.g-tile .g-strip { align-self: end; padding: 0 4px; box-sizing: content-box; width: calc(100% - 8px); }
.g-facts { display: flex; flex-direction: column; padding: 0 4px; color: inherit; }

/* Home and Browse (WEB-DESIGN §6.4c): tiles in a grid whose rows share their slot tracks, the day board, the decade field. */
.nw { white-space: nowrap; }
.g-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 0 var(--space-3); grid-auto-rows: auto; margin-bottom: var(--space-3); }
.g-grid > .g-tile-li { margin-bottom: var(--space-3); }
.g-tile-li, .g-tile, .g-name, .g-facts > span { min-width: 0; }
.g-day { margin-bottom: var(--space-6); padding: var(--space-4); border-radius: var(--radius-card); background: var(--color-surface-alt); }
.g-day-date { margin: 0 0 var(--space-1); }
.g-years-wrap { margin-top: var(--space-3); }
.g-years { display: block; width: 100%; height: 64px; overflow: visible; }
.g-yr { cursor: pointer; outline: none; }
.g-yr-hit { fill: transparent; }
.g-yr-bar { fill: var(--genre-accent); }
.g-yr-bar[data-genre=""] { fill: var(--color-text-muted); }
/* Home's day board draws in one ink (§4.2r rule 6): every bar muted text, the chosen year's in text. */
.g-day .g-yr-bar { fill: var(--color-text-muted); }
.g-day .g-yr[aria-checked="true"] .g-yr-bar { fill: var(--color-text); }
.g-yr-zero { fill: var(--color-text-muted); opacity: 0.5; }
.g-yr-sel { fill: none; stroke: var(--color-text); stroke-width: 1.5px; vector-effect: non-scaling-stroke; display: none; }
.g-yr[aria-checked="true"] .g-yr-sel { display: inline; }
.g-yr:focus-visible .g-yr-sel { display: inline; }
.g-axis-labels { display: flex; justify-content: space-between; margin-top: var(--space-1); }
.g-legend { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-3); margin: var(--space-3) 0 0; padding: 0; list-style: none; }
.g-legend li, .g-field-label { display: inline-flex; align-items: center; gap: var(--space-1); white-space: nowrap; }
.g-legend i, .g-field-label i { width: 10px; height: 10px; border-radius: 2px; background: var(--genre-accent); flex: none; }
.g-count { font-family: var(--font-display); font-weight: var(--type-section-header-weight); font-size: var(--type-section-header-size); }
#browse-count { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-1) var(--space-3); margin-bottom: var(--space-3); }
.g-browse { display: block; }
.g-az { display: flex; flex-wrap: wrap; gap: 2px; margin: 0 0 var(--space-3); }
.g-az-link { display: inline-flex; align-items: center; justify-content: center; min-width: 36px; min-height: 36px; padding: 0 var(--space-1);
  border-radius: 4px; color: var(--color-text); text-decoration: none; font-family: var(--font-display); font-weight: 700; }
.g-az-link:hover { background: var(--color-surface-alt); }
.g-grid > li { scroll-margin-top: var(--space-4); }
.g-field-sec { margin-bottom: var(--space-6); }
.g-field { display: grid; grid-template-columns: minmax(0, 96px) repeat(var(--n), minmax(0, 1fr)); align-items: end; gap: var(--space-2) 0; }
.g-field-label { white-space: normal; align-items: center; }
.g-field-head { text-align: center; }
.g-field-cell { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 2px; min-height: 44px; color: inherit; text-decoration: none; border-radius: 4px; }
a.g-field-cell:hover { background: var(--color-surface-alt); }
.g-field-cell[aria-current="true"] { outline: 2px solid var(--color-text); outline-offset: 1px; }
.g-field-mark { display: block; background: var(--genre-accent); border-radius: 2px; }
@media (min-width: 1024px) {
  .g-browse.has-field { display: grid; grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); gap: var(--space-6); align-items: start; }
  .g-browse.has-field .g-field-sec { position: sticky; top: var(--space-4); margin-bottom: 0; }
}

/* The head board: built in D3-1, adopted by the pages in D3-3. */
.g-head {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--space-3); padding: var(--space-3);
  border-radius: var(--radius-card); background: var(--genre-board, var(--color-surface-alt)); color: var(--genre-on, var(--color-text));
}
.g-head > .g-window { width: 96px; }
@media (min-width: 600px) { .g-head > .g-window { width: 128px; } }
@media (min-width: 1024px) { .g-head > .g-window { width: 176px; } }
.g-head-text { display: flex; flex-direction: column; justify-content: center; gap: var(--space-1); min-width: 0; }
.g-kicker { color: inherit; text-transform: uppercase; letter-spacing: 0.08em; }
.g-head-name {
  font-family: var(--font-display); font-weight: var(--type-page-title-weight); font-size: var(--type-page-title-size);
  line-height: 1.05; text-transform: uppercase; text-wrap: balance; overflow-wrap: normal; hyphens: manual;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden;
}
.g-head-name[data-step="1"] { font-size: var(--type-section-header-size); }
.g-head-name[data-step="2"] { font-size: var(--type-body-strong-size); }
.g-head-facts { color: inherit; }
.g-head-strip { grid-column: 1 / -1; height: 32px; }
@media (min-width: 600px) { .g-head-strip { height: 40px; } }
.g-kicker-link { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.g-kicker-link:hover { text-decoration-thickness: 2px; }
.g-head-link { text-decoration: none; }
.g-head-link .g-head-name { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.g-head-link:hover .g-head-name { text-decoration-thickness: 2px; }
.g-head-link:hover { filter: brightness(1.06); }
/* An item page's head (WEB-DESIGN 6.4g): Home's hero geometry. The window spans the board's top on a phone
   and is a 320 px column beside the words from 600 px; a picture keeps its own shape (a wide one stays a
   plate over the words at every width, its height capped, sitting at the start of the board). */
.g-head-hero { grid-template-columns: minmax(0, 1fr); gap: 0; padding: 0; overflow: hidden; }
.g-head-art { display: block; min-width: 0; }
.g-head-hero .g-head-art > .g-window { width: 100%; border-radius: 0; }
/* A cap that would leave a strip of board under 15% of its width is lifted (6.4g rule 2): the second
   term of max() is huge exactly when the capped width reaches 85% of the board. */
.g-head-hero .g-head-art > .g-shaped { --cap: calc(400px * var(--a)); width: min(100%, max(var(--cap), (var(--cap) - 85%) * 9999)); }
.g-head-hero[data-shape="wide"] .g-head-art > .g-shaped { --cap: calc(360px * var(--a)); }
.g-head-hero > .g-head-text { padding: var(--space-4) var(--space-4) 0; }
.g-head-hero > .g-head-strip { width: calc(100% - 2 * var(--space-4)); margin: var(--space-3) var(--space-4) var(--space-4); }
.g-head-hero > .g-head-text:last-child { padding-bottom: var(--space-4); }
.g-window.g-shaped { aspect-ratio: var(--a); background: var(--color-print-ground); }
.g-window.g-shaped img { position: static; width: 100%; height: 100%; object-fit: cover; }
.g-head-hero .g-head-art > .g-window.g-round { width: calc(100% - 2 * var(--space-4)); margin: var(--space-4) auto 0; border-radius: 50%; }
#drama-body > .actions { margin-bottom: var(--space-4); }
.g-strip.has-mark rect { opacity: 0.45; }
.g-strip.has-mark rect.on { opacity: 1; }
@media (min-width: 600px) {
  .g-head-hero:not([data-shape="wide"]) { grid-template-columns: auto minmax(0, 1fr); grid-template-rows: 1fr auto; }
  .g-head-hero:not([data-shape="wide"]) > .g-head-art { grid-row: 1 / span 2; align-self: start; }
  .g-head-hero .g-head-art > .g-window { width: 320px; }
  .g-head-hero .g-head-art > .g-shaped { width: min(320px, calc(400px * var(--a))); }
  .g-head-hero > .g-head-text { padding: var(--space-6) var(--space-6) 0; align-self: center; }
  .g-head-hero > .g-head-text:last-child { padding-bottom: var(--space-6); }
  .g-head-hero > .g-head-strip { width: calc(100% - 2 * var(--space-6)); margin: var(--space-3) var(--space-6) var(--space-6); align-self: end; }
  .g-head-hero:not([data-shape="wide"]) > .g-head-strip { grid-column: 2; }
  .g-head-hero[data-shape="wide"] .g-head-art > .g-shaped { --cap: calc(440px * var(--a)); width: min(100%, max(var(--cap), (var(--cap) - 85%) * 9999)); }
  .g-head-hero .g-head-art > .g-window.g-round { width: 288px; margin: var(--space-4); }
}
@media (min-width: 1024px) { .g-head-hero .g-head-name[data-step="1"] { font-size: var(--type-page-title-size); } }
/* The episode page's show row, and a series' further pictures, one height, each with its credit under it. */
.ep-show { margin: var(--space-2) 0; border-top: 1px solid var(--color-border); }
.g-gallery-list { list-style: none; margin: 0; padding: 0 0 var(--space-2); display: flex; gap: var(--space-3); overflow-x: auto; scroll-snap-type: x proximity; }
.g-gallery-list > li { flex: none; scroll-snap-align: start; }
.g-gallery-fig { margin: 0; display: table; }
.g-gallery-fig > .g-shaped { height: 160px; width: auto; }
.g-gallery-fig > figcaption { display: table-caption; caption-side: bottom; margin-top: var(--space-1); color: var(--color-text-muted); overflow-wrap: anywhere; }
@media (min-width: 600px) { .g-gallery-fig > .g-shaped { height: 200px; } }
.pl-open.pl-open-hero { padding: var(--space-5, 20px); gap: var(--space-3); font-size: var(--type-body-size); }
.pl-open-hero .pl-open-sp:first-child b { padding-right: 0; }
.pl-open-hero .pl-open-said, .pl-open-hero .pl-open-sp:last-of-type .pl-open-said { -webkit-line-clamp: 3; line-clamp: 3; }
/* Whole speeches only: one that does not fit above the foot takes a second column, off the page. */
.pl-open-hero.pl-open-foot { padding-bottom: 16%; }
.pl-open.pl-open-hero { flex-wrap: wrap; align-content: flex-start; column-gap: 48px; }
.pl-open-hero .pl-open-sp { flex: none; width: 100%; }

/* Series and episode pages (WEB-DESIGN 6.4d): one button row that never wraps apart. Play and Follow take
   the room; the others fold to their icons when the row is under 480 px, and keep their label as the name. */
.actions-one { flex-wrap: nowrap; container-type: inline-size; margin-bottom: var(--space-4); }
.actions-start { padding-top: 0; }
.g-event-line + .actions-one, .ep-heading + .actions-one { margin-top: var(--space-1); }
.versions { margin-top: var(--space-6); }
.actions-one .btn { flex: none; white-space: nowrap; }
.actions-one .btn-play, .actions-one .btn-follow { flex: 1 1 auto; min-width: 0; }
@container (min-width: 480px) { .actions-one .btn-play, .actions-one .btn-follow { flex: none; } }
@container (max-width: 479px) {
  .actions-one .btn-fold { width: var(--tap); padding: 0; }
  .actions-one .btn-fold .btn-lab { display: none; }
}
.actions-start .start-drama { display: flex; flex-wrap: wrap; flex: 1 1 auto; gap: var(--space-2); min-width: 0; }
.actions-start .start-drama .btn { flex: 1 1 auto; }
.ep-heading { margin-top: var(--space-4); margin-bottom: var(--space-1); text-wrap: balance; }
.g-event-line { display: block; color: var(--color-text-muted); }
.photo-credits { margin-top: var(--space-2); }

/* On the air: the cast as faces, each in a 72 px round window, the name under it. */
.g-faces { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: var(--space-4) var(--space-2); }
.g-face { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; color: inherit; text-decoration: none; min-width: 0; }
.g-face > .g-window { width: 72px; border-radius: 50%; }
.g-face-name { font-weight: 600; text-wrap: balance; overflow-wrap: normal; color: var(--color-text); }
.g-face-role { color: var(--color-text-muted); text-wrap: balance; }
a.g-face:hover .g-face-name { text-decoration: underline; }
.booklet { margin: var(--space-6) 0; border-top: 1px solid var(--color-border); border-bottom: 1px solid var(--color-border); }
.booklet > summary { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); min-height: 52px; cursor: pointer; font-weight: var(--type-body-strong-weight); list-style: none; }
.booklet > summary::-webkit-details-marker { display: none; }
.booklet > summary .caption { color: var(--color-text-muted); }
.booklet + .booklet { margin-top: calc(-1 * var(--space-6)); border-top: 0; }
.booklet[open] > summary { border-bottom: 1px solid var(--color-border); margin-bottom: var(--space-2); }

/* The row: 64 px whatever it carries; a 48 px visual, the title, the sub line, the length, Play. */
.g-row { display: flex; align-items: center; gap: var(--space-2); min-height: 64px; border-bottom: 1px solid var(--color-border); }
.g-link { flex: 1; min-width: 0; display: flex; align-items: center; gap: var(--space-3); min-height: 64px; padding: var(--space-2) 0; text-decoration: none; color: inherit; }
.g-link > .g-window, .g-link > .g-date { width: 48px; height: 48px; }
.g-text { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 2px; }
.g-link:hover .ep-title { text-decoration: underline; }
.g-len { flex: none; color: var(--color-text-muted); }
.g-row .g-play { width: 36px; height: 36px; min-width: 36px; min-height: 36px; }
.g-event { overflow-wrap: anywhere; }
/* The date block: the month and year in small caps over the day, on the series' board. */
.g-date {
  flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  border-radius: 4px; background: var(--genre-board, var(--color-surface-alt)); color: var(--genre-on, var(--color-text));
  line-height: 1;
}
.g-date-small { font-size: var(--type-caption-size); font-variant-caps: all-small-caps; letter-spacing: 0.04em; white-space: nowrap; }
.g-date-small:empty { display: none; }
.g-date-big { font-family: var(--font-display); font-weight: 700; font-size: var(--type-page-title-size); }
.g-date-big[data-len="3"], .g-date-big[data-len="4"] { font-size: var(--type-section-header-size); }
.g-date-big[data-len="5"], .g-date-big[data-len="6"] { font-size: var(--type-body-strong-size); }

/* ---- Episode rows: date first (R1), set in tabular figures ---- */
.ep-list { margin-bottom: var(--space-3); }
.ep-row { display: flex; align-items: center; gap: var(--space-2); border-bottom: 1px solid var(--color-border); }
.ep-title { overflow-wrap: anywhere; }
/* Search's transcript match: the line as said, verbatim (WEB-DESIGN §4.6). */
.ep-quote { margin-top: var(--space-1); color: var(--color-text); font-style: italic; overflow-wrap: anywhere; }
.ep-progress { display: block; height: 3px; margin-top: var(--space-1); border-radius: 2px; background: var(--color-surface-alt); }
.ep-progress > span { display: block; height: 100%; border-radius: 2px; background: var(--color-primary); }
.row-tools { display: flex; }
/* The queue row carries four controls: on a phone they take their own line so the date and title keep the row. */
@media (max-width: 599px) {
  .ep-row-queue { flex-wrap: wrap; }
  .ep-row-queue .ep-link { flex: 1 1 100%; }
  .ep-row-queue .ep-link + * { margin-left: auto; }
}

/* ---- Art (§6.4, Decision 069): a served portrait, else the typographic card ---- */
:root { --tile: 56px; }
.art-tile {
  position: relative; display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: var(--tile); height: var(--tile); overflow: hidden; border-radius: var(--radius-control);
  background: var(--color-surface-alt); box-shadow: inset 0 -3px 0 var(--genre-accent);
}
.art-letter { font-family: var(--type-section-header-family); font-size: var(--type-section-header-size); font-weight: var(--type-section-header-weight); line-height: 1; color: var(--genre-accent); }
.art-tile[data-genre=""] .art-letter { color: var(--color-text-muted); }
.art-tile img {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 20%;
}
.art-tile.has-img .art-letter { visibility: hidden; }
.series-row-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }

/* A picture in a box of its own shape (§6.4a, artwork-presentation-design): an archival print's
   hairline and the control radius, the genre's edge under it, and nothing behind it. While it
   loads the box is the surface at exactly the picture's size; --a is its width over height. */
.art-frame {
  position: relative; display: block; overflow: hidden; flex: none;
  border: 1px solid var(--color-border); border-radius: var(--radius-control);
  background: var(--color-surface-alt);
}
.art-frame::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--genre-accent); }
.art-frame img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 20%; }

/* A page's face. Upright (a square included): the print beside the heading, its caption under it
   at the picture's width; the actions run under both. Wide: the plate above the heading. */
.page-head.has-face { border-left: 0; padding-left: 0; }
.page-head.face-print {
  display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: var(--space-3); align-items: start;
}
.page-head.face-print > .face-fig { grid-row: 1 / span 2; grid-column: 1; }
.page-head.face-print > .page-head-text { grid-column: 2; margin-top: 0; }
.page-head.face-print > .actions { grid-column: 1 / -1; }
.face-fig { margin: 0; }
.face-print .face-fig { display: table; }
.face-print .face-fig figcaption { display: table-caption; caption-side: bottom; }
.face-print .art-frame {
  --h: min(168px, calc(40vw / var(--a)));
  height: var(--h); width: calc(var(--h) * var(--a));
}
@media (min-width: 768px) { .face-print .art-frame { --h: min(240px, calc(30vw / var(--a))); } }
.face-plate .face-fig { margin-bottom: var(--space-3); }
.face-plate .art-frame { width: min(100%, calc(320px * var(--a))); height: auto; aspect-ratio: var(--a); }
.face-fig figcaption { margin-top: var(--space-1); overflow-wrap: anywhere; }
.face-credit { color: var(--color-link); }
/* No face: the series page's head is drawn as its typographic card (§6.4a), the name on the genre. */
.page-head.as-card {
  display: flex; flex-direction: column; justify-content: flex-end; min-height: 200px;
  padding: var(--space-6) var(--space-4) var(--space-4); border-left-width: 8px;
  border-radius: var(--radius-card); background: var(--color-surface-alt);
}
.page-head.as-card > .page-head-text { flex: none; }
@media (min-width: 768px) { .page-head.as-card { min-height: 240px; } }
.page-head-text { min-width: 0; flex: 1; }
.page-head-text > * + * { margin-top: var(--space-1); }
.page-head.has-face > .actions { margin-top: var(--space-3); }
.photo-credits a { color: var(--color-link); }

/* Now Playing's picture (D3-4): the grammar's window, square and no taller than 44 % of the screen,
   so Play stays on a phone's first screen; the show's picture, its star's, else the title block. */
.np-art:empty { display: none; }
.np-credit { display: block; margin-top: var(--space-1); text-align: center; }
.np-art { margin-bottom: var(--space-3); }
.np-art .np-window { width: min(100%, 36vh); width: min(100%, 36dvh); margin: 0 auto; border-radius: var(--radius-card); }

/* Period radios (Decision 094, WEB-DESIGN §5.11, RADIOS-DESIGN §4.2): radio mode. js/app.js sets --rh (the set's
   height in px, the largest that fits the screen less its gutter) and .radio-mode on the dialog; under 240 px the
   picture returns. The chrome (.np-chrome) is laid over the set and fades with .chrome-off; the set never moves. */
.np-art.has-radio { display: none; }
.np-radio-set:not([hidden]) { display: flex; justify-content: center; margin-bottom: var(--space-3); }
.radio-set { position: relative; container-type: inline-size; aspect-ratio: var(--ar); height: var(--rh, 300px); touch-action: none;
  -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
.radio-art { display: block; width: 100%; height: 100%; overflow: visible; isolation: isolate; }
.radio-controls { position: absolute; inset: 0; }
.rx-ctl { position: absolute; left: var(--x); top: var(--y); width: max(44px, var(--w)); height: max(44px, var(--h)); transform: translate(-50%, -50%);
  margin: 0; padding: 0; border: 0; border-radius: 50%; background: none; color: inherit; cursor: grab; }
.rx-ctl:active { cursor: grabbing; }
button.rx-ctl { border-radius: 10px; cursor: pointer; }
.rx-eye, .rx-clock { cursor: default; }
.rx-ctl:focus-visible, .rx-ctl:has(:focus-visible) { outline: 3px solid var(--color-link); outline-offset: 2px; }
.rx-t { font-family: var(--font-body); font-weight: 600; letter-spacing: 0.02em; }
.rx-display { font-family: var(--font-display); }
.rx-dial { font-family: "Dial Gothic", var(--font-body); font-weight: 400; }
.rx-dial-geo { font-family: "Dial Geometric", var(--font-body); font-weight: 500; }
@media (prefers-reduced-motion: no-preference) { .radio-set { animation: rx-in 250ms ease-out; } }
@keyframes rx-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-contrast: more) { .rx-ctl:focus-visible, .rx-ctl:has(:focus-visible) { outline-width: 6px; } }
@media (forced-colors: active) { .np-art.has-radio { display: block; } .np-radio-set:not([hidden]) { display: none; } }
.now-playing.radio-mode {
  width: 100%; max-width: 100%; height: 100%; max-height: 100%; margin: 0; padding: 0; border: 0; border-radius: 0; overflow: hidden;
  color-scheme: dark;
  background: radial-gradient(ellipse 46% 9% at var(--pool-x, 50%) var(--pool-y, 80%), var(--color-radio-pool), transparent),
    radial-gradient(ellipse 60% 50% at 50% 50%, color-mix(in srgb, var(--color-radio-pool) 55%, transparent), transparent 80%) var(--color-radio-surround);
  --color-text: var(--color-radio-ink); --color-text-muted: var(--color-radio-ink-muted); --color-link: var(--color-radio-ink);
  --color-primary: var(--color-radio-ink); --color-on-primary: var(--color-radio-surround); --color-secondary: var(--color-radio-ink);
  --color-surface-alt: var(--color-radio-raised); --color-border: var(--color-radio-raised); color: var(--color-text);
}
.now-playing.radio-mode::backdrop { background: var(--color-radio-surround); opacity: 1; }
.radio-mode .np-inner { position: relative; display: block; max-width: none; height: 100%; padding: 0; }
.radio-mode .np-art, .radio-mode .np-verbs, .radio-mode #np-next, .radio-mode #np-story, .radio-mode .np-people { display: none; }
/* Nothing of the chrome lies over the set (§4.2 rule 4): js/app.js gives the set the room the chrome leaves, a block
   at the bottom (stacked) or a band at the right (.chrome-side), and the whole screen when the chrome fades. */
.radio-mode .np-radio-set:not([hidden]) { position: absolute; inset: var(--rtop, 0) var(--rright, 0) var(--rbottom, 0) 0; padding: var(--rpad, 0);
  align-items: var(--ralign, center); margin: 0; }
.radio-mode.set-tucked .np-radio-set { visibility: hidden; }
.radio-mode .np-top { position: absolute; top: 0; left: 0; right: 0; z-index: 2; margin: 0; padding: var(--space-2) var(--space-4); }
.radio-mode .np-panel { position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; display: flex; flex-direction: column; gap: var(--space-1);
  padding: var(--space-2) max(var(--space-4), calc((100% - 520px) / 2)) var(--space-4); }
/* The side band starts at the top but sits under the header strip (z-index 2), or it swallows the Radio menu's clicks (2026-12-03). */
.radio-mode.chrome-side .np-panel { left: auto; top: 0; width: min(400px, 40%); justify-content: center; padding: var(--space-8) var(--space-6) var(--space-4) 0; }
.radio-mode .seek { margin-top: 0; }
.radio-mode .np-controls { margin: 0; }
.radio-mode .np-chrome { transition: opacity 300ms ease, visibility 0s linear 0s; }
.radio-mode.chrome-off .np-chrome { opacity: 0; visibility: hidden; transition: opacity 300ms ease, visibility 0s linear 300ms; }
.radio-mode.chrome-off { cursor: none; }
.lib-radio-choices { display: grid; gap: var(--space-1); margin: 0 0 var(--space-3); padding: 0 0 0 calc(20px + var(--space-2)); border: 0; }
.lib-radio-choices label { display: flex; align-items: center; gap: var(--space-2); min-height: var(--tap); }
.np-meta { margin: 0; text-align: left; }
.np-series { color: var(--color-link); text-decoration: none; }
.mini-window { flex: none; width: 40px; height: 40px; margin-right: var(--space-2); }
.mini-window > .g-window { width: 40px; height: 40px; }
.type-card {
  display: flex; flex-direction: column; justify-content: flex-end; gap: var(--space-1);
  width: min(200px, 52vw); aspect-ratio: 1; padding: var(--space-4);
  border-radius: var(--radius-card);
  background: var(--genre-board, var(--color-surface-alt)); color: var(--genre-on, var(--color-text));
}
.type-card .caption { color: inherit; }
.type-card-name { font-family: var(--type-page-title-family); font-size: var(--type-page-title-size); font-weight: var(--type-page-title-weight); line-height: 1.15; overflow-wrap: anywhere; }

/* ---- Radio: an evening's schedule on the one clock (R9, R10) ---- */
.radio-head { margin-bottom: var(--space-4); }
.radio-head > * + * { margin-top: var(--space-1); }
.radio-head .radio-year { flex-direction: row; align-items: center; gap: var(--space-2); }
.radio-head .radio-year select { width: auto; }
.slots { margin-bottom: var(--space-3); border-top: 1px solid var(--color-border); }
/* A slot is a grammar row on the evening's clock; the one on now takes the ink pill, not a stripe. */
.slot-now, .station-live { background: var(--color-surface); }
.slot-now .g-link, .station-live .g-link { padding-left: var(--space-2); }
.slot-gap .g-window { opacity: 0.6; }
.slot-run { list-style: none; border-bottom: 1px solid var(--color-border); }
.slot-run summary { list-style: none; }
.slot-run summary::-webkit-details-marker { display: none; }
.slot-run .run-line::after { content: '\25BE'; margin-left: auto; }
.slot-run details[open] > .run-line::after { content: '\25B4'; }
.slot-run .run-line { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); min-height: var(--tap); cursor: pointer; color: var(--color-text-muted); }
.slot-run .slots { margin: 0; }
.slot-gap .g-text > .body-strong, .slot-gap .g-event { color: var(--color-text-muted); }
.g-now {
  flex: none; padding: 2px var(--space-2); border-radius: 999px; background: var(--color-primary);
  color: var(--color-on-primary); font-size: var(--type-caption-size); font-weight: var(--type-body-strong-weight);
}
.slot .g-event, .station .g-event { overflow-wrap: anywhere; }
.witness { padding-bottom: var(--space-6); }
.stations { margin-bottom: var(--space-6); border-top: 1px solid var(--color-border); }
.station > .station-go { flex: none; }
.station-tap { cursor: pointer; }
.station-tap .g-link { cursor: pointer; }
.station-go { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); flex: none; width: 36px; height: 36px; min-width: 36px; padding: 0; border: 1.5px solid var(--color-text); border-radius: 999px; background: transparent; color: var(--color-text); cursor: pointer; }
.station-go svg { width: 18px; height: 18px; fill: currentColor; }
.station-go-on { background: var(--color-text); color: var(--color-bg); width: auto; padding: 0 var(--space-2); }
.station-go-lab { display: none; font-size: var(--type-caption-size); font-weight: var(--type-body-strong-weight); white-space: nowrap; }
.station-go-on:not(:has(.station-go-lab)) { width: 36px; }
@media (min-width: 768px) { .station-go-on .station-go-lab { display: inline; } .station-go-on { padding: 0 var(--space-3) 0 var(--space-2); } }
.station-go-on svg { flex: none; }
.witness a { color: var(--color-link); }

/* ---- Filters ---- */
.filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2) var(--space-3); margin-bottom: var(--space-3); }
.filter { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.filter select { width: 100%; }
.filter-check { display: flex; align-items: center; gap: var(--space-2); min-height: var(--tap); align-self: end; padding: 0 var(--space-2); cursor: pointer;
  border: 1px solid var(--color-border); border-radius: var(--radius-control); background: var(--color-background); }
.filter-check:has(input:checked) { border-color: var(--color-text); background: var(--color-surface-alt); }
.filter-check input { width: 20px; height: 20px; margin: 0; accent-color: var(--color-secondary); }
@media (min-width: 768px) { .filters { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* ---- Surprise (WEB-DESIGN §4.13): three picks, each one tap from playing ---- */
.picks { display: grid; gap: var(--space-3); }
.pick { display: flex; flex-direction: column; min-width: 0; }
.pick .section-header { margin-bottom: var(--space-2); }
.pick .actions { margin-top: var(--space-3); }
.pick .g-head { flex: 1; align-content: start; }
@media (min-width: 768px) and (max-width: 1023px) { .pick .g-head > .g-window { width: 96px; } }
@media (min-width: 768px) { .picks { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.search-form { margin-bottom: var(--space-4); }

/* ---- Series page and Detail ---- */
.page-head { margin-bottom: var(--space-4); padding-left: var(--space-3); border-left: 4px solid var(--genre-accent); }
.page-head > * + * { margin-top: var(--space-1); }
.page-head .caption a { color: var(--color-link); }
.eyebrow-link { display: inline-block; text-decoration: none; color: var(--color-link); }
.eyebrow-link:hover { text-decoration: underline; }
.actions { display: flex; flex-wrap: wrap; gap: var(--space-2); padding-top: var(--space-3); }

.credit { padding: var(--space-2) 0; }
.credit dd { padding: 1px 0; }
@media (min-width: 768px) {
  .credit { display: grid; grid-template-columns: 10rem minmax(0, 1fr); column-gap: var(--space-4); }
  .credit dt { grid-column: 1; grid-row: 1 / span 40; padding-top: 3px; }
  .credit dd { grid-column: 2; }
}

.versions { border: 0; margin-bottom: var(--space-4); }
.versions legend { margin-bottom: var(--space-2); }
.version {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--space-3);
  padding: var(--space-2) 0; border-bottom: 1px solid var(--color-border);
}
.version input { width: 20px; height: 20px; accent-color: var(--color-secondary); }
.version label { display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; cursor: pointer; }
.version a { min-height: var(--tap); display: inline-flex; align-items: center; color: var(--color-link); }
.rights { padding-bottom: var(--space-6); }
.transcript > summary { display: list-item; cursor: pointer; }
.transcript-text { white-space: pre-line; max-width: 68ch; user-select: text; }

/* ---- Plays: pass the phone (WEB-DESIGN §4.10) ---- */
.play-list { border-top: 1px solid var(--color-border); }
.play-row { padding: var(--space-3) 0; border-bottom: 1px solid var(--color-border); }
.play-link { display: flex; flex-direction: column; gap: 2px; min-height: var(--tap); justify-content: center; text-decoration: none; }
.play-link:hover .body-strong { text-decoration: underline; }
.play-remote { background: none; border: 0; padding: 0; color: inherit; font: inherit; text-align: start; cursor: pointer; width: 100%; }
.play-rights { overflow-wrap: anywhere; }
.play-rights a, .read-along a { color: var(--color-link); }
.refusal { color: var(--color-error); }
.btn-destructive { color: var(--color-error); border-color: var(--color-error); background: transparent; }
.change-lines > summary { cursor: pointer; }
.change-row { padding: var(--space-3) 0; border-bottom: 1px solid var(--color-border); }
.change-row .take-row { align-items: center; }
.archive-failed .actions { margin-top: var(--space-2); }
.refusal:empty { display: none; }
.cast-progress { margin-bottom: var(--space-3); }
.cast-list { border-top: 1px solid var(--color-border); margin-bottom: var(--space-3); }
.cast-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); padding: var(--space-2) 0; border-bottom: 1px solid var(--color-border); }
.cast-main { flex: 1 1 12rem; min-width: 0; display: flex; flex-direction: column; gap: 2px; min-height: var(--tap); justify-content: center; text-decoration: none; overflow-wrap: anywhere; }
.cast-main:hover .body-strong { text-decoration: underline; }
.cast-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-left: auto; }
.cast-actions:has(.take-form) { flex: 1 1 18rem; }
.take-form { display: flex; flex-wrap: wrap; gap: var(--space-2); width: 100%; }
.take-form .field-input { flex: 1 1 8rem; width: auto; min-width: 0; }
.listen { margin-top: var(--space-4); }
.listen > * + * { margin-top: var(--space-2); }
.mix-audio { display: block; width: 100%; }
/* Phase 2: a production shared through the Worker (WEB-DESIGN §4.10a) */
.share-box { margin-top: var(--space-3); }
.share-box > * + * { margin-top: var(--space-2); }
.share-box .take-form { max-width: 32rem; }
.consent { margin-top: var(--space-4); }
.consent-text { max-width: 68ch; padding: var(--space-3) 0; }
.consent-text p + p, .consent-text p + ul { margin-top: var(--space-2); }
.consent-list { list-style: disc; padding-left: var(--space-6); }
.consent-list li + li { margin-top: var(--space-2); }
.report-form { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); flex: 1 1 100%; }
.report-form .field-input { flex: 1 1 10rem; width: auto; min-width: 0; }
.report-form .refusal { flex: 1 1 100%; }
.invite-slot:not(:empty) { margin-top: var(--space-2); }
.invite-slot .caption { margin-top: var(--space-1); }
.class-code { font-variant-numeric: tabular-nums; letter-spacing: 0.08em; }
.class-form { max-width: 32rem; margin-top: var(--space-3); }
.class-code-input { font-variant-numeric: tabular-nums; letter-spacing: 0.08em; text-transform: uppercase; }
.read-along .take-row { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-1); }
.read-along { list-style: none; margin-top: var(--space-3); }
.read-along > li { padding: var(--space-2) 0; border-bottom: 1px solid var(--color-border); }
.script-line { max-width: 68ch; }
.line-role { letter-spacing: 0.02em; }
.line-text { overflow-wrap: anywhere; }
.line-aside { font-style: italic; color: var(--color-text-muted); }
.line-dim { opacity: 0.55; }
.take-row .tabular { flex: 1; }
.take-chosen svg { width: 24px; height: 24px; fill: var(--color-secondary); }

/* ---- Making in direction D (WEB-DESIGN §4.10b): a play on the drama board, the cast as faces and marks,
   the recorder in three modes (owner ruling 4). Red only while the microphone is armed or open (Decision 064);
   no card-edge stripes; your line's box is your part's board, the partner's cue card the page's surface. ---- */
.btn-way { color: var(--color-secondary); }
.btn-way:hover { background: var(--color-surface-alt); }
.btn-again { border-color: var(--color-record); color: var(--color-record); background: transparent; }
.btn-again .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--color-record); flex: none; }
[data-hue="mystery"] { --hue: var(--color-genre-mystery); --on-hue: var(--color-on-genre-mystery); --board: var(--color-board-mystery); --on-board: var(--color-on-board-mystery); }
[data-hue="scifi"] { --hue: var(--color-genre-scifi); --on-hue: var(--color-on-genre-scifi); --board: var(--color-board-scifi); --on-board: var(--color-on-board-scifi); }
[data-hue="western"] { --hue: var(--color-genre-western); --on-hue: var(--color-on-genre-western); --board: var(--color-board-western); --on-board: var(--color-on-board-western); }
[data-hue="serial"] { --hue: var(--color-genre-serial); --on-hue: var(--color-on-genre-serial); --board: var(--color-board-serial); --on-board: var(--color-on-board-serial); }
[data-hue="documentary"] { --hue: var(--color-genre-documentary); --on-hue: var(--color-on-genre-documentary); --board: var(--color-board-documentary); --on-board: var(--color-on-board-documentary); }
[data-hue="comedy"] { --hue: var(--color-genre-comedy); --on-hue: var(--color-on-genre-comedy); --board: var(--color-board-comedy); --on-board: var(--color-on-board-comedy); }
[data-hue="news"] { --hue: var(--color-genre-news); --on-hue: var(--color-on-genre-news); --board: var(--color-board-news); --on-board: var(--color-on-board-news); }
[data-hue="none"] { --hue: var(--color-text-muted); --on-hue: var(--color-background); --board: var(--color-surface-alt); --on-board: var(--color-text); }

/* The cast fingerprint: on a board one color, the onBoard, the parts told apart by their gaps. */
.pl-print { display: flex; gap: 1px; height: 10px; min-width: 0; border-radius: 5px; overflow: hidden; }
.pl-print i { display: block; min-width: 1px; background: var(--hue); }
.g-tile .pl-print, .g-head .pl-print { color: inherit; }
.g-tile .pl-print i, .g-head .pl-print i { background: currentColor; }
.g-tile .pl-print { align-self: end; height: 8px; margin: 5px 4px; }
.g-head .pl-print-head { height: 12px; align-self: end; border-radius: 6px; }
.pl-presence { display: flex; align-items: flex-end; gap: 1px; height: 18px; }
.pl-presence i { flex: 1; min-height: 1px; border-radius: 1px; background: var(--hue); }
.pl-presence i.z { height: 1px; background: var(--color-border); }

/* Faces: a performer is a filled circle on their part's mark; the device voice a dashed ring with a wave. */
.pl-face { --s: 36px; position: relative; display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: var(--s); height: var(--s); border-radius: 50%; background: var(--hue); color: var(--on-hue);
  font: 700 calc(var(--s) * 0.46)/1 var(--font-display); }
.pl-face.voice { background: transparent; border: 2px dashed var(--hue); color: var(--hue); }
.pl-face.voice svg { width: 55%; height: 55%; fill: currentColor; }
.pl-face.sm { --s: 28px; }
.pl-face.xs { --s: 22px; }
.pl-face.lg { --s: 48px; }
.pl-face .ok { position: absolute; right: -3px; bottom: -3px; display: flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; border-radius: 50%; background: var(--color-background); color: var(--color-text); }
.pl-face .ok svg { width: 12px; height: 12px; fill: currentColor; }
.pl-face.live { box-shadow: 0 0 0 3px var(--color-background), 0 0 0 5px var(--color-record); }
.pl-face.now { box-shadow: 0 0 0 2px var(--color-surface-alt), 0 0 0 4px var(--color-primary); }

/* The play's and the production's parts: a grid of cards, two across on a phone. */
.pl-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2); margin: var(--space-3) 0 var(--space-4); }
@media (min-width: 900px) { .pl-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--space-3); } }
@media (max-width: 359px) { .pl-grid { grid-template-columns: minmax(0, 1fr); } }
.pl-part { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto auto 1fr auto; gap: 8px; min-width: 0; padding: var(--space-3);
  border-radius: var(--radius-card); background: var(--color-surface-alt); }
.pl-part.mine { box-shadow: inset 0 0 0 2px var(--color-primary); }
.pl-part-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.pl-part-name { min-width: 0; font: 700 var(--type-section-header-size)/1.02 var(--font-display); text-transform: uppercase;
  overflow-wrap: anywhere; }
.pl-part-link { color: inherit; text-decoration: none; min-width: 0; }
.pl-part-link:hover .pl-part-name { text-decoration: underline; }
.pl-part-len, .pl-part-who { color: var(--color-text-muted); }
.pl-part-who { align-self: start; }
.pl-part-acts, .pl-part-acts .take-form { display: flex; flex-direction: column; gap: var(--space-2); }
.pl-part-acts .btn { width: 100%; min-height: 40px; padding: 0 10px; }
.pl-as { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) 0; margin-top: var(--space-3);
  border-top: 1px solid var(--color-border); border-bottom: 1px solid var(--color-border); }
.pl-as .field-input { flex: 1 1 auto; min-width: 0; width: auto; }

/* ---- The recorder: fixed slots (top, strip, mode, scene, dock) that never move between modes or states ---- */
.pl-rec { display: flex; flex-direction: column; max-width: 720px; }
.pl-top { display: grid; grid-template-columns: var(--tap) minmax(0, 1fr) auto; align-items: center; gap: var(--space-2); }
.pl-top .icon-btn svg { width: 24px; height: 24px; fill: currentColor; }
.pl-top-t { min-width: 0; }
.pl-top-part { margin: 0; font: 700 var(--type-section-header-size)/1 var(--font-display); text-transform: uppercase; overflow-wrap: anywhere; }
.pl-top-play { margin: 2px 0 0; color: var(--color-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-top-count { font: 600 14px/1 var(--font-mono); color: var(--color-text-muted); white-space: nowrap; }
.pl-strip { display: flex; height: 22px; margin-top: var(--space-3); }
.pl-strip i { flex: 1 1 0; min-width: 1px; border-radius: 2px; background: var(--color-border); }
.pl-strip i.k { background: var(--hue); }
.pl-strip i.f { background: var(--color-warning); }
.pl-strip i.c { background: var(--color-primary); transform: scaleY(1.3); min-width: 3px; }
.pl-strip i.c.rec-on { background: var(--color-record); }
.pl-mode-row { margin-top: var(--space-3); }
.pl-mode { display: flex; gap: 2px; padding: 3px; border: 1px solid var(--color-border); border-radius: var(--radius-control); }
.pl-mode label { position: relative; flex: 1 1 0; display: inline-flex; align-items: center; justify-content: center; min-height: 40px;
  padding: 0 6px; border-radius: calc(var(--radius-control) - 3px); color: var(--color-secondary); font-weight: 600; white-space: nowrap; cursor: pointer; }
.pl-mode label.on { background: var(--color-secondary); color: var(--color-on-secondary); }
.pl-mode input { position: absolute; top: 0; right: 0; bottom: 0; left: 0; opacity: 0; margin: 0; cursor: inherit; }
.pl-mode label:has(input:focus-visible) { outline: 2px solid var(--color-text); outline-offset: 2px; }
.pl-mode label:has(input:disabled) { cursor: default; }
.pl-mode label:has(input:disabled):not(.on) { opacity: 0.4; }
.pl-opp { display: flex; align-items: center; gap: var(--space-3); margin-top: var(--space-3); overflow: hidden; }
.pl-opp-p { flex: 0 1 auto; overflow: hidden; display: inline-flex; align-items: center; gap: 6px; min-width: 0; font-size: var(--type-caption-size); white-space: nowrap; }
.pl-muted { color: var(--color-text-muted); }
.pl-opp-p > b, .pl-opp-p > .pl-face { flex: none; }
.pl-opp-p > .pl-muted { min-width: 0; overflow: hidden; text-overflow: ellipsis; }

.pl-scene { display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-4) 0; min-height: 280px; }
.pl-ln { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: start; margin-right: 28px; }
.pl-ln-body { min-width: 0; }
.pl-ln-who { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0;
  font-size: var(--type-caption-size); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--color-text-muted); }
.pl-tag { font-weight: 500; letter-spacing: 0; text-transform: none; }
.pl-say { margin: 2px 0 0; font-size: 17px; line-height: 1.4; overflow-wrap: break-word; text-wrap: pretty; }
.pl-ln.past, .pl-ln.next { opacity: 0.6; }
.pl-ln.past .pl-say, .pl-ln.next .pl-say { font-size: 15px; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; }
.pl-cue { padding: var(--space-3); border-radius: var(--radius-card); background: var(--color-surface-alt); }
.pl-cue .pl-ln { margin-right: 0; }
.pl-mine { display: flex; flex-direction: column; gap: var(--space-2); margin-left: 28px; padding: var(--space-4);
  border-radius: var(--radius-card); background: var(--board); color: var(--on-board); }
.pl-mine-who { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 26px; margin: 0;
  font-size: var(--type-caption-size); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.pl-mine-say { margin: 0; font-size: 25px; font-weight: 600; line-height: 1.3; overflow-wrap: break-word; text-wrap: pretty; }
.pl-mine .line-aside { color: inherit; opacity: 0.85; }
.pl-mine.armed { outline: 2px dashed var(--color-record); outline-offset: 3px; }
.pl-mine.on { outline: 3px solid var(--color-record); outline-offset: 3px; }
.pl-pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; border-radius: 999px; white-space: nowrap;
  font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: none; }
.pl-pill.red { background: var(--color-record); color: var(--color-on-record); }
.pl-pill.redo { border: 1.5px dashed var(--color-record); background: var(--color-background); color: var(--color-record); }
.pl-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.pl-takes { display: inline-flex; gap: 6px; }
.pl-take-n { width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid currentColor; background: transparent; color: inherit;
  font: 600 12px/1 var(--font-mono); cursor: pointer; }
.pl-take-n.on { background: var(--on-board); color: var(--board); border-color: var(--on-board); }
.pl-take { display: flex; align-items: center; gap: var(--space-3); min-width: 0; }
.pl-play-dot { display: inline-grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 50%;
  border: 1.5px solid currentColor; background: transparent; color: inherit; cursor: pointer; }
.pl-play-dot svg { width: 18px; height: 18px; fill: currentColor; }
.pl-take-len { flex: 1; font: 600 14px/1 var(--font-mono); }
.pl-warn { display: flex; align-items: flex-start; gap: 8px; margin: 0; padding: var(--space-2) var(--space-3);
  border: 1.5px solid var(--color-warning); border-radius: var(--radius-control); background: var(--color-background);
  color: var(--color-text); font-size: var(--type-caption-size); text-transform: none; letter-spacing: 0; font-weight: 500; }
.pl-warn svg { width: 18px; height: 18px; flex: none; fill: var(--color-warning); }

.pl-aside { display: flex; flex-direction: column; gap: var(--space-3); }
.pl-aids { display: flex; justify-content: center; gap: var(--space-2); flex-wrap: nowrap; }
.pl-aid { display: inline-flex; align-items: center; min-height: 36px; padding: 0 12px; border: 1.5px solid var(--color-border);
  border-radius: 999px; background: var(--color-background); color: var(--color-secondary); font-size: 14px; font-weight: 600; white-space: nowrap; cursor: pointer; }
.pl-aid:disabled { opacity: 0.4; cursor: default; }
select.pl-aid { padding-right: 8px; }
.pl-keys { display: none; }
.pl-dock { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: var(--space-2); min-height: 120px; padding: var(--space-3) 0;
  position: sticky; bottom: 0; z-index: 1; background: var(--color-background); }
.pl-dock.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pl-dock.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pl-dock.two .btn, .pl-dock.three .btn { width: 100%; min-height: 52px; padding: 0 8px; gap: 6px; white-space: nowrap; }
.pl-dock-none { display: none; }
.pl-side { display: flex; justify-content: center; text-align: center; color: var(--color-text-muted); }
.pl-side .icon-btn svg { width: 28px; height: 28px; fill: var(--color-secondary); }
.pl-side .icon-btn:disabled svg { opacity: 0.35; }
.pl-ctr { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.pl-lab { font-size: 12px; color: var(--color-text-muted); }
.pl-recbtn { display: inline-grid; place-items: center; width: 76px; height: 76px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--color-record); color: var(--color-on-record);
  box-shadow: 0 0 0 4px var(--color-background), 0 0 0 6px var(--color-record); }
@supports (color: color-mix(in srgb, red 50%, blue)) { .pl-recbtn { box-shadow: 0 0 0 4px var(--color-background), 0 0 0 6px color-mix(in srgb, var(--color-record) 40%, transparent); } }
.pl-recbtn svg { width: 30px; height: 30px; fill: currentColor; }
.pl-recbtn.armed { background: transparent; color: var(--color-record); border: 3px dashed var(--color-record); box-shadow: none; }
.pl-recbtn.ink { background: var(--color-primary); color: var(--color-on-primary); box-shadow: none; }
.pl-recbtn:disabled { cursor: default; }
.pl-recbtn:disabled:not(.armed) { opacity: 0.4; }
.pl-meter { display: flex; align-items: center; gap: 2px; height: 32px; margin-top: var(--space-2); padding: 0 var(--space-3);
  background: var(--color-surface); border-radius: var(--radius-control); }
.pl-meter i { flex: 1 1 0; min-width: 0; max-width: 3px; height: 3px; border-radius: 2px; background: var(--color-record); }
.pl-done { display: flex; flex-direction: column; gap: var(--space-1); padding-bottom: var(--space-6); }
.pl-done .btn { width: 100%; }

/* Run through's review: the run's takes, each heard with its cue */
.pl-rv-list { display: flex; flex-direction: column; gap: var(--space-3); }
.pl-rv { display: flex; flex-direction: column; gap: 8px; padding: var(--space-3); border-radius: var(--radius-card); background: var(--color-surface-alt); }
.pl-rv .caption { margin: 0; color: var(--color-text-muted); }
.pl-rv .btn-again { flex: none; min-height: 40px; padding: 0 12px; }

/* Line by line: every line of the part; the one selected opens in place */
.pl-lx-list, .pl-rv-list { list-style: none; margin: 0; padding: 0; }
.pl-lx-list { display: flex; flex-direction: column; }
.pl-lx { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: var(--space-3); align-items: start; width: 100%;
  padding: 10px 0; border: 0; border-bottom: 1px solid var(--color-border); background: none; color: inherit; font: inherit; text-align: start; cursor: pointer; }
.pl-lx:disabled { cursor: default; }
.pl-lx-n { padding-top: 3px; color: var(--color-text-muted); }
.pl-lx-say { margin: 0; font-size: 16px; line-height: 1.4; overflow-wrap: break-word; }
.pl-lx-st { display: inline-flex; align-items: center; gap: 4px; padding-top: 2px; white-space: nowrap; font-size: var(--type-caption-size); color: var(--color-text-muted); }
.pl-lx-st svg { width: 14px; height: 14px; fill: currentColor; }
.pl-lx-st.kept { color: var(--color-text); }
.pl-lx-st.warn svg { fill: var(--color-warning); }
li.pl-lx.sel { display: flex; flex-direction: column; align-items: stretch; gap: var(--space-3); padding: var(--space-3) 0; border-bottom: 1px solid var(--color-border); }
li.pl-lx.sel .pl-mine { margin-left: 0; }
.pl-lx-acts { display: flex; gap: var(--space-2); }
.pl-lx-acts .btn { flex: 1 1 0; min-width: 0; }

/* Before the first take */
.pl-pre { display: flex; flex-direction: column; align-items: center; gap: var(--space-4); max-width: 560px; padding: var(--space-6) 0; text-align: center; }
.pl-pre-icon { width: 48px; height: 48px; fill: var(--color-secondary); }
.pl-pre-h { margin: 0; font: 700 var(--type-page-title-size)/1.05 var(--font-display); text-transform: uppercase; }
.pl-pre-why { margin: 0; color: var(--color-text-muted); }
.pl-check { display: flex; align-items: center; gap: 12px; min-height: var(--tap); padding: var(--space-3) var(--space-4);
  border: 1.5px solid var(--color-border); border-radius: var(--radius-control); cursor: pointer; }
.pl-check input { width: 22px; height: 22px; accent-color: var(--color-secondary); }
.pl-go { width: 100%; min-height: 56px; }
.pl-countdown { margin: 0; font: 700 var(--type-page-title-size)/1 var(--font-display); }

/* The desktop recorder: the scene in the middle, the cast on the left, this line's aids and the keys on the right */
.pl-rail { display: none; }
@media (min-width: 1100px) {
  .pl-rec:not(.pl-rec-pre) { display: grid; max-width: none; grid-template-columns: 240px minmax(0, 720px) 240px; column-gap: var(--space-8); justify-content: center; }
  .pl-rec > .pl-top, .pl-rec > .pl-strip { grid-column: 1 / -1; grid-row: auto; }
  .pl-rec > .pl-mode-row { grid-column: 2; grid-row: 3; }
  .pl-rec > .pl-opp { display: none; }
  .pl-rec > .pl-scene { grid-column: 2; grid-row: 4; }
  .pl-rec > .pl-dock, .pl-rec > .pl-dock-none { grid-column: 2; grid-row: 5; }
  .pl-rec > .pl-done { grid-column: 2; grid-row: 6; }
  .pl-rail { display: flex; flex-direction: column; gap: var(--space-4); grid-column: 1; grid-row: 3 / 7; padding-top: var(--space-3); }
  .pl-rec > .pl-aside { grid-column: 3; grid-row: 3 / 7; padding-top: var(--space-3); }
  .pl-aids { flex-direction: column; align-items: stretch; }
  .pl-rail-h { margin: 0; font-size: var(--type-caption-size); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--color-text-muted); }
  .pl-r1 { display: flex; align-items: center; gap: var(--space-3); }
  .pl-r1 > span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
  .pl-r1-nm { font: 700 18px/1 var(--font-display); text-transform: uppercase; }
  .pl-keys { display: grid; grid-template-columns: auto 1fr; gap: 8px 12px; align-items: center; margin: 0; font-size: 14px; }
  .pl-keys dd { margin: 0; }
  .pl-keys kbd { display: inline-block; min-width: 2em; padding: 4px 7px; border: 1.5px solid var(--color-border); border-bottom-width: 3px;
    border-radius: 6px; font: 600 12px/1 var(--font-mono); text-align: center; }
  .pl-mine-say { font-size: 32px; }
  .pl-say { font-size: 19px; }
  .pl-dock { position: static; }
}

/* ---- The player bar: a flex child above the tab bar ---- */
.player { flex-shrink: 0; border-top: 1px solid var(--color-border); background: var(--color-surface); }
.player[hidden] { display: none; }
.player-progress { height: 2px; background: var(--color-surface-alt); }
.player-progress > div { height: 100%; width: 0; background: var(--color-primary); }
.player-row { display: flex; align-items: center; gap: var(--space-1); padding: var(--space-1) var(--space-2) var(--space-1) var(--space-4); }
.player-title .g-event { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-title {
  flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start;
  min-height: var(--tap); justify-content: center; border: 0; background: none; text-align: left; cursor: pointer;
}
.player-title > span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-title .is-error { color: var(--color-error); }
.wide-only { display: none; }
@media (min-width: 768px) { .wide-only { display: inline-grid; } .player-row { padding-left: calc(var(--sidebar-width) + var(--space-4)); } }

/* ---- Now Playing: a modal <dialog>, full screen on a phone ---- */
.now-playing {
  width: 100%; max-width: 100%; height: 100%; max-height: 100%; margin: 0; border: 0;
  background: var(--color-background); color: var(--color-text);
}
.now-playing::backdrop { background: var(--color-scrim); opacity: 0.4; }
.np-inner { display: flex; flex-direction: column; gap: var(--space-2); max-width: 520px; margin: 0 auto; padding: var(--space-4); }
.np-top { display: flex; align-items: center; gap: var(--space-1); margin-bottom: var(--space-4); }
.np-top #np-close { margin-right: auto; }
.np-panel { display: contents; }
/* The Radio menu (RADIOS-DESIGN §8.1): the radio icon is the face of a native <select>, laid invisibly over it. */
.np-radio-pick { position: relative; }
.np-radio-pick select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: 0; }
.np-radio-pick:has(select:focus-visible) { outline: 2px solid var(--color-link); outline-offset: 2px; }
.np-radio-pick.is-on { color: var(--color-secondary); }
/* In radio mode the menu names the set drawn, so it reads as the switch (owner 2026-12-03: switching radios was hard to find). */
.np-radio-name { display: none; }
.radio-mode .np-radio-pick.is-on { display: inline-flex; align-items: center; width: auto; gap: var(--space-2); padding: 0 var(--space-4) 0 var(--space-3);
  border: 1px solid currentColor; border-radius: 999px; }
.radio-mode .np-radio-pick.is-on .np-radio-name { display: inline; font-weight: 600; white-space: nowrap; }
.radio-mode .np-radio-pick.is-on .np-radio-name::after { content: ''; display: inline-block; margin-left: var(--space-2);
  border: 5px solid transparent; border-top-color: currentColor; border-bottom: 0; vertical-align: middle; }
.seek { width: 100%; margin-top: var(--space-4); accent-color: var(--color-primary); min-height: var(--tap); }
.np-times { display: flex; justify-content: space-between; }
.np-controls { display: flex; justify-content: center; align-items: center; gap: var(--space-6); margin: var(--space-4) 0; }
/* The options row (RADIOS-DESIGN §8.1, WEB-DESIGN §6.4): one line of five equal slots, icons and two values only. */
.np-options { display: flex; justify-content: center; align-items: center; }
.np-options > * { flex: 0 0 20%; min-width: 0; }
.np-slot { display: inline-flex; align-items: center; justify-content: center; gap: 2px; width: 100%; min-width: 0; min-height: var(--tap);
  padding: 0; border: 0; border-radius: var(--radius-card); background: none; color: var(--color-text); cursor: pointer; }
.np-slot svg { width: 24px; height: 24px; flex: none; fill: currentColor; }
.np-slot:hover:not(:disabled) { background: var(--color-surface-alt); }
.np-slot:disabled { opacity: 0.35; cursor: default; }
.np-slot[aria-pressed="true"], .np-slot.is-on { color: var(--color-secondary); }
.np-slot-value { font-size: var(--type-caption-size); font-weight: var(--type-body-strong-weight); white-space: nowrap; }
.np-slot-value[hidden] { display: none; }
.np-speed select { width: 100%; min-height: var(--tap); padding: 0; border: 0; border-radius: var(--radius-card); background: none;
  -webkit-appearance: none; appearance: none; text-align: center; text-align-last: center; font-weight: var(--type-body-strong-weight); cursor: pointer; }
.np-speed select:hover:not(:disabled) { background: var(--color-surface-alt); }
.menu-note { padding: var(--space-2) var(--space-3); }
.menu-note[hidden] { display: none; }
@media (min-width: 768px) {
  .now-playing { width: 520px; height: fit-content; max-height: 90vh; margin: auto; border-radius: var(--radius-card); border: 1px solid var(--color-border); }
}

/* ---- Menus (Popover API) ---- */
.menu {
  width: min(320px, calc(100% - 2 * var(--space-4))); margin: auto; padding: var(--space-2);
  border: 1px solid var(--color-border); border-radius: var(--radius-card);
  background: var(--color-surface); color: var(--color-text);
}
.menu-title { padding: var(--space-2) var(--space-3); }
.menu button {
  display: flex; align-items: center; width: 100%; min-height: var(--tap); padding: 0 var(--space-3);
  border: 0; border-radius: var(--radius-control); background: none; text-align: left; cursor: pointer;
  font-size: var(--type-body-size);
}
.menu button:hover { background: var(--color-surface-alt); }
.menu button[aria-current="true"] { font-weight: var(--type-body-strong-weight); color: var(--color-secondary); }
.menu button[hidden] { display: none; }

/* ---- Offline: a status line in the document flow, never an overlay ---- */
.offline-note:not([hidden]) {
  flex-shrink: 0; display: block; padding: var(--space-1) var(--space-4);
  border-bottom: 1px solid var(--color-border); background: var(--color-surface-alt);
  color: var(--color-text); text-align: center;
}

/* A new shell took over this open page (WEB-DESIGN §10.1): one line, never an overlay. */
.update-note:not([hidden]) {
  flex-shrink: 0; display: flex; align-items: center; justify-content: center; gap: var(--space-2);
  padding: 0 var(--space-4); border-bottom: 1px solid var(--color-border);
  background: var(--color-surface-alt); color: var(--color-text);
}
.update-note .btn { min-height: 36px; padding: 0 var(--space-2); }

/* ---- The quiet footer: the site pages, never featured in the main UI ---- */
.site-footer {
  display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-4);
  max-width: 960px; margin: 0 auto; padding: var(--space-4) var(--space-4) var(--space-6);
}
.site-footer a { display: inline-flex; align-items: center; min-height: var(--tap); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.site-footer a[aria-current="page"] { color: var(--color-text); }
@media (min-width: 768px) { .site-footer { padding-left: var(--space-8); padding-right: var(--space-8); } }

/* ---- Site pages (credits, privacy, take-down requests) ---- */
.site-bar {
  flex-shrink: 0; display: flex; align-items: center; min-height: 52px; padding: 0 var(--space-4);
  border-bottom: 1px solid var(--color-border); background: var(--color-surface);
}
.site-home { text-decoration: none; }
.site-home:hover { text-decoration: underline; }
.site-page #main-content { flex: 1; min-height: 0; overflow-y: auto; }
.prose, .site-page .site-footer { max-width: 42rem; }
.prose > .view-heading { margin-bottom: var(--space-4); }
.prose > .section-header { margin: var(--space-6) 0 var(--space-2); }
.prose > p, .prose > ol, .prose > ul { margin-bottom: var(--space-3); }
.prose ol, .prose ul { padding-left: var(--space-6); }
.prose ol { list-style: decimal; }
.prose ul { list-style: disc; }
.prose li { margin-bottom: var(--space-2); }
.prose a { color: var(--color-link); }
.facts > div { display: grid; grid-template-columns: 9rem minmax(0, 1fr); gap: var(--space-3);
  padding: var(--space-2) 0; border-bottom: 1px solid var(--color-border); }
.request-form { display: grid; gap: var(--space-2); margin-bottom: var(--space-3); }
.request-form fieldset { border: 0; padding: 0; display: grid; gap: var(--space-1); }
.request-form [data-for] { display: grid; gap: var(--space-2); }
.request-form [hidden] { display: none; }
.request-form .choice { display: flex; gap: var(--space-2); align-items: flex-start; min-height: 44px; }
.request-form .choice input { flex: none; width: 20px; height: 20px; margin: 2px 0 0; }
.request-form textarea.field-input { padding: var(--space-2) var(--space-3); }
.request-form .btn { justify-self: start; }
.request-trap { position: absolute; left: -9999px; }
.request-agent { font-style: normal; margin-bottom: var(--space-3); }
.credit-list > div { padding: var(--space-3) 0; border-bottom: 1px solid var(--color-border); }
.credit-list dd { margin-top: 2px; }
@media (min-width: 768px) { .site-bar { padding-left: var(--space-8); padding-right: var(--space-8); } }

/* ---- The account (WEB-DESIGN §4.11): one row in Library, a sheet it opens ---- */
.account-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--space-2); margin: calc(-1 * var(--space-2)) 0 var(--space-1); }
.account-row .btn-ghost { padding: 0 var(--space-2); margin-left: calc(-1 * var(--space-2)); }
#export-row { flex-wrap: nowrap; }
.account-row .btn-ghost:disabled { color: var(--color-text-muted); opacity: 1; }
.account-warn, .account-error { color: var(--color-error); }
.account-error:not([hidden]) { display: block; margin-top: var(--space-3); }
.account-sheet {
  width: 100%; max-width: 100%; height: 100%; max-height: 100%; margin: 0; border: 0; padding: var(--space-4);
  background: var(--color-background); color: var(--color-text);
}
.account-sheet::backdrop { background: var(--color-scrim); opacity: 0.4; }
.account-sheet .section-header { margin: var(--space-2) 0 var(--space-3); }
.account-sheet .caption, .account-sheet .account-reason { margin-bottom: var(--space-4); }
.account-sheet .facts { margin-bottom: var(--space-2); }
.account-close { display: grid; margin-left: calc(-1 * var(--space-2)); }
.account-close svg { width: 24px; height: 24px; fill: currentColor; }
.account-delete { margin-top: var(--space-6); padding: 0; color: var(--color-error); }
.account-providers { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-3); }
.btn-apple { width: 280px; max-width: 100%; background: var(--color-text); border-color: var(--color-text); color: var(--color-background); }
.btn-apple:hover { background: var(--color-text); filter: brightness(1.15); }
/* Google's button is its own iframe; a light document on a dark page gets an opaque white box otherwise. */
.google-button iframe { color-scheme: light; }
.google-button { min-height: var(--tap); }
@media (min-width: 768px) {
  .account-sheet { width: 440px; height: fit-content; max-height: 90vh; margin: auto; padding: var(--space-6);
    border-radius: var(--radius-card); border: 1px solid var(--color-border); }
}
/* A smart-TV package runs from file:// (Origin: null), which the Worker refuses until a TV sign-in is decided (docs/WORKER.md). */
html.tv .account-row { display: none; }

/* ---- Listen Together (WEB-DESIGN §4.12): a button on the player, a row in Library, one sheet ---- */
.room-code { margin: var(--space-2) 0 var(--space-1); font-variant-numeric: tabular-nums; letter-spacing: 0.08em; }
.consent-sheet .consent-text { margin-bottom: var(--space-4); }
.consent-sheet .actions + .actions { padding-top: var(--space-2); }
.together-sheet .actions + .actions { padding-top: var(--space-2); }
.together-start { margin-bottom: var(--space-4); }
.together-form { display: flex; flex-direction: column; gap: var(--space-1); }
.together-sheet .together-form .caption { margin-bottom: 0; }
.together-field { display: flex; gap: var(--space-2); }
.together-field .field-input { flex: 1 1 auto; min-width: 0; font-variant-numeric: tabular-nums; letter-spacing: 0.08em; text-transform: uppercase; }
.seek:disabled, #np-speed:disabled { opacity: 0.5; }
html.tv .np-together { display: none; }
.np-remote[hidden], html.tv .np-remote { display: none; }
.agreed-list .cast-row { justify-content: space-between; align-items: center; }

/* Now Playing's verbs and people (D3-9): queue and Share on one line that never wraps apart; the faces and the
   night's broadcasts under the controls. */
.np-verbs { display: flex; flex-wrap: nowrap; justify-content: center; gap: var(--space-2); }
.np-verbs .btn { flex: none; white-space: nowrap; }
.np-people { margin-top: var(--space-4); }
.np-people .g-faces { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); }

/* Voices (D3-9): the most heard people as round faces, in a grid on Browse and a rail on Home. */
.g-faces-voices { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
.g-faces-voices .g-face > .g-window, .g-faces-rail .g-face > .g-window { width: 84px; }
.g-faces-rail { display: grid; grid-auto-flow: column; grid-auto-columns: 120px; gap: var(--space-2); overflow-x: auto; scroll-snap-type: x proximity; padding: 0 0 var(--space-2); list-style: none; }
.g-faces-rail > li { scroll-snap-align: start; min-width: 0; }
.g-face-count { color: var(--color-text-muted); white-space: nowrap; }

/* ---- Library (WEB-DESIGN §4.7, Decision 087): Listening | Making over one foot ---- */
.lib-sides { display: grid; grid-template-columns: 1fr 1fr; max-width: 420px; margin-bottom: var(--space-4); }
.lib-sides button { min-height: 40px; font-size: var(--type-body-size); font-weight: var(--type-body-strong-weight); }
.lib-sides[hidden], .lib-foot[hidden] { display: none; }
.lib-lines { margin-bottom: var(--space-6); border-top: 1px solid var(--color-border); }
.lib-section .lib-lines { margin-bottom: 0; }
.lib-line { display: flex; align-items: center; gap: var(--space-3); min-height: var(--tap); padding: var(--space-2) 0;
  border-bottom: 1px solid var(--color-border); color: var(--color-text); text-decoration: none; }
.lib-line .lib-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lib-line .lib-value { color: var(--color-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 60%; }
.lib-line svg { width: 18px; height: 18px; fill: var(--color-text-muted); flex: none; }
.lib-line:hover .lib-label { text-decoration: underline; }
.lib-back { margin-left: calc(-1 * var(--space-3)); padding: 0 var(--space-2); }
.lib-page-h { margin: var(--space-2) 0 var(--space-3); }
.lib-foot { margin-top: var(--space-6); }
.lib-foot > .section-header { margin-bottom: var(--space-2); }
.lib-group { padding: 0 var(--space-3); border-radius: var(--radius-card); background: var(--color-surface); }
.lib-row { border-bottom: 1px solid var(--color-border); }
.lib-group > .lib-row:last-child { border-bottom: 0; }
.lib-group .account-row { margin: 0; min-height: var(--tap); }
.lib-group .account-row .btn { white-space: nowrap; }
.lib-group #export-row { flex-wrap: wrap; }
.lib-more > summary { display: flex; align-items: center; gap: var(--space-2); min-height: var(--tap); cursor: pointer; list-style: none;
  color: var(--color-link); font-weight: var(--type-body-strong-weight); }
.lib-more > summary::-webkit-details-marker { display: none; }
.lib-more > summary svg { width: 20px; height: 20px; fill: currentColor; flex: none; }
.lib-more > summary .lib-label { flex: 1; min-width: 0; }
.lib-more > summary .lib-value { color: var(--color-text-muted); font-weight: var(--type-body-weight); white-space: nowrap; }
.lib-more > summary::after { content: ""; flex: none; width: 7px; height: 7px; margin: 0 4px 4px 2px;
  border-right: 2px solid var(--color-text-muted); border-bottom: 2px solid var(--color-text-muted); transform: rotate(45deg); }
.lib-more[open] > summary::after { margin-bottom: 0; margin-top: 4px; transform: rotate(-135deg); }
.lib-voices > .vs-voices { margin: 0; padding-bottom: var(--space-3); }
.lib-voices .vs-head { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.lib-about-links { display: flex; flex-direction: column; margin: 0; padding: 0 0 var(--space-2) calc(20px + var(--space-2)); list-style: none; }
.lib-about-links a { display: inline-flex; align-items: center; min-height: var(--tap); text-decoration: none; }
.lib-about-links a:hover { text-decoration: underline; }
#main-content:has(#view-library:not([hidden])) .site-footer { display: none; }
html.tv .lib-voices { display: none; }
@media (min-width: 1024px) {
  .lib-cols { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(320px, 1fr); gap: var(--space-8); align-items: start; }
  .lib-foot { margin-top: 0; }
}

/* A show's About: four lines until opened; the attribution under it is the license's price. */
.about { margin: var(--space-4) 0; max-width: 68ch; }
.about-text p { margin: 0 0 var(--space-3); }
.about-text[data-clamped="true"] { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; line-clamp: 4; overflow: hidden; }
.about-text[data-clamped="true"] p { display: inline; margin: 0; }
.about-text[data-clamped="true"] p + p::before { content: " "; }
.about-more { padding-left: 0; padding-right: 0; min-height: 44px; }
.about-source { margin: 0; color: var(--color-text-muted); }
.ep-script { margin: var(--space-2) 0; }

/* ---- Home and Record (WEB-DESIGN §4.2, §4.15; Decision 075) ---- */
.home-head { align-items: center; margin-bottom: var(--space-3); }
.home-head .view-heading { margin: 0; }
.home-surprise { flex: none; white-space: nowrap; }
/* The site's footer leaves Home (§4.8). */
#main-content:has(#view-listen:not([hidden])) .site-footer { display: none; }
/* The hero (§4.2r rule 1): the board of the show on the air, its window at tier L (full column width on a
   phone, 320 px beside the words from 600 px), the show's name in page-title type, then Listen live. */
.home-live {
  display: grid; margin-bottom: var(--space-3); overflow: hidden; border-radius: var(--radius-card);
  background: var(--genre-board, var(--color-surface-alt)); color: var(--genre-on, var(--color-text));
}
.home-live-win { display: block; }
.home-live-win > .g-window { width: 100%; border-radius: 0; }
.home-live-text { min-width: 0; padding: var(--space-4); }
.home-live .g-kicker { margin: 0 0 var(--space-2); color: inherit; }
.home-live-name {
  display: block; color: inherit; text-decoration: none; font-family: var(--type-page-title-family);
  font-weight: var(--type-page-title-weight); font-size: var(--type-page-title-size); line-height: 1.05;
  text-transform: uppercase; text-wrap: balance; overflow-wrap: normal; word-break: normal; hyphens: manual;
}
.home-live-name[data-step="1"] { font-size: var(--type-section-header-size); }
.home-live-name[data-step="2"] { font-size: var(--type-body-strong-size); }
.home-live-name:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.home-live .g-event, .home-live .caption { color: inherit; }
.home-live-event { display: block; margin-top: var(--space-1); }
.home-live-note { margin: var(--space-2) 0 0; }
.home-live-actions { display: flex; flex-wrap: nowrap; gap: var(--space-2); margin-top: var(--space-4); }
.home-live-actions .btn { flex: none; white-space: nowrap; }
.home-live-actions .btn-primary { flex: 1 1 auto; min-width: 0; }
.home-live .btn-ghost { color: inherit; }
@media (min-width: 600px) {
  .home-live { grid-template-columns: 320px minmax(0, 1fr); align-items: center; }
  .home-live-text { padding: var(--space-4) var(--space-6); }
  .home-live-actions .btn-primary { flex: none; }
}
.btn-live-home[aria-pressed="true"] { background: var(--color-primary); color: var(--color-on-primary); }
/* The dial (§4.2r rule 2): every genre station as a small label, one row; it scrolls on a phone. */
.home-dial { margin: 0 0 var(--space-4); }
.home-dial-list {
  display: grid; grid-auto-flow: column; grid-auto-columns: 84px; gap: var(--space-2);
  margin: 0; padding: 0 0 var(--space-1); list-style: none; overflow-x: auto; scroll-snap-type: x proximity;
}
.home-dial-list > li { min-width: 0; scroll-snap-align: start; }
@media (min-width: 768px) { .home-dial-list { grid-auto-flow: row; grid-template-columns: repeat(8, minmax(0, 1fr)); overflow: visible; } }
.home-dial-st {
  display: flex; flex-direction: column; align-items: center; gap: 2px; width: 100%; min-width: 0; padding: var(--space-1) 0;
  border: 0; border-radius: var(--radius-card); background: none; color: var(--color-text); font: inherit; text-align: center; cursor: pointer;
}
.home-dial-st:disabled { cursor: default; opacity: 0.55; }
.home-dial-st > .g-window { width: 56px; margin-bottom: 2px; }
.home-dial-st[aria-pressed="true"] > .g-window { box-shadow: 0 0 0 2px var(--color-surface), 0 0 0 4px var(--color-text); }
.home-dial-name { font-weight: var(--type-body-strong-weight); color: var(--color-text); }
.home-dial-name, .home-dial-on { display: block; max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; line-height: 1.25; }
.home-dial-on { color: var(--color-text-muted); }
@media (min-width: 768px) { .home-dial-on { white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow-wrap: anywhere; } }
.home-chips { margin-top: 0; }
.home-chips button { white-space: nowrap; flex: none; }
/* Play on a tile: over the window's corner, outside the link so the two targets stay two. */
.g-tile-playable { position: relative; }
.g-tile-play { position: absolute; top: 12px; right: 12px; width: 40px; height: 40px; min-width: 40px; min-height: 40px; }
/* On the air's kicker: a steady ink dot before "On the air" (live is ink; red is recording only, Decision 064). */
.home-live-dot { display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; background: currentColor; vertical-align: 1px; }
/* Today's scene (WEB-DESIGN §4.2 item 5, §4.15 item 2): the title block on the drama board, then its opening as a page. */
.pl-scene { margin-bottom: var(--space-3); padding: var(--space-4); border-radius: var(--radius-card);
  background: var(--genre-board); color: var(--genre-on); }
.pl-scene-head { display: block; color: inherit; text-decoration: none; }
.pl-scene-head:hover .pl-scene-title { text-decoration: underline; }
.pl-scene-head .g-kicker { margin: 0 0 var(--space-1); }
.pl-scene-title { margin: 0 0 var(--space-1); font: var(--type-page-title-weight) var(--type-page-title-size)/1.05 var(--type-page-title-family);
  text-transform: uppercase; text-wrap: balance; overflow-wrap: normal; }
.pl-scene-page { list-style: none; margin: var(--space-3) 0 0; padding: var(--space-3) var(--space-4); border-radius: 4px;
  background: var(--color-print-ground); color: var(--color-text); box-shadow: inset 0 0 0 1px var(--color-print-edge); }
.pl-scene-sp { position: relative; margin: 0 0 var(--space-2); padding-left: 12px; }
.pl-scene-sp:last-child { margin-bottom: 0; }
.pl-scene-sp::before { content: ""; position: absolute; left: 0; top: 3px; bottom: 3px; width: 3px; border-radius: 2px; background: var(--hue); }
.pl-scene-who { display: block; font-weight: var(--type-body-strong-weight); font-size: var(--type-caption-size); letter-spacing: 0.04em; }
.pl-scene-said { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; }
.pl-verse-row { display: block; padding-left: 1em; text-indent: -1em; }
.pl-scene-now { background: var(--color-surface-alt); border-radius: 2px; }
@supports (color: color-mix(in srgb, red 50%, blue)) { .pl-scene-now { background: color-mix(in srgb, var(--hue) 14%, transparent); } }
.pl-scene-actions { flex-wrap: nowrap; margin: var(--space-3) 0 0; padding-top: 0; }
.pl-scene-actions .btn-primary { flex: 1 1 auto; min-width: 0; }
.pl-scene-actions .btn svg { flex: none; }
@container (min-width: 480px) { .pl-scene-actions .btn-primary { flex: none; } }
.pl-scene .btn-ghost { color: inherit; }
.pl-scene .caption, .pl-scene .g-event { color: inherit; }
@media (max-width: 400px) {
  .pl-scene { padding: var(--space-3); }
  .pl-scene-page { padding: var(--space-3); }
  .pl-scene-actions .btn-ghost { padding-left: var(--space-2); padding-right: var(--space-2); }
}
.pl-scene .refusal:empty { display: none; }
/* Today's scene on Home (§4.2r rule 6): a wide card at the grammar's size. The drama board is the window,
   holding the script page; the title, facts and buttons stand beside it on the page ground. */
.pl-scene.pl-scene-wide { display: grid; gap: var(--space-3); min-height: 0; padding: 0; border-radius: 0; background: none; color: var(--color-text); }
.pl-scene-win { padding: var(--space-3); border-radius: var(--radius-card); background: var(--genre-board); color: var(--genre-on); }
.pl-scene-win .pl-scene-page { margin: 0; }
.pl-scene-wide > * { min-width: 0; }
.pl-scene-wide .pl-scene-actions { margin: 0; }
.pl-scene-wide .caption, .pl-scene-wide .g-event { color: var(--color-text-muted); }
.pl-scene-wide .pl-scene-head .g-kicker { color: var(--color-text-muted); }
.pl-scene-wide .btn-ghost { color: var(--color-link); }
@media (min-width: 600px) {
  .pl-scene.pl-scene-wide {
    grid-template-columns: minmax(0, 320px) minmax(0, 1fr); grid-template-areas: "win head" "win actions" "win err";
    grid-template-rows: 1fr auto 1fr; column-gap: var(--space-6); row-gap: var(--space-3);
  }
  .pl-scene-wide > .pl-scene-head { grid-area: head; align-self: end; }
  .pl-scene-wide > .pl-scene-win { grid-area: win; }
  .pl-scene-wide > .pl-scene-actions { grid-area: actions; }
  .pl-scene-wide > .refusal { grid-area: err; align-self: start; }
  .pl-scene-wide .pl-scene-page { font-size: var(--type-caption-size); }
}
/* A play tile's window, when its row carries an opening: the first two speeches as a page. */
.pl-open { display: flex; flex-direction: column; gap: 6px; padding: 10px; box-sizing: border-box; color: var(--color-text);
  font-size: var(--type-caption-size); line-height: 1.3; text-align: left; text-transform: none; }
.pl-open-sp { display: block; min-width: 0; }
/* The role on its own line, never broken inside its name; the first clears the Read button in the corner. */
.pl-open-sp b { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-weight: var(--type-body-strong-weight); letter-spacing: 0.04em; }
.pl-open-sp:first-child b { padding-right: 34px; }
.pl-open-said { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; overflow-wrap: break-word; }
/* The voice band's rules take the page's foot (§6.4r), so the last speech keeps one line. */
.pl-open-sp:last-of-type .pl-open-said { -webkit-line-clamp: 1; line-clamp: 1; }
/* A long play title stops at four lines on a tile; the page carries the whole. */
.pl-tile-li .g-name { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; line-clamp: 4; overflow: hidden; }
.home-open-parts .section-header { font-size: var(--type-body-strong-size); }

/* ---- The script reader (WEB-DESIGN §4.16, Decision 076): pages by default, a slide, two facing pages from 900 px ---- */
body.reading .tabbar, body.reading .sidebar { display: none; }
body.reading #main-content { overflow: hidden; }
.view.view-reader { max-width: none; height: 100%; padding: 0; }
#reader-body, #readroom-body { height: 100%; }
#reader-body > .state, #readroom-body > .state { padding: var(--space-6) var(--space-4); }
.rd {
  --rd-scale: 1; --rd-leading: 1.55; --rd-per: 1; --rd-gap: 48px;
  height: 100%; display: flex; flex-direction: column; background: var(--color-background);
}
.rd-bar { flex-shrink: 0; display: flex; align-items: center; gap: var(--space-1); min-height: 52px; padding: 0 var(--space-2); background: var(--color-background); }
.rd-top { border-bottom: 1px solid var(--color-border); }
.rd-bottom { border-top: 1px solid var(--color-border); gap: var(--space-2); }
.rd-icon svg { width: 22px; height: 22px; }
.rd-titles { flex: 1; min-width: 0; padding: 0 var(--space-1); }
.rd-title, .rd-where { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.25; }
.rd-where:empty { display: none; }
.rd-part { flex: 1 1 auto; min-width: 0; }
.rd-part-sel { width: 100%; max-width: 18rem; min-height: 40px; padding: 0 var(--space-2); border: 1px solid var(--color-border);
  border-radius: var(--radius-control); background: var(--color-background); text-overflow: ellipsis; }
.rd-tool { flex: none; min-height: 40px; padding: 0 var(--space-2); white-space: nowrap; }
.rd-tool-lab { display: none; }
@media (min-width: 560px) { .rd-tool-lab { display: inline; } }
.rd-tool[aria-pressed="true"] { background: var(--color-surface-alt); border-color: transparent; }
.rd-page { flex: none; min-width: 4.5em; text-align: right; }
/* A phone's bar holds the part, four tools and the page: tighter gaps, so the part's name still reads. */
@media (max-width: 399px) {
  .rd-bottom { gap: 4px; }
  .rd-bottom .rd-tool { padding: 0 4px; min-width: 34px; }
  .rd-part-sel { padding: 0 2px 0 6px; font-size: 14px; }
  .rd-page { min-width: 0; font-size: 12px; }
  .rd-of { font-size: 0; }
  .rd-of::after { content: "/"; font-size: 12px; }
}
.rd-stage { flex: 1; min-height: 0; position: relative; padding: var(--space-6) var(--space-2) var(--space-4); outline: none; }
@media (min-width: 600px) { .rd-stage { padding-left: var(--space-6); padding-right: var(--space-6); } }
/* The page: a 14 px inner margin, so the tint of "my" speeches is never cut at a page's edge. */
.rd-clip { --rd-pad: 14px; height: 100%; overflow: hidden; margin: 0 auto; padding: 0 var(--rd-pad); box-sizing: border-box;
  max-width: calc(var(--rd-per) * 36em + (var(--rd-per) - 1) * var(--rd-gap) + 2 * var(--rd-pad));
  font-size: calc(var(--type-body-size) * var(--rd-scale)); touch-action: pan-y pinch-zoom; }
.rd-flow { height: 100%; column-fill: auto; transition: transform 240ms ease; will-change: transform; line-height: var(--rd-leading); }
.rd-flow.rd-still { transition: none; }
.rd[data-layout="scroll"] .rd-stage { overflow-y: auto; overscroll-behavior: contain; }
.rd[data-layout="scroll"] .rd-clip { height: auto; overflow: visible; }
.rd[data-layout="scroll"] .rd-flow { height: auto; transition: none; will-change: auto; padding-bottom: 40vh; }
/* The running head: a speech carried over from the page before names its speaker. */
.rd-heads-wrap { position: absolute; top: 4px; left: 0; right: 0; padding: 0 var(--space-2); pointer-events: none; font-size: calc(var(--type-body-size) * var(--rd-scale)); }
@media (min-width: 600px) { .rd-heads-wrap { padding: 0 var(--space-6); } }
.rd-heads { display: grid; grid-template-columns: repeat(var(--rd-per), minmax(0, 1fr)); column-gap: var(--rd-gap); margin: 0 auto; padding: 0 14px;
  max-width: calc(var(--rd-per) * 36em + (var(--rd-per) - 1) * var(--rd-gap) + 28px); line-height: 1.4; }
.rd-runhead { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--color-text-muted); font-size: 0.8125em; }
.rd-runhead-name { color: var(--hue); }
.rd[data-gutter="true"] .rd-runhead { padding-left: 11.7em; }
/* The front of the play: title, authors, the speaking parts in their hues. */
.rd-front { margin: 0 0 2.5em; }
.rd-front-title { font-family: var(--type-page-title-family); font-weight: var(--type-page-title-weight); font-size: 1.75em; line-height: 1.1; margin: 0 0 0.3em; }
.rd-front-by { margin: 0 0 1.2em; color: var(--color-text-muted); }
.rd-front-lab { margin: 0 0 0.3em; font-size: 0.8125em; color: var(--color-text-muted); }
.rd-front-parts { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.15em 0.9em; }
.rd-front-parts li { color: var(--hue); font-weight: var(--type-body-strong-weight); letter-spacing: 0.02em; }
/* A line. A speech: the name (L3, the part's hue) over the words (L4); beside them from 30 em a page. */
.rd-line { margin: 0 0 0.85em; overflow-wrap: break-word; scroll-margin-top: var(--space-4); }
.rd-speech { margin: 0; }
.rd-sp { margin: 0 0 0.85em; }
.rd-who { margin: 0; break-after: avoid; }
.rd-name { color: var(--hue); font-weight: var(--type-body-strong-weight); letter-spacing: 0.02em; }
.rd-body { margin: 0; orphans: 2; widows: 2; }
.rd-row { display: block; }
.rd-verse .rd-row:not(.rd-sfx) { padding-left: 1.5em; text-indent: -1.5em; }
.rd-verse .rd-row.rd-half { padding-left: 4em; }
/* Never a single verse line left at a page's foot or carried alone to the next. */
.rd-verse .rd-row { break-inside: avoid; }
.rd-verse .rd-row:first-child { break-after: avoid; }
.rd-verse .rd-row:last-child:nth-child(n+4) { break-before: avoid; }
.rd[data-gutter="true"] .rd-sp { display: flow-root; padding-left: 9.5em; }
.rd[data-gutter="true"] .rd-who { float: left; width: 8.5em; margin-left: -9.5em; text-align: right; overflow-wrap: anywhere; }
/* A printed direction inside a speech: italic and muted, in upright parentheses. */
.rd-aside { font-style: italic; color: var(--color-text-muted); }
.rd-aside.rd-roman { font-style: normal; }
.rd-aside.rd-open::before { content: "("; font-style: normal; }
.rd-aside.rd-close::after { content: ")"; font-style: normal; }
/* A stage direction: a quieter, indented paragraph; a part it names (in capitals) in that part's hue. */
.rd-dir { font-style: italic; color: var(--color-text-muted); margin-left: 1.5em; }
.rd-dir em { font-style: normal; }
.rd[data-gutter="true"] .rd-dir, .rd[data-gutter="true"] .rd-line.rd-cue { margin-left: 9.5em; }
.rd-dname { color: var(--hue); font-style: normal; font-weight: var(--type-body-strong-weight); }
/* The sound lane (radio): a cue is its own row, a block in capitals (L5) behind a speaker glyph. */
.rd-sfx { margin: 0.35em 0; }
.rd-line.rd-cue { margin-left: 1.5em; }
.rd-sfx-text { font-size: 0.8125em; font-style: normal; text-transform: uppercase; letter-spacing: 0.06em; color: var(--color-text);
  background: var(--color-surface-alt); padding: 0.2em 0.5em; border-radius: 4px; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.rd-sfx-mark svg { display: inline-block; width: 1.1em; height: 1.1em; margin-right: 0.35em; vertical-align: -0.2em; fill: var(--color-text-muted); }
.rd-verse .rd-row.rd-sfx { text-indent: 0; padding-left: 0; }
/* Act and scene headings: an act opens a page (L1); a scene is a section header (L2). */
.rd-head, .rd-headline {
  font-family: var(--type-section-header-family); font-weight: var(--type-section-header-weight); font-style: normal;
  font-size: 1.25em; line-height: 1.15; color: var(--color-text); margin: 1.4em 0 0.6em; break-after: avoid; break-inside: avoid;
}
.rd-headline { margin-left: 0; }
.rd[data-gutter="true"] .rd-headline { margin-left: 0; }
.rd-head[data-level="act"], .rd-headline[data-level="act"], .rd-head[data-level="part"], .rd-headline[data-level="part"] { font-size: 1.75em; }
.rd[data-layout="pages"] .rd-head[data-level="act"], .rd[data-layout="pages"] .rd-headline[data-level="act"],
.rd[data-layout="pages"] .rd-head[data-level="part"], .rd[data-layout="pages"] .rd-headline[data-level="part"] { break-before: column; margin-top: 0; }
.rd-flow > :first-child { margin-top: 0; }
/* I'm playing: my speeches tinted with a rule in the hue; the cue I come in on underlined in it. */
.rd-sp.rd-mine { position: relative; background: var(--color-surface-alt);
  box-shadow: -10px 0 0 0 var(--color-surface-alt), 10px 0 0 0 var(--color-surface-alt); }
@supports (color: color-mix(in srgb, red 50%, blue)) { .rd-sp.rd-mine { background: color-mix(in srgb, var(--hue) 10%, transparent); box-shadow: -10px 0 0 0 color-mix(in srgb, var(--hue) 10%, transparent), 10px 0 0 0 color-mix(in srgb, var(--hue) 10%, transparent); } }
.rd-sp.rd-mine::before { content: ""; position: absolute; top: 0; bottom: 0; left: -13px; width: 3px; background: var(--hue); }
.rd-cueword { text-decoration: underline 2px var(--mine); text-underline-offset: 0.22em; text-decoration-skip-ink: none; }
.rd-hiding .rd-line:not(.rd-peek) .rd-sp.rd-mine .rd-said {
  color: transparent; background: var(--color-surface-alt); border-radius: 3px;
  -webkit-box-decoration-break: clone; box-decoration-break: clone; user-select: none;
}
@supports (color: color-mix(in srgb, red 50%, blue)) { .rd-hiding .rd-line:not(.rd-peek) .rd-sp.rd-mine .rd-said { background: color-mix(in srgb, var(--hue) 30%, transparent); } }
.rd-hiding .rd-mine:not(.rd-peek) { cursor: pointer; }
.rd-flash { outline: 2px solid var(--color-text); outline-offset: 2px; border-radius: 2px; }
.rd-now .rd-sp, .rd-line.rd-now:not(.rd-speech) { background: var(--color-surface-alt);
  box-shadow: -10px 0 0 0 var(--color-surface-alt), 10px 0 0 0 var(--color-surface-alt); }
@supports (color: color-mix(in srgb, red 50%, blue)) { .rd-now .rd-sp, .rd-line.rd-now:not(.rd-speech) { background: color-mix(in srgb, var(--color-text) 8%, transparent); box-shadow: -10px 0 0 0 color-mix(in srgb, var(--color-text) 8%, transparent), 10px 0 0 0 color-mix(in srgb, var(--color-text) 8%, transparent); } }
.rd-dock { flex-shrink: 0; }
.rd-back-line { align-self: center; margin: var(--space-2) 0; flex-shrink: 0; }
.rd-back-line[hidden] { display: none; }

/* ---- Read along (PLAYS-DESIGN §2.11, WEB-DESIGN §4.16a): the transport takes the bottom bar; the word heard is a fill and a 2 px rule in the speaker's hue ---- */
.rd-bottom.rd-alonging > :not(.rd-transport):not(.rd-page) { display: none; }
.rd-alonging .rd-page { display: none; }
@media (min-width: 860px) { .rd-alonging .rd-page { display: block; } }
.rd-transport { flex: 1; min-width: 0; display: flex; align-items: center; gap: 2px; }
.rd-transport[hidden] { display: none; }
.rd-speaker { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--hue, var(--color-text-muted)); letter-spacing: 0.02em; }
.rd-t-play { display: flex; align-items: center; gap: 6px; }
.rd-t-ico { display: flex; }
.rd-t-ico svg { width: 22px; height: 22px; fill: currentColor; }
.rd-speed { flex: none; min-height: 40px; padding: 0 var(--space-1); border: 1px solid var(--color-border); border-radius: var(--radius-control);
  background: var(--color-background); color: var(--color-text); }
@media (max-width: 399px) { .rd-transport .icon-btn { width: 36px; min-width: 36px; } .rd-t-play { padding: 0 6px; } }
::highlight(rd-w-ink) { background-color: var(--color-surface-alt); text-decoration: underline 2px var(--color-text); text-underline-offset: 0.2em; text-decoration-skip-ink: none; }
@supports (color: color-mix(in srgb, red 50%, blue)) { ::highlight(rd-w-ink) { background-color: color-mix(in srgb, var(--color-text) 22%, transparent); } }
::highlight(rd-w-mystery) { background-color: var(--color-surface-alt); text-decoration: underline 2px var(--color-genre-mystery); text-underline-offset: 0.2em; text-decoration-skip-ink: none; }
@supports (color: color-mix(in srgb, red 50%, blue)) { ::highlight(rd-w-mystery) { background-color: color-mix(in srgb, var(--color-genre-mystery) 30%, transparent); } }
::highlight(rd-w-scifi) { background-color: var(--color-surface-alt); text-decoration: underline 2px var(--color-genre-scifi); text-underline-offset: 0.2em; text-decoration-skip-ink: none; }
@supports (color: color-mix(in srgb, red 50%, blue)) { ::highlight(rd-w-scifi) { background-color: color-mix(in srgb, var(--color-genre-scifi) 30%, transparent); } }
::highlight(rd-w-western) { background-color: var(--color-surface-alt); text-decoration: underline 2px var(--color-genre-western); text-underline-offset: 0.2em; text-decoration-skip-ink: none; }
@supports (color: color-mix(in srgb, red 50%, blue)) { ::highlight(rd-w-western) { background-color: color-mix(in srgb, var(--color-genre-western) 30%, transparent); } }
::highlight(rd-w-serial) { background-color: var(--color-surface-alt); text-decoration: underline 2px var(--color-genre-serial); text-underline-offset: 0.2em; text-decoration-skip-ink: none; }
@supports (color: color-mix(in srgb, red 50%, blue)) { ::highlight(rd-w-serial) { background-color: color-mix(in srgb, var(--color-genre-serial) 30%, transparent); } }
::highlight(rd-w-documentary) { background-color: var(--color-surface-alt); text-decoration: underline 2px var(--color-genre-documentary); text-underline-offset: 0.2em; text-decoration-skip-ink: none; }
@supports (color: color-mix(in srgb, red 50%, blue)) { ::highlight(rd-w-documentary) { background-color: color-mix(in srgb, var(--color-genre-documentary) 30%, transparent); } }
::highlight(rd-w-comedy) { background-color: var(--color-surface-alt); text-decoration: underline 2px var(--color-genre-comedy); text-underline-offset: 0.2em; text-decoration-skip-ink: none; }
@supports (color: color-mix(in srgb, red 50%, blue)) { ::highlight(rd-w-comedy) { background-color: color-mix(in srgb, var(--color-genre-comedy) 30%, transparent); } }
::highlight(rd-w-news) { background-color: var(--color-surface-alt); text-decoration: underline 2px var(--color-genre-news); text-underline-offset: 0.2em; text-decoration-skip-ink: none; }
@supports (color: color-mix(in srgb, red 50%, blue)) { ::highlight(rd-w-news) { background-color: color-mix(in srgb, var(--color-genre-news) 30%, transparent); } }
.rd-main { flex: 1; min-height: 0; display: flex; }
.rd-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rd-rec-btn { color: var(--color-record); border-color: var(--color-record); }
@supports (color: color-mix(in srgb, red 50%, blue)) { .rd-rec-btn { border-color: color-mix(in srgb, var(--color-record) 45%, transparent); } }
.rd-rec-btn svg { fill: currentColor; }

/* ---- Marks on the reader's page (WEB-DESIGN §4.16 item 15, PLAYS-DESIGN §2.10) ---- */
/* Highlights, underlines and a note's rule: the CSS Custom Highlight API, so the words never move. */
::highlight(ed-mk-yellow) { background-color: var(--color-mark-yellow); }
::highlight(ed-mk-green) { background-color: var(--color-mark-green); }
::highlight(ed-mk-blue) { background-color: var(--color-mark-blue); }
::highlight(ed-mk-pink) { background-color: var(--color-mark-pink); }
::highlight(ed-mk-under) { text-decoration-line: underline; text-decoration-thickness: 2px; text-decoration-color: var(--color-text); text-decoration-skip-ink: none; }
::highlight(ed-mk-note) { text-decoration-line: underline; text-decoration-style: dotted; text-decoration-thickness: 2px; text-decoration-color: var(--color-text); }
/* Hide my lines hides a hidden line's marks with its words; a peek shows both. */
.rd-hiding .rd-line:not(.rd-peek) .rd-sp.rd-mine .rd-said::highlight(ed-mk-yellow),
.rd-hiding .rd-line:not(.rd-peek) .rd-sp.rd-mine .rd-said::highlight(ed-mk-green),
.rd-hiding .rd-line:not(.rd-peek) .rd-sp.rd-mine .rd-said::highlight(ed-mk-blue),
.rd-hiding .rd-line:not(.rd-peek) .rd-sp.rd-mine .rd-said::highlight(ed-mk-pink) { background-color: transparent; }
.rd-hiding .rd-line:not(.rd-peek) .rd-sp.rd-mine .rd-said::highlight(ed-mk-under),
.rd-hiding .rd-line:not(.rd-peek) .rd-sp.rd-mine .rd-said::highlight(ed-mk-note) { text-decoration-line: none; }
.rd-hiding .rd-line:not(.rd-peek) .rd-sp.rd-mine .mk { visibility: hidden; }
/* Breath, pause, beat, a note's glyph: empty elements, the glyph drawn here, so no character joins the words. */
.mk { user-select: none; -webkit-user-select: none; cursor: pointer; color: var(--color-text); font-style: normal; text-indent: 0; }
/* Inline, never inline-block: a slash may not start a line (UAX 14), so a mark never wraps away from its word. */
.mk-breath::before, .mk-pause::before, .mk-beat::before {
  position: relative; top: -0.1em; margin: 0 0.14em 0 0.2em; font-size: 1.1em; font-weight: var(--type-body-strong-weight); letter-spacing: -0.06em; }
.mk-breath::before { content: "/"; }
.mk-pause::before { content: "//"; }
.mk-beat::before { content: "//\2060"; }
.mk-beat::after { content: attr(data-label); margin: 0 0.35em 0 0.05em; padding: 0 0.3em; border: 1.5px solid currentColor; border-radius: 4px;
  font-size: 0.8125em; letter-spacing: 0.06em; text-transform: uppercase; font-weight: var(--type-body-strong-weight); white-space: nowrap;
  -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.mk-beat[data-label=""]::after { content: none; }
.mk-pin::before { content: "\2060"; } /* a word joiner: the glyph never wraps away from the words */
.mk-pin svg { display: inline-block; width: 0.95em; height: 0.95em; margin-left: 0.15em; vertical-align: -0.12em; fill: currentColor; }
/* A phone's top bar holds Close, the title and five tools: 40 px tools, no gaps, so the title still reads. */
@media (max-width: 430px) { .rd-top { gap: 0; } .rd-top .rd-icon { width: 40px; } }
/* The mark bar: centered over the page's foot, never beside the selection (the browser's own menu lives there). */
.rd-col { position: relative; }
.mk-host { position: relative; height: 0; z-index: 5; }
.mk-wrap { position: absolute; left: 0; right: 0; bottom: 10px; display: flex; justify-content: center; padding: 0 var(--space-2); pointer-events: none; }
.mk-bar { pointer-events: auto; display: flex; flex-direction: column; gap: 2px; max-width: 100%; padding: 4px; box-sizing: border-box;
  background: var(--color-background); border: 1px solid var(--color-border); border-radius: 14px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.22); }
@supports (color: color-mix(in srgb, red 50%, blue)) { .mk-bar { box-shadow: 0 8px 28px color-mix(in srgb, #000 22%, transparent); } }
.mk-bar[hidden] { display: none; }
.mk-row { display: flex; align-items: center; gap: 2px; }
.mk-btn { flex: none; width: 44px; height: 44px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 10px;
  background: transparent; color: var(--color-text); cursor: pointer; }
.mk-btn:hover { background: var(--color-surface-alt); }
.mk-btn svg { width: 22px; height: 22px; fill: currentColor; }
.mk-btn[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--color-text); }
.mk-text { width: auto; padding: 0 var(--space-4); font: inherit; font-weight: var(--type-body-strong-weight); }
.mk-swatch { flex: none; display: inline-block; width: 22px; height: 22px; border-radius: 50%; background: var(--mk);
  box-shadow: inset 0 0 0 1px var(--color-border); }
@supports (color: color-mix(in srgb, red 50%, blue)) { .mk-swatch { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--color-text) 30%, transparent); } }
.mk-swatch[data-hue="yellow"] { --mk: var(--color-mark-yellow); }
.mk-swatch[data-hue="green"] { --mk: var(--color-mark-green); }
.mk-swatch[data-hue="blue"] { --mk: var(--color-mark-blue); }
.mk-swatch[data-hue="pink"] { --mk: var(--color-mark-pink); }
.mk-kind { display: grid; place-items: center; width: 36px; height: 44px; }
.mk-kind svg { width: 20px; height: 20px; fill: var(--color-text-muted); }
.mk-kind-lab { padding-right: var(--space-2); color: var(--color-text-muted); }
.mk-warn { display: flex; align-items: center; gap: 6px; margin: 0; padding: 4px 8px 2px; color: var(--color-warning); }
.mk-warn svg { flex: none; width: 16px; height: 16px; fill: currentColor; }
/* A beat's label, a note's words. */
.mk-quote { margin: 0 0 var(--space-3); color: var(--color-text-muted); }
.mk-field { width: 100%; box-sizing: border-box; }
.mk-note-field { min-height: 8em; resize: vertical; font: inherit; line-height: 1.45; }
.mk-sheet-acts { display: flex; justify-content: flex-end; gap: var(--space-2); margin-top: var(--space-3); }
.mk-del { margin-right: auto; }
.mk-del svg { width: 18px; height: 18px; fill: currentColor; }
/* The notebook: every mark in script order, then what a revision lost. */
.mk-show { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); min-height: var(--tap); margin-bottom: var(--space-2);
  border-bottom: 1px solid var(--color-border); cursor: pointer; }
.mk-show-box { width: 20px; height: 20px; margin: 0; accent-color: var(--color-secondary); }
.mk-nb-list { list-style: none; margin: 0; padding: 0; }
.mk-nb-row, .mk-nb-lost { display: flex; align-items: flex-start; gap: var(--space-3); width: 100%; padding: var(--space-2); box-sizing: border-box;
  border: 0; border-bottom: 1px solid var(--color-border); background: transparent; color: var(--color-text); font: inherit; text-align: left; }
.mk-nb-row { cursor: pointer; }
.mk-nb-row:hover { background: var(--color-surface-alt); }
.mk-nb-row .mk-swatch, .mk-nb-lost .mk-swatch, .mk-glyph { margin-top: 1px; }
.mk-glyph { flex: none; width: 22px; height: 22px; }
.mk-glyph svg { width: 22px; height: 22px; fill: var(--color-text); }
.mk-nb-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.mk-nb-who { color: var(--color-text-muted); }
.mk-nb-words { overflow-wrap: anywhere; }
.mk-nb-point { font-weight: var(--type-body-strong-weight); }
.mk-nb-extra { color: var(--color-text-muted); white-space: pre-wrap; overflow-wrap: anywhere; }
.mk-nb-label { color: var(--color-text); font-size: var(--type-caption-size); font-weight: var(--type-body-strong-weight); letter-spacing: 0.06em; text-transform: uppercase; }
.mk-nb-h { margin: var(--space-4) 0 var(--space-1); color: var(--color-text-muted); font-weight: var(--type-body-strong-weight); letter-spacing: 0.06em; text-transform: uppercase; }
.mk-nb-del { flex: none; }
.mk-nb-del svg { width: 20px; height: 20px; fill: currentColor; }

/* ---- The studio inside the reader (WEB-DESIGN §4.16 item 14, PLAYS-DESIGN §2.9) ---- */
/* Each of my lines' take state, after the speaker's name: a ring, the ring filled with the count, or the flag. */
.rd-take { display: inline-flex; align-items: center; gap: 0.3em; margin-left: 0.5em; padding: 0.15em 0.35em; border: 0; border-radius: 999px;
  background: transparent; color: var(--hue); font: inherit; font-size: 0.8125em; line-height: 1; vertical-align: 0.05em; cursor: pointer; }
.rd-take:hover { background: var(--color-surface-alt); }
@supports (color: color-mix(in srgb, red 50%, blue)) { .rd-take:hover { background: color-mix(in srgb, var(--hue) 14%, transparent); } }
.rd-take-dot { width: 0.75em; height: 0.75em; border-radius: 50%; border: 1.5px solid currentColor; box-sizing: border-box; }
.rd-take[data-state="chosen"] .rd-take-dot { background: currentColor; }
.rd-take[data-state="none"] { color: var(--color-text-muted); }
.rd-take svg { width: 1em; height: 1em; fill: var(--color-warning); }
.rd-take-n { font-weight: var(--type-body-strong-weight); color: var(--color-text); }
.rd[data-gutter="true"] .rd-take { display: flex; width: max-content; margin: 0.2em 0 0 auto; }
/* Another part's line a device voice reads: the dashed ring (never a face) and the voice's name; a tap casts the part. */
.rd-vc { display: inline-flex; align-items: center; gap: 0.35em; margin-left: 0.5em; padding: 0.15em 0.4em 0.15em 0.15em; border: 0; border-radius: 999px;
  background: transparent; color: var(--color-text-muted); font: inherit; font-size: 0.8125em; line-height: 1; vertical-align: 0.05em; cursor: pointer; }
.rd-vc:hover { background: var(--color-surface-alt); color: var(--color-text); }
@supports (color: color-mix(in srgb, red 50%, blue)) { .rd-vc:hover { background: color-mix(in srgb, var(--hue) 14%, transparent); } }
.rd-vc[hidden] { display: none; }
.rd-vc-ring { display: inline-flex; align-items: center; justify-content: center; width: 1.25em; height: 1.25em; border: 1.5px dashed var(--hue); border-radius: 50%; box-sizing: border-box; }
.rd-vc-ring svg { width: 0.85em; height: 0.85em; fill: var(--hue); }
.rd[data-gutter="true"] .rd-vc { display: flex; width: max-content; margin: 0.2em 0 0 auto; }
/* In the studio a line of mine never splits across pages, so the line being recorded is always whole on screen. */
.rd.rd-studio .rd-line.rd-mine { break-inside: avoid; }
/* Room at each page's head and foot for the current line's outline (the page clips what overflows it). */
.rd.rd-studio[data-layout="pages"] .rd-flow { padding: 8px 0; box-sizing: border-box; }
/* The current line in ink; dashed red while its cue plays, solid red while the microphone is open. */
.rd-line.rd-cur, .rd-line.rd-armed, .rd-line.rd-rec { outline-offset: 6px; border-radius: 2px; }
.rd-line.rd-cur { outline: 2px solid var(--color-text); }
.rd-line.rd-armed { outline: 2px dashed var(--color-record); }
.rd-line.rd-rec { outline: 3px solid var(--color-record); }
/* The dock: the mode, then one status row (or the gate before the first take). */
.st-dock { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-2) var(--space-2) var(--space-1); border-top: 1px solid var(--color-border); }
.st-mode { width: 100%; max-width: 30rem; margin: 0 auto; box-sizing: border-box; }
.st-mode label { min-height: 34px; font-size: var(--type-caption-size); }
.st-status { display: flex; align-items: center; gap: var(--space-2); min-height: 32px; width: 100%; max-width: 30rem; margin: 0 auto; flex-wrap: wrap; }
.st-status > .tabular:first-child { flex: 1; }
.st-takes-btn { min-height: 32px; padding: 0 var(--space-2); border: 1px solid var(--color-border); border-radius: 999px; background: transparent;
  color: var(--color-text); font: inherit; cursor: pointer; white-space: nowrap; }
.st-takes-btn:hover { background: var(--color-surface-alt); }
.st-again-line { min-height: 32px; padding: 0 var(--space-3); }
.st-warn-t { color: var(--color-warning); }
.st-who { color: var(--hue); font-weight: var(--type-body-strong-weight); }
.st-muted { color: var(--color-text-muted); }
.st-rec { display: inline-flex; align-items: center; gap: 6px; color: var(--color-record); font-weight: var(--type-body-strong-weight); white-space: nowrap; }
.st-rec .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--color-record); }
.st-meter { flex: 1; min-width: 80px; height: 28px; margin: 0; padding: 0 var(--space-2); }
.st-count { font-weight: var(--type-body-strong-weight); margin-left: auto; }
.st-gate { display: flex; flex-direction: column; gap: var(--space-2); width: 100%; max-width: 30rem; margin: 0 auto; padding: var(--space-1) 0; }
.st-gate > .body { margin: 0; }
.st-gate > .btn { align-self: flex-start; }
.st-gate-h { display: flex; align-items: center; gap: var(--space-2); }
.st-gate-h > span { display: flex; flex-direction: column; }
.st-gate-icon { width: 28px; height: 28px; flex: none; fill: currentColor; }
.st-why { color: var(--color-text-muted); }
.st-gate-go { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.st-gate-go .pl-check { flex: 1 1 14rem; padding: var(--space-2) var(--space-3); }
.st-go { flex: 1 1 10rem; min-height: var(--tap); }
.st-gate .refusal { margin: 0; }
/* The transport: the bottom bar while the studio is attached. */
.rd-studio .rd-bottom { min-height: 64px; }
.st-transport { flex: 1; display: flex; align-items: center; justify-content: center; gap: var(--space-2); min-width: 0; }
.st-transport:empty { visibility: hidden; }
.st-transport > .btn { flex: 0 1 auto; min-width: 0; white-space: nowrap; padding-left: var(--space-2); padding-right: var(--space-2); }
.st-recbtn { flex: none; width: 52px; height: 52px; box-shadow: 0 0 0 3px var(--color-background), 0 0 0 5px var(--color-record); }
@supports (color: color-mix(in srgb, red 50%, blue)) { .st-recbtn { box-shadow: 0 0 0 3px var(--color-background), 0 0 0 5px color-mix(in srgb, var(--color-record) 40%, transparent); } }
.st-recbtn svg { width: 22px; height: 22px; }
.st-hear[aria-pressed="true"] { color: var(--color-text); background: var(--color-surface-alt); }
.rd[data-studio="wide"] .st-open { display: none; }
/* A review's three buttons take the phone's whole bar. */
@media (max-width: 559px) { .st-reviewing .rd-page, .st-reviewing .st-open, .st-reviewing .rd-tool[aria-pressed] { display: none; } }
/* The panel: beside the script from the spread width, else the Studio sheet. */
.st-side { flex: none; width: 360px; border-left: 1px solid var(--color-border); overflow-y: auto; overscroll-behavior: contain; background: var(--color-background); }
.st-side[hidden] { display: none; }
.st-panel { display: flex; flex-direction: column; gap: var(--space-4); }
.st-side .st-panel { padding: var(--space-4); }
.st-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-2); }
.st-part { color: var(--hue); font-family: var(--type-section-header-family); font-weight: var(--type-section-header-weight); font-size: var(--type-section-header-size); text-transform: uppercase; }
.st-sec { display: flex; flex-direction: column; gap: var(--space-2); }
.st-h { margin: 0; font-size: var(--type-caption-size); font-weight: var(--type-body-strong-weight); letter-spacing: 0.06em; text-transform: uppercase; color: var(--color-text-muted); }
.st-words { margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--color-text-muted); }
.st-take-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.st-take { display: flex; align-items: center; gap: var(--space-2); min-height: var(--tap); border-bottom: 1px solid var(--color-border); }
.st-take-pick { flex: 1; min-width: 0; display: flex; align-items: center; gap: var(--space-2); cursor: pointer; }
.st-take-t { display: flex; flex-direction: column; line-height: 1.25; white-space: nowrap; }
.st-take-pick input { width: 20px; height: 20px; margin: 0; accent-color: var(--color-secondary); flex: none; }
.st-take.on .st-take-pick .body-strong { color: var(--hue); }
.st-flag { width: 18px; height: 18px; fill: var(--color-warning); flex: none; }
.st-take .pl-play-dot { width: 36px; height: 36px; }
.st-cue { flex: none; padding-left: var(--space-2); padding-right: var(--space-2); }
.st-del, .st-del-gap { flex: none; width: 40px; }
.st-del svg { width: 20px; height: 20px; fill: currentColor; }
.st-again { align-self: flex-start; }
.st-acts { align-items: stretch; }
.st-acts .caption { margin: 0; }
.st-keys { display: none; }
.st-side .st-keys { display: grid; grid-template-columns: auto 1fr; gap: 8px 12px; align-items: center; margin: 0; font-size: var(--type-caption-size); }
.st-side .st-keys dd { margin: 0; }
.st-side .st-keys kbd { display: inline-block; min-width: 2em; padding: 4px 7px; border: 1.5px solid var(--color-border); border-bottom-width: 3px;
  border-radius: 6px; font: 600 var(--type-caption-size)/1 var(--font-mono); text-align: center; }
/* The reader's sheets: full screen on a phone, a card from 600 px. */
.rd-sheet { width: 100%; max-width: 100%; height: 100%; max-height: 100%; margin: 0; border: 0; padding: var(--space-4);
  background: var(--color-background); color: var(--color-text); overflow-y: auto; }
.rd-sheet::backdrop { background: var(--color-scrim); opacity: 0.4; }
.rd-sheet-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); margin-bottom: var(--space-3); }
.rd-sheet-head .icon-btn { margin-right: calc(-1 * var(--space-2)); }
@media (min-width: 600px) {
  .rd-sheet { width: 480px; height: fit-content; max-height: 85vh; margin: auto; padding: var(--space-6);
    border-radius: var(--radius-card); border: 1px solid var(--color-border); }
}
.rd-toc { list-style: none; padding: 0; margin: 0; }
.rd-toc-btn { display: block; width: 100%; min-height: var(--tap); padding: var(--space-2) var(--space-2); border: 0; border-radius: var(--radius-control);
  background: transparent; text-align: left; cursor: pointer; }
.rd-toc-btn:hover { background: var(--color-surface-alt); }
.rd-toc-top .rd-toc-btn { font-weight: var(--type-body-strong-weight); }
.rd-toc-scene .rd-toc-btn { padding-left: var(--space-6); }
.rd-toc-btn[aria-current] { background: var(--color-surface-alt); box-shadow: inset 3px 0 0 var(--color-text); }
.rd-q { width: 100%; }
.rd-count { margin: var(--space-2) 0; min-height: 1.2em; }
.rd-hits { list-style: none; padding: 0; margin: 0; }
.rd-hit { display: flex; flex-direction: column; gap: 2px; width: 100%; padding: var(--space-2); border: 0; border-bottom: 1px solid var(--color-border);
  background: transparent; text-align: left; cursor: pointer; }
.rd-hit:hover { background: var(--color-surface-alt); }
.rd-hit mark { background: var(--color-surface-alt); color: inherit; border-radius: 2px; }
@supports (color: color-mix(in srgb, red 50%, blue)) { .rd-hit mark { background: color-mix(in srgb, var(--color-link) 22%, transparent); } }
.rd-size { display: flex; align-items: center; gap: var(--space-2); margin-bottom: var(--space-4); }
.rd-size > .caption { flex: 1; }
.rd-size-btn { min-width: 56px; }
.rd-size-big { font-size: 1.15em; }
.rd-size-lab { min-width: 3.5em; text-align: center; }
.rd-choice { border: 0; padding: 0; margin: 0 0 var(--space-4); }
.rd-choice legend { margin-bottom: var(--space-2); }
.rd-seg { display: flex; gap: 2px; padding: 3px; border: 1px solid var(--color-border); border-radius: var(--radius-control); }
.rd-seg label { flex: 1; position: relative; }
.rd-seg input { position: absolute; opacity: 0; top: 0; right: 0; bottom: 0; left: 0; margin: 0; cursor: pointer; }
.rd-seg span { display: grid; place-items: center; min-height: 40px; border-radius: calc(var(--radius-control) - 3px); font-weight: var(--type-body-strong-weight); color: var(--color-secondary); }
.rd-seg input:checked + span { background: var(--color-primary); color: var(--color-on-primary); }
.rd-seg input:focus-visible + span { outline: 2px solid var(--color-link); outline-offset: 2px; }
/* ---- The device voices' cast (WEB-DESIGN §4.10, §4.16 item 13; PLAYS-DESIGN §2.8) ---- */
.vc-chip { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; min-height: 32px; margin: -6px 0 0 -6px; padding: 0 4px 0 6px;
  border: 0; border-radius: var(--radius-control); background: transparent; color: var(--color-link);
  font: inherit; font-size: var(--type-caption-size); text-align: left; cursor: pointer; }
.vc-chip:hover { background: var(--color-surface-alt); }
@supports (color: color-mix(in srgb, red 50%, blue)) { .vc-chip:hover { background: color-mix(in srgb, var(--color-text) 6%, transparent); } }
.vc-chip-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* In a narrow card the name keeps its line and "Default" (or the speed) wraps under it (Decision 086). */
.vc-chip:has(.vc-chip-tune) { flex-wrap: wrap; column-gap: 4px; row-gap: 0; }
.vc-chip:has(.vc-chip-tune) .vc-chip-name { flex: 0 1 auto; max-width: 100%; }
.vc-chip-tune { flex: none; color: var(--color-text-muted); font-variant-numeric: tabular-nums; }
.vc-chip svg { flex: none; width: 16px; height: 16px; fill: currentColor; }
.vc-chip .vc-warn { fill: var(--color-warning); }
.vc-chip[data-state="off"], .vc-chip[data-state="none"] { color: var(--color-text-muted); }
.vc-sheet .pl-warn { margin-bottom: var(--space-3); }
.vc-steps { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); margin-bottom: var(--space-4); }
.vc-step { display: flex; align-items: center; gap: var(--space-2); flex: 1 1 12rem; }
.vc-step-lab { flex: 1; }
.vc-step-btn { min-width: 44px; padding: 0; font-size: 1.15em; }
.vc-step-val { min-width: 3.2em; text-align: center; }
.vc-group { margin: 0 0 var(--space-1); color: var(--color-text-muted); font-weight: var(--type-body-strong-weight); }
.vc-list { list-style: none; padding: 0; margin: 0; }
.vc-row { display: flex; align-items: center; gap: var(--space-1); border-bottom: 1px solid var(--color-border); }
.vc-pick { flex: 1; min-width: 0; display: flex; align-items: center; gap: var(--space-2); min-height: var(--tap); padding: var(--space-1) 0; cursor: pointer; }
.vc-pick input { flex: none; width: 20px; height: 20px; margin: 0; accent-color: var(--color-primary); }
.vc-name { min-width: 0; overflow-wrap: anywhere; }
.vc-lang { flex: none; color: var(--color-text-muted); }
.vc-hear svg { width: 22px; height: 22px; }
.vc-more-voices { margin: var(--space-3) 0 0; color: var(--color-text-muted); }
.vc-cast-list { list-style: none; padding: 0; margin: 0 0 var(--space-3); }
.vc-cast-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); min-height: var(--tap);
  padding: var(--space-1) 0; border-bottom: 1px solid var(--color-border); }
.vc-cast-part { display: flex; flex-direction: column; min-width: 0; }
.vc-cast-part .caption { color: var(--color-text-muted); }
.vc-cast-who { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--color-text-muted); }
.vc-cast-row .vc-chip { margin: 0; flex: 0 1 auto; min-width: 0; }
/* Settings > Voices (Decision 086; WEB-DESIGN §4.11a): Kokoro's download, the Default speed, the Default order. */
.vs-voices { margin-top: var(--space-5); }
.vs-head { margin: 0 0 var(--space-2); }
.vs-hifi { margin-bottom: var(--space-3); }
.vs-hifi:empty { display: none; }
.vs-hifi-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-1) var(--space-3); min-height: var(--tap); }
.vs-hifi .caption { margin: var(--space-1) 0 0; }
/* Better voices at first launch (WEB-DESIGN §4.11b): a bottom sheet on a phone, the reader's card from 600 px. */
.vstep { height: fit-content; margin: auto 0 0; border-top: 1px solid var(--color-border);
  border-radius: var(--radius-card) var(--radius-card) 0 0; padding-bottom: calc(var(--space-4) + env(safe-area-inset-bottom)); }
.vstep .section-header { margin: 0 0 var(--space-2); }
.vstep-fact { margin: 0 0 var(--space-4); }
.vstep-actions { display: flex; justify-content: flex-end; }
@media (min-width: 600px) { .vstep { margin: auto; border-radius: var(--radius-card); } }
.vs-progress { display: block; width: 100%; height: 6px; margin-top: var(--space-2); accent-color: var(--color-primary); }
.vs-credit, .vs-order { color: var(--color-text-muted); }
.vs-order { margin: 0 0 var(--space-3); }
.vs-name { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.vs-name .vc-lang { flex: none; }
.vs-move svg { width: 22px; height: 22px; }
.vs-row .icon-btn { flex: none; }
.vs-device { margin-top: var(--space-3); }
.vs-device > summary { padding: var(--space-2) 0; cursor: pointer; }
.vc-top { margin-bottom: var(--space-3); }
.rd-voice-now { display: flex; align-items: center; gap: 6px; margin: 0; padding: var(--space-2) var(--space-4); color: var(--color-text-muted);
  border-top: 1px solid var(--color-border); }
.rd-voice-now svg { width: 16px; height: 16px; fill: currentColor; flex: none; }
.rd-tool svg { width: 20px; height: 20px; fill: currentColor; }

/* Read on a play tile: over the window's corner, outside the link, as Play on an episode tile. */
.pl-tile-li { position: relative; }
.g-tile-read { position: absolute; top: 12px; right: 12px; width: 40px; height: 40px; min-width: 40px; min-height: 40px;
  background: var(--color-background); color: var(--color-text); box-shadow: 0 0 0 1px var(--color-border); }
.g-tile-read:hover:not(:disabled) { background: var(--color-surface); }
.g-tile-read svg { width: 22px; height: 22px; }
.pl-more { height: 1px; }

/* ---- Reading together (WEB-DESIGN §4.17): the join page and the room bar on the reader ---- */
.rr-page { max-width: 560px; margin: 0 auto; padding: var(--space-6) var(--space-4); display: flex; flex-direction: column; gap: var(--space-3); }
#view-readroom { overflow-y: auto; }
.rr-code { font-family: var(--type-page-title-family); font-size: var(--type-page-title-size); font-weight: var(--type-page-title-weight); font-variant-numeric: tabular-nums; letter-spacing: 0.12em; margin: 0; }
.rr-go { align-self: flex-start; }
.rr-name-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: var(--space-2); }
.rr-name { width: 100%; justify-content: center; }
.check { display: inline-flex; align-items: center; gap: var(--space-2); min-height: 36px; }
.rr-bar { flex-shrink: 0; border-top: 1px solid var(--color-border); padding: var(--space-2) var(--space-3); display: flex; flex-direction: column; gap: var(--space-1); background: var(--color-background); }
.rr-row { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.rr-fact { flex: 1 1 auto; min-width: 0; margin: 0; }
.rr-here { margin-left: auto; color: var(--color-text-muted); }
.rr-warn { margin: 0; color: var(--color-warning); }
.rr-warn:empty { display: none; }
.rr-lead { display: flex; gap: var(--space-2); flex: 1 1 auto; }
.rr-lead[hidden] { display: none; }
.rr-lead .btn { min-height: 44px; }
.rr-next { flex: 1 1 auto; max-width: 240px; }
.rr-menu { position: relative; }
.rr-menu[hidden] { display: none; }
.rr-menu summary { list-style: none; cursor: pointer; }
.rr-menu summary::-webkit-details-marker { display: none; }
.rr-menu-body { position: absolute; right: 0; bottom: calc(100% + var(--space-2)); z-index: 5; min-width: 220px; padding: var(--space-3); display: flex; flex-direction: column; gap: var(--space-2);
  background: var(--color-background); border: 1px solid var(--color-border); border-radius: 8px; }
.rr-end { color: var(--color-error); }
/* Record in the room (§4.17 item 9): red only while this device records (Decision 064). */
.rr-rec[hidden] { display: none; }
.rr-rec-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--color-record); flex-shrink: 0; }
.rr-quiet { margin: 0; color: var(--color-text-muted); }
.rr-name-field { display: flex; flex-direction: column; max-width: 320px; }
.rr-name-field[hidden] { display: none; }
.rr-pair { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.rr-pair-input { flex: 1 1 8em; min-width: 0; text-transform: uppercase; font-variant-numeric: tabular-nums; }
.rr-pair-input::placeholder { text-transform: none; }
.rr-menu-body .rd-choice { display: flex; flex-direction: column; gap: var(--space-1); }
.rr-pair .caption { flex-basis: 100%; margin: 0; }
.rr-counts { margin: 0 0 var(--space-2); }
.rr-takes-sheet .rd-sheet-head { position: sticky; top: calc(-1 * var(--space-4)); z-index: 1; background: var(--color-background); padding-top: var(--space-2); }
@media (min-width: 600px) { .rr-takes-sheet .rd-sheet-head { top: calc(-1 * var(--space-6)); } }
.rr-take-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.rr-take-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-1) var(--space-2); padding: var(--space-2) 0; border-bottom: 1px solid var(--color-border); }
.rr-take-row .cast-main { display: flex; flex-direction: column; min-width: 0; }
.rr-take-words { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rr-take-state { align-self: start; color: var(--color-text-muted); }
.rr-take-row[data-state="recorded"] .rr-take-state { color: var(--color-text); }
.rr-take-acts { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: var(--space-1); }
.rr-take-acts:empty { display: none; }
.rr-again-note summary { list-style: none; cursor: pointer; }
.rr-again-note summary::-webkit-details-marker { display: none; }
.rr-again-note form { display: flex; gap: var(--space-2); margin-top: var(--space-1); }
.rr-take-foot { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; margin-top: var(--space-3); }
.rr-publish { display: flex; flex-direction: column; gap: var(--space-2); flex-basis: 100%; }
.rs-pair .rs-page { align-items: center; text-align: center; }
.rs-pair .rs-status { flex: 0 0 auto; }
.rs-pair-code { font-family: var(--type-page-title-family); font-weight: var(--type-page-title-weight); font-size: clamp(3rem, 12vw, 9rem); letter-spacing: 0.12em; margin: 0; }

/* ---- The shared screen (§4.18): the current line large, presence and the code in a corner ---- */
body.read-screen .tabbar, body.read-screen .sidebar, body.read-screen .site-footer, body.read-screen #now-playing-bar { display: none; }
.rs { min-height: 100vh; display: flex; flex-direction: column; background: var(--color-background); }
.rs-page { flex: 1; max-width: 1100px; width: 100%; margin: 0 auto; padding: var(--space-8) var(--space-6); display: flex; flex-direction: column; justify-content: center; gap: var(--space-6); }
.rs-line { margin: 0; }
.rs-line p { margin: 0; }
.rs-after { display: flex; flex-direction: column; gap: var(--space-3); }
.rs-near .rs-words { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.rs-near { color: var(--color-text-muted); }
.rs-near .rs-words { font-size: var(--type-section-header-size); line-height: 1.35; }
.rs-who { font-family: var(--type-section-header-family); font-weight: var(--type-section-header-weight); font-size: var(--type-section-header-size); text-transform: uppercase; letter-spacing: 0.04em; margin: 0 0 var(--space-1); }
.rs-who[data-hue="drama"] { color: var(--color-genre-drama); } .rs-who[data-hue="mystery"] { color: var(--color-genre-mystery); }
.rs-who[data-hue="scifi"] { color: var(--color-genre-scifi); } .rs-who[data-hue="western"] { color: var(--color-genre-western); }
.rs-who[data-hue="comedy"] { color: var(--color-genre-comedy); } .rs-who[data-hue="news"] { color: var(--color-genre-news); }
.rs-who[data-hue="documentary"] { color: var(--color-genre-documentary); } .rs-who[data-hue="serial"] { color: var(--color-genre-serial); }
.rs-current .rs-words { font-family: var(--type-page-title-family); font-weight: var(--type-page-title-weight); font-size: clamp(1.75rem, 4.2vw, 3.5rem); line-height: 1.2; }
.rs-foot { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; padding: var(--space-3) var(--space-6); border-top: 1px solid var(--color-border); }
.rs-status { margin: 0; flex: 1 1 auto; color: var(--color-warning); }
.rs-corner { margin-left: auto; display: flex; align-items: baseline; gap: var(--space-3); }
.rs-code { font-family: var(--type-page-title-family); font-size: var(--type-page-title-size); font-weight: var(--type-page-title-weight); letter-spacing: 0.12em; }

/* ---- The class page and the casting board (§4.19) ---- */
#class-body { max-width: 760px; }
.cl-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-2) var(--space-3); margin-bottom: var(--space-4); }
.cl-head .view-heading { flex: 1 0 100%; margin: 0; }
.cl-code { font-variant-numeric: tabular-nums; letter-spacing: 0.08em; margin: 0; }
.cl-code-big { font-family: var(--type-page-title-family); font-weight: var(--type-page-title-weight); font-size: clamp(3rem, 14vw, 9rem); letter-spacing: 0.08em; text-align: center; margin: var(--space-8) 0; }
.cl-waiting { margin: 0 0 var(--space-3); }
.cl-waiting:empty { display: none; }
.cl-start { align-items: center; flex-wrap: wrap; }
.cl-modes { display: flex; gap: var(--space-3); margin: 0; }
.cl-modes legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.cl-seat-tools { margin-left: auto; display: flex; gap: var(--space-1); }
#class-body .cast-main { flex: 1 1 0; min-width: 0; }
.cl-play .cast-row { flex-wrap: nowrap; }
.cl-add { display: flex; flex-direction: column; gap: var(--space-2); margin-top: var(--space-2); }
.cl-auth { display: flex; flex-direction: column; gap: var(--space-3); max-width: 32rem; }
.cl-auth .field { display: flex; flex-direction: column; gap: var(--space-1); }
.cl-ends { margin-bottom: var(--space-2); }
.cl-names { width: 100%; resize: vertical; font: inherit; }
.cl-refused { margin: 0; padding: 0; list-style: none; }
.cl-plays { list-style: none; margin: 0 0 var(--space-3); padding: 0; }
.cl-play .cast-row { justify-content: space-between; }
.cl-prog { list-style: none; margin: 0; padding: 0 0 var(--space-2); }
.cl-prog-row { display: flex; justify-content: space-between; gap: var(--space-3); padding: var(--space-1) 0; }
.cl-review-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--color-border); }
.cl-review-row { padding: var(--space-3) 0; border-bottom: 1px solid var(--color-border); display: flex; flex-direction: column; gap: var(--space-2); }
.cl-review-row p { margin: 0; }
.cl-review-acts { margin: 0; }
.cl-review-line { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.cb-seats { list-style: none; margin: 0 0 var(--space-3); padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-2); }
.cb-chip { display: flex; flex-direction: column; padding: var(--space-2) var(--space-3); border: 1px solid var(--color-border); border-radius: 8px; cursor: grab; background: var(--color-background); }
.cb-tools { margin: 0 0 var(--space-3); }
.cb-parts { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--color-border); }
.cb-part { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); padding: var(--space-2) 0; border-bottom: 1px solid var(--color-border); }
.cb-part.cb-over { outline: 2px solid var(--color-link); outline-offset: -2px; }
.cb-part-main { flex: 1 1 240px; display: flex; flex-direction: column; min-width: 0; }
.cb-part-acts { display: flex; gap: var(--space-2); align-items: center; }
.cb-sel { min-width: 140px; }
.cb-name[data-hue="drama"] { color: var(--color-genre-drama); } .cb-name[data-hue="mystery"] { color: var(--color-genre-mystery); }
.cb-name[data-hue="scifi"] { color: var(--color-genre-scifi); } .cb-name[data-hue="western"] { color: var(--color-genre-western); }
.cb-name[data-hue="comedy"] { color: var(--color-genre-comedy); } .cb-name[data-hue="news"] { color: var(--color-genre-news); }
.cb-name[data-hue="documentary"] { color: var(--color-genre-documentary); } .cb-name[data-hue="serial"] { color: var(--color-genre-serial); }

/* Relay across time: a performer's takes with their state (PLAYS-DESIGN §12.11, WEB-DESIGN §4.20) */
.parts-prod { margin-bottom: var(--space-4); }
.parts-part { margin-bottom: var(--space-3); }
.parts-line { display: grid; grid-template-columns: 1fr; gap: var(--space-1); }
@media (min-width: 640px) { .parts-line { grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: var(--space-3); } }

/* ---- Adding and correcting a script (WEB-DESIGN §4.21, Decision 088.3): the reader's bar grammar, full height ---- */
body.scripting .tabbar { display: none; }
body.scripting #main-content { overflow: hidden; }
body.scripting .site-footer { display: none; }
#own-body { height: 100%; }
#own-body > .state { padding: var(--space-6) var(--space-4); }
.os { height: 100%; display: flex; flex-direction: column; min-width: 0; background: var(--color-background); }
.os-bar { min-height: 56px; padding: 0 var(--space-2); }
.os-next { flex: none; }
.os-drop { outline: 2px dashed var(--color-link); outline-offset: -6px; }
/* The text */
.os-add { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: var(--space-1); width: 100%; max-width: 760px; margin: 0 auto;
  padding: var(--space-4) var(--space-4) var(--space-3); overflow-y: auto; }
.os-text-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); margin-top: var(--space-2); }
.os-ways { display: flex; flex-wrap: wrap; justify-content: flex-end; }
.os-ways .btn { padding: 0 var(--space-2); white-space: nowrap; }
.os-text { flex: 1; min-height: 160px; padding: var(--space-3); line-height: 1.5; resize: none; font-family: inherit; color: inherit; }
.os-foot { flex: none; min-height: 40px; padding: var(--space-2) var(--space-4); border-top: 1px solid var(--color-border); text-align: center; }
.os-foot p { margin: 0; }
.os-count { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 var(--space-2); }
.os-count .tabular { font-size: inherit; }
.os-count > :empty { display: none; }
.os-count > :not(:empty) + :not(:empty)::before { content: "· "; }
.os-count { gap: 0 0.35em; }
/* The parts page */
.os-title-btn { display: block; width: 100%; min-height: var(--tap); padding: 0; border: 0; background: transparent; color: inherit; text-align: left; cursor: pointer; }
.os-title-btn > span { display: block; }
.os-title-btn:hover .rd-title { text-decoration: underline; }
.os-problem { flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); padding: var(--space-2) var(--space-4);
  background: var(--color-error-surface); color: var(--color-error); }
.os-strip { flex: none; border-bottom: 1px solid var(--color-border); }
.os-strip-in { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); max-width: 760px; margin: 0 auto; padding: 2px var(--space-4); }
.os-strip-t { margin: 0; color: var(--color-warning); }
.os-strip-next { margin-right: calc(-1 * var(--space-4)); }
.os-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.os-page { max-width: 760px; margin: 0 auto; padding: var(--space-4) var(--space-4) 40vh; }
.os-chips, .os-acts { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.os-chips { margin-bottom: var(--space-4); }
.os-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; min-height: var(--tap); padding: 0 var(--space-3); border: 1px solid var(--color-border);
  border-radius: 22px; background: var(--color-background); color: var(--color-text); font-size: var(--type-body-size); text-align: left; cursor: pointer; }
.os-chip .body-strong { overflow-wrap: anywhere; }
.os-chip:hover { background: var(--color-surface-alt); }
.os-chip[aria-pressed="true"] { border-color: var(--color-text); box-shadow: inset 0 0 0 1px var(--color-text); }
.os-plain, .os-n { color: var(--color-text-muted); }
.os-chip svg { width: 18px; height: 18px; fill: currentColor; }
.os-dot { flex: none; width: 12px; height: 12px; border-radius: 50%; background: var(--hue); }
/* Drawn by window: fifty lines a block, laid out and painted only near the screen, always in the page. */
.os-block { content-visibility: auto; contain-intrinsic-size: auto 3600px; }
.os-block.os-far { content-visibility: hidden; }
.os-list { line-height: 1.5; }
.os-line { position: relative; margin: 0 calc(-1 * var(--space-2)); padding: 6px var(--space-2); min-height: var(--tap); border-radius: var(--radius-control); cursor: pointer; }
.os-line:hover { background: var(--color-surface); }
.os-line:focus-visible { outline-offset: -2px; }
.os-line .rd-sp, .os-line .rd-line { margin-bottom: 0; }
.os-line .rd-headline { margin: 0.6em 0 0; }
.os-open { margin: var(--space-2) 0; padding: 2px var(--space-3) var(--space-3); border: 1px dashed var(--color-warning); border-radius: var(--radius-control); }
.os-open .os-acts { margin-top: var(--space-1); }
.os-nopart { display: block; color: var(--color-warning); font-weight: var(--type-body-strong-weight); }
.os-words { display: block; overflow-wrap: break-word; }
.os-verse { white-space: pre-line; }
/* The sheets: at the foot on a phone, centered from 860 px. */
.os-sheet { width: 100%; max-width: 100%; max-height: 85vh; margin: auto 0 0; padding: 0; border: 0; border-radius: 16px 16px 0 0;
  background: var(--color-background); color: var(--color-text); overflow-y: auto; }
.os-sheet::backdrop { background: var(--color-scrim); opacity: 0.4; }
.os-sheet-in { display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-3) var(--space-4) var(--space-4); }
.os-sheet-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.os-sheet-head .section-header { margin: 0; overflow-wrap: anywhere; }
.os-sheet-head .icon-btn { margin: 0 calc(-1 * var(--space-2)) 0 auto; }
.os-sheet-top { margin-bottom: calc(-1 * var(--space-3)); }
.os-part-h { color: var(--hue); }
.os-cutline { margin: 0; overflow-wrap: break-word; line-height: 1.9; max-height: 34vh; overflow-y: auto; border-radius: var(--radius-control); }
.os-cutline[role="slider"] { cursor: text; touch-action: pan-y; }
.os-cut { display: inline-block; width: 3px; height: 1.4em; margin: 0 2px; vertical-align: -0.3em; border-radius: 2px; background: var(--color-link); }
.os-four { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2); }
.os-four .btn { padding: 0 var(--space-2); text-align: center; line-height: 1.2; }
.os-edit { min-height: 160px; max-height: 50vh; padding: var(--space-3); line-height: 1.5; font-family: inherit; color: inherit; resize: vertical; }
.os-form { display: flex; flex-direction: column; gap: var(--space-2); margin: 0; }
.os-form-row { display: flex; gap: var(--space-2); }
.os-form-row .field-input { flex: 1 1 auto; min-width: 0; }
.os-form-row .btn { flex: none; }
.os-lab, .os-form p, .os-sheet-in > p.refusal { margin: 0; }
.os-more:empty { display: none; }
@media (min-width: 860px) {
  .os-sheet { width: 560px; max-height: 80vh; margin: auto; border: 1px solid var(--color-border); border-radius: var(--radius-card); }
  .os-sheet.os-small { width: 440px; }
  .os-sheet-in { padding: var(--space-4) var(--space-6) var(--space-6); }
}
/* An own script's page, and its way in. */
.os-own { margin-top: var(--space-2); }
/* A shared own script's rows on its cast sheet (§4.21 item 10), and a class play whose script was not sent. */
.own-share { margin-top: var(--space-4); }
.own-share > p { margin: 0 0 2px; }
.own-share .actions, .own-share .report-form { margin-top: var(--space-2); }
.cl-own { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); padding: var(--space-2) 0; }
.cl-own > p:empty { display: none; }
.cl-own > p { margin: 0; }
.os-state { flex: 1; padding: var(--space-4); }
.os-title-btn:disabled { cursor: default; }
.os-title-btn:disabled .rd-title { text-decoration: none; }

/* ---- Casting an episode by ear (WEB-DESIGN §4.22): the lines, and the parts with the transport at the foot of a phone, a rail from 860 px ---- */
body.casting .player { display: none; }
.ec-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.ec-lines { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.ec-page { padding-bottom: 30vh; }
.ec-auto { margin: 0 0 var(--space-1); }
.ec-note { flex: none; margin: 0; padding: var(--space-2) var(--space-4); border-bottom: 1px solid var(--color-border); }
.ec-note[hidden] { display: none; }
.ec-state { flex: 1; padding: var(--space-4); }
.ec-list { line-height: 1.5; }
.ec-line { margin: 0 calc(-1 * var(--space-2) - 2px); padding: 4px var(--space-2); min-height: 32px; border: 2px solid transparent; border-radius: var(--radius-control); cursor: pointer; }
.ec-line:hover { background: var(--color-surface); }
.ec-line:focus-visible { outline-offset: -2px; }
.ec-line .rd-name { display: block; }
.ec-words { display: block; overflow-wrap: break-word; }
.ec-uncast .ec-words, .ec-out .ec-words, .ec-out .rd-name { color: var(--color-text-muted); }
.ec-out .ec-words { text-decoration: line-through; }
.ec-aside .ec-words { font-style: italic; }
.ec-lit .ec-line { border-color: var(--color-text); background: var(--color-surface); }
.ec-lit .ec-words { color: var(--color-text); }
.ec-back-line { position: absolute; left: 50%; bottom: var(--space-3); transform: translateX(-50%); box-shadow: 0 2px 8px rgb(0 0 0 / 0.16); }
.ec-back-line[hidden] { display: none; }
.ec-dock { flex: none; display: flex; flex-direction: column; border-top: 1px solid var(--color-border); background: var(--color-background); }
.ec-dock-parts { display: flex; flex-wrap: wrap; gap: var(--space-2); padding: var(--space-2) var(--space-3) 0; }
.ec-parts, .ec-verbs, .ec-part { display: contents; }
/* Five parts and more: two rows that scroll, and the verbs always in reach under them. */
.ec-many .ec-parts { display: flex; flex-wrap: wrap; gap: var(--space-2); width: 100%; max-height: 96px; overflow-y: auto; overscroll-behavior: contain; }
.ec-many .ec-verbs { display: flex; gap: var(--space-2); }
.ec-who { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; min-height: var(--tap); padding: 0 var(--space-3); border: 1px solid var(--color-border); border-radius: 22px;
  background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.ec-who:hover { background: var(--color-surface-alt); }
.ec-who[aria-pressed="true"] { border-color: var(--color-text); box-shadow: inset 0 0 0 1px var(--color-text); }
.ec-verb:disabled { opacity: 0.45; cursor: default; }
.ec-verb[aria-pressed="true"] { border-color: var(--color-text); box-shadow: inset 0 0 0 1px var(--color-text); }
.ec-name { min-width: 0; overflow-wrap: anywhere; }
.ec-num, .ec-who .pl-face, .ec-n, .ec-hear { display: none; }
.ec-transport { display: grid; grid-template-columns: 1fr auto 64px auto 1fr; align-items: center; padding: var(--space-2) var(--space-3); }
.ec-transport > .ec-time { grid-column: 1; }
.ec-transport > .icon-btn:not(.ec-play) { grid-column: 2; margin-right: var(--space-4); }
.ec-play { grid-column: 3; width: 56px; height: 56px; justify-self: center; }
.ec-play svg { width: 28px; height: 28px; }
.ec-play .i-pause, .ec-play.is-playing .i-play { display: none; }
.ec-play.is-playing .i-pause { display: block; }
.ec-speed { grid-column: 4 / span 2; justify-self: end; min-height: var(--tap); min-width: 72px; padding: 0 var(--space-2); border: 0; border-radius: var(--radius-control); background: transparent; color: var(--color-link);
  font: inherit; font-weight: var(--type-body-strong-weight); cursor: pointer; }
@media (min-width: 860px) {
  .ec-body { flex-direction: row; }
  .ec-lines .os-page { max-width: 860px; padding-left: var(--space-8, 48px); padding-right: var(--space-6); }
  .ec-dock { width: 340px; border-top: 0; border-left: 1px solid var(--color-border); }
  .ec-dock-parts { flex: 1; min-height: 0; flex-direction: column; flex-wrap: nowrap; gap: 0; padding: var(--space-3) var(--space-5, 20px); }
  .ec-parts, .ec-many .ec-parts { display: block; flex: 0 1 auto; min-height: 0; max-height: none; overflow-y: auto; }
  .ec-part { display: flex; align-items: center; gap: var(--space-1); border-bottom: 1px solid var(--color-border); }
  .ec-who { flex: 1; min-width: 0; gap: var(--space-3); min-height: 60px; padding: var(--space-1); border: 0; border-radius: var(--radius-control); }
  .ec-who[aria-pressed="true"] { background: var(--color-surface-alt); box-shadow: inset 0 0 0 2px var(--color-text); }
  .ec-who .os-dot { display: none; }
  .ec-num, .ec-n { display: block; }
  .ec-num { flex: none; width: 26px; padding: 2px 0; border: 1px solid var(--color-border); border-radius: 6px; text-align: center; }
  .ec-num:empty { visibility: hidden; }
  .ec-who .pl-face { display: inline-flex; }
  .ec-name .body-strong { display: block; }
  .ec-hear { display: inline-flex; }
  .ec-verbs, .ec-many .ec-verbs { flex: none; display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); margin-top: var(--space-4); }
  .ec-verb { justify-content: center; border-radius: var(--radius-control); }
  .ec-transport { padding: var(--space-3) var(--space-5, 20px); }
}
.os-own p { margin: 0 0 2px; }
.os-add-link svg { width: 20px; height: 20px; fill: currentColor; }

/* ---- Finding a play (B31 §3, WEB-DESIGN §4.15 item 3): search, facet chips, the ways in, Filters ---- */
.pl-search-form { position: relative; margin: var(--space-2) 0 var(--space-3); }
.pl-search-form > svg { position: absolute; left: 12px; top: 50%; width: 20px; height: 20px; transform: translateY(-50%); fill: var(--color-text-muted); pointer-events: none; }
.pl-search-form .pl-search { width: 100%; padding-left: 40px; }
/* The facets are native selects drawn as chips, one row that scrolls sideways on a phone. */
.pl-facets { display: flex; gap: var(--space-2); overflow-x: auto; margin: 0 calc(-1 * var(--space-4)) var(--space-4); padding: 2px var(--space-4) var(--space-2); scrollbar-width: none; }
.pl-facets::-webkit-scrollbar { display: none; }
@media (min-width: 768px) { .pl-facets { flex-wrap: wrap; overflow: visible; margin-left: 0; margin-right: 0; padding-left: 0; padding-right: 0; } }
.pl-facet { flex: none; position: relative; display: inline-flex; }
.pl-facet select, .pl-facet-btn { appearance: none; -webkit-appearance: none; min-height: 36px; padding: 0 30px 0 14px; border-radius: 999px;
  border: 1px solid var(--color-border); background: var(--color-background); color: var(--color-text); font: inherit; font-size: var(--type-caption-size);
  font-weight: var(--type-body-strong-weight); cursor: pointer; max-width: 70vw; text-overflow: ellipsis; field-sizing: content; }
label.pl-facet::after { content: ""; position: absolute; right: 13px; top: 50%; width: 6px; height: 6px; margin-top: -5px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); pointer-events: none; }
.pl-facet-btn { display: inline-flex; align-items: center; padding-right: 14px; }
.pl-facet.on select, .pl-facet-btn.on { background: var(--color-text); color: var(--color-background); border-color: var(--color-text); }
label.pl-facet.on::after { color: var(--color-background); }
.pl-count { margin-left: 6px; font-family: var(--font-body); font-weight: 400; color: var(--color-text-muted); }
.pl-all { color: var(--color-link); text-decoration: none; }
.pl-by { margin: calc(-1 * var(--space-1)) 0 var(--space-2); color: var(--color-text-muted); }
.pl-note { margin: 0 0 var(--space-3); max-width: 60ch; }
.pl-said { font-style: italic; color: var(--color-text); overflow-wrap: anywhere; }
.pl-row .g-tile-read { position: static; flex: none; }
/* A scene for N voices: a card on the surface, its heading and minutes, the play's name, the parts. */
.pl-scard-rail { grid-auto-columns: minmax(200px, 64%); }
@media (min-width: 768px) { .pl-scard-rail { grid-auto-columns: 220px; } }
.pl-scard-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--space-3); margin: 0; padding: 0; list-style: none; }
.pl-scard { display: flex; flex-direction: column; gap: 4px; height: 100%; box-sizing: border-box; padding: var(--space-3); border-radius: 8px;
  background: var(--color-surface-alt); color: var(--color-text); text-decoration: none; box-shadow: inset 0 0 0 1px var(--color-border); }
.pl-scard-kick { text-transform: uppercase; letter-spacing: 0.08em; color: var(--color-text-muted); }
.pl-scard-title { font-family: var(--font-display); font-weight: 700; font-size: var(--type-body-size); text-transform: uppercase; line-height: 1.15;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; overflow-wrap: anywhere; }
.pl-scard-parts { color: var(--color-text-muted); }
.pl-scard:hover .pl-scard-title { text-decoration: underline; }
/* A scene that records (PLAYS-DESIGN §2.12): the card is the door, Read sits on its corner outside it. */
.pl-scard-li { position: relative; }
button.pl-scard { width: 100%; font: inherit; text-align: left; border: 0; cursor: pointer; padding-right: 56px; }
button.pl-scard:disabled { opacity: 0.6; cursor: progress; }
.pl-scard-mic { display: inline-flex; vertical-align: -3px; margin-right: 4px; }
.pl-scard-mic svg { width: 18px; height: 18px; fill: currentColor; }
.pl-scard-li .g-tile-read { top: 8px; right: 8px; }
/* Filters: every facet as chips, counted against the others. */
.pl-filters .rd-sheet-head { position: sticky; top: calc(-1 * var(--space-4)); z-index: 1; background: var(--color-background); padding: var(--space-2) 0; }
.pl-filter-group { border: 0; margin: 0 0 var(--space-4); padding: 0; min-width: 0; }
.pl-filter-legend { padding: 0; margin-bottom: var(--space-2); text-transform: uppercase; letter-spacing: 0.08em; color: var(--color-text-muted); }
.pl-chips { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.pl-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--color-border);
  background: var(--color-background); color: var(--color-text); font: inherit; font-size: var(--type-caption-size); font-weight: var(--type-body-strong-weight); cursor: pointer; max-width: 100%; }
.pl-chip > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-chip-n { font-weight: 400; color: var(--color-text-muted); }
.pl-chip[aria-pressed="true"] { background: var(--color-text); color: var(--color-background); border-color: var(--color-text); }
.pl-chip[aria-pressed="true"] .pl-chip-n { color: inherit; opacity: 0.8; }

/* ---- Stage directions and Sound as parts; the sound board (WEB-DESIGN §4.16 item 14a, B32) ---- */
.rd-take-end { float: right; margin: 0 0 0 0.5em; font-style: normal; }
.rd-take[data-state="silent"] .rd-take-dot { border-style: dashed; }
.rd-take[data-state="silent"] { color: var(--color-text-muted); }
.sb-host > .sb-ring { margin-left: 0.5em; vertical-align: 0.05em; color: var(--color-text); }
.sb-ring .rd-take-dot, .rd-take-end .rd-take-dot { width: 1em; height: 1em; }
.sb-words .rd-sfx-mark { flex: none; }
.rd-line.rd-cue.sb-host, .rd-sfx.sb-host, .sb-added { display: block; }
.sb-added { margin: 0.35em 0 0; font-style: normal; }
.sb-list { display: flex; flex-direction: column; gap: 2px; margin: 0.3em 0 0 1.45em; font-style: normal; text-transform: none; letter-spacing: 0; }
.sb-snd { display: inline-flex; align-items: center; gap: 0.35em; color: var(--color-text); }
.sb-snd svg { width: 1.1em; height: 1.1em; flex: none; fill: currentColor; }
.sb-snd-t { font-weight: var(--type-body-strong-weight); }
.rd .sb-cur { outline: 2px solid var(--color-text); outline-offset: 5px; border-radius: 4px; }
.rd .sb-cur.sb-rec { outline: 3px solid var(--color-record); }
.rd-line.sb-bed { position: relative; }
.rd-line.sb-bed::after { content: ""; position: absolute; top: -0.35em; bottom: -0.35em; left: -13px; width: 3px; background: var(--color-text-muted); }
.sb-dock-t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-dock .st-status { flex-wrap: nowrap; }
.sb-dock .st-status > .tabular:first-child { flex: none; }
.sb-panel { gap: var(--space-3); }
.sb-part { color: var(--color-text); }
.sb-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.sb-done { min-height: 36px; padding: 0 var(--space-2); }
.st-side .sb-done { display: none; }
.sb-words { margin: 0; display: flex; align-items: flex-start; gap: 0.35em; }
.sb-words .rd-sfx-text { font-size: var(--type-caption-size); }
.sb-line { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--color-text-muted); }
.sb-silent { align-self: flex-start; min-height: 36px; }
.sb-list-rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.sb-row { display: flex; align-items: center; gap: var(--space-2); min-height: 56px; border-bottom: 1px solid var(--color-border); }
.sb-row .pl-play-dot { width: 36px; height: 36px; }
.sb-row-t { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: var(--space-1) 0; border: 0; background: transparent;
  color: inherit; font: inherit; text-align: left; cursor: pointer; line-height: 1.25; }
span.sb-row-t { cursor: default; }
.sb-row-t > span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-in.on .sb-row-t .body-strong { text-decoration: underline; text-underline-offset: 3px; }
.sb-remove { flex: none; min-height: 36px; padding: 0 var(--space-2); color: var(--color-text-muted); }
.sb-add { flex: none; min-height: 36px; padding: 0 var(--space-3); border-radius: 999px; gap: 4px; }
.sb-add .i-inline { width: 18px; height: 18px; }
.sb-add.on { background: var(--color-text); color: var(--color-background); border-color: var(--color-text); cursor: default; }
.sb-dim .sb-row-t, .sb-dim .pl-play-dot { opacity: 0.55; }
.sb-del { flex: none; width: 40px; }
.sb-del svg { width: 20px; height: 20px; fill: currentColor; }
.sb-record { display: flex; flex-direction: column; gap: 2px; padding: var(--space-2) 0 var(--space-2) 44px; border-bottom: 1px solid var(--color-border); color: var(--color-text-muted); }
.sb-ctl { display: flex; flex-direction: column; }
.sb-place { margin-bottom: var(--space-1); }
.sb-place label { min-height: 40px; }
.sb-set { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); min-height: var(--tap); border-bottom: 1px solid var(--color-border); }
.sb-step { display: inline-flex; align-items: center; gap: var(--space-2); }
.sb-pm { min-width: 40px; min-height: 36px; padding: 0; justify-content: center; font-size: 1.1em; }
.sb-until { display: inline-flex; align-items: center; gap: 4px; min-height: 36px; padding: 0; border: 0; background: transparent; color: inherit; font: inherit; cursor: pointer; }
.sb-until svg { width: 20px; height: 20px; fill: var(--color-text-muted); }
.sb-more { border-bottom: 1px solid var(--color-border); }
.sb-more > summary { list-style: none; cursor: pointer; border-bottom: 0; }
.sb-more > summary::-webkit-details-marker { display: none; }
.sb-more[open] > summary { border-bottom: 1px solid var(--color-border); }
.sb-more .sb-set:last-child { border-bottom: 0; }
.sb-level { display: inline-flex; align-items: center; gap: var(--space-2); }
.sb-level input { width: 9rem; accent-color: var(--color-text); }
.sb-sel { min-height: 36px; max-width: 13rem; }
.sb-inplace { align-self: flex-start; margin-top: var(--space-2); border: 1px solid var(--color-border); border-radius: 999px; }
.sb-find { gap: var(--space-2); }
.sb-q { width: 100%; box-sizing: border-box; }
.sb-chips { margin: 0; }
.sb-chips:empty { display: none; }
.sb-cat { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); min-height: 40px; margin-top: var(--space-2); }
.sb-here { display: inline-flex; align-items: center; gap: 4px; color: var(--color-secondary); }
.sb-here .i-inline { width: 16px; height: 16px; }
.sb-dl { min-height: 36px; padding: 0 var(--space-2); gap: 4px; }
.sb-loading { display: inline-flex; align-items: center; gap: 6px; }
.sb-ring-p { width: 16px; height: 16px; border-radius: 50%; background: conic-gradient(var(--color-text) calc(var(--p) * 1%), var(--color-border) 0); }
.sb-state { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-2); margin: var(--space-2) 0; }
.sb-state > p, p.sb-state { margin: 0; }
.sb-mine-acts { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin-top: var(--space-2); }
.sb-mine-acts .btn { gap: 6px; }
.sb-skel .sb-row { gap: var(--space-3); }
.sb-skel-dot { width: 36px; height: 36px; border-radius: 50%; background: var(--color-surface-alt); flex: none; }
.sb-skel-t { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.sb-skel-t i { display: block; height: 10px; width: 70%; border-radius: 5px; background: var(--color-surface-alt); }
.sb-skel-t i + i { width: 40%; }
.rd.rd-studio { position: relative; }
.sb-menu { position: absolute; z-index: 30; padding: 4px; border: 1px solid var(--color-border); border-radius: var(--radius-control);
  background: var(--color-background); box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18); }
.sb-menu-item { display: inline-flex; align-items: center; gap: 6px; min-height: var(--tap); padding: 0 var(--space-3); border: 0; border-radius: var(--radius-control);
  background: transparent; color: var(--color-text); font: inherit; cursor: pointer; white-space: nowrap; }
.sb-menu-item:hover, .sb-menu-item:focus-visible { background: var(--color-surface-alt); }
