/* ============================================================
 * kweb companion — visual system
 *
 * One scheme for every page, the one the watch page took from Burke's own
 * K-Web blueprint: silver on near-black, hairlines instead of boxes, serif for
 * what is said and mono for what is measured. Colour is never decoration: the
 * four category hues carry meaning (person · place · event · thing), a pale
 * gold marks the trail and what you can act on, a warm white marks what is lit.
 * The pictures — portraits, episode stills, the globe — bring the rest.
 * (The deck's own --dk-* tokens in deck.css are the same values.)
 * ============================================================ */
:root {
  /* near-black */
  --bg:       #050507;
  --bg-2:     #0b0b10;
  --bg-3:     #14141b;
  --border:   #22222c;
  --border-2: #34343f;

  /* text */
  --fg:       #e9e9ee;          /* silver */
  --fg-dim:   #c9c9d2;
  --dim:      #8b8b98;

  /* accents (names kept from the old warm scheme; values are the blueprint's) */
  --gold:     #e8cf96;          /* the trail, and what you can act on */
  --gold-dim: #9a8a62;
  --teal:     #8fd3c3;          /* place */
  --terra:    #e6c07a;          /* event / warm signal */
  --rose:     #e6a3a3;          /* person */
  --green:    #a9d19a;          /* thing */
  --lit:      #fff3cf;          /* what is lit right now */

  /* type */
  --font-serif: "Source Serif Pro", "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-mono:  ui-monospace, "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;
  --font-sans:  -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  background: var(--bg); color: var(--fg);
  font-family: var(--font-mono);
  font-size: 15px; line-height: 1.55;
  min-height: 100dvh; overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* ─── state visibility ─── */
.state-intro  .stage,
.state-intro  .deck                { display: none; }
.state-active .intro               { display: none; }
.state-active .deck[hidden]        { display: none; }
.state-active .stage[hidden]       { display: none; }

/* ============================================================
 * INTRO (landing page)
 * ============================================================ */
.intro {
  min-height: 100dvh; position: relative;
  padding: 0 24px;
  background:
    radial-gradient(ellipse 1000px 500px at 50% -10%, rgba(232,207,150,0.07), transparent 70%),
    radial-gradient(ellipse 800px 500px at 90% 110%, rgba(135,184,164,0.05), transparent 70%),
    var(--bg);
}

.intro-utility {
  position: relative;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 22px 0; max-width: 880px; margin: 0 auto;
}
.brand-mark {
  font-family: var(--font-mono);
  font-size: 13px; font-weight: 500; letter-spacing: 1.5px;
  color: var(--gold); opacity: 0.85;
}
.brand-mark span { color: var(--fg); }

.listen-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 16px; font-family: var(--font-mono); font-size: 12px;
  font-weight: 500; letter-spacing: 0.5px;
  background: transparent; color: var(--gold);
  border: 1px solid rgba(232,207,150,0.4);
  border-radius: 999px; cursor: pointer;
  transition: all 0.15s;
}
.listen-pill:hover { background: var(--gold); color: var(--bg); border-color: var(--gold); }
.listen-pill .ico {
  width: 7px; height: 7px; border-radius: 50%; background: var(--gold);
  animation: btnPulse 1.4s infinite;
}
.listen-pill:hover .ico { background: var(--bg); }
.listen-pill.on { background: var(--gold); color: var(--bg); border-color: var(--gold); }
.listen-pill.on .ico { background: var(--bg); }
@keyframes btnPulse { 50% { opacity: 0.45; transform: scale(0.92); } }

.intro-inner { max-width: 880px; margin: 0 auto; padding: 24px 0 80px; }

/* ─── Hero copy ─── */
.hero-headline {
  font-family: var(--font-serif);
  font-size: clamp(34px, 5.5vw, 56px);
  font-weight: 600; line-height: 1.05; letter-spacing: -0.02em;
  color: var(--fg); margin-bottom: 22px; max-width: 22ch;
}
.hero-headline em {
  font-style: italic; font-weight: 400; color: var(--gold);
}
.hero-headline br { display: block; content: ''; }

.hero-sub {
  font-family: var(--font-serif);
  font-size: clamp(15px, 1.7vw, 18px); line-height: 1.55;
  color: var(--fg-dim); max-width: 56ch; margin-bottom: 56px;
  text-wrap: pretty;
}
.hero-sub a { color: var(--gold); text-decoration: none; border-bottom: 1px dotted var(--gold); }
.hero-sub em {
  color: var(--gold); font-style: normal; font-weight: 500;
}

/* ─── Section label ─── */
.section-label {
  font-family: var(--font-mono);
  font-size: 10px; letter-spacing: 2.5px; text-transform: uppercase;
  color: var(--gold); opacity: 0.75;
  margin-bottom: 16px;
}

/* ─── The hero moment (.hm): Burke's words beside the web he is drawing ─── */
.hm { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-areas: "said" "who" "clip" "what" "go"; margin: 10px 0 64px; }
@media (min-width: 900px) {
  .hm { grid-template-columns: minmax(0, 1fr) minmax(0, 460px); grid-template-areas: "said clip" "who clip" "what clip" "go clip"; grid-template-rows: auto auto auto 1fr; column-gap: 56px; align-items: start; }
}
.hm-said { grid-area: said; margin: 0; min-height: 3.4em; display: flex; align-items: flex-end; }
.hm-line { font-family: var(--font-serif); font-size: clamp(22px, 3.1vw, 32px); line-height: 1.28; color: var(--fg); margin: 0; }
.hm-line::before { content: '“'; color: var(--gold); margin-right: .06em; }
.hm-line::after { content: '”'; color: var(--gold); margin-left: .04em; }
.hm-line mark { background: none; color: inherit; border-bottom: 1.5px solid rgba(232,207,150,.55); padding-bottom: 1px; }
.hm-line.in { animation: moment-in .5s ease-out; }
@keyframes moment-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.hm-who { grid-area: who; margin: 12px 0 0; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .08em; color: var(--dim); }
.hm-who em { font-family: var(--font-serif); font-size: 12.5px; letter-spacing: 0; color: var(--fg-dim); }
.hm-clip { grid-area: clip; display: block; position: relative; aspect-ratio: 800 / 804; margin: 22px 0 0; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--bg); }
.hm-clip video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
@media (min-width: 900px) { .hm-clip { margin: 0; } }
.hm-what { grid-area: what; margin: 22px 0 0; font-family: var(--font-serif); font-size: 16px; line-height: 1.6; color: var(--fg-dim); max-width: 46ch; }
.hm-go { grid-area: go; margin-top: 26px; }
.watch-card { display: flex; align-items: center; gap: 14px; padding: 10px 16px 10px 10px; border: 1px solid rgba(232,207,150,.45); border-radius: 12px; background: var(--bg-2); color: inherit; text-decoration: none; transition: border-color .15s, background .15s, transform .15s; max-width: 460px; }
.watch-card:hover, .watch-card:focus-visible { border-color: var(--gold); background: var(--bg-3); transform: translateY(-1px); }
.watch-thumb { position: relative; flex: 0 0 112px; width: 112px; aspect-ratio: 16 / 10; border-radius: 7px; overflow: hidden; background: var(--bg-3); }
.watch-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0; transition: opacity .4s; }
.watch-thumb img.loaded { opacity: .95; }
.watch-play { position: absolute; left: 50%; top: 50%; width: 34px; height: 34px; margin: -17px 0 0 -17px; border-radius: 50%; display: grid; place-items: center; padding-left: 3px; background: var(--gold); color: var(--bg); font-size: 13px; }
.watch-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.watch-title { font-family: var(--font-serif); font-size: 18px; line-height: 1.2; color: var(--fg); }
.watch-title em { color: var(--lit); }
.watch-meta { font-family: var(--font-mono); font-size: 10.5px; color: var(--dim); letter-spacing: .02em; }
.watch-soon { margin: 12px 0 0; font-family: var(--font-mono); font-size: 10.5px; color: var(--dim); letter-spacing: .02em; }

/* ─── Accordion ─── */
.all-episodes { margin-top: 8px; margin-bottom: 16px; }
.all-episodes > summary {
  cursor: pointer; user-select: none; list-style: none;
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--dim); font-size: 12px; letter-spacing: 0.6px;
  padding: 10px 14px; margin-left: -14px;
  border-radius: 8px;
  transition: color 0.2s, background 0.2s;
}
.all-episodes > summary:hover { color: var(--fg); background: rgba(255,255,255,0.025); }
.all-episodes > summary::-webkit-details-marker { display: none; }
.all-episodes .caret { color: var(--gold); font-size: 10px; transition: transform 0.2s; }
.all-episodes[open] .caret { transform: rotate(90deg); }

.picker-inline { text-align: left; margin-top: 14px; }
.series-row { margin-bottom: 36px; }
.series-row:last-child { margin-bottom: 0; }
.series-row-title {
  font-family: var(--font-serif);
  font-size: 15px; font-weight: 600; letter-spacing: -0.005em;
  margin-bottom: 12px; color: var(--fg-dim);
}
.series-row-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px;
}
.ep-card {
  background: transparent; border: none; padding: 0;
  font-family: inherit; color: inherit; cursor: pointer; text-align: left;
  display: flex; flex-direction: column;
  transition: transform 0.15s;
}
.ep-card:hover { transform: translateY(-2px); }
.ep-card:hover .ep-thumb { border-color: var(--gold); box-shadow: 0 10px 30px rgba(232,207,150,0.15); }
.ep-card:hover .ep-title { color: var(--gold); }
.ep-thumb {
  position: relative; aspect-ratio: 16/9; overflow: hidden;
  border-radius: 8px; border: 1px solid var(--border);
  background: var(--bg-2);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.ep-thumb img {
  width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transition: opacity 0.5s;
  filter: sepia(0.08) saturate(0.9);
}
.ep-thumb img.loaded { opacity: 1; }
.ep-num {
  position: absolute; left: 6px; top: 6px;
  font-family: var(--font-mono);
  font-size: 10px; font-weight: 600; letter-spacing: 0.5px;
  color: var(--fg); background: rgba(5,5,7,0.8); backdrop-filter: blur(4px);
  padding: 2px 7px; border-radius: 999px;
}
.ep-duration {
  position: absolute; right: 6px; bottom: 6px;
  font-family: var(--font-mono);
  font-size: 10px; color: var(--fg);
  background: rgba(5,5,7,0.8); backdrop-filter: blur(4px);
  padding: 2px 7px; border-radius: 4px;
}
.ep-title {
  font-family: var(--font-serif);
  font-size: 13.5px; font-weight: 500; line-height: 1.3;
  padding: 8px 4px 0; color: var(--fg); transition: color 0.15s;
}
/* one episode at a time: the rest wait, visibly */
.ep-card.soon { cursor: default; }
.ep-card.soon:hover { transform: none; }
.ep-card.soon:hover .ep-thumb { border-color: var(--border); box-shadow: none; }
.ep-card.soon:hover .ep-title { color: var(--fg-dim); }
.ep-card.soon .ep-thumb img.loaded { opacity: 0.32; filter: grayscale(0.75) sepia(0.15); }
.ep-card.soon .ep-title { color: var(--fg-dim); }
.ep-card.soon .fp-canvas { opacity: 0.45; }
.ep-card.soon.soon-open { cursor: pointer; }
.ep-card.soon.soon-open:hover .ep-thumb { border-color: var(--gold); }
.soon-badge {
  position: absolute; right: 6px; bottom: 6px;
  font-family: var(--font-mono); font-size: 9px; font-weight: 600; letter-spacing: 0.9px; text-transform: uppercase;
  color: var(--fg-dim); background: rgba(5,5,7,0.82); backdrop-filter: blur(4px);
  border: 1px solid var(--border); padding: 2px 7px; border-radius: 999px;
}
.ep-card.ready .ep-thumb { border-color: rgba(232,207,150,0.55); }
.ep-card.ready .ep-duration { color: var(--bg); background: var(--gold); font-weight: 600; }
.picker-note { font-family: var(--font-serif); font-size: 13.5px; font-style: italic; color: var(--fg-dim); line-height: 1.55; margin: 4px 0 18px; max-width: 62ch; }
.picker-note b { color: var(--fg); font-style: normal; font-weight: 500; }
.ep-card.external .ep-thumb {
  background: linear-gradient(135deg, var(--bg-2), #16131c);
  border-color: rgba(230,192,122,0.35);
}
.ep-card.external .ep-thumb img.loaded { opacity: 0.4; }
.ep-card.external .ext-badge {
  position: absolute; left: 6px; bottom: 6px;
  font-family: var(--font-mono);
  font-size: 9px; font-weight: 600; letter-spacing: 0.5px;
  color: var(--bg); background: var(--terra);
  padding: 3px 8px; border-radius: 999px;
}
.series-row-note {
  font-family: var(--font-serif);
  font-size: 13px; color: var(--fg-dim); line-height: 1.55;
  margin-bottom: 16px; max-width: 60ch;
}
.series-row-note a { color: var(--gold); text-decoration: none; border-bottom: 1px dotted var(--gold); }

/* ─── rule and maker's note ─── */
.rule {
  border: none; height: 1px;
  background: linear-gradient(to right, transparent, var(--border), transparent);
  margin: 56px 0 28px;
}

.makers-note {
  max-width: 56ch;
  padding: 4px 0;
}
.makers-note h4 {
  font-family: var(--font-serif);
  font-size: 17px; font-weight: 600; color: var(--gold);
  margin-bottom: 12px; letter-spacing: -0.005em;
}
.makers-note p {
  font-family: var(--font-serif);
  font-size: 14.5px; line-height: 1.6; color: var(--fg-dim);
  margin-bottom: 12px; text-wrap: pretty;
}
.makers-note em { color: var(--fg); font-style: italic; }
.makers-note-links a {
  color: var(--gold); text-decoration: none; font-weight: 500;
  border-bottom: 1px dotted var(--gold);
}
.makers-note-links a:hover { color: var(--terra); border-color: var(--terra); }

.hint-line {
  color: var(--dim); font-size: 10px; opacity: 0.4;
  letter-spacing: 0.5px; margin-top: 28px;
  font-family: var(--font-mono);
}

/* ============================================================
 * LISTEN-PILL POPOVER
 * ============================================================ */
.listen-tooltip {
  position: absolute; top: calc(100% + 8px); right: 0;
  max-width: 360px; padding: 18px 22px;
  background: var(--bg-2); border: 1px solid var(--gold); border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6), 0 0 30px rgba(232,207,150,0.12);
  z-index: 100; text-align: left;
  animation: tooltipIn 0.2s ease-out;
}
@keyframes tooltipIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.listen-tooltip strong {
  font-family: var(--font-serif); color: var(--gold); font-size: 15px;
  display: block; margin-bottom: 8px; font-weight: 600;
}
.listen-tooltip p {
  font-family: var(--font-serif); color: var(--fg-dim);
  font-size: 13.5px; line-height: 1.55; margin-bottom: 14px;
}
.listen-tooltip-btn {
  background: var(--gold); color: var(--bg); border: none;
  padding: 10px 18px; border-radius: 999px; font-family: var(--font-mono);
  font-size: 12px; font-weight: 600; cursor: pointer; letter-spacing: 0.3px;
}
.listen-tooltip-btn:hover { background: var(--terra); }
.listen-tooltip-close {
  position: absolute; top: 8px; right: 10px;
  background: transparent; border: none; color: var(--dim);
  cursor: pointer; font-size: 22px; line-height: 1; padding: 4px 8px;
}
.listen-tooltip-close:hover { color: var(--fg); }
@media (max-width: 720px) {
  .listen-tooltip { left: 14px; right: 14px; max-width: none; }
}

/* ============================================================
 * STAGE (active watch/listen mode)
 * ============================================================ */

/* ---------- entity strip: every node as a dot on the episode's time axis ---------- */
/* being said right now */
/* every later mention of a node: a hairline in its colour */
@media (max-width: 720px) {
  /* bigger touch targets without moving the visual dot */
}

/* ---------- live panel (globe · card · timeline · knowledge web) ---------- */
.lp-label {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--dim); margin: 22px 0 8px;
}
.lp-label { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.lp-hint {
  /* it sits at the end of the label's line: a float here would squeeze whatever comes next (it once
     crushed the node cloud into one-letter columns on a phone) */
  float: none; margin-left: auto; font-family: var(--font-mono); font-size: 10px;
  letter-spacing: .04em; text-transform: none; color: var(--dim); opacity: .85; text-align: right;
}
/* a connection the narration has not made yet */
/* …and the moment it does */
/* a node being said right now */
@keyframes node-said { 0% { stroke-opacity: 1; } 50% { stroke-opacity: .45; } 100% { stroke-opacity: 1; } }

/* ---------- also-in on the live card ---------- */
.alsoin-label { color: var(--dim); letter-spacing: .06em; text-transform: uppercase; font-size: 10px; margin-right: 4px; }
.alsoin-link { color: var(--teal); text-decoration: none; border-bottom: 1px dotted var(--teal); }
.alsoin-link:hover { color: var(--fg); border-color: var(--fg); }

/* ---------- /nodes explorer ---------- */
body.state-nodes .intro { display: none !important; }
/* deep links decide the shell before first paint — no landing flash */
html.route-app .intro { display: none !important; }
.nodes-page { max-width: 1100px; margin: 0 auto; padding: 20px 18px 120px; }
.nodes-search {
  width: 100%; margin: 6px 0 20px; padding: 11px 14px;
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 8px;
  color: var(--fg); font-family: var(--font-mono); font-size: 14px;
}
.nodes-search:focus { outline: none; border-color: var(--gold-dim); }
.nodes-link { margin-left: auto; font-family: var(--font-mono); font-size: 11px; color: var(--teal); text-decoration: none; }
.nodes-link:hover { color: var(--fg); }
/* the web on /nodes: the same one the watch page draws */
.nodes-web { position: relative; margin: 10px 0 18px; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--bg); }
.nodes-web .kweb-box { height: min(62svh, 620px); }
@media (max-width: 720px) { .nodes-web .kweb-box { height: 58svh; min-height: 340px; } }
.nodes-web-bar { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-top: 1px solid var(--border); background: var(--bg-2); }
.nodes-web-hint { flex: 1 1 auto; min-width: 0; font-family: var(--font-mono); font-size: 10px; letter-spacing: .04em; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nodes-btn { flex: none; background: transparent; border: 1px solid var(--border-2); border-radius: 6px; padding: 3px 9px; color: var(--fg-dim); font-family: var(--font-mono); font-size: 10.5px; cursor: pointer; }
.nodes-btn:hover { color: var(--lit); border-color: var(--gold-dim); }
.nodes-btn[hidden] { display: none; }
.nodes-web .inst-dim { position: static; flex: none; height: 22px; opacity: .75; }

.node-cloud { display: flex; flex-wrap: wrap; gap: 5px 10px; align-items: baseline; margin-top: 8px; }
.cloud-node {
  /* never shrink: a flex row that squeezes its items turns every name into a one-letter column */
  flex: 0 0 auto; max-width: 100%;
  background: none; border: none; padding: 1px 0; cursor: pointer;
  font-family: var(--font-serif); line-height: 1.25; color: var(--fg-dim);
}
.cloud-node:hover { color: var(--lit); }
.cloud-node.cat-person { color: var(--rose); }
.cloud-node.cat-place  { color: var(--teal); }
.cloud-node.cat-event  { color: var(--terra); }
.cloud-node.cat-thing  { color: var(--green); }
.cloud-more { margin-top: 10px; background: none; border: 1px solid var(--border-2); border-radius: 6px; padding: 4px 10px; color: var(--dim); font-family: var(--font-mono); font-size: 10.5px; cursor: pointer; }
.cloud-more:hover { color: var(--fg); border-color: var(--gold-dim); }
.node-bio { margin: 8px 0 30px; padding: 18px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.bio-head { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
#bio-img { width: 120px; height: 120px; object-fit: cover; border-radius: 8px; flex: none; }
.bio-text { flex: 1 1 260px; min-width: 0; }
#bio-name { font-family: var(--font-serif); font-size: 26px; margin-bottom: 4px; }
.bio-meta { font-family: var(--font-mono); font-size: 11.5px; color: var(--dim); margin-bottom: 8px; }
#bio-extract { font-family: var(--font-serif); font-size: 15px; line-height: 1.6; color: var(--fg-dim); max-width: 64ch; }   /* what is said is set in serif, as in the deck */
#bio-link { font-family: var(--font-mono); font-size: 12px; color: var(--teal); }
.bio-fp { width: 300px; max-width: 100%; flex: none; }
.bio-appearances { display: flex; flex-direction: column; }
.bio-appearance {
  display: grid; grid-template-columns: 70px 1fr 52px; gap: 4px 12px;
  padding: 7px 0; border-bottom: 1px solid rgba(34,34,44,.9);
  text-decoration: none; color: var(--fg-dim); font-size: 13px;
}
.bio-appearance:hover { color: var(--fg); background: rgba(232,207,150,.05); }
.ba-ep { font-family: var(--font-mono); color: var(--gold); font-size: 12px; }
.ba-title { font-family: var(--font-serif); font-style: italic; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ba-t { font-family: var(--font-mono); color: var(--dim); font-size: 12px; text-align: right; }
.ba-gloss { grid-column: 1 / -1; font-family: var(--font-serif); font-size: 13.5px; color: var(--dim); line-height: 1.45; }
#bio-web { width: 100%; display: block; touch-action: none; cursor: grab; }
#bio-web:active { cursor: grabbing; }
@media (max-width: 720px) {
  .bio-appearance { grid-template-columns: 58px 1fr 48px; }
  .bio-fp { width: 100%; }
}

/* hover mini-card */

/* ---------- geospatial fingerprint (shared glyph with kweb-wikify) ---------- */
.fp-canvas { display: block; background: transparent; }
.fp-huge { width: min(680px, 100%); margin: 6px 0 4px; }
.fp-series { width: 260px; max-width: 100%; opacity: 0.9; }
.fp-ep { width: 100%; margin-top: 6px; opacity: 0.85; }
.fp-row { width: 150px; flex: none; opacity: 0.85; }
.series-row-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
}
.all-fp-block { margin: 18px 0 6px; }

/* whole-video play overlay — one quiet ring, no words */

.topbar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-bottom: 18px; min-height: 32px;
}
.ghost {
  background: transparent; color: var(--dim); border: 1px solid var(--border);
  padding: 6px 14px; border-radius: 6px; font-family: var(--font-mono); font-size: 12px;
  cursor: pointer; letter-spacing: 0.5px;
}
.ghost:hover { color: var(--gold); border-color: var(--gold); }

.now-playing {
  font-family: var(--font-serif);
  font-size: 14px; color: var(--fg-dim);
  flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.now-playing .show { color: var(--gold); font-weight: 500; }
.now-playing .title { color: var(--fg); font-weight: 600; font-style: italic; }
.now-playing .sep { opacity: 0.4; margin: 0 6px; }
@media (max-width: 720px) {
  /* never truncate the episode title on a phone — wrap it */
  .now-playing { white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.4; }
}

.pill {
  font-family: var(--font-mono);
  font-size: 10px; letter-spacing: 1.5px; padding: 3px 9px;
  border-radius: 999px; border: 1px solid var(--border); background: var(--bg);
  color: var(--dim); text-transform: uppercase;
}
.pill.listening   { color: var(--gold); border-color: var(--gold); animation: pulse 1.5s infinite; }
.pill.identified, .pill.playing { color: var(--green); border-color: var(--green); }
.pill.paused      { color: var(--terra); border-color: var(--terra); }
.pill.skipped     { color: var(--gold); border-color: var(--gold); }
.pill.switched    { color: var(--teal); border-color: var(--teal); }
.pill.stale, .pill.unknown { color: var(--rose); border-color: var(--rose); }
@keyframes pulse { 50% { opacity: 0.5; } }

.mode {
  font-family: var(--font-mono);
  color: var(--dim); font-size: 9px; letter-spacing: 2px;
  padding: 2px 7px; border: 1px solid var(--border); border-radius: 4px;
}
.mode.locked  { color: var(--green); border-color: var(--green); }
.mode.hunting { color: var(--terra); border-color: var(--terra); }

/* ============================================================
 * Entity card
 * ============================================================ */

/* ============================================================
 * Cue stream
 * ============================================================ */
/* the words that name a node */

/* ============================================================
 * Time corner / paused / lost (listen mode only)
 * ============================================================ */
body.mode-watch #status-pill,
body.mode-watch #mode-tag,
body.mode-watch .time-corner,
body.mode-watch .paused-overlay,
body.mode-watch .lost-banner { display: none !important; }

.time-corner {
  position: fixed; bottom: 14px; left: 14px;
  display: flex; align-items: baseline; gap: 10px;
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: 12px; padding: 10px 16px;
  backdrop-filter: blur(8px); z-index: 60;
  font-variant-numeric: tabular-nums;
}
.big-time {
  font-family: var(--font-mono);
  font-size: 26px; font-weight: 700; color: var(--gold);
  transition: color 0.3s, opacity 0.3s, text-shadow 0.6s;
}
.duration { color: var(--dim); font-size: 12px; font-family: var(--font-mono); }
.tick-dot {
  display: inline-block; width: 9px; height: 9px; border-radius: 50%;
  background: var(--dim); margin-left: 4px; align-self: center;
  transition: background 0.2s, box-shadow 0.2s;
}
.tick-dot.tick-on  { background: var(--green); box-shadow: 0 0 8px var(--green); }
.tick-dot.tick-off { background: var(--green); opacity: 0.35; }
.tick-dot.frozen   { background: var(--terra); }
.tick-dot.lost     { background: var(--rose); animation: pulse 1s infinite; }
.progress-mini {
  position: absolute; bottom: 0; left: 0; right: 0; height: 2px;
  border-radius: 0 0 12px 12px; overflow: hidden;
}
#progress-fill { height: 100%; width: 0%; background: var(--gold); transition: width 0.3s; }
.time-corner.verified .big-time { animation: verifyPulse 0.8s ease-out; }
.time-corner.lost  .big-time { color: var(--rose); opacity: 0.5; }
.time-corner.stale .big-time { opacity: 0.5; }
@keyframes verifyPulse {
  0% { color: var(--green); text-shadow: 0 0 18px var(--green); }
  100% { color: var(--gold); text-shadow: none; }
}

.paused-overlay {
  position: fixed; right: 14px; top: 80px; z-index: 70;
  pointer-events: none;
  display: flex; align-items: center; gap: 10px;
  padding: 8px 14px; border-radius: 999px;
  background: rgba(5,5,7,0.85); backdrop-filter: blur(8px);
  border: 1px solid var(--terra);
  opacity: 0; transform: translateY(-12px);
  transition: opacity 0.4s, transform 0.4s;
}
body.audio-paused .paused-overlay { opacity: 1; transform: translateY(0); }
.paused-icon { font-size: 13px; letter-spacing: 3px; color: var(--terra); animation: btnPulse 2s infinite; }
.paused-label {
  font-family: var(--font-mono);
  font-size: 10px; font-weight: 600; letter-spacing: 2px;
  color: var(--terra); text-transform: uppercase;
}

.lost-banner {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 80px;
  padding: 10px 20px; background: var(--rose); color: var(--bg);
  font-weight: 700; border-radius: 8px; letter-spacing: 0.5px;
  z-index: 65; font-family: var(--font-mono); font-size: 12px;
  box-shadow: 0 8px 30px rgba(214,138,138,0.4);
}

/* ============================================================
 * Diagnostics drawer
 * ============================================================ */
.diag {
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: 8px; padding: 12px; margin-top: 30px;
}
.diag summary {
  cursor: pointer; color: var(--dim); user-select: none;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 1px;
}
.diag table { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 11px; }
.diag th, .diag td { text-align: left; padding: 4px 8px; border-bottom: 1px solid var(--border); }
.diag th { color: var(--dim); font-weight: normal; }
.diag tr.top { color: var(--green); }
.diag #log {
  background: var(--bg); padding: 10px; border-radius: 6px;
  font-family: var(--font-mono); font-size: 10px;
  max-height: 180px; overflow: auto; white-space: pre-wrap;
  margin-top: 10px; color: var(--dim);
}
.diag textarea {
  width: 100%; margin-top: 10px;
  background: var(--bg); color: var(--fg);
  border: 1px solid var(--border); border-radius: 6px; padding: 8px;
  font-family: var(--font-mono); font-size: 11px; resize: vertical;
}

/* corpus tip rows with thumbnails */

/* corpus tip — demo-style single card + interactive rows */

/* ============================================================
 * Studio — the curator's desk (/studio/<ep>)
 * Video + live views on the left, the dock on the right. Hairlines,
 * mono labels, no boxes: the views are the subject, the dock is the notebook.
 * ============================================================ */
body.mode-studio .studio-only { display: inline-flex !important; }
.studio-link { text-decoration: none; }
body.mode-studio .studio-link { display: none; }
.studio-tag {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--gold); border: 1px solid var(--gold-dim); border-radius: 4px; padding: 3px 7px;
}

/* the desk splits: player + stage keep the left, the dock owns the right */

.tool {
  background: transparent; color: var(--dim); border: 1px solid var(--border);
  border-radius: 5px; padding: 3px 8px; font-family: var(--font-mono); font-size: 10.5px;
  letter-spacing: .04em; text-transform: none; cursor: pointer; white-space: nowrap;
  transition: color .15s, border-color .15s;
}
.tool:hover { color: var(--gold); border-color: var(--gold); }
.tool.primary { color: var(--bg); background: var(--gold); border-color: var(--gold); }
.tool.primary:hover { background: var(--fg); border-color: var(--fg); }
.tool.ok { color: var(--green); border-color: rgba(164,199,154,.4); }
.tool.ok:hover { border-color: var(--green); }
.tool kbd, .sd-keys kbd { font-family: inherit; font-size: 9px; color: var(--dim); border: 1px solid var(--border); border-radius: 3px; padding: 0 3px; margin-left: 4px; }
.tool.flash { color: var(--gold); border-color: var(--gold); box-shadow: 0 0 0 3px rgba(232,207,150,.18); }

/* marks under the video: notes ▲, keyframes |, approved bands */
.ss-range { position: absolute; top: 0; height: 100%; background: rgba(164,199,154,.2); border-left: 1px solid rgba(164,199,154,.5); border-right: 1px solid rgba(164,199,154,.5); }
.ss-cue { position: absolute; top: 2px; width: 1px; height: 10px; background: var(--teal); opacity: .75; transform: translateX(-.5px); cursor: pointer; }
.ss-cue.v-globe { background: var(--teal); } .ss-cue.v-timeline { background: var(--gold); } .ss-cue.v-web { background: var(--rose); } .ss-cue.v-card { background: var(--fg-dim); }
.ss-cue::after { content: ''; position: absolute; inset: -4px -5px; }
.ss-note {
  position: absolute; bottom: 1px; width: 0; height: 0; transform: translateX(-50%);
  border-left: 4.5px solid transparent; border-right: 4.5px solid transparent; border-bottom: 8px solid var(--gold);
  cursor: pointer; opacity: .9;
}
.ss-note.k-wrong { border-bottom-color: var(--rose); } .ss-note.k-missing { border-bottom-color: var(--green); }
.ss-note.k-camera { border-bottom-color: var(--teal); } .ss-note.k-love { border-bottom-color: var(--fg); }
.ss-note::after { content: ''; position: absolute; left: -6px; top: -2px; width: 12px; height: 14px; }
.ss-note:hover, .ss-cue:hover { opacity: 1; filter: brightness(1.4); }
.ss-in { position: absolute; top: 0; height: 100%; width: 1px; background: var(--fg); opacity: .6; }
.ss-in::before { content: '['; position: absolute; left: 1px; top: -2px; font: 10px var(--font-mono); color: var(--fg); }

/* the dock */
.studio-dock {
  position: fixed; top: 0; right: 0; bottom: 0; width: 420px; z-index: 40;
  background: var(--bg-2); border-left: 1px solid var(--border);
  display: flex; flex-direction: column; font-family: var(--font-mono); font-size: 12px; color: var(--fg-dim);
}
.studio-dock[hidden] { display: none; }
.sd-head { padding: 12px 14px 8px; border-bottom: 1px solid var(--border); }
.sd-title { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sd-ep { color: var(--fg-dim); letter-spacing: 0; text-transform: none; margin-left: 8px; font-family: var(--font-serif); font-size: 13px; }
.sd-status { font-size: 10.5px; color: var(--dim); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sd-status.dirty { color: var(--terra); } .sd-status.err { color: var(--rose); } .sd-status.ok { color: var(--green); }
.sd-search-row { display: flex; gap: 8px; padding: 10px 14px 6px; align-items: center; }
#sd-search {
  flex: 1 1 auto; min-width: 0; padding: 7px 10px; background: var(--bg); border: 1px solid var(--border); border-radius: 6px;
  color: var(--fg); font-family: var(--font-mono); font-size: 12px;
}
#sd-search:focus { outline: none; border-color: var(--gold-dim); }
.sd-scope { display: inline-flex; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.sd-scope button, .sd-cats button, .sd-tabs button, .sd-kinds button {
  background: transparent; border: 0; color: var(--dim); font-family: var(--font-mono); font-size: 11px; cursor: pointer; padding: 5px 9px;
}
.sd-scope button.on { background: var(--bg-3); color: var(--gold); }
.sd-cats { display: flex; gap: 2px; padding: 0 10px 8px; align-items: center; }
.sd-cats button { opacity: .45; border-bottom: 2px solid transparent; padding: 3px 6px; }
.sd-cats button.on { opacity: 1; }
.sd-cats button.cat-person.on { border-color: var(--rose); color: var(--rose); }
.sd-cats button.cat-place.on  { border-color: var(--teal); color: var(--teal); }
.sd-cats button.cat-event.on  { border-color: var(--terra); color: var(--terra); }
.sd-cats button.cat-thing.on  { border-color: var(--green); color: var(--green); }
.sd-count { margin-left: auto; font-size: 10.5px; color: var(--dim); }
.sd-tabs { display: flex; border-bottom: 1px solid var(--border); padding: 0 8px; }
.sd-tabs button { padding: 8px 10px; border-bottom: 2px solid transparent; margin-bottom: -1px; letter-spacing: .06em; text-transform: uppercase; font-size: 10.5px; }
.sd-tabs button.on { color: var(--fg); border-bottom-color: var(--gold); }
.sd-tabs b { font-weight: 400; color: var(--gold); margin-left: 4px; }
.sd-panel { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 10px 14px 20px; }
.sd-panel[hidden] { display: none; }
.sd-help { font-family: var(--font-serif); font-size: 12.5px; color: var(--dim); line-height: 1.5; margin: 6px 0 12px; }
.sd-help em { color: var(--fg-dim); font-style: italic; }

/* composer */
.sd-composer { border-bottom: 1px solid var(--border); padding-bottom: 12px; margin-bottom: 10px; }
.sd-comp-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.sd-at { color: var(--gold); font-size: 12px; }
.tiny { background: transparent; border: 0; color: var(--dim); font-family: var(--font-mono); font-size: 10.5px; cursor: pointer; padding: 2px 4px; }
.tiny:hover { color: var(--gold); }
.sd-node { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--border); border-radius: 12px; padding: 1px 4px 1px 7px; font-size: 11px; color: var(--fg-dim); }
.sd-node[hidden] { display: none; }
.sd-node .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); display: inline-block; }
.sd-node .x { background: transparent; border: 0; color: var(--dim); cursor: pointer; font-size: 13px; line-height: 1; padding: 0 3px; }
.sd-node .x:hover { color: var(--rose); }
.sd-kinds { display: flex; flex-wrap: wrap; gap: 2px; margin-bottom: 6px; }
.sd-kinds button { padding: 3px 7px; border-radius: 10px; border: 1px solid transparent; }
.sd-kinds button.on { color: var(--fg); border-color: var(--gold-dim); background: var(--bg-3); }
#sd-text {
  width: 100%; resize: vertical; min-height: 64px; padding: 8px 10px;
  background: var(--bg); border: 1px solid var(--border); border-radius: 6px;
  color: var(--fg); font-family: var(--font-serif); font-size: 14px; line-height: 1.45;
}
#sd-text:focus { outline: none; border-color: var(--gold-dim); }
.sd-comp-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; }
.sd-comp-foot .hint { font-size: 10px; color: var(--dim); opacity: .8; }

/* approvals */
.sd-approve { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.sd-in-label { font-size: 10.5px; color: var(--fg-dim); }
.sd-ranges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.sd-range { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: var(--green); border: 1px solid rgba(164,199,154,.35); border-radius: 12px; padding: 1px 6px 1px 8px; }
.sd-range .x { background: transparent; border: 0; color: var(--dim); cursor: pointer; font-size: 13px; line-height: 1; }
.sd-range .x:hover { color: var(--rose); }

/* lists */
.sd-list { list-style: none; margin: 0; padding: 0; }
.sd-item { display: grid; grid-template-columns: 46px 1fr auto; gap: 6px 10px; padding: 8px 0; border-bottom: 1px solid var(--border); align-items: start; }
.sd-item.current { background: linear-gradient(90deg, rgba(232,207,150,.08), transparent); margin: 0 -14px; padding-left: 14px; padding-right: 14px; }
.sd-t { color: var(--gold); cursor: pointer; font-size: 11.5px; padding-top: 2px; }
.sd-t:hover { text-decoration: underline; }
.sd-body { min-width: 0; }
.sd-meta { display: flex; gap: 8px; align-items: center; font-size: 10.5px; color: var(--dim); margin-bottom: 2px; flex-wrap: wrap; }
.sd-meta .k { color: var(--fg-dim); }
.sd-meta .n { color: var(--teal); cursor: pointer; }
.sd-meta .n:hover { text-decoration: underline; }
.sd-text { font-family: var(--font-serif); font-size: 13.5px; line-height: 1.45; color: var(--fg); white-space: pre-wrap; word-break: break-word; cursor: text; }
.sd-text:hover { color: var(--gold); }
.sd-edit { width: 100%; background: var(--bg); border: 1px solid var(--gold-dim); border-radius: 5px; color: var(--fg); font-family: var(--font-serif); font-size: 13.5px; padding: 6px 8px; resize: vertical; }
.sd-acts { display: flex; gap: 2px; }
.sd-acts button { background: transparent; border: 0; color: var(--dim); cursor: pointer; font-size: 13px; padding: 0 4px; }
.sd-acts button:hover { color: var(--rose); }
.sd-empty { font-family: var(--font-serif); color: var(--dim); font-size: 13px; padding: 18px 0; line-height: 1.5; }
.sd-kf-row { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.sd-cue-sum { font-size: 11.5px; color: var(--fg-dim); }
.sd-cue-sum .v { color: var(--fg); }
.v-globe .sd-t { color: var(--teal); } .v-timeline .sd-t { color: var(--gold); } .v-web .sd-t { color: var(--rose); } .v-card .sd-t { color: var(--fg-dim); }

/* roster */
.sd-row { display: grid; grid-template-columns: 46px 8px 1fr auto; gap: 6px 8px; padding: 6px 0; border-bottom: 1px solid var(--border); align-items: center; cursor: pointer; }
.sd-row:hover, .sd-row.hot { background: linear-gradient(90deg, rgba(232,207,150,.08), transparent); margin: 0 -14px; padding-left: 14px; padding-right: 14px; }
.sd-row .cdot { width: 8px; height: 8px; border-radius: 50%; }
.cdot.cat-person { background: var(--rose); } .cdot.cat-place { background: var(--teal); } .cdot.cat-event { background: var(--terra); } .cdot.cat-thing { background: var(--green); }
.sd-row .nm { color: var(--fg); font-size: 12.5px; }
.sd-row .gl { font-family: var(--font-serif); font-size: 12px; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sd-row .st { font-size: 10px; color: var(--dim); text-align: right; white-space: nowrap; }
.sd-row .st b { color: var(--fg-dim); font-weight: 400; }
.sd-row-acts { display: none; gap: 2px; grid-column: 4; }
.sd-row:hover .sd-row-acts { display: inline-flex; }
.sd-row-acts button { background: transparent; border: 0; color: var(--dim); cursor: pointer; font-size: 12px; padding: 0 3px; }
.sd-row-acts button:hover { color: var(--gold); }

/* footer */
.sd-foot { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 8px 14px 10px; border-top: 1px solid var(--border); }
#sd-key { width: 90px; padding: 3px 7px; background: var(--bg); border: 1px solid var(--border); border-radius: 5px; color: var(--fg); font-family: var(--font-mono); font-size: 11px; }
#sd-key.bad { border-color: var(--rose); }
.sd-keys { font-size: 10.5px; color: var(--dim); width: 100%; }
.sd-keys summary { cursor: pointer; }
.sd-keys div { padding: 4px 0 0; line-height: 1.6; }

/* toast */
.sd-toast {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 80;
  background: rgba(5,5,7,.95); color: var(--fg); border: 1px solid var(--gold-dim); border-radius: 20px;
  padding: 8px 16px; font-family: var(--font-mono); font-size: 12px; display: flex; gap: 12px; align-items: center;
  box-shadow: 0 8px 24px rgba(0,0,0,.45); opacity: 0; pointer-events: none; transition: opacity .2s;
}
.sd-toast.on { opacity: 1; pointer-events: auto; }
.sd-toast button { background: transparent; border: 0; color: var(--gold); font-family: inherit; cursor: pointer; }

/* narrow: the dock stacks under the stage instead of owning the right */
@media (max-width: 1100px) {
  .studio-dock { position: static; width: auto; height: auto; border-left: 0; border-top: 1px solid var(--border); }
  .sd-panel { max-height: 60vh; }
}

/* who to thank: the long form of the credits (the map itself only carries a small i) */
.credits-line { font-family: var(--font-mono); font-size: 10.5px; line-height: 1.6; color: var(--fg-dim); opacity: .8; margin-top: 18px; max-width: 70ch; }
.credits-line a { color: inherit; text-decoration: none; border-bottom: 1px dotted currentColor; }

/* an appearance in an episode that is not ready yet: named, not linked */
.bio-appearance.soon { cursor: default; opacity: .62; }
.bio-appearance.soon:hover { background: transparent; }
.ba-soon { font-family: var(--font-mono); font-style: normal; font-size: 9px; letter-spacing: 1px; text-transform: uppercase; color: var(--dim); border: 1px solid var(--border); border-radius: 999px; padding: 1px 6px; margin-left: 6px; }
