/* B&C McKeown — the quote calculators (calculator.html and other.html).

   Loaded after site.css, which supplies the colours, fonts, header and footer.
   Everything the calculator draws lives inside #app, and every rule here is
   scoped to it, so nothing in this file can restyle the shared header, footer,
   basket or search. app.js builds the markup; this file only dresses it. */

:root {
  --danger: #c0392b;
  --warn: #8a4b12;
  --warn-bg: #fdf3e6;
  --chrome: calc(var(--stick-top) + 16px);     /* where sticky panels sit under the header */
  color-scheme: light;
}

body { background: var(--sand); }

#app { min-height: 60vh; }
#app button, #app input, #app select, #app textarea { font: inherit; color: inherit; }
#app button { cursor: pointer; }
#app img { max-width: 100%; display: block; }

/* the same width and gutters as .shell, so the page lines up with the header */
#app .wrap, #app .calc-intro, #app .layout {
  width: 100%;
  max-width: var(--shell);
  margin: 0 auto;
  padding-inline: var(--gut);
}

#app .row-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- buttons ---------- */
#app .primary, #app .ghost, #app .nav-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--pill);
  padding: 13px 26px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: 0.015em;
  transition: background-color 200ms var(--ease), border-color 200ms var(--ease), color 200ms var(--ease),
              transform 200ms var(--ease), box-shadow 200ms var(--ease);
}
#app .primary { background: var(--forest); border: 1px solid var(--forest); color: #fff; }
#app .primary:hover { background: var(--forest-lift); border-color: var(--forest-lift); transform: translateY(-1px); box-shadow: 0 10px 22px rgba(51, 86, 26, 0.24); }
#app .primary:active { transform: none; box-shadow: none; }
#app .primary[disabled] { opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: none; }
#app .ghost, #app .nav-clear { background: #fff; border: 1px solid var(--line-strong); color: var(--ink); }
#app .ghost:hover, #app .nav-clear:hover { border-color: var(--ink); }
#app .ghost[disabled] { opacity: 0.55; cursor: not-allowed; }

#app .stepper button, #app .text-btn, #app .add-btn {
  border: 1px solid var(--line-strong);
  background: #fff;
  border-radius: var(--pill);
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  transition: border-color var(--quick) var(--ease), background-color var(--quick) var(--ease), color var(--quick) var(--ease);
}
#app .stepper button:hover, #app .text-btn:hover, #app .add-btn:hover { border-color: var(--ink); }
#app .text-btn.danger, #app .item-tools .danger { color: var(--danger); }

#app .proto-links { display: flex; flex-wrap: wrap; gap: 14px; margin: 12px 0 0; }
#app .proto-links a, #app .proto-links button {
  background: none;
  border: 0;
  padding: 0;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-size: 14px;
}
#app .editor-bar .ghost, #app .editor-bar .file-btn { color: var(--ink); border-color: var(--line-strong); background: #fff; }

/* ---------- page title ---------- */
#app .calc-intro { padding-top: clamp(28px, 4vw, 52px); padding-bottom: clamp(20px, 2.6vw, 30px); }
#app .calc-intro::before {
  content: "Quote calculator";
  display: block;
  margin-bottom: 14px;
  padding-left: 38px;
  background: linear-gradient(var(--forest), var(--forest)) left center / 26px 2px no-repeat;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--forest);
}
#app .calc-intro h1 { margin: 0 0 12px; font-size: clamp(42px, 5.8vw, 76px); line-height: 0.92; }
#app .calc-intro p { margin: 0; max-width: 62ch; color: var(--ink-soft); font-size: clamp(16.5px, 1.5vw, 19px); line-height: 1.55; }

#app .step-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

/* ---------- messages ---------- */
#app .banner, #app .note, #app .warn, #app .err, #app .ok {
  border-radius: var(--r-sm);
  padding: 12px 16px;
  margin: 0 0 14px;
  font-size: 15px;
  line-height: 1.5;
}
#app .banner, #app .note { background: var(--sand); color: var(--ink-soft); }
#app .wrap > .banner { background: #fff; box-shadow: var(--shadow); }
#app .banner strong, #app .note strong { color: var(--ink); }
#app .warn { background: var(--warn-bg); color: var(--warn); }
#app .warn a { color: inherit; font-weight: 600; }
#app .err { color: var(--danger); background: #fdf0ec; }
#app .err:empty { display: none; }
#app ul.err { padding-left: 34px; }
#app .ok { background: var(--sage-mist); color: #24400f; }
#app .howto { margin: 8px 0 18px; }
#app .howto summary { cursor: pointer; font-weight: 600; }

/* ---------- two columns: the steps list, and the step itself ---------- */
#app .layout {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  gap: 26px;
  align-items: start;
  padding-bottom: 20px;
}
#app .step-nav {
  position: sticky;
  top: var(--chrome);
  background: #fff;
  border-radius: var(--r);
  box-shadow: var(--shadow);
  padding: 12px 12px 18px;
  transition: top 420ms var(--rv-ease);
}
#app .nav-link {
  width: 100%;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: var(--r-sm);
  color: var(--ink-soft);
  font-weight: 500;
  font-size: 14.5px;
  line-height: 1.3;
  padding: 8px 10px;
  transition: background-color var(--quick) var(--ease), color var(--quick) var(--ease);
}
#app .nav-link:hover { background: var(--sand); color: var(--ink); }
#app .nav-link.is-active { background: var(--sage-mist); color: #1d330f; font-weight: 600; }
#app .nav-link > span:not(.num):not(.nav-swatches) { flex: 1; min-width: 0; }
#app .nav-link .num { width: 28px; height: 28px; flex: 0 0 28px; font-size: 15px; background: var(--sand-deep); color: var(--ink); }
#app .nav-link.is-active .num { background: var(--forest); color: #fff; }
#app .nav-swatches { display: flex; gap: 5px; width: 100%; padding-left: 40px; }
#app .nav-swatches i { width: 16px; height: 16px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, 0.18); display: block; }
#app .nav-swatches i.is-on { outline: 2px solid var(--forest); outline-offset: 1px; }
#app .nav-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin: 14px 10px 10px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
#app .nav-total span { color: var(--muted); font-size: 14px; }
#app .nav-total strong { font-family: Teko, sans-serif; font-size: 32px; font-weight: 600; line-height: 1; white-space: nowrap; }
#app .nav-save, #app .nav-reset, #app .nav-clear { display: flex; width: calc(100% - 20px); margin: 8px 10px 0; }
#app .nav-reset {
  justify-content: center;
  background: transparent;
  border: 0;
  padding: 10px 0 2px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}
#app .nav-reset:hover { color: var(--ink); }

#app .step {
  background: #fff;
  border-radius: var(--r);
  box-shadow: var(--shadow);
  margin-bottom: 22px;
  padding: clamp(22px, 3vw, 38px);
  scroll-margin-top: calc(var(--head-h) + 16px);
}
#app .step-head {
  width: 100%;
  display: flex;
  gap: 14px;
  align-items: center;
  text-align: left;
  border-bottom: 1px solid var(--line);
  padding: 0 0 18px;
  margin-bottom: 20px;
}
#app .step-head h2 { margin: 0; font-size: clamp(30px, 3vw, 40px); line-height: 0.95; }
#app .step-hint { margin: -6px 0 18px; color: var(--muted); font-size: 15px; }
#app .step-head small, #app .muted, #app .field small, #app .detail { color: var(--muted); }
#app .detail { margin: 3px 0 0; font-size: 14.5px; line-height: 1.45; }
#app .num {
  width: 38px; height: 38px; flex: 0 0 38px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--forest);
  color: #fff;
  font-family: Teko, sans-serif;
  font-weight: 600;
  font-size: 21px;
  line-height: 1;
  letter-spacing: 0.02em;
  padding-top: 2px;
}
#app .step-body { padding: 0; }
#app .step-body > h3:not(.line-section) { font-size: 22px; letter-spacing: 0.02em; margin: 26px 0 12px; }
#app .step-body > h3:not(.line-section):first-child { margin-top: 0; }
#app .step-body > p { max-width: 74ch; }
/* buttons that sit loose in a step (add to basket, download, email, export) */
#app .step-body > .primary, #app .step-body > .ghost { margin: 8px 8px 12px 0; }
#app .step-grid, #app .editor-grid { display: grid; gap: 12px; }
#app .step-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

/* ---------- options ---------- */
#app .choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
#app .choice, #app .swatch, #app .pick, #app .editor-card {
  position: relative;
  border: 1px solid var(--line-strong);
  background: #fff;
  border-radius: 14px;
  text-align: left;
  color: var(--ink);
  transition: border-color var(--quick) var(--ease), box-shadow var(--quick) var(--ease), transform var(--quick) var(--ease);
}
/* a column from the top, so the pictures line up across a row whatever the
   length of the names under them (a button centres its contents otherwise) */
#app .choice { display: flex; flex-direction: column; justify-content: flex-start; padding: 14px 16px 18px; }
/* a step whose options are not wrapped in a grid (thickness) */
#app .step-body > .choice { display: inline-flex; vertical-align: top; min-width: min(240px, 100%); margin: 0 12px 12px 0; padding-top: 18px; }
#app .choice:hover, #app .swatch:hover, #app .pick:hover, #app .editor-card:hover {
  border-color: #a9a59c;
  box-shadow: 0 6px 18px rgba(18, 20, 18, 0.08);
  transform: translateY(-2px);
}
#app .choice:active, #app .swatch:active { transform: none; }
#app .choice.is-selected, #app .swatch.is-selected, #app .pick.is-on {
  border-color: var(--forest);
  box-shadow: 0 0 0 1px var(--forest), 0 8px 22px rgba(51, 86, 26, 0.14);
}
/* a tick on the chosen option */
#app .choice.is-selected::after, #app .swatch.is-selected::after {
  content: "";
  position: absolute;
  top: 10px; right: 10px;
  z-index: 2;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--forest) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='10' viewBox='0 0 12 10' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 5.2l3.2 3.2L11 1.4'/%3E%3C/svg%3E") center no-repeat;
  box-shadow: 0 0 0 3px #fff;
}
#app .choice strong, #app .swatch strong { color: var(--ink); font-weight: 600; font-size: 16.5px; line-height: 1.3; }
#app .choice p, #app .pick p { margin: 6px 0 0; color: var(--muted); font-size: 14.5px; line-height: 1.45; }
#app .choice p strong { font-size: inherit; color: var(--out); }
#app .media, #app .ph-box {
  border-radius: 10px;
  background: var(--sand);
  display: grid;
  place-items: center;
  overflow: hidden;
}
#app .choice .media { height: 128px; margin-bottom: 12px; }
#app .media img, #app .ph-box img { width: 100%; height: 100%; object-fit: cover; }
#app .media.pattern { background: var(--sand); }
#app .media.pattern img { object-fit: contain; padding: 6px 8px; }
#app .letter { font-family: Teko, sans-serif; font-size: 34px; font-weight: 600; color: var(--forest); }
#app .diagram { width: 100%; height: auto; color: var(--ink); }
#app .choice .media .diagram { width: 100%; height: 100%; display: block; }

/* ---------- fields ---------- */
#app .field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 14px; }
#app .field span, #app .check span { font-weight: 600; font-size: 14.5px; }
#app .field small { font-size: 13.5px; line-height: 1.45; }
#app input[type="text"], #app input[type="email"], #app input[type="tel"], #app input:not([type]), #app select, #app textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  padding: 13px 15px;
  background: #fff;
  font-size: 16px;
  transition: border-color var(--quick) var(--ease), box-shadow var(--quick) var(--ease);
}
#app input:hover, #app select:hover, #app textarea:hover { border-color: #a9a59c; }
#app input:focus, #app select:focus, #app textarea:focus {
  outline: none;
  border-color: var(--forest);
  box-shadow: 0 0 0 4px rgba(51, 86, 26, 0.13);
}
#app textarea { min-height: 96px; resize: vertical; }
#app input:disabled { background: var(--sand); color: var(--muted); }
#app .field.has-error input { border-color: var(--danger); }
#app .check { display: flex; gap: 10px; align-items: flex-start; margin: 8px 0; cursor: pointer; }
#app .check input { margin-top: 4px; width: 18px; height: 18px; flex: none; accent-color: var(--forest); }

/* ---------- colours ---------- */
#app .swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
#app .swatch { width: auto; padding: 0; overflow: hidden; }
#app .swatch strong { display: block; padding: 12px 14px; font-size: 16px; }
#app .swatch small { display: block; margin: -6px 14px 14px; color: var(--muted); font-size: 12.5px; }
#app .swatch svg { width: 100%; height: 72px; display: block; }
#app .swatch .chip {
  display: block;
  width: 100%;
  height: 96px;
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.14);
}
#app .roof-colours .chip { height: 148px; }
#app .swatch img.chip { object-fit: cover; }
#app .chip.is-clear {
  background: linear-gradient(165deg, #ffffff 0%, #f7fcfe 36%, var(--swatch, #d4ebf5) 100%);
  box-shadow: inset 0 0 0 1px rgba(55, 110, 135, 0.3);
}
#app .chip.is-bronze {
  background: linear-gradient(180deg, #7d5b3a 0%, var(--swatch, #6b4f32) 38%, #5a4128 100%);
  box-shadow: inset 0 0 0 1px rgba(62, 36, 12, 0.4);
}
#app .swatch .chip-sheet {
  display: block;
  width: 100%;
  height: 148px;
  background: linear-gradient(170deg, #fbfaf6 0%, var(--sand) 100%);
  box-shadow: inset 0 -1px 0 var(--line);
}
#app .chip-art { position: relative; isolation: isolate; }
#app .chip-art img, #app .chip-art i {
  position: absolute; inset: 0; width: 100%; height: 100%;
  padding: 10px 14px; box-sizing: border-box; object-fit: contain;
}
#app .chip-art i {
  background: var(--swatch) content-box;
  -webkit-mask: var(--src) center / contain no-repeat content-box;
  mask: var(--src) center / contain no-repeat content-box;
}
#app .chip-art.is-tinted img { filter: grayscale(1); mix-blend-mode: overlay; }
#app .chip-art.is-light img { mix-blend-mode: multiply; opacity: 0.7; }
#app .roof-colours .swatch small { margin-top: -6px; }

/* ---------- extras ---------- */
#app .pick { display: grid; grid-template-columns: 84px 1fr; gap: 16px; padding: 16px; margin-bottom: 12px; }
#app .pick .media { width: 84px; height: 84px; background: #fff; }
#app .pick .media img { object-fit: contain; }
#app .pick strong { font-weight: 600; }
#app .pick > div > p:last-child { font-size: 14px; }
#app .stepper { display: flex; align-items: center; gap: 8px; margin: 12px 0 10px; }
#app .stepper input { width: 76px; text-align: center; padding: 10px 8px; border-radius: var(--pill); font-weight: 600; }
#app .stepper button { width: 40px; height: 40px; padding: 0; border-radius: 50%; font-size: 18px; line-height: 1; }
#app .preview { margin: 14px 0 0; padding-left: 20px; font-size: 15.5px; }
#app .preview li::marker { color: var(--forest); }
#app .preview-price { color: var(--ink); font-weight: 700; }
#app .continue { margin-top: 0; }

/* ---------- the materials list and totals ---------- */
#app .summary {
  position: sticky;
  top: var(--chrome);
  max-height: calc(100vh - 104px);
  overflow: auto;
  background: #fff;
  border-radius: var(--r);
  box-shadow: var(--shadow);
  padding: 20px;
  scroll-margin-top: 88px;
}
#app .summary h2 { margin: 0 0 8px; font-size: 26px; }
#app .line { display: flex; justify-content: space-between; gap: 18px; padding: 12px 0; border-top: 1px solid var(--line); font-size: 15.5px; }
#app .line strong { font-weight: 600; }
#app .line-section {
  margin: 20px 0 8px;
  font-family: Outfit, sans-serif;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--forest);
}
#app .line-price { text-align: right; white-space: nowrap; }
#app .line-price span, #app .totals span { display: block; color: var(--muted); }
#app .line-price span { font-size: 14px; }
#app .totals { margin: 6px 0 22px; padding: 16px 20px; border-radius: var(--r-sm); background: var(--sand); }
#app .totals div, #app .total-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 5px 0; font-size: 15.5px; }
#app .totals strong { font-weight: 600; }
#app .totals .total-row { margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--line-strong); font-size: 16.5px; }
#app .totals .total-row span { color: var(--ink); font-weight: 600; }
#app .totals .total-row strong { font-family: Teko, sans-serif; font-size: 36px; line-height: 1; }
#app .summary .primary, #app .summary .ghost, #app .summary .text-btn { width: 100%; margin-top: 8px; }
#app .foot { margin: 0; padding: 6px 0 44px; color: var(--muted); font-size: 14px; line-height: 1.6; max-width: 90ch; }

/* an optional bar with the running total (kept switched off, as before) */
#app .mobile-total {
  display: none;
  position: sticky;
  bottom: 0;
  z-index: 14;
  background: #fff;
  border-top: 1px solid var(--line);
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.06);
  padding: 10px 16px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
#app .mobile-total span { display: block; color: var(--muted); font-size: 13px; }
#app .mobile-total button { background: var(--forest); color: #fff; border: 0; border-radius: var(--pill); padding: 10px 16px; font-weight: 600; }

/* ---------- catalogue editor ---------- */
#app .editor-bar {
  position: sticky;
  top: var(--head-h);
  z-index: 12;
  background: rgba(246, 243, 237, 0.96);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  padding: 10px 0;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}
#app .editor-section { margin: 8px 0 22px; }
#app .editor-section h2 { margin: 0 0 8px; font-size: 28px; }
#app .editor-card { padding: 16px; margin: 10px 0; }
#app .editor-card:hover { transform: none; }
#app .editor-grid { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
#app .item-tools { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
#app .image-edit .ph-box { width: 120px; height: 90px; margin-bottom: 8px; }
#app .file-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: var(--pill);
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
#app .file-btn input { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- pop-ups (save a quote, start over) ---------- */
#app .overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 12, 10, 0.58);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  display: grid;
  place-items: center;
  z-index: 120;
  padding: 20px;
}
#app .modal { width: min(500px, 100%); background: #fff; border-radius: var(--r); padding: clamp(22px, 4vw, 32px); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4); }
#app .modal h2 { margin: 0 0 12px; font-size: 34px; }
#app .modal p { color: var(--ink-soft); }
#app .modal form + .ghost, #app .modal .ok ~ .ghost { margin-top: 10px; }
#app .fatal { padding: 40px var(--gut); }

/* ---------- wall cladding: the wall-by-wall wizard ---------- */
#app .wizard-title { margin: 8px 0 8px; font-size: 22px; color: var(--ink); }
#app .wall-choices { display: flex; flex-wrap: wrap; gap: 14px; margin: 12px 0; }
#app .wall-choice {
  width: 176px;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  padding: 10px;
  text-align: center;
  color: var(--ink);
  transition: border-color var(--quick) var(--ease), box-shadow var(--quick) var(--ease), transform var(--quick) var(--ease);
}
#app .wall-choice:hover { border-color: #a9a59c; transform: translateY(-2px); box-shadow: 0 6px 18px rgba(18, 20, 18, 0.08); }
#app .wall-choice.is-selected { border-color: var(--forest); box-shadow: 0 0 0 1px var(--forest), 0 8px 22px rgba(51, 86, 26, 0.14); background: var(--sage-mist); }
#app .wall-choice svg { width: 140px; height: 108px; display: block; margin: 0 auto 6px; }
#app .wall-choice span { display: block; font-size: 13.5px; font-weight: 600; }
#app .yes-no .wall-choice { width: 96px; }
#app .measure-layout { display: grid; grid-template-columns: minmax(260px, 340px) 1fr; gap: 20px; align-items: start; }
/* the blue and red here match the lines on the wall drawing beside them */
#app .dim-box { border-radius: var(--r-sm); padding: 14px 16px; margin-bottom: 12px; }
#app .dim-box.gable { background: #e7f4fb; color: #1e428b; }
#app .dim-box.wall { background: #fdecef; color: #b42318; }
#app .dim-box strong { display: block; letter-spacing: 0.04em; margin-bottom: 8px; }
#app .dim-box .field { margin-bottom: 10px; color: inherit; }
#app .dim-box .field:last-child { margin-bottom: 0; }
#app .dim-box .field span { color: inherit; }
#app .dim-box .field small { color: inherit; opacity: 0.78; }
#app .dim-box input { width: 100%; max-width: 240px; font-weight: 600; color: var(--ink); }
#app .dim-row { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; margin: 8px 0; }
#app .dim-row label { display: grid; gap: 4px; font-weight: 600; }
#app .dim-row input { width: 84px; font-weight: 600; color: var(--ink); }
#app .dim-row small { font-weight: 500; color: var(--muted); }
#app .house-diagram { width: 100%; max-width: 420px; height: auto; }
#app .wizard-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 18px; }
#app .wizard-nav .danger { border: 1px solid var(--danger); color: var(--danger); background: #fff; border-radius: var(--pill); padding: 12px 22px; font-size: 15px; font-weight: 600; }
#app .wall-card { border: 1px solid var(--line); border-radius: 14px; padding: 18px; margin-bottom: 14px; background: var(--sand); }
#app .wall-card h3 { letter-spacing: 0.06em; font-size: 20px; }
#app .wall-card-grid { display: grid; grid-template-columns: 150px 1fr 1fr; gap: 12px; align-items: center; }
#app .wall-card-grid svg { width: 140px; height: 108px; }
#app .opening-notes p { margin: 0 0 8px; }

/* ---------- drawings ---------- */
#app .scale-diagram {
  margin: 8px 0 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  padding: 14px 16px 12px;
}
#app .scale-diagram .diagram { max-width: 100%; }
#app .scale-diagram h3 {
  margin: 0 0 10px;
  font-family: Outfit, sans-serif;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--forest);
}
#app .scale-caption { margin: 8px 0 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
#app .roof-preview {
  margin: 10px 0 14px;
  border-radius: 14px;
  background: linear-gradient(170deg, #fbfaf6 0%, #f3efe7 62%, var(--sand-deep) 100%);
  padding: 6px 10px 4px;
  overflow: hidden;
}
#app .roof-preview .diagram { width: 100%; height: auto; display: block; }
#app .preview-caption { margin: 0 0 8px; text-align: center; font-size: 13.5px; font-weight: 600; color: var(--ink-soft); }

/* ---------- metres or feet ---------- */
#app .unit-toggle { display: flex; align-items: center; gap: 8px; margin: 0 0 16px; font-size: 14px; color: var(--muted); }
#app .unit-toggle > span { font-weight: 600; margin-right: 2px; }
#app .unit-btn {
  padding: 8px 18px;
  border: 1px solid var(--line-strong);
  border-radius: var(--pill);
  background: #fff;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-soft);
  transition: background-color var(--quick) var(--ease), border-color var(--quick) var(--ease), color var(--quick) var(--ease);
}
#app .unit-btn:hover { border-color: var(--ink); }
#app .unit-btn.is-on { background: var(--forest); border-color: var(--forest); color: #fff; }
#app .unit-note { margin-top: -4px; }

#app .slope-help { margin: 2px 0 14px; }
#app .slope-help summary { cursor: pointer; font-weight: 600; font-size: 15px; color: var(--forest); }
#app .slope-help-body { margin-top: 8px; padding: 14px 16px; border-radius: var(--r-sm); background: var(--sand); }
#app .slope-help-body .field { margin: 8px 0 0; max-width: 340px; }
#app .slope-help-body p { margin: 0; }

/* The letter beside each measurement. It turns blue while its box is in use, the
   same blue as the matching arrow on the drawing. */
#app .dim-letter {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-right: 8px;
  border: 1px solid #4a5a73;
  border-radius: 50%;
  color: #4a5a73;
  font-size: 12px;
  font-weight: 700;
  font-style: normal;
  vertical-align: -4px;
  transition: background-color var(--quick) var(--ease), color var(--quick) var(--ease), border-color var(--quick) var(--ease);
}
#app .dim-letter.is-warm { border-color: #c9682c; color: #c9682c; }
#app .field:focus-within .dim-letter { background: #1d4ed8; border-color: #1d4ed8; color: #fff; }

/* ---------- V mesh boundary ---------- */
#app .bnd-list { display: grid; gap: 10px; margin: 6px 0 16px; max-width: 560px; }
#app .bnd-row { display: flex; align-items: flex-end; gap: 12px; }
#app .bnd-row .field { flex: 1; margin: 0; }
#app .bnd-remove { margin-bottom: 4px; color: #8a5a3c; white-space: nowrap; }
#app .bnd-join { display: flex; align-items: center; gap: 8px; padding: 2px 0 2px 30px; font-size: 14px; color: var(--muted); position: relative; }
#app .bnd-join::before { content: ""; position: absolute; left: 10px; top: -8px; bottom: -8px; border-left: 1.5px dashed var(--line-strong); }
#app .bnd-join > span { font-weight: 600; margin-right: 4px; }
#app .bnd-join .unit-btn { padding: 6px 14px; }
#app .bnd-add { justify-self: start; }
#app .bnd-colours .swatch .chip-photo,
#app .bnd-colours .swatch .bnd-photos {
  display: block;
  width: 100%;
  height: 148px;
  object-fit: cover;
  background: var(--sand);
}
#app .bnd-colours .swatch .bnd-photos { display: grid; grid-template-columns: 1.4fr 1fr; gap: 3px; background: #fff; }
#app .bnd-colours .swatch .bnd-photos img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- motion ----------
   The page re-renders wholesale on every keystroke, so nothing here animates
   on mount except .step-enter, which app.js adds only when the step changes.
   Everything else is state-driven, so it cannot flicker while typing. */
@keyframes stepIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
@keyframes itemIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
#app .step-enter .step-body { animation: stepIn 260ms var(--ease) both; }
#app .step-enter .choices > *, #app .step-enter .swatches > * { animation: itemIn 300ms var(--ease) both; }
#app .step-enter .choices > *:nth-child(1), #app .step-enter .swatches > *:nth-child(1) { animation-delay: 20ms; }
#app .step-enter .choices > *:nth-child(2), #app .step-enter .swatches > *:nth-child(2) { animation-delay: 55ms; }
#app .step-enter .choices > *:nth-child(3), #app .step-enter .swatches > *:nth-child(3) { animation-delay: 90ms; }
#app .step-enter .choices > *:nth-child(4), #app .step-enter .swatches > *:nth-child(4) { animation-delay: 125ms; }
#app .step-enter .choices > *:nth-child(5), #app .step-enter .swatches > *:nth-child(5) { animation-delay: 160ms; }
#app .step-enter .choices > *:nth-child(n+6), #app .step-enter .swatches > *:nth-child(n+6) { animation-delay: 190ms; }

/* ---------- one column ---------- */
@media (max-width: 979px) {
  #app .layout { grid-template-columns: 1fr; gap: 16px; }
  #app .measure-layout, #app .wall-card-grid { grid-template-columns: 1fr; }
  #app .summary { position: static; max-height: none; }
  /* The steps list becomes a row of numbers with the total and the three
     buttons under it, so the step itself starts near the top of a phone
     instead of a full screen down. Each number keeps its name for screen
     readers. */
  #app .step-nav {
    position: static;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 6px;
    padding: 14px;
  }
  /* the numbers share one row, shrinking a little on a narrow phone */
  #app .nav-link { width: auto; flex: 1 1 0; min-width: 28px; max-width: 34px; padding: 0; gap: 0; border-radius: 50%; }
  #app .nav-link:hover, #app .nav-link.is-active { background: none; }
  #app .nav-link > span:not(.num) {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  #app .nav-link .num { width: 100%; height: auto; aspect-ratio: 1; flex: 1 1 auto; font-size: 17px; }
  #app .nav-total { flex: 1 0 100%; margin: 4px 2px 0; padding-top: 12px; }
  #app .nav-total strong { font-size: 30px; }
  #app .nav-save, #app .nav-clear { flex: 1 1 0; width: auto; margin: 0; padding-inline: 12px; }
  #app .nav-reset { flex: none; width: auto; margin: 0; padding: 10px 6px; }
}
@media (max-width: 560px) {
  /* room for "Clear basket" and "Save quote" side by side on one line each */
  #app .nav-reset { flex: 1 0 100%; padding: 6px 0 0; }
  #app .step-actions .ghost, #app .step-actions .primary { flex: 1; }
  #app .pick { grid-template-columns: 64px 1fr; gap: 12px; padding: 14px; }
  #app .pick .media { width: 64px; height: 64px; }
  #app .choices, #app .swatches { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  #app .choice { padding: 10px 12px 14px; }
  #app .choice .media { height: 92px; }
  #app .choice strong, #app .swatch strong { font-size: 15px; }
  #app .choice p { font-size: 13.5px; }
  #app .step-body > .choice { display: flex; width: 100%; margin-right: 0; }
  #app .roof-colours .chip, #app .swatch .chip-sheet { height: 112px; }
  #app .line { font-size: 15px; gap: 12px; }
  #app .step-body > .primary, #app .step-body > .ghost { width: 100%; margin-right: 0; }
}

/* ---------- print (the quote itself) ---------- */
.print-only { display: none; }
#app .quote-head { margin: 0 0 14px; padding: 0 0 10px; border-bottom: 2px solid var(--ink); }
#app .quote-head strong { font-size: 1.15rem; }
#app .quote-head p { margin: 2px 0; font-size: 13px; }

@media print {
  .print-only { display: block !important; }
  .no-print, .site-head, .site-foot, .skip-link, .cart-drawer, .search-layer,
  #app .calc-intro, #app .howto, #app .step-nav, #app .step-actions, #app .mobile-total, #app .editor-page { display: none !important; }
  body, #app .summary, #app .step { background: #fff; }
  #app .layout { display: block; width: auto; max-width: none; padding: 0; }
  #app .step { box-shadow: none; border: 1px solid #ddd; }
  #app .summary { position: static; max-height: none; overflow: visible; box-shadow: none; border: 0; }
  #app .totals { background: none; padding: 0; }
}

@media (prefers-reduced-motion: reduce) {
  #app .choice:hover, #app .swatch:hover, #app .pick:hover, #app .wall-choice:hover, #app .primary:hover { transform: none; }
}
