:root {
    color-scheme: dark;
    --background: #07131f;
    --panel: #0d1d2c;
    --panel-raised: #132638;
    --border: rgba(153, 203, 255, 0.18);
    --text: #edf7ff;
    --muted: #9fb4c6;
    --accent: #44d2a8;
    --accent-blue: #71b7ff;
    --warning: #ffc857;
    --danger: #ff718a;
}

* {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
    background: var(--background);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
    overflow: hidden;
}

a {
    color: var(--accent-blue);
}

.skip-link {
    position: absolute;
    left: 1rem;
    top: -5rem;
    z-index: 100;
    padding: 0.7rem 1rem;
    background: white;
    color: #07131f;
    border-radius: 0.4rem;
}

.skip-link:focus {
    top: 1rem;
}

.topbar {
    height: 78px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.8rem 1.4rem;
    border-bottom: 1px solid var(--border);
    background: rgba(7, 19, 31, 0.96);
}

.topbar h1,
.panel h2,
.panel h3,
.topbar p {
    margin: 0;
}

.topbar h1 {
    font-size: clamp(1.15rem, 2vw, 1.55rem);
    letter-spacing: -0.02em;
}

.topbar nav {
    display: flex;
    gap: 0.7rem;
}

.topbar nav a {
    padding: 0.55rem 0.8rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    text-decoration: none;
    color: var(--text);
    font-size: 0.88rem;
}

.topbar nav a:hover,
.topbar nav a:focus-visible {
    border-color: var(--accent-blue);
    background: rgba(113, 183, 255, 0.1);
}

.eyebrow {
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.13em;
    font-size: 0.68rem;
    font-weight: 800;
    margin: 0 0 0.35rem;
}

.workspace {
    height: calc(100% - 78px);
    display: grid;
    grid-template-columns: minmax(280px, 360px) 1fr;
}

.panel {
    overflow-y: auto;
    padding: 1.35rem;
    border-right: 1px solid var(--border);
    background: linear-gradient(180deg, #0d1d2c 0%, #091725 100%);
}

.panel h2 {
    font-size: 1.6rem;
    line-height: 1.12;
}

.intro,
.source-note,
.status-card p,
.data-scope,
.method-card li {
    color: var(--muted);
    line-height: 1.55;
}

.data-scope {
    margin-bottom: 0;
    font-size: 0.78rem;
}

.status-card,
.method-card {
    margin-top: 1.15rem;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 0.8rem;
    background: var(--panel-raised);
}

.status-heading {
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.status-indicator {
    width: 0.62rem;
    height: 0.62rem;
    border-radius: 50%;
    background: var(--warning);
    box-shadow: 0 0 0.7rem rgba(255, 200, 87, 0.6);
}

.status-indicator.ready {
    background: var(--accent);
    box-shadow: 0 0 0.7rem rgba(68, 210, 168, 0.6);
}

.status-indicator.error {
    background: var(--danger);
    box-shadow: 0 0 0.7rem rgba(255, 113, 138, 0.6);
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.55rem;
    margin-top: 1rem;
}

.metric-grid article {
    min-width: 0;
    padding: 0.75rem 0.55rem;
    border: 1px solid var(--border);
    border-radius: 0.65rem;
    background: rgba(255, 255, 255, 0.025);
}

.metric-value,
.metric-label {
    display: block;
}

.metric-value {
    color: var(--text);
    font-size: 1.25rem;
    font-weight: 800;
}

.metric-label {
    margin-top: 0.25rem;
    color: var(--muted);
    font-size: 0.7rem;
    line-height: 1.25;
}

.method-card ul {
    margin: 0.7rem 0 0;
    padding-left: 1.15rem;
}

.method-card li + li {
    margin-top: 0.45rem;
}

.source-note {
    font-size: 0.78rem;
}

.map-shell,
#map {
    position: relative;
    width: 100%;
    height: 100%;
}

.map-error {
    position: absolute;
    inset: 1rem 1rem auto;
    z-index: 10;
    padding: 0.8rem 1rem;
    border: 1px solid rgba(255, 113, 138, 0.5);
    border-radius: 0.6rem;
    background: rgba(69, 15, 28, 0.96);
    color: #ffeef2;
}

@media (max-width: 760px) {
    body {
        overflow: auto;
    }

    .topbar {
        height: auto;
        align-items: flex-start;
    }

    .topbar nav {
        flex-direction: column;
    }

    .workspace {
        height: auto;
        grid-template-columns: 1fr;
    }

    .panel {
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }

    .map-shell {
        height: 68vh;
        min-height: 480px;
    }
}
