/* pxCite. A broadcast control room: one dark look, caption-yellow is the only brand color.
   The page reads in three steps: watch (player), understand (the on-screen card), verify (the fact-check cards). */
:root {
  --bg: #0E1015;
  --panel: #15181F;
  --card: #1B1E26;
  --line: #2A2E37;
  --ink: #ECECE8;
  --muted: #A3A8B2;
  --marker: #F2C433;
  --marker-ink: #111318;
  --ok: #43B482;
  --warn: #E3A33A;
  --bad: #E5675C;
  --neutral: #6F7480;
  --on-air: #C2362B;
  --ok-ink: #08130D;
  --warn-ink: #1A1203;
  --bad-ink: #1A0705;
  /* The fictional HCTV broadcast's own graphics, kept apart from pxCite's colours. */
  --hctv-blue: #1D3E7A;
  --tie-blue: #2B4E8E;
  --tie-red: #8E2B2B;
  --tie-green: #2E7A55;
  --white: #ffffff;
  --black: #000000;
  --display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --body: "Source Serif 4", Georgia, serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--ink); font-family: var(--display); font-size: 15px; line-height: 1.45;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 0 24px; min-height: 100vh;
}
button, input { font: inherit; color: inherit; }
button:focus-visible, input:focus-visible, label.btn:focus-within, a:focus-visible, summary:focus-visible { outline: 2px solid var(--marker); outline-offset: 2px; }
a { color: inherit; }
.mono { font-family: var(--mono); }
.small { font-size: 13px; }

/* Header */
.top { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; padding: 14px 0; border-bottom: 1px solid var(--line); }
.brand { font-weight: 850; font-stretch: 75%; font-size: 26px; display: flex; align-items: baseline; gap: 2px; }
.brand sup { background: var(--marker); color: var(--marker-ink); font-size: 12px; padding: 0 6px; margin-right: 10px; }
.brand .tag { font-family: var(--body); font-style: italic; font-weight: 400; font-stretch: 100%; font-size: 15px; color: var(--muted); }
.modes { display: flex; gap: 4px; background: var(--panel); padding: 4px; border-radius: 8px; }
.mode { background: none; border: 0; padding: 8px 14px; border-radius: 6px; cursor: pointer; color: var(--muted); font-weight: 600; min-height: 40px; }
.mode.on { background: var(--card); color: var(--ink); box-shadow: inset 0 -2px 0 var(--marker); }
/* Early-access sign-up, top right. Its note drops below the header so the header never changes height. */
/* The How page keeps its own header link. */
.top-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.nav-search { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.nav-search input { width: 260px; min-width: 0; background: var(--bg); border: 1px solid var(--neutral); border-radius: 6px; padding: 8px 12px; font-size: 16px; min-height: 44px; }
.nav-search input::placeholder { color: var(--muted); }
.nav-search .btn { min-height: 44px; }
.nav-search .short { display: none; }
.nav-search ~ .nav-early { margin-left: 0; }
.nav-early { margin-left: auto; position: relative; display: flex; align-items: center; gap: 8px; }
.nav-early input { width: 240px; min-width: 0; background: var(--bg); border: 1px solid var(--neutral); border-radius: 6px; padding: 8px 12px; font-size: 16px; min-height: 44px; }
.nav-early input::placeholder { color: var(--muted); }
.nav-early .short, .nav-early .send { display: none; }
.nav-early-msg { position: absolute; top: 100%; right: 0; margin: 6px 0 0; padding: 6px 10px; z-index: 20; font-size: 13px; color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: 6px; white-space: nowrap; }
/* Empty, it takes no room but stays in the page, so screen readers announce what is written into it. */
.nav-early-msg:empty { padding: 0; border: 0; }

.intro { grid-area: intro; margin: 0; font-family: var(--body); font-weight: 400; font-size: 17px; line-height: 1.4; color: var(--ink); max-width: 72ch; }
.intro span { color: var(--muted); }
.sr-only, .layout:has(#intro-demo[hidden]) .intro { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
/* Outside the fictional demo the heading is for screen readers only, so its row closes up. */
.layout:has(#intro-demo[hidden]) { grid-template-areas: "player panel"; grid-template-rows: minmax(0, 1fr); }

.btn { background: var(--marker); color: var(--marker-ink); border: 0; border-radius: 6px; padding: 10px 16px; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; min-height: 44px; }
.btn.small { padding: 8px 12px; font-size: 13px; min-height: 36px; }
.btn:disabled { opacity: .5; cursor: default; }
.ghost { background: none; border: 1px solid var(--line); border-radius: 6px; padding: 9px 14px; cursor: pointer; color: var(--ink); min-height: 44px; display: inline-flex; align-items: center; }
.linkish { background: none; border: 0; padding: 0; color: inherit; font: inherit; text-decoration: underline; cursor: pointer; }

/*
 * Layout: one screen, like a native app. The page itself never scrolls: the player takes the left
 * side at the largest 16:9 size that fits, and the side panel (fact checks, or the transcript tab)
 * scrolls on its own. On phones and tablets the player sits on top and the panel fills the rest.
 */
.layout {
  display: grid; gap: 16px 20px; padding-top: 16px;
  grid-template-columns: minmax(0, 1fr) clamp(300px, 34vw, 380px);
  grid-template-areas: "intro panel" "player panel";
  grid-template-rows: auto minmax(0, 1fr);
}
.player { grid-area: player; display: flex; flex-direction: column; min-width: 0; }
.panel { grid-area: panel; }
/* One column: phones, portrait tablets, and anything too short for the shell (landscape phones). */
@media (max-width: 960px) and (max-aspect-ratio: 999/1000), (max-width: 639px), (max-width: 960px) and (max-height: 499px) {
  .layout { grid-template-columns: minmax(0, 1fr); grid-template-areas: "intro" "player" "panel"; grid-template-rows: none; }
  .layout:has(#intro-demo[hidden]) { grid-template-areas: "player" "panel"; grid-template-rows: none; }
}
/* While the first debate loads, keep the picker out of sight so it doesn't flash up. */
.stage.booting .yt-gate { visibility: hidden; }

/* Stage */
.stage { position: relative; width: 100%; aspect-ratio: 16 / 9; background: var(--black); border-radius: 8px 8px 0 0; overflow: hidden; container-type: inline-size; }
.stage video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: var(--black); }
.studio { position: absolute; inset: 0; background: radial-gradient(120% 90% at 70% 30%, #2A3B5C 0%, #141C2C 55%, #0A0E16 100%); }
.studio .wall { position: absolute; inset: 0; background: repeating-linear-gradient(90deg, rgba(255,255,255,.035) 0 2px, transparent 2px 9%), linear-gradient(180deg, transparent 60%, rgba(0,0,0,.35)); }
.studio .desk { position: absolute; left: 0; right: 0; bottom: 0; height: 24%; background: linear-gradient(180deg, #1E2737, #0E131C); }
.studio .person { position: absolute; left: 39%; bottom: 18%; width: 22%; height: 62%; transition: transform .5s ease; }
.studio .head { position: absolute; left: 32%; top: 0; width: 36%; aspect-ratio: 1 / 1.15; border-radius: 50%; background: linear-gradient(160deg, #C9A58B, #8D6A55); }
.studio .body { position: absolute; left: 0; right: 0; bottom: 0; height: 62%; border-radius: 45% 45% 0 0; background: linear-gradient(170deg, #3B4252, #1C212C); }
.studio .tie { position: absolute; left: 47%; width: 6%; bottom: 0; height: 52%; background: var(--tie, var(--tie-red)); clip-path: polygon(30% 0, 70% 0, 100% 85%, 50% 100%, 0 85%); }
.studio .live-bug { position: absolute; left: 3%; top: 5%; font-size: max(12px, 1.3cqw); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--white); background: rgba(10,12,16,.75); border: 1px solid rgba(255,255,255,.35); border-radius: 999px; padding: .45em 1em .45em .9em; display: flex; align-items: center; gap: .6em; }
.studio .live-bug::before { content: ""; width: .7em; height: .7em; border-radius: 50%; background: var(--marker); }
.studio .live-bug.on-air { background: var(--on-air); border-color: transparent; border-radius: 2px; }
.studio .live-bug.on-air::before { background: var(--white); animation: pulse 1.4s ease-in-out infinite; }
.studio .net-bug { position: absolute; right: 3%; top: 5%; font-size: max(12px, 1.6cqw); font-weight: 800; letter-spacing: .06em; color: var(--white); opacity: .85; padding: .4em .7em; border: 1px solid rgba(255,255,255,.5); }
.net-chyron { position: absolute; left: 4%; bottom: 30%; display: flex; flex-direction: column; font-size: 1.8cqw; }
.net-chyron .n1 { background: #F4F4F4; color: #111; font-weight: 800; padding: .3em .8em; font-stretch: 85%; text-transform: uppercase; }
.net-chyron .n2 { background: var(--hctv-blue); color: var(--white); padding: .25em .8em; }
.stage:has(.fncard:not([hidden])) .net-chyron { bottom: auto; top: 30%; }
.stage:has(.yt-gate:not([hidden]), .drop:not([hidden]), .mic-gate:not([hidden])) .fnbar { display: none; }
.captions { position: absolute; left: 12%; right: 12%; top: 13%; text-align: center; font-size: 1.6cqw; }
.captions span { background: rgba(0,0,0,.75); color: var(--white); padding: .2em .6em; box-decoration-break: clone; -webkit-box-decoration-break: clone; line-height: 1.6; }
@keyframes pulse { 50% { opacity: .3; } }
.btn.nudge { animation: nudge 1.2s ease-in-out infinite; box-shadow: 0 0 0 0 var(--marker); }
@keyframes nudge { 50% { box-shadow: 0 0 0 6px transparent; transform: scale(1.04); } }
.status.warn { color: var(--marker); font-weight: 700; }
.status.warn::before { background: var(--marker); }

/* pxCite overlay: one claim, one verdict, one sentence, and where it came from. */
/*
 * pxCite overlay: one small card in the bottom-left corner, so the broadcast stays the picture.
 * It says the verdict, whose claim it rates, the finding in a sentence or two, and how many
 * sources back it (tap or click for them). The quote, links and details live in the side panel.
 */
.fnbar { position: absolute; left: 2.5%; bottom: 4%; width: min(52%, 540px); display: flex; flex-direction: column; gap: 8px; }
.fncard:focus-visible { outline: 2px solid var(--marker); outline-offset: 2px; }
.fncard { display: flex; flex-direction: column; background: rgba(12,14,19,.8); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-left: 4px solid var(--c, var(--marker)); border-radius: 8px; box-shadow: 0 8px 28px rgba(0,0,0,.35); font-size: clamp(12px, 1.4cqw, 16px); animation: rise .5s ease-out both; overflow: hidden; cursor: pointer; }
.fncard .mark, .fncard .claim, .fncard .when, .fncard .src { display: none; }
.fncard .side { order: -1; display: flex; align-items: center; gap: .7em; padding: .8em 1em 0; min-width: 0; }
.fncard .verdict { order: -1; font-size: .85em; }
.fncard .side::before { content: attr(data-who); flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9em; color: #C9CCD3; }
.fncard .side::after { content: attr(data-sources); flex: none; font-size: .9em; color: #C9CCD3; }
.fncard .txt { padding: .5em 1em .85em; display: flex; flex-direction: column; min-width: 0; }
.fncard .ctx { font-weight: 650; color: var(--white); font-size: 1.1em; line-height: 1.32; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.fncard:hover .side::after { color: var(--white); }
.ticker { display: flex; align-items: center; gap: 1cqw; background: rgba(242,196,51,.97); color: var(--marker-ink); font-size: 1.35cqw; font-weight: 700; padding: .55cqw 1.4cqw; white-space: nowrap; overflow: hidden; border-radius: .3cqw; }
.ticker #ticker-text { overflow: hidden; text-overflow: ellipsis; }
.ticker b { text-transform: uppercase; letter-spacing: .06em; }
.ticker i { font-style: normal; font-family: var(--mono); font-weight: 600; }
@keyframes rise { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }

/* A phone-sized player gets a real phone card, not the TV layout shrunk: verdict, the finding, and a pointer to the sources below. */
@container (max-width: 620px) {
  .fnbar { left: 2.5%; right: 2.5%; bottom: 3%; width: auto; }
  .fncard { font-size: 12px; border-radius: 6px; }
  .fncard .side { padding: 8px 10px 0; gap: 8px; }
  .fncard .txt { padding: 4px 10px 8px; }
  .fncard .ctx { font-size: 13px; line-height: 1.3; }
  .ticker { display: none; }
  .captions { font-size: 12px; top: 24%; left: 4%; right: 4%; }
  .net-chyron { display: none; }
}

.verdict { font-weight: 800; letter-spacing: .06em; text-transform: uppercase; padding: .25em .6em; border-radius: 3px; white-space: nowrap; font-size: inherit; }
.r-supported { background: var(--ok); color: var(--ok-ink); }
.r-missing_context { background: var(--warn); color: var(--warn-ink); }
.r-misleading, .r-false { background: var(--bad); color: var(--bad-ink); }
.r-unverifiable { background: var(--neutral); color: var(--white); }
.r-checking { background: var(--line); color: var(--ink); display: inline-flex; align-items: center; gap: .5em; }

.drop, .mic-gate { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; padding: 24px; background: rgba(10,12,16,.9); }
.drop p, .mic-gate p { margin: 0; max-width: 46ch; }
.drop .small { color: var(--muted); }

/* Player bar */
.controls { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--panel); border: 1px solid var(--line); border-top: 0; border-radius: 0 0 8px 8px; padding: 10px 12px; }
.clock { font-size: 13px; color: var(--muted); min-width: 9ch; font-variant-numeric: tabular-nums; }
.seek { flex: 1; min-width: 120px; height: 32px; cursor: pointer; appearance: none; -webkit-appearance: none; background: transparent; }
.seek::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: var(--line); }
.seek::-moz-range-track { height: 6px; border-radius: 3px; background: var(--line); }
.seek::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; margin-top: -6px; border-radius: 50%; background: var(--marker); border: 0; }
.seek::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--marker); border: 0; }
.status { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--neutral); flex: none; }
.status.live::before { background: var(--bad); animation: pulse 1.4s ease-in-out infinite; }
.status.ok::before { background: var(--ok); }
/* Prepared checks play back; only live checking gets the pulsing red dot. */
.status.prepared::before { background: var(--ok); animation: none; }
/* The fiction note belongs to the scripted county debate only. */
body:has(#intro-demo[hidden]) .foot .demo-note { display: none; }
.controls:not(:has(.seek:not([hidden]))) .status { margin-left: auto; }

/* Transcript */
.section-head { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-bottom: 10px; }
.section-head .ghost { min-height: 36px; padding: 6px 12px; font-size: 13px; }
.section-head h2, .panel-title { margin: 0; font-family: var(--display); font-size: 20px; font-weight: 800; }
.transcript { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 6px 14px; max-height: 260px; overflow-y: auto; display: flex; flex-direction: column; font-family: var(--body); font-size: 15px; }
.transcript:empty::before { content: "The transcript appears here as the show plays."; color: var(--muted); font-style: italic; padding: 8px 0; }
.transcript .line { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 2px 10px; padding: 8px 0; border-bottom: 1px solid var(--line); background: none; border-left: 0; border-right: 0; border-top: 0; text-align: left; color: inherit; font: inherit; }
.transcript .line:last-child { border-bottom: 0; }
.transcript button.line { cursor: pointer; }
.transcript button.line:hover .txt { color: var(--white); }
.transcript .line .t { font-family: var(--mono); font-size: 13px; color: var(--muted); padding-top: 3px; }
.transcript .line .who { font-family: var(--display); font-weight: 700; font-size: 13px; color: var(--muted); padding-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.transcript .line.claim .txt { box-shadow: inset 0 -2px 0 var(--c, rgba(242,196,51,.55)); }
/* Words still being said (streamed live), until the line is final. */
.transcript .line.interim .txt { color: var(--muted); font-style: italic; }
.transcript .line.interim .t { color: var(--marker); }
/* The transcript sits in the side panel, so the speaker goes above each line rather than beside it. */
.transcript .line .who, .transcript .line .txt { grid-column: 2; }

/* Fact checks */
.panel { display: flex; flex-direction: column; gap: 10px; min-width: 0; min-height: 0; }
.panel-body { display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.feed { display: flex; flex-direction: column; gap: 10px; }
.feed .empty { color: var(--muted); font-family: var(--body); display: flex; flex-direction: column; gap: 10px; }
.feed .empty p { margin: 0; font-style: italic; }
.feed .empty .cta { font-style: normal; font-size: 14px; }
.feed .empty .cta .linkish { color: var(--ink); text-underline-offset: 3px; text-decoration-color: var(--marker); min-height: 24px; }

/*
 * Side panel tabs: Fact checks first, then By speaker (once anything is checked) and the
 * Transcript (when there is one). With only the first tab showing, it reads as a heading.
 */
.panel-tabs { display: flex; align-items: baseline; gap: 18px; flex: none; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tab { background: none; border: 0; padding: 4px 0 8px; margin-bottom: -1px; font-family: var(--display); font-size: 17px; font-weight: 800; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--marker); }
.tab:hover { color: var(--ink); }
.tab:focus-visible { outline: 2px solid var(--marker); outline-offset: 2px; }
/* These sit at the edge of scrolling boxes, which would clip a ring drawn outside them. */
.tab:focus-visible, .panel-body .brow:focus-visible, .feed-filter:focus-visible { outline-offset: -2px; }
.panel:has(#transcript-box[hidden]) #tab-transcript, .panel:has(#board[hidden]) #tab-board { display: none; }
.panel:has(#transcript-box[hidden]):has(#board[hidden]) .tab { font-size: 20px; cursor: default; border-bottom-color: transparent; }
.panel .pane { display: none; }
.panel[data-tab="checks"] #panel-checks, .panel[data-tab="board"] #panel-board, .panel[data-tab="transcript"] #transcript-box { display: flex; }
/* The score line over the checks: one bar for every check so far. Opens By speaker. */
.score { display: flex; flex-direction: column; gap: 6px; flex: none; width: 100%; padding: 2px 0 10px; background: none; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.score[hidden] { display: none; }
.score-head { font-size: 13px; color: var(--muted); }
.score-head b { color: var(--ink); font-weight: 800; }
.score .bar { height: 8px; gap: 1px; }
.score .bar span { font-size: 0; }
.score:hover .score-head b { text-decoration: underline; text-underline-offset: 3px; }
.score:focus-visible { outline: 2px solid var(--marker); outline-offset: -2px; }
.feed-filter { align-self: flex-start; font-size: 13px; color: var(--muted); min-height: 24px; }
.transcript-box { min-width: 0; flex-direction: column; }
/* In its own tab the speaker tally needs no box of its own. */
#panel-board .board { background: none; border: 0; padding: 0; }
.fcard { background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--c, var(--neutral)); border-radius: 8px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; animation: rise .4s ease-out both; }
.fcard .who { display: flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.fcard .who .verdict { margin-left: auto; font-family: var(--display); font-size: 12px; }
.fcard .at { background: none; border: 0; padding: 0; color: var(--ink); font: inherit; font-weight: 600; }
.fcard button.at { cursor: pointer; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.fcard .speaker { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.fcard q { font-family: var(--body); font-style: italic; color: #DCDDE2; font-size: 16px; line-height: 1.35; }
.fcard p { margin: 0; font-size: 15px; line-height: 1.4; }
.fcard .srcs { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.fcard .srcs a { color: var(--ink); text-decoration-color: var(--marker); text-underline-offset: 3px; overflow-wrap: anywhere; }
.fcard .srcs a { display: flex; align-items: flex-start; gap: 6px; }
.fcard .more { font-size: 13px; color: var(--muted); }
.fcard .more summary { cursor: pointer; width: max-content; }
.fcard .more p { font-size: 13px; color: var(--muted); margin-top: 6px; }
.fcard .notes { color: var(--warn); }
.fcard .actions { display: flex; gap: 16px; align-items: center; }
.fcard .flag { background: none; border: 0; padding: 0; color: var(--muted); font-size: 13px; cursor: pointer; text-decoration: underline; min-height: 24px; }
.fcard.pending { --c: var(--line); }
.fcard.pending .checking { font-family: var(--body); font-style: italic; color: var(--muted); }
.spinner { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--muted); border-top-color: transparent; animation: spin 1s linear infinite; }

.stats { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; order: 1; flex: none; }
.stats div { background: var(--panel); padding: 10px 8px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; }
.stats b { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
.stats span { font-size: 12px; color: var(--muted); line-height: 1.3; }
.access { order: -3; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 12px; display: flex; flex-direction: column; gap: 6px; }
.access label { font-size: 13px; font-weight: 600; }
.access .row { display: flex; gap: 6px; }
.access input { flex: 1; min-width: 0; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; font-size: 16px; }
.access p { margin: 0; color: var(--muted); }

/* Footer: the small print, at the bottom of the side panel. */
.foot { order: 3; margin-top: auto; display: flex; flex-direction: column; gap: 6px; padding-top: 12px; border-top: 1px solid var(--line); font-family: var(--body); font-size: 13px; line-height: 1.4; color: var(--muted); flex: none; }
.foot p { margin: 0; }
.foot .links { display: flex; flex-wrap: wrap; column-gap: 20px; }
.foot .links a, .foot .links button { color: var(--ink); min-height: 32px; display: inline-flex; align-items: center; }

/* YouTube clip mode: the official embed with the overlay drawn above it. */
.yt { position: absolute; inset: 0; background: var(--black); }
.yt iframe, .yt #yt { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.stage.on-yt .fnbar { bottom: 13%; pointer-events: none; }
.stage.on-yt .captions { display: none; }
.yt-gate { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: stretch; justify-content: safe center; gap: 8px; padding: 24px max(24px, 16%); background: rgba(10,12,16,.94); overflow-y: auto; }
.yt-gate p { margin: 0; }
.yt-gate .gate-title { font-size: 22px; }
.yt-gate .small { color: var(--muted); }
.yt-gate label { font-size: 14px; font-weight: 600; margin-top: 10px; }
.yt-gate .row { display: flex; gap: 8px; }
.yt-gate input[type="url"], .yt-gate input[type="search"] { flex: 1; min-width: 0; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; font-size: 16px; min-height: 44px; }
.yt-gate .advanced { font-size: 13px; color: var(--muted); }
.yt-gate .advanced summary { cursor: pointer; padding: 6px 0; }
.yt-gate .advanced label { display: block; font-weight: 400; margin: 4px 0; }
@media (max-width: 600px) { .yt-gate { position: static; padding: 16px; } .stage:has(.yt-gate:not([hidden])) { aspect-ratio: auto; } }

/* Problem reports, featured debates */
.report { background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: 10px; padding: 20px; width: min(460px, calc(100vw - 32px)); }
.report::backdrop { background: rgba(0,0,0,.6); }
.report form { display: flex; flex-direction: column; gap: 8px; }
.report h2 { margin: 0; font-size: 20px; }
.report p { margin: 0; color: var(--muted); }
.report label { font-size: 13px; font-weight: 600; margin-top: 4px; }
.report textarea, .report input { background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; font-family: var(--body); font-size: 16px; resize: vertical; }
.report .row { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.clip-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.clip-list .label { font-size: 14px; font-weight: 600; }
.clip-buttons { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px; }
.clip { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; background: var(--card); border: 1px solid var(--line); border-left: 3px solid var(--marker); border-radius: 6px; padding: 10px 12px; cursor: pointer; }
.clip:hover { border-color: var(--marker); }
.clip strong { font-size: 14px; }
.clip span { font-size: 12px; color: var(--muted); }

@media (max-width: 600px) {
  .top { gap: 10px; }
  .modes { overflow-x: auto; max-width: 100%; }
  .mode { white-space: nowrap; padding: 8px 10px; min-height: 44px; }
  .intro { font-size: 15px; }
  .controls { gap: 8px 10px; }
  .seek { order: 5; flex-basis: 100%; }
  .stats b { font-size: 17px; }
  .clip-buttons { grid-template-columns: 1fr; }
  .foot .links a, .foot .links button { min-height: 44px; }
}

/* Last, so it wins over every animation above. */
@media (prefers-reduced-motion: reduce) { .fncard, .fcard, .spinner, .status.live::before, .studio .live-bug.on-air::before, .btn.nudge { animation: none; } }
.yt-own { display: flex; flex-direction: column; gap: 8px; }
.yt-gate input[type="date"] { align-self: flex-start; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; font-size: 16px; min-height: 44px; color: inherit; }
.yt-gate .aired { font-weight: 400; }

/* ---------- claims by speaker ---------- */
:root { --r-supported: var(--ok); --r-missing_context: var(--warn); --r-misleading: color-mix(in srgb, var(--bad) 65%, var(--warn)); --r-false: var(--bad); --r-unverifiable: var(--neutral); }
.board { order: -2; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 14px 14px 12px; display: flex; flex-direction: column; gap: 10px; }
.board-head { display: flex; flex-direction: column; gap: 4px; }
.board-head h2 { margin: 0; font-size: 18px; font-weight: 800; letter-spacing: .02em; text-transform: uppercase; }
.board-meta { font-size: 12px; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
.board-meta .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--bad); margin-right: 6px; vertical-align: 1px; }
.board-rows { display: flex; flex-direction: column; }
.brow { display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; padding: 9px 0; border-top: 1px solid var(--line); background: none; border-left: 0; border-right: 0; border-bottom: 0; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.brow:first-child { border-top: 0; padding-top: 2px; }
.brow:hover .bname, .brow.on .bname { text-decoration: underline; text-underline-offset: 3px; }
.brow:focus-visible { outline: 2px solid var(--marker); outline-offset: 2px; }
.bname { font-weight: 700; font-size: 16px; }
.bname small { font-weight: 400; color: var(--muted); font-size: 13px; margin-left: 4px; }
.bcount { font-size: 13px; color: var(--muted); align-self: end; }
.bcount b { color: var(--text, #fff); font-size: 16px; font-variant-numeric: tabular-nums; }
.bar { grid-column: 1 / -1; display: flex; height: 22px; border-radius: 4px; overflow: hidden; background: var(--card); gap: 2px; }
.bar span { display: flex; align-items: center; justify-content: center; min-width: 0; font-size: 12px; font-weight: 800; color: var(--marker-ink); font-variant-numeric: tabular-nums; transition: flex-grow .4s ease; }
.bar .r-missing_context, .bar .r-misleading { color: var(--marker-ink); }
.bar .r-false, .bar .r-unverifiable { color: #fff; }
.bstats { grid-column: 1 / -1; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
:is(.bar span, .board-legend i, .final-table th).r-supported { background: var(--r-supported); }
:is(.bar span, .board-legend i, .final-table th).r-missing_context { background: var(--r-missing_context); }
:is(.bar span, .board-legend i, .final-table th).r-misleading { background: var(--r-misleading); }
:is(.bar span, .board-legend i, .final-table th).r-false { background: var(--r-false); }
:is(.bar span, .board-legend i, .final-table th).r-unverifiable { background: var(--r-unverifiable); }
.board-legend { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 12px; color: var(--muted); }
.board-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.board-legend b { color: var(--text, #fff); margin-left: 3px; font-variant-numeric: tabular-nums; }
.board-note { margin: 0; font-size: 12px; color: var(--muted); font-style: italic; }
.feed .fcard.filtered { display: none; }

/* on-video scoreboard, shown in Clean feed */
.board-bug { position: absolute; top: 3%; right: 2%; width: min(42%, 380px); background: rgba(14,16,21,.9); border: 1px solid rgba(255,255,255,.14); border-radius: 8px; padding: 8px 10px; z-index: 4; font-size: clamp(10px, 1.1cqw, 13px); pointer-events: none; }
.board-bug .bug-head { display: flex; justify-content: space-between; gap: 8px; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; padding-bottom: 6px; border-bottom: 1px solid rgba(255,255,255,.14); }
.board-bug .bug-row { display: grid; grid-template-columns: 7.5em 2em 1fr; align-items: center; gap: 8px; padding: 5px 0; border-bottom: 1px solid rgba(255,255,255,.08); }
.board-bug .bug-row:last-child { border-bottom: 0; }
.board-bug .bug-row b { font-weight: 800; text-transform: uppercase; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-bug .bug-row em { font-style: normal; font-weight: 800; font-size: 1.3em; text-align: right; font-variant-numeric: tabular-nums; }
.board-bug .bar { height: 1em; }
.board-bug .bar span { font-size: 0; }

/* end-of-clip summary */
.board-final { position: absolute; inset: 0; z-index: 6; background: #0a0c10; display: flex; flex-direction: column; gap: 12px; padding: clamp(14px, 3%, 32px) clamp(16px, 5%, 56px); overflow-y: auto; }
.final-head { display: flex; justify-content: space-between; align-items: center; }
.final-brand { font-family: Archivo, sans-serif; font-weight: 900; font-stretch: 75%; font-size: 26px; }
.final-brand sup { background: var(--marker); color: var(--marker-ink); font-size: 13px; padding: 0 4px; margin-left: 2px; }
.final-kicker { margin-left: 12px; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.final-close { min-width: 40px; font-size: 20px; }
.board-final h2 { margin: 0; font-size: clamp(20px, 2.4vw, 30px); }
.final-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 14px; }
.final-table th, .final-table td { padding: 7px 8px; text-align: center; border-bottom: 1px solid var(--line); }
.final-table th:first-child, .final-table td:first-child { text-align: left; }
.final-table thead th { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--marker-ink); }
.final-table thead th.plain { color: var(--muted); background: none; }
.final-table td.zero { color: var(--muted); }
.final-table td b { font-size: 16px; }
.final-totals { display: flex; gap: 28px; flex-wrap: wrap; }
.final-totals div { display: flex; flex-direction: column; }
.final-totals b { font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; }
.final-totals span { font-size: 12px; color: var(--muted); }
.final-note { margin: 0; font-size: 12px; color: var(--muted); font-style: italic; }
.final-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.final-url { margin-left: auto; color: var(--marker); font-weight: 600; }
/* Phones: the summary sits in the flow and the stage grows to hold it, so it can scroll into view. */
@media (max-width: 600px) { .board-final { position: relative; } .stage:has(.board-final:not([hidden])) { aspect-ratio: auto; flex: none; } .final-table { font-size: 12px; } .final-table th, .final-table td { padding: 6px 4px; } }
.early { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.early .early-links { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.early .early-links .linkish { color: var(--ink); min-height: 32px; }
.yt-gate input::placeholder { color: var(--muted); }

/* Hide the all-zero counters until the first check lands. */
.panel:has(#feed-empty:not([hidden])) .stats { display: none; }

/* Phone: one-line header, and no capture-only controls. */
@media (max-width: 600px) {
  .top { flex-wrap: nowrap; padding: 10px 0; }
  .brand { font-size: 22px; }
  .brand .tag { font-size: 13px; white-space: nowrap; }
  /* The sign-up folds into one button; tapping it opens the email field on its own row. */
  .nav-early .long { display: none; }
  .nav-early .short { display: inline; }
  .nav-early .btn { min-height: 40px; padding: 8px 12px; font-size: 14px; }
  .nav-early:not(.open) input { display: none; }
  .top:has(.nav-early.open) { flex-wrap: wrap; row-gap: 8px; }
  .nav-early.open { flex-basis: 100%; }
  .nav-early.open input { flex: 1; width: 0; }
  .nav-early.open .short { display: none; }
  .nav-early.open .send { display: inline; }
  /* Search folds into a button too; tapping it opens the field on its own row. */
  .nav-search .long { display: none; }
  .nav-search .short { display: inline; }
  .nav-search .btn { min-height: 40px; padding: 8px 12px; font-size: 14px; }
  .nav-search:not(.open) input { display: none; }
  .top:has(.nav-search.open) { flex-wrap: wrap; row-gap: 8px; }
  .nav-search.open { flex-basis: 100%; order: 4; }
  .nav-search.open input { flex: 1; width: 0; }
  .top:has(.modes:not([hidden])) { flex-wrap: wrap; }
  .top:has(.modes:not([hidden])) .modes { order: 3; flex-basis: 100%; }
  #try-debate { border: 0; padding: 8px 0; min-height: 44px; text-decoration: underline; text-underline-offset: 3px; color: var(--muted); }
}
@media (max-width: 380px) { .brand .tag { display: none; } }
/* 320px phones: the three panel tabs fit without scrolling. */
@media (max-width: 359px) { .panel-tabs { gap: 14px; } .tab { font-size: 15px; } }
/* Small windows: the tagline gives way so the header sign-up stays on one row. */
@media (min-width: 601px) and (max-width: 820px) { .brand .tag { display: none; } }

/* Sources sheet (phones tap the on-screen card) */
.sheet { background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px 20px; width: min(520px, calc(100vw - 32px)); }
.sheet::backdrop { background: rgba(0,0,0,.6); }
.sheet-head { display: flex; align-items: center; gap: 10px; }
.sheet-at { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet-close { margin-left: auto; font-size: 22px; line-height: 1; padding: 6px 14px; }
.sheet-ctx { margin: 12px 0 8px; font-weight: 700; font-size: 17px; line-height: 1.35; color: var(--white); }
.sheet-quote { display: block; font-family: var(--body); font-style: italic; color: var(--muted); font-size: 15px; }
.sheet-title { margin: 16px 0 6px; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.sheet-srcs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.sheet-srcs li { border-top: 1px solid var(--line); }
.sheet-srcs a { display: block; padding: 12px 0; min-height: 44px; color: var(--ink); text-underline-offset: 3px; }
.sheet-srcs a { display: flex; align-items: flex-start; gap: 8px; }
.stype { flex: none; display: inline-flex; color: var(--marker); }
.fcard .srcs .stype { margin-top: 2px; }
.sheet-srcs .stype { margin-top: 3px; }
.stage.on-yt .fncard { pointer-events: auto; }
/*
 * The yellow ticker only carries prompts while nothing is on screen (live checking: "Listening…",
 * "Press Start checking"). A shown check is the card's job, and the scripted demo and prepared
 * debates need no prompts, so there it stays out of the picture.
 */
.fnbar:has(.fncard:not([hidden])) .ticker,
.stage:not(.on-yt):has(#studio:not([hidden]) .live-bug:not(.on-air)) .ticker,
.player:has(#play[hidden]):has(#stop[hidden]) .stage.on-yt .ticker { display: none; }
@media (max-width: 600px) {
  .sheet { margin: auto 0 0; width: 100%; max-width: 100%; max-height: 80vh; border-radius: 16px 16px 0 0; border-bottom: 0; padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
  .sheet[open] { animation: sheet-up .22s ease-out; }
  .stats { display: none; }
}
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) { .sheet[open] { animation: none; } }


/* Check marks under a prepared clip: grey until shown, then the rating colour; tap to jump. */
.marks { position: relative; flex-basis: 100%; order: 6; height: 28px; margin: 0 9px; }
.marks::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 2px; margin-top: -1px; background: var(--line); }
.marks .mk { position: absolute; top: 50%; width: 10px; height: 10px; margin: -5px 0 0 -5px; padding: 0; border: 0; border-radius: 50%; background: #5A5F6B; cursor: pointer; }
.marks .mk::after { content: ""; position: absolute; inset: -9px -3px; }
.marks .mk.done { background: var(--c, var(--marker)); }
.marks .mk:hover, .marks .mk:focus-visible { transform: scale(1.4); }
.marks .playhead { position: absolute; top: 4px; bottom: 4px; width: 2px; margin-left: -1px; left: 0; background: var(--white); border-radius: 1px; pointer-events: none; }

/* Phones: once a clip is loaded, the player bar tightens so the checks keep most of the screen. */
@media (max-width: 600px) {
  .player:not(:has(.yt-gate:not([hidden]), .drop:not([hidden]), .mic-gate:not([hidden]), .board-final:not([hidden]))) .controls { padding: 4px 10px; gap: 0 12px; }
  .player:not(:has(.yt-gate:not([hidden]), .drop:not([hidden]), .mic-gate:not([hidden]), .board-final:not([hidden]))) .controls .status.live { display: none; }
  .player:not(:has(.yt-gate:not([hidden]), .drop:not([hidden]), .mic-gate:not([hidden]), .board-final:not([hidden]))) .controls .btn { min-height: 40px; padding: 6px 14px; }
  .player:not(:has(.yt-gate:not([hidden]), .drop:not([hidden]), .mic-gate:not([hidden]), .board-final:not([hidden]))) #try-debate { margin-left: auto; }
  .player:not(:has(.yt-gate:not([hidden]), .drop:not([hidden]), .mic-gate:not([hidden]), .board-final:not([hidden]))) .seek { height: 28px; }
}

/*
 * The one-screen app shell. Wide screens: header on top, player left, panel right, nothing else.
 * The player's width follows the height left for it (the layout is a size container, so 100cqh is
 * its height), so a short laptop screen gets a smaller video rather than a scrolling page.
 * Phones and portrait tablets: header, then the player, then the panel filling the rest and scrolling.
 * Landscape tablets and small windows use the side-by-side layout. Landscape phones are too short
 * for either, so they keep the ordinary scrolling page.
 */
@media (min-width: 961px), (min-width: 640px) and (min-aspect-ratio: 1/1) and (min-height: 500px), (max-width: 960px) and (max-aspect-ratio: 999/1000) and (min-height: 500px), (max-width: 639px) and (min-height: 500px) {
  html:has(> body.app), body.app { height: 100%; overflow: hidden; overscroll-behavior: none; }
  body.app { display: flex; flex-direction: column; height: 100vh; height: 100dvh; min-height: 0; padding-bottom: 16px; }
  .top { flex: none; }
  .layout { flex: 1; min-height: 0; }
  .panel { overflow: hidden; }
  .panel-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding-right: 4px; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
  .transcript-box { flex: 1; min-height: 0; }
  .transcript { flex: 1; min-height: 0; max-height: none; overscroll-behavior: contain; }
}
@media (min-width: 961px), (min-width: 640px) and (min-aspect-ratio: 1/1) and (min-height: 500px) {
  .layout { container-type: size; align-items: start; }
  .player { --chrome: 96px; justify-self: center; width: min(100%, calc((100cqh - var(--chrome)) * 16 / 9)); }
  .player:has(#marks:not([hidden])) { --chrome: 106px; }
  .layout:has(#intro-demo:not([hidden])) .player { --chrome: 150px; }
  .panel { align-self: stretch; }
}
@media (max-width: 960px) and (max-aspect-ratio: 999/1000) and (min-height: 500px), (max-width: 639px) and (min-height: 500px) {
  body.app { padding-bottom: 0; }
  .layout { display: flex; flex-direction: column; gap: 12px; padding-top: 12px; }
  .intro, .player { flex: none; }
  .panel { flex: 1; }
  .panel-body { padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
  .transcript-box { padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
}
/* Phones, on a YouTube clip: the video has its own clock, so the status and the picker share one row. */
@media (max-width: 600px) {
  .controls:has(#marks:not([hidden])) .clock { display: none; }
  .controls:has(#marks:not([hidden])) .status { margin-left: 0; flex: 1; min-width: 0; }
}
/* Phones: the video runs edge to edge, like a video app. */
@media (max-width: 600px) and (min-height: 500px) {
  /* The picker and the end-of-clip summary take the whole screen below the header. */
  .layout:has(.yt-gate:not([hidden]), .board-final:not([hidden])) .player { flex: 1; min-height: 0; overflow-y: auto; }
  .layout:has(.yt-gate:not([hidden]), .board-final:not([hidden])):not(:has(#access:not([hidden]))) .panel { display: none; }
  .player { margin-inline: calc(-1 * max(16px, env(safe-area-inset-left, 0px))) calc(-1 * max(16px, env(safe-area-inset-right, 0px))); }
  .layout { padding-top: 0; }
  .stage { border-radius: 0; }
  .controls { border-inline: 0; border-radius: 0; }
  .layout:has(.yt-gate:not([hidden]), .board-final:not([hidden])) .player { margin-inline: 0; }
  .layout:has(.yt-gate:not([hidden]), .board-final:not([hidden])) .stage { border-radius: 8px 8px 0 0; }
  .layout:has(.yt-gate:not([hidden]), .board-final:not([hidden])) .controls { border-inline: 1px solid var(--line); border-radius: 0 0 8px 8px; }
}

/* YouTube search results under the link box */
.yt-results { display: flex; flex-direction: column; gap: 6px; }
.yt-result { flex: none; display: flex; gap: 10px; align-items: center; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 6px; cursor: pointer; color: inherit; min-height: 44px; }
.yt-result:hover, .yt-result:focus-visible { border-color: var(--marker); }
.yt-result img { width: 112px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 4px; flex: none; background: var(--bg); }
.yt-result .meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.yt-result strong { color: var(--ink); font-size: 14px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.yt-result span { font-size: 12px; color: var(--muted); }
.yt-result .cc { color: var(--ok); }
@media (max-width: 600px) { .yt-result img { width: 96px; } }
