/* Plank & Post. Phone first; wider layouts start at 600px, 720px and 1024px. */

:root {
  --paper: #f6f2e9;
  --card: #fffdf8;
  --ink: #18212b;
  --ink-2: #4d5866;
  --ink-3: #7c8591;
  --line: #ddd5c3;
  --edge: #18212b;
  --tape: #ffc21a;
  --tape-ink: #18212b;
  --blue: #1d5fbf;
  --header: #18212b;
  --header-ink: #f6f2e9;
  --radius: 14px;
  --gutter: 16px;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "Roboto Mono", Consolas, "Liberation Mono", monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #11171e;
    --card: #19212b;
    --ink: #f3efe6;
    --ink-2: #b5bdc7;
    --ink-3: #8691a0;
    --line: #2b3643;
    --edge: #556273;
    --blue: #8cbaff;
    --header: #0b1016;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  overflow-x: hidden;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
a { color: var(--blue); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; margin: 0; }
h1 { font-size: clamp(32px, 6vw + 8px, 54px); font-weight: 800; }
h2 { font-size: clamp(23px, 2vw + 16px, 30px); font-weight: 800; }
h3 { font-size: 19px; font-weight: 700; }
p { margin: 0 0 14px; }

.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding-left: max(var(--gutter), env(safe-area-inset-left));
  padding-right: max(var(--gutter), env(safe-area-inset-right));
}
.skip { position: absolute; left: -999px; top: 0; background: var(--tape); color: var(--tape-ink); padding: 10px 14px; z-index: 20; }
.skip:focus { left: 8px; top: 8px; }

/* ---------- Header and the tape-measure strip ---------- */
.site-header { background: var(--header); color: var(--header-ink); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; min-height: 58px; gap: 12px; }
.brand { display: inline-flex; align-items: center; gap: 8px; color: inherit; text-decoration: none; font-weight: 800; font-size: 18px; letter-spacing: -0.01em; white-space: nowrap; }
.logo { width: 30px; height: 30px; flex: none; }
.site-header nav { display: flex; }
.site-header nav a {
  color: var(--header-ink);
  opacity: 0.82;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  min-height: 44px;
  padding: 0 7px;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}
.site-header nav a:last-child { padding-right: 0; }
.site-header nav a:hover, .site-header nav a.is-active { opacity: 1; color: var(--tape); }
.nav-optional { display: none !important; }
@media (max-width: 359px) {
  .site-header nav a:nth-child(3) { display: none; }
}
.tape {
  height: 14px;
  background:
    repeating-linear-gradient(90deg, var(--tape-ink) 0 2px, transparent 2px 60px) 0 0 / 100% 10px no-repeat,
    repeating-linear-gradient(90deg, var(--tape-ink) 0 1px, transparent 1px 12px) 0 0 / 100% 5px no-repeat,
    var(--tape);
}

/* ---------- Page heading ---------- */
.crumbs { font-size: 13px; color: var(--ink-3); margin: 18px 0 8px; }
.crumbs a { color: inherit; }
.eyebrow { font: 700 12px var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--blue); margin: 0 0 8px; }
.hl { background: linear-gradient(transparent 56%, var(--tape) 56% 92%, transparent 92%); padding: 0 0.08em; }
.lead { font-size: clamp(17px, 1vw + 14px, 20px); color: var(--ink-2); max-width: 60ch; margin: 12px 0 22px; }
@media (prefers-color-scheme: dark) {
  .hl { background: none; color: var(--tape); padding: 0; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 10px 18px;
  border: 1.5px solid var(--edge);
  border-radius: 10px;
  background: var(--tape);
  color: var(--tape-ink);
  font: 700 16px var(--sans);
  text-decoration: none;
  box-shadow: 3px 3px 0 var(--edge);
  cursor: pointer;
  transition: transform 0.08s, box-shadow 0.08s;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--edge); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--edge); }
.btn.quiet { background: transparent; color: var(--ink); box-shadow: none; font-weight: 600; }
.btn.quiet:hover { transform: none; background: rgba(127, 127, 127, 0.12); }
.btn.small { min-height: 44px; padding: 8px 14px; font-size: 15px; }

/* ---------- Ad placeholders ---------- */
.ad {
  border: 1.5px dashed var(--ink-3);
  border-radius: 10px;
  color: var(--ink-3);
  font: 600 12px var(--mono);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 8px;
  margin-left: auto;
  margin-right: auto;
}
/* Real ad units, once AdSense is set up in site.json */
.ad-unit { margin: 20px auto; text-align: center; max-width: 970px; }
.ad-unit.ad-side { margin: 0; }
.ad-label { display: block; font: 600 11px var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 4px; }
.ad-top { height: 100px; max-width: 320px; margin-top: 16px; }
.ad-mid { height: 250px; max-width: 300px; margin-top: 28px; margin-bottom: 8px; }
.ad-side { height: 250px; max-width: 300px; width: 100%; }

/* ---------- Calculator ---------- */
.calc { margin-top: 4px; }
.stage {
  background-color: #eef3fa;
  background-image:
    linear-gradient(rgba(29, 95, 191, 0.13) 1px, transparent 1px),
    linear-gradient(90deg, rgba(29, 95, 191, 0.13) 1px, transparent 1px);
  background-size: 20px 20px;
  border: 1.5px solid var(--edge);
  border-radius: var(--radius);
  padding: 10px 8px 4px;
  overflow: hidden;
}
.stage svg { display: block; width: 100%; height: auto; max-height: 280px; }
/* Hold the drawing's space before the script draws it, so the page does not jump */
#art { min-height: 190px; display: flex; align-items: center; }
.stage-cap { font: 600 13px/1.4 var(--mono); color: #1d5fbf; margin: 2px 6px 8px; text-align: center; }
.stage text { font: 700 13px var(--mono); }
.stage .dim { fill: #1d5fbf; }
.stage .soft { fill: #5b6673; font-weight: 600; font-size: 12px; }
.stage .plot { fill: #18212b; font: 800 16px var(--sans); }
.stage .warn { fill: #b3261e; }

.calc-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; margin-top: 18px; }
.panel {
  background: var(--card);
  border: 1.5px solid var(--edge);
  border-radius: var(--radius);
  box-shadow: 4px 4px 0 var(--edge);
  padding: 18px 16px;
}
.field { border: 0; padding: 0; margin: 0 0 20px; min-width: 0; }
.field:last-child { margin-bottom: 0; }
.field > legend, .field > label:not(.check) { display: block; padding: 0; font-weight: 700; font-size: 15px; margin-bottom: 8px; }
.hint { font-size: 13px; color: var(--ink-2); margin: 8px 0 0; }

.chips { display: grid; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); gap: 8px; }
.chips.wide { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.chip { position: relative; display: block; }
.chip input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.chip span {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 48px;
  height: 100%;
  padding: 7px 10px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  font-weight: 700;
  font-size: 15px;
  line-height: 1.2;
  text-align: center;
}
.chip small { font-weight: 500; font-size: 12px; color: var(--ink-2); margin-top: 2px; }
.chip input:hover + span { border-color: var(--edge); }
.chip input:checked + span { background: var(--tape); color: var(--tape-ink); border-color: var(--edge); box-shadow: 2px 2px 0 var(--edge); }
.chip input:checked + span small { color: var(--tape-ink); }
.chip input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 2px; }
.chip input:disabled { cursor: not-allowed; }
.chip input:disabled + span { opacity: 0.38; text-decoration: line-through; }

.length { display: flex; align-items: center; gap: 12px; }
.unit-input { position: relative; flex: none; width: 128px; }
.unit-input input, .money-input input {
  width: 100%;
  height: 48px;
  border: 1.5px solid var(--edge);
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
  font: 700 18px var(--mono);
  padding: 0 38px 0 12px;
}
.unit-input i, .money-input i { position: absolute; top: 0; height: 48px; display: flex; align-items: center; font: 600 14px var(--mono); font-style: normal; color: var(--ink-2); pointer-events: none; }
.unit-input i { right: 12px; }
.money-input { position: relative; }
.money-input input { padding: 0 10px 0 26px; font-size: 16px; }
.money-input i { left: 11px; }
input[type=number] { -moz-appearance: textfield; appearance: textfield; }
input[type=number]::-webkit-outer-spin-button, input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

input[type=range] { -webkit-appearance: none; appearance: none; flex: 1; min-width: 0; height: 44px; margin: 0; background: transparent; cursor: pointer; touch-action: pan-y; }
input[type=range]::-webkit-slider-runnable-track {
  height: 12px;
  border: 1.5px solid var(--edge);
  border-radius: 3px;
  background: repeating-linear-gradient(90deg, var(--tape-ink) 0 1px, transparent 1px 10px) 0 0 / 100% 5px no-repeat, var(--tape);
}
input[type=range]::-moz-range-track {
  height: 10px;
  border: 1.5px solid var(--edge);
  border-radius: 3px;
  background: repeating-linear-gradient(90deg, var(--tape-ink) 0 1px, transparent 1px 10px) 0 0 / 100% 5px no-repeat, var(--tape);
}
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 32px; margin-top: -12px; border-radius: 5px; background: var(--card); border: 1.5px solid var(--edge); box-shadow: 2px 2px 0 var(--edge); }
input[type=range]::-moz-range-thumb { width: 20px; height: 30px; border-radius: 5px; background: var(--card); border: 1.5px solid var(--edge); box-shadow: 2px 2px 0 var(--edge); }

.pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: end; }
.stepper { display: flex; align-items: stretch; border: 1.5px solid var(--edge); border-radius: 10px; overflow: hidden; background: var(--paper); height: 48px; }
.stepper button { flex: none; width: 48px; border: 0; background: transparent; color: var(--ink); font: 700 22px var(--sans); cursor: pointer; }
.stepper button:hover { background: var(--tape); color: var(--tape-ink); }
.stepper input { flex: 1; min-width: 0; border: 0; border-left: 1.5px solid var(--edge); border-right: 1.5px solid var(--edge); background: transparent; color: var(--ink); text-align: center; font: 700 18px var(--mono); }
.sub-label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }

.check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 600; font-size: 15px; cursor: pointer; }
.check input { width: 22px; height: 22px; margin: 0; accent-color: var(--ink); flex: none; }

details.prices { border-top: 1.5px dashed var(--line); margin-top: 20px; padding-top: 6px; }
details.prices summary { min-height: 44px; display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; cursor: pointer; color: var(--blue); list-style: none; }
details.prices summary::-webkit-details-marker { display: none; }
details.prices summary::before { content: "+"; font: 700 18px var(--mono); width: 16px; }
details.prices[open] summary::before { content: "\2212"; }
.price-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 6px; }

/* The estimate slip: always paper-coloured, in light and dark mode */
.slip-wrap { filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.16)); }
.slip {
  --ink: #18212b;
  --ink-2: #4d5866;
  --edge: #18212b;
  --rule: #cdc5b0;
  --hole: 6px;
  background: #fffdf6;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 15px;
  padding: 26px 18px 28px;
  -webkit-mask:
    radial-gradient(var(--hole) at 50% 0, #0000 98%, #000) 50% 0 / calc(var(--hole) * 3) 51% repeat-x,
    radial-gradient(var(--hole) at 50% 100%, #0000 98%, #000) 50% 100% / calc(var(--hole) * 3) 51% repeat-x;
  mask:
    radial-gradient(var(--hole) at 50% 0, #0000 98%, #000) 50% 0 / calc(var(--hole) * 3) 51% repeat-x,
    radial-gradient(var(--hole) at 50% 100%, #0000 98%, #000) 50% 100% / calc(var(--hole) * 3) 51% repeat-x;
}
.slip p { margin: 0; }
.slip-kicker { font-size: 12px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-2); display: flex; justify-content: space-between; gap: 8px; }
.slip-title { font: 800 20px/1.2 var(--sans); letter-spacing: -0.01em; margin-top: 6px !important; }
.slip-sub { font-size: 13px; color: var(--ink-2); margin-top: 4px !important; }
.slip-lines { margin-top: 14px; border-top: 1.5px dashed var(--rule); }
.slip-line { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1.5px dashed var(--rule); }
.slip-line span:last-child { white-space: nowrap; font-weight: 700; }
.slip-line small { display: block; font-size: 12px; color: var(--ink-2); }
.slip-sum { font-weight: 700; border-bottom: 0; }
.slip-total { background: var(--tape); margin: 16px -18px 0; padding: 14px 18px 16px; }
.slip-total-label { display: block; font-size: 12px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; }
.slip-total strong { display: block; font: 800 clamp(27px, 7vw, 36px)/1.15 var(--sans); letter-spacing: -0.02em; margin: 2px 0; }
.slip-perft { font-size: 13px; }
.slip-needs { margin: 16px 0 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
.slip-needs li { border: 1.5px solid var(--rule); border-radius: 8px; padding: 8px 10px; font-size: 12px; color: var(--ink-2); }
.slip-needs b { display: block; font: 800 19px/1.2 var(--sans); color: var(--ink); }
.slip-custom { margin-top: 12px !important; font-size: 13px; }
.slip-custom button { background: none; border: 0; padding: 0; color: #1d5fbf; font: inherit; text-decoration: underline; cursor: pointer; }
.slip-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.slip .btn.quiet { border-color: var(--rule); }
.slip-note { margin-top: 14px !important; font-size: 12px; line-height: 1.5; color: var(--ink-2); }
.slip-note a { color: #1d5fbf; }
[hidden] { display: none !important; }

/* ---------- Guide text ---------- */
.content { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; align-items: start; margin-top: 36px; }
.prose > h2 { margin: 34px 0 10px; }
.prose > h2:first-child { margin-top: 0; }
.prose > h3 { margin: 22px 0 6px; }
.prose p, .prose li { color: var(--ink-2); max-width: 68ch; }
.prose ul, .prose ol { padding-left: 22px; margin: 0 0 14px; }
.prose li { margin-bottom: 6px; }
.prose strong { color: var(--ink); }
.reviewed { font: 600 13px var(--mono); color: var(--ink-3); margin: -10px 0 20px; }
.reviewed a { color: inherit; }
.sources { font-size: 15px; }
.sources li { margin-bottom: 8px; }
.callout { border-left: 5px solid var(--tape); background: var(--card); padding: 12px 14px; margin: 0 0 16px; max-width: 68ch; }
.callout p { margin: 0; color: var(--ink); }

.table-wrap { overflow-x: auto; margin: 0 0 16px; border: 1.5px solid var(--edge); border-radius: 10px; background: var(--card); }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { padding: 10px 12px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--line); }
th:first-child, td:first-child { text-align: left; white-space: normal; min-width: 150px; }
thead th { background: var(--header); color: var(--header-ink); font: 700 12px var(--mono); letter-spacing: 0.04em; border-bottom: 0; }
tbody th { font-weight: 600; }
tbody td { font-family: var(--mono); }
tbody tr:last-child th, tbody tr:last-child td { border-bottom: 0; }
/* Tables of words rather than numbers: left-aligned and free to wrap */
.table-wrap.text td, .table-wrap.text thead th { text-align: left; white-space: normal; }
.table-wrap.text tbody td { font-family: var(--sans); color: var(--ink-2); }
.table-wrap.text tbody th { font-family: var(--mono); font-size: 13px; min-width: 110px; }
@media (max-width: 599px) { .table-wrap.text table { min-width: 560px; } }
/* The first column stays put while a wide table scrolls sideways on a phone */
th:first-child { position: sticky; left: 0; }
tbody th:first-child { background: var(--card); }

/* ---------- Cards ---------- */
.cards { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--card);
  color: var(--ink);
  border: 1.5px solid var(--edge);
  border-radius: var(--radius);
  box-shadow: 4px 4px 0 var(--edge);
  padding: 16px;
  text-decoration: none;
  transition: transform 0.1s, box-shadow 0.1s;
}
.card:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--tape); }
.card strong { font-size: 18px; line-height: 1.25; letter-spacing: -0.01em; }
.card-text { font-size: 15px; color: var(--ink-2); line-height: 1.45; }
.card-go { margin-top: auto; padding-top: 6px; font: 700 13px var(--mono); color: var(--blue); }
.card-ico svg { width: 44px; height: 44px; display: block; }
/* The card's picture sits on the same graph paper as the calculator's drawing */
.card-art {
  display: block;
  aspect-ratio: 16 / 10;
  margin-bottom: 6px;
  border: 1.5px solid var(--edge);
  border-radius: 9px;
  overflow: hidden;
  background-color: #eef3fa;
  background-image:
    linear-gradient(rgba(29, 95, 191, 0.13) 1px, transparent 1px),
    linear-gradient(90deg, rgba(29, 95, 191, 0.13) 1px, transparent 1px);
  background-size: 16px 16px;
}
.card-art img { display: block; width: 100%; height: 100%; object-fit: contain; padding: 4px 6px 2px; }
/* On phones the picture sits beside the text, so a list of cards stays short */
@media (max-width: 599px) {
  .card { display: grid; grid-template-columns: 118px minmax(0, 1fr); column-gap: 12px; row-gap: 4px; align-items: start; padding: 12px; }
  .card-art { grid-row: 1 / span 3; aspect-ratio: 1 / 1; margin: 0; }
  .card-ico { grid-row: 1 / span 3; }
  .card-go { margin-top: 0; }
}
.i-ink { fill: var(--ink); }
.i-tape { fill: var(--tape); }
.i-line { fill: none; stroke: var(--ink); stroke-width: 1.5; }
.i-thick { stroke-width: 3; }
.related { margin-top: 44px; }
.related h2 { margin-bottom: 14px; }

/* ---------- Home ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1fr); gap: 30px; align-items: center; padding: 30px 0 10px; }
.hero .lead { margin-bottom: 20px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.hero-points { list-style: none; padding: 0; margin: 22px 0 0; display: flex; flex-wrap: wrap; gap: 8px 18px; font: 600 13px var(--mono); color: var(--ink-2); }
.hero-points li::before { content: "\2713"; color: var(--blue); margin-right: 6px; font-weight: 800; }
.slip-wrap.sample { position: static; width: 100%; max-width: 360px; margin: 0 auto; transform: rotate(1.6deg); }
.sample-cap { font: 600 12px var(--mono); color: var(--ink-3); text-align: center; margin: 14px 0 0; }
.section { margin-top: 52px; }
.section > h2 { margin-bottom: 6px; }
.section > h2 a { color: inherit; text-decoration-color: var(--tape); text-decoration-thickness: 3px; text-underline-offset: 5px; }
.section > .lead { margin-top: 6px; }
.steps { list-style: none; padding: 0; margin: 18px 0 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; counter-reset: step; }
.steps li { counter-increment: step; background: var(--card); border: 1.5px solid var(--line); border-radius: var(--radius); padding: 16px; }
.steps li::before { content: counter(step); display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 8px; background: var(--tape); color: var(--tape-ink); font: 800 17px var(--mono); margin-bottom: 10px; border: 1.5px solid var(--edge); }
.steps h3 { margin-bottom: 4px; }
.steps p { margin: 0; color: var(--ink-2); font-size: 16px; }
.page { padding-top: 8px; }
.page .prose { margin-top: 20px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--header); color: var(--header-ink); margin-top: 64px; padding: 30px 0 26px; font-size: 15px; }
.foot-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; }
.site-footer p { color: #b9c0c9; margin: 10px 0 0; max-width: 40ch; }
.site-footer h2 { font: 700 12px var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--tape); margin-bottom: 4px; }
.site-footer nav a { display: flex; align-items: center; min-height: 40px; color: var(--header-ink); text-decoration: none; opacity: 0.86; }
.site-footer nav a:hover { opacity: 1; text-decoration: underline; }
.site-footer .fine { border-top: 1px solid #2f3a47; margin-top: 22px; padding-top: 16px; font-size: 13px; max-width: none; }
body.has-calc .site-footer { padding-bottom: 86px; }

/* ---------- Sticky total (phones only) ---------- */
.sticky-total {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px max(var(--gutter), env(safe-area-inset-right)) calc(10px + env(safe-area-inset-bottom)) max(var(--gutter), env(safe-area-inset-left));
  background: var(--tape);
  color: var(--tape-ink);
  border-top: 2px solid #18212b;
  font: 700 12px var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transform: translateY(110%);
  transition: transform 0.2s ease;
}
.sticky-total.show { transform: translateY(0); }
.sticky-total strong { font: 800 18px var(--sans); letter-spacing: -0.01em; white-space: nowrap; text-transform: none; }

/* ---------- 600px and up ---------- */
@media (min-width: 600px) {
  :root { --gutter: 24px; }
  .site-header .wrap { min-height: 66px; }
  .brand { font-size: 21px; gap: 10px; }
  .site-header nav a { padding: 0 14px; font-size: 16px; }
  .nav-optional { display: inline-flex !important; }
  .ad-top { height: 90px; max-width: 728px; margin-top: 20px; }
  .ad-mid { height: 90px; max-width: 728px; }
  .panel { padding: 22px; }
  .slip { padding: 28px 22px 30px; }
  .slip-total { margin-left: -22px; margin-right: -22px; padding-left: 22px; padding-right: 22px; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .foot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- 720px and up: inputs and slip side by side ---------- */
@media (min-width: 720px) {
  .calc-grid { grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr); gap: 26px; }
  .slip-wrap { position: sticky; top: 16px; align-self: start; }
  .sticky-total { display: none; }
  body.has-calc .site-footer { padding-bottom: 26px; }
  .hero { grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr); padding-top: 44px; }
}

/* ---------- 1024px and up ---------- */
@media (min-width: 1024px) {
  :root { --gutter: 32px; }
  .ad-top { max-width: 970px; }
  .ad-mid { max-width: 970px; height: 120px; }
  .content:has(> .side) { grid-template-columns: minmax(0, 1fr) 300px; gap: 36px; }
  .side { position: sticky; top: 16px; }
  .ad-side { height: 600px; }
  .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .related .cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .foot-grid { grid-template-columns: 1.3fr 1.2fr 1.2fr 0.9fr; }
}

/* ---------- Print: just the drawing and the estimate ---------- */
@media print {
  .site-header nav, .tape, .ad, .side, .panel, .related, .site-footer nav, .sticky-total, .slip-actions, .skip, .content { display: none !important; }
  body { background: #fff; color: #000; }
  .site-header, .site-footer { background: none; color: #000; }
  .slip-wrap { filter: none; position: static; }
  .slip { -webkit-mask: none; mask: none; border: 1px solid #000; }
  .calc-grid { display: block; }
}
