:root {
  --bg0: #080c14; --bg1: #0c1220; --card: #131c2e; --line: #1e2a40; --line-hi: #2a3a58;
  --text: #e7ecf6; --muted: #8e9ab0; --faint: #5d6a82; --accent: #3d8bff; --accent-hi: #6aa8ff;
  --ok: #2fd08a; --warn: #f0b429; --crit: #ff5c6c; --snap: #a78bfa; --stale: #c9a25e;
  --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg0); color: var(--text); }
body {
  font: 15px/1.45 "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  padding: env(safe-area-inset-top) 16px calc(24px + env(safe-area-inset-bottom));
  max-width: 760px; margin: 0 auto; -webkit-font-smoothing: antialiased;
}
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0 10px; background: linear-gradient(var(--bg0) 75%, transparent); }
.brand { display: flex; gap: 8px; align-items: center; font-size: 12px; font-weight: 700; letter-spacing: 1.6px; color: var(--muted); }
.glyph { color: var(--accent); font-size: 16px; }
.icon-btn { background: var(--card); color: var(--text); border: 1px solid var(--line-hi); border-radius: 10px;
  width: 40px; height: 40px; font-size: 18px; }
.freshness { font-size: 12px; color: var(--muted); margin: -2px 0 10px; }
.freshness.stale { color: var(--warn); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin: 0 0 12px; }
.card h2 { font-size: 15px; margin: 0 0 8px; font-weight: 650; }
.card.center { text-align: center; }
.muted { color: var(--muted); } .faint { color: var(--faint); font-size: 12px; }
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 0 12px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.kpi .e { font-size: 10.5px; letter-spacing: 1px; color: var(--muted); font-weight: 650; text-transform: uppercase; }
.kpi .v { font-size: 22px; font-weight: 650; margin-top: 2px; }
.kpi .s { font-size: 11.5px; color: var(--faint); }
.surface .head { display: flex; align-items: center; gap: 8px; }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.surface .name { font-weight: 650; flex: 1; }
.chip { font-size: 10px; font-weight: 750; letter-spacing: .5px; border: 1px solid currentColor; border-radius: 5px; padding: 1px 6px; white-space: nowrap; }
.state { font-size: 10.5px; font-weight: 750; letter-spacing: .6px; margin: 6px 0 2px; }
.headline { font-size: 24px; font-weight: 650; margin: 2px 0; }
.headline.dim { color: var(--muted); }
.detail { font-size: 12px; color: var(--faint); }
.pool { margin-top: 10px; }
.pool .row { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.pool .row .v { color: var(--muted); white-space: nowrap; }
.meter { height: 6px; background: var(--line); border-radius: 4px; margin-top: 5px; overflow: hidden; }
.meter > i { display: block; height: 100%; border-radius: 4px; background: var(--accent); }
.meter.none { background: transparent; border: 1px dashed var(--line-hi); }
.reset { font-size: 11.5px; color: var(--faint); text-align: right; margin-top: 2px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
td { padding: 7px 0; border-top: 1px solid var(--line); vertical-align: top; }
td.r { text-align: right; white-space: nowrap; padding-left: 8px; }
.alert { display: flex; gap: 8px; padding: 7px 0; border-top: 1px solid var(--line); font-size: 13px; }
.alert:first-of-type { border-top: none; }
.sev { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex: none; }
.pair input { width: 100%; font-size: 22px; letter-spacing: 3px; text-align: center; padding: 12px; margin: 10px 0;
  background: var(--bg1); color: var(--text); border: 1px solid var(--line-hi); border-radius: 10px; text-transform: uppercase; }
.pair input:focus { outline: 2px solid var(--accent); }
button.primary { width: 100%; padding: 12px; font-size: 16px; font-weight: 650; color: #fff; background: var(--accent);
  border: none; border-radius: 10px; }
button.link { background: none; border: none; color: var(--muted); text-decoration: underline; padding: 8px 0; font-size: 13px; }
.msg { min-height: 1.4em; font-size: 13px; }
.msg.err { color: var(--crit); } .msg.ok { color: var(--ok); }
details summary { cursor: pointer; color: var(--muted); font-size: 13px; }

.why { margin-top: 4px; } .why summary { font-size: 12px; color: var(--accent-hi); }
.why div { padding: 6px 0 2px; line-height: 1.5; }
