:root {
  --surface-1: #fcfcfb;
  --page: #f9f9f7;
  --text-primary: #0b0b0b;
  --text-secondary: #52514e;
  --muted: #898781;
  --grid: #e1e0d9;
  --baseline: #c3c2b7;
  --blue: #2a78d6;
  --good: #006300;
  --critical: #d03b3b;
}
@media (prefers-color-scheme: dark) {
  :root {
    --surface-1: #1a1a19;
    --page: #0d0d0d;
    --text-primary: #ffffff;
    --text-secondary: #c3c2b7;
    --muted: #898781;
    --grid: #2c2c2a;
    --baseline: #383835;
    --blue: #3987e5;
    --good: #0ca30c;
    --critical: #e66767;
  }
}
:root[data-theme="dark"] {
  --surface-1: #1a1a19; --page: #0d0d0d; --text-primary: #ffffff; --text-secondary: #c3c2b7;
  --grid: #2c2c2a; --baseline: #383835; --blue: #3987e5; --good: #0ca30c; --critical: #e66767;
}
:root[data-theme="light"] {
  --surface-1: #fcfcfb; --page: #f9f9f7; --text-primary: #0b0b0b; --text-secondary: #52514e;
  --grid: #e1e0d9; --baseline: #c3c2b7; --blue: #2a78d6; --good: #006300; --critical: #d03b3b;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--page);
  color: var(--text-primary);
}
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px; border-bottom: 1px solid var(--grid);
  flex-wrap: wrap; gap: 12px;
}
.topbar h1 { font-size: 18px; margin: 0; }
#strategy-select {
  background: var(--surface-1); color: var(--text-primary);
  border: 1px solid var(--baseline); border-radius: 6px; padding: 8px 12px; font-size: 14px;
}
main { max-width: 1100px; margin: 0 auto; padding: 24px; }

.tiles {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px; margin-bottom: 24px;
}
.tile {
  background: var(--surface-1); border: 1px solid var(--grid); border-radius: 10px;
  padding: 16px;
}
.tile .label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.tile .value { font-size: 24px; font-weight: 700; margin-top: 4px; }
.tile .value.up { color: var(--good); }
.tile .value.down { color: var(--critical); }

.panel {
  background: var(--surface-1); border: 1px solid var(--grid); border-radius: 10px;
  padding: 20px; margin-bottom: 24px;
}
.panel h2 { font-size: 14px; margin: 0 0 16px; color: var(--text-secondary); }
.chart-wrap { position: relative; height: 320px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: right; padding: 8px 10px; white-space: nowrap; }
th:first-child, td:first-child, th:nth-child(2), td:nth-child(2) { text-align: left; }
th {
  color: var(--muted); font-weight: 500; font-size: 11px; text-transform: uppercase;
  border-bottom: 1px solid var(--baseline);
}
tbody tr { border-bottom: 1px solid var(--grid); }
td.up { color: var(--good); }
td.down { color: var(--critical); }
.badge {
  display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px;
  background: var(--grid); color: var(--text-secondary);
}
.badge.open { background: var(--blue); color: #fff; }
.empty { color: var(--muted); padding: 16px 0; text-align: center; }
