:root {
  --surface-1:      #fcfcfb;
  --page-plane:     #f9f9f7;
  --text-primary:   #0b0b0b;
  --text-secondary: #52514e;
  --text-muted:     #898781;
  --gridline:       #e1e0d9;
  --border:         rgba(11,11,11,0.10);
  --good:           #006300;
  --critical:       #d03b3b;
  --accent:         #2a78d6;
  --spark-line:     #c3c2b7;
}

@media (prefers-color-scheme: dark) {
  :root {
    --surface-1:      #1a1a19;
    --page-plane:     #0d0d0d;
    --text-primary:   #ffffff;
    --text-secondary: #c3c2b7;
    --text-muted:     #898781;
    --gridline:       #2c2c2a;
    --border:         rgba(255,255,255,0.10);
    --good:           #0ca30c;
    --critical:       #e66767;
    --accent:         #3987e5;
    --spark-line:     #383835;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--page-plane);
  color: var(--text-primary);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

.page {
  max-width: 1080px;
  margin: 0 auto;
  padding: 24px 20px 48px;
}

.topbar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.topbar h1 {
  font-size: 20px;
  font-weight: 600;
  margin: 0;
}

.meta {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 13px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--good);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.section { margin-bottom: 32px; }

.section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0 0 12px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

.grid-narrow {
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

.tile {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
}

.tile-label {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.tile-value-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.tile-value {
  font-size: 22px;
  font-weight: 600;
  font-variant-numeric: proportional-nums;
}

.tile-delta {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.tile-delta.up { color: var(--good); }
.tile-delta.down { color: var(--critical); }
.tile-delta.flat { color: var(--text-muted); }

.tile-spark { margin-top: 8px; display: block; }

.tile-error {
  font-size: 13px;
  color: var(--text-muted);
}

.news-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.news-col {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
}

.news-col h3 {
  font-size: 14px;
  margin: 0 0 10px;
  color: var(--text-primary);
}

.news-item {
  padding: 8px 0;
  border-top: 1px solid var(--gridline);
}

.news-item:first-child { border-top: none; padding-top: 0; }

.news-item a {
  color: var(--text-primary);
  text-decoration: none;
  font-size: 14px;
  line-height: 1.4;
}

.news-item a:hover { color: var(--accent); }

.news-item .src {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-muted);
}

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