:root { --bg:#fbfaf7; --panel:#fff; --ink:#1d1c1a; --muted:#6b6862; --line:#e2dfd8; --accent:#8a3ffc; --mark:#ffe58a;
        --media:#8a877f; --band:#e9e7e1; --warn:#b3261e; color-scheme: light dark; }
@media (prefers-color-scheme: dark) {
  :root { --bg:#151517; --panel:#1e1e21; --ink:#ecebe7; --muted:#9a978f; --line:#313136; --accent:#b58cff; --mark:#6b5a12;
          --media:#85827b; --band:#2a2a2e; --warn:#ff8a80; } }
* { box-sizing: border-box; }
html, body { margin:0; } html { height:100%; } body { min-height:100%; }
body:has(main.watch) { height:100%; }   /* only the watch page is a fixed-height app; other pages scroll, footer at the end */
body { background:var(--bg); color:var(--ink); font:15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; display:flex; flex-direction:column; }
a { color:var(--accent); text-decoration:none; } a:hover { text-decoration:underline; }
header { display:flex; gap:20px; align-items:baseline; padding:10px 16px; border-bottom:1px solid var(--line); background:var(--panel); flex-wrap:wrap; }
header .brand { font-weight:700; color:var(--ink); }
header .badge { font-size:11px; background:var(--warn); color:#fff; border-radius:3px; padding:1px 6px; }
main { flex:1; width:100%; max-width:980px; margin:0 auto; padding:16px; min-height:0; }
footer { padding:10px 16px; border-top:1px solid var(--line); color:var(--muted); font-size:12px; text-align:center; }
input, select, button { font:inherit; color:inherit; background:var(--panel); border:1px solid var(--line); border-radius:6px; padding:6px 10px; }
button { cursor:pointer; } button:hover { border-color:var(--accent); } button:disabled { opacity:.5; cursor:default; }
.row { display:flex; gap:8px; flex-wrap:wrap; align-items:center; margin:8px 0; }
.row input[type=search], .row input[type=text] { flex:1; min-width:160px; }
.tabs { display:flex; gap:4px; border-bottom:1px solid var(--line); margin-top:8px; }
.tabs button { border:0; border-bottom:2px solid transparent; border-radius:0; background:none; padding:8px 14px; color:var(--muted); }
.tabs button.on { color:var(--ink); border-bottom-color:var(--accent); }
.hit { padding:10px 0; border-bottom:1px solid var(--line); }
.hit .meta { color:var(--muted); font-size:13px; }
.hit p { margin:4px 0 0; overflow-wrap:anywhere; }
mark { background:var(--mark); color:inherit; border-radius:2px; padding:0 1px; }
.note { color:var(--muted); padding:16px 0; }
.tag { font-size:11px; border:1px solid var(--line); border-radius:3px; padding:0 5px; color:var(--muted); margin-left:6px; white-space:nowrap; }
.tag.del { color:var(--warn); border-color:var(--warn); }
table { border-collapse:collapse; width:100%; } td, th { text-align:left; padding:7px 8px; border-bottom:1px solid var(--line); }
th { color:var(--muted); font-weight:500; font-size:13px; }
.num { font-variant-numeric:tabular-nums; white-space:nowrap; }

header .hsearch { margin-left:auto; flex:0 1 280px; min-width:160px; }
header .hsearch input { width:100%; padding:4px 10px; }
@media (max-width: 600px) { header .hsearch { flex-basis:100%; margin-left:0; } header { row-gap:6px; } }
.tabs .n { font-size:12px; color:var(--muted); margin-left:4px; font-variant-numeric:tabular-nums; }
#timeline { margin:10px 0 2px; }
#timeline svg { width:100%; height:72px; display:block; background:var(--panel); border:1px solid var(--line); border-radius:6px; }
#timeline rect.b { fill:var(--accent); opacity:.75; cursor:pointer; } #timeline rect.b:hover, #timeline rect.b.sel { opacity:1; }
#timeline rect.z { fill:var(--line); }
#timeline .cap { display:flex; justify-content:space-between; color:var(--muted); font-size:12px; margin-top:2px; }
.chip { display:inline-flex; gap:6px; align-items:center; font-size:13px; background:var(--band); border-radius:12px; padding:2px 4px 2px 10px; }
.chip button { border:0; background:none; padding:0 6px; }
.hit .acts { float:right; display:flex; gap:4px; }
.hit .acts button { font-size:12px; padding:1px 8px; }

/* watch page */
main.watch { max-width:none; display:grid; grid-template-columns:minmax(0,1fr) 360px; gap:14px; padding:12px; }
.col { display:flex; flex-direction:column; min-height:0; min-width:0; }
#panes { display:none; }
#player { flex:none; aspect-ratio:16/9; width:100%; max-height:46vh; background:#000; border-radius:6px; overflow:hidden; }
#player iframe { width:100%; height:100%; border:0; display:block; }
#slider { background:var(--panel); border:1px solid var(--line); border-radius:6px; padding:12px; }
#slider input[type=range] { width:100%; padding:0; }
.bar { display:flex; gap:8px; align-items:center; margin:8px 0; flex-wrap:wrap; font-size:13px; }
.bar h1 { font-size:15px; margin:0; flex:1; min-width:200px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
#transcript, #chat { flex:1; overflow-y:auto; min-height:160px; background:var(--panel); border:1px solid var(--line); border-radius:6px; }
.turn { display:grid; grid-template-columns:64px 1fr; gap:8px; padding:6px 10px; cursor:pointer; border-left:3px solid transparent; }
.turn:hover { background:var(--band); }
.turn.now { border-left-color:var(--accent); background:var(--band); }
.turn .t { color:var(--muted); font-size:12px; font-variant-numeric:tabular-nums; padding-top:2px; }
.turn .who { font-weight:600; margin-right:6px; }
.turn.media { color:var(--media); } .turn.media .who { font-weight:500; font-style:italic; }
.hide-media .turn.media { display:none; }
.mutedband { background:var(--band); color:var(--muted); font-size:12px; text-align:center; padding:4px; }
#strip { width:100%; height:54px; display:block; background:var(--panel); border:1px solid var(--line); border-radius:6px; cursor:pointer; }
#chat { margin-top:8px; padding:6px 0; font-size:14px; }
.msg { padding:2px 10px; overflow-wrap:anywhere; }
.msg .t { color:var(--muted); font-size:11px; margin-right:6px; font-variant-numeric:tabular-nums; }
.msg .who { font-weight:600; cursor:pointer; color:var(--accent); }
.msg.deleted .body { color:var(--muted); font-style:italic; }
.msg.mod { color:var(--warn); font-size:13px; }
.msg .first { color:#fff; background:var(--accent); font-size:10px; border-radius:3px; padding:0 4px; margin-right:4px; }
#terms { font-size:12px; color:var(--muted); min-height:18px; margin-top:4px; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
/* phone / narrow (and any phone held sideways): player on top at full 16:9, then one pane (transcript or chat) */
@media (max-width: 860px), (orientation: landscape) and (max-height: 500px) {
  body:has(main.watch) { height:100vh; height:100dvh; }
  body:has(main.watch) header { padding:6px 12px; gap:14px; }
  body:has(main.watch) header .hsearch { display:none; }
  body:has(main.watch) footer { padding:3px 12px; font-size:10.5px; line-height:1.3; }
  main.watch { display:flex; flex-direction:column; padding:0; gap:0; }
  main.watch .col { display:contents; }
  main.watch #player, main.watch #slider { order:1; flex:none; border-radius:0; }
  main.watch #player { max-height:none; }
  main.watch #slider { border-width:0 0 1px; }
  main.watch .bar.info { order:2; flex:none; margin:0; padding:6px 12px 4px; row-gap:4px; }
  .bar.info h1 { flex-basis:100%; min-width:0; font-size:14px; line-height:1.3; white-space:normal;
                 display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; }
  .bar.info button { padding:4px 10px; }
  #panes { order:3; display:flex; flex:none; margin:0; padding:0 4px; gap:0; background:var(--panel); }
  #panes button { flex:1; padding:10px 8px; font-size:15px; }
  #transcript, #strip, #terms, #chat { order:4; }
  #transcript, #chat { flex:1; min-height:0; max-height:none; margin:0; border-radius:0; border-width:0; }
  #strip, #terms { flex:none; }
  #strip { height:40px; border-radius:0; border-width:0 0 1px; }
  #terms { margin:0; padding:3px 12px; background:var(--panel); border-bottom:1px solid var(--line); }
  main.watch[data-pane="transcript"] :is(#strip, #terms, #chat) { display:none; }
  main.watch[data-pane="chat"] #transcript { display:none; }
  .turn { grid-template-columns:56px 1fr; padding:8px 12px; }
  .msg { padding:3px 12px; font-size:15px; }
}
/* phone held sideways: video left, tabs + pane right */
@media (orientation: landscape) and (max-height: 500px) {
  body:has(main.watch) header { padding:3px 12px; }
  main.watch { display:grid; grid-template-columns:minmax(0, 56%) minmax(0, 1fr); grid-template-rows:auto auto minmax(0, 1fr); }
  main.watch #player, main.watch #slider { grid-column:1; grid-row:1 / -1; align-self:start; }
  main.watch .bar.info { grid-column:2; grid-row:1; padding:4px 12px 2px; border-left:1px solid var(--line); }
  .bar.info h1 { -webkit-line-clamp:1; }
  #panes { grid-column:2; grid-row:2; border-left:1px solid var(--line); }
  #transcript, #chat { grid-column:2; grid-row:3; border-left:1px solid var(--line); }
  main.watch :is(#strip, #terms) { display:none; }
}

/* weekly reel */
main.reel { max-width:1200px; }
.reelbar { display:flex; gap:8px; align-items:center; flex-wrap:wrap; margin-bottom:10px; }
.reelbar select { flex:1; min-width:200px; }
.reelbar button { font-size:18px; padding:4px 14px; }
#stage { display:grid; grid-template-columns:minmax(0, 1fr) 380px; gap:16px; }
.rcol { display:flex; flex-direction:column; min-width:0; }
main.reel #player { flex:none; aspect-ratio:16/9; width:100%; max-height:none; background:#000; border-radius:6px; overflow:hidden; }
main.reel #player iframe { width:100%; height:100%; border:0; display:block; }
.clipctl { margin:8px 0; }
#card { background:var(--panel); border:1px solid var(--line); border-radius:6px; padding:12px 14px; }
#card h2 { font-size:18px; margin:6px 0 2px; line-height:1.3; }
#card h3 { font-size:13px; text-transform:uppercase; letter-spacing:.04em; color:var(--muted); margin:12px 0 2px; }
#card p { margin:0; }
#card blockquote { margin:10px 0 0; padding:6px 12px; border-left:3px solid var(--accent); background:var(--band); font-style:italic; }
.cmeta { display:flex; gap:6px; flex-wrap:wrap; align-items:center; }
.cmeta .tag { margin-left:0; }
.cwhen { color:var(--muted); font-size:13px; }
.cex { margin:4px 0 0; padding-left:18px; color:var(--muted); }
.sev { font-weight:700; font-size:13px; color:#fff; border-radius:4px; padding:1px 8px; background:#8a877f; }
.sev.s5, .sev.s6 { background:#c77d0a; } .sev.s7, .sev.s8 { background:#c2410c; } .sev.s9, .sev.s10 { background:#b3261e; }
#rtabs { margin-top:0; }
#chatbox, #lines { background:var(--panel); border:1px solid var(--line); border-top:0; border-radius:0 0 6px 6px; }
#chatbox { display:flex; flex-direction:column; height:min(70vh, 640px); }
#chatbox[hidden], #lines[hidden] { display:none; }
.allchat { font-size:13px; color:var(--muted); padding:6px 10px; border-bottom:1px solid var(--line); }
#rchat { flex:1; overflow-y:auto; padding:6px 0; font-size:14px; }
#lines { max-height:min(70vh, 640px); overflow-y:auto; }
.note.small { font-size:12px; }
@media (max-width: 860px) {
  main.reel { padding:8px; }
  #stage { grid-template-columns:1fr; }
  main.reel #player { border-radius:0; margin:0 -8px; width:calc(100% + 16px); }
  #chatbox { height:60vh; }
}
#views { margin:0 0 10px; }
.verdict { font-weight:600; font-size:12px; border-radius:4px; padding:1px 8px; color:#fff; background:#8a877f; white-space:nowrap; }
.v-false { background:#b3261e; } .v-misleading { background:#c2410c; } .v-unsupported { background:#8a6d0a; }
.v-mostly_accurate { background:#3f7d3a; } .v-accurate { background:#2e6b2a; }
.tally { display:flex; gap:6px; flex-wrap:wrap; margin:6px 0 12px; }
.fh { font-size:18px; margin:4px 0; }
.alltime { background:var(--panel); border:1px solid var(--line); border-radius:6px; padding:8px 12px; margin-bottom:12px; }
.alltime summary { cursor:pointer; font-weight:600; }
.alltime table { margin-top:8px; font-size:14px; }
.fact { background:var(--panel); border:1px solid var(--line); border-radius:6px; padding:12px 14px; margin-bottom:10px; }
.fact h3 { font-size:16px; margin:6px 0 2px; line-height:1.35; }
.fact blockquote { margin:8px 0; padding:4px 12px; border-left:3px solid var(--accent); background:var(--band); font-style:italic; }
.fact p { margin:4px 0; } .fact .fx { color:var(--muted); font-size:14px; }
@media (max-width: 600px) { .alltime table { font-size:12px; } .alltime td, .alltime th { padding:5px 4px; } }
#stage[hidden], #facts[hidden], #views[hidden] { display:none; }
.correction { margin:8px 0; padding:6px 10px; border-left:3px solid #2e6b2a; background:var(--band); font-size:14px; }
.report { margin-top:12px; font-size:13px; color:var(--muted); }
.report summary { cursor:pointer; }
.report form { display:flex; flex-direction:column; gap:6px; margin-top:6px; }
.report textarea { font:inherit; color:inherit; background:var(--panel); border:1px solid var(--line); border-radius:6px; padding:6px 10px; }
.flag { background:var(--panel); border:1px solid var(--line); border-radius:6px; padding:12px 14px; margin-bottom:10px; }
.flag .acts { display:flex; gap:6px; flex-wrap:wrap; margin-top:8px; }
#trends[hidden] { display:none; }
:root { --series1:#2a78d6; --tt-bg:#0b0b0b; --tt-ink:#f0efec; }
@media (prefers-color-scheme: dark) { :root { --series1:#3987e5; --tt-bg:#f0efec; --tt-ink:#0b0b0b; } }
.charts { display:grid; grid-template-columns:repeat(auto-fit, minmax(280px, 1fr)); gap:12px; margin-bottom:12px; }
.chart { margin:0; background:var(--panel); border:1px solid var(--line); border-radius:6px; padding:10px 12px; }
.chart figcaption { display:flex; flex-direction:column; font-size:14px; } .chart figcaption span { color:var(--muted); font-size:12px; }
.chart svg { width:100%; height:auto; display:block; margin-top:4px; }
.chart .grid { stroke:var(--line); stroke-width:1; }
.chart .axis { fill:var(--muted); font-size:10px; }
.chart .val { fill:var(--ink); font-size:11px; font-weight:600; }
.chart .bar { fill:var(--series1); }
.chart .hit { fill:transparent; cursor:default; outline:none; }
.chart .hit:hover, .chart .hit:focus { fill:var(--ink); fill-opacity:.06; }
.tip { position:absolute; z-index:10; background:var(--tt-bg); color:var(--tt-ink); font-size:12px; line-height:1.4; padding:6px 9px; border-radius:6px; pointer-events:none; max-width:240px; }
.tip[hidden] { display:none; } .tip .tt { font-weight:600; }
.share { font-size:13px; padding:3px 12px; margin-top:10px; }
.fact.focus { border-color:var(--accent); box-shadow:0 0 0 2px var(--accent); }
.cnum { margin:2px 0 0; padding-left:18px; font-size:14px; }
.chip { border:0; cursor:pointer; font:inherit; font-weight:600; font-size:13px; padding:3px 10px; }
.tally.picking .chip[aria-pressed=false] { opacity:.4; }
.chip:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
.fcpage .filters select { max-width:100%; }
.fcpage .cex { margin:6px 0 0; padding-left:18px; font-size:14px; }
