.spec-main { padding-block: clamp(24px, 5vw, 60px); }
.spec-main h1 { font-size: clamp(2rem, 5vw, 4.4rem); }
.spec-nav { display: flex; flex-wrap: wrap; gap: .4rem 1rem; margin-bottom: 1.25rem; font-size: .9rem; font-weight: 800; }
.spec-controls { display: flex; flex-wrap: wrap; align-items: end; gap: .7rem 1rem; margin-block: 1.4rem; }
.spec-controls label { display: grid; gap: .25rem; font-size: .84rem; font-weight: 800; }
.spec-controls input { min-width: 0; width: min(19rem, calc(100vw - 40px)); height: 2.5rem; padding: .55rem .7rem; border: 1px solid var(--line); border-radius: 6px; background: var(--card); color: var(--ink); font: inherit; }
.spec-controls output { align-self: center; font-size: .87rem; color: var(--muted); }
.spec-controls[hidden], .spec-nav [hidden], .spec-group[hidden], .spec-table [hidden] { display: none; }
.spec-group { padding-block: 24px 28px; scroll-margin-top: 1rem; }
.spec-group h2 { font-size: clamp(1.3rem, 3vw, 2.15rem); }
.spec-table { overflow: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
.spec-table:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
.spec-table table { min-width: 650px; font-size: .94rem; }
.spec-table tr:last-child > * { border-bottom: 0; }
.spec-table th[scope=row] { width: 28%; font-weight: 800; }
.spec-table td:last-child { width: 42%; }
.spec-table .unit, .spec-table .val { white-space: nowrap; }
.spec-table .val { font-variant-numeric: tabular-nums; font-weight: 850; }
.spec-table .unit, .spec-table small { color: var(--muted); }
.spec-table small { display: block; margin-top: .22rem; font-size: .86em; }
.spec-table .status { display: inline-block; margin-right: .28rem; padding: .1rem .4rem; border-radius: 4px; background: var(--screen); color: var(--ink); font-size: .77em; font-weight: 800; }
.spec-table .status.cad { background: var(--active); }
.spec-table .status.open { background: transparent; border: 1px solid var(--line); color: var(--accent); }

.benchmark .lead { max-width: 100ch; }
.benchmark-table table { min-width: 0; table-layout: fixed; font-size: .89rem; }
.benchmark-table thead th { width: 16%; }
.benchmark-table thead th:last-child { width: 22%; }
.benchmark-table th, .benchmark-table td { overflow-wrap: anywhere; }
.benchmark-table tbody small { display: block; margin-top: .25rem; color: var(--muted); font-size: .84em; }
.benchmark-table .verdict { display: table; margin-bottom: .25rem; padding: .05rem .37rem; border: 1px solid var(--line); border-radius: 4px; font-size: .78em; font-weight: 850; }
.benchmark-table .passes { background: var(--active); }
.benchmark-table .gap { color: var(--accent); }
.benchmark-table .indicative, .benchmark-table .archive { background: var(--screen); }
.benchmark-history { color: var(--muted); font-size: .88rem; }

@media screen and (max-width: 820px) {
  .benchmark-table thead { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; white-space: nowrap; }
  .benchmark-table tbody, .benchmark-table table { display: block; }
  .benchmark-table tbody tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-bottom: 1px solid var(--line); padding-block: .45rem; }
  .benchmark-table tbody tr > * { border: 0; padding: .38rem .55rem; }
  .benchmark-table tr th, .benchmark-table td:last-child { grid-column: 1 / -1; }
  .benchmark-table td::before { display: block; content: attr(data-label); font-weight: 850; font-size: .82em; margin-bottom: .12rem; }
}

.benchmark-table tr[hidden] { display: none; }

@media (max-width: 680px) {
  .spec-table table { min-width: 0; font-size: .83rem; }
  .spec-table tr { display: grid; grid-template-columns: minmax(0, 1fr) 3.5rem repeat(2, 4.65rem); }
  .spec-table tr > * { padding: .45rem .42rem; border-bottom: 0; }
  .spec-table th[scope=row], .spec-table td:last-child { width: auto; }
  .spec-table td:last-child, .spec-table thead th:last-child { grid-column: 1 / -1; }
  .spec-table thead th:last-child { display: none; }
  .spec-table td:last-child { border-bottom: 1px solid var(--line); padding-top: 0; }
  .spec-table .unit, .spec-table thead th:nth-child(2) { text-align: center; white-space: normal; }
  .spec-table .val, .spec-table thead th:nth-child(n+3) { text-align: right; }
  .spec-table .val { white-space: normal; }
  .spec-table th[scope=row] { overflow-wrap: anywhere; }
}

@media print {
  :root, :root[data-theme=night] { color-scheme: light; --paper: #fff; --card: #fff; --ink: #151515; --muted: #404040; --line: #bbb; --accent: #151515; --char: #eee; --screen: #eee; --active: #e5eee6; }
  header, .spec-nav, .spec-controls { display: none !important; }
  .spec-main { width: 100%; padding: 0; }
  .spec-main h1 { font-size: 24pt; }
  .spec-group { padding-block: 10pt; }
  .spec-group h2 { break-after: avoid; font-size: 15pt; }
  .spec-table { overflow: visible; }
  .spec-table table { min-width: 0; font-size: 8.5pt; }
  .spec-table tr { display: table-row; break-inside: avoid; }
  .spec-table thead th:last-child { display: table-cell; }
  .spec-table thead { color: var(--ink); }
  .spec-table tr > * { padding: 3pt 4pt; }
  .benchmark-table table { font-size: 8pt; }
  .benchmark-table thead { color: var(--ink); }
  .benchmark-table tr { break-inside: avoid; }
  .benchmark-table tr > * { padding: 3pt 4pt; }
}
