#home-atlas-panel [data-atlas-map-mode] {
    --survey-fill: color-mix(in srgb, var(--sw-warm, #cad8d8) 72%, var(--sw-bg, #12181d));
    --survey-neutral: color-mix(in srgb, var(--sw-muted, #a9bac2) 21%, var(--sw-bg, #12181d));
    --survey-outline: color-mix(in srgb, var(--sw-muted, #a9bac2) 45%, var(--sw-bg, #12181d));
}

#home-atlas-panel [data-atlas-map-mode] .mineral-atlas__searchbar { grid-template-columns: minmax(0, 1fr); }

@media (forced-colors: none) {
    #home-atlas-panel > .mineral-atlas[data-atlas-map-mode] > section.mineral-atlas__workspace { background: transparent; }
    #home-atlas-panel [data-atlas-map-mode] .mineral-atlas__searchbar { background: var(--sw-bg-raised, #171e24); }
    #home-atlas-panel > .mineral-atlas[data-atlas-map-mode] .mineral-atlas__map-column {
        --atlas-water: color-mix(in srgb, var(--sw-bg, #090a0c) 66%, transparent);
        background: var(--atlas-water);
    }
    #home-atlas-panel [data-atlas-map-mode] .mineral-atlas__ocean { fill: transparent; }
}

#home-atlas-panel [data-atlas-map-mode] .mineral-atlas__surface-modes,
#home-atlas-panel [data-atlas-map-mode] [hidden] { display: none !important; }

.mineral-atlas__map-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px 14px;
    margin-bottom: 8px;
}

.mineral-atlas__map-controls [data-atlas-mode-bar] {
    display: inline-flex;
    flex-wrap: wrap;
    border: 1px solid var(--sw-line-bright, #465561);
    background: var(--sw-panel, #171e24);
}

.mineral-atlas__map-controls [data-atlas-mode] {
    min-height: 40px;
    padding: 7px 13px;
    border: 0;
    color: var(--sw-muted, #adbac6);
    background: transparent;
    font: 600 .75rem/1.3 var(--sw-sans, sans-serif);
}

.mineral-atlas__map-controls [data-atlas-mode] + [data-atlas-mode] { border-inline-start: 1px solid var(--sw-line-bright, #465561); }
.mineral-atlas__map-controls [data-atlas-mode]:disabled { opacity: .5; }
.mineral-atlas__map-controls [data-atlas-mode]:not(:disabled):hover,
.mineral-atlas__map-controls [data-atlas-mode][aria-pressed='true'] {
    color: var(--sw-ink, #eff3f6);
    background: var(--sw-panel-soft, #2b363e);
}
.mineral-atlas__map-controls [data-atlas-mode][aria-pressed='true'] { box-shadow: inset 0 -2px var(--atlas-accent); }

.mineral-atlas__map-controls :is([data-atlas-terrain-option], .mineral-atlas__epithermal-toggle) {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 40px;
    color: var(--sw-ink-soft, #ced8df);
    font: .75rem/1.4 var(--sw-sans, sans-serif);
}
.mineral-atlas__map-controls [data-atlas-terrain-toggle] { accent-color: var(--sw-warm, #c8d1da); }
.mineral-atlas__epithermal-toggle input { margin: 0; accent-color: #74fff1; }

.mineral-atlas__map-controls [data-atlas-figure-controls] {
    display: flex;
    flex: 1 1 100%;
    flex-wrap: wrap;
    align-items: center;
    gap: 3px 12px;
}
.mineral-atlas__map-controls [data-atlas-figure-controls] .mineral-atlas__views {
    width: auto;
    justify-content: flex-start;
    border: 0;
    padding: 0;
}
.mineral-atlas__map-controls [data-atlas-period] { margin: 0; text-align: start; }

#home-atlas-panel [data-atlas-map-mode='survey'] .mineral-atlas__map .mineral-atlas__country[data-survey-coverage] {
    fill: var(--survey-neutral);
    stroke: var(--survey-outline);
    stroke-dasharray: none;
}
#home-atlas-panel [data-atlas-map-mode='survey'] .mineral-atlas__map .mineral-atlas__country[data-survey-coverage='available'] { fill: var(--survey-fill); }
#home-atlas-panel [data-atlas-map-mode='survey'] .mineral-atlas__map.is-terrain [data-survey-coverage='available'] { fill-opacity: .42; }
#home-atlas-panel [data-atlas-map-mode='survey'] .mineral-atlas__map [data-survey-coverage]:is(:hover, :focus-visible, .is-selected) {
    stroke: var(--sw-ink, #f4f7f8);
    stroke-opacity: 1;
    stroke-width: 1.8;
}
#home-atlas-panel [data-atlas-map-mode='survey'] .mineral-atlas__map [data-survey-coverage='unavailable']:is(:hover, :focus-visible, .is-selected) {
    fill: color-mix(in srgb, var(--survey-neutral) 74%, var(--sw-ink, #f4f7f8));
}

#home-atlas-panel [data-atlas-coverage-legend] {
    display: flex;
    flex-basis: 100%;
    flex-wrap: wrap;
    gap: 5px 13px;
    color: var(--sw-ink-soft, #ced8df);
}
[data-atlas-coverage-legend] > span { display: inline-flex; align-items: center; gap: 6px; }
[data-atlas-coverage-legend] [data-survey-coverage='available'] { background: var(--survey-fill); }
[data-atlas-coverage-legend] [data-survey-coverage='unavailable'] { background: var(--survey-neutral); }

#home-atlas-panel .mineral-atlas__coverage-results { gap: 0; }
.mineral-atlas__coverage-country {
    display: flex;
    justify-content: space-between;
    gap: 4px 8px;
    align-items: baseline;
    width: 100%;
    min-height: 40px;
    padding: 7px 8px;
    border: 0;
    color: inherit;
    background: transparent;
    text-align: start;
    font: .78rem/1.35 var(--sw-sans, sans-serif);
}
.mineral-atlas__coverage-country:hover,
.mineral-atlas__coverage-country:focus-visible { background: var(--sw-panel-soft, #2b363e); }
.mineral-atlas__coverage-country .mineral-atlas__catalog-count { white-space: nowrap; }

.mineral-atlas__coverage-detail { padding: 12px; }
.mineral-atlas__coverage-detail h3 { font-size: 1rem; }
.mineral-atlas__coverage-detail p { margin-top: 8px; }
.mineral-atlas__coverage-back { margin-bottom: 10px; }
.mineral-atlas__coverage-back,
.mineral-atlas__figures-actions button {
    min-height: 36px;
    padding: 6px 10px;
    border: 1px solid var(--sw-line-bright, #465561);
    background: var(--sw-panel, #171e24);
    color: var(--sw-ink, #eff3f6);
    font: 600 .72rem/1.3 var(--sw-sans, sans-serif);
}
.mineral-atlas__coverage-back:hover,
.mineral-atlas__figures-actions button:hover { background: var(--sw-panel-soft, #2b363e); }

.mineral-atlas__figures-sidebar :is(h2, .mineral-atlas__eyebrow) { margin: 0 0 6px; }
.mineral-atlas__figures-sidebar h2 { font: 500 1.38rem/1.2 var(--sw-serif, serif); }
.mineral-atlas__figures-sidebar .mineral-atlas__figure-value {
    margin: 12px 0 3px;
    color: var(--sw-ink, #eff3f6);
    overflow-wrap: anywhere;
    font: 500 clamp(1.6rem, 2.7vw, 2.4rem)/1.1 var(--sw-serif, serif);
    font-variant-numeric: tabular-nums;
}
.mineral-atlas__figures-sidebar .mineral-atlas__figure-value.is-unavailable { font-size: 1rem; }
.mineral-atlas__figures-sidebar .mineral-atlas__world-value { font-size: clamp(1.6rem, 3vw, 2.65rem); }
.mineral-atlas__figures-sidebar .mineral-atlas__world-note,
.mineral-atlas__figures-sidebar .mineral-atlas__coverage { color: var(--sw-muted, #adbac6); }
.mineral-atlas__figures-sidebar .mineral-atlas__world-note a { color: var(--sw-warm, #c8d1da); text-underline-offset: 3px; }
.mineral-atlas__figures-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }

@media (max-width: 850px) {
    #home-atlas-panel .mineral-atlas__coverage-results { max-height: 330px; overflow-y: auto; }
}

@media (pointer: coarse) {
    .mineral-atlas__map-controls :is([data-atlas-mode], [data-atlas-terrain-option], .mineral-atlas__epithermal-toggle),
    .mineral-atlas__coverage-country,
    .mineral-atlas__coverage-back,
    .mineral-atlas__figures-actions button { min-height: 44px; }
}

@media (forced-colors: active) {
    #home-atlas-panel [data-atlas-map-mode='survey'] {
        --survey-fill: Highlight;
        --survey-neutral: Canvas;
        --survey-outline: CanvasText;
    }
    [data-atlas-map-mode='survey'] .mineral-atlas__map [data-survey-coverage],
    [data-atlas-coverage-legend] [data-survey-coverage] { forced-color-adjust: none; }
    [data-atlas-mode][aria-pressed='true'] { outline: 2px solid Highlight; outline-offset: -2px; }
}
