:root {
  --bg: #f7f6f3; --surface: #ffffff; --ink: #1b1d21; --muted: #5d6470; --line: #e3e1dc;
  --accent: #1f4e79; --low: #6b7280; --mid: #b7791f; --high: #d9622b; --crit: #c0262d;
  --ok: #2f7d4f; --warn: #b7791f;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
/* Dark: follows the OS unless the visitor picked Light/Dark in Preferences */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111317; --surface: #191c21; --ink: #e8e9eb; --muted: #9aa1ac; --line: #2a2e35;
    --accent: #7fb2e5; --low: #8b93a1; --mid: #e0a43a; --high: #f07a42; --crit: #f0545b;
    --ok: #5cc28a; --warn: #e0a43a; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111317; --surface: #191c21; --ink: #e8e9eb; --muted: #9aa1ac; --line: #2a2e35;
  --accent: #7fb2e5; --low: #8b93a1; --mid: #e0a43a; --high: #f07a42; --crit: #f0545b;
  --ok: #5cc28a; --warn: #e0a43a; color-scheme: dark;
}
html { font-size: 100%; }
html[data-size="s"] { font-size: 93.75%; }
html[data-size="l"] { font-size: 112.5%; }
html[data-size="xl"] { font-size: 125%; }
html[data-compact] .breakdown, html[data-compact] .ctx { display: none; }
html[data-compact] .story { padding: .75rem .9rem; margin-bottom: .6rem; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 1rem/1.55 var(--sans); padding-bottom: 5rem; }
a { color: var(--accent); }
.wrap { max-width: 860px; margin: 0 auto; padding: 0 1rem; }

.masthead { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.masthead .wrap { display: flex; align-items: center; gap: 1rem; min-height: 3.25rem; }
.brand { font-weight: 800; letter-spacing: .02em; text-transform: uppercase; font-size: .9rem; color: var(--ink); text-decoration: none; }
.masthead nav a { color: var(--muted); text-decoration: none; margin-left: 1rem; font-size: .92rem; }
.masthead nav a[aria-current="page"] { color: var(--ink); font-weight: 600; }
.masthead nav { display: flex; align-items: center; margin-left: auto; }
.gear { margin-left: .9rem; background: transparent; border: 1px solid var(--line); border-radius: 6px; color: var(--muted);
        width: 2rem; height: 2rem; display: inline-grid; place-items: center; cursor: pointer; padding: 0; }
.gear:hover { color: var(--ink); border-color: var(--muted); }

h1 { font-size: 1.6rem; line-height: 1.2; margin: 1.5rem 0 .25rem; }
.gen { color: var(--muted); font-size: .9rem; margin: 0 0 1rem; }
.archived-tag { font-weight: 600; color: var(--warn); }

.stale { background: var(--crit); color: #fff; padding: .75rem 1rem; border-radius: 6px; margin-top: 1rem; }
.play-all { font: inherit; font-weight: 600; background: var(--ink); color: var(--bg); border: 0; border-radius: 6px; padding: .55rem 1rem; cursor: pointer; }

.stories, .timeline { list-style: none; padding: 0; margin: 1.25rem 0; }
.story { display: grid; grid-template-columns: 4.5rem 1fr; gap: 1rem; background: var(--surface); border: 1px solid var(--line);
         border-radius: 8px; padding: 1rem 1.1rem; margin-bottom: .9rem; scroll-margin-top: 4rem; }
.story.playing { outline: 2px solid var(--accent); }
.rail { text-align: center; }
.rank { font-family: var(--mono); color: var(--muted); font-size: .85rem; margin-bottom: .35rem; }
.rank a { color: inherit; }
.score { border-radius: 6px; padding: .35rem 0; color: #fff; font-family: var(--mono); line-height: 1; }
.score .num { font-size: 1.6rem; font-weight: 700; }
.score .den { font-size: .75rem; opacity: .85; }
.sev-low { background: var(--low); } .sev-mid { background: var(--mid); }
.sev-high { background: var(--high); } .sev-crit { background: var(--crit); }
.delta { font-size: .72rem; font-family: var(--mono); margin-top: .35rem; color: var(--muted); }
.delta.up { color: var(--crit); } .delta.down { color: var(--ok); } .delta.new { color: var(--accent); font-weight: 700; }

.story h2 { font-size: 1.15rem; line-height: 1.3; margin: 0 0 .35rem; }
.meta { font-size: .85rem; color: var(--muted); }
.event-link { font-weight: 600; }
.meta2 { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .6rem; margin: .5rem 0 .6rem; font-size: .78rem; }
.verif { font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: .1rem .4rem; border-radius: 4px; border: 1px solid; }
.verif.confirmed { color: var(--ok); } .verif.developing { color: var(--warn); }
.outlets { color: var(--muted); }
.breakdown { display: flex; flex-wrap: wrap; gap: .3rem; list-style: none; padding: 0; margin: 0; }
.breakdown li { font-family: var(--mono); border: 1px solid var(--line); border-radius: 4px; padding: .05rem .35rem; color: var(--muted); }
.breakdown li.f2 { color: var(--ink); border-color: var(--muted); }
.breakdown li.f0 { opacity: .6; }

.story p { margin: .4rem 0; }
.lbl { font-family: var(--mono); font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
       color: var(--muted); margin-right: .35rem; }
.sources { font-size: .88rem; }
.actions { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; margin-top: .6rem; font-size: .9rem; }
.listen { font: inherit; font-size: .85rem; background: transparent; color: var(--ink); border: 1px solid var(--line);
          border-radius: 999px; padding: .3rem .8rem; cursor: pointer; }
.story.playing .listen { border-color: var(--accent); color: var(--accent); }

.crumb { margin: 1.25rem 0 0; font-size: .85rem; color: var(--muted); }
.status { font-weight: 700; }
.status.active { color: var(--ok); } .status.dormant { color: var(--warn); } .status.archived { color: var(--muted); }
.spark { margin: 0; }
.spark svg { width: 100%; height: auto; display: block; }
.spark .line { fill: none; stroke: var(--accent); stroke-width: 2; }
.spark .dot { fill: var(--accent); }
.spark .mid { stroke: var(--line); stroke-dasharray: 3 3; }
.spark .lbl-s { font: 600 10px var(--mono); fill: var(--muted); text-anchor: middle; }
.spark figcaption { font-size: .75rem; color: var(--muted); }

.group { font-size: 1.1rem; margin-top: 1.75rem; }
.group span { color: var(--muted); font-weight: 400; }
table.events { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; font-size: .92rem; }
table.events th, table.events td { text-align: left; padding: .55rem .7rem; border-bottom: 1px solid var(--line); vertical-align: top; }
table.events th { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.pill { display: inline-block; font-family: var(--mono); font-weight: 700; font-size: .8rem; color: #fff; padding: .1rem .4rem; border-radius: 4px; white-space: nowrap; }

.prose { max-width: 680px; }
.foot { color: var(--muted); font-size: .8rem; margin-top: 2rem; padding-bottom: 1rem; }




/* ---------- Preferences dialog ---------- */
.prefs { border: 1px solid var(--line); border-radius: 12px; padding: 0; background: var(--surface); color: var(--ink);
         width: min(440px, calc(100vw - 2rem)); max-height: calc(100vh - 2rem); box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.prefs::backdrop { background: rgba(0,0,0,.45); }
.prefs-body { padding: 1rem 1.2rem 1.1rem; }
.prefs-head { display: flex; align-items: center; justify-content: space-between; }
.prefs h2 { margin: 0; font-size: 1.15rem; }
.prefs .x { background: transparent; border: 0; color: var(--muted); font-size: 1.1rem; cursor: pointer; padding: .25rem .4rem; }
.prefs .hint { color: var(--muted); font-size: .8rem; margin: .15rem 0 .6rem; }
.prefs fieldset { border: 0; padding: 0; margin: 0 0 .9rem; }
.prefs legend { font-family: var(--mono); font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
                color: var(--muted); margin-bottom: .35rem; padding: 0; }
.seg { display: flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg label { flex: 1; position: relative; }
.seg input, .stack input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; text-align: center; padding: .45rem .2rem; font-size: .88rem; cursor: pointer; border-left: 1px solid var(--line); }
.seg label:first-child span { border-left: 0; }
.seg input:checked + span { background: var(--ink); color: var(--bg); font-weight: 600; }
.seg input:focus-visible + span, .stack input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: -2px; }
.sz-s { font-size: .75rem !important; } .sz-m { font-size: .9rem !important; } .sz-l { font-size: 1.05rem !important; } .sz-xl { font-size: 1.2rem !important; }
.stack { display: grid; gap: .35rem; }
.stack .voice { position: relative; display: flex; align-items: center; gap: .5rem; border: 1px solid var(--line); border-radius: 8px;
                padding: .5rem .7rem; cursor: pointer; font-size: .9rem; }
.stack .voice em { margin-left: auto; font-style: normal; font-size: .72rem; color: var(--muted); }
.stack .voice:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); font-weight: 600; }
.check { display: flex; gap: .55rem; align-items: flex-start; font-size: .9rem; cursor: pointer; }
.check input { margin-top: .2rem; accent-color: var(--ink); }
.prefs-foot { display: flex; justify-content: space-between; gap: .75rem; margin-top: 1rem; }
.prefs-foot button { font: inherit; font-size: .9rem; border-radius: 6px; padding: .5rem .9rem; cursor: pointer; }
.prefs-foot .ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.prefs-foot .primary { background: var(--ink); color: var(--bg); border: 0; font-weight: 600; }

/* small bits used at all sizes */
.breakdown .short { display: none; }
.sources .more { color: var(--muted); font-size: .8em; }
.nowrap { white-space: nowrap; }

/* =================== Phones =================== */
@media (max-width: 600px) {
  .wrap { padding: 0 .8rem; }
  body { padding-bottom: calc(4.5rem + env(safe-area-inset-bottom)); }

  /* Masthead: brand + gear on one row, nav as full-width tabs below. Not sticky: the player is. */
  .masthead { position: static; }
  .masthead .wrap { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "brand gear" "nav nav";
                    gap: 0; min-height: 0; padding-top: .55rem; }
  .brand { grid-area: brand; font-size: .85rem; align-self: center; }
  .gear { grid-area: gear; margin-left: 0; width: 2.4rem; height: 2.4rem; }
  .masthead nav { grid-area: nav; margin: .35rem -.8rem 0; display: grid; grid-template-columns: repeat(4, 1fr);
        border-top: 1px solid var(--line); }
  .masthead nav a { margin: 0; text-align: center; padding: .65rem 0; font-size: .9rem; border-bottom: 2px solid transparent; }
  .masthead nav a[aria-current="page"] { border-bottom-color: var(--ink); }

  h1 { font-size: 1.35rem; margin-top: 1.1rem; }
  .gen { font-size: .82rem; }
  .play-all { width: 100%; padding: .75rem 1rem; font-size: 1rem; }

  /* Story cards: full-width text, score moves into a header row */
  .stories, .timeline { margin: 1rem 0; }
  .story { display: block; padding: .9rem .9rem .8rem; margin-bottom: .75rem; border-radius: 10px; }
  .rail { display: flex; align-items: center; gap: .5rem; margin-bottom: .5rem; text-align: left; }
  .rank { order: 3; margin: 0 0 0 auto; font-size: .8rem; }
  .badge-row { display: flex; align-items: center; gap: .5rem; }
  .score { padding: .2rem .5rem; border-radius: 5px; }
  .score .num { font-size: 1.05rem; }
  .score .den { font-size: .7rem; }
  .delta { margin: 0; font-size: .75rem; }
  .story h2 { font-size: 1.1rem; line-height: 1.3; margin-bottom: .3rem; }
  .meta { font-size: .8rem; line-height: 1.45; }
  .meta .event-link { display: block; margin-bottom: .1rem; }
  .meta .event-link + .dot { display: none; }
  .meta2 { gap: .35rem .5rem; margin: .45rem 0 .5rem; font-size: .72rem; }
  .verif { padding: .05rem .35rem; }
  .breakdown { gap: .25rem; flex-basis: 100%; }
  .breakdown li { padding: 0 .3rem; font-size: .7rem; }
  .breakdown .full { display: none; }
  .breakdown .short { display: inline; }
  .story p { margin: .45rem 0; font-size: .97rem; line-height: 1.5; }
  .lbl { display: block; margin: 0 0 .05rem; font-size: .66rem; }
  .sources { font-size: .85rem; }
  .sources .lbl { display: inline; }
  .actions { gap: .6rem; margin-top: .7rem; justify-content: space-between; }
  .listen { min-height: 2.5rem; padding: .4rem 1rem; font-size: .9rem; }
  .actions a { font-size: .88rem; }

  /* Tables become stacked rows */
  main > table.events, main > table.events tbody, main > table.events tr, main > table.events td { display: block; }
  main > table.events thead { display: none; }
  main > table.events tr { display: grid; grid-template-columns: auto 1fr; column-gap: .7rem; row-gap: .15rem;
                    padding: .7rem .8rem; border-bottom: 1px solid var(--line); }
  main > table.events tr:last-child { border-bottom: 0; }
  main > table.events td { border: 0; padding: 0; }
  main > table.events td:first-child { grid-row: span 3; }
  main > table.events td:nth-child(2) { font-weight: 600; line-height: 1.35; }
  main > table.events td[data-label] { grid-column: 2; font-size: .78rem; color: var(--muted); }
  main > table.events td[data-label]::before { content: attr(data-label) ": "; }
  .prose table.events { font-size: .78rem; }
  .prose table.events th, .prose table.events td { padding: .4rem .35rem; }

  .event-head h1 { font-size: 1.3rem; }
  .spark svg { width: 100%; }

  /* Player: bigger targets, title truncates */
}
@media (max-width: 600px) {
  main > table.archive tr { grid-template-columns: 1fr; }
  main > table.archive td:first-child { grid-row: auto; font-weight: 600; }
  main > table.archive td:nth-child(2) { font-weight: 400; font-size: .88rem; }
  main > table.archive td[data-label] { grid-column: 1; }
}

/* ---------- Editions ---------- */
.edition-bar { display: flex; align-items: center; gap: .5rem; margin: .4rem 0 .6rem; }
.editions { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; margin: 0; }
.editions a { padding: .4rem 1rem; font-size: .9rem; color: var(--muted); text-decoration: none; margin: 0;
              border-left: 1px solid var(--line); border-bottom: 0; }
.editions a:first-child { border-left: 0; }
.editions a[aria-current="page"] { background: var(--ink); color: var(--bg); font-weight: 600; }
.ed-step { display: inline-grid; place-items: center; width: 2.1rem; height: 2.1rem; border: 1px solid var(--line);
           border-radius: 8px; color: var(--ink); text-decoration: none; font-size: 1.2rem; line-height: 1; }
.ed-step.off { opacity: .3; pointer-events: none; }
.story .flag { font-family: var(--mono); font-size: .7rem; line-height: 1.4; font-weight: 700; letter-spacing: .04em;
               text-transform: uppercase; margin: 0 0 .35rem; }
.story .flag.fresh { color: var(--accent); }
.story .flag.quiet { color: var(--muted); }
.story.carried { opacity: .82; }
.rank .ed { display: block; font-size: .7rem; }
.eds { display: grid; gap: .35rem; }
.ed-row { display: block; color: var(--ink); text-decoration: none; }
.ed-row:hover .ed-top { text-decoration: underline; }
.ed-name { display: inline-block; min-width: 5.5rem; font-family: var(--mono); font-size: .75rem; color: var(--muted);
           text-transform: uppercase; letter-spacing: .04em; }
@media (max-width: 600px) {
  .edition-bar { margin: .5rem 0 .6rem; }
  .editions { flex: 1; }
  .editions a { flex: 1; text-align: center; padding: .55rem 0; }
  .ed-step { width: 2.6rem; height: 2.6rem; }
  .rank .ed { display: inline; }
  .ed-name { display: block; min-width: 0; margin-bottom: .1rem; }
  main > table.archive td.eds { font-size: .88rem; }
}


/* =================== v8: freshness, sections, rows =================== */
.fresh-line, .catchup { margin: 0 0 .25rem; font-size: .88rem; color: var(--muted); }
.catchup b { color: var(--ink); }
.fresh-line .next { color: var(--ink); }
.stale { background: var(--crit); color: #fff; padding: .7rem 1rem; border-radius: 8px; margin: 1rem 0 0; font-size: .92rem; }
.section-h { font-size: .78rem; font-family: var(--mono); text-transform: uppercase; letter-spacing: .07em; color: var(--muted);
             margin: 1.6rem 0 .5rem; font-weight: 700; }
.section-h span { text-transform: none; letter-spacing: 0; font-family: var(--sans); font-weight: 400; margin-left: .4rem; }
.stories { margin-top: .5rem; }

.stories.rows .story.row { display: block; padding: 0; }
.row details > summary { list-style: none; display: grid; grid-template-columns: auto auto 1fr auto; gap: .65rem; align-items: start;
                         padding: .75rem 1rem; cursor: pointer; }
.row details > summary::-webkit-details-marker { display: none; }
.row-rank { font-family: var(--mono); font-size: .8rem; color: var(--muted); padding-top: .15rem; min-width: 1.6rem; }
.row .pill { margin-top: .05rem; }
.row-text { min-width: 0; }
.row-head { display: block; font-weight: 600; line-height: 1.35; }
.row-sub { display: block; font-size: .8rem; color: var(--muted); margin-top: .1rem; }
.chev { color: var(--muted); transition: transform .15s; padding-top: .1rem; }
.row details[open] .chev { transform: rotate(180deg); }
.row-body { padding: 0 1rem .9rem calc(1rem + 1.6rem + .65rem); }
.row-body .badge-line { margin: .1rem 0 .4rem; }
.row.playing { outline: 2px solid var(--accent); }
.story.carried .row-head { color: var(--muted); }

/* =================== tooltips (factor chips, outlet counts) =================== */
.breakdown { position: relative; }
.meta2 { position: relative; }
.chip, .chip-plain { cursor: help; }
.chip:focus-visible, .chip-plain:focus-visible, .score-wrap:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tip { display: none; position: absolute; left: 0; bottom: calc(100% + 8px); z-index: 30; width: max-content; max-width: min(340px, 100%);
       background: var(--ink); color: var(--bg); font: 400 .8rem/1.45 var(--sans); padding: .55rem .7rem; border-radius: 8px;
       box-shadow: 0 8px 24px rgba(0,0,0,.25); white-space: normal; text-transform: none; letter-spacing: 0; pointer-events: none; }
.tip strong { display: block; font-weight: 700; margin-bottom: .15rem; }
.chip:hover .tip, .chip:focus .tip, .chip-plain:hover .tip, .chip-plain:focus .tip { display: block; }
.meta2 .chip-plain { position: static; }

/* =================== score popover (hover/tap the overall score) =================== */
.score-wrap { position: relative; display: inline-block; border-radius: 6px; }
.score-wrap[tabindex] { cursor: help; }
.score-pop { display: none; position: absolute; top: calc(100% + 8px); left: 0; z-index: 40; width: 300px; text-align: left;
             background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 10px; padding: .7rem .8rem .6rem;
             box-shadow: 0 12px 32px rgba(0,0,0,.22); }
.score-wrap:hover .score-pop, .score-wrap:focus .score-pop, .score-wrap:focus-within .score-pop { display: block; }
.sp-head { font-size: .85rem; margin-bottom: .4rem; }
.sp-head b { font-size: 1.05rem; }
.score-pop table { width: 100%; border-collapse: collapse; font-size: .8rem; }
.score-pop th { text-align: left; font-weight: 600; padding: .25rem .5rem .25rem 0; white-space: nowrap; }
.score-pop td { padding: .25rem 0; vertical-align: middle; }
.score-pop .lvl { color: var(--muted); padding-left: .5rem; line-height: 1.3; }
.score-pop tr.f2 .lvl { color: var(--ink); }
.pips { white-space: nowrap; }
.pips i { display: inline-block; width: .7rem; height: .7rem; border-radius: 50%; border: 1.5px solid var(--muted); margin-right: .2rem; vertical-align: -1px; }
.pips i.on { background: var(--ink); border-color: var(--ink); }
.sp-foot { font-size: .72rem; color: var(--muted); margin-top: .45rem; }
.story, .stories li { overflow: visible; }

/* =================== listen card =================== */
.listen-card { display: flex; gap: 1rem; align-items: center; background: var(--surface); border: 1px solid var(--line);
               border-radius: 12px; padding: .9rem 1rem; margin: 1rem 0 .25rem; }
.listen-card.is-playing { border-color: var(--accent); }
.lc-play { flex: none; width: 3.4rem; height: 3.4rem; border-radius: 50%; border: 0; background: var(--ink); color: var(--bg);
           font-size: 1.25rem; cursor: pointer; display: grid; place-items: center; }
.lc-main { flex: 1; min-width: 0; }
.lc-title { font-weight: 700; margin-bottom: .4rem; }
.lc-modes { display: flex; gap: .35rem; flex-wrap: wrap; }
.lc-modes button { font: inherit; font-size: .85rem; border: 1px solid var(--line); background: transparent; color: var(--ink);
                   border-radius: 999px; padding: .3rem .75rem; cursor: pointer; }
.lc-modes button .d { font-family: var(--mono); font-size: .75rem; color: var(--muted); margin-left: .2rem; }
.lc-modes button.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.lc-modes button.on .d { color: var(--bg); opacity: .8; }
.lc-progress { height: 4px; background: var(--line); border-radius: 2px; margin: .6rem 0 .3rem; overflow: hidden; }
.lc-progress .fill { height: 100%; width: 0; background: var(--accent); }
.lc-status { font-size: .78rem; color: var(--muted); font-family: var(--mono); }

/* =================== player bar =================== */
.player { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; display: flex; align-items: center; gap: .9rem;
          background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -4px 16px rgba(0,0,0,.08);
          padding: .55rem 1rem calc(.55rem + env(safe-area-inset-bottom)); }
.player .np { flex: 1; min-width: 0; font-size: .85rem; }
.np-line { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-pos { font-family: var(--mono); color: var(--muted); }
.scrub-row { display: flex; align-items: center; gap: .5rem; margin-top: .2rem; }
.scrub-row span { font-family: var(--mono); font-size: .72rem; color: var(--muted); min-width: 2.4rem; }
.scrub-row .t-dur { text-align: right; }
.ctrls { display: flex; align-items: center; gap: .35rem; flex: none; }
.ctrls button { font: inherit; background: transparent; color: var(--ink); border: 1px solid var(--line); border-radius: 8px;
                min-width: 2.4rem; height: 2.4rem; cursor: pointer; padding: 0 .4rem; }
.ctrls button.main { background: var(--ink); color: var(--bg); border-color: var(--ink); min-width: 2.8rem; }
.ctrls .skip { font-family: var(--mono); font-size: .78rem; }
.ctrls .skip span { font-size: .95rem; }
.ctrls .rate { font-family: var(--mono); font-size: .8rem; }
.scrub { -webkit-appearance: none; appearance: none; flex: 1; height: 1.4rem; background: transparent; cursor: pointer; --p: 0%; }
.scrub::-webkit-slider-runnable-track { height: 4px; border-radius: 2px;
  background: linear-gradient(to right, var(--accent) var(--p), var(--line) var(--p)); }
.scrub::-moz-range-track { height: 4px; border-radius: 2px; background: var(--line); }
.scrub::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--accent); }
.scrub::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: var(--accent);
  margin-top: -5px; border: 2px solid var(--surface); }
.scrub::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); border: 2px solid var(--surface); }
body.has-player { padding-bottom: 6.5rem; }

/* =================== event page: status card + timeline =================== */
.status-card { display: grid; grid-template-columns: auto 1fr minmax(180px, 280px); gap: 1rem; align-items: center;
               background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 1rem; margin: .8rem 0 1rem; }
.sc-score .score .num { font-size: 1.9rem; }
.sc-trend { font-weight: 800; font-size: 1.1rem; }
.t-escalating, .t-rising { color: var(--crit); }
.t-easing { color: var(--ok); }
.t-steady { color: var(--muted); }
.sc-sub { font-size: .85rem; color: var(--muted); }
.open { margin: .5rem 0 0; font-size: .92rem; }
.open .lbl { color: var(--warn); }
.tl { list-style: none; margin: .5rem 0 1rem; padding: 0 0 0 1.4rem; position: relative; }
.tl::before { content: ""; position: absolute; left: .45rem; top: .4rem; bottom: .4rem; width: 2px; background: var(--line); }
.tl-item { position: relative; margin-bottom: .9rem; }
.tl-dot { position: absolute; left: -1.38rem; top: 1.05rem; width: .95rem; height: .95rem; border-radius: 50%; border: 3px solid var(--bg); }
.tl-card { display: block; padding: .85rem 1rem; }
.tl-when { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; font-size: .82rem; }
.tl-when a { font-weight: 600; color: var(--ink); text-decoration: none; }
.tl-when .delta { margin: 0; }
.tl-card h3 { font-size: 1.05rem; line-height: 1.3; margin: .35rem 0 .3rem; }
.tl-card p { margin: .35rem 0; }
.more-detail { margin-top: .4rem; }
.more-detail summary { cursor: pointer; font-size: .85rem; color: var(--accent); }
.delta.flat { color: var(--muted); }

@media (max-width: 600px) {
  .listen-card { padding: .8rem; gap: .75rem; margin-top: .8rem; }
  .lc-play { width: 3rem; height: 3rem; }
  .lc-modes button { padding: .3rem .6rem; font-size: .8rem; }
  .row details > summary { grid-template-columns: auto 1fr auto; padding: .7rem .85rem; gap: .55rem; }
  .row-rank { display: none; }
  .row-body { padding: 0 .85rem .85rem; }
  .player { flex-direction: column; align-items: stretch; gap: .35rem; padding-left: .7rem; padding-right: .7rem; }
  .ctrls { justify-content: space-between; }
  .ctrls button { min-width: 2.7rem; height: 2.7rem; }
  body.has-player { padding-bottom: 8.5rem; }
  .score-pop { width: min(300px, calc(100vw - 3.5rem)); }
  .tip { max-width: 100%; }
  .status-card { grid-template-columns: auto 1fr; }
  .status-card .spark { grid-column: 1 / -1; }
  .tl { padding-left: 1.1rem; }
  .tl-dot { left: -1.08rem; }
  .tl::before { left: .33rem; }
}

/* =================== v9: unified story list (featured + rows), scope =================== */
.bl { list-style: none; padding: 0; margin: .5rem 0 0; }
.bi { margin-bottom: .7rem; }
.story.bs { display: block; padding: 0; }
.bs > details > summary { list-style: none; display: grid; grid-template-columns: auto auto 1fr auto; gap: .7rem;
                          align-items: start; padding: .8rem 1rem; cursor: pointer; }
.bs > details > summary::-webkit-details-marker { display: none; }
.bs-rank { font-family: var(--mono); font-size: .8rem; color: var(--muted); padding-top: .3rem; min-width: 1.7rem; }
.bs .badge-row { display: flex; flex-direction: column; align-items: center; gap: .25rem; }
.bs .score { padding: .25rem .45rem; border-radius: 6px; }
.bs .score .num { font-size: 1.15rem; }
.bs .score .den { font-size: .68rem; }
.bs .delta { margin: 0; font-size: .68rem; white-space: nowrap; }
.bs-text { min-width: 0; }
.bs-head { display: block; font-weight: 650; line-height: 1.3; font-size: 1.02rem; }
.bs-sub { display: flex; flex-wrap: wrap; gap: .25rem .4rem; align-items: center; font-size: .8rem; color: var(--muted); margin-top: .25rem; }
.tag { display: inline-block; font-size: .7rem; line-height: 1.5; padding: 0 .4rem; border-radius: 999px; border: 1px solid var(--line);
       color: var(--muted); white-space: nowrap; }
.tag.fresh { color: var(--accent); border-color: var(--accent); }
.tag.quiet { font-style: italic; }
.tag.warn { color: var(--warn); border-color: var(--warn); }
.tag.world { color: var(--crit); border-color: var(--crit); }
.dyn:empty { display: none; }
.chev { color: var(--muted); transition: transform .15s; padding-top: .25rem; }
.bs > details[open] .chev { transform: rotate(180deg); }
.bs-body { padding: 0 1rem 1rem calc(1rem + 1.7rem + .7rem); }
.bs-body .flag { margin-top: 0; }
.bs-body .meta { margin-top: 0; }
/* featured: always open, bigger headline, no chevron */
.bs.feat > details > summary { cursor: default; padding-top: 1rem; }
.bs.feat .bs-head { font-size: 1.22rem; line-height: 1.28; }
.bs.feat .score .num { font-size: 1.5rem; }
.bs.feat .chev { display: none; }
.bs.feat > details > summary .ev { display: none; }   /* event name is in the body meta line */
.bs:not(.feat) .bs-body .flag { display: none; }       /* already shown as a tag in the row */
.bs.playing { outline: 2px solid var(--accent); }
.bs.carried .bs-head { color: var(--muted); }

.day-note { margin: .35rem 0 0; font-size: .85rem; color: var(--warn); }
.view-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; margin: .6rem 0 0; padding: .5rem .75rem;
            border: 1px dashed var(--accent); border-radius: 8px; font-size: .85rem; }
.view-bar.is-world { border-color: var(--line); }
.vb-label { flex: 1; min-width: 12rem; }
.vb-toggle { font: inherit; font-size: .82rem; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
             border-radius: 999px; padding: .25rem .75rem; cursor: pointer; }

/* prefs: scope chips */
.prefs .pg { font-size: .95rem; margin: 1.1rem 0 .5rem; padding-top: .8rem; border-top: 1px solid var(--line); }
.prefs .pg:first-of-type { border-top: 0; padding-top: 0; margin-top: .4rem; }
.prefs .lh { text-transform: none; letter-spacing: 0; font-family: var(--sans); font-weight: 400; margin-left: .3rem; }
.chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.ck { position: relative; }
.ck input { position: absolute; opacity: 0; pointer-events: none; }
.ck span { display: inline-block; font-size: .82rem; padding: .3rem .65rem; border: 1px solid var(--line); border-radius: 999px; cursor: pointer; }
.ck input:checked + span { background: var(--ink); color: var(--bg); border-color: var(--ink); font-weight: 600; }
.ck input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }
.prefs { max-height: calc(100vh - 2rem); overflow-y: auto; }

.ed-n { font-size: .75rem; color: var(--muted); margin-left: .3rem; }
.ev-tags { display: inline-flex; flex-wrap: wrap; gap: .25rem; margin-left: .35rem; vertical-align: middle; }

@media (max-width: 600px) {
  .bs > details > summary { grid-template-columns: auto 1fr auto; gap: .6rem; padding: .75rem .8rem; }
  .bs-rank { display: none; }
  .bs-body { padding: 0 .8rem .9rem; }
  .bs.feat .bs-head { font-size: 1.12rem; }
  .bs.feat .score .num { font-size: 1.3rem; }
  .bs-head { font-size: .98rem; }
  .ev-tags { display: flex; margin: .2rem 0 0; }
}
.bs.feat .bs-sub .tag.quiet, .bs.feat .bs-sub .tag.fresh { display: none; }  /* the body flag says it */

/* =================== v10: tone =================== */
.tv .t-c { display: none; }
html[data-tone="c"] .tv .t-n { display: none; }
html[data-tone="c"] .tv .t-c { display: inline; }
.tone-note { margin: .5rem 0 0; font-size: .82rem; color: var(--muted); }
.tone-note b { color: var(--ink); }
.tone-note button { font: inherit; font-size: .78rem; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
                    border-radius: 999px; padding: .1rem .6rem; margin-left: .3rem; cursor: pointer; }
.prefs .fh { font-size: .75rem; color: var(--muted); margin: .35rem 0 0; }
