/* generated from video-lens 802698d3c3bee0dd319d17894e8199d8b8a46c7e (viewer/) by tools/build-viewer.ts; do not edit, run npm run assets */
/* video-lens design tokens: the one source of color and font for every page (038 §5 D1).
   tools/build_viewer.py inlines this file into the local report (with viewer.css), the gallery
   (skills/video-lens-gallery/index.html) and the Discover page (skills/video-lens-recs/template.html),
   and the share build emits it for the site pages of the share service (video-lens-core).
   No other stylesheet defines a color token; a test fails when one does.
   Dark follows the OS unless the reader chose light ([data-theme] on <html>); script-free pages
   have no data-theme and simply follow the OS. */

:root {
  --paper: #f9f9f7;      /* page background */
  --pane: #f0f0ee;       /* side panes, bars, code, placeholders */
  --card: #fff;          /* cards on the paper */
  --text: #1a1a1a;
  --strong: #111;
  --muted: #555;
  --label: #696966;      /* small uppercase labels */
  --line: #e0e0dc;       /* rules on the paper */
  --pane-line: #d6d6d2;  /* rules and button borders on a pane */
  --accent: #c0392b;
  --on-accent: #fff;
  --accent-soft: rgba(192, 57, 43, 0.07);
  --video: #101010;
  --on-video: #f0ede8;
  --term: #1c1916;       /* terminal blocks (landing page) */
  --term-text: #f0ede8;
  --term-muted: #9a948f;
  --term-accent: #e05a4a;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow: 0 1px 2px rgba(20, 15, 10, 0.06), 0 12px 40px -12px rgba(20, 15, 10, 0.22);
  --backdrop: rgba(0, 0, 0, 0.4);
  --sans: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --serif: Georgia, 'Times New Roman', serif;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  color-scheme: light;
}

/* Dark: the OS setting, unless the reader chose light. The same values again for a chosen dark. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #1c1916;
    --pane: #14110f;
    --card: #211e1b;
    --text: #d0cdc8;
    --strong: #f0ede8;
    --muted: #9a948f;
    --label: #8f8983;
    --line: #2c2925;
    --pane-line: #2a2520;
    --accent: #e05a4a;
    --on-accent: #14110f;
    --accent-soft: rgba(224, 90, 74, 0.1);
    --video: #000;
    --term: #110e0c;
    --shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.3);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 16px 48px -12px rgba(0, 0, 0, 0.7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #1c1916;
  --pane: #14110f;
  --card: #211e1b;
  --text: #d0cdc8;
  --strong: #f0ede8;
  --muted: #9a948f;
  --label: #8f8983;
  --line: #2c2925;
  --pane-line: #2a2520;
  --accent: #e05a4a;
  --on-accent: #14110f;
  --accent-soft: rgba(224, 90, 74, 0.1);
  --video: #000;
  --term: #110e0c;
  --shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.3);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 16px 48px -12px rgba(0, 0, 0, 0.7);
  color-scheme: dark;
}

/* video-lens components: the pieces every local page shares (038 §5 D5, D7). tools/build_viewer.py
   puts this file after tokens.css, before viewer.css in the report and the share page, and into the
   gallery and Discover pages with the tokens. Page-specific layout stays in each page. */

/* Small buttons: one look everywhere (.tool, .tool.icon, .tool.quiet, pressed). */
.tool {
  font: 500 0.78rem/1 var(--sans);
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--pane-line);
  border-radius: 6px;
  min-height: 1.9rem;
  padding: 0 0.6rem;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}
.tool:hover { color: var(--strong); border-color: var(--muted); }
.tool.icon { width: 1.9rem; padding: 0; display: inline-grid; place-items: center; font-size: 0.9rem; }
.tool.quiet { min-height: 1.6rem; font-size: 0.72rem; }
.tool[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.tool.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
.tool.primary:hover { filter: brightness(1.08); color: var(--on-accent); }
a.tool { display: inline-flex; align-items: center; text-decoration: none; }

/* Chips: tags, filters, facts. One look; .active (a chosen filter) and .accent (a fact that stands
   out) take the accent. A chip that is a button or a link reacts to the pointer. */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  font: 500 0.72rem/1.5 var(--sans);
  padding: 0.05rem 0.55rem;
  border-radius: 1rem;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--muted);
  white-space: nowrap;
  text-decoration: none;
}
button.chip, a.chip { cursor: pointer; }
button.chip:hover, a.chip:hover { color: var(--strong); border-color: var(--muted); }
.chip.active, .chip.accent { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 45%, transparent); color: var(--accent); }

/* Cards: a raised block on the paper (gallery cards, Discover picks). */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-sm); }


/* ── Help: a <dialog>, ? opens it, Esc closes ── */
dialog {
  margin: auto; /* centred, also on a page that resets margins */
  width: min(26rem, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  padding: 1.5rem 1.6rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  color: var(--text);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  font: 400 0.88rem/1.6 var(--sans);
}
dialog:focus { outline: none; }
dialog::backdrop { background: var(--backdrop); }
dialog h2 { margin: 1.3rem 0 0.6rem; }
dialog h2:first-of-type { margin-top: 0; }
dialog p { margin: 0; }
#help-close { position: absolute; top: 0.8rem; right: 0.8rem; border: 0; font-size: 1.2rem; }
.keys { display: grid; grid-template-columns: auto 1fr; gap: 0.4rem 1rem; margin: 0; align-items: center; }
.keys dt { white-space: nowrap; }
.keys dd { margin: 0; color: var(--muted); }
kbd { font: 500 0.76rem/1 var(--mono); background: var(--pane); border: 1px solid var(--pane-line); border-radius: 4px; padding: 0.2rem 0.4rem; color: var(--strong); }
dialog h2 { font: 600 0.72rem/1.3 var(--sans); letter-spacing: 0.1em; text-transform: uppercase; color: var(--label); }
dialog a { color: var(--accent); }

/* video-lens viewer: one stylesheet for the local report and the share page (035 §4, 036).
   It styles the fragment markup the renderers produce today (li > a.ts, .outline-title,
   .outline-detail; li > strong, p), so reports written before 036 still render.
   Sans (DM Sans) is the interface and the structure: title, headlines, labels, times, controls.
   Serif (Georgia) is the prose the report says: summary, takeaway, key-point text. */

:root {
  /* Colors and fonts come from tokens.css (inlined before this file, or linked on the share page). */
  --pad: clamp(1.25rem, 8%, 3.5rem); /* of the pane, not of the window: the pane's width is the reader's choice */
  --stage-h: 0px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.7;
  overflow-wrap: break-word;
}
a { color: var(--accent); }
strong { color: var(--strong); }
code {
  font-family: var(--mono);
  font-size: 0.86em;
  background: var(--pane);
  padding: 0.05em 0.3em;
  border-radius: 3px;
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

h2 {
  font: 600 0.72rem/1.3 var(--sans);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--label);
  margin: 0;
}
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }

.ts { color: var(--accent); font: 500 0.8rem/1.4 var(--sans); font-variant-numeric: tabular-nums; text-decoration: none; }

/* ── Layout: the video pane stays, the page scrolls beside it ── */
.layout {
  display: grid;
  grid-template-columns: var(--split, 44%) 9px minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  min-height: 100vh;
}
.layout.snapping { transition: grid-template-columns 0.2s ease; }
.watch {
  grid-column: 1;
  grid-row: 1 / 3;
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--pane);
}
.divider {
  grid-column: 2;
  grid-row: 1 / 3;
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  cursor: col-resize;
  touch-action: none;
  background: var(--pane);
  border-right: 1px solid var(--pane-line);
  display: grid;
  place-items: center;
}
.divider::after { content: ''; width: 3px; height: 2.2rem; border-radius: 2px; background: var(--pane-line); }
.divider:hover::after, .divider:focus-visible::after, .dragging .divider::after { background: var(--accent); height: 3.4rem; }
.dragging { cursor: col-resize; user-select: none; -webkit-user-select: none; }
.dragging iframe { pointer-events: none; }
.masthead { grid-column: 3; grid-row: 1; }
.doc { grid-column: 3; grid-row: 2; }

/* ── Stage: player, section timeline, now-playing bar ── */
.stage { flex-shrink: 0; background: var(--pane); }
.player {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 200px;
  max-height: calc(100vh - 15rem);
  max-height: calc(100dvh - 15rem);
  background: var(--video);
  color: var(--on-video);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  padding: 1rem;
  text-align: center;
}
.player.loaded { display: block; padding: 0; }
.player iframe { display: block; width: 100%; height: 100%; border: 0; }
.load {
  font: 600 1rem/1 var(--sans);
  background: #c0392b;
  color: #fff;
  border: 0;
  border-radius: 6px;
  padding: 0.8rem 1.2rem;
  cursor: pointer;
}
.load:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.load.nudge { animation: nudge 0.5s ease; }
@keyframes nudge { 30% { transform: scale(1.07); } 60% { transform: scale(0.98); } }
.consent, .player-note { font: 400 0.8rem/1.5 var(--sans); margin: 0; max-width: 30rem; }
.player a { color: inherit; }
.player-note code { background: rgba(255, 255, 255, 0.12); user-select: all; -webkit-user-select: all; }
.watch-link { font: 600 1rem var(--sans); }

.timeline { display: flex; gap: 2px; cursor: pointer; background: var(--pane); }
.seg { position: relative; flex: 1 1 0; min-width: 3px; height: 15px; }
.seg::before, .seg > i { content: ''; position: absolute; left: 0; top: 4px; height: 5px; }
.seg::before { right: 0; background: var(--pane-line); }
.seg > i { width: 0; background: var(--accent); }
.seg:hover::before { background: var(--label); }
.seg.done > i { width: 100%; }

.nowbar { display: flex; align-items: center; gap: 0.4rem; padding: 0.15rem 0.7rem 0.6rem; font: 500 0.8rem/1.3 var(--sans); }
.nowbar-label { flex: 1; min-width: 0; margin: 0 0.3rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--strong); }
#now-idx { color: var(--label); font-variant-numeric: tabular-nums; margin-right: 0.6em; }
.clock { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; font-size: 0.76rem; }
#speed { min-width: 3.1rem; font-variant-numeric: tabular-nums; }

/* ── Outline ── */
.outline { position: relative; flex: 1; min-height: 0; overflow-y: auto; border-top: 1px solid var(--pane-line); padding-bottom: 1rem; }
.outline .sec-head { position: sticky; top: 0; z-index: 1; background: var(--pane); padding: 0.65rem 0.7rem 0.5rem 1.1rem; }
.topics { list-style: none; margin: 0; padding: 0; }
.topics > li {
  display: grid;
  grid-template-columns: 3.6rem minmax(0, 1fr) auto;
  align-items: baseline;
  padding: 0.4rem 0.8rem 0.4rem 1.1rem;
  cursor: pointer;
  font-size: 0; /* hides the bare " — " between time and title in reports written before 036 */
}
.topics > li:hover { background: var(--accent-soft); }
.topics > li > a.ts { grid-area: 1 / 1; }
.outline-title { grid-area: 1 / 2; font: 400 0.92rem/1.4 var(--sans); color: var(--text); }
.outline-detail { grid-area: 2 / 2 / auto / span 2; margin: 0.2rem 0 0.15rem; font: 400 0.84rem/1.5 var(--sans); color: var(--muted); }
.topics > li.active { background: var(--accent-soft); box-shadow: inset 3px 0 0 0 var(--accent); }
.topics > li.active .outline-title { font-weight: 600; color: var(--strong); }
/* With script: descriptions fold away, except the playing section, unless "Details" is on. */
.js:not([data-outline="full"]) .topics > li:not(.active) .outline-detail { display: none; }
.kp-refs { grid-area: 1 / 3; display: flex; gap: 0.2rem; margin-left: 0.5rem; }
.kp-ref, .kp-list > li::before {
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font: 600 0.66rem/1 var(--sans);
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  text-decoration: none;
}
.kp-ref:hover { background: var(--accent); color: var(--on-accent); }

/* ── Rail: where you came from, and the tools ── */
.rail { display: flex; align-items: center; gap: 0.35rem; padding: 0.45rem 0.7rem; border-top: 1px solid var(--pane-line); background: var(--pane); flex-shrink: 0; }
.brand { display: inline-flex; align-items: center; gap: 0.45rem; font: 600 0.8rem/1 var(--sans); color: var(--muted); text-decoration: none; white-space: nowrap; }
.brand:hover { color: var(--strong); }
.rail-gap { flex: 1; }
html:not(.js) .rail .tool { display: none; }

/* ── The document ── */
.masthead, .doc { padding-inline: var(--pad); }
.masthead > *, .doc > * { max-width: 100%; }
.masthead { padding-top: 2.4rem; container-type: inline-size; }
.meta-line, .links { font: 500 0.8rem/1.5 var(--sans); color: var(--muted); margin: 0; }
h1 {
  font: 600 1.6rem/1.18 var(--sans);
  font-size: clamp(1.3rem, 0.85rem + 3.4cqi, 2.05rem); /* follows the pane as the divider moves */
  letter-spacing: -0.015em;
  color: var(--strong);
  margin: 0.45rem 0 0.7rem;
  text-wrap: balance;
}
.links a { text-decoration: none; }
.links a:hover, .colophon a:hover, .ts:hover { text-decoration: underline; }

.doc section { margin-top: 2.3rem; }
.doc h2 { margin-bottom: 0.7rem; }
.doc p { margin: 0 0 0.9rem; }
.doc p:last-child { margin-bottom: 0; }
/* Each of the three parts has its own shape, so the labels can stay small. */
#summary p { font-size: 1.16rem; line-height: 1.62; color: var(--strong); }
#takeaway { border-left: 3px solid var(--accent); background: var(--accent-soft); border-radius: 0 6px 6px 0; padding: 1rem 1.25rem 1.15rem; }
#takeaway h2 { color: var(--accent); }
#key-points .sec-head { margin-bottom: 0.2rem; }
#key-points h2 { margin: 0; }

.kp-list { list-style: none; margin: 0; padding: 0; counter-reset: kp; }
.kp-list > li { counter-increment: kp; position: relative; padding: 1.15rem 0 1.15rem 2.5rem; border-top: 1px solid var(--line); scroll-margin-top: calc(var(--stage-h) + 0.5rem); }
.kp-list > li:first-child { border-top: 0; }
.kp-list > li::before { content: counter(kp); position: absolute; left: 0; top: 1.15rem; width: 1.6rem; height: 1.6rem; font-size: 0.76rem; }
.kp-list > li.now::before { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
/* Headline, then the "why" as the first paragraph, then the detail as the second. */
.kp-list > li > strong:first-child { font: 600 1.05rem/1.4 var(--sans); color: var(--strong); }
.kp-list > li > a.ts { display: inline-block; margin-left: 0.35rem; padding: 0 0.45rem; border-radius: 1rem; background: var(--accent-soft); font-size: 0.74rem; line-height: 1.6; vertical-align: 0.08em; white-space: nowrap; }
.kp-list > li > p { margin: 0.35rem 0 0; }
.kp-list > li > p + p { margin-top: 0.65rem; font-size: 0.97rem; color: var(--muted); }
.kp-toggle { display: none; margin-top: 0.45rem; }
.kp-toggle[aria-expanded="true"] { color: var(--strong); }
[data-skim] .kp-list > li { padding-block: 0.85rem; }
[data-skim] .kp-list > li::before { top: 0.85rem; }
[data-skim] .kp-list > li:not(.open) > p + p { display: none; }
[data-skim] .kp-toggle { display: inline-block; }
.kp-list > li.flash { animation: flash 1.4s ease; }
@keyframes flash { 0%, 40% { background: var(--accent-soft); } }

.description-details { margin-top: 2.3rem; padding-top: 1rem; border-top: 1px solid var(--line); font: 400 0.86rem/1.6 var(--sans); color: var(--muted); }
.description-details summary { cursor: pointer; font-weight: 500; }
.video-description { margin-top: 0.7rem; }

.colophon { margin-top: 3rem; padding-top: 1rem; padding-bottom: 3rem; border-top: 1px solid var(--line); font: 400 0.78rem/1.6 var(--sans); color: var(--muted); }
.doc .colophon p { margin: 0 0 0.45rem; }

/* ── Tabs: only where the panes stack ── */
.tabs { display: none; }
.tabs button {
  flex: 1;
  font: 600 0.8rem/1 var(--sans);
  letter-spacing: 0.04em;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-bottom: 3px solid transparent;
  padding: 0.75rem 0 0.6rem;
  cursor: pointer;
}
.tabs button[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }

/* ── Narrow screens: the two panes become two tabs under a player that stays in view ── */
@media (max-width: 800px) {
  .layout { display: flex; flex-direction: column; }
  .watch { display: contents; }
  .divider { display: none; }
  .rail { order: 0; border-top: 0; border-bottom: 1px solid var(--pane-line); }
  .masthead { order: 1; padding-top: 1.2rem; padding-bottom: 1.1rem; }
  .stage { order: 2; z-index: 5; border-bottom: 1px solid var(--pane-line); }
  .outline { order: 3; flex: none; overflow: visible; border-top: 0; }
  .outline .sec-head { position: static; background: transparent; padding-inline: var(--pad); }
  .topics > li { padding-inline: var(--pad); }
  .doc { order: 4; }
  .player { max-height: none; }
  .tabs:not([hidden]) { display: flex; }
  .nowbar { padding-bottom: 0.3rem; }
  .clock { display: none; }
  .doc section:first-child { margin-top: 1.4rem; }
  .js[data-tab="read"] .outline, .js[data-tab="outline"] #read { display: none; }
  .js[data-tab="outline"] .colophon { margin-top: 1rem; }
}
@media (max-width: 360px) {
  .brand span { display: none; }
}
/* The player stays in view only when the screen is tall enough to read under it. */
@media (max-width: 800px) and (min-height: 560px) {
  .stage { position: sticky; top: 0; }
  .player { max-height: 40vh; max-height: 40dvh; }
}

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

@media print {
  .layout { display: block; }
  .watch { position: static; height: auto; display: block; background: none; }
  .stage, .rail, .divider, .tool, .kp-refs { display: none !important; }
  .outline { overflow: visible; border: 0; }
  .outline-detail, .kp-list > li > p { display: block !important; }
}
