:root {
  color-scheme: light;
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #222c29;
  background: #fafbf9;
  --paper: #fff;
  --ink: #222c29;
  --muted: #5f6c65;
  --line: #dce2dc;
  --soft: #f1f4ef;
  --link: #126356;
  --focus: #007b85;
  --pass: #e1f0d9;
  --pass-ink: #315428;
  --partial: #fff0cf;
  --partial-ink: #745315;
  --basic: #eaf0f0;
  --basic-ink: #445e61;
  --feature-width: 240px;
  --tool-width: 130px;
}

* { box-sizing: border-box; }
body { margin: 0; }
main { padding: 24px 28px 56px; }
a { color: var(--link); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
summary { cursor: pointer; -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 6px; font-size: clamp(28px, 3vw, 34px); line-height: 1.2; letter-spacing: -.035em; font-weight: 650; }
h2 { margin-bottom: 12px; font-size: 20px; line-height: 1.3; }
h2 small { margin-left: 5px; font-weight: 400; }
h3 { font-size: 16px; }
p { max-width: 90ch; }
small { font-size: 12px; color: var(--muted); }
code, pre { font: 12px/1.6 ui-monospace, SFMono-Regular, Consolas, monospace; }
code { overflow-wrap: anywhere; }
pre { max-width: 100%; overflow: auto; padding: 12px 16px; background: var(--soft); white-space: pre-wrap; overflow-wrap: anywhere; }
li { overflow-wrap: anywhere; }

.masthead { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px 24px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.brand { font: 600 15px/1.4 ui-monospace, SFMono-Regular, Consolas, monospace; color: var(--ink); text-decoration: none; }
.masthead nav, footer nav { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 13px; }
.masthead nav a { padding: 5px 0; }
.intro { margin: 28px 0 22px; }
.run-date { margin: 0; font-size: 13px; color: var(--muted); }

.contents { display: flex; flex-wrap: wrap; gap: 12px 24px; margin: 20px 0 28px; font-size: 14px; }
.comparison { margin: 28px 0 40px; scroll-margin-top: 16px; }
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 0 0 10px; }
.legend > span { white-space: nowrap; }
.pass-key { color: var(--pass-ink); }
.partial-key { color: var(--partial-ink); }
.basic-key { color: var(--basic-ink); }
.skip-key { color: var(--muted); }
.legend { font-size: 13px; }
.note { margin: 8px 0 12px; font-size: 13px; color: var(--muted); }

.table-wrap { width: max-content; border: 1px solid var(--line); background: var(--paper); }
.matrix { width: calc(var(--feature-width) + var(--tool-count, 0) * var(--tool-width)); table-layout: fixed; border-collapse: separate; border-spacing: 0; font-size: 13px; line-height: 1.4; }
.feature-col { width: var(--feature-width); }
.matrix col[data-tool] { width: var(--tool-width); }
.matrix th, .matrix td { padding: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); vertical-align: middle; }
.matrix th:last-child, .matrix td:last-child { border-right: 0; }
.matrix tbody tr:last-child > * { border-bottom: 0; }
.matrix thead th { position: sticky; top: 0; z-index: 3; padding: 12px 8px; background: var(--soft); text-align: center; font-weight: 650; overflow-wrap: anywhere; }
.matrix thead th:first-child { left: 0; z-index: 4; padding-left: 14px; text-align: left; }
.matrix thead a { color: var(--ink); text-decoration: none; }
.matrix thead a:hover { color: var(--link); text-decoration: underline; }
.matrix thead small { display: block; margin-top: 3px; font-size: 11px; font-weight: 400; }
.matrix tbody th { position: sticky; left: 0; z-index: 1; background: var(--paper); text-align: left; font-weight: 450; }
.matrix tbody th > a { display: block; padding: 10px 14px; color: var(--ink); text-decoration: none; }
.matrix tbody th > a[data-popover="info"] { text-decoration: underline; text-decoration-color: var(--line); }
.matrix tbody th > a:hover { color: var(--link); text-decoration: underline; }
.matrix tbody td { text-align: center; font-variant-numeric: tabular-nums; }
.matrix .group-row th { z-index: 2; padding: 7px 14px; background: var(--soft); color: var(--muted); font-size: 11px; font-weight: 650; letter-spacing: .035em; text-transform: uppercase; }
.matrix .group-label { position: sticky; left: 14px; display: inline-block; }
.matrix .result { display: flex; width: 100%; height: 100%; align-items: center; justify-content: center; min-height: 39px; padding: 9px 7px; color: inherit; text-decoration: none; }
.matrix td:has(> .result) { cursor: pointer; }
.matrix td:has(> .result):hover { box-shadow: inset 0 0 0 2px currentColor; }
.matrix :is(td, th):has(> [data-popover][aria-expanded="true"]) { box-shadow: inset 0 0 0 2px var(--focus); }
.matrix a:focus-visible { outline-offset: -3px; }
.matrix td.pass { background: var(--pass); color: var(--pass-ink); }
.matrix td.fail, .matrix td.error, .matrix td.partial { background: var(--partial); color: var(--partial-ink); }
.matrix td.basic { background: var(--basic); color: var(--basic-ink); }
.matrix td.skip { color: var(--muted); background: #f9faf8; }
.matrix tr:hover > th { background: var(--soft); }
.speed-matrix tbody th { padding: 10px 14px; }
.speed-matrix tbody th small { display: block; font-size: 11px; font-weight: 400; }
.speed-matrix td.speed-ranked { background: hsl(var(--speed-hue) 65% 91%); color: var(--ink); }
.speed-matrix td.error, .speed-matrix td.skip { background: #f9faf8; color: var(--muted); }
#cell-popover { display: none; position: fixed; inset: auto; margin: 0; padding: 0; width: 460px; max-width: calc(100vw - 24px); max-height: min(480px, calc(100dvh - 24px)); overflow: hidden; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); color: var(--ink); font: 13px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; box-shadow: 0 8px 28px #222c2926; }
#cell-popover:popover-open { display: flex; flex-direction: column; }
.popover-header { display: flex; align-items: center; gap: 8px; flex: none; padding: 5px 8px 5px 16px; border-bottom: 1px solid var(--line); }
.popover-heading { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; flex: 1; min-width: 0; }
.popover-tool { color: var(--muted); font-size: 11px; }
#cell-popover-title { margin: 0; font-size: 17px; line-height: 1.35; letter-spacing: -.02em; overflow-wrap: anywhere; }
.popover-close { flex: none; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 3px; background: transparent; color: var(--muted); font: inherit; font-size: 24px; line-height: 1; cursor: pointer; }
.popover-close:hover { background: var(--soft); color: var(--ink); }
.popover-body { min-height: 0; padding: 14px 16px 16px; overflow: auto; overscroll-behavior: contain; overflow-wrap: anywhere; }
.popover-body p { margin: 0 0 12px; }
.popover-body > :last-child { margin-bottom: 0; }
.feature-checks { color: var(--muted); font-size: 12px; }
.feature-diagram { display: block; width: 100%; max-width: 320px; height: auto; margin: 12px 0; }
.result-summary { margin-bottom: 10px; font-size: 15px; font-weight: 550; font-variant-numeric: tabular-nums; }
.result-summary .fail, .result-summary .error { color: #a43b34; }
.result-summary .skip { color: var(--muted); }
.scope-label { color: var(--muted); font-size: 11px; margin: -4px 0 12px; }
.popover-case { border-top: 1px solid var(--line); }
.popover-case > summary { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 10px 0; list-style: none; }
.popover-case > summary::-webkit-details-marker { display: none; }
.popover-case > summary::after { content: ''; width: 6px; height: 6px; flex: none; margin: 0 3px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: rotate(45deg); }
.popover-case[open] > summary::after { transform: rotate(225deg); }
.case-label { flex: 1; min-width: 0; font-weight: 550; }
.case-status { flex: none; font-size: 12px; color: var(--muted); }
.case-status.pass { color: var(--pass-ink); }
.case-status.fail, .case-status.error { color: #95382f; }
.case-context { display: block; color: var(--muted); font-size: 11px; font-weight: 400; }
.case-label .case-context { display: inline; margin-left: 8px; }
.case-state { padding: 8px 0; color: var(--muted); }
.metric-grid { margin-bottom: 4px; }
.metric-grid:empty { display: none; }
.metric { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 4px 12px; padding: 5px 0; }
.metric-label { color: var(--muted); font-size: 12px; }
.metric-reading { text-align: right; font-variant-numeric: tabular-nums; }
.metric-value { font-weight: 550; }
.metric-value small { font-size: 11px; font-weight: 400; }
.metric.fail .metric-value { color: #a43b34; }
.metric-limit { display: inline-block; margin-left: 6px; color: var(--muted); font-size: 11px; }
.metric-limit strong { font-weight: 400; }
.case-explanation { line-height: 1.6; }
.technical-details { margin-bottom: 12px; color: var(--muted); }
.technical-details > summary { min-height: 44px; padding: 11px 0; font-size: 12px; }
.technical-details p, .technical-details pre { color: var(--ink); }
.popover-body .case-artifacts { display: flex; gap: 16px; margin-bottom: 0; font-size: 11px; }
.popover-body pre { margin: 8px 0 12px; padding: 10px 12px; font-size: 11px; }
.popover-body .case-output:last-child > :last-child { margin-bottom: 12px; }
.popover-body .bench-output > :last-child { margin-bottom: 0; }

.overhead { margin: 12px 0; max-width: 90ch; font-size: 13px; }
.overhead > summary { min-height: 36px; padding: 7px 0; }
.overhead p, .overhead ul { margin: 8px 0; }

.archive { margin: 0; border-top: 1px solid var(--line); }
.cell-details > details { display: none; }
.cell-details > details:target, .cell-details > details:has(:target) { display: block; }
.archive > summary { min-height: 52px; padding: 15px 0; font-size: 15px; font-weight: 550; }
.archive > summary:hover, .contract > summary:hover, .package-entry summary:hover { color: var(--link); }
.archive > summary small { margin-left: 7px; font-weight: 400; }
.archive > p, .archive > ul, .archive > dl, .archive > label, .archive > .table-wrap { margin-top: 0; margin-bottom: 18px; }
.archive p, .archive li, .archive dl { font-size: 13px; }
.archive ul { padding-left: 22px; }
.archive li { margin: 6px 0; }
.archive .contract, .archive > details { margin: 0 0 0 14px; border-top: 1px solid var(--line); }
.contract > summary, .archive > details > summary { min-height: 44px; padding: 11px 0; font-size: 13px; font-weight: 550; }
.contract > summary code, .archive > details > summary code { margin-left: 6px; color: var(--muted); font-size: 11px; font-weight: 400; }
.contract > p, .contract > ul, .contract > dl { margin: 4px 0 14px; }
.case-result { margin: 0 0 0 16px; border-top: 1px solid var(--line); }
.case-result > summary { min-height: 40px; padding: 9px 0; font-size: 13px; }
.case-result > p { margin: 6px 0; }
.case-result pre { margin: 8px 0 16px; }
.case-tools { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 8px 0; padding: 0; font-size: 12px; list-style: none; }
.case-tools .pass { color: var(--pass-ink); }
.case-tools .fail, .case-tools .error { color: var(--partial-ink); }
.case-tools .skip { color: var(--muted); }
.archive [id], .cell-details [id] { scroll-margin-top: 16px; }
#package-rows { list-style: none; padding: 0; }
#package-rows > li { margin: 0; border-top: 1px solid var(--line); }
.package-entry summary { padding: 11px 0; min-height: 44px; font-size: 13px; }
.package-entry summary a { font-weight: 550; }
.package-entry summary small, .package-entry .purpose { margin-left: 8px; color: var(--muted); }
.package-entry p { margin: 2px 0 12px 16px; }
.run-info { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 7px 20px; }
.run-info dt { color: var(--muted); }
.run-info dd { margin: 0; overflow-wrap: anywhere; }
footer { display: flex; flex-wrap: wrap; gap: 8px 20px; border-top: 1px solid var(--line); margin-top: 24px; padding-top: 20px; font-size: 12px; color: var(--muted); }
footer p { margin: 0; }
.skip-link { position: fixed; top: 8px; left: 8px; z-index: 10; padding: 10px 14px; background: var(--paper); transform: translateY(-160%); }
.skip-link:focus { transform: none; }

@media (max-width: 700px) {
  :root { --feature-width: 160px; --tool-width: 110px; }
  main { padding: 16px 14px 36px; }
  .masthead { gap: 8px 16px; padding-bottom: 12px; }
  .masthead nav { gap: 8px 14px; font-size: 12px; }
  .intro { margin: 22px 0 18px; }
  .legend { gap: 5px 10px; }
  .matrix { font-size: 12px; }
  .matrix thead th { padding: 10px 6px; }
  .matrix thead th:first-child { padding-left: 10px; }
  .matrix tbody th > a, .speed-matrix tbody th { padding: 10px; }
  .matrix .group-row th { padding: 7px 10px; }
  .matrix .group-label { left: 10px; }
  .matrix .result { min-height: 44px; padding: 10px 6px; }
  .archive > summary { font-size: 14px; }
  .archive > summary small { font-size: 11px; }
  .archive .contract, .archive > details { margin-left: 8px; }
  .contract > summary code, .archive > details > summary code { display: block; margin: 3px 0 0 14px; }
  .package-entry summary small, .package-entry .purpose { display: block; margin: 4px 0 0 14px; }
  .run-info { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .run-info dd { margin-bottom: 16px; }
}

@media (pointer: coarse) {
  .matrix .result { min-height: 44px; }
}

@media print {
  :root { background: white; }
  main { max-width: none; padding: 0; }
  .skip-link, .contents, .masthead nav, footer, #cell-popover { display: none; }
  .table-wrap { width: 100%; }
  .matrix { width: 100%; font-size: 10px; }
  .matrix thead th, .matrix tbody th { position: static; }
  .feature-col { width: 24%; }
  .matrix { print-color-adjust: exact; }
}
