/* Week-in-review dashboard (folded into the home page). Topic chip colours (.topic /
   .topic-*) come from the home page's own styles. */

.week-review { margin-top: 1.5rem; }
.week-range { font-size: 1.15rem; font-weight: 700; margin: 0 0 0.25rem; }

.chan-chips { display: flex; gap: 0.4rem; flex-wrap: wrap; margin: 0.75rem 0 1.25rem; }
/* inline-flex so a channel chip can carry its logo tile beside the name (text-only chips are
   unaffected — a flex box with one child lays out the same as the old inline button). */
.chip { width: auto; margin: 0; padding: 0.2rem 0.7rem; font-size: 0.82rem; line-height: 1.5;
  display: inline-flex; align-items: center; gap: 0.35rem;
  cursor: pointer; border-radius: 999px; border: 1px solid var(--pico-muted-border-color);
  /* --tv-ink (not --pico-color): chip is a <button>; Pico shadows --pico-color dark on buttons. */
  background: var(--pico-card-background-color); color: var(--tv-ink); }
.chip.on { border-color: var(--tv-coral, #fe7f63); background: var(--tv-coral-tint, rgba(254, 127, 99, 0.14));
  color: var(--tv-coral-text, #cf4020); font-weight: 600; }
.chip.disabled { opacity: 0.45; cursor: not-allowed; }

/* Blurb — theme-aware: a translucent accent tint over the page background (readable in
   both light and dark themes) with text in the theme's own colour. No hardcoded light box. */
.blurb { background: var(--tv-coral-tint, rgba(254, 127, 99, 0.14)); border: 1px solid var(--pico-muted-border-color);
  border-left: 3px solid var(--tv-coral, #fe7f63); border-radius: 8px; padding: 0.85rem 1.1rem;
  font-size: 1rem; line-height: 1.6; color: var(--pico-color); margin-bottom: 1.25rem; }
.blurb.muted { border-left-color: var(--pico-muted-border-color); background: transparent;
  color: var(--pico-muted-color); font-style: italic; }

.stat-cards { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 1.5rem; }
.stat-card { flex: 1 1 130px; border: 1px solid var(--pico-muted-border-color); border-radius: 8px;
  padding: 0.7rem 0.9rem; background: var(--pico-card-background-color); }
.stat-card .num { font-size: 1.5rem; font-weight: 700; line-height: 1.1; }
.stat-card .lbl { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--pico-muted-color); }

h3.section { font-size: 0.95rem; margin: 1.5rem 0 0.6rem; }

/* Topic breakdown bars. FIXED final column (was `auto`) so every bar track is the SAME length
   regardless of how wide the count/airtime text is — otherwise a short label like "1 story · 5m"
   left a wider track than "128 stories · 18h 15m". */
.topic-bars { display: flex; flex-direction: column; gap: 0.4rem; }
.topic-row { display: grid; grid-template-columns: 130px 1fr 150px; align-items: center; gap: 0.6rem; }
.topic-row .bar-track { position: relative; background: var(--pico-secondary-background); border-radius: 5px; height: 16px; overflow: hidden; }
.topic-row .bar-fill { position: relative; z-index: 1; height: 100%; border-radius: 5px; }
/* Airtime milestone gridlines, drawn BEHIND the fill (visible only in the unfilled part, so each
   bar shows how far along the shared scale it reached). Theme-aware line colour. */
.topic-row .topic-tick { position: absolute; top: 0; bottom: 0; width: 1px; z-index: 0;
  background: var(--pico-muted-border-color); }
.topic-row .nums { font-size: 0.76rem; color: var(--pico-muted-color); white-space: nowrap;
  text-align: right; font-variant-numeric: tabular-nums; }
.tick-note { font-size: 0.68rem; color: var(--pico-muted-color); margin: 0.35rem 0 0; }

/* Per-day bars */
.day-bars { display: flex; gap: 0.6rem; align-items: flex-end; }
.day-col { flex: 1 1 0; text-align: center; }
.day-col .col-track { height: 70px; display: flex; align-items: flex-end; }
.day-col .col-fill { width: 100%; background: var(--tv-coral, #fe7f63); border-radius: 4px 4px 0 0; min-height: 2px; }
.day-col .col-fill.empty { background: var(--pico-secondary-background); }
.day-col .d-name { font-size: 0.72rem; font-weight: 600; margin-top: 0.25rem; }
.day-col .d-num { font-size: 0.7rem; color: var(--pico-muted-color); }

/* Top stories — each row expands to show its video inline underneath when clicked. */
.top-list { list-style: none; padding: 0; margin: 0; }
.top-item { border: 1px solid var(--pico-muted-border-color); border-left: 3px solid #cbd5e1;
  border-radius: 6px; margin-bottom: 0.45rem; background: var(--pico-card-background-color);
  transition: box-shadow 0.12s, border-color 0.12s; }
.top-item:hover { box-shadow: 0 2px 10px rgba(0,0,0,0.08); }
.top-item.playing { border-left-color: var(--tv-coral, #fe7f63); box-shadow: 0 2px 10px rgba(254,127,99,0.20); }
.top-row { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap;
  padding: 0.5rem 0.75rem; cursor: pointer; }
.top-row .rank { font-weight: 700; color: var(--pico-muted-color); min-width: 1.4rem; }
.top-row .ttl { flex: 1 1 280px; font-size: 0.9rem; }
.top-row .meta { font-size: 0.74rem; color: var(--pico-muted-color); font-variant-numeric: tabular-nums; }
.top-row .agenda-meta { color: var(--pico-muted-color); font-weight: 400; }

/* Inline player that opens directly under the clicked story. */
.week-player { padding: 0 0.75rem 0.75rem; }
.week-player .yt-wrap { position: relative; width: 100%; max-width: 640px; aspect-ratio: 16 / 9; }
.week-player .yt-wrap iframe, .week-player .yt-wrap > div { position: absolute; inset: 0; width: 100%; height: 100%; }
.week-player .no-video { color: var(--pico-muted-color); font-style: italic; margin: 0.4rem 0 0; }

.week-empty { margin-top: 1.5rem; padding: 1.25rem; text-align: center; color: var(--pico-muted-color);
  border: 1px dashed var(--pico-muted-border-color); border-radius: var(--pico-border-radius); }

/* Story-threads header: section title on the left, sort selector on the right. */
.thread-head { display: flex; align-items: baseline; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; }
.thread-sort { display: flex; align-items: center; gap: 0.4rem; margin: 0; font-size: 0.75rem;
  color: var(--pico-muted-color); }
.thread-sort select { width: auto; margin: 0; padding: 0.15rem 1.6rem 0.15rem 0.5rem; font-size: 0.78rem;
  height: auto; }

/* Channel names on their own line under a thread's title (All-channels list). */
.top-row .ttl .chan-line { display: block; margin-top: 0.1rem; font-weight: 400;
  color: var(--pico-muted-color); }

/* ── Story arcs — the zoomed-out level over threads (MULTIDAY_THREADS_PLAN.md §10) ──
   Deliberately introduces NO new colour pair: the container is a border + a coral rail (no
   fill), and the only coloured text is --tv-coral-text, the site's accent-text token. A tinted
   ground was tried and dropped — Pico's sectioning surface is lighter than the card colour on
   the dark theme, so member cards would have receded instead of lifting. */

/* View switch ("By storyline" / "By story thread") — reuses .chip for all of its colour. */
.week-views { display: flex; gap: 0.4rem; flex-wrap: wrap; margin: 1.25rem 0 0.2rem; }

.arc-box { border: 1px solid var(--pico-muted-border-color);
  border-left: 3px solid var(--tv-coral, #fe7f63); border-radius: 8px;
  padding: 0.55rem 0.6rem 0.35rem; margin-bottom: 0.9rem; }
.arc-head { display: flex; align-items: baseline; gap: 0.6rem; flex-wrap: wrap;
  padding: 0.1rem 0.25rem 0.5rem; }
.arc-head .arc-title { flex: 1 1 260px; font-size: 0.95rem; font-weight: 700; }
.arc-head .meta { font-size: 0.74rem; color: var(--pico-muted-color);
  font-variant-numeric: tabular-nums; }
/* Accent text on the page background (NOT inside a button) — --tv-coral-text is the readable
   half of the accent in both themes; --tv-coral itself is a fill and must never be text. */
.arc-count { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--tv-coral-text); font-weight: 700; white-space: nowrap; }

/* The accent rail belongs to the CONTAINER, so member cards drop their own — otherwise the arc
   reads as a box inside a box. :not(.open) keeps this from fighting .top-item.open, which has
   equal specificity and must still win when a row is expanded. */
.arc-box .top-item:not(.open) { border-left-color: transparent; }
.arc-box .top-item { margin-bottom: 0.4rem; }
.arc-box .top-item:last-child { margin-bottom: 0.15rem; }
.arc-seq { font-weight: 700; color: var(--pico-muted-color); min-width: 1.4rem;
  font-size: 0.78rem; font-variant-numeric: tabular-nums; }

/* Brief highlight when the threads view's badge jumps to an arc. */
.arc-box.arc-flash { box-shadow: 0 0 0 2px var(--tv-coral-tint), 0 2px 10px rgba(254,127,99,0.20); }

/* The arc badge on a thread row (threads view). OUTLINED, never a filled pastel pill, so it
   cannot be mistaken for the topic chip beside it. It IS a <button>, so its text uses
   --tv-coral-text (accent) — never --pico-color, which Pico shadows dark inside buttons. */
.arc-tag { width: auto; margin: 0; padding: 0.02rem 0.45rem; font-size: 0.68rem; line-height: 1.5;
  display: inline-flex; align-items: center; gap: 0.25rem; cursor: pointer;
  border-radius: 999px; border: 1px solid var(--tv-coral, #fe7f63);
  background: transparent; color: var(--tv-coral-text); font-weight: 600; white-space: nowrap; }
.arc-tag:hover { background: var(--tv-coral-tint, rgba(254,127,99,0.14)); }
.arc-tag .at-dot { font-size: 0.6rem; line-height: 1; }

/* ── Thread clip panel (watch every video in a story; compare two side by side) ── */
.top-row .expand { color: var(--pico-muted-color); font-size: 0.8rem; margin-left: 0.2rem; }
.top-item.open { border-left-color: var(--tv-coral, #fe7f63); box-shadow: 0 2px 10px rgba(254,127,99,0.20); }

.thread-clips { padding: 0.15rem 0.75rem 0.7rem; }
.clip-modes { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin: 0.2rem 0 0.5rem; }
.clip-count { font-size: 0.72rem; color: var(--pico-muted-color); }
.mode-btns { display: flex; gap: 0.3rem; }
.mode-btn { width: auto; margin: 0; padding: 0.12rem 0.6rem; font-size: 0.72rem; line-height: 1.4;
  cursor: pointer; border-radius: 999px; border: 1px solid var(--pico-muted-border-color);
  /* --tv-ink (not --pico-color): mode-btn is a <button>; Pico shadows --pico-color dark on buttons. */
  background: var(--pico-card-background-color); color: var(--tv-ink); }
.mode-btn.on { border-color: var(--tv-coral, #fe7f63); background: var(--tv-coral-tint, rgba(254,127,99,0.14)); font-weight: 600; }
.clip-hint { font-size: 0.7rem; color: var(--pico-muted-color); margin: 0 0 0.5rem; }

.clip-day { margin-bottom: 0.35rem; }
.clip-day-h { font-size: 0.7rem; font-weight: 700; color: var(--pico-muted-color); margin: 0.3rem 0 0.15rem; }
.clip-day-h .clip-day-date { font-weight: 400; opacity: 0.8; }
.clip-row { display: flex; align-items: center; gap: 0.5rem; padding: 0.26rem 0.4rem; border-radius: 5px;
  cursor: pointer; font-size: 0.78rem; border: 1px solid transparent; }
.clip-row:hover { background: var(--tv-hover); }   /* translucent — see DESIGN_GUIDELINES rule 8 */
.clip-row.picked, .clip-row.playing { border-color: var(--tv-coral, #fe7f63); background: var(--tv-coral-tint, rgba(254,127,99,0.14)); }
.clip-pick { display: inline-flex; align-items: center; justify-content: center; width: 1.15rem; height: 1.15rem;
  flex: 0 0 auto; border-radius: 50%; border: 1px solid var(--pico-muted-border-color);
  font-size: 0.66rem; font-weight: 700; color: var(--pico-muted-color); }
.clip-row.picked .clip-pick { background: var(--tv-coral, #fe7f63); color: var(--tv-on-coral, #242038); border-color: var(--tv-coral, #fe7f63); }
.clip-ch { font-weight: 600; white-space: nowrap; }
.clip-dur { color: var(--pico-muted-color); font-variant-numeric: tabular-nums; white-space: nowrap; }
.clip-title { flex: 1 1 auto; min-width: 0; color: var(--pico-muted-color);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clip-novideo { color: #b45309; flex: 0 0 auto; }

.thread-single.yt-wrap { position: relative; width: 100%; max-width: 640px; aspect-ratio: 16 / 9; margin-bottom: 0.5rem; }
.thread-single iframe, .thread-single > div { position: absolute; inset: 0; width: 100%; height: 100%; }

.clip-compare { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 0.6rem; }
.clip-compare .cmp-slot { flex: 1 1 300px; min-width: 240px; }
.clip-compare .cmp-cap { font-size: 0.72rem; font-weight: 600; margin-bottom: 0.2rem; }
.clip-compare .yt-wrap { position: relative; width: 100%; aspect-ratio: 16 / 9; }
.clip-compare .yt-wrap iframe, .clip-compare .yt-wrap > div { position: absolute; inset: 0; width: 100%; height: 100%; }
.clip-compare .cmp-empty { font-size: 0.75rem; color: var(--pico-muted-color); font-style: italic;
  border: 1px dashed var(--pico-muted-border-color); border-radius: 6px; padding: 0.75rem; text-align: center; }
