:root {
  --bg: #f6f7f4;
  --surface: #ffffff;
  --surface-2: #eef1ec;
  --text: #17201b;
  --muted: #5b665f;
  --line: #dde3dc;
  --brand: #1f6f4a;
  --brand-ink: #ffffff;
  --accent: #2f8f63;
  --ok: #1f8a4c;
  --warn: #b26a00;
  --bad: #b3261e;
  --idle: #7a847e;
  --c1: #1f6f4a;
  --c2: #2563a8;
  --shadow: 0 1px 2px rgba(20, 30, 25, .06), 0 4px 14px rgba(20, 30, 25, .05);
  --radius: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1412;
    --surface: #161d1a;
    --surface-2: #1d2622;
    --text: #e6ece8;
    --muted: #9aa69f;
    --line: #2a3530;
    --brand: #5cc28f;
    --brand-ink: #0b1310;
    --accent: #5cc28f;
    --ok: #5cc28f;
    --warn: #e0a24a;
    --bad: #f08a80;
    --idle: #8b958f;
    --c1: #5cc28f;
    --c2: #7fb2ff;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .4em; }
h1 { font-size: clamp(1.8rem, 4.5vw, 2.7rem); letter-spacing: -.02em; }
h2 { font-size: 1.4rem; letter-spacing: -.01em; }
h3 { font-size: 1.02rem; }
p { margin: 0 0 .8em; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.fine { color: var(--muted); font-size: .82rem; margin: .6em 0 0; }

.site-header {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 56px; gap: 12px; }
.brand { display: flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; font-weight: 650; }
.brand svg { width: 24px; height: 24px; fill: none; stroke: var(--brand); stroke-width: 2.5; stroke-linecap: round; }
nav { display: flex; gap: 4px; }
nav a { color: var(--muted); text-decoration: none; padding: 6px 10px; border-radius: 8px; font-size: .95rem; }
nav a:hover { color: var(--text); background: var(--surface-2); }

.hero { padding: 48px 0 28px; }
.eyebrow { color: var(--accent); font-weight: 600; font-size: .85rem; letter-spacing: .04em; text-transform: uppercase; margin-bottom: .6em; }
.lead { font-size: 1.08rem; color: var(--muted); max-width: 46rem; }
.status {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 8px;
  padding: 7px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line);
  font-size: .92rem; box-shadow: var(--shadow);
}
.status .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--idle); flex: none; }
.status-live .dot { background: var(--ok); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 22%, transparent); }
.status-stale .dot { background: var(--warn); }
.status-down .dot { background: var(--bad); }

.section { padding: 28px 16px 8px; }
.section-head { margin-bottom: 14px; }
.section-head p { max-width: 48rem; }
.sub { margin-top: 26px; }

.grid { display: grid; gap: 16px; }
.cards-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cards-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 900px) { .cards-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .cards-3, .cards-2 { grid-template-columns: minmax(0, 1fr); } }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow); min-width: 0;
}
.card p:last-child { margin-bottom: 0; }
.skeleton { min-height: 220px; background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: shimmer 1.4s infinite linear; }
@keyframes shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } html { scroll-behavior: auto; } }

.card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 4px; }
.card-title { font-size: 1.08rem; font-weight: 650; }
.card-sub { color: var(--muted); font-size: .86rem; }
.pill { font-size: .78rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; white-space: nowrap; border: 1px solid transparent; }
.pill.ok { color: var(--ok); background: color-mix(in srgb, var(--ok) 13%, transparent); }
.pill.off { color: var(--bad); background: color-mix(in srgb, var(--bad) 11%, transparent); }
.pill.none { color: var(--idle); background: var(--surface-2); }

.metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; margin: 14px 0 12px; }
.metric { min-width: 0; }
.metric .k { color: var(--muted); font-size: .78rem; }
.metric .v { font-size: 1.15rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.metric .v small { font-size: .78rem; font-weight: 500; color: var(--muted); margin-left: 2px; }
.metric .v.dim { color: var(--idle); font-weight: 500; }
.target { font-size: .84rem; color: var(--muted); }
.rec { margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); font-size: .88rem; }
.rec b { text-transform: capitalize; }
.rec .why { color: var(--muted); display: block; margin-top: 2px; }
.lastseen { font-size: .82rem; color: var(--muted); margin-top: 10px; }

.weather { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; }

.alerts { list-style: none; margin: 0; padding: 0; }
.alerts li { padding: 9px 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
.alerts li:last-child { border-bottom: 0; }
.alerts .when { color: var(--muted); font-size: .8rem; display: block; }

.chart-card { padding: 14px 16px 16px; }
.controls { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; margin-bottom: 10px; }
.controls label { font-size: .85rem; color: var(--muted); display: flex; align-items: center; gap: 6px; }
select {
  font: inherit; font-size: .9rem; color: var(--text); background: var(--surface-2);
  border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; max-width: 220px;
}
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.seg button { font: inherit; font-size: .88rem; border: 0; background: transparent; color: var(--muted); padding: 6px 12px; cursor: pointer; }
.seg button.on { background: var(--brand); color: var(--brand-ink); }
.chart-box { position: relative; height: 320px; }
@media (max-width: 640px) { .chart-box { height: 260px; } }
.chart-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--muted); margin: 0; pointer-events: none; }
.chart-empty[hidden] { display: none; }

.flow { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; counter-reset: step; }
.flow li { position: relative; background: var(--surface-2); border-radius: 12px; padding: 14px 12px 12px; counter-increment: step; }
.flow li::before { content: counter(step); position: absolute; top: -10px; left: 12px; width: 22px; height: 22px; border-radius: 50%; background: var(--brand); color: var(--brand-ink); font-size: .75rem; font-weight: 700; display: grid; place-items: center; }
.flow strong { display: block; margin: 4px 0 4px; font-size: .95rem; }
.flow span { color: var(--muted); font-size: .84rem; }
@media (max-width: 900px) { .flow { grid-template-columns: minmax(0, 1fr); } }
.status-card { border-left: 4px solid var(--warn); }

.site-footer { margin-top: 40px; padding: 24px 0 36px; border-top: 1px solid var(--line); color: var(--muted); font-size: .88rem; }
