/* Selection, inspector and date controls share layout space in every view. */
#stage{--date-height:230px;--inspector-width:350px;--inspector-height:0px}
#stage #timeDock{display:block;height:auto;min-height:0;padding:8px 16px 12px}
#stage #timeDock.collapsed{padding:4px 14px}
.dates-toggle{width:100%;display:flex;justify-content:space-between;align-items:center;gap:12px;background:transparent;border:0;min-height:36px;padding:3px 0;text-align:left;color:#cbdbe9}
#compactPeriod{font-weight:650;color:#5de3ce}.dates-toggle:focus-visible{outline:2px solid #5de3ce}
#dateControls[hidden]{display:none!important}
#stage #mapPanel,#stage #frescoPanel,#stage #voyagePanel,#stage #discoverPanel,#stage #graphPanel{bottom:var(--date-height)}
#stage .map-controls{bottom:calc(var(--date-height) + 28px)}
#stage .atlas-caption{bottom:calc(var(--date-height) + 12px)}
#stage #reader{top:12px;bottom:calc(var(--date-height) + 10px);right:12px;width:var(--inspector-width);max-width:calc(100% - 24px);overflow:auto;border:1px solid #3b566c;z-index:450}
#stage.selection-open:not(.graph-mode):not(.voyage-mode):not(.discover-mode) #mapPanel{right:calc(var(--inspector-width) + 24px)}
#stage.selection-open .map-controls{right:calc(var(--inspector-width) + 38px)}
#stage.selection-open .explore-top{right:calc(var(--inspector-width) + 38px)}
.selection-toggle{position:absolute;right:16px;top:8px;z-index:460;min-height:38px;background:#142c40;border:1px solid #567388;border-radius:7px;padding:7px 12px}
#stage.selection-open .selection-toggle{right:calc(var(--inspector-width) + 38px)}
.selection-toolbar{display:flex;justify-content:space-between;position:sticky;top:0;background:#122337;z-index:2;padding:8px 12px;border-bottom:1px solid #2c465d}
.selection-toolbar button{background:transparent;border:1px solid #3e6077;border-radius:6px;min-height:36px;padding:5px 10px}.selection-toolbar #closeReader{margin-left:auto;font-size:22px;min-width:40px}
#selectionContext{padding:14px 18px 10px;border-bottom:1px solid #2c465d}#selectionContext h2{font-size:22px;margin:5px 0}.selection-period{color:#6de0cc;font-weight:600;margin:5px 0}.selection-filters{font-size:12px;line-height:1.5;color:#b5c9db;margin:7px 0 0}
#selectionSummary{padding:12px 16px 20px}.selection-count{font-size:13px;color:#a8c0d1}.selection-result{display:block;width:100%;text-align:left;background:#162d42;border:1px solid #355269;border-radius:7px;margin:7px 0;padding:11px}.selection-result small{display:block;color:#94b5ce;font-size:12px}.selection-result strong{display:block;font-size:14px;margin-top:5px}.selection-notice{font-size:12px;color:#c0d6e4}.selection-results{min-width:0}.selection-results strong{overflow-wrap:anywhere}
#selectionMore,#retrySelection{min-height:40px;border:1px solid #48718a;background:#1b3a50;border-radius:6px;padding:8px 14px;width:100%}
.fresco-empty-state{padding:24px;color:#bdd0e1}.graph-mode #reader{bottom:calc(var(--date-height) + 10px)}
@media(max-width:780px){
 #stage{--inspector-width:calc(100% - 16px);--inspector-height:min(38%,260px)}
 #stage #timeDock{padding:4px 10px 8px}.dates-toggle{min-height:40px;font-size:12px}#dateControls .dock-period{flex-wrap:wrap;gap:5px}#dateControls .dock-top{gap:5px}.manual-dates input{width:92px}
 #stage #reader{left:8px;right:8px;width:auto;top:auto;height:var(--inspector-height);bottom:calc(var(--date-height) + 8px);max-height:calc(100% - var(--date-height) - 65px)}
 #stage.selection-open:not(.graph-mode):not(.voyage-mode):not(.discover-mode) #mapPanel{right:0;bottom:calc(var(--date-height) + var(--inspector-height) + 16px)}
 #stage.selection-open .explore-top{right:10px;top:52px}.selection-toggle,#stage.selection-open .selection-toggle{right:10px;top:8px;min-height:40px}
 #stage.selection-open .map-controls{right:10px;bottom:calc(var(--date-height) + var(--inspector-height) + 24px)}
 #stage.selection-open .atlas-caption{display:none}.selection-toolbar{padding:4px 9px}#selectionContext{padding:8px 12px}#selectionContext h2{font-size:18px}#selectionSummary{padding:8px 12px}.selection-toolbar button,.selection-result{min-height:40px}
 #stage #readerBody{padding:15px}.sidebar{z-index:500}.sidebar .sidebar-heading{min-height:44px}#closeFilters,#toggleFilters{min-width:40px;min-height:40px}
}

#stage[data-mode="map"] .explore-top{top:58px}
.map-pick-controls{position:absolute;left:14px;top:8px;z-index:440;background:#102538ee;border:1px solid #476276;border-radius:7px;padding:5px 9px;font-size:11px;color:#a9c3d6}.map-pick-controls select{display:block;max-width:175px;min-height:30px;background:#102538;color:#edf6ff;border:0;font-size:13px}
@media(max-width:780px){.map-pick-controls{left:8px;max-width:165px}.map-pick-controls select{max-width:145px;min-height:34px}.selection-toggle{max-width:175px;font-size:12px}}

.result-pages{display:flex;align-items:center;gap:10px;justify-content:space-between;padding-bottom:8px;font-size:12px}.result-pages[hidden]{display:none}.result-pages button{padding:5px 9px;min-height:32px;background:#183044;color:#e7f2fa;border:1px solid #486479;border-radius:6px;cursor:pointer}.result-pages button:disabled{opacity:.4;cursor:default}.result-pages button:focus-visible{outline:2px solid #5de3ce;outline-offset:2px}.result-pages span{text-align:center}@media(max-width:780px){.result-pages{gap:4px;font-size:11px}.result-pages button{font-size:11px;padding:4px}}

/* Paging belongs to the results list, including on small screens. */
.reader .result-pages{position:static;display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px;margin:16px 0 4px;padding:10px 0;border-top:1px solid #263449;}
.reader .result-pages[hidden]{display:none;}
.reader .result-pages span{font-size:12px;white-space:nowrap;}
.reader .result-pages button{font-size:12px;padding:7px 9px;}

.time-distribution-status{display:block;font-size:11px;color:#afbdcc;}.time-distribution-status:empty{display:none;}
