/* Content Insights. One stylesheet for the sign-in page and the app.
   Gabe's personal brand (brand kit v1, Oct 2026): "one lamp, the rest is the room".
   Paper surfaces, espresso ink, greige for quiet things, amber as the single accent, used sparingly.
   Red and green mean good vs bad and nothing else (rule 07). Inter for everything; Barlow Condensed
   ExtraBold Italic only on series tags; Caveat only for the odd handwritten aside.
   Every class name here is read by public/app.js or public/review.js. Rename only with both sides. */

/* ---------- fonts (self-hosted, subset to what the app shows, SIL Open Font License; see public/fonts/OFL.txt) ---------- */

@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url(/fonts/inter-latin.woff2) format("woff2");
  unicode-range: U+0020-007E, U+00A0-00FF, U+0131, U+0152-0153, U+2010-2027, U+2030-203A, U+20AC, U+2122, U+2190-2193, U+2197, U+2212, U+2713, U+2717;
}
@font-face {
  font-family: "Barlow Condensed"; font-style: italic; font-weight: 800; font-display: swap;
  src: url(/fonts/barlow-condensed-800i-latin.woff2) format("woff2");
}
@font-face {
  font-family: "Caveat"; font-style: normal; font-weight: 600; font-display: swap;
  src: url(/fonts/caveat-600-latin.woff2) format("woff2");
  unicode-range: U+0020-007E, U+00A0-00FF, U+2013-2014, U+2018-201D, U+2026;
}

/* ---------- tokens ---------- */

:root {
  color-scheme: light;

  /* Palette, locked on brand kit page 2. */
  --espresso: #231A15;
  --paper: #F5F0E8;
  --greige: #B8B3AA;
  --amber: #E6A051;
  --brick: #C2593F;

  /* Surfaces */
  --bg: var(--paper);
  --surface: #FBF8F3;          /* cards: a lighter sheet on the paper */
  --surface-2: #F1EBE1;        /* hover, insets, quiet fills */
  --surface-3: #E9E2D6;        /* pressed, tracks */
  --dark: var(--espresso);     /* espresso cards, the video stage */
  --dark-2: #33281F;           /* raised on espresso */

  /* Ink. All text tokens pass AA (4.5:1) on paper and on --surface. */
  --text: var(--espresso);
  --dim: #5F564E;              /* secondary text, 6.3:1 on paper */
  --faint: #6A6158;            /* labels and meta, 5.3:1 on paper, 5.1:1 on --surface-2 */
  --on-dark: var(--paper);
  --on-dark-dim: var(--greige);

  /* Lines */
  --line: rgba(35, 26, 21, 0.09);
  --line-strong: rgba(35, 26, 21, 0.17);
  --line-input: #CFC8BD;

  /* The lamp */
  --accent: var(--amber);
  --accent-text: #8F5414;      /* amber that reads as text on paper, 5.4:1 */
  --accent-line: #B0702A;      /* amber for strokes and chart lines, 3:1 on paper */
  --accent-wash: rgba(230, 160, 81, 0.16);
  --accent-border: rgba(176, 112, 42, 0.45);

  /* Status. Green and brick mean good and bad, nothing else. */
  --good: #3F6A3A;
  --good-fill: #4E7A47;
  --good-wash: rgba(78, 122, 71, 0.10);
  --good-border: rgba(63, 106, 58, 0.38);
  --bad: #A8432C;
  --bad-fill: var(--brick);
  --bad-wash: rgba(194, 89, 63, 0.09);
  --bad-border: rgba(168, 67, 44, 0.38);
  --warning: var(--accent-text); /* late, held, needs a look: amber, not red */

  /* Charts */
  --series-1: var(--accent-line);
  --series-2: var(--espresso);
  --series-quiet: rgba(35, 26, 21, 0.17);
  --grid: rgba(35, 26, 21, 0.06);
  --axis: rgba(35, 26, 21, 0.18);

  /* Type */
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-tag: "Barlow Condensed", "Arial Narrow", var(--font);
  --font-hand: "Caveat", "Bradley Hand", cursive;
  --fs-xs: 11px;
  --fs-sm: 12.5px;
  --fs-base: 14px;
  --fs-md: 15px;
  --fs-lg: 18px;
  --fs-xl: 22px;
  --fs-2xl: 30px;
  --track-tight: -0.022em;
  --track-label: 0.12em;

  /* Space (4px steps) */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 20px; --s-6: 24px; --s-8: 32px; --s-10: 40px; --s-12: 48px;

  /* Shape */
  --r-xs: 4px;
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 10px;
  --r-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(35, 26, 21, 0.05), 0 2px 8px -4px rgba(35, 26, 21, 0.10);
  --shadow-lg: 0 2px 6px rgba(35, 26, 21, 0.06), 0 18px 44px -18px rgba(35, 26, 21, 0.35);

  /* Motion */
  --ease: cubic-bezier(0.2, 0, 0, 1);
  --dur: 140ms;

  --focus: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent-line);

  --z-sticky: 20;
  --z-tooltip: 40;
  --z-modal: 50;
}

/* ---------- base ---------- */

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0; min-height: 100vh; overflow-x: hidden;
  background: var(--bg); color: var(--text);
  font: 400 var(--fs-base)/1.55 var(--font);
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3 { margin: 0; text-wrap: balance; letter-spacing: var(--track-tight); }
h2 { font-size: var(--fs-lg); font-weight: 700; }
h3 { font-size: var(--fs-md); font-weight: 700; }
p { margin: 0; }
a { color: var(--text); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; transition: text-decoration-color var(--dur) var(--ease); }
a:hover { color: var(--text); text-decoration-color: var(--accent-line); }
button, input, select, textarea { font-family: inherit; }
code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 0.92em; }
b, strong { font-weight: 650; }
.muted { color: var(--dim); }
.small { font-size: var(--fs-sm); }
.num { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }
::selection { background: var(--accent-wash); color: var(--text); }
:focus-visible { outline: 2px solid var(--accent-line); outline-offset: 2px; border-radius: var(--r-xs); }

/* The quiet label: small, uppercase, widely tracked (brand kit headers). */
.kicker {
  display: inline-block; margin-bottom: var(--s-2);
  font-size: var(--fs-xs); font-weight: 600; letter-spacing: var(--track-label); text-transform: uppercase; color: var(--faint);
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 38px; padding: 0 14px;
  border: 1px solid var(--line-strong); border-radius: var(--r-md);
  background: var(--surface); color: var(--text);
  font-size: var(--fs-base); font-weight: 600; line-height: 1.2; text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.btn:hover { background: var(--surface-2); border-color: var(--greige); color: var(--text); }
.btn:active { background: var(--surface-3); }
.btn:focus-visible { outline: none; box-shadow: var(--focus); }
.btn[disabled] { opacity: 0.5; cursor: default; pointer-events: none; }
.btn-primary { background: var(--espresso); border-color: var(--espresso); color: var(--paper); }
.btn-primary:hover, .btn-primary:active { background: var(--dark-2); border-color: var(--dark-2); color: var(--paper); }
.btn-quiet { background: transparent; border-color: transparent; color: var(--dim); }
.btn-quiet:hover { background: var(--surface-2); border-color: transparent; color: var(--text); }
.btn-danger { background: transparent; border-color: var(--bad-border); color: var(--bad); }
.btn-danger:hover { background: var(--bad-wash); border-color: var(--bad); color: var(--bad); }
.btn-small { min-height: 32px; padding: 0 11px; font-size: 13px; border-radius: var(--r-sm); }
.btn-big { width: 100%; min-height: 52px; font-size: var(--fs-md); border-radius: var(--r-md); }

/* ---------- fields ---------- */

label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 600; color: var(--text); }
input[type="email"], input[type="password"], input[type="text"], input[type="number"], input[type="datetime-local"], select, .input {
  width: 100%; min-height: 42px; padding: 0 12px;
  border: 1px solid var(--line-input); border-radius: var(--r-md);
  background: var(--surface); color: var(--text); font: inherit; font-size: var(--fs-base);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
input[type="datetime-local"], select { font-size: 16px; } /* 16px stops phones zooming in on focus */
select { padding-right: 8px; }
textarea.input { padding: 10px 12px; }
input::placeholder, textarea::placeholder { color: var(--faint); opacity: 1; }
input:hover, select:hover, textarea:hover { border-color: var(--greige); }
input:focus, input:focus-visible, select:focus, textarea:focus, .input:focus {
  outline: none; border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-wash);
}
input[type="checkbox"], input[type="radio"] { accent-color: var(--espresso); }
.field + .field { margin-top: var(--s-4); }
.hint { margin-top: 6px; font-size: 12px; color: var(--faint); }

/* ---------- notices ---------- */

.notice { padding: 10px 14px; border-radius: var(--r-md); font-size: 13.5px; line-height: 1.5; border: 1px solid transparent; }
.notice-error { background: var(--bad-wash); border-color: var(--bad-border); color: var(--bad); }
.notice-info { background: var(--surface); border-color: var(--line-strong); color: var(--text); border-left: 3px solid var(--accent-line); }

/* ---------- sign-in page ---------- */

.gate { min-height: 100dvh; display: grid; place-items: center; padding: var(--s-6) var(--s-4); }
.gate-box {
  width: 100%; max-width: 400px; padding: var(--s-8);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
}
.gate-box .kicker { margin-bottom: var(--s-3); }
.gate-box h1 { font-size: 30px; font-weight: 800; letter-spacing: -0.035em; line-height: 1.05; }
.gate-box .lede { margin: var(--s-2) 0 var(--s-6); color: var(--dim); font-size: var(--fs-base); }
.gate-box .btn { width: 100%; margin-top: 22px; min-height: 46px; }
.gate-box .notice { margin-top: var(--s-4); }

/* ---------- app frame ---------- */

.topbar {
  position: sticky; top: 0; z-index: var(--z-sticky);
  background: rgba(245, 240, 232, 0.9); -webkit-backdrop-filter: saturate(1.2) blur(12px); backdrop-filter: saturate(1.2) blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar-in {
  max-width: 1200px; margin: 0 auto; min-height: 60px; padding: 10px 24px;
  display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap;
}
.brand { display: inline-flex; align-items: center; gap: 10px; margin-right: auto; color: var(--text); text-decoration: none; }
.brand:hover { color: var(--text); }
.brand svg { flex: none; }
.brand h1 { font-size: 16px; font-weight: 700; letter-spacing: -0.015em; line-height: 1; }
.status { display: inline-flex; align-items: center; gap: 7px; font-size: var(--fs-sm); font-weight: 500; color: var(--dim); margin-right: 4px; }
.status svg { flex: none; color: var(--greige); }
.status-good svg { color: var(--good-fill); }
.status-late { color: var(--warning); }
.status-late svg { color: var(--accent-line); }

main { max-width: 1200px; margin: 0 auto; padding: var(--s-6) 24px 96px; }
section + section { margin-top: var(--s-12); }
.section-head { display: flex; align-items: center; gap: 10px 12px; flex-wrap: wrap; margin-bottom: var(--s-2); }
.section-head h2 { font-size: var(--fs-lg); }
.section-head .spacer { margin-left: auto; }
.section-note { color: var(--dim); font-size: var(--fs-base); max-width: 72ch; }

.hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin-bottom: var(--s-6); }
.hero h2 { font-size: var(--fs-2xl); font-weight: 800; letter-spacing: -0.035em; line-height: 1.08; }
.hero p { margin-top: var(--s-2); color: var(--dim); font-size: var(--fs-md); max-width: 560px; }

/* ---------- tabs (the section nav) ---------- */

.tabs {
  display: flex; gap: 2px; margin: 0 0 var(--s-8); padding: 0;
  border-bottom: 1px solid var(--line-strong);
  overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: none; position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 44px; padding: 0 14px; margin-bottom: -1px;
  color: var(--dim); font-weight: 600; font-size: var(--fs-base); text-decoration: none; white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.tab:hover { color: var(--text); border-bottom-color: var(--line-strong); }
.tab[aria-current="page"] { color: var(--text); border-bottom-color: var(--accent); }
.tab:focus-visible { outline-offset: -4px; }
.tab-count {
  display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: var(--r-pill); background: var(--accent); color: var(--espresso);
  font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: var(--s-4); }

/* ---------- segmented filters ---------- */

.filters { display: flex; gap: 10px 22px; flex-wrap: wrap; align-items: center; }
.seg {
  display: inline-flex; max-width: 100%; padding: 3px; gap: 2px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-md);
  overflow-x: auto; scrollbar-width: none;
}
.seg::-webkit-scrollbar { display: none; }
.seg button {
  flex: none; min-height: 30px; padding: 0 12px; border: 0; border-radius: var(--r-sm);
  background: transparent; color: var(--dim); font-size: 13px; font-weight: 600; white-space: nowrap; cursor: pointer;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.seg button:hover { color: var(--text); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(35, 26, 21, 0.12), 0 0 0 1px var(--line); }
.seg button:focus-visible { outline-offset: -2px; }
.filter { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; max-width: 100%; }
.filter-label { font-size: var(--fs-xs); font-weight: 600; letter-spacing: var(--track-label); text-transform: uppercase; color: var(--faint); white-space: nowrap; }

/* ---------- figures: the one espresso card on the overview ---------- */

.figures {
  display: flex; flex-wrap: wrap; gap: 1px; margin-top: var(--s-5); overflow: hidden;
  background: rgba(245, 240, 232, 0.1); border-radius: var(--r-lg); box-shadow: var(--shadow-sm);
}
.figure { flex: 1 1 160px; padding: 18px 20px 20px; background: var(--dark); color: var(--on-dark); }
.figure .label { font-size: var(--fs-xs); font-weight: 600; letter-spacing: var(--track-label); text-transform: uppercase; color: var(--on-dark-dim); }
.figure .value { margin-top: 8px; font-size: 28px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.figure .sub { margin-top: 4px; font-size: 12px; color: var(--on-dark-dim); }

/* ---------- cards (shared surface) ---------- */

.chart-card, .connection, .phase-box, .reads-form, .live-row, .story, .transcript, .rr-card, .rr-new, .rr-job, .rr-foot,
.rr-bcard, .rr-newidea, .rr-film-card, .rr-film-sec, .rr-film-keep, .rr-note, .rr-version, .rr-token, .rr-modal, .rr-film-overlay-panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
}

/* ---------- charts ---------- */

.chart-card { margin-top: var(--s-4); padding: 18px 20px 16px; box-shadow: var(--shadow-sm); }
.chart-tools { display: flex; gap: 8px 16px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.chart-tools .spacer { margin-left: auto; }
.chart-tools .axis-name { font-size: var(--fs-xs); font-weight: 600; letter-spacing: var(--track-label); text-transform: uppercase; color: var(--faint); }
.chart-wrap { position: relative; }
.chart-wrap svg { display: block; width: 100%; height: auto; overflow: visible; touch-action: pan-y; }
.chart-wrap svg:focus-visible { outline-offset: 6px; }
.chart-wrap text { font: 500 11px var(--font); fill: var(--faint); font-variant-numeric: tabular-nums; }
.chart-wrap .grid-line { stroke: var(--grid); stroke-width: 1; }
.chart-wrap .axis-line { stroke: var(--axis); stroke-width: 1; }
.chart-wrap .ref-line { stroke: var(--accent-border); stroke-width: 1; stroke-dasharray: 4 4; }
.chart-wrap .ref-label { fill: var(--accent-text); font-weight: 600; letter-spacing: 0.04em; }
.chart-wrap .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart-wrap .line.quiet { stroke: var(--series-quiet); stroke-width: 1.5; }
.chart-wrap .line.s1 { stroke: var(--series-1); stroke-width: 2.5; }
.chart-wrap .line.s2 { stroke: var(--series-2); stroke-width: 2.5; }
.chart-wrap .fade-top { stop-color: var(--accent); stop-opacity: 0.28; }
.chart-wrap .fade-bottom { stop-color: var(--accent); stop-opacity: 0; }
.chart-wrap .dot { stroke: var(--surface); stroke-width: 2; }
.chart-wrap .dot.s1 { fill: var(--series-1); }
.chart-wrap .dot.s2 { fill: var(--series-2); }
.chart-wrap .dot.quiet { fill: var(--greige); }
.chart-wrap .cross { stroke: var(--line-strong); stroke-width: 1; }
.chart-wrap .end-label { fill: var(--text); font-weight: 700; font-size: 12px; }
.chart-wrap .phase-mark { stroke: var(--line-strong); stroke-width: 1; }
.chart-wrap .phase-label { fill: var(--dim); font-weight: 600; }

.tooltip {
  position: absolute; z-index: var(--z-tooltip); pointer-events: none;
  min-width: 160px; max-width: 270px; padding: 10px 12px;
  background: var(--dark); color: var(--on-dark); border-radius: var(--r-md); box-shadow: var(--shadow-lg); font-size: 13px;
}
.tooltip .tip-head { margin-bottom: 6px; font-size: 12px; font-weight: 500; color: var(--on-dark-dim); }
.tooltip .tip-row { display: flex; align-items: center; gap: 8px; }
.tooltip .tip-row + .tip-row { margin-top: 3px; }
.tooltip .tip-value { font-weight: 700; font-variant-numeric: tabular-nums; }
.tooltip .tip-name { color: var(--on-dark-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tooltip .key { border-color: rgba(245, 240, 232, 0.35); }
.tooltip .key.s1 { border-color: var(--amber); }
.tooltip .key.s2 { border-color: var(--paper); }

.key { flex: none; width: 14px; height: 0; border-top: 2px solid var(--series-quiet); border-radius: 2px; }
.key.s1 { border-color: var(--series-1); }
.key.s2 { border-color: var(--series-2); }

.legend { display: flex; flex-wrap: wrap; gap: 4px 6px; margin-top: var(--s-3); }
.legend-item {
  display: inline-flex; align-items: center; gap: 8px; max-width: 100%;
  min-height: 32px; padding: 0 10px; border: 1px solid transparent; border-radius: var(--r-sm);
  background: none; color: var(--dim); font-size: 13px; font-weight: 500; cursor: pointer; text-align: left;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.legend-item span.name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.legend-item:hover { background: var(--surface-2); color: var(--text); }
.legend-item[aria-pressed="true"] { background: var(--accent-wash); border-color: var(--accent-border); color: var(--text); font-weight: 600; }
.legend-static { display: inline-flex; align-items: center; gap: 8px; margin-right: 14px; font-size: 13px; font-weight: 500; color: var(--dim); }

/* ---------- empty and loading states ---------- */

.empty { margin-top: var(--s-4); padding: 44px 20px; text-align: center; color: var(--dim); border: 1px dashed var(--line-strong); border-radius: var(--r-lg); background: transparent; }
.chart-card .empty { margin-top: 0; border: 0; padding: 36px 12px; }
.empty strong { display: block; margin-bottom: 4px; font-family: var(--font-hand); font-size: 26px; font-weight: 600; line-height: 1.15; letter-spacing: 0; color: var(--accent-text); }
.empty p { max-width: 58ch; margin: 0 auto; font-size: var(--fs-base); }

.skel {
  border-radius: var(--r-lg);
  background: linear-gradient(90deg, var(--surface-2), var(--surface), var(--surface-2)); background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}
.skel + .skel { margin-top: var(--s-4); }
.skel-figures { height: 96px; background: linear-gradient(90deg, var(--dark), var(--dark-2), var(--dark)); background-size: 200% 100%; }
.skel-chart { height: 340px; }
.skel-table { height: 420px; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.loading { padding: 48px 0; text-align: center; color: var(--dim); }
.stale { opacity: 0.6; transition: opacity var(--dur) var(--ease); }

/* ---------- tables ---------- */

.table-scroll {
  margin-top: var(--s-4); overflow-x: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm);
}
.chart-card .table-scroll { margin-top: 0; background: transparent; border: 0; border-radius: var(--r-md); box-shadow: none; }
table { width: 100%; border-collapse: collapse; font-size: var(--fs-base); }
th, td { padding: 12px 10px; text-align: center; vertical-align: middle; white-space: nowrap; border-bottom: 1px solid var(--line); }
th:first-child, td:first-child { text-align: left; padding-left: 20px; }
tbody tr:last-child td, tbody tr:last-child th { border-bottom: 0; }
td { font-weight: 500; font-variant-numeric: tabular-nums; }
thead th {
  padding: 0; background: var(--surface-2);
  font-size: var(--fs-xs); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint);
  border-bottom: 1px solid var(--line-strong);
}
thead th .th-btn {
  display: flex; align-items: center; justify-content: center; gap: 4px; width: 100%;
  min-height: 48px; padding: 6px 10px; border: 0; background: none; cursor: pointer;
  color: inherit; font: inherit; letter-spacing: inherit; text-transform: inherit;
  transition: color var(--dur) var(--ease);
}
thead th:first-child .th-btn { justify-content: flex-start; padding-left: 20px; }
.th-lines { display: inline-flex; flex-direction: column; align-items: center; line-height: 1.25; text-align: center; }
thead th .th-btn:hover { color: var(--text); }
thead th .th-btn:focus-visible { outline-offset: -3px; }
thead th[aria-sort] .th-btn { color: var(--text); }
thead th.plain { padding: 14px; }
thead th.plain:first-child { padding-left: 20px; }
td.num, th.num { font-variant-numeric: tabular-nums; }
td.none { color: var(--greige); font-weight: 400; }
td .aside { color: var(--faint); font-weight: 400; }
th.text, td.text { text-align: left; }
td.text { white-space: normal; min-width: 90px; font-weight: 400; }

.posts th:first-child { width: 34%; }
.posts tbody tr { cursor: pointer; transition: background-color var(--dur) var(--ease); }
.posts tbody tr:hover { background: var(--surface-2); }
.post-cell { display: flex; align-items: center; gap: 12px; max-width: 460px; min-width: 230px; white-space: normal; color: inherit; text-decoration: none; }
.post-cell:hover { color: inherit; }
.post-words { flex: 1 1 auto; min-width: 0; }
.post-cell .cap { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; font-weight: 600; color: var(--text); }
.post-cell .meta { display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; white-space: nowrap; overflow: hidden; margin-top: 3px; font-size: 12px; font-weight: 400; color: var(--faint); }

/* Cover images. The tile shows on its own while loading or when Instagram has no image. */
.cover { flex: none; display: block; overflow: hidden; border-radius: var(--r-sm); background: var(--surface-3); }
.cover img { display: block; width: 100%; height: 100%; object-fit: cover; }
.cover-small { width: 36px; height: 48px; }
.cover-large { width: 120px; height: 160px; border-radius: var(--r-md); box-shadow: var(--shadow-sm); }

/* ---------- badges ---------- */

.badge {
  flex: none; display: inline-flex; align-items: center; padding: 1px 7px; border-radius: var(--r-xs);
  border: 1px solid var(--line-strong); background: transparent; color: var(--dim);
  font-size: 10.5px; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase; line-height: 1.6; white-space: nowrap;
}
.badge-feed { border-color: var(--accent-border); background: var(--accent-wash); color: var(--accent-text); }
.badge-collab { border-color: var(--line-strong); background: var(--surface-2); color: var(--text); }
.post-head .badge-collab { text-transform: none; letter-spacing: 0.01em; font-size: 11px; }
.badge-more { border-style: dashed; }
.badge-note { border-style: dashed; }
.badge-floor { border-color: var(--espresso); background: var(--espresso); color: var(--paper); }
.badge-leader, .rr-verdict.badge-collab { border-color: var(--good-border); background: var(--good-wash); color: var(--good); }
.badge-danger { border-color: var(--bad-border); background: var(--bad-wash); color: var(--bad); }
.badge-promote { border-color: var(--espresso); background: var(--espresso); color: var(--paper); }
/* Series tags: the only place Barlow Condensed ExtraBold Italic appears (brand kit page 2). */
.rr-pillar {
  border: 0; padding: 0 2px; background: none; color: var(--text);
  font-family: var(--font-tag); font-style: italic; font-weight: 800; font-size: 13px; letter-spacing: 0.01em; line-height: 1.2;
}

/* A tag's extra detail, shown on hover. Drawn above the page so the table cannot clip it. */
.tip {
  position: fixed; z-index: var(--z-tooltip); pointer-events: none; max-width: 280px; padding: 7px 10px;
  background: var(--dark); color: var(--on-dark); border-radius: var(--r-sm); box-shadow: var(--shadow-lg);
  font-size: 12px; font-weight: 500; line-height: 1.45; white-space: normal;
}

/* ---------- connections ---------- */

.connections { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; margin-top: var(--s-4); }
.connection { padding: 18px 20px; box-shadow: var(--shadow-sm); }
.connection .label { display: flex; align-items: center; gap: 8px; font-size: var(--fs-xs); font-weight: 600; letter-spacing: var(--track-label); text-transform: uppercase; color: var(--faint); }
.connection p { margin-top: 8px; color: var(--dim); font-size: var(--fs-base); max-width: 60ch; }
.connection p:first-of-type { color: var(--text); font-weight: 600; }
.connection p.problem { color: var(--bad); }
.connection .btn { margin-top: 14px; }
.connection .btn[aria-disabled="true"] { opacity: 0.5; cursor: default; }
.state { width: 8px; height: 8px; border-radius: 50%; background: var(--greige); }
.state-good { background: var(--good-fill); }
.state-problem { background: var(--bad-fill); }
.connect-result { margin-top: 14px; max-width: 80ch; }
.collab-note { margin-top: 14px; max-width: 80ch; }
.table-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 14px; }
.apify-line { margin-top: 28px; }

/* ---------- post page ---------- */

.back { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 18px; font-weight: 500; color: var(--dim); }
.back a { color: var(--dim); text-decoration: none; }
.back:hover, .back a:hover { color: var(--text); }
.post-head { display: flex; gap: 16px 22px; flex-wrap: wrap; align-items: flex-start; }
.post-head .words { flex: 1 1 300px; min-width: 0; }
.post-head h2 { font-size: 28px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.12; }
.post-head .meta { display: flex; align-items: center; gap: 6px 8px; flex-wrap: wrap; margin-top: 10px; color: var(--dim); font-size: 13px; }
.caption { margin-top: 12px; color: var(--dim); font-size: var(--fs-base); max-width: 72ch; white-space: pre-line; }
.caption.clamped { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.post-head .btn-quiet { margin-top: 6px; margin-left: -12px; }

.phases { margin-top: 14px; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.phase-box { padding: 18px 20px; box-shadow: var(--shadow-sm); }
.phase-box .label { display: flex; align-items: center; gap: 8px; font-size: var(--fs-xs); font-weight: 600; letter-spacing: var(--track-label); text-transform: uppercase; color: var(--faint); }
.phase-box .value { margin-top: 6px; font-size: 24px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.15; font-variant-numeric: tabular-nums; }

.reads-form {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; align-items: end;
  margin-top: 14px; padding: 20px; box-shadow: var(--shadow-sm);
}
.reads-form .field + .field { margin-top: 0; }
.reads-form .btn { min-height: 42px; }
.reads-form + .notice { margin-top: 12px; }

.transcript-section { margin-top: 28px; }
.transcript { max-width: 72ch; padding: 18px 20px; box-shadow: var(--shadow-sm); }
.transcript p { margin: 0; font-size: var(--fs-md); line-height: 1.65; color: var(--text); }
.transcript p + p { margin-top: 12px; }

.promote-panel { margin-top: 18px; max-width: 640px; }
.promote-panel .live-form-buttons { margin-top: 8px; }
.promote-panel .notice { margin-top: 10px; }
.promote-panel label { display: grid; gap: 6px; }
.promote-panel input[type=datetime-local] { min-height: 40px; }

/* ---------- live trials ---------- */

.live { margin-bottom: 28px; }
.live .section-head { margin-bottom: 10px; }
.live-row { margin-top: 8px; padding: 14px 18px; box-shadow: var(--shadow-sm); }
.live-head { display: flex; align-items: center; gap: 12px; }
.live-words { flex: 1 1 auto; min-width: 0; }
.live-cap { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-ask { margin-bottom: 2px; font-size: var(--fs-xs); font-weight: 600; letter-spacing: var(--track-label); text-transform: uppercase; color: var(--accent-text); }
.live-meta { display: flex; flex-wrap: wrap; gap: 2px 14px; margin-top: 2px; font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; }
.live-body { margin-top: 14px; }
.live-body > * + * { margin-top: 10px; }
.live-links { display: flex; flex-wrap: wrap; gap: 4px 6px; }
.live-links .btn-quiet { margin-left: -4px; }
.live-form { display: grid; gap: 12px; }
.live-form .field + .field { margin-top: 0; }
.live-form-buttons { display: flex; flex-wrap: wrap; gap: 8px; }

/* Pulling numbers from Instagram: an indeterminate bar with its words underneath. */
.live-progress p { margin-top: 8px; font-size: var(--fs-base); font-weight: 500; color: var(--dim); }
.progress { position: relative; height: 6px; overflow: hidden; border-radius: 3px; background: var(--surface-3); }
.progress span { position: absolute; top: 0; bottom: 0; left: 0; width: 40%; border-radius: 3px; background: var(--accent); animation: progress-slide 1.1s var(--ease) infinite; }
@keyframes progress-slide { from { left: -40%; } to { left: 100%; } }

.live-ok { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border-radius: var(--r-md); border: 1px solid var(--good-border); background: var(--good-wash); font-size: var(--fs-base); line-height: 1.5; }
.live-check { flex: none; display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--good); color: var(--paper); font-weight: 700; }
.live-ok strong { color: var(--good); }
.live-undo-error { margin-top: 4px; color: var(--bad); }

/* An idle trial row is compact on wide screens: one line, button at the right. */
@media (min-width: 760px) {
  .live-row-idle { display: flex; align-items: center; gap: 18px; padding: 12px 18px; }
  .live-row-idle .live-head { flex: 1 1 auto; min-width: 0; }
  .live-row-idle .live-body { display: flex; align-items: center; gap: 6px; margin-top: 0; flex: none; }
  .live-row-idle .live-body > * + * { margin-top: 0; }
  .live-row-idle .btn-big { width: auto; min-height: 36px; padding: 0 14px; font-size: 13px; border-radius: var(--r-sm); }
  .live-row-idle .live-links { flex-wrap: nowrap; }
  .live-row-idle .live-links .btn-quiet { margin-left: 0; }
}

/* ---------- stories on the Trials tab ---------- */

.stories-wrap { margin-bottom: 28px; }
.unsorted { margin-bottom: 28px; }
.unsorted .live-meta a { color: var(--accent-text); }
.unsorted-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.unsorted-actions select { width: auto; max-width: 100%; min-height: 34px; padding: 0 10px; border-radius: var(--r-sm); font-size: 13px; }
.unsorted .notice { margin-top: 10px; }

.story { margin-top: 8px; box-shadow: var(--shadow-sm); }
.story > summary { list-style: none; cursor: pointer; }
.story > summary::-webkit-details-marker { display: none; }
.story-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; }
.story-head::after { content: ""; flex: none; width: 7px; height: 7px; border-right: 1.5px solid var(--faint); border-bottom: 1.5px solid var(--faint); transform: rotate(-45deg); transition: transform var(--dur) var(--ease); }
.story[open] > .story-head::after { transform: rotate(45deg); }
.story-words { flex: 1 1 auto; min-width: 0; }
.story-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.story-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
.story-body { padding: 4px 18px 18px; border-top: 1px solid var(--line); }
.story-best { font-size: 13px; color: var(--dim); }
.story-best-leader { font-weight: 600; color: var(--good); }

.cut-row { display: flex; gap: 14px; padding-top: 14px; }
.cut-label { flex: none; width: 74px; display: flex; flex-direction: column; gap: 2px; padding-top: 10px; }
.cut-letter { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--line-strong); font-weight: 700; }
.cut-promoted .cut-letter { background: var(--espresso); border-color: var(--espresso); color: var(--paper); }
.cut-leader .cut-letter { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--good-fill); }
.vtiles { flex: 1 1 auto; min-width: 0; display: grid; gap: 8px; }
.vtile-wrap { display: grid; gap: 6px; }
.vtile { display: block; padding: 12px 16px; border-radius: var(--r-md); background: var(--bg); border: 1px solid var(--line); color: inherit; text-decoration: none; transition: border-color var(--dur) var(--ease), background-color var(--dur) var(--ease); }
.vtile:hover { border-color: var(--line-strong); background: var(--surface-2); color: inherit; }
.vtile:focus-visible { outline: none; box-shadow: var(--focus); }
.vtile-promoted { border-color: var(--espresso); box-shadow: inset 3px 0 0 var(--espresso); }
.vtile-leader { border-color: var(--good-border); background: var(--good-wash); box-shadow: inset 3px 0 0 var(--good-fill); }
.vtile-leader .vt-stats .vt-stat:first-child .vt-value { color: var(--good); }
.vt-head { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; margin-bottom: 8px; }
.vt-title { font-weight: 700; color: var(--text); }
.vt-open { margin-left: auto; color: var(--faint); font-size: 18px; line-height: 1; }
.vtile:hover .vt-open { color: var(--text); }
.vt-stats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px 18px; }
.vt-stat { display: flex; flex-direction: column; gap: 1px; font-size: 13px; line-height: 1.4; }
.vt-label { font-size: var(--fs-xs); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint); }
.vt-value { font-size: var(--fs-md); font-weight: 600; font-variant-numeric: tabular-nums; }
.vt-value .aside { font-size: 12px; font-weight: 400; color: var(--faint); }
.vt-change { margin-top: 8px; color: var(--dim); line-height: 1.4; }
.vt-how { color: var(--faint); font-size: 11px; }

.older { margin-top: 18px; }
.older > summary { cursor: pointer; font-weight: 600; font-size: var(--fs-base); padding: 6px 0; }

/* ---------- competitors ---------- */

.competitors th:first-child { width: 20%; }
.competitors th, .competitors td { padding-left: 8px; padding-right: 8px; }
.competitors thead th.plain { padding: 14px 8px; }
.competitors .spark { width: 90px; }
.comp-cell { display: flex; flex-direction: column; gap: 2px; white-space: normal; min-width: 180px; }
.comp-cell > div:first-child { display: flex; align-items: center; gap: 8px; }
.comp-handle { font-weight: 600; color: var(--text); text-decoration: none; }
.comp-handle:hover { color: var(--accent-text); }
.comp-cell .meta { display: flex; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--faint); }
.comp-cell .meta .problem { color: var(--bad); }
.delta { font-variant-numeric: tabular-nums; font-weight: 600; }
.delta-up { color: var(--good); }
.delta-down { color: var(--bad); }
.delta-flat { color: var(--dim); }
.delta .aside { font-size: 12px; font-weight: 400; color: var(--faint); }
.spark-wrap { display: inline-flex; color: var(--accent-line); }
.spark { display: block; overflow: visible; }
.comp-add { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 14px; }
.comp-add input { flex: 1 1 240px; max-width: 360px; min-height: 36px; }
#competitor-note { margin-top: 10px; }

/* =====================================================================
   Review room (public/review.js). Phone first: Gabe reviews and films from his phone.
   ===================================================================== */

.rr-card {
  display: flex; align-items: center; gap: 14px; margin-top: 8px; padding: 14px 18px; box-shadow: var(--shadow-sm);
  color: var(--text); text-decoration: none; transition: border-color var(--dur) var(--ease), background-color var(--dur) var(--ease);
}
.rr-card:hover { border-color: var(--line-strong); background: #FDFBF8; color: var(--text); }
.rr-card-needs { box-shadow: inset 3px 0 0 var(--accent), var(--shadow-sm); }
.rr-card-words { flex: 1 1 auto; min-width: 0; }
.rr-card-title { font-weight: 600; }
.rr-card-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: none; }
.rr-letters { display: inline-flex; gap: 4px; }
.rr-mini {
  display: inline-flex; align-items: center; gap: 4px; min-width: 26px; height: 24px; padding: 0 7px; border-radius: var(--r-sm);
  border: 1px solid var(--line-strong); background: var(--surface); font-size: 12px; font-weight: 700; color: var(--dim);
}
.rr-mini::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--greige); }
.rr-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--greige); }
.rr-mini.rr-dot-approved::after, .rr-dot.rr-dot-approved { background: var(--good-fill); }
.rr-mini.rr-dot-killed::after, .rr-dot.rr-dot-killed { background: var(--bad-fill); }
.rr-mini.rr-dot-held::after, .rr-dot.rr-dot-held { background: var(--accent); }
.rr-mini.rr-dot-pending::after, .rr-dot.rr-dot-pending { background: var(--greige); }
.rr-mini.rr-mini-posted { color: var(--good); }
.rr-mini.rr-mini-flagged { color: var(--bad); }

.rr-setup { margin-top: 28px; color: var(--dim); }
.rr-setup summary { cursor: pointer; font-size: 13px; }
.rr-setup p { margin-top: 8px; }
.rr-setup .btn { margin-top: 10px; }
.rr-token { margin-top: 10px; padding: 12px 14px; border-radius: var(--r-md); }
.rr-token code { display: block; word-break: break-all; font-size: 13px; color: var(--text); }

.rr-group { margin: 18px 0; }
.rr-group > summary {
  cursor: pointer; display: list-item; margin-bottom: 4px; padding: 4px 0;
  font-weight: 600; letter-spacing: var(--track-label); text-transform: uppercase; font-size: var(--fs-xs); color: var(--faint);
}
.rr-group-hint { text-transform: none; letter-spacing: 0; font-weight: 400; }

/* Story header, tabs and the letter chips */
.rr-head { margin-bottom: 16px; }
.rr-title-row { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.rr-title-row > div { flex: 1 1 260px; min-width: 0; }
.rr-title-row h2 { font-size: var(--fs-xl); font-weight: 800; letter-spacing: -0.03em; line-height: 1.15; }
.rr-title-row p { margin-top: 4px; }
.rr-title-row .badge { margin-top: 6px; }
.rr-stageline { margin-top: 8px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rr-roomtabs { margin: 16px 0 0; }
.rr-roomtabs .tab { flex: 1 1 0; }
.rr-tab-off { opacity: 0.45; cursor: default; flex-direction: column; gap: 0; }
.rr-tab-off:hover { border-bottom-color: transparent; color: var(--dim); }
.rr-chips { display: flex; gap: 8px; margin-top: 14px; overflow-x: auto; padding: 2px 2px 4px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.rr-chips::-webkit-scrollbar { display: none; }
.rr-head .rr-chips { margin-top: 14px; }
.rr-chip {
  flex: none; display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border-radius: var(--r-pill);
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); font-size: 13px; cursor: pointer;
  transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.rr-chip:hover { border-color: var(--greige); }
.rr-chip:focus-visible { outline: none; box-shadow: var(--focus); }
.rr-chip-on { background: var(--espresso); border-color: var(--espresso); color: var(--paper); }
.rr-chip-on:hover { border-color: var(--espresso); }
.rr-chip[disabled] { opacity: 0.4; cursor: default; }
.rr-chip b { font-weight: 700; }
.rr-chip-label { color: inherit; opacity: 0.8; }
.rr-chip-on .rr-dot { box-shadow: 0 0 0 2px rgba(245, 240, 232, 0.4); }
.rr-chip-mark { font-size: 11px; color: var(--good); margin-left: 4px; }
.rr-chip-on .rr-chip-mark { color: #A9C9A2; }
.rr-chip-mark.rr-chip-flag { color: var(--bad); }
.rr-chip-on .rr-chip-mark.rr-chip-flag { color: #F0A898; }

/* The three-column room: versions, player, notes */
.rr-grid { display: grid; grid-template-columns: 230px minmax(0, 1fr) 360px; gap: 24px; align-items: start; margin-top: 8px; }
.rr-versions .kicker, .rr-notes .kicker, .rr-caption summary { display: block; margin: 0 0 8px; }
.rr-notes .kicker + .rr-note, .rr-notes .rr-none { margin-bottom: 14px; }
.rr-version-wrap { margin-bottom: 8px; }
.rr-version {
  width: 100%; display: flex; flex-direction: column; gap: 3px; padding: 10px 12px; text-align: left;
  border-radius: var(--r-md); color: var(--text); font: inherit; cursor: pointer;
  transition: border-color var(--dur) var(--ease);
}
.rr-version:hover { border-color: var(--line-strong); }
.rr-version:focus-visible { outline: none; box-shadow: var(--focus); }
.rr-version-on { border-color: var(--espresso); border-bottom-left-radius: 0; border-bottom-right-radius: 0; box-shadow: inset 3px 0 0 var(--accent); }
.rr-version-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.rr-changes { padding: 10px 12px 12px; background: var(--surface); border: 1px solid var(--espresso); border-top: 0; border-radius: 0 0 var(--r-md) var(--r-md); }
.rr-changes .kicker { margin-bottom: 6px; }
.rr-change { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; line-height: 1.4; margin-top: 6px; }
.rr-changes p { margin-top: 8px; }
.rr-at {
  flex: none; display: inline-flex; align-items: center; min-height: 22px; padding: 0 7px; border-radius: var(--r-xs);
  border: 1px solid var(--accent-border); background: var(--accent-wash); color: var(--accent-text);
  font: inherit; font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; cursor: pointer;
}
.rr-at:hover { background: rgba(230, 160, 81, 0.28); }
.rr-at-none { border-color: var(--line-strong); background: transparent; color: var(--dim); cursor: default; }
.rr-note .rr-at { border-color: var(--espresso); background: var(--espresso); color: var(--paper); }

.rr-player { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.rr-stage { position: relative; width: 100%; max-width: 380px; aspect-ratio: 9 / 16; background: var(--dark); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-lg); }
.rr-video { width: 100%; height: 100%; display: block; object-fit: contain; background: var(--dark); }
.rr-stage-label { position: absolute; top: 10px; left: 10px; padding: 2px 8px; border-radius: var(--r-xs); background: rgba(35, 26, 21, 0.72); color: var(--paper); font-size: 11px; font-weight: 700; letter-spacing: 0.04em; pointer-events: none; }
.rr-timeline { width: 100%; max-width: 380px; }
.rr-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.rr-controls .num { margin-left: auto; }
.rr-speeds { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--r-pill); padding: 2px; background: var(--surface); }
.rr-speed { min-height: 28px; padding: 0 10px; border: 0; border-radius: var(--r-pill); background: transparent; color: var(--dim); font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.rr-speed:hover { color: var(--text); }
.rr-speed-on { background: var(--espresso); color: var(--paper); }
.rr-speed-on:hover { color: var(--paper); }
.rr-bar-row { display: flex; align-items: center; gap: 6px; }
.rr-bar-row .rr-bar { flex: 1 1 auto; }
.rr-step { flex: none; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); font: inherit; font-size: 20px; line-height: 1; cursor: pointer; touch-action: none; user-select: none; display: inline-flex; align-items: center; justify-content: center; padding: 0 0 2px; }
.rr-step:hover { background: var(--surface-2); }
.rr-step:active { background: var(--espresso); color: var(--paper); }
.rr-bar { position: relative; height: 40px; cursor: pointer; outline: none; touch-action: none; user-select: none; }
.rr-bar-scrubbing { cursor: grabbing; }
.rr-track { position: absolute; left: 0; right: 0; top: 17px; height: 6px; border-radius: 3px; background: var(--surface-3); }
.rr-buffered { position: absolute; left: 0; top: 17px; height: 6px; border-radius: 3px; background: var(--greige); opacity: 0.6; width: 0; pointer-events: none; }
.rr-progress { position: absolute; left: 0; top: 17px; height: 6px; border-radius: 3px; background: var(--espresso); width: 0; pointer-events: none; }
.rr-knob { position: absolute; top: 12px; width: 16px; height: 16px; margin-left: -8px; border-radius: 50%; background: var(--surface); border: 2px solid var(--espresso); box-sizing: border-box; pointer-events: none; transition: transform 0.1s var(--ease); }
.rr-bar:hover .rr-knob, .rr-bar-scrubbing .rr-knob { transform: scale(1.2); }
.rr-bar:focus-visible .rr-track { box-shadow: 0 0 0 3px var(--accent-wash), 0 0 0 1px var(--accent-line); }
.rr-mark-change { position: absolute; top: 6px; width: 9px; height: 9px; margin-left: -5px; transform: rotate(45deg); background: var(--accent); border: 1.5px solid var(--surface); pointer-events: none; }
.rr-mark-note { position: absolute; top: 26px; width: 10px; height: 10px; margin-left: -5px; border-radius: 50%; background: var(--espresso); border: 1.5px solid var(--surface); pointer-events: none; }
.rr-mark-done { opacity: 0.4; }
.rr-mark-pin { position: absolute; top: 2px; bottom: 2px; width: 2px; margin-left: -1px; background: var(--accent-line); pointer-events: none; }
.rr-legend { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.rr-legend span { display: inline-flex; align-items: center; gap: 6px; }
.rr-key { width: 8px; height: 8px; display: inline-block; }
.rr-key-change { background: var(--accent); transform: rotate(45deg); }
.rr-key-note { background: var(--espresso); border-radius: 50%; }
.rr-hook { max-width: 380px; text-align: center; }

/* Notes */
.rr-notes { display: flex; flex-direction: column; }
.rr-new { padding: 14px; margin-bottom: 18px; box-shadow: var(--shadow-sm); }
.rr-new-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.rr-new-head .kicker { margin: 0; }
.rr-new-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.rr-textarea {
  width: 100%; min-height: 64px; padding: 10px 12px; resize: vertical; font: inherit; font-size: 15px; line-height: 1.5;
  color: var(--text); background: var(--surface); border: 1px solid var(--line-input); border-radius: var(--r-md);
}
.rr-pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 4px 3px 10px; border-radius: var(--r-pill); background: var(--espresso); color: var(--paper); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.rr-pill-x { width: 22px; height: 22px; border-radius: 50%; border: 0; background: var(--dark-2); color: var(--paper); font: inherit; font-size: 14px; line-height: 1; cursor: pointer; }
.rr-note { display: flex; gap: 12px; padding: 12px 14px; margin-bottom: 8px; border-radius: var(--r-md); font-size: 13.5px; line-height: 1.45; }
.rr-note-done { background: var(--surface-2); color: var(--dim); } /* done notes step back by colour, not opacity, so the text keeps AA */
.rr-note-done .rr-note-head b { color: var(--dim); }
.rr-frame { flex: none; width: 48px; height: 85px; object-fit: cover; border-radius: var(--r-sm); background: var(--dark); }
.rr-note-words { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.rr-note-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rr-note .btn-quiet { align-self: flex-start; margin-left: -10px; }
.rr-caption { margin-top: 6px; }
.rr-caption summary { cursor: pointer; }
.rr-scope { display: inline-flex; gap: 2px; margin: 0 0 8px; padding: 3px; border-radius: var(--r-pill); background: var(--surface-2); border: 1px solid var(--line); }
.rr-scope-btn { border: 0; background: transparent; color: var(--dim); font: inherit; font-size: 12px; font-weight: 600; padding: 5px 12px; border-radius: var(--r-pill); cursor: pointer; }
.rr-scope-on { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(35, 26, 21, 0.12); }
.rr-suggest { margin-top: 12px; }
.rr-suggest-row { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-top: 1px solid var(--line); }
.rr-suggest-text { flex: 1 1 auto; font-size: 13px; line-height: 1.45; white-space: pre-wrap; }
.rr-suggest-row .btn { flex: 0 0 auto; }

/* Posting, flags, story actions */
.rr-post-wrap, .rr-posted, .rr-flag { display: inline-flex; align-items: center; gap: 10px; }
.rr-flag { flex-wrap: wrap; }
.rr-flags { display: flex; flex-direction: column; gap: 4px; }
.rr-flag-quiet { color: var(--faint); }
.rr-flag-quiet .btn { color: var(--faint); }
.rr-flag-quiet:hover .btn, .rr-flag-quiet:focus-within .btn { color: var(--text); }
.rr-confirm-input { width: 130px; min-height: 32px; padding: 4px 8px; font-size: 12px; }
.rr-story-wrap { display: flex; flex-direction: column; gap: 8px; }
.rr-story-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 24px 0 6px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface-2); }
.rr-story-actions .kicker { margin: 0 4px 0 0; }
.rr-failed { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border: 1px solid var(--bad-border); border-radius: var(--r-md); background: var(--bad-wash); }
.rr-failed-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; }
.rr-failed-text { flex: 1 1 auto; min-width: 0; }
.rr-post-error { color: var(--bad); max-width: 320px; }

/* The bottom bar, under the thumb */
.rr-actions {
  position: sticky; bottom: 0; z-index: var(--z-sticky); display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  margin: 24px -24px -96px; padding: 12px 24px calc(12px + env(safe-area-inset-bottom));
  background: rgba(245, 240, 232, 0.94); border-top: 1px solid var(--line-strong);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.rr-actions .btn { min-height: 44px; }
.rr-actions .spacer { margin-left: auto; }
.rr-approve { background: var(--good); border-color: var(--good); color: var(--paper); font-weight: 700; } /* paper on --good: 5.6:1 */
.rr-approve:hover { background: #34582F; border-color: #34582F; color: var(--paper); }
.rr-danger-text { color: var(--bad); }
.rr-danger-text:hover { color: var(--bad); border-color: var(--bad-border); background: var(--bad-wash); }
.rr-danger { background: var(--bad); border-color: var(--bad); color: var(--paper); } /* paper on --bad: 5.3:1 */
.rr-danger:hover { background: #8F3826; border-color: #8F3826; color: var(--paper); }
.rr-confirm { display: inline-flex; align-items: center; gap: 8px; }

/* Modal overlay (Post all) */
.rr-modal-back { position: fixed; inset: 0; z-index: var(--z-modal); display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(35, 26, 21, 0.5); }
.rr-modal { width: min(560px, 100%); max-height: 90vh; overflow: auto; padding: 20px; box-shadow: var(--shadow-lg); }
.rr-modal-wide { width: min(720px, 100%); }
.rr-modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.rr-modal-head h3 { margin: 0; font-size: var(--fs-lg); }
.rr-pa-list { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.rr-pa-row { display: grid; grid-template-columns: 20px 1fr; gap: 4px 10px; align-items: start; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-md); cursor: pointer; margin: 0; font-weight: 400; }
.rr-pa-row:hover { border-color: var(--line-strong); }
.rr-pa-row input { margin-top: 3px; }
.rr-pa-hook, .rr-pa-row .rr-textarea { grid-column: 2; }
.rr-pa-shared { display: flex; align-items: center; gap: 8px; margin: 8px 0; font-size: 13px; font-weight: 600; cursor: pointer; }
.rr-modal-foot { display: flex; align-items: center; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.rr-modal-foot .muted { margin-right: auto; }
.rr-cover-main { display: grid; grid-template-columns: 180px 1fr; gap: 14px; margin: 12px 0; align-items: start; }
.rr-cover-pick { width: 180px; aspect-ratio: 9 / 16; object-fit: cover; border-radius: var(--r-md); background: var(--dark); }
.rr-cover-empty { display: flex; align-items: center; justify-content: center; color: var(--on-dark-dim); }
.rr-cover-side { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.rr-cover-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; padding: 4px 0 8px; }
.rr-cover-opt { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 4px; border: 2px solid transparent; border-radius: var(--r-md); background: none; color: inherit; cursor: pointer; font: inherit; font-size: 11px; }
.rr-cover-opt:disabled { cursor: wait; opacity: 0.7; }
.rr-cover-opt img { width: 100%; aspect-ratio: 9 / 16; object-fit: cover; border-radius: var(--r-sm); background: var(--dark); display: block; }
.rr-cover-opt.rr-cover-on { border-color: var(--accent-line); }

/* The Mac pill and the job card */
.rr-mac { display: inline-flex; align-items: center; gap: 7px; padding: 3px 10px; border-radius: var(--r-pill); border: 1px solid var(--line-strong); background: var(--surface); font-size: 12px; font-weight: 600; color: var(--dim); }
.rr-mac-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--greige); }
.rr-mac-green { border-color: var(--good-border); color: var(--good); }
.rr-mac-green .rr-mac-dot { background: var(--good-fill); }
.rr-mac-red { border-color: var(--bad-border); background: var(--bad-wash); color: var(--bad); }
.rr-mac-red .rr-mac-dot { background: var(--bad-fill); }
.rr-job { margin: 12px 0; padding: 12px 16px; box-shadow: inset 3px 0 0 var(--accent); }
.rr-job-bad { border-color: var(--bad-border); box-shadow: inset 3px 0 0 var(--bad-fill); }
.rr-job-good { border-color: var(--good-border); box-shadow: inset 3px 0 0 var(--good-fill); }
.rr-job-quiet { border-style: dashed; box-shadow: none; opacity: 0.85; }
.rr-job-cancel { margin-top: 10px; display: grid; gap: 6px; }
.rr-job-cancel .input { max-width: 480px; }
.rr-job-head { display: flex; flex-wrap: wrap; gap: 10px; align-items: baseline; }
.rr-job-line { margin: 6px 0 0; font-size: var(--fs-base); line-height: 1.5; color: var(--text); overflow-wrap: anywhere; }
.rr-job-denial { margin: 4px 0 0; color: var(--warning); overflow-wrap: anywhere; }
.rr-job-steps { margin: 8px 0 0; }
.rr-job .btn { margin-top: 10px; }
.rr-job-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }

/* Dropped footage */
.rr-footage { margin: 0 0 16px; }
.rr-footage h3 { margin: 0 0 8px; font-size: var(--fs-md); }
.rr-foot { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; padding: 10px 14px; margin-bottom: 8px; box-shadow: inset 3px 0 0 var(--accent); }
.rr-foot.muted { background: var(--surface-2); box-shadow: none; }
.rr-foot-file { flex: 1 1 100%; font-size: 13px; overflow-wrap: anywhere; }
.rr-foot-guess { font-size: var(--fs-base); }
.rr-foot-pick { width: auto; max-width: 100%; }

/* ---------- Stories board ---------- */

.rr-board { display: grid; grid-template-columns: repeat(7, minmax(240px, 1fr)); gap: 14px; margin-top: 16px; overflow-x: auto; align-items: start; padding-bottom: 12px; }
.rr-board-filters { margin-top: 12px; }
.rr-col { min-width: 0; padding: 0 0 10px; margin: 0; } /* margin 0 beats the global section + section gap */
.rr-col-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 10px; padding: 8px 2px;
  font-size: var(--fs-xs); font-weight: 600; letter-spacing: var(--track-label); text-transform: uppercase; color: var(--faint);
  background: var(--bg); border-bottom: 1px solid var(--line-strong);
}
.rr-col-toggle { display: inline-flex; align-items: center; gap: 8px; width: 100%; justify-content: space-between; padding: 0; border: 0; background: transparent; color: inherit; font: inherit; letter-spacing: inherit; text-transform: inherit; cursor: pointer; }
.rr-col-count { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--r-pill); background: var(--surface-2); color: var(--dim); font-size: 11px; font-weight: 600; letter-spacing: 0; }
.rr-col-empty { padding: 6px 2px; }
.rr-bcard { margin-bottom: 8px; padding: 12px 14px; border-radius: var(--r-md); box-shadow: var(--shadow-sm); }
.rr-bcard-title { font-size: var(--fs-base); font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.rr-bcard-sub { margin-top: 2px; }
.rr-bcard-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.rr-bcard-line { margin-top: 8px; color: var(--dim); font-variant-numeric: tabular-nums; }
.rr-bcard-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; }
.rr-bmenu { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.rr-bmenu .kicker { flex: 1 0 100%; margin: 0; }
.rr-bcard .rr-job-cancel { margin-top: 10px; }
.rr-bcard .rr-job-cancel .input { width: 100%; }
.rr-stagebadge { color: var(--dim); }
.rr-card-side .rr-stagebadge { opacity: 0.85; }
.rr-newidea { margin-top: 12px; padding: 16px; border-radius: var(--r-md); box-shadow: var(--shadow-sm); }
.rr-form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.rr-form-wide { grid-column: 1 / -1; }
.rr-newidea select, .rr-pane select { min-height: 42px; font-size: var(--fs-base); }
.rr-newidea .rr-job-actions { margin-top: 12px; }

/* ---------- story page panes: Body, Card, Numbers ---------- */

.rr-pane { max-width: 760px; padding-bottom: 20px; }
.rr-pane-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 22px 0 8px; }
.rr-pane-head:first-child { margin-top: 4px; }
.rr-pane-head h3 { font-size: var(--fs-md); }
.rr-block { margin-top: 16px; }
.rr-block .kicker { margin-bottom: 6px; }
.rr-move { font-size: 17px; line-height: 1.5; font-weight: 500; }
.rr-para { white-space: pre-wrap; margin: 0 0 12px; line-height: 1.65; overflow-wrap: anywhere; font-size: var(--fs-md); }
.rr-facts, .rr-sources { margin: 0; padding-left: 20px; display: grid; gap: 6px; line-height: 1.55; }
.rr-sources a { color: var(--text); overflow-wrap: anywhere; }
.rr-fn { padding: 0 2px; border: 0; background: transparent; color: var(--accent-text); font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.rr-fn:hover { text-decoration: underline; }
.rr-missing { margin: 0; }
.rr-textarea-tall { min-height: 280px; }
.rr-row { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 4px 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.rr-row .kicker { margin: 0; align-self: center; }
.rr-val { line-height: 1.5; overflow-wrap: anywhere; }
.rr-val a { color: var(--text); }
.rr-trigs { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.rr-actual { margin-top: 12px; }
.rr-notion { margin-top: 14px; }
.rr-fieldset { border: 0; padding: 0; margin-left: 0; margin-right: 0; min-width: 0; }
.rr-check { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-weight: 400; color: var(--text); }
.rr-check input { width: 18px; height: 18px; accent-color: var(--espresso); }

.rr-num-line { margin: 4px 0 6px; line-height: 1.6; }
.rr-num-promote { margin: 0 0 10px; }
.rr-num-scroll { max-width: 100%; overflow-x: auto; scroll-behavior: auto; -webkit-overflow-scrolling: touch; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.rr-num-table { min-width: 460px; }
.rr-num-table th[scope="row"] { text-align: left; font-weight: 600; padding-left: 14px; }
.rr-num-table th[scope="col"] { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.08em; color: var(--faint); font-weight: 600; background: var(--surface-2); padding: 10px; }
.rr-num-table td { padding: 10px; }
.rr-num-sub { font-weight: 400; margin-top: 2px; }
.rr-num-scroll:focus-visible { outline: 2px solid var(--accent-line); outline-offset: 2px; }

/* ---------- Film: the filming board, read off a phone. Big type, 48px targets. ---------- */

.rr-film { font-size: 19px; line-height: 1.45; max-width: 860px; overflow-wrap: anywhere; }
.rr-filmpane { max-width: 860px; }
.rr-film-h { margin: 32px 0 10px; font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: var(--track-label); color: var(--faint); }
.rr-film-picks { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 20px; padding: 2px 2px 4px; scrollbar-width: none; }
.rr-film-picks::-webkit-scrollbar { display: none; }
.rr-film-pick { flex: 1 0 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 52px; padding: 8px 16px; border-radius: var(--r-md); border: 1px solid var(--line-strong); background: var(--surface); color: var(--dim); font: inherit; font-weight: 600; cursor: pointer; transition: border-color var(--dur) var(--ease), background-color var(--dur) var(--ease); }
.rr-film-pick:hover { color: var(--text); border-color: var(--greige); }
.rr-film-pick[aria-selected="true"] { background: var(--espresso); border-color: var(--espresso); color: var(--paper); }
.rr-film-pick[aria-selected="true"] .small { color: var(--greige); }
.rr-film-pick:focus-visible, .rr-film-scroll:focus-visible { outline: 2px solid var(--accent-line); outline-offset: 2px; }
.rr-film-title { font-size: 26px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.15; margin: 4px 0 12px; }
.rr-film-code { display: inline-block; padding: 1px 8px; border-radius: var(--r-xs); background: var(--espresso); color: var(--paper); font-family: var(--font-tag); font-style: italic; font-weight: 800; font-size: 17px; letter-spacing: 0.02em; vertical-align: 0.08em; }
/* The amber sticker sits only on the story's own code (brand kit page 3, the #NN sticker) and on "your take". */
.rr-film-title .rr-film-code { background: var(--accent); color: var(--espresso); font-size: 19px; }
.rr-film-meta { font-size: var(--fs-md); color: var(--dim); }
.rr-film-bend { background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: var(--r-md); padding: 12px 14px; margin: 12px 0; font-size: 18px; }
.rr-film-bend b, .rr-film-keep b { display: block; margin-bottom: 2px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: var(--track-label); color: var(--faint); }
.rr-film-dont { background: var(--bad-wash); border: 1px solid var(--bad-border); border-radius: var(--r-md); padding: 12px 14px; margin: 12px 0; }
.rr-film-dont-h { display: block; margin-bottom: 4px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: var(--track-label); color: var(--bad); }
.rr-film-dont ul, .rr-film-keep ul { margin: 0; padding-left: 1.2em; }
.rr-film-dont li { margin: 4px 0; font-weight: 600; }
.rr-film-keep { border-radius: var(--r-md); padding: 10px 14px; margin: 12px 0; }
.rr-film-keep li { margin: 3px 0; }
.rr-film-scroll { max-width: 100%; overflow-x: auto; }
.rr-film-table { width: 100%; border-collapse: collapse; }
.rr-film-table th, .rr-film-table td { padding: 10px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); font-size: 17px; white-space: normal; }
.rr-film-table th:first-child, .rr-film-table td:first-child { padding-left: 0; }
.rr-film-table thead th { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.08em; color: var(--faint); font-weight: 600; background: none; padding: 8px 10px; }
.rr-film-table tbody th { font-weight: 700; }
.rr-film-table a { color: var(--text); font-weight: 700; }
.rr-film-sub { display: block; font-size: 14px; color: var(--dim); font-weight: 400; }
.rr-film-cuts th[scope="row"] { white-space: nowrap; }
.rr-film-plain { margin: 0 0 8px; font-size: 18px; }
.rr-film-beats { padding-left: 1.4em; margin: 10px 0; }
.rr-film-beats li { margin: 6px 0; }
.rr-film-card { border-radius: var(--r-lg); padding: 14px 16px; margin: 12px 0; box-shadow: var(--shadow-sm); }
.rr-film-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 6px; }
.rr-film-hook { border-color: var(--line-strong); }
.rr-film-hooktext { margin: 4px 0; font-size: 27px; line-height: 1.22; font-weight: 800; letter-spacing: -0.025em; }
.rr-film-take { background: var(--dark); border-color: var(--dark); color: var(--on-dark); }
.rr-film-take .rr-film-meta, .rr-film-take .muted, .rr-film-take .rr-film-note { color: var(--on-dark-dim); }
.rr-film-take .rr-film-code { background: var(--accent); color: var(--espresso); }
.rr-film-prompt { margin: 4px 0 10px; font-size: 20px; font-weight: 600; }
.rr-film-starter { margin: 8px 0; padding-left: 12px; border-left: 4px solid var(--accent); font-size: 23px; line-height: 1.3; font-weight: 800; letter-spacing: -0.02em; }
.rr-film-line { margin: 8px 0; font-size: 21px; line-height: 1.4; }
.rr-film-lb { display: inline-block; min-width: 2.2em; margin-right: 6px; font-size: 14px; font-weight: 700; color: var(--faint); font-variant-numeric: tabular-nums; }
.rr-film-cut { margin: 12px 0; padding: 8px 12px; border: 1.5px dashed var(--accent-line); border-radius: var(--r-sm); color: var(--accent-text); font-size: 16px; font-weight: 700; text-align: center; }
.rr-film-note { margin: 8px 0 0; font-size: 15px; color: var(--dim); font-family: var(--font); font-style: italic; }
.rr-film-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.rr-film-btn { min-height: 48px; padding: 0 18px; font-size: 16px; font-weight: 600; }
.rr-film-add { width: 100%; margin: 4px 0 14px; border-style: dashed; background: transparent; }
.rr-film-edtag { padding: 2px 8px; border-radius: var(--r-pill); background: var(--accent-wash); border: 1px solid var(--accent-border); color: var(--accent-text); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }
.rr-film-editing { border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-wash); }
.rr-film-textarea { display: block; width: 100%; min-height: 120px; margin: 6px 0 0; padding: 12px 14px; border-radius: var(--r-md); border: 1px solid var(--line-input); background: var(--surface); color: var(--text); font: inherit; font-size: 24px; line-height: 1.3; font-weight: 700; resize: vertical; }
.rr-film-card .notice { margin-top: 10px; }
.rr-film-sec { border-radius: var(--r-lg); margin: 10px 0; box-shadow: var(--shadow-sm); }
.rr-film-sum { cursor: pointer; min-height: 56px; display: flex; align-items: center; gap: 10px; padding: 10px 16px; font-size: 18px; font-weight: 700; letter-spacing: -0.015em; list-style: none; }
.rr-film-sum::-webkit-details-marker { display: none; }
.rr-film-sum::before { content: ""; flex: none; width: 8px; height: 8px; margin: 0 4px 0 2px; border-right: 2px solid var(--faint); border-bottom: 2px solid var(--faint); transform: rotate(-45deg); transition: transform var(--dur) var(--ease); }
.rr-film-sec[open] > .rr-film-sum::before { transform: rotate(45deg); }
.rr-film-sum:focus-visible { outline: 2px solid var(--accent-line); outline-offset: 2px; border-radius: var(--r-lg); }
.rr-film-secbody { padding: 0 16px 16px; }
.rr-film-secbody > .rr-film-card:first-child { margin-top: 0; }
.rr-film-secbody .rr-film-dont, .rr-film-secbody .rr-film-keep { margin: 0; }
.rr-film-dates { list-style: none; margin: 0; padding: 0; }
.rr-film-dates li { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.rr-film-dates li:last-child { border-bottom: 0; }
.rr-film-date-text b { font-size: 20px; }
.rr-film-dtag { flex: none; padding: 4px 10px; border-radius: var(--r-pill); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; white-space: nowrap; }
.rr-film-dtag-say { background: var(--accent-wash); border: 1px solid var(--accent-border); color: var(--accent-text); }
.rr-film-dtag-screen { background: var(--espresso); border: 1px solid var(--espresso); color: var(--paper); }
.rr-film-overlay { position: fixed; inset: 0; z-index: var(--z-modal); display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(35, 26, 21, 0.55); }
.rr-film-overlay-panel { width: 100%; max-width: 640px; max-height: calc(100vh - 32px); overflow: auto; padding: 18px 20px; box-shadow: var(--shadow-lg); font-size: 19px; }

/* ---------- responsive ---------- */

@media (max-width: 1000px) {
  .rr-grid { grid-template-columns: 200px minmax(0, 1fr); }
  .rr-notes { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  body { font-size: var(--fs-md); }
  .hide-narrow { display: none; }

  /* Top bar: one tight row of brand and buttons, the recording status on a second line. Not sticky on the
     phone, where the room's action bar already owns the bottom and the screen is short. */
  .topbar { position: static; }
  .topbar-in { min-height: 0; padding: 10px 16px 8px; gap: 4px 6px; }
  .brand { order: 0; }
  .brand h1 { font-size: 15px; }
  .brand svg { width: 24px; height: 24px; }
  #sync { order: 1; }
  .topbar-in > a.btn { order: 2; }
  .status { order: 3; flex: 1 0 100%; font-size: 12px; margin: 0; }

  main { padding: 16px 16px 64px; }
  section + section { margin-top: var(--s-10); }
  .tabs { margin: 0 -16px var(--s-6); padding: 0 8px; }
  .tab { min-height: 46px; padding: 0 12px; }
  .hero { margin-bottom: var(--s-5); }
  .hero h2 { font-size: 26px; }
  .seg button { padding: 0 10px; }
  .filters { gap: 10px 14px; }
  .figure { padding: 14px 16px; flex-basis: 140px; }
  .figure .value { font-size: 22px; }
  th, td { padding: 11px 10px; }
  th:first-child, td:first-child, thead th:first-child .th-btn { padding-left: 14px; }
  thead th .th-btn { padding: 6px 10px; }
  .post-cell { min-width: 200px; }
  .cover-large { width: 78px; height: 104px; }
  .post-head .words { flex-basis: 200px; }
  .post-head h2 { font-size: 22px; }
  .chart-card { padding: 16px 14px 14px; }
  .live-row { padding: 14px; }

  /* The room stacks: player, versions, notes, all full width. */
  .rr-grid { display: flex; flex-direction: column; align-items: stretch; gap: 18px; }
  .rr-player { order: 0; }
  .rr-versions { order: 1; }
  .rr-notes { order: 2; }
  .rr-stage, .rr-timeline, .rr-hook { max-width: 100%; }
  .rr-stage { aspect-ratio: auto; height: min(68vh, 560px); border-radius: var(--r-md); }
  .rr-version-wrap { margin-bottom: 6px; }
  .rr-actions { margin: 20px -16px -64px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); gap: 8px; }
  .rr-actions .btn { flex: 1 1 auto; padding: 0 10px; font-size: 14px; }
  .rr-actions .spacer { display: none; }
  .rr-title-row h2 { font-size: 20px; }
  .rr-roomtabs .tab { flex: 1 0 auto; }

  .rr-board { display: block; overflow: visible; }
  /* Sticky only on the phone layout, where the board does not scroll sideways and the page is the scroller.
     The top bar is not sticky here, so the column heads stick to the very top. */
  .rr-col-head { position: sticky; top: 0; z-index: 2; }
  .rr-col + .rr-col { margin-top: 12px; }
}

@media (max-width: 640px) {
  .cut-row { flex-direction: column; gap: 8px; }
  .cut-label { width: auto; flex-direction: row; align-items: center; gap: 8px; }
  .story-side .story-best { font-size: 12px; }
  .vt-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 12px; }
}

@media (max-width: 560px) {
  .rr-cover-main { grid-template-columns: 1fr; }
  .rr-cover-pick { width: 140px; }
  .rr-row { grid-template-columns: 1fr; }
  .rr-film { font-size: 18px; }
  .rr-film-title { font-size: 23px; }
  .rr-film-hooktext { font-size: 25px; }
  .rr-film-actions .rr-film-btn { flex: 1 1 auto; }
  .gate-box { padding: var(--s-6); }
}

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

@media print {
  .topbar, .tabs, .rr-actions { display: none; }
  body { background: #fff; }
}

/* The promote card under a post's figures needs air. */
.figures + .live-row, .figures + * { margin-top: var(--s-4); }
