:root {
    --c-bg: #f4f6f8;
    --c-surface: #ffffff;
    --c-ink: #1c2733;
    --c-muted: #5c6b7a;
    --c-border: #dde4ea;
    --c-primary: #14334d;
    --c-primary-ink: #ffffff;
    --c-accent: #e8a13c;
    --c-ok: #2e8b57;
    --c-warn-minor: #f0c419;
    --c-warn-moderate: #e8821e;
    --c-warn-severe: #d3382c;
    --c-warn-extreme: #8e1e7b;
    --radius: 10px;
    --shadow: 0 1px 3px rgba(16, 32, 48, .08), 0 4px 14px rgba(16, 32, 48, .06);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    background: var(--c-bg);
    color: var(--c-ink);
    line-height: 1.55;
}

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }

/* Header */
.site-header { background: var(--c-primary); color: var(--c-primary-ink); }
.header-inner { display: flex; align-items: center; gap: 28px; min-height: 62px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; font-size: 1.12rem; }
.brand-icon { color: var(--c-accent); font-size: 1.15rem; }
.brand strong { font-weight: 700; }
.main-nav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.nav-link {
    color: rgba(255, 255, 255, .82); text-decoration: none; padding: 8px 12px;
    border-radius: 6px; font-size: .95rem;
}
.nav-link:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.nav-link.active { background: rgba(255, 255, 255, .16); color: #fff; }
.lang-nav { display: flex; gap: 2px; }
.lang-link {
    color: rgba(255, 255, 255, .7); text-decoration: none; padding: 6px 8px;
    border-radius: 6px; font-size: .82rem; text-transform: uppercase; letter-spacing: .04em;
}
.lang-link:hover { color: #fff; }
.lang-link.active { color: var(--c-accent); font-weight: 700; }

/* Dashboard */
.dashboard { padding: 28px 0 8px; }
.dashboard-head h1 { margin: 0 0 4px; font-size: 1.7rem; }
.claim { margin: 0 0 6px; color: var(--c-muted); }
.updated { margin: 0; font-size: .85rem; color: var(--c-muted); display: flex; align-items: center; gap: 7px; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; background: #b8c2cc; }
.dot-ok { background: var(--c-ok); }
.dot-loading { background: var(--c-accent); animation: pulse 1.2s ease-in-out infinite; }
.dot-error { background: var(--c-warn-severe); }
@keyframes pulse { 50% { opacity: .35; } }

.summary-tiles {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 14px; margin: 20px 0;
}
.tile {
    background: var(--c-surface); border: 1px solid var(--c-border);
    border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px;
    border-top: 3px solid var(--c-primary);
}
.tile h2 { margin: 0; font-size: .82rem; text-transform: uppercase; letter-spacing: .05em; color: var(--c-muted); font-weight: 600; }
.tile-value { margin: 6px 0 0; font-size: 1.9rem; font-weight: 700; line-height: 1.15; }
.tile-sub { margin: 2px 0 0; font-size: .85rem; color: var(--c-muted); min-height: 1.2em; }
.tile.level-ok { border-top-color: var(--c-ok); }
.tile.level-minor { border-top-color: var(--c-warn-minor); }
.tile.level-moderate { border-top-color: var(--c-warn-moderate); }
.tile.level-severe { border-top-color: var(--c-warn-severe); }
.tile.level-extreme { border-top-color: var(--c-warn-extreme); }

.dashboard-grid {
    display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    gap: 14px; margin-bottom: 24px;
}
@media (max-width: 880px) { .dashboard-grid { grid-template-columns: 1fr; } }

.panel {
    background: var(--c-surface); border: 1px solid var(--c-border);
    border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px;
}
.panel h2 { margin: 0 0 10px; font-size: 1.05rem; }
#wl-map { height: 460px; border-radius: 8px; background: #e8eef2; }
.map-legend, .map-sources { font-size: .8rem; color: var(--c-muted); margin: 8px 0 0; }
.map-sources { margin-top: 2px; }
.map-legend .swatch, .map-sources .swatch {
    display: inline-block; width: 10px; height: 10px; border-radius: 50%;
    margin: 0 4px 0 10px; vertical-align: baseline;
}
.map-legend .swatch:first-child, .map-sources .swatch:first-of-type { margin-left: 4px; }
.map-sources .src-sep { color: var(--c-border); }
.map-sources .src-stale { color: #b06d00; font-weight: 600; }
.map-sources .src-down { color: var(--c-warn-severe); font-weight: 600; }

a.wl-locate {
    display: block; width: 30px; height: 30px; line-height: 28px; text-align: center;
    background: #fff; color: var(--c-primary); font-size: 19px; text-decoration: none;
}
a.wl-locate:hover { background: #f4f4f4; }

.wl-search {
    width: 100%; padding: 8px 12px; border: 1px solid var(--c-border); border-radius: 7px;
    font-size: .92rem; margin-bottom: 10px; background: var(--c-bg);
}
.warning-list { list-style: none; margin: 0; padding: 0; max-height: 430px; overflow-y: auto; }
.warning-list li {
    padding: 10px 12px; border-left: 4px solid var(--c-border); background: var(--c-bg);
    border-radius: 6px; margin-bottom: 8px; font-size: .9rem;
}
.warning-list li.sev-Minor { border-left-color: var(--c-warn-minor); }
.warning-list li.sev-Moderate { border-left-color: var(--c-warn-moderate); }
.warning-list li.sev-Severe { border-left-color: var(--c-warn-severe); }
.warning-list li.sev-Extreme { border-left-color: var(--c-warn-extreme); }
.warning-list .w-head { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.warning-list .w-title { font-weight: 600; }
.warning-list .w-badge {
    font-size: .72rem; text-transform: uppercase; letter-spacing: .04em;
    color: var(--c-muted); white-space: nowrap;
}
.warning-list .w-region { color: var(--c-muted); font-size: .82rem; margin-top: 2px; }
.warning-list li.muted { color: var(--c-muted); border-left-color: var(--c-border); }

/* Content area below dashboard */
.content-area { padding: 8px 0 40px; }

/* Footer */
.site-footer { background: var(--c-primary); color: rgba(255, 255, 255, .75); margin-top: 30px; }
.footer-inner { padding: 22px 20px; font-size: .82rem; }
.footer-inner p { margin: 0 0 6px; max-width: 900px; }
.footer-nav { margin-top: 10px; display: flex; gap: 16px; flex-wrap: wrap; }
.footer-nav a { color: rgba(255, 255, 255, .85); text-decoration: none; }
.footer-nav a:hover { text-decoration: underline; }

/* Leaflet popup tweaks */
.leaflet-popup-content { font-size: .85rem; line-height: 1.45; }
.leaflet-popup-content b { display: block; margin-bottom: 2px; }
