/* The Fireplace Guys — cap builder
 * One screen, no page-to-page hopping, no page scrolling: the question lives on the left (below on
 * a phone), the customer's own cap is drawn on the right (on top on a phone), and every answer
 * changes the drawing immediately.
 */

:root {
  --canvas:     #14100d;
  --panel:      #221b15;
  --panel-2:    #2a211a;
  --line:       #44372c;
  --line-2:     #5b4a3c;
  --sand:       #f7f1e8;
  --sand-2:     #d9cec1;
  --muted:      #ad9f8f;
  --ember:      #e8763f;
  --ember-2:    #f39a5a;
  --ember-soft: rgba(232,118,63,.16);
  --bad:        #f0937a;
  --paper:      #fbf9f6;
  --radius:     16px;
  --radius-lg:  24px;
  --shadow:     0 18px 50px rgba(0,0,0,.35);
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --ease: cubic-bezier(.2,.8,.25,1);
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--canvas);
  color: var(--sand);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

button, input, select, textarea { font-family: inherit; }
button { -webkit-tap-highlight-color: transparent; cursor: pointer; }
:focus-visible { outline: 3px solid var(--ember-2); outline-offset: 2px; }
.muted { color: var(--muted); font-weight: 400; }

/* ── shell ─────────────────────────────────────────────────────────────────────────────── */
.shell {
  height: 100dvh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background:
    radial-gradient(1200px 620px at 78% -12%, rgba(232,118,63,.14), transparent 62%),
    var(--canvas);
}

.bar {
  display: flex; align-items: center; gap: 20px;
  padding: 14px clamp(16px, 3vw, 40px) 10px;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.mark {
  width: 40px; height: 40px; flex: none; border-radius: 12px;
  background: linear-gradient(160deg, var(--ember-2), #b8501f);
  display: grid; place-items: center;
  box-shadow: 0 6px 18px rgba(232,118,63,.32);
}
.mark svg { width: 24px; height: 24px; display: block; }
.brand-name { font-size: 15px; font-weight: 750; letter-spacing: .14em; text-transform: uppercase; white-space: nowrap; }
.brand-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.track { flex: 1; height: 5px; border-radius: 999px; background: rgba(255,255,255,.1); overflow: hidden; min-width: 50px; }
.track > i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--ember), var(--ember-2)); border-radius: 999px; transition: width .45s var(--ease); }
.counter { font-size: 13px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ── stage: question | drawing ─────────────────────────────────────────────────────────── */
.stage {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(16px, 2.2vw, 32px);
  padding: 6px clamp(16px, 3vw, 40px) 0;
  min-height: 0;
}
.stage > * { min-height: 0; min-width: 0; }
.ask, .show { display: flex; flex-direction: column; }
.ask { justify-content: center; }

.kicker { font-size: 12.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--ember-2); font-weight: 750; margin-bottom: 10px; }
.q { font-size: clamp(26px, 2.7vw, 38px); line-height: 1.12; font-weight: 750; letter-spacing: -0.02em; margin: 0 0 10px; }
.q em { font-style: normal; color: var(--ember-2); }
.help { font-size: 16px; line-height: 1.5; color: var(--sand-2); margin: 0 0 18px; max-width: 48ch; }
.help b { color: var(--sand); }
.fine { font-size: 14px; color: var(--muted); margin: 14px 0 0; line-height: 1.5; }

.body { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 3px 4px 6px 3px; margin: -3px -4px 0 -3px;
        scrollbar-width: thin; scrollbar-color: #4a3d32 transparent; }

/* ── choices ───────────────────────────────────────────────────────────────────────────── */
.opts { display: grid; gap: 10px; }
.opts.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.opts.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.opt {
  position: relative; display: flex; flex-direction: column; gap: 3px; text-align: left;
  min-height: 56px; padding: 14px 16px; border-radius: var(--radius);
  border: 1.5px solid var(--line); background: linear-gradient(180deg, var(--panel-2), var(--panel));
  color: var(--sand);
  transition: border-color .18s var(--ease), transform .18s var(--ease), background .18s var(--ease);
}
.opt:hover { border-color: var(--line-2); }
.opt:active { transform: scale(.985); }
.opt[aria-pressed="true"] { border-color: var(--ember); background: linear-gradient(180deg, rgba(232,118,63,.2), rgba(232,118,63,.08)); }
.opt.tall { padding: 20px 18px; min-height: 104px; justify-content: center; }
.opt.center { align-items: center; text-align: center; }
.opt .t { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.opt .t.big { font-size: 30px; line-height: 1; }
.opt .s { font-size: 14px; color: var(--muted); line-height: 1.35; }
.opt .k, .card .k { position: absolute; top: 9px; right: 12px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

.mrow { display: flex; align-items: center; gap: 12px; }
.mrow > span:last-child { display: flex; flex-direction: column; gap: 2px; }
.sw { display: block; width: 36px; height: 36px; border-radius: 10px; flex: none; border: 1px solid rgba(255,255,255,.18);
      box-shadow: inset 0 1px 0 rgba(255,255,255,.35), inset 0 -6px 12px rgba(0,0,0,.28); }
.sw.mini { width: 13px; height: 13px; border-radius: 50%; box-shadow: none; }
.sw-galv    { background: linear-gradient(135deg,#e9e7e3,#c9c6c0 45%,#dedbd5 60%,#b6b2ab); }
.sw-paint   { background: conic-gradient(from 210deg,#7f9cae,#ae9a81,#8f6b62,#5d5d5d,#67785f,#7f9cae); }
.sw-grip    { background: linear-gradient(135deg,#cfc7bb,#b9b0a3); }
.sw-valume  { background: linear-gradient(135deg,#dcdcd8,#bdbdb6 55%,#d3d3cd); }
.sw-bonder  { background: linear-gradient(135deg,#8f8d89,#6f6d69); }
.sw-copper  { background: linear-gradient(135deg,#c8845a,#a5613a 55%,#8c4c2c); }
.sw-stainless { background: linear-gradient(135deg,#eef0f1,#c3c8cb 50%,#dfe3e5); }

/* the first screen: one catalog, two sides (brick | flue pipe), the full width */
.stage.step-style { grid-template-columns: minmax(0, 1fr); }
.stage.step-style .show { display: none; }
.stage.step-style .ask { max-width: none; }
.catalog { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); column-gap: 14px; row-gap: 14px; align-items: start; }
.catalog .side.brick, .catalog .side.flue { grid-column: span 2; }
.catalog .side { min-width: 0; }
.catalog .sidehead { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 0 0 10px; padding-bottom: 8px; border-bottom: 1px solid var(--line); min-height: 34px; }
.catalog .sidehead .t { font-size: 17px; font-weight: 700; color: var(--sand); }
.catalog .sidehead .s { font-size: 13.5px; color: var(--sand-2); }
/* every card the same size: five equal columns across the page (2 | 1 | 2), the cards on the same tracks */
.catalog .side { display: grid; grid-template-columns: subgrid; align-content: start; }
.catalog .side .sidehead, .catalog .side .cards { grid-column: 1 / -1; }
.catalog .side .cards { display: grid; grid-template-columns: subgrid; column-gap: 14px; row-gap: 14px; }
.catalog .card { height: 100%; }
.catalog .card .short { display: none; }
.catalog .card .cap .s { min-height: 2.6em; }

/* product cards with the shop's own photos */
.cards { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.card {
  position: relative; padding: 0; overflow: hidden; text-align: left;
  border-radius: var(--radius); border: 1.5px solid var(--line);
  background: linear-gradient(180deg, var(--panel-2), var(--panel)); color: var(--sand);
  display: flex; flex-direction: column; transition: border-color .18s var(--ease), transform .18s var(--ease);
}
.card:hover { border-color: var(--line-2); }
.card:active { transform: scale(.985); }
.card[aria-pressed="true"] { border-color: var(--ember); box-shadow: 0 0 0 1px var(--ember) inset; }
.card .k { z-index: 1; color: #8a7f72; }
.card .ph { aspect-ratio: 4 / 3; width: 100%; background: var(--paper); display: grid; place-items: center; overflow: hidden; }
.card .ph img { width: 100%; height: 100%; object-fit: contain; display: block; mix-blend-mode: multiply; }
.card .cap { padding: 10px 12px 12px; }
.card .cap .t { display: block; font-size: 15px; font-weight: 700; line-height: 1.2; }
.card .cap .s { display: -webkit-box; font-size: 13px; color: var(--muted); margin-top: 3px; line-height: 1.35;
                -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* segmented control + chips */
.seg-row { display: flex; align-items: center; gap: 14px; margin-top: 18px; flex-wrap: wrap; }
.seg-l, .cgroup { font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 650; }
.cgroup .muted { text-transform: none; letter-spacing: 0; font-size: 13.5px; }
.seg { display: inline-flex; border: 1.5px solid var(--line); border-radius: 999px; padding: 3px; background: var(--panel); }
.seg button { border: 0; background: transparent; color: var(--sand-2); font-size: 15px; font-weight: 600; padding: 9px 18px; border-radius: 999px; min-height: 40px; }
.seg button[aria-pressed="true"] { background: var(--ember); color: #1d0e06; }

.chiprow { margin-bottom: 18px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.chip {
  border: 1.5px solid var(--line); background: var(--panel); color: var(--sand);
  border-radius: 12px; padding: 10px 16px; font-size: 16px; font-weight: 650; min-height: 46px; min-width: 64px;
  font-variant-numeric: tabular-nums;
}
.chip small { font-size: 12px; color: var(--muted); font-weight: 500; margin-left: 4px; }
.chip:hover { border-color: var(--line-2); }
.chip[aria-pressed="true"] { border-color: var(--ember); background: var(--ember-soft); }
.chip[aria-pressed="true"] small { color: var(--sand-2); }

/* ── numbers: inches + an eighth ───────────────────────────────────────────────────────── */
.nums { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 14px; }
.nums.three { grid-template-columns: minmax(0, 1fr); gap: 10px; }
.nums.one { grid-template-columns: minmax(0, 1fr); max-width: 340px; }
.gaprow { margin: 14px 0 6px; }
.spot { margin-top: 12px; }
.spot .nums { margin-bottom: 4px; }
.num { display: flex; flex-direction: column; gap: 7px; }
.nl { font-size: 15px; font-weight: 700; color: var(--sand); }
.nl small { display: block; font-size: 13px; font-weight: 400; color: var(--muted); margin-top: 1px; }
.nums.three .num { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); align-items: center; gap: 12px; }
.nrow {
  display: flex; align-items: center; gap: 6px; min-height: 60px;
  border: 1.5px solid var(--line); border-radius: var(--radius); background: var(--panel); padding: 6px 8px 6px 14px;
  transition: border-color .18s var(--ease);
}
.nrow:focus-within { border-color: var(--ember); box-shadow: 0 0 0 3px var(--ember-soft); }
.nrow input {
  flex: 1; min-width: 0; width: 60px; border: 0; background: transparent; color: var(--sand);
  font-size: 32px; font-weight: 750; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; outline: none; padding: 0;
}
.nrow input::placeholder { color: #5f5145; }
.nrow .unit { font-size: 16px; color: var(--muted); font-weight: 600; }
.fsel {
  appearance: none; -webkit-appearance: none; border: 1.5px solid var(--line); background: var(--panel-2);
  color: var(--sand); border-radius: 10px; padding: 9px 10px; font-size: 15px; font-weight: 650; min-height: 44px; cursor: pointer;
}
.fsel:focus { border-color: var(--ember); outline: none; }
.nums.three .nrow { min-height: 54px; }
.nums.three .nrow input { font-size: 26px; }

.quick { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 6px; }
.ghost {
  border: 1.5px dashed var(--line-2); background: transparent; color: var(--sand);
  border-radius: 12px; padding: 10px 14px; font-size: 14.5px; font-weight: 600; min-height: 44px;
}
.ghost:hover { border-color: var(--ember); }
.err { font-size: 14px; color: var(--bad); min-height: 20px; margin-top: 6px; line-height: 1.4; }

/* colours */
.cg { margin-bottom: 10px; }
.colours { display: grid; gap: 6px; grid-template-columns: repeat(5, minmax(0, 1fr)); margin-top: 6px; }
.colour {
  display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 8px 2px; border-radius: 12px;
  border: 1.5px solid transparent; background: transparent; color: var(--sand-2);
}
.colour:hover { border-color: var(--line); }
.colour[aria-pressed="true"] { border-color: var(--ember); background: var(--ember-soft); color: var(--sand); }
.colour .dot { width: 32px; height: 32px; border-radius: 50%; border: 1px solid rgba(255,255,255,.25); }
.colour .n { font-size: 12px; text-align: center; line-height: 1.15; }

/* toggles */
.tog {
  display: flex; align-items: center; gap: 14px; width: 100%; min-height: 60px;
  padding: 14px 16px; border-radius: var(--radius);
  border: 1.5px solid var(--line); background: var(--panel); color: var(--sand); text-align: left;
}
.tog > span:nth-child(2) { display: flex; flex-direction: column; gap: 2px; }
.tog[aria-pressed="true"] { border-color: var(--ember); background: var(--ember-soft); }
.tog .box { width: 46px; height: 26px; border-radius: 999px; background: #4d4136; position: relative; flex: none; transition: background .18s var(--ease); }
.tog .box::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #efeadf; transition: transform .2s var(--ease); }
.tog[aria-pressed="true"] .box { background: var(--ember); }
.tog[aria-pressed="true"] .box::after { transform: translateX(20px); }
.tog .t { font-size: 16px; font-weight: 700; }
.tog .s { font-size: 14px; color: var(--muted); }
.tog[aria-pressed="true"] .s { color: var(--sand-2); }
.tog .price { margin-left: auto; font-variant-numeric: tabular-nums; font-size: 16px; color: var(--ember-2); font-weight: 750; }
.tog.slim { min-height: 0; padding: 12px 14px; }

/* form */
.grid2 { display: grid; gap: 4px 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 14px; font-weight: 650; color: var(--sand-2); }
.field input, .field textarea {
  border: 1.5px solid var(--line); background: var(--panel); color: var(--sand);
  border-radius: 12px; padding: 12px 14px; font-size: 17px; outline: none; width: 100%; min-height: 50px;
}
.field input:focus, .field textarea:focus { border-color: var(--ember); box-shadow: 0 0 0 3px var(--ember-soft); }
.field input[aria-invalid="true"] { border-color: var(--bad); }
.field .err { font-size: 13px; min-height: 18px; margin: 0; }
textarea { resize: none; line-height: 1.45; }
.linkbtn { border: 0; background: none; color: var(--ember-2); font-size: 15px; font-weight: 600; padding: 10px 0; text-align: left; min-height: 44px; }

/* ── drawing panel ─────────────────────────────────────────────────────────────────────── */
.show {
  position: relative; border-radius: var(--radius-lg); overflow: hidden; color: #17130f;
  background: radial-gradient(620px 320px at 50% 0%, rgba(255,255,255,.35), transparent 70%), linear-gradient(180deg, #fdfcfa, #f1ece4);
  border: 1px solid #e5ded3; box-shadow: var(--shadow);
}
.stagearea { position: absolute; inset: 0; display: grid; place-items: center; padding: 10px 10px 58px; overflow: hidden; }
.draw { width: 100%; height: 100%; display: block; }
.hero { width: 100%; height: 100%; display: grid; place-items: center; }
.show:has(.hero) { background: #fff; }
/* the first screen: all nine caps, cut out, on the page's own dark ground (no white card) */
.show.dark { background: transparent; border: 0; box-shadow: none; }
.show.dark:has(.hero) { background: transparent; }
.hero.gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 18px; align-content: center; padding: 4px; }
.hero.gallery figure { margin: 0; display: flex; flex-direction: column; align-items: center; min-width: 0; transition: opacity .2s; }
.hero.gallery figure.dim { opacity: .22; }
.hero.gallery.few { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 26px; }
.hero.gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; display: block; filter: drop-shadow(0 10px 14px rgba(0,0,0,.45)); }
.hero.gallery figcaption { font-size: 13px; font-weight: 650; color: var(--sand-2); text-align: center; line-height: 1.2; margin-top: 4px; }
@media (max-width: 560px) { .hero.gallery { gap: 2px 8px; } .hero.gallery figcaption { font-size: 10.5px; margin-top: 1px; } }
.hero.empty { color: #7d7369; font-size: 17px; }
.hero.is3d { position: relative; overflow: hidden; }
.hero .box3d { position: relative; }
.hero .cap3d { width: 100%; height: 100%; display: block; }
.hero .marks3d { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.photo { max-width: 90%; max-height: 90%; object-fit: contain; display: block; mix-blend-mode: multiply; filter: drop-shadow(0 20px 26px rgba(60,45,32,.18)); }
.specbar {
  position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; justify-content: flex-end;
  gap: 8px; overflow: hidden; padding: 10px 14px; min-height: 50px;
  background: linear-gradient(180deg, rgba(255,255,255,0), rgba(255,255,255,.94) 40%);
  font-size: 14px; color: #4f473f;
}
.specbar .pill {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid rgba(23,19,15,.16); border-radius: 999px;
  padding: 5px 11px; white-space: nowrap; background: rgba(255,255,255,.85); min-width: 0; overflow: hidden; text-overflow: ellipsis; flex: 0 1 auto;
}
.specbar .pill .dot { width: 13px; height: 13px; border-radius: 50%; border: 1px solid rgba(0,0,0,.2); flex: none; }
.specbar .total { color: #a8461a; }
.specbar svg.ic { width: 24px; height: 16px; flex: none; }

/* ── review ────────────────────────────────────────────────────────────────────────────── */
.review { justify-content: flex-start; padding-top: 6px; }
.rlist { display: flex; flex-direction: column; min-height: 0; overflow-y: auto; }
.rrow {
  display: grid; grid-template-columns: 70px minmax(0, 1fr) auto; gap: 12px; align-items: baseline; text-align: left;
  border: 0; border-bottom: 1px solid var(--line); background: none; color: var(--sand); padding: 10px 2px; font-size: 16px; min-height: 44px;
}
.rrow:hover .ed { color: var(--ember-2); }
.rrow .k { color: var(--muted); font-size: 14px; }
.rrow .v { font-weight: 650; }
.rrow .ed { font-size: 13px; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.rtotals { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.rtotal { display: flex; justify-content: space-between; font-size: 16px; color: var(--sand); font-weight: 650; }
.rtotal .num { color: var(--ember-2); font-variant-numeric: tabular-nums; }
.note-small { font-size: 14px; color: var(--muted); line-height: 1.5; }
.note-small a { color: var(--sand-2); }

/* ── done ──────────────────────────────────────────────────────────────────────────────── */
.stage.step-done { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
.done { display: grid; place-items: center; text-align: center; height: 100%; padding: 24px; }
.done .tick { width: 74px; height: 74px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 18px;
  background: rgba(111,157,99,.16); border: 1px solid rgba(111,157,99,.5); }
.done h2 { font-size: clamp(26px, 3vw, 38px); margin: 0 0 10px; letter-spacing: -0.02em; }
.done p { color: var(--sand-2); max-width: 46ch; margin: 0 auto 10px; line-height: 1.6; font-size: 16px; }
.done .ref { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--ember-2); font-size: 18px; }
.done-btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }

/* ── footer ────────────────────────────────────────────────────────────────────────────── */
.foot { display: flex; align-items: center; gap: 14px; padding: 12px clamp(16px, 3vw, 40px) max(14px, env(safe-area-inset-bottom)); }
.btn {
  border: 0; border-radius: 999px; padding: 14px 28px; min-height: 50px; font-size: 16.5px; font-weight: 750;
  background: linear-gradient(180deg, var(--ember-2), var(--ember)); color: #1d0e06;
  box-shadow: 0 10px 26px rgba(232,118,63,.30); transition: transform .16s var(--ease), filter .16s var(--ease); white-space: nowrap;
}
.btn:hover { filter: brightness(1.05); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .45; cursor: default; transform: none; }
.btn.plain { background: transparent; color: var(--sand); border: 1.5px solid var(--line-2); box-shadow: none; font-weight: 600; padding: 12px 22px; }
.btn.big { padding: 16px 36px; font-size: 17.5px; }
.hint { font-size: 14px; color: var(--muted); }
.hint kbd { font-family: inherit; font-size: 12px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 1px 5px; color: var(--sand-2); }
.spacer { flex: 1; }

@keyframes riseIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.rise { animation: riseIn .26s var(--ease) both; }
@media (prefers-reduced-motion: reduce) { .rise { animation: none; } * { transition: none !important; } }

/* ── touch screens: no keyboard shortcuts to advertise ─────────────────────────────────── */
@media (hover: none), (pointer: coarse) {
  .kb, .opt .k, .card .k { display: none; }
  select[data-frac], input[data-num] { min-height: 44px; }
}

/* ── narrow screens: the drawing on top, the question under it ─────────────────────────── */
@media (max-width: 980px) {
  .stage { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 38%) minmax(0, 1fr); gap: 14px; }
  .show { order: 1; border-radius: 18px; }
  .ask { order: 2; justify-content: flex-start; }
  .brand-sub { display: none; }
  /* the photos ARE the visual on the style step; the form needs the room */
  .stage.step-style { grid-template-rows: minmax(0, 1fr); }
  .stage.step-style .show { display: none; }
  .stage.step-review { grid-template-rows: minmax(0, 32%) minmax(0, 1fr); }
  .stage.step-fit { grid-template-rows: minmax(0, 30%) minmax(0, 1fr); }
}

@media (max-width: 560px) {
  .bar { gap: 12px; padding: 10px 16px 8px; }
  .mark { width: 34px; height: 34px; border-radius: 10px; }
  .brand-name { font-size: 13px; letter-spacing: .1em; }
  .counter { display: none; }
  .stage { padding: 4px 16px 0; gap: 12px; }
  .q { font-size: 24px; margin-bottom: 6px; }
  .kicker { font-size: 11.5px; margin-bottom: 6px; }
  .help { font-size: 15px; margin-bottom: 12px; }
  .stagearea { padding: 4px 4px 46px; }
  .specbar { min-height: 42px; padding: 7px 10px; font-size: 12.5px; gap: 6px; justify-content: flex-start; }
  .specbar .pill { padding: 4px 9px; }
  .opts.two { gap: 8px; }
  .opt { padding: 12px 13px; }
  .opt.tall { min-height: 92px; }
  .opt .t { font-size: 16px; }
  .opt .s { font-size: 13px; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .card .cap .s { display: none; }
  .card .cap { padding: 8px 10px 10px; }
  .grid2 { grid-template-columns: minmax(0, 1fr); }
  .nums { gap: 10px; }
  .nrow input { font-size: 28px; }
  .nums.three .num { grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 8px; }
  .colour .n { font-size: 10.5px; }
  .colour .dot { width: 30px; height: 30px; }
  .foot { gap: 10px; padding: 10px 16px max(12px, env(safe-area-inset-bottom)); }
  .btn { padding: 13px 22px; font-size: 16px; }
  .btn.big { padding: 14px 26px; font-size: 16.5px; }
  .rrow { grid-template-columns: 54px minmax(0, 1fr) auto; font-size: 15px; padding: 9px 0; }
  .catalog { grid-template-columns: repeat(4, minmax(0, 1fr)); column-gap: 6px; row-gap: 12px; }
  .catalog .side.brick, .catalog .side.flue, .catalog .side.both { grid-column: 1 / -1; }
  .catalog .side .cards { column-gap: 6px; row-gap: 6px; }
  .catalog .card .cap .s { display: none; }
  .catalog .card .cap { padding: 6px 7px 8px; }
  .catalog .card .cap .t { font-size: 12.5px; line-height: 1.2; min-height: 2.4em; }
  .catalog .card .long { display: none; }
  .catalog .card .short { display: inline; }
  /* the Pan alone in the middle row: same size as the others, centred */
  .catalog .side.both .cards { display: flex; justify-content: center; }
  .catalog .side.both .card { width: calc((100% - 18px) / 4); }
  .catalog .sidehead { margin-bottom: 7px; padding-bottom: 5px; }
  .catalog .sidehead .t { font-size: 15px; }
  .catalog .sidehead .s { font-size: 12px; }
}

/* ── short windows: keep the answers reachable ─────────────────────────────────────────── */
@media (max-height: 640px) and (min-width: 981px) {
  .q { font-size: 26px; }
  .help { font-size: 14.5px; margin-bottom: 12px; }
  .opt { padding: 10px 14px; min-height: 48px; }
  .opt.tall { min-height: 80px; }
  .card .cap .s { display: none; }
  .card .ph { aspect-ratio: 4 / 2.6; }
}
@media (max-height: 560px) and (max-width: 980px) {
  .stage, .stage.step-review { grid-template-rows: minmax(0, 1fr); }
  .show { display: none; }
}
