/* Garden room designer (demo) */
:root {
  --navy: #323F46;
  --green: #4F751F;
  --green-dark: #34511A;
  --text: #3D5159;
  --stone: #E8E6E1;
  --stone-2: #f4f3f0;
  --line: #d6d3cc;
  --white: #fff;
  --focus: #1a73e8;
  --panel-w: 440px;
  --top-h: 64px;
  --radius: 10px;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  font-family: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--text);
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--stone-2); font-size: 16px; line-height: 1.45; overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.skip { position: absolute; left: 8px; top: -60px; z-index: 50; background: var(--navy); color: #fff; padding: 10px 14px; border-radius: 6px; }
.skip:focus { top: 8px; }

/* ---------- top bar ---------- */
.topbar { height: var(--top-h); display: flex; align-items: center; gap: 20px; padding: 0 24px; background: #fff; border-bottom: 1px solid var(--line); }
.brand img { display: block; height: 40px; width: auto; }
.topbar__title { display: flex; align-items: baseline; gap: 14px; min-width: 0; }
.topbar h1 { margin: 0; font-size: 20px; font-weight: 700; color: var(--navy); letter-spacing: -0.01em; white-space: nowrap; }
.demo-badge { margin: 0; font-size: 13px; font-weight: 600; color: var(--navy); background: var(--stone); border-radius: 999px; padding: 3px 10px; white-space: nowrap; }

/* ---------- layout ---------- */
.app { display: grid; grid-template-columns: minmax(0, 1fr) var(--panel-w); height: calc(100dvh - var(--top-h)); }
.viewer { position: relative; min-width: 0; min-height: 0; background: #dfe7e9; overflow: hidden; }
.viewer__stage { position: absolute; inset: 0; }
.viewer__stage canvas { display: block; width: 100%; height: 100%; touch-action: none; outline: none; }
.viewer__loading { position: absolute; inset: 0; display: grid; place-items: center; color: var(--navy); font-weight: 600; background: linear-gradient(#cfdde6, #e3e8e6); }
.viewer__loading { z-index: 2; }
/* the placeholder kept over the first 3D frames (designer.js: reveal), then dissolved */
.viewer__cover { pointer-events: none; transition: opacity 500ms ease-out; }
.viewer__cover.is-leaving { opacity: 0; }
/* a picture of the view before a change, faded away over the changed scene (js/scene.js: crossfade) */
.viewer__fade { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; pointer-events: none; opacity: 0; }
.viewer__hint { position: absolute; left: 50%; bottom: 76px; transform: translateX(-50%); margin: 0; padding: 6px 12px; border-radius: 999px; background: rgba(28, 36, 40, 0.6); color: #fff; font-size: 13px; pointer-events: none; transition: opacity 0.3s ease-out; white-space: nowrap; }
.viewer__hint.is-hidden { opacity: 0; }
/* the controls on the view arrive with the room, not before it */
.viewer__top, .viewer__views, .viewer__ar, .viewer__zoom { transition: opacity 300ms ease-out; }
.viewer:not(.is-ready) .viewer__top, .viewer:not(.is-ready) .viewer__views, .viewer:not(.is-ready) .viewer__ar, .viewer:not(.is-ready) .viewer__zoom, .viewer:not(.is-ready) .viewer__hint { opacity: 0; visibility: hidden; pointer-events: none; }
.viewer__zoom { position: absolute; right: 16px; bottom: 74px; display: flex; flex-direction: column-reverse; gap: 6px; }
.viewer__zoom .chip--zoom { width: 44px; padding: 0 0 3px; font-size: 26px; line-height: 1; font-weight: 400; }
.viewer__top { position: absolute; top: 16px; right: 16px; display: flex; gap: 8px; align-items: center; }
/* left+right (not left:50% + translate): an absolute box with left:50% only gets half the width to lay out in, so the chips wrapped and covered the hint */
.viewer__views { position: absolute; left: 12px; right: 12px; bottom: 18px; display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; pointer-events: none; }
.viewer__views .chip { pointer-events: auto; }

.chip, .seg__btn { min-height: 44px; padding: 0 16px; border-radius: 999px; border: 0; cursor: pointer; font-weight: 600; font-size: 14px; }
.chip, .seg__btn, .choice { transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, box-shadow 160ms ease, transform 160ms var(--ease-out); }
.chip:active, .choice:active, .btn:active, .specbar__share:active { transform: scale(0.97); }
/* the hairline keeps the dark controls readable against the night garden */
.chip--dark { background: rgba(28, 36, 40, 0.72); color: #fff; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18); }
.chip--dark[aria-pressed="true"] { background: #fff; color: var(--navy); box-shadow: none; }
/* AR: "See it in your garden" (added by designer.js only where the device can do AR) */
/* keep clear of the Morning/Night + Roof off controls on the right (about 300px wide) */
.viewer__ar { position: absolute; top: 16px; left: 16px; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; max-width: calc(100% - 340px); pointer-events: none; }
.viewer__ar > * { pointer-events: auto; }
.chip--ar { display: inline-flex; align-items: center; gap: 8px; }
.chip--ar[aria-busy="true"] { cursor: progress; opacity: 0.85; }
.chip__icon { flex: none; }
.ar-note { margin: 0; padding: 6px 12px; border-radius: 14px; line-height: 1.35; background: rgba(28, 36, 40, 0.55); color: #fff; font-size: 13px; }
.ar-status { margin: 0; padding: 6px 12px; border-radius: 12px; background: rgba(28, 36, 40, 0.72); color: #fff; font-size: 13px; max-width: 320px; }
.ar-status:empty { display: none; }
.ar-overlay { position: fixed; inset: 0; z-index: 50; pointer-events: none; font-family: inherit; }
.ar-overlay__exit { position: absolute; top: max(16px, env(safe-area-inset-top)); right: 16px; pointer-events: auto; }
.ar-overlay__msg { position: absolute; left: 16px; right: 16px; bottom: max(24px, env(safe-area-inset-bottom)); margin: 0 auto; max-width: 360px; padding: 10px 14px; border-radius: 14px; background: rgba(28, 36, 40, 0.72); color: #fff; font-size: 15px; text-align: center; }
/* Morning / Night: two equal halves and a white thumb that slides to the one in use (designer.js adds .is-night) */
.seg { position: relative; display: inline-grid; grid-template-columns: 1fr 1fr; padding: 3px; border-radius: 999px; }
.seg--dark { background: rgba(28, 36, 40, 0.72); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18); }
.seg::before { content: ""; position: absolute; top: 3px; bottom: 3px; left: 3px; width: calc(50% - 3px); border-radius: 999px; background: #fff; transition: transform 240ms var(--ease-out); }
.seg.is-night::before { transform: translateX(100%); }
.seg__btn { position: relative; background: transparent; color: #fff; min-height: 44px; transition: color 200ms ease; }
.seg__btn[aria-pressed="true"] { color: var(--navy); }

/* ---------- panel ---------- */
.panel { background: #fff; border-left: 1px solid var(--line); overflow-y: auto; overscroll-behavior: contain; min-height: 0; }
.progress { position: sticky; top: 0; z-index: 2; background: #fff; border-bottom: 1px solid var(--line); padding: 12px 16px; }
.progress ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.progress__btn { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 4px; background: none; border: 0; padding: 4px 0; cursor: pointer; color: var(--text); }
.progress__num { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 700; background: var(--stone); color: var(--navy); transition: background-color 200ms ease, color 200ms ease; }
.progress__now { display: none; }
.progress__label { font-size: 11.5px; line-height: 1.15; text-align: center; font-weight: 500; }
.progress__btn.is-done .progress__num { background: #dfe8d3; color: var(--green-dark); }
.progress__btn.is-current .progress__num { background: var(--green); color: #fff; }
.progress__btn.is-current .progress__label { color: var(--navy); font-weight: 700; }

.step { border-bottom: 1px solid var(--line); scroll-margin-top: 92px; }
.step__head { margin: 0; }
.step__toggle { width: 100%; display: flex; align-items: center; gap: 12px; padding: 16px 20px; min-height: 60px; background: #fff; border: 0; cursor: pointer; text-align: left; color: var(--navy); font-size: 17px; font-weight: 700; }
.step__num { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 14px; background: var(--navy); color: #fff; flex: none; }
.step__title { flex: 1; }
.step__chev { width: 10px; height: 10px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); transition: transform 0.2s; margin-right: 4px; }
.step.is-open .step__chev { transform: rotate(-135deg); }
.step__body { padding: 4px 20px 22px; }
.step.is-open .step__body { animation: step-in 240ms var(--ease-out); }
@keyframes step-in { from { opacity: 0; transform: translateY(6px); } }
.step__nav { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }

.ctl { border: 0; margin: 0; padding: 12px 0; min-width: 0; }
.ctl + .ctl { border-top: 1px solid #eeece8; }
.ctl__label { display: block; font-weight: 600; color: var(--navy); font-size: 15px; padding: 0; margin-bottom: 8px; }
.ctl__row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ctl__row .ctl__label { margin-bottom: 0; }
.ctl--sub { padding: 6px 0 4px; }
.ctl--sub .ctl__label { font-weight: 500; font-size: 14px; color: var(--text); margin-bottom: 6px; }
.wallctl > .ctl__label { margin-bottom: 2px; }
.hint { margin: 6px 0 0; font-size: 13.5px; color: #5b6b71; }
.readout { font-variant-numeric: tabular-nums; margin: 0; padding: 10px 12px; background: var(--stone-2); border-radius: 8px; font-weight: 600; color: var(--navy); font-size: 14.5px; }

.num-wrap { display: inline-flex; align-items: center; gap: 6px; }
.num { font-variant-numeric: tabular-nums; width: 76px; min-height: 44px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; text-align: right; font-weight: 600; color: var(--navy); background: #fff; }
.unit { font-size: 14px; color: #5b6b71; }

input[type="range"] { --fill: 50%; -webkit-appearance: none; appearance: none; width: 100%; height: 44px; background: transparent; margin: 4px 0 0; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: linear-gradient(to right, var(--green) var(--fill), #dcd9d2 var(--fill)); }
input[type="range"]::-moz-range-track { height: 6px; border-radius: 3px; background: #dcd9d2; }
input[type="range"]::-moz-range-progress { height: 6px; border-radius: 3px; background: var(--green); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; margin-top: -10px; border-radius: 50%; background: #fff; border: 2px solid var(--green); box-shadow: 0 1px 4px rgba(0,0,0,0.2); }
input[type="range"]::-moz-range-thumb { width: 24px; height: 24px; border-radius: 50%; background: #fff; border: 2px solid var(--green); }
input[type="range"]::-webkit-slider-thumb { transition: box-shadow 160ms ease; }
input[type="range"]:active::-webkit-slider-thumb { box-shadow: 0 1px 4px rgba(0,0,0,0.2), 0 0 0 8px rgba(79, 117, 31, 0.16); }
input[type="range"]:active::-moz-range-thumb { box-shadow: 0 0 0 8px rgba(79, 117, 31, 0.16); }
input[type="range"]:focus-visible { outline-offset: -2px; }

.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choice { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 14px; border: 1.5px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; font-size: 14.5px; font-weight: 500; color: var(--text); user-select: none; }
input.vh:checked + .choice { border-color: var(--green); background: #f1f6ea; color: var(--navy); font-weight: 700; box-shadow: inset 0 0 0 1px var(--green); }
input.vh:focus-visible + .choice { outline: 3px solid var(--focus); outline-offset: 2px; }
/* options with a picture: the material or shape leads, the name sits under it */
.choice--pic { position: relative; flex-direction: column; justify-content: flex-start; gap: 6px; padding: 8px 8px 7px; text-align: center; font-size: 13.5px; line-height: 1.2; }
.choices--pic .choice--pic { flex: 1 1 0; min-width: 76px; max-width: 112px; }
.choice--roof, .choice--door { padding-top: 10px; }
.choice--pic .pic { display: block; color: var(--navy); }
.tile { display: block; width: 100%; max-width: 72px; aspect-ratio: 1; border-radius: 6px; background-color: #b79a7c; background-size: 100% 100%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.14); position: relative; overflow: hidden; }
.tile--timber { background-image: url("textures/cladding-timber-512.webp"); }
.tile--composite { background-color: #a9a5a2; background-image: url("textures/cladding-composite-grey-512.webp"); background-size: 150% 150%; }
.tile--charred { background-color: #2b2a29; background-image: url("textures/cladding-charred-512.webp"); }
.tile--mixed { background-image: url("textures/cladding-timber-512.webp"); }
.tile--mixed::after { content: ""; position: absolute; inset: 0 0 0 56%; background: #2b2a29 url("textures/cladding-charred-512.webp") 100% 0 / auto 100%; box-shadow: -1px 0 0 rgba(0, 0, 0, 0.35); }
input.vh:checked + .choice--pic::after { content: ""; position: absolute; top: 4px; right: 4px; width: 18px; height: 18px; border-radius: 50%; background: var(--green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath d='M5 9.3l2.7 2.7L13 6.4' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 18px no-repeat; box-shadow: 0 0 0 2px #fff; }
.ctl--swatch .choice { padding: 5px 14px 5px 6px; gap: 10px; }
.swatch { width: 36px; height: 36px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.22), 0 0 0 2px #fff, 0 0 0 3px var(--line); flex: none; transition: box-shadow 160ms ease; }
input.vh:checked + .choice .swatch { box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.22), 0 0 0 2px #fff, 0 0 0 4px var(--green); }
.swatch--anthracite { background: #383e42; }
.swatch--black { background: #17181a; }
.swatch--white { background: #efefeb; }
.swatch--oak { background: linear-gradient(100deg, #a77b4f, #c79a68 40%, #946a40 70%, #b88a5a); }

.ctl--toggle { display: flex; flex-wrap: wrap; }
.ctl--toggle .hint { flex-basis: 100%; }
.switch__input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch { display: flex; align-items: center; gap: 12px; min-height: 44px; cursor: pointer; font-weight: 500; font-size: 15px; color: var(--navy); }
.switch__track { width: 46px; height: 28px; border-radius: 999px; background: #cfccc5; position: relative; flex: none; transition: background 0.2s; }
.switch__track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.25); transition: transform 0.2s; }
.switch__input:checked + .switch .switch__track { background: var(--green); }
.switch__input:checked + .switch .switch__track::after { transform: translateX(18px); }
.switch__input:focus-visible + .switch .switch__track { outline: 3px solid var(--focus); outline-offset: 2px; }

.planning { margin-top: 10px; padding: 12px 14px; border-radius: 8px; background: #fff8e6; border: 1px solid #ecd9a6; font-size: 14px; color: #4a4330; }
.planning p { margin: 0 0 6px; }
.planning p:last-child { margin-bottom: 0; }
.planning__title { font-weight: 700; color: #4a3d14; }
.planning a { color: #3d5a13; font-weight: 600; }

.btn { min-height: 48px; padding: 0 20px; border-radius: 8px; border: 0; cursor: pointer; font-weight: 700; font-size: 15.5px; }
.btn--primary { background: var(--green); color: #fff; }
.btn { transition: background-color 160ms ease, transform 160ms var(--ease-out); }
.btn--ghost { background: #fff; color: var(--navy); border: 1.5px solid var(--navy); }
/* hover only where there is a pointer that hovers: on touch screens it would stick after a tap */
@media (hover: hover) and (pointer: fine) {
  .chip--dark:hover { background: rgba(28, 36, 40, 0.88); }
  .chip--dark[aria-pressed="true"]:hover { background: #fff; }
  .step__toggle:hover { background: var(--stone-2); }
  .choice:hover { border-color: #a9b3a0; }
  .btn--primary:hover { background: var(--green-dark); }
  .btn--ghost:hover { background: var(--stone-2); }
  .specbar__share:hover { background: var(--stone-2); }
  .summary__edit:hover { text-decoration: underline; }
}
.btn--block { width: 100%; margin-top: 10px; }

.summary__intro { margin: 8px 0 12px; font-size: 14.5px; }
.summary__list { margin: 0 0 8px; display: grid; grid-template-columns: 118px 1fr; gap: 0; border-top: 1px solid #eeece8; }
.summary__list dt, .summary__list dd { margin: 0; padding: 9px 0; border-bottom: 1px solid #eeece8; font-size: 14.5px; }
.summary__list dd { font-variant-numeric: tabular-nums; display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
/* each line can be changed: the button jumps to its step (the word is drawn here, the name is on the button) */
.summary__edit { flex: none; margin: -11px -6px -11px 0; min-width: 44px; min-height: 44px; padding: 0 6px; border: 0; background: none; color: #3d5a13; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.summary__edit::after { content: "Edit"; }
.summary__list dt { font-weight: 700; color: var(--navy); padding-right: 10px; }
.copy-status { font-size: 14px; margin: 8px 0 0; word-break: break-all; }

/* ---------- spec bar: the design so far, the next action and Share, always in view ---------- */
.specbar { position: sticky; bottom: 0; z-index: 3; display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 8px 10px; align-items: center; padding: 9px 16px 12px; background: #fff; border-top: 1px solid var(--line); box-shadow: 0 -8px 18px rgba(50, 63, 70, 0.07); }
.specbar__text { grid-column: 1 / -1; position: relative; min-width: 0; }
.specbar__spec { margin: 0; display: flex; align-items: baseline; gap: 0; font-size: 13.5px; line-height: 1.35; color: #5b6b71; font-variant-numeric: tabular-nums; white-space: nowrap; transition: opacity 160ms ease; }
.specbar__size { flex: none; font-weight: 700; color: var(--navy); }
.specbar__rest { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.specbar__rest span::before { content: " · "; white-space: pre; }
.specbar__said { position: absolute; inset: 0; margin: 0; display: flex; align-items: center; font-size: 13.5px; font-weight: 700; color: var(--green-dark); opacity: 0; transition: opacity 160ms ease; pointer-events: none; }
.specbar.is-said .specbar__said { opacity: 1; }
.specbar.is-said .specbar__spec { opacity: 0; }
.specbar__share { width: 44px; height: 44px; display: grid; place-items: center; padding: 0; border: 1.5px solid var(--line); border-radius: 8px; background: #fff; color: var(--navy); cursor: pointer; transition: background-color 160ms ease, transform 160ms var(--ease-out); }
.specbar .specbar__next { min-height: 44px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- enquiry dialog ---------- */
.enquiry { width: min(520px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); overscroll-behavior: contain; border: 0; border-radius: 14px; padding: 0; box-shadow: 0 20px 60px rgba(0,0,0,0.3); color: var(--text); }
.enquiry::backdrop { background: rgba(20, 28, 32, 0.55); }
.enquiry form { padding: 22px 24px 24px; }
.enquiry[open] { animation: dlg-in 240ms var(--ease-out); }
.enquiry[open]::backdrop { animation: dlg-fade 200ms ease-out; }
@keyframes dlg-in { from { opacity: 0; transform: translateY(12px) scale(0.98); } }
@keyframes dlg-fade { from { opacity: 0; } }
@keyframes sheet-in { from { transform: translateY(100%); } }
@keyframes tick-in { from { opacity: 0; transform: scale(0.6); } }
.enquiry__head { display: flex; justify-content: space-between; align-items: center; }
.enquiry h2 { flex: 1; margin: 0; color: var(--navy); font-size: 22px; }
.enquiry__tick { display: none; flex: none; margin-right: 10px; line-height: 0; color: var(--green); }
.enquiry.is-sent .enquiry__tick { display: block; animation: tick-in 320ms cubic-bezier(0.34, 1.56, 0.64, 1); }
/* a picture of the design, taken from the 3D view as the dialog opens */
.enquiry__shot { margin: 12px 0 2px; aspect-ratio: 2.2; border-radius: 10px; overflow: hidden; background: var(--stone-2); }
.enquiry__shot canvas { display: block; width: 100%; height: 100%; }
.enquiry__sent { margin-top: 6px; }
.enquiry__visit { display: block; margin-top: 12px; min-height: 44px; line-height: 44px; text-align: center; color: #3d5a13; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.enquiry__close { width: 44px; height: 44px; border: 0; background: var(--stone-2); border-radius: 50%; font-size: 24px; cursor: pointer; }
.enquiry__intro { margin: 6px 0 14px; font-size: 14.5px; }
.field { margin-bottom: 10px; }
.field label { display: block; font-weight: 600; color: var(--navy); font-size: 14.5px; margin-bottom: 4px; }
.field input { width: 100%; min-height: 46px; padding: 8px 12px; border: 1.5px solid var(--line); border-radius: 8px; background: #fff; }
.field input[aria-invalid="true"] { border-color: #b3261e; }
.field__error { margin: 4px 0 0; color: #b3261e; font-size: 13.5px; min-height: 0; }
.field__error:empty { margin: 0; } /* stays rendered (zero height) so its aria-live region exists before a message arrives */
.enquiry__design { margin: 2px 0 0; font-size: 14px; }
.enquiry__design summary { cursor: pointer; font-weight: 600; color: var(--navy); min-height: 44px; padding-block: 12px; } /* 44px tap target, marker kept (display stays list-item) */
.enquiry__design pre { white-space: pre-wrap; font: inherit; font-size: 13px; background: var(--stone-2); padding: 10px; border-radius: 8px; margin: 6px 0 0; }
.enquiry__done { margin: 12px 0 0; font-weight: 700; color: var(--green-dark); }
.enquiry.is-sent .enquiry__done { font-weight: 500; font-size: 16px; color: var(--text); }
.enquiry__done:empty { display: none; }
.enquiry__done.is-error { color: #b23b3b; }

/* ---------- tablet ---------- */
@media (max-width: 1100px) { :root { --panel-w: 380px; } }

/* ---------- phones, upright or sideways: part of the page, one question at a time ----------
   Same query as PHONE_MQ in designer.js. The designer is a section of the page and the page scrolls as any other:
   the 3D view sticks to the top of the screen (at most about 42% of its height), the step row (five numbered dots,
   the step's name and "2 of 5", which opens the list of steps) sticks under it, the question follows, and the bar
   with Back, the design so far, Share and Next sticks to the foot of the screen. All of them let go at the end of
   the designer, so the page carries on to the text and the footer. Only the 3D view takes a finger for itself
   (one finger turns, two zoom); a finger anywhere else scrolls the page. */
/* not used on desktop */
.specbar__back, .viewer__view, .stepmenu, .planning__more, .summary__more, .planning__short, .stepper, .presets { display: none; }
@media (max-width: 899px) {
  :root { --top-h: 52px; }
  .topbar { padding: 0 12px; gap: 10px; }
  .brand img { height: 30px; }
  .topbar__title { flex-direction: column; gap: 0; align-items: flex-start; }
  .topbar h1 { font-size: 15px; }
  .demo-badge { font-size: 11px; padding: 1px 8px; }
}
@media (max-width: 899px), (max-height: 500px) and (pointer: coarse) {
  /* the room's height: fixed against the small viewport (svh), so Safari's bars sliding away while the page
     scrolls never resize the 3D view; the step row's and the bar's heights for the question below */
  :root { --view-h: 42vh; --view-h: clamp(210px, 42svh, 460px); --prog-h: 49px; --bar-h: 66px; }
  html, body { height: auto; }
  body { overflow: visible; }
  .app { display: block; height: auto; }
  .viewer { position: sticky; top: 0; z-index: 5; height: var(--view-h); -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
  /* quick taps on Next must never read as a double-tap (the browser would zoom); panning the page stays free */
  .app, .enquiry { touch-action: manipulation; }
  .viewer__stage canvas { touch-action: none; }
  button, label, .choice { -webkit-tap-highlight-color: transparent; }
  /* the controls on the view: one row at the top, the view button at the foot (right). Only the buttons
     themselves catch a finger: a drag that starts between them turns the room. */
  .viewer__top { top: 8px; right: 8px; left: 8px; gap: 6px; justify-content: space-between; pointer-events: none; }
  .viewer__top > * { pointer-events: auto; }
  .chip--dark.is-on { background: #fff; color: var(--navy); box-shadow: none; }
  .viewer__top .chip, .viewer__top .seg__btn { padding: 0 11px; font-size: 13px; }
  .viewer__zoom { display: none; }
  /* "In your garden" (AR): the foot of the view, at the left, opposite the view button */
  .viewer__ar { top: auto; bottom: 8px; left: 8px; max-width: calc(100% - 120px); }
  .viewer__ar .ar-status { position: absolute; bottom: calc(100% + 6px); left: 0; width: max-content; max-width: min(320px, calc(100vw - 32px)); }
  .chip--ar { min-height: 44px; padding: 0 14px 0 11px; font-size: 13px; }
  .viewer__top .chip, .viewer__top .seg__btn, .chip--ar, .chip--view { white-space: nowrap; }
  .viewer__hint { bottom: 62px; font-size: 12px; }
  /* a very short view (the cookie notice is up): the hint would sit on the top row */
  .viewer { container-type: size; }
  @container (max-height: 200px) { .viewer__hint { display: none; } }
  .viewer__view { display: block; position: absolute; right: 8px; bottom: 8px; transition: opacity 300ms ease-out; pointer-events: none; }
  .viewer__view > * { pointer-events: auto; }
  .viewer:not(.is-ready) .viewer__view { opacity: 0; visibility: hidden; pointer-events: none; }
  .chip--view { display: inline-flex; align-items: center; gap: 6px; min-width: 44px; padding: 0 14px 0 11px; font-size: 13px; }
  /* the six views: a small menu over the room, opened by the view button */
  .viewer__views { display: none; }
  .viewer.is-views .viewer__views { display: grid; grid-template-columns: repeat(3, 64px); gap: 6px; left: auto; right: 8px; bottom: 60px; padding: 6px; border-radius: 16px; background: rgba(28, 36, 40, 0.8); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25); pointer-events: auto; animation: menu-in 160ms var(--ease-out); transform-origin: 100% 100%; }
  .viewer__views .chip { min-height: 48px; padding: 0 6px; font-size: 13.5px; background: rgba(255, 255, 255, 0.08); box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .viewer__views .chip[aria-pressed="true"] { background: #fff; color: var(--navy); }
  .chip--view[aria-expanded="true"] { background: #fff; color: var(--navy); box-shadow: none; }

  /* the panel under the view: step row, one question, the bar */
  .panel { display: block; min-height: 0; overflow: visible; border: 0; }
  .progress { position: sticky; top: var(--view-h); z-index: 6; display: flex; align-items: center; gap: 2px; min-height: 48px; padding: 2px 6px 0 4px; border-top: 1px solid var(--line); border-bottom: 1px solid #eeece8; }
  .progress ol { display: flex; gap: 0; flex: none; }
  .progress__btn { width: 44px; min-height: 44px; justify-content: center; padding: 0; }
  .progress__num { width: 26px; height: 26px; font-size: 12.5px; }
  .progress__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .progress__now { display: flex; align-items: center; justify-content: space-between; gap: 6px; flex: 1; min-width: 0; min-height: 44px; margin: 0; padding: 0 6px 0 8px; border: 0; border-radius: 8px; background: none; color: var(--navy); cursor: pointer; text-align: left; }
  .progress__text { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
  .progress__name { font-size: 14.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .progress__count { font-size: 12.5px; color: #5b6b71; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .progress__now svg { flex: none; transition: transform 160ms var(--ease-out); }
  .progress__now[aria-expanded="true"] svg { transform: rotate(180deg); }
  .progress__now:active { background: var(--stone-2); }
  /* the list of steps: opens upwards, over the room */
  .stepmenu { display: block; position: absolute; z-index: 8; left: 8px; right: 8px; bottom: calc(100% + 6px); padding: 6px; border-radius: 14px; background: #fff; box-shadow: 0 10px 30px rgba(28, 36, 40, 0.28), 0 0 0 1px rgba(28, 36, 40, 0.08); animation: menu-in 160ms var(--ease-out); transform-origin: 50% 100%; }
  .progress .stepmenu__list { display: block; list-style: none; margin: 0; padding: 0; }
  .stepmenu__item, .stepmenu__more { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; padding: 0 10px; border: 0; border-radius: 10px; background: none; color: var(--navy); font-size: 15.5px; font-weight: 600; text-align: left; cursor: pointer; }
  .stepmenu__item:active, .stepmenu__more:active { background: var(--stone-2); }
  .stepmenu__num { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; flex: none; font-size: 12.5px; font-weight: 700; background: var(--stone); }
  .stepmenu__item.is-done .stepmenu__num { background: #dfe8d3; color: var(--green-dark); }
  .stepmenu__item.is-current { background: #f1f6ea; }
  .stepmenu__item.is-current .stepmenu__num { background: var(--green); color: #fff; }
  .stepmenu__more { margin-top: 4px; border-top: 1px solid #eeece8; border-radius: 0 0 10px 10px; color: #3d5a13; font-weight: 600; }

  /* one question: the open step's current question (designer.js marks it .is-q). It is at least the rest of the
     screen tall, so the bar stays at the foot of the screen whatever the question; a long one (the summary)
     simply makes the page longer. */
  #steps { --q-min: calc(100vh - 42vh - var(--prog-h) - var(--bar-h)); --q-min: calc(100svh - var(--view-h) - var(--prog-h) - var(--bar-h) - var(--ggr-cookie-bar-h, 0px)); min-height: max(150px, var(--q-min)); background: #fff; padding-bottom: 12px; }
  .step { border: 0; scroll-margin-top: 0; }
  .step:not(.is-open), .step__head, .step__nav { display: none; }
  .step__body { padding: 4px 16px 4px; }
  .step.is-open .step__body { animation: none; }
  .step__body [data-q]:not(.is-q) { display: none; }
  .ctl + .ctl { border-top: 0; }
  .step__body .ctl { padding: 4px 0; }
  .step__body .ctl--toggle { padding: 2px 0; }
  /* the question's own name leads the card */
  .step__body .is-q-lead:not(.ctl--sub) > .ctl__label, .step__body .is-q-lead > .ctl__row .ctl__label, .wallctl.is-q > .ctl__label { font-size: 17px; font-weight: 700; color: var(--navy); margin-bottom: 8px; }
  .step__body .is-q-lead > .ctl__row .ctl__label { margin-bottom: 0; }
  .wallctl > .ctl__label { margin-bottom: 4px; }
  .wallctl__num > .ctl__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  /* a follow-on choice (which side, which direction, what style): its name above its options */
  .step__body .ctl--choice.is-q:not(.is-q-lead) > .ctl__label, .step__body .ctl--sub:not(.wallctl__num) > .ctl__label { margin: 6px 0 6px; font-size: 15px; font-weight: 600; line-height: 1.25; color: var(--navy); }
  .ctl--sub { padding: 2px 0 4px; }
  .hint { font-size: 13px; margin-top: 2px; }
  /* the pictures say what each roof shape is */
  .choices--pic ~ .hint { display: none; }
  /* (frames: anthracite, the standard, is already chosen and named; colours are confirmed at the design visit, as the summary says) */
  .ctl--swatch[data-q="frame"] .hint { display: none; }
  .readout { padding: 2px 0; background: none; font-size: 13.5px; font-weight: 600; }
  input[type="range"] { height: 44px; margin: 0; }
  /* big targets: options are tiles across the width (52px high), the chosen one green with a tick */
  .choice, .switch { min-height: 52px; }
  .step__body .choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; }
  .step__body .choices--pic { grid-template-columns: repeat(auto-fit, minmax(72px, 1fr)); }
  .step__body .choice { position: relative; justify-content: center; text-align: center; padding: 8px 10px; font-size: 15px; line-height: 1.2; }
  .step__body .ctl--swatch .choice { justify-content: flex-start; text-align: left; }
  .step__body input.vh:checked + .choice { border-width: 2px; }
  .step__body input.vh:checked + .choice:not(.choice--pic)::after { content: ""; position: absolute; top: -7px; right: -7px; width: 20px; height: 20px; border-radius: 50%; background: var(--green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath d='M5 9.3l2.7 2.7L13 6.4' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 20px no-repeat; box-shadow: 0 0 0 2px #fff; }
  .choices--pic .choice--pic { min-width: 0; max-width: none; }
  .switch { width: 100%; }

  /* steppers (sizes and counts) and the common sizes, instead of sliders and number boxes */
  .ctl--range input[type="range"], .ctl--range .num-wrap, .wallctl__num .choices { display: none; }
  .stepper { display: grid; grid-template-columns: 56px minmax(0, 1fr) 56px; gap: 10px; align-items: stretch; margin-top: 8px; }
  .stepper__btn { display: grid; place-items: center; min-height: 52px; padding: 0; border: 1.5px solid var(--green); border-radius: 12px; background: #fff; color: var(--green-dark); font-size: 30px; font-weight: 500; line-height: 1; cursor: pointer; touch-action: manipulation; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; transition: background-color 120ms ease, transform 120ms var(--ease-out), opacity 160ms ease; }
  .stepper__btn:active, .stepper__btn.is-held { background: #e6efdb; transform: scale(0.96); }
  .stepper__btn[aria-disabled="true"] { border-color: var(--line); color: #a5adb0; background: var(--stone-2); cursor: default; transform: none; }
  .stepper__box { display: flex; align-items: center; justify-content: center; gap: 4px; min-height: 52px; border-radius: 12px; background: var(--stone-2); }
  .stepper__val { width: 2.9em; min-width: 0; padding: 6px 2px; border: 0; border-radius: 8px; background: transparent; text-align: right; font-size: 22px; font-weight: 700; color: var(--navy); font-variant-numeric: tabular-nums; }
  .stepper__val:focus { background: #fff; outline: 2px solid var(--green); outline-offset: 0; }
  .stepper--count .stepper__val, .stepper__box > .stepper__val:only-child { width: 2.4em; text-align: center; }
  .stepper__unit { font-size: 17px; font-weight: 600; color: #5b6b71; }
  .ctl--range { padding: 6px 0 8px; }
  .wallctl__num .stepper { margin-top: 2px; }
  .presets { display: block; padding: 2px 0 8px; }
  .presets__label { margin: 0 0 6px; font-size: 14px; font-weight: 600; color: #5b6b71; }
  .presets__row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
  .presets__btn { min-height: 48px; padding: 0 2px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; color: var(--navy); font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; cursor: pointer; touch-action: manipulation; transition: background-color 120ms ease, border-color 120ms ease, transform 120ms var(--ease-out); }
  .presets__btn:active { transform: scale(0.96); }
  .presets__btn[aria-pressed="true"] { border: 2px solid var(--green); background: #f1f6ea; font-weight: 700; }
  .tile { max-width: 56px; }
  .ctl--swatch .choices { display: grid; grid-template-columns: 1fr 1fr; }
  .ctl--swatch .choice { line-height: 1.2; }
  .swatch { width: 32px; height: 32px; }
  .summary__intro { margin-top: 4px; }
  .summary__list { grid-template-columns: 100px 1fr; }
  .summary__more { display: block; width: 100%; min-height: 48px; margin-top: 6px; border: 0; background: none; color: #3d5a13; font-weight: 600; font-size: 15px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
  .planning { margin-top: 4px; padding: 0 10px; font-size: 13.5px; }
  .planning.is-open { padding-bottom: 8px; }
  .planning:not(.is-open) p:not(.planning__title) { display: none; }
  .planning__title { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 !important; }
  .planning__more { display: inline-block; flex: none; min-height: 44px; margin: -10px -6px; padding: 0 6px; border: 0; background: none; color: #3d5a13; font-size: 13.5px; font-weight: 700; text-decoration: underline; cursor: pointer; }
  .planning--summary .planning__more { display: none; }
  .planning__long { display: none; }
  .planning__short { display: inline; }
  .planning--summary .planning__long { display: inline; }
  .planning--summary .planning__short { display: none; }
  .readout__height { display: none; }
  .planning--summary p:not(.planning__title) { display: block; }

  /* the bar: Back, the design so far, Share, Next */
  .specbar { position: sticky; bottom: var(--ggr-cookie-bar-h, 0px); z-index: 4; grid-template-columns: 48px minmax(0, 1fr) 44px auto; gap: 8px; padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); box-shadow: 0 -6px 16px rgba(50, 63, 70, 0.06); }
  .specbar__back { display: grid; place-items: center; width: 48px; height: 48px; padding: 0; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; color: var(--navy); cursor: pointer; transition: opacity 160ms ease, transform 160ms var(--ease-out); }
  .specbar__back:active { transform: scale(0.97); }
  .specbar__back:disabled { opacity: 0.35; cursor: default; }
  .specbar__text { grid-column: auto; }
  .specbar__spec { flex-direction: column; align-items: stretch; font-size: 12.5px; }
  .specbar__size { font-size: 14.5px; }
  .specbar__rest span:first-child::before { content: none; }
  .specbar__share { width: 44px; height: 48px; }
  .specbar .specbar__next { min-height: 48px; padding: 0 22px; font-size: 16px; }
  .specbar__title { display: none; }
  /* the last step: the summary has the design, so the bar is just Back, Share and Send */
  .panel:has(#step-summary.is-open) .specbar__spec { visibility: hidden; }
}
/* sideways: the room on the left, the questions on the right */
@media (max-width: 899px) and (orientation: landscape) and (max-height: 500px), (max-height: 500px) and (pointer: coarse) and (orientation: landscape) {
  :root { --view-h: 100vh; --view-h: 100svh; }
  .app { display: grid; grid-template-columns: minmax(0, 1fr) min(380px, 48%); align-items: start; }
  .viewer { top: 0; }
  .panel { border-top: 0; border-left: 1px solid var(--line); }
  .progress { top: 0; }
  #steps { --q-min: calc(100svh - var(--prog-h) - var(--bar-h)); }
  .specbar__text { display: none; }
  .specbar { grid-template-columns: 48px 44px minmax(0, 1fr); }
  /* the list of steps opens over the room, beside the panel (there is no room under the step row) */
  .stepmenu { top: 4px; bottom: auto; left: auto; right: calc(100% + 8px); width: 300px; max-height: calc(100dvh - var(--dgr-above, 65px) - 16px); overflow-y: auto; transform-origin: 100% 0; }
  /* the sheet: a smaller picture, so the form starts on the first screen */
  .enquiry__shot { width: calc(28dvh * 2.2); max-width: 100%; margin-inline: auto; }
}
@keyframes menu-in { from { opacity: 0; transform: scale(0.96); } }
@media (max-width: 899px), (pointer: coarse) {
  /* touch tablets: the AR button rides in the top row (designer.js moves it there) */
  .viewer__top .viewer__ar { position: static; max-width: none; flex-direction: row; }
  .viewer__top .ar-status { position: absolute; top: calc(100% + 6px); left: 0; }
}
@media (max-width: 899px), (max-height: 500px) and (pointer: coarse) {
  /* enquiry: a sheet that rises from the foot of the screen */
  .enquiry { margin: auto 0 0; width: 100%; max-width: none; max-height: calc(100dvh - 28px); border-radius: 16px 16px 0 0; }
  .enquiry[open] { animation: sheet-in 240ms cubic-bezier(0.32, 0.72, 0, 1); }
  .enquiry form { padding: 18px 16px calc(20px + env(safe-area-inset-bottom)); }
}
@media (max-width: 380px) {
  .viewer__top .chip, .viewer__top .seg__btn { padding: 0 9px; }
  .topbar h1 { font-size: 14px; }
  .specbar { gap: 6px; padding-left: 10px; padding-right: 10px; }
  .specbar .specbar__next { padding: 0 18px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* A camera lens darkens the corners of every photograph a little; without it the render reads as a
   screen. Drawn over the 3D view (and over the poster picture while it loads), never over the controls. */
.viewer__stage::after { content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 1;
  background: radial-gradient(ellipse 75% 70% at 50% 46%, rgba(0, 0, 0, 0) 55%, rgba(12, 16, 10, 0.2) 100%); }

/* The hidden radio and switch inputs are position: absolute. With no positioned parent they sat at a fixed
   spot on the page rather than moving with the scrolling options panel, so choosing an option (which focuses
   its input) made the browser scroll the whole page to wherever that input was. Anchor them to their group. */
.ctl, .choices, .swatches { position: relative; }
