/* The Entrance Deuren sliding door configurator. Tokens and patterns taken from Entrance's demo page (KHEPM7JT):
   Sora, navy #112337 on white, cyan #00A0DF as the one accent, 6 px radii, a 3 px cyan rule under the header. */
:root {
  --navy: #112337; --navy-dk: #0d1b2a; --cyan: #00A0DF; --cyan-dk: #0090c9; --cyan-ink: #007fb3; --sky: #e6f5fc;
  --ink: #112337; --muted: #585e6a; --line: #e3e6ea; --sand: #F5F2F0; --stage: #e8ebee;
  --err: #c0171a; --ok: #2b8a4f; --warn-bg: #fff6df; --warn: #d7af00;
  --font: Sora, Arial, Helvetica, sans-serif;
  --panel-w: 400px; --head-h: 72px; --r: 6px; --gap: 18px; --sheet-h: 56dvh;
  --shadow-1: 0 8px 28px rgba(17,35,55,.16); --shadow-2: 0 16px 50px rgba(17,35,55,.18);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--stage); color: var(--ink); font-family: var(--font); font-size: 15px; -webkit-font-smoothing: antialiased; overflow: hidden; }
button, input, textarea { font-family: var(--font); }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }
.eyebrow { font-weight: 600; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--cyan-ink); }
.skip { position: fixed; left: 12px; top: -60px; z-index: 100; background: var(--navy); color: #fff; padding: 10px 14px; border-radius: var(--r); }
.skip:focus { top: 12px; }
:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; }

/* ---------- header ----------
   One flex row that cannot overlap: the logo, price and buttons never shrink below their content; the title and the
   "Your door" chip give way first (they truncate, then hide by width), then the button labels, then the logo scales. */
header.top { position: fixed; inset: 0 0 auto 0; height: var(--head-h); background: #fff; display: flex; align-items: center; gap: 12px; padding: 0 max(16px, env(safe-area-inset-right)) 0 max(20px, env(safe-area-inset-left)); z-index: 30; box-shadow: 0 1px 0 var(--line); }
header.top::after { content: ''; position: absolute; left: 0; right: 0; bottom: -3px; height: 3px; background: var(--cyan); }
header.top > * { flex: none; }
header.top .logo { flex: 0 1 auto; min-width: 56px; height: 34px; width: auto; display: block; object-fit: contain; object-position: left center; }
header.top .ttl { flex: 0 1 auto; display: flex; flex-direction: column; line-height: 1.15; border-left: 1px solid var(--line); padding-left: 16px; min-width: 0; overflow: hidden; }
header.top .ttl b { font-weight: 600; font-size: 15px; color: var(--navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
header.top .ttl small { font-size: 12px; color: var(--muted); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
header.top .grow { flex: 1 1 0; min-width: 0; }
.model { flex: 0 1 auto !important; display: flex; flex-direction: column; align-items: flex-end; line-height: 1.1; padding: 6px 12px; border: 1px solid var(--line); border-left: 4px solid var(--cyan); background: #fff; border-radius: var(--r); max-width: 440px; min-width: 0; }
.model small, .price small { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 600; white-space: nowrap; }
.model b { font-size: 13.5px; color: var(--navy); font-weight: 700; white-space: nowrap; display: flex; max-width: 100%; min-width: 0; }
.model b .nm { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.model b .sz { flex: none; white-space: pre; font-variant-numeric: tabular-nums; }
.model.flash { animation: mflash 1.2s ease; }
@keyframes mflash { 0% { background: var(--sky); } 100% { background: #fff; } }
.price { display: grid; justify-items: end; line-height: 1.05; }
.price b { font-weight: 700; font-size: 22px; color: var(--navy); transition: opacity .25s; font-variant-numeric: tabular-nums; white-space: nowrap; margin-top: 2px; }
.price.busy b { opacity: .4; }
.hbtn { all: unset; box-sizing: border-box; cursor: pointer; height: 40px; padding: 0 14px; display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 600; font-size: 13.5px; color: var(--navy); border: 1px solid rgba(17,35,55,.35); border-radius: var(--r); transition: background .2s, color .2s; white-space: nowrap; min-width: 40px; }
.hbtn:hover { background: var(--sand); }
.hbtn.cta { background: var(--cyan); border: 3px solid var(--cyan); color: #fff; }
.hbtn.cta:hover { background: var(--cyan-dk); border-color: var(--cyan-dk); }
.hbtn svg { width: 16px; height: 16px; flex: none; }
.hbtn .chev { width: 14px; height: 14px; transition: transform .2s ease; }
.hbtn:hover .chev { transform: translateX(4px); }
/* The language switch: the current code, and a small list of every offered language under it. */
.langs { position: relative; }
#lang-b { padding: 0 10px 0 12px; gap: 5px; letter-spacing: .04em; }
#lang-b .dd { width: 11px; height: 11px; transition: transform .2s; }
#lang-b[aria-expanded="true"] .dd { transform: rotate(180deg); }
.lang-menu { position: absolute; top: calc(100% + 8px); right: 0; z-index: 40; min-width: 170px; padding: 4px; display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-1); }
.lang-menu button { all: unset; box-sizing: border-box; cursor: pointer; display: flex; align-items: center; gap: 12px; min-height: 40px; padding: 0 12px; font-size: 13.5px; color: var(--navy); border-radius: 4px; }
.lang-menu button b { width: 22px; font-weight: 700; letter-spacing: .04em; }
.lang-menu button:hover { background: var(--sand); }
.lang-menu button[aria-pressed="true"] { background: var(--sky); box-shadow: inset 3px 0 0 var(--cyan); }
/* Until the page knows its language, its own words stay out of sight (the logo and the spinner do not wait). */
.i18n-wait header.top > :not(.logo), .i18n-wait #intro .in, .i18n-wait #loading .eyebrow { visibility: hidden; }
@media (max-width: 1420px) { #b-draw span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); } #b-draw { padding: 0; width: 40px; } }
@media (max-width: 1360px) { header.top .ttl { display: none; } }
/* The language switch takes the room of the title one step earlier, so the "Your door" chip keeps its length. */
@media (max-width: 1600px) { header.top:has(#langs:not([hidden])) .ttl { display: none; } }
@media (max-width: 1140px) { #b-reset span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); } #b-reset { padding: 0; width: 40px; } #b-ask span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); } #b-ask { padding: 0; width: 40px; } }
@media (max-width: 900px) { header.top .model, #b-draw { display: none; } }

/* ---------- stage ---------- */
#stage { position: fixed; inset: var(--head-h) 0 0 0; background: var(--stage); }
/* The canvas runs past the right edge by --shift, so the door sits in the middle of what the panel leaves free while the room still fills the whole stage. */
#stage canvas { position: absolute; top: 0; left: 0; width: calc(100% + var(--shift)); height: 100%; display: block; touch-action: none; outline: none; --shift: calc(var(--panel-w) + 36px); }
body.intro #stage canvas { --shift: 36vw; }
#stage::after { content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 1; background: radial-gradient(ellipse at 60% 50%, transparent 65%, rgba(17,35,55,.12) 100%); }
.modes { position: absolute; left: calc(var(--panel-w) + 40px); right: 24px; bottom: 22px; display: flex; justify-content: center; pointer-events: none; z-index: 5; }
.modes .bar { pointer-events: auto; display: flex; background: rgba(255,255,255,.96); box-shadow: var(--shadow-1); border-radius: var(--r); overflow: hidden; }
.modes .bar:empty { display: none; }
.modes button { all: unset; cursor: pointer; min-height: 42px; box-sizing: border-box; padding: 0 14px; font-weight: 600; font-size: 12.5px; color: var(--navy); display: flex; gap: 7px; align-items: center; border-right: 1px solid var(--line); white-space: nowrap; }
.modes button:last-child { border-right: 0; }
.modes button:hover { background: var(--sand); }
.modes button.on { background: var(--navy); color: #fff; box-shadow: inset 0 -3px 0 var(--cyan); }
.modes button svg { width: 15px; height: 15px; }
.modes .sep { width: 10px; }
.hint { position: absolute; left: calc(var(--panel-w) + 40px); top: 18px; z-index: 5; background: rgba(17,35,55,.9); color: #fff; padding: 9px 14px 9px 12px; font-size: 13px; line-height: 1.35; display: flex; gap: 10px; align-items: center; opacity: 0; transform: translateY(-6px); transition: opacity .5s, transform .5s; pointer-events: none; max-width: 480px; border-radius: var(--r); }
.hint.show { opacity: 1; transform: none; }
.hint i { width: 4px; align-self: stretch; background: var(--cyan); flex: none; }
body.settling #stage canvas { cursor: progress; }

/* ---------- panel ----------
   On a wide screen the panel is as tall as its step needs, up to the stage; the questions scroll inside it. */
#panel { position: fixed; z-index: 10; left: 18px; top: calc(var(--head-h) + 18px); max-height: calc(100dvh - var(--head-h) - 36px); width: var(--panel-w); background: #fff; box-shadow: var(--shadow-2); display: flex; flex-direction: column; overflow: hidden; outline: none; }
#panel .phead { flex: none; padding: 20px 24px 16px; border-bottom: 1px solid var(--line); }
#panel .phead .eyebrow::before, #intro .eyebrow::before { content: '// '; color: var(--cyan); }
#p-title { margin: 6px 0 0; font-weight: 600; font-size: 26px; line-height: 1.2; color: var(--navy); letter-spacing: -.01em; outline: none; }
#panel .phead p { margin: 8px 0 0; color: var(--muted); font-size: 14px; line-height: 1.4; }
#panel .phead p:empty { display: none; }
#panel .grip { display: none; }
#panel .pbody { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 0 24px 6px; scroll-behavior: smooth; overscroll-behavior: contain; }
#panel .pfoot { flex: none; display: flex; gap: 10px; padding: 14px 24px 18px; border-top: 1px solid var(--line); }
#p-back { min-width: 96px; }
#p-next span { overflow: hidden; text-overflow: ellipsis; }
.steps { display: flex; gap: 4px; margin: 0 0 12px; }
.steps button { all: unset; cursor: pointer; flex: 1; height: 5px; background: var(--line); position: relative; border-radius: var(--r); transition: background .2s; }
.steps button::after { content: ''; position: absolute; inset: -10px 0; }
.steps button:hover { background: #c7cbcf; }
.steps button.done { background: var(--navy); }
.steps button.on { background: var(--cyan); }
.pbtn { all: unset; box-sizing: border-box; cursor: pointer; height: 44px; padding: 0 18px; display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 600; font-size: 13.5px; border: 2px solid var(--navy); color: var(--navy); background: #fff; border-radius: var(--r); transition: background .2s, color .2s, border-color .2s; white-space: nowrap; min-width: 0; }
.pbtn:hover { background: var(--sky); }
.pbtn.next { flex: 1; background: var(--cyan); border-color: var(--cyan); color: #fff; }
.pbtn.next:hover { background: var(--navy); border-color: var(--navy); }
.pbtn[disabled] { opacity: .35; pointer-events: none; }
.ovl .bar .pbtn.next { flex: none; }

/* One question. Where its answer came from sits small in the block's top corner, in room the block always has, so a
   tag or "Saving…" never takes width from the question and never moves the block. */
.mod { position: relative; padding: 24px 0 18px; border-bottom: 1px solid var(--line); scroll-margin-top: 10px; }
.mod:last-child { border-bottom: 0; }
.mod > * + * { margin-top: 12px; }
.mod > .tag + h3 { margin-top: 0; }
.mod > h3 + .sub { margin-top: 4px; }
.mod h3 { margin: 0; font-weight: 700; font-size: 15px; line-height: 1.35; color: var(--navy); }
.mod h3 label { cursor: inherit; }
.tag { position: absolute; top: 6px; right: 0; display: flex; align-items: center; gap: 5px; font-weight: 600; font-size: 10px; line-height: 14px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.tag::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #b9bdc1; }
.tag.auto { color: var(--cyan-ink); } .tag.auto::before { background: var(--cyan); }
.tag.saving { color: var(--navy); } .tag.saving::before { background: var(--cyan); animation: pulse 1s infinite; }
.mod .sub { font-size: 13.5px; color: var(--muted); line-height: 1.45; }
.mod .why { padding: 8px 10px; background: var(--sky); border-left: 3px solid var(--cyan); font-size: 13px; line-height: 1.4; color: var(--navy); }
.mod details { font-size: 13.5px; color: var(--ink); }
.mod details summary { cursor: pointer; font-size: 12px; font-weight: 600; color: var(--muted); list-style: none; display: inline-flex; align-items: center; gap: 7px; padding: 2px 0; border-radius: 3px; }
.mod details summary::-webkit-details-marker { display: none; }
.mod details summary::before { content: ''; width: 5px; height: 5px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: rotate(-45deg); transition: transform .2s; }
.mod details[open] summary::before { transform: rotate(45deg); }
.mod details summary:hover { color: var(--navy); }
.mod details .md { margin-top: 6px; line-height: 1.5; color: var(--muted); }
.mod details .md p { margin: 6px 0; }
.mod details .md b { color: var(--navy); }
.mod details .md ul { margin: 6px 0; padding-left: 18px; }
.mod.ping { animation: ping 1.2s ease; }
@keyframes ping { 0% { box-shadow: 0 0 0 3px var(--cyan); } 100% { box-shadow: 0 0 0 0 rgba(0,160,223,0); } }

.opts { display: grid; gap: 8px; }
.opt { all: unset; box-sizing: border-box; position: relative; display: flex; gap: 12px; align-items: flex-start; padding: 11px 12px; border: 1px solid var(--line); background: #fff; cursor: pointer; text-align: left; border-radius: var(--r); transition: border-color .15s, box-shadow .15s, background .15s; min-height: 52px; width: 100%; }
.opt:hover { border-color: var(--navy); }
.opt .rad { flex: none; width: 18px; height: 18px; border: 2px solid #b9bdc1; border-radius: 50%; margin-top: 1px; display: grid; place-items: center; box-sizing: border-box; }
.opt .txt { min-width: 0; flex: 1; }
.opt .nm { font-size: 14.5px; font-weight: 600; line-height: 1.25; color: var(--navy); }
.opt .ds { font-size: 12.8px; color: var(--muted); margin-top: 3px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.opt .rs { font-size: 12.8px; color: var(--err); margin-top: 4px; line-height: 1.3; }
.opt[aria-checked="true"] { border: 2px solid var(--navy); padding: 10px 11px; box-shadow: inset 4px 0 0 var(--cyan); background: #f2fafe; }
.opt[aria-checked="true"] .rad { border-color: var(--navy); }
.opt[aria-checked="true"] .rad::after { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--cyan); }
.opt.def { border-style: dashed; border-color: #a9b6bf; }
.opt.def .rad::after { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #b9bdc1; }
.opt.blocked { background: #fafafa; }
.opt.blocked .nm, .opt.blocked .ds, .opt.blocked .ico, .opt.blocked .chip { opacity: .5; }
.opt.pending .rad::after { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--cyan); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .25; } }
.opt .ico { flex: none; width: 52px; height: 52px; display: grid; place-items: center; background: var(--sand); border-radius: var(--r); overflow: hidden; }
.opt .ico img { width: 100%; height: 100%; object-fit: cover; }

.sw { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.sw .opt { flex-direction: column; gap: 8px; padding: 8px; min-height: 0; align-items: stretch; }
.sw .opt[aria-checked="true"] { padding: 7px; }
.sw .chip { height: 46px; border: 1px solid rgba(0,0,0,.08); border-radius: var(--r); position: relative; overflow: hidden; }
.sw .chip::after { content: ''; position: absolute; inset: 0; background: linear-gradient(160deg, rgba(255,255,255,.4), rgba(255,255,255,0) 45%, rgba(0,0,0,.14)); }
.sw .chip.none { background: repeating-linear-gradient(135deg, #fff 0 7px, #eef0f2 7px 14px); }
.sw .nm { font-size: 12.8px; }
.sw .rs { font-size: 11.5px; }

.num .row { display: flex; align-items: center; gap: 10px; }
.num input[type=number], .txtin { height: 44px; border: 1px solid #c9cdd1; border-radius: var(--r); padding: 0 12px; font-size: 16px; font-weight: 600; color: var(--navy); font-variant-numeric: tabular-nums; background: #fff; }
.num input[type=number] { width: 120px; }
.num input[type=number]:focus, .txtin:focus { border-color: var(--navy); outline: none; box-shadow: 0 0 0 3px rgba(0,160,223,.35); }
.num .unit { font-weight: 600; color: var(--muted); font-size: 13px; }
.num .rng { margin-left: auto; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
/* A slider with a thumb big enough to grab and its track filled up to the value. */
.num input[type=range] { -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 32px; margin: 8px 0 -4px; padding: 0; background: transparent; cursor: pointer; }
.num input[type=range]::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: linear-gradient(var(--cyan), var(--cyan)) 0 0 / var(--fill, 50%) 100% no-repeat, var(--line); }
.num input[type=range]::-moz-range-track { height: 6px; border-radius: 3px; background: linear-gradient(var(--cyan), var(--cyan)) 0 0 / var(--fill, 50%) 100% no-repeat, var(--line); }
.num input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 24px; height: 24px; margin-top: -9px; border-radius: 50%; background: #fff; border: 3px solid var(--cyan); box-shadow: 0 1px 4px rgba(17,35,55,.3); box-sizing: border-box; }
.num input[type=range]::-moz-range-thumb { width: 24px; height: 24px; border-radius: 50%; background: #fff; border: 3px solid var(--cyan); box-shadow: 0 1px 4px rgba(17,35,55,.3); box-sizing: border-box; }
.num input[type=range]:focus-visible { outline: none; }
.num input[type=range]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px rgba(0,160,223,.45); }
.num input[type=range]:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 4px rgba(0,160,223,.45); }
.txtin { display: block; width: 100%; font-weight: 400; line-height: 1.45; padding: 10px 12px; min-height: 44px; resize: none; overflow: hidden; }
.derived { margin: 0; font-weight: 600; color: var(--navy); }

/* ---------- toasts ---------- */
#toasts { position: fixed; right: 18px; top: calc(var(--head-h) + 20px); width: 370px; z-index: 35; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.toast { pointer-events: auto; background: #fff; box-shadow: 0 12px 40px rgba(17,35,55,.22); padding: 14px 16px 14px 18px; border-left: 4px solid var(--cyan); font-size: 13.8px; line-height: 1.4; animation: tin .35s ease; border-radius: var(--r); }
.toast.bad { border-left-color: var(--err); }
.toast ul { margin: 6px 0 0; padding-left: 0; list-style: none; }
.toast li { margin: 6px 0; }
.toast li .why { display: block; color: var(--muted); font-size: 12.8px; margin-top: 2px; }
.toast > .eyebrow { display: block; margin-bottom: 3px; }
.toast .x { all: unset; float: right; cursor: pointer; color: var(--muted); margin-left: 8px; font-size: 18px; line-height: 1; }
@keyframes tin { from { opacity: 0; transform: translateX(16px); } }

/* ---------- overlays ---------- */
.ovl { position: fixed; inset: var(--head-h) 0 0 0; z-index: 25; background: #eef2f4; display: flex; flex-direction: column; }
.ovl .bar { flex: none; display: flex; align-items: center; gap: 14px; padding: 14px 22px; background: #fff; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.ovl .bar h2 { margin: 0; font-size: 18px; font-weight: 700; color: var(--navy); }
.ovl .bar .sp { flex: 1; }
.ovl .tabs, .ovl .poses { display: flex; gap: 4px; }
.ovl .tabs button, .ovl .poses button { all: unset; cursor: pointer; padding: 8px 12px; font-weight: 600; font-size: 13px; color: var(--muted); border-bottom: 3px solid transparent; }
.ovl .tabs button[aria-selected="true"] { color: var(--navy); border-bottom-color: var(--cyan); }
.ovl .poses { border: 1px solid var(--line); border-radius: var(--r); padding: 0 2px; }
.ovl .poses button { padding: 6px 10px; border: 0; }
.ovl .poses button[aria-pressed="true"] { color: #fff; background: var(--navy); border-radius: 4px; }
.sheetwrap { flex: 1; min-height: 0; overflow: auto; padding: 24px; display: flex; justify-content: center; align-items: flex-start; }
.paper { margin: 0; background: #fff; box-shadow: 0 10px 40px rgba(17,35,55,.15); width: min(1400px, 100%); border-radius: var(--r); padding: 18px; }
.paper .frame { border: 2px solid #3a4656; padding: 24px; }
.paper img { display: block; width: 100%; height: auto; max-height: calc(100vh - var(--head-h) - 210px); object-fit: contain; }
.paper figcaption { display: flex; justify-content: space-between; gap: 16px; margin-top: 16px; padding-top: 12px; border-top: 2px solid var(--navy); font-size: 13px; color: var(--muted); }
.paper figcaption b { color: var(--navy); font-size: 16px; display: block; }
.paper.loading img { opacity: .3; }
#summary .cols { flex: 1; min-height: 0; overflow: auto; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 24px; padding: 24px; align-items: start; }
#summary .shot { background: #fff; box-shadow: 0 10px 40px rgba(17,35,55,.12); border-radius: var(--r); overflow: hidden; }
#summary .shot img { display: block; width: 100%; height: auto; }
#summary .card { background: #fff; box-shadow: 0 10px 40px rgba(17,35,55,.12); padding: 24px 26px; border-radius: var(--r); }
#summary .mn { overflow-wrap: anywhere; font-size: 28px; font-weight: 600; color: var(--navy); letter-spacing: -.01em; margin: 6px 0 2px; line-height: 1.2; }
#summary .tot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 12px; margin: 16px 0 6px; padding: 14px 0; border-top: 2px solid var(--navy); }
#summary .tot b { font-size: 30px; font-weight: 700; color: var(--navy); font-variant-numeric: tabular-nums; white-space: nowrap; }
#summary table { width: 100%; border-collapse: collapse; font-size: 13.5px; margin-top: 8px; }
#summary td { padding: 7px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
#summary td:first-child { color: var(--muted); width: 42%; padding-right: 10px; }
#summary td:last-child { font-weight: 600; color: var(--navy); white-space: pre-line; }
#summary .note { font-size: 12.5px; color: var(--muted); line-height: 1.45; margin: 4px 0 14px; }
#summary label { display: block; font-weight: 600; font-size: 13px; margin: 14px 0 6px; }
#summary input[type=email] { width: 100%; height: 44px; border: 1px solid #c9cdd1; border-radius: var(--r); padding: 0 12px; font-size: 15px; }
#summary .warn { font-size: 12.5px; color: var(--muted); margin-top: 6px; padding: 8px 10px; background: var(--warn-bg); border-left: 3px solid var(--warn); }
#summary .res { margin-top: 12px; font-size: 14px; }
#summary .err { color: var(--err); }
#summary .pbtn.busy[disabled] { opacity: 1; cursor: progress; }
#summary .pbtn .spin { width: 14px; height: 14px; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; border-radius: 50%; animation: spin .9s linear infinite; flex: none; }
#summary .pending, #summary .failed { padding: 12px 14px; border-radius: 0 var(--r) var(--r) 0; line-height: 1.45; }
#summary .pending { background: var(--sky); border-left: 3px solid var(--cyan); }
#summary .failed { background: #fdf0ef; border-left: 3px solid var(--err); }
#summary .pending p, #summary .failed p { margin: 4px 0 0; }
#summary .pending .track { height: 3px; margin-top: 10px; background: rgba(0,160,223,.18); overflow: hidden; border-radius: 2px; }
#summary .pending .track span { display: block; width: 35%; height: 100%; background: var(--cyan); animation: slide 1.4s ease-in-out infinite; }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(290%); } }
#summary .sent .to { margin-top: 4px; padding-left: 26px; display: block; }
@media (prefers-reduced-motion: reduce) { #summary .pbtn .spin, #summary .pending .track span { animation-duration: 3s; } }
#summary .sent { padding: 12px 14px; background: #eef8f1; border-left: 3px solid var(--ok); border-radius: 0 var(--r) var(--r) 0; }
#summary .sent p { margin: 0; display: flex; gap: 8px; align-items: flex-start; line-height: 1.45; overflow-wrap: anywhere; min-width: 0; }
#summary .sent p svg { flex: none; width: 18px; height: 18px; color: var(--ok); margin-top: 1px; }
#summary .sent p.soft { margin-top: 6px; font-size: 12.5px; color: var(--muted); }
#summary .sent .pbtn { display: inline-flex; margin-top: 12px; text-decoration: none; }

#dialog { position: fixed; inset: 0; z-index: 50; background: rgba(17,35,55,.45); display: grid; place-items: center; }
#dialog .box { background: #fff; width: min(480px, 92vw); padding: 24px 26px; box-shadow: 0 20px 60px rgba(0,0,0,.3); border-radius: var(--r); }
#dialog h3 { margin: 6px 0 8px; font-size: 19px; color: var(--navy); }
#dialog p { font-size: 14.5px; line-height: 1.45; margin: 8px 0; }
#dialog p.soft { color: var(--muted); font-size: 14px; }
#dialog .row { display: flex; gap: 10px; margin-top: 16px; }

/* ---------- the assistant (the Wizard drawer) ----------
   A chat at the side, full height under the header; the 3D stays visible between the panel and the drawer. On a phone
   (and a phone on its side) it is a full screen sheet sized to the visible viewport, so the keyboard never covers it. */
:root { --chat-w: 420px; }
#wiz { position: fixed; z-index: 24; right: 0; top: var(--head-h); bottom: 0; width: var(--chat-w); background: #fff; box-shadow: -12px 0 40px rgba(17,35,55,.16); display: flex; flex-direction: column; overflow: hidden; }
body.chat-open #stage canvas { --shift: 0px; }
body.chat-open .modes { right: calc(var(--chat-w) + 24px); }
body.chat-open #toasts { right: calc(var(--chat-w) + 18px); }
#wiz .chead { flex: none; display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 14px 16px; background: var(--navy); color: #fff; box-shadow: inset 0 -3px 0 var(--cyan); }
#wiz .chead b { display: block; font-size: 15px; }
#wiz .chead small { display: block; font-size: 11.5px; opacity: .78; margin-top: 2px; line-height: 1.35; }
#wiz .cx { all: unset; cursor: pointer; font-size: 22px; line-height: 1; padding: 4px 8px; border-radius: var(--r); flex: none; }
#wiz .clog { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; padding: 18px 16px 12px; display: flex; flex-direction: column; gap: 12px; background: #f6f7f9; }
#wiz .ci { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; min-width: 0; max-width: 100%; animation: cin .25s ease; }
#wiz .ci.user { align-items: flex-end; }
@keyframes cin { from { opacity: 0; transform: translateY(4px); } }
#wiz .cm { max-width: 90%; min-width: 0; padding: 10px 13px; border-radius: 12px 12px 12px 4px; font-size: 14px; line-height: 1.5; color: var(--ink); background: #fff; border: 1px solid var(--line); overflow-wrap: anywhere; }
#wiz .cm.user { background: var(--navy); color: #fff; border: 0; border-radius: 12px 12px 4px 12px; white-space: pre-wrap; }
#wiz .ci.wait .cm.user { opacity: .55; }
#wiz .cst { font-size: 11.5px; color: var(--muted); }
#wiz .md p { margin: 0; } #wiz .md p + p, #wiz .md p + ul, #wiz .md p + ol, #wiz .md ul + p, #wiz .md ol + p { margin-top: 8px; }
#wiz .md ul, #wiz .md ol { margin: 6px 0 0; padding-left: 20px; } #wiz .md li + li { margin-top: 3px; }
#wiz .md b { color: var(--navy); } #wiz .md .mh { margin-top: 10px; }
#wiz .md code { font-size: 12.5px; background: var(--sand); padding: 1px 4px; border-radius: 3px; }
#wiz .md a { color: var(--cyan-ink); }
/* a table fits the bubble: columns share its width by content and wrap between words; only a table whose longest words
   cannot fit side by side moves sideways, without a visible bar */
.md .mdt { margin: 8px 0 0; overflow-x: auto; scrollbar-width: none; }
.md .mdt::-webkit-scrollbar { display: none; }
#wiz .md .mdt + p, .md .mdt + p { margin-top: 8px; }
.md table { width: 100%; border-collapse: collapse; font-size: 12.5px; line-height: 1.4; font-variant-numeric: tabular-nums; }
.md th, .md td { padding: 5px 8px 5px 0; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); overflow-wrap: break-word; hyphens: auto; }
.md th:last-child, .md td:last-child { padding-right: 0; }
.md th { font-weight: 700; color: var(--navy); border-bottom-color: var(--navy); }
.md tr:last-child td { border-bottom: 0; }
#wiz .dots { display: flex; gap: 4px; padding: 14px 14px; }
#wiz .dots i { width: 7px; height: 7px; border-radius: 50%; background: #9aa6b2; animation: blink 1.2s infinite; }
#wiz .dots i:nth-child(2) { animation-delay: .2s; } #wiz .dots i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
#wiz .cact { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
#wiz .cact i { width: 6px; height: 6px; border-radius: 50%; background: var(--cyan); animation: pulse 1s infinite; flex: none; }
#wiz .cnote { font-size: 12px; line-height: 1.4; color: var(--muted); padding-left: 10px; border-left: 2px solid var(--line); max-width: 90%; }
#wiz .cchg { font-size: 12.5px; color: var(--muted); max-width: 90%; }
#wiz .cchg summary { cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 7px; font-weight: 600; color: var(--cyan-ink); padding: 2px 0; }
#wiz .cchg summary::-webkit-details-marker { display: none; }
#wiz .cchg summary::before { content: ''; width: 5px; height: 5px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: rotate(-45deg); transition: transform .2s; flex: none; }
#wiz .cchg[open] summary::before { transform: rotate(45deg); }
#wiz .cchg ul { margin: 6px 0 0; padding: 8px 10px; list-style: none; background: var(--sky); border-left: 3px solid var(--cyan); color: var(--navy); }
#wiz .cchg li + li { margin-top: 5px; }
#wiz .cchg .why { display: block; color: var(--muted); margin-top: 2px; }
#wiz .cready { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
#wiz .cready .pbtn { flex: none; } #wiz .cready .pbtn svg { width: 14px; height: 14px; }
#wiz .cready a { font-size: 13px; font-weight: 600; color: var(--cyan-ink); }
#wiz .cerr { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; font-size: 13px; color: var(--err); max-width: 90%; }
#wiz .cerr button { all: unset; cursor: pointer; font-weight: 600; color: var(--navy); text-decoration: underline; text-underline-offset: 3px; }
/* A question: its options under the message, as chips or (long, pictured or emphasised) as cards. */
#wiz .cq { display: flex; flex-direction: column; gap: 8px; width: 90%; min-width: 0; }
#wiz .cq .qh { font-weight: 600; font-size: 14px; color: var(--navy); line-height: 1.4; }
#wiz .qchips { display: flex; flex-wrap: wrap; gap: 6px; max-width: 100%; }
#wiz .qcards { display: grid; gap: 6px; }
#wiz .qopt { all: unset; box-sizing: border-box; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; max-width: 100%; min-height: 36px; padding: 7px 12px; font-size: 13px; font-weight: 600; line-height: 1.3; color: var(--navy); background: #fff; border: 1px solid #c4cfdf; border-radius: var(--r); transition: background .15s, border-color .15s; overflow-wrap: anywhere; }
#wiz .qcards .qopt { display: flex; align-items: flex-start; padding: 10px 12px; }
#wiz .qopt:hover { background: var(--sky); border-color: var(--navy); }
#wiz .qopt[aria-pressed="true"] { background: var(--sky); border: 2px solid var(--navy); padding: 6px 11px; box-shadow: inset 3px 0 0 var(--cyan); }
#wiz .qcards .qopt[aria-pressed="true"] { padding: 9px 11px; }
#wiz .qopt[disabled] { cursor: default; background: #fafafa; }
#wiz .qopt[disabled]:not([aria-pressed="true"]) .nm, #wiz .qopt[disabled]:not([aria-pressed="true"]) .ds, #wiz .qopt[disabled] .sw-dot { opacity: .5; }
#wiz .cq.done .qopt[aria-pressed="true"] { background: var(--sky); }
#wiz .qopt[disabled]:not([aria-pressed="true"]) { color: #8a929c; border-color: var(--line); }
#wiz .qopt .qt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
#wiz .qopt .ds { font-weight: 400; font-size: 12.5px; color: var(--muted); line-height: 1.35; }
#wiz .qopt .rs { font-weight: 400; font-size: 12px; color: var(--err); line-height: 1.3; }
#wiz .qopt.blocked .rs { opacity: 1; }
#wiz .qopt .qimg { flex: none; width: 44px; height: 44px; border-radius: 4px; overflow: hidden; background: var(--sand); }
#wiz .qopt .qimg img { width: 100%; height: 100%; object-fit: cover; display: block; }
#wiz .sw-dot { flex: none; width: 14px; height: 14px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0,0,0,.15); }
#wiz .qin { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 8px; align-items: center; }
#wiz .qin .qhint { grid-column: 1 / -1; }
#wiz .qrow { display: flex; align-items: center; gap: 8px; min-width: 0; }
#wiz .qrow input { flex: 1; min-width: 0; width: 100%; height: 44px; border: 1px solid #c9cdd1; border-radius: var(--r); padding: 0 12px; font: inherit; font-size: 15px; font-weight: 600; color: var(--navy); font-variant-numeric: tabular-nums; background: #fff; }
#wiz .qrow input:focus { border-color: var(--navy); outline: none; box-shadow: 0 0 0 3px rgba(0,160,223,.35); }
#wiz .qrow input:disabled { background: #fafafa; color: var(--muted); }
#wiz .qrow .unit { font-weight: 600; color: var(--muted); font-size: 13px; }
#wiz .qin .pbtn, #wiz .qmulti .pbtn { flex: none; height: 44px; }
#wiz .qhint { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
#wiz .qhint.bad { color: var(--err); }
#wiz .qmulti { display: flex; flex-direction: column; gap: 12px; padding: 12px; background: #fff; border: 1px solid var(--line); border-radius: var(--r); }
#wiz .qgrp { display: flex; flex-direction: column; gap: 6px; }
#wiz .qgl { font-size: 12px; font-weight: 600; color: var(--muted); }
#wiz .qmulti .pbtn { align-self: flex-start; }
#wiz .starters, #wiz .sugg { max-width: 100%; }
/* The composer: grows with what is typed; while a turn runs it looks paused but still takes typing (sent after the turn). */
#wiz .ccomp { flex: none; display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px 12px; background: #fff; border-top: 1px solid var(--line); }
#wiz .ccomp textarea { flex: 1; min-width: 0; min-height: 44px; max-height: 140px; resize: none; overflow-y: hidden; border: 1px solid #c9cdd1; border-radius: var(--r); padding: 11px 12px; font: inherit; font-size: 14.5px; line-height: 1.4; color: var(--ink); background: #fff; }
#wiz .ccomp textarea:focus { border-color: var(--navy); outline: none; box-shadow: 0 0 0 3px rgba(0,160,223,.35); }
#wiz .csend { all: unset; box-sizing: border-box; cursor: pointer; flex: none; width: 44px; height: 44px; display: grid; place-items: center; color: #fff; background: var(--cyan); border-radius: var(--r); transition: background .2s, opacity .2s; }
#wiz .csend:hover { background: var(--navy); }
#wiz .csend svg { width: 18px; height: 18px; }
#wiz .ccomp.busy .csend { opacity: .4; }
/* Attachments: the attach button beside the field, the files waiting above it, and the same tiles in a sent message. */
#wiz .ccomp { flex-wrap: wrap; }
#wiz .cattach { all: unset; box-sizing: border-box; cursor: pointer; flex: none; width: 44px; height: 44px; display: grid; place-items: center; color: var(--navy); background: #fff; border: 1px solid #c9cdd1; border-radius: var(--r); transition: background .2s, border-color .2s; }
@media (hover: hover) { #wiz .cattach:hover { background: var(--sky); border-color: var(--navy); } #wiz .cfx:hover { background: var(--cyan); } }
#wiz .cattach svg { width: 20px; height: 20px; }
#wiz .ctray { flex: 1 0 100%; display: flex; flex-wrap: wrap; gap: 10px; padding: 8px 8px 2px 0; }
#wiz .cfnote { flex: 1 0 100%; font-size: 12.5px; line-height: 1.4; color: var(--err); }
#wiz .cfile { position: relative; flex: none; box-sizing: border-box; display: inline-flex; align-items: center; gap: 8px; height: 56px; min-width: 0; background: #fff; border: 1px solid var(--line); border-radius: var(--r); }
#wiz .cfile.img { width: 56px; }
#wiz .cfile.img img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: calc(var(--r) - 1px); }
#wiz .cfile.chip { max-width: 200px; padding: 0 12px 0 10px; font-size: 12.5px; font-weight: 600; color: var(--navy); }
#wiz .cfile.chip > svg { flex: none; width: 20px; height: 20px; color: var(--muted); }
#wiz .cfile .fn { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#wiz .cfile.bad { border-color: var(--err); box-shadow: 0 0 0 1px var(--err); }
#wiz .cfx { all: unset; box-sizing: border-box; cursor: pointer; position: absolute; top: -8px; right: -8px; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--navy); box-shadow: 0 0 0 2px #fff; transition: background .2s; }
#wiz .cfx::after { content: ''; position: absolute; inset: -8px; }
#wiz .cfx svg { width: 12px; height: 12px; stroke-width: 2.6; }
#wiz .cfs { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; max-width: 90%; }
#wiz .cfs .cfile.img { width: 72px; height: 72px; }
#wiz .cfs .cfile.chip { height: 40px; }
#wiz .ci.wait .cfs { opacity: .55; }
#wiz .cdrop { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; background: rgba(246,247,249,.9); box-shadow: inset 0 0 0 2px var(--cyan); font-weight: 600; font-size: 14px; color: var(--navy); pointer-events: none; }

/* ---------- intro and loading ---------- */
#intro { position: fixed; inset: var(--head-h) 0 0 0; z-index: 28; display: flex; align-items: center; padding: 0 0 0 6vw; background: linear-gradient(90deg, rgba(17,35,55,.97) 0%, rgba(17,35,55,.92) 36%, rgba(17,35,55,.55) 56%, rgba(17,35,55,0) 74%); transition: opacity .6s; overflow-y: auto; }
#intro.gone { opacity: 0; pointer-events: none; visibility: hidden; transition: opacity .6s, visibility 0s .6s; }
#intro .in { position: relative; color: #fff; max-width: 620px; min-width: 0; }
#intro .eyebrow { color: #fff; font-size: 13px; letter-spacing: .08em; }
#intro h1 { font-size: clamp(38px, 4.6vw, 66px); line-height: 1.05; font-weight: 600; letter-spacing: -.01em; margin: 14px 0 18px; color: #fff; }
#intro h1 span { display: block; }
#intro p { font-size: 17px; line-height: 1.7; margin: 0 0 24px; color: rgba(245,242,240,.88); max-width: 34em; }
#intro .row { display: flex; gap: 12px; flex-wrap: wrap; }
#intro .hbtn { color: #fff; border: 1px solid rgba(255,255,255,.55); background: transparent; height: 52px; padding: 0 26px; font-size: 14px; }
#intro .hbtn:hover { background: rgba(255,255,255,.08); }
#intro .hbtn.cta { background: var(--cyan); border: 3px solid var(--cyan); }
#intro .hbtn.cta:hover { background: var(--cyan-dk); border-color: var(--cyan-dk); }
#intro .facts { display: flex; gap: 30px; margin-top: 34px; flex-wrap: wrap; }
#intro .facts div { font-size: 12.5px; line-height: 1.35; color: rgba(245,242,240,.85); max-width: 180px; }
#intro .facts div::before { content: ''; display: block; width: 26px; height: 3px; background: var(--cyan); margin-bottom: 10px; }
#intro .facts b { display: block; color: #fff; font-size: 24px; font-weight: 600; margin-bottom: 4px; }
#intro .src { font-size: 11px; margin-top: 14px; color: rgba(245,242,240,.6); }
body.intro #panel, body.intro .modes, body.intro .hint { opacity: 0; pointer-events: none; visibility: hidden; }
#panel, .modes { transition: opacity .5s; }
#loading { position: fixed; inset: var(--head-h) 0 0 0; z-index: 29; background: var(--navy); color: #fff; display: grid; place-items: center; transition: opacity .6s; text-align: center; }
#loading .eyebrow { color: #fff; }
#loading.gone { opacity: 0; pointer-events: none; visibility: hidden; transition: opacity .6s, visibility 0s .6s; }
#loading .ring { width: 42px; height: 42px; border: 3px solid rgba(255,255,255,.25); border-top-color: var(--cyan); border-radius: 50%; animation: spin 1s linear infinite; margin: 0 auto 14px; }
#loading p { max-width: 440px; color: rgba(245,242,240,.85); line-height: 1.5; }
@keyframes spin { to { transform: rotate(360deg); } }

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

/* Every control shows where the keyboard is (the `all: unset` buttons included). */
button:focus-visible, summary:focus-visible, a:focus-visible, [role="radio"]:focus-visible, [tabindex]:not([tabindex="-1"]):focus-visible { outline: 3px solid var(--cyan) !important; outline-offset: 2px; }
.steps button:focus-visible { outline-offset: 4px; }

/* Fingers: every control at least 44 px tall. */
@media (pointer: coarse) {
  .hbtn { height: 44px; min-width: 44px; }
  #b-draw, #b-ask { width: 44px; }
  .modes button { min-height: 44px; min-width: 44px; justify-content: center; }
  .mod details summary { padding: 12px 0; margin: -10px 0; }
  .num input[type=range] { height: 44px; margin: 2px 0 -10px; }
  .num input[type=range]::-webkit-slider-thumb { width: 28px; height: 28px; margin-top: -11px; }
  .num input[type=range]::-moz-range-thumb { width: 28px; height: 28px; }
  .ovl .tabs button, .ovl .poses button { min-height: 44px; box-sizing: border-box; display: inline-flex; align-items: center; }
  #wiz .cx { width: 44px; height: 44px; padding: 0; display: grid; place-items: center; margin: -8px -8px -8px 0; }
  #wiz .qopt { min-height: 44px; }
  #wiz .cchg summary { padding: 12px 0; margin: -10px 0; }
  #wiz .cerr button { padding: 12px 4px; margin: -12px -4px; }
  .lang-menu button { min-height: 44px; }
  .toast .x { padding: 10px; margin: -10px -10px 0 0; }
}

/* ---------- short screens (a phone on its side, a small laptop window): the same layout, tighter ---------- */
@media (max-height: 560px) and (min-width: 561px) {
  :root { --head-h: 56px; --panel-w: 340px; }
  header.top .logo { height: 26px; }
  .price small { display: none; }
  .price b { font-size: 18px; }
  #panel { left: 10px; top: calc(var(--head-h) + 10px); max-height: calc(100dvh - var(--head-h) - 20px); }
  #panel .phead { display: grid; grid-template-columns: 1fr auto; align-items: baseline; column-gap: 12px; padding: 12px 18px 10px; } #panel .phead p { display: none; }
  .steps { grid-column: 1 / -1; margin-bottom: 10px; }
  #p-title { grid-column: 1; grid-row: 2; font-size: 18px; margin: 0; }
  #panel .phead .eyebrow { grid-column: 2; grid-row: 2; font-size: 10.5px; color: var(--muted); }
  #panel .phead .eyebrow::before { content: none; }
  #panel .pbody { padding: 0 18px 4px; }
  #panel .pfoot { padding: 10px 18px max(10px, env(safe-area-inset-bottom)); }
  .modes { left: calc(var(--panel-w) + 20px); right: 12px; bottom: 10px; }
  .modes button span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .hint { left: calc(var(--panel-w) + 24px); top: 10px; }
  #intro { padding-left: 5vw; }
  #intro .in { padding: 20px 0; }
  #intro h1 { font-size: 32px; margin: 8px 0 10px; } #intro p { font-size: 14px; line-height: 1.5; margin-bottom: 14px; }
  #intro .hbtn { height: 44px; } #intro .facts { margin-top: 16px; } #intro .facts b { font-size: 18px; }
}

/* ---------- phones and narrow tablets held upright: the panel becomes a bottom sheet over the 3D ---------- */
@media (max-width: 560px), (max-width: 900px) and (min-height: 561px) {
  :root { --panel-w: 0px; --head-h: 60px; }
  header.top { gap: 8px; padding: 0 max(10px, env(safe-area-inset-right)) 0 max(12px, env(safe-area-inset-left)); }
  header.top .logo { height: 24px; min-width: 52px; }
  .price small { display: none; }
  .price b { font-size: 16px; margin: 0; }
  header.top .hbtn { padding: 0 12px; }
  #b-sum .chev { display: none; }
  #lang-b { padding: 0; width: 44px; } #lang-b .dd { display: none; }

  #panel { left: 0; right: 0; width: auto; top: auto; bottom: 0; max-height: none; height: var(--sheet-h); border-radius: 12px 12px 0 0; transition: height .3s ease; box-shadow: 0 -8px 30px rgba(17,35,55,.18); }
  body.sheet-open #panel { height: calc(100dvh - var(--head-h)); }
  #panel.dragging { transition: none; }
  #panel .phead { position: relative; display: grid; grid-template-columns: 1fr auto; align-items: baseline; column-gap: 12px; padding: 18px 16px 10px; touch-action: none; cursor: grab; user-select: none; }
  #panel .grip { all: unset; display: block; position: absolute; left: 50%; top: 0; width: 88px; height: 18px; transform: translateX(-50%); cursor: pointer; }
  #panel .grip::before { content: ''; position: absolute; left: 50%; top: 6px; width: 40px; height: 5px; border-radius: 3px; background: #c9cdd1; transform: translateX(-50%); }
  .steps { grid-column: 1 / -1; margin: 0 0 10px; }
  .steps button::after { inset: -14px 0 -8px; }
  #p-title { grid-column: 1; grid-row: 2; font-size: 18px; margin: 0; }
  #panel .phead .eyebrow { grid-column: 2; grid-row: 2; font-size: 10.5px; color: var(--muted); }
  #panel .phead .eyebrow::before { content: none; }
  #panel .phead p { display: none; }
  #panel .pbody { padding: 0 16px 6px; }
  #panel .pfoot { padding: 10px 16px max(12px, env(safe-area-inset-bottom)); }
  .mod { padding: 22px 0 16px; }
  .opt .nm { font-size: 15px; }

  #stage canvas, body.intro #stage canvas { --shift: 0px; height: calc(100% - var(--sheet-h) + 14px); }
  body.intro #stage canvas { height: 58%; }
  .modes { left: max(8px, env(safe-area-inset-left)); right: 8px; bottom: calc(var(--sheet-h) + 10px); justify-content: flex-start; overflow-x: auto; scrollbar-width: none; }
  .modes button { padding: 0 12px; min-width: 44px; justify-content: center; }
  .modes button span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  #toasts { right: 8px; left: 8px; width: auto; top: calc(var(--head-h) + 8px); }
  #toasts > .toast:nth-child(n+2) { display: none; }
  .toast { font-size: 12.8px; padding: 10px 12px 10px 14px; }
  .hint { left: 50%; right: auto; top: 10px; max-width: calc(100% - 24px); width: max-content; transform: translate(-50%, -6px); font-size: 12.5px; }
  .hint.show { transform: translate(-50%, 0); }
  #intro { padding: 0 18px max(20px, env(safe-area-inset-bottom)); align-items: flex-start; background: linear-gradient(0deg, rgba(17,35,55,.99) 0%, rgba(17,35,55,.96) 62%, rgba(17,35,55,.55) 80%, rgba(17,35,55,0) 100%); }
  #intro .in { padding-top: 34vh; margin-top: auto; }
  #intro .eyebrow { font-size: 11.5px; }
  #intro h1 { font-size: 32px; margin: 8px 0 10px; } #intro p { font-size: 14px; line-height: 1.55; margin-bottom: 16px; }
  #intro .row { gap: 8px; flex-wrap: nowrap; } #intro .hbtn { height: 48px; padding: 0 10px; font-size: 13px; flex: 1 1 0; min-width: 0; justify-content: center; }
  #intro .facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 18px; } #intro .facts div { font-size: 11px; line-height: 1.3; } #intro .facts b { font-size: 15px; margin-bottom: 2px; } #intro .facts div::before { margin-bottom: 6px; width: 20px; }
  #intro .src { font-size: 10.5px; margin-top: 10px; }
  .ovl .bar { gap: 8px; padding: 8px 12px; } .ovl .bar h2 { font-size: 15px; } .ovl .bar .pbtn { padding: 0 12px; font-size: 13px; }
  #sheet-svg, #sheet-print { display: none; }
  #sheet .bar h2 { flex: 1 0 55%; } #sheet .bar .sp { display: none; } #sheet-x { order: 1; } #sheet-tabs { order: 2; margin-right: auto; } #sheet-poses { order: 3; }
  .sheetwrap { padding: 12px 12px max(12px, env(safe-area-inset-bottom)); } .paper { padding: 8px; } .paper .frame { padding: 10px; }
  .paper img { max-height: none; }
  #summary .cols { grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 12px 12px max(16px, env(safe-area-inset-bottom)); }
  .paper figcaption { flex-direction: column; } .paper figcaption > div:last-child { text-align: left !important; }
  #summary .card { padding: 18px; }
  #summary .mn { font-size: 22px; }
  #summary .tot b { font-size: 22px; }
  #summary input[type=email] { font-size: 16px; }
  #dialog .box { max-height: calc(100dvh - 32px); overflow: auto; }
  #dialog .row .pbtn { flex: 1; }
}
@media (max-width: 900px) { header.top .grow { display: none; } header.top .price { margin-left: auto; } }
/* A phone, upright or on its side: the assistant is a full screen sheet over everything, sized to the visible viewport. */
@media (max-width: 900px), (max-height: 560px) {
  #wiz { z-index: 46; left: 0; right: 0; width: auto; bottom: auto; top: var(--vvt, 0px); height: var(--vvh, 100dvh); box-shadow: none; }
  #wiz .chead { padding: max(12px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 12px max(16px, env(safe-area-inset-left)); }
  #wiz .clog { padding: 14px max(12px, env(safe-area-inset-right)) 10px max(12px, env(safe-area-inset-left)); }
  #wiz .ccomp { padding: 8px max(10px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left)); }
  #wiz .ccomp textarea, #wiz .qrow input { font-size: 16px; }
  #wiz .cm, #wiz .cq, #wiz .cchg, #wiz .cnote, #wiz .cerr, #wiz .cfs { max-width: 94%; }
  #wiz .cq { width: 94%; }
  body.chat-open #toasts { z-index: 47; right: 8px; }
  body.chat-open #stage canvas { --shift: 0px; }
}
/* A phone's header has room for the range on two lines only. */
@media (max-width: 440px) {
  .price b { font-size: 14px; line-height: 1.15; }
  .price b span { display: block; }
  header.top .logo { min-width: 44px; }
}
@media (max-width: 350px) { header.top { gap: 6px; } header.top .hbtn { padding: 0 10px; font-size: 12.5px; } }
/* The smallest phones with the language switch: every header item a little tighter, so the quote button stays whole. */
@media (max-width: 359px) {
  header.top:has(#langs:not([hidden])) { gap: 4px; }
  header.top:has(#langs:not([hidden])) .logo { min-width: 36px; }
  header.top:has(#langs:not([hidden])) #lang-b, header.top:has(#langs:not([hidden])) #b-ask { width: 40px; min-width: 40px; }
  header.top:has(#langs:not([hidden])) #b-sum { padding: 0 8px; }
}
@media (max-width: 359px) { #intro .row { flex-wrap: wrap; } #intro .row .hbtn { flex: 1 1 100%; } }
