:root {
  color-scheme: light;
  --surface: #fcfcfb;
  --surface-raised: #f3f2ef;
  --hairline: #e4e3de;
  --text-primary: #0b0b0b;
  --text-secondary: #52514e;
  --link: #1c5cab;
  --status-good: #008300;
  --status-bad: #c53030;
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --series-3: #1baf7a;
  --series-4: #eda100;
  --series-5: #e87ba4;
  --series-6: #008300;
  --series-7: #6250d6;
  --series-8: #e34948;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --surface: #1a1a19;
    --surface-raised: #242423;
    --hairline: #363634;
    --text-primary: #f0efec;
    --text-secondary: #c3c2b7;
    --link: #86b6ef;
    --status-good: #4cc24c;
    --status-bad: #e66767;
    --series-1: #3987e5;
    --series-2: #d95926;
    --series-3: #199e70;
    --series-4: #c98500;
    --series-5: #d55181;
    --series-6: #008300;
    --series-7: #9085e9;
    --series-8: #e66767;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--surface);
  color: var(--text-primary);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

header.site {
  display: flex;
  gap: 2rem;
  align-items: baseline;
  padding: 0.75rem 1.5rem;
  border-bottom: 1px solid var(--hairline);
}

header.site .brand { font-weight: 600; color: var(--text-primary); text-decoration: none; }
header.site nav { display: flex; gap: 1.25rem; }

main { max-width: 72rem; margin: 0 auto; padding: 1.5rem; }

h1 { font-size: 1.75rem; margin: 0.5rem 0 1rem; }
h2 { font-size: 1.25rem; margin: 2.25rem 0 0.75rem; }
h3 { font-size: 1rem; margin: 1.5rem 0 0.5rem; }

a { color: var(--link); }

table { width: 100%; border-collapse: collapse; margin: 0.75rem 0; }
th, td { padding: 0.45rem 0.75rem 0.45rem 0; text-align: left; border-bottom: 1px solid var(--hairline); vertical-align: top; }
th { font-weight: 600; color: var(--text-secondary); font-size: 0.875rem; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.wrap { overflow-wrap: anywhere; }

.muted { color: var(--text-secondary); font-size: 0.875rem; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.875rem; overflow-wrap: anywhere; }
.note { padding: 0.5rem 0.75rem; background: var(--surface-raised); border-radius: 4px; }
.flag { color: var(--status-bad); font-size: 0.875rem; }

.status { font-weight: 600; }
.status-passed { color: var(--status-good); }
.status-failed, .status-error { color: var(--status-bad); }
.status-pending { color: var(--text-secondary); }

dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 0.25rem 1.5rem; margin: 1rem 0; }
dl.facts dt { color: var(--text-secondary); }
dl.facts dd { margin: 0; }

pre {
  padding: 0.75rem;
  background: var(--surface-raised);
  border-radius: 4px;
  overflow-x: auto;
  font: 0.8125rem/1.45 ui-monospace, SFMono-Regular, Menlo, monospace;
}

details { margin: 0.5rem 0; }
summary { cursor: pointer; color: var(--text-secondary); font-size: 0.875rem; }

form.controls { display: flex; flex-wrap: wrap; gap: 1rem 2rem; align-items: flex-start; margin-bottom: 1.5rem; }
form.controls fieldset { border: 1px solid var(--hairline); border-radius: 4px; padding: 0.5rem 0.75rem; margin: 0; }
form.controls fieldset label { display: block; }
form.controls legend { color: var(--text-secondary); font-size: 0.875rem; }

button, select {
  font: inherit;
  padding: 0.3rem 0.75rem;
  color: var(--text-primary);
  background: var(--surface-raised);
  border: 1px solid var(--hairline);
  border-radius: 4px;
}
button { cursor: pointer; }

figure.chart { position: relative; margin: 0.5rem 0; }
figure.chart .plot { width: 100%; }
figure.chart .plot:focus-visible { outline: 2px solid var(--series-1); outline-offset: 2px; }
figure.chart svg { display: block; width: 100%; height: auto; touch-action: pan-y; }
figure.chart text { fill: var(--text-secondary); font-size: 12px; font-variant-numeric: tabular-nums; }
figure.chart .grid { stroke: var(--hairline); stroke-width: 1; }
figure.chart .crosshair { stroke: var(--text-secondary); stroke-width: 1; }
figure.chart .series { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
figure.chart .dot { stroke: var(--surface); stroke-width: 2; }
figure.chart .frontier { fill: none; stroke: var(--text-secondary); stroke-width: 2; stroke-linejoin: round; }
figure.chart .ceiling { stroke: var(--text-secondary); stroke-width: 1; stroke-dasharray: 4 4; }
figure.chart .mark { stroke: var(--surface); stroke-width: 1.5; }
figure.chart .cross { fill: none; stroke-width: 2; stroke-linecap: round; }
figure.chart .focused { stroke: var(--text-primary, currentColor); stroke-width: 2; }
figure.chart .clickable { cursor: pointer; }
.chart-note { margin: 0 0 0.75rem; font-size: 0.875rem; }
figure.chart .legend svg.key { display: inline-block; width: 12px; height: 12px; margin-right: 0.35rem; vertical-align: -1px; overflow: visible; }

.legend { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; margin: 0 0 0.5rem; font-size: 0.875rem; color: var(--text-secondary); }
.legend span.key, .tooltip span.key { display: inline-block; width: 14px; height: 2px; margin-right: 0.4rem; vertical-align: middle; }

.tooltip {
  position: absolute;
  z-index: 2;
  pointer-events: none;
  min-width: 8rem;
  padding: 0.4rem 0.6rem;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 4px;
  font-size: 0.8125rem;
  box-shadow: 0 2px 6px rgb(0 0 0 / 12%);
}
.tooltip .head { color: var(--text-secondary); margin-bottom: 0.15rem; }
.tooltip .row { white-space: nowrap; }
.tooltip strong { font-weight: 600; margin-right: 0.4rem; font-variant-numeric: tabular-nums; }
.tooltip .name { color: var(--text-secondary); }

.browser { display: grid; grid-template-columns: minmax(12rem, 20rem) 1fr; gap: 1rem; align-items: start; }
.browser ul { list-style: none; margin: 0; padding: 0; max-height: 36rem; overflow: auto; font-size: 0.875rem; }
.browser li button { display: block; width: 100%; padding: 0.15rem 0.4rem; text-align: left; background: none; border: 0; color: var(--link); overflow-wrap: anywhere; font-size: inherit; }
.browser li button[aria-current="true"] { background: var(--surface-raised); font-weight: 600; }
.browser li span.size { color: var(--text-secondary); }
.browser pre { margin: 0; max-height: 36rem; overflow: auto; }

@media (max-width: 40rem) {
  .browser { grid-template-columns: 1fr; }
  table { display: block; overflow-x: auto; }
}
