/* Engine styles. Every color, font, texture and brush is a custom property set by the show's theme
   (show.json "theme", emitted as /<slug>/theme.css and loaded after this file). Only structural
   defaults live here. A show's own theme.css may restyle, never restructure. */
:root {
  --sp1: 4px; --sp2: 8px; --sp3: 16px; --sp4: 24px; --sp5: 32px; --sp6: 48px;
  --r: 0; --shadow: none; --t: 140ms ease;
  /* the map's chrome sits on a light base map whatever the theme */
  --map-bg: #e9ecef; --map-status-bg: #eef0f2; --map-status-ink: #3c4043; --map-ctrl-line: #000000;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
/* Until the engine's first render the page stays hidden; otherwise Where to start and the filled-in catalog push
   everything down right after the first paint (a layout shift). main.js removes the class, and if the engine
   never runs, the page shows anyway after 4 seconds. */
html.booting body { visibility: hidden; animation: ee-reveal 0s 4s forwards; }
@keyframes ee-reveal { to { visibility: visible; } }
body { background: var(--bg); color: var(--ink); font: 400 15px/1.5 var(--serif); letter-spacing: .005em; }
h1, h2, h3 { font-family: var(--serif); font-weight: 700; margin: 0; line-height: 1.1; }
h1 { font-size: 24px; } h2 { font-size: 22px; } h3 { font-size: 17px; }
.brush { background: var(--brush) no-repeat left 100% / 100% .3em; padding-bottom: .16em; }
button, select, input { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
a { color: var(--accent); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* header */
header.top { background: var(--bg); border-bottom: 1px solid var(--rule); padding: var(--sp4) var(--sp4) 0; }
.wordmark { font-size: 26px; text-transform: uppercase; letter-spacing: .02em; line-height: 1.05; }
.wordmark a.home { color: inherit; text-decoration: none; }
.wordmark a.home:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.fan-tag { display: inline-block; vertical-align: middle; margin-left: var(--sp2); font-size: 12px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--accent); border: 1px solid currentColor; padding: 1px 6px; position: relative; top: -3px; }
.brand { display: flex; align-items: baseline; gap: var(--sp3); flex-wrap: wrap; }
.brand p { margin: 0; color: var(--ink-2); font-size: 14px; }
.head-row { display: flex; align-items: flex-start; gap: var(--sp3); flex-wrap: wrap; }
.head-row .brand { flex: 1 1 420px; }
.ask-open { white-space: normal; text-align: left; line-height: 1.25; padding-top: 6px; padding-bottom: 6px; }
dialog.ask { width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 32px); border: 1px solid var(--rule); border-radius: 0; padding: var(--sp4); background: var(--bg); color: var(--ink); }
dialog.ask::backdrop { background: var(--backdrop); }
.ask-top { display: flex; gap: var(--sp3); align-items: flex-start; }
.ask-top h2 { flex: 1; font-size: 24px; margin: 0; }
.ask p.lead { color: var(--ink-2); font-size: 15px; line-height: 1.5; margin: var(--sp2) 0 0; }
.ask form { display: grid; gap: var(--sp1); margin-top: var(--sp2); }
.ask label { font-size: 13px; margin-top: var(--sp2); }
.ask label span { color: var(--ink-2); }
.ask input, .ask textarea { width: 100%; font: 400 15px/1.4 var(--serif); color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 0; padding: var(--sp2); min-height: 44px; }
.ask textarea { resize: vertical; }
.ask input:focus-visible, .ask textarea:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.ask .btn.primary { justify-self: start; margin-top: var(--sp3); }
.ask .hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
nav.tabs { display: flex; gap: 0; margin-top: var(--sp3); overflow-x: auto; }
nav.tabs a { display: inline-flex; align-items: center; gap: var(--sp2); padding: var(--sp2) var(--sp4); min-height: 48px; text-decoration: none; color: var(--ink-2); font-weight: 700; font-size: 17px; white-space: nowrap; transition: color var(--t); }
nav.tabs a:hover { color: var(--ink); }
nav.tabs a[aria-current="page"] { color: var(--accent-ink); background: var(--accent); }
nav.tabs a[aria-current="page"] .pill { background: var(--accent-ink); color: var(--accent); }
.pill { background: var(--surface-2); border-radius: 0; padding: 0 var(--sp2); font-size: 12px; font-weight: 600; min-width: 22px; text-align: center; }
.filterbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp2); padding: var(--sp2) var(--sp4); background: var(--surface-2); border-bottom: 1px solid var(--line); font-size: 14px; min-height: 44px; }
.filterbar[hidden] { display: none; }
.filterbar .chip { cursor: pointer; }
.filterbar .lead { color: var(--ink-2); }
.filterbar.active { background: color-mix(in srgb, var(--accent) 14%, var(--surface-2)); border-bottom-color: var(--accent); }
.filterbar.active .lead { color: var(--ink); font-weight: 600; }
.filterbar #clearAll { margin-left: var(--sp1); }

main { padding: var(--sp4); max-width: 1440px; margin: 0 auto; }
section[hidden] { display: none; }

/* buttons & chips */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--sp2); min-height: 44px; padding: 0 var(--sp4); border-radius: 0; border: 1px solid var(--accent); background: transparent; cursor: pointer; font-weight: 700; font-size: 15px; font-stretch: 75%; letter-spacing: .01em; transition: background var(--t), color var(--t); text-decoration: none; color: var(--accent); }
.btn:hover { background: var(--accent); color: var(--accent-ink); }
.btn:disabled { opacity: .45; cursor: default; background: transparent; color: var(--accent); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.btn.danger { color: var(--danger); border-color: var(--danger); }
.btn.danger:hover { background: var(--danger-strong); color: var(--danger-ink); }
.btn.small { min-height: 36px; padding: 0 var(--sp3); font-size: 14px; }
.linkbtn { background: none; border: 0; padding: var(--sp1); color: var(--accent); cursor: pointer; text-decoration: underline; font-size: 14px; min-height: 32px; }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); border-radius: 0; padding: 4px 10px; font-size: 13px; line-height: 1.3; }
button.chip { cursor: pointer; min-height: 36px; text-align: left; transition: background var(--t), border-color var(--t); }
button.chip:hover { border-color: var(--ink-2); }
button.chip[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
button.chip[aria-pressed="true"] .n { color: inherit; opacity: .8; }
button.chip:disabled { opacity: .45; cursor: default; }
.chip .n { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.dot { width: 10px; height: 10px; border-radius: 0; flex: none; display: inline-block; }
.star { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; flex: none; transition: background var(--t); }
.star svg { width: 20px; height: 20px; fill: none; stroke: var(--ink-2); stroke-width: 1.8; }
.star[aria-pressed="true"] { background: var(--saved); border-color: var(--saved); }
.star[aria-pressed="true"] svg { fill: var(--accent-ink); stroke: var(--accent-ink); }
.star.heard-btn svg { stroke-width: 2.4; }
.star.heard-btn[aria-pressed="true"] { background: var(--accent-2); border-color: var(--accent-2); }
.star.heard-btn[aria-pressed="true"] svg { fill: none; stroke: var(--surface); }
.heard-tag { margin-left: var(--sp1); color: var(--accent-2); font-size: 12px; font-weight: 600; white-space: nowrap; }
.saved-views { margin: 0 0 var(--sp3); }
/* Saved state on text buttons: solid, like the saved star on cards, so it reads as "on" */
.btn[data-save][aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn[data-save][aria-pressed="true"]:hover { background: var(--ink); border-color: var(--ink); color: var(--bg); }

/* header: what's new */
.head-btns { display: flex; flex-wrap: wrap; gap: var(--sp2); align-items: flex-start; }
.whatsnew .spark { font-size: 15px; line-height: 1; }
.whatsnew .spark[hidden] { display: none; }
dialog.rel { width: min(640px, calc(100vw - 32px)); }
.rel-list { margin-top: var(--sp3); border-top: 1px solid var(--rule); }
.rel-item { border-bottom: 1px solid var(--line); padding: var(--sp3) 0; }
.rel-item h3, .rel-item summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px var(--sp2); font-size: 17px; }
.rel-item summary { cursor: pointer; font-weight: 700; min-height: 32px; list-style: none; }
.rel-item summary::-webkit-details-marker { display: none; }
.rel-item summary::after { content: "+"; margin-left: auto; color: var(--accent); font-size: 20px; line-height: 1; }
.rel-item[open] summary::after { content: "\2212"; }
.rel-item summary .req { margin-left: 0; font-weight: 600; }
.rel-item .ver { color: var(--accent); font-variant-numeric: tabular-nums; }
.rel-item .rd { color: var(--ink-2); font-size: 13px; font-weight: 400; }
.rel-item .new { background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 700; padding: 1px 6px; letter-spacing: .03em; text-transform: uppercase; }
.rel-item ul { margin: var(--sp2) 0 0; padding-left: 20px; display: grid; gap: 6px; font-size: 15px; }
.rel .req { display: inline-block; margin-left: 6px; border: 1px solid var(--accent-2); color: var(--accent-2); font-size: 12px; font-weight: 600; padding: 0 6px; white-space: nowrap; }
.rel-ask { margin: var(--sp3) 0 0; color: var(--ink-2); }

/* where to start */
details.start { background: var(--surface) var(--texture); border: 1px solid var(--line); margin-bottom: var(--sp4); }
details.start[hidden] { display: none; }
details.start > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: var(--sp3); padding: var(--sp3); min-height: 48px; }
details.start > summary::-webkit-details-marker { display: none; }
details.start > summary .hint { margin-left: auto; color: var(--accent); font-size: 14px; text-decoration: underline; }
details.start > summary .hint::after { content: "Hide"; }
details.start:not([open]) > summary .hint::after { content: "Show"; }
/* auto-fit, not auto-fill: three or four cards share the whole row instead of leaving empty columns beside them */
.start-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--sp3); padding: 0 var(--sp3) var(--sp3); }
/* about half the screen at most: longer cards fade out under Show all (features/start.js). Capped, each card keeps its
   own height, so a short one's button (Surprise me) never stretches down under the fade. */
details.start.capped .start-grid { max-height: max(240px, calc(50vh - 120px)); overflow: hidden; align-items: start;
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 64px), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 64px), transparent); }
details.start .start-more { display: block; margin: calc(var(--sp2) * -1) auto var(--sp2); font-weight: 600; color: var(--ink); }
details.start .start-more[hidden] { display: none; }
/* the last column: the guides over Surprise me, half the column's height each */
.sc-stack { display: grid; gap: var(--sp3); min-width: 0; }
.sc-stack.halves { grid-template-rows: 1fr 1fr; }
.sc-guides p a { color: var(--ink); font-weight: 700; font-size: 15px; line-height: 1.3; }
.sc-guides p a:hover { color: var(--accent); }
.sc { background: var(--bg); border: 1px solid var(--line); padding: var(--sp3); min-width: 0; display: flex; flex-direction: column; gap: var(--sp2); }
.sc h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); display: flex; gap: var(--sp2); justify-content: space-between; align-items: baseline; }
.sc h3 span { color: var(--ink-2); text-transform: none; letter-spacing: 0; font-weight: 400; }
.sc p { margin: 0; color: var(--ink-2); font-size: 14px; }
.sc ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp2); }
.sc li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--sp2); align-items: start; border-top: 1px solid var(--line); padding-top: var(--sp2); }
.sc .when { font-size: 12px; color: var(--ink-2); }
.sc .what { font-weight: 700; font-size: 15px; line-height: 1.25; }
.sc button.go { display: block; background: none; border: 0; padding: 2px 0; min-height: 24px; text-align: left; cursor: pointer; color: var(--ink); font-size: 14px; line-height: 1.3; }
.sc button.go:hover { text-decoration: underline; }
.sc .what + .epl .go, .sc .epl + .epl .go { color: var(--ink-2); font-size: 13px; }
.sc .sub { font-size: 12px; color: var(--ink-2); }
.sc .linkbtn { padding: 0; min-height: 28px; font-size: 13px; }
.sc > .linkbtn { align-self: flex-start; }
.sc .epl { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: var(--sp2); }
.sc .epl .linkbtn { min-height: 24px; font-size: 12px; }
.sc .star { width: 38px; height: 38px; }
.sc .star svg { width: 18px; height: 18px; }
.sc-box { display: contents; }
/* phones: the cards become a swipeable row, so the catalog isn't pushed far down */
@media (max-width: 600px) {
  .start-grid { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 86%; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: var(--sp3); overscroll-behavior-x: contain; padding-bottom: var(--sp3); align-items: start; }
  details.start.capped .start-grid { overflow-x: auto; overflow-y: hidden; }
  .sc { scroll-snap-align: start; }
}
.sc .sc-acts { display: flex; flex-wrap: wrap; gap: var(--sp2); align-items: center; margin-top: auto; }
.sc .pick { border-top: 1px solid var(--line); padding-top: var(--sp2); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--sp2); align-items: start; }
.sc .pick .what { font-size: 17px; }

/* explore layout */
.explore { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: var(--sp4); align-items: start; }
.explore > *, .two > * { min-width: 0; }
.rail { position: sticky; top: var(--sp3); max-height: calc(100vh - 32px); overflow-y: auto; padding-right: var(--sp2); }
.rail h2 { font-size: 16px; color: var(--ink); margin: var(--sp4) 0 var(--sp2); }
.rail h2:first-child { margin-top: 0; }
.rail .chips { display: flex; flex-wrap: wrap; gap: 6px; }
.books-link { margin: 0 0 var(--sp2); font-weight: 600; }
.books-link .books-on { font-weight: 400; color: var(--ink-2); }
.rail .chip-note { font-size: 12px; line-height: 1.45; color: var(--ink-2); margin: 6px 0 0; }
.field label { display: block; font-weight: 600; font-size: 13px; margin-bottom: var(--sp1); }
.field input[type="search"], .field select, select.inline { width: 100%; min-height: 44px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); padding: 0 var(--sp3); }
details.more summary { cursor: pointer; color: var(--accent); font-size: 14px; margin-top: var(--sp2); min-height: 32px; display: flex; align-items: center; }
details.more .chips { margin-top: var(--sp2); }

/* time strip */
.strip { background: var(--surface) var(--texture); border: 1px solid var(--line); border-radius: var(--r); padding: var(--sp3); margin-bottom: var(--sp3); box-shadow: var(--shadow); }
.strip-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--sp2); flex-wrap: wrap; margin-bottom: var(--sp2); }
.strip-head p { margin: 0; color: var(--ink-2); font-size: 13px; }
.bars { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(28px, 1fr); gap: 3px; align-items: end; overflow-x: auto; padding-bottom: var(--sp1); }
.bar { display: flex; flex-direction: column; align-items: stretch; justify-content: flex-end; gap: 4px; background: none; border: 0; padding: 0; cursor: pointer; height: 150px; min-width: 28px; }
.bar .stack { display: flex; flex-direction: column-reverse; border-radius: 0; overflow: hidden; min-height: 2px; background: var(--surface-2); }
.bar .stack span { display: block; }
.bar .cnt { font-size: 11px; color: var(--ink-2); text-align: center; font-variant-numeric: tabular-nums; order: -1; }
.bar .lbl { font-size: 10px; color: var(--ink-2); text-align: center; line-height: 1.15; height: 26px; overflow: hidden; order: 1; }
.bar[aria-pressed="true"] .stack { outline: 3px solid var(--ink); outline-offset: 1px; }
.bar[aria-pressed="true"] .lbl { color: var(--ink); font-weight: 700; }
.bar.dim .stack { opacity: .35; }
.bar.sep { border-left: 1px dashed var(--line); padding-left: 3px; }
.legend { display: flex; flex-wrap: wrap; gap: var(--sp2) var(--sp3); font-size: 12px; color: var(--ink-2); margin-top: var(--sp2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }

/* toolbar + list */
.toolbar { display: flex; flex-wrap: wrap; gap: var(--sp2) var(--sp3); align-items: end; margin-bottom: var(--sp3); }
.toolbar .field { min-width: 170px; }
.toolbar .count { margin-left: auto; color: var(--ink-2); font-size: 14px; align-self: center; }
.group { margin-bottom: var(--sp4); }
.group-head { display: flex; align-items: center; gap: var(--sp3); flex-wrap: wrap; padding: var(--sp2) 0; border-bottom: 1px solid var(--rule); margin-bottom: var(--sp2); }
.group-head h2 { font-size: 22px; }
.group-head .meta { color: var(--ink-2); font-size: 13px; }
.group-head .mix { display: flex; height: 8px; width: 120px; border-radius: 0; overflow: hidden; background: var(--surface-2); }
.group-head .acts { margin-left: auto; display: flex; gap: var(--sp2); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: var(--sp2); }
.card { background: var(--surface) var(--texture); border: 1px solid var(--line); border-radius: var(--r); padding: var(--sp3); display: flex; gap: var(--sp3); align-items: flex-start; box-shadow: var(--shadow); }
.card.saved { border-color: var(--accent); box-shadow: inset 4px 0 0 var(--accent); }
.card .body { flex: 1; min-width: 0; }
.card .ttl { background: none; border: 0; padding: 0; text-align: left; cursor: pointer; font-family: var(--serif); font-size: 16px; font-weight: 600; line-height: 1.3; color: var(--ink); }
.card .ttl:hover { text-decoration: underline; }
.card .sub { color: var(--ink-2); font-size: 13px; margin: 2px 0 var(--sp2); }
.card .tags { display: flex; flex-wrap: wrap; gap: 6px; }
.card .tags .chip { padding: 2px 8px; font-size: 12px; }
.chip.guest { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.chip .ico { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2.2; flex: none; }
.guest-list { display: flex; flex-wrap: wrap; gap: 6px; }
.empty { text-align: center; padding: var(--sp6) var(--sp3); color: var(--ink-2); background: var(--surface) var(--texture); border: 1px solid var(--line); border-radius: 0; }
.empty h2 { color: var(--ink); margin-bottom: var(--sp2); }
.more-row { text-align: center; margin-top: var(--sp3); }

/* patterns */
.panel { background: var(--surface) var(--texture); border: 1px solid var(--line); border-radius: var(--r); padding: var(--sp4); margin-bottom: var(--sp4); box-shadow: var(--shadow); }
.panel > p.note { color: var(--ink-2); margin: var(--sp1) 0 var(--sp3); font-size: 14px; }
.scroll-x { overflow-x: auto; }
table.heat { border-collapse: separate; border-spacing: 2px; font-size: 12px; }
table.heat th { font-weight: 600; color: var(--ink-2); padding: var(--sp1); white-space: nowrap; }
table.heat thead th { writing-mode: vertical-rl; transform: rotate(180deg); text-align: left; height: 92px; vertical-align: bottom; }
table.heat tbody th { text-align: right; position: sticky; left: 0; background: var(--surface); z-index: 1; }
table.heat td { padding: 0; }
table.heat td button { width: 34px; height: 30px; border: 0; border-radius: 0; cursor: pointer; font-size: 11px; font-variant-numeric: tabular-nums; }
table.heat td button.zero { background: var(--surface-2); color: transparent; cursor: default; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp4); }
.rank { list-style: none; margin: 0; padding: 0; }
.rank li { display: grid; grid-template-columns: minmax(0, 1fr) 2fr 44px; gap: var(--sp2); align-items: center; padding: 4px 0; }
.rank li button { text-align: left; background: none; border: 0; padding: 4px 0; cursor: pointer; color: var(--ink); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-height: 32px; }
.rank li button:hover { text-decoration: underline; }
.rank .track { height: 12px; background: var(--surface-2); border-radius: 0; overflow: hidden; display: flex; }
.rank .v { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-2); font-size: 13px; }
svg text { fill: var(--ink-2); font-family: var(--sans); }
svg .gridline { stroke: var(--line); stroke-width: 1; }
svg .mark { cursor: pointer; }
svg .mark:focus { outline: none; }
svg .mark:focus-visible { stroke: var(--focus); stroke-width: 3; }
svg .mark.saved { stroke: var(--ink); stroke-width: 2; }
.tip { position: fixed; pointer-events: none; background: var(--ink); color: var(--bg); padding: 6px 10px; border-radius: 0; font-size: 13px; max-width: 320px; z-index: 60; box-shadow: var(--shadow); }
.tip[hidden] { display: none; }

/* saved */
.saved-head { display: flex; flex-wrap: wrap; gap: var(--sp3); align-items: center; margin-bottom: var(--sp3); }
.saved-head .big { font-family: var(--serif); font-size: 34px; font-weight: 700; }
.saved-head .acts { margin-left: auto; display: flex; flex-wrap: wrap; gap: var(--sp2); }
table.list { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
table.list th, table.list td { text-align: left; padding: var(--sp2) var(--sp3); border-bottom: 1px solid var(--line); vertical-align: top; font-size: 14px; }
table.list th { font-size: 13px; font-weight: 700; color: var(--ink); background: var(--surface-2); border-bottom: 1px solid var(--rule); }
table.list td.ttlc button { background: none; border: 0; padding: 0; cursor: pointer; text-align: left; font-family: var(--serif); font-size: 15px; font-weight: 600; color: var(--ink); }
table.list td.ttlc button:hover { text-decoration: underline; }

/* drawer */
dialog.drawer { margin: 0 0 0 auto; height: 100vh; max-height: 100vh; width: min(720px, 100vw); border: 0; border-left: 1px solid var(--rule); padding: 0; background: var(--bg); color: var(--ink); }
dialog.drawer::backdrop { background: var(--backdrop); }
.drawer-inner { padding: var(--sp4) var(--sp5, 32px); display: flex; flex-direction: column; gap: var(--sp3); }
.drawer-top { display: flex; gap: var(--sp2); align-items: flex-start; }
.drawer-top .btn { flex: none; }
.drawer-top h2 { margin-right: var(--sp2); }
.drawer-top h2 { min-width: 0; overflow-wrap: break-word; }
@media (max-width: 600px) {
  dialog.drawer { max-width: 100vw; }
  .drawer-inner { padding: var(--sp3); }
  .drawer-top { flex-wrap: wrap; }
  .drawer-top .btn[data-save] { margin-left: auto; }
  dialog.drawer .drawer-top h2 { order: 2; flex: 1 1 100%; margin: 0; }
}
.drawer-top h2 { flex: 1; font-size: 28px; }
.drawer .desc { white-space: pre-line; line-height: 1.55; font-size: 16px; font-weight: 300; letter-spacing: .01em; }
.drawer .facts { display: grid; grid-template-columns: auto 1fr; gap: 4px var(--sp3); font-size: 14px; margin: 0; }
.drawer .facts dt { color: var(--ink-2); }
.drawer .facts dd { margin: 0; }
.drawer .acts { display: flex; flex-wrap: wrap; gap: var(--sp2); }
.minilist { list-style: none; margin: calc(var(--sp2) + var(--sp1)) 0 0; padding: 0; border-top: 1px solid var(--line); }
.minilist li { display: flex; align-items: center; gap: var(--sp2); border-bottom: 1px solid var(--line); padding: 4px 0; }
.minilist li button.go { flex: 1; text-align: left; background: none; border: 0; padding: var(--sp2) 0; cursor: pointer; color: var(--ink); font-size: 14px; }
.minilist li button.go:hover { text-decoration: underline; }
.minilist li.current button.go { font-weight: 700; }
.minilist .star { width: 36px; height: 36px; }
.card-acts { display: flex; flex-direction: column; gap: var(--sp2); flex: none; }
.play-btn svg { fill: var(--ink-2); stroke: none; width: 18px; height: 18px; }
.play-btn[aria-pressed="true"] { background: var(--playing); border-color: var(--playing); }
.play-btn[aria-pressed="true"] svg { fill: var(--playing-ink); }
.spot { font-size: 13px; color: var(--ink-2); }
.spot a { color: inherit; }
.drawer-sec { display: flex; flex-direction: column; gap: var(--sp3); }
#drawerVideo:empty { display: none; }
.yt { position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; padding: 0; border: 1px solid var(--rule); background: #000; overflow: hidden; }
button.yt { cursor: pointer; }
.yt img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: .88; transition: opacity var(--t); }
button.yt:hover img, button.yt:focus-visible img { opacity: 1; }
.yt .yt-play { position: absolute; left: 50%; top: 50%; width: 68px; height: 48px; transform: translate(-50%, -50%); background: var(--accent); display: flex; align-items: center; justify-content: center; transition: background var(--t); }
button.yt:hover .yt-play { background: var(--playing); }
.yt .yt-play svg { width: 26px; height: 26px; fill: var(--accent-ink); }
button.yt:hover .yt-play svg { fill: var(--playing-ink); }
.yt iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.yt-note { font-size: 13px; color: var(--ink-2); margin: 6px 0 0; }
.chip[hidden] { display: none; }
.chip.vid { border-color: var(--accent-2); color: var(--accent-2); font-weight: 600; }
.chip.vid .ico { fill: currentColor; stroke: none; }
/* player bar */
body.has-player { padding-bottom: 96px; }
.player { position: fixed; left: 0; right: 0; bottom: 0; z-index: 70; background: var(--bg); border-top: 1px solid var(--rule);
  display: grid; grid-template-columns: minmax(0, 1.3fr) auto minmax(0, 2fr) auto auto; gap: var(--sp3); align-items: center; padding: var(--sp2) var(--sp4); }
.player[hidden] { display: none; }
.pl-info { min-width: 0; display: flex; flex-direction: column; }
.pl-label { font-size: 12px; color: var(--ink-2); }
.pl-title { background: none; border: 0; padding: 0; text-align: left; cursor: pointer; color: var(--ink); font-family: var(--serif); font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-height: 28px; }
.pl-title:hover { text-decoration: underline; }
.pl-ctrls { display: flex; align-items: center; gap: var(--sp2); }
.pl-play { width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--accent); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.pl-play svg { width: 22px; height: 22px; fill: var(--accent-ink); }
.pl-skip, .pl-close { min-width: 44px; height: 44px; border-radius: 0; border: 1px solid var(--accent); background: transparent; cursor: pointer; font-weight: 700; font-size: 13px; color: var(--accent); }
.pl-skip:hover, .pl-close:hover { background: var(--accent); color: var(--accent-ink); }
.pl-seek { display: flex; align-items: center; gap: var(--sp2); font-size: 12px; color: var(--ink-2); font-variant-numeric: tabular-nums; min-width: 0; }
.pl-seek input { flex: 1; min-width: 60px; accent-color: var(--accent); height: 28px; }
#plRate { min-height: 44px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); padding: 0 var(--sp2); }
@media (max-width: 760px) {
  body.has-player { padding-bottom: 150px; }
  .player { grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: "info rate close" "ctrls ctrls ctrls" "seek seek seek"; gap: var(--sp1) var(--sp2); padding: var(--sp2) var(--sp3); }
  .pl-info { grid-area: info; } .pl-ctrls { grid-area: ctrls; justify-content: center; } .pl-seek { grid-area: seek; } #plRate { grid-area: rate; } .pl-close { grid-area: close; }
}
.minilist .star svg { width: 16px; height: 16px; }

/* episode rows (timeline list, map panel) */
.elist { list-style: none; margin: 0; padding: 0; }
.erow { display: grid; grid-template-columns: 76px minmax(0, 1fr) auto; gap: var(--sp3); align-items: center; padding: var(--sp2) 0; border-bottom: 1px solid var(--line); }
.erow.noyr { grid-template-columns: minmax(0, 1fr) auto; }
.erow.saved { box-shadow: inset 3px 0 0 var(--accent); padding-left: var(--sp2); }
.erow .yr { font-family: var(--serif); font-weight: 600; font-size: 15px; font-variant-numeric: tabular-nums; text-align: right; }
.erow .ttl { background: none; border: 0; padding: 0; text-align: left; cursor: pointer; font-family: var(--serif); font-size: 15px; font-weight: 600; line-height: 1.3; color: var(--ink); }
.erow .ttl:hover { text-decoration: underline; }
.erow .sub { color: var(--ink-2); font-size: 13px; margin-top: 2px; }
.erow .acts { display: flex; gap: var(--sp2); }
.chrono-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--sp2) var(--sp3); }
.chrono-head .count { color: var(--ink-2); font-size: 14px; }
.ltabs { display: flex; flex-wrap: wrap; gap: 0; border-bottom: 1px solid var(--rule); margin-bottom: var(--sp3); }
.ltabs button { background: none; border: 0; padding: var(--sp3) var(--sp4); cursor: pointer; font: 700 19px/1.15 var(--serif); color: var(--ink-2); text-align: left; transition: color var(--t), background var(--t); }
.ltabs button:hover { color: var(--ink); }
.ltabs button[aria-selected="true"] { background: var(--accent); color: var(--accent-ink); }
.ltabs .count { margin-left: auto; align-self: center; color: var(--ink-2); font-size: 14px; padding: 0 var(--sp2); }
.field.chrono-order { max-width: 260px; margin-bottom: var(--sp3); }
@media (max-width: 600px) { .ltabs button { font-size: 16px; padding: var(--sp2) var(--sp3); flex: 1 1 50%; } .ltabs .count { width: 100%; padding: var(--sp2) 0 0; } }
h3.era-h { font-size: 18px; margin: var(--sp5) 0 0; padding-bottom: var(--sp2); border-bottom: 1px solid var(--rule); }
@media (max-width: 600px) { .erow { grid-template-columns: 56px minmax(0, 1fr) auto; gap: var(--sp2); } .erow .yr { font-size: 13px; } .erow .acts { flex-direction: column; } }

/* map */
.mapwrap { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: var(--sp4); align-items: start; }
.mapbox { position: relative; height: min(74vh, 780px); min-height: 420px; border: 1px solid var(--rule); overflow: hidden; background: var(--map-bg); }
#mapCanvas { position: absolute; inset: 0; }
.mapstatus { position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--sp3); padding: var(--sp4); text-align: center; background: var(--map-status-bg); color: var(--map-status-ink); }
.mapstatus[hidden] { display: none; }
.map-reset { position: absolute; top: 10px; left: 10px; z-index: 1; background: var(--bg); color: var(--accent); }
.map-reset[hidden] { display: none; }
.mappanel { background: var(--surface) var(--texture); border: 1px solid var(--line); padding: var(--sp3); max-height: min(74vh, 780px); overflow-y: auto; box-shadow: var(--shadow); }
.mappanel h2 { margin-bottom: var(--sp1); }
.mappanel .note { color: var(--ink-2); font-size: 14px; margin: 0 0 var(--sp3); }
.mappanel .acts-row { display: flex; flex-wrap: wrap; gap: var(--sp2); margin-bottom: var(--sp2); }
.mappanel .rank li { grid-template-columns: minmax(0, 1.4fr) 1fr 36px; }
.maplibregl-ctrl-group button { width: 40px; height: 40px; }
.mapbox .maplibregl-ctrl-group { border-radius: 0; box-shadow: none; border: 1px solid var(--map-ctrl-line); }
@media (max-width: 960px) {
  .mapwrap { grid-template-columns: minmax(0, 1fr); }
  .mapbox { height: 62vh; min-height: 320px; }
  .mappanel { max-height: none; }
}

.toast { position: fixed; left: 50%; bottom: var(--sp4); transform: translateX(-50%); background: var(--playing); color: var(--playing-ink); padding: var(--sp2) var(--sp3); border-radius: 0; display: flex; gap: var(--sp3); align-items: center; z-index: 80; box-shadow: var(--shadow); max-width: calc(100vw - 32px); }
.toast[hidden] { display: none; }
.toast button { background: none; border: 1px solid var(--playing-ink); color: var(--playing-ink); border-radius: 0; padding: 4px 12px; cursor: pointer; min-height: 36px; font-weight: 600; }
.foot { background: var(--footer-bg); color: var(--footer-ink); margin-top: var(--sp6); }
.foot-in { max-width: 1440px; margin: 0 auto; padding: var(--sp6) var(--sp4) var(--sp5); display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: var(--sp5) var(--sp6); }
.foot h2 { font-size: 28px; margin-bottom: var(--sp3); }
.foot h3 { font-size: 17px; margin: 0 0 var(--sp2); }
.foot p { margin: 0 0 var(--sp3); font-size: 16px; line-height: 1.5; font-weight: 300; letter-spacing: .01em; }
.foot a { color: var(--footer-ink); text-underline-offset: 3px; }
.foot .follow { list-style: none; padding: 0; margin: 0 0 var(--sp3); display: flex; flex-wrap: wrap; gap: var(--sp2); }
.foot .contact { list-style: none; padding: 0; margin: 0 0 var(--sp3); display: grid; gap: var(--sp2); font-size: 15px; }
.foot .contact span { display: block; font-size: 13px; color: var(--footer-ink-2); }
.foot .help { margin-top: var(--sp4); padding-top: var(--sp3); border-top: 1px solid var(--footer-rule); }
.foot .help-links { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: var(--sp2) var(--sp4); font-size: 15px; }
.foot .fine { grid-column: 1 / -1; border-top: 1px solid var(--footer-rule); padding-top: var(--sp3); font-size: 12px; line-height: 1.6; color: var(--footer-fine); }
.foot .fine p { font-size: 12px; font-weight: 400; margin-bottom: var(--sp2); }
.foot .btn { color: var(--footer-ink); border-color: var(--footer-ink); }
.note-box { margin-top: var(--sp2); font-size: 15px; }
.note-box summary { cursor: pointer; text-decoration: underline; text-underline-offset: 3px; min-height: 44px; display: flex; align-items: center; }
.note-box form { display: grid; gap: var(--sp1); margin-top: var(--sp2); max-width: 520px; }
.note-box label { font-size: 13px; margin-top: var(--sp2); }
.note-box label span { color: var(--footer-ink-3); }
.note-box input, .note-box textarea { width: 100%; font: 400 15px/1.4 var(--serif); color: var(--footer-field-ink); background: var(--footer-field-bg); border: 1px solid var(--footer-ink); border-radius: 0; padding: var(--sp2); min-height: 44px; }
.note-box textarea { resize: vertical; }
.note-box input:focus-visible, .note-box textarea:focus-visible { outline: 3px solid var(--footer-ink); outline-offset: 2px; }
.note-box .btn { justify-self: start; margin-top: var(--sp3); }
.note-box .hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.nf-status { font-size: 14px; min-height: 1.5em; margin: var(--sp2) 0 0; }
.foot .btn:hover { background: var(--footer-ink); color: var(--footer-bg); }
body.has-player .foot { padding-bottom: 0; }
@media (max-width: 760px) { .foot-in { grid-template-columns: minmax(0, 1fr); padding: var(--sp5) var(--sp3); } }
.err { background: var(--error-bg); color: var(--error-ink); border: 1px solid var(--error-line); padding: var(--sp3); border-radius: var(--r); margin: var(--sp3) var(--sp4); }
/* Moving in from a show's old address (features/handoff.js): what came across, until the visitor closes it */
.moved { max-width: 1440px; margin: var(--sp3) auto 0; padding: 0 var(--sp4); }
.moved[hidden] { display: none; }
.moved-in { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp3); background: var(--surface) var(--texture); color: var(--ink); border: 1px solid var(--accent); border-left-width: 4px; border-radius: var(--r); padding: var(--sp3) var(--sp4); }
.moved-in p { margin: 0; flex: 1 1 320px; line-height: 1.5; }
.moved-acts { display: flex; flex-wrap: wrap; gap: var(--sp2); }
.moved-pull { margin: 0 0 var(--sp3); color: var(--ink-2); font-size: 15px; }
.moved-pull a { color: var(--accent); }

/* Dropdowns draw their own arrow, in the text color (two small gradients, so it follows the theme), with room on
   the right so it never crowds the border. Forced-colors mode drops background images, so it keeps the browser's. */
.field select, select.inline, #plRate { appearance: none; -webkit-appearance: none; padding-right: 40px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 22px) 50%, calc(100% - 17px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
#plRate { padding-left: var(--sp3); }
@media (forced-colors: active) { .field select, select.inline, #plRate { appearance: auto; -webkit-appearance: auto; background-image: none; padding-right: var(--sp2); } }

@media (max-width: 960px) {
  .explore { grid-template-columns: minmax(0, 1fr); }
  .rail { position: static; max-height: none; }
  .two { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  header.top { padding: var(--sp3) var(--sp3) 0; }
  .wordmark { font-size: 20px; }
  nav.tabs a { padding: var(--sp2) var(--sp3); font-size: 15px; }
  main { padding: var(--sp3); }
  .filterbar { padding: var(--sp2) var(--sp3); }
  .cards { grid-template-columns: 1fr; }
  .toolbar .count { margin-left: 0; width: 100%; }
  .panel { padding: var(--sp3); }
  table.list .hide-sm { display: none; }
}

/* ---------- show components, our own notes, reruns, content levels ---------- */
.view { min-height: 40vh; }
.desc.own .hook { font-size: 1.05em; margin: 0 0 var(--sp2); }
.notes-out { margin: 0; }
.muted { color: var(--ink-2); }
.rerun-line { margin: var(--sp1) 0; font-size: 14px; }
.rerun-line > span:first-child { font-weight: 600; }
.masked-note { font-size: 14px; color: var(--ink-2); margin: var(--sp2) 0; }
details.fold > summary { cursor: pointer; color: var(--ink-2); font-size: 14px; }
details.fold[open] > summary { margin-bottom: var(--sp1); }
.content-box { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp1) var(--sp2); padding: var(--sp1) var(--sp3); font-size: 14px; border-top: 1px solid var(--line); }
.content-box label { font-weight: 600; }
.content-box select { width: auto; min-width: 10em; }
.content-note { color: var(--ink-2); }
