.viz-root {
  color-scheme: light;
  --surface-1:      #fcfcfb;
  --page-plane:     #f9f9f7;
  --text-primary:   #0b0b0b;
  --text-secondary: #52514e;
  --text-muted:     #898781;
  --gridline:       #e1e0d9;
  --baseline:       #c3c2b7;
  --series-actual:  #2a78d6;
  --series-actual-wash: rgba(42, 120, 214, 0.10);
  --series-ideal:   #898781;
  --status-good:     #0ca30c;
  --status-warning:  #fab219;
  --status-serious:  #ec835a;
  --status-critical: #d03b3b;
  --border: rgba(11,11,11,0.10);
}
@media (prefers-color-scheme: dark) {
  .viz-root {
    color-scheme: dark;
    --surface-1:      #1a1a19;
    --page-plane:     #0d0d0d;
    --text-primary:   #ffffff;
    --text-secondary: #c3c2b7;
    --text-muted:     #898781;
    --gridline:       #2c2c2a;
    --baseline:       #383835;
    --series-actual:  #3987e5;
    --series-actual-wash: rgba(57, 135, 229, 0.14);
    --series-ideal:   #898781;
    --status-good:     #0ca30c;
    --status-warning:  #fab219;
    --status-serious:  #ec835a;
    --status-critical: #d03b3b;
    --border: rgba(255,255,255,0.10);
  }
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--page-plane);
  color: var(--text-primary);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
body { padding: 20px 16px 40px; max-width: 480px; margin: 0 auto; }

.card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 16px;
}

.app-title {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0 0 4px;
}
.plan-name {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 0 20px;
}

.hero-row { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.hero-value { font-size: 48px; font-weight: 600; line-height: 1; letter-spacing: -0.02em; }
.hero-unit { font-size: 18px; color: var(--text-secondary); }
.hero-cap { font-size: 15px; color: var(--text-muted); margin-left: 2px; }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 12px; padding: 5px 10px 5px 8px;
  border-radius: 999px; font-size: 13px; font-weight: 600;
  background: var(--page-plane);
  border: 1px solid var(--border);
}
.badge .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }

.status-good .dot, .meter-fill.status-good { background: var(--status-good); }
.status-good .label, .diff-value.status-good { color: var(--status-good); }
.status-warning .dot, .meter-fill.status-warning { background: var(--status-warning); }
.status-warning .label, .diff-value.status-warning { color: var(--status-warning); }
.status-serious .dot, .meter-fill.status-serious { background: var(--status-serious); }
.status-serious .label, .diff-value.status-serious { color: var(--status-serious); }
.status-critical .dot, .meter-fill.status-critical { background: var(--status-critical); }
.status-critical .label, .diff-value.status-critical { color: var(--status-critical); }

.meter-track {
  margin-top: 16px;
  height: 10px; border-radius: 999px;
  background: var(--gridline);
  overflow: hidden;
  position: relative;
}
.meter-fill { height: 100%; border-radius: 999px; }
.meter-ideal-tick {
  position: absolute; top: -3px; width: 2px; height: 16px;
  background: var(--text-muted); border-radius: 1px;
}

.submetrics {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
  margin-top: 18px;
}
.submetric-label { font-size: 12px; color: var(--text-muted); margin: 0 0 2px; }
.submetric-value { font-size: 16px; font-weight: 600; color: var(--text-primary); margin: 0; }

.chart-card .card-title { font-size: 14px; color: var(--text-secondary); margin: 0 0 2px; }
.chart-card .card-sub { font-size: 12px; color: var(--text-muted); margin: 0 0 12px; }
.legend { display: flex; gap: 16px; margin-top: 10px; font-size: 12px; color: var(--text-secondary); }
.legend-item { display: flex; align-items: center; gap: 6px; }
.legend-swatch { width: 14px; height: 2px; border-radius: 1px; }
.legend-swatch.dashed {
  background: repeating-linear-gradient(90deg, var(--series-ideal) 0 4px, transparent 4px 7px);
}
.legend-swatch.solid { background: var(--series-actual); }

.chart-wrap { position: relative; height: 220px; width: 100%; }

.updated-at { font-size: 12px; color: var(--text-muted); text-align: center; margin-top: 4px; }

.empty-state { text-align: center; padding: 40px 20px; color: var(--text-secondary); }
