:root{
  --bg:#050711; --panel:#0d1224; --panel2:#111832; --text:#e9efff; --muted:#9ba8c4; --line:#26314f;
  --robot:#80d8ff; --spacer:#6ee7c8; --empire:#ffb86b; --foundation:#d7b7ff; --gaia:#b9ff9b; --accent:#8bdcff;
}
*{box-sizing:border-box}
body{margin:0;background:radial-gradient(circle at top,#101936 0,#050711 46%,#02030a 100%);color:var(--text);font-family:Inter,system-ui,sans-serif}
.site-header{display:flex;justify-content:space-between;gap:18px;align-items:center;padding:14px 22px 10px;border-bottom:1px solid rgba(255,255,255,.08);position:sticky;top:0;z-index:10;background:rgba(5,7,17,.86);backdrop-filter:blur(12px)}
.eyebrow{margin:0 0 3px;text-transform:uppercase;letter-spacing:.18em;color:var(--muted);font-size:10px;font-weight:750}.eyebrow.small{font-size:9px}
h1{font-size:clamp(22px,3vw,38px);line-height:1;margin:0}h2{margin:0;font-size:20px}h3{margin:0 0 8px;font-size:15px}p{color:var(--muted);line-height:1.5}.panel-head p{margin:5px 0 0;font-size:12px}.header-actions{display:flex;gap:8px;flex-wrap:wrap}
button{border:1px solid rgba(139,220,255,.25);background:rgba(139,220,255,.08);color:var(--text);border-radius:999px;padding:7px 12px;cursor:pointer}button:hover,button.active{background:rgba(139,220,255,.2)}button:disabled{opacity:.35;cursor:default}
.tabs{display:flex;gap:8px;padding:10px 22px;background:rgba(5,7,17,.55);position:sticky;top:63px;z-index:9;backdrop-filter:blur(10px)}.tab{border-color:rgba(255,255,255,.12);background:rgba(255,255,255,.04)}
main{padding:16px 22px 26px}.tab-panel{display:none}.tab-panel.active{display:block}.map-layout{display:grid;grid-template-columns:minmax(0,1fr) 360px;gap:14px}.side-stack{display:flex;flex-direction:column;gap:14px}.panel{background:linear-gradient(180deg,rgba(17,24,50,.94),rgba(8,12,28,.96));border:1px solid rgba(255,255,255,.09);border-radius:18px;padding:14px;box-shadow:0 18px 50px rgba(0,0,0,.25)}.panel-head{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;margin-bottom:8px}.map-panel{min-height:600px}.book-panel{min-height:360px}.world-panel{min-height:220px}.timeline-panel,.xy-panel,.bibliography-panel,.source-panel{margin-top:14px}.hero-timeline{margin-top:14px;margin-bottom:0}.timeline-below{clear:both}svg{width:100%;height:auto;display:block}
.legend{display:flex;gap:7px;flex-wrap:wrap;justify-content:flex-end}
#mapLegend{flex-direction:column;flex-wrap:nowrap;align-items:flex-start;justify-content:flex-start}.xy-controls{display:flex;gap:10px;align-items:flex-start;justify-content:flex-end;flex-wrap:wrap}.chip{display:inline-flex;align-items:center;gap:6px;border:1px solid rgba(255,255,255,.14);border-radius:999px;padding:5px 8px;font-size:11px;color:var(--muted);user-select:none;cursor:pointer}.chip input{accent-color:var(--accent);margin:0}.chip.disabled{opacity:.32}.chip i{width:10px;height:10px;border-radius:999px;display:inline-block}.meta-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:12px 0}.meta{background:rgba(255,255,255,.04);border:1px solid rgba(255,255,255,.08);border-radius:12px;padding:8px}.meta span{display:block;color:var(--muted);font-size:10px;text-transform:uppercase;letter-spacing:.08em}.meta b{font-size:13px}.book-notes{font-size:13px}.nav-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px}.nav-grid span{display:block;color:var(--muted);font-size:10px;text-transform:uppercase;letter-spacing:.08em;margin-bottom:4px}.nav-grid button{width:100%;border-radius:12px;text-align:left;font-size:12px;min-height:42px}.location-notes{margin-top:14px;font-size:12px;color:var(--muted);display:grid;gap:8px}.inline-world-button{width:100%;border-radius:12px;text-align:left;color:var(--muted);background:rgba(255,255,255,.035);border-color:rgba(255,255,255,.08)}.inline-world-button b{color:var(--text)}
.world-meta{font-size:12px;margin:8px 0 10px}.world-book-list{display:grid;gap:7px}.world-book-button{width:100%;display:block;text-align:left;border-radius:12px;background:rgba(255,255,255,.04);border-color:rgba(255,255,255,.1);padding:8px 10px}.world-book-button b{display:block;font-size:12px}.world-book-button span{display:block;color:var(--muted);font-size:11px;margin-top:2px}.world-book-button.active{background:rgba(139,220,255,.16);border-color:rgba(139,220,255,.35)}
.axis text,.small-label,.label{fill:#b9c5df;font-size:11px}.timeline-label{font-size:10.5px;paint-order:stroke;stroke:#050711;stroke-width:3px;stroke-linejoin:round;dominant-baseline:middle}.axis path,.axis line{stroke:#50617f}.grid line{stroke:#1e2945}.grid path{display:none}.galaxy-arm{fill:none;stroke:rgba(145,181,255,.16);stroke-width:24;stroke-linecap:round;filter:url(#armBlur)}.galaxy-arm-thin{fill:none;stroke:rgba(219,235,255,.22);stroke-width:1.4;stroke-linecap:round}.dust,.star{fill:#dce8ff}.core-glow{filter:url(#softGlow)}.route{fill:none;stroke:rgba(139,220,255,.5);stroke-width:2.2;stroke-dasharray:6 8}.book-world-link{stroke:rgba(255,255,255,.32);stroke-width:1.4;stroke-dasharray:4 6;fill:none}.node text{pointer-events:none}.node circle{transition:opacity .18s, r .18s}.node.filtered,.time-mark.filtered,.scatter.filtered,.spacer-dot.filtered,.route-dot.filtered{opacity:.12}.node.dimmed{opacity:1}.active-mark circle,.active-mark{filter:url(#softGlow)}.active-world circle{stroke:#fff;stroke-width:2.4}.selected-world circle{stroke:var(--accent);stroke-width:3}.route-dot{transition:opacity .2s,r .2s}.band-bg{opacity:.08;pointer-events:none}.band-label{font-size:12px;font-weight:750;fill:#d8e3ff}.filters{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin:12px 0}input[type=search]{background:rgba(255,255,255,.06);border:1px solid rgba(255,255,255,.14);border-radius:999px;color:var(--text);padding:9px 14px;min-width:260px}.domain-filters{display:flex;gap:6px;flex-wrap:wrap}.bib-list{display:grid;grid-template-columns:repeat(auto-fill,minmax(230px,1fr));gap:10px;margin-top:12px}.bib-card,.note-grid article{background:rgba(255,255,255,.04);border:1px solid rgba(255,255,255,.08);border-radius:14px;padding:12px}.bib-card p{margin:0;font-size:12px}.note-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(230px,1fr));gap:12px;margin-top:14px}.tooltip{position:fixed;z-index:30;pointer-events:none;opacity:0;transform:translate(12px,12px);max-width:320px;background:rgba(2,4,12,.96);border:1px solid rgba(255,255,255,.18);border-radius:12px;padding:10px 12px;font-size:12px;line-height:1.45;box-shadow:0 12px 30px rgba(0,0,0,.35)}.tooltip b{display:block;color:#fff;margin-bottom:4px}footer{padding:16px 22px 26px;color:var(--muted);font-size:12px}
@media(max-width:980px){.map-layout{grid-template-columns:1fr}.tabs{top:58px;overflow:auto}.book-panel{min-height:auto}.site-header{align-items:flex-start;flex-direction:column}.panel-head{flex-direction:column}.legend{justify-content:flex-start}}

.timeline-leader{stroke-opacity:.62;stroke-width:1.2;vector-effect:non-scaling-stroke}.timeline-underline{stroke-width:1.2;stroke-opacity:.95;vector-effect:non-scaling-stroke}

.map-stage{position:relative;min-height:560px}.map-legend-overlay{position:absolute;top:12px;right:12px;z-index:3;background:rgba(5,7,17,.34);border:1px solid rgba(255,255,255,.12);border-radius:14px;padding:8px 9px;backdrop-filter:blur(5px);box-shadow:none}.map-legend-overlay .chip{background:rgba(5,7,17,.18);border-color:rgba(255,255,255,.12)}.duration-mark{stroke-width:8;stroke-linecap:round;stroke-opacity:.9;filter:url(#softGlow)}.time-mark circle{filter:url(#softGlow)}.break-mark{fill:none;stroke:#6f7d98;stroke-width:1.8;stroke-linecap:round}.timeline-leader{stroke-opacity:.58;stroke-width:1.1;vector-effect:non-scaling-stroke}.timeline-underline{stroke-width:1.15;stroke-opacity:.95;vector-effect:non-scaling-stroke}.timeline-label{font-size:10.2px;paint-order:stroke;stroke:#050711;stroke-width:3.5px;stroke-linejoin:round;dominant-baseline:middle}.active-mark .duration-mark,.active-mark circle{stroke:#fff;stroke-width:1.5;filter:url(#softGlow)}
/* V9 visualization refinements */
.duration-band{stroke-width:1.1;fill-opacity:.88;filter:url(#softGlow)}
.active-mark .duration-band{stroke:#fff;stroke-width:1.8;fill-opacity:1}
.xy-panel{max-height:calc(100vh - 150px);overflow:hidden}.xy-panel svg{max-height:calc(100vh - 255px)}
.xy-label{font-size:9.6px;paint-order:stroke;stroke:#050711;stroke-width:3px;stroke-linejoin:round;dominant-baseline:middle}.xy-leader{stroke-opacity:.45}.xy-underline{stroke-opacity:.82}.scatter-point.filtered{opacity:.12}

/* V10 layout and bibliography pass */
.map-panel{padding:0;overflow:hidden}.map-stage{min-height:600px;border-radius:18px;overflow:hidden}.map-title-overlay{position:absolute;top:14px;left:14px;z-index:3;background:rgba(5,7,17,.28);border:1px solid rgba(255,255,255,.10);border-radius:14px;padding:8px 11px;backdrop-filter:blur(4px)}.map-title-overlay h2{font-size:18px}.map-legend-overlay{top:14px;right:14px;background:rgba(5,7,17,.24);backdrop-filter:blur(4px)}
#locationNotes{grid-template-columns:1fr 1fr}.inline-world-button{min-height:74px}.timeline-underline,.xy-underline{stroke-width:1.25;stroke-opacity:.9}.bibliography-panel svg{margin-top:4px}.bib-controls select{background:rgba(255,255,255,.06);border:1px solid rgba(255,255,255,.14);border-radius:999px;color:var(--text);padding:8px 12px;max-width:230px}.bib-controls option{background:#10162b;color:#e9efff}.bib-series-line{fill:none;stroke:rgba(255,255,255,.22);stroke-width:1.1;stroke-dasharray:2 4}.bib-axis-label{fill:#b9c5df;font-size:11px}.bib-dot{cursor:pointer}.bib-dot.filtered{opacity:.14}.table-wrap{overflow:auto;margin-top:12px;border:1px solid rgba(255,255,255,.09);border-radius:14px}.bib-table{width:100%;border-collapse:collapse;font-size:12px}.bib-table th,.bib-table td{padding:8px 10px;border-bottom:1px solid rgba(255,255,255,.07);vertical-align:top}.bib-table th{position:sticky;top:0;background:rgba(13,18,36,.98);z-index:1;text-align:left;color:#d9e6ff;cursor:pointer;white-space:nowrap}.bib-table th::after{content:' ⇅';color:#73809b;font-weight:400}.bib-table tr:hover td{background:rgba(139,220,255,.06)}.bib-shape-note{fill:#9ba8c4;font-size:11px}
@media(max-width:980px){#locationNotes{grid-template-columns:1fr}.map-title-overlay,.map-legend-overlay{position:static;margin:8px;display:inline-flex}.map-stage{min-height:auto}}

/* V11 bibliography structure: signed Y-axis */
#bibTimeline{min-height:820px;}
.bib-zero-line{stroke:rgba(255,255,255,.34);stroke-width:1.5;}
.bib-section-label{fill:#cdd8ef;font-size:11px;font-weight:650;letter-spacing:.02em;}
.bib-cat-label{fill:#9ba8c4;font-size:10.5px;paint-order:stroke;stroke:#050711;stroke-width:3px;stroke-linejoin:round;}
.bib-cat-guide{stroke:rgba(255,255,255,.055);stroke-width:1;}
.bib-mark-label{font-size:9.2px;paint-order:stroke;stroke:#050711;stroke-width:3px;stroke-linejoin:round;dominant-baseline:middle;}
.bib-label-leader{fill:none;stroke-width:1;stroke-opacity:.62;vector-effect:non-scaling-stroke;}

/* V12 interaction and timeline-axis fixes */
.hit-target{pointer-events:all;cursor:pointer;}
.time-mark,.node,.scatter-point{cursor:pointer;}
.timeline-era-label{fill:#d8e3ff;font-weight:700;letter-spacing:.02em;}
.timeline-year-label{fill:#9ba8c4;font-size:10px;}
.timeline-year-axis .tick text{font-size:10px;fill:#9ba8c4;}
.bib-table tbody tr{cursor:pointer;}
.bib-table tbody tr:focus td{background:rgba(139,220,255,.10);outline:none;}
.bib-dot.active-bib{stroke:#fff;stroke-width:2.2;filter:url(#softGlow);}
.bib-mark-label.active-bib-label{font-weight:750;}
