/* TabWorks site tokens (design study s4.2 v3). Contrast pairs are asserted by site/check-site.mjs and site/tools/check-a11y.mjs. */
:root {
  --paper: #f3efe6; --panel: #fbf9f4; --ink: #1c1b18; --muted: #6b665b; --rule: #ddd6c7;
  --signal: #c2410c; --signal-text: #a8380a; --moss: #3f5d4a;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #171613; --panel: #1f1d19; --ink: #ece7dc; --muted: #a39d8f; --rule: #34312a;
    --signal: #f07a3a; --signal-text: #f07a3a; --moss: #8fb59a;
  }
}
* { box-sizing: border-box; }
html { background: var(--paper); }
body { margin: 0; color: var(--ink); background: var(--paper); font: 17px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--signal-text); text-underline-offset: 3px; }
a:focus-visible, .btn:focus-visible, button:focus-visible, input:focus-visible, summary:focus-visible, .table-wrap:focus-visible, main:focus-visible { outline: 3px solid var(--signal); outline-offset: 3px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; background: var(--panel); color: var(--ink); padding: 8px 12px; z-index: 2; }
.wrap { max-width: 980px; margin: 0 auto; padding: 0 20px; }
header.site { border-bottom: 1px solid var(--rule); }
header.site .wrap { display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: baseline; padding-top: 18px; padding-bottom: 14px; }
.brand { font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif; font-size: 24px; font-weight: 700; color: var(--ink); text-decoration: none; margin-right: auto; }
nav.site ul { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 0; padding: 0; }
nav.site a { color: var(--ink); display: inline-block; padding: 6px 0; min-height: 24px; }
nav.site a[aria-current="page"] { color: var(--signal-text); text-decoration-thickness: 2px; }
main { padding: 8px 0 48px; }
.grid { display: grid; grid-template-columns: 7fr 5fr; gap: 40px; align-items: start; }
@media (max-width: 760px) { .grid { grid-template-columns: 1fr; gap: 16px; } }
h1, h2, h3 { font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif; line-height: 1.2; font-weight: 700; }
h1 { font-size: clamp(32px, 5vw, 48px); margin: 36px 0 14px; max-width: 22ch; }
h2 { font-size: 26px; margin: 48px 0 10px; padding-top: 14px; border-top: 1px solid var(--rule); }
h3 { font-size: 20px; margin: 24px 0 6px; }
.lede { font-size: 19px; max-width: 60ch; }
.meta, .note { color: var(--muted); font-size: 15px; }
time, .mono, code { font-family: ui-monospace, "Cascadia Mono", Consolas, "Courier New", monospace; }
code { font-size: 15px; background: var(--panel); border: 1px solid var(--rule); padding: 0 4px; overflow-wrap: anywhere; }
.btn { display: inline-block; background: var(--ink); color: var(--paper); text-decoration: none; padding: 12px 18px; min-height: 44px; font: inherit; font-weight: 600; border: 0; cursor: pointer; }
.btn:hover, .btn:focus-visible { background: var(--signal); color: var(--paper); }
.cta { margin: 22px 0 6px; }
.textlink { margin: 4px 0 0; }
.timeline { list-style: none; margin: 40px 0 0; padding: 0 0 0 18px; border-left: 2px solid var(--muted); background: var(--panel); }
.timeline li { position: relative; padding: 10px 14px 10px 6px; border-bottom: 1px solid var(--rule); }
.timeline li::before { content: ""; position: absolute; left: -25px; top: 18px; width: 12px; height: 2px; background: var(--signal); }
.timeline time { display: block; font-size: 14px; color: var(--muted); }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; margin: 12px 0; font-size: 16px; background: var(--panel); }
th, td { text-align: left; vertical-align: top; border-bottom: 1px solid var(--rule); padding: 9px 10px; }
thead th { border-bottom: 2px solid var(--muted); }
th[scope="row"] { font-weight: 600; }
ul.plain { padding-left: 20px; }
ol.steps { padding-left: 24px; }
ol.steps li, ul.plain li { margin: 4px 0; }
caption { text-align: left; caption-side: top; padding: 0 0 6px; }
address { font-style: normal; }
footer.site { border-top: 1px solid var(--rule); color: var(--muted); font-size: 15px; padding: 22px 0 40px; }
footer.site ul { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 18px; padding: 0; margin: 0 0 10px; }
footer.site a { color: var(--muted); display: inline-block; padding: 4px 0; }
footer.site p { margin: 6px 0; }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Hero scrub (design study s4.5). Without JavaScript the list shows every dated state. With it, .on turns the list into
   one stacked cell (the tallest state sets the height, so scrubbing never moves the page) and the controls are inserted. */
.scrub { margin-top: 28px; }
.scrub .timeline { margin-top: 8px; }
.timeline .what { display: block; margin: 0; font-weight: 600; }
.tablist { list-style: none; margin: 6px 0 0; padding: 0; }
.tablist li { border: 0; padding: 2px 0; font-size: 15px; line-height: 1.35; }
.tablist li::before { display: none; }
.tablist .dom { display: block; font-family: ui-monospace, "Cascadia Mono", Consolas, "Courier New", monospace; font-size: 13px; color: var(--muted); }
.tablist .added { color: var(--moss); font-weight: 600; }
.scrub.on .timeline { display: grid; }
.scrub.on .timeline > li { grid-area: 1 / 1; visibility: hidden; opacity: 0; }
.scrub.on .timeline > li.active { visibility: visible; opacity: 1; }
/* CLS (HP run tabworks-lh-r1, desktop 0.152): the stacked layout used to start only when the script ran, so the list collapsed from five
   states to one after first paint. A browser that will run scripts gets the stacked layout (newest state showing) from the first paint;
   with scripting off, every dated state still shows. The script then adds .on and picks the active state; the controls go AFTER the list. */
@media (scripting: enabled) {
  .scrub .timeline { display: grid; }
  .scrub .timeline > li { grid-area: 1 / 1; visibility: hidden; opacity: 0; }
  .scrub .timeline > li:last-child { visibility: visible; opacity: 1; }
  .scrub.on .timeline > li:last-child:not(.active) { visibility: hidden; opacity: 0; }
}
.scrub-ctl { margin-top: 12px; }
.scrub-ctl label { display: block; font-weight: 600; font-size: 15px; }
.scrub-row { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.step { flex: none; width: 44px; height: 44px; padding: 0; background: var(--ink); color: var(--paper); border: 0; font: 700 22px/1 ui-monospace, "Cascadia Mono", Consolas, monospace; cursor: pointer; }
.step:hover, .step:focus-visible { background: var(--signal); color: var(--paper); }
.step[aria-disabled="true"] { background: var(--muted); color: var(--paper); cursor: default; }
.track { --thumb: 28px; position: relative; flex: 1; min-width: 0; height: 44px; }
.track input[type="range"] { position: absolute; inset: 0; width: 100%; height: 44px; margin: 0; background: transparent; -webkit-appearance: none; appearance: none; touch-action: pan-y; }
.track input[type="range"]::-webkit-slider-runnable-track { height: 4px; background: var(--muted); border: 0; }
.track input[type="range"]::-moz-range-track { height: 4px; background: var(--muted); border: 0; }
.track input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 28px; height: 28px; margin-top: -12px; box-sizing: border-box; background: var(--signal); border: 3px solid var(--paper); border-radius: 0; }
.track input[type="range"]::-moz-range-thumb { width: 22px; height: 22px; background: var(--signal); border: 3px solid var(--paper); border-radius: 0; }
.ticks { position: absolute; left: 0; right: 0; top: 30px; height: 12px; margin: 0; padding: 0; list-style: none; pointer-events: none; }
.ticks li { position: absolute; top: 0; width: 2px; height: 10px; margin-left: -1px; background: var(--muted); }
.scrub output { display: block; margin-top: 6px; font-size: 15px; color: var(--muted); min-height: 3.3em; } /* two lines reserved: the longest state wraps, and a changing line count would move the import band */
.band { margin-top: 12px; }
.sources td:first-child, .sources th[scope="row"] { white-space: nowrap; }
.drop { margin: 14px 0; padding: 14px; background: var(--panel); border: 1px solid var(--muted); }
.drop label { display: block; font-weight: 600; margin-bottom: 6px; }
.drop input[type="file"] { max-width: 100%; font: inherit; }
.results { margin: 12px 0 0; padding: 0; list-style: none; }
.results > li { border-bottom: 1px solid var(--rule); padding: 8px 0; }
.results summary { cursor: pointer; font-weight: 600; min-height: 24px; }
.results .count { font-weight: 400; color: var(--muted); }
.results .addr { margin: 6px 0 0; padding-left: 18px; font-size: 14px; overflow-wrap: anywhere; }
.results .addr li { margin: 2px 0; }
.err { color: var(--signal-text); font-weight: 600; }
.ledger-note { margin: 4px 0 18px; }
.changelog { list-style: none; margin: 18px 0; padding: 0; }
.changelog > li { display: grid; grid-template-columns: 9.5em 1fr; gap: 4px 20px; padding: 14px 0; border-bottom: 1px solid var(--rule); }
.changelog time { color: var(--muted); font-size: 15px; }
.changelog h2 { margin: 0 0 4px; padding: 0; border: 0; font-size: 20px; }
.changelog p { margin: 4px 0; }
@media (max-width: 560px) { .changelog > li { grid-template-columns: 1fr; } }

/* Phone tables (design study s4.6): a table keeps its table semantics and scrolls sideways inside a focusable region,
   with the row labels pinned on the left so a number is never separated from the thing it measures. */
th[scope="row"] { position: sticky; left: 0; background: var(--panel); }
@media (max-width: 560px) {
  body { font-size: 16px; }
  table { font-size: 15px; }
  th, td { padding: 8px 8px; min-width: 9.5em; }
  th[scope="row"] { min-width: 8em; max-width: 9em; }
  .sources td:first-child, .sources th[scope="row"] { white-space: normal; }
  .track input[type="range"]::-webkit-slider-thumb { width: 44px; height: 44px; margin-top: -20px; }
  .track input[type="range"]::-moz-range-thumb { width: 38px; height: 38px; }
  .track { --thumb: 44px; }
  .ticks { top: 34px; }
}
@media (prefers-reduced-motion: no-preference) {
  .btn, .step { transition: background-color 120ms; }
  /* Opacity only: visibility must flip at once, or for 150 ms after load all five states are still "visible" (and read by a screen reader). */
  .scrub.on .timeline > li { transition: opacity 150ms; }
}
