/* A single viewport, with independent reading surfaces. */
.atlas-app .date-kind{display:inline-flex;align-items:center;flex:none;border:1px solid #cdd8e8;border-radius:5px;background:#f3f6fb;color:#465c78;padding:1px 6px;font:500 11px/18px var(--sans);white-space:nowrap}
.atlas-app .card-date-kind{display:flex;align-items:center;flex-wrap:wrap;gap:4px;margin:5px 0 0}
.atlas-app .continuation-tag{color:var(--teal);font-size:11px;line-height:18px}
.atlas-app .story-content>p.story-date-kind{display:flex;align-items:flex-start;gap:7px;margin:0 0 12px;font-size:12px;line-height:1.7;color:#596c87}
.atlas-app .story-date-kind>span:last-child{min-width:0}
.atlas-app .story-content>p.continuation-note{padding:8px 10px;border-left:2px solid var(--teal);background:var(--soft);font-size:12px;line-height:1.7;color:#465c78}
.atlas-app #timeline-date.timeline-date-button{display:flex;align-items:center;gap:5px;max-width:100%;padding:0;border:0;border-radius:4px;background:transparent;color:var(--ink);text-align:left;white-space:nowrap;cursor:pointer;opacity:1;transform:none;box-shadow:none}
.atlas-app #timeline-date.timeline-date-button:disabled{cursor:default;color:var(--ink)}
.atlas-app #timeline-date:not(:disabled):hover{color:var(--teal)}
.atlas-app .timeline-date-text{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.atlas-app .same-year-count{flex:none;font:500 11px/20px var(--sans);color:var(--teal);text-decoration:underline;text-underline-offset:3px}
.atlas-app #same-year-dialog{width:min(520px,calc(100vw - 28px));max-height:75dvh;padding:20px;overflow:auto;border:1px solid #dce3ee;border-radius:14px}
.atlas-app #same-year-dialog h2{font:600 20px/1.5 var(--sans);margin:0}
.atlas-app .same-year-note{font-size:13px;line-height:1.7;color:#596c87;margin:10px 0 16px}
.atlas-app .same-year-event{display:block;width:100%;text-align:left;padding:12px;margin:7px 0;border:1px solid #dce3ee;border-radius:8px;background:#fff;color:var(--ink)}
.atlas-app .same-year-event[aria-pressed=true],.atlas-app .same-year-event:hover{background:var(--soft);border-color:var(--teal)}
.atlas-app .same-year-event span{display:block;font-size:12px;line-height:1.6;color:#596c87}
.atlas-app .same-year-event strong{display:block;font-size:15px;line-height:1.6;margin-top:4px}
.atlas-app .milestone-references{margin:10px 0;padding:8px 10px;border:1px solid #dce3ee;border-radius:8px;background:#f7f9fc}
.atlas-app .milestone-references summary{cursor:pointer;font-size:13px;line-height:1.7;color:#395878}
.atlas-app .milestone-references ul{margin:8px 0 2px;padding-left:18px}
.atlas-app .milestone-references li{display:list-item;margin:4px 0;padding:0;min-height:0;font-size:13px;line-height:1.7}
.atlas-app .milestone-references a{overflow-wrap:anywhere}
.atlas-app .dynasty-reading-panel .milestone-references p{font-size:12px;line-height:1.7;margin:6px 0;color:#596c87}
.atlas-app .milestone-references .verification-scope{font-weight:500}
html{height:100%;overflow:hidden;scrollbar-gutter:auto}
body.atlas-app{height:100vh;height:100dvh;min-height:0;overflow:hidden;display:grid;grid-template-rows:56px minmax(0,1fr);background:#f2f5fa;background-image:none}
.atlas-app .site-header{height:56px;min-height:0;width:100%;max-width:1600px;margin:0 auto;padding:0 18px;border-bottom:1px solid #dce3ee;background:#fff;flex-wrap:nowrap;gap:12px}
.atlas-app .brand{gap:10px;flex:none}.atlas-app .brand-symbol{width:30px;height:30px;border-radius:9px;font-size:25px;box-shadow:2px 2px 0 #ffd16d}.atlas-app .brand-name{font-size:23px;letter-spacing:3px}.atlas-app .brand-caption{font-size:13px;letter-spacing:0;line-height:1.5;padding-left:12px}
.atlas-app .site-header nav{height:auto;width:auto;gap:16px;justify-content:flex-end;flex-wrap:nowrap}.atlas-app .site-header nav .nav-active{display:inline-flex;padding:6px 12px;font-size:14px}.atlas-app .site-header .plain{padding:6px 0;font-size:14px;margin:0;white-space:nowrap}
.atlas-app main{width:100%;max-width:1600px;min-height:0;margin:0 auto;padding:10px 14px 14px;overflow:hidden}
.atlas-app #world-view{height:100%;min-height:0;display:grid;gap:10px}
.atlas-app .app-toolbar{display:flex;gap:16px;align-items:center;min-width:0;min-height:0}
.atlas-app .era-tabs{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));flex:1;min-width:0;gap:7px;margin:0;overflow:visible}
.atlas-app .era-tab{height:46px;min-height:0;padding:6px 10px;border-radius:9px;box-shadow:none;transform:none;display:flex;align-items:center;justify-content:center;gap:6px}
.atlas-app .era-tab strong{font-size:14px;white-space:nowrap}.atlas-app .era-tab .era-no,.atlas-app .era-tab small,.atlas-app .era-glyph{display:none}.atlas-app .era-tab:hover,.atlas-app .era-tab[aria-pressed=true]{transform:none;box-shadow:none}
.atlas-app .region-filter{width:180px;flex:none;font-size:14px;gap:8px}.atlas-app .region-filter select{width:100%;min-width:0;max-width:none;padding:7px 22px 7px 8px;background:#fff;border-radius:8px;height:36px;font-size:14px}
.atlas-app .timeline-panel{position:relative;top:auto;height:78px;margin:0;padding:10px 16px;border-radius:12px;display:grid;grid-template-columns:minmax(145px,190px) minmax(0,1fr) auto;grid-template-rows:1fr;gap:18px;align-items:center;box-shadow:none;z-index:1}
.atlas-app .timeline-heading{height:auto;min-width:0;display:block}.atlas-app .timeline-heading>div{display:flex;flex-direction:column;align-items:flex-start;gap:1px;min-width:0}.atlas-app .section-label{font-size:12px;color:var(--muted)}
.atlas-app #timeline-date{width:100%;font-size:16px;height:24px;line-height:24px}.atlas-app .timeline-panel .range-wrap{height:45px;min-width:0;margin:0;padding-top:12px}.atlas-app .range-labels{font-size:12px}
.atlas-app .timeline-panel .timeline-hint{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0)}
.atlas-app .playback-controls{display:flex;align-items:center;gap:12px}.atlas-app #play-button{height:36px;width:112px;flex:0 0 112px;font-size:14px}
.atlas-app .playback-speed-label{display:flex;align-items:center;gap:7px;white-space:nowrap;font-size:14px;color:var(--muted)}.atlas-app #playback-speed{height:36px;width:70px;padding:4px 7px;border:1px solid #cad5e7;border-radius:8px;background:#fff;color:var(--ink);font-size:14px}
.atlas-app .workspace-tabs{display:none}
.atlas-app .atlas-shell{height:100%;min-height:0;display:grid;grid-template-columns:210px minmax(0,1fr) minmax(300px,360px);grid-template-rows:minmax(0,1fr);gap:12px;align-items:stretch;border:0}
.atlas-app .events-section{height:100%;min-height:0;min-width:0;display:flex;flex-direction:column;padding:0;background:#fff;border:1px solid #dce3ee;border-radius:13px;overflow:hidden}
.atlas-app .events-heading{height:48px;flex:none;margin:0;padding:0 14px;display:flex;flex-direction:row;align-items:center;justify-content:space-between;gap:8px;border-bottom:1px solid #e5eaf1}
.atlas-app .events-heading h2{font:600 15px var(--sans);margin:0}.atlas-app #event-list-count{font-size:13px;color:var(--muted)}
.atlas-app #event-grid{position:relative;flex:1;min-height:0;display:block;padding:5px;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-gutter:stable;overflow-anchor:none}
.atlas-app .event-card{display:block;width:100%;padding:12px 10px;margin:0 0 4px;border:1px solid transparent;border-radius:8px;text-align:left;box-shadow:none;transform:none;background:transparent}
.atlas-app .event-card:hover{transform:none;background:#f0f4fb}.atlas-app .event-card[aria-pressed=true]{background:var(--soft);border-color:var(--track);box-shadow:inset 3px 0 0 var(--teal)}
.atlas-app .event-card .card-top{font-size:12px;display:block}.atlas-app .event-card .card-category,.atlas-app .event-card p{display:none}.atlas-app .event-card h3{font:500 15px/1.6 var(--sans);margin:5px 0 6px}.atlas-app .card-bottom{padding:0;margin:0;border:0;font-size:12px;gap:6px}.atlas-app .reading-label{font-size:12px}.atlas-app .empty-state{padding:20px 10px;font-size:14px;overflow-wrap:anywhere}
.atlas-app .map-panel{height:100%;min-height:0;min-width:0;display:grid;grid-template-rows:32px minmax(0,1fr) 96px 40px 28px;border-radius:13px;overflow:hidden;box-shadow:none}
.atlas-app .map-wrap{grid-row:2}.atlas-app .territory-controls{grid-row:3}.atlas-app #territory-legend{grid-row:4}.atlas-app .map-bottom{grid-row:5}
.atlas-app .map-wrap{margin:0;padding:0 5px;min-height:0;height:100%;display:flex;align-items:center}.atlas-app .map-wrap svg{width:100%;height:100%;min-height:0;max-height:100%;display:block;filter:none;overflow:visible}
.atlas-app .map-bottom{height:28px;min-height:0;display:flex;flex-direction:row;padding:0 12px 6px;gap:8px;align-items:center;font-size:12px;overflow:hidden}.atlas-app .map-bottom>span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:none}.atlas-app .map-bottom>span:first-child{flex:none;max-width:55%}.atlas-app .map-bottom>#map-scope-note{flex:1;text-align:right;max-width:none}
.atlas-app .territory-controls{min-height:0;padding:6px 12px;border:0;border-top:1px solid #ffffff20;background:#142236;color:#d0d9e5;overflow:hidden}
.atlas-app .territory-control-row{min-height:36px;display:grid;grid-template-columns:auto auto minmax(0,1fr) auto;gap:8px;align-items:center;flex-wrap:nowrap}
.atlas-app .territory-check{font-size:13px;color:#d0d9e5;min-height:0;gap:5px}.atlas-app .territory-year-label{font-size:0;min-width:0;margin:0;width:auto;display:block}.atlas-app .territory-year-label select{display:block;width:100%;max-width:none;min-width:0;height:32px;min-height:0;margin:0;padding:3px 20px 3px 7px;border-color:#425674;background:#21334b;color:#e5edf6;font-size:13px}
.atlas-app #range-details-toggle{height:32px;border:1px solid #425674;border-radius:7px;padding:3px 8px;background:#21334b;color:#e5edf6;font-size:13px;white-space:nowrap}.atlas-app #range-details-toggle[aria-expanded=true]{background:#e8efff;color:#23446e}.atlas-app #range-details-toggle:disabled{opacity:.5}
.atlas-app #territory-status{height:40px;line-height:20px;overflow-y:auto;margin:5px 0 0;font-size:12px;color:#aec0d7;scrollbar-width:thin;overflow-anchor:none}
.atlas-app #territory-legend{height:40px;min-width:0;margin:0;padding:3px 10px 5px;display:flex;flex-wrap:nowrap;gap:6px;overflow-x:auto;overflow-y:hidden;scrollbar-width:thin;overscroll-behavior:contain;background:#142236}
.atlas-app #territory-legend button{flex:none;min-height:29px;height:29px;font-size:12px;padding:3px 8px;background:#21334b;border-color:#425674;color:#d0d9e5;white-space:nowrap}.atlas-app #territory-legend button[aria-pressed=true]{background:#e8efff;color:#23446e}
.atlas-app #territory-summary{position:relative;inset:auto;z-index:auto;width:100%;height:100%;grid-column:3;grid-row:1;margin:0;padding:0;background:#fff;border:1px solid #cfd9e8;border-radius:13px;box-shadow:none;display:flex;flex-direction:column;min-width:0;min-height:0;overflow:hidden;color:var(--ink);scroll-margin:0}
.atlas-app .range-drawer-heading{display:flex;justify-content:space-between;align-items:center;gap:12px;height:50px;flex:none;padding:10px 14px;border-bottom:1px solid #e0e7f0}.atlas-app .range-drawer-heading h2{font:600 16px var(--sans);margin:0}.atlas-app #close-range-details{border:1px solid #d2dbea;background:#f4f7fc;color:#435b7c;border-radius:7px;width:30px;height:30px;font-size:22px;line-height:1}
.atlas-app .range-drawer-body{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:14px 16px;scrollbar-gutter:stable}.atlas-app .territory-detail-heading{display:block}.atlas-app .territory-detail-heading>span{display:block;margin-top:5px}.atlas-app .territory-method{font-size:13px}
.atlas-app .map-event-picker{left:12px;top:12px;bottom:auto;max-height:calc(100% - 24px);width:min(360px,calc(100% - 24px));display:flex;flex-direction:column;z-index:7}.atlas-app .map-picker-heading{flex:none}.atlas-app .map-event-picker ul{min-height:0;overflow-y:auto;max-height:min(35dvh,280px);overscroll-behavior:contain}
.atlas-app .story-panel{height:100%;min-height:0;min-width:0;padding:18px 18px 12px;border-radius:13px;background:#fff;border:1px solid #dce3ee;box-shadow:none;overflow:hidden;display:flex;flex-direction:column;scroll-margin:0}
.atlas-app .story-content{flex:1 1 0;min-height:0;overflow-y:auto;overscroll-behavior:contain;scrollbar-gutter:stable;padding-right:8px;display:flex;flex-direction:column;overflow-anchor:none}
.atlas-app .story-panel h2{font-size:25px;line-height:1.5}.atlas-app .story-date{font-size:19px;margin:8px 0 12px}.atlas-app .story-foot{height:44px;min-height:44px;flex:none;padding:8px 0 0;margin:10px 0 0;border-top:1px solid #e5eaf1}.atlas-app .story-nav button{width:33px;height:33px}
.atlas-app .story-content>p{font-size:16px}.atlas-app .story-context{font-size:14px}.atlas-app .source-link{font-size:13px}
.atlas-app #china-view{height:100%;min-height:0;display:grid;grid-template-rows:auto minmax(0,1fr);gap:10px}
.atlas-app .china-toolbar{display:flex;align-items:center;gap:16px;min-height:56px;min-width:0;position:relative}
.atlas-app .china-intro{padding:0;display:flex;gap:16px;align-items:center;flex:1;min-width:0}.atlas-app .china-intro h1{font-size:24px;line-height:1.4;margin:0}.atlas-app .china-intro-actions{display:flex;flex-direction:row;gap:12px;align-items:center;flex-shrink:1}.atlas-app .china-count{font-size:13px;padding:4px 9px;margin:0;white-space:nowrap}.atlas-app .china-modern-jump{font-size:13px;padding:6px 10px;border-radius:7px;white-space:nowrap}
.atlas-app .chronology-notes{position:relative;flex:none;margin:0;padding:6px 10px;border-radius:7px}.atlas-app .chronology-notes summary{font-size:13px;white-space:nowrap}.atlas-app #chronology-notes{position:absolute;z-index:12;right:0;top:38px;width:min(440px,calc(100vw - 32px));max-height:55dvh;overflow-y:auto;overscroll-behavior:contain;padding:14px 18px;background:#fff;border:1px solid #d7dfeb;border-radius:10px;box-shadow:0 8px 28px #233b6726}
.atlas-app .dynasty-select-label{display:none;margin:0}.atlas-app .china-layout{height:100%;min-height:0;margin:0;display:grid;grid-template-columns:250px minmax(0,1fr);grid-template-rows:minmax(0,1fr);gap:12px;align-items:stretch}
.atlas-app #dynasty-directory{position:relative}
.atlas-app .china-directory{height:100%;min-height:0;display:flex;flex-direction:column;position:relative;top:auto;border-radius:13px}.atlas-app .directory-heading{padding:14px 16px;height:50px;flex:none}.atlas-app #dynasty-directory{flex:1;min-height:0;height:auto;max-height:none;overflow-y:auto;overscroll-behavior:contain;scrollbar-gutter:stable}
.atlas-app .dynasty-detail{height:100%;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:24px 28px;border-radius:13px;scrollbar-gutter:stable;scroll-margin:0;overflow-anchor:none}.atlas-app .dynasty-heading h2{font-size:32px}.atlas-app .dynasty-heading{gap:16px}.atlas-app .dynasty-section h3{font-size:20px}
@media(max-width:1200px){.atlas-app .atlas-shell{grid-template-columns:180px minmax(0,1fr) 310px}.atlas-app .timeline-panel{grid-template-columns:160px minmax(0,1fr) auto;gap:12px}.atlas-app .region-filter{width:160px}.atlas-app .territory-control-row{grid-template-columns:auto auto minmax(0,1fr);gap:6px}.atlas-app #range-details-toggle{grid-column:3;grid-row:1}.atlas-app .territory-year-label{grid-column:1 / -1;grid-row:2}.atlas-app .territory-controls{padding-top:4px;padding-bottom:4px}.atlas-app #territory-status{height:20px;margin-top:3px}.atlas-app .territory-control-row{min-height:64px}.atlas-app .china-intro-actions{gap:7px}.atlas-app .china-count{display:none}}
@media(max-width:900px){
 .atlas-app .site-header{padding:0 12px;gap:8px}.atlas-app .brand-caption{display:none}.atlas-app .site-header nav{gap:12px}.atlas-app .site-header nav .nav-active{padding:6px 9px}.atlas-app main{padding:8px 10px 10px}
 .atlas-app #world-view{gap:8px}.atlas-app .app-toolbar{gap:8px}.atlas-app .era-tabs{display:flex;overflow-x:auto;overflow-y:hidden;scrollbar-width:none;gap:6px}.atlas-app .era-tab{height:38px;flex:none;min-width:80px;padding:5px 8px}.atlas-app .region-filter{width:118px}.atlas-app .region-filter>span{display:none}
 .atlas-app .timeline-panel{height:96px;grid-template-columns:minmax(0,1fr) auto;grid-template-rows:36px 34px;gap:4px 10px;padding:8px 12px}.atlas-app .timeline-heading{grid-row:1;grid-column:1}.atlas-app .playback-controls{grid-row:1;grid-column:2;gap:8px}.atlas-app #play-button{width:98px;flex-basis:98px;font-size:13px}.atlas-app #playback-speed{width:64px;font-size:14px}.atlas-app .playback-speed-label{font-size:13px;gap:5px}.atlas-app .timeline-panel .range-wrap{grid-row:2;grid-column:1 / -1;height:34px;padding-top:7px}.atlas-app .timeline-panel .range-labels{height:20px;margin-top:6px;font-size:12px}.atlas-app .timeline-panel .timeline-tick{top:1px}
 .atlas-app .workspace-tabs{display:grid;grid-template-columns:repeat(3,1fr);gap:6px;height:34px}.atlas-app .workspace-tabs button{border:1px solid #cdd8e8;border-radius:7px;background:#fff;color:#607490;font-size:14px}.atlas-app .workspace-tabs button[aria-selected=true]{background:var(--teal);color:#fff;border-color:var(--teal)}
 .atlas-app .atlas-shell{display:block;height:100%;min-height:0;position:relative}.atlas-app .atlas-shell>section,.atlas-app .atlas-shell>aside{height:100%;min-height:0;width:100%}.atlas-app .map-panel{grid-template-rows:32px minmax(0,1fr) 96px 40px 28px}.atlas-app .story-panel{padding:18px}.atlas-app .event-card h3{font-size:16px}.atlas-app .event-card p{display:block;font-size:14px;margin:6px 0}.atlas-app .event-card .card-category{display:inline}.atlas-app .event-card .card-top{display:flex}
 .atlas-app .china-toolbar{flex-wrap:wrap;gap:8px;min-height:0}.atlas-app .china-intro{width:100%;flex:auto;justify-content:space-between}.atlas-app .china-intro h1{font-size:22px}.atlas-app .china-intro-actions{flex:none}.atlas-app .chronology-notes{margin:0}.atlas-app .dynasty-select-label{display:flex;flex:1;min-width:0;flex-direction:row;gap:7px;align-items:center;font-size:13px}.atlas-app .dynasty-select-label select{width:100%;min-width:0;height:35px;padding:5px 22px 5px 8px;font-size:14px;border-radius:7px}
 .atlas-app .china-layout{grid-template-columns:minmax(0,1fr);display:grid}.atlas-app .china-directory{display:none}.atlas-app .dynasty-detail{padding:18px 20px}.atlas-app .dynasty-heading{flex-direction:column;gap:10px}.atlas-app .dynasty-heading h2{font-size:29px}.atlas-app .dynasty-explain{grid-template-columns:1fr}.atlas-app #chronology-notes{left:0;right:auto}.atlas-app .dynasty-step-nav{margin-top:0}
}
@media(max-width:480px){.atlas-app .site-header nav{gap:8px}.atlas-app .site-header .plain,.atlas-app .site-header nav a{font-size:13px}.atlas-app .brand{gap:6px}.atlas-app .brand-name{font-size:21px;letter-spacing:2px}.atlas-app .region-filter{width:102px}.atlas-app .section-label{display:none}.atlas-app #timeline-date{font-size:14px}.atlas-app .playback-speed-label{font-size:0;gap:0}.atlas-app #playback-speed{font-size:14px}.atlas-app .china-modern-jump{font-size:12px}.atlas-app .dynasty-detail{padding:16px}.atlas-app .map-bottom #map-scope-note{display:none}}
@media(max-width:1200px){.atlas-app .territory-control-row{row-gap:4px}.atlas-app .territory-year-label select{height:28px}}
@media(max-width:420px){.atlas-app .brand-name{display:none}.atlas-app .site-header nav{gap:7px}.atlas-app .site-header nav .nav-active{padding:6px 7px}}
/* Keep controls reachable when the viewport is short, including landscape phones. */
@media(max-height:620px){
 body.atlas-app{grid-template-rows:44px minmax(0,1fr)}.atlas-app .site-header{height:44px}.atlas-app main{padding:4px 8px}
 .atlas-app #world-view{gap:4px}.atlas-app .era-tab{height:30px;padding:3px 8px}.atlas-app .region-filter select{height:30px;padding-top:3px;padding-bottom:3px}
 .atlas-app .timeline-panel{height:44px;padding:4px 10px;grid-template-columns:120px minmax(0,1fr) auto;grid-template-rows:1fr;gap:10px}.atlas-app .timeline-heading{grid-column:1;grid-row:1}.atlas-app .timeline-heading .section-label{display:none}.atlas-app #timeline-date{font-size:13px}.atlas-app .timeline-panel .range-wrap{grid-column:2;grid-row:1;height:30px;padding-top:14px}.atlas-app .timeline-panel .range-labels{display:none}.atlas-app .timeline-panel .timeline-tick{top:5px}.atlas-app .playback-controls{grid-column:3;grid-row:1}.atlas-app #play-button,.atlas-app #playback-speed{height:30px}
 .atlas-app .map-panel{grid-template-rows:32px minmax(0,1fr) 40px 30px 20px}.atlas-app .territory-controls{padding:3px 8px}.atlas-app .territory-control-row{grid-template-columns:auto auto minmax(0,1fr) auto;min-height:32px;gap:6px}.atlas-app .territory-year-label{grid-column:3;grid-row:1}.atlas-app #range-details-toggle{grid-column:4;grid-row:1;height:30px}.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:30px;padding:0 8px}.atlas-app #territory-legend button{height:26px;min-height:26px}.atlas-app .map-bottom{height:20px;padding:0 10px 2px}
 .atlas-app .story-panel{padding:12px}.atlas-app .story-panel h2{font-size:22px}.atlas-app .story-foot{height:36px;min-height:36px;margin-top:5px;padding-top:4px}.atlas-app .china-toolbar{min-height:36px}.atlas-app .china-layout{gap:8px}.atlas-app .dynasty-detail{padding:14px 20px}
}
@media(max-height:620px) and (max-width:900px){
 .atlas-app #world-view{}.atlas-app .workspace-tabs{height:28px}.atlas-app .workspace-tabs button{font-size:13px}.atlas-app .playback-speed-label{font-size:0;gap:0}.atlas-app .playback-controls{gap:6px}.atlas-app #play-button{width:90px;flex-basis:90px}
}
@media(max-height:620px) and (max-width:480px){
 .atlas-app .timeline-panel{grid-template-columns:85px minmax(0,1fr) auto;gap:6px}.atlas-app .territory-control-row{grid-template-columns:auto auto auto}.atlas-app .territory-year-label{grid-column:1 / -1;grid-row:2}.atlas-app #range-details-toggle{grid-column:3}.atlas-app .map-panel{grid-template-rows:32px minmax(0,1fr) 68px 30px 20px}.atlas-app .territory-check{font-size:12px}
}

/* China uses a fixed chapter header and tabs, with one reading panel at a time. */
.atlas-app #dynasty-detail[data-ready=true]{display:grid;grid-template-rows:auto 42px minmax(0,1fr);padding:0;overflow:hidden;scrollbar-gutter:auto}
.atlas-app #dynasty-detail .dynasty-heading{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:14px;padding:16px 22px;margin:0;min-width:0;background:#fff;flex-direction:row}
.atlas-app .dynasty-heading-copy{min-width:0}.atlas-app #dynasty-detail .dynasty-heading .eyebrow{margin:0 0 5px;padding:0;background:none;font-size:12px;line-height:1.5}.atlas-app #dynasty-detail .dynasty-heading h2{font-size:28px;line-height:1.4;margin:0 0 4px;overflow-wrap:anywhere}.atlas-app #dynasty-detail .dynasty-date{font-size:13px;line-height:1.6;margin:0;color:#607490}
.atlas-app #dynasty-detail .dynasty-step-nav{margin:0;gap:7px;align-self:center}.atlas-app #dynasty-detail .dynasty-step-nav button{font-size:13px;min-height:34px;padding:5px 10px;white-space:nowrap}
.atlas-app .dynasty-reading-tabs{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:4px;padding:4px 16px;border-bottom:1px solid #e2e8f1;background:#f7f9fc;min-width:0}
.atlas-app .dynasty-reading-tabs button{height:33px;min-width:0;border:0;border-radius:7px;background:transparent;color:#627793;font-size:14px;line-height:1.4;white-space:nowrap;padding:4px 8px}.atlas-app .dynasty-reading-tabs button:hover{background:#eaf0f8}.atlas-app .dynasty-reading-tabs button[aria-selected=true]{background:var(--soft);color:var(--teal);font-weight:600;box-shadow:inset 0 -2px 0 var(--teal)}
.atlas-app .dynasty-reading{min-height:0;min-width:0;overflow:hidden;display:grid;grid-template-rows:minmax(0,1fr);grid-template-columns:minmax(0,1fr)}
.atlas-app .dynasty-reading-panel{grid-area:1 / 1;height:100%;min-height:0;min-width:0;padding:20px 24px;overflow-y:auto;overscroll-behavior:contain;scrollbar-gutter:stable;overflow-anchor:none;scrollbar-width:thin}
.atlas-app .dynasty-reading-panel:focus-visible{outline:2px solid var(--teal);outline-offset:-3px}
.atlas-app .dynasty-reading-panel>.dynasty-section:first-child,.atlas-app .dynasty-reading-panel>.dynasty-sources:first-child{margin:0;padding:0;border:0}
.atlas-app .dynasty-reading-panel .dynasty-summary{font-size:17px;line-height:1.8;margin:0 0 13px}.atlas-app .dynasty-reading-panel .dynasty-overview{font-size:15px;line-height:1.9;margin:0 0 18px}.atlas-app .dynasty-reading-panel .dynasty-facts{padding:12px 0 18px;margin:0}.atlas-app .dynasty-reading-panel .dynasty-explain{margin-top:18px;gap:12px}.atlas-app .dynasty-reading-panel .dynasty-explain>div{padding:16px}.atlas-app .dynasty-reading-panel .dynasty-relations{margin:0;padding:16px 18px}
.atlas-app .dynasty-relation-note,.atlas-app .dynasty-source-note{font-size:14px;line-height:1.9;color:#6b7e98;margin:18px 0 0}.atlas-app .dynasty-reading-panel .dynasty-sources a{overflow-wrap:anywhere}
@media(max-width:1100px){.atlas-app #dynasty-detail .dynasty-heading h2{font-size:25px}.atlas-app #dynasty-detail .dynasty-heading{padding:14px 18px}.atlas-app .dynasty-reading-panel{padding:18px 20px}.atlas-app .dynasty-reading-panel .dynasty-explain{grid-template-columns:1fr}}
@media(max-width:600px){
 .atlas-app #dynasty-detail .dynasty-heading{grid-template-columns:minmax(0,1fr);gap:8px;padding:12px 16px}.atlas-app #dynasty-detail .dynasty-heading h2{font-size:23px;line-height:1.35}.atlas-app #dynasty-detail .dynasty-heading .eyebrow{margin-bottom:3px}.atlas-app #dynasty-detail .dynasty-date{font-size:12px;line-height:1.6}.atlas-app #dynasty-detail .dynasty-step-nav{justify-content:flex-end}.atlas-app #dynasty-detail .dynasty-step-nav button{min-height:30px;font-size:12px;padding:4px 9px}
 .atlas-app #dynasty-detail[data-ready=true]{grid-template-rows:auto 38px minmax(0,1fr)}.atlas-app .dynasty-reading-tabs{padding:3px 8px;gap:2px}.atlas-app .dynasty-reading-tabs button{height:31px;font-size:13px;padding:3px 5px}.atlas-app .dynasty-reading-panel{padding:16px}.atlas-app .dynasty-reading-panel .dynasty-summary{font-size:16px}.atlas-app .dynasty-reading-panel .dynasty-facts{grid-template-columns:1fr;gap:10px}
}
@media(max-height:620px){
 .atlas-app #dynasty-detail .dynasty-heading{padding:8px 14px;gap:8px}.atlas-app #dynasty-detail .dynasty-heading h2{font-size:21px}.atlas-app #dynasty-detail .dynasty-heading .eyebrow{display:none}.atlas-app #dynasty-detail .dynasty-step-nav button{min-height:28px;padding:3px 8px}.atlas-app #dynasty-detail[data-ready=true]{grid-template-rows:auto 34px minmax(0,1fr)}.atlas-app .dynasty-reading-tabs{padding:2px 8px}.atlas-app .dynasty-reading-tabs button{height:29px}.atlas-app .dynasty-reading-panel{padding:12px 16px}
}

/* Align the compact workspace without moving its frames during feedback. */
.atlas-app .site-header nav>a,
.atlas-app .site-header nav .plain{
 display:inline-flex;align-items:center;justify-content:center;
 min-height:36px;height:36px;line-height:1.3;margin:0;white-space:nowrap;
}
.atlas-app .site-header nav>a{padding:6px 12px}
.atlas-app .era-tab:focus-visible,
.atlas-app .event-card:focus-visible,
.atlas-app .dynasty-item:focus-visible,
.atlas-app #territory-legend button:focus-visible{outline-offset:-3px}
.atlas-app .story-nav button,
.atlas-app .dynasty-step-nav button,
.atlas-app #range-details-toggle,
.atlas-app #close-range-details,
.atlas-app #close-about{display:inline-flex;align-items:center;justify-content:center;line-height:1.3}
.atlas-app .story-nav button{flex:none}
.atlas-app #dynasty-detail .dynasty-date{min-height:3.2em}
.atlas-app .dynasty-reading-panel .dynasty-overview,
.atlas-app .dynasty-reading-panel .dynasty-explain p,
.atlas-app .dynasty-reading-panel .dynasty-milestones p,
.atlas-app .dynasty-reading-panel .comparison-card p,
.atlas-app .dynasty-reading-panel .dynasty-relations p{font-size:16px;color:#53647d}
.atlas-app .parallel-label span,
.atlas-app .parallel-axis,
.atlas-app .dynasty-chart-note,
.atlas-app .dynasty-section-heading>span,
.atlas-app .dynasty-source-note,
.atlas-app .dynasty-relation-note{color:#5c6d85}
.atlas-app .comparison-card:hover{transform:none}
.atlas-app :is(button,.china-modern-jump){transition:background-color 160ms,border-color 160ms,transform 120ms,opacity 120ms}
.atlas-app :is(button,.china-modern-jump):active:not(:disabled){transform:scale(.98);opacity:.86}
.atlas-app .marker.selected .marker-ping{animation:none;transform-box:fill-box;transform-origin:center}

/* A larger hit area and a thin track occupy the existing timeline slot. */
.atlas-app .timeline-panel .range-wrap{padding-top:0}
.atlas-app #year-slider{
 position:absolute;top:0;left:0;width:100%;height:28px;margin:0;padding:0;
 border:0;appearance:none;background:transparent;cursor:ew-resize;
}
.atlas-app #year-slider::-webkit-slider-runnable-track{
 height:4px;border-radius:4px;
 background:linear-gradient(to right,var(--teal) var(--timeline-progress,0%),var(--track) var(--timeline-progress,0%));
}
.atlas-app #year-slider::-moz-range-track{
 height:4px;border-radius:4px;
 background:linear-gradient(to right,var(--teal) var(--timeline-progress,0%),var(--track) var(--timeline-progress,0%));
}
.atlas-app #year-slider::-webkit-slider-thumb{
 appearance:none;width:18px;height:18px;margin-top:-7px;border:3px solid #fff;border-radius:50%;
 background:var(--teal);box-shadow:0 0 0 1px var(--teal);
}
.atlas-app #year-slider::-moz-range-thumb{
 width:12px;height:12px;border:3px solid #fff;border-radius:50%;background:var(--teal);
}
.atlas-app .timeline-panel .range-labels{position:absolute;left:0;right:0;bottom:0;height:20px;margin:0;pointer-events:none}
.atlas-app #year-slider:disabled{cursor:default;opacity:.55}
.atlas-app #year-slider:focus-visible{outline-offset:-3px}
.atlas-app .timeline-panel .range-labels span{top:0;line-height:20px}
@media(max-width:900px){
 .atlas-app #year-slider{top:-4px}
 .atlas-app .timeline-panel .range-labels{bottom:-2px}
}
@media(max-width:600px){
 .atlas-app #dynasty-detail .dynasty-heading h2{min-height:2.7em}
 .atlas-app .site-header nav>a{padding:6px 9px}
}
@media(max-width:420px){.atlas-app .site-header nav>a{padding:6px 7px}}
@media(max-height:620px){.atlas-app #year-slider{top:1px}}
@media(max-height:620px) and (max-width:480px){
 .atlas-app #world-view{}
 .atlas-app .timeline-panel{height:74px;padding:6px 10px;grid-template-columns:minmax(0,1fr) auto;grid-template-rows:30px 28px;gap:2px 8px}
 .atlas-app .timeline-heading{grid-column:1;grid-row:1}
 .atlas-app .playback-controls{grid-column:2;grid-row:1}
 .atlas-app .timeline-panel .range-wrap{grid-column:1 / -1;grid-row:2;height:28px}
 .atlas-app #year-slider{top:0}
}
@media(prefers-reduced-motion:reduce){.atlas-app :is(button,.china-modern-jump):active:not(:disabled){transform:none}}

/* Each era colors the reading surface; the map keeps its fixed palette. */
body.atlas-app[data-era="origin"]{--teal:#9b4523;--soft:#fff5e7;--track:#ead3ba;--chapter-paper:#fff5e7;--chapter-band:#4e2b1e}
body.atlas-app[data-era="classical"]{--teal:#6743b7;--soft:#f3edff;--track:#dcd1ee;--chapter-paper:#f3edff;--chapter-band:#30204c}
body.atlas-app[data-era="medieval"]{--teal:#08766f;--soft:#e6f6f0;--track:#c8e4da;--chapter-paper:#e6f6f0;--chapter-band:#113f3e}
body.atlas-app[data-era="connections"]{--teal:#2467a7;--soft:#eaf3ff;--track:#cddded;--chapter-paper:#eaf3ff;--chapter-band:#163c5c}
body.atlas-app[data-era="revolution"]{--teal:#b44736;--soft:#fff0ea;--track:#edcfc5;--chapter-paper:#fff0ea;--chapter-band:#542c27}
body.atlas-app[data-era="modern"]{--teal:#2165aa;--soft:#e8f5ff;--track:#caddf0;--chapter-paper:#e8f5ff;--chapter-band:#16384e}
body.atlas-app{--accent:#f4cc4c;background:#edf1f6}
.atlas-app .era-tab[data-era="origin"]{--tile:#9b4523;--tile-soft:#fff5e7}
.atlas-app .era-tab[data-era="classical"]{--tile:#6743b7;--tile-soft:#f3edff}
.atlas-app .era-tab[data-era="medieval"]{--tile:#08766f;--tile-soft:#e6f6f0}
.atlas-app .era-tab[data-era="connections"]{--tile:#2467a7;--tile-soft:#eaf3ff}
.atlas-app .era-tab[data-era="revolution"]{--tile:#b44736;--tile-soft:#fff0ea}
.atlas-app .era-tab[data-era="modern"]{--tile:#2165aa;--tile-soft:#e8f5ff}
.atlas-app .timeline-panel{background:var(--soft);border-color:var(--track)}
.atlas-app .story-panel{border-top:3px solid var(--teal)}
.atlas-app .story-context{background:var(--soft);border-color:var(--track)}

/* A single era panorama spans the workspace; its height never depends on copy. */
.atlas-app #world-view{
 --hero-height:clamp(180px,28dvh,300px);
 grid-template-rows:42px var(--hero-height) 64px minmax(0,1fr);gap:8px;
}
.atlas-app .era-tab{height:42px}
.atlas-app .chapter-cover{
 position:relative;isolation:isolate;min-width:0;min-height:0;margin:0;padding:0;
 overflow:hidden;border-radius:13px;background:var(--chapter-band,#30204c);
}
.atlas-app .chapter-illustration{
 position:absolute;inset:0 0 0 auto;width:90%;height:100%;margin:0;padding:0;pointer-events:none;
}
.atlas-app .chapter-illustration img{
 display:block;width:100%;height:100%;object-fit:cover;object-position:var(--art-x,50%) var(--art-y,50%);
}
.atlas-app .chapter-scene::after{
 content:"";position:absolute;inset:0;z-index:0;pointer-events:none;
 background:linear-gradient(90deg,var(--chapter-band,#30204c) 0%,#101b2aeb 14%,#101b2acc 29%,#101b2a55 44%,transparent 60%);
}
.atlas-app .chapter-copy{
 position:relative;z-index:1;width:430px;max-width:48%;height:100%;min-width:0;
 padding:16px 28px;display:flex;flex-direction:column;justify-content:center;align-items:flex-start;gap:6px;
}
.atlas-app .chapter-meta{
 margin:0;padding:0;color:#ecedf6;font:500 14px/20px var(--sans);letter-spacing:.5px;
 font-variant-numeric:tabular-nums;white-space:nowrap;
}
.atlas-app .chapter-title{
 margin:0;color:#fff;font:600 clamp(32px,3.5vw,52px)/1.15 var(--serif);letter-spacing:3px;
}
.atlas-app .chapter-subtitle{margin:0;color:#fff;font:500 20px/28px var(--sans)}
.atlas-app .chapter-intro{margin:5px 0 0;color:#f1f2f8;font:400 16px/1.65 var(--sans);text-wrap:pretty}
.chapter-scene[data-era="origin"]{--chapter-band:#4e2b1e;--art-y:55%}
.chapter-scene[data-era="classical"]{--chapter-band:#30204c;--art-y:60%}
.chapter-scene[data-era="medieval"]{--chapter-band:#113f3e;--art-y:55%}
.chapter-scene[data-era="connections"]{--chapter-band:#163c5c;--art-y:56%}
.chapter-scene[data-era="revolution"]{--chapter-band:#542c27;--art-y:54%}
.chapter-scene[data-era="modern"]{--chapter-band:#16384e;--art-y:60%}
.atlas-app .timeline-panel{height:64px;padding:6px 16px}
.atlas-app .map-workspace-heading{grid-row:1;display:flex;align-items:center;padding:0 14px;min-height:0}
.atlas-app .map-workspace-heading h2{margin:0;color:#edf2fa;font:600 15px/24px var(--sans)}
.atlas-app .map-panel{grid-template-rows:32px minmax(0,1fr) 68px 34px 22px}
.atlas-app .territory-controls{padding:4px 12px}
.atlas-app #territory-status{height:20px;line-height:20px;margin-top:2px}
.atlas-app #territory-legend{height:34px;padding:2px 10px 3px}
.atlas-app .map-bottom{height:22px;padding-bottom:2px}
@media(max-width:1200px){
 .atlas-app .map-panel{grid-template-rows:32px minmax(0,1fr) 96px 34px 22px}
 .atlas-app .chapter-copy{padding:16px 24px;max-width:52%}
}
@media(max-width:900px){
 .atlas-app #world-view{--hero-height:clamp(120px,18dvh,160px);grid-template-rows:42px var(--hero-height) 96px 34px minmax(0,1fr);gap:6px}
 .atlas-app .era-tab{height:38px}
 .atlas-app .timeline-panel{height:96px;padding:8px 12px}
 .atlas-app .chapter-illustration{width:100%}
 .atlas-app .chapter-copy{width:380px;max-width:70%;padding:12px 20px;gap:4px}
 .atlas-app .chapter-title{font-size:32px;line-height:38px}
 .atlas-app .chapter-meta{font-size:12px;line-height:18px}
 .atlas-app .chapter-subtitle{font-size:16px;line-height:22px}
 .atlas-app .chapter-intro{display:none}
 .atlas-app .chapter-scene::after{background:linear-gradient(90deg,#101b2aeb,#101b2a99 35%,transparent 80%)}
}
@media(max-width:480px){
 .atlas-app .chapter-copy{max-width:86%;padding:10px 16px}
 .atlas-app .chapter-title{font-size:30px;line-height:36px}
}
@media(max-width:900px) and (min-height:621px) and (max-height:740px){
 .atlas-app #world-view{--hero-height:112px;grid-template-rows:38px var(--hero-height) 74px 30px minmax(0,1fr)}
 .atlas-app .workspace-tabs{height:30px}
 .atlas-app .timeline-panel{height:74px;grid-template-rows:30px 28px;padding:6px 10px;gap:2px 8px}
 .atlas-app .timeline-panel .range-wrap{height:28px}
 .atlas-app .timeline-panel .range-labels{display:none}
 .atlas-app #play-button,.atlas-app #playback-speed{height:30px}
}
@media(max-height:800px) and (min-width:901px){
 .atlas-app .chapter-copy{padding:12px 24px;gap:4px}
 .atlas-app .chapter-title{font-size:36px;line-height:42px}
 .atlas-app .chapter-subtitle{font-size:17px;line-height:24px}
 .atlas-app .chapter-intro{font-size:14px;line-height:21px;margin-top:2px}
}
@media(max-height:620px){
 .atlas-app #world-view{--hero-height:84px;grid-template-rows:32px var(--hero-height) 44px minmax(0,1fr);gap:4px}
 .atlas-app .era-tab{height:30px}
 .atlas-app .timeline-panel{height:44px;padding:4px 10px}
 .atlas-app .chapter-copy{max-width:75%;padding:8px 16px;gap:3px}
 .atlas-app .chapter-title{font-size:28px;line-height:34px}
 .atlas-app .chapter-meta{font-size:12px;line-height:18px}
 .atlas-app .chapter-subtitle,.atlas-app .chapter-intro{display:none}
 .atlas-app .map-panel{grid-template-rows:24px minmax(0,1fr) 40px 30px 20px}
 .atlas-app .territory-controls{padding:3px 8px}
 .atlas-app #territory-status{height:1px;margin:-1px}
 .atlas-app #territory-legend{height:30px;padding:0 8px}
 .atlas-app .map-bottom{height:20px;padding-bottom:2px}
}
@media(max-height:620px) and (max-width:900px){
 .atlas-app #world-view{grid-template-rows:32px var(--hero-height) 44px 28px minmax(0,1fr)}
}
@media(max-height:620px) and (max-width:480px){
 .atlas-app #world-view{grid-template-rows:32px var(--hero-height) 74px 28px minmax(0,1fr)}
 .atlas-app .timeline-panel{height:74px;padding:6px 10px}
 .atlas-app .map-panel{grid-template-rows:24px minmax(0,1fr) 68px 30px 20px}
}
@media(max-height:440px){
 .atlas-app #world-view{--hero-height:52px}
 .atlas-app .chapter-copy{flex-direction:row;align-items:center;justify-content:flex-start;gap:14px;padding:6px 16px;max-width:100%}
 .atlas-app .chapter-title{font-size:24px;line-height:30px;order:-1}
 .atlas-app .map-workspace-heading{display:none}
 .atlas-app .map-panel{grid-template-rows:0 minmax(0,1fr) 40px 30px 20px}
}

@media(max-height:440px) and (max-width:480px){.atlas-app .map-panel{grid-template-rows:0 minmax(0,1fr) 68px 30px 20px}}

/* Each dissolve layer owns its colors and crop; body theme changes cannot move an old image. */
.atlas-app .chapter-cover{background:#162236}
.atlas-app .chapter-scene{position:absolute;inset:0;isolation:isolate;overflow:hidden;background:var(--chapter-band,#30204c)}
.atlas-app .chapter-number::after{content:" · "}
.atlas-app .chapter-scene-unavailable::after{background:none}
@media(max-width:900px) and (min-height:621px){
 .atlas-app .chapter-copy{position:absolute;left:16px;right:12px;bottom:10px;width:auto;max-width:none;height:auto;padding:0;display:grid;grid-template-columns:auto minmax(0,1fr);gap:2px 12px;align-items:baseline}
 .atlas-app .chapter-title{grid-row:1;grid-column:1;font-size:27px;line-height:32px;letter-spacing:1px}
 .atlas-app .chapter-meta{grid-row:1;grid-column:2;font-size:12px;line-height:18px;letter-spacing:0}
 .atlas-app .chapter-number{display:none}
 .atlas-app .chapter-subtitle{grid-row:2;grid-column:1 / -1;font-size:14px;line-height:20px}
 .atlas-app .chapter-scene::after{background:linear-gradient(180deg,transparent 15%,#101b2a22 35%,#101b2ae0 100%)}
}

/* Zoom changes only the timeline scale, keeping its existing row height. */
.atlas-app .timeline-panel .range-wrap{display:grid;grid-template-columns:88px minmax(0,1fr);column-gap:10px;padding-top:0;align-items:start}
.atlas-app .timeline-axis{position:relative;min-width:0;height:100%}
.atlas-app .timeline-mode-label{display:block;min-width:0;margin:0}
.atlas-app #timeline-mode{display:block;width:88px;height:28px;padding:2px 5px;border:1px solid var(--track);border-radius:7px;background:#fff;color:var(--teal);font:500 12px/20px var(--sans)}
.atlas-app .timeline-panel .range-labels span{display:block;transform:translateX(-50%)}
.atlas-app .timeline-panel .range-labels span:first-child{transform:none}
.atlas-app .timeline-panel .range-labels span:last-child{transform:translateX(-100%)}
@media(max-width:600px){
 .atlas-app .timeline-panel .range-wrap{grid-template-columns:82px minmax(0,1fr);column-gap:8px}
 .atlas-app #timeline-mode{width:82px}
 .atlas-app .timeline-panel .range-labels span:not(:first-child):not(:last-child){display:none}
}

/* Range reading occupies the existing story column, never the map surface. */
.atlas-app #events-panel{grid-column:1;grid-row:1}
.atlas-app #map-panel{grid-column:2;grid-row:1}
.atlas-app #story-panel{grid-column:3;grid-row:1}
.atlas-app .range-peek{display:none}
@media(max-width:900px){
 .atlas-app .map-panel{--map-heading-row:32px;--map-controls-row:96px;--map-legend-row:34px;--map-footer-row:48px;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-bottom{height:var(--map-footer-row);padding:0 8px;border-top:1px solid #ffffff20}
 .atlas-app .map-bottom>span{display:none}
 .atlas-app .range-peek{display:flex;align-items:center;gap:7px;width:100%;min-width:0;height:100%;color:#edf2fa}
 .atlas-app .range-peek-copy{flex:1;min-width:0;overflow:hidden}
 .atlas-app #range-peek-title{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font:600 14px/20px var(--sans)}
 .atlas-app #range-peek-meta{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font:400 12px/17px var(--sans);color:#c2d0e2}
 .atlas-app #range-peek-details,.atlas-app #clear-range-selection{flex:none;height:34px;border:1px solid #566c89;border-radius:6px;background:#21334b;color:#fff;padding:3px 10px;font:500 14px/24px var(--sans)}
 .atlas-app #range-peek-details:disabled{opacity:.5}
 .atlas-app #clear-range-selection{width:34px;padding:0;font-size:23px}
 .atlas-app #close-range-details{width:auto;min-width:78px;font:500 14px/24px var(--sans);padding:2px 8px}
 .atlas-app #territory-summary{width:100%;height:100%;max-height:none}
}
@media(max-height:620px) and (max-width:900px){
 .atlas-app .map-panel{--map-heading-row:24px;--map-controls-row:40px;--map-legend-row:30px;--map-footer-row:40px}
 .atlas-app #range-peek-title{line-height:18px}
 .atlas-app #range-peek-meta{line-height:16px}
}
@media(max-height:620px) and (max-width:480px){.atlas-app .map-panel{--map-controls-row:68px}}
@media(max-height:440px) and (max-width:900px){.atlas-app .map-panel{--map-heading-row:0px}}

/* One continuous China chapter scene behind the existing title and controls. */
.atlas-app #dynasty-detail[data-ready=true]{grid-template-rows:196px 42px minmax(0,1fr)}
.atlas-app #dynasty-detail .dynasty-heading{position:relative;isolation:isolate;height:100%;overflow:hidden;background:#233347;padding:20px 24px}
.atlas-app .dynasty-cover{position:absolute;inset:0;z-index:-2;overflow:hidden}
.atlas-app .dynasty-cover-image{display:block;width:100%;height:100%;object-fit:cover;object-position:58% 58%;opacity:0;transition:opacity 320ms ease-out}
.atlas-app .dynasty-cover-image-ready{opacity:1}
.atlas-app #dynasty-detail .dynasty-heading::after{content:"";position:absolute;inset:0;z-index:-1;pointer-events:none;background:linear-gradient(90deg,#0d192de8 0%,#0d192dbd 28%,#0d192d55 62%,#0d192d66 100%)}
.atlas-app #dynasty-detail .dynasty-heading-copy{max-width:700px}
.atlas-app #dynasty-detail .dynasty-heading h2{color:#fff;font-size:36px;line-height:1.25;letter-spacing:2px;min-height:0}
.atlas-app #dynasty-detail .dynasty-heading-long h2{font-size:28px;letter-spacing:0}
.atlas-app #dynasty-detail .dynasty-heading .eyebrow,.atlas-app #dynasty-detail .dynasty-date{color:#f2f4fa;text-shadow:0 1px 2px #0d192d80}
.atlas-app #dynasty-detail .dynasty-step-nav button{color:#fff;border-color:#d7e3f280;background:#132238c9;backdrop-filter:blur(4px)}
.atlas-app #dynasty-detail .dynasty-step-nav button:disabled{color:#c3cedd;opacity:.55}
.atlas-app #dynasty-detail .dynasty-step-nav button:focus-visible{outline:2px solid #f4cc4c;outline-offset:3px}
@media(max-width:900px){.atlas-app #dynasty-detail[data-ready=true]{grid-template-rows:176px 42px minmax(0,1fr)}.atlas-app #dynasty-detail .dynasty-heading{gap:10px;padding:16px 20px}.atlas-app #dynasty-detail .dynasty-heading h2{font-size:30px}.atlas-app #dynasty-detail .dynasty-heading-long h2{font-size:25px}}
@media(max-width:600px){.atlas-app #dynasty-detail[data-ready=true]{grid-template-rows:184px 38px minmax(0,1fr)}.atlas-app #dynasty-detail .dynasty-heading{grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr) 30px;gap:4px;padding:12px 16px}.atlas-app #dynasty-detail .dynasty-heading h2{font-size:29px;line-height:1.22}.atlas-app #dynasty-detail .dynasty-heading-long h2{font-size:23px;line-height:1.22}.atlas-app #dynasty-detail .dynasty-heading .eyebrow{font-size:11px;margin-bottom:3px}.atlas-app #dynasty-detail .dynasty-date{font-size:12px;line-height:1.5}.atlas-app #dynasty-detail .dynasty-step-nav{justify-content:space-between;width:100%;align-self:end}.atlas-app .dynasty-cover-image{object-position:58% 55%}.atlas-app #dynasty-detail .dynasty-heading::after{background:linear-gradient(90deg,#0d192dde,#0d192d75 70%,#0d192d55)}}
@media(max-height:620px){.atlas-app #dynasty-detail[data-ready=true]{grid-template-rows:146px 34px minmax(0,1fr)}.atlas-app #dynasty-detail .dynasty-heading{padding:10px 16px}.atlas-app #dynasty-detail .dynasty-heading h2{font-size:26px}.atlas-app #dynasty-detail .dynasty-heading-long h2{font-size:22px}}
@media(max-height:620px) and (max-width:600px){.atlas-app #dynasty-detail[data-ready=true]{grid-template-rows:162px 34px minmax(0,1fr)}}
@media(max-height:440px){.atlas-app #dynasty-detail[data-ready=true]{grid-template-rows:118px 34px minmax(0,1fr)}.atlas-app #dynasty-detail .dynasty-heading{grid-template-columns:minmax(0,1fr) auto;grid-template-rows:1fr;gap:8px}.atlas-app #dynasty-detail .dynasty-step-nav{width:auto;align-self:center}.atlas-app #dynasty-detail .dynasty-heading h2{font-size:23px}.atlas-app #dynasty-detail .dynasty-heading-long h2{font-size:19px}}
@media(prefers-reduced-motion:reduce){.atlas-app .dynasty-cover-image{transition:none}}
@media(max-height:440px) and (max-width:600px){.atlas-app #dynasty-detail .dynasty-heading .eyebrow{display:none}.atlas-app #dynasty-detail .dynasty-step-nav{flex-direction:column;gap:4px}.atlas-app #dynasty-detail .dynasty-step-nav button{min-height:26px;padding:3px 7px;font-size:11px}.atlas-app #dynasty-detail .dynasty-heading-long h2{font-size:18px}}

/* References are bibliography text; all detail content stays inside its reading panel. */
.atlas-app .story-references{font-size:13px;color:var(--muted);margin:0 0 18px;overflow-wrap:anywhere}
.atlas-app .story-references h3,.atlas-app .story-location-note h3{font-size:13px;margin:0 0 6px;color:var(--teal)}
.atlas-app .story-references ul{margin:0;padding-left:18px}
.atlas-app .story-references li{margin:0 0 7px}
.atlas-app .story-references>p{font-size:12px;line-height:1.7;margin:8px 0 0}
.atlas-app .story-location-note{padding:12px 14px;background:var(--soft);border-radius:10px;margin:0 0 18px;font-size:13px;line-height:1.8;color:#526277}
.atlas-app .story-location-note p{margin:0}
.atlas-app .territory-reference{font-size:13px;line-height:1.8;margin:0 0 8px;color:var(--teal);overflow-wrap:anywhere}
