:root{color-scheme:dark;--bg:#101113;--surface:#181a1e;--line:#303035;--text:#f2ece1;--muted:#b3a99b;--gold:#e2bb82;--accent:#352a20;font-family:Tahoma,Arial,sans-serif}
*{box-sizing:border-box}
body{margin:0;background:var(--bg);color:var(--text);font-size:1rem;line-height:1.8}
button,input,textarea,select{font:inherit}
button,a,input,textarea,select{outline-offset:4px}
a{color:var(--gold)}
button{cursor:pointer;border:1px solid transparent;border-radius:9px;padding:.55rem 1rem;background:var(--gold);color:#20170e;font-weight:bold;min-height:44px}
button:hover{filter:brightness(1.17)}
button.quiet,.button{background:#202126;border:1px solid #414047;color:var(--text)}
.button{display:inline-block;text-decoration:none;padding:.5rem .85rem;border-radius:9px}
header{height:76px;padding:0 clamp(1rem,4vw,3.5rem);border-bottom:1px solid var(--line);display:flex;justify-content:space-between;align-items:center;background:#141517}
.brand{display:flex;align-items:center;gap:.8rem;line-height:1.45}
.brand strong{font-size:1.1rem}
small,.muted{color:var(--muted)}
.brand small{display:block;font-size:.8rem}
.seal{font-size:1.65rem;color:var(--gold);width:43px;height:43px;display:grid;place-items:center;border:1px solid #725635;border-radius:12px;background:#2b221a}
.shell{display:grid;grid-template-columns:220px minmax(0,1fr);max-width:1440px;margin:auto;min-height:calc(100vh - 76px)}
aside{padding:2rem 1rem;border-inline-end:1px solid var(--line)}
nav{display:grid;gap:.45rem}
nav a{display:flex;align-items:center;gap:.8rem;padding:.65rem .85rem;border:1px solid transparent;color:var(--muted);text-decoration:none;border-radius:9px;white-space:nowrap}
nav a[aria-current]{background:var(--accent);color:var(--gold);border-color:#624a32}
i{font-style:normal;width:1.1rem;text-align:center}
.sidebar-note{margin:2.5rem .75rem 0;border-top:1px solid var(--line);padding-top:1rem;color:var(--gold);font-size:.9rem}
.sidebar-note p{margin:.25rem 0;color:var(--muted)}
main{padding:clamp(1rem,4vw,3.25rem);min-width:0}
h1,h2,h3,p{margin:0 0 .65rem}
h1{font-size:clamp(1.65rem,4vw,2.8rem);line-height:1.35}
h2{font-size:1.2rem}h3{font-size:1.03rem}
.hero{position:relative;overflow:hidden;isolation:isolate;border:1px solid #5b4633;border-radius:18px;padding:clamp(1.25rem,4vw,2.8rem);background:linear-gradient(105deg,#201a18,#22191d 50%,#1b191c);margin-bottom:1.2rem}
.hero::before,.hero::after{content:"";position:absolute;z-index:-1;pointer-events:none;inset-inline-end:clamp(-150px,-4vw,-20px);top:-100px;width:420px;aspect-ratio:1;border-radius:50%;opacity:.5}
.hero::before{background:repeating-radial-gradient(circle,transparent 0 23px,#866441 24px,transparent 25px 39px),radial-gradient(circle,#64442b,transparent 67%);mask-image:linear-gradient(90deg,#000,transparent)}
.hero::after{border:1px solid #866441;transform:rotate(-35deg) scaleY(.42)}
.eyebrow{color:var(--gold);font-size:.9rem;margin-bottom:.7rem}
.hero p{max-width:35rem;color:#d0c4b4;margin-bottom:1.2rem}
.row{display:flex;gap:.65rem;align-items:center;flex-wrap:wrap}
.spread{justify-content:space-between}
.grid{display:grid;gap:1rem;grid-template-columns:repeat(2,minmax(0,1fr));margin:1rem 0}
.stats{grid-template-columns:repeat(3,minmax(0,1fr))}
.card{background:var(--surface);border:1px solid var(--line);border-radius:13px;padding:1.2rem;min-width:0;overflow-wrap:anywhere}
.stat strong{display:block;font-size:1.65rem;color:var(--gold)}
.stack{display:grid;gap:.8rem;margin:1rem 0}
progress{width:100%;height:12px;accent-color:var(--gold)}
.empty{border-style:dashed;color:var(--muted)}
.headline{margin-bottom:1.2rem}
.pill{display:inline-block;border:1px solid #554534;background:#27211d;border-radius:20px;padding:.12rem .65rem;color:var(--gold);font-size:.88rem;text-decoration:none}
.filters{display:grid;grid-template-columns:repeat(auto-fit,minmax(130px,1fr));gap:.7rem;margin:.9rem 0}
label{display:grid;gap:.25rem;color:var(--muted);font-size:.9rem}
input,textarea,select{width:100%;border:1px solid #45434a;background:#141519;color:var(--text);border-radius:8px;padding:.55rem .7rem;min-height:44px;font-size:1rem}
textarea{resize:vertical;min-height:92px}
dialog{border:1px solid #5d5144;background:#1b1b20;border-radius:15px;color:var(--text);width:min(94vw,650px);max-height:90dvh;padding:1.3rem}
dialog::backdrop{background:#000a}
form .stack{margin-bottom:1.3rem}
fieldset{border:1px solid var(--line);border-radius:8px;margin:0;padding:.8rem;min-width:0}
.pre{white-space:pre-wrap}
img.attachment{display:block;max-width:100%;max-height:350px;border-radius:8px;margin:.5rem 0}
#toast{position:fixed;z-index:2;bottom:1rem;inset-inline-start:1rem;max-width:90vw;background:#302519;border-radius:8px;color:#fff;padding:.5rem .9rem}
#toast:empty{display:none}
@media(max-width:760px){header{height:65px}.shell{display:block}aside{padding:.6rem .8rem;border-inline-end:0;border-bottom:1px solid var(--line)}nav{display:flex;overflow-x:auto}nav a{padding:.45rem .6rem;font-size:.9rem}nav i,.sidebar-note{display:none}main{padding:1rem}.hero::before{opacity:.25}}
@media(max-width:480px){.grid:not(.stats){grid-template-columns:1fr}.card{padding:.85rem}.stats{gap:.4rem}.stat{font-size:.83rem}.stat strong{font-size:1.3rem}}
.person-details{display:grid;grid-template-columns:repeat(auto-fit,minmax(112px,1fr));gap:.75rem;margin:.65rem 0}
.person-details dt{color:var(--muted);font-size:.9rem}
.person-details dd{margin:0}
summary{cursor:pointer;color:var(--gold)}
.archive{margin-block:1rem}
.archive li{margin-block:.25rem}
.archive-tiles{grid-template-columns:repeat(3,minmax(0,1fr))}
.archive-tile{text-decoration:none;color:var(--text)}
.archive-tile:hover,.archive-tile:focus-visible{border-color:var(--gold)}
.archive-tile span{color:var(--gold)}
.reading-gate{border-color:#645037}
@media(max-width:760px){nav{display:flex;flex-wrap:wrap;overflow:visible;gap:.25rem}nav a{padding:.38rem .55rem;min-height:42px}}
@media(max-width:480px){.grid.archive-tiles{grid-template-columns:repeat(3,minmax(0,1fr));gap:.4rem}.archive-tile{padding:.62rem}.archive-tile h2{font-size:.95rem}.archive-tile span{font-size:.78rem}}

.pathway summary{cursor:pointer;min-height:44px;padding-block:.4rem;color:var(--gold)}
.pathway dl{margin:.4rem 0 0}
.pathway dl>div{display:grid;grid-template-columns:minmax(8rem,1fr) 3fr;gap:.65rem;padding:.55rem 0;border-top:1px solid var(--line)}
.pathway dd{margin:0}
.pathway dd span{display:block;font-size:.9rem;text-align:start}

.lookup{margin-bottom:1rem}
.lookup .row{align-items:end}
.lookup p{margin:.5rem 0 0}
.lookup p:empty{display:none}

.review-events{padding-inline-start:1.6rem}
.review-events li+li{margin-top:.45rem}

.atlas-current,.atlas-search{margin-bottom:1rem}
.atlas-current strong{color:var(--gold);font-size:1.2rem}
.atlas-map{padding:1rem;margin:1rem 0;border:1px solid #62503d;border-radius:16px;background:repeating-linear-gradient(0deg,transparent 0 31px,#e2bb8210 32px),repeating-linear-gradient(90deg,transparent 0 31px,#e2bb8210 32px),#1d2325;display:grid;gap:.8rem;grid-template-columns:repeat(2,minmax(0,1fr))}
.atlas-region{border:1px solid #7b674d;border-radius:14px;padding:.8rem;background:#29251ddd}
.atlas-region:nth-child(2){background:#343022dd}
#atlas-trier-map,#atlas-below,#atlas-other{grid-column:1/-1}
#atlas-below{border-style:dashed;background:#211d29dd}
#atlas-other{background:#24232add}
.atlas-nodes{display:flex;flex-wrap:wrap;gap:.4rem}
.atlas-node{font-size:.9rem}
.atlas-node[aria-current]{background:var(--gold);color:#20170e;border-color:var(--gold)}
.atlas-place:focus{outline:2px solid var(--gold)}
.atlas-place[hidden]{display:none}
@media(max-width:540px){.atlas-map{grid-template-columns:1fr}}

.atlas-map{position:relative;isolation:isolate;overflow:hidden}
.atlas-terrain{position:absolute;inset:0;width:100%;height:100%;z-index:-1;opacity:.72}

.world-atlas{margin-bottom:1rem}
.world-destinations{margin:.65rem 0}
.world-stage{position:relative;border:1px solid #857252;background:#182d39;border-radius:12px;overflow:hidden}
.world-stage svg{display:block;width:100%;height:clamp(285px,55vw,610px);touch-action:none;cursor:grab;user-select:none}
.world-stage svg:active{cursor:grabbing}
.world-stage svg:focus-visible{outline:2px solid var(--gold);outline-offset:-3px}
.world-stage svg text{text-anchor:middle;font-family:Tahoma,Arial,sans-serif;direction:rtl}
.world-land{fill:#7e7950;stroke:#d5c292;stroke-width:1.6}
.world-unknown{fill:url(#world-unknown)}
.world-borders{fill:none;stroke:#d2c493;stroke-width:1.3;stroke-dasharray:5 4}
.world-river{fill:none;stroke:#8bd2e5;stroke-width:2;opacity:.8}
.world-ocean{fill:#c2e1e9;font-size:15px}
.world-region{fill:#fff3d7;font-weight:bold;font-size:17px;paint-order:stroke;stroke:#2a2b25;stroke-width:3px;stroke-linejoin:round}
.world-city{fill:#fff9eb;stroke:#241f15}
.world-city text{font-size:12px;paint-order:stroke;stroke-width:2px}
.world-marker circle{fill:#ffce67;stroke:#251b12;stroke-width:2}
.world-marker path{fill:#5b2524}
.world-compass{fill:#e6c885;font-size:12px}
.world-controls{position:absolute;left:.55rem;bottom:.55rem;display:grid;gap:.3rem}
.world-controls button{font-size:1.2rem;padding:0;width:44px}
.world-hint,.world-credits{margin:.65rem 0 0;font-size:.9rem}

:root{--bg:#0b121e;--surface:#121d2e;--line:#2a384a;--text:#f5eddd;--muted:#bdc6d4;--gold:#edc584;--accent:#2b2730}
body{background:radial-gradient(ellipse at 15% 0,#172538 0,transparent 43rem),var(--bg)}
header{background:#0e1827;border-bottom-color:#6a5234}
.card{background:linear-gradient(145deg,#152236,#101a29)}
.illustrated-hero,.chapter-cover{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);align-items:center;overflow:hidden;border:1px solid #7d603c;border-radius:18px;margin-bottom:1.2rem}
.illustrated-hero{padding:0;background:linear-gradient(130deg,#182c51,#101a2c)}
.hero-copy,.chapter-cover .headline{padding:clamp(1.1rem,3.5vw,2.6rem)}
.hero-art,.chapter-cover img{display:block;width:100%;height:auto}
.chapter-cover{grid-template-columns:minmax(0,1fr) minmax(140px,26%);background:linear-gradient(135deg,#321d29,#101a2c)}
.chapter-cover .headline{margin:0}
@media(max-width:540px){.illustrated-hero{grid-template-columns:1fr}.chapter-cover{grid-template-columns:minmax(0,1fr) minmax(93px,35%)}.chapter-cover h1{font-size:clamp(1rem,5vw,1.55rem)}}
.hero::before,.hero::after{display:none}
.hero p{color:#f4e8d1}
.world-atlas{padding:clamp(.65rem,2vw,1.5rem)}
.world-stage{background:#071a28}
.world-stage svg{height:clamp(440px,75vw,790px)}
.world-stage svg text{fill:#fff1ce;stroke:#0a1d2a;stroke-width:3px;stroke-linejoin:round;paint-order:stroke}
.world-point{cursor:pointer}
.world-point text{font-size:22px;font-weight:bold}
.world-point circle{fill:#f1d08f;stroke:#241804;stroke-width:2px}
.world-point .world-latin{font-family:Georgia,serif;font-size:14px;direction:ltr}
.world-settlement text{font-size:19px}
.world-settlement .world-latin{font-size:12px}
.world-point:hover text,.world-point:focus-visible text{fill:#ffdc83}
.world-political path{stroke:#f9dda7;stroke-width:2.5;stroke-dasharray:7 5;fill:none}
.world-route path{fill:none;stroke:#ffca68;stroke-width:4;stroke-dasharray:9 7;filter:drop-shadow(0 0 4px #ac6319)}
.world-route .world-journey-spirit{stroke:#b7d8ff;stroke-dasharray:2 7}
.world-route .world-journey-special,.world-route .world-journey-dream{stroke:#d9b8ff;stroke-dasharray:2 8}
.world-weather ellipse{fill:#d2efff19;stroke:#bed9f34a;stroke-width:2;stroke-dasharray:3 6}
.world-weather text{font-size:28px}
.world-marker .world-halo{fill:#ffcf5d40;stroke:#ffe19d;stroke-width:1;filter:drop-shadow(0 0 6px #ffb449)}
.hide-weather .world-weather,.hide-relief .world-relief,.hide-political .world-political,.hide-route .world-route{display:none}
.world-search{display:block;max-width:26rem;margin:.65rem 0}
.world-search input{margin-top:.3rem}
.world-results:not(:empty){margin-bottom:.6rem}
.world-info:not(:empty){padding:.7rem 0}
.world-info p{margin:.25rem 0 0;color:var(--muted)}
.world-layers{margin:.65rem 0}
.world-layers label{display:flex;align-items:center;gap:.35rem}
.world-layers input{width:1.1rem;height:1.1rem;min-height:0;accent-color:var(--gold)}
.world-timeline{margin:1rem 0}
.world-timeline ol{max-height:23rem;overflow:auto;padding-inline-start:2rem}
.world-timeline li{padding:.6rem 0;border-bottom:1px solid var(--line)}
.world-timeline .row{margin:.25rem 0}
.world-expanded{position:fixed;inset:0;z-index:80;border-radius:0}
.world-expanded svg{height:100%;width:100%}
.atlas-expanded{overflow:hidden}
.world-expanded .world-controls{bottom:max(.8rem,env(safe-area-inset-bottom));left:max(.8rem,env(safe-area-inset-left))}
.atlas-facts{display:grid;grid-template-columns:repeat(auto-fit,minmax(175px,1fr));gap:.55rem}
.atlas-facts div{padding:.5rem;border-inline-start:2px solid #80643c}
.atlas-facts dt{color:var(--muted)}
.atlas-facts dd{margin:0}
.atlas-mini{display:grid;place-items:center;min-height:160px;overflow:hidden;border:1px solid #735735;border-radius:10px;background:#0a1c2b}
.atlas-mini svg{width:100%;height:155px;display:block}
.atlas-mini span{padding:.45rem}
.atlas-mini text{fill:#fff2ca;stroke:#17202e;stroke-width:2px;paint-order:stroke;font: bold 16px Tahoma,Arial,sans-serif;text-anchor:middle}
.atlas-mini .world-latin{font-size:11px}
.atlas-mentioned{margin:1rem 0}
@media(max-width:540px){.world-stage svg{height:clamp(380px,120vw,560px)}.world-expanded svg{height:100%}}
