/* ==========================================================================
   Pack Bench

   The page is a cutting table: a self-healing mat ruled in centimetres, with
   the pack drawn on it and the paperwork laid out underneath. Green-grey
   throughout, one safety-orange accent, and every number set in mono so the
   columns line up the way a spec sheet's should.
   ========================================================================== */

:root {
  /* --- the mat and the paper ---------------------------------------- */
  --mat:        #e4e8e0;
  --mat-line:   #d3d9cd;
  --mat-line-5: #c3cbba;
  --sheet:      #f8faf5;
  --sheet-2:    #eef1e9;

  --ink:        #171d1a;
  --ink-2:      #4c5650;
  --ink-3:      #7d867e;
  --rule:       #cdd4c6;
  --rule-2:     #b6bfad;

  /* --- the one loud colour, and the annotation colour ---------------- */
  --blaze:      #d9451a;
  --blaze-soft: #fbe6de;
  --blueprint:  #1d7d92;
  --blueprint-soft: #dbeef2;

  /* six accents, used to colour-code the panel, the tiles and the tables */
  --a1: #d9451a;   /* blaze   */
  --a2: #1189a0;   /* lagoon  */
  --a3: #2f56c4;   /* ultra   */
  --a4: #59942b;   /* moss    */
  --a5: #c9880c;   /* signal  */
  --a6: #b52d76;   /* magenta */

  --shadow:    0 1px 1px rgba(23,29,26,.05), 0 10px 22px -14px rgba(23,29,26,.35);
  --shadow-lg: 0 2px 3px rgba(23,29,26,.07), 0 26px 50px -26px rgba(23,29,26,.45);

  --display: Archivo, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --body:    "IBM Plex Sans", ui-sans-serif, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono:    "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --wrap: 1280px;
  --r: 3px;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --mat:        #151a18;
    --mat-line:   #1e2522;
    --mat-line-5: #263029;
    --sheet:      #1d2422;
    --sheet-2:    #232b28;

    --ink:        #e8ede7;
    --ink-2:      #b3bcb3;
    --ink-3:      #838d84;
    --rule:       #313a35;
    --rule-2:     #414c45;

    --blaze:      #ff6b3d;
    --blaze-soft: #3a1e14;
    --blueprint:  #5cc2d8;
    --blueprint-soft: #14282d;

    --a1: #ff6b3d;
    --a2: #3ec4dc;
    --a3: #7b95ff;
    --a4: #93d155;
    --a5: #f2c03f;
    --a6: #ef73b3;

    --shadow:    0 1px 1px rgba(0,0,0,.4), 0 10px 22px -14px rgba(0,0,0,.8);
    --shadow-lg: 0 2px 3px rgba(0,0,0,.45), 0 26px 50px -26px rgba(0,0,0,.9);

    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --mat:        #151a18;
  --mat-line:   #1e2522;
  --mat-line-5: #263029;
  --sheet:      #1d2422;
  --sheet-2:    #232b28;

  --ink:        #e8ede7;
  --ink-2:      #b3bcb3;
  --ink-3:      #838d84;
  --rule:       #313a35;
  --rule-2:     #414c45;

  --blaze:      #ff6b3d;
  --blaze-soft: #3a1e14;
  --blueprint:  #5cc2d8;
  --blueprint-soft: #14282d;

  --a1: #ff6b3d;
  --a2: #3ec4dc;
  --a3: #7b95ff;
  --a4: #93d155;
  --a5: #f2c03f;
  --a6: #ef73b3;

  --shadow:    0 1px 1px rgba(0,0,0,.4), 0 10px 22px -14px rgba(0,0,0,.8);
  --shadow-lg: 0 2px 3px rgba(0,0,0,.45), 0 26px 50px -26px rgba(0,0,0,.9);

  color-scheme: dark;
}

/* ==========================================================================
   Base
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-padding-top: 88px; }

body {
  margin: 0;
  font-family: var(--body);
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--ink);
  background-color: var(--mat);
  /* the cutting mat: a centimetre grid, every fifth line darker */
  background-image:
    linear-gradient(var(--mat-line-5) 1px, transparent 1px),
    linear-gradient(90deg, var(--mat-line-5) 1px, transparent 1px),
    linear-gradient(var(--mat-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--mat-line) 1px, transparent 1px),
    radial-gradient(900px 520px at 8% -6%, color-mix(in srgb, var(--a2) 15%, transparent), transparent 70%),
    radial-gradient(760px 480px at 96% 4%, color-mix(in srgb, var(--a5) 14%, transparent), transparent 68%);
  background-size: 110px 110px, 110px 110px, 22px 22px, 22px 22px, 100% 100%, 100% 100%;
  background-position: -1px -1px;
  -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; }

h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: -.021em;
  line-height: 1.1;
  text-wrap: balance;
  margin: 0 0 .5em;
}
h1 { font-size: clamp(2.1rem, 4.6vw, 3.2rem); font-weight: 800; }
h2 { font-size: clamp(1.45rem, 2.6vw, 1.95rem); }
h3 { font-size: 1.12rem; }
h4 { font-size: .95rem; }
p { margin: 0 0 1.05em; }

a { color: var(--blaze); text-underline-offset: 3px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 clamp(16px, 3vw, 34px); }

/* the small stencilled labels that run through the whole page */
.tag {
  font-family: var(--mono);
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .17em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.tag-blaze { color: var(--blaze); }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* ==========================================================================
   Header
   ========================================================================== */

.rig {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--mat) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--rule);
}
.rig-in {
  max-width: var(--wrap); margin: 0 auto;
  padding: 10px clamp(16px, 3vw, 34px);
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
}
.mark { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.mark svg { width: 26px; height: 26px; flex: none; }
.mark b {
  font-family: var(--display); font-weight: 800; font-size: 1.15rem;
  letter-spacing: -.03em;
}
.mark span { font-family: var(--mono); font-size: .64rem; letter-spacing: .18em;
             text-transform: uppercase; color: var(--ink-3); }

/* Cross-site switcher. The rich cards at the foot of the page are fine for
   someone who reads to the end, but this page is 8,000 pixels tall — the
   links have to live somewhere permanently reachable too. */
.sites { display: flex; gap: 3px; flex-wrap: wrap; }
.sites a {
  font-size: .84rem; font-weight: 500; text-decoration: none; white-space: nowrap;
  padding: 5px 10px; border-radius: var(--r);
  color: var(--ink-2); border: 1px solid transparent;
}
.sites a:nth-child(1) { --s: var(--a6); }
.sites a:nth-child(2) { --s: var(--a3); }
.sites a:nth-child(3) { --s: var(--a5); }
.sites a:hover { color: var(--s); border-color: var(--s); }
.sites a:focus-visible { outline: 2px solid var(--s); outline-offset: 1px; }

@media (max-width: 720px) {
  .sites { order: 3; width: 100%; }
  .namer { margin-left: 0; }
}

.namer { margin-left: auto; display: flex; align-items: center; gap: 9px; }
.namer label { font-family: var(--mono); font-size: .68rem; letter-spacing: .14em;
               text-transform: uppercase; color: var(--ink-3); }
.namer input {
  font: inherit; font-family: var(--display); font-weight: 600; font-size: .95rem;
  width: 15ch; padding: 6px 10px; color: var(--ink);
  background: var(--sheet); border: 1px solid var(--rule-2); border-radius: var(--r);
}
.namer input:focus-visible { outline: 2px solid var(--blaze); outline-offset: 1px; }

/* ==========================================================================
   Masthead
   ========================================================================== */

.top { padding: clamp(30px, 5vw, 56px) 0 clamp(20px, 3vw, 30px); }
.top-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 40px; align-items: end; }
.top h1 { margin: 10px 0 14px; }
.top h1 em { font-style: normal; color: var(--blaze); }
.top p { color: var(--ink-2); max-width: 58ch; margin: 0; font-size: 1.04rem; }

.legend-strip {
  border: 1px solid var(--rule); background: var(--sheet); border-radius: var(--r);
  padding: 14px 16px;
}
.legend-strip dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; }
.legend-strip dt { font-family: var(--mono); font-size: .68rem; letter-spacing: .12em;
                   text-transform: uppercase; color: var(--ink-3); }
.legend-strip dd { margin: 0; font-size: .84rem; color: var(--ink-2); }

@media (max-width: 900px) { .top-grid { grid-template-columns: 1fr; gap: 22px; } }

/* ==========================================================================
   The bench — drawing and controls
   ========================================================================== */

.bench {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 356px;
  gap: 26px;
  align-items: start;
  padding-bottom: clamp(30px, 5vw, 56px);
}
@media (max-width: 1080px) { .bench { grid-template-columns: 1fr; } }

.stage { display: grid; gap: 16px; position: sticky; top: 78px; }
@media (max-width: 1080px) { .stage { position: static; } }

.plate {
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: var(--r);
  box-shadow: var(--shadow-lg);
  padding: 12px;
  position: relative;
}
/* corner ticks, like registration marks on a pattern */
.plate::before, .plate::after {
  content: ""; position: absolute; width: 13px; height: 13px; pointer-events: none;
  border-color: var(--rule-2); border-style: solid; border-width: 0;
}
.plate::before { top: 6px; left: 6px; border-top-width: 2px; border-left-width: 2px; }
.plate::after { bottom: 6px; right: 6px; border-bottom-width: 2px; border-right-width: 2px; }

.plate svg { display: block; width: 100%; height: auto; }
.plate-cap {
  margin: 4px 6px 2px; font-size: .82rem; color: var(--ink-3);
  display: flex; gap: 6px 16px; flex-wrap: wrap; justify-content: center;
}
.plate-cap b { color: var(--ink-2); font-family: var(--mono); font-weight: 600; }

/* ---------- KPI row --------------------------------------------------- */

.kpi { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.kpi-tile {
  background: var(--sheet); border: 1px solid var(--rule);
  border-top: 3px solid var(--ink-3);
  border-radius: var(--r); padding: 11px 13px;
}
.kpi-tile:nth-child(1) { border-top-color: var(--a1); }
.kpi-tile:nth-child(2) { border-top-color: var(--a2); }
.kpi-tile:nth-child(3) { border-top-color: var(--a4); }
.kpi-tile:nth-child(4) { border-top-color: var(--a3); }
.kpi-tile:nth-child(1) small { color: var(--a1); }
.kpi-tile:nth-child(2) small { color: var(--a2); }
.kpi-tile:nth-child(3) small { color: var(--a4); }
.kpi-tile:nth-child(4) small { color: var(--a3); }
.kpi-tile b {
  display: block; font-family: var(--display); font-weight: 800;
  font-size: 1.66rem; line-height: 1.02; letter-spacing: -.03em;
  font-variant-numeric: tabular-nums; color: var(--ink);
}
.kpi-tile b i { font-style: normal; font-family: var(--mono); font-size: .82rem;
                font-weight: 500; color: var(--ink-3); letter-spacing: 0; }
.kpi-tile small {
  display: block; margin-top: 4px;
  font-family: var(--mono); font-size: .64rem; font-weight: 600;
  letter-spacing: .13em; text-transform: uppercase; color: var(--ink-3);
}
@media (max-width: 640px) { .kpi { grid-template-columns: repeat(2, 1fr); } }

/* ---------- toolbar ---------------------------------------------------- */

.tools { display: flex; flex-wrap: wrap; gap: 8px; }
.btn {
  font: inherit; font-size: .85rem; font-weight: 500;
  font-family: var(--body);
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 14px; cursor: pointer;
  background: var(--sheet); color: var(--ink);
  border: 1px solid var(--rule-2); border-radius: var(--r);
}
.btn:hover { border-color: var(--blaze); color: var(--blaze); }
.btn:focus-visible { outline: 2px solid var(--blaze); outline-offset: 2px; }
.btn svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.btn.done { border-color: var(--blaze); color: var(--blaze); background: var(--blaze-soft); }

/* ==========================================================================
   Control panel
   ========================================================================== */

.panel {
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.panel > header {
  padding: 12px 16px; border-bottom: 1px solid var(--rule); background: var(--sheet-2);
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
}
.panel > header h2 { margin: 0; font-size: .95rem; letter-spacing: -.01em; }

.grp { border: 0; margin: 0; padding: 16px; border-bottom: 1px solid var(--rule); display: grid; gap: 13px; }
.grp:last-child { border-bottom: 0; }
.grp > legend {
  padding: 0; font-family: var(--mono); font-size: .66rem; font-weight: 600;
  letter-spacing: .17em; text-transform: uppercase; color: var(--g, var(--blaze));
}
.grp:nth-of-type(1) { --g: var(--a1); }
.grp:nth-of-type(2) { --g: var(--a2); }
.grp:nth-of-type(3) { --g: var(--a3); }
.grp:nth-of-type(4) { --g: var(--a4); }
.grp:nth-of-type(5) { --g: var(--a5); }
.grp:nth-of-type(6) { --g: var(--a6); }
.grp:nth-of-type(7) { --g: var(--a2); }
/* the group's own colour drives its controls, so the panel reads as sections */
.grp input[type=range]::-webkit-slider-runnable-track {
  background: linear-gradient(90deg, var(--g) var(--fill, 50%), var(--rule) var(--fill, 50%));
}
.grp input[type=range]::-moz-range-track {
  background: linear-gradient(90deg, var(--g) var(--fill, 50%), var(--rule) var(--fill, 50%));
}
.grp input[type=range]::-webkit-slider-thumb { border-color: var(--g); }
.grp input[type=range]::-moz-range-thumb { border-color: var(--g); }
.grp .slide .val { color: var(--g); }
.grp .pills label:hover { border-color: var(--g); color: var(--g); }
.grp .pills label:has(input:checked), .grp .pills label.on {
  background: var(--g); border-color: var(--g);
}
.grp .checks label:has(input:checked), .grp .checks label.on { border-color: var(--g); }
.grp .checks label:has(input:checked)::before, .grp .checks label.on::before {
  background: var(--g); border-color: var(--g);
}
.grp .presets button:nth-child(1) { --g: var(--a1); border-color: var(--a1); color: var(--a1); }
.grp .presets button:nth-child(2) { --g: var(--a2); border-color: var(--a2); color: var(--a2); }
.grp .presets button:nth-child(3) { --g: var(--a4); border-color: var(--a4); color: var(--a4); }
.grp .presets button:nth-child(4) { --g: var(--a3); border-color: var(--a3); color: var(--a3); }
.grp .presets button:hover { background: var(--g); border-style: solid; color: #fff; }
.grp .hint { font-size: .79rem; color: var(--ink-3); margin: -3px 0 0; line-height: 1.5; }

/* ---------- sliders ---------------------------------------------------- */

.slide { display: grid; gap: 4px; }
.slide .top-line {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  font-size: .89rem; font-weight: 500;
}
.slide .val { font-family: var(--mono); font-size: .84rem; font-weight: 600; color: var(--blaze);
              font-variant-numeric: tabular-nums; }
.slide .sub { font-family: var(--mono); font-size: .72rem; color: var(--ink-3); }

.panel input[type=range] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 20px; margin: 0; background: transparent; cursor: ew-resize;
}
.panel input[type=range]::-webkit-slider-runnable-track {
  height: 4px; border-radius: 2px;
  background: linear-gradient(90deg, var(--blaze) var(--fill, 50%), var(--rule) var(--fill, 50%));
}
.panel input[type=range]::-moz-range-track {
  height: 4px; border-radius: 2px;
  background: linear-gradient(90deg, var(--blaze) var(--fill, 50%), var(--rule) var(--fill, 50%));
}
.panel input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 16px; height: 16px; margin-top: -6px; border-radius: 2px;
  background: var(--sheet); border: 2px solid var(--blaze); box-shadow: var(--shadow);
}
.panel input[type=range]::-moz-range-thumb {
  width: 16px; height: 16px; border-radius: 2px;
  background: var(--sheet); border: 2px solid var(--blaze); box-shadow: var(--shadow);
}
.panel input[type=range]:focus-visible { outline: 2px solid var(--blaze); outline-offset: 3px; }

/* ---------- pills, toggles, selects ------------------------------------ */

.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pills label {
  position: relative; cursor: pointer;
  font-size: .83rem; font-weight: 500; line-height: 1;
  padding: 8px 11px; border-radius: var(--r);
  border: 1px solid var(--rule-2); background: var(--sheet); color: var(--ink-2);
}
.pills input { position: absolute; opacity: 0; width: 0; height: 0; }
.pills label:hover { border-color: var(--blaze); color: var(--blaze); }
.pills label:has(input:checked), .pills label.on {
  background: var(--blaze); border-color: var(--blaze); color: #fff;
}
.pills label:has(input:focus-visible) { outline: 2px solid var(--blaze); outline-offset: 2px; }

.checks { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.checks label {
  position: relative; cursor: pointer; display: flex; align-items: center; gap: 8px;
  font-size: .83rem; padding: 7px 9px; border-radius: var(--r);
  border: 1px solid var(--rule-2); background: var(--sheet); color: var(--ink-2);
}
.checks input { position: absolute; opacity: 0; width: 0; height: 0; }
.checks label::before {
  content: ""; width: 13px; height: 13px; flex: none; border-radius: 1px;
  border: 1.5px solid var(--rule-2); background: var(--sheet);
}
.checks label:has(input:checked), .checks label.on { color: var(--ink); border-color: var(--blaze); }
.checks label:has(input:checked)::before, .checks label.on::before {
  background: var(--blaze); border-color: var(--blaze);
  box-shadow: inset 0 0 0 2px var(--sheet);
}
.checks label:has(input:focus-visible) { outline: 2px solid var(--blaze); outline-offset: 2px; }

.field { display: grid; gap: 5px; font-size: .84rem; font-weight: 500; }
.field select {
  font: inherit; font-family: var(--body); font-weight: 400; font-size: .87rem;
  padding: 8px 10px; border-radius: var(--r); color: var(--ink);
  border: 1px solid var(--rule-2); background: var(--sheet);
}
.field select:focus-visible { outline: 2px solid var(--blaze); outline-offset: 1px; }

/* ---------- colourway swatches ------------------------------------------ */

.cw { display: grid; grid-template-columns: 88px 1fr; gap: 10px; align-items: center; }
.cw > span { font-family: var(--mono); font-size: .7rem; letter-spacing: .1em;
             text-transform: uppercase; color: var(--ink-3); }
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chips label { position: relative; cursor: pointer; line-height: 0; }
.chips input { position: absolute; opacity: 0; width: 0; height: 0; }
.chips span {
  display: block; width: 22px; height: 22px; border-radius: 2px;
  background: var(--c); border: 1px solid rgba(0,0,0,.28);
}
.chips label:has(input:checked) span, .chips label.on span {
  box-shadow: 0 0 0 2px var(--sheet), 0 0 0 3.5px var(--ink);
}
.chips label:has(input:focus-visible) span { outline: 2px solid var(--blaze); outline-offset: 4px; }

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

.presets { display: flex; flex-wrap: wrap; gap: 6px; }
.presets button {
  font: inherit; font-family: var(--mono); font-size: .74rem; font-weight: 500;
  letter-spacing: .04em;
  padding: 7px 11px; cursor: pointer; border-radius: var(--r);
  border: 1px dashed var(--rule-2); background: transparent; color: var(--ink-2);
}
.presets button:hover { border-style: solid; border-color: var(--blaze); color: var(--blaze); }
.presets button:focus-visible { outline: 2px solid var(--blaze); outline-offset: 2px; }

/* ==========================================================================
   The spec sheet
   ========================================================================== */

.spec { background: var(--sheet); border-top: 1px solid var(--rule); }
.spec-in { padding: clamp(30px, 5vw, 56px) 0 clamp(36px, 6vw, 66px); }

.doc-head {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: end;
  padding-bottom: 18px; margin-bottom: 30px;
  border-bottom: 3px solid transparent;
  border-image: linear-gradient(90deg, var(--a1), var(--a5), var(--a4), var(--a2), var(--a3), var(--a6)) 1;
}
.doc-head h2 { margin: 6px 0 0; font-size: clamp(1.6rem, 3vw, 2.2rem); }
.doc-meta { display: flex; gap: 26px; flex-wrap: wrap; }
.doc-meta div { display: grid; gap: 2px; }
.doc-meta dt, .doc-meta .k {
  font-family: var(--mono); font-size: .63rem; letter-spacing: .14em;
  text-transform: uppercase; color: var(--ink-3);
}
.doc-meta .v { font-family: var(--mono); font-size: .95rem; font-weight: 600;
               font-variant-numeric: tabular-nums; }
@media (max-width: 760px) { .doc-head { grid-template-columns: 1fr; align-items: start; } }

.blocks { display: grid; gap: 34px; }
.two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 34px; align-items: start; }
@media (max-width: 900px) { .two { grid-template-columns: 1fr; } }

.block > h3 {
  display: flex; align-items: baseline; gap: 10px;
  padding-bottom: 7px; margin-bottom: 14px;
  border-bottom: 2px solid var(--b, var(--a1));
}
.block > h3::before {
  content: ""; width: 9px; height: 9px; border-radius: 2px;
  background: var(--b, var(--a1)); flex: none;
}
.blocks > .block:nth-of-type(1) { --b: var(--a1); }
.blocks > .block:nth-of-type(2) { --b: var(--a2); }
.two:nth-of-type(3) .block:nth-child(1) { --b: var(--a4); }
.two:nth-of-type(3) .block:nth-child(2) { --b: var(--a5); }
.two:nth-of-type(4) .block:nth-child(1) { --b: var(--a3); }
.two:nth-of-type(4) .block:nth-child(2) { --b: var(--a6); }
.block > h3 .tag { color: var(--b, var(--a1)); }
.block > h3 .tag { margin-left: auto; }
.block > p { color: var(--ink-2); font-size: .92rem; max-width: 66ch; }

/* ---------- tables -------------------------------------------------------- */

.tbl-scroll { overflow-x: auto; border: 1px solid var(--rule); border-radius: var(--r); }
table { border-collapse: collapse; width: 100%; font-size: .87rem; }
thead th {
  text-align: left; padding: 8px 12px; white-space: nowrap;
  background: color-mix(in srgb, var(--b, var(--a1)) 12%, var(--sheet-2));
  color: var(--b, var(--a1));
  font-family: var(--mono); font-size: .64rem; font-weight: 600;
  letter-spacing: .13em; text-transform: uppercase;
  border-bottom: 1px solid var(--rule);
}
tbody td { padding: 8px 12px; border-bottom: 1px solid var(--rule); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:nth-child(even) { background: color-mix(in srgb, var(--sheet-2) 55%, transparent); }
td.n, th.n { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums;
             white-space: nowrap; }
td b { font-family: var(--mono); font-weight: 600; font-variant-numeric: tabular-nums; }
td .note { display: block; color: var(--ink-3); font-size: .8rem; }
tfoot td {
  padding: 9px 12px; border-top: 2px solid var(--ink);
  font-family: var(--mono); font-weight: 600; font-variant-numeric: tabular-nums;
}

/* Grid children default to min-width:auto, which lets a wide table or SVG
   push its whole track past the viewport instead of scrolling inside it.
   Pin every layout track to zero. */
.bench > *, .stage > *, .blocks > *, .two > *, .top-grid > *,
.doc-head > *, .wbars > li > *, .block { min-width: 0; }

/* ---------- nesting diagram ---------------------------------------------- */

.nest-frame {
  border: 1px solid var(--rule); border-radius: var(--r);
  background: var(--sheet-2); padding: 14px;
  overflow: auto; max-height: 720px;
}
.nest-frame svg { display: block; margin: 0 auto; height: auto; max-width: none; }

/* ---------- weight breakdown ---------------------------------------------- */

.wbars { display: grid; gap: 9px; margin: 0; padding: 0; list-style: none; }
.wbars li { display: grid; grid-template-columns: 96px minmax(0, 1fr) 64px; gap: 12px;
            align-items: center; }
.wbars .lab { font-size: .85rem; color: var(--ink-2); }
.wbars .track { height: 12px; background: var(--sheet-2); border: 1px solid var(--rule);
                border-radius: 2px; overflow: hidden; }
.wbars .fill { display: block; height: 100%; background: var(--w, var(--a1));
               border-radius: 0 2px 2px 0; }
.wbars li:nth-child(1) { --w: var(--a1); }
.wbars li:nth-child(2) { --w: var(--a2); }
.wbars li:nth-child(3) { --w: var(--a3); }
.wbars li:nth-child(4) { --w: var(--a4); }
.wbars li:nth-child(5) { --w: var(--a5); }
.wbars .amt { font-family: var(--mono); font-size: .84rem; font-variant-numeric: tabular-nums;
              text-align: right; color: var(--ink); }
.wbars li.total { border-top: 2px solid var(--ink); padding-top: 9px; margin-top: 3px; }
.wbars li.total .lab, .wbars li.total .amt { font-weight: 600; color: var(--ink); }

/* ---------- build order ---------------------------------------------------- */

.build { list-style: none; counter-reset: b; padding: 0; margin: 0; display: grid; gap: 12px; }
.build li { counter-increment: b; position: relative; padding-left: 40px; font-size: .92rem;
            color: var(--ink-2); }
.build li::before {
  content: counter(b, decimal-leading-zero); position: absolute; left: 0; top: 1px;
  font-family: var(--mono); font-size: .74rem; font-weight: 600;
  color: var(--b, var(--a1));
  border: 1px solid color-mix(in srgb, var(--b, var(--a1)) 45%, transparent);
  background: color-mix(in srgb, var(--b, var(--a1)) 9%, transparent);
  border-radius: 2px; padding: 1px 5px;
}
.build li b { color: var(--ink); font-weight: 600; }

/* ---------- notes ----------------------------------------------------------- */

.note-box {
  border-left: 3px solid var(--blaze); background: var(--blaze-soft);
  padding: 12px 16px; border-radius: 0 var(--r) var(--r) 0; font-size: .89rem;
  color: var(--ink-2);
}
.note-box strong {
  display: block; font-family: var(--mono); font-size: .66rem; letter-spacing: .13em;
  text-transform: uppercase; color: var(--blaze); margin-bottom: 3px;
}
.note-box p:last-child { margin-bottom: 0; }

/* ==========================================================================
   Install
   ========================================================================== */

/* The install UI is toggled with the hidden attribute, so nothing below may
   set display on these without honouring it. */
[hidden] { display: none !important; }

.install { border-top: 1px solid var(--rule); background: var(--sheet-2); }
.install-in { padding: clamp(30px, 5vw, 52px) 0; }
.install-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: clamp(24px, 4vw, 48px); align-items: start;
}
.install-grid > * { min-width: 0; }
.install-grid h2 { margin: 8px 0 12px; }
.install-grid > div > p { color: var(--ink-2); max-width: 52ch; }
@media (max-width: 860px) { .install-grid { grid-template-columns: 1fr; } }

.install-cta { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 18px; }
.btn-lead {
  background: var(--a1); border-color: var(--a1); color: #fff;
  font-weight: 600; padding: 11px 20px;
}
.btn-lead:hover { background: var(--a1); border-color: var(--a1); color: #fff; filter: brightness(1.08); }
.btn-lead svg { stroke-width: 2; }
.install-size { font-family: var(--mono); font-size: .74rem; color: var(--ink-3); }

.install-done {
  margin-top: 18px; padding: 12px 16px;
  border-left: 3px solid var(--a4);
  background: color-mix(in srgb, var(--a4) 12%, transparent);
  border-radius: 0 var(--r) var(--r) 0; font-size: .9rem; color: var(--ink-2);
}
.install-done strong { color: var(--a4); }

.install-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.install-steps > div {
  background: var(--sheet); border: 1px solid var(--rule);
  border-top: 3px solid var(--s, var(--a2));
  border-radius: var(--r); padding: 14px 16px;
}
.install-steps > div:nth-child(1) { --s: var(--a2); }
.install-steps > div:nth-child(2) { --s: var(--a4); }
.install-steps > div:nth-child(3) { --s: var(--a3); }
.install-steps h4 {
  margin: 0 0 9px; font-family: var(--mono); font-size: .68rem; font-weight: 600;
  letter-spacing: .13em; text-transform: uppercase; color: var(--s, var(--a2));
}
.install-steps ol { margin: 0; padding-left: 18px; display: grid; gap: 6px; }
.install-steps li { font-size: .85rem; color: var(--ink-2); }
.install-steps li b { color: var(--ink); font-weight: 600; }
@media (max-width: 560px) { .install-steps { grid-template-columns: 1fr; } }

/* Running as an installed app there is no browser chrome, so the sticky
   header has to clear the status bar itself. */
@media (display-mode: standalone) {
  .rig { padding-top: env(safe-area-inset-top); }
  html { scroll-padding-top: calc(88px + env(safe-area-inset-top)); }
  body { overscroll-behavior-y: none; }
}
.rig-in, .wrap {
  padding-left: max(clamp(16px, 3vw, 34px), env(safe-area-inset-left));
  padding-right: max(clamp(16px, 3vw, 34px), env(safe-area-inset-right));
}
.foot { padding-bottom: max(40px, calc(26px + env(safe-area-inset-bottom))); }

/* ==========================================================================
   Sibling sites
   ========================================================================== */

.siblings { border-top: 1px solid var(--rule); }
.siblings-in { padding: clamp(26px, 4vw, 42px) 0; }
.siblings .tag { display: block; margin-bottom: 14px; }

.sib-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 820px) { .sib-grid { grid-template-columns: 1fr; } }

.sib {
  display: grid; grid-template-rows: auto auto 1fr; gap: 8px;
  padding: 16px 18px; text-decoration: none; color: var(--ink);
  background: var(--sheet); border: 1px solid var(--rule);
  border-left: 3px solid var(--s);
  border-radius: var(--r);
}
.sib:nth-child(1) { --s: var(--a6); }
.sib:nth-child(2) { --s: var(--a3); }
.sib:nth-child(3) { --s: var(--a5); }

.sib svg {
  width: 24px; height: 24px; fill: none; stroke: var(--s);
  stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
}
.sib-name { font-family: var(--display); font-weight: 700; font-size: 1rem; letter-spacing: -.015em; }
.sib-note { font-size: .85rem; color: var(--ink-2); line-height: 1.5; }

.sib:hover { border-color: var(--s); background: color-mix(in srgb, var(--s) 7%, var(--sheet)); }
.sib:hover .sib-name { color: var(--s); }
.sib:focus-visible { outline: 2px solid var(--s); outline-offset: 2px; }
@media (prefers-reduced-motion: no-preference) {
  .sib { transition: background .13s ease, border-color .13s ease; }
}

/* ==========================================================================
   Footer
   ========================================================================== */

.foot { border-top: 1px solid var(--rule); padding: 26px 0 40px; font-size: .85rem;
        color: var(--ink-3); }
.foot-in { display: flex; gap: 20px; flex-wrap: wrap; justify-content: space-between; }

/* ==========================================================================
   Print — the spec sheet is the thing worth printing
   ========================================================================== */

@media print {
  body { background: #fff; color: #000; font-size: 11px; }
  .rig, .panel, .tools, .top, .foot, .presets, .install, .siblings { display: none !important; }
  .bench { grid-template-columns: 1fr; padding: 0; }
  .stage { position: static; }
  .plate { box-shadow: none; border: 1px solid #999; break-inside: avoid; }
  .spec { border: 0; }
  .block { break-inside: avoid; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
