
:root{
  --ink:#1c1a16;
  --bg:#171612;
  --bg-2:#201e18;
  --panel:#242118;
  --panel-2:#2a261d;
  --parchment:#d6ccb5;
  --parchment-2:#c8bda4;
  --paper-line:#8c826f;
  --text:#eee5d4;
  --muted:#aaa08c;
  --gold:#b99b5d;
  --gold-soft:#d6c089;
  --green:#55715e;
  --red:#87564d;
  --blue:#526a78;
  --shadow:0 24px 70px rgba(0,0,0,.38);
}
*{box-sizing:border-box}
html,body{margin:0;min-height:100%;background:var(--bg);color:var(--text);font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}
body{background:
 radial-gradient(1000px 600px at 20% -10%,rgba(185,155,93,.08),transparent 65%),
 radial-gradient(900px 500px at 100% 5%,rgba(85,113,94,.08),transparent 65%),
 linear-gradient(180deg,#191713,#13120f 75%);
 overflow-x:hidden}
body:before{content:"";position:fixed;inset:0;pointer-events:none;opacity:.18;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.16'/%3E%3C/svg%3E");mix-blend-mode:soft-light}
button,input{font:inherit}
button{color:inherit}
.app{min-height:100vh}
.topbar{height:74px;display:flex;align-items:center;justify-content:space-between;gap:20px;padding:0 28px;border-bottom:1px solid rgba(185,155,93,.19);background:rgba(18,17,14,.88);backdrop-filter:blur(18px);position:sticky;top:0;z-index:50}
.brand{display:flex;align-items:center;gap:13px;min-width:0}.monogram{width:42px;height:42px;border:1px solid rgba(214,192,137,.65);border-radius:50%;display:grid;place-items:center;font-family:Georgia,serif;color:var(--gold-soft);font-size:19px;box-shadow:inset 0 0 0 5px rgba(185,155,93,.05)}
.brand-title{font-family:Georgia,"Times New Roman",serif;font-size:18px;letter-spacing:.12em;text-transform:uppercase;white-space:nowrap}.brand-sub{font-size:10px;color:var(--muted);letter-spacing:.09em;margin-top:3px;white-space:nowrap}
.top-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;justify-content:flex-end}
.btn{border:1px solid rgba(238,229,212,.14);background:rgba(255,255,255,.025);border-radius:999px;padding:9px 13px;font-size:12px;cursor:pointer;transition:.22s ease;color:#ddd3c0}.btn:hover{border-color:rgba(214,192,137,.55);background:rgba(185,155,93,.08)}.btn.active{border-color:var(--gold);background:rgba(185,155,93,.13);color:#f2e9d8}.btn.icon{width:38px;height:38px;padding:0;display:grid;place-items:center;font-size:17px}.btn.primary{background:rgba(185,155,93,.16);border-color:rgba(214,192,137,.48)}
.layout{max-width:1720px;margin:0 auto;padding:18px 20px 26px;display:grid;grid-template-columns:minmax(0,1.7fr) minmax(330px,.62fr);gap:16px}
.card{border:1px solid rgba(185,155,93,.15);background:linear-gradient(180deg,rgba(40,36,27,.93),rgba(26,24,19,.96));border-radius:18px;box-shadow:var(--shadow);overflow:hidden}
.map-card{min-height:620px;position:relative;background:#bdb49f}
.map-toolbar{position:absolute;left:16px;right:16px;top:15px;z-index:12;display:flex;justify-content:space-between;gap:10px;pointer-events:none}.toolbar-block{pointer-events:auto;display:flex;gap:7px;flex-wrap:wrap}.map-toolbar .btn{background:rgba(28,26,22,.86);backdrop-filter:blur(10px);border-color:rgba(233,224,205,.16);box-shadow:0 8px 20px rgba(0,0,0,.16)}
.year-badge{pointer-events:auto;background:rgba(28,26,22,.91);border:1px solid rgba(214,192,137,.28);border-radius:15px;padding:11px 14px 10px;min-width:124px;box-shadow:0 8px 22px rgba(0,0,0,.2)}.year-badge .eyebrow{font-size:9px;color:#c7b88f;letter-spacing:.16em;text-transform:uppercase}.year-badge strong{font:34px/1 Georgia,serif;display:block;margin:4px 0 2px}.year-badge span{font-size:10px;color:#aaa18e}
#worldMap{display:block;width:100%;height:620px;background:linear-gradient(180deg,#cfc5ae,#bcb29c);touch-action:none;cursor:grab}.map-card.dragging #worldMap{cursor:grabbing}
.sea{fill:#bdb39b}.graticule line{stroke:#8c826f;stroke-width:.45;opacity:.25;vector-effect:non-scaling-stroke}.country{fill:#d8cfbc;stroke:#7e7564;stroke-width:.62;vector-effect:non-scaling-stroke;transition:fill .18s,stroke .18s,opacity .18s}.country:hover{fill:#ded5c4}.country.kyrgyz-highlight{fill:#e9dcc0;stroke:#3f4d3e;stroke-width:2.2;filter:url(#countryGlow)}
.empire-path{vector-effect:non-scaling-stroke;stroke-width:1.4;stroke-linejoin:round;stroke-linecap:round;transition:filter .2s,opacity .25s;cursor:pointer}.empire-path:hover,.empire-path.selected{filter:url(#empireGlow);stroke-width:2.2}.empire-path.local{stroke-dasharray:5 4}.empire-path.fuzzy{stroke-dasharray:8 5}.empire-label{font:600 11px Georgia,serif;letter-spacing:.04em;fill:#211f1a;paint-order:stroke;stroke:rgba(232,222,199,.66);stroke-width:3px;stroke-linejoin:round;pointer-events:none;opacity:.72}.empire-label.small{font-size:9px}.modern-label{font:600 10px Inter,sans-serif;fill:#27241e;paint-order:stroke;stroke:#e1d8c6;stroke-width:3px;pointer-events:none}
.place-dot{cursor:pointer}.place-dot circle.core{fill:#27231c;stroke:#f1dfaa;stroke-width:1.4;vector-effect:non-scaling-stroke}.place-dot text{font:10px Inter,sans-serif;fill:#28251f;paint-order:stroke;stroke:rgba(224,215,196,.9);stroke-width:3px;pointer-events:none}.place-dot.active circle.core{fill:#5b3f31;stroke:#f3d796}.route{fill:none;stroke:#6a4937;stroke-width:2.5;stroke-dasharray:10 8;vector-effect:non-scaling-stroke;animation:dash 5s linear infinite;filter:url(#routeGlow)}@keyframes dash{to{stroke-dashoffset:-72}}
.empire-group.enter{opacity:0}.empire-group{transition:opacity .62s ease}.empire-group.enter.show{opacity:1}.empire-group.leave{opacity:0}
.map-legend{position:absolute;left:16px;bottom:16px;z-index:12;width:min(380px,calc(100% - 32px));background:rgba(28,26,22,.90);border:1px solid rgba(214,192,137,.22);border-radius:14px;padding:11px 12px 12px;backdrop-filter:blur(12px);box-shadow:0 10px 30px rgba(0,0,0,.2)}.legend-top{display:flex;align-items:center;justify-content:space-between;gap:10px}.legend-top b{font:13px Georgia,serif}.legend-top span{font-size:9px;color:#aaa18e}.legend-items{display:flex;gap:7px;flex-wrap:wrap;margin-top:9px}.legend-item{display:flex;align-items:center;gap:6px;font-size:10px;color:#d6cdb9;cursor:pointer;padding:4px 6px;border-radius:7px}.legend-item:hover{background:rgba(255,255,255,.04)}.swatch{width:12px;height:8px;border-radius:2px;border:1px solid rgba(255,255,255,.24)}
.opacity-control{position:absolute;right:16px;bottom:16px;z-index:12;background:rgba(28,26,22,.90);border:1px solid rgba(214,192,137,.22);border-radius:14px;padding:10px 12px;width:210px;backdrop-filter:blur(12px)}.opacity-control label{display:flex;justify-content:space-between;font-size:9px;color:#c9bea8;margin-bottom:6px}.opacity-control input{width:100%;accent-color:#a78954}
.tooltip{position:absolute;z-index:30;pointer-events:none;opacity:0;transform:translate(10px,10px);background:rgba(24,22,18,.96);color:#eee5d4;border:1px solid rgba(214,192,137,.28);border-radius:9px;padding:8px 10px;font-size:11px;max-width:260px;box-shadow:0 10px 25px rgba(0,0,0,.25);transition:opacity .12s}.tooltip.show{opacity:1}.tooltip b{font-family:Georgia,serif;color:#f0dfb4}.tooltip small{display:block;color:#a99f8b;margin-top:3px;line-height:1.35}
.side-card{min-height:720px;display:flex;flex-direction:column}.side-head{padding:23px 23px 18px;border-bottom:1px solid rgba(238,229,212,.07)}.kicker{font-size:9px;text-transform:uppercase;letter-spacing:.17em;color:#c6af75}.side-title{font:30px/1.1 Georgia,serif;margin:8px 0 10px}.side-desc{font-size:13px;line-height:1.65;color:#c8beaa}.meta{display:flex;gap:7px;flex-wrap:wrap;margin-top:13px}.pill{border:1px solid rgba(238,229,212,.13);border-radius:999px;padding:5px 8px;font-size:9px;color:#c8beaa;background:rgba(255,255,255,.02)}.pill.gold{border-color:rgba(185,155,93,.45);color:#dec78d}.pill.green{border-color:rgba(85,113,94,.55);color:#a7c0aa}.pill.warn{border-color:rgba(135,86,77,.55);color:#d3a59b}
.side-scroll{padding:18px 23px 20px;overflow:auto}.section-label{font-size:9px;text-transform:uppercase;letter-spacing:.16em;color:#8e8573;margin-bottom:9px}.world-list{display:grid;gap:8px}.world-item{border:1px solid rgba(238,229,212,.08);border-radius:11px;padding:11px 12px;background:rgba(255,255,255,.018);cursor:pointer;transition:.18s}.world-item:hover{border-color:rgba(185,155,93,.28);transform:translateY(-1px)}.world-item b{display:block;font:14px Georgia,serif;color:#e8ddca}.world-item p{margin:5px 0 0;font-size:11px;line-height:1.5;color:#a99f8b}.world-item span{font-size:9px;color:#c1ae79;margin-top:6px;display:inline-block}
.ca-focus{margin-top:18px;border-top:1px solid rgba(238,229,212,.08);padding-top:17px}.ca-card{background:linear-gradient(135deg,rgba(85,113,94,.11),rgba(185,155,93,.05));border:1px solid rgba(97,127,105,.26);border-radius:13px;padding:13px}.ca-card h4{font:17px Georgia,serif;margin:0 0 8px}.ca-card p{font-size:11px;line-height:1.58;color:#b9b09e;margin:6px 0}.ca-card strong{color:#e2d6be}.mini-actions{display:flex;flex-wrap:wrap;gap:6px;margin-top:10px}.mini-actions button{border:1px solid rgba(238,229,212,.12);background:rgba(0,0,0,.1);color:#cfc4ae;border-radius:999px;padding:6px 8px;font-size:9px;cursor:pointer}.mini-actions button:hover{border-color:rgba(185,155,93,.45)}
.selected-card{margin-top:16px;border-top:1px solid rgba(238,229,212,.08);padding-top:16px}.selected-card.hidden{display:none}.selected-card h3{font:21px Georgia,serif;margin:4px 0 8px}.selected-card p{font-size:11px;line-height:1.6;color:#b9b09e;margin:7px 0}.territories{font-size:10px;color:#d2c4a9;padding:8px 10px;border-left:2px solid rgba(185,155,93,.48);background:rgba(185,155,93,.05);margin-top:9px}.source-note{font-size:9px;line-height:1.45;color:#827966;margin-top:10px}.source-note a{color:#b9a36e;text-decoration:none}.source-note a:hover{text-decoration:underline}
.timeline-card{grid-column:1/-1;padding:16px 18px 15px}.timeline-row{display:grid;grid-template-columns:auto auto minmax(140px,1fr) auto auto;align-items:center;gap:10px}.round{width:40px;height:40px;border-radius:50%;border:1px solid rgba(214,192,137,.42);background:rgba(185,155,93,.08);color:#eee1c1;cursor:pointer;font-size:16px}.round:hover{background:rgba(185,155,93,.15)}.year-now{min-width:94px}.year-now strong{font:27px Georgia,serif}.year-now span{display:block;font-size:9px;color:#978d7b;margin-top:2px}.timeline-input{position:relative}.timeline-input input{width:100%;accent-color:#ad8e52}.ticks{position:absolute;left:2px;right:2px;top:25px;height:8px;pointer-events:none}.tick{position:absolute;top:0;width:1px;height:6px;background:#7b725f}.tick.major{height:9px;background:#c3a762}.tick-label{position:absolute;top:10px;transform:translateX(-50%);font-size:8px;color:#746c5d;white-space:nowrap}.speed{display:flex;border:1px solid rgba(238,229,212,.1);border-radius:999px;overflow:hidden}.speed button{border:0;background:transparent;color:#958b78;padding:7px 8px;font-size:9px;cursor:pointer}.speed button.active{background:rgba(185,155,93,.14);color:#e0cfaa}.timeline-hint{font-size:9px;color:#807765;text-align:right}
.bottom-grid{grid-column:1/-1;display:grid;grid-template-columns:1.1fr .9fr;gap:16px}.bottom-card{padding:19px 20px}.bottom-title{display:flex;justify-content:space-between;align-items:flex-start;gap:14px;margin-bottom:13px}.bottom-title h3{font:20px Georgia,serif;margin:0}.bottom-title span{font-size:9px;color:#817966;text-transform:uppercase;letter-spacing:.12em}.people{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:9px}.person{padding:12px;border:1px solid rgba(238,229,212,.08);border-radius:11px;background:rgba(255,255,255,.018);cursor:pointer;transition:.18s;min-height:114px}.person:hover{border-color:rgba(185,155,93,.32);transform:translateY(-2px)}.person .age{float:right;font:24px Georgia,serif;color:#d6bd82}.person h4{font:14px Georgia,serif;margin:0 36px 5px 0}.person p{font-size:10px;line-height:1.45;color:#9d9483;margin:0}.person .confidence{display:inline-block;margin-top:8px;font-size:8px;color:#b6a778}
.compare{display:grid;grid-template-columns:1fr 1fr;gap:10px}.compare-col{border-left:2px solid rgba(185,155,93,.26);padding:3px 0 3px 12px}.compare-col h4{font:14px Georgia,serif;margin:0 0 6px;color:#dfc88f}.compare-col p{font-size:10px;line-height:1.55;color:#aca391;margin:0}.compare-col small{display:block;font-size:8px;color:#766e5f;margin-top:8px}
.footer{max-width:1720px;margin:0 auto;padding:0 22px 26px;color:#766e5f;font-size:9px;line-height:1.5}.footer strong{color:#9d927b}
.modal{position:fixed;inset:0;z-index:100;background:rgba(8,8,6,.72);display:none;align-items:center;justify-content:center;padding:20px;backdrop-filter:blur(8px)}.modal.show{display:flex}.modal-box{width:min(760px,100%);max-height:84vh;overflow:auto;background:#211e18;border:1px solid rgba(214,192,137,.28);border-radius:18px;padding:24px;box-shadow:0 30px 100px rgba(0,0,0,.55)}.modal-close{float:right;border:0;background:transparent;color:#9d9483;font-size:23px;cursor:pointer}.modal h2{font:28px Georgia,serif;margin:6px 0 10px}.modal h3{font:18px Georgia,serif;margin:19px 0 8px}.modal p,.modal li{font-size:12px;line-height:1.65;color:#bdb3a0}.modal a{color:#ceb36f;text-decoration:none}.modal a:hover{text-decoration:underline}.timeline-life{display:grid;gap:8px;margin-top:13px}.life-row{display:grid;grid-template-columns:70px 1fr;gap:10px;padding:9px 0;border-top:1px solid rgba(238,229,212,.07)}.life-row b{font:13px Georgia,serif;color:#d2b873}.life-row span{font-size:11px;color:#aaa08d;line-height:1.45}

/* v3: quieter historical atlas palette + deeper interaction */
:root{--map-sea:#c8bea7;--map-land:#ddd4c1;--map-border:#7e7565;--map-ink:#2d2921;--sage:#718273;--clay:#9b7059;--dust:#b49a68}
.sea{fill:var(--map-sea)}.country{fill:var(--map-land);stroke:var(--map-border);stroke-width:.56}.country:hover{fill:#e5dcc9;stroke:#5f584b;stroke-width:.9}
.map-card:after{content:"";position:absolute;inset:0;pointer-events:none;background:radial-gradient(ellipse at 50% 45%,transparent 42%,rgba(53,45,31,.11) 100%);mix-blend-mode:multiply;z-index:2}
.map-toolbar,.map-legend,.opacity-control,.layer-panel,.tooltip{z-index:15}
.layer-panel{position:absolute;right:16px;top:98px;width:250px;background:rgba(28,26,22,.93);border:1px solid rgba(214,192,137,.24);border-radius:14px;padding:12px 13px;backdrop-filter:blur(12px);box-shadow:0 12px 34px rgba(0,0,0,.24);display:none}
.layer-panel.show{display:block;animation:panelIn .2s ease-out}.layer-panel h4{font:14px Georgia,serif;margin:0 0 8px;color:#eadfc8}.layer-panel p{font-size:9px;color:#908674;line-height:1.4;margin:0 0 9px}.layer-row{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:7px 0;border-top:1px solid rgba(255,255,255,.05);font-size:10px;color:#cfc5b2}.layer-row:first-of-type{border-top:0}.switch{position:relative;width:34px;height:18px;flex:none}.switch input{opacity:0;width:0;height:0}.slider{position:absolute;inset:0;border-radius:999px;background:#49443a;border:1px solid rgba(255,255,255,.08);cursor:pointer;transition:.2s}.slider:before{content:"";position:absolute;width:12px;height:12px;left:2px;top:2px;border-radius:50%;background:#c8bda5;transition:.2s}.switch input:checked + .slider{background:#667565}.switch input:checked + .slider:before{transform:translateX(16px);background:#efe4cd}
@keyframes panelIn{from{opacity:0;transform:translateY(-5px)}to{opacity:1;transform:none}}
.trade-route{fill:none;stroke:#705f48;stroke-width:1.25;stroke-dasharray:4 6;opacity:.56;vector-effect:non-scaling-stroke;animation:tradeDash 10s linear infinite}.trade-route.major{stroke-width:1.7;opacity:.7}.trade-label{font:italic 9px Georgia,serif;fill:#5b5142;paint-order:stroke;stroke:#ddd2ba;stroke-width:3px;pointer-events:none;opacity:.75}@keyframes tradeDash{to{stroke-dashoffset:-80}}

.ca-facts{display:grid;grid-template-columns:1fr 1fr;gap:7px;margin-top:11px}.ca-fact{border:1px solid rgba(238,229,212,.08);background:rgba(0,0,0,.08);border-radius:9px;padding:8px}.ca-fact b{display:block;font:11px Georgia,serif;color:#dcc895;margin-bottom:3px}.ca-fact span{font-size:8.5px;color:#aaa08e;line-height:1.35;display:block}.ca-note{margin-top:10px;padding:9px 10px;border-left:2px solid rgba(185,155,93,.5);background:rgba(185,155,93,.05);font-size:9px;line-height:1.5;color:#bcb19e}
.empire-path.fuzzy{filter:saturate(.86)}.empire-path.local{fill-opacity:.30!important}.country-layer-muted .country{opacity:.22}.hidden-layer{display:none!important}
@media(max-width:760px){.layer-panel{right:9px;top:92px;width:min(250px,calc(100% - 18px))}.ca-facts{grid-template-columns:1fr}}

@media(max-width:1200px){.layout{grid-template-columns:1fr}.map-card,.side-card{min-height:auto}.side-card{max-height:none}.people{grid-template-columns:repeat(2,1fr)}.bottom-grid{grid-template-columns:1fr}.map-legend{width:330px}.opacity-control{right:16px}}
@media(max-width:760px){.topbar{height:auto;min-height:70px;padding:12px 14px;align-items:flex-start}.brand-sub{display:none}.brand-title{font-size:14px}.top-actions .btn:nth-child(2),.top-actions .btn:nth-child(3){display:none}.layout{padding:10px;gap:10px}.map-card{border-radius:13px}.map-toolbar{left:9px;right:9px;top:9px}.year-badge{min-width:105px;padding:9px 10px}.year-badge strong{font-size:27px}#worldMap{height:590px}.map-legend{left:9px;bottom:9px;width:calc(100% - 18px)}.opacity-control{display:none}.legend-items{max-height:72px;overflow:auto}.timeline-card{padding:13px 12px}.timeline-row{grid-template-columns:auto 1fr auto}.year-now{display:none}.timeline-hint{display:none}.speed{display:none}.people{grid-template-columns:1fr}.compare{grid-template-columns:1fr}.bottom-card{padding:16px}.side-head,.side-scroll{padding-left:17px;padding-right:17px}}


/* v5 Eurasia */
.shift-card{margin-top:10px;background:rgba(72,61,41,.05);border:1px solid rgba(92,74,45,.12);border-radius:16px;padding:12px 13px}
.shift-card p{margin:0;font-size:11px;line-height:1.62;color:#4e4539}
.shift-card b{color:#3f3529}
.map-banner{position:absolute;left:50%;transform:translateX(-50%);top:16px;z-index:11;background:rgba(38,34,28,.82);border:1px solid rgba(214,192,137,.24);color:#f2e8d3;padding:8px 12px;border-radius:999px;font-size:10px;letter-spacing:.06em;backdrop-filter:blur(8px);box-shadow:0 10px 28px rgba(0,0,0,.12)}
.map-banner b{color:#e4ce98}
.campaign-route{fill:none;stroke-width:2.1;stroke-dasharray:7 6;opacity:.82;vector-effect:non-scaling-stroke;filter:url(#routeGlow);animation:dashMove 2.8s linear infinite}
.campaign-route.sasanian{stroke:#8f5f49}
.campaign-route.byzantine{stroke:#77657d}
.campaign-route.tang{stroke:#728066}
.campaign-node{stroke:#f4dfac;stroke-width:1.1;vector-effect:non-scaling-stroke}
.campaign-node.sasanian{fill:#8f5f49}
.campaign-node.byzantine{fill:#77657d}
.campaign-node.tang{fill:#728066}
@keyframes dashMove{to{stroke-dashoffset:-52}}
.map-legend .legend-top span strong{color:#d7c08a}


/*  */
.era-strip{display:flex;gap:7px;flex-wrap:wrap;padding:0 16px 14px 70px}
.era-strip button{border:1px solid rgba(93,75,45,.16);background:rgba(255,252,244,.52);color:#6e604d;border-radius:999px;padding:6px 9px;font-size:9px;cursor:pointer;transition:.18s}
.era-strip button:hover,.era-strip button.active{background:#2d2922;color:#f4e8cf;border-color:#2d2922}
.campaign-route.rashidun{stroke:#4d6d57}.campaign-route.umayyad{stroke:#6f7b55}.campaign-route.seljuk{stroke:#7d6a51}.campaign-route.mongol{stroke:#725b52}.campaign-route.ottoman{stroke:#536b5c}
.campaign-node.rashidun{fill:#4d6d57}.campaign-node.umayyad{fill:#6f7b55}.campaign-node.seljuk{fill:#7d6a51}.campaign-node.mongol{fill:#725b52}.campaign-node.ottoman{fill:#536b5c}
@media(max-width:900px){.era-strip{padding:0 12px 12px}.era-strip button{font-size:8px;padding:5px 7px}}


.mini-actions a{display:inline-block;text-decoration:none;border:1px solid rgba(91,75,49,.16);border-radius:999px;padding:5px 8px;font-size:9px;color:#655741;background:rgba(255,255,255,.35)}
.mini-actions a:hover{background:#2d2922;color:#f1e4cb}

/* v6.2: simplified map controls */
.map-toolbar .toolbar-block{gap:5px}
.map-toolbar .toolbar-block .btn.icon{width:34px;height:34px;padding:0;border-radius:50%;font-size:18px;background:rgba(39,35,29,.82);color:#efe2c7}

/* v6.3 label readability + stars panel */
.empire-label{
  font-size:12px;font-weight:700;letter-spacing:.2px;paint-order:stroke;
  stroke:#f2ead7;stroke-width:4.2px;fill:#362f26;
}
.empire-label.small{font-size:10px;stroke-width:4px}
.empire-label.hidden{display:none}
.empire-label.reference{fill:#6b645a;stroke:#f6efdf;stroke-dasharray:0}
.label-bg{fill:rgba(255,248,234,.82);stroke:rgba(80,68,48,.16);stroke-width:1.1;rx:6;ry:6}
.stars-card{margin-top:18px;border-top:1px solid rgba(238,229,212,.08);padding-top:14px}
.stars-card h4{font:16px Georgia,serif;color:#f3e8d2;margin-bottom:8px}
.stars-note{font-size:12px;line-height:1.5;color:#d7c9ae;margin-bottom:10px}
.star-group{margin-top:10px}
.star-group-title{font-size:11px;text-transform:uppercase;letter-spacing:.12em;color:#c9b082;margin-bottom:7px}
.star-list{display:flex;flex-wrap:wrap;gap:7px}
.star-chip{
  display:inline-flex;align-items:center;gap:6px;padding:6px 9px;border-radius:999px;
  border:1px solid rgba(185,155,93,.22);background:rgba(255,255,255,.04);color:#f0e4cc;
  font-size:11px;line-height:1.2
}
.star-chip .era{color:#c4ad7e;font-size:10px}
.star-chip.sahabi{border-color:rgba(110,166,125,.25)}
.star-chip.tabiun{border-color:rgba(127,155,211,.22)}
.star-chip.tabi-tabiin{border-color:rgba(176,145,220,.24)}
.star-chip.scholar{border-color:rgba(199,161,102,.28)}
.star-empty{font-size:12px;color:#cdbd9f}
.map-legend .legend-item{font-size:9px}


/* v6.4 audited label system */
.empire-label{font:700 11.5px Georgia,serif;letter-spacing:.01em;fill:#2f2921;paint-order:stroke;stroke:#f5edda;stroke-width:4.6px;stroke-linejoin:round;pointer-events:none;opacity:.94}
.empire-label.small{font-size:9.5px;stroke-width:4px}
.empire-label.reference{font-size:9px;fill:#746b5e;stroke:#f6efdf;opacity:.72}
.label-bg{fill:#f7efdc;fill-opacity:.78;stroke:#6f6148;stroke-opacity:.15;stroke-width:.8}
.place-dot text{font:700 9.5px Inter,sans-serif;stroke:#f5eddb;stroke-width:3.8px;fill:#2e2922}
.place-dot.minor text{display:none}
#worldMap.zoomed-in .place-dot.minor text{display:block}
#worldMap.zoomed-close .place-dot.medium text{display:block}
.place-dot.medium text{display:none}
#worldMap.zoomed-in .place-dot.medium text{display:block}
.western-rome-note{position:absolute;left:16px;top:62px;z-index:12;max-width:270px;padding:8px 10px;border-radius:11px;background:rgba(45,40,33,.86);border:1px solid rgba(203,181,132,.24);color:#e9dfcc;font-size:9px;line-height:1.45;backdrop-filter:blur(8px)}
.western-rome-note b{color:#e6cd91}
.western-rome-note.hidden{display:none}


/* v6.5 stable labels */
.empire-label{font:700 12px Georgia,serif;letter-spacing:.01em;fill:#2f2a22;paint-order:stroke;stroke:#f8f1e2;stroke-width:4.8px;stroke-linejoin:round;pointer-events:none;opacity:.96}
.empire-label.small{font-size:10px;stroke-width:4.4px}
.empire-label.reference{font-size:9px;fill:#786e61;stroke:#fbf6ea;opacity:.72}
.label-bg{fill:#faf3e3;fill-opacity:.84;stroke:#7b6c50;stroke-opacity:.16;stroke-width:.9}


/* v6.6 source hierarchy */
.source-badge{display:inline-flex;align-items:center;gap:6px;border-radius:999px;padding:4px 7px;font-size:8px;font-weight:700;letter-spacing:.04em;text-transform:uppercase;margin:0 5px 5px 0;border:1px solid transparent}
.source-badge.islamic-primary{background:rgba(83,124,91,.14);border-color:rgba(83,124,91,.34);color:#b9d2bc}
.source-badge.islamic-local{background:rgba(184,148,78,.12);border-color:rgba(184,148,78,.32);color:#e0c890}
.source-badge.chinese{background:rgba(90,119,146,.13);border-color:rgba(90,119,146,.31);color:#b9cde0}
.source-badge.academic{background:rgba(139,131,119,.12);border-color:rgba(139,131,119,.28);color:#cfc5b5}
.source-badge.reconstruction{background:rgba(144,105,91,.11);border-color:rgba(144,105,91,.28);color:#d3b3a6}
.source-note .source-main{display:block;margin-top:5px;color:#d5c6aa}
.source-note .source-method{display:block;margin-top:6px;color:#8e8575;font-size:8px;line-height:1.45}
.empire-path.influence{stroke-dasharray:9 5;stroke-width:1.5}


/* v6.7 cleaner labels */
.label-bg{display:none}
.empire-label{font:700 12.4px Georgia,serif;letter-spacing:.01em;fill:#2f2a22;paint-order:stroke;stroke:#f2e7d0;stroke-width:5.2px;stroke-linejoin:round;opacity:.97}
.empire-label.small{font-size:10.2px;stroke-width:4.7px}
.empire-label.reference{font-size:9px;fill:#73685c;stroke:#f1e8d4;opacity:.70}
.place-dot text{font:700 9.4px Inter,sans-serif;fill:#3b3328;paint-order:stroke;stroke:#f1e8d6;stroke-width:3.8px}
.place-dot.major text{font-size:9.2px;display:none}
.place-dot.medium text{display:none}
.place-dot.minor text{display:none}
#worldMap.zoomed-in .place-dot.major text{display:block}
#worldMap.zoomed-close .place-dot.medium text{display:block}
#worldMap.zoomed-very-close .place-dot.minor text{display:block}


/* Chronograph 1.0 RC — publication pass */
.release-mark{opacity:.45;font-size:9px;white-space:nowrap}
#worldMap .label-bg{display:none!important}
.empire-label{font:700 12.2px Georgia,serif;letter-spacing:.01em;fill:#2e2922;paint-order:stroke;stroke:#efe4cc;stroke-width:4.5px;stroke-linejoin:round;pointer-events:none;opacity:.96}
.empire-label.small{font-size:9.8px;stroke-width:4px}.empire-label.reference{font-size:8.8px;opacity:.65}
/* At atlas scale political names dominate; at local scale city names take over. */
#worldMap:not(.detail-labels) .place-dot text{display:none!important}
#worldMap.detail-labels .place-dot.major text{display:block!important}
#worldMap:not(.local-labels) .place-dot.medium text,#worldMap:not(.local-labels) .place-dot.minor text{display:none!important}
#worldMap.local-labels .place-dot.medium text{display:block!important}
#worldMap:not(.micro-labels) .place-dot.minor text{display:none!important}
#worldMap.micro-labels .place-dot.minor text{display:block!important}
/* Political labels retain scale-aware sizing at close zoom. */
.place-dot text{font:700 9.5px Inter,sans-serif;fill:#302a22;paint-order:stroke;stroke:#efe6d3;stroke-width:3.5px}
.method-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:14px 0}.method-box{border:1px solid rgba(238,229,212,.1);border-radius:12px;padding:11px;background:rgba(255,255,255,.025)}.method-box b{display:block;font:14px Georgia,serif;color:#eadcc3;margin-bottom:5px}.method-box p{margin:0;font-size:10px;line-height:1.55;color:#b9af9c}
.source-library{display:grid;gap:8px;margin-top:12px}.source-row{display:grid;grid-template-columns:128px 1fr;gap:10px;padding:8px 0;border-bottom:1px solid rgba(238,229,212,.07)}.source-row:last-child{border-bottom:0}.source-row .who{font:12px Georgia,serif;color:#e7dac2}.source-row .works{font-size:10px;line-height:1.55;color:#b9af9c}.source-row a{color:#cbb27b;text-decoration:none}.source-row a:hover{text-decoration:underline}
.confidence-row{display:flex;gap:6px;flex-wrap:wrap;margin:7px 0 3px}.confidence-pill{border-radius:999px;padding:4px 7px;font-size:8px;font-weight:700;letter-spacing:.03em;border:1px solid rgba(238,229,212,.12)}.confidence-pill.high{color:#b9d3bc;border-color:rgba(91,140,103,.35);background:rgba(91,140,103,.10)}.confidence-pill.medium{color:#e0c88e;border-color:rgba(186,150,78,.34);background:rgba(186,150,78,.09)}.confidence-pill.approx{color:#d1b0a3;border-color:rgba(145,102,87,.32);background:rgba(145,102,87,.08)}
.source-badge.traveler{background:rgba(90,119,146,.13);border-color:rgba(90,119,146,.31);color:#b9cde0}.source-badge.retrospective{background:rgba(130,104,145,.12);border-color:rgba(130,104,145,.28);color:#d0bad9}
@media(max-width:760px){#worldMap{height:510px}.map-legend{max-height:132px;overflow:auto}.method-grid{grid-template-columns:1fr}.source-row{grid-template-columns:1fr}.top-actions{gap:4px}.top-actions .btn{padding:7px 9px;font-size:9px}.top-actions .btn:nth-child(2),.top-actions .btn:nth-child(3){display:none}.release-mark{display:none}.side-scroll{max-height:none}.modal-box{width:calc(100% - 18px);max-height:90vh;overflow:auto}}


/* RC compact map geometry: prevent grid stretching to sidebar height */
.layout{align-items:start}
.map-card{height:620px!important;min-height:620px!important;align-self:start}
.empire-label{font-size:13.4px!important;stroke-width:4.8px!important}
.empire-label.small{font-size:10.8px!important;stroke-width:4.2px!important}
@media(max-width:760px){.map-card{height:510px!important;min-height:510px!important}#worldMap{height:510px!important}}


/* RC2 — Stars of Islam at the top-right */
.side-card{overflow:hidden}
#starsCard{
  margin:0;
  padding:15px 18px 13px;
  border-top:0;
  border-bottom:1px solid rgba(238,229,212,.09);
  background:linear-gradient(135deg,rgba(185,155,93,.10),rgba(85,113,94,.06));
  max-height:245px;
  overflow:auto;
  flex:0 0 auto;
}
#starsCard h4{font-size:18px;margin:3px 0 6px}
#starsCard .stars-note{margin-bottom:7px;font-size:10px;line-height:1.42}
#starsCard .star-group{margin-top:7px}
#starsCard .star-group-title{font-size:8px;margin-bottom:5px}
#starsCard .star-list{gap:5px}
#starsCard .star-chip{padding:4px 7px;font-size:9px}
#starsCard .star-chip .era{font-size:8px}
#starsCard > .source-note{display:none}
.side-head{padding-top:17px}


/* CHRONOGRAPH 1.0 RC3.7 — a bounded atlas workspace */
[hidden]{display:none!important}
html,body{height:100%;min-height:0;overflow:hidden}
.app{height:100vh;height:100dvh;min-height:0;display:flex;flex-direction:column;overflow:hidden}
.topbar{position:relative;flex:0 0 auto;height:62px;padding:0 20px;gap:12px}
.layout{width:100%;flex:1;min-height:0;padding:12px;gap:12px;grid-template-columns:minmax(0,1fr) minmax(350px,390px);grid-template-rows:minmax(0,1fr) auto;align-items:stretch;overflow:hidden}
.map-card{height:100%!important;min-height:0!important;align-self:stretch;min-width:0}
#worldMap{height:100%!important;min-height:0;width:100%}
.side-card{min-height:0;height:100%;min-width:0;overflow:hidden}
#starsCard{flex:0 1 auto;max-height:36%;min-height:92px;overflow:hidden;display:flex;flex-direction:column;padding:12px 14px 10px}
#starsCard .section-label{flex:none;font-size:9px;color:#cbb888;margin:0 0 5px;letter-spacing:.1em}
#starsCard h4{flex:none;font-size:17px;margin:0 0 7px}
#starsYear{font:11px system-ui;color:#cbb888;white-space:nowrap}
#starsContent{min-height:0;overflow:auto;overscroll-behavior:contain;scrollbar-gutter:stable}
#starsCard .star-chip{font-size:10px;line-height:1.4;padding:5px 7px}
#starsCard .star-group-title{font-size:9px;color:#c6bba5}
.side-tabs{display:flex;flex:none;gap:2px;padding:5px 7px;border-bottom:1px solid #534735;background:#211e18;overflow-x:auto;scrollbar-width:thin}
.side-tabs button{flex:1;white-space:nowrap;border:0;border-radius:7px;background:transparent;color:#bfb39b;padding:9px 5px;font:11px system-ui;cursor:pointer}
.side-tabs button[aria-selected=true]{background:#443c2b;color:#f4dfae;box-shadow:inset 0 -2px #b99b5d}
.side-panel{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;scrollbar-gutter:stable;padding:14px}
.side-head{padding:0 0 14px;margin:0 0 13px}
.side-title{font-size:25px}.side-desc{font-size:12px;line-height:1.6}
.side-panel .ca-focus:first-child{margin-top:0;padding-top:0;border-top:0}
.side-panel .selected-card{margin-top:0;padding-top:0;border-top:0}
.shift-card p,.shift-card b{color:#c8beaa}.shift-card{background:#2a261e;border-color:#514635}
.western-rome-note{position:static;max-width:none;margin-top:12px}
.side-panel .bottom-grid{display:grid;grid-template-columns:1fr;gap:15px}
.side-panel .bottom-card{padding:0;border:0;border-radius:0;background:none;box-shadow:none;overflow:visible}
.side-panel .bottom-title{flex-direction:column;gap:6px}.bottom-title h3{font-size:18px}
.side-panel .people,.side-panel .compare{grid-template-columns:1fr}
.side-panel .footer{padding:14px 0 0;margin-top:14px;font-size:10px}
.release-mark{display:block;font-size:10px;opacity:1;margin-top:9px}
.timeline-card{position:sticky;bottom:0;z-index:40;min-width:0;flex:none;padding:10px 14px 8px;overflow:hidden;background:#211e18}
.timeline-row{grid-template-columns:40px 80px minmax(0,1fr) auto;gap:12px;min-height:47px}
.timeline-hint{display:none}.year-now{display:block;min-width:0}.year-now strong{font-size:25px}
.timeline-input{min-width:0;padding-bottom:17px}.ticks{top:23px}.tick-label{font-size:8px;color:#b5a78e}
.speed{display:flex}.era-strip{padding:9px 0 2px;flex-wrap:nowrap;overflow-x:auto;overscroll-behavior:contain;scrollbar-width:thin;gap:6px}
.era-strip button{flex:none;padding:6px 9px;background:#2c281f;color:#c9bda7;border-color:#544a36;font-size:10px}
.era-strip button:hover,.era-strip button.active{background:#574a30;color:#fff0c9;border-color:#b99b5d}
.map-toolbar{top:12px;left:12px;right:12px}
.map-toolbar .toolbar-block{align-content:start;max-width:calc(100% - 118px)}
.year-badge{min-width:104px;max-width:150px;padding:9px 11px}.year-badge strong{font-size:29px}.year-badge span{display:block;max-width:128px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.map-legend{padding:0;left:12px;bottom:12px;width:min(330px,calc(100% - 24px));max-height:45%;overflow:auto;overscroll-behavior:contain}
.map-legend summary{padding:11px 12px;cursor:pointer;font:13px Georgia,serif;color:#e7d5b0}
.map-legend summary span{font:9px system-ui;color:#afa18a;margin-left:6px}
.legend-body{padding:0 12px 12px}.legend-top b{display:none}.legend-items{max-height:none;overflow:visible}
.legend-top span{line-height:1.5}.map-legend .legend-item{font-size:10px}
.layer-panel{display:block;right:auto;left:12px;top:59px;max-height:calc(100% - 118px);overflow:auto;overscroll-behavior:contain;width:min(290px,calc(100% - 24px))}
.layer-panel .opacity-control{display:block;position:static;width:auto;padding:0 0 12px;border:0;background:none;backdrop-filter:none}
.layer-row{font-size:11px}.layer-panel p{font-size:10px}
.switch input{position:absolute;inset:0;width:34px;height:18px;margin:0;opacity:0;z-index:1;cursor:pointer}.switch input:focus-visible + .slider{outline:2px solid #dcc38b;outline-offset:2px}
.tooltip{max-width:min(260px,calc(100% - 20px))}
button:focus-visible,a:focus-visible,input:focus-visible,summary:focus-visible,[tabindex]:focus-visible{outline:2px solid #dcc38b;outline-offset:-2px}
*{scrollbar-width:thin;scrollbar-color:#736346 #242118}
.modal{padding:12px}.modal-box{max-height:calc(100dvh - 24px)}
@media(max-width:1100px){.layout{grid-template-columns:minmax(0,1fr) 350px}.brand-sub{display:none}.top-actions .btn{font-size:11px;padding:8px 10px}}
@media(max-width:700px){
 .topbar{height:52px;min-height:52px;padding:0 10px;align-items:center}.brand{gap:7px}.brand-title{font-size:13px;letter-spacing:.05em}.monogram{width:30px;height:30px;font-size:15px}
 .top-actions .btn:nth-child(2),.top-actions .btn:nth-child(3){display:none}.top-actions .btn{font-size:10px;padding:7px 9px}
 .layout{grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,.95fr) minmax(0,1fr) auto;gap:7px;padding:7px}
 .map-card,.side-card{border-radius:12px}.map-card{grid-row:1}.side-card{grid-row:2}.timeline-card{grid-row:3;grid-column:1;border-radius:12px;padding:7px 10px}
 #starsCard{max-height:46%;min-height:76px;padding:8px 11px}#starsCard h4{font-size:14px;margin-bottom:4px}#starsCard .section-label{font-size:8px;margin-bottom:3px}
 #starsCard .star-chip{padding:3px 6px;font-size:9px}#starsCard .star-group{margin-top:4px}
 .side-tabs{padding:3px 6px}.side-tabs button{font-size:10px;padding:7px 4px}.side-panel{padding:10px 12px}
 .side-title{font-size:22px}.side-desc{font-size:11px}.timeline-row{grid-template-columns:36px 58px minmax(0,1fr);gap:8px;min-height:44px}
 .round{width:36px;height:36px}.speed{display:none}.year-now strong{font-size:22px}.year-now span{font-size:8px}
 .era-strip{padding-top:6px}.era-strip button{padding:5px 8px;font-size:9px}
 .ticks .tick-label{display:none}.ticks .tick-label:first-child,.ticks .tick-label:last-child{display:block}
 .map-toolbar{top:8px;left:8px;right:8px}.map-toolbar .btn{font-size:10px;padding:7px 9px}.map-toolbar .toolbar-block .btn.icon{width:30px;height:30px}
 .year-badge{min-width:76px;max-width:90px;padding:6px 8px}.year-badge .eyebrow{font-size:7px}.year-badge strong{font-size:23px}.year-badge span{font-size:8px}
 .map-toolbar .toolbar-block{max-width:calc(100% - 98px)}.map-legend{left:8px;bottom:8px;width:calc(100% - 16px);max-height:48%}.map-legend summary{padding:8px 10px;font-size:11px}
 .layer-panel{left:8px;top:45px;max-height:calc(100% - 80px)}
}
@media(max-height:540px) and (min-width:701px){.topbar{height:48px}.layout{padding:6px;gap:6px}.timeline-card{padding:6px 12px}.timeline-row{min-height:40px}.era-strip{padding-top:4px}#starsCard{padding:7px 12px;max-height:48%;min-height:100px}#starsCard h4{font-size:14px;margin-bottom:3px}#starsCard .section-label{font-size:8px;margin-bottom:3px}#starsCard .star-group{margin-top:2px}#starsCard .star-chip{padding:3px 6px;font-size:9px}.side-panel{padding:10px 12px}.side-tabs button{padding:6px 4px}.brand-sub{display:none}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important;scroll-behavior:auto!important}}


/* RC3.2: keep both calendars legible in narrow panels. */
 #starsCard .star-chip{max-width:100%;flex-wrap:wrap;column-gap:7px;row-gap:2px;border-radius:10px}
 #starsCard .star-chip .era{display:flex;flex-wrap:wrap;gap:2px 4px;line-height:1.45}
 #starsCard .gregorian-years{font-size:10px;color:#e8d7b4}
 #starsCard .hijri-years{overflow-wrap:anywhere}
 
.sources-heading{font:23px Georgia,serif;margin:0 0 18px}.source-group{margin:0 0 22px}.source-group h4{font:17px Georgia,serif;color:#d9c493;margin:0 0 8px}.source-group .source-library{margin-top:0}.source-group .source-row{grid-template-columns:1fr;gap:5px}.source-group .works{overflow-wrap:anywhere;font-size:11px}.source-group .who{font-size:14px}

.source-group .works{color:#cbb27b}.source-badge{cursor:default}

#starsCard button.star-chip{font-family:inherit;color:inherit;text-align:left;cursor:pointer}#starsCard button.star-chip:hover{background:#3c382c}#starsCard button.star-chip:focus-visible{outline:2px solid #e2c17c;outline-offset:2px}.map-slice-note{font-size:9px!important;color:#d4c399!important}
.biography-peers{display:flex;flex-wrap:wrap;gap:7px}.biography-peers .star-chip{font-size:12px;line-height:1.5;padding:8px 11px;text-align:left;white-space:normal}.modal-close{position:sticky;top:0;background:#211e18;border-radius:6px;min-width:36px;min-height:36px}.modal-box{overscroll-behavior:contain}.modal p{font-size:13px}.modal-close:focus-visible,.biography-peers button:focus-visible{outline:2px solid #dfbe79;outline-offset:2px}
.history-toggle{display:flex;align-items:center;gap:6px;color:#e5cca0}.history-stages{display:grid;gap:5px}.history-stages button{background:#2c281e;color:#e8d8b9;border:1px solid #685a3f;border-radius:5px;text-align:left;padding:7px;font:11px/1.4 system-ui;cursor:pointer}.history-stages button[aria-current=true]{border-color:#d6b574;background:#49402b}#kyrgyzEraFacts details{margin-top:10px}#kyrgyzEraFacts summary{cursor:pointer;color:#dcc18b;padding:5px 0}.kyrgyz-movement{fill:none;stroke:#744c22;stroke-width:2.4;stroke-dasharray:7 4;vector-effect:non-scaling-stroke}.kyrgyz-movement-node{fill:#fff0c9;stroke:#744c22;stroke-width:1.5;vector-effect:non-scaling-stroke}.kyrgyz-route-label{font:10px system-ui;fill:#382817;paint-order:stroke;stroke:#f0e2c6;stroke-width:3;stroke-linejoin:round}#kyrgyzRouteLayer{pointer-events:none}body.future-mode #kyrgyzRouteLayer{display:none!important}body.future-mode #kyrgyzHistoryBtn{display:none!important}@media(max-width:700px){#kyrgyzHistoryBtn{font-size:9px;padding:5px;max-width:105px;white-space:normal;line-height:1.15}}
.kyrgyz-route-label{font-size:7px!important}#kyrgyzEraFacts{display:block}#kyrgyzEraFacts details{margin-top:10px}#kyrgyzEraFacts .history-toggle{font-size:12px}
#mongolScope{position:absolute;left:14px;bottom:63px;max-width:340px;padding:8px 10px;background:rgba(33,29,22,.92);color:#ebdfc8;border-radius:10px;font:10px/1.4 system-ui;z-index:5}#mongolScope[hidden]{display:none}#mongolScope button{display:block;margin-top:5px;background:#5b4930;color:#fff1d8;border:1px solid #a68b57;border-radius:6px;padding:5px 9px;cursor:pointer;font:inherit}.unified-mongol{stroke:#61483a;stroke-width:1.25;stroke-linejoin:round}.mongol-dependencies{stroke:none}.kyrgyz-core{stroke:none}body.future-mode #mongolScope{display:none!important}@media(max-width:700px){#mongolScope{max-width:235px;font-size:9px;bottom:48px;padding:5px 8px}}
#worldMap.city-mode .empire-label.realm-label{display:block!important}.kyrgyz-extent-note{display:block;margin-top:9px}
/* The localized atlas subtitle remains visible in compact headers. */
.brand .brand-sub{display:block;font-size:10px;letter-spacing:.04em}
@media(max-width:700px){.brand .brand-sub{font-size:9px;margin-top:1px}}

/* Transparent Meridian of Time mark, matched to the atlas palette. */
.brand .monogram{flex:none;border:0;border-radius:0;box-shadow:none;background:transparent;color:var(--gold-soft)}
.brand .monogram svg{display:block;width:100%;height:100%;overflow:visible}

#languageSelect{font:inherit;color:#eadbc1;background:#252218;border:1px solid #675b40;border-radius:8px;max-width:112px;padding:6px}#languageSelect:focus-visible{outline:2px solid #dfbe79}#translationNotice{flex:none;margin:0;padding:5px 12px;font-size:10px;line-height:1.3;color:#e3c994;background:#302a1e}html[lang=en] .brand-sub,html[lang=ky] .brand-sub{font-size:9px}@media(max-width:700px){.top-actions{gap:3px}#languageSelect{max-width:87px;padding:4px;font-size:10px}.top-actions .btn{font-size:9px;padding:5px 7px}#translationNotice{font-size:9px;padding:3px 10px}}
#mapCard{overflow:clip}
#countryLayer:not(.modern-reference) .country:not(.kyrgyz-highlight){stroke:none;pointer-events:none}
#worldMap,#worldMap text{user-select:none;-webkit-user-select:none;-webkit-tap-highlight-color:transparent}
.world-header{position:sticky;top:-14px;z-index:3;background:#211e18;padding:10px 0 9px;border-bottom:1px solid #514733;box-shadow:0 5px 10px #211e1840}
.world-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}.world-heading h3{font:18px/1.2 Georgia,serif;margin:0;color:#f1dfb7}.world-heading>span{font:12px Georgia,serif;white-space:nowrap;color:#d8bd80;padding-top:4px}
.world-card-actions button,#worldYearApply{font:11px/1.3 system-ui;border:1px solid #62563e;background:#2c281f;color:#ddceb1;border-radius:8px;padding:7px 9px;cursor:pointer}
#worldYearForm{display:flex;align-items:center;gap:6px;margin-top:10px}.world-sr{position:absolute!important;width:1px;height:1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}#worldRegionSelect{flex:1;min-width:0;width:100%;border:1px solid #6d6044;border-radius:6px;padding:6px;background:#302b20;color:#f1dfb7;font:11px system-ui}#worldYearInput{width:66px;min-width:0;padding:6px;color:#f1dfb7;background:#191813;border:1px solid #6d6044;border-radius:6px;font:12px system-ui}#worldScope{font:10px/1.5 system-ui;color:#c3b392;margin:8px 0 0}.world-legend,.world-dating{font:10px/1.6 system-ui;color:#b4a78f;margin:10px 0;white-space:pre-wrap}
#worldCards{display:grid;gap:10px}.world-card{border:1px solid #514734;border-radius:12px;padding:13px;background:linear-gradient(135deg,#2a271e,#242119);scroll-margin-top:165px}.world-card.selected{border-color:#dbbd78;box-shadow:inset 3px 0 #dbbd78}.world-card-meta{font:9px/1.5 system-ui;color:#b9aa87;letter-spacing:.035em}.world-card h4{margin:5px 0}.world-card-title{border:0;padding:0;background:none;color:#f0dfb8;font:19px/1.25 Georgia,serif;text-align:left;cursor:pointer}.world-card h5{font:12px/1.4 system-ui;color:#dcc792;margin:10px 0 5px}.world-period{font:10px system-ui;color:#baa98a}.world-description{font:12px/1.65 system-ui;color:#d3c7b0;margin:5px 0 11px}.world-card-actions{display:flex;gap:6px}.world-card-actions button:hover{border-color:#d5ba7e;background:#3c3324}
.world-source summary,.world-phases summary{font:10px system-ui;color:#c9b787;cursor:pointer;margin-top:10px;padding:4px 0}.world-source p,.world-source-title{font:10px/1.6 system-ui;color:#b9ae98;overflow-wrap:anywhere}.world-phases button{display:block;width:100%;font:10px/1.5 system-ui;text-align:left;color:#c8bea8;border:0;border-left:2px solid #62553b;padding:6px 8px;background:#201e18;cursor:pointer}.world-phases button[aria-current=true]{border-color:#dbbd78;background:#3c3424;color:#f3deb2}.world-empty{font:12px/1.6 system-ui;color:#c9bfa9}.world-eurasia{border-top:1px solid #514734;padding-top:8px}.world-eurasia>summary{font:13px/1.5 Georgia,serif;color:#ddc796;cursor:pointer;padding:5px 0 12px}
.world-marker{cursor:pointer}.world-marker-hit{fill:transparent;stroke:none}.world-marker-core{fill:#51452d;stroke:#fff1ce;stroke-width:1.6}.world-marker-core.culture{fill:#3a624d}.world-marker-core.landscape,.world-marker-core.region{fill:#fff4d5;fill-opacity:.5;stroke:#695036;stroke-width:2;stroke-dasharray:3 2}.world-marker text{font:11px system-ui;fill:#251f16;paint-order:stroke;stroke:#eee1bf;stroke-width:3px;stroke-linejoin:round;pointer-events:none}.world-marker.selected .world-marker-core,.world-marker:focus .world-marker-core{stroke:#2c1a0c;fill:#efd18a;stroke-width:2.5}.world-marker:focus{outline:none}.world-marker.selected text{font-weight:700}
.future-mode #worldHistoryLayer,.future-mode #worldExploreBtn{display:none!important}
.world-comparison.world-regional #mongolScope{display:none}
.world-comparison #starsCard{max-height:24%;min-height:76px}
.world-comparison #starsContent>.stars-note{display:none}
@media(max-width:700px){.world-comparison #starsContent .star-group-title{display:none}.world-comparison #starsContent .star-group{margin-top:0}}
@media(max-width:700px){.world-comparison #starsCard{max-height:88px;min-height:64px}.world-header{position:static;padding-top:7px}.world-heading h3{font-size:18px}.world-card{padding:10px}.world-card-title{font-size:17px}.world-description{font-size:11px}.world-legend{font-size:9px}#worldExploreBtn{padding:6px 8px}}
@media(max-height:550px){.world-header{position:static}.world-comparison #starsCard{max-height:75px;min-height:64px}}
.world-modes{display:grid;grid-template-columns:1fr 1fr;gap:4px;margin-top:10px}.world-modes button,.world-event-actions button,.world-source-button{font:11px/1.3 system-ui;border:1px solid #62563e;background:#2c281f;color:#ddceb1;border-radius:7px;padding:7px 8px;cursor:pointer}.world-modes button[aria-pressed=true]{background:#59472c;border-color:#bfa16a;color:#fff0cf}.world-filters{margin-top:8px}.world-filters>div{display:flex;gap:5px;margin-top:5px}.world-filters input,.world-filters select{box-sizing:border-box;min-width:0;width:100%;font:11px system-ui;color:#ead8b7;background:#191813;border:1px solid #62563e;border-radius:6px;padding:7px}.world-filters select{flex:1}.world-event-detail{border:1px solid #ba9255;border-radius:10px;background:linear-gradient(140deg,#3b3020,#252018);padding:12px;margin-top:12px}.world-event-detail h4{font:20px/1.25 Georgia,serif;color:#f4dfb5;margin:7px 0 10px}.world-event-actions{display:flex;gap:6px;margin-top:10px}.world-event-actions button:disabled{opacity:.35;cursor:default}.world-event-actions button:last-child{margin-left:auto}.world-count{font:10px system-ui;color:#bfae8e;margin:8px 0}.world-timeline-item{position:relative;margin-left:6px;padding-left:15px;border-left:1px solid #756140}.world-timeline-item:before{content:'';position:absolute;left:-4px;top:20px;width:7px;height:7px;border-radius:50%;background:#9b845b}.world-timeline-button{display:flex;flex-direction:column;gap:6px;width:100%;padding:12px 9px;margin:4px 0;color:#e8d6b2;background:#2b261d;border:1px solid transparent;border-radius:8px;text-align:left;cursor:pointer}.world-timeline-button strong{font:15px/1.3 Georgia,serif}.world-timeline-item.selected .world-timeline-button{border-color:#ceaa69;background:#433621}.world-timeline-item.current:before{background:#e5c374;box-shadow:0 0 0 3px #e5c37425}.world-timeline-button:hover{background:#3a3022}.world-explorer button:focus-visible,.world-explorer select:focus-visible,.world-explorer input:focus-visible{outline:2px solid #ead29d;outline-offset:2px}.world-area{fill:url(#worldCoreHatch);stroke:#695131;stroke-width:1;stroke-dasharray:3 2;vector-effect:non-scaling-stroke;pointer-events:none}.world-area.selected{stroke:#8f4123;stroke-width:2;fill-opacity:1}.world-marker-core.state{fill:#ae7540}.world-marker-core.uninhabited{fill:#d8e3e5;stroke:#506872;stroke-dasharray:2 2}.world-event-route{fill:none;stroke:#9a351e;stroke-width:2.5;stroke-dasharray:6 4;vector-effect:non-scaling-stroke;pointer-events:none}.world-event-ring{fill:#fcdb9c55;stroke:#983e22;stroke-width:2}.world-event-dot{fill:#982e18;stroke:#fff1c7;stroke-width:1.5}.world-event-marker text{font-weight:700;fill:#62270e}.world-chronology[hidden],.world-filters[hidden],#worldCards[hidden],.world-event-detail[hidden]{display:none}
@media(max-width:700px){.world-filters input,.world-filters select{font-size:11px;padding:6px}.world-modes button{font-size:10px;padding:7px 4px}.world-timeline-button strong{font-size:14px}.world-event-detail h4{font-size:18px}.world-header{top:0}.world-event-detail{padding:10px}}
.world-filter-toggle{display:block;border:0;background:transparent;color:#ceb886;font:10px system-ui;margin-top:7px;padding:2px 0;cursor:pointer}.world-filter-toggle[hidden]{display:none}.world-card-actions{flex-wrap:wrap}
.world-explorer.filters-expanded .world-header{position:static}.world-timeline-button{scroll-margin-top:190px}.world-card-title{scroll-margin-top:170px}
.world-explorer.has-event .world-heading,.world-explorer.has-event #worldScope{display:none}.world-explorer.has-event .world-header{padding-top:0}.world-era-strip{display:none}.world-comparison #eraStrip{display:none}.world-comparison .world-era-strip{display:flex;gap:6px;overflow-x:auto;scrollbar-width:thin;padding:4px 0;min-width:0}.world-era-strip button{flex:none;border:1px solid #60523b;border-radius:20px;background:#302b22;color:#e6d6b4;font:9px system-ui;padding:6px 9px;cursor:pointer}.world-era-strip button:hover{border-color:#c7a76a}
.world-polities{border:1px solid #5b4e36;border-radius:10px;padding:10px}.world-polities summary{font:13px Georgia,serif;color:#e6cf9b;cursor:pointer}.world-polities>div{display:flex;flex-wrap:wrap;gap:5px;margin-top:10px}.world-polities button{border:1px solid #685839;border-radius:8px;background:#30291e;color:#e7d4af;font:10px/1.4 system-ui;padding:6px 8px;text-align:left;cursor:pointer}
.future-mode #worldTerritoryLayer,.future-mode #worldTerritoryLabels{display:none!important}
.world-territory>path{fill-opacity:var(--area-opacity,.48);stroke-width:1.15;vector-effect:non-scaling-stroke;cursor:pointer;stroke-linejoin:round;touch-action:none}.world-territory.influence>path{stroke-dasharray:5 3;fill-opacity:calc(var(--area-opacity,.48)*.66)}.world-territory.cultural>path,.world-territory.settlement>path,.world-territory.landscape>path{stroke-dasharray:2 2;fill-opacity:calc(var(--area-opacity,.48)*.58)}.world-territory.uninhabited>path{fill-opacity:.38;stroke:none}.world-territory>path.world-territory-hatch{stroke:none;fill-opacity:1;pointer-events:none}.world-territory.selected>path:first-child,.world-territory>path:first-child:hover,.world-territory>path:first-child:focus-visible{stroke:#634725;stroke-width:2.4;fill-opacity:.7;outline:none}.world-territory-label{font-family:Georgia,serif;font-weight:700;fill:#342b20;paint-order:stroke;stroke:#f3e7cb;stroke-linejoin:round;pointer-events:none}.world-territory-label.selected{fill:#582e1c}
.world-map-steps{display:flex;align-items:center;gap:5px;margin-top:9px}.world-territories-toggle{display:flex;align-items:center;gap:5px;flex:1;color:#d8c496;font:10px/1.4 system-ui;cursor:pointer}.world-territories-toggle input{accent-color:#ba9b64}.world-map-steps button,.world-area-stages button{border:1px solid #73603f;border-radius:6px;padding:6px 7px;background:#30281e;color:#eed9ad;font:10px system-ui;cursor:pointer}.world-map-steps button:disabled{opacity:.3;cursor:default}.world-area-stages{display:flex;flex-wrap:wrap;gap:5px;margin-top:10px}.world-area-stages button[aria-pressed=true]{background:#6b5431;border-color:#d3b778}.world-area-detail{position:relative;border-left:4px solid var(--territory-color)}.world-area-detail h5{font:12px/1.5 system-ui;color:#e0c595;margin:8px 0}.world-area-close{float:right;border:0;background:none;color:#ddc597;font:22px/1 system-ui;cursor:pointer;padding:0 0 8px 12px}.world-explorer.has-area .world-heading,.world-explorer.has-area #worldScope{display:none}.world-explorer.has-area .world-header{padding-top:0}.world-area-detail[hidden]{display:none}
.world-territory-list{display:grid;grid-template-columns:1fr 1fr;gap:5px}.world-territory-list h4{grid-column:1/-1;font:14px Georgia,serif;color:#dec894;margin:5px 0}.world-territory-chip{border:1px solid #5b503b;border-left:4px solid var(--territory-color);border-radius:7px;padding:8px;text-align:left;color:#ead9b8;background:#2e291f;cursor:pointer;min-width:0;scroll-margin-top:210px;scroll-margin-bottom:12px}.world-territory-chip strong{display:block;font:12px/1.35 Georgia,serif}.world-territory-chip small{display:block;font:9px/1.5 system-ui;color:#bba986;margin-top:3px}.world-territory-chip:hover,.world-territory-chip[aria-pressed=true]{background:#463a26;border-color:#ba9b64}.world-area-detail h4:focus{outline:none}
@media(max-width:700px){.world-map-steps{margin-top:6px}.world-territories-toggle{font-size:9px}.world-territory-chip{padding:7px;scroll-margin-top:12px}.world-territory-chip strong{font-size:11px}}

.world-territory-guide{stroke:#605239;stroke-width:.8;stroke-opacity:.65;vector-effect:non-scaling-stroke;pointer-events:none}.world-territory.influence>path:first-child{fill-opacity:calc(var(--area-opacity,.51)*.82)}
.world-territory.political-outline>path:first-child{fill-rule:nonzero}.world-territory.sovereign-part:not(.selected):not(.detached-province)>path{fill:none;stroke:none;pointer-events:none}
.world-territory.mongol-unified-member>path{fill:none;stroke:none;pointer-events:none}
.world-territory.imperial-dependency>path:first-child{stroke-dasharray:4 3;fill-opacity:calc(var(--area-opacity)*.55)}
.world-imperial-parent{font:inherit;font-size:11px;text-align:left;color:#e4ca95;background:#302c23;border:1px solid #75633f;border-radius:6px;padding:6px 9px;margin:5px 0;cursor:pointer}.world-imperial-parent:focus-visible{outline:2px solid #dfbe79}

.world-legend-region{border-top:1px solid #63563d;margin-top:10px;padding-top:5px;display:flex;flex-wrap:wrap;gap:3px}.world-legend-region h4{width:100%;margin:4px 0;font:12px Georgia,serif;color:#e5cb91}.world-legend-region button{background:none;border:0;text-align:left}.world-legend-region button:focus-visible{outline:2px solid #e5cb91}.future-mode #worldMapLegend{display:none}
.world-modes{grid-template-columns:1.25fr 1fr .8fr}
.world-learning{margin:10px 0 13px;border-top:1px solid #605137;padding-top:8px}.world-learning summary{font:12px/1.45 Georgia,serif;color:#e9d2a0;cursor:pointer;padding:3px 0}.world-learning summary:focus-visible{outline:2px solid #e9d2a0;outline-offset:3px}.world-learning dl{margin:10px 0 0}.world-learning dt{font:10px/1.5 system-ui;font-weight:600;color:#d4b578;margin-top:10px}.world-learning dd{margin:3px 0 0;font:12px/1.65 system-ui;color:#d9ceb8}
.world-study-tools[hidden]{display:none}.world-study-tools{padding:4px 0 10px}.world-study-tools p{font:11px/1.6 system-ui;color:#ccbea1;margin:6px 0 9px}.world-study-tools input{box-sizing:border-box;width:100%;font:12px system-ui;color:#ead8b7;background:#191813;border:1px solid #62563e;border-radius:7px;padding:9px}
.world-explorer.studying #worldMapSteps,.world-explorer.studying #worldLegend,.world-explorer.studying #worldDating,.world-explorer.studying #worldStudyHint{display:none}.world-explorer.studying .world-study-tools{padding-top:10px}
@media(max-width:700px){.world-learning dd{font-size:11px}.world-learning summary{font-size:12px}.world-modes button{padding-inline:3px}}
.world-pager{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:8px 0;margin:6px 0 10px;border-block:1px solid var(--line);font-size:12px}
.world-pager button{min-width:42px;min-height:36px;border:1px solid var(--line);border-radius:6px;background:transparent;color:inherit;cursor:pointer}
.world-pager button:disabled{opacity:.3;cursor:default}
.world-pager button:focus-visible{outline:2px solid var(--gold);outline-offset:2px}

.world-territory-index{margin:8px 0 12px;border-block:1px solid #514733;padding:10px 0}.world-territory-index>summary{cursor:pointer;color:#e2c68e;font-size:12px}.world-territory-index>summary:focus-visible{outline:2px solid #ddbc78;outline-offset:3px}

/* Historic boundaries take precedence over the modern reference grid. */
.empire-path{stroke-linejoin:round;stroke-linecap:round;vector-effect:non-scaling-stroke;stroke-width:1.25;fill-rule:nonzero}.empire-dependency{stroke-width:1.1;stroke-dasharray:5 3;stroke-linejoin:round;vector-effect:non-scaling-stroke;cursor:pointer}.country-layer.modern-reference .country{stroke-opacity:.28}
.world-territory>path{fill-rule:nonzero;stroke-linecap:round}
.world-territory.military-occupation>path:first-child{fill-opacity:calc(var(--area-opacity,.5)*1.3);stroke-width:1.4;stroke-dasharray:none}
.world-territory>path.world-occupation-hatch{stroke:none;fill-opacity:1;pointer-events:none}
.world-territory.related-selected>path:first-child{stroke:#513238;stroke-width:1.8}
/* Context is not another sovereign colour. Preserve interactive hit areas and
   meaningful occupation hatching without darkening the country underneath. */
.world-territory>path.world-context-outline{fill-opacity:0!important}
.empire-path[data-empire-type="context"]{fill-opacity:0!important}
.world-territory>path.world-context-tint{pointer-events:none;stroke:none!important;fill-opacity:calc(var(--area-opacity,.5)*.55)}
.world-territory.military-occupation>path.world-context-tint{fill-opacity:var(--area-opacity,.5)}
.world-territory.selected>path[role=button],.world-territory>path[role=button]:hover,.world-territory>path[role=button]:focus-visible{stroke:#634725;stroke-width:2.4;outline:none}
.world-war-years{display:flex;gap:4px;flex-wrap:wrap;margin:8px 0 12px}
.world-war-years button{font:11px system-ui;border:1px solid #80694e;border-radius:5px;background:#30271f;color:#e9d4b2;min-height:30px;padding:5px 7px;cursor:pointer}
.world-war-years button[aria-pressed=true]{background:#805c60;border-color:#dfb79d;color:#fff1db}
.world-war-years button:focus-visible,.world-war-key:focus-visible{outline:2px solid #f3d99d;outline-offset:2px}
.world-war-note{font:11px/1.5 system-ui;color:#dbc4a1}
.world-war-key{position:absolute;right:12px;bottom:12px;z-index:4;padding:10px 12px;border:1px solid #927f69;border-radius:9px;background:#30271feb;color:#eddbc0;font:11px system-ui;cursor:pointer}
.world-war-key[hidden],.future-mode .world-war-key{display:none}
@media(max-width:700px){.world-war-key{right:7px;bottom:52px;padding:7px 9px;max-width:180px;font-size:10px}}

.kyrgyz-map-key{display:grid;gap:7px;padding:10px 0;margin:5px 0 10px;border-block:1px solid #514733}
.kyrgyz-map-key>span{display:flex;gap:9px;align-items:center;font-size:11px;line-height:1.4;color:#e3caa0}
.kyrgyz-map-key i{width:23px;height:11px;flex:none;background:#b08a5870;border:1px solid #b08a58;border-radius:2px}
.kyrgyz-map-key i.influence{background:#b08a585c;border-style:dashed}
.kyrgyz-map-key i.direction{height:0;border:0;border-top:2px dashed #f1ce83;border-radius:0}
#kyrgyzEraFacts .kyrgyz-map-note{font-size:10px;line-height:1.5;color:#baab91}
.kyrgyz-context #pulseLayer,.kyrgyz-context .place-dot.active .pulse{display:none}
.kyrgyz-context .trade-label{font-size:var(--kyrgyz-trade-font);stroke-width:var(--kyrgyz-trade-stroke)}
.empire-dependency[data-empire="kyrgyzKhaganate"]{stroke-width:1.6;stroke-dasharray:6 3;stroke-opacity:.95}
.kyrgyz-heartland{stroke-width:.8;stroke-opacity:.55}
#kyrgyzScope{position:absolute;left:14px;bottom:63px;max-width:255px;display:grid;gap:5px;padding:9px 11px;background:rgba(33,29,22,.94);color:#eadcc3;border:1px solid #806d49;border-radius:9px;font:10px/1.4 system-ui;z-index:5;pointer-events:none}
#kyrgyzScope strong{font-size:10px;font-weight:600;color:#f0cc85}
#kyrgyzScope span{display:flex;align-items:center;gap:7px}
#kyrgyzScope i{display:block;width:16px;height:8px;border:1px dashed #c5a06b;background:#b08a585c;flex:none}
#kyrgyzScope i.core{border-style:solid;background:#b08a5899}
#kyrgyzScope[hidden],body.future-mode #kyrgyzScope,.world-comparison.world-regional #kyrgyzScope{display:none!important}
@media(max-width:700px){#kyrgyzScope{left:8px;bottom:48px;max-width:215px;font-size:9px;padding:6px 8px;gap:3px}#kyrgyzScope strong{font-size:9px}}

#expansionLayer{pointer-events:none}
.expansion-route{--journey-color:#995624}
.expansion-route.treaty{--journey-color:#246d73}
.expansion-route.settlement,.expansion-route.voyage{--journey-color:#865c35}
.expansion-route.occupation{--journey-color:#784e8c}
.expansion-line,.expansion-hit{fill:none;vector-effect:non-scaling-stroke;stroke-linecap:round;stroke-linejoin:round}
.expansion-line{stroke:var(--journey-color);stroke-width:1.8;stroke-dasharray:6 5;opacity:.85}
.expansion-hit{pointer-events:stroke;stroke:transparent;stroke-width:14;cursor:pointer}
.expansion-route:hover .expansion-line,.expansion-route:focus-within .expansion-line{stroke-width:3;opacity:1}
.expansion-hit:focus-visible{stroke:#fff;stroke-opacity:.22;outline:none}
.expansion-symbol{pointer-events:none;fill:var(--journey-color);stroke:#262015;stroke-width:1}
.route-kind{color:var(--gold);font-size:12px}.route-caption,.route-source{font-size:12px;line-height:1.5;color:var(--muted)}
body.future-mode #expansionLayer{display:none!important}


.late-world-item{display:block;width:100%;color:inherit;text-align:left;font:inherit;background:transparent;cursor:pointer}.late-world-item:focus-visible{outline:2px solid #ddbc78;outline-offset:2px}.late-region h4{margin:14px 0 4px;color:#d9bd82;font:12px Georgia,serif}
#futureBtn{display:inline-flex!important;align-items:center;border-color:#9e8552;color:#f6dfaa;white-space:nowrap}#futureBtn[aria-pressed=true]{background:#665332;color:#fff4d8}
#futurePanel{min-height:0;min-width:0;height:100%;overflow:hidden;display:flex;flex-direction:column;background:#231f18}
.future-head{padding:16px 16px 12px;border-bottom:1px solid #544936;flex:none}.future-head h2{font:25px Georgia,serif;color:#f4e2bb;margin:4px 0 7px}.future-head p{color:#c5bba8;font-size:11px;line-height:1.5;margin:0 0 10px}
.future-controls{display:grid;grid-template-columns:1fr;gap:7px}.future-controls select,.future-controls input{width:100%;min-width:0;color:#efe0c4;background:#30291f;border:1px solid #675638;border-radius:7px;padding:8px;font:12px system-ui}.future-controls select:focus-visible{outline:2px solid #e1c580}
.future-scroll{overflow:auto;overscroll-behavior:contain;min-height:0;padding:14px 16px;scrollbar-gutter:stable;flex:1}.future-scroll h3{font:23px/1.2 Georgia,serif;color:#f5e6c7;margin:8px 0 12px}.future-scroll p{font-size:12px;line-height:1.65;color:#d1c5b0;margin:10px 0}.future-label{font:9px/1.5 system-ui;text-transform:uppercase;letter-spacing:.08em;color:#d6b778}.future-source{border-top:1px solid #514430;margin-top:16px;padding-top:10px;color:#d2b783;font-size:11px;line-height:1.7}.future-places{display:flex;flex-wrap:wrap;gap:6px;margin-top:10px}.future-places button{padding:6px 8px;border:1px solid #776340;border-radius:7px;background:#343023;color:#e8d9ba;font:11px system-ui;cursor:pointer}.future-places button:disabled{cursor:default;opacity:.8}
.future-context{border-left:2px solid #ac9060;padding-left:10px!important;color:#c3b69c!important;font-size:11px!important}.future-index{margin-top:18px}.future-index summary,.future-method summary{cursor:pointer;color:#e1c58c;font-size:12px;padding:10px 0}.future-list{display:grid;gap:5px;padding:0;margin:3px 0;list-style:none}.future-list button{width:100%;text-align:left;border:1px solid #514633;border-radius:7px;padding:9px 10px;background:#28231a;color:#d5c7ac;font:11px/1.45 system-ui;cursor:pointer}.future-list button[aria-current=true]{border-color:#ceb175;background:#49402b;color:#fff0cc}.future-method{border-top:1px solid #514633;margin-top:14px}.future-method p{font-size:11px}
#futureTimeline{display:grid;grid-template-columns:auto auto minmax(0,1fr) auto;gap:10px;align-items:center}.future-progress{min-width:0}.future-progress strong{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#eeddb7;font:14px Georgia,serif}.future-progress small{display:block;color:#c4b490;font:10px system-ui;margin-top:3px}.future-progress progress{display:block;width:100%;height:4px;margin-top:7px;accent-color:#d4b476}.future-status{min-width:0;max-width:210px;font:10px/1.5 system-ui;color:#cab895}
#futureMapNote{position:absolute;bottom:12px;left:12px;right:12px;pointer-events:none;display:flex;flex-wrap:wrap;gap:8px;align-items:center}.future-map-caption{font:10px/1.4 system-ui;color:#e2d0aa;background:rgba(29,26,20,.94);padding:7px 10px;border:1px solid #685534;border-radius:7px;max-width:440px}.future-map-caption b{color:#f4dcaa}.future-marker{cursor:pointer}.future-marker circle{fill:#c4a366;stroke:#ffedc8;stroke-width:1.3;vector-effect:non-scaling-stroke}.future-marker .future-halo{fill:#d7b26f;opacity:.13;stroke:#dfbd76;stroke-dasharray:3 3}.future-marker text{font:10px system-ui;fill:#fff0ce;paint-order:stroke;stroke:#211d17;stroke-width:3px;stroke-linejoin:round;pointer-events:none}.future-marker:focus{outline:none}.future-marker:focus circle{stroke:#fff;stroke-width:3}.future-marker.selected circle{fill:#ffdb88}
body.future-mode .side-card,body.future-mode #timelineCard,body.future-mode #empireLayer,body.future-mode #empireLabelLayer,body.future-mode #tradeLayer,body.future-mode #campaignLayer,body.future-mode #routeLayer,body.future-mode #pulseLayer,body.future-mode #placeLayer,body.future-mode #modernLabelLayer,body.future-mode .map-legend,body.future-mode .year-badge,body.future-mode #layersBtn,body.future-mode #layerPanel,body.future-mode #tooltip{display:none!important}
body.future-mode #countryLayer{display:block!important;pointer-events:none;opacity:.62}body.future-mode #atlasBtn,body.future-mode #compareBtn,body.future-mode #centralAsiaBtn,body.future-mode #aboutBtn{display:none!important}body.future-mode .map-toolbar .toolbar-block{max-width:100%}
@media(max-width:700px){#futureBtn{font-size:10px;padding:7px 8px}#atlasBtn,#compareBtn,#centralAsiaBtn,#aboutBtn{display:none!important}.topbar{gap:6px}.brand-title{font-size:11px}.monogram{display:none}.top-actions{gap:4px}#futurePanel{grid-column:1;grid-row:2;border-radius:12px}.future-head{padding:8px 11px}.future-head h2{font-size:18px;margin:0 0 5px}.future-head p{display:none}.future-controls{grid-template-columns:minmax(0,1.25fr) minmax(0,1fr);gap:5px}.future-controls select,.future-controls input{padding:6px;font-size:10px}.future-scroll{padding:9px 11px}.future-scroll h3{font-size:20px;margin:5px 0 7px}.future-scroll p{font-size:11px;line-height:1.55}.future-source{margin-top:9px;padding-top:6px}.future-label{font-size:8px}#futureTimeline{grid-template-columns:auto auto minmax(0,1fr) auto;gap:7px}.future-status{display:none}.future-progress strong{font-size:12px}.future-progress small{font-size:9px}#futureMapNote{bottom:8px;left:8px;right:8px}.future-map-caption{font-size:9px;padding:5px 7px}.future-marker text{font-size:9px}}
@media(max-height:550px) and (min-width:701px){.future-head{padding:8px 12px}.future-head h2{font-size:20px}.future-head p{display:none}.future-controls{grid-template-columns:1fr 1fr}.future-scroll{padding:10px 12px}}

.future-area{fill:#d6b876;fill-opacity:.19;stroke:#d6b876;stroke-width:1;stroke-dasharray:4 3;vector-effect:non-scaling-stroke;pointer-events:none}
.future-territory{fill:#aa7640;fill-opacity:.45;stroke:#ffdb92;stroke-width:2;vector-effect:non-scaling-stroke;pointer-events:none}
.future-territory-label{font:600 12px system-ui;fill:#fff1cf;paint-order:stroke;stroke:#302316;stroke-width:3px;stroke-linejoin:round;pointer-events:none}
.future-geography{margin:8px 0 16px;padding:12px;border:1px solid #625037;border-radius:8px;background:#30291f}.future-geography strong{display:block;margin-top:4px;color:#f0dcae;font:13px system-ui}.future-geography p{margin:6px 0 10px!important;font-size:11px!important;line-height:1.55!important}.future-geography .future-geography-source{font-size:10px!important;margin-bottom:0!important;color:#bfae8e!important}.future-geography .btn{font-size:11px;padding:6px 10px}
.future-map-caption strong,.future-map-caption span{display:block}.future-map-caption strong{color:#f4dcaa;margin-bottom:3px;font-size:12px}
.future-route{fill:none;stroke:#f3d17e;stroke-width:3;stroke-dasharray:3 2;vector-effect:non-scaling-stroke;pointer-events:none;animation:future-route-travel 7s linear 1}
@keyframes future-route-travel{from{stroke-dashoffset:100}to{stroke-dashoffset:0}}
.future-chapters{display:flex;gap:6px;overflow-x:auto;margin-top:10px}.future-chapters[hidden]{display:none}
.future-chapters button{min-width:28px;min-height:28px;border:1px solid #79653e;border-radius:50%;color:#ddc89d;background:#2e281d;cursor:pointer}.future-chapters button[aria-current=true]{background:#d5b878;color:#221e17}
.future-grade{display:inline-block;border:1px solid #63735b;border-radius:6px;padding:5px 8px;color:#cee0bb!important;font-size:10px!important}
@media(prefers-reduced-motion:reduce){.future-route{animation:none}}

#futureBattle{display:block;width:100%;margin-top:8px;color:#f4dfac;border-color:#a68a51;text-align:left}

.future-hadith{margin-top:14px;border-top:1px solid #71603e;padding-top:12px}.future-hadith summary{cursor:pointer;color:#f4dfac;padding:8px 0}.future-hadith h4{font-size:12px;color:#d8bd80}.future-hadith .future-arabic{font-family:"Traditional Arabic","Noto Naskh Arabic",Tahoma,serif;font-size:22px;line-height:2.05;text-align:right;white-space:pre-wrap;overflow-wrap:anywhere;color:#eee5d0}.future-hadith section+section{border-top:1px solid #71603e;margin-top:16px}

.future-quote .future-source{margin:6px 0 14px;padding-top:0;border:0;color:#d8bd80}.future-translation{margin:8px 0 20px;padding:0 0 0 14px;border-left:2px solid #b7985d;font-size:16px;line-height:1.7;color:#f2e9d7}.future-quote .future-arabic{margin:8px 0 20px;padding:0;font-family:"Traditional Arabic","Noto Naskh Arabic",Tahoma,serif;font-size:23px;line-height:1.9;text-align:right;white-space:pre-wrap;overflow-wrap:anywhere;color:#eee5d0}.future-quote .future-label{font-size:9px;color:#bca777}

/* The scene occupies the existing map cell, leaving the atlas timeline in view. */
body.future-mode #mapCard{background:#1e281f}
#futureSceneSwitch{position:absolute;z-index:19;top:14px;right:14px;display:flex;gap:3px;padding:4px;border:1px solid #67684c;border-radius:22px;background:#22291ff5;box-shadow:0 6px 25px #101a1644}
#futureSceneSwitch button{border:0;border-radius:18px;padding:8px 14px;min-height:34px;color:#bec3ab;background:transparent;font:12px system-ui;cursor:pointer}
#futureSceneSwitch button[aria-pressed=true]{background:#d9bd85;color:#242d20}
#futureSceneSwitch button:hover{filter:brightness(1.12)}
#futureScene{position:absolute;z-index:17;inset:0;display:flex;flex-direction:column;min-height:0;overflow:hidden;color:#f0dfbb;background:radial-gradient(ellipse at 50% 59%,#39462d55,#20281ef2 78%);padding:68px 24px 0}
#futureScene[hidden],#futureSceneSwitch[hidden]{display:none}
body.future-mode #mapCard[data-future-view=illustration] #worldMap{opacity:.13;pointer-events:none}
body.future-mode #mapCard[data-future-view=illustration] .map-toolbar,
body.future-mode #mapCard[data-future-view=illustration] #futureMapNote,
body.future-mode #mapCard[data-future-view=illustration] #futureLayer{visibility:hidden}
body.future-mode #mapCard[data-future-view=map] .map-toolbar{right:215px}
body.future-mode #kyrgyzHistoryBtn,body.future-mode #mongolScope,body.future-mode #kyrgyzRouteLayer,body.future-mode .opacity-control{display:none!important}
.future-scene-head{flex:none;min-width:0;padding:0 5px;text-align:left}
.future-scene-kicker{color:#b5b69a;font:11px/1.4 system-ui;letter-spacing:.09em;text-transform:uppercase}
#futureSceneTitle{font:clamp(21px,2.4vw,33px)/1.16 Georgia,serif;font-weight:400;margin:9px 0 12px;max-width:700px;color:#f0dfba;text-wrap:balance}
#futureScenePlaces{display:flex;flex-wrap:wrap;gap:5px;max-height:66px;overflow:auto}
#futureScenePlaces:empty{display:none}
#futureScenePlaces button{background:#343e2c;border:1px solid #70745377;border-radius:18px;color:#d9c99f;font:11px/1.35 system-ui;padding:6px 10px;cursor:pointer}
#futureScenePlaces button:hover{background:#45503a;color:#f3e0b7}
.future-scene-canvas{flex:1;min-height:0;display:grid;place-items:center;overflow:hidden}
#futureSceneArt{display:block;width:100%;height:100%;min-height:0;overflow:visible;filter:drop-shadow(0 10px 18px #0d190d33)}
.future-scene-caption{flex:none;padding:6px 10px 13px;display:flex;gap:12px;align-items:baseline;justify-content:space-between;min-width:0}
#futureSceneCaption{font:clamp(14px,1.5vw,19px)/1.3 Georgia,serif;color:#e8d4a7}
#futureSceneKind{font:10px/1.4 system-ui;color:#a5ad92;text-align:right;flex:0 1 112px}
.future-scene-player{flex:none;display:flex;gap:18px;align-items:center;margin:0 -24px;padding:15px 24px;border-top:1px solid #60654677;background:#1d261ded}
#futureScenePlay{display:flex;align-items:center;justify-content:center;gap:9px;border:0;background:#d9bd85;color:#263122;border-radius:25px;padding:12px 17px;min-height:42px;font:12px/1.3 system-ui;cursor:pointer;min-width:142px}
#futureScenePlay:hover{background:#ead297}#futureScenePlay:disabled{opacity:.4}
.future-scene-play-symbol{width:14px;text-align:center}
.future-scene-track{flex:1;min-width:0;display:block}
.future-scene-track-head{display:flex;align-items:center;justify-content:space-between;gap:8px;font:11px/1.35 system-ui;color:#b8c0a3}
#futureScenePercent{color:#e5d4ab;font-variant-numeric:tabular-nums}
#futureSceneSeek{display:block;width:100%;height:21px;accent-color:#d9bd85;margin:6px 0 0;cursor:pointer}
.future-scene-sr{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
body.future-mode .future-head{padding:12px 16px 10px}body.future-mode .future-head h2{font-size:22px}
body.future-mode .future-head p{display:none}
body.future-mode #futureArticle>.future-geography{margin-top:18px}
body.future-mode .future-quote .future-source{font-size:12px}
body.future-mode #futurePanel{background:#24241c}body.future-mode .future-translation{font-family:Georgia,serif;line-height:1.7}
@media(max-width:1000px) and (min-width:701px){#futureScene{padding:64px 16px 0}.future-scene-player{margin:0 -16px;padding:12px 16px;gap:11px}#futureScenePlay{min-width:116px;font-size:11px;padding:11px}.future-scene-caption{display:block}#futureSceneKind{display:block;margin-top:4px;text-align:left}}
@media(max-width:700px){
 body.future-mode .layout{grid-template-rows:minmax(240px,1.2fr) minmax(150px,1fr) auto}
 #futureScene{padding:44px 11px 0}.future-scene-kicker{display:none}#futureSceneTitle{font-size:18px;margin:3px 0 6px;line-height:1.15}
 #futureSceneSwitch{top:7px;right:8px;padding:2px}#futureSceneSwitch button{font-size:11px;padding:5px 10px;min-height:29px}
 #futureScenePlaces{display:none}.future-scene-head{padding:0 2px}
 .future-scene-caption{padding:2px 2px 7px}#futureSceneCaption{font-size:12px;line-height:1.25}#futureSceneKind{display:none}
 .future-scene-player{gap:10px;margin:0 -11px;padding:7px 10px}#futureScenePlay{font-size:11px;min-height:34px;min-width:114px;padding:8px 10px}
 .future-scene-track-head{font-size:10px}#futureSceneSeek{height:17px;margin-top:2px}
 body.future-mode #mapCard[data-future-view=map] .map-toolbar{top:47px;right:8px}
 body.future-mode .future-head{padding:7px 10px}body.future-mode .future-head h2{display:none}body.future-mode .future-head>.future-label{display:none}
 body.future-mode .future-chapters{margin-top:6px}body.future-mode #futureBattle{margin-top:5px;padding:5px 8px;font-size:10px}
 body.future-mode .future-scroll{padding-top:8px}.future-scene-canvas{min-height:70px}
}
@media(max-height:580px) and (min-width:701px){#futureScene{padding-top:54px}#futureSceneTitle{font-size:21px;margin:4px 0}.future-scene-kicker{display:none}#futureScenePlaces{display:none}.future-scene-player{padding-top:8px;padding-bottom:8px}.future-scene-caption{padding-bottom:7px}#futureSceneKind{display:none}}
@media(max-height:680px) and (max-width:700px){body.future-mode .layout{grid-template-rows:minmax(220px,1.1fr) minmax(120px,1fr) auto}#futureSceneTitle{font-size:16px}.future-scene-caption{display:none}}
@media(pointer:coarse){#futureSceneSwitch button,#futureScenePlay,#futureScenePlaces button{min-height:44px}#futureSceneSeek{height:28px}#futureScene{padding-top:60px}}

#supportBtn{display:inline-flex!important;align-items:center;justify-content:center;white-space:nowrap;background:#3b3322;border-color:#a58b56;color:#f5dfae}
#supportBtn:hover{background:#51442b}
.support-lead{color:#e0c48a!important}.support-status{padding:14px;background:#2c271d;border:1px solid #65553a;border-radius:10px}
@media(min-width:701px) and (max-width:1380px){.brand-sub{display:none}.topbar{gap:8px;padding-inline:12px}.top-actions{gap:5px}.top-actions .btn{font-size:10px;padding:7px 8px}}
@media(max-width:700px){
 .topbar{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);grid-template-rows:28px 32px;gap:5px 8px;height:84px;min-height:84px;padding:8px 10px}
 .topbar .brand{grid-column:1;grid-row:1;min-width:0}.topbar .brand-title{font-size:12px}
 .topbar .top-actions{display:contents}
 #languageSelect{grid-column:2;grid-row:1;justify-self:end;width:96px;max-width:96px}
 #futureBtn{grid-column:1;grid-row:2;min-width:0;width:100%;font-size:10px;white-space:normal;line-height:1.15;text-align:center;justify-content:center;padding:5px}
 #supportBtn{grid-column:2;grid-row:2;min-width:0;width:100%;font-size:10px;white-space:normal;line-height:1.15;text-align:center;padding:5px}
}

#contactBtn{display:inline-flex!important;align-items:center;justify-content:center;white-space:nowrap}
.contact-email{color:var(--gold-soft);overflow-wrap:anywhere;text-underline-offset:4px}
.contact-email:focus-visible{outline:2px solid var(--gold-soft);outline-offset:4px}
@media(max-width:700px){
 .topbar{grid-template-columns:repeat(3,minmax(0,1fr))}
 .topbar .brand{grid-column:1 / 3}
 #languageSelect{grid-column:3}
 #futureBtn{grid-column:1}#supportBtn{grid-column:2}
 #contactBtn{grid-column:3;grid-row:2;min-width:0;width:100%;font-size:10px;padding:5px}
}

/* Existing map and timeline remain in place; only event epicentres blink briefly. */
.year-event-accent{pointer-events:none}
.year-event-ring{fill:#da5b2826;stroke:#b43b22;stroke-width:2}
.year-event-dot{fill:#c84724;stroke:#fff3d3;stroke-width:1.5}
.year-event-blink{animation:year-event-blink 1.2s ease-in-out 2}
@keyframes year-event-blink{0%,100%{opacity:1}50%{opacity:.15}}
@media(prefers-reduced-motion:reduce){.year-event-blink{animation:none}}
body.future-mode .year-event-accent{display:none}

