:root {
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.75vw, 1.5rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);
  --text-2xl: clamp(2rem, 1.2rem + 2.5vw, 3.5rem);
  --text-3xl: clamp(2.5rem, 1rem + 4vw, 5rem);
  --space-1: .25rem; --space-2: .5rem; --space-3: .75rem; --space-4: 1rem; --space-5: 1.25rem; --space-6: 1.5rem;
  --space-8: 2rem; --space-10: 2.5rem; --space-12: 3rem; --space-16: 4rem; --space-20: 5rem; --space-24: 6rem;
  --radius-sm: 4px; --radius-md: 8px; --radius-lg: 14px;
  --font-display: 'Zodiak', 'Source Serif 4', Georgia, serif;
  --font-read: 'Source Serif 4', Georgia, serif;
  --font-ui: 'Satoshi', 'Inter', system-ui, sans-serif;
  --content: 1180px;
  --ease: cubic-bezier(.2,.7,.2,1);
}
:root, [data-theme='light'] {
  --bg: #f3ede1; --surface: #faf6ee; --surface-2: #efe7d8; --surface-3: #e6dcc9;
  --border: oklch(0.35 0.03 70 / 0.16); --divider: oklch(0.35 0.03 70 / 0.10);
  --text: #231c13; --muted: #685d4c; --faint: #9a8e7a; --inverse: #faf6ee;
  --accent: #9b2a1a; --accent-hover: #7f2113; --accent-soft: oklch(0.55 0.15 35 / 0.10);
  --gold: #8a6414;
  --b1: #a8741c; --b2: #33508a; --b3: #3f7a5c; --b4: #a24a3f; --b5: #5d6878;
  --restored: oklch(0.80 0.10 85 / 0.32); --restored-line: #b38a2a;
  --shadow: 0 1px 2px oklch(0.3 0.04 60 / .06), 0 8px 24px oklch(0.3 0.04 60 / .07);
}
[data-theme='dark'] {
  --bg: #13100c; --surface: #1b1712; --surface-2: #231e17; --surface-3: #2d261d;
  --border: oklch(0.9 0.03 80 / 0.12); --divider: oklch(0.9 0.03 80 / 0.07);
  --text: #ece3d1; --muted: #ab9f89; --faint: #7a6f5d; --inverse: #13100c;
  --accent: #e0805a; --accent-hover: #ec9877; --accent-soft: oklch(0.7 0.13 40 / 0.14);
  --gold: #d8b25c;
  --b1: #d6a24a; --b2: #7f9ad6; --b3: #74b18f; --b4: #e08a7d; --b5: #9fabbd;
  --restored: oklch(0.65 0.10 85 / 0.18); --restored-line: #d8b25c;
  --shadow: 0 1px 2px #0006, 0 8px 24px #0005;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #13100c; --surface: #1b1712; --surface-2: #231e17; --surface-3: #2d261d;
    --border: oklch(0.9 0.03 80 / 0.12); --divider: oklch(0.9 0.03 80 / 0.07);
    --text: #ece3d1; --muted: #ab9f89; --faint: #7a6f5d; --inverse: #13100c;
    --accent: #e0805a; --accent-hover: #ec9877; --accent-soft: oklch(0.7 0.13 40 / 0.14);
    --gold: #d8b25c;
    --b1: #d6a24a; --b2: #7f9ad6; --b3: #74b18f; --b4: #e08a7d; --b5: #9fabbd;
    --restored: oklch(0.65 0.10 85 / 0.18); --restored-line: #d8b25c;
    --shadow: 0 1px 2px #0006, 0 8px 24px #0005;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font-ui); font-size: var(--text-base); line-height: 1.6; -webkit-font-smoothing: antialiased; transition: background .3s var(--ease), color .3s var(--ease); }
img { max-width: 100%; display: block; }
a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-hover); }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
h1, h2, h3, h4 { margin: 0; line-height: 1.15; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
.muted { color: var(--muted); }
.skip { position: absolute; left: -999px; top: 0; background: var(--accent); color: var(--inverse); padding: var(--space-2) var(--space-4); z-index: 100; }
.skip:focus { left: var(--space-4); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* Header */
.site-header { position: sticky; top: 0; z-index: 40; background: color-mix(in oklab, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--divider); }
.header-inner { max-width: var(--content); margin: 0 auto; padding: var(--space-3) var(--space-6); display: flex; align-items: center; gap: var(--space-6); }
.brand { display: flex; align-items: center; gap: var(--space-3); color: var(--text); text-decoration: none; margin-right: auto; }
.logo { width: 34px; height: 34px; }
.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-1 { font-family: var(--font-display); font-size: 1.2rem; font-weight: 500; letter-spacing: .01em; }
.brand-2 { font-size: var(--text-xs); text-transform: uppercase; letter-spacing: .22em; color: var(--accent); margin-top: 3px; font-weight: 700; }
.main-nav { display: flex; gap: var(--space-1); }
.main-nav a { color: var(--muted); text-decoration: none; font-size: var(--text-sm); font-weight: 500; padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm); min-height: 40px; display: inline-flex; align-items: center; }
.main-nav a:hover { color: var(--text); background: var(--surface-2); }
.main-nav a[aria-current='page'] { color: var(--text); background: var(--surface-2); box-shadow: inset 0 -2px 0 var(--accent); }
.icon-btn { background: none; border: 1px solid var(--border); border-radius: var(--radius-md); width: 42px; height: 42px; display: inline-grid; place-items: center; cursor: pointer; color: var(--muted); }
.icon-btn:hover { color: var(--text); background: var(--surface-2); }
.nav-toggle { display: none; }
@media (max-width: 960px) {
  .nav-toggle { display: inline-grid; }
  .main-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; background: var(--bg); border-bottom: 1px solid var(--border); padding: var(--space-3) var(--space-6) var(--space-6); }
  .main-nav.open { display: flex; }
  .main-nav a { min-height: 44px; }
}

main { min-height: 70vh; outline: none; }
.wrap { max-width: var(--content); margin: 0 auto; padding: 0 var(--space-6); }
.page-head { padding: clamp(var(--space-10), 6vw, var(--space-16)) 0 var(--space-8); }
.eyebrow { font-size: var(--text-xs); text-transform: uppercase; letter-spacing: .18em; color: var(--accent); font-weight: 700; margin-bottom: var(--space-3); }
.page-title { font-family: var(--font-display); font-weight: 500; font-size: var(--text-2xl); letter-spacing: -.01em; }
.lede { font-family: var(--font-read); font-size: var(--text-lg); color: var(--muted); max-width: 62ch; margin-top: var(--space-4); line-height: 1.5; }
.section { padding-block: clamp(var(--space-8), 5vw, var(--space-16)); }
.section + .section { border-top: 1px solid var(--divider); }
.h2 { font-family: var(--font-display); font-weight: 500; font-size: var(--text-xl); margin-bottom: var(--space-4); }
.h3 { font-family: var(--font-ui); font-weight: 700; font-size: var(--text-lg); }
.prose { font-family: var(--font-read); max-width: 68ch; }
.prose p + p { margin-top: var(--space-4); }

/* Hero */
.hero { position: relative; min-height: min(82vh, 760px); display: grid; align-items: end; overflow: hidden; background: #0d0b14; }
.hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 60% 40%; }
.hero::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(8,7,14,.86) 0%, rgba(8,7,14,.6) 42%, rgba(8,7,14,.05) 75%), linear-gradient(0deg, rgba(8,7,14,.7) 0%, transparent 40%); }
.hero-inner { position: relative; z-index: 2; max-width: var(--content); width: 100%; margin: 0 auto; padding: var(--space-16) var(--space-6) var(--space-12); color: #f4ecdc; }
.hero h1 { font-family: var(--font-display); font-weight: 500; font-size: var(--text-3xl); line-height: 1.02; letter-spacing: -.02em; max-width: 13ch; }
.hero h1 em { font-style: italic; color: #f0a37f; }
.hero p { font-family: var(--font-read); font-size: var(--text-lg); max-width: 50ch; margin-top: var(--space-5); color: #e3d8c3; line-height: 1.5; }
.hero .eyebrow { color: #f0a37f; }
.cta-row { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-8); }
.btn { display: inline-flex; align-items: center; gap: var(--space-2); min-height: 44px; padding: 0 var(--space-5); border-radius: var(--radius-md); font-weight: 600; font-size: var(--text-sm); text-decoration: none; border: 1px solid transparent; cursor: pointer; transition: background .2s var(--ease), color .2s var(--ease); }
.btn-primary { background: var(--accent); color: #fff8f0; }
.btn-primary:hover { background: var(--accent-hover); color: #fff; }
.hero .btn-primary { background: #c4472c; }
.hero .btn-primary:hover { background: #d9573a; }
.btn-ghost { border-color: var(--border); color: var(--text); background: var(--surface); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.hero .btn-ghost { background: rgba(255,255,255,.06); color: #f4ecdc; border-color: rgba(255,255,255,.25); }
.hero .btn-ghost:hover { background: rgba(255,255,255,.14); }
.credit { position: absolute; right: var(--space-4); bottom: var(--space-3); z-index: 2; font-size: var(--text-xs); color: rgba(255,255,255,.55); }

/* Strip */
.strip-wrap { margin-top: var(--space-6); }
.strip { display: grid; grid-template-columns: repeat(108, 1fr); gap: 2px; height: 64px; }
.strip a { display: block; border-radius: 2px; opacity: .85; transition: transform .15s var(--ease), opacity .15s; position: relative; }
.strip a:hover, .strip a:focus-visible { opacity: 1; transform: scaleY(1.18); }
.strip-legend { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5); margin-top: var(--space-4); font-size: var(--text-sm); color: var(--muted); }
.strip-legend span { display: inline-flex; align-items: center; gap: var(--space-2); }
.dot { width: 10px; height: 10px; border-radius: 2px; display: inline-block; flex: none; }
.bg-b1 { background: var(--b1); } .bg-b2 { background: var(--b2); } .bg-b3 { background: var(--b3); } .bg-b4 { background: var(--b4); } .bg-b5 { background: var(--b5); }
.c-b1 { color: var(--b1); } .c-b2 { color: var(--b2); } .c-b3 { color: var(--b3); } .c-b4 { color: var(--b4); } .c-b5 { color: var(--b5); }
.strip-scale { display: flex; justify-content: space-between; font-size: var(--text-xs); color: var(--faint); margin-top: var(--space-2); font-variant-numeric: tabular-nums; }

/* Facts */
.facts { display: grid; grid-template-columns: repeat(5, 1fr); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.fact { padding: var(--space-6) var(--space-4); }
.fact + .fact { border-left: 1px solid var(--divider); }
.fact b { display: block; font-family: var(--font-display); font-size: var(--text-2xl); font-weight: 500; line-height: 1; font-variant-numeric: tabular-nums; }
.fact span { display: block; font-size: var(--text-sm); color: var(--muted); margin-top: var(--space-2); }
@media (max-width: 760px) { .facts { grid-template-columns: repeat(2, 1fr); } .fact:nth-child(odd) { border-left: none; } .fact { border-top: 1px solid var(--divider); } }

.two-col { display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(var(--space-8), 5vw, var(--space-16)); align-items: start; }
@media (max-width: 860px) { .two-col { grid-template-columns: 1fr; } }

.solves { list-style: none; padding: 0; margin: 0; counter-reset: s; }
.solves li { counter-increment: s; display: grid; grid-template-columns: 3rem 1fr; gap: var(--space-4); padding: var(--space-5) 0; border-top: 1px solid var(--divider); }
.solves li::before { content: counter(s, upper-roman); font-family: var(--font-display); font-size: var(--text-lg); color: var(--accent); }
.solves h3 { font-size: var(--text-base); font-weight: 700; margin-bottom: var(--space-1); }
.solves p { color: var(--muted); font-size: var(--text-sm); }
.solves a { font-weight: 600; font-size: var(--text-sm); }

.context-list { display: grid; gap: 0; }
.context-list div { display: grid; grid-template-columns: 9rem 1fr; gap: var(--space-4); padding: var(--space-4) 0; border-top: 1px solid var(--divider); font-size: var(--text-sm); }
.context-list dt { font-weight: 700; }
.context-list dd { margin: 0; color: var(--muted); }
@media (max-width: 560px) { .context-list div { grid-template-columns: 1fr; gap: var(--space-1); } }

/* Story */
.book { display: grid; grid-template-columns: 15rem 1fr; gap: clamp(var(--space-6), 4vw, var(--space-12)); padding-block: var(--space-12); border-top: 1px solid var(--border); }
.book-side { position: sticky; top: 90px; align-self: start; }
.book-num { font-family: var(--font-display); font-size: var(--text-3xl); line-height: 1; }
.book-name { font-family: var(--font-display); font-size: var(--text-xl); font-weight: 500; margin-top: var(--space-3); }
.book-range { font-size: var(--text-sm); color: var(--muted); margin-top: var(--space-2); font-variant-numeric: tabular-nums; }
.themes { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-4); }
.tag { font-size: var(--text-xs); padding: 2px var(--space-2); border-radius: var(--radius-sm); background: var(--surface-2); color: var(--muted); border: 1px solid var(--divider); white-space: nowrap; }
.tag.scholarly { background: var(--surface-2); }
.tag.text { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.book-one { font-family: var(--font-read); font-size: var(--text-lg); line-height: 1.45; margin-bottom: var(--space-5); }
.chap-list { margin-top: var(--space-8); border-top: 1px solid var(--divider); }
.chap-row { display: grid; grid-template-columns: 3.5rem 1fr auto; gap: var(--space-4); padding: var(--space-3) 0; border-bottom: 1px solid var(--divider); align-items: baseline; font-size: var(--text-sm); }
.chap-row .n { font-family: var(--font-display); font-size: var(--text-base); color: var(--muted); font-variant-numeric: tabular-nums; }
.chap-row a.go { font-size: var(--text-xs); font-weight: 700; text-decoration: none; white-space: nowrap; }
@media (max-width: 860px) { .book { grid-template-columns: 1fr; } .book-side { position: static; } }

/* Toolbar / chips */
.toolbar { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; margin-bottom: var(--space-8); }
.chip { border: 1px solid var(--border); background: var(--surface); border-radius: 999px; padding: 0 var(--space-4); min-height: 38px; font-size: var(--text-sm); cursor: pointer; color: var(--muted); }
.chip[aria-pressed='true'] { background: var(--text); color: var(--bg); border-color: var(--text); }
.chip:hover { color: var(--text); }
.search { flex: 1 1 220px; max-width: 360px; min-height: 42px; border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius-md); padding: 0 var(--space-4); font: inherit; font-size: var(--text-sm); color: var(--text); }
.search::placeholder { color: var(--faint); }

/* Characters */
.char-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: var(--space-4); }
.char { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--space-6); display: flex; flex-direction: column; gap: var(--space-3); }
.char-top { display: flex; justify-content: space-between; gap: var(--space-3); align-items: baseline; }
.char h3 { font-family: var(--font-display); font-weight: 500; font-size: var(--text-lg); }
.char .grp { font-size: var(--text-xs); color: var(--muted); text-transform: uppercase; letter-spacing: .12em; white-space: nowrap; }
.char .role { font-size: var(--text-sm); font-weight: 600; color: var(--accent); }
.char .bio { font-family: var(--font-read); font-size: var(--text-sm); color: var(--text); line-height: 1.55; }
.heat { display: grid; grid-template-columns: repeat(108, 1fr); gap: 1px; height: 22px; margin-top: auto; }
.heat i { display: block; border-radius: 1px; background: var(--surface-3); }
.heat-meta { display: flex; justify-content: space-between; font-size: var(--text-xs); color: var(--muted); font-variant-numeric: tabular-nums; }
.refs { display: flex; flex-wrap: wrap; gap: var(--space-1); }
.ref { font-size: var(--text-xs); padding: 1px var(--space-2); border-radius: var(--radius-sm); border: 1px solid var(--border); text-decoration: none; color: var(--muted); font-variant-numeric: tabular-nums; }
.ref:hover { color: var(--accent); border-color: var(--accent); }
.titles-chart { overflow-x: auto; }
.titles-table { border-collapse: collapse; width: 100%; font-size: var(--text-sm); min-width: 560px; }
.titles-table th, .titles-table td { padding: var(--space-2) var(--space-3); border-bottom: 1px solid var(--divider); text-align: right; font-variant-numeric: tabular-nums; }
.titles-table th:first-child, .titles-table td:first-child { text-align: left; }
.titles-table thead th { font-weight: 600; color: var(--muted); font-size: var(--text-xs); text-transform: uppercase; letter-spacing: .06em; }
.cell-bar { display: inline-block; height: 10px; border-radius: 2px; vertical-align: middle; margin-left: 6px; }

/* Scenes */
.scene-list { position: relative; }
.scene { display: grid; grid-template-columns: 7rem 1fr; gap: var(--space-6); padding: var(--space-6) 0; border-top: 1px solid var(--divider); }
.scene-ref { font-family: var(--font-display); font-size: var(--text-lg); font-variant-numeric: tabular-nums; }
.scene-ref small { display: block; font-family: var(--font-ui); font-size: var(--text-xs); color: var(--muted); margin-top: var(--space-1); }
.scene h3 { font-family: var(--font-display); font-weight: 500; font-size: var(--text-lg); }
.scene blockquote { margin: var(--space-3) 0; font-family: var(--font-read); font-style: italic; font-size: var(--text-base); color: var(--text); padding-left: var(--space-4); border-left: 1px solid var(--accent); }
.scene p { color: var(--muted); font-size: var(--text-sm); max-width: 70ch; }
.scene .meta { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-3); align-items: center; }
.scene .place { font-size: var(--text-xs); color: var(--muted); }
@media (max-width: 640px) { .scene { grid-template-columns: 1fr; gap: var(--space-2); } }

/* Decoders */
.tabs { display: flex; gap: var(--space-1); flex-wrap: wrap; border-bottom: 1px solid var(--border); margin-bottom: var(--space-8); }
.tabs a { text-decoration: none; color: var(--muted); font-size: var(--text-sm); font-weight: 600; padding: var(--space-3) var(--space-4); min-height: 44px; display: inline-flex; align-items: center; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a[aria-current='true'] { color: var(--text); border-bottom-color: var(--accent); }
.tabs a:hover { color: var(--text); }
.decoder-intro { display: grid; grid-template-columns: 1fr 300px; gap: var(--space-10); align-items: start; margin-bottom: var(--space-8); }
.decoder-intro figure { margin: 0; }
.decoder-intro img { border-radius: var(--radius-lg); border: 1px solid var(--border); }
.decoder-intro figcaption { font-size: var(--text-xs); color: var(--muted); margin-top: var(--space-2); }
@media (max-width: 860px) { .decoder-intro { grid-template-columns: 1fr; } .decoder-intro figure { max-width: 320px; } }
.era { margin-top: var(--space-8); }
.era h3 { font-family: var(--font-display); font-weight: 500; font-size: var(--text-lg); margin-bottom: var(--space-3); }
.key-table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.key-table th, .key-table td { text-align: left; padding: var(--space-3) var(--space-3); border-bottom: 1px solid var(--divider); vertical-align: top; }
.key-table thead th { font-size: var(--text-xs); color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.key-table td:first-child { white-space: nowrap; font-variant-numeric: tabular-nums; }
.key-table td.sym { font-family: var(--font-read); font-style: italic; }
.key-table td.arrow { color: var(--faint); width: 1.5rem; }
.key-table td.mean { font-weight: 600; }
.legend-inline { display: flex; gap: var(--space-4); flex-wrap: wrap; font-size: var(--text-xs); color: var(--muted); align-items: center; }
.table-scroll { overflow-x: auto; }

/* Weeks */
.weeks { display: grid; grid-template-columns: repeat(11, 1fr); gap: 4px; margin: var(--space-8) 0 var(--space-4); }
.week { min-height: 96px; border-radius: var(--radius-md); padding: var(--space-3); display: flex; flex-direction: column; justify-content: space-between; border: 1px solid var(--border); background: var(--surface); cursor: pointer; text-align: left; }
.week.past { background: var(--surface-2); }
.week.now { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.week.future { background: var(--accent-soft); border-style: dashed; }
.week b { font-family: var(--font-display); font-size: var(--text-xl); font-weight: 500; line-height: 1; }
.week span { font-size: var(--text-xs); color: var(--muted); }
.week[aria-pressed='true'] { outline: 2px solid var(--text); outline-offset: 1px; }
.week-detail { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--space-6); display: grid; grid-template-columns: 6rem 1fr; gap: var(--space-6); }
.week-detail .big { font-family: var(--font-display); font-size: var(--text-3xl); line-height: 1; }
.week-detail blockquote { margin: 0 0 var(--space-3); font-family: var(--font-read); font-style: italic; font-size: var(--text-lg); line-height: 1.45; }
.week-detail .key { font-weight: 700; }
.now-note { font-size: var(--text-sm); color: var(--muted); display: flex; gap: var(--space-4); flex-wrap: wrap; }
@media (max-width: 760px) { .weeks { grid-template-columns: repeat(4, 1fr); } .week-detail { grid-template-columns: 1fr; } }

/* Calendar */
.cal { display: grid; grid-template-columns: 1.2fr 1fr; gap: var(--space-8); align-items: start; }
.cal > *, .grid-2 > *, .map-wrap > *, .two-col > * { min-width: 0; }
@media (max-width: 900px) { .cal { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .month-strip { grid-template-columns: repeat(6, minmax(0, 1fr)); } .cal .panel, .map-wrap .panel, .grid-2 .panel { padding: var(--space-4); } }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--space-6); }
.cal svg { width: 100%; height: auto; display: block; }
.slider-row { display: flex; gap: var(--space-4); align-items: center; margin-top: var(--space-4); flex-wrap: wrap; }
.slider-row input[type=range] { flex: 1 1 240px; accent-color: var(--accent); min-height: 44px; }
.slider-row output { font-variant-numeric: tabular-nums; font-weight: 700; min-width: 7ch; }
.daybar { display: grid; grid-template-columns: repeat(18, 1fr); gap: 2px; margin-top: var(--space-3); }
.daybar i { height: 26px; border-radius: 2px; }
.daybar i.d { background: var(--gold); }
.daybar i.n { background: var(--b2); opacity: .7; }
.readout { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-4); margin-top: var(--space-5); }
.readout div span { display: block; font-size: var(--text-xs); color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.readout div b { font-size: var(--text-lg); font-variant-numeric: tabular-nums; }
.month-strip { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 3px; margin-top: var(--space-5); }
.month-strip button { border: 1px solid var(--border); background: var(--surface-2); border-radius: var(--radius-sm); min-height: 44px; font-size: var(--text-xs); cursor: pointer; font-variant-numeric: tabular-nums; padding: 2px; line-height: 1.2; }
.month-strip button.on { background: var(--text); color: var(--bg); }
.check-table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); font-variant-numeric: tabular-nums; }
.check-table td, .check-table th { padding: var(--space-2) var(--space-3); border-bottom: 1px solid var(--divider); text-align: right; }
.check-table td:first-child, .check-table th:first-child { text-align: left; }
.check-table thead th { font-size: var(--text-xs); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.ok { color: var(--b3); font-weight: 700; }
.callout { background: var(--surface-2); border-radius: var(--radius-lg); padding: var(--space-6); font-size: var(--text-sm); }
.callout h4 { font-size: var(--text-base); margin-bottom: var(--space-2); }
.callout p + p { margin-top: var(--space-3); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-6); }
@media (max-width: 820px) { .grid-2 { grid-template-columns: 1fr; } }

/* Watchers ledger */
.ledger { display: grid; grid-template-columns: 2.5rem 1fr 1.5rem 1fr; font-size: var(--text-sm); }
.ledger > div { padding: var(--space-2) var(--space-2); border-bottom: 1px solid var(--divider); }
.ledger .hd { font-size: var(--text-xs); color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.ledger .num { color: var(--faint); font-variant-numeric: tabular-nums; }
.ledger .hit { background: var(--accent-soft); }
.ledger .rel { color: var(--faint); text-align: center; }
.ledger .same { color: var(--b3); font-weight: 700; }

/* Shepherds */
.shep-bar { display: flex; height: 64px; border-radius: var(--radius-md); overflow: hidden; margin: var(--space-6) 0 var(--space-3); }
.shep-bar div { display: grid; place-items: center; color: #fff; font-weight: 700; font-size: var(--text-sm); font-variant-numeric: tabular-nums; }
.shep-legend { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-4); }
.shep-legend div { font-size: var(--text-sm); }
.shep-legend b { display: block; }
.shep-legend span { color: var(--muted); font-size: var(--text-xs); }
@media (max-width: 760px) { .shep-legend { grid-template-columns: 1fr 1fr; } }
.sum-steps { list-style: none; padding: 0; margin: var(--space-6) 0 0; display: grid; gap: var(--space-2); font-size: var(--text-sm); }
.sum-steps li { display: grid; grid-template-columns: 6rem 1fr 6rem; gap: var(--space-4); padding: var(--space-3) var(--space-4); background: var(--surface); border: 1px solid var(--divider); border-radius: var(--radius-md); align-items: baseline; }
.sum-steps .tot { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
@media (max-width: 560px) { .sum-steps li { grid-template-columns: 1fr; gap: var(--space-1); } .sum-steps .tot { text-align: left; } }

/* Journeys map */
.map-wrap { display: grid; grid-template-columns: 1.3fr 1fr; gap: var(--space-8); align-items: start; }
@media (max-width: 900px) { .map-wrap { grid-template-columns: 1fr; } }
.map svg { width: 100%; height: auto; }
.map .station { cursor: pointer; }
.map .station circle { fill: var(--surface); stroke: var(--accent); stroke-width: 1.5; transition: r .15s; }
.map .station.on circle, .map .station:hover circle { fill: var(--accent); }
.map .station text { font-family: var(--font-ui); font-size: 3.2px; fill: var(--text); font-weight: 700; }
.map .station.on text, .map .station:hover text { fill: var(--inverse); }
.station-list { list-style: none; margin: 0; padding: 0; font-size: var(--text-sm); }
.station-list li { display: grid; grid-template-columns: 3rem 1fr; gap: var(--space-3); padding: var(--space-2) var(--space-2); border-bottom: 1px solid var(--divider); cursor: pointer; border-radius: var(--radius-sm); }
.station-list li.on { background: var(--accent-soft); }
.station-list li b { font-variant-numeric: tabular-nums; color: var(--accent); }

/* Reader */
.reader { display: grid; grid-template-columns: 250px 1fr; gap: var(--space-10); padding-top: var(--space-8); }
.toc { position: sticky; top: 76px; align-self: start; max-height: calc(100vh - 96px); overflow: auto; padding-right: var(--space-2); font-size: var(--text-sm); }
.toc h4 { font-size: var(--text-xs); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: var(--space-4) 0 var(--space-2); display: flex; align-items: center; gap: var(--space-2); }
.toc-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 3px; }
.toc-grid a { text-decoration: none; color: var(--muted); text-align: center; font-size: var(--text-xs); padding: 4px 0; border-radius: var(--radius-sm); font-variant-numeric: tabular-nums; position: relative; min-height: 28px; display: grid; place-items: center; }
.toc-grid a:hover { background: var(--surface-2); color: var(--text); }
.toc-grid a.on { background: var(--text); color: var(--bg); }
.reader-main { max-width: 720px; min-width: 0; }
.toc-details > summary { cursor: pointer; font-weight: 700; font-size: var(--text-sm); min-height: 44px; display: flex; align-items: center; list-style: none; }
.toc-details > summary::after { content: '+'; margin-left: auto; color: var(--muted); }
.toc-details[open] > summary::after { content: '−'; }
@media (min-width: 861px) { .toc-details > summary { display: none; } }
.chapter-head { border-bottom: 1px solid var(--divider); padding-bottom: var(--space-6); margin-bottom: var(--space-6); }
.chapter-head .roman { font-family: var(--font-display); font-size: var(--text-3xl); line-height: 1; color: var(--accent); }
.chapter-head .sub { font-family: var(--font-read); font-style: italic; color: var(--muted); margin-top: var(--space-3); }
.chapter-head .sum { margin-top: var(--space-4); font-size: var(--text-sm); background: var(--surface); border: 1px solid var(--divider); border-radius: var(--radius-md); padding: var(--space-4); }
.chapter-head .sum b { font-size: var(--text-xs); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); display: block; margin-bottom: var(--space-1); }
.chapter-head .who { display: flex; flex-wrap: wrap; gap: var(--space-1); margin-top: var(--space-3); }
.text { font-family: var(--font-read); font-size: clamp(1.05rem, 1rem + .25vw, 1.2rem); line-height: 1.75; }
.text p { margin: 0 0 var(--space-3); }
.text sup { font-family: var(--font-ui); font-size: .65em; color: var(--accent); font-weight: 700; margin-right: 4px; font-variant-numeric: tabular-nums; vertical-align: .45em; }
.text .sec { font-family: var(--font-ui); font-size: var(--text-xs); text-transform: uppercase; letter-spacing: .12em; color: var(--muted); font-weight: 700; margin: var(--space-6) 0 var(--space-3); padding-top: var(--space-3); border-top: 1px dashed var(--border); }
.text .note { font-family: var(--font-ui); font-size: var(--text-sm); color: var(--muted); font-style: italic; border: 1px dashed var(--border); padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); }
.text mark { background: oklch(0.85 0.14 85 / .55); color: inherit; border-radius: 2px; padding: 0 1px; }
.pager { display: flex; justify-content: space-between; gap: var(--space-4); margin-top: var(--space-10); padding-top: var(--space-6); border-top: 1px solid var(--divider); }
.reader-search { display: flex; gap: var(--space-2); margin-bottom: var(--space-4); }
.results { list-style: none; padding: 0; margin: 0 0 var(--space-8); }
.results li { padding: var(--space-3) 0; border-bottom: 1px solid var(--divider); font-size: var(--text-sm); }
.results li a { font-weight: 700; text-decoration: none; margin-right: var(--space-2); font-variant-numeric: tabular-nums; }
.results .snip { font-family: var(--font-read); color: var(--muted); }
.results mark { background: oklch(0.85 0.14 85 / .55); color: var(--text); }
@media (max-width: 860px) { .reader { grid-template-columns: 1fr; gap: var(--space-4); } .toc { position: static; max-height: none; } .toc-grid { grid-template-columns: repeat(9, 1fr); } }

/* Footer */
.site-footer { border-top: 1px solid var(--divider); margin-top: var(--space-20); }
.footer-inner { max-width: var(--content); margin: 0 auto; padding: var(--space-8) var(--space-6) var(--space-12); font-size: var(--text-xs); color: var(--muted); display: grid; gap: var(--space-2); }

.tooltip { position: fixed; z-index: 60; max-width: 300px; background: var(--text); color: var(--bg); font-size: var(--text-xs); line-height: 1.45; padding: var(--space-2) var(--space-3); border-radius: var(--radius-md); pointer-events: none; box-shadow: var(--shadow); }
.tooltip b { display: block; font-size: var(--text-sm); }

.fade-in { animation: fade .35s var(--ease) both; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (max-width: 760px) { .tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: calc(-1 * var(--space-6)); padding-inline: var(--space-6); } .tabs a { white-space: nowrap; flex: none; } }
