:root {
    --toolbar-bg: rgba(18, 22, 28, 0.92);
    --toolbar-border: rgba(255, 255, 255, 0.08);
    --text: #f4f6f8;
    --muted: #a8b0ba;
    --accent: #3ecf8e;
    --accent-hot: #ef4444;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    height: 100%;
    font-family: "Segoe UI", system-ui, sans-serif;
    background: #0f1419;
    color: var(--text);
    overflow: hidden;
}

#map {
    position: fixed;
    inset: 0;
    z-index: 1;
}

.toolbar {
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 220px;
    padding: 14px 16px;
    border: 1px solid var(--toolbar-border);
    border-radius: 12px;
    background: var(--toolbar-bg);
    backdrop-filter: blur(8px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.toolbar-title {
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.toolbar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.layer-btn {
    border: 1px solid var(--toolbar-border);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    padding: 6px 12px;
    font-size: 0.82rem;
    cursor: pointer;
}

.layer-btn.is-active {
    border-color: rgba(62, 207, 142, 0.5);
    background: rgba(62, 207, 142, 0.18);
}

.layer-btn.is-disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.status {
    font-size: 0.78rem;
    color: var(--muted);
    min-height: 1.2em;
}

.error-banner {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1100;
    width: min(720px, calc(100vw - 32px));
    padding: 14px 16px;
    border: 1px solid rgba(239, 68, 68, 0.55);
    border-radius: 12px;
    background: rgba(40, 12, 14, 0.96);
    backdrop-filter: blur(8px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.error-banner.is-hidden {
    display: none;
}

.error-banner-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: #fecaca;
    margin-bottom: 6px;
}

.error-banner-message {
    font-size: 0.9rem;
    color: #fee2e2;
    word-break: break-word;
}

.error-banner-detail {
    margin: 10px 0 0;
    padding: 10px 12px;
    max-height: 220px;
    overflow: auto;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.35);
    color: #fca5a5;
    font-size: 0.72rem;
    line-height: 1.4;
    white-space: pre-wrap;
    word-break: break-word;
}

.error-banner-detail.is-hidden {
    display: none;
}

.legend {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 1000;
    width: 180px;
    padding: 12px 14px;
    border: 1px solid var(--toolbar-border);
    border-radius: 12px;
    background: var(--toolbar-bg);
    backdrop-filter: blur(8px);
}

.legend-title {
    font-size: 0.78rem;
    color: var(--muted);
    margin-bottom: 8px;
}

.legend-gradient {
    height: 10px;
    border-radius: 999px;
    background: linear-gradient(
        90deg,
        rgba(74, 222, 128, 0.5) 0%,
        rgba(163, 230, 53, 0.5) 25%,
        rgba(253, 224, 71, 0.45) 55%,
        rgba(253, 186, 116, 0.42) 78%,
        rgba(252, 165, 165, 0.45) 100%
    );
}

.heat-point-hit {
    pointer-events: auto;
    cursor: pointer;
}

.legend-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
    font-size: 0.75rem;
    color: var(--muted);
}

.leaflet-control-attribution {
    font-size: 10px;
}
