@font-face {
  font-family: "Archivo";
  src: url("assets/fonts/archivo-var.woff2") format("woff2");
  font-weight: 400 900;
  font-stretch: 62% 125%;
  font-display: swap;
}
@font-face {
  font-family: "Azeret Mono";
  src: url("assets/fonts/azeret-mono-var.woff2") format("woff2");
  font-weight: 400 600;
  font-display: swap;
}

/* The Crate Line: a packing bench on kraft paper. Pine crate, rosewood bar,
   one stamp red that only ever means the box is packed or the crate is wrong.
   Olive marks a box that matches the occasion; amber marks a caveat. */
:root {
  --ground: #d9c7a8;
  --ground-2: #cfbc9a;
  --panel: #e6d7bd;
  --panel-2: #ecdfc7;
  --panel-3: #f2e7d2;
  --line: rgba(54, 38, 26, 0.16);
  --line-2: rgba(54, 38, 26, 0.3);
  --line-control: rgba(54, 38, 26, 0.5);
  --ink: #2b2119;
  --muted: #5a4632;
  --action: #8f2c19;
  --action-2: #74220f;
  --action-dim: rgba(143, 44, 25, 0.11);
  --rose: #6b2b30;
  --rose-2: #552025;
  --rose-ink: #f5ead6;
  --match: #4a5c33;
  --match-dim: rgba(74, 92, 51, 0.12);
  --warn: #8a5a12;
  --warn-dim: rgba(138, 90, 18, 0.12);
  --crate: #b8874f;
  --crate-2: #a3743f;
  --crate-3: #c99d68;
  --straw: #e8d9b4;
  --sans: "Archivo", ui-sans-serif, system-ui, sans-serif;
  --mono: "Azeret Mono", ui-monospace, "SFMono-Regular", monospace;
  --max: 1380px;
  --gutter: clamp(18px, 4.2vw, 56px);
  --label: 0.6875rem;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
main section[id] { scroll-margin-top: 84px; }

body {
  margin: 0;
  background-color: var(--ground);
  background-image:
    repeating-linear-gradient(0deg, rgba(54, 38, 26, 0.035) 0 1px, transparent 1px 96px),
    radial-gradient(circle at 88% -8%, rgba(107, 43, 48, 0.12), transparent 42%);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--action); color: #fdf6e9; }
* { scrollbar-width: thin; scrollbar-color: var(--line-2) var(--ground); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--ground); }
::-webkit-scrollbar-thumb { background: var(--line-2); border: 3px solid var(--ground); }

a { color: inherit; }
button, input, select { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--action); outline-offset: 3px; }

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 50;
  padding: 10px 14px; background: var(--action); color: #fdf6e9;
  font-family: var(--mono); font-size: 0.75rem; text-decoration: none;
}
.skip:focus { top: 12px; }

.wrap {
  width: min(var(--max), calc(100% - var(--gutter) * 2));
  margin-inline: auto;
}

.mono {
  font-family: var(--mono);
  font-size: var(--label);
  line-height: 1.5;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -0.03em; line-height: 1.05; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; }

/* ---------- bar ---------- */

.bar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--ground) 94%, transparent);
  border-bottom: 1px solid var(--line-2);
  backdrop-filter: blur(8px);
}
.bar-in { display: flex; align-items: center; gap: 1.2rem; min-height: 64px; }

.brand { display: flex; flex-direction: column; gap: 0.05rem; text-decoration: none; line-height: 1; }
.brand-a { font-size: 1.3rem; font-weight: 800; letter-spacing: -0.04em; text-transform: uppercase; font-stretch: 112%; }
.brand-b { font-family: var(--mono); font-size: var(--label); font-weight: 500; letter-spacing: 0.2em; text-transform: uppercase; color: var(--rose); }

.bar-tool { margin-left: auto; color: var(--muted); }
.bar-live {
  font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--muted); white-space: nowrap;
}
.bar-live b { color: var(--action); font-size: 0.95rem; letter-spacing: 0.02em; }

.reset {
  background: none; border: 1px solid var(--line-2); color: var(--muted);
  font-family: var(--mono); font-size: var(--label); letter-spacing: 0.14em;
  text-transform: uppercase; padding: 0.55rem 0.7rem;
}
.reset:hover { color: var(--ink); border-color: var(--line-control); }

.social { display: flex; gap: 0.25rem; }
.social a { width: 30px; height: 30px; display: grid; place-items: center; color: var(--muted); text-decoration: none; }
.social a:hover { color: var(--action); }
.social svg { width: 17px; height: 17px; }

/* ---------- intro ---------- */

.intro { padding: clamp(2.2rem, 5vw, 4.2rem) 0 clamp(1.8rem, 4vw, 3.2rem); }
.intro-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: end;
}
.intro h1 {
  font-size: clamp(2.3rem, 5.4vw, 4.6rem);
  font-weight: 800;
  max-width: 15ch;
  font-stretch: 110%;
  text-wrap: balance;
}
.lede-answer { max-width: 58ch; margin: 0 0 0.9rem; font-size: 1.06em; line-height: 1.6; }
.intro-sub {
  margin: 0.7rem 0 1rem;
  max-width: 34ch;
  font-size: clamp(1.05rem, 1.7vw, 1.3rem);
  font-weight: 500;
  font-stretch: 100%;
  letter-spacing: -0.01em;
  line-height: 1.25;
  text-wrap: balance;
  color: var(--rose);
}
.intro-sub + .lede-answer { margin-top: 0; }
.last-checked {
  margin-top: 1rem; color: var(--muted);
  font-family: var(--mono); font-size: var(--label); letter-spacing: 0.08em;
  text-transform: uppercase;
}
.intro-copy > p:not(.last-checked) { margin-top: 1.2rem; max-width: 56ch; color: var(--muted); }

.intro-specs {
  display: flex; flex-wrap: wrap; list-style: none; margin: 1.8rem 0 0; padding: 0;
  border-top: 1px solid var(--line-2);
}
.intro-specs li {
  display: flex; flex-direction: column; gap: 0.2rem;
  padding: 0.8rem 1.4rem 0.8rem 0; margin-right: 1.4rem;
  border-right: 1px solid var(--line-2);
}
.intro-specs li:last-child { border-right: 0; }
.intro-specs .mono { color: var(--muted); font-size: var(--label); }
.intro-specs b { font-size: 1.1rem; font-weight: 600; letter-spacing: -0.02em; }

/* delivery ticket — the one paper object on the bench */
.ticket {
  margin: 0;
  background: #f4ead6;
  color: var(--ink);
  border: 1px solid #c2ad8a;
  box-shadow: 10px 10px 0 rgba(43, 33, 25, 0.16);
}
.ticket-head {
  display: flex; justify-content: space-between; gap: 1rem;
  padding: 0.7rem 1rem; border-bottom: 1px dashed #c2ad8a;
  color: var(--muted); font-size: var(--label);
}
.ticket-for { padding: 0.9rem 1rem 0; font-size: 0.85rem; color: var(--muted); }
.ticket-for b { color: var(--ink); font-weight: 600; }
.ticket-pour { padding: 0.1rem 1rem 0.9rem; font-size: 1.15rem; font-weight: 700; letter-spacing: -0.02em; }
.ticket-grid { display: grid; grid-template-columns: 1fr 1fr; margin: 0; border-top: 1px dashed #c2ad8a; }
.ticket-grid > div { padding: 0.75rem 1rem; border-bottom: 1px dashed #c2ad8a; }
.ticket-grid > div:nth-child(odd) { border-right: 1px dashed #c2ad8a; }
.ticket-grid dt { color: var(--muted); font-size: var(--label); margin-bottom: 0.2rem; }
.ticket-grid dd { margin: 0; font-size: 1rem; font-weight: 600; letter-spacing: -0.01em; }
.ticket-link { color: inherit; text-decoration: underline; text-decoration-color: #c2ad8a; text-underline-offset: 3px; }
.ticket-link:hover { text-decoration-color: var(--ink); }
.ticket-link[aria-disabled="true"] { color: var(--muted); text-decoration: none; cursor: default; }
.ticket-foot {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: 0.8rem 1rem; color: var(--muted);
}
.ticket-foot b { font-family: var(--mono); font-size: 0.82rem; letter-spacing: 0.04em; text-transform: uppercase; }
.ticket-foot b.match { color: var(--match); }
.ticket-foot b.caution { color: var(--warn); }
.ticket-foot b.no { color: var(--action); }

/* ---------- before you send ---------- */

.note {
  display: grid; grid-template-columns: auto 1fr; gap: 1rem 1.4rem;
  align-items: start;
  margin-bottom: clamp(1.4rem, 3vw, 2.4rem);
  padding: 0.9rem 1rem;
  border-left: 3px solid var(--rose);
  background: rgba(107, 43, 48, 0.07);
}
.note-tag { color: var(--rose); padding-top: 0.1rem; }
.note ul { list-style: none; display: grid; gap: 0.25rem; }
.note li { font-size: 0.92rem; }
.note li::before { content: "— "; color: var(--rose); }

/* ---------- section grammar ---------- */

.sec-head {
  display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(1.2rem, 4vw, 4rem);
  align-items: start;
  padding-top: clamp(2rem, 4vw, 3.2rem);
  margin-bottom: clamp(1.2rem, 2.5vw, 2rem);
  border-top: 1px solid var(--line-2);
}
.sec-head h2 { font-size: clamp(1.7rem, 3vw, 2.5rem); font-stretch: 108%; }
.sec-head p { color: var(--muted); max-width: 62ch; }
.sec-num {
  display: inline-block; margin-right: 0.7rem; color: var(--action);
  font-family: var(--mono); font-size: var(--label); font-weight: 500;
  letter-spacing: 0.12em; vertical-align: 0.35em;
}

/* ---------- presets ---------- */

.presets { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.2rem; }
.preset {
  display: flex; flex-direction: column; gap: 0.1rem; text-align: left;
  padding: 0.5rem 0.75rem; min-width: 138px;
  border: 1px solid var(--line-2); background: transparent; color: var(--ink);
}
.preset b { font-size: 0.9rem; font-weight: 600; }
.preset span { font-family: var(--mono); font-size: var(--label); letter-spacing: 0.06em; color: var(--muted); }
.preset:hover { border-color: var(--line-control); }
.preset[aria-pressed="true"] { border-color: var(--rose); background: rgba(107, 43, 48, 0.08); }
.preset[aria-pressed="true"] span { color: var(--ink); }

/* ---------- bench ---------- */

.bench { padding-bottom: clamp(1rem, 2vw, 2rem); }
.bench-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.28fr) minmax(310px, 0.72fr);
  gap: clamp(1.2rem, 2.6vw, 2rem);
  align-items: start;
}

.stage {
  border: 1px solid var(--line-2);
  background: linear-gradient(170deg, var(--panel-2), var(--ground-2) 78%);
  padding: 0.9rem;
}
.stage-head {
  display: flex; justify-content: space-between; gap: 1rem;
  padding: 0 0.2rem 0.7rem; border-bottom: 1px solid var(--line-2);
  color: var(--muted);
}
.stage-head .mono:first-child { color: var(--rose); }

/* the crate itself */
.crate {
  position: relative; margin: 0.9rem 0 0;
  padding: 0.55rem;
  background:
    repeating-linear-gradient(90deg, var(--crate) 0 46px, var(--crate-2) 46px 48px),
    var(--crate);
  border: 1px solid #7c5730;
  box-shadow: inset 0 0 0 3px rgba(255, 244, 220, 0.18), 6px 6px 0 rgba(43, 33, 25, 0.15);
}
.crate-lid {
  display: flex; justify-content: space-between; gap: 0.6rem;
  margin: -0.1rem -0.1rem 0.5rem;
  padding: 0.28rem 0.45rem;
  background: var(--straw);
  border: 1px solid rgba(124, 87, 48, 0.55);
  color: #5a4326;
  font-family: var(--mono); font-size: 0.58rem; letter-spacing: 0.18em; text-transform: uppercase;
}
.bays {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.4rem;
  list-style: none; padding: 0;
}
.bay {
  position: relative; min-height: 92px;
  display: flex; flex-direction: column; justify-content: space-between; gap: 0.3rem;
  padding: 0.45rem 0.5rem;
  background: #f7eedb;
  border: 1px solid rgba(124, 87, 48, 0.45);
  box-shadow: inset 0 -4px 0 rgba(124, 87, 48, 0.1);
}
.bay.is-empty {
  background: rgba(232, 217, 180, 0.42);
  border-style: dashed; border-color: rgba(90, 67, 38, 0.55);
  justify-content: center; align-items: center; text-align: center;
}
.bay-no { font-family: var(--mono); font-size: 0.56rem; letter-spacing: 0.14em; color: #7a5c38; }
.bay-name { font-size: 0.86rem; font-weight: 600; line-height: 1.25; letter-spacing: -0.01em; }
.bay.is-pour .bay-name { font-size: 1rem; }
.bay-cat {
  margin-top: auto;
  font-family: var(--mono); font-size: 0.54rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: #7a5c38;
}
.bay.is-empty .bay-cat { color: #7a5c38; }
.bay.is-pour { background: #f2e2c8; border-color: var(--rose); box-shadow: inset 0 0 0 1px var(--rose); }
.bay.is-pour .bay-no { color: var(--rose); }

.crate-stamp {
  position: absolute; right: -0.55rem; bottom: -0.55rem;
  display: grid; place-items: center; gap: 0.05rem;
  width: 96px; height: 96px;
  transform: rotate(-11deg);
  border: 3px double var(--action);
  border-radius: 50%;
  color: var(--action);
  text-align: center;
  opacity: 0.72;
  pointer-events: none;
  animation: stamp-in 0.28s ease-out;
}
.crate-stamp span { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.2em; font-weight: 600; }
.crate-stamp em { font-style: normal; font-family: var(--mono); font-size: 0.6rem; letter-spacing: 0.12em; }
@keyframes stamp-in { from { transform: rotate(-11deg) scale(1.5); opacity: 0; } }

.readouts {
  display: grid; grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2);
}
.readout {
  display: grid; grid-template-columns: auto 1fr; align-items: baseline; gap: 0 0.4rem;
  padding: 0.7rem 0.8rem; border-right: 1px solid var(--line-2);
}
.readout:last-child { border-right: 0; }
.readout .mono { grid-column: 1 / -1; color: var(--muted); font-size: var(--label); }
.readout b { font-size: 1.35rem; font-weight: 600; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.readout .unit { color: var(--muted); font-size: var(--label); }
.readout b.no { color: var(--action); }
.readout b.caution { color: var(--warn); }
.readout b.holds { color: var(--match); }

.hint { color: var(--muted); font-size: 0.82rem; line-height: 1.5; }

.stage-read {
  margin-top: 0.55rem; padding: 0.8rem 0.9rem;
  border-left: 2px solid var(--line-control); background: rgba(43, 33, 25, 0.06);
  font-size: 0.95rem;
}
.stage-read.holds { border-left-color: var(--match); }
.stage-read.no { border-left-color: var(--action); }

.stage .saved-mount { margin-top: 1rem; }

/* ---------- controls ---------- */

.controls { display: grid; gap: 1rem; }
.control-group { border: 1px solid var(--line-2); background: var(--panel); }
.control-head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
  padding: 0.75rem 0.9rem; border-bottom: 1px solid var(--line-2);
}
.control-head h3 { font-size: 1rem; font-weight: 600; }
.control-head .mono { color: var(--muted); font-size: var(--label); }

.field { padding: 0.8rem 0.9rem; border-bottom: 1px solid var(--line-2); }
.field:last-child { border-bottom: 0; }
.field-head { display: flex; justify-content: space-between; align-items: baseline; gap: 0.8rem; margin-bottom: 0.45rem; }
.field-head label, .field-head .mono:first-child { font-family: var(--mono); font-size: var(--label); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink); }
.field-head output, .field-head .mono:last-child { font-family: var(--mono); font-size: var(--label); letter-spacing: 0.06em; color: var(--rose); }
.field.two-up { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; }
.field.two-up > div { min-width: 0; }

.chips { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.chips button {
  min-height: 40px; padding: 0.35rem 0.55rem;
  border: 1px solid var(--line-2); background: transparent; color: var(--muted);
  font-family: var(--mono); font-size: var(--label); letter-spacing: 0.06em; text-transform: uppercase;
}
.chips button:hover { color: var(--ink); border-color: var(--line-control); }
.chips button[aria-pressed="true"] { background: var(--action); border-color: var(--action); color: #fdf6e9; }
#pour button[aria-pressed="true"] { background: var(--rose); border-color: var(--rose); }
#occasion button[aria-pressed="true"] { background: var(--rose); border-color: var(--rose); }

.bench-picks { display: grid; grid-template-columns: 1fr 1fr; gap: 0.35rem; padding: 0.8rem 0.9rem; }
.pick {
  display: flex; align-items: flex-start; gap: 0.45rem;
  min-height: 48px; padding: 0.45rem 0.5rem; text-align: left;
  border: 1px solid var(--line-2); background: transparent; color: var(--ink);
  font-size: 0.8rem; line-height: 1.25;
}
.pick:hover { border-color: var(--line-control); }
.pick:disabled { opacity: 0.4; cursor: not-allowed; }
.pick-mark {
  flex: none; width: 14px; height: 14px; margin-top: 0.1rem;
  border: 1px solid var(--line-control); background: #f7eedb;
}
.pick[aria-pressed="true"] { border-color: var(--rose); background: rgba(107, 43, 48, 0.08); }
.pick[aria-pressed="true"] .pick-mark { background: var(--rose); border-color: var(--rose); box-shadow: inset 0 0 0 2px #f7eedb; }
.pick .pick-group {
  display: block;
  font-family: var(--mono); font-size: 0.54rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--muted); margin-top: 0.15rem;
}

select {
  width: 100%; min-height: 44px; padding: 0.35rem 0.5rem;
  border: 1px solid var(--line-2); border-radius: 0;
  background: var(--panel-2); color: var(--ink);
  font-family: var(--mono); font-size: var(--label); letter-spacing: 0.04em;
}

input[type="range"] { width: 100%; accent-color: var(--action); min-height: 28px; }
input[type="range"]:focus-visible { outline-offset: 6px; }

.bench-help { padding: 0.9rem; border: 1px dashed var(--line-2); }
.bench-help p { color: var(--muted); font-size: 0.86rem; margin-top: 0.35rem; }
.bench-help .mono { color: var(--rose); }
.bench-help a { color: var(--ink); text-underline-offset: 3px; }
.bench-help a:hover { color: var(--action); }

/* ---------- results ---------- */

.results { padding-bottom: clamp(1rem, 2vw, 2rem); }
.result-head {
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  padding: 0.6rem 0; border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2);
  color: var(--muted);
}
.result-head .mono:first-child { color: var(--ink); }

.rows { list-style: none; }
.row {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) 92px 176px;
  gap: 1rem; align-items: start;
  padding: 1rem 0.2rem 1rem 0;
  border-bottom: 1px solid var(--line-2);
  position: relative;
}
.row:hover { background: rgba(255, 250, 235, 0.28); }
.row-rank { color: var(--muted); font-size: 0.7rem; padding-top: 0.15rem; }
.row-main { min-width: 0; }
.row-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.6rem; }
.row-title h3 { font-size: 1.18rem; font-weight: 600; letter-spacing: -0.02em; }
.row-price { color: var(--muted); font-size: var(--label); }
.row-reason { margin-top: 0.3rem; font-size: 0.92rem; }
.row-trade { margin-top: 0.35rem; color: var(--muted); font-size: 0.84rem; }
.row-trade b { color: var(--ink); font-weight: 500; }
.row-metrics {
  display: flex; flex-wrap: wrap; gap: 0.2rem 0.55rem; margin-top: 0.5rem;
  font-family: var(--mono); font-size: var(--label); letter-spacing: 0.04em; color: var(--muted);
}
.row-metrics span:not(:last-child)::after { content: "·"; margin-left: 0.55rem; color: var(--line-control); }
.tags { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.5rem; }
.tag {
  padding: 0.15rem 0.4rem; border: 1px solid var(--line-2);
  font-family: var(--mono); font-size: var(--label); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted);
}
.tag.match { color: var(--match); border-color: rgba(74, 92, 51, 0.5); }
.tag.warn { color: var(--warn); border-color: rgba(138, 90, 18, 0.5); }
.tag.fail { color: var(--action); border-color: rgba(163, 52, 31, 0.5); }

.score {
  justify-self: start; text-align: left;
  font-family: var(--mono); font-size: var(--label); letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted);
}
.score b { display: block; color: var(--ink); font-size: 1.5rem; font-weight: 600; letter-spacing: -0.03em; }

.row-actions { display: grid; gap: 0.45rem; justify-items: end; text-align: right; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.55rem;
  min-height: 40px; padding: 0.55rem 0.8rem;
  border: 1px solid var(--action); background: var(--action); color: #fdf6e9;
  font-family: var(--mono); font-size: var(--label); font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase; text-decoration: none;
  touch-action: manipulation;
}
.btn:hover { background: var(--action-2); border-color: var(--action-2); }
.row-actions .btn { min-height: 36px; padding: 0.4rem 0.6rem; }

.gate-block { margin-top: 1.4rem; }
.gate-block h3 { font-size: 1rem; margin-bottom: 0.5rem; }
.gate-block.late { border-left: 3px solid var(--warn); background: var(--warn-dim); padding: 0.9rem 1rem; }
.gate-block.blocked { border-left: 3px solid var(--action); background: var(--action-dim); padding: 0.9rem 1rem; }
.gate-block p { color: var(--muted); font-size: 0.88rem; }
.gate-fold { margin-top: 0.5rem; }
.gate-fold summary {
  display: inline-block; padding: 0.15rem 0; cursor: pointer; color: var(--ink);
  font-size: var(--label); letter-spacing: 0.1em; text-transform: uppercase;
}
.gate-fold summary:hover { color: var(--action); }
.gate-fold[open] summary { margin-bottom: 0.3rem; }
.gate-list { list-style: none; display: grid; gap: 0.3rem; margin-top: 0.5rem; }
.gate-list li { font-size: 0.86rem; display: flex; flex-wrap: wrap; gap: 0.2rem 0.6rem; }
.gate-list .mono { color: var(--muted); }
.gate-list a { color: var(--ink); text-underline-offset: 3px; }

/* ---------- table ---------- */

.catalogue { padding-bottom: clamp(1rem, 2vw, 2rem); }
.table-hint { color: var(--muted); margin-bottom: 0.5rem; }
.table-wrap { overflow-x: auto; border-top: 1px solid var(--line-control); border-bottom: 1px solid var(--line-control); }
table { width: 100%; border-collapse: collapse; min-width: 940px; }
caption { text-align: left; }
th {
  text-align: left; padding: 0.6rem 0.8rem 0.6rem 0;
  font-family: var(--mono); font-size: var(--label); font-weight: 500;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted);
  border-bottom: 1px solid var(--line-control); white-space: nowrap;
}
td {
  padding: 0.7rem 0.8rem 0.7rem 0; border-bottom: 1px solid var(--line-2);
  font-size: 0.88rem; vertical-align: top;
}
tbody tr:last-child td { border-bottom: 0; }
td.name b { display: block; font-size: 0.95rem; font-weight: 600; }
td.num { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.02em; white-space: nowrap; }
td.desc { color: var(--muted); font-size: 0.8rem; }
td a { color: var(--ink); text-decoration-color: var(--line-control); text-underline-offset: 3px; }
td a:hover { color: var(--action); }
.chart-note { margin-top: 0.7rem; color: var(--muted); font-size: 0.8rem; max-width: 90ch; }

/* ---------- method ---------- */

.method { padding-bottom: clamp(2rem, 4vw, 3.5rem); }
.method details { border-top: 1px solid var(--line-control); border-bottom: 1px solid var(--line-control); }
.method summary {
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  padding: 1rem 0; cursor: pointer; list-style: none;
}
.method summary::-webkit-details-marker { display: none; }
.method summary .mono:first-child { color: var(--ink); }
.method summary .mono:last-child { color: var(--muted); }
.method-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.2rem, 3vw, 2.6rem); padding: 0.5rem 0 1.6rem;
}
.method h3 { font-size: 1.05rem; margin-bottom: 0.6rem; }
.method p { color: var(--muted); font-size: 0.9rem; margin-bottom: 0.7rem; }
.method p b { color: var(--ink); font-weight: 500; }
.limits { list-style: none; display: grid; gap: 0.55rem; }
.limits li { color: var(--muted); font-size: 0.86rem; padding-left: 0.9rem; position: relative; }
.limits li::before { content: "—"; position: absolute; left: 0; color: var(--action); }
.limits b { color: var(--ink); font-weight: 500; }
.sources { list-style: none; display: grid; gap: 0.35rem; }
.sources a { font-size: 0.82rem; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.sources a:hover { color: var(--action); }
.fine { font-size: 0.78rem !important; }

/* ---------- footer ---------- */

.foot { border-top: 1px solid var(--line-control); padding: clamp(1.6rem, 3vw, 2.4rem) 0 2rem; }
.related-tools { display: grid; gap: 0.5rem; padding-bottom: 1.2rem; border-bottom: 1px solid var(--line-2); }
.related-title { font-family: var(--mono); font-size: var(--label); letter-spacing: 0.14em; text-transform: uppercase; color: var(--rose); }
.related-tools ul { list-style: none; display: flex; flex-wrap: wrap; gap: 0.4rem 1.4rem; }
.related-tools a { color: var(--muted); text-decoration: none; font-size: 0.9rem; }
.related-tools a:hover { color: var(--ink); }
.affiliate-disclosure { max-width: 92ch; padding: 1.2rem 0; color: var(--muted); font-size: 0.8rem; line-height: 1.6; }
.affiliate-disclosure strong { color: var(--ink); }
.foot-in {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.4rem 1.2rem;
  padding-top: 1rem; border-top: 1px solid var(--line-2); color: var(--muted);
}
.foot-mark { font-weight: 700; color: var(--ink); letter-spacing: -0.02em; margin-right: auto; }
.foot-in .mono { font-size: var(--label); }
.foot-in a { color: var(--muted); text-decoration: none; }
.foot-in a:hover { color: var(--ink); }

/* ---------- responsive ---------- */

@media (max-width: 1080px) {
  .bench-grid { grid-template-columns: 1fr; }
  .controls { grid-template-columns: 1fr 1fr; }
  .bench-help { grid-column: 1 / -1; }
  .row { grid-template-columns: 40px minmax(0, 1fr) 92px; }
  .row-actions { grid-column: 2 / -1; grid-auto-flow: column; justify-content: start; justify-items: start; }
}

@media (max-width: 900px) {
  .intro-grid { grid-template-columns: 1fr; align-items: start; }
  .ticket { max-width: 460px; }
  .sec-head { grid-template-columns: 1fr; gap: 0.7rem; }
  .method-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .bar-in { flex-wrap: wrap; gap: 0.5rem 0.9rem; padding: 0.5rem 0; }
  .bar-tool { display: none; }
  .bar-live { order: 5; margin-left: 0; }
  .reset { order: 6; margin-left: auto; }
  .readouts { grid-template-columns: 1fr 1fr; }
  .readout:nth-child(2) { border-right: 0; }
  .readout:nth-child(1), .readout:nth-child(2) { border-bottom: 1px solid var(--line-2); }
  .controls { grid-template-columns: 1fr; }
  .row { grid-template-columns: 32px minmax(0, 1fr); gap: 0.6rem; }
  .score { grid-column: 2; }
  .row-actions { grid-column: 2; }
  .note { grid-template-columns: 1fr; }
  .bays { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 560px) {
  :root { --label: 0.75rem; }
}

@media (max-width: 480px) {
  .intro h1 { font-size: 2.2rem; }
  .intro-specs li { padding-right: 0.9rem; margin-right: 0.9rem; }
  .field.two-up { grid-template-columns: 1fr; }
  .presets { display: grid; grid-template-columns: 1fr 1fr; }
  .preset { min-width: 0; }
  .stage { padding: 0.55rem; }
  .row-title h3 { font-size: 1.05rem; }
  .bench-picks { grid-template-columns: 1fr; }
  .crate-stamp { width: 78px; height: 78px; right: 0.7rem; bottom: 0.7rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .crate-stamp { animation: none; }
}
