/**
 * @file        sg-atlas.css
 * @description Styles of the atlas module: color modes and legend, time slider, city dots and regions, country panel blocks, world map routes and pins, route replay, poster dialog, map style cards, globe switch (V6-01 to V6-09, V6-11, D6-01, D6-02)
 *
 * @author      Thomas Dobler - SYNTHETIXMIND LTD
 * @company     SYNTHETIXMIND LTD, Paphos, Cyprus
 * @url         https://synthetixmind.com
 *
 * @uid         443cf81c-796e-4095-b4b9-9d3b607b13bb
 * @version     0.3.0.3
 * @created     2026-12-01
 * @updated     2026-12-04
 *
 * @copyright   (c) 2026 by SYNTHETIXMIND LTD
 * @license     Proprietary — All rights reserved
 */

/* Elements sg-atlas.js reveals stay hidden without it, whatever display their button class sets. */
.sg-atlas-tools [hidden], .sg-atlas-replay [hidden], .sg-atlas-globe [hidden], .sg-atlas-intro[hidden], .sg-atlas-intro [hidden] { display: none !important; }

/* Color modes (FR-602): the sequential scale s0..s7 and trip swatches t0..t11 match SG_ATLAS_SCALE_HEX and SG_ATLAS_TRIP_HEX in atlas.php. */
.sg-world .sg-c.sg-c--visited.sg-atlas-s0 { fill: #F3D9C8; stroke: #6B2D19; }
.sg-atlas-sw-s0 { background: #F3D9C8; border-color: #6B2D19; }
.sg-world .sg-c.sg-c--visited.sg-atlas-s1 { fill: #EBC0A5; stroke: #6B2D19; }
.sg-atlas-sw-s1 { background: #EBC0A5; border-color: #6B2D19; }
.sg-world .sg-c.sg-c--visited.sg-atlas-s2 { fill: #E0A27F; stroke: #6B2D19; }
.sg-atlas-sw-s2 { background: #E0A27F; border-color: #6B2D19; }
.sg-world .sg-c.sg-c--visited.sg-atlas-s3 { fill: #D2845C; stroke: #6B2D19; }
.sg-atlas-sw-s3 { background: #D2845C; border-color: #6B2D19; }
.sg-world .sg-c.sg-c--visited.sg-atlas-s4 { fill: #BC6640; stroke: #6B2D19; }
.sg-atlas-sw-s4 { background: #BC6640; border-color: #6B2D19; }
.sg-world .sg-c.sg-c--visited.sg-atlas-s5 { fill: #A0502F; stroke: #6B2D19; }
.sg-atlas-sw-s5 { background: #A0502F; border-color: #6B2D19; }
.sg-world .sg-c.sg-c--visited.sg-atlas-s6 { fill: #7F3D23; stroke: #6B2D19; }
.sg-atlas-sw-s6 { background: #7F3D23; border-color: #6B2D19; }
.sg-world .sg-c.sg-c--visited.sg-atlas-s7 { fill: #5C2A17; stroke: #6B2D19; }
.sg-atlas-sw-s7 { background: #5C2A17; border-color: #6B2D19; }
.sg-world .sg-c.sg-c--visited.sg-atlas-t0 { fill: #5A6FA8; stroke: var(--surface); }
.sg-atlas-sw-t0 { background: #5A6FA8; border-color: #5A6FA8; }
.sg-atlas-st-t0 { stroke: #5A6FA8; fill: #5A6FA8; }
.sg-world .sg-c.sg-c--visited.sg-atlas-t1 { fill: #2F6F8F; stroke: var(--surface); }
.sg-atlas-sw-t1 { background: #2F6F8F; border-color: #2F6F8F; }
.sg-atlas-st-t1 { stroke: #2F6F8F; fill: #2F6F8F; }
.sg-world .sg-c.sg-c--visited.sg-atlas-t2 { fill: #4E9A6B; stroke: var(--surface); }
.sg-atlas-sw-t2 { background: #4E9A6B; border-color: #4E9A6B; }
.sg-atlas-st-t2 { stroke: #4E9A6B; fill: #4E9A6B; }
.sg-world .sg-c.sg-c--visited.sg-atlas-t3 { fill: #8A6FB0; stroke: var(--surface); }
.sg-atlas-sw-t3 { background: #8A6FB0; border-color: #8A6FB0; }
.sg-atlas-st-t3 { stroke: #8A6FB0; fill: #8A6FB0; }
.sg-world .sg-c.sg-c--visited.sg-atlas-t4 { fill: #C08A2E; stroke: var(--surface); }
.sg-atlas-sw-t4 { background: #C08A2E; border-color: #C08A2E; }
.sg-atlas-st-t4 { stroke: #C08A2E; fill: #C08A2E; }
.sg-world .sg-c.sg-c--visited.sg-atlas-t5 { fill: #6B2D19; stroke: var(--surface); }
.sg-atlas-sw-t5 { background: #6B2D19; border-color: #6B2D19; }
.sg-atlas-st-t5 { stroke: #6B2D19; fill: #6B2D19; }
.sg-world .sg-c.sg-c--visited.sg-atlas-t6 { fill: #3E7C7A; stroke: var(--surface); }
.sg-atlas-sw-t6 { background: #3E7C7A; border-color: #3E7C7A; }
.sg-atlas-st-t6 { stroke: #3E7C7A; fill: #3E7C7A; }
.sg-world .sg-c.sg-c--visited.sg-atlas-t7 { fill: #9C4F6B; stroke: var(--surface); }
.sg-atlas-sw-t7 { background: #9C4F6B; border-color: #9C4F6B; }
.sg-atlas-st-t7 { stroke: #9C4F6B; fill: #9C4F6B; }
.sg-world .sg-c.sg-c--visited.sg-atlas-t8 { fill: #5B6B78; stroke: var(--surface); }
.sg-atlas-sw-t8 { background: #5B6B78; border-color: #5B6B78; }
.sg-atlas-st-t8 { stroke: #5B6B78; fill: #5B6B78; }
.sg-world .sg-c.sg-c--visited.sg-atlas-t9 { fill: #A0522D; stroke: var(--surface); }
.sg-atlas-sw-t9 { background: #A0522D; border-color: #A0522D; }
.sg-atlas-st-t9 { stroke: #A0522D; fill: #A0522D; }
.sg-world .sg-c.sg-c--visited.sg-atlas-t10 { fill: #2E5A3C; stroke: var(--surface); }
.sg-atlas-sw-t10 { background: #2E5A3C; border-color: #2E5A3C; }
.sg-atlas-st-t10 { stroke: #2E5A3C; fill: #2E5A3C; }
.sg-world .sg-c.sg-c--visited.sg-atlas-t11 { fill: #7A5C3E; stroke: var(--surface); }
.sg-atlas-sw-t11 { background: #7A5C3E; border-color: #7A5C3E; }
.sg-atlas-st-t11 { stroke: #7A5C3E; fill: #7A5C3E; }
.sg-world .sg-c.sg-c--visited.sg-atlas-tx { fill: #B8C0C7; stroke: var(--border-strong); }
.sg-atlas-sw-tx { background: #B8C0C7; border-color: #8A949D; }
.sg-atlas-st-tx { stroke: #8A949D; fill: #8A949D; }
.sg-atlas-sw-visited { background: repeating-linear-gradient(45deg, #6B2D19 0 3px, #8A4A33 3px 5px); border-color: #6B2D19; }

/* Time slider (FR-605): later countries stay in the drawing and look unvisited. */
.sg-world .sg-c.sg-c--visited.sg-atlas-later, .sg-world .sg-c.sg-c--new.sg-atlas-later { fill: var(--bg); stroke: var(--border-strong); }
.sg-atlas-cities .sg-atlas-later { display: none; }
.sg-atlas-time input[type="range"] { width: 100%; min-height: 44px; accent-color: var(--mahogany); }
.sg-atlas-time--live [data-atlas-time-submit] { display: none; }

/* Controls and legend (V6-03). */
.sg-atlas-tools { margin-top: 12px; display: grid; gap: 8px; }
.sg-atlas-controls, .sg-atlas-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 16px; }
.sg-atlas-controls .sg-field, .sg-atlas-filters .sg-field { margin: 0; min-width: 0; flex: 1 1 160px; }
.sg-atlas-controls select, .sg-atlas-filters select { width: 100%; }
.sg-atlas-auto .sg-atlas-controls > button, .sg-atlas-auto > button { display: none; }
.sg-atlas-legend summary { cursor: pointer; font-size: 0.85rem; color: var(--ink-muted); min-height: 44px; display: flex; align-items: center; }
.sg-atlas-legend .sg-legend { margin-top: 0; }
.sg-atlas-links { flex-wrap: wrap; }

/* City dots and clusters (FR-601). */
.sg-atlas-city { fill: var(--accent); stroke: var(--surface); stroke-width: 0.6; }
.sg-atlas-cluster circle { fill: var(--accent); stroke: var(--surface); stroke-width: 0.8; }
.sg-atlas-cluster text { fill: #fff; font: 600 5px var(--font-mono); pointer-events: none; }

/* Regions in the country panel (FR-600). */
.sg-atlas-panel-block { margin-top: 16px; }
.sg-atlas-panel-block progress { width: 100%; height: 8px; accent-color: var(--mahogany); }
.sg-atlas-chip { margin: 0 0 4px; font-family: var(--font-mono); }
.sg-atlas-regions { width: 100%; height: auto; max-height: 260px; margin: 8px 0; display: block; }
.sg-atlas-region { fill: var(--bg); stroke: var(--border-strong); stroke-width: 0.05; vector-effect: non-scaling-stroke; }
.sg-atlas-region--visited { fill: #A0502F; stroke: #6B2D19; }
.sg-atlas-regions-list, .sg-atlas-cities-list { overflow-wrap: anywhere; }

/* World map of all trips (FR-608). */
.sg-atlas-world { display: grid; gap: 16px; }
.sg-atlas-world-head { margin: 16px 0 8px; overflow-wrap: anywhere; }
.sg-atlas-world-head h1 { margin: 0; }
@media (min-width: 1024px) { .sg-atlas-world--list { grid-template-columns: 1fr 280px; } }
.sg-world .sg-c.sg-atlas-world-visited { fill: var(--beige); }
.sg-atlas-route { fill: none; stroke-width: 1.2; stroke-linecap: round; stroke-linejoin: round; }
.sg-atlas-pin { stroke: var(--surface); stroke-width: 0.6; }
.sg-atlas-trip-list li { display: flex; align-items: center; gap: 8px; overflow-wrap: anywhere; }
.sg-atlas-profile-world { margin-top: 16px; }

/* Route replay (FR-607). */
.sg-atlas-replay { margin-top: 12px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); padding: 8px 12px; }
.sg-atlas-replay__bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.sg-atlas-replay__map { width: 100%; height: auto; display: block; }
.sg-atlas-replay__leg { stroke: var(--ink); stroke-width: 3; stroke-dasharray: 6 4; }
.sg-atlas-replay__step circle { fill: var(--warm-ink); stroke: var(--surface); stroke-width: 1.5; }
.sg-atlas-replay__step text { fill: var(--surface); font: 600 12px var(--font-mono); pointer-events: none; }
.sg-atlas-replay__step.is-current circle { fill: var(--orange); }
.sg-atlas-replay__step.is-current text { fill: var(--on-orange); }
.sg-atlas-replay .is-pending { opacity: 0; }
.sg-atlas-replay .is-shown { transition: opacity 150ms ease-out; }
@media (prefers-reduced-motion: reduce) { .sg-atlas-replay .is-shown { transition: none; } }
html[data-reduce-motion="1"] .sg-atlas-replay .is-shown { transition: none; }
.sg-atlas-style-note { margin-top: 8px; }

/* Poster dialog (V6-07). */
.sg-atlas-poster { display: grid; gap: 16px; }
@media (min-width: 1000px) { .sg-atlas-poster { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; } }
.sg-atlas-poster-preview { margin: 0; }
.sg-atlas-poster-form .sg-field input, .sg-atlas-poster-form .sg-field select { width: 100%; }
.sg-atlas-poster-svg { width: 100%; height: auto; display: block; border: 1px solid var(--border); border-radius: var(--radius); }

/* Map style cards (V6-11) and the admin forms (D6-02). */
.sg-atlas-styles { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 640px) { .sg-atlas-styles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.sg-atlas-style input { position: absolute; opacity: 0; }
.sg-atlas-style label { display: grid; gap: 6px; padding: 6px; border: 1px solid var(--border); border-radius: var(--radius-lg); cursor: pointer; min-height: 44px; background: var(--surface); }
.sg-atlas-style input:checked + label { border: 2px solid var(--atlas-sel); padding: 5px; }
.sg-atlas-style input:focus-visible + label { outline: 2px solid var(--focus); outline-offset: 2px; }
.sg-atlas-style input:disabled + label { opacity: 0.6; cursor: not-allowed; }
/* Thumbnails: background, land, border and route colors per style, as in the V6-11 mockup. */
.sg-atlas-style__media { position: relative; display: block; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.sg-atlas-style__thumb { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; }
.sg-atlas-thumb__land { stroke-width: 1.2; }
.sg-atlas-thumb__route, .sg-atlas-thumb__contour { fill: none; stroke-linecap: round; }
.sg-atlas-thumb__route { stroke-width: 2.5; }
.sg-atlas-thumb__contour { stroke: #B8C5B6; stroke-width: 0.8; }
.sg-atlas-style__thumb--light .sg-atlas-thumb__bg { fill: #EBF0F4; } .sg-atlas-style__thumb--light .sg-atlas-thumb__land { fill: #FBFCFF; stroke: #DFE3E7; } .sg-atlas-style__thumb--light .sg-atlas-thumb__route { stroke: #FA5800; }
.sg-atlas-style__thumb--dark .sg-atlas-thumb__bg { fill: #16232C; } .sg-atlas-style__thumb--dark .sg-atlas-thumb__land { fill: #22323D; stroke: #394955; } .sg-atlas-style__thumb--dark .sg-atlas-thumb__route { stroke: #FF8C5F; }
.sg-atlas-style__thumb--brand .sg-atlas-thumb__bg { fill: #EADDD3; } .sg-atlas-style__thumb--brand .sg-atlas-thumb__land { fill: #F2F4F6; stroke: #D1C4BB; } .sg-atlas-style__thumb--brand .sg-atlas-thumb__route { stroke: #6B2D19; }
.sg-atlas-style__thumb--terrain .sg-atlas-thumb__bg { fill: #DDE5DC; } .sg-atlas-style__thumb--terrain .sg-atlas-thumb__land { fill: #F3F5EE; stroke: #B8C5B6; } .sg-atlas-style__thumb--terrain .sg-atlas-thumb__route { stroke: #A83900; }
.sg-atlas-style__thumb--satellite .sg-atlas-thumb__bg { fill: #1C2C37; } .sg-atlas-style__thumb--satellite .sg-atlas-thumb__land { fill: #354A42; stroke: #50606D; } .sg-atlas-style__thumb--satellite .sg-atlas-thumb__route { stroke: #FA5800; }
.sg-atlas-style__check, .sg-atlas-style__lock { position: absolute; top: 6px; right: 6px; display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; background: var(--atlas-sel); color: var(--atlas-sel-ink); }
.sg-atlas-style__check { width: 22px; height: 22px; visibility: hidden; }
.sg-atlas-style__check .sg-icon, .sg-atlas-style__lock .sg-icon { width: 14px; height: 14px; }
.sg-atlas-style__lock { width: 24px; height: 24px; }
.sg-atlas-style input:checked + label .sg-atlas-style__check { visibility: visible; }
.sg-atlas-style__name { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 0 4px; }
.sg-atlas-style label .sg-hint { padding: 0 4px; overflow-wrap: anywhere; }
/* D6-01, D6-02 admin pages: page head with lead, count chip and navy action, on/off switches, style source cards. */
.sg-atlas-admin__head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: 0 0 8px; }
.sg-atlas-admin__lead { flex: 1 1 260px; margin: 0; color: var(--ink-muted); }
.sg-atlas-admin__count { margin: 0; }
.sg-atlas-button--navy { background: var(--atlas-sel); border-color: var(--atlas-sel); color: var(--atlas-sel-ink); }
.sg-atlas-button--navy[disabled] { background: var(--bg); border-color: var(--border); color: var(--ink-muted); cursor: not-allowed; }
.sg-atlas-admin__missing { color: var(--atlas-warn); font-weight: 600; }
.sg-atlas-admin__row--missing { background: color-mix(in srgb, #EADDD3 35%, transparent); }
.sg-atlas-onoff { position: relative; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0; border: 0; background: none; color: var(--ink); font: inherit; font-size: 0.875rem; cursor: pointer; }
.sg-atlas-onoff[disabled], .sg-atlas-onoff:has(input:disabled) { color: var(--ink-muted); cursor: not-allowed; }
.sg-atlas-onoff--check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.sg-atlas-onoff__track { display: inline-flex; align-items: center; flex: none; width: 44px; height: 24px; padding: 2px; border: 1px solid var(--border-strong); border-radius: 999px; background: var(--bg); }
.sg-atlas-onoff__knob { width: 18px; height: 18px; border-radius: 50%; background: var(--ink-muted); transition: transform 0.15s ease; }
.sg-atlas-onoff[aria-checked="true"] .sg-atlas-onoff__track, .sg-atlas-onoff--check input:checked + .sg-atlas-onoff__track { background: var(--atlas-sel); border-color: var(--atlas-sel); }
.sg-atlas-onoff[aria-checked="true"] .sg-atlas-onoff__knob, .sg-atlas-onoff--check input:checked + .sg-atlas-onoff__track .sg-atlas-onoff__knob { background: var(--atlas-sel-ink); transform: translateX(20px); }
.sg-atlas-onoff:focus-visible { outline: none; }
.sg-atlas-onoff:focus-visible .sg-atlas-onoff__track, .sg-atlas-onoff--check input:focus-visible + .sg-atlas-onoff__track { outline: 2px solid var(--focus); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .sg-atlas-onoff__knob { transition: none; } }
/* Below 640 px the region table becomes one block per country with the column name in front of each value. */
@media (max-width: 639px) {
  .sg-atlas-admin-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .sg-atlas-admin-table .sg-table, .sg-atlas-admin-table tbody, .sg-atlas-admin-table tr, .sg-atlas-admin-table .sg-table td { display: block; width: 100%; }
  .sg-atlas-admin-table tr { padding: 8px 0; border-bottom: 1px solid var(--border); }
  /* Two classes win over the base .sg-table td rule (left text, bottom border) whatever order the sheets load in. */
  .sg-atlas-admin-table .sg-table td { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 4px 8px; border: 0; text-align: right; overflow-wrap: anywhere; }
  .sg-atlas-admin-table td::before { content: attr(data-label); flex: none; max-width: 45%; color: var(--ink-muted); text-align: left; }
}
.sg-atlas-style-grid { display: grid; gap: 16px; margin-bottom: 16px; }
.sg-atlas-style-admin { display: grid; gap: 12px; min-width: 0; }
.sg-atlas-style-admin input:not([type="checkbox"]) { width: 100%; }
.sg-atlas-style-admin__head { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 12px; }
.sg-atlas-style-admin__swatch { width: 36px; height: 36px; flex: none; border: 1px solid var(--border-strong); border-radius: var(--radius); }
.sg-atlas-style-admin__swatch--light { background: #EBF0F4; box-shadow: inset 0 -5px 0 #FA5800; }
.sg-atlas-style-admin__swatch--dark { background: #16232C; box-shadow: inset 0 -5px 0 #FF8C5F; }
.sg-atlas-style-admin__swatch--brand { background: #EADDD3; box-shadow: inset 0 -5px 0 #6B2D19; }
.sg-atlas-style-admin__swatch--terrain { background: #DDE5DC; box-shadow: inset 0 -5px 0 #A83900; }
.sg-atlas-style-admin__swatch--satellite { background: #354A42; box-shadow: inset 0 -5px 0 #FA5800; }
.sg-atlas-style-admin__name { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; flex: 1 1 180px; min-width: 0; }
.sg-atlas-style-admin__name h2 { margin: 0; font-size: 1.15rem; }
.sg-atlas-style-admin__name .sg-hint { flex-basis: 100%; margin: 0; }
.sg-atlas-style-admin__controls { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.sg-atlas-style-admin__fields { display: grid; gap: 0 12px; }
@media (min-width: 640px) { .sg-atlas-style-admin__fields { grid-template-columns: minmax(0, 6fr) minmax(0, 4fr) minmax(0, 2fr); } }
.sg-atlas-style-admin__foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; padding-top: 12px; border-top: 1px solid var(--border); }
.sg-atlas-style-admin__state { margin: 0; font-size: 0.8rem; color: var(--ink-muted); overflow-wrap: anywhere; }
.sg-atlas-style-admin--failed .sg-atlas-style-admin__state, .sg-atlas-tag--failed { color: var(--atlas-warn); border-color: currentColor; }
.sg-atlas-tag--ok { color: var(--ink); border-color: var(--border-strong); }
.sg-atlas-style-admin .sg-atlas-card__head h2 { margin: 0; }

/* Globe (V6-04, V6-05). */
.sg-atlas-globe__map, .sg-atlas-intro__map { width: 100%; aspect-ratio: 1 / 1; max-height: 70vh; border-radius: var(--radius-lg); overflow: hidden; }
.sg-atlas-intro { position: relative; margin-bottom: 8px; }
.sg-atlas-intro [data-atlas-intro-skip] { position: absolute; right: 8px; bottom: 8px; }

/* Phase 6 mockup pass (2026-12-04): shared pieces of the V6 views. Selected states use navy with white text; the dark
   theme turns them into light chips with dark text, because navy on the dark surface would hardly show. */
:root { --atlas-sel: #1C2C37; --atlas-sel-ink: #FBFCFF; --atlas-warn: #6B2D19; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --atlas-sel: #F2F4F6; --atlas-sel-ink: #14212A; --atlas-warn: #FF8C5F; } }
:root[data-theme="dark"] { --atlas-sel: #F2F4F6; --atlas-sel-ink: #14212A; --atlas-warn: #FF8C5F; }
.sg-atlas-icon { flex: none; vertical-align: middle; }
.sg-button .sg-atlas-icon, .sg-link-button .sg-atlas-icon { width: 18px; height: 18px; margin-right: 6px; }
.sg-atlas-eyebrow { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-muted); }
.sg-atlas-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 12px 16px; min-width: 0; }
.sg-atlas-card__head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; color: var(--ink); }
.sg-atlas-card__title { margin: 0; font-size: 1rem; }
.sg-atlas-card__figure { margin: 0 0 0 auto; font-family: var(--font-mono); font-size: 0.85rem; color: var(--ink-muted); overflow-wrap: anywhere; }
.sg-atlas-tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg); font-size: 0.78rem; color: var(--ink-muted); }
.sg-atlas-tag .sg-atlas-icon { width: 14px; height: 14px; }
.sg-atlas-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.sg-atlas-count { display: inline-flex; min-width: 20px; height: 20px; padding: 0 6px; align-items: center; justify-content: center; border-radius: 999px; background: var(--atlas-sel); color: var(--atlas-sel-ink); font: 600 0.72rem var(--font-mono); }
.sg-atlas-pill { display: inline-flex; align-items: center; gap: 6px; margin: 0; padding: 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); font-size: 0.85rem; color: var(--ink-muted); max-width: 100%; }
.sg-atlas-chip--map { display: inline-block; padding: 2px 8px; border-radius: var(--radius-sm); background: var(--atlas-sel); color: var(--atlas-sel-ink); font-size: 0.8rem; justify-self: start; }
.sg-atlas-banner { display: flex; align-items: flex-start; gap: 10px; flex-wrap: wrap; padding: 12px 16px; margin: 0 0 16px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
.sg-atlas-banner > div { flex: 1 1 200px; min-width: 0; }
.sg-atlas-banner p { margin: 0; overflow-wrap: anywhere; }
.sg-atlas-banner__title { font-weight: 600; color: var(--ink); }
.sg-atlas-banner--info { border-color: var(--border-strong); }
.sg-atlas-banner--success { border-color: #4E9A6B; }
.sg-atlas-banner--success > .sg-atlas-icon { color: #2E6B47; }
.sg-atlas-banner--error { border-color: #B3261E; }
.sg-atlas-banner--error > .sg-atlas-icon { color: #B3261E; }
.sg-atlas-switch { display: inline-flex; padding: 2px; gap: 2px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg); }
.sg-atlas-switch__item { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 12px; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--ink-muted); font: inherit; font-size: 0.875rem; cursor: pointer; }
.sg-atlas-switch__item[aria-pressed="true"] { background: var(--atlas-sel); color: var(--atlas-sel-ink); }
.sg-atlas-switch__item:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.sg-atlas-switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 12px 0; padding: 12px 0; border-top: 1px solid var(--border); cursor: pointer; }
.sg-atlas-switch-row > span:first-child { display: grid; gap: 2px; min-width: 0; }
.sg-atlas-switch-row input { width: 22px; height: 22px; flex: none; accent-color: var(--ink); }
.sg-atlas-label-row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.sg-atlas-close { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: var(--radius); color: var(--ink); flex: none; }
.sg-atlas-close:hover { background: var(--bg); }
.sg-atlas-dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.sg-atlas-dialog-head > div { min-width: 0; }
.sg-atlas-dialog-head p { margin: 4px 0 0; }

/* Segmented radios (poster format and paper). */
.sg-atlas-seg { border: 0; margin: 0 0 12px; padding: 0; min-width: 0; }
.sg-atlas-seg legend { font-weight: 600; margin-bottom: 6px; padding: 0; }
.sg-atlas-seg__row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; }
.sg-atlas-seg__radio { position: absolute; opacity: 0; width: 1px; height: 1px; }
.sg-atlas-seg__opt { display: grid; gap: 2px; align-content: center; min-height: 44px; padding: 6px 8px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); cursor: pointer; text-align: center; overflow-wrap: anywhere; }
.sg-atlas-seg__radio:checked + .sg-atlas-seg__opt { border: 2px solid var(--atlas-sel); padding: 5px 7px; }
.sg-atlas-seg__radio:focus-visible + .sg-atlas-seg__opt { outline: 2px solid var(--focus); outline-offset: 2px; }
.sg-atlas-seg__main { font-weight: 600; color: var(--ink); }
.sg-atlas-seg__sub { font-size: 0.72rem; color: var(--ink-muted); }

/* V6-01 and V6-03: layer toggles and the color mode control. */
.sg-atlas-layers { border: 0; margin: 0; padding: 0; min-width: 0; }
.sg-atlas-layers legend { padding: 0; margin-bottom: 4px; }
.sg-atlas-layers__row { display: flex; flex-wrap: wrap; gap: 8px; }
.sg-atlas-toggle { position: relative; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--ink-muted); cursor: pointer; }
.sg-atlas-toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.sg-atlas-toggle:has(input:checked) { background: var(--atlas-sel); border-color: var(--atlas-sel); color: var(--atlas-sel-ink); }
.sg-atlas-toggle:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.sg-atlas-modes { display: none; }
@media (min-width: 1024px) {
  .sg-atlas-mode--segments select { display: none; }
  .sg-atlas-modes { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 2px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg); }
  .sg-atlas-mode--segments { flex: 1 1 100%; }
}
.sg-atlas-modes__item { display: inline-flex; align-items: center; min-height: 40px; padding: 0 12px; border-radius: var(--radius-sm); color: var(--ink-muted); text-decoration: none; font-size: 0.875rem; }
.sg-atlas-modes__item[aria-current="true"] { background: var(--atlas-sel); color: var(--atlas-sel-ink); }
.sg-atlas-modes__item.is-disabled { opacity: 0.5; cursor: not-allowed; }
.sg-atlas-legend__list { display: flex; flex-wrap: wrap; gap: 6px 14px; list-style: none; margin: 0; padding: 0; }
.sg-atlas-legend__list li { display: inline-flex; align-items: center; gap: 6px; font-size: 0.85rem; min-width: 0; overflow-wrap: anywhere; }
.sg-atlas-legend--scale { gap: 0; }
.sg-atlas-legend--scale li { flex: 1 1 64px; flex-direction: column; align-items: stretch; gap: 4px; font-family: var(--font-mono); font-size: 0.75rem; }
.sg-atlas-legend--scale .sg-swatch-mini { width: 100%; height: 12px; border-width: 0; }
.sg-atlas-legend--scale .sg-atlas-legend__selected { flex: 0 0 auto; margin-left: 12px; }
.sg-atlas-sw-selected { background: var(--orange); border-color: var(--orange); }
.sg-atlas-sw-later { background: var(--bg); border-color: var(--border-strong); }
.sg-atlas-dots { display: inline-flex; gap: 2px; }
.sg-atlas-dots i { width: 8px; height: 8px; border-radius: 999px; border: 1px solid var(--mahogany); }
.sg-atlas-dots i.is-on { background: var(--mahogany); }

/* V6-02: rows of the country panel. */
.sg-atlas-rows { list-style: none; margin: 8px 0 0; padding: 0; }
.sg-atlas-rows li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 0; border-top: 1px solid var(--border); min-width: 0; }
.sg-atlas-row__link { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; min-height: 44px; color: inherit; text-decoration: none; }
.sg-atlas-row__link:hover .sg-atlas-row__name { text-decoration: underline; }
.sg-atlas-row__text { display: grid; gap: 2px; min-width: 0; flex: 1 1 auto; }
.sg-atlas-row__name { font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.sg-atlas-row__meta, .sg-atlas-row__side { font-size: 0.8rem; color: var(--ink-muted); }
.sg-atlas-row__side { flex: none; }
.sg-atlas-panel-block .sg-atlas-card__head { margin-bottom: 4px; }

/* V6-04: globe bar. */
.sg-atlas-globe__bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0; }
.sg-atlas-globe__hint { margin: 4px 0 0; }

/* V6-05: intro place line and skip. */
.sg-atlas-intro__place { position: absolute; left: 8px; top: 8px; margin: 0; padding: 2px 8px; border-radius: var(--radius-sm); background: var(--surface); font-size: 0.8rem; max-width: calc(100% - 16px); overflow-wrap: anywhere; }
.sg-atlas-intro [data-atlas-intro-skip] .sg-atlas-icon { margin: 0 0 0 6px; }

/* V6-06: time slider card. */
.sg-atlas-time { margin-top: 12px; }
.sg-atlas-time__row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 12px; }
.sg-atlas-time__field { flex: 1 1 220px; margin: 0; min-width: 0; }
.sg-atlas-time__ticks { display: flex; justify-content: space-between; list-style: none; margin: 0; padding: 0; font-size: 0.72rem; color: var(--ink-muted); }
.sg-atlas-time__legend { display: flex; flex-wrap: wrap; gap: 6px 16px; list-style: none; padding: 0; margin: 8px 0 4px; font-size: 0.85rem; }
.sg-atlas-time__legend li { display: inline-flex; align-items: center; gap: 6px; }
.sg-atlas-time--single p { margin: 0; }
.sg-atlas-time--live [data-atlas-time-submit] { display: none; }

/* V6-07: poster dialog. */
.sg-atlas-poster__counters { border: 0; padding: 0; margin: 12px 0; display: grid; gap: 4px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.sg-atlas-poster__counters legend { font-weight: 600; padding: 0; margin-bottom: 4px; }
.sg-atlas-poster-form:has(input[name="format"][value="png"]:checked) .sg-atlas-poster__paper,
.sg-atlas-poster-form:has(input[name="format"][value="pdf"]:checked) .sg-atlas-poster__width,
.sg-atlas-poster-form:has(input[name="format"][value="svg"]:checked) .sg-atlas-poster__paper,
.sg-atlas-poster-form:has(input[name="format"][value="svg"]:checked) .sg-atlas-poster__width { display: none; }
.sg-atlas-poster-preview .sg-atlas-card__head { margin-bottom: 8px; }

/* V6-08: replay player. */
.sg-atlas-replay__open { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); color: var(--ink); font-weight: 600; cursor: pointer; list-style: none; }
.sg-atlas-replay__open::-webkit-details-marker { display: none; }
.sg-atlas-replay[open] .sg-atlas-replay__open { margin-bottom: 8px; }
.sg-atlas-replay__chip { margin: 0 0 8px; }
.sg-atlas-replay__player { display: grid; gap: 8px; padding: 8px 0; }
.sg-atlas-replay__player progress { width: 100%; height: 6px; accent-color: var(--orange); }
.sg-atlas-replay__now { flex: 1 1 160px; min-width: 0; }
.sg-atlas-replay__now p { margin: 0; overflow-wrap: anywhere; }
.sg-atlas-replay__now .sg-mono { font-size: 0.8rem; color: var(--ink-muted); }
.sg-atlas-replay__title { font-weight: 600; color: var(--ink); }
.sg-atlas-style-button { margin: 8px 0 0; }

/* V6-09: world map filters, legend, list and empty state. */
.sg-atlas-filter-sheet { margin: 0 0 12px; }
.sg-atlas-filter-sheet > summary { list-style: none; display: inline-flex; align-items: center; gap: 6px; }
.sg-atlas-filter-sheet > summary::-webkit-details-marker { display: none; }
.sg-atlas-filter-sheet__body { display: grid; gap: 10px; margin-top: 8px; }
@media (min-width: 640px) {
  .sg-atlas-filter-sheet > summary { display: none; }
  .sg-atlas-filter-sheet__body { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 20px; margin-top: 0; }
}
.sg-atlas-filter-group { display: grid; gap: 4px; min-width: 0; }
.sg-atlas-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.sg-atlas-chip-link { display: inline-flex; align-items: center; min-height: 36px; padding: 0 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--ink); text-decoration: none; font-size: 0.85rem; overflow-wrap: anywhere; }
.sg-atlas-chip-link[aria-current="true"] { background: var(--atlas-sel); border-color: var(--atlas-sel); color: var(--atlas-sel-ink); }
.sg-atlas-world__legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-top: 8px; }
.sg-atlas-world__legend .sg-legend { display: flex; flex-wrap: wrap; gap: 6px 12px; list-style: none; margin: 0; padding: 0; }
.sg-atlas-world__legend li { display: inline-flex; align-items: center; gap: 6px; font-size: 0.85rem; overflow-wrap: anywhere; }
.sg-atlas-trip-list li { align-items: flex-start; }
.sg-atlas-trip-list .sg-swatch-mini { width: 12px; height: 12px; border-radius: 999px; margin-top: 4px; flex: none; }
.sg-atlas-empty { display: grid; justify-items: center; gap: 8px; text-align: center; padding: 32px 16px; }
.sg-atlas-empty h2 { margin: 0; font-size: 1.1rem; }
.sg-atlas-empty p { margin: 0; }
