:root {
  color-scheme: light;
  --page: #f9f9f7;
  --surface: #fcfcfb;
  --text: #0b0b0b;
  --text-2: #52514e;
  --muted: #898781;
  --grid: #e1e0d9;
  --axis: #c3c2b7;
  --ring: rgba(11, 11, 11, 0.1);
  --wash: rgba(11, 11, 11, 0.04);
  --branch: #2a78d6;
  --release: #eb6834;
  --other: #1baf7a;
  --upstream: #a3a29c;
  --fast: #7a4fd0;
  --accent: #256abf;
  --good: #006300;
  --bad: #b42d2d;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --page: #0d0d0d;
    --surface: #1a1a19;
    --text: #f0efec;
    --text-2: #c3c2b7;
    --muted: #898781;
    --grid: #2c2c2a;
    --axis: #383835;
    --ring: rgba(255, 255, 255, 0.1);
    --wash: rgba(255, 255, 255, 0.05);
    --branch: #3987e5;
    --release: #d95926;
    --other: #199e70;
    --upstream: #6b6a65;
    --fast: #9a76e8;
    --accent: #6da7ec;
    --good: #0ca30c;
    --bad: #e66767;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0d0d0d;
  --surface: #1a1a19;
  --text: #f0efec;
  --text-2: #c3c2b7;
  --muted: #898781;
  --grid: #2c2c2a;
  --axis: #383835;
  --ring: rgba(255, 255, 255, 0.1);
  --wash: rgba(255, 255, 255, 0.05);
  --branch: #3987e5;
  --release: #d95926;
  --other: #199e70;
  --upstream: #6b6a65;
  --fast: #9a76e8;
  --accent: #6da7ec;
  --good: #0ca30c;
  --bad: #e66767;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
}
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 16px 64px; }
a { color: var(--accent); }
code { font-size: 0.92em; background: var(--wash); padding: 0.1em 0.35em; border-radius: 4px; }
pre { background: var(--surface); border: 1px solid var(--ring); border-radius: 8px; padding: 12px 14px; overflow-x: auto; font-size: 13px; }

header.top { padding: 32px 0 8px; }
header.top h1 { font-size: 28px; margin: 0 0 6px; letter-spacing: -0.01em; }
header.top p { margin: 0; color: var(--text-2); max-width: 70ch; }

.controls {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 5;
  background: var(--page);
  padding: 12px 0;
  border-bottom: 1px solid var(--grid);
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  align-items: center;
}
.seg { display: inline-flex; border: 1px solid var(--ring); border-radius: 8px; overflow: hidden; }
.seg button {
  font: inherit; border: 0; background: var(--surface); color: var(--text-2);
  padding: 6px 12px; cursor: pointer;
}
.seg button + button { border-left: 1px solid var(--ring); }
.seg button[aria-pressed="true"] { background: var(--text); color: var(--page); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--ring); border-radius: 999px; padding: 3px 10px 3px 8px;
  background: var(--surface); color: var(--text-2); cursor: pointer; user-select: none;
}
.chip input { margin: 0; accent-color: var(--text); }
.chip .key { width: 10px; height: 10px; border-radius: 2px; }
.chip:has(input:not(:checked)) { opacity: 0.55; }
.controls label.small { color: var(--text-2); display: inline-flex; gap: 6px; align-items: center; }
select { font: inherit; padding: 4px 6px; border-radius: 6px; border: 1px solid var(--ring); background: var(--surface); color: var(--text); }

nav.suites { display: flex; flex-wrap: wrap; gap: 4px 12px; padding: 12px 0 0; }
nav.suites a { color: var(--text-2); text-decoration: none; }
nav.suites a:hover { color: var(--text); text-decoration: underline; }

.machine-meta { color: var(--text-2); margin: 14px 0 0; }
.machine-meta strong { color: var(--text); }

section.suite { margin-top: 36px; }
section.suite > header { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; }
section.suite h2 { font-size: 20px; margin: 0; }
section.suite .about { color: var(--text-2); }
section.suite .view { margin-left: auto; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); gap: 14px; margin-top: 12px; }
.card { background: var(--surface); border: 1px solid var(--ring); border-radius: 10px; padding: 12px 14px 10px; }
.card h3 { font-size: 14px; font-weight: 600; margin: 0 0 8px; }
.card h3 .unit { font-weight: 400; color: var(--muted); }

.bars { display: grid; grid-template-columns: minmax(8.5rem, 40%) 1fr auto; column-gap: 8px; row-gap: 2px; }
.row { display: contents; }
.row > * { padding: 2px 0; }
.row .name { color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12.5px; }
.row .name sup { color: var(--muted); }
.row .track { position: relative; display: flex; align-items: center; min-width: 0; }
.row .bar { height: 14px; border-radius: 0 4px 4px 0; min-width: 2px; }
.row .val { font-variant-numeric: tabular-nums; font-size: 12.5px; text-align: right; white-space: nowrap; color: var(--text); }
.row .val .x { color: var(--muted); display: inline-block; min-width: 3.6em; }
.row .val .x.up { color: var(--good); }
.row .val .x.down { color: var(--bad); }
.row:hover > *, .row:focus-within > * { background: var(--wash); }
.row .track:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-radius: 3px; }
.row.missing .name { color: var(--muted); }
.row.missing .val { color: var(--muted); }

.notes { margin: 8px 0 0; padding: 0; list-style: none; color: var(--muted); font-size: 12px; }
.notes li { margin-top: 2px; }

table.data { border-collapse: collapse; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.tablewrap { overflow-x: auto; margin-top: 12px; background: var(--surface); border: 1px solid var(--ring); border-radius: 10px; }
table.data th, table.data td { padding: 5px 10px; border-bottom: 1px solid var(--grid); text-align: right; white-space: nowrap; }
table.data th:first-child, table.data td:first-child { text-align: left; position: sticky; left: 0; background: var(--surface); }
table.data thead th { color: var(--text-2); font-weight: 600; vertical-align: bottom; }
table.data td.na { color: var(--muted); }

.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--text-2); margin-top: 10px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; border-radius: 2px; display: inline-block; }

#tip {
  position: fixed; z-index: 20; pointer-events: none; max-width: 320px;
  background: var(--surface); color: var(--text); border: 1px solid var(--ring);
  border-radius: 8px; padding: 8px 10px; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18); font-size: 12.5px;
}
#tip .v { font-size: 15px; font-weight: 600; }
#tip .k { display: inline-block; width: 12px; height: 2px; vertical-align: middle; margin-right: 6px; border-radius: 1px; }
#tip .s { color: var(--text-2); }
#tip .n { color: var(--muted); margin-top: 4px; }

.method h2 { font-size: 20px; margin: 48px 0 8px; }
.method p, .method li { color: var(--text-2); max-width: 80ch; }
.method table.data { margin-top: 8px; }
.method table.data td, .method table.data th { text-align: left; }
footer { margin-top: 48px; color: var(--muted); font-size: 12.5px; }
.suite-notes { font-size: 12.5px; margin-top: 6px; }
