:root {
    --bg: #eef2f7;
    --surface: #ffffff;
    --surface-soft: #f1f5f9;
    --text: #05070a;
    --muted: #243043;
    --border: #b8c3d3;
    --border-strong: #8fa0b7;
    --accent: #0b3a82;
    --accent-soft: #dbeafe;
    --good: #15803d;
    --warn: #b45309;
    --bad: #b91c1c;
    --shadow: 0 6px 18px rgba(15, 23, 42, 0.10);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text);
    font-weight: 500;
}

a, button, .button { color-scheme: light; }

.page {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 26px 0 48px;
}

.hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 18px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--border);
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: .12em;
    font-size: .72rem;
    font-weight: 800;
}

h1 {
    margin: 0;
    color: #020617;
    font-size: clamp(2rem, 5vw, 3.6rem);
    line-height: 1;
    letter-spacing: -0.045em;
}

.subtitle {
    color: #1f2937;
    margin: 10px 0 0;
    font-size: .98rem;
}

.status-card, .panel, .card {
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: 14px;
    box-shadow: var(--shadow);
}

.status-card {
    min-width: 285px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.status-card strong {
    display: block;
    font-size: .96rem;
}

.status-card span:last-child, #last-updated {
    display: block;
    color: #1f2937;
    font-size: .86rem;
    margin-top: 2px;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    flex: 0 0 auto;
}

.dot-online { background: var(--good); box-shadow: 0 0 0 4px rgba(21, 128, 61, .13); }
.dot-offline { background: var(--bad); box-shadow: 0 0 0 4px rgba(185, 28, 28, .13); }

.cards {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}

.card {
    padding: 16px;
    min-height: 112px;
    border-top: 3px solid var(--accent);
}

.card span {
    display: block;
    color: #111827;
    font-size: .82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .055em;
}

.card strong {
    color: #020617;
    font-weight: 850;
    font-size: clamp(1.55rem, 4vw, 2.35rem);
    letter-spacing: -0.045em;
    display: inline-block;
    margin-top: 8px;
}

.card small {
    color: var(--muted);
    margin-left: 4px;
    font-weight: 650;
}

.grid-two {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(280px, .85fr);
    gap: 12px;
    margin-bottom: 12px;
}

.panel {
    padding: 18px;
}

.panel-title {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.panel-title h2 {
    margin: 0;
    color: #020617;
    font-size: 1.05rem;
    letter-spacing: -0.01em;
}

.panel-title p {
    margin: 0;
    color: #1f2937;
    font-size: .86rem;
    text-align: right;
}

.map {
    height: 320px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--surface-soft);
}

.health-list {
    margin: 0 0 18px;
    display: grid;
    gap: 0;
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
}

.health-list div {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}

.health-list div:nth-child(even) { background: var(--surface-soft); }
.health-list div:last-child { border-bottom: 0; }

dt {
    color: #111827;
    font-size: .88rem;
    font-weight: 700;
}

dd {
    margin: 0;
    color: #020617;
    font-weight: 700;
    text-align: right;
    font-size: .9rem;
    font-variant-numeric: tabular-nums;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 9px 13px;
    background: var(--accent);
    color: #ffffff;
    text-decoration: none;
    border-radius: 9px;
    font-weight: 800;
    font-size: .9rem;
}

.button:hover { filter: brightness(.96); }

.chart-wrap {
    height: 230px;
    padding: 10px 0 14px;
    border-top: 1px solid var(--border);
}

.chart-wrap:first-of-type { border-top: 0; }

.test-panel code {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
    color: #0f172a;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 13px;
    font-size: .85rem;
}

.leaflet-container { background: #eef3f8; }
.leaflet-control-attribution { font-size: 10px; }

@media (max-width: 850px) {
    .hero, .panel-title { align-items: stretch; flex-direction: column; }
    .status-card { min-width: 0; }
    .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid-two { grid-template-columns: 1fr; }
    .panel-title p { text-align: left; }
}

@media (max-width: 520px) {
    .cards { grid-template-columns: 1fr; }
    .page { width: min(100% - 20px, 1180px); }
    .map { height: 260px; }
    .health-list div { flex-direction: column; gap: 3px; }
    dd { text-align: left; }
}
