:root {
  color-scheme: light;
  --page: #f9f9f7; --surface: #fcfcfb; --ink: #0b0b0b; --ink2: #52514e; --muted: #898781;
  --grid: #e1e0d9; --axis: #c3c2b7; --ring: rgba(11,11,11,0.10);
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s5: #e87ba4; --s6: #008300; --s7: #6250d6; --s8: #e34948;
  --crit: #d03b3b; --warn: #fab219; --good: #0ca30c;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #0d0d0d; --surface: #1a1a19; --ink: #f0efec; --ink2: #c3c2b7; --muted: #898781;
    --grid: #2c2c2a; --axis: #383835; --ring: rgba(255,255,255,0.10);
    --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #008300; --s7: #9085e9; --s8: #e66767;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0d0d0d; --surface: #1a1a19; --ink: #f0efec; --ink2: #c3c2b7; --muted: #898781;
  --grid: #2c2c2a; --axis: #383835; --ring: rgba(255,255,255,0.10);
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #008300; --s7: #9085e9; --s8: #e66767;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; padding: 12px 16px 32px; background: var(--page); color: var(--ink);
  font: 14px/1.4 system-ui, -apple-system, "Segoe UI", sans-serif; }
.top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.title { font-weight: 600; font-size: 16px; }
.stamp { color: var(--ink2); font-variant-numeric: tabular-nums; font-size: 13px; }
.stamp.stale { color: var(--crit); font-weight: 600; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 4px; }
.seg { display: inline-flex; border: 1px solid var(--ring); border-radius: 8px; overflow: hidden; }
.seg button, .tabs button { font: inherit; background: var(--surface); color: var(--ink2); border: 0;
  padding: 6px 12px; cursor: pointer; min-height: 32px; }
.seg button + button { border-left: 1px solid var(--ring); }
.seg button[aria-checked="true"], .tabs button[aria-selected="true"] { color: var(--ink); font-weight: 600;
  box-shadow: inset 0 -2px 0 var(--ink); }
h2 { font-size: 15px; margin: 18px 0 6px; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 6px; }
.tabs button { border: 1px solid var(--ring); border-radius: 8px; }
.card { margin: 0 0 10px; background: var(--surface); border: 1px solid var(--ring); border-radius: 10px;
  padding: 8px 8px 4px; }
figcaption { color: var(--ink2); font-size: 13px; margin: 0 0 4px 4px; }
.plot { position: relative; height: 150px; touch-action: pan-y; }
.plot canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.plot .empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 13px; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 0 0 6px; font-size: 13px; color: var(--ink2); }
.key { display: inline-flex; align-items: center; gap: 6px; }
.key i { display: inline-block; width: 14px; height: 2px; border-radius: 1px; }
.key i.dash { background: repeating-linear-gradient(90deg, var(--muted) 0 4px, transparent 4px 7px) !important; }
.key b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.tip { position: absolute; z-index: 5; pointer-events: none; background: var(--surface); color: var(--ink);
  border: 1px solid var(--ring); border-radius: 8px; padding: 6px 8px; font-size: 12px; white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0,0,0,.12); font-variant-numeric: tabular-nums; }
.tip .t { color: var(--ink2); margin-bottom: 2px; }
.tip .r { display: flex; align-items: center; gap: 6px; }
.tip .r i { width: 10px; height: 2px; display: inline-block; }
.tip .r span { color: var(--ink2); }
.checks { font-size: 13px; color: var(--ink); margin: 0 0 6px; }
.checks div { margin: 2px 0; }
.msg { margin: 12px 0; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--ring); background: var(--surface); }
.note { color: var(--muted); font-size: 12px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.tbl th, .tbl td { text-align: right; padding: 6px 3px; border-bottom: 1px solid var(--grid); vertical-align: top; }
.tbl .mx { color: var(--muted); font-size: 11px; }
.tbl th:first-child, .tbl td:first-child { text-align: left; }
.tbl th { color: var(--ink2); font-weight: 500; }
#table { overflow-x: auto; }
main.loading { opacity: .6; }
