/* Shared state tokens. Keep interactive contrast independent of legacy panel rules. */
:root{--surface-muted:#586570;--focus-ring:#506675;--switch-off:#89959e;--switch-border:#667681;--switch-thumb:#fff}
:root[data-theme=dark]{--surface-muted:#b4c0c8;--focus-ring:#b9cfdd;--switch-off:#596874;--switch-border:#a5b7c3;--switch-thumb:#edf1f4}
button:focus-visible,input:focus-visible,textarea:focus-visible,a:focus-visible,summary:focus-visible{outline:2px solid var(--focus-ring);outline-offset:2px}
.atlas-tool:focus-visible,.atlas-brand:focus-visible,.dropdown-trigger:focus-visible{outline:2px solid var(--focus-ring);outline-offset:-3px}
.dropdown-option:focus-visible{outline:2px solid var(--focus-ring);outline-offset:-3px;background:var(--surface-hover);color:var(--surface-ink)}
.switch-track{border:1px solid var(--switch-border);background:var(--switch-off)}
.switch input:focus-visible+.switch-track{outline:2px solid var(--focus-ring);outline-offset:3px}
.switch input:checked+.switch-track{background:var(--surface-ink);border-color:var(--surface-ink)}
.switch{width:34px;height:20px;flex:none}
.switch-track{inset:0;border-radius:999px}
.switch-track:after{content:'';display:block;position:absolute;top:50%;left:2px;width:14px;height:14px;border-radius:50%;background:var(--switch-thumb);border:0;transform:translateY(-50%);transition:transform .16s}
.switch input:checked+.switch-track:after{background:var(--surface);transform:translate(14px,-50%)}
.switch input:focus-visible{outline:none}
.load-more{color:var(--surface-ink);border-radius:8px}
.load-more:hover,.load-more:focus-visible{background:var(--surface-hover);color:var(--surface-ink)}
.empty,.legend-values{color:var(--surface-muted)}
#main .data-note,.panel .data-note{color:var(--surface-muted)!important}
.journey-actions button:first-child{background:var(--primary-bg);color:var(--primary-ink)}
.journey-actions button:first-child:hover{background:var(--primary-hover);color:var(--primary-ink)}
.journey-actions button:disabled{background:var(--action-bg);color:var(--surface-muted);cursor:default}
:root[data-theme=dark] .switch-track{background:var(--switch-off)}
:root[data-theme=dark] .switch input:checked+.switch-track{background:var(--surface-ink);border:1px solid var(--surface-ink)}
:root[data-theme=dark] .switch input:checked+.switch-track:after{background:var(--surface)}

/* Compact result rows and shared record type labels. */
.type-pill{display:inline-flex;align-items:center;justify-content:center;flex:none;padding:2px 6px;border:1px solid var(--surface-line);border-radius:5px;background:var(--surface-hover);color:var(--surface-muted);font:400 10px/1.4 Inter,sans-serif;white-space:nowrap;letter-spacing:0;text-transform:none}
.shortcut-key,.search-open-key{display:inline-flex;align-items:center;justify-content:center;min-height:22px;padding:2px 5px;border:1px solid var(--surface-line);border-radius:5px;background:var(--surface-hover);color:var(--surface-muted);font:400 11px/1.2 Inter,sans-serif;white-space:nowrap;box-shadow:0 1px 1px #00000008}
.search-launch-key{margin-left:auto}
#search-close{border:0;background:transparent;box-shadow:none;border-radius:7px;width:30px;height:30px}
#search-close:hover{background:var(--surface-hover);color:var(--surface-ink)}
#search-close:focus-visible{outline-offset:-2px}
.search-escape-key{margin-left:8px}
.search-dialog:focus-visible{outline:none}
.search-input-row{gap:10px;padding:16px 20px}
#search-results{padding:6px}
.search-result{display:grid;grid-template-columns:minmax(0,1fr) auto 22px;align-items:center;gap:12px;min-height:46px;padding:10px 12px;margin:0;border-radius:8px;text-align:left}
.search-result-title{display:flex;align-items:center;gap:8px;min-width:0}
.search-result strong{display:block;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:14px;font-weight:450;line-height:1.5}
.search-result time{font-size:12px;color:var(--surface-muted);white-space:nowrap}
.search-result-action{display:grid;place-items:center;width:22px}
.search-result-action>.lucide{width:16px;height:16px}
.search-open-key{display:none;width:22px;padding:2px}
.search-result.focused .search-result-action>.lucide{display:none}
.search-result.focused .search-open-key{display:inline-flex}
#search-status{font-size:11px;padding:8px 18px}
#search-status:empty{display:none}
.record-title-line{display:flex;align-items:flex-start;gap:8px;min-width:0}
.record-title-line>span:first-child{min-width:0;flex:1}
.record-title-line .type-pill{margin-top:2px}
@media(max-width:900px){.search-launch-key{display:none}}
@media(max-width:500px){.search-escape-key{display:none}.search-input-row{padding:14px 16px}.search-result{gap:8px;padding:10px}.search-result strong{font-size:13px}.search-result time{font-size:11px}.search-result .type-pill{font-size:9px;padding:2px 4px}}

/* One button and dropdown surface across the app; white in light mode. */
:root{--button-bg:#fff;--button-border:#c5ccd2;--button-hover:#f4f6f8;--button-active:#e8edf1;--button-shadow:0 1px 2px #18263110;--action-bg:var(--button-bg);--action-hover:var(--button-hover);--primary-bg:var(--button-bg);--primary-ink:var(--surface-ink);--primary-hover:var(--button-hover)}
:root[data-theme=dark]{--button-bg:#252a2e;--button-border:#53616c;--button-hover:#333e46;--button-active:#414d56;--button-shadow:0 1px 3px #0003;--action-bg:var(--button-bg);--action-hover:var(--button-hover);--primary-bg:var(--button-bg);--primary-ink:var(--surface-ink);--primary-hover:var(--button-hover)}
#detail-panel .record-tools button,.journey-actions button,.chat-actions button,.chat-error button,.reader-button:not([role=tab]),#ask-welcome button,.random-choice,.story-choice,.small-control,#timeline-settings-toggle,#time-dock .timeline-controls>button,#time-dock .time-range-zoom button{background:var(--button-bg);color:var(--surface-ink);border:1px solid var(--button-border);border-radius:8px;box-shadow:var(--button-shadow)}
#detail-panel .record-tools button:hover,.journey-actions button:hover,.chat-actions button:hover,.reader-button:not([role=tab]):hover:not(:disabled),#ask-welcome button:hover,.random-choice:hover,.story-choice:hover,.small-control:hover,#time-dock .timeline-controls>button:hover,#time-dock .time-range-zoom button:hover{background:var(--button-hover);color:var(--surface-ink);border-color:var(--surface-muted)}
#voyage-resume,#voyage-resume:hover,#voyage-resume:focus-visible,#voyage-resume:active,#ask-submit:not(:disabled),#ask-submit:not(:disabled):hover,#time-dock #play,#time-dock #play:hover,#story-play,#voyage-toggle{background:var(--button-bg);color:var(--surface-ink);border:1px solid var(--button-border);box-shadow:var(--button-shadow)}
#voyage-resume:hover,#ask-submit:not(:disabled):hover,#time-dock #play:hover,#story-play:hover,#voyage-toggle:hover{background:var(--button-hover);color:var(--surface-ink)}
#ask-welcome button{margin-top:10px;padding:13px 14px;min-height:44px;text-decoration:none;font-weight:400;font-size:14px}
#ask-welcome button:first-of-type{margin-top:0}
#more-menu .atlas-tool{margin-bottom:5px;box-shadow:none}
#more-menu .atlas-tool:last-child{margin-bottom:0}
.story-choice{margin-bottom:8px;padding:12px;box-sizing:border-box}
.story-choice strong{font-size:14px;font-weight:450}
.story-choice small{font-size:12px}
.random-choice{padding:12px 14px}
.random-choice>.random-label{display:inline-flex;align-items:center;gap:9px}
.random-label>.lucide{width:17px;height:17px}
body .dropdown .dropdown-trigger,#reader-section-dropdown .dropdown-trigger,#time-dock .dropdown-trigger{display:grid;grid-template-columns:minmax(0,1fr) 14px;align-items:center;gap:10px;min-height:36px;height:36px;padding:7px 12px;width:100%;border:1px solid var(--button-border);border-radius:8px;background:var(--button-bg);color:var(--surface-ink);box-shadow:var(--button-shadow);font:400 14px/1.4 Inter,sans-serif;text-align:left}
body .dropdown .dropdown-trigger:hover,#time-dock .dropdown-trigger:hover{background:var(--button-hover);color:var(--surface-ink);border-color:var(--surface-muted)}
body .dropdown .dropdown-trigger[aria-expanded=true]{border-color:var(--surface-muted);background:var(--button-active)}
body .dropdown-trigger>span:first-child{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
body .dropdown-trigger>svg.lucide{width:14px;height:14px;justify-self:end;margin:0;color:var(--surface-muted)}
body .dropdown-menu{background:var(--surface);color:var(--surface-ink);border:1px solid var(--button-border);border-radius:10px;padding:5px;box-shadow:0 4px 16px #00000020}
body .dropdown-option{color:var(--surface-ink);font-size:14px;padding:9px 11px;min-height:36px;border-radius:6px;background:transparent}
body .dropdown-option:hover,body .dropdown-option[aria-selected=true]{background:var(--button-hover);color:var(--surface-ink)}

#time-dock .time-playback-row>button{background:var(--button-bg);color:var(--surface-ink);border:1px solid var(--button-border);border-radius:7px;box-shadow:var(--button-shadow)}
#time-dock .time-playback-row>button:hover{background:var(--button-hover);color:var(--surface-ink)}
#search-input:focus,#search-input:focus-visible{outline:none;box-shadow:none;border:0;background:transparent}
#ask-welcome button{display:flex;align-items:center;justify-content:space-between;gap:12px;line-height:1.4}
#ask-welcome button>span{display:inline-flex;align-items:center;justify-content:center}
#ask-welcome button>span>.lucide{display:block;width:17px;height:17px;margin:0}
.population-change{grid-column:1/-1;display:flex;align-items:center;gap:5px;font-size:11px;line-height:1.4;color:var(--surface-muted);margin-top:4px;white-space:nowrap}
.population-change .lucide{width:13px;height:13px}
.map-tooltip{display:flex;align-items:center;gap:8px;z-index:10;pointer-events:none}
.map-tooltip[hidden]{display:none}.map-tooltip>.lucide{width:16px;height:16px;flex-shrink:0;color:var(--surface-muted)}
/* Explore options remain unboxed search-like rows. */
#explore-list .story-choice{background:transparent;border:0;box-shadow:none;border-radius:8px;margin:0;min-height:56px;padding:11px 14px;line-height:1.45}
#explore-list .story-choice:hover{background:var(--surface-hover);box-shadow:none}
#explore-list .story-choice strong{font-size:14px;font-weight:450}#explore-list .story-choice small{font-size:12px;margin-top:3px}
#explore-list{padding:0 10px 10px;max-height:min(52dvh,470px);overflow:auto}
dialog[open]{margin:auto!important;max-height:calc(100dvh - 32px)}
#explore-dialog{max-height:min(620px,calc(100dvh - 32px));overflow:hidden;display:flex;flex-direction:column}#explore-dialog:not([open]){display:none}
#detail-panel .related-record{width:calc(100% + 24px);margin-left:-12px;margin-right:-12px}
#detail-panel .record-enrichment .image-credit,#detail-panel #battle-enrichment .image-credit{margin:12px 0 16px!important;line-height:1.55!important}
#detail-panel .source-connections .detail-related{margin-top:16px;padding-top:16px}
#detail-panel .source-fact-list{list-style:none;margin:0;padding:0;display:grid;gap:10px}
#detail-panel .source-fact-list li{margin:0;padding:0;font-weight:400;line-height:1.55}
.source-fact-detail{display:block;color:var(--surface-muted);font-size:12px;margin-top:3px}
.source-fact-citation{display:inline-flex;align-items:center;vertical-align:middle;padding:2px 5px;background:var(--surface-hover);color:var(--surface-muted);border-radius:4px;font-size:10px;line-height:1.4;text-decoration:none;margin-left:4px}
#detail-panel .source-context:first-child{margin-top:0;padding-top:0;border:0}
.ask-disclosure{display:flex;align-items:center;justify-content:center;gap:5px;flex:none}
.accuracy-info{position:relative;border:0;background:none;padding:0;display:inline-flex;color:var(--surface-muted)}.accuracy-info>.lucide{width:13px;height:13px}
#accuracy-tooltip{position:absolute;bottom:calc(100% + 9px);left:0;display:none;width:220px;padding:10px 12px;border:1px solid var(--surface-line);border-radius:8px;background:var(--surface);box-shadow:var(--surface-shadow);font-size:12px;line-height:1.5;text-align:left;color:var(--surface-ink);z-index:50}.accuracy-info:hover #accuracy-tooltip,.accuracy-info:focus-visible #accuracy-tooltip{display:block}
#ask-messages{scroll-padding-bottom:28px;padding-top:20px;padding-bottom:36px;mask-image:linear-gradient(to bottom,#000 0%,#000 calc(100% - 24px),transparent 100%)}
#ask-welcome{padding-top:6px}.chat-turn+.chat-turn{border-top:0;padding-top:10px}.answer-pin-icon>.lucide{width:15px;height:15px}
#time-dock #play,#story-player #story-play,#voyage-toggle{background:var(--button-bg);color:var(--surface-ink);border:1px solid var(--button-border);box-shadow:var(--button-shadow)}
#time-dock #play:hover,#story-player #story-play:hover,#voyage-toggle:hover{background:var(--button-hover);color:var(--surface-ink)}
#story-player .story-playback button,#story-follow,#story-ambient,#story-narration{background:var(--button-bg);color:var(--surface-ink);border:1px solid var(--button-border);box-shadow:var(--button-shadow);border-radius:7px;min-height:32px;display:inline-flex;align-items:center;justify-content:center;gap:5px;padding:6px 8px;font-size:12px;line-height:1.3}
#story-player .story-playback button:hover,#story-follow:hover,#story-ambient:hover,#story-narration:hover{background:var(--button-hover);color:var(--surface-ink)}
#story-follow[aria-pressed=true],#story-narration[aria-pressed=true]{background:var(--surface-hover);border-color:var(--surface-muted)}
#story-player #story-ambient{display:none}#story-player #story-play svg{fill:none!important;stroke:currentColor!important}
#story-player input[type=range]{appearance:none;height:24px;background:transparent;cursor:pointer}
#story-player input[type=range]::-webkit-slider-runnable-track{height:3px;border-radius:2px;background:var(--surface-line)}
#story-player input[type=range]::-webkit-slider-thumb{appearance:none;width:15px;height:15px;margin-top:-6px;background:var(--surface);border:2px solid #8b99a3;border-radius:50%;box-shadow:0 1px 2px #0002}
#time-dock #year-slider::-webkit-slider-runnable-track{background:linear-gradient(to right,#8b99a3 0%,#8b99a3 var(--progress,50%),var(--surface-line) var(--progress,50%),var(--surface-line) 100%)}
#time-dock #year-slider::-webkit-slider-thumb{background:var(--surface);border:2px solid #8b99a3;box-shadow:none}
@media(min-width:701px){#feed-panel,#detail-panel{height:calc(100dvh - 116px);min-height:min(420px,calc(100dvh - 240px));max-height:calc(100dvh - 116px)}#detail-panel .panel-heading{position:sticky;top:0;z-index:3;background:var(--surface)}}
#detail-panel .detail-body.content-changing{animation:record-content-in .16s ease-out}
@keyframes record-content-in{from{opacity:.4}to{opacity:1}}
@media(prefers-reduced-motion:reduce){#detail-panel .detail-body.content-changing{animation:none}}
#search-dialog{min-height:0!important;display:flex;flex-direction:column;overflow:hidden;transition:height .22s cubic-bezier(.2,.7,.2,1)}#search-dialog:not([open]){display:none}
#search-dialog .search-input-row,#search-dialog .search-tabs{flex:none}#search-results{min-height:0!important;max-height:334px;flex:1;overflow-y:auto;padding-top:6px;padding-bottom:6px;box-sizing:border-box}
#search-dialog .search-status:empty{display:none}#search-dialog .search-result{height:46px;min-height:46px;box-sizing:border-box}
@media(prefers-reduced-motion:reduce){#search-dialog{transition:none}}
#records-live-view{width:auto;gap:5px;padding:0 7px;font-size:12px;display:flex;align-items:center}#records-live-view .lucide{width:14px;height:14px}
#live-feed-state{padding:9px 18px;font-size:12px;color:var(--surface-muted)}
#feed-panel.live-feed-mode .feed-filters,#feed-panel.live-feed-mode .viewport-filter,#feed-panel.live-feed-mode .feed-range,#feed-panel.live-feed-mode #record-query,#feed-panel.live-feed-mode #export-records,#feed-panel.live-feed-mode #next-event{display:none}
.live-event .record-meta{align-items:center}.live-event p{font-size:13px;line-height:1.6;font-weight:400}.live-event small{font-size:12px;color:var(--surface-muted)}
.live-event-new{animation:live-event-in .24s ease-out}@keyframes live-event-in{from{opacity:0;transform:translateY(-7px)}to{opacity:1;transform:translateY(0)}}
@media(prefers-reduced-motion:reduce){.live-event-new{animation:none}}
#story-player{width:520px;padding:12px;box-sizing:border-box;border:1px solid var(--surface-line);background:var(--surface);color:var(--surface-ink)}
#story-player .story-player-heading{flex-wrap:wrap;gap:7px;align-items:center}#story-name{font-size:14px;font-weight:500;min-width:150px}#story-current{font-size:12px}
#story-player #story-exit{margin-left:auto;min-height:30px;width:30px;flex:none;display:grid;place-items:center}
#story-event-label{display:block;width:100%;text-align:left;font-size:13px;font-weight:400;line-height:1.5;padding:9px 0 2px;color:var(--surface-muted);background:none;border:0;box-shadow:none;white-space:normal}
#story-event-label:hover{color:var(--surface-ink)}#story-player .story-playback{gap:7px;margin-top:8px}
#story-follow>.lucide,#story-narration>.lucide{width:14px;height:14px}#story-follow{margin-left:auto}#story-player #story-rate{font-size:12px;min-width:36px}
@media(max-width:700px){#story-player{max-width:calc(100vw - 24px);width:390px}#story-name{flex-basis:calc(100% - 90px)}#story-follow{margin-left:0}#story-exit{position:absolute;top:9px;right:9px}#story-player .story-playback{gap:6px}}
#ask-messages[hidden],#ask-form[hidden],#ask-history[hidden],.ask-disclosure[hidden]{display:none!important}
#ask-history{flex:1;min-height:0;overflow:auto;padding:14px 18px}#ask-history-open{display:inline-flex;align-items:center;gap:5px;padding:5px 7px;font-size:13px}#ask-history-open .lucide{width:15px;height:15px}
.chat-history-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:16px}.chat-history-toolbar button{display:inline-flex;align-items:center;gap:6px;font-size:12px}.chat-history-toolbar .lucide{width:14px;height:14px}.chat-history-toolbar small{font-size:11px;color:var(--surface-muted)}
.chat-thread-row{display:grid;grid-template-columns:17px minmax(0,1fr) 15px;align-items:center;gap:10px;width:100%;text-align:left;border:0;padding:12px 8px;border-radius:8px;box-shadow:none;background:transparent;color:var(--surface-ink)}.chat-thread-row:hover{background:var(--surface-hover)}.chat-thread-row>.lucide{width:16px;height:16px;color:var(--surface-muted)}.chat-thread-row strong{display:block;font-size:14px;font-weight:400;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.chat-thread-row small{display:block;margin-top:5px;font-size:12px;color:var(--surface-muted)}
.table-source{display:inline-flex!important;align-items:center;gap:6px;color:var(--surface-ink);text-decoration:none;font-size:12px!important;margin:0!important;white-space:nowrap}.table-source>span{display:grid;place-items:center;min-width:20px;height:20px;padding:0 3px;border-radius:5px;background:var(--surface-hover);font-size:11px;color:var(--surface-muted)}.table-source:hover{text-decoration:underline}
#ask-panel .panel-heading{display:flex;align-items:center;gap:8px;min-height:56px;padding:12px 16px}#ask-panel .panel-heading h2{flex:1;min-width:0;font-size:16px;line-height:1.4;margin:0;font-weight:500;letter-spacing:0}#ask-panel .panel-heading>div{margin-left:auto;gap:5px}#ask-history-back{width:28px;height:30px;padding:0;display:grid;place-items:center;background:transparent;border:0;box-shadow:none;flex:none}#ask-history-back[hidden],#ask-history-open[hidden]{display:none!important}#ask-history-back>.lucide{width:17px;height:17px}
#ask-panel .panel-heading button:focus-visible{outline-offset:-2px;border-radius:6px}#ask-history{padding:8px 12px}.chat-thread-row{min-height:62px;padding:12px 8px;gap:9px}.chat-thread-row strong{font-size:14px;line-height:1.5}.chat-thread-row small{font-size:11px;margin-top:4px}
/* More is a popover menu, not a stack of outlined action buttons. */
#more-menu.atlas-more{padding:6px;border:1px solid var(--surface-line);border-radius:10px;background:var(--surface);box-shadow:var(--surface-shadow)}
#more-menu .atlas-tool{display:flex;align-items:center;justify-content:flex-start;gap:9px;width:100%;height:39px;min-height:39px;margin:0;padding:9px 11px;border:0;border-radius:6px;background:transparent;box-shadow:none;color:var(--surface-ink);font-size:13px;line-height:1.4;text-align:left}
#more-menu .atlas-tool:hover,#more-menu .atlas-tool:focus-visible{background:var(--surface-hover);color:var(--surface-ink);border:0;box-shadow:none;outline-offset:-2px}#more-menu .atlas-tool>.lucide{width:17px;height:17px}
#journeys-open{display:inline-flex;align-items:center;gap:7px}.journeys-menu{padding:6px;border:1px solid var(--surface-line);border-radius:10px;background:var(--surface);box-shadow:var(--surface-shadow);z-index:80;overflow:auto}
.journey-menu-row{display:grid;grid-template-columns:17px minmax(0,1fr) 14px;gap:9px;align-items:center;width:100%;text-align:left;border:0;background:transparent;color:var(--surface-ink);box-shadow:none;border-radius:6px;padding:10px 11px}.journey-menu-row:hover,.journey-menu-row:focus-visible{background:var(--surface-hover);outline-offset:-2px}.journey-menu-row .lucide{width:16px;height:16px;color:var(--surface-muted)}.journey-menu-row strong{display:block;font-size:13px;line-height:1.5;font-weight:400}.journey-menu-row small{display:block;color:var(--surface-muted);font-size:11px;margin-top:3px}
@media(max-width:1100px){#journeys-open{width:34px;padding:0;justify-content:center}#journeys-open>span{display:none}}
@media(max-width:700px){#journeys-open{width:34px;height:39px;flex:none;pointer-events:auto;border-radius:10px;background:var(--surface);box-shadow:var(--surface-shadow);border:1px solid var(--surface-line)}#journeys-open>.lucide{width:16px;height:16px}}
@media(max-width:500px){#journeys-open{width:31px}#layers-button,#records-button,#explore-open,#ask-open,#more-open{width:31px}.atlas-actions{gap:5px}}
/* Text links underline on interaction; card and menu links keep their own row affordance. */
a[href],.source-links a,.image-credit a,.reader-source a{color:inherit;text-decoration:none;text-underline-offset:3px;text-decoration-thickness:1px}
a[href]:hover,a[href]:focus-visible,.source-links a:hover,.image-credit a:hover,.reader-source a:hover{text-decoration:underline}
.atlas-brand:hover,.source-list>a:hover,.source-list>a:focus-visible{text-decoration:none}
.text-button,.overview-toggle{ text-decoration:none!important }.text-button:hover,.overview-toggle:hover{text-decoration:underline!important;text-underline-offset:3px}
#voyage-player{display:flex;align-items:center;gap:8px;padding:10px 12px;box-sizing:border-box}#voyage-player[hidden]{display:none}#voyage-details{flex:1;min-width:0;text-align:left;font-size:13px;line-height:1.45}#voyage-details>span{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}#voyage-rate-dropdown{width:67px;flex:none}#voyage-rate-dropdown .dropdown-trigger{height:32px;font-size:12px;padding:5px 8px;gap:5px}#voyage-toggle,#voyage-exit{flex:none;width:32px;height:32px;display:grid;place-items:center;border-radius:7px}#voyage-player svg{width:16px;height:16px}
/* Keep the reading surface free of standalone method/disclaimer captions. */
.data-note,.world-data-note,.world-chart-method,.chart-coverage,.ask-disclosure,.reader-note,.reader-availability-note{display:none!important}
#detail-panel .record-source-links{padding-top:12px}#ask-form{margin-bottom:14px}
#detail-panel a.source-fact-citation{display:inline-grid;place-items:center;width:22px;height:22px;min-width:22px;min-height:22px;padding:0;margin-left:5px;box-sizing:border-box;border:1px solid var(--surface-line);border-radius:5px;line-height:1;vertical-align:middle;background:var(--surface);box-shadow:0 1px 1px #00000005;text-decoration:none}
#detail-panel a.source-fact-citation>.lucide{width:12px;height:12px;margin:0;display:block}#detail-panel a.source-fact-citation:hover{background:var(--surface-hover);text-decoration:none}#detail-panel a.source-fact-citation:focus-visible{outline-offset:2px;border-radius:5px}
#ask-stop{width:34px;height:34px;min-width:34px;min-height:34px;padding:0;border-radius:50%;display:grid;place-items:center;background:var(--button-bg);color:var(--surface-ink);border:1px solid var(--button-border);box-shadow:var(--button-shadow)}#ask-stop>.lucide{width:14px;height:14px;stroke-width:2}#ask-stop[hidden]{display:none!important}
.source-list>a:hover .source-title{text-decoration:underline;text-underline-offset:3px}
.icon-button,#search-close,#story-exit,#voyage-exit,#detail-dismiss,#layers-close,#feed-close,#world-close,#sources-close,#explore-close,#ask-close{display:inline-grid;place-items:center;flex:none;width:30px;height:30px;min-width:30px;min-height:30px;padding:0;box-sizing:border-box;aspect-ratio:1;border-radius:7px;line-height:1}
.icon-button>.lucide,#search-close>.lucide,#story-exit>.lucide,#voyage-exit>.lucide{display:block;margin:0;width:18px;height:18px;vertical-align:initial}
#ask-form .area-context-clear{display:inline-grid;place-items:center;flex:none;width:28px;height:28px;min-width:28px;min-height:28px;padding:0;aspect-ratio:1;box-sizing:border-box;border:1px solid var(--surface-line);border-radius:6px;background:var(--button-bg);line-height:1}
#ask-form .area-context-clear>span{display:grid;place-items:center;line-height:0;margin:0;padding:0}#ask-form .area-context-clear>span:empty{display:none}#ask-form .area-context-clear .lucide{display:block;width:14px;height:14px;margin:0;vertical-align:initial}
#voyage-rate-dropdown,#story-rate-dropdown{width:99px;flex:none}#story-rate-dropdown .dropdown-trigger{height:32px;font-size:12px;padding:5px 8px;gap:5px}#story-player .story-playback input{min-width:30px}
#detail-panel .source-links a{font-size:12.5px}#detail-panel .image-credit a{font-size:10.5px}#detail-panel .source-context>.image-credit a{font-size:10.5px}#detail-panel .reader-source-link{font-size:12.5px}#detail-panel .reader-provenance a{font-size:12.5px}#detail-panel .detail-related>p>a{font-size:13.5px}.chat-sources .source-title{font-size:14.5px}.answer-table .table-source{font-size:12.5px!important}
@media(min-width:701px) and (max-width:875px){#layers-button,#records-button,#explore-open{width:34px;padding:0;justify-content:center}#layers-button>span,#records-button>span,#explore-open>span{display:none}.atlas-area-tools .area-button{width:30px}.atlas-area-tools{gap:2px}}
/* One opening transition. The final transform is none, so anchored controls stay anchored. */
@keyframes archive-surface-in{from{opacity:0;transform:translateY(5px)}to{opacity:1;transform:none}}
body .panel:not([hidden]),body .atlas-popover:not([hidden]),body dialog[open]{animation:archive-surface-in .18s cubic-bezier(.2,.7,.2,1)!important}
body .dropdown-menu:not([hidden]){animation:archive-surface-in .12s ease-out!important}
#detail-panel .detail-body.content-changing{animation:record-content-in .16s ease-out!important}
body .panel.is-dragging{transition:none!important}
@media(prefers-reduced-motion:reduce){body .panel:not([hidden]),body .atlas-popover:not([hidden]),body dialog[open],body .dropdown-menu:not([hidden]),#detail-panel .detail-body.content-changing{animation:none!important}}
#time-dock.time-dock-compact .time-options-row{grid-template-columns:minmax(88px,108px) minmax(116px,140px);gap:6px}
body #search-dialog{transition:height .22s cubic-bezier(.2,.7,.2,1)!important}
#story-player input[type=range]::-moz-range-track{height:3px;border-radius:2px;background:var(--surface-line)}#story-player input[type=range]::-moz-range-thumb{width:12px;height:12px;background:var(--surface);border:2px solid #8b99a3;border-radius:50%}
@media(prefers-reduced-motion:reduce){body #search-dialog{transition:none!important}}
body.time-dock-visible #layers-panel{max-height:calc(100dvh - 92px - var(--time-dock-clearance,134px))!important;overflow-y:auto}
@media(max-width:700px){body.time-dock-visible #layers-panel{max-height:calc(100dvh - 124px - var(--time-dock-clearance,240px))!important}}

.overview-text h4{font:500 14px/1.45 Inter,sans-serif;color:var(--text);margin:20px 0 8px}.overview-text h4:first-child{margin-top:0}

body #detail-panel,body #feed-panel{transition:height .2s cubic-bezier(.2,.7,.2,1),max-height .2s cubic-bezier(.2,.7,.2,1)!important}body #detail-panel.is-dragging,body #feed-panel.is-dragging,body #detail-panel.is-resizing,body #feed-panel.is-resizing{transition:none!important}@media(prefers-reduced-motion:reduce){body #detail-panel,body #feed-panel{transition:none!important}}

/* Fact groups end cleanly; the next section owns its own boundary. */
#detail-panel .record-field:not(:has(+ .record-field)),#detail-panel .battle-field:last-child{border-bottom:0}

@font-face{font-family:"Source Serif 4";font-style:normal;font-weight:200 900;font-display:swap;src:url("./fonts/SourceSerif4Variable-Roman.woff2") format("woff2")}
#detail-panel .detail-body h2{font-family:"Source Serif 4",Georgia,serif;font-weight:500;font-size:28px;font-optical-sizing:auto;letter-spacing:-.45px;line-height:1.2;margin-bottom:18px}@media(max-width:700px){#detail-panel .detail-body h2{font-size:26px}}

#voyage-follow{flex:none;width:30px;height:30px;border:0;box-shadow:none;background:transparent;color:var(--surface-muted);border-radius:7px;display:grid;place-items:center}#voyage-follow:hover,#voyage-follow[aria-pressed=true]{background:var(--surface-hover);color:var(--surface-ink)}#voyage-follow .lucide{display:block;margin:0;width:17px;height:17px}

.dropdown-value,.dropdown-option-label{display:flex;align-items:center;gap:9px;min-width:0}.dropdown-value-text,.dropdown-option-label>span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.metric-swatch{display:block;width:19px;height:19px;flex:0 0 19px;border:1px solid #0002;border-radius:50%;box-sizing:border-box}.swatch-numeric{background:linear-gradient(135deg,#ebf1f2,#99bfcc 35%,#4b7d94 65%,#1b4159)}.swatch-borders{background:conic-gradient(#d9b8aa 0 30%,#b8c8af 30% 65%,#cbc1d0 65% 100%)}.swatch-conflict{background:radial-gradient(circle,#9e5945 0 30%,#9e594588 35% 60%,#9e594520 65%)}.swatch-outbreak{background:radial-gradient(circle,#84578c 0 30%,#84578c88 35% 60%,#84578c20 65%)}
.metric-legend-heading{display:grid;gap:4px;margin-top:14px;font:400 12px/1.45 Inter,sans-serif}.metric-legend-heading strong{font-weight:500;color:var(--surface-ink)}.metric-legend-heading span,.metric-geography{color:var(--surface-muted)}.metric-geography{display:block;font:400 11px/1.45 Inter,sans-serif;margin-top:8px}.metric-hover{display:grid;gap:4px}.metric-hover strong{font-weight:500}.metric-hover small{color:var(--surface-muted);font-size:11px}.statistics-open{display:inline-flex;align-items:center;justify-content:center;gap:6px;margin-top:10px;padding:7px 10px;border:1px solid var(--button-border);background:var(--button-bg);color:var(--surface-ink);border-radius:7px;box-shadow:var(--button-shadow);font:400 12px/1.4 Inter,sans-serif}.statistics-open .lucide{width:15px;height:15px}.statistics-open:hover{background:var(--button-hover)}
.statistics-dialog{width:min(720px,calc(100vw - 28px));max-height:calc(100dvh - 32px);overflow:auto}.statistics-dialog .panel-heading{height:58px;padding:14px 22px}.statistics-dialog .panel-heading h2{font:500 17px/1.3 Inter,sans-serif;letter-spacing:-.25px}.statistics-dialog .panel-heading h2>span{color:var(--surface-muted);font-size:13px;font-weight:400;margin-left:8px}.statistics-filters{display:grid;grid-template-columns:1fr 1fr 1fr;gap:9px;padding:18px 22px 0}.statistics-content{padding:22px}.statistics-value{display:flex;align-items:baseline;flex-wrap:wrap;gap:9px;margin:9px 0}.statistics-value strong{font:500 32px/1.25 Inter,sans-serif;letter-spacing:-.7px}.statistics-value>span,.statistics-observation{font:400 12px/1.5 Inter,sans-serif;color:var(--surface-muted)}.statistics-observation>span{margin-left:12px}.statistics-content .world-chart-range{padding:16px 0 0;gap:6px}.statistics-content .archive-chart{height:230px}.statistics-actions{display:flex;align-items:center;justify-content:space-between;margin-top:18px;gap:16px}.statistics-actions>a{font-size:12.5px}.statistics-actions>button{display:inline-flex;align-items:center;justify-content:center;gap:7px;padding:8px 11px;border:1px solid var(--button-border);border-radius:7px;background:var(--button-bg);color:var(--surface-ink);box-shadow:var(--button-shadow);font:400 13px/1.4 Inter,sans-serif}.statistics-actions>button .lucide{width:16px;height:16px}.statistics-dialog>.dropdown-menu{z-index:105}.statistics-content .chart-coverage{display:block!important;color:var(--surface-muted);font-size:11px!important;margin:10px 0!important}@media(max-width:550px){.statistics-filters{grid-template-columns:1fr 1fr;padding:16px 16px 0}#stats-compare{grid-column:1/-1}.statistics-content{padding:18px 16px}.statistics-dialog .panel-heading{padding:14px 16px}.statistics-content .archive-chart{height:190px}.statistics-value strong{font-size:28px}}

.reader-scan-date{margin:12px 0}.reader-scan{overflow:auto}.reader-scan.reader-scan-zoomed>img{width:1100px;min-width:1100px;max-width:none}.metric-legend-heading+.gradient{margin-top:9px}

body :is(strong,b){font-weight:500}#detail-panel .voyage-live>strong,#voyage-current{font-weight:450}body{font-synthesis:style}

#world-dialog .chart-span-segments{display:inline-flex;gap:2px;padding:3px;border:1px solid var(--surface-line);border-radius:9px;background:var(--surface-hover)}#world-dialog .chart-span-segments>button{display:flex;align-items:center;justify-content:center;margin:0;min-height:30px;padding:5px 10px;border:1px solid transparent;border-radius:6px;background:transparent;color:var(--surface-muted);box-shadow:none;font:400 12px/1.3 Inter,sans-serif;white-space:nowrap}#world-dialog .chart-span-segments>button:hover{color:var(--surface-ink)}#world-dialog .chart-span-segments>button[aria-pressed=true]{background:var(--surface);color:var(--surface-ink);border-color:var(--surface-line);box-shadow:0 1px 3px #00000012}

.swatch-population{background:var(--swatch-population)}
.swatch-gdp{background:var(--swatch-gdp)}
.swatch-gdpPerson{background:var(--swatch-gdpPerson)}
.swatch-life{background:var(--swatch-life)}
.swatch-deaths{background:var(--swatch-deaths)}
.swatch-mortality{background:var(--swatch-mortality)}
.swatch-infant{background:var(--swatch-infant)}
.swatch-urban{background:var(--swatch-urban)}
.swatch-fertility{background:var(--swatch-fertility)}
.swatch-birthrate{background:var(--swatch-birthrate)}
#layers-panel{display:flex;flex-direction:column;overflow:hidden!important}#layers-panel[hidden]{display:none!important}#layers-panel>.panel-heading,#layers-panel>.panel-section{flex:none}#layers-panel>.layer-list{overflow:auto;min-height:80px;flex:1;scrollbar-width:thin}

body :is(h1,h2,h3,h4,h5,h6){font-weight:500}

#world-dialog .world-chart-range .chart-span-segments{display:inline-grid;grid-template-columns:repeat(3,minmax(0,1fr));max-width:100%;box-sizing:border-box}@media(max-width:360px){#world-dialog .chart-span-segments>button{padding:5px 6px}}#story-narration[data-state=preparing] span{background:linear-gradient(90deg,var(--surface-muted) 10%,var(--surface-ink) 45%,var(--surface-muted) 80%);background-size:200% 100%;background-clip:text;-webkit-text-fill-color:transparent;animation:status-shimmer 1.6s linear infinite}

#map-labels.impact-context{opacity:.65}#plague-legend{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin:8px 0 3px;font:400 11px/1.4 Inter,sans-serif;color:var(--surface-muted)}#plague-legend[hidden]{display:none}#plague-legend>strong{font-weight:500;color:var(--surface-ink)}#plague-legend>span{display:flex;align-items:center;gap:5px}.impact-swatch,.impact-unknown{display:block;width:13px;height:13px;border:1px solid #80516d55;border-radius:3px;background:#80516d88}.impact-unknown{border-color:var(--surface-line);background:repeating-linear-gradient(135deg,transparent 0 3px,#9da6ac99 3px 4px)}#plague-legend>.icon-button{width:24px;height:24px;min-height:24px;margin-left:auto}#plague-legend>.icon-button .lucide{width:14px;height:14px}:root[data-theme=dark] .impact-swatch{background:#c4a1bc99;border-color:#c4a1bc55}

.impact-unmapped{display:block;width:13px;height:13px;border:1px solid var(--surface-line);border-radius:3px;background:#edeee8}:root[data-theme=dark] .impact-unmapped{background:#29353e}
/* Reserve the close-button slot when the sequence header wraps. */
@media(max-width:700px){#story-player .story-player-heading{padding-right:32px;box-sizing:border-box}#story-player #story-current{flex:none}}
