/* Primary Sources — archival-box blue-grey, iron-gall ink, ochre for editorial context.
   Tokens first; components only ever read tokens, so both themes resolve as a set. */
:root {
  color-scheme: light;
  --ground: #e6ecef;      /* the archival box */
  --surface: #fbfcfc;     /* the sheet */
  --surface-2: #f0f4f5;
  --ink: #121c24;         /* iron-gall blue-black */
  --ink-2: #44535e;
  --muted: #75838c;
  --grid: #dde5e8;
  --axis: #b7c3c9;
  --hair: rgba(18, 28, 36, .12);
  --accent: #1d4e6e;      /* Prussian blue */
  --accent-soft: #d9e7ef;
  --on-accent: #ffffff;
  --ochre: #a36f12;       /* editorial context: events, eras */
  --ochre-soft: #f3e7cd;
  --hand: #f7ecc9;        /* Joseph Smith's own handwriting */
  --mark: #ffe28a;
  --shadow: 0 1px 2px rgba(18, 28, 36, .06), 0 8px 24px rgba(18, 28, 36, .08);
  /* genre slots — validated order, never cycled */
  --g-documents: #2a78d6; --g-legal: #eb6834; --g-administrative: #1baf7a; --g-financial: #eda100;
  --g-revelations: #e87ba4; --g-histories: #008300; --g-journals: #4a3aa7; --g-other: #e34948;
  --seq-lo: #d6e6f7; --seq-hi: #0d366b;
  --serif: "Libre Caslon Text", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --display: "Libre Caslon Display", "Libre Caslon Text", "Iowan Old Style", Georgia, serif;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --ground: #0b1115; --surface: #151d23; --surface-2: #1b262d; --ink: #eef3f5; --ink-2: #b6c3cb;
    --muted: #84939c; --grid: #24313a; --axis: #3a4a55; --hair: rgba(255, 255, 255, .12);
    --accent: #7dbbe0; --accent-soft: #1c3546; --on-accent: #0b1115; --ochre: #ddaa4a; --ochre-soft: #33290f;
    --hand: #3a3116; --mark: #6b5600; --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .45);
    --g-documents: #3987e5; --g-legal: #d95926; --g-administrative: #199e70; --g-financial: #c98500;
    --g-revelations: #d55181; --g-histories: #008300; --g-journals: #9085e9; --g-other: #e66767;
    --seq-lo: #183149; --seq-hi: #a9cdf5;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --ground: #0b1115; --surface: #151d23; --surface-2: #1b262d; --ink: #eef3f5; --ink-2: #b6c3cb;
  --muted: #84939c; --grid: #24313a; --axis: #3a4a55; --hair: rgba(255, 255, 255, .12);
  --accent: #7dbbe0; --accent-soft: #1c3546; --on-accent: #0b1115; --ochre: #ddaa4a; --ochre-soft: #33290f;
  --hand: #3a3116; --mark: #6b5600; --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .45);
  --g-documents: #3987e5; --g-legal: #d95926; --g-administrative: #199e70; --g-financial: #c98500;
  --g-revelations: #d55181; --g-histories: #008300; --g-journals: #9085e9; --g-other: #e66767;
  --seq-lo: #183149; --seq-hi: #a9cdf5;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { background: var(--ground); color: var(--ink); font: 15px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
h1, h2, h3 { margin: 0; text-wrap: balance; font-weight: 400; }
h1 { font: 400 clamp(30px, 4vw, 46px)/1.08 var(--display); letter-spacing: -.01em; }
h2 { font: 400 25px/1.2 var(--display); }
h3 { font: 600 12px/1.3 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
p { margin: 0; }
.lede { font: 400 17px/1.55 var(--serif); color: var(--ink-2); max-width: 64ch; }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------ shell */
.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.rail { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 22px; padding: 22px 16px;
  background: var(--surface); border-right: 1px solid var(--hair); }
.brand { display: flex; gap: 10px; align-items: center; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-mark { font: 400 34px/1 var(--display); color: var(--accent); width: 34px; text-align: center; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-weight: 600; font-size: 14px; letter-spacing: .02em; }
.brand-text small { color: var(--muted); font-size: 12px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { padding: 8px 10px; border-radius: 6px; color: var(--ink-2); font-weight: 500; }
.nav a:hover { background: var(--surface-2); text-decoration: none; color: var(--ink); }
.nav a.on { background: var(--accent-soft); color: var(--ink); box-shadow: inset 3px 0 0 var(--accent); }
.rail-search input, .field { width: 100%; padding: 8px 10px; border: 1px solid var(--hair); border-radius: 6px;
  background: var(--surface-2); }
.rail-foot { margin-top: auto; display: flex; flex-direction: column; gap: 12px; font-size: 12px; color: var(--ink-2); }
.meter { height: 6px; border-radius: 3px; background: var(--accent-soft); overflow: hidden; margin: 6px 0 4px; }
.meter > i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.ghost { background: none; border: 1px solid var(--hair); border-radius: 6px; padding: 6px 10px; cursor: pointer; color: var(--ink-2); }
.ghost:hover { background: var(--surface-2); color: var(--ink); }
main { padding: 34px clamp(16px, 3.4vw, 48px) 80px; display: flex; flex-direction: column; gap: 30px; min-width: 0; outline: none; }
.view-head { display: flex; flex-direction: column; gap: 10px; }
.eyebrow { font: 600 12px/1 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--ochre); }

@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .rail { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 12px 16px;
    border-right: 0; border-bottom: 1px solid var(--hair); }
  .nav { flex-direction: row; overflow-x: auto; max-width: 100%; }
  .nav a { white-space: nowrap; }
  .nav a.on { box-shadow: inset 0 -3px 0 var(--accent); }
  .rail-search { flex: 1 1 180px; }
  .rail-foot { margin: 0; flex-direction: row; align-items: center; flex: 1 1 100%; justify-content: space-between; }
  .coverage { flex: 1; max-width: 300px; }
}

/* ------------------------------------------------------------ panels & figures */
.panel { background: var(--surface); border: 1px solid var(--hair); border-radius: 10px; padding: 22px 24px;
  display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.panel-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; }
.panel-head p { color: var(--ink-2); font-size: 14px; max-width: 70ch; }
.cols { display: grid; gap: 22px; align-items: start; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); }
.hero { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 28px; align-items: end; }
@media (max-width: 1000px) { .hero { grid-template-columns: minmax(0, 1fr); } }
.hero-figure { font: 600 clamp(48px, 7vw, 84px)/1 var(--sans); letter-spacing: -.03em; }
.hero-figure small { display: block; font: 400 15px/1.4 var(--sans); letter-spacing: 0; color: var(--ink-2); margin-top: 8px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 0; border-top: 1px solid var(--hair); }
.stat { padding: 14px 14px 4px 0; display: flex; flex-direction: column; gap: 2px; }
.stat b { font: 600 24px/1.1 var(--sans); }
.stat span { font-size: 12.5px; color: var(--ink-2); }

.legend { display: flex; flex-wrap: wrap; gap: 6px 8px; }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--hair);
  background: var(--surface); font-size: 13px; color: var(--ink-2); cursor: pointer; line-height: 1.3; }
.chip:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.chip.off { opacity: .45; }
.chip.on { background: var(--accent-soft); color: var(--ink); border-color: transparent; }
.chip i, .key { width: 10px; height: 10px; border-radius: 3px; flex: none; display: inline-block; }
.chip .n { color: var(--muted); font-variant-numeric: tabular-nums; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-2); white-space: nowrap; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.toolbar select, .toolbar input[type="search"], .toolbar input[type="text"] { padding: 7px 10px; border: 1px solid var(--hair);
  border-radius: 6px; background: var(--surface); }
.seg { display: inline-flex; border: 1px solid var(--hair); border-radius: 6px; overflow: hidden; }
.seg button { border: 0; background: var(--surface); padding: 6px 12px; cursor: pointer; color: var(--ink-2); }
.seg button + button { border-left: 1px solid var(--hair); }
.seg button.on { background: var(--accent); color: var(--on-accent); }

svg text { font-family: var(--sans); fill: var(--muted); font-size: 11.5px; }
svg .lbl { fill: var(--ink-2); }
svg .strong { fill: var(--ink); font-weight: 600; }
.chart { position: relative; width: 100%; }
.chart svg, .chart canvas { display: block; width: 100%; }
.chart.wide { overflow-x: auto; }
.chart.wide svg { min-width: 760px; }
.tablewrap { overflow-x: auto; max-height: 420px; overflow-y: auto; border-top: 1px solid var(--hair); }
table.data { border-collapse: collapse; width: 100%; font-size: 13px; font-variant-numeric: tabular-nums; }
table.data th, table.data td { padding: 5px 10px; text-align: right; border-bottom: 1px solid var(--grid); white-space: nowrap; }
table.data th:first-child, table.data td:first-child { text-align: left; }
table.data th { position: sticky; top: 0; background: var(--surface); color: var(--ink-2); font-weight: 600; }

.tip { position: fixed; z-index: 50; pointer-events: none; background: var(--ink); color: var(--surface); padding: 9px 11px;
  border-radius: 7px; font-size: 12.5px; line-height: 1.4; max-width: 320px; box-shadow: var(--shadow); }
.tip b { font-weight: 600; }
.tip .t-head { display: block; opacity: .75; margin-bottom: 4px; }
.tip .t-row { display: flex; justify-content: space-between; gap: 14px; align-items: center; }
.tip .t-row span { display: inline-flex; align-items: center; gap: 6px; opacity: .85; }
.tip .t-key { width: 10px; height: 3px; border-radius: 2px; display: inline-block; }

/* horizontal bar lists */
.bars { display: flex; flex-direction: column; gap: 7px; }
.bar-row { display: grid; grid-template-columns: minmax(110px, 50%) minmax(0, 1fr) auto; gap: 10px; align-items: center;
  font-size: 13.5px; padding: 1px 0; color: var(--ink); background: none; border: 0; text-align: left; cursor: pointer; width: 100%; }
.bar-row:hover .bar-name { color: var(--accent); }
.bar-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 10px; }
.bar-fill { height: 10px; border-radius: 0 4px 4px 0; background: var(--accent); min-width: 2px; }
.bar-val { color: var(--ink-2); font-variant-numeric: tabular-nums; font-size: 12.5px; min-width: 3ch; text-align: right; }

/* landmark cards */
.landmarks { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 0; border-top: 1px solid var(--hair); }
.landmark { padding: 14px 18px 16px 0; border-bottom: 1px solid var(--grid); display: flex; flex-direction: column; gap: 5px; color: var(--ink); }
.landmark strong { font: 400 17px/1.25 var(--serif); }
.landmark span { font-size: 13px; color: var(--ink-2); }
.landmark .pill { white-space: normal; align-items: baseline; }
.landmark.missing { opacity: .5; }
a.landmark:hover { text-decoration: none; }
a.landmark:hover strong { color: var(--accent); }

/* ------------------------------------------------------------ timeline */
.tl-wrap { position: relative; border: 1px solid var(--hair); border-radius: 10px; background: var(--surface); overflow: hidden; }
.tl-wrap canvas { display: block; width: 100%; cursor: grab; touch-action: none; }
.tl-wrap canvas.grabbing { cursor: grabbing; }
.tl-hint { position: absolute; right: 12px; bottom: 8px; font-size: 12px; color: var(--muted); pointer-events: none; }
.digest { display: grid; gap: 22px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); }
.digest h3 { margin-bottom: 8px; }
.event-list { display: flex; flex-direction: column; gap: 8px; font-size: 13.5px; }
.event-list li, ul.plain li { list-style: none; }
ul.plain, .event-list { margin: 0; padding: 0; }
.event-list time { color: var(--ochre); font-weight: 600; font-variant-numeric: tabular-nums; margin-right: 6px; white-space: nowrap; }
.doc-mini { display: flex; flex-direction: column; gap: 8px; font-size: 13.5px; }
.doc-mini a { color: var(--ink); display: block; }
.doc-mini small { color: var(--muted); display: block; }

/* ------------------------------------------------------------ library */
.results { display: flex; flex-direction: column; }
.result { display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--grid);
  color: var(--ink); align-items: start; }
.result:hover { text-decoration: none; }
.result:hover .r-title { color: var(--accent); }
.r-thumb { width: 46px; height: 60px; object-fit: cover; border-radius: 3px; background: var(--surface-2); border: 1px solid var(--hair); }
.r-title { font: 400 17px/1.3 var(--serif); }
.r-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; color: var(--ink-2); margin-top: 3px; }
.r-snip { font: 400 14.5px/1.5 var(--serif); color: var(--ink-2); margin-top: 6px; }
mark { background: var(--mark); color: inherit; border-radius: 2px; padding: 0 1px; }
.r-side { font-size: 12.5px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------ reader */
.reader-head { display: flex; flex-direction: column; gap: 8px; }
.reader-head h1 { font-size: clamp(24px, 3vw, 36px); }
.reader-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 22px; align-items: start; }
.reader-grid.noscan { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 1100px) { .reader-grid { grid-template-columns: minmax(0, 1fr); } }
.scan { position: sticky; top: 16px; background: var(--surface-2); border: 1px solid var(--hair); border-radius: 8px; overflow: hidden; }
.scan img { display: block; width: 100%; max-height: 86vh; object-fit: contain; background: #2a2622; }
.scan figcaption { font-size: 11.5px; color: var(--muted); padding: 8px 10px; }
@media (max-width: 1100px) { .scan { position: static; } }
.pager { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pager select { padding: 6px 8px; border-radius: 6px; border: 1px solid var(--hair); background: var(--surface); }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--hair); flex-wrap: wrap; }
.tabs button { border: 0; background: none; padding: 9px 14px; cursor: pointer; color: var(--ink-2); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button.on { color: var(--ink); border-bottom-color: var(--accent); }
.prose { font: 400 17px/1.7 var(--serif); max-width: 66ch; overflow-wrap: anywhere; }
.prose .wasptag, .prose p { margin: 0 0 .5em; }
.prose .indent { text-indent: 1.6em; }
.prose .hangindent { padding-left: 1.6em; text-indent: -1.6em; }
.prose .center { text-align: center; } .prose .right { text-align: right; }
.prose .italic { font-style: italic; } .prose .bold { font-weight: 700; }
.prose .underscore { text-decoration: underline; text-underline-offset: 3px; }
.prose .small-caps, .prose .smallcaps { font-variant: small-caps; }
.prose .editorial-comment, .prose .note-data { color: var(--muted); }
.prose .josephswriting { background: var(--hand); border-radius: 2px; padding: 0 2px; font-weight: 700; }
.prose .hide-this, .prose input { display: none; }
.prose hr, .prose .journal-entry-divider { border: 0; border-top: 1px solid var(--hair); margin: 1.2em 0; }
.prose table { border-collapse: collapse; font: 400 14px/1.4 var(--sans); display: block; overflow-x: auto; max-width: 100%; }
.prose td { padding: 3px 10px 3px 0; vertical-align: top; border-bottom: 1px solid var(--grid); }
.prose img { max-width: 100%; height: auto; }
.prose aside.popup-wrapper { display: inline; position: relative; }
.prose aside > a { color: var(--accent); text-decoration: underline; text-decoration-color: var(--axis); text-underline-offset: 3px; cursor: pointer; }
.prose aside > a.editorial-note-static, .prose aside > a.new-scribe-note { text-decoration: none; font: 600 11px/1 var(--sans); vertical-align: super;
  background: var(--ochre-soft); color: var(--ochre); border-radius: 3px; padding: 1px 4px; }
.prose .popup-content { display: none; }
.prose aside.open > .popup-content { display: block; position: absolute; z-index: 20; left: 0; top: 1.7em; width: min(24em, 80vw); text-indent: 0;
  background: var(--surface); border: 1px solid var(--hair); box-shadow: var(--shadow); border-radius: 8px; padding: 10px 12px;
  font: 400 13.5px/1.5 var(--sans); color: var(--ink-2); text-align: left; font-style: normal; font-weight: 400; }
.footnotes { font: 400 14px/1.55 var(--serif); color: var(--ink-2); border-top: 1px solid var(--hair); padding-top: 12px; max-width: 66ch;
  display: flex; flex-direction: column; gap: 6px; }
.footnotes div { display: grid; grid-template-columns: 2.2em minmax(0, 1fr); }
.hand-key { font-size: 12.5px; color: var(--ink-2); }
.hand-key span { background: var(--hand); font-weight: 700; padding: 0 4px; border-radius: 2px; font-family: var(--serif); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }

/* ------------------------------------------------------------ drawer */
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 100vw); background: var(--surface); border-left: 1px solid var(--hair);
  box-shadow: var(--shadow); z-index: 40; overflow-y: auto; padding: 22px 22px 40px; display: flex; flex-direction: column; gap: 18px; }
.drawer h2 { font-size: 27px; }
.drawer .close { position: sticky; top: 0; align-self: flex-end; }
.drawer .blurb { font: 400 15.5px/1.6 var(--serif); color: var(--ink-2); }

/* ------------------------------------------------------------ stories (controversies, facts) */
.stories { display: flex; flex-direction: column; }
.story { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 8px 32px; padding: 30px 0; border-top: 1px solid var(--hair); scroll-margin-top: 16px; }
.story:last-child { border-bottom: 1px solid var(--hair); }
.story-when { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--ink-2); padding-top: 6px; }
.story-when b { font: 600 15px/1.3 var(--sans); color: var(--ochre); font-variant-numeric: tabular-nums; }
.story-when a { margin-top: 6px; }
.story-body { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.story-body h2 { font-size: 28px; }
.story-summary { font: 400 18px/1.6 var(--serif); max-width: 68ch; }
.story-sides { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 18px 32px; max-width: 1000px; }
.story-sides h3, .story-sources h3 { margin-bottom: 6px; }
.story-sides p { font: 400 15.5px/1.6 var(--serif); color: var(--ink-2); }
.story-sources ol { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 330px), 1fr)); gap: 0 32px; max-width: 1000px; }
.story-sources li { padding: 9px 0; border-top: 1px solid var(--grid); display: flex; flex-direction: column; gap: 2px; }
.story-sources li a { font: 400 16px/1.35 var(--serif); }
.story-sources li span { font-size: 12.5px; color: var(--ink-2); }
.story-sources .key { vertical-align: baseline; margin: 0 1px 0 2px; }
.teasers { display: flex; flex-direction: column; }
.teasers li { padding: 8px 0; border-top: 1px solid var(--grid); font: 400 16.5px/1.35 var(--serif); }
.teasers li .muted { font: 400 12.5px/1 var(--sans); }
@media (max-width: 760px) { .story { grid-template-columns: minmax(0, 1fr); } .story-when { flex-direction: row; flex-wrap: wrap; gap: 4px 14px; align-items: baseline; } .story-when a { margin: 0; } }

/* ------------------------------------------------------------ insights */
.nav-head { font: 700 12.5px/1 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--ochre);
  margin-top: 14px; padding: 12px 10px 7px; border-top: 1px solid var(--hair); }
.nav-head:first-child { margin-top: 0; border-top: 0; padding-top: 4px; }
.nav-head::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--ochre); margin-right: 8px; vertical-align: 1px; }
.rail { overflow-y: auto; }
.insights { display: flex; flex-direction: column; gap: 12px; }
.insights-head { display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: baseline; }
.insights-head h3 { color: var(--ochre); }
.insight-grid { columns: 3 330px; column-gap: 16px; }
.insight { background: var(--ochre-soft); border-radius: 10px; padding: 18px 20px; display: flex; flex-direction: column; gap: 10px; min-width: 0; break-inside: avoid; margin-bottom: 16px; }
.insight h4 { margin: 0; font: 400 21px/1.25 var(--display); text-wrap: balance; }
.insight p { font: 400 15px/1.6 var(--serif); color: var(--ink-2); }
.insight .bar-fill { background: var(--ochre) !important; }
.insight .bar-row { cursor: default; font-size: 13px; }
.insight .bar-row:hover .bar-name { color: inherit; }
.circle-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; font-size: 12.5px; }
.circle-cols ol { margin: 4px 0 0; padding-left: 18px; color: var(--ink-2); }
.mix { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; }
.mix-row { display: grid; grid-template-columns: 150px minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.mix-bar { display: flex; gap: 2px; height: 12px; } .mix-bar i { display: block; min-width: 1px; border-radius: 2px; }
@media (max-width: 860px) { .nav-head { display: none; } }

/* ------------------------------------------------------------ threads */
.gantt-row text { font-size: 11.5px; }
.day-year { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 6px 24px; padding: 18px 0; border-top: 1px solid var(--hair); }
.day-year > b { font: 600 22px/1.2 var(--sans); color: var(--ochre); font-variant-numeric: tabular-nums; }
.day-year small { display: block; font: 400 12px/1.3 var(--sans); color: var(--ink-2); }
.datebar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.datebar select { padding: 7px 10px; border: 1px solid var(--hair); border-radius: 6px; background: var(--surface); }
.versions { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; }
.versions a { font-size: 12px; padding: 2px 8px; border: 1px solid var(--hair); border-radius: 999px; color: var(--ink-2); }
.rev-row { padding: 10px 0; border-top: 1px solid var(--grid); display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 4px 16px; }
.rev-row .dc { font: 600 13px/1.5 var(--sans); color: var(--ochre); }
.tour { background: var(--accent-soft); border-radius: 10px; padding: 18px 22px; display: flex; flex-direction: column; gap: 10px; }
.tour h2 { font-size: 24px; } .tour p { font: 400 16.5px/1.6 var(--serif); max-width: 78ch; }
.tour .pager { justify-content: space-between; }

/* ------------------------------------------------------------ guide, record, who's who, world */
.dates { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; }
.dates li { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 4px 20px; padding: 10px 0; border-top: 1px solid var(--grid); font: 400 16px/1.5 var(--serif); }
.dates b { font: 600 14px/1.5 var(--sans); color: var(--ochre); }
.prose-cols { columns: 2 320px; column-gap: 32px; font: 400 16px/1.6 var(--serif); }
.prose-cols p { margin: 0 0 1em; break-inside: avoid; }
dl.marks { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 8px 22px; margin: 0; font-size: 14.5px; }
dl.marks dt { color: var(--ink); } dl.marks dd { margin: 0; color: var(--ink-2); font-family: var(--serif); font-size: 15.5px; }
dl.marks code { font: 500 13px/1.4 "IBM Plex Mono", ui-monospace, monospace; background: var(--surface-2); padding: 2px 6px; border-radius: 4px; }
.badge { display: inline-block; font: 600 12px/1.3 var(--sans); background: var(--accent-soft); color: var(--ink); padding: 3px 9px; border-radius: 999px; }
.first-reads { margin: 0; padding-left: 24px; display: flex; flex-direction: column; gap: 10px; }
.first-reads li { font: 400 16.5px/1.4 var(--serif); } .first-reads li a { display: block; } .first-reads li span { display: block; font: 400 13px/1.4 var(--sans); color: var(--ink-2); }
.role-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 18px 28px; }
.role h3 { margin-bottom: 8px; }
.family { display: flex; flex-direction: column; gap: 12px; } .fam-row h3 { margin-bottom: 6px; } .chip.off { opacity: .5; cursor: default; }
.arc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.arc { display: flex; flex-direction: column; gap: 2px; background: var(--surface-2); border: 1px solid var(--hair); border-radius: 8px; padding: 10px 12px; text-align: left; cursor: pointer; color: var(--ink); }
.arc:hover { border-color: var(--accent); } .arc b { font-weight: 600; font-size: 13.5px; } .arc small { color: var(--ink-2); font-size: 12px; } .arc svg { width: 100%; margin-top: 4px; }
.two-lane li { padding-left: 14px; border-left: 3px solid var(--ochre); } .two-lane li.nation { border-left-color: var(--axis); } .two-lane li.nation time { color: var(--muted); }
.sites { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 18px 28px; }
.site { display: flex; flex-direction: column; gap: 6px; font: 400 14.5px/1.55 var(--serif); color: var(--ink-2); }
.site h3 { color: var(--ink); text-transform: none; letter-spacing: 0; font: 400 20px/1.2 var(--display); } .site b { color: var(--ink); font-weight: 700; }
.journey { display: flex; flex-direction: column; gap: 10px; }

/* ------------------------------------------------------------ misc */
.split { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 22px; align-items: start; }
@media (max-width: 1100px) { .split { grid-template-columns: minmax(0, 1fr); } }
.list-scroll { max-height: 640px; overflow-y: auto; padding-right: 6px; }
.note { font-size: 12.5px; color: var(--muted); max-width: 80ch; }
.empty { padding: 40px 0; color: var(--ink-2); font: 400 17px/1.5 var(--serif); }
.more { align-self: flex-start; }
.slider { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.slider input[type="range"] { flex: 1 1 260px; accent-color: var(--accent); }
.slider output { font: 600 28px/1 var(--sans); min-width: 4.5ch; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
