:root {
  --bg: #14110c;
  --bg2: #1c1812;
  --panel: #221d15;
  --panel2: #2a241a;
  --line: #3a3225;
  --ink: #ece4d2;
  --ink-dim: #b3a88e;
  --ink-faint: #8a8069;
  --gold: #e8b64c;
  --gold-dim: #b08d3f;
  --teal: #3fa7a0;
  --purple: #8e6bb8;
  --bronze: #c87f3a;
  --red: #b8524f;
  --serif: Georgia, 'Iowan Old Style', 'Times New Roman', serif;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --rad: 14px;
  --shadow: 0 10px 32px rgba(0,0,0,.45);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--sans); line-height: 1.55;
  background-image: radial-gradient(1200px 500px at 70% -10%, rgba(232,182,76,.07), transparent 60%);
}
a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }
h1,h2,h3 { font-family: var(--serif); font-weight: 600; letter-spacing: .01em; }

/* ---------- top bar ---------- */
#topbar {
  position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 18px;
  padding: 10px 22px; background: rgba(20,17,12,.92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--serif); font-size: 19px; color: var(--ink); }
.brand:hover { text-decoration: none; color: var(--gold); }
#mainnav { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
#mainnav a {
  padding: 7px 13px; border-radius: 9px; color: var(--ink-dim); font-size: 14.5px;
}
#mainnav a:hover { color: var(--ink); background: var(--panel); text-decoration: none; }
#mainnav a.active { color: var(--gold); background: var(--panel); }
#navtoggle { display: none; margin-left: auto; background: none; border: 1px solid var(--line); color: var(--ink); border-radius: 8px; font-size: 18px; padding: 4px 12px; }

main { min-height: 72vh; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 28px 22px 60px; }

#sitefooter { border-top: 1px solid var(--line); margin-top: 40px; padding: 22px; color: var(--ink-faint); font-size: 12.5px; max-width: 900px; margin-left:auto; margin-right:auto; }

.avatar svg, .avatar img { width: 100%; height: auto; display: block; }

.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 11px; border-radius: 999px;
  font-size: 12px; border: 1px solid var(--line); color: var(--ink-dim); background: var(--panel);
  white-space: nowrap;
}
.pill.link:hover { border-color: var(--gold-dim); color: var(--gold); text-decoration: none; cursor: pointer; }
.pill .dot { width: 8px; height: 8px; border-radius: 50%; }

.btn {
  display: inline-flex; align-items:center; gap:8px; background: var(--panel2); color: var(--ink); border: 1px solid var(--line);
  padding: 8px 16px; border-radius: 10px; cursor: pointer; font-size: 14px;
}
.btn:hover { border-color: var(--gold-dim); color: var(--gold); text-decoration: none; }
.btn.primary { background: linear-gradient(160deg, var(--gold), #c99027); color: #241b08; border: none; font-weight: 600; }
.btn.primary:hover { filter: brightness(1.07); color: #241b08; }

/* ---------- home ---------- */
.hero { text-align: center; padding: 68px 20px 34px; }
.hero h1 { font-size: clamp(30px, 5.4vw, 54px); margin: 0 0 12px; }
.hero h1 em { color: var(--gold); font-style: normal; }
.hero p.lead { max-width: 640px; margin: 0 auto 26px; color: var(--ink-dim); font-size: 17px; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; margin-top: 38px; }
.feature {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--rad);
  padding: 20px 18px; text-align: left; transition: transform .15s ease, border-color .15s ease; color: var(--ink);
}
.feature:hover { transform: translateY(-3px); border-color: var(--gold-dim); text-decoration: none; }
.feature h3 { margin: 8px 0 6px; font-size: 18px; color: var(--gold); }
.feature p { margin: 0; color: var(--ink-dim); font-size: 13.5px; }
.feature .fig { font-size: 26px; }
.home-verse { max-width: 620px; margin: 46px auto 10px; font-family: var(--serif); font-size: 19px; color: var(--ink-dim); font-style: italic; text-align:center; }
.home-verse cite { display:block; margin-top:8px; font-size: 13px; color: var(--gold-dim); font-style: normal; }

/* ---------- reader ---------- */
.reader-layout { display: grid; grid-template-columns: 235px minmax(0,1fr) 320px; gap: 24px; align-items: start; }
.reader-toc { position: sticky; top: 66px; max-height: calc(100vh - 90px); overflow-y: auto; padding-right: 4px; }
.toc-volume { margin-bottom: 8px; border-bottom: 1px solid rgba(255,255,255,.05); padding-bottom: 6px; }
.toc-vol-btn {
  width: 100%; text-align: left; background: none; border: none; cursor: pointer; font-family: var(--serif);
  color: var(--ink); font-size: 15px; padding: 8px 8px; display: flex; align-items: center; gap: 9px;
}
.toc-volume:not(.open) .toc-vol-btn { color: var(--ink-faint); }
.toc-vol-btn:hover { color: var(--gold); }
.toc-vol-books { padding-left: 6px; }
.toc-book { margin-bottom: 4px; }
.toc-book > button {
  width: 100%; text-align: left; background: none; border: none; color: var(--ink-dim); cursor: pointer;
  font-size: 14px; padding: 7px 10px; border-radius: 8px; display:flex; align-items:center; gap:8px; font-family: var(--sans);
}
.toc-book > button:hover { background: var(--panel); color: var(--ink); }
.toc-book.current > button { color: var(--gold); font-weight: 600; }
.toc-book .dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.toc-chapters { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px 8px 10px; }
.toc-chapters a {
  width: 30px; height: 26px; display:flex; align-items:center; justify-content:center; border-radius: 6px;
  font-size: 12px; color: var(--ink-dim); background: var(--panel);
}
.toc-chapters a:hover { color: var(--gold); text-decoration: none; }
.toc-chapters a.current { background: var(--gold); color: #241b08; font-weight: 700; }

.chapter-head { border-bottom: 1px solid var(--line); padding-bottom: 18px; margin-bottom: 20px; }
.chapter-head .crumbs { color: var(--ink-faint); font-size: 13px; margin-bottom: 4px; }
.chapter-head h1 { margin: 2px 0 4px; font-size: 34px; }
.chapter-head h2.ctitle { margin: 0 0 12px; font-size: 19px; color: var(--gold); font-weight: 500; font-style: italic; }
.chapter-head .synopsis {
  font-size: 15px; color: var(--ink-dim); background: var(--panel); border-left: 3px solid var(--gold-dim);
  padding: 12px 16px; border-radius: 0 10px 10px 0; margin: 12px 0;
}
.chapter-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

.verses { font-family: var(--serif); font-size: 18.5px; line-height: 1.85; max-width: 720px; }
.verse { padding: 5px 14px; margin: 2px 0; border-left: 3px solid transparent; border-radius: 4px; transition: background .3s; scroll-margin-top: 120px; }
.verse .vnum { color: var(--gold-dim); font-size: 13px; font-family: var(--sans); vertical-align: super; margin-right: 7px; font-weight: 600; }
.verse.seg-active { background: rgba(232,182,76,.05); }
.verse:target { background: rgba(232,182,76,.13); }

.chapter-nav { display: flex; justify-content: space-between; margin: 34px 0 10px; max-width: 720px; }

/* speaker rail */
.speaker-rail { position: sticky; top: 66px; display: flex; flex-direction: column; gap: 14px; }
.speaker-card {
  background: linear-gradient(175deg, var(--panel2), var(--panel)); border: 1px solid var(--line);
  border-radius: var(--rad); padding: 16px; box-shadow: var(--shadow);
}
.speaker-card .sc-label { font-size: 11px; text-transform: uppercase; letter-spacing: .14em; color: var(--ink-faint); margin-bottom: 10px; }
.sc-duo { display: flex; align-items: center; gap: 8px; }
.sc-duo .sc-portrait { flex: none; width: 96px; text-align: center; }
.sc-duo .sc-portrait.small { width: 72px; opacity: .85; }
.sc-portrait .avatar { border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: var(--bg2); }
.sc-portrait .who { font-size: 12.5px; margin-top: 6px; color: var(--ink); font-weight: 600; line-height: 1.25; }
.sc-portrait .role { font-size: 10.5px; color: var(--ink-faint); }
.sc-arrow { flex: 1; text-align: center; color: var(--gold-dim); font-size: 20px; }
.sc-arrow .to-label { display: block; font-size: 9.5px; text-transform: uppercase; letter-spacing: .12em; color: var(--ink-faint); }
.sc-note { margin-top: 12px; font-size: 13px; color: var(--ink-dim); font-style: italic; border-top: 1px dashed var(--line); padding-top: 10px; }
.sc-verses { font-size: 11px; color: var(--ink-faint); margin-top: 4px; }
.context-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--rad); padding: 14px 16px; font-size: 13px; }
.context-card h4 { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .13em; color: var(--ink-faint); font-weight: 600; }
.context-card .row { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; border-bottom: 1px solid rgba(255,255,255,.04); }
.context-card .row:last-child { border-bottom: none; }
.context-card .k { color: var(--ink-faint); }
.context-card .v { text-align: right; color: var(--ink-dim); }
.context-card .v a { font-size: 13px; }
.mini-timeline { margin-top: 8px; }
.mini-timeline svg { width: 100%; display: block; }

/* ---------- timeline ---------- */
.tl-toolbar {
  position: sticky; top: 49px; z-index: 20;
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  margin: 0 -22px 18px; padding: 10px 22px;
  background: rgba(20,17,12,.92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.tl-count { font-size: 12.5px; color: var(--ink-faint); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tl-legend { display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.tl-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; }

/* the river: one shared vertical spine, earliest at the top */
.tl-river { padding: 6px 0 30px; }
.tl-ev, .tl-era, .tl-gap {
  display: grid; grid-template-columns: 104px 34px minmax(0, 1fr);
  gap: 0 14px; width: 100%; text-align: left; scroll-margin-top: 130px;
}
.tl-ev { background: none; border: none; padding: 0; margin: 0; cursor: pointer; font-family: var(--sans); color: var(--ink); border-radius: 10px; -webkit-user-select: none; user-select: none; }
.tl-ev:focus-visible { outline: 1px solid var(--gold-dim); outline-offset: 2px; }
.tl-node, .tl-era-node, .tl-gap-node { position: relative; display: block; grid-column: 2; }
.tl-body, .tl-era-body, .tl-gap-txt { grid-column: 3; }
.tl-node::before, .tl-era-node::before, .tl-gap-node::before {
  content: ''; position: absolute; left: 50%; top: 0; bottom: 0; width: 2px;
  margin-left: -1px; background: var(--line);
}
.tl-gap-node::before { background: none; border-left: 2px dotted #4a4028; margin-left: -1px; }
.tl-river > :first-child .tl-node::before,
.tl-river > :first-child .tl-era-node::before { top: 50%; }
.tl-river > :last-child .tl-node::before { bottom: 50%; }
.tl-dot {
  position: absolute; left: 50%; top: 50%; width: 13px; height: 13px; margin: -6.5px 0 0 -6.5px;
  border-radius: 50%; background: var(--bg); border: 3px solid var(--gold); z-index: 1;
  transition: transform .15s, box-shadow .15s;
}
.tl-ev .tl-year { align-self: center; text-align: right; font-size: 12px; color: var(--ink-faint); font-variant-numeric: tabular-nums; line-height: 1.3; padding: 4px 0; }
.tl-ev .tl-body { padding: 9px 12px 9px 2px; border-radius: 10px; min-width: 0; }
.tl-ev .tl-title { display: block; font-family: var(--serif); font-size: 16px; line-height: 1.35; color: var(--ink); transition: color .12s; }
.tl-ev .tl-meta { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--ink-faint); margin-top: 2px; letter-spacing: .04em; }
.tl-swatch { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex: none; }
.tl-ev:hover .tl-title { color: var(--gold); }
.tl-ev:hover .tl-dot { transform: scale(1.25); }
.tl-ev.sel .tl-body { background: rgba(232,182,76,.08); box-shadow: inset 0 0 0 1px rgba(232,182,76,.35); padding-left: 12px; }
.tl-ev.sel .tl-title { color: var(--gold); }
.tl-ev.sel .tl-dot { box-shadow: 0 0 0 4px rgba(232,182,76,.25); transform: scale(1.25); }

/* era headers on the spine */
.tl-era { padding: 26px 0 10px; scroll-margin-top: 120px; }
.tl-gem {
  position: absolute; left: 50%; bottom: 6px; width: 12px; height: 12px; margin-left: -8px;
  transform: rotate(45deg); background: var(--bg); border: 3px solid var(--gold); z-index: 1;
}
.tl-era-body { align-self: end; }
.tl-era-name { display: block; font-family: var(--serif); font-size: 19px; letter-spacing: .02em; }
.tl-era-range { display: block; font-size: 11.5px; color: var(--ink-faint); margin-top: 1px; }
.tl-era.flash .tl-era-name { animation: tl-flash 1.2s ease; }
@keyframes tl-flash { 0% { text-shadow: 0 0 18px rgba(232,182,76,.9); } 100% { text-shadow: none; } }

/* "years pass" pauses */
.tl-gap { padding: 2px 0; }
.tl-gap-node { min-height: 34px; }
.tl-gap-txt { align-self: center; font-size: 11.5px; font-style: italic; color: var(--ink-faint); opacity: .85; padding: 8px 0; }

/* cross-record threads */
.tl-thread {
  display: block; background: none; border: none; padding: 2px 0 0; margin-top: 3px; cursor: pointer;
  font-size: 11.5px; font-style: italic; color: var(--gold-dim); text-align: left; font-family: var(--sans);
}
.tl-thread em { font-style: italic; border-bottom: 1px dotted var(--gold-dim); }
.tl-thread:hover, .tl-thread:hover em { color: var(--gold); border-color: var(--gold); }

/* detail panel */
.tl-side { position: sticky; top: 118px; }
.tl-detail {
  background: linear-gradient(175deg, var(--panel2), var(--panel)); border: 1px solid var(--line);
  border-radius: var(--rad); padding: 18px; box-shadow: var(--shadow); position: relative;
}
.tl-detail.open { border-color: var(--gold-dim); }
.tl-detail-era { display: flex; align-items: center; gap: 7px; font-size: 11px; text-transform: uppercase; letter-spacing: .14em; font-weight: 600; margin-bottom: 8px; }
.tl-detail h3 { margin: 0 0 2px; font-size: 21px; color: var(--gold); line-height: 1.3; }
.tl-detail .yrs { font-size: 12.5px; color: var(--ink-faint); margin-bottom: 10px; }
.tl-detail p { font-size: 14px; color: var(--ink-dim); margin: 0 0 12px; }
.tl-detail .faces { display: flex; gap: 8px; margin: 10px 0 14px; flex-wrap: wrap; }
.tl-detail .faces .fc { width: 52px; text-align: center; }
.tl-detail .faces .fc .avatar { border-radius: 9px; overflow: hidden; border: 1px solid var(--line); background: var(--bg2); }
.tl-detail .faces .fc:hover .avatar { border-color: var(--gold-dim); }
.tl-detail .faces .fc-name { display: block; font-size: 10px; color: var(--ink-dim); margin-top: 3px; line-height: 1.2; }
.tl-detail .faces .fc:hover { text-decoration: none; }
.tl-detail-threads { border-top: 1px dashed var(--line); margin: 4px 0 10px; padding-top: 8px; }
.tl-detail .btn.primary { width: 100%; justify-content: center; }
.tl-detail-step { display: flex; justify-content: space-between; gap: 10px; margin-top: 12px; border-top: 1px solid rgba(255,255,255,.05); padding-top: 12px; }
.tl-detail-step .btn { flex: 1; justify-content: center; font-size: 13px; padding: 7px 10px; }
.tl-detail .close { position: absolute; top: 10px; right: 12px; background: none; border: none; color: var(--ink-faint); font-size: 15px; cursor: pointer; display: none; }
.tl-detail.open .close { display: block; }
.tl-hint-card { text-align: center; padding: 18px 6px; color: var(--ink-dim); font-size: 13.5px; }
.tl-hint-mark { font-size: 26px; color: var(--gold-dim); margin-bottom: 8px; }

/* ---------- map ---------- */
.map-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr); gap: 22px; align-items: start; }
.map-stage { background: var(--bg2); border: 1px solid var(--line); border-radius: var(--rad); overflow: hidden; }
.map-stage svg { display: block; width: 100%; }
.map-side { position: sticky; top: 66px; }
.place-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--rad); padding: 18px; }
.place-card h3 { margin: 0 0 4px; color: var(--gold); font-size: 20px; }
.place-card .kind { font-size: 11px; text-transform: uppercase; letter-spacing: .14em; color: var(--ink-faint); margin-bottom: 10px; }
.place-card p { font-size: 14px; color: var(--ink-dim); }
.place-card .chapters { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.map-marker { cursor: pointer; }
.map-marker text { paint-order: stroke; stroke: rgba(15,17,12,.75); stroke-width: 3px; }
.map-marker.sel circle { stroke: #fff; stroke-width: 2; }
.map-note { font-size: 12px; color: var(--ink-faint); margin-top: 10px; }
.oldworld-strip { margin-top: 16px; }

/* ---------- plates ---------- */
.plates-stage { background: var(--bg2); border: 1px solid var(--line); border-radius: var(--rad); padding: 8px; margin-bottom: 24px; }
.plates-stage svg { width: 100%; display: block; }
.plate-node { cursor: pointer; }
.plate-detail { background: var(--panel); border: 1px solid var(--line); border-radius: var(--rad); padding: 18px; margin-bottom: 20px; }
.plate-detail h3 { margin: 0 0 6px; }
.books-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 18px; }
.book-chip { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--panel); color: var(--ink); }
.book-chip:hover { border-color: var(--gold-dim); text-decoration: none; }
.book-chip .b { font-family: var(--serif); font-size: 15px; }
.book-chip .s { display: block; font-size: 11px; color: var(--ink-faint); margin-top: 2px; }
.book-chip .bar { height: 4px; border-radius: 2px; margin-top: 8px; }

/* ---------- cast ---------- */
.cast-controls { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 20px; }
.cast-controls input[type=search], .stories-controls input[type=search] {
  background: var(--panel); border: 1px solid var(--line); color: var(--ink); border-radius: 10px;
  padding: 9px 14px; font-size: 14px; min-width: 230px;
}
.cast-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; }
.char-card {
  background: linear-gradient(180deg, var(--panel2), var(--panel)); border: 1px solid var(--line); border-radius: var(--rad);
  overflow: hidden; cursor: pointer; transition: transform .15s, border-color .15s; text-align: left; color: var(--ink); padding: 0;
  font-family: var(--sans);
}
.char-card:hover { transform: translateY(-4px); border-color: var(--gold-dim); }
.char-card .avatar { width: 100%; aspect-ratio: 1/1.05; }
.char-card .avatar svg, .char-card .avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.char-card .cc-body { padding: 12px 14px 14px; }
.char-card h3 { margin: 0; font-size: 17px; }
.char-card .cc-title { font-size: 12px; color: var(--gold-dim); margin-top: 2px; }
.char-card .cc-era { font-size: 11px; color: var(--ink-faint); margin-top: 4px; }
.cast-book-section h2 { border-bottom: 1px solid var(--line); padding-bottom: 8px; margin: 34px 0 16px; font-size: 22px; }
.cast-book-section h2 .n { color: var(--ink-faint); font-size: 14px; font-family: var(--sans); margin-left: 8px; }

/* character modal */
.modal-back { position: fixed; inset: 0; background: rgba(10,8,5,.75); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 18px; }
.char-modal { background: var(--bg2); border: 1px solid var(--gold-dim); border-radius: 18px; max-width: 760px; width: 100%; max-height: 88vh; overflow-y: auto; box-shadow: var(--shadow); position: relative; }
.char-modal .close { position: absolute; top: 12px; right: 14px; background: var(--panel); border: 1px solid var(--line); color: var(--ink); border-radius: 8px; font-size: 15px; cursor: pointer; padding: 4px 10px; z-index: 2; }
.cm-grid { display: grid; grid-template-columns: 250px 1fr; gap: 22px; padding: 22px; }
.cm-grid .avatar { border-radius: 14px; overflow: hidden; border: 1px solid var(--line); }
.cm-info h2 { margin: 0; font-size: 26px; }
.cm-info .cc-title { color: var(--gold-dim); margin: 2px 0 10px; }
.cm-info p { color: var(--ink-dim); font-size: 14.5px; }
.cm-info h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .13em; color: var(--ink-faint); margin: 16px 0 8px; }
.cm-apps { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- stories ---------- */
.stories-controls { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }
.story-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.story-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--rad); padding: 16px 18px; color: var(--ink); display: flex; flex-direction: column; gap: 8px; transition: transform .15s, border-color .15s; }
.story-card:hover { transform: translateY(-3px); border-color: var(--gold-dim); text-decoration: none; }
.story-card h3 { margin: 0; font-size: 17px; line-height: 1.35; }
.story-card p { margin: 0; font-size: 13px; color: var(--ink-dim); flex: 1; }
.story-card .refs { font-size: 12px; color: var(--gold-dim); }
.story-card .faces { display: flex; flex-wrap: wrap; gap: 10px; }
.story-card .faces .fc { width: 46px; text-align: center; color: var(--ink-dim); }
.story-card .faces .fc .avatar { border-radius: 8px; overflow: hidden; border: 1px solid var(--line); }
.story-card .faces .fc:hover { color: var(--gold); text-decoration: none; }
.story-card .faces .fc:hover .avatar { border-color: var(--gold-dim); }
.story-card .faces .fc-name { display: block; font-size: 9.5px; line-height: 1.15; margin-top: 3px; }

/* ---------- allegories ---------- */
.alle-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--rad); padding: 20px; margin-bottom: 22px; }
.alle-stage { background: var(--bg2); border: 1px solid var(--line); border-radius: var(--rad); margin: 16px 0; overflow: hidden; }
.alle-stage svg { width: 100%; display: block; }
.symbol-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.symbol-item { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; background: var(--panel2); cursor: pointer; }
.symbol-item.sel { border-color: var(--gold); }
.symbol-item h4 { margin: 0 0 3px; font-size: 14.5px; color: var(--gold); }
.symbol-item p { margin: 0; font-size: 12.5px; color: var(--ink-dim); }
.stage-controls { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 12px 0; }
.stage-dots { display: flex; gap: 8px; }
.stage-dots button { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line); background: var(--panel); color: var(--ink-dim); cursor: pointer; font-size: 13px; }
.stage-dots button.on { background: var(--gold); color: #241b08; border-color: var(--gold); font-weight: 700; }
.stage-desc h3 { margin: 6px 0 2px; color: var(--gold); }
.stage-desc .era { font-size: 12px; color: var(--ink-faint); margin-bottom: 6px; }
.stage-desc p { color: var(--ink-dim); font-size: 14.5px; }
.legend-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px; margin: 14px 0; }
.legend-grid .lg { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; border-bottom: 1px dashed var(--line); padding: 4px 2px; }
.legend-grid .lg .s { color: var(--ink); }
.legend-grid .lg .m { color: var(--ink-dim); text-align: right; }

.section-intro { max-width: 760px; color: var(--ink-dim); font-size: 15px; margin-bottom: 24px; }
.page-title { font-size: 32px; margin: 4px 0 6px; }
.eyebrow { font-size: 12px; text-transform: uppercase; letter-spacing: .18em; color: var(--gold-dim); font-weight: 600; }

.loading { text-align: center; padding: 80px 0; color: var(--ink-faint); font-style: italic; }

@media (max-width: 1020px) {
  .reader-layout { grid-template-columns: minmax(0,1fr) 300px; }
  .reader-toc { display: none; }
}
@media (max-width: 900px) {
  .tl-layout { grid-template-columns: 1fr; }
  .tl-side { position: static; }
  .tl-detail { display: none; }
  .tl-detail.open {
    display: block; position: fixed; left: 10px; right: 10px; bottom: 10px; z-index: 90;
    max-height: 62vh; overflow-y: auto; background: rgba(28,24,18,.98);
  }
  .tl-ev, .tl-era, .tl-gap { grid-template-columns: 78px 28px minmax(0, 1fr); gap: 0 10px; }
  .tl-legend { margin-left: 0; }
}
@media (max-width: 760px) {
  #mainnav { display: none; position: absolute; top: 100%; left: 0; right: 0; background: var(--bg2); flex-direction: column; padding: 10px; border-bottom: 1px solid var(--line); }
  #mainnav.open { display: flex; }
  #navtoggle { display: block; }
  .reader-layout, .map-layout, .cm-grid { grid-template-columns: 1fr; }
  .speaker-rail { position: static; flex-direction: column; }
  .map-side { position: static; }
  .tl-toolbar { position: static; }
}

/* ---------- Godhead feature (cast page) ---------- */
.godhead-section { background: linear-gradient(160deg, rgba(232,182,76,.06), transparent 70%); border: 1px solid var(--gold-dim); border-radius: var(--rad); padding: 18px 20px 20px; margin-bottom: 34px; }
.godhead-section > h2 { border-bottom: none; margin-top: 6px; }
.godhead-note { color: var(--ink-dim); font-size: 14px; max-width: 760px; margin: 0 0 16px; border-left: 3px solid var(--gold-dim); padding-left: 14px; }
.godhead-note em { color: var(--gold); font-style: normal; }
.godhead-section .cast-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }

/* ---------- reader: cast of this chapter ---------- */
.reader-cast { display: flex; flex-wrap: wrap; gap: 10px; }
.reader-cast .rc { width: 58px; text-align: center; color: var(--ink-dim); }
.reader-cast .rc .avatar { border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.reader-cast .rc:hover { color: var(--gold); text-decoration: none; }
.reader-cast .rc:hover .avatar { border-color: var(--gold-dim); }
.reader-cast .rc-name { display: block; font-size: 10.5px; margin-top: 3px; line-height: 1.2; }
.rc-hint { font-size: 11px; color: var(--ink-faint); margin-top: 10px; font-style: italic; }

/* ---------- chapter browser (drill-up navigation below the reader) ---------- */
.chapter-browser { max-width: 720px; margin: 26px 0 10px; border: 1px solid var(--line); border-radius: var(--rad); overflow: hidden; background: var(--panel); }
.cb-toggle { width: 100%; display: flex; align-items: center; gap: 12px; background: none; border: none; color: var(--ink); cursor: pointer; padding: 14px 18px; font-family: var(--serif); font-size: 16px; text-align: left; }
.cb-toggle:hover { background: var(--panel2); }
.cb-toggle-label { font-weight: 600; }
.cb-here { color: var(--ink-faint); font-size: 13px; font-family: var(--sans); margin-left: auto; }
.cb-caret { transition: transform .2s; color: var(--gold-dim); }
.cb-toggle.open .cb-caret { transform: rotate(180deg); }
.cb-panel { border-top: 1px solid var(--line); padding: 14px 18px 18px; }
.cb-crumbs { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.cb-up { background: var(--panel2); border: 1px solid var(--line); color: var(--ink); border-radius: 8px; padding: 5px 12px; font-size: 13px; cursor: pointer; }
.cb-up:hover { border-color: var(--gold-dim); color: var(--gold); }
.cb-trail { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13.5px; }
.cb-crumb { background: none; border: none; color: var(--gold); cursor: pointer; font-size: 13.5px; padding: 2px 2px; font-family: var(--sans); }
.cb-crumb:hover { text-decoration: underline; }
.cb-crumb.current { color: var(--ink); cursor: default; font-weight: 600; }
.cb-sep { color: var(--ink-faint); }
.cb-volumes { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.cb-vol { display: flex; flex-direction: column; gap: 2px; text-align: left; background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; cursor: pointer; }
.cb-vol:hover { border-color: var(--gold-dim); }
.cb-vol.here { outline: 1px solid var(--gold-dim); }
.cb-vol-name { font-family: var(--serif); font-size: 16px; }
.cb-vol-sub { font-size: 12px; color: var(--ink-faint); }
.cb-books { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.cb-book { display: flex; justify-content: space-between; align-items: center; gap: 8px; background: var(--panel2); border: 1px solid var(--line); color: var(--ink); border-radius: 9px; padding: 9px 12px; cursor: pointer; font-size: 14px; text-align: left; font-family: var(--sans); }
.cb-book:hover { border-color: var(--gold-dim); color: var(--gold); }
.cb-book.here { border-color: var(--gold); color: var(--gold); }
.cb-book-n { font-size: 11px; color: var(--ink-faint); }
.cb-chapters { display: flex; flex-wrap: wrap; gap: 6px; }
.cb-chapters-head { width: 100%; font-size: 13px; color: var(--ink-faint); margin-bottom: 4px; }
.cb-ch { width: 36px; height: 32px; display: flex; align-items: center; justify-content: center; border-radius: 7px; font-size: 13px; color: var(--ink-dim); background: var(--panel2); border: 1px solid var(--line); }
.cb-ch:hover { color: var(--gold); border-color: var(--gold-dim); text-decoration: none; }
.cb-ch.here { background: var(--gold); color: #241b08; font-weight: 700; border-color: var(--gold); }
