/* Incremental layout fixes: the map has its own stage, with controls outside
   the narration panel. Existing colours, typography and content are preserved. */
:root{--muted:#a9bebd;--control:44px}
*{box-sizing:border-box}
button,a,input,textarea,summary{-webkit-tap-highlight-color:transparent}
button:focus-visible,a:focus-visible,input:focus-visible,textarea:focus-visible,summary:focus-visible,canvas:focus-visible{outline:2px solid #f8d18d;outline-offset:3px}
button{touch-action:manipulation}
button:disabled{opacity:.58}
.skip-link{position:fixed;top:8px;left:8px;transform:translateY(-150%);z-index:100;background:#e3bd78;color:#10262c;padding:14px;border-radius:8px}
.skip-link:focus{transform:translateY(0)}
.world{align-self:start;min-height:0;overflow:hidden}
.map-top{position:relative;z-index:12;display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:16px;padding:24px 22px 8px;background:linear-gradient(#06141cec,#06141c00)}
.map-heading{position:static;max-width:none;grid-column:1;filter:none}
.map-heading h1{font-size:clamp(30px,3.2vw,42px);margin:12px 0 5px}
.map-top .search{position:relative;inset:auto;width:100%;grid-column:1/-1;min-height:48px;margin:0;padding:2px 12px}
.search input{font-size:16px;min-height:44px}
.search>button{min-width:44px;min-height:44px}
.map-top .view-switch{position:relative;inset:auto;grid-column:1/-1;width:100%;display:flex;justify-content:space-between;gap:4px}
.view-switch button{flex:1;font-size:13px;min-height:44px;padding:8px 5px}
.map-top .maximize{position:relative;inset:auto;grid-column:2;grid-row:1;min-width:44px;min-height:44px;padding:10px;font-size:20px}
.map-top .maximize span{display:none}
.map-stage{position:relative;min-width:0;isolation:isolate}
#globe{height:clamp(380px,49vw,540px);width:100%;filter:saturate(1.08) contrast(1.03)}
.maptools{left:auto;right:14px;top:18px;bottom:auto;z-index:5;gap:5px}
.maptools>button,.maptools>div{background:#071923e8}
.maptools>button{width:44px;min-height:44px;padding:8px}
.maptools>div{display:flex;flex-direction:column}
.maptools>div button{width:44px;min-height:44px;padding:8px}
.maptools button span{display:none}
.map-note{left:16px;right:auto;bottom:16px;max-width:calc(100% - 90px);text-align:left;letter-spacing:.2px;pointer-events:none;font-size:12px}
.map-note small{font-size:11px;line-height:1.4}
.world:has(#map-peek:not([hidden])) .map-note{display:none}
#map-peek{left:14px;right:76px;bottom:14px;transform:none;max-width:none;padding:9px 12px;gap:12px}
#map-peek>div{min-width:0;flex:1}
#map-peek strong{overflow-wrap:anywhere}
#map-peek button{min-height:44px;font-size:13px;white-space:normal}
#map-loading{left:16px;right:16px;text-align:center;top:45%}
.guide,.world:has(#map-peek:not([hidden])) .guide{position:relative;inset:auto;margin:0 14px 14px;width:calc(100% - 28px);max-width:none;grid-template-columns:116px minmax(0,1fr);gap:10px;padding:16px 14px 14px;background:linear-gradient(120deg,#0e2b33,#0a202a);box-shadow:0 12px 35px #0005;backdrop-filter:none}
.guide-character{height:auto;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:0;align-self:start}
.guide-content{padding:0;min-width:0}
.guide-title{padding-right:36px;flex-wrap:wrap;gap:3px 9px;align-items:center}
.guide-title strong{font-size:24px}
.guide-title span{font-size:12px;line-height:1.45;display:block;overflow-wrap:anywhere}
.guide-content>p{font-size:14px;line-height:1.6}
#guide-caption{max-height:126px;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;padding-right:3px}
.guide-minimize{width:44px;height:44px;top:4px;right:4px;z-index:1}
.mundi-puppet{width:112px;height:112px;display:block;object-fit:contain;filter:drop-shadow(0 8px 12px #0006);transform-origin:50% 85%}
#mundi-state{font-size:12px;line-height:1.35;color:#c5d9d0;max-width:115px;min-height:32px;margin-top:6px}
.mundi-puppet[data-motion=breathe]{animation:atlas-breathe 4.5s ease-in-out infinite}
.mundi-puppet[data-motion=talk]{animation:mundi-talk .95s ease-in-out infinite}
.mundi-puppet[data-motion=think]{animation:mundi-think 2.7s ease-in-out infinite}
.mundi-puppet[data-motion=surprise]{animation:atlas-surprise .7s ease-out both}
.mundi-puppet[data-motion=happy]{animation:atlas-happy 1.5s ease-in-out 2}
.mundi-puppet[data-motion=celebrate]{animation:mundi-celebrate .65s ease-in-out 3}
.mundi-puppet[data-motion=encourage]{animation:atlas-nod 1.6s ease-in-out 2}
.mundi-puppet[data-motion=point]{animation:atlas-point 1.8s ease-in-out 2}
@keyframes atlas-breathe{50%{transform:translateY(-3px) scale(1.01)}}
@keyframes atlas-surprise{30%{transform:translateY(-7px) scale(1.08)}70%{transform:translateY(-2px) scale(1.02)}}
@keyframes atlas-happy{50%{transform:rotate(4deg) translateY(-3px)}}
@keyframes atlas-nod{35%{transform:rotate(4deg) translateY(2px)}65%{transform:rotate(-2deg)}}
@keyframes atlas-point{50%{transform:translateX(4px) rotate(2deg)}}
.challenge-guide{display:flex;align-items:center;gap:14px;padding-right:32px;color:#e3bd78}
.challenge-guide .mundi-puppet{width:92px;height:92px}
.challenge-guide span{font-size:14px}
.narration-controls{gap:6px}
.narration-controls button{min-width:44px;min-height:44px;font-size:13px;padding:9px 11px}
.audio-progress span{display:block;font-size:12px;white-space:normal}
.audio-progress progress{height:7px}
.audio-notice{font-size:13px!important;line-height:1.5!important}
.seek-label{display:block;font-size:12px;color:#b7cbc3;margin:8px 0 0}
#audio-seek{height:26px;min-height:26px;margin:0}
#audio-seek:disabled{opacity:.35;cursor:default}
#narration-transcript{font-size:13px;margin-top:8px;color:#c6d7d1}
#narration-transcript summary{min-height:36px;display:list-item;padding-top:8px;color:var(--gold);cursor:pointer}
#narration-transcript p{font-size:14px;line-height:1.7;max-height:200px;overflow:auto}
#audio-credit{font-size:12px;line-height:1.5}
#audio-credit a{color:#e3bd78}
.guide-restore{position:relative;inset:auto;margin:8px 14px 14px;min-height:44px;font-size:14px}
.destination-strip{position:relative;inset:auto;margin:0 14px 14px;padding:5px 0;min-height:54px}
.destination-strip button{min-height:44px;font-size:13px}
.source-link{font-size:12px;color:#b5d7ca;line-height:1.5;text-decoration:underline;text-underline-offset:3px}
.place-description.has-read-more{overflow-wrap:anywhere}
.place-description .description-preview,.place-description .description-full{white-space:normal}
.place-description .description-preview[hidden],.place-description .description-full[hidden]{display:none!important}
.place-description .read-more-toggle{display:inline-flex;align-items:center;min-height:36px;margin:-7px -3px -7px 2px;padding:7px 3px;border:0;border-radius:5px;background:transparent;color:var(--gold);font:600 inherit;text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:3px;cursor:pointer;white-space:nowrap}
.place-description .read-more-toggle:hover{color:#f4d59c;background:#ffffff0a}
.place-description.is-expanded .read-more-toggle{margin-left:5px}
.history-source{margin:8px 0 14px;display:flex;flex-wrap:wrap;gap:5px 12px}
.history-source .source-link,.history-claim .source-link{margin-top:3px}
.historical-context{padding:14px;border:1px solid #a5c4b82d;border-radius:10px;margin:16px 0;background:#08232a}
.historical-context>h3{font:500 22px Georgia,serif;margin:0 0 12px}
.historical-context h4,.comparison-columns h4{font:600 13px/1.5 'DM Sans',sans-serif;color:#e3bd78;margin:13px 0 5px}
.historical-context p{font-size:14px;line-height:1.7;color:#d0ded7;margin:4px 0 7px}
.historical-context .coverage-note{padding-left:10px;border-left:2px solid #c6a576;margin:12px 0}
.historical-context details{margin-top:14px}
.historical-context summary{cursor:pointer;min-height:36px;font-size:13px;color:#cce2d9}
.historical-context details p,.historical-context small{font-size:12px;line-height:1.6}
.time-comparison .comparison-columns{display:grid;grid-template-columns:1fr;gap:16px}
.comparison-columns section+section{border-top:1px solid #aac7b82d;padding-top:10px}
.time-comparison p{font-size:14px;line-height:1.6}
.time-comparison small,.outfit-note p{font-size:12px;line-height:1.6}
.time-comparison summary,.outfit-note summary{font-size:14px;min-height:32px}
.region-pick-list button,.nearby-list button,.scope-hint .subtle{min-height:44px;font-size:14px}
.region-pick-list{grid-template-columns:1fr}
.scope-hint .subtle{margin:3px 4px 3px 0}
.scope-hint p{font-size:14px}
.place-actions button,.subtle,.iconbtn{min-height:44px}
.iconbtn{min-width:44px}
#close-detail{width:44px;height:44px}
#era{min-height:40px}
.ticks{font-size:12px}
footer{color:#a8bdba;font-size:12px}
footer button{min-height:44px;font-size:12px}
dialog{max-height:calc(100dvh - 28px);padding-top:44px}
dialog .close{width:44px;height:44px;right:8px;top:8px}
dialog select,dialog input[type=file]{max-width:100%;font-size:16px;min-height:44px}
dialog textarea{font-size:16px}
dialog label{line-height:1.6}
dialog input[type=range]{min-height:36px}
.audio-settings-grid{gap:20px}
.auto-route input{min-width:24px;min-height:24px}
.auto-route{min-height:44px}
.route-card .primary{min-height:44px}
.journey-actions{flex-wrap:wrap}
.journey-actions .primary{white-space:normal}
.immersive .map-top{position:absolute;left:16px;right:16px;top:max(12px,env(safe-area-inset-top));z-index:45;padding:0;display:flex;flex-wrap:wrap;gap:9px;background:none;pointer-events:none}
.immersive .map-top>*{pointer-events:auto}
.immersive .map-top .map-heading{display:none}
.immersive .map-top .view-switch{position:relative;inset:auto;width:340px;margin:0;flex:0 0 auto}
.immersive .map-top .search{position:relative;inset:auto;width:330px;margin-left:auto;flex:0 1 330px}
.immersive .map-top .maximize{position:fixed;inset:auto;bottom:max(16px,env(safe-area-inset-bottom));right:16px;min-width:44px;min-height:44px;font-size:20px}
.immersive .map-top .maximize span{display:none}
.immersive .world{width:100vw;height:100dvh;align-self:stretch}
.immersive .map-stage{position:absolute;inset:0}
.immersive #globe{width:100vw;height:100dvh}
.immersive .maptools{top:auto;bottom:82px;right:16px;left:auto;gap:5px}
.immersive .map-note{left:16px;right:auto;bottom:80px;text-align:left;max-width:calc(100% - 100px)}
.immersive #map-peek{bottom:80px;left:16px;right:78px;transform:none;max-width:440px}
.immersive .guide,.immersive .world:has(#map-peek:not([hidden])) .guide{position:absolute;left:14px;right:auto;bottom:14px;margin:0;width:min(550px,calc(100% - 28px));max-height:48dvh;overflow:auto;overscroll-behavior:contain;z-index:50;box-shadow:0 15px 50px #000a}
.immersive .guide-restore{position:absolute;left:14px;bottom:14px;margin:0;z-index:46}
.immersive .world:has(#guide:not([hidden])) .map-note,.immersive .world:has(#guide:not([hidden])) #map-peek{display:none}
.immersive.show-detail #place{z-index:55;top:132px;bottom:16px;right:16px;max-height:calc(100dvh - 148px);width:360px}
.immersive.show-detail #close-detail{z-index:56;top:138px;right:24px;width:44px;height:44px}
@media(min-width:1250px){
 .map-top{grid-template-columns:minmax(0,1fr) minmax(230px,290px) 44px}
 .map-top .search{grid-column:2;grid-row:1}
 .map-top .maximize{grid-column:3}
 .map-top .view-switch{grid-column:1/-1;max-width:390px}
}
@media(max-width:900px){
 main{display:flex;flex-direction:column}
 .world,aside{width:100%}
 #globe{height:450px}
 .map-top{padding:20px 16px 8px;gap:12px}
}
@media(max-width:600px){
 .map-top{padding:18px 12px 6px;gap:10px}
 .map-heading h1{font-size:30px}
 .map-heading .eyebrow{font-size:9px;letter-spacing:1.2px}
 #globe{height:390px}
 .maptools{right:10px;top:15px}
 .map-note{left:12px}
 #map-peek{left:10px;right:66px}
 .guide{margin:0 10px 12px;width:calc(100% - 20px);grid-template-columns:76px minmax(0,1fr);padding:12px;gap:6px 10px}
 .guide-content{display:contents}
 .guide-character{grid-column:1;grid-row:1/3}
 .guide-title{grid-column:2;display:block;padding-right:26px}
 .guide-title span{font-size:12px;display:block}
 .guide-title strong{font-size:23px}
 #guide-caption{grid-column:2;min-height:42px;font-size:14px;line-height:1.5;max-height:110px;margin:4px 0 8px}
 .mundi-puppet{width:82px;height:82px}
 #mundi-state{font-size:11px;max-width:76px}
 .audio-progress,.narration-controls,.audio-notice,.seek-label,#audio-seek,#audio-credit,#narration-transcript{grid-column:1/-1}
 .audio-progress{margin:3px 0 8px}
 .narration-controls{display:grid;grid-template-columns:1fr 44px 44px}
 .narration-controls button{font-size:14px;min-height:44px;max-width:none!important}
 .narration-controls button:last-child{grid-column:1/-1}
 .audio-progress span{font-size:12px}
 .guide-restore{margin-left:10px}
 .destination-strip{margin:0 10px 12px}
 .place-content{padding:0 18px 20px}
 .timebar{padding:18px}
 .timebar .eyebrow{font-size:10px}
 .journey-actions #browse-routes{width:100%}
 .immersive .map-top{left:10px;right:10px;top:max(10px,env(safe-area-inset-top));gap:8px}
 .immersive .map-top .view-switch{width:100%;flex-basis:100%}
 .immersive .map-top .search{width:100%;flex-basis:100%;margin:0}
 .immersive .maptools{bottom:80px;right:10px;left:auto}
 .immersive .guide,.immersive .world:has(#map-peek:not([hidden])) .guide{left:10px;right:10px;bottom:10px;width:calc(100% - 20px);max-height:48dvh}
 .immersive .world:has(#guide:not([hidden])) .maptools{bottom:calc(48dvh + 18px);flex-direction:row;flex-wrap:wrap;width:142px}
 .immersive .world:has(#guide:not([hidden])) .maptools>div{flex-direction:row}
 .immersive .map-note{left:12px;bottom:82px;font-size:12px}
 .immersive #map-peek{left:10px;right:68px;bottom:82px}
 .immersive.show-detail #place{left:10px;right:10px;top:132px;bottom:10px;width:auto;max-height:calc(100dvh - 142px)}
 .immersive.show-detail #close-detail{top:138px;right:18px}
 .immersive.show-detail .guide,.immersive.show-detail .maptools{visibility:hidden}
}
@media(max-width:350px){.brand{font-size:18px}.brand small{letter-spacing:1.2px}.nav{font-size:12px}.nav span{margin-left:3px}.map-heading h1{font-size:28px}.view-switch button{font-size:12px}.guide-title strong{font-size:21px}}
@media(prefers-reduced-motion:reduce){.mundi-puppet{animation:none!important}.guide{transition:none}#globe{scroll-behavior:auto}}

/* Required route challenges: centered, focused and answer-first without changing free exploration. */
dialog.challenge-required{width:min(680px,calc(100% - 24px));max-width:680px;max-height:calc(100dvh - 24px);padding:34px 30px 28px;border-color:#d1aa63;background:linear-gradient(145deg,#132f35,#0b2028);box-shadow:0 24px 90px #000c}
dialog.challenge-required::backdrop{background:#02090dcc;backdrop-filter:blur(10px)}
dialog.challenge-required h2{font-size:clamp(25px,4vw,36px);line-height:1.18;margin:14px 0 12px}
dialog.challenge-required .challenge-required-note{margin:0 0 16px;color:#e3bd78;font-size:14px}
dialog.challenge-required .answer{min-height:50px;margin:10px 0;font-size:15px;background:#0c252d}
dialog.challenge-required .answer:hover:not(:disabled){background:#173b43}
dialog.challenge-required #feedback{min-height:28px;margin:16px 0;color:#cbdad4}
dialog.challenge-required #challenge-continue{width:100%;margin-top:8px}
dialog.challenge-required #leave-route{display:block;width:100%;margin-top:10px;color:#b6c9c4}
dialog.challenge-required .challenge-guide{margin:-8px 0 10px;padding:0;border:0;background:transparent;box-shadow:none}
dialog.challenge-required .challenge-guide span{font-size:14px}
@media(max-width:600px){dialog.challenge-required{width:calc(100% - 16px);padding:25px 17px 20px}dialog.challenge-required .answer{font-size:16px;padding:13px 12px}dialog.challenge-required .challenge-guide .mundi-puppet{width:76px;height:76px}}

/* Keep search results above the view buttons, including narrow screens. */
.map-top .search{z-index:50}
