/* Keep the map useful in a single viewport, with artwork available on demand. */
body.atlas-app{grid-template-rows:calc(56px + env(safe-area-inset-top,0px)) minmax(0,1fr)}
.atlas-app .site-header{height:100%;padding-top:env(safe-area-inset-top,0px)}
.atlas-app main{padding-bottom:max(14px,env(safe-area-inset-bottom,0px));padding-left:max(14px,env(safe-area-inset-left,0px));padding-right:max(14px,env(safe-area-inset-right,0px))}
.atlas-app [hidden]{display:none!important}
.atlas-app #world-view{--hero-height:clamp(128px,20dvh,224px);grid-template-rows:42px var(--hero-height) 64px minmax(0,1fr);gap:8px}
.atlas-app .region-filter>span{flex:none;white-space:nowrap}
.atlas-app .era-art-open{position:absolute;z-index:3;right:12px;bottom:12px;min-height:32px;padding:5px 10px;border:1px solid #e2e9f299;border-radius:8px;background:#112136c9;color:#fff;font:500 12px/20px var(--sans);backdrop-filter:blur(6px)}
.atlas-app .era-art-open:disabled{opacity:.55;cursor:wait}
.atlas-app .chapter-copy{padding-top:12px;padding-bottom:12px;gap:4px}
.atlas-app .chapter-title{font-size:clamp(30px,3vw,44px)}
.atlas-app .chapter-subtitle{font-size:18px;line-height:25px}
.atlas-app .chapter-intro{font-size:14px;line-height:21px;margin-top:2px}
.atlas-app .map-panel{grid-template-rows:40px minmax(0,1fr) 66px 32px 24px}
.atlas-app .map-wrap,.atlas-app .map-wrap svg{overflow:hidden}
.atlas-app .map-workspace-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:0 10px;min-height:0}
.atlas-app .map-workspace-heading h2,html[lang=en] .atlas-app .map-workspace-heading h2{font:600 14px/22px var(--sans);white-space:nowrap;letter-spacing:0}
.atlas-app .map-navigation{display:flex;align-items:center;gap:5px;flex:none}
.atlas-app .map-navigation button{height:30px;min-width:30px;padding:3px 8px;border:1px solid #566c89;border-radius:7px;background:#21334b;color:#edf2fa;font:500 12px/22px var(--sans);white-space:nowrap}
.atlas-app .map-navigation #map-zoom-in,.atlas-app .map-navigation #map-zoom-out{font-size:20px;padding:2px 5px}
.atlas-app .map-navigation #map-expand{border-color:#a7b9d1}
.atlas-app .map-navigation #map-expand[aria-pressed=true]{background:#e8efff;color:#23446e}
.atlas-app .territory-controls{padding:3px 10px;overflow:hidden}
.atlas-app .territory-control-row,html[lang=en] .atlas-app .territory-control-row{display:grid;grid-template-columns:auto auto minmax(0,1fr);grid-template-rows:28px 28px;min-height:56px;gap:3px 8px}
.atlas-app .territory-check{font-size:12px;min-height:28px;gap:5px}
.atlas-app #range-details-toggle,html[lang=en] .atlas-app #range-details-toggle{grid-column:3;grid-row:1;justify-self:end;height:28px;padding:2px 8px;font-size:12px}
.atlas-app .territory-year-label,html[lang=en] .atlas-app .territory-year-label{grid-column:1 / -1;grid-row:2;min-width:0;margin:0;width:100%;display:block}
.atlas-app .territory-year-label select{height:28px;min-height:28px;margin:0;width:100%;font-size:12px;padding-top:2px;padding-bottom:2px}
.atlas-app #territory-status{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0)}
.atlas-app #territory-legend{height:32px;padding:1px 10px 3px;gap:6px}
.atlas-app #territory-legend button{height:28px;min-height:28px;padding:2px 8px;font-size:12px}
.atlas-app .map-bottom{height:24px;padding:0 10px 3px}
.atlas-app .era-art-dialog{width:min(1200px,calc(100vw - 28px));max-height:calc(100dvh - 28px);padding:14px;background:#101b2a;color:#edf2fa;border-color:#53647c;overflow:auto}
.atlas-app .era-art-dialog .dialog-heading{gap:16px;margin-bottom:12px}
.atlas-app .era-art-dialog h2{font:600 20px/1.4 var(--sans);margin:0}
.atlas-app .era-art-dialog .close-button{flex:none;color:#fff;border-color:#8494ab}
.atlas-app .era-art-frame{display:flex;align-items:center;justify-content:center;min-height:0;background:#0b1420;border-radius:8px;overflow:hidden}
.atlas-app #era-art-image{display:block;width:auto;max-width:100%;height:auto;max-height:calc(100dvh - 155px);object-fit:contain}
.atlas-app #era-art-caption{font-size:13px;line-height:1.7;color:#d0d9e5;margin:10px 0 0}
.atlas-app.map-picker-open::after{content:"";position:fixed;inset:0;z-index:80;background:#081527bb;backdrop-filter:blur(4px)}
.atlas-app #map-event-picker{position:fixed;inset:50% auto auto 50%;transform:translate(-50%,-50%);z-index:81;display:flex;width:min(520px,calc(100vw - 28px));max-height:calc(100dvh - 40px);flex-direction:column;border-color:#c7d3e5;background:#fff9ed}
.atlas-app #map-event-picker .map-picker-heading{flex:none;padding:12px 14px}
.atlas-app #map-event-picker .map-picker-heading button{flex:none;width:34px;height:34px}
.atlas-app #map-event-picker ul{min-height:0;max-height:none;overflow-y:auto;overscroll-behavior:contain}
.atlas-app.map-expanded #world-view{grid-template-rows:42px 64px minmax(0,1fr)}
.atlas-app.map-expanded #era-cover,.atlas-app.map-expanded .workspace-tabs,.atlas-app.map-expanded #events-panel,.atlas-app.map-expanded #story-panel,.atlas-app.map-expanded #territory-summary{display:none!important}
.atlas-app.map-expanded .atlas-shell{display:grid;grid-template-columns:minmax(0,1fr)}
.atlas-app.map-expanded #map-panel{grid-column:1;grid-row:1}
@media(min-width:901px) and (max-height:800px){
 .atlas-app #world-view{--hero-height:112px}
 .atlas-app .chapter-title{font-size:32px;line-height:38px}
 .atlas-app .chapter-subtitle{font-size:16px;line-height:22px}
 .atlas-app .chapter-intro{display:none}
}
@media(max-width:900px){
 body.atlas-app{grid-template-rows:calc(48px + env(safe-area-inset-top,0px)) minmax(0,1fr)}
 .atlas-app .site-header{padding-left:max(12px,env(safe-area-inset-left,0px));padding-right:max(12px,env(safe-area-inset-right,0px))}
 .atlas-app main{padding:8px max(10px,env(safe-area-inset-right,0px)) max(8px,env(safe-area-inset-bottom,0px)) max(10px,env(safe-area-inset-left,0px))}
 .atlas-app #world-view{--hero-height:72px;grid-template-rows:40px var(--hero-height) 80px 34px minmax(0,1fr);gap:6px}
 .atlas-app .era-tab{height:36px;min-width:80px}
 .atlas-app .chapter-copy,html[lang=en] .atlas-app .chapter-copy{position:absolute;left:12px;right:96px;top:0;bottom:0;width:auto;height:100%;max-width:none;display:flex;flex-direction:column;justify-content:center;align-items:flex-start;gap:1px;padding:4px 0}
 .atlas-app .chapter-title,html[lang=en] .atlas-app .chapter-title{font-size:24px;line-height:29px;letter-spacing:0;order:0}
 .atlas-app .chapter-meta,html[lang=en] .atlas-app .chapter-meta{font-size:11px;line-height:16px;order:1}
 .atlas-app .chapter-number,.atlas-app .chapter-subtitle,.atlas-app .chapter-intro{display:none}
 .atlas-app .chapter-scene::after{background:linear-gradient(90deg,#101b2ad9,#101b2a55 65%,#101b2a33)}
 .atlas-app .era-art-open{right:9px;bottom:20px;min-height:30px;padding:3px 7px;font-size:11px}
 .atlas-app .timeline-panel{height:80px;padding:6px 10px;grid-template-columns:minmax(0,1fr) auto;grid-template-rows:32px 32px;gap:4px 8px}
 .atlas-app .timeline-heading{grid-column:1;grid-row:1}
 .atlas-app .timeline-heading .section-label{display:none}
 .atlas-app .playback-controls{grid-column:2;grid-row:1;gap:7px}
 .atlas-app #play-button{height:32px;width:98px;flex-basis:98px;font-size:12px}
 .atlas-app #playback-speed{height:32px;width:60px;font-size:13px}
 .atlas-app .playback-speed-label{font-size:0;gap:0}
 .atlas-app .timeline-panel .range-wrap{grid-column:1 / -1;grid-row:2;height:32px;grid-template-columns:82px minmax(0,1fr);column-gap:8px;padding-top:0}
 .atlas-app #timeline-mode{width:82px;height:28px;font-size:11px}
 html[lang=en] .atlas-app .timeline-panel .range-wrap{grid-template-columns:98px minmax(0,1fr);column-gap:8px}
 html[lang=en] .atlas-app #timeline-mode{width:98px;font-size:11px}
 .atlas-app #year-slider{top:0;height:28px}
 .atlas-app .timeline-panel .range-labels{display:block;height:13px;bottom:-2px;font-size:10px}
 .atlas-app .timeline-panel .range-labels span{line-height:13px}
 .atlas-app .timeline-panel .range-labels span:not(:first-child):not(:last-child){display:none}
 .atlas-app .timeline-panel .timeline-tick{top:3px}
 .atlas-app .workspace-tabs{height:34px}
 .atlas-app .map-panel,html[lang=en] .atlas-app .map-panel{--map-heading-row:38px;--map-controls-row:66px;--map-legend-row:32px;--map-footer-row:46px;grid-template-rows:var(--map-heading-row) minmax(0,1fr) var(--map-controls-row) var(--map-legend-row) var(--map-footer-row)}
 .atlas-app .map-workspace-heading{height:38px;padding:0 8px}
 .atlas-app .map-navigation{gap:4px}
 .atlas-app .map-navigation button{padding-left:7px;padding-right:7px}
 .atlas-app .territory-control-row,html[lang=en] .atlas-app .territory-control-row{min-height:56px;row-gap:3px}
 .atlas-app .map-bottom{height:46px;padding:0 8px}
 .atlas-app .range-peek{height:100%}
 .atlas-app #range-peek-title{font-size:13px;line-height:19px}
 .atlas-app #range-peek-meta{font-size:11px;line-height:16px}
 .atlas-app #range-peek-details{height:32px;font-size:12px;padding:2px 8px}
 .atlas-app #clear-range-selection{height:32px;width:30px}
 .atlas-app.map-expanded #world-view{grid-template-rows:40px 80px minmax(0,1fr)}
 .atlas-app .era-art-dialog{padding:12px;max-height:calc(100dvh - max(28px,env(safe-area-inset-bottom,0px)))}
}
@media(max-width:560px){
 .atlas-app .site-header #sources-button{display:none}
 .atlas-app .site-header nav,html[lang=en] .atlas-app .site-header nav{gap:7px;min-width:0}
 .atlas-app .site-header .brand-name{display:none}
 .atlas-app .site-header nav>a{padding:6px 7px;font-size:13px}
 .atlas-app .site-header .plain,html[lang=en] .atlas-app .site-header #about-button{font-size:12px}
 .atlas-app .language-control select{width:70px;max-width:70px;font-size:12px}
 .atlas-app .region-filter{width:104px;flex:none}
 .atlas-app .chapter-title,html[lang=en] .atlas-app .chapter-title{font-size:21px;line-height:26px}
 html[lang=en] .atlas-app .chapter-copy{right:91px}
}
@media(max-height:620px) and (min-width:901px){
 .atlas-app #world-view{--hero-height:72px;grid-template-rows:34px var(--hero-height) 50px minmax(0,1fr);gap:5px}
 .atlas-app .era-tab{height:32px}
 .atlas-app .chapter-title{font-size:28px;line-height:32px}
 .atlas-app .chapter-subtitle{display:none}
 .atlas-app .timeline-panel{height:50px;padding:4px 10px}
 .atlas-app.map-expanded #world-view{grid-template-rows:34px 50px minmax(0,1fr)}
}
@media(max-height:480px) and (max-width:900px){
 .atlas-app #world-view{--hero-height:48px;grid-template-rows:34px var(--hero-height) 70px 30px minmax(0,1fr);gap:4px}
 .atlas-app .era-tab{height:32px}
 .atlas-app .chapter-title,html[lang=en] .atlas-app .chapter-title{font-size:19px;line-height:23px}
 .atlas-app .chapter-meta{display:none}
 .atlas-app .era-art-open{bottom:9px}
 .atlas-app .timeline-panel{height:70px;grid-template-rows:30px 28px;padding:4px 10px;gap:3px 8px}
 .atlas-app .timeline-panel .range-wrap{height:28px}
 .atlas-app .workspace-tabs{height:30px}
 .atlas-app.map-expanded #world-view{grid-template-rows:34px 70px minmax(0,1fr)}
}
@media(max-height:480px) and (min-width:600px) and (max-width:900px){
 .atlas-app #world-view{grid-template-rows:34px 48px 44px 30px minmax(0,1fr)}
 .atlas-app .timeline-panel{height:44px;grid-template-columns:120px minmax(0,1fr) auto;grid-template-rows:minmax(0,1fr);gap:8px;padding:4px 10px}
 .atlas-app .timeline-heading{grid-column:1;grid-row:1}
 .atlas-app .playback-controls{grid-column:3;grid-row:1}
 .atlas-app .timeline-panel .range-wrap{grid-column:2;grid-row:1;height:28px}
 .atlas-app .timeline-panel .range-labels{display:none}
 .atlas-app.map-expanded #world-view{grid-template-rows:34px 44px minmax(0,1fr)}
 .atlas-app .map-panel,html[lang=en] .atlas-app .map-panel{grid-template-columns:230px minmax(0,1fr);grid-template-rows:32px 66px 26px minmax(28px,1fr)}
 .atlas-app .map-workspace-heading{grid-column:1 / -1;grid-row:1;height:32px}
 .atlas-app .map-wrap{grid-column:2;grid-row:2 / 5;height:100%;padding:0 6px}
 .atlas-app .territory-controls{grid-column:1;grid-row:2;padding-left:8px;padding-right:8px;border-right:1px solid #ffffff20}
 .atlas-app .territory-control-row,html[lang=en] .atlas-app .territory-control-row{grid-template-columns:minmax(0,1fr) auto;column-gap:6px}
 .atlas-app .territory-check + .territory-check{grid-column:2;grid-row:1;justify-self:end}
 .atlas-app .territory-year-label,html[lang=en] .atlas-app .territory-year-label{grid-column:1;grid-row:2}
 .atlas-app #range-details-toggle,html[lang=en] .atlas-app #range-details-toggle{grid-column:2;grid-row:2}
 .atlas-app #territory-legend{grid-column:1;grid-row:3;height:26px;padding:0 6px;border-right:1px solid #ffffff20}
 .atlas-app #territory-legend button{height:24px;min-height:24px;font-size:11px;padding:1px 6px}
 .atlas-app .map-bottom{grid-column:1;grid-row:4;height:100%;padding:0 6px;align-items:flex-start;border-right:1px solid #ffffff20}
 .atlas-app .range-peek{height:28px;gap:4px}
 .atlas-app #range-peek-title{font-size:12px;line-height:18px}
 .atlas-app #range-peek-meta{display:none}
 .atlas-app #range-peek-details{height:26px;padding:1px 5px;font-size:11px;line-height:22px}
 .atlas-app #clear-range-selection{height:26px;width:25px;font-size:19px}
}
@media(prefers-reduced-motion:reduce){.atlas-app .era-art-open{backdrop-filter:none}.atlas-app .map-navigation button{transition:none}}
