/* Shared atlas layout: intentionally independent of the site's article styles. */
:root {
    color-scheme: dark;
    --atlas-bg: #0b101a;
    --atlas-panel: rgba(18, 26, 38, .96);
    --atlas-border: #384252;
    --atlas-text: #f0eadb;
    --atlas-muted: #acb5c2;
    --atlas-accent: #e0be73;
    --atlas-danger: #ff9f92;
    --atlas-radius: 12px;
}
.atlas-page { margin: 0; height: 100vh; height: 100dvh; overflow: hidden; display: flex; flex-direction: column; background: var(--atlas-bg); color: var(--atlas-text); font: 14px/1.5 system-ui, sans-serif; }
.atlas-page *, .atlas-page *::before, .atlas-page *::after { box-sizing: border-box; }
.atlas-page [hidden] { display: none !important; }
.atlas-page h1, .atlas-page h2, .atlas-page h3, .atlas-page h4, .atlas-page p { margin: 0; }
.atlas-page a { color: inherit; text-decoration: none; }
.atlas-page button, .atlas-page input, .atlas-page select, .atlas-page textarea { font: inherit; }
.atlas-page button { border: 1px solid var(--atlas-border); border-radius: 7px; min-height: 38px; padding: 7px 12px; background: #202c3c; color: var(--atlas-text); cursor: pointer; }
.atlas-page button:hover { background: #304054; }
.atlas-page button:disabled { cursor: default; opacity: .45; }
.atlas-page :focus-visible { outline: 2px solid var(--atlas-accent); outline-offset: 3px; }
.atlas-page input, .atlas-page select, .atlas-page textarea { width: 100%; background: #0d1521; border: 1px solid #596576; color: var(--atlas-text); padding: 9px 11px; border-radius: 6px; }
.atlas-page input::placeholder { color: var(--atlas-muted); }
.atlas-page label { display: block; }
.atlas-skip { position: absolute; left: 12px; top: -100px; z-index: 20; background: var(--atlas-panel); padding: 10px; }
.atlas-skip:focus { top: 8px; }
.atlas-main { position: relative; flex: 1; min-height: 0; isolation: isolate; }
#stars, #map { position: absolute; inset: 0; width: 100%; height: 100%; }
#stars { pointer-events: none; }
#map { background: transparent; }
.atlas-panel { background: var(--atlas-panel); border: 1px solid var(--atlas-border); border-radius: var(--atlas-radius); box-shadow: 0 8px 30px #0003; }
.atlas-explorer { position: absolute; top: 20px; left: 20px; width: 290px; display: flex; flex-direction: column; gap: 12px; max-height: calc(100% - 86px); overflow: auto; scrollbar-width: thin; }
.atlas-search { padding: 18px; }
.atlas-eyebrow { text-transform: uppercase; letter-spacing: .16em; font-size: 10px; color: var(--atlas-accent); }
.atlas-search h1 { font: 25px/1.2 Georgia, serif; margin: 8px 0 20px; }
.atlas-search label { font-size: 12px; margin-bottom: 6px; color: var(--atlas-muted); }
.atlas-search-field { display: flex; gap: 6px; }
.atlas-search-field input { min-width: 0; font-size: 13px; }
.atlas-search-field button { font-size: 24px; padding: 0; flex: 0 0 38px; }
.atlas-muted { color: var(--atlas-muted); font-size: 12px; }
#search-status { margin-top: 12px; }
#city-results { padding: 0; list-style: none; margin: 8px 0 0; max-height: 230px; overflow: auto; }
.atlas-page .city-result { width: 100%; text-align: left; margin-top: 5px; }
.city-result small { display: block; color: var(--atlas-muted); font-size: 11px; }
#legend { width: 290px; }
.atlas-editor #legend { position: absolute; top: 20px; left: 20px; max-height: calc(100% - 70px); overflow: auto; }
#legend summary { cursor: pointer; padding: 13px 16px; color: var(--atlas-text); font-weight: 600; }
.legend-content { padding: 0 16px 16px; }
.map-layer-controls { display: grid; gap: 5px; border-bottom: 1px solid var(--atlas-border); margin-bottom: 12px; padding-bottom: 12px; }
.map-layer-controls label { display: flex; gap: 10px; align-items: center; min-height: 32px; font-size: 13px; cursor: pointer; }
.atlas-page input[type="checkbox"] { width: 16px; height: 16px; margin: 0; accent-color: var(--atlas-accent); }
.legend-nations h3, .legend-content h3, .legend-content h4 { font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: var(--atlas-muted); margin: 8px 0; }
.legend-item { display: flex; align-items: center; gap: 9px; padding: 3px 0; font-size: 12px; }
.legend-swatch { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; border: 1px solid #ffffff30; }
.atlas-tools { position: absolute; bottom: 30px; right: 20px; display: flex; gap: 8px; }
.atlas-tools button { background: var(--atlas-panel); box-shadow: 0 4px 15px #0003; }
.atlas-status { position: absolute; top: 20px; left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100% - 110px); background: var(--atlas-panel); padding: 12px 16px; border: 1px solid var(--atlas-border); border-radius: 8px; box-shadow: 0 4px 15px #0004; z-index: 3; }
.atlas-status[data-state="error"] { color: var(--atlas-danger); }
.atlas-status button { margin-left: 10px; }
.atlas-toast { position: absolute; bottom: 85px; right: 20px; max-width: min(330px, calc(100% - 40px)); background: var(--atlas-panel); border: 1px solid var(--atlas-accent); border-radius: 8px; padding: 10px 16px; z-index: 4; }
.atlas-page .maplibregl-ctrl-top-right { top: 10px; right: 10px; }
.atlas-page .maplibregl-ctrl-group { border: 1px solid var(--atlas-border); border-radius: 8px; overflow: hidden; }
.atlas-page .maplibregl-ctrl-group button { background: var(--atlas-panel); border: 0; border-radius: 0; width: 40px; height: 40px; padding: 0; }
.atlas-page .maplibregl-ctrl-group button + button { border-top: 1px solid var(--atlas-border); }
.atlas-page .maplibregl-ctrl-icon { filter: invert(.85); }
.atlas-page .maplibregl-ctrl-scale { background: var(--atlas-panel); border-color: var(--atlas-accent); color: var(--atlas-text); font: 11px/1.5 system-ui, sans-serif; padding: 2px 6px; border-radius: 2px; }
.atlas-page .maplibregl-popup-content { background: #162231; color: var(--atlas-text); border: 1px solid var(--atlas-border); border-radius: 10px; padding: 16px 30px 16px 16px; font: 13px/1.5 system-ui, sans-serif; min-width: 180px; }
.atlas-page .maplibregl-popup-tip { border-top-color: #162231; border-bottom-color: #162231; }
.atlas-page .maplibregl-popup-close-button { width: 28px; min-height: 28px; background: transparent; border: 0; padding: 0; font-size: 20px; }
.atlas-feature-title { font: 20px/1.2 Georgia, serif; margin-bottom: 7px !important; }
.atlas-feature-kind { text-transform: uppercase; letter-spacing: .12em; font-size: 10px; color: var(--atlas-accent); margin-bottom: 8px !important; }
.atlas-feature-coordinates { color: var(--atlas-muted); font-size: 11px; margin-top: 9px !important; }
.measure-btn.active { color: var(--atlas-accent); background: #423921 !important; }
.measure-panel { position: absolute; top: 20px; right: 72px; width: 260px; padding: 16px; border-radius: var(--atlas-radius); border: 1px solid var(--atlas-border); background: var(--atlas-panel); color: var(--atlas-text); box-shadow: 0 8px 30px #0003; pointer-events: auto; z-index: 3; }
.measure-panel-heading { font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.measure-status { color: var(--atlas-accent); font-size: 20px; margin-bottom: 6px !important; }
.measure-hint { font-size: 12px; color: var(--atlas-muted); }
.measure-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.map-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.atlas-page .measure-marker { width: 32px; height: 32px; min-height: 32px; padding: 0; border: 2px solid #f3d38d; border-radius: 50%; background: #172331; color: #f3d38d; font-weight: bold; box-shadow: 0 2px 8px #0008; cursor: grab; }
@media (max-width: 640px) {
    .atlas-explorer { top: 12px; left: 12px; width: calc(100% - 84px); max-width: 290px; max-height: calc(100% - 100px); gap: 8px; }
    .atlas-search { padding: 12px; }
    .atlas-search h1 { display: none; }
    .atlas-eyebrow { margin-bottom: 10px !important; }
    .atlas-search label { display: none; }
    #search-status { margin-top: 8px; font-size: 11px; }
    #legend { width: 100%; }
    #legend summary { padding: 10px 12px; }
    .legend-content { padding: 0 12px 12px; }
    .atlas-editor #legend { top: 12px; left: 12px; width: calc(100% - 84px); max-width: 290px; max-height: max(50px, calc(100% - var(--editor-panel-height, 350px) - 60px)); }
    .atlas-tools { right: 12px; bottom: 32px; gap: 6px; }
    .atlas-tools button { font-size: 12px; padding: 7px 10px; }
    .atlas-status { top: auto; bottom: 90px; left: 12px; transform: none; max-width: calc(100% - 24px); width: auto; font-size: 12px; }
    .atlas-toast { right: 12px; bottom: 85px; }
    .measure-panel { top: auto; bottom: 90px; right: 12px; width: calc(100% - 24px); max-width: 300px; }
    .atlas-page .maplibregl-ctrl-top-right { top: 2px; right: 2px; }
}
@media (max-height: 500px) and (min-width: 641px) { .atlas-search h1 { display: none; } .atlas-search { padding: 12px; } .atlas-search .atlas-eyebrow { margin-bottom: 10px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; } }
