:root {
  --bg: #f4f2ee; --panel: #ffffff; --text: #1f1d1a; --muted: #6b665e; --line: #ddd8cf;
  --accent: #8a5a12; --accent-2: #3d6b8f; --ok: #2f7d4a; --bad: #b3261e; --warn-bg: #fff4e0;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161514; --panel: #201f1d; --text: #ece8e1; --muted: #a39d93; --line: #3a3733;
    --accent: #e0a54a; --accent-2: #7fb0d6; --ok: #6cc28a; --bad: #ff8a80; --warn-bg: #3a2c14;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; }
header { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--panel); position: sticky; top: 0; z-index: 2; flex-wrap: wrap; }
header h1 { font-size: 17px; margin: 0; }
header h1 span { color: var(--muted); font-weight: 400; }
.spacer { flex: 1; }
.pill { padding: 2px 10px; border-radius: 999px; font-size: 12px; border: 1px solid var(--line); }
.pill.ok { color: var(--ok); border-color: var(--ok); }
.pill.bad { color: var(--bad); border-color: var(--bad); }
.muted { color: var(--muted); }
.error { color: var(--bad); min-height: 1em; margin: 6px 16px; }
nav { display: flex; gap: 4px; padding: 8px 16px 0; flex-wrap: wrap; }
nav button { background: transparent; border: 1px solid transparent; border-bottom: 2px solid transparent; border-radius: 0; color: var(--muted); }
nav button.active { color: var(--text); border-bottom-color: var(--accent); }
button { font: inherit; padding: 6px 12px; border-radius: 6px; border: 1px solid var(--line); background: var(--panel); color: var(--text); cursor: pointer; }
button:hover { border-color: var(--accent); }
button.warn { background: var(--warn-bg); }
button:disabled { opacity: .5; cursor: default; }
input { font: inherit; padding: 6px 8px; border-radius: 6px; border: 1px solid var(--line); background: var(--bg); color: var(--text); min-width: 0; }
label { display: flex; flex-direction: column; gap: 4px; }
#refresh-toggle { flex-direction: row; align-items: center; }
.tab { padding: 8px 16px 32px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; min-width: 0; }
.card h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 0 0 8px; }
.card.wide { grid-column: 1 / -1; }
.card.narrow { max-width: 360px; margin: 48px auto; display: flex; flex-direction: column; gap: 12px; }
.big { font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; }
dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; margin: 0; }
dt { color: var(--muted); }
dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 8px 0; }
.row input { flex: 1; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 4px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-weight: 500; position: sticky; top: 0; background: var(--panel); }
td.num, th.num { text-align: right; }
tbody tr.clickable { cursor: pointer; }
tbody tr.clickable:hover { background: var(--bg); }
.good { color: var(--ok); }
.bad { color: var(--bad); }
pre { background: var(--bg); padding: 8px; border-radius: 6px; overflow: auto; max-height: 420px; font-size: 12px; }
svg.chart { width: 100%; height: auto; max-height: 220px; display: block; }
svg.chart .bar { fill: var(--accent); }
svg.chart .bar2 { fill: var(--accent-2); }
svg.chart .line { fill: none; stroke: var(--accent); stroke-width: 1.5; }
svg.chart text { fill: var(--muted); font-size: 10px; }
svg.chart .axis { stroke: var(--line); }
.legend { display: flex; gap: 12px; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; margin-right: 4px; border-radius: 2px; }
.legend i.a { background: var(--accent); }
.legend i.b { background: var(--accent-2); }
.proposals li { margin-bottom: 8px; }
@media (max-width: 600px) { .grid { grid-template-columns: 1fr; } .big { font-size: 22px; } }
