/* ═══════════════════════════════════════════════════
   ATLAS — Transportation Intelligence UI Styles
   Glass morphism, animations, MapLibre integration
   ═══════════════════════════════════════════════════ */

/* ── Atlas Theme Bridge ──
   Derives translucent surface/background variants from the
   solid theme tokens emitted by SiteTheme.ToCssVariables().
   When the theme changes (dark → light), these automatically adapt.
   ──────────────────────────────────────────────────── */
:root {
    /* Translucent backgrounds derived from --bg */
    --bg-alpha88: color-mix(in srgb, var(--bg, #0e1117) 88%, transparent);
    --bg-alpha92: color-mix(in srgb, var(--bg, #0e1117) 92%, transparent);
    --bg-alpha95: color-mix(in srgb, var(--bg, #0e1117) 95%, transparent);

    /* Translucent surfaces derived from --surface-1 */
    --surface-1-alpha60: color-mix(in srgb, var(--surface-1, #141922) 60%, transparent);
    --surface-1-alpha75: color-mix(in srgb, var(--surface-1, #141922) 75%, transparent);
    --surface-1-alpha80: color-mix(in srgb, var(--surface-1, #141922) 80%, transparent);
    --surface-1-alpha85: color-mix(in srgb, var(--surface-1, #141922) 85%, transparent);
    --surface-1-alpha92: color-mix(in srgb, var(--surface-1, #141922) 92%, transparent);

    /* Theme-aware hover/interaction overlays */
    --hover-overlay-subtle: color-mix(in srgb, var(--text-primary, #E6E9EF) 4%, transparent);
    --hover-overlay-light:  color-mix(in srgb, var(--text-primary, #E6E9EF) 5%, transparent);
    --hover-overlay:        color-mix(in srgb, var(--text-primary, #E6E9EF) 8%, transparent);
    --hover-overlay-medium: color-mix(in srgb, var(--text-primary, #E6E9EF) 10%, transparent);
    --hover-overlay-strong: color-mix(in srgb, var(--text-primary, #E6E9EF) 12%, transparent);

    /* Theme-aware divider/separator */
    --border-subtle: color-mix(in srgb, var(--text-primary, #E6E9EF) 5%, transparent);
    --border-faint:  color-mix(in srgb, var(--text-primary, #E6E9EF) 4%, transparent);

    /* Slider/control track */
    --control-track: color-mix(in srgb, var(--text-primary, #E6E9EF) 10%, transparent);

    /* MapLibre zoom/compass icon filter (dark theme inverts dark icons to light) */
    --maplibre-icon-filter: invert(0.7);

    /* Weather radar overlay — configurable via Admin Theme Editor */
    --weather-radar-opacity: 0.35;

    /* GIS / geofence layers — resolved by atlas-map.js at draw time so the
       Admin Theme Editor restyles existing zones on next render (ZybronAtlas-GIS.md §3.3).
       Default to the brand accent; override per-layer via AtlasLayerStyle. */
    --geofence-fill: var(--accent, #00D68F);
    --geofence-fill-opacity: 0.15;
    --geofence-stroke: var(--accent, #00D68F);
    --geofence-stroke-width: 2;
}

/* ── Map Container ── */

.atlas-dashboard {
    position: relative;
    width: 100%;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    background: var(--bg, #0e1117);
}

.atlas-map-container {
    width: 100%;
    height: 100%;
    min-height: 200px;
    opacity: 0;
    animation: atlasMapFadeIn 0.5s ease forwards;
}

@keyframes atlasMapFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ── Floating Search Bar ── */

.atlas-search-bar {
    position: absolute;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    width: 380px;
    max-width: calc(100% - 32px);
    transition: width 0.3s ease;
}

.atlas-search-bar:focus-within {
    width: 480px;
}

.atlas-search-input-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: var(--atlas-search-bg, var(--surface-1-alpha75, rgba(20, 25, 34, 0.75)));
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--atlas-panel-border, var(--border, #232B3A));
    border-radius: 24px;
    box-shadow: 0 4px 20px color-mix(in srgb, var(--shadow-color, #000000) 30%, transparent), 0 0 0 0 color-mix(in srgb, var(--brand-jade, #00d68f) 0%, transparent);
    transition: all 0.3s ease;
}

.atlas-search-bar:focus-within .atlas-search-input-wrapper {
    border-color: color-mix(in srgb, var(--brand-jade, #00d68f) 40%, transparent);
    box-shadow: 0 4px 24px color-mix(in srgb, var(--shadow-color, #000000) 40%, transparent), 0 0 12px color-mix(in srgb, var(--brand-jade, #00d68f) 15%, transparent);
}

.atlas-search-icon {
    color: var(--muted, #7A8599);
    font-size: 20px;
    flex-shrink: 0;
}

.atlas-search-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--atlas-search-text, var(--text-primary, #E6E9EF));
    font-size: 14px;
    font-family: inherit;
}

.atlas-search-input::placeholder {
    color: var(--atlas-search-placeholder, var(--muted, #7A8599));
}

.atlas-search-btn {
    background: transparent;
    border: none;
    color: var(--muted, #7A8599);
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.atlas-search-btn:hover {
    color: var(--brand-jade, #00D68F);
    background: color-mix(in srgb, var(--brand-jade, #00d68f) 10%, transparent);
}

/* ── Results Panel (slides in from left) ── */

.atlas-results-panel {
    position: absolute;
    top: 72px;
    left: 16px;
    bottom: 16px;
    width: 340px;
    max-width: calc(100% - 32px);
    background: var(--atlas-panel-bg, var(--surface-1-alpha85, rgba(20, 25, 34, 0.85)));
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--atlas-panel-border, var(--border, #232B3A));
    border-radius: var(--radius-lg, 12px);
    box-shadow: 0 8px 32px color-mix(in srgb, var(--shadow-color, #000000) 40%, transparent);
    z-index: 5;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: translateX(-120%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.atlas-results-panel.visible {
    transform: translateX(0);
}

.atlas-results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border, #232B3A);
    flex-shrink: 0;
}

.atlas-results-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary, #E6E9EF);
}

.atlas-results-count {
    font-size: 12px;
    color: var(--muted, #7A8599);
}

.atlas-results-close {
    background: transparent;
    border: none;
    color: var(--muted, #7A8599);
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.atlas-results-close:hover {
    background: var(--hover-overlay-medium);
    color: var(--text-primary, #E6E9EF);
}

.atlas-results-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.atlas-result-card {
    padding: 12px;
    border-radius: var(--radius-sm, 8px);
    cursor: pointer;
    transition: all 0.15s ease;
    margin-bottom: 4px;
}

.atlas-result-card:hover {
    background: var(--hover-overlay-light);
}

.atlas-result-card.selected {
    background: color-mix(in srgb, var(--brand-jade, #00d68f) 8%, transparent);
    border: 1px solid color-mix(in srgb, var(--brand-jade, #00d68f) 20%, transparent);
}

.atlas-result-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary, #E6E9EF);
    margin-bottom: 4px;
}

.atlas-result-address {
    font-size: 12px;
    color: var(--muted, #7A8599);
    margin-bottom: 4px;
}

.atlas-result-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
}

.atlas-result-rating {
    color: var(--warning, #f5a623);
    font-weight: 600;
}

.atlas-result-types {
    color: var(--muted, #7A8599);
}

/* ── Route Info Panel ── */

.atlas-route-info {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    background: var(--surface-1-alpha85, rgba(20, 25, 34, 0.85));
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border, #232B3A);
    border-radius: var(--radius-lg, 12px);
    padding: 16px 24px;
    box-shadow: 0 8px 32px color-mix(in srgb, var(--shadow-color, #000000) 40%, transparent);
    display: flex;
    align-items: center;
    gap: 24px;
    animation: atlasSlideUp 0.3s ease-out;
}

@keyframes atlasSlideUp {
    from { transform: translateX(-50%) translateY(20px); opacity: 0; }
    to { transform: translateX(-50%) translateY(0); opacity: 1; }
}

.atlas-route-stat {
    text-align: center;
}

.atlas-route-stat-value {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary, #E6E9EF);
}

.atlas-route-stat-label {
    font-size: 11px;
    color: var(--muted, #7A8599);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.atlas-route-divider {
    width: 1px;
    height: 32px;
    background: var(--border, #232B3A);
}

.atlas-route-edit {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: color-mix(in srgb, var(--brand-jade, #00d68f) 10%, transparent);
    border: 1px solid color-mix(in srgb, var(--brand-jade, #00d68f) 25%, transparent);
    border-radius: 6px;
    color: var(--brand-jade, #00D68F);
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    font-family: inherit;
    transition: all 0.15s ease;
}

.atlas-route-edit:hover {
    background: color-mix(in srgb, var(--brand-jade, #00d68f) 20%, transparent);
    border-color: color-mix(in srgb, var(--brand-jade, #00d68f) 40%, transparent);
}

.atlas-route-close {
    background: transparent;
    border: none;
    color: var(--muted, #7A8599);
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    transition: all 0.15s ease;
}

.atlas-route-close:hover {
    background: var(--hover-overlay-medium);
    color: var(--text-primary, #E6E9EF);
}

/* ── POI Marker (custom marker element) ── */

.atlas-poi-wrapper {
    cursor: pointer;
}

.atlas-poi-marker {
    width: 28px;
    height: 28px;
    background: var(--brand-jade, #00D68F);
    border: 2px solid color-mix(in srgb, var(--text-primary, #ffffff) 90%, transparent);
    border-radius: 50%;
    box-shadow: 0 2px 8px color-mix(in srgb, var(--brand-jade, #00d68f) 40%, transparent);
    animation: atlasMarkerDrop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
    transition: box-shadow 0.15s ease;
}

.atlas-poi-wrapper:hover .atlas-poi-marker {
    box-shadow: 0 4px 12px color-mix(in srgb, var(--brand-jade, #00d68f) 60%, transparent);
}

/* Numbered label inside POI marker (for corridor search results) */
.atlas-poi-label {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-on-brand, #fff);
    text-shadow: 0 1px 2px color-mix(in srgb, var(--shadow-color, #000000) 30%, transparent);
    line-height: 1;
    pointer-events: none;
}

@keyframes atlasMarkerDrop {
    0% { transform: scale(0) translateY(-20px); opacity: 0; }
    60% { transform: scale(1.15) translateY(0); opacity: 1; }
    100% { transform: scale(1) translateY(0); opacity: 1; }
}

/* ── Geocode Address Marker (pin shape, red) ── */
.atlas-geocode-wrapper {
    position: relative;
    width: 34px;
    height: 44px;
    cursor: pointer;
}

.atlas-geocode-marker {
    width: 28px;
    height: 28px;
    margin: 0 auto;
    background: var(--danger, #FF6B6B);
    border: 3px solid color-mix(in srgb, var(--text-primary, #ffffff) 95%, transparent);
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    transform-origin: center center;
    box-shadow: 0 3px 10px color-mix(in srgb, var(--tone-red, #ff6b6b) 50%, transparent);
}

.atlas-geocode-wrapper:hover .atlas-geocode-marker {
    box-shadow: 0 4px 14px color-mix(in srgb, var(--tone-red, #ff6b6b) 70%, transparent);
}

.atlas-geocode-pulse {
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 12px;
    height: 12px;
    margin-left: -6px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--tone-red, #ff6b6b) 40%, transparent);
    animation: atlasGeocodePulse 1.5s ease-out infinite;
    pointer-events: none;
}

@keyframes atlasGeocodePulse {
    0%   { transform: scale(1); opacity: 0.6; }
    100% { transform: scale(3); opacity: 0; }
}

/* ── Map Popup ── */

.atlas-popup .maplibregl-popup-content {
    background: var(--surface-1-alpha92, rgba(20, 25, 34, 0.92));
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border, #232B3A);
    border-radius: var(--radius-sm, 8px);
    padding: 0;
    box-shadow: 0 8px 24px color-mix(in srgb, var(--shadow-color, #000000) 40%, transparent);
    color: var(--text-primary, #E6E9EF);
}

.atlas-popup .maplibregl-popup-tip {
    border-top-color: var(--surface-1-alpha92, rgba(20, 25, 34, 0.92));
}

.atlas-popup .maplibregl-popup-close-button {
    color: var(--muted, #7A8599);
    font-size: 18px;
    padding: 4px 8px;
}

.atlas-popup-card {
    padding: 12px 16px;
}

.atlas-popup-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary, #E6E9EF);
    margin-bottom: 4px;
}

.atlas-popup-rating {
    color: var(--warning, #f5a623);
    font-size: 13px;
    font-weight: 500;
}

.atlas-popup-address {
    font-size: 12px;
    color: var(--muted, #7A8599);
    margin-bottom: 4px;
}

.atlas-popup-types {
    font-size: 11px;
    color: var(--text-secondary, #7A8599);
}

/* ── Loading State ── */

.atlas-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: var(--muted, #7A8599);
    z-index: 5;
}

.atlas-loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid color-mix(in srgb, var(--brand-jade, #00d68f) 20%, transparent);
    border-top-color: var(--brand-jade, #00D68F);
    border-radius: 50%;
    animation: atlasSpinner 0.8s linear infinite;
}

@keyframes atlasSpinner {
    to { transform: rotate(360deg); }
}

.atlas-loading-text {
    font-size: 13px;
}

/* ── No API Key Banner ── */

.atlas-no-key-banner {
    position: absolute;
    bottom: 16px;
    right: 16px;
    z-index: 10;
    background: var(--surface-1-alpha85, rgba(20, 25, 34, 0.85));
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid color-mix(in srgb, var(--warning, #f5a623) 30%, transparent);
    border-radius: var(--radius-sm, 8px);
    padding: 10px 16px;
    font-size: 12px;
    color: var(--warning, #f5a623);
    box-shadow: 0 4px 16px color-mix(in srgb, var(--shadow-color, #000000) 30%, transparent);
}

/* ── Override content-pane for Atlas (full bleed map) ── */

.content-pane.atlas-active {
    padding: 0 !important;
    overflow: hidden !important;
}

/* ── Responsive ── */

@media (max-width: 768px) {
    .atlas-search-bar {
        width: calc(100% - 32px);
    }

    .atlas-search-bar:focus-within {
        width: calc(100% - 32px);
    }

    .atlas-results-panel {
        width: calc(100% - 32px);
        bottom: auto;
        max-height: 50%;
    }

    .atlas-route-info {
        width: calc(100% - 32px);
        flex-wrap: wrap;
        gap: 12px;
        padding: 12px 16px;
    }
}

/* ── MapLibre GL overrides for dark theme ── */

.maplibregl-ctrl-group {
    background: var(--surface-1-alpha85, rgba(20, 25, 34, 0.85)) !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--border, #232B3A) !important;
    border-radius: var(--radius-sm, 8px) !important;
    box-shadow: 0 4px 12px color-mix(in srgb, var(--shadow-color, #000000) 30%, transparent) !important;
}

.maplibregl-ctrl-group button {
    background: transparent !important;
    border-color: var(--border, #232B3A) !important;
}

.maplibregl-ctrl-group button + button {
    border-top: 1px solid var(--border, #232B3A) !important;
}

.maplibregl-ctrl-group button span {
    filter: var(--maplibre-icon-filter, invert(0.7));
}

/* ═══════════════════════════════════════════════════
   TMC Control Center Layout
   ═══════════════════════════════════════════════════ */

/* ── TMC Grid Layout ── */

.atlas-tmc-layout {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.atlas-tmc-main {
    flex: 1;
    display: flex;
    min-height: 0;
    position: relative;
}

.atlas-tmc-map-area {
    flex: 1;
    position: relative;
    min-width: 0;
    overflow: hidden;
}

/* ── TMC Header ── */

.atlas-tmc-header {
    height: 44px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 16px;
    background: var(--atlas-header-bg, var(--bg-alpha88, rgba(14, 17, 23, 0.88)));
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--atlas-panel-border, var(--border, #232B3A));
    flex-shrink: 0;
    z-index: 20;
}

.atlas-tmc-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.atlas-tmc-brand-text {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 3px;
    font-variant: small-caps;
    color: var(--atlas-header-accent, var(--brand-jade, #00D68F));
}

.atlas-tmc-divider-v {
    width: 1px;
    height: 24px;
    background: var(--border, #232B3A);
    flex-shrink: 0;
}

/* ── TMC Header Search (inline) ── */

.atlas-tmc-search {
    flex: 1;
    max-width: 480px;
    position: relative;
}

.atlas-tmc-search-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px;
    background: var(--surface-1-alpha60, rgba(20, 25, 34, 0.6));
    border: 1px solid var(--border, #232B3A);
    border-radius: 20px;
    transition: all 0.2s ease;
}

.atlas-tmc-search-wrapper:focus-within {
    border-color: color-mix(in srgb, var(--brand-jade, #00d68f) 40%, transparent);
    background: var(--surface-1-alpha80, rgba(20, 25, 34, 0.8));
}

.atlas-tmc-search-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary, #E6E9EF);
    font-size: 13px;
    font-family: inherit;
}

.atlas-tmc-search-input::placeholder {
    color: var(--muted, #7A8599);
}

/* ── TMC Autocomplete Dropdown ── */

.atlas-tmc-autocomplete {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    background: var(--bg-alpha95, rgba(14, 17, 23, 0.95));
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border, #232B3A);
    border-radius: 12px;
    box-shadow: 0 8px 32px color-mix(in srgb, var(--shadow-color, #000000) 50%, transparent);
    z-index: 30;
    overflow: hidden;
    animation: atlasAutocompleteFadeIn 0.15s ease-out;
}

@keyframes atlasAutocompleteFadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.atlas-tmc-autocomplete-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 14px;
    cursor: pointer;
    transition: background 0.1s ease;
}

.atlas-tmc-autocomplete-item:hover,
.atlas-tmc-autocomplete-item.highlighted {
    background: color-mix(in srgb, var(--brand-jade, #00d68f) 8%, transparent);
}

.atlas-tmc-autocomplete-item + .atlas-tmc-autocomplete-item {
    border-top: 1px solid var(--border-faint);
}

.atlas-tmc-autocomplete-item-main {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary, #E6E9EF);
    line-height: 1.3;
}

.atlas-tmc-autocomplete-item.highlighted .atlas-tmc-autocomplete-item-main {
    color: var(--brand-jade, #00D68F);
}

.atlas-tmc-autocomplete-item-secondary {
    font-size: 11px;
    color: var(--muted, #7A8599);
    margin-top: 1px;
    line-height: 1.3;
}

/* ── TMC Clock ── */

.atlas-tmc-clock {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.atlas-tmc-clock-time {
    font-family: 'SF Mono', 'Cascadia Code', 'Consolas', monospace;
    font-size: 13px;
    color: var(--text-primary, #E6E9EF);
    letter-spacing: 0.5px;
}

.atlas-tmc-clock-tz {
    font-size: 10px;
    color: var(--muted, #7A8599);
    text-transform: uppercase;
}

/* ── TMC Tenant Badge ── */

.atlas-tmc-tenant {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--muted, #7A8599);
    flex-shrink: 0;
}

/* ── TMC Tool Palette — moved to MainLayout microrail ── */

/* ── TMC Layer Panel ── */

.atlas-tmc-layer-panel {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 240px;
    background: var(--bg-alpha92, rgba(14, 17, 23, 0.92));
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-right: 1px solid var(--border, #232B3A);
    z-index: 12;
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.atlas-tmc-layer-panel.visible {
    transform: translateX(0);
}

/* ── TMC Tile Selector ── */

.atlas-tmc-tile-selector {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    background: var(--bg-alpha92, rgba(14, 17, 23, 0.92));
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-right: 1px solid var(--border, #232B3A);
    z-index: 12;
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.atlas-tmc-tile-selector.visible {
    transform: translateX(0);
}

/* ── Shared Panel Styles ── */

.atlas-tmc-panel-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--atlas-panel-border, var(--border, #232B3A));
    font-size: 13px;
    font-weight: 600;
    color: var(--atlas-panel-text, var(--text-primary, #E6E9EF));
    flex-shrink: 0;
}

.atlas-tmc-panel-close {
    background: transparent;
    border: none;
    color: var(--muted, #7A8599);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.atlas-tmc-panel-close:hover {
    background: var(--hover-overlay-medium);
    color: var(--text-primary, #E6E9EF);
}

.atlas-tmc-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

/* ── Layer Row ── */

.atlas-tmc-layer-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    border-radius: var(--radius-sm, 8px);
    cursor: pointer;
    transition: background 0.15s ease;
    position: relative;
}

.atlas-tmc-layer-row:hover {
    background: var(--hover-overlay-subtle);
}

.atlas-tmc-layer-name {
    font-size: 13px;
    color: var(--text-primary, #E6E9EF);
}

.atlas-tmc-layer-row input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.atlas-tmc-toggle {
    width: 34px;
    height: 18px;
    background: var(--hover-overlay-strong);
    border-radius: 9px;
    position: relative;
    transition: background 0.2s ease;
    flex-shrink: 0;
}

.atlas-tmc-toggle::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    background: var(--muted, #7A8599);
    border-radius: 50%;
    transition: all 0.2s ease;
}

.atlas-tmc-layer-row input:checked ~ .atlas-tmc-toggle {
    background: color-mix(in srgb, var(--brand-jade, #00d68f) 30%, transparent);
}

.atlas-tmc-layer-row input:checked ~ .atlas-tmc-toggle::after {
    left: 18px;
    background: var(--brand-jade, #00D68F);
}

/* ── Radar Floating Panel ── */

.atlas-radar-toggle {
    position: absolute;
    bottom: 8px;
    right: 10px;
    z-index: 14;
    width: 30px;
    height: 30px;
    border-radius: 6px;
    border: none;
    background: var(--bg-alpha88, rgba(14, 17, 23, 0.88));
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: var(--muted, #7A8599);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 1px 4px color-mix(in srgb, var(--shadow-color, #000000) 30%, transparent);
}

.atlas-radar-toggle:hover {
    color: var(--text-primary, #E6E9EF);
    background: var(--surface-1-alpha85, rgba(20, 25, 34, 0.85));
    border-color: var(--brand-jade, #00D68F);
}

.atlas-radar-toggle.active {
    color: var(--brand-jade, #00D68F);
    border-color: var(--brand-jade, #00D68F);
    box-shadow: 0 0 12px color-mix(in srgb, var(--brand-jade, #00d68f) 20%, transparent);
}

.atlas-radar-panel {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 14;
    width: auto;
    min-width: 320px;
    max-width: 480px;
    background: var(--bg-alpha92, rgba(14, 17, 23, 0.92));
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border, #232B3A);
    border-radius: var(--radius-md, 12px);
    box-shadow: 0 4px 20px color-mix(in srgb, var(--shadow-color, #000000) 40%, transparent);
    padding: 10px 16px;
    display: none;
    flex-direction: row;
    align-items: center;
    gap: 12px;
}

.atlas-radar-panel.visible {
    display: flex;
}

.atlas-radar-panel-header {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-primary, #E6E9EF);
    letter-spacing: 0.3px;
    text-transform: uppercase;
    white-space: nowrap;
    flex-shrink: 0;
}

.atlas-radar-panel-header .material-symbols-outlined {
    font-size: 14px;
    color: var(--brand-jade, #00D68F);
}

/* Mode buttons: Live / 1hr / 2hr */
.atlas-radar-modes {
    display: flex;
    gap: 3px;
    flex-shrink: 0;
}

.radar-mode-btn {
    padding: 4px 10px;
    border: 1px solid var(--border, #232B3A);
    border-radius: var(--radius-sm, 8px);
    background: transparent;
    color: var(--muted, #7A8599);
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: center;
    white-space: nowrap;
}

.radar-mode-btn:hover {
    background: var(--hover-overlay-subtle);
    color: var(--text-primary, #E6E9EF);
}

.radar-mode-btn.active {
    background: color-mix(in srgb, var(--brand-jade, #00d68f) 12%, transparent);
    color: var(--brand-jade, #00D68F);
    border-color: color-mix(in srgb, var(--brand-jade, #00d68f) 30%, transparent);
}

/* Playback controls */
.radar-playback {
    display: none;
    flex-direction: row;
    align-items: center;
    gap: 4px;
    flex: 1;
    min-width: 0;
}

.radar-controls {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}

.radar-controls button {
    width: 26px;
    height: 26px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--text-primary, #E6E9EF);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease;
    padding: 0;
}

.radar-controls button:hover {
    background: var(--hover-overlay-medium);
}

.radar-controls .material-symbols-outlined {
    font-size: 18px;
}

/* Scrub bar */
.radar-scrub {
    flex: 1;
    min-width: 60px;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--hover-overlay-strong);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.radar-scrub::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--brand-jade, #00D68F);
    cursor: pointer;
    box-shadow: 0 0 4px color-mix(in srgb, var(--brand-jade, #00d68f) 40%, transparent);
}

.radar-scrub::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--brand-jade, #00D68F);
    border: none;
    cursor: pointer;
}

.radar-time-label {
    font-size: 10px;
    color: var(--muted, #7A8599);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    min-width: 55px;
    text-align: center;
    flex-shrink: 0;
}

/* Radar legend */
.radar-legend-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}

.radar-legend {
    display: flex;
    align-items: center;
    gap: 2px;
}

.radar-legend-swatch {
    width: 12px;
    height: 5px;
    border-radius: 1px;
}

.radar-legend-labels {
    display: flex;
    gap: 6px;
    font-size: 8px;
    color: var(--muted, #7A8599);
}

.radar-refresh-label {
    font-size: 8px;
    color: var(--muted, #7A8599);
    opacity: 0.6;
    white-space: nowrap;
}

/* ── Tile Selector Cards ── */

.atlas-tmc-tile-card {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px;
    border-radius: var(--radius-sm, 8px);
    cursor: pointer;
    transition: background 0.15s ease;
    margin-bottom: 4px;
}

.atlas-tmc-tile-card:hover {
    background: var(--hover-overlay-subtle);
}

.atlas-tmc-tile-card.selected {
    background: color-mix(in srgb, var(--brand-jade, #00d68f) 8%, transparent);
}

.atlas-tmc-tile-radio {
    color: var(--muted, #7A8599);
    flex-shrink: 0;
    padding-top: 1px;
}

.atlas-tmc-tile-card.selected .atlas-tmc-tile-radio {
    color: var(--brand-jade, #00D68F);
}

.atlas-tmc-tile-info {
    flex: 1;
    min-width: 0;
}

.atlas-tmc-tile-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary, #E6E9EF);
    margin-bottom: 2px;
}

.atlas-tmc-tile-meta {
    font-size: 11px;
    color: var(--muted, #7A8599);
}

.atlas-tmc-tile-loading {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 10px;
    font-size: 12px;
    color: var(--muted, #7A8599);
}

.atlas-tmc-tile-empty {
    padding: 16px 10px;
    font-size: 12px;
    color: var(--muted, #7A8599);
    line-height: 1.5;
    text-align: center;
}

/* ── TMC KPI Strip ── */

.atlas-tmc-kpi-strip {
    height: 36px;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 16px;
    background: var(--atlas-footer-bg, var(--bg-alpha88, rgba(14, 17, 23, 0.88)));
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--atlas-panel-border, var(--border, #232B3A));
    flex-shrink: 0;
    z-index: 20;
}

.atlas-tmc-kpi {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--atlas-footer-text, var(--muted, #7A8599));
}

.atlas-tmc-kpi .material-symbols-outlined {
    font-size: 14px;
    opacity: 0.6;
}

.atlas-tmc-kpi-label {
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 10px;
    opacity: 0.7;
}

.atlas-tmc-kpi-value {
    font-family: 'SF Mono', 'Cascadia Code', 'Consolas', monospace;
    font-size: 11px;
    color: var(--text-primary, #E6E9EF);
}

.atlas-tmc-kpi-divider {
    width: 1px;
    height: 18px;
    background: var(--border, #232B3A);
}

.atlas-tmc-kpi-badge {
    font-size: 10px;
    color: var(--brand-jade, #00D68F);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    opacity: 0.7;
}

/* ── Adjust results panel position for TMC layout ── */

.atlas-tmc-map-area .atlas-results-panel {
    top: 12px;
    left: 12px;
    bottom: 12px;
}

/* ── Adjust route info for TMC layout ── */

.atlas-tmc-map-area .atlas-route-info {
    bottom: 12px;
}

/* ── Adjust no-key banner for TMC layout ── */

.atlas-tmc-map-area .atlas-no-key-banner {
    bottom: 12px;
    right: 12px;
}

/* ═══════════════════════════════════════════════════
   Directions Panel Styles
   ═══════════════════════════════════════════════════ */

/* ── Result Card Directions Button ── */

.atlas-result-directions-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 8px;
    padding: 4px 10px;
    background: color-mix(in srgb, var(--brand-jade, #00d68f) 8%, transparent);
    border: 1px solid color-mix(in srgb, var(--brand-jade, #00d68f) 20%, transparent);
    border-radius: 6px;
    color: var(--brand-jade, #00D68F);
    cursor: pointer;
    font-size: 12px;
    font-family: inherit;
    font-weight: 500;
    transition: all 0.15s ease;
}

.atlas-result-directions-btn .material-symbols-outlined {
    font-size: 15px;
}

.atlas-result-directions-btn:hover {
    background: color-mix(in srgb, var(--brand-jade, #00d68f) 18%, transparent);
    border-color: color-mix(in srgb, var(--brand-jade, #00d68f) 40%, transparent);
}

/* ── Directions Form ── */

.atlas-directions-form {
    padding: 12px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    position: relative;
}

.atlas-directions-field-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.atlas-directions-field-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
}

.atlas-directions-field-icon.from {
    background: color-mix(in srgb, var(--brand-jade, #00d68f) 20%, transparent);
    color: var(--brand-jade, #00D68F);
}

.atlas-directions-field-icon.to {
    background: color-mix(in srgb, var(--tone-red, #ff6b6b) 20%, transparent);
    color: var(--danger, #FF6B6B);
}

.atlas-directions-field-icon.stop {
    background: var(--rz-warning);
    color: white;
}

.atlas-directions-field-container {
    flex: 1;
    position: relative;
}

.atlas-directions-field {
    width: 100%;
    padding: 8px 12px;
    background: var(--surface-1-alpha60, rgba(20, 25, 34, 0.6));
    border: 1px solid var(--border, #232B3A);
    border-radius: 8px;
    color: var(--text-primary, #E6E9EF);
    font-size: 13px;
    font-family: inherit;
    outline: none;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.atlas-directions-field::placeholder {
    color: var(--muted, #7A8599);
}

.atlas-directions-field:focus {
    border-color: color-mix(in srgb, var(--brand-jade, #00d68f) 40%, transparent);
    background: var(--surface-1-alpha80, rgba(20, 25, 34, 0.8));
}

/* ── From Field Input Row (input + my location btn) ── */

.atlas-directions-field-input-row {
    display: flex;
    align-items: center;
    gap: 4px;
}

.atlas-directions-field-input-row .atlas-directions-field {
    flex: 1;
    min-width: 0;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.atlas-directions-myloc-btn {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-1-alpha60, rgba(20, 25, 34, 0.6));
    border: 1px solid var(--border, #232B3A);
    border-left: none;
    border-radius: 0 8px 8px 0;
    color: var(--muted, #7A8599);
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
    transition: all 0.15s ease;
}

.atlas-directions-myloc-btn .material-symbols-outlined {
    font-size: 18px;
}

.atlas-directions-myloc-btn:hover:not(:disabled) {
    background: color-mix(in srgb, var(--brand-jade, #00d68f) 12%, transparent);
    color: var(--brand-jade, #00D68F);
    border-color: color-mix(in srgb, var(--brand-jade, #00d68f) 30%, transparent);
}

.atlas-directions-myloc-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.atlas-directions-myloc-btn.locating .material-symbols-outlined {
    animation: atlasSpinner 1s linear infinite;
}

/* ── Swap Button ── */

.atlas-directions-swap {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 50%;
    color: var(--muted, #7A8599);
    cursor: pointer;
    transition: all 0.15s ease;
    margin: 2px 0 2px 34px;
    padding: 0;
    flex-shrink: 0;
}

.atlas-directions-swap .material-symbols-outlined {
    font-size: 18px;
}

.atlas-directions-swap:hover {
    background: var(--hover-overlay);
    color: var(--text-primary, #E6E9EF);
}

/* ── Travel Mode Pills ── */

.atlas-directions-modes {
    display: flex;
    gap: 4px;
    padding: 8px 12px;
}

.atlas-directions-mode {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 6px 8px;
    background: transparent;
    border: 1px solid var(--border, #232B3A);
    border-radius: 8px;
    color: var(--muted, #7A8599);
    cursor: pointer;
    font-size: 11px;
    font-family: inherit;
    transition: all 0.15s ease;
}

.atlas-directions-mode .material-symbols-outlined {
    font-size: 16px;
}

.atlas-directions-mode:hover {
    background: var(--hover-overlay-light);
    color: var(--text-primary, #E6E9EF);
}

.atlas-directions-mode.active {
    background: color-mix(in srgb, var(--brand-jade, #00d68f) 12%, transparent);
    border-color: color-mix(in srgb, var(--brand-jade, #00d68f) 30%, transparent);
    color: var(--brand-jade, #00D68F);
}

/* ── Get Route Button ── */

.atlas-directions-go {
    width: 100%;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--brand-jade, #00D68F);
    border: none;
    border-radius: 8px;
    color: var(--bg, #0e1117);
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s ease;
}

.atlas-directions-go:hover:not(:disabled) {
    background: var(--brand-jade-hover, #00c280);
}

.atlas-directions-go:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ── Route Alternative Cards ── */

.atlas-route-card {
    padding: 10px 12px;
    border-radius: var(--radius-sm, 8px);
    cursor: pointer;
    transition: all 0.15s ease;
    margin-bottom: 4px;
    border: 1px solid transparent;
}

.atlas-route-card:hover {
    background: var(--hover-overlay-light);
}

.atlas-route-card.selected {
    background: color-mix(in srgb, var(--brand-jade, #00d68f) 8%, transparent);
    border-color: color-mix(in srgb, var(--brand-jade, #00d68f) 20%, transparent);
}

.atlas-route-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2px;
}

.atlas-route-card-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary, #E6E9EF);
}

.atlas-route-card.selected .atlas-route-card-label {
    color: var(--brand-jade, #00D68F);
}

.atlas-route-card-via {
    font-size: 12px;
    color: var(--muted, #7A8599);
    margin-bottom: 2px;
}

.atlas-route-card-stats {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-primary, #E6E9EF);
}

.atlas-route-card-dot {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--muted, #7A8599);
}

/* ═══════════════════════════════════════════════════
   Traffic Simulation Panel Styles
   ═══════════════════════════════════════════════════ */

/* ── Sim Panel (slides over map from right) ── */

.atlas-sim-panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 300px;
    background: var(--bg-alpha92, rgba(14, 17, 23, 0.92));
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-left: 1px solid var(--border, #232B3A);
    z-index: 12;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
}

.atlas-sim-panel.visible {
    transform: translateX(0);
}

.atlas-sim-panel-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border, #232B3A);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary, #E6E9EF);
    flex-shrink: 0;
}

/* ── Sim Clock ── */

.atlas-sim-clock {
    text-align: center;
    padding: 16px 12px 8px;
}

.atlas-sim-clock-time {
    font-family: 'SF Mono', 'Cascadia Code', 'Consolas', monospace;
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary, #E6E9EF);
    letter-spacing: 2px;
    line-height: 1;
}

.atlas-sim-clock-period {
    font-size: 11px;
    color: var(--brand-jade, #00D68F);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-top: 4px;
}

/* ── Transport Controls ── */

.atlas-sim-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 12px;
}

.atlas-sim-ctrl-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--hover-overlay);
    border: 1px solid var(--border, #232B3A);
    border-radius: 50%;
    color: var(--muted, #7A8599);
    cursor: pointer;
    transition: all 0.15s ease;
    padding: 0;
}

.atlas-sim-ctrl-btn .material-symbols-outlined {
    font-size: 22px;
}

.atlas-sim-ctrl-btn:hover {
    background: var(--hover-overlay-strong);
    color: var(--text-primary, #E6E9EF);
    border-color: var(--border, #232B3A);
}

.atlas-sim-ctrl-btn.play {
    width: 48px;
    height: 48px;
    background: color-mix(in srgb, var(--brand-jade, #00d68f) 15%, transparent);
    border-color: color-mix(in srgb, var(--brand-jade, #00d68f) 30%, transparent);
    color: var(--brand-jade, #00D68F);
}

.atlas-sim-ctrl-btn.play .material-symbols-outlined {
    font-size: 28px;
}

.atlas-sim-ctrl-btn.play:hover {
    background: color-mix(in srgb, var(--brand-jade, #00d68f) 25%, transparent);
    border-color: color-mix(in srgb, var(--brand-jade, #00d68f) 50%, transparent);
}

.atlas-sim-ctrl-btn.play.active {
    background: var(--brand-jade, #00D68F);
    border-color: var(--brand-jade, #00D68F);
    color: var(--bg, #0e1117);
    box-shadow: 0 0 16px color-mix(in srgb, var(--brand-jade, #00d68f) 30%, transparent);
}

/* ── Speed Pills ── */

.atlas-sim-speed-pills {
    display: flex;
    gap: 6px;
    padding: 4px 12px 8px;
    justify-content: center;
}

.atlas-sim-speed-pill {
    padding: 4px 14px;
    background: transparent;
    border: 1px solid var(--border, #232B3A);
    border-radius: 16px;
    color: var(--muted, #7A8599);
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s ease;
}

.atlas-sim-speed-pill:hover {
    background: var(--hover-overlay);
    color: var(--text-primary, #E6E9EF);
}

.atlas-sim-speed-pill.active {
    background: color-mix(in srgb, var(--brand-jade, #00d68f) 15%, transparent);
    border-color: color-mix(in srgb, var(--brand-jade, #00d68f) 30%, transparent);
    color: var(--brand-jade, #00D68F);
}

/* ── Time Scrubber / Slider ── */

.atlas-sim-scrubber {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px 12px;
}

.atlas-sim-scrubber-label {
    font-family: 'SF Mono', 'Cascadia Code', 'Consolas', monospace;
    font-size: 10px;
    color: var(--muted, #7A8599);
    flex-shrink: 0;
}

.atlas-sim-slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    background: var(--control-track);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.atlas-sim-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    background: var(--brand-jade, #00D68F);
    border-radius: 50%;
    border: 2px solid color-mix(in srgb, var(--text-primary, #ffffff) 90%, transparent);
    box-shadow: 0 0 6px color-mix(in srgb, var(--brand-jade, #00d68f) 40%, transparent);
    cursor: pointer;
    transition: box-shadow 0.15s ease;
}

.atlas-sim-slider::-webkit-slider-thumb:hover {
    box-shadow: 0 0 12px color-mix(in srgb, var(--brand-jade, #00d68f) 60%, transparent);
}

.atlas-sim-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: var(--brand-jade, #00D68F);
    border-radius: 50%;
    border: 2px solid color-mix(in srgb, var(--text-primary, #ffffff) 90%, transparent);
    box-shadow: 0 0 6px color-mix(in srgb, var(--brand-jade, #00d68f) 40%, transparent);
    cursor: pointer;
}

/* ── Sim KPIs ── */

.atlas-sim-kpis {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 8px 12px;
    border-top: 1px solid var(--border, #232B3A);
}

.atlas-sim-kpi {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: var(--hover-overlay-subtle);
    border-radius: 8px;
}

.atlas-sim-kpi-icon {
    font-size: 18px;
    color: var(--muted, #7A8599);
    opacity: 0.7;
}

.atlas-sim-kpi-value {
    font-family: 'SF Mono', 'Cascadia Code', 'Consolas', monospace;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary, #E6E9EF);
    line-height: 1.2;
}

.atlas-sim-kpi-value small {
    font-size: 10px;
    font-weight: 400;
    color: var(--muted, #7A8599);
}

.atlas-sim-kpi-value.warn {
    color: var(--warning, #f97316);
}

.atlas-sim-kpi-label {
    font-size: 10px;
    color: var(--muted, #7A8599);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ── LOS Distribution Bar ── */

.atlas-sim-los {
    padding: 10px 12px 14px;
    border-top: 1px solid var(--border, #232B3A);
}

.atlas-sim-los-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--muted, #7A8599);
    margin-bottom: 6px;
}

.atlas-sim-los-bar {
    display: flex;
    height: 10px;
    border-radius: 5px;
    overflow: hidden;
    gap: 1px;
}

.atlas-sim-los-seg {
    min-width: 2px;
    transition: flex 0.3s ease;
}

.atlas-sim-los-seg.los-a { background: var(--tone-jade, #22c55e); }
.atlas-sim-los-seg.los-b { background: color-mix(in srgb, var(--tone-jade, #22c55e) 50%, var(--tone-amber, #eab308)); }
.atlas-sim-los-seg.los-c { background: var(--tone-amber, #eab308); }
.atlas-sim-los-seg.los-d { background: var(--tone-orange, #f97316); }
.atlas-sim-los-seg.los-e { background: var(--danger, #ef4444); }
.atlas-sim-los-seg.los-f { background: var(--tone-red, #991b1b); }

.atlas-sim-los-legend {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 6px;
    font-size: 10px;
    color: var(--muted, #7A8599);
}

.atlas-sim-los-legend span + span {
    margin-right: 6px;
}

.atlas-sim-los-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 2px;
}

.atlas-sim-los-dot.los-a { background: var(--tone-jade, #22c55e); }
.atlas-sim-los-dot.los-b { background: color-mix(in srgb, var(--tone-jade, #22c55e) 50%, var(--tone-amber, #eab308)); }
.atlas-sim-los-dot.los-c { background: var(--tone-amber, #eab308); }
.atlas-sim-los-dot.los-d { background: var(--tone-orange, #f97316); }
.atlas-sim-los-dot.los-e { background: var(--danger, #ef4444); }
.atlas-sim-los-dot.los-f { background: var(--tone-red, #991b1b); }

/* ── Sim Panel Responsive ── */

@media (max-width: 768px) {
    .atlas-sim-panel {
        width: 100%;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        max-height: 60%;
        border-left: none;
        border-top: 1px solid var(--border, #232B3A);
        border-radius: 16px 16px 0 0;
        transform: translateY(100%);
    }

    .atlas-sim-panel.visible {
        transform: translateY(0);
    }
}

/* ── Directions Field Autocomplete ── */

.atlas-directions-field-autocomplete {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    background: var(--bg-alpha95, rgba(14, 17, 23, 0.95));
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border, #232B3A);
    border-radius: 10px;
    box-shadow: 0 8px 32px color-mix(in srgb, var(--shadow-color, #000000) 50%, transparent);
    z-index: 30;
    overflow: hidden;
    animation: atlasAutocompleteFadeIn 0.15s ease-out;
    max-height: 200px;
    overflow-y: auto;
}

/* ── TMC Responsive ── */

@media (max-width: 768px) {
    .atlas-tmc-header {
        height: auto;
        flex-wrap: wrap;
        padding: 8px 12px;
        gap: 8px;
    }

    .atlas-tmc-search {
        order: 10;
        max-width: 100%;
        flex-basis: 100%;
    }

    .atlas-tmc-layer-panel,
    .atlas-tmc-tile-selector {
        width: 100%;
    }

    .atlas-tmc-kpi-strip {
        height: auto;
        flex-wrap: wrap;
        padding: 6px 12px;
        gap: 8px;
    }
}

/* ═══════════════════════════════════════════════════
   Simulation Region Toggle & Lasso UI
   ═══════════════════════════════════════════════════ */

.atlas-sim-region-toggle {
    display: flex;
    gap: 4px;
    padding: 8px 12px 4px;
}

.atlas-sim-region-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 6px 8px;
    background: transparent;
    border: 1px solid var(--border, #232B3A);
    border-radius: 8px;
    color: var(--muted, #7A8599);
    cursor: pointer;
    font-size: 11px;
    font-family: inherit;
    transition: all 0.15s ease;
}

.atlas-sim-region-btn:hover {
    background: var(--hover-overlay-light);
    color: var(--text-primary, #E6E9EF);
}

.atlas-sim-region-btn.active {
    background: color-mix(in srgb, var(--brand-jade, #00d68f) 12%, transparent);
    border-color: color-mix(in srgb, var(--brand-jade, #00d68f) 30%, transparent);
    color: var(--brand-jade, #00D68F);
}

.atlas-sim-region-section {
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.atlas-sim-lasso-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 12px;
    background: color-mix(in srgb, var(--brand-jade, #00d68f) 8%, transparent);
    backdrop-filter: blur(8px);
    border: 1px dashed color-mix(in srgb, var(--brand-jade, #00d68f) 40%, transparent);
    border-radius: 8px;
    color: var(--brand-jade, #00D68F);
    cursor: pointer;
    font-size: 12px;
    font-family: inherit;
    font-weight: 500;
    transition: all 0.15s ease;
}

.atlas-sim-lasso-btn:hover {
    background: color-mix(in srgb, var(--brand-jade, #00d68f) 15%, transparent);
    border-color: color-mix(in srgb, var(--brand-jade, #00d68f) 60%, transparent);
}

.atlas-sim-lasso-btn.clear {
    background: transparent;
    border: 1px solid var(--border, #232B3A);
    color: var(--muted, #7A8599);
}

.atlas-sim-lasso-btn.clear:hover {
    background: var(--hover-overlay-light);
    color: var(--text-primary, #E6E9EF);
}

.atlas-sim-region-hint {
    font-size: 11px;
    color: var(--muted, #7A8599);
    line-height: 1.4;
}

.atlas-sim-region-stats {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-primary, #E6E9EF);
}

.atlas-sim-corridor-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    max-height: 80px;
    overflow-y: auto;
}

.atlas-sim-corridor-chip {
    display: inline-block;
    padding: 2px 8px;
    background: color-mix(in srgb, var(--brand-jade, #00d68f) 10%, transparent);
    border: 1px solid color-mix(in srgb, var(--brand-jade, #00d68f) 20%, transparent);
    border-radius: 12px;
    font-size: 10px;
    color: var(--brand-jade, #00D68F);
    white-space: nowrap;
}

/* ── Folio Section ── */

.atlas-sim-folio-section {
    padding: 6px 12px;
    border-top: 1px solid var(--border-subtle);
    border-bottom: 1px solid var(--border-subtle);
}

.atlas-sim-folio-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 6px 10px;
    background: var(--surface-1-alpha60, rgba(20, 25, 34, 0.6));
    border: 1px solid var(--border, #232B3A);
    border-radius: 6px;
    color: var(--muted, #7A8599);
    cursor: pointer;
    font-size: 11px;
    font-family: inherit;
    transition: all 0.15s ease;
}

.atlas-sim-folio-btn:hover {
    background: color-mix(in srgb, var(--brand-jade, #00d68f) 8%, transparent);
    border-color: color-mix(in srgb, var(--brand-jade, #00d68f) 30%, transparent);
    color: var(--brand-jade, #00D68F);
}

.atlas-sim-folio-attached {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: color-mix(in srgb, var(--brand-jade, #00d68f) 6%, transparent);
    border: 1px solid color-mix(in srgb, var(--brand-jade, #00d68f) 20%, transparent);
    border-radius: 6px;
}

.atlas-sim-folio-code {
    font-family: 'SF Mono', 'Cascadia Code', 'Consolas', monospace;
    font-size: 12px;
    color: var(--brand-jade, #00D68F);
    flex: 1;
}

.atlas-sim-folio-detach {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 4px;
    color: var(--muted, #7A8599);
    cursor: pointer;
    padding: 0;
    transition: all 0.15s ease;
}

.atlas-sim-folio-detach:hover {
    background: var(--hover-overlay);
    color: var(--text-primary, #E6E9EF);
}

/* ── Simulation Setup Section ── */

.atlas-sim-setup {
    padding: 8px 12px 4px;
    border-top: 1px solid var(--border-subtle);
}

.atlas-sim-setup-header {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1.2px;
    color: var(--muted, #7A8599);
    text-transform: uppercase;
    margin-bottom: 8px;
}

.atlas-sim-param-label {
    font-size: 11px;
    color: var(--text-secondary, #A0A8B8);
    margin-bottom: 4px;
    margin-top: 8px;
}

.atlas-sim-param-row {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

/* ── Compact dropdown row (Start / Duration / Resolution) ── */
.atlas-sim-dropdowns-row {
    display: flex;
    gap: 6px;
    margin-top: 4px;
}

.atlas-sim-dropdown-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.atlas-sim-dropdown-label {
    font-size: 10px;
    color: var(--text-secondary, #A0A8B8);
    letter-spacing: 0.3px;
}

.atlas-sim-dropdown {
    appearance: none;
    -webkit-appearance: none;
    background: var(--hover-overlay);
    border: 1px solid var(--control-track);
    border-radius: 4px;
    color: var(--text-primary, #E8ECF0);
    font-size: 11px;
    padding: 4px 20px 4px 6px;
    cursor: pointer;
    outline: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23A0A8B8'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 6px center;
}

.atlas-sim-dropdown:hover {
    border-color: var(--border, #232B3A);
}

.atlas-sim-dropdown:focus {
    border-color: var(--brand-jade, #2DD4A8);
}

.atlas-sim-dropdown option {
    background: var(--surface-2, #1a1e2e);
    color: var(--text-primary, #E8ECF0);
}

.atlas-sim-road-pills {
    display: flex;
    gap: 4px;
}

.atlas-sim-road-pill {
    flex: 1;
    padding: 5px 8px;
    background: var(--surface-1-alpha60, rgba(20, 25, 34, 0.6));
    border: 1px solid var(--border, #232B3A);
    border-radius: 6px;
    color: var(--muted, #7A8599);
    cursor: pointer;
    font-size: 11px;
    font-family: inherit;
    font-weight: 500;
    text-align: center;
    transition: all 0.15s ease;
}

.atlas-sim-road-pill:hover {
    background: color-mix(in srgb, var(--tone-amber, #ffb800) 8%, transparent);
    border-color: color-mix(in srgb, var(--tone-amber, #ffb800) 30%, transparent);
    color: var(--warning, #FFB800);
}

.atlas-sim-road-pill.active {
    background: color-mix(in srgb, var(--tone-amber, #ffb800) 12%, transparent);
    border-color: color-mix(in srgb, var(--tone-amber, #ffb800) 40%, transparent);
    color: var(--warning, #FFB800);
}

.atlas-sim-demand-slider {
    display: flex;
    align-items: center;
    gap: 6px;
}

.atlas-sim-demand-value {
    font-size: 11px;
    font-weight: 600;
    color: var(--warning, #FFB800);
    min-width: 32px;
    text-align: right;
}

.atlas-sim-folio-btn-single {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 12px;
    background: var(--surface-1-alpha60, rgba(20, 25, 34, 0.6));
    border: 1px solid var(--border, #232B3A);
    border-radius: 6px;
    color: var(--muted, #7A8599);
    cursor: pointer;
    font-size: 12px;
    font-family: inherit;
    font-weight: 500;
    transition: all 0.15s ease;
}

.atlas-sim-folio-btn-single:hover {
    background: color-mix(in srgb, var(--brand-jade, #00d68f) 8%, transparent);
    border-color: color-mix(in srgb, var(--brand-jade, #00d68f) 30%, transparent);
    color: var(--brand-jade, #00D68F);
}

/* ═══════════════════════════════════════════════════
   Measure Distance Tool
   ═══════════════════════════════════════════════════ */

.atlas-measure-readout {
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--surface-1-alpha85, rgba(20, 25, 34, 0.85));
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid color-mix(in srgb, var(--tone-amber, #ffb800) 30%, transparent);
    border-radius: 20px;
    color: var(--warning, #FFB800);
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
}

.atlas-measure-close {
    background: transparent;
    border: none;
    color: var(--muted, #7A8599);
    cursor: pointer;
    padding: 2px;
    display: flex;
    align-items: center;
}

.atlas-measure-close:hover {
    color: var(--text-primary, #E6E9EF);
}

/* ── GIS draw toolbar + annotate panel (ZybronAtlas-GIS.md §4) ── */

.atlas-gis-entry {
    position: absolute;
    bottom: 16px;
    right: 16px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    background: var(--atlas-panel-bg, var(--surface-1-alpha85, rgba(20, 25, 34, 0.85)));
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--atlas-panel-border, var(--border, #232B3A));
    border-radius: var(--radius-lg, 12px);
    box-shadow: 0 4px 16px color-mix(in srgb, var(--shadow-color, #000000) 35%, transparent);
    color: var(--text-secondary, #9AA3B2);
    font-size: 13px;
    cursor: pointer;
    z-index: 5;
    transition: color 0.15s, border-color 0.15s;
}

.atlas-gis-entry:hover {
    color: var(--accent, #00D68F);
    border-color: var(--accent, #00D68F);
}

.atlas-gis-entry .material-symbols-outlined {
    font-size: 18px;
}

.atlas-gis-toolbar {
    position: absolute;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px;
    background: var(--atlas-panel-bg, var(--surface-1-alpha85, rgba(20, 25, 34, 0.85)));
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--atlas-panel-border, var(--border, #232B3A));
    border-radius: var(--radius-lg, 12px);
    box-shadow: 0 8px 32px color-mix(in srgb, var(--shadow-color, #000000) 40%, transparent);
    z-index: 6;
}

.atlas-gis-tool {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border: none;
    border-radius: var(--radius-md, 8px);
    background: transparent;
    color: var(--text-secondary, #9AA3B2);
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.atlas-gis-tool:hover {
    background: var(--hover-overlay, rgba(230, 233, 239, 0.08));
    color: var(--text-primary, #E6E9EF);
}

.atlas-gis-tool.active {
    background: color-mix(in srgb, var(--accent, #00D68F) 18%, transparent);
    color: var(--accent, #00D68F);
}

.atlas-gis-tool .material-symbols-outlined {
    font-size: 18px;
}

.atlas-gis-tool-done {
    color: var(--accent, #00D68F);
}

.atlas-gis-toolbar-sep {
    width: 1px;
    align-self: stretch;
    margin: 4px 2px;
    background: var(--border-subtle, rgba(230, 233, 239, 0.05));
}

/* ── GIS Manager menu (expanded card left panel) ─────────────────────
   Fills the directions-drawer column in Regions mode. In expanded mode it
   replaces the floating toolbar + hint; the floating toolbar still covers
   the compact card, which has no left column. */
.zc-shell .zc-skill-card.is-expanded .atlas-gis-toolbar,
.zc-shell .zc-skill-card.is-expanded .atlas-gis-hint { display: none; }

.atlas-gis-menu { display: flex; flex-direction: column; gap: 4px; }
.atlas-gis-menu > header .material-symbols-outlined { font-size: 18px; color: var(--accent, #00D68F); margin-right: 6px; }

.atlas-gis-menu-section {
    margin-top: 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--text-tertiary, #6B7280);
}

.atlas-gis-menu-item {
    display: flex; align-items: center; gap: 10px;
    width: 100%;
    padding: 9px 12px;
    border: 1px solid transparent;
    border-radius: var(--radius-md, 8px);
    background: var(--surface-2, rgba(0, 0, 0, 0.2));
    color: var(--text-secondary, #9AA3B2);
    font-size: 13px;
    text-align: left;
    cursor: pointer;
    transition: background .15s, color .15s, border-color .15s;
}
.atlas-gis-menu-item:hover { color: var(--text-primary, #E6E9EF); border-color: var(--border, #232B3A); }
.atlas-gis-menu-item.active {
    background: color-mix(in srgb, var(--accent, #00D68F) 16%, transparent);
    color: var(--accent, #00D68F);
    border-color: color-mix(in srgb, var(--accent, #00D68F) 40%, transparent);
}
.atlas-gis-menu-item .material-symbols-outlined { font-size: 18px; }

.atlas-gis-menu-hint {
    padding: 8px 10px;
    font-size: 12px;
    color: var(--text-secondary, #9AA3B2);
    background: var(--surface-2, rgba(0, 0, 0, 0.2));
    border-radius: var(--radius-md, 8px);
}
.atlas-gis-menu-draw-actions { display: flex; gap: 6px; }
.atlas-gis-menu-mini {
    display: flex; align-items: center; gap: 5px;
    flex: 1; justify-content: center;
    padding: 7px 8px;
    border: 1px solid var(--border, #232B3A);
    border-radius: var(--radius-md, 8px);
    background: transparent;
    color: var(--text-secondary, #9AA3B2);
    font-size: 12px; cursor: pointer;
}
.atlas-gis-menu-mini:hover { color: var(--text-primary, #E6E9EF); }
.atlas-gis-menu-mini .material-symbols-outlined { font-size: 16px; }
.atlas-gis-menu-mini-done {
    color: var(--accent, #00D68F);
    border-color: color-mix(in srgb, var(--accent, #00D68F) 40%, transparent);
}

.atlas-gis-menu-regions { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.atlas-gis-menu-region {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 10px;
    border-radius: var(--radius-md, 8px);
    color: var(--text-secondary, #9AA3B2);
    font-size: 13px; cursor: pointer;
    transition: background .15s, color .15s;
}
.atlas-gis-menu-region:hover { background: var(--hover-overlay, rgba(230, 233, 239, 0.08)); color: var(--text-primary, #E6E9EF); }
.atlas-gis-menu-region .material-symbols-outlined { font-size: 16px; color: var(--accent, #00D68F); }
.atlas-gis-menu-region-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.atlas-gis-menu-empty { font-size: 12px; color: var(--text-tertiary, #6B7280); padding: 4px 2px; line-height: 1.5; }

/* Create-from-place form (geocode → pins → circle) */
.atlas-gis-menu-place { display: flex; flex-direction: column; gap: 6px; }
.atlas-gis-menu-place-input,
.atlas-gis-menu-radius,
.atlas-gis-menu-unit {
    padding: 8px 10px;
    border: 1px solid var(--border, #232B3A);
    border-radius: var(--radius-md, 8px);
    background: var(--surface-2, rgba(0, 0, 0, 0.2));
    color: var(--text-primary, #E6E9EF);
    font-size: 13px;
    box-sizing: border-box;
}
.atlas-gis-menu-place-input:focus,
.atlas-gis-menu-radius:focus,
.atlas-gis-menu-unit:focus { outline: none; border-color: var(--accent, #00D68F); }
.atlas-gis-menu-place-input { width: 100%; }
.atlas-gis-menu-place-row { display: flex; gap: 6px; align-items: stretch; }
.atlas-gis-menu-radius { width: 64px; }
.atlas-gis-menu-unit { width: 56px; }
.atlas-gis-menu-place-row .atlas-gis-menu-mini { flex: 1; }
.atlas-gis-menu-place-err { font-size: 12px; color: var(--danger, #FF647C); line-height: 1.4; }

/* Region Builder panel */
.atlas-gis-menu-primary {
    background: color-mix(in srgb, var(--accent, #00D68F) 16%, transparent) !important;
    color: var(--accent, #00D68F) !important;
    border-color: color-mix(in srgb, var(--accent, #00D68F) 40%, transparent) !important;
    font-weight: 600;
}
.atlas-gis-builder { display: flex; flex-direction: column; gap: 6px; }
.atlas-gis-builder-label {
    font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
    color: var(--text-tertiary, #6B7280); margin-top: 6px;
}
.atlas-gis-builder .atlas-gis-menu-draw-actions { margin-top: 10px; }

.atlas-gis-hint {
    position: absolute;
    top: 68px;
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 12px;
    background: var(--surface-1-alpha85, rgba(20, 25, 34, 0.85));
    border: 1px solid var(--border-subtle, rgba(230, 233, 239, 0.05));
    border-radius: var(--radius-md, 8px);
    color: var(--text-secondary, #9AA3B2);
    font-size: 12px;
    z-index: 6;
    pointer-events: none;
}

.atlas-gis-annotate {
    position: absolute;
    top: 72px;
    right: 16px;
    width: 300px;
    max-width: calc(100% - 32px);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: var(--atlas-panel-bg, var(--surface-1-alpha85, rgba(20, 25, 34, 0.85)));
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--atlas-panel-border, var(--border, #232B3A));
    border-radius: var(--radius-lg, 12px);
    box-shadow: 0 8px 32px color-mix(in srgb, var(--shadow-color, #000000) 40%, transparent);
    z-index: 7;
}

.atlas-gis-annotate-header {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary, #E6E9EF);
}

.atlas-gis-annotate-name,
.atlas-gis-annotate-code,
.atlas-gis-annotate-meta-key,
.atlas-gis-annotate-meta-val {
    padding: 8px 10px;
    border: 1px solid var(--border, #232B3A);
    border-radius: var(--radius-md, 8px);
    background: var(--surface-2, rgba(0, 0, 0, 0.2));
    color: var(--text-primary, #E6E9EF);
    font-size: 13px;
    width: 100%;
    box-sizing: border-box;
}

.atlas-gis-annotate-name:focus,
.atlas-gis-annotate-code:focus,
.atlas-gis-annotate-meta-key:focus,
.atlas-gis-annotate-meta-val:focus {
    outline: none;
    border-color: var(--accent, #00D68F);
}

.atlas-gis-annotate-meta-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary, #9AA3B2);
    margin-top: 4px;
}

.atlas-gis-annotate-meta-row {
    display: flex;
    gap: 6px;
}

.atlas-gis-annotate-addmeta {
    align-self: flex-start;
    padding: 4px 8px;
    border: none;
    background: transparent;
    color: var(--accent, #00D68F);
    font-size: 12px;
    cursor: pointer;
}

.atlas-gis-annotate-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 8px;
}

.atlas-gis-annotate-cancel,
.atlas-gis-annotate-save {
    padding: 8px 16px;
    border: none;
    border-radius: var(--radius-md, 8px);
    font-size: 13px;
    cursor: pointer;
}

.atlas-gis-annotate-cancel {
    background: transparent;
    color: var(--text-secondary, #9AA3B2);
}

.atlas-gis-annotate-cancel:hover {
    color: var(--text-primary, #E6E9EF);
}

.atlas-gis-annotate-save {
    background: var(--accent, #00D68F);
    color: var(--text-on-brand, #0e1117);
    font-weight: 600;
}

.atlas-gis-annotate-save:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.atlas-gis-annotate-delete {
    padding: 8px 16px;
    border: none;
    border-radius: var(--radius-md, 8px);
    font-size: 13px;
    cursor: pointer;
    background: transparent;
    color: var(--danger, #E5484D);
    margin-right: auto;            /* push to the left, away from Cancel/Save */
}

.atlas-gis-annotate-delete:hover {
    background: color-mix(in srgb, var(--danger, #E5484D) 14%, transparent);
}

.atlas-gis-json {
    position: absolute;
    top: 72px;
    right: 16px;
    width: 360px;
    max-width: calc(100% - 32px);
    max-height: calc(100% - 100px);
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px;
    background: var(--atlas-panel-bg, var(--surface-1-alpha85, rgba(20, 25, 34, 0.85)));
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--atlas-panel-border, var(--border, #232B3A));
    border-radius: var(--radius-lg, 12px);
    box-shadow: 0 8px 32px color-mix(in srgb, var(--shadow-color, #000000) 40%, transparent);
    z-index: 8;
}

.atlas-gis-json-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary, #E6E9EF);
}

.atlas-gis-json-text {
    flex: 1;
    min-height: 200px;
    width: 100%;
    box-sizing: border-box;
    padding: 10px;
    border: 1px solid var(--border, #232B3A);
    border-radius: var(--radius-md, 8px);
    background: var(--surface-2, rgba(0, 0, 0, 0.25));
    color: var(--text-primary, #E6E9EF);
    font-family: var(--font-mono, ui-monospace, monospace);
    font-size: 11px;
    line-height: 1.5;
    resize: vertical;
    white-space: pre;
}


/* ── GIS inspector ─────────────────────────────────────────────────────────────────
   A region was clicked, on the map or in the menu. The panel sits over the map's right
   edge and is gone when nothing is selected, so the map has the space the rest of the
   time. Reads the host's tokens when it is embedded (--zc-*), with its own fallbacks. */
.atlas-gis-inspector {
    position: absolute; top: 10px; right: 10px; bottom: 44px; width: min(300px, 46%); z-index: 6;
    display: flex; flex-direction: column; overflow: hidden;
    background: var(--zc-surface, #fff); color: var(--zc-text, #0F1319);
    border: 1px solid var(--zc-border, #E5E8EE); border-radius: 12px;
    box-shadow: 0 10px 30px color-mix(in srgb, var(--shadow-color, #0f1319) 16%, transparent); font-size: 12.5px;
    animation: atlas-gis-inspector-in .16s ease;
}
@keyframes atlas-gis-inspector-in { from { opacity: 0; transform: translateX(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .atlas-gis-inspector { animation: none; } }
.atlas-gis-inspector header { display: flex; align-items: center; gap: 8px; padding: 12px 12px 10px; border-bottom: 1px solid var(--zc-border, #E5E8EE); }
.atlas-gis-inspector header > .material-symbols-outlined { font-size: 18px; color: var(--zc-tone-jade, #0FA47F); }
.atlas-gis-inspector header h4 { margin: 0; flex: 1; min-width: 0; font-size: 14px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.atlas-gis-inspector .x { background: none; border: none; cursor: pointer; color: var(--zc-text-3, #6B7686); padding: 2px; border-radius: 6px; line-height: 0; }
.atlas-gis-inspector .x:hover { background: var(--zc-surface-2, #F7F8FA); color: var(--zc-text, #0F1319); }
.atlas-gis-inspector .x .material-symbols-outlined { font-size: 17px; }
.atlas-gis-inspector dl { margin: 0; padding: 6px 12px; overflow-y: auto; flex: 1; }
.atlas-gis-inspector dl > div { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--zc-surface-3, #EEF0F4); }
.atlas-gis-inspector dl > div:last-child { border-bottom: none; }
.atlas-gis-inspector dt { font-size: 10px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--zc-text-3, #6B7686); padding-top: 1px; }
.atlas-gis-inspector dd { margin: 0; color: var(--zc-text-2, #3F4A5B); overflow-wrap: anywhere; }
.atlas-gis-inspector footer { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px 12px; border-top: 1px solid var(--zc-border, #E5E8EE); }
.atlas-gis-inspector footer button { font: inherit; font-weight: 600; padding: 7px 10px; border-radius: 8px; cursor: pointer; background: var(--zc-surface-2, #F7F8FA); border: 1px solid var(--zc-border, #E5E8EE); color: var(--zc-text-2, #3F4A5B); }
.atlas-gis-inspector footer button:hover { border-color: var(--zc-jade-ring, rgba(15,164,127,.28)); color: var(--zc-text, #0F1319); }
.atlas-gis-inspector footer button.primary { background: var(--zc-jade, #0FA47F); border-color: var(--zc-jade, #0FA47F); color: var(--text-on-brand, #fff); }
/* Regions · Points — the two kinds of thing a map holds, one list at a time. */
.atlas-gis-embed-tabs { display: flex; gap: 4px; padding: 0 0 8px; }
.atlas-gis-embed-tabs button { flex: 1; display: flex; align-items: center; justify-content: center; gap: 5px; font: inherit; font-size: 12px; font-weight: 600; padding: 6px 8px; border-radius: 8px; cursor: pointer; background: none; border: 1px solid transparent; color: var(--zc-text-3, #6B7686); }
.atlas-gis-embed-tabs button:hover { color: var(--zc-text, #0F1319); background: var(--zc-surface-2, #F7F8FA); }
.atlas-gis-embed-tabs button.is-on { color: var(--zc-text, #0F1319); background: var(--zc-surface-2, #F7F8FA); border-color: var(--zc-border, #E5E8EE); }
/* Three tabs (Regions · Points · Lines) in a 240 px menu: the words and counts fit, the icons do not. */
.atlas-gis-embed-tabs button { min-width: 0; padding: 6px 2px; gap: 3px; font-size: 11.5px; }
.atlas-gis-embed-tabs { gap: 2px; }
.atlas-gis-embed-tabs button .material-symbols-outlined { display: none; }
.atlas-gis-embed-tabs button small { font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 999px; background: var(--zc-surface-3, #EEF0F4); color: var(--zc-text-3, #6B7686); }
.atlas-gis-embed-tabs button.is-on small { background: var(--zc-jade, #0FA47F); color: var(--text-on-brand, #fff); }

/* A library row's menu (⋮): a short list under the row, in the panel's own colours. */
.atlas-gis-embed-item .more { flex: none; border: 0; background: none; padding: 2px; border-radius: 6px; cursor: pointer; color: var(--zc-text-3, #6B7686); line-height: 0; }
.atlas-gis-embed-item .more:hover { background: var(--zc-surface-3, #EEF0F4); color: var(--zc-text, #0F1319); }
.atlas-gis-embed-item .more .material-symbols-outlined { font-size: 16px; }
.atlas-gis-embed-rowmenu { display: flex; flex-direction: column; margin: 0 0 6px 26px; padding: 4px; border: 1px solid var(--zc-border, #E5E8EE); border-radius: 8px; background: var(--zc-surface, #fff); }
.atlas-gis-embed-rowmenu button { display: flex; align-items: center; gap: 8px; border: 0; background: none; padding: 6px 8px; border-radius: 6px; font: inherit; font-size: 12px; text-align: left; cursor: pointer; color: var(--zc-text, #0F1319); }
.atlas-gis-embed-rowmenu button:hover { background: var(--zc-surface-2, #F7F8FA); }
.atlas-gis-embed-rowmenu button .material-symbols-outlined { font-size: 16px; color: var(--zc-text-3, #6B7686); }
.atlas-gis-embed-rowmenu button.danger, .atlas-gis-embed-rowmenu button.danger .material-symbols-outlined { color: var(--zc-tone-red, var(--tone-red, #DB4F38)); }

/* A line in the Lines list: a short stroke in the colour the map draws it (dashed when the map dashes it). */
.atlas-gis-line-swatch { flex: none; width: 18px; height: 0; border-top: 3px solid var(--olg-c, var(--zc-text-3, #6B7686)); border-radius: 2px; margin: 0 1px; }
.atlas-gis-line-swatch.is-dashed { border-top-style: dashed; }
.atlas-gis-line-swatch.is-off { opacity: .55; }
/* Map ⇄ Directions (Phase 9–10): the switch at the top of the map's menu, and the Directions view. Theme tokens only;
   a mode's colour is the theme's --tone-* (drive slate, transit violet, bike jade, walk amber; combinations their own). */
.atlas-gis-embed-modes { display: flex; gap: 2px; padding: 3px; margin-bottom: 10px; border-radius: 10px; background: var(--zc-surface-2, #F7F8FA); border: 1px solid var(--zc-border, #E5E8EE); }
.atlas-gis-embed-modes button { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; border: 0; background: none; padding: 6px; border-radius: 8px; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--zc-text-3, #6B7686); cursor: pointer; }
.atlas-gis-embed-modes button.is-on { background: var(--zc-surface, #fff); color: var(--zc-text, #0F1319); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.atlas-gis-embed-modes .material-symbols-outlined { font-size: 17px; }

.atlas-dir { display: flex; flex-direction: column; gap: 8px; }

/* The trip card: the rail, the fields, the swap. */
.atlas-dir-trip { display: flex; align-items: center; gap: 6px; padding: 6px 6px 6px 4px; border: 1px solid var(--zc-border, #E5E8EE); border-radius: 12px; background: var(--zc-surface, #fff); }
.atlas-dir-trip-fields { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.atlas-dir-field { position: relative; display: flex; align-items: center; gap: 8px; }
.atlas-dir-field + .atlas-dir-field { border-top: 1px solid var(--zc-border, #E5E8EE); }
.atlas-dir-rail { position: relative; flex: none; width: 14px; align-self: stretch; }
.atlas-dir-rail::before { content: ""; position: absolute; left: 50%; top: 50%; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; border-radius: 50%; border: 2px solid var(--zc-text-3, #6B7686); background: var(--zc-surface, #fff); z-index: 1; }
.atlas-dir-field.is-stop .atlas-dir-rail::before { width: 7px; height: 7px; margin: -3.5px 0 0 -3.5px; border-width: 2px; border-radius: 2px; }
.atlas-dir-field.is-dest .atlas-dir-rail::before { border-color: var(--zc-tenant, var(--zc-jade, #0FA47F)); background: var(--zc-tenant, var(--zc-jade, #0FA47F)); }
.atlas-dir-rail::after { content: ""; position: absolute; left: 50%; width: 0; border-left: 2px dotted var(--zc-border, #D2D7E0); top: 0; bottom: 0; margin-left: -1px; }
.atlas-dir-field.is-origin .atlas-dir-rail::after { top: 50%; }
.atlas-dir-field.is-dest .atlas-dir-rail::after { bottom: 50%; }
.atlas-dir-input { flex: 1; min-width: 0; display: flex; align-items: center; gap: 2px; }
.atlas-dir-input input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; padding: 9px 4px; font: inherit; font-size: 13px; color: var(--zc-text, #0F1319); }
.atlas-dir-input input::placeholder { color: var(--zc-text-4, #8A93A3); }
.atlas-dir-field:focus-within { background: var(--zc-surface-2, #F7F8FA); border-radius: 8px; }
.atlas-dir-rm, .atlas-dir-swap { flex: none; border: 0; background: none; padding: 4px; border-radius: 8px; cursor: pointer; color: var(--zc-text-3, #6B7686); line-height: 0; }
.atlas-dir-rm:hover, .atlas-dir-swap:hover { background: var(--zc-surface-2, #F7F8FA); color: var(--zc-text, #0F1319); }
.atlas-dir-rm .material-symbols-outlined { font-size: 16px; }
.atlas-dir-swap .material-symbols-outlined { font-size: 20px; }
.atlas-dir-addstop { align-self: flex-start; display: inline-flex; align-items: center; gap: 5px; margin: -2px 0 0 4px; border: 0; background: none; padding: 3px 6px; border-radius: 6px; font: inherit; font-size: 12px; font-weight: 600; color: var(--zc-text-2, #3F4A5B); cursor: pointer; }
.atlas-dir-addstop:hover { background: var(--zc-surface-2, #F7F8FA); }
.atlas-dir-addstop .material-symbols-outlined { font-size: 17px; color: var(--zc-tenant, var(--zc-jade, #0FA47F)); }

/* Suggestions under a field. */
.atlas-dir-suggest { position: absolute; left: 18px; right: 0; top: calc(100% + 2px); z-index: 8; display: flex; flex-direction: column; padding: 4px; border: 1px solid var(--zc-border, #E5E8EE); border-radius: 10px; background: var(--zc-surface, #fff); box-shadow: 0 10px 28px rgba(0,0,0,.14); }
.atlas-dir-suggest button { display: flex; align-items: center; gap: 8px; border: 0; background: none; padding: 7px 8px; border-radius: 7px; font: inherit; font-size: 12.5px; text-align: left; cursor: pointer; color: var(--zc-text, #0F1319); }
.atlas-dir-suggest button:hover { background: var(--zc-surface-2, #F7F8FA); }
.atlas-dir-suggest .material-symbols-outlined { font-size: 16px; color: var(--zc-text-3, #6B7686); }
.atlas-dir-suggest .tx { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.atlas-dir-suggest small { color: var(--zc-text-3, #6B7686); }

/* Mode: a segmented control. */
.atlas-dir-modes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px; padding: 3px; border-radius: 12px; background: var(--zc-surface-2, #F7F8FA); border: 1px solid var(--zc-border, #E5E8EE); }
.atlas-dir-modes button { display: flex; flex-direction: column; align-items: center; gap: 1px; border: 0; background: none; border-radius: 9px; padding: 6px 2px 5px; cursor: pointer; color: var(--zc-text-3, #6B7686); font: inherit; }
.atlas-dir-modes button .material-symbols-outlined { font-size: 20px; }
.atlas-dir-modes button small { font-size: 10.5px; font-weight: 600; }
.atlas-dir-modes button.is-on { background: var(--zc-surface, #fff); color: var(--zc-tenant, var(--zc-jade, #0FA47F)); box-shadow: 0 1px 3px rgba(0,0,0,.08); }

/* When. */
.atlas-dir-when { display: flex; align-items: center; gap: 6px; padding: 0 2px; }
.atlas-dir-when > .material-symbols-outlined { font-size: 17px; color: var(--zc-text-3, #6B7686); }
.atlas-dir-when select, .atlas-dir-when input { border: 1px solid var(--zc-border, #E5E8EE); border-radius: 8px; padding: 5px 8px; font: inherit; font-size: 12px; background: var(--zc-surface, #fff); color: var(--zc-text, #0F1319); min-width: 0; }
.atlas-dir-when input { flex: 1; }

/* Route options: avoid chips, sort, the person's own driving cost. */
.atlas-dir-opts { display: flex; flex-direction: column; gap: 6px; padding: 8px; border: 1px dashed var(--zc-border, #D2D7E0); border-radius: 10px; }
.atlas-dir-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.atlas-dir-chips button { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--zc-border, #E5E8EE); background: var(--zc-surface, #fff); border-radius: 999px; padding: 3px 9px; font: inherit; font-size: 11.5px; color: var(--zc-text-2, #3F4A5B); cursor: pointer; }
.atlas-dir-chips button .material-symbols-outlined { font-size: 15px; color: var(--zc-text-3, #6B7686); }
.atlas-dir-chips button.is-on { border-color: var(--zc-tenant, var(--zc-jade, #0FA47F)); background: color-mix(in srgb, var(--zc-tenant, var(--zc-jade, #0FA47F)) 10%, transparent); color: var(--zc-text, #0F1319); }
.atlas-dir-chips button.is-on .material-symbols-outlined { color: var(--zc-tenant, var(--zc-jade, #0FA47F)); }
.atlas-dir-sort, .atlas-dir-cost { display: flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--zc-text-3, #6B7686); }
.atlas-dir-sort > span, .atlas-dir-cost > span { flex: none; min-width: 74px; }
.atlas-dir-sort button { border: 1px solid var(--zc-border, #E5E8EE); background: var(--zc-surface, #fff); border-radius: 7px; padding: 3px 9px; font: inherit; font-size: 11.5px; color: var(--zc-text-2, #3F4A5B); cursor: pointer; }
.atlas-dir-sort button.is-on { border-color: var(--zc-tenant, var(--zc-jade, #0FA47F)); color: var(--zc-text, #0F1319); font-weight: 700; }
.atlas-dir-cost input, .atlas-dir-cost select { min-width: 0; border: 1px solid var(--zc-border, #E5E8EE); border-radius: 7px; padding: 3px 6px; font: inherit; font-size: 11.5px; background: var(--zc-surface, #fff); color: var(--zc-text, #0F1319); }
.atlas-dir-cost input { width: 58px; }
.atlas-dir-cost input.cur { width: 64px; }
.atlas-dir-card-cost { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; color: var(--zc-text, #0F1319); }
.atlas-dir-card-cost .material-symbols-outlined { font-size: 15px; color: var(--zc-text-3, #6B7686); }
.atlas-dir-tag.is-warn { background: color-mix(in srgb, var(--tone-amber, #B87508) 14%, transparent); color: var(--tone-amber, #B87508); }

/* Actions. */
.atlas-dir-actions { display: flex; flex-direction: column; gap: 6px; }
.atlas-dir-go, .atlas-dir-compare { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border-radius: 10px; padding: 9px 12px; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.atlas-dir-go { border: 0; background: var(--zc-tenant, var(--zc-jade, #0FA47F)); color: var(--text-on-brand, #fff); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.atlas-dir-compare { border: 1px solid var(--zc-border, #E5E8EE); background: var(--zc-surface, #fff); color: var(--zc-text, #0F1319); }
.atlas-dir-compare .material-symbols-outlined { color: var(--zc-tenant, var(--zc-jade, #0FA47F)); }
.atlas-dir-go .material-symbols-outlined, .atlas-dir-compare .material-symbols-outlined { font-size: 18px; }
.atlas-dir-go:disabled, .atlas-dir-compare:disabled { opacity: .65; cursor: default; }
.atlas-dir-hint { margin: -2px 4px 0; font-size: 11px; color: var(--zc-text-3, #6B7686); line-height: 1.45; }
.atlas-dir-error { display: flex; gap: 6px; align-items: flex-start; margin: 0; padding: 8px 10px; border-radius: 8px; font-size: 12px; background: color-mix(in srgb, var(--tone-red, #DB4F38) 9%, transparent); color: var(--zc-text, #0F1319); }
.atlas-dir-error .material-symbols-outlined { font-size: 16px; color: var(--tone-red, #DB4F38); }

/* By time of day: drive against transit at each hour. */
.atlas-dir-bytime { display: flex; gap: 6px; }
.atlas-dir-bytime .atlas-dir-compare { flex: 1; }
.atlas-dir-bytime select { border: 1px solid var(--zc-border, #E5E8EE); border-radius: 10px; padding: 0 8px; font: inherit; font-size: 12px; background: var(--zc-surface, #fff); color: var(--zc-text, #0F1319); }
.atlas-dir-profile { display: flex; flex-direction: column; gap: 4px; padding: 10px; border: 1px solid var(--zc-border, #E5E8EE); border-radius: 12px; background: var(--zc-surface, #fff); }
.atlas-dir-profile-legend { display: flex; align-items: center; gap: 6px; font-size: 10.5px; color: var(--zc-text-3, #6B7686); margin-bottom: 4px; }
.atlas-dir-profile-legend .sw { width: 10px; height: 10px; border-radius: 3px; margin-left: 4px; }
.atlas-dir-profile-legend .sw:first-child { margin-left: 0; }
.sw.is-drive, .bar.is-drive { background: color-mix(in srgb, var(--tone-slate, #475569) 70%, transparent); }
.sw.is-transit, .bar.is-transit { background: color-mix(in srgb, var(--tone-violet, #7C3AED) 75%, transparent); }
.atlas-dir-profile-row { display: grid; grid-template-columns: 38px 1fr 34px; align-items: center; gap: 6px; padding: 2px 4px; border-radius: 6px; }
.atlas-dir-profile-row.is-best { background: color-mix(in srgb, var(--zc-tenant, var(--zc-jade, #0FA47F)) 9%, transparent); }
.atlas-dir-profile-row.is-worst { background: color-mix(in srgb, var(--tone-amber, #B87508) 9%, transparent); }
.atlas-dir-profile-row .t { font-size: 11px; font-weight: 700; color: var(--zc-text-2, #3F4A5B); font-variant-numeric: tabular-nums; }
.atlas-dir-profile-row .bars { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.atlas-dir-profile-row .bar { display: block; min-width: 22px; height: 12px; border-radius: 3px; position: relative; }
.atlas-dir-profile-row .bar b { position: absolute; left: 4px; top: -1px; font-size: 9.5px; color: #fff; font-weight: 700; line-height: 14px; white-space: nowrap; }
.atlas-dir-profile-row .r { font-size: 11px; font-weight: 700; text-align: right; color: var(--zc-text, #0F1319); font-variant-numeric: tabular-nums; }

/* Results: cards with the mode's colour down the left. */
.atlas-dir-results-hd { margin: 6px 2px 0; font-size: 10.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--zc-text-3, #6B7686); }
.atlas-dir-card { position: relative; display: flex; flex-direction: column; gap: 5px; text-align: left; border: 1px solid var(--zc-border, #E5E8EE); border-radius: 12px; padding: 10px 12px 10px 15px; background: var(--zc-surface, #fff); cursor: pointer; font: inherit; color: var(--zc-text, #0F1319); overflow: hidden; transition: border-color .12s, box-shadow .12s; }
.atlas-dir-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--card-c, var(--tone-blue, #2563EB)); }
.atlas-dir-card:hover { border-color: color-mix(in srgb, var(--card-c, #2563EB) 45%, var(--zc-border, #E5E8EE)); }
.atlas-dir-card.is-on { border-color: var(--card-c, #2563EB); box-shadow: 0 0 0 3px color-mix(in srgb, var(--card-c, #2563EB) 18%, transparent); }
.atlas-dir-card-top { display: flex; align-items: center; gap: 8px; }
.atlas-dir-card-time { font-size: 18px; font-weight: 800; letter-spacing: -.01em; }
.atlas-dir-card-top .atlas-dir-card-time:last-child { margin-left: auto; }
.atlas-dir-card-dist { font-size: 11.5px; color: var(--zc-text-3, #6B7686); }
.atlas-dir-card-top .atlas-dir-card-dist { margin-left: auto; }
.atlas-dir-card-sum { font-size: 12.5px; color: var(--zc-text-2, #3F4A5B); }
.atlas-dir-card-when { font-size: 11.5px; font-weight: 600; color: var(--zc-text-2, #3F4A5B); }
.atlas-dir-card-note { font-size: 11px; color: var(--zc-text-3, #6B7686); line-height: 1.4; }
.atlas-dir-opt { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; }
.atlas-dir-opt .material-symbols-outlined { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; font-size: 16px; color: var(--card-c, #2563EB); background: color-mix(in srgb, var(--card-c, #2563EB) 14%, transparent); }
.atlas-dir-tag { font-size: 10px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; padding: 2px 7px; border-radius: 999px; background: color-mix(in srgb, var(--zc-tenant, var(--zc-jade, #0FA47F)) 14%, transparent); color: var(--zc-tenant, var(--zc-jade, #0FA47F)); }
.atlas-dir-legs { display: flex; flex-wrap: wrap; gap: 4px; }
.atlas-dir-leg { display: inline-flex; align-items: center; gap: 3px; padding: 2px 7px; border-radius: 999px; font-size: 11px; background: var(--zc-surface-3, #EEF0F4); color: var(--zc-text-2, #3F4A5B); }
.atlas-dir-leg .material-symbols-outlined { font-size: 13px; }
.atlas-dir-leg.is-ride { background: color-mix(in srgb, var(--leg-c, var(--tone-violet, #7C3AED)) 16%, transparent); color: var(--zc-text, #0F1319); }
.atlas-dir-credit { font-size: 10.5px; color: var(--zc-text-4, #8A93A3); margin: 0 4px; }

/* ROUTES (Phase 12): the map's saved routes, in groups, shown together. */
.atlas-dir-cardwrap { position: relative; display: flex; flex-direction: column; }
.atlas-dir-save { position: absolute; top: 8px; right: 8px; z-index: 1; border: 1px solid var(--zc-border, #E5E8EE); background: var(--zc-surface, #fff); border-radius: 8px; padding: 3px; line-height: 0; cursor: pointer; color: var(--zc-text-3, #6B7686); }
.atlas-dir-save:hover { color: var(--zc-tenant, var(--zc-jade, #0FA47F)); border-color: var(--zc-tenant, var(--zc-jade, #0FA47F)); }
.atlas-dir-save .material-symbols-outlined { font-size: 17px; }
.atlas-dir-cardwrap .atlas-dir-card-top { padding-right: 30px; }
.atlas-dir-savegroup { display: flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--zc-text-3, #6B7686); }
.atlas-dir-savegroup .material-symbols-outlined { font-size: 16px; color: var(--zc-tenant, var(--zc-jade, #0FA47F)); }
.atlas-dir-savegroup input { flex: 1; min-width: 0; border: 1px solid var(--zc-border, #E5E8EE); border-radius: 7px; padding: 3px 7px; font: inherit; font-size: 11.5px; background: var(--zc-surface, #fff); color: var(--zc-text, #0F1319); }
.atlas-dir-saved { display: flex; gap: 6px; align-items: center; margin: 0; padding: 6px 9px; border-radius: 8px; font-size: 11.5px; background: color-mix(in srgb, var(--zc-tenant, var(--zc-jade, #0FA47F)) 9%, transparent); color: var(--zc-text, #0F1319); }
.atlas-dir-saved .material-symbols-outlined { font-size: 15px; color: var(--zc-tenant, var(--zc-jade, #0FA47F)); }
.atlas-routes { display: flex; flex-direction: column; gap: 6px; }
.atlas-routes-hd { display: flex; flex-direction: column; gap: 6px; }
.atlas-routes-hd p { margin: 0 2px; font-size: 11.5px; color: var(--zc-text-3, #6B7686); line-height: 1.45; }
.atlas-routes-group { display: flex; align-items: center; gap: 2px; margin-top: 6px; }
.atlas-routes-group-name { flex: 1; min-width: 0; display: flex; align-items: center; gap: 2px; border: 0; background: none; padding: 2px; font: inherit; font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--zc-text-3, #6B7686); cursor: pointer; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.atlas-routes-group-name .material-symbols-outlined { font-size: 16px; }
.atlas-routes-group > button:not(.atlas-routes-group-name) { border: 0; background: none; padding: 3px; border-radius: 6px; line-height: 0; cursor: pointer; color: var(--zc-text-3, #6B7686); }
.atlas-routes-group > button:not(.atlas-routes-group-name):hover, .atlas-routes-group > button.is-on { background: var(--zc-surface-2, #F7F8FA); color: var(--zc-text, #0F1319); }
.atlas-routes-group .material-symbols-outlined { font-size: 16px; }
.atlas-gis-embed-item.is-hidden .nm { opacity: .55; }
.atlas-routes-compare { width: 100%; border-collapse: collapse; font-size: 11px; background: var(--zc-surface, #fff); border: 1px solid var(--zc-border, #E5E8EE); border-radius: 8px; overflow: hidden; }
.atlas-routes-compare th { text-align: left; font-weight: 700; color: var(--zc-text-3, #6B7686); padding: 4px 6px; background: var(--zc-surface-2, #F7F8FA); }
.atlas-routes-compare td { padding: 4px 6px; border-top: 1px solid var(--zc-border, #E5E8EE); font-variant-numeric: tabular-nums; }
.atlas-routes-compare td:first-child { display: flex; align-items: center; gap: 5px; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.atlas-routes-compare tr.is-best td { background: color-mix(in srgb, var(--zc-tenant, var(--zc-jade, #0FA47F)) 8%, transparent); font-weight: 700; }
.atlas-routes-edit { display: flex; gap: 4px; margin: 0 0 6px 26px; }
.atlas-routes-edit input { flex: 1; min-width: 0; border: 1px solid var(--zc-border, #E5E8EE); border-radius: 7px; padding: 3px 7px; font: inherit; font-size: 12px; background: var(--zc-surface, #fff); color: var(--zc-text, #0F1319); }
.atlas-routes-edit button { border: 1px solid var(--zc-border, #E5E8EE); background: var(--zc-surface, #fff); border-radius: 7px; padding: 3px 8px; font: inherit; font-size: 11.5px; cursor: pointer; }
.atlas-routes-detail { display: flex; flex-direction: column; gap: 5px; margin: 0 0 8px 26px; padding: 8px 10px; border: 1px solid var(--zc-border, #E5E8EE); border-radius: 10px; background: var(--zc-surface, #fff); }

/* The library's filters: All · On no map · This week. */
.atlas-gis-embed-filters { display: flex; flex-wrap: wrap; gap: 4px; margin: 2px 0 6px; }
.atlas-gis-embed-filters button { border: 1px solid var(--zc-border, #E5E8EE); background: none; border-radius: 999px; padding: 2px 8px; font: inherit; font-size: 11px; color: var(--zc-text-3, #6B7686); cursor: pointer; }
.atlas-gis-embed-filters button.is-on { background: var(--zc-jade-bg, rgba(15,164,127,.10)); border-color: var(--zc-jade-ring, rgba(15,164,127,.28)); color: var(--zc-text, #0F1319); }
/* A tag group's heading in the library. */
.atlas-gis-embed-tag { text-transform: none; letter-spacing: 0; }
/* Tags in an item's details: chips, and a box to add one. */
.atlas-gis-tags { margin: 8px 0; }
.atlas-gis-tags-hd { font-size: 11px; font-weight: 700; color: var(--zc-text-3, #6B7686); margin-bottom: 4px; }
.atlas-gis-tags-row { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.atlas-gis-tag { display: inline-flex; align-items: center; gap: 2px; padding: 1px 4px 1px 8px; border-radius: 999px; font-size: 11px; background: var(--zc-surface-3, #EEF0F4); color: var(--zc-text, #0F1319); }
.atlas-gis-tag button { border: 0; background: none; padding: 0; cursor: pointer; line-height: 0; color: var(--zc-text-3, #6B7686); }
.atlas-gis-tag .material-symbols-outlined { font-size: 13px; }
.atlas-gis-tags-row input { flex: 1 1 90px; min-width: 0; border: 1px solid var(--zc-border, #E5E8EE); border-radius: 6px; padding: 3px 6px; font: inherit; font-size: 12px; background: var(--zc-surface, #fff); color: inherit; }

/* A group heading that carries an action (a layer's "Keep all"). */
.atlas-gis-embed-group--act { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.atlas-gis-embed-group--act button { border: 0; background: none; padding: 2px 6px; border-radius: 6px; font: inherit; font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--zc-jade, #0FA47F); cursor: pointer; }
.atlas-gis-embed-group--act button:hover { background: var(--zc-surface-2, #F7F8FA); }
.atlas-gis-embed-group--act button:disabled { opacity: .5; cursor: default; }

/* A point's icon, as a chip: the same coloured disc the map draws. */
.material-symbols-outlined.poi { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; flex: none; border-radius: 50%; color: #fff !important; font-size: 13px !important; font-variation-settings: 'FILL' 1; }
.material-symbols-outlined.poi.is-off { opacity: .55; }
.atlas-gis-embed-item .nm small { font-weight: 400; color: var(--zc-text-3, #6B7686); }

.atlas-gis-poi-edit { border-top: 1px solid var(--zc-border, #E5E8EE); padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; flex: none; }
.atlas-gis-poi-edit > input { font: inherit; padding: 6px 8px; border-radius: 7px; border: 1px solid var(--zc-border, #E5E8EE); background: var(--zc-surface, #fff); color: var(--zc-text, #0F1319); min-width: 0; }
.atlas-gis-poi-edit > input:focus { outline: none; border-color: var(--zc-jade, #0FA47F); }

.atlas-icon-picker { display: flex; flex-direction: column; gap: 6px; }
.atlas-icon-picker .grid { display: grid; grid-template-columns: repeat(9, 1fr); gap: 3px; }
.atlas-icon-picker .grid button { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; padding: 0; border-radius: 6px; cursor: pointer; background: var(--zc-surface-2, #F7F8FA); border: 1px solid transparent; color: var(--zc-text-2, #3F4A5B); }
.atlas-icon-picker .grid button:hover { border-color: var(--zc-border, #E5E8EE); color: var(--zc-text, #0F1319); }
.atlas-icon-picker .grid button.is-on { color: #fff; }
.atlas-icon-picker .grid button .material-symbols-outlined { font-size: 16px; }
.atlas-icon-picker .row { display: flex; align-items: center; gap: 6px; }
.atlas-icon-picker .row .preview { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; flex: none; border-radius: 50%; color: #fff; font-size: 16px; font-variation-settings: 'FILL' 1; }
.atlas-icon-picker .row input { flex: 1; min-width: 0; font: inherit; font-size: 12px; padding: 5px 8px; border-radius: 7px; border: 1px solid var(--zc-border, #E5E8EE); background: var(--zc-surface, #fff); color: var(--zc-text, #0F1319); }
.atlas-icon-picker .swatches { display: flex; gap: 5px; }
.atlas-icon-picker .swatches button { width: 18px; height: 18px; padding: 0; border-radius: 50%; cursor: pointer; border: 2px solid var(--zc-surface, #fff); box-shadow: 0 0 0 1px var(--zc-border, #E5E8EE); }
.atlas-icon-picker .swatches button.is-on { box-shadow: 0 0 0 2px var(--zc-text, #0F1319); }

/* Delete: in the details panel only, quiet until asked for, never offered for a region something else uses. */
.atlas-gis-inspector footer button.danger-quiet { background: none; border-color: transparent; color: var(--zc-text-3, #6B7686); font-weight: 500; }
.atlas-gis-inspector footer button.danger-quiet:hover:not(:disabled) { color: var(--danger, #C6283C); border-color: var(--danger, #C6283C); background: none; }
.atlas-gis-inspector footer button:disabled { opacity: .5; cursor: default; }
.atlas-gis-inspector footer button.danger { background: var(--danger, #C6283C); border-color: var(--danger, #C6283C); color: var(--text-on-brand, #fff); }
.atlas-gis-delete-why { margin: 0; font-size: 11px; line-height: 1.4; color: var(--zc-text-3, #6B7686); }
.atlas-gis-delete-confirm { border: 1px solid var(--danger, #C6283C); border-radius: 8px; padding: 9px 10px; background: color-mix(in srgb, var(--danger, #c6283c) 5%, transparent); }
.atlas-gis-delete-confirm p { margin: 0 0 8px; font-size: 12px; line-height: 1.45; color: var(--zc-text-2, #3F4A5B); }
.atlas-gis-delete-confirm > div { display: flex; gap: 6px; }
.atlas-gis-delete-confirm > div button { flex: 1; }
.atlas-gis-embed-group.is-toggle { display: flex; align-items: center; gap: 2px; width: 100%; background: none; border: none; cursor: pointer; text-align: left; font-family: inherit; }
.atlas-gis-embed-group.is-toggle .material-symbols-outlined { font-size: 16px; }
.atlas-gis-embed-item.is-deleted { opacity: .75; }
.atlas-gis-embed-item.is-deleted .nm small { margin-left: 6px; font-size: 10px; color: var(--zc-text-3, #6B7686); }
.atlas-gis-annotate-refused { margin: 6px 0 0; font-size: 12px; line-height: 1.4; color: var(--error, #C6283C); }

/* History: every save of a region is a version, and any earlier one can be brought back. */
.atlas-gis-history { border-top: 1px solid var(--zc-border, #E5E8EE); padding: 8px 12px 10px; max-height: 34%; overflow-y: auto; flex: none; }
.atlas-gis-history h5 { margin: 0 0 4px; font-size: 10px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--zc-text-3, #6B7686); }
.atlas-gis-history ol { list-style: none; margin: 0; padding: 0; }
.atlas-gis-history li { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; grid-template-areas: "v what act" "v when act"; column-gap: 6px; align-items: center; padding: 5px 0; border-bottom: 1px solid var(--zc-surface-3, #EEF0F4); }
.atlas-gis-history li:last-child { border-bottom: none; }
.atlas-gis-history .v { grid-area: v; font-size: 11px; font-weight: 700; color: var(--zc-text-3, #6B7686); font-variant-numeric: tabular-nums; }
.atlas-gis-history li.is-current .v { color: var(--zc-jade, #0FA47F); }
.atlas-gis-history .what { grid-area: what; font-size: 12px; color: var(--zc-text-2, #3F4A5B); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.atlas-gis-history .when { grid-area: when; font-size: 11px; color: var(--zc-text-3, #6B7686); }
.atlas-gis-history .now { grid-area: act; font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--zc-jade, #0FA47F); }
.atlas-gis-history li button { grid-area: act; font: inherit; font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 6px; cursor: pointer; background: var(--zc-surface-2, #F7F8FA); border: 1px solid var(--zc-border, #E5E8EE); color: var(--zc-text-2, #3F4A5B); }
.atlas-gis-history li button:hover:not(:disabled) { border-color: var(--zc-jade-ring, rgba(15,164,127,.28)); color: var(--zc-text, #0F1319); }
.atlas-gis-history li button:disabled { opacity: .5; cursor: default; }
.atlas-gis-history .more { margin-top: 4px; font: inherit; font-size: 11px; background: none; border: none; padding: 2px 0; cursor: pointer; color: var(--zc-jade, #0FA47F); }
.atlas-gis-embed-item .nm.is-inspected { color: var(--zc-jade, #0FA47F); font-weight: 700; }
@media (max-width: 700px) { .atlas-gis-inspector { left: 10px; right: 10px; width: auto; top: auto; max-height: 55%; } }
/* Data layers (atlas.gis.showLayer): the legend of what is drawn read-only beneath the regions. Colours are the
   layer's own theme tones (--tone-*), set inline per row; nothing here names a kind. */
.atlas-gis-overlay-legend {
    position: absolute; left: 10px; bottom: 44px; z-index: 5; max-width: min(240px, 60%); max-height: 45%; overflow-y: auto;
    display: flex; flex-direction: column; gap: 10px; padding: 10px 12px;
    background: color-mix(in srgb, var(--zc-surface, #fff) 94%, transparent); color: var(--zc-text-2, #3F4A5B);
    border: 1px solid var(--zc-border, #E5E8EE); border-radius: 10px; font-size: 11.5px;
    box-shadow: 0 6px 18px color-mix(in srgb, var(--shadow-color, #0f1319) 12%, transparent);
}
.atlas-gis-overlay-legend .olg-title { font-weight: 700; color: var(--zc-text, #0F1319); margin-bottom: 5px; }
.atlas-gis-overlay-legend .olg-row { display: flex; align-items: center; gap: 8px; padding: 2px 0; }
.atlas-gis-overlay-legend .olg-swatch { flex: 0 0 22px; height: var(--olg-w, 3px); border-radius: 2px; background: var(--olg-c); }
.atlas-gis-overlay-legend .olg-swatch.is-dashed { background: repeating-linear-gradient(90deg, var(--olg-c) 0 5px, transparent 5px 9px); }
.atlas-gis-overlay-legend .olg-src { margin-top: 4px; font-size: 10px; color: var(--zc-text-3, #6B7686); }
