:root {
  color-scheme: light;
  --bg: #fafaf7;
  --ink: #1a1a1a;
  --muted: #6b6b66;
  --rule: #dcdcd5;
  --grid: #ebebe5;
  --axis: #c8c8c0;
  --link: #1a1a1a;
  --focus: #2a78d6;
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s5: #e87ba4; --s6: #008300;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #161616; --ink: #e8e8e3; --muted: #9a9a93; --rule: #33332f; --grid: #262624; --axis: #44443f;
    --link: #e8e8e3; --focus: #6da7ec;
    --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #3a9a3a;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--sans); }
main { max-width: 780px; margin: 0 auto; padding: 28px 16px 48px; }
h1 { font-size: 20px; margin: 0 0 6px; }
p { margin: 0 0 10px; }
a { color: var(--link); }
header { margin-bottom: 18px; }
.meta, .msg, footer { color: var(--muted); font-size: 13px; }
.msg:empty { display: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }

.search { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; font-size: 13px; }
.combo { position: relative; flex: 1 1 240px; max-width: 360px; }
input, select, button { font: 14px var(--mono); color: var(--ink); background: var(--bg);
  border: 1px solid var(--axis); border-radius: 2px; }
input { width: 100%; padding: 6px 8px; }
select { padding: 5px 4px; font-size: 13px; }
button { padding: 6px 12px; cursor: pointer; }
button:hover { border-color: var(--ink); }
button:disabled { opacity: 0.4; cursor: default; }
#suggestions { position: absolute; z-index: 10; left: 0; right: 0; top: 100%; margin: 0; padding: 0; list-style: none;
  background: var(--bg); border: 1px solid var(--axis); border-top: 0; }
#suggestions li { padding: 4px 8px; font: 14px var(--mono); cursor: pointer; }
#suggestions li[aria-selected="true"], #suggestions li:hover { background: var(--grid); }

.chips { display: flex; flex-wrap: wrap; gap: 4px 16px; font: 14px var(--mono); min-height: 21px; }
.chips > span { display: inline-flex; align-items: center; gap: 6px; }
.chips i { width: 12px; height: 3px; display: inline-block; }
.chips a { font: 12px var(--sans); color: var(--muted); }
.chips button { border: 0; padding: 0 2px; background: none; color: var(--muted); font-size: 15px; line-height: 1; }
.chips button:hover { color: var(--ink); }

.chart { position: relative; width: 100%; min-height: 320px; margin: 6px 0 12px; }
.chart svg { display: block; width: 100%; overflow: visible; }
.tick { font: 11px var(--mono); fill: var(--muted); font-variant-numeric: tabular-nums; }
.hit { fill: transparent; cursor: crosshair; outline: none; }
.hit:focus-visible { stroke: var(--focus); stroke-width: 2; }
.tip { position: absolute; pointer-events: none; background: var(--bg); border: 1px solid var(--axis); padding: 6px 8px;
  font-size: 12px; min-width: 140px; display: grid; gap: 2px; z-index: 5; }
.tip .when { font: 11px var(--mono); color: var(--muted); }
.tip .r { display: grid; grid-template-columns: 12px auto 1fr; align-items: center; gap: 6px; }
.tip .r i { width: 12px; height: 2px; }
.tip .r b { font-weight: 600; font-variant-numeric: tabular-nums; }
.tip .r span { color: var(--muted); font-family: var(--mono); }
.empty { display: grid; place-items: center; min-height: 280px; color: var(--muted); font-size: 13px; }

.note { font-size: 13px; color: var(--muted); max-width: 70ch; }
.presets { font-size: 13px; color: var(--muted); }
.presets button { border: 0; padding: 0; background: none; font: 13px var(--sans); color: var(--link);
  text-decoration: underline; margin-right: 10px; }
details { font-size: 13px; margin-bottom: 24px; }
summary { cursor: pointer; color: var(--muted); }
.table-wrap { overflow-x: auto; margin-top: 8px; }
table { border-collapse: collapse; font: 12px var(--mono); font-variant-numeric: tabular-nums; }
th, td { padding: 3px 10px; text-align: right; border-bottom: 1px solid var(--grid); white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
th { color: var(--muted); font-weight: normal; }
footer { border-top: 1px solid var(--rule); padding-top: 12px; }
