/* RESEARCH SHELL | Source geometry converted at 1440 × 1000; mobile at 440 × 956. */
:root {
    --ink: #172229;
    --muted: #6d787e;
    --blue: #389df7;
    --paper: #f8fafb;
    --fetch-blue: #4BA8FC;
    --fetch-red: #EB5858;
    --border-width: 0.03vw;
    --border-color: #EAEAEA;
    --border: solid var(--border-width) var(--border-color);
    --sidebar-width: 15.97222222vw;
    --content-padding: 3.61111111vw;
    --card-radius: 0.97222222vw;
    font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
    color: var(--ink);
    background: var(--paper);
    font-size: 0.97222222vw;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
}

a {
    color: inherit;
    text-decoration: none;
}

#retry-map {
    font: inherit;
    cursor: pointer;
    color: var(--ink);
    background: white;
    border: var(--border);
    border-radius: 0.55555556vw;
    padding: 0.69444444vw 1.11111111vw;
}

#retry-map:hover:not(:disabled) {
    background: #edf6ff;
}

#retry-map:disabled {
    cursor: default;
    opacity: 0.5;
}

:focus-visible {
    outline: 0.20833333vw solid var(--blue);
    outline-offset: 0.27777778vw;
}

[hidden] {
    display: none !important;
}

.skip {
    position: fixed;
    top: -10vw;
    padding: 0.83333333vw;
    background: white;
    z-index: 10;
}

.skip:focus {
    top: 0.69444444vw;
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-width);
    background: white;
    border-right: var(--border);
    padding: 2.5vw 1.66666667vw;
    display: flex;
    flex-direction: column;
    z-index: 2;
}

.brand {
    font-size: 2.56944444vw;
    line-height: 1;
}

.brand span {
    color: var(--blue);
}

.brand-caption {
    margin: 0.76388889vw 0 3.33333333vw;
    color: var(--muted);
    font-size: 0.83333333vw;
    letter-spacing: 0.13888889vw;
    text-transform: uppercase;
}

.nav-label {
    font-size: 0.69444444vw;
    letter-spacing: 0.125vw;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
}

.sidebar nav {
    display: grid;
    gap: 0.48611111vw;
    margin: 0.90277778vw 0 2.36111111vw;
}

.nav-item {
    display: flex;
    justify-content: space-between;
    gap: 0.90277778vw;
    padding: 0.83333333vw;
    font-size: 0.90277778vw;
    font-weight: 600;
    border-radius: 0.625vw;
    color: #5a676e;
}

.nav-item:hover, .nav-item.active {
    color: #1379cf;
    background: #edf6ff;
}

.side-note {
    margin-top: auto;
    border-top: var(--border);
    padding-top: 1.59722222vw;
    font-size: 0.76388889vw;
    line-height: 1.8;
    color: var(--muted);
}

.dot {
    display: inline-block;
    width: 0.41666667vw;
    height: 0.41666667vw;
    background: var(--blue);
    border-radius: 50%;
    margin-right: 0.48611111vw;
}

main {
    margin-left: var(--sidebar-width);
    max-width: 111.11111111vw;
    padding: 0 var(--content-padding) 2.77777778vw;
}

.preview-notice {
    color: var(--muted);
    font-size: 0.83333333vw;
    line-height: 1.6;
    margin-bottom: 1.38888889vw;
}

.map-card {
    margin-top: 1.66666667vw;
    background: white;
    border: var(--border);
    border-radius: var(--card-radius);
    overflow: hidden;
}

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.83333333vw;
    padding: 1.66666667vw 1.66666667vw 0;
}

h2 {
    font-size: 1.11111111vw;
    font-weight: 650;
    letter-spacing: -0.02777778vw;
    margin: 0;
}

.section-head p {
    font-size: 0.83333333vw;
    color: var(--muted);
    margin: 0.41666667vw 0 0;
}

/* MAP RESET | The canonical solid icon appears only away from the home camera. */
#reset-map {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.22222222vw;
    height: 2.22222222vw;
    padding: 0.55555556vw;
    color: var(--ink);
    border: 0;
    background: transparent;
    cursor: pointer;
}

#reset-map svg {
    display: block;
    width: 100%;
    height: 100%;
    fill: currentColor;
}

/* HOME MAP | The canonical custom WebGL atmosphere owns the soft edge fade. */
.map-surface {
    --blue: #4BA8FC;
    --map-person-size: 0.83333333vw;
    --map-fade: 2.44444444vw;
    position: relative;
    height: 32vw;
    background: white;
}

#mapbox-map {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity .3s;
}

[map-state="ready"] #mapbox-map {
    opacity: 1;
}

.dashboard-annotations {
    position: absolute;
    inset: 0;
    z-index: 5;
    overflow: hidden;
    pointer-events: none;
}

.dashboard-point {
    pointer-events: none;
    position: absolute;
    width: var(--map-person-size);
    height: var(--map-person-size);
    margin: 0;
    border-radius: 50%;
    background: var(--blue);
}

.dashboard-point[cluster] {
    pointer-events: auto;
    cursor: pointer;
}

.dashboard-point[cluster]::after {
    content: '';
    position: absolute;
    inset: -0.76388889vw;
}

.map-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%,-50%);
    display: flex;
    align-items: center;
    gap: 0.83333333vw;
    color: var(--muted);
    text-align: center;
    font-size: 0.90277778vw;
    line-height: 1.6;
}

[map-state="ready"] .map-message {
    display: none;
}

.spinner {
    width: 1.38888889vw;
    height: 1.38888889vw;
    border: var(--border);
    border-top-color: var(--blue);
    border-radius: 50%;
    animation: spin .8s linear infinite;
    flex-shrink: 0;
}

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

[map-state="failed"] .spinner {
    display: none;
}

.metrics {
    display: grid;
    gap: 1.11111111vw;
    margin-top: 1.11111111vw;
}

.metric {
    padding: 1.66666667vw;
    border: var(--border);
    border-radius: var(--card-radius);
    background: white;
    min-width: 0;
}

.metric h2 {
    color: var(--muted);
    font-size: 0.90277778vw;
    font-weight: 500;
    letter-spacing: 0;
}

.value {
    font-size: 2.5vw;
    font-weight: 700;
    letter-spacing: -0.06944444vw;
    line-height: 1.2;
    margin: 0.83333333vw 0 0.41666667vw;
    overflow-wrap: anywhere;
    font-variant-numeric: tabular-nums;
}

.metric p {
    color: var(--muted);
    font-size: 0.76388889vw;
    line-height: 1.5;
    margin: 0;
}

footer {
    display: flex;
    justify-content: space-between;
    gap: 1.11111111vw;
    border-top: var(--border);
    margin-top: 2.5vw;
    padding-top: 1.38888889vw;
    color: #7c8a92;
    font-size: 0.69444444vw;
}

/* CONNECTION STATUS | Global FETCH colors, without a badge surface. */
.map-actions {
    display: flex;
    align-items: center;
    gap: 1.38888889vw;
}

.source-status {
    display: flex;
    align-items: center;
    gap: 0.48611111vw;
    color: var(--muted);
    font-size: 0.83333333vw;
    font-weight: 300;
    white-space: nowrap;
}

.source-status[status="online"] .status-dot {
    background: var(--fetch-blue);
}

.status-dot {
    width: 0.55555556vw;
    height: 0.55555556vw;
    border-radius: 50%;
    background: var(--fetch-red);
}

@media (min-width: 500px) {
    .metrics {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 500px) {
    :root {
        --content-padding: 5vw;
        --card-radius: 3.18181818vw;
        font-size: 3.18181818vw;
    }

    .sidebar {
        position: relative;
        width: 100%;
        padding: 5vw;
        flex-direction: row;
        align-items: baseline;
        gap: 3vw;
        border-right: 0;
        border-bottom: var(--border);
    }

    .brand {
        font-size: 7.27272727vw;
    }

    .brand-caption {
        margin: 0;
        font-size: 2.72727273vw;
        letter-spacing: 0.45454545vw;
    }

    .sidebar nav[aria-label="Other Fetch websites"], .sidebar .nav-label, .side-note {
        display: none;
    }

    .map-actions {
        gap: 2vw;
    }

    #reset-map {
        width: 8vw;
        height: 8vw;
        padding: 2vw;
    }

    .source-status {
        font-size: 2.72727273vw;
        gap: 1.59090909vw;
    }

    .status-dot {
        width: 1.81818182vw;
        height: 1.81818182vw;
    }

    .sidebar {
        flex-wrap: wrap;
    }

    .sidebar nav[aria-label="Statistics navigation"] {
        display: flex;
        flex-basis: 100%;
        gap: 2vw;
        margin: 2vw 0 0;
    }

    .nav-item[environment] {
        font-size: 3vw;
        padding: 2vw 3vw;
        border-radius: 1.8vw;
    }

    main {
        margin-left: 0;
        max-width: 100%;
        padding-bottom: 7vw;
    }

    .preview-notice {
        font-size: 2.72727273vw;
        margin-bottom: 4.54545455vw;
    }

    .section-head {
        padding: 4.54545455vw 4.54545455vw 0;
        gap: 2.72727273vw;
    }

    h2 {
        font-size: 3.63636364vw;
    }

    .section-head p {
        font-size: 2.72727273vw;
        margin-top: 1.36363636vw;
    }

    #retry-map {
        font-size: 2.72727273vw;
        padding: 2.27272727vw 3.63636364vw;
        border-radius: 1.81818182vw;
    }

    .map-surface {
        --map-person-size: 2.72727273vw;
        --map-fade: 8vw;
        height: 80vw;
    }

    .map-message {
        font-size: 2.95454545vw;
        gap: 2.72727273vw;
        width: 80%;
    }

    .spinner {
        width: 4.54545455vw;
        height: 4.54545455vw;
    }

    .dot {
        width: 1.36363636vw;
        height: 1.36363636vw;
        margin-right: 1.59090909vw;
    }

    .metrics {
        grid-template-columns: repeat(2, 1fr);
        gap: 3.63636364vw;
        margin-top: 3.63636364vw;
    }

    .metric {
        padding: 4.54545455vw;
    }

    .metric h2 {
        font-size: 2.95454545vw;
    }

    .value {
        font-size: 6.36363636vw;
        letter-spacing: -0.22727273vw;
        margin: 2.72727273vw 0 1.36363636vw;
    }

    .metric[metric="totalEarned"] .value, .metric[metric="totalPaid"] .value {
        font-size: 5.1vw;
    }

    .metric p {
        font-size: 2.5vw;
    }

    footer {
        margin-top: 8.18181818vw;
        padding-top: 4.54545455vw;
        font-size: 2.27272727vw;
        gap: 3.63636364vw;
        flex-wrap: wrap;
    }

    .dashboard-point[cluster]::after {
        inset: -2.5vw;
    }

    :focus-visible {
        outline-width: 0.68181818vw;
        outline-offset: 0.90909091vw;
    }
}

@media (prefers-reduced-motion: reduce) {
    .spinner {
        animation: none;
    }

    #mapbox-map {
        transition: none;
    }
}

