/* Configurator: the 3D stage owns the left, the build panel the right; the price stays pinned at the panel's foot. */
.app { display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 440px); height: calc(100svh - var(--header-h) - env(safe-area-inset-top, 0px)); min-height: 600px; border-bottom: 1px solid var(--line); }

/* Stage */
.stage { position: relative; overflow: hidden; background:
  radial-gradient(50% 40% at 50% 40%, #151a18 0%, transparent 100%),
  linear-gradient(180deg, #0e1211 62%, #0a0d0c 62%); isolation: isolate; }
.stage canvas { display: block; width: 100%; height: 100%; cursor: grab; touch-action: pan-y; }
.stage canvas:active { cursor: grabbing; }
.stage-top, .stage-bottom { position: absolute; left: 16px; right: 16px; display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; pointer-events: none; }
.stage-top { top: 16px; } .stage-bottom { bottom: 16px; }
.stage-top > *, .stage-bottom > * { pointer-events: auto; }
.dims { font-family: var(--font-display); font-stretch: 112%; font-weight: 300; font-size: clamp(22px, 2.4vw, 34px); letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.dims i { font-family: var(--font-body); font-style: normal; font-weight: 300; color: var(--muted); margin: 0 .18em; font-size: .8em; }
.dims small { display: block; font-family: var(--font-body); font-size: 12px; color: var(--muted); letter-spacing: .04em; font-stretch: 100%; }
.stage-tools { display: flex; gap: 6px; }
.chip { border: 1px solid var(--line-strong); background: rgba(19, 24, 23, .82); padding: 8px 12px; font-size: 13px; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; }
.chip:hover { border-color: var(--brass); }
.chip[aria-pressed="true"] { border-color: var(--brass); color: var(--brass); }
.chip svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.5; }
.hint { font-size: 12px; color: var(--muted); }
.hint-touch { display: none; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.stage-loading, .stage-fallback { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 14px; pointer-events: none; }
.stage-fallback { display: none; }
.stage.ready .stage-loading { display: none; }
.stage.no-webgl .stage-loading { display: none; } .stage.no-webgl .stage-fallback { display: grid; }

/* Panel */
.panel { display: flex; flex-direction: column; min-height: 0; border-left: 1px solid var(--line); background: var(--surface); }
.panel-scroll { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 24px 24px 8px; display: flex; flex-direction: column; gap: 26px; }
.panel h1 { font-size: 30px; }
.panel .lead { color: var(--muted); font-size: 15px; margin-top: 10px; max-width: 34rem; }
.group { display: flex; flex-direction: column; gap: 12px; }
.group-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.group h2 { font-size: 15px; font-weight: 500; font-stretch: 112%; letter-spacing: .02em; }
.group-value { font-size: 13px; color: var(--muted); text-align: right; }

.types { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.type { border: 1px solid var(--line); background: var(--raise); padding: 10px 4px 8px; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; cursor: pointer; color: var(--muted); }
.type svg { width: 34px; height: 34px; stroke: currentColor; fill: none; stroke-width: 1.3; }
.type:hover { color: var(--ink); border-color: var(--line-strong); }
.type[aria-pressed="true"] { border-color: var(--brass); color: var(--ink); background: var(--brass-soft); }
.type[aria-pressed="true"] svg { stroke: var(--brass); }

.dim { display: grid; grid-template-columns: 92px minmax(0, 1fr) 96px; align-items: center; gap: 12px; }
.dim label { font-size: 14px; }
.dim .range-hint { display: block; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.num { display: flex; align-items: center; border: 1px solid var(--line-strong); background: var(--sunk); }
.num input { width: 100%; min-width: 0; border: 0; background: none; padding: 9px 4px 9px 6px; text-align: right; font-variant-numeric: tabular-nums; font-size: 15px; -moz-appearance: textfield; }
.num input::-webkit-outer-spin-button, .num input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.num span { padding-right: 10px; color: var(--muted); font-size: 13px; }
.num:focus-within { border-color: var(--brass); }
input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 28px; background: transparent; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { height: 2px; background: linear-gradient(90deg, var(--brass) var(--p, 50%), var(--line-strong) var(--p, 50%)); }
input[type="range"]::-moz-range-track { height: 2px; background: var(--line-strong); }
input[type="range"]::-moz-range-progress { height: 2px; background: var(--brass); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; margin-top: -7px; border-radius: 50%; background: var(--ink); border: 3px solid var(--brass); }
input[type="range"]::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: var(--ink); border: 3px solid var(--brass); }

.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button { border: 1px solid var(--line); background: var(--raise); padding: 8px 12px; font-size: 13px; cursor: pointer; color: var(--muted); font-variant-numeric: tabular-nums; }
.seg button:hover { color: var(--ink); border-color: var(--line-strong); }
.seg button[aria-pressed="true"] { border-color: var(--brass); color: var(--ink); background: var(--brass-soft); }
.row { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 14px; }
.stepper { display: flex; align-items: center; border: 1px solid var(--line-strong); }
.stepper button { width: 34px; height: 34px; border: 0; background: none; cursor: pointer; color: var(--ink); display: grid; place-items: center; }
.stepper button:hover { color: var(--brass); }
.stepper button:disabled { color: var(--faint); cursor: default; }
.stepper svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 1.5; }
.stepper output { min-width: 28px; text-align: center; font-variant-numeric: tabular-nums; }

.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); gap: 6px; }
.swatch { aspect-ratio: 1; border: 1px solid rgba(255, 255, 255, .08); cursor: pointer; position: relative; padding: 0; background-size: cover; }
.swatch[aria-pressed="true"] { outline: 1px solid var(--brass); outline-offset: 2px; }
.swatch:hover { transform: translateY(-1px); }

.notes { font-size: 13px; color: var(--brass); }
.decor-note { font-size: 12px; color: var(--muted); }
.cross { font-size: 14px; color: var(--brass); text-decoration: underline; text-underline-offset: 4px; text-decoration-color: rgba(201, 169, 110, .4); }
.cross svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 1.5; vertical-align: -2px; margin-left: 6px; }

/* Summary */
.summary { border-top: 1px solid var(--line); padding: 16px 24px calc(16px + env(safe-area-inset-bottom, 0px)); background: var(--raise); display: flex; flex-direction: column; gap: 12px; }
.sum-lines { display: grid; grid-template-columns: 1fr auto; gap: 3px 0; margin: 0; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.sum-lines dd { margin: 0; padding-left: 16px; text-align: right; color: var(--ink); }
.sum-lines dt.sep, .sum-lines dd.sep { border-top: 1px solid var(--line); padding-top: 6px; margin-top: 2px; }
.sum-total { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.sum-label { display: flex; flex-direction: column; gap: 2px; font-size: 13px; color: var(--muted); }
.sum-label .proto { font-size: 11px; color: var(--muted); line-height: 1.3; }
.sum-total strong { font-family: var(--font-display); font-weight: 300; font-stretch: 112%; font-size: 40px; line-height: 1; font-variant-numeric: tabular-nums; transition: color .3s var(--ease); }
.sum-total strong.bump { color: var(--brass); }
.sum-lines dt.sum-ship { display: flex; align-items: center; gap: 8px; }
.sum-lines dd.sep { display: flex; align-items: center; justify-content: flex-end; }   /* stretch with the select row so the rule runs straight across */
.sum-ship select { -webkit-appearance: none; appearance: none; background: var(--sunk) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5' fill='none' stroke='%23c9a96e' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 8px center; border: 1px solid var(--line-strong); padding: 4px 26px 4px 8px; font-size: 12.5px; color: var(--ink); cursor: pointer; }
.sum-ship select:hover, .sum-ship select:focus { border-color: var(--brass); outline: none; }
.sum-actions { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.flat { font-size: 12px; color: var(--muted); line-height: 1.5; }
.quote-link { display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; border: 0; background: none; padding: 2px 0; color: var(--brass); font-size: 14px; cursor: pointer; text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 4px; transition: text-decoration-color .2s var(--ease); }
.quote-link:hover { text-decoration-color: currentColor; }
.quote-link svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 1.5; }

/* Value band: the luxury promise and the price argument, straight under the configurator */
.value { position: relative; border-bottom: 1px solid var(--line); background: radial-gradient(120% 140% at 0% 0%, var(--stage-glow), transparent 60%), var(--bg); }
.value::before { content: ""; position: absolute; inset: 0 0 auto; height: 1px; background: linear-gradient(90deg, var(--brass), transparent 70%); opacity: .55; }
.value-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(40px, 6vw, 96px); padding-block: clamp(64px, 8vw, 120px); align-items: start; }
.value h2 { font-size: clamp(34px, 4.2vw, 60px); font-weight: 300; font-stretch: 118%; line-height: 1.05; letter-spacing: -.01em; text-wrap: balance; }
.value h2 em { display: block; font-style: normal; color: var(--brass); }
.value-lead { margin-top: 24px; color: var(--muted); font-size: 18px; line-height: 1.6; max-width: 34rem; text-wrap: pretty; }
.value-cta { margin-top: 36px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.value-cta span { color: var(--muted); font-size: 14px; }
.value-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; border-top: 1px solid var(--line-strong); }
.value-facts > div { padding: 32px 32px 36px 0; border-bottom: 1px solid var(--line); }
.value-facts > div:nth-child(even) { padding-left: 32px; padding-right: 0; border-left: 1px solid var(--line); }
.value-facts dt { display: flex; flex-direction: column; gap: 14px; font-size: 16px; font-weight: 500; }
.value-facts .fig { font-family: var(--font-display); font-weight: 200; font-stretch: 125%; font-size: clamp(40px, 4vw, 56px); line-height: 1; color: var(--brass); font-variant-numeric: tabular-nums; }
.value-facts dd { margin: 8px 0 0; color: var(--muted); font-size: 15px; line-height: 1.55; text-wrap: pretty; max-width: 30ch; }
@media (max-width: 1100px) { .value-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 600px) {
  .value-facts > div, .value-facts > div:nth-child(even) { padding: 24px 0 26px; border-left: 0; }
  .value-facts > div:nth-child(odd) { padding-right: 16px; }
  .value-facts > div:nth-child(even) { padding-left: 16px; border-left: 1px solid var(--line); }
  .value-facts .fig { font-size: 34px; }
  .value-facts dd { font-size: 14px; }
}

/* desktop: the breakdown is always on; the toggle only exists on phones */
.details-toggle { display: none; border: 0; background: none; color: var(--muted); font-size: 12px; cursor: pointer; padding: 0; width: 100%; align-items: center; gap: 8px; text-align: left; font-variant-numeric: tabular-nums; }
.details-toggle:hover { color: var(--ink); }
.sum-brief { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.details-toggle svg { flex: none; width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 1.5; }
.details-toggle .ico-less, .summary.expanded .details-toggle .ico-more { display: none; }
.summary.expanded .details-toggle .ico-less { display: block; }

/* Order form (replaces the build panel) */
.form { display: flex; flex-direction: column; gap: 14px; }
.form h2 { font-size: 26px; }
.form .lead { margin-top: 0; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.field input, .field textarea, .field select { background: var(--sunk); border: 1px solid var(--line-strong); padding: 11px 12px; font-size: 15px; color: var(--ink); }
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--brass); }
.field textarea { min-height: 80px; resize: vertical; }
.field .err { color: var(--danger); font-size: 12px; }
.field[data-invalid] input, .field[data-invalid] textarea { border-color: var(--danger); }
.field-2 { display: grid; grid-template-columns: 1fr 120px; gap: 10px; }
.field-2.even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.field input { min-width: 0; }
.order-only { display: flex; flex-direction: column; gap: 14px; }
.form[data-mode="quote"] .order-only { display: none; }
.ok-box .btn { align-self: flex-start; margin-top: 8px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--muted); }
.check input { margin-top: 3px; accent-color: var(--brass); }
.form-msg { font-size: 14px; }
.form-msg.err { color: var(--danger); }
.ok-box { border: 1px solid var(--brass); padding: 20px; display: flex; flex-direction: column; gap: 8px; }
.ok-box h2 { font-size: 24px; color: var(--brass); }

/* Below the app */
.band { padding-block: clamp(56px, 7vw, 96px); border-bottom: 1px solid var(--line); }
.band h2 { font-size: clamp(28px, 3.4vw, 44px); }
.band .band-lead { color: var(--muted); max-width: 46rem; margin-top: 12px; text-wrap: pretty; }
.parts-wrap { margin-top: 28px; overflow-x: auto; border: 1px solid var(--line); }
.parts { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; min-width: 640px; }
.parts th, .parts td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.parts th { font-weight: 500; color: var(--muted); font-size: 12px; letter-spacing: .04em; background: var(--surface); position: sticky; top: 0; }
.parts td.num-col, .parts th.num-col { text-align: right; }
.parts tbody tr { cursor: pointer; transition: background .15s; }
.parts tbody tr:hover, .parts tbody tr.hl { background: var(--brass-soft); }
.parts tbody tr.hl td { border-bottom-color: rgba(201, 169, 110, .45); }
.decor-dot { display: inline-block; width: 12px; height: 12px; vertical-align: -1px; margin-right: 8px; border: 1px solid rgba(255,255,255,.12); }
.code { color: var(--muted); font-size: 12px; }
.edges { display: inline-flex; gap: 3px; }
.edges i { display: inline-block; width: 16px; height: 4px; background: var(--line-strong); }
.edges i.e1 { background: var(--brass); }
.edges i.e05 { background: #8a7a5a; }
.parts-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-top: 12px; font-size: 13px; color: var(--muted); }

.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 36px; border-top: 1px solid var(--line); counter-reset: s; }
.steps li { list-style: none; padding: 24px 24px 0 0; display: flex; flex-direction: column; gap: 8px; }
.steps li + li { padding-left: 24px; border-left: 1px solid var(--line); }
.steps li::before { counter-increment: s; content: counter(s); font-family: var(--font-display); font-weight: 200; font-stretch: 125%; font-size: 40px; color: var(--brass); line-height: 1; }
.steps h3 { font-size: 20px; }
.steps p { color: var(--muted); font-size: 15px; text-wrap: pretty; }
.steps { padding: 0; margin-bottom: 0; }

/* Phones: stage on top, panel flows, price bar sticks to the bottom */
@media (max-width: 900px) {
  .app { display: block; height: auto; min-height: 0; }
  .stage { position: sticky; top: calc(var(--header-h) + env(safe-area-inset-top, 0px)); height: 42svh; min-height: 300px; z-index: 5; border-bottom: 1px solid var(--line); }
  .panel { border-left: 0; }
  .panel-scroll { overflow: visible; padding: 20px 16px; }
  .summary { position: sticky; bottom: 0; z-index: 6; padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px)); gap: 8px; }
  .details-toggle { display: flex; }
  .summary .flat, .summary:not(.expanded) .sum-lines { display: none; }
  .summary.expanded .flat { display: block; }
  .sum-total strong { font-size: 30px; }
  .dims { font-size: 22px; }
  .hint-pointer { display: none; }
  .hint-touch { display: block; }
  /* phones: the size readout already names the piece, so the intro shrinks to a headline and the controls start sooner */
  .panel-scroll { gap: 16px; }
  .panel-scroll#build { padding-top: 14px; }
  .panel h1 { font-size: 20px; }
  .panel h1 br { display: none; }
  #build .lead { display: none; }
  .steps { grid-template-columns: minmax(0, 1fr); }
  .steps li + li { padding-left: 0; border-left: 0; }
  .steps li { padding: 20px 0; border-bottom: 1px solid var(--line); }
}
@media (max-width: 420px) {
  .types { grid-template-columns: repeat(5, minmax(56px, 1fr)); overflow-x: auto; }
  .dim { grid-template-columns: 68px minmax(0, 1fr) 90px; gap: 8px; }
}

/* Ready-made designs: a strip of three in the panel, all fifteen in the band below */
.thumb { display: block; aspect-ratio: 72 / 51; background: linear-gradient(#ebe6de 0 62%, #d8d0c4 62%); overflow: hidden; }
.thumb img { display: block; width: 100%; height: 100%; object-fit: cover; animation: thumbIn .5s var(--ease) both; }
@keyframes thumbIn { from { opacity: 0; } to { opacity: 1; } }
.design-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.design-chip { display: flex; flex-direction: column; gap: 0; padding: 0; border: 1px solid var(--line); background: var(--raise); cursor: pointer; color: var(--muted); font-size: 13px; text-align: left; }
.design-chip span:last-child { padding: 6px 8px; }
.design-chip:hover { color: var(--ink); border-color: var(--line-strong); }
.design-chip[aria-pressed="true"] { border-color: var(--brass); color: var(--ink); background: var(--brass-soft); }
.designs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-top: 28px; }
.design { display: flex; flex-direction: column; gap: 8px; padding: 0 0 16px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; text-align: left; color: var(--ink); min-width: 0; transition: border-color .2s var(--ease); }
.design:hover { border-color: var(--brass); }
.design .thumb { margin-bottom: 6px; border-bottom: 1px solid var(--line); }
.design:hover .thumb img { transform: scale(1.03); }
.design .thumb img { transition: transform .5s var(--ease); }
.design-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 0 14px; }
.design-head strong { font-family: var(--font-display); font-stretch: 112%; font-weight: 400; font-size: 22px; }
.design-type { font-size: 12px; color: var(--muted); }
.design-line { padding: 0 14px; font-size: 13.5px; color: var(--muted); line-height: 1.45; text-wrap: pretty; }
.design-price { padding: 0 14px; margin-top: auto; font-size: 13px; color: var(--brass); font-variant-numeric: tabular-nums; }
@media (max-width: 1100px) { .designs { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .designs { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } .design-line { display: none; } .design-head { flex-direction: column; gap: 0; } }
.group > .range-hint { font-size: 12.5px; line-height: 1.5; color: var(--muted); text-wrap: pretty; }

/* AR sheet */
.ar-sheet { width: min(440px, calc(100vw - 32px)); padding: 22px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); }
.ar-sheet::backdrop { background: rgba(5, 7, 6, .72); }
.ar-head { display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.ar-head h2 { font-size: 24px; }
.ar-head .chip svg { transform: rotate(45deg); }
.ar-lead { color: var(--muted); margin: 8px 0 16px; }
.ar-mv { display: block; width: 100%; height: 280px; background: linear-gradient(#ebe6de 0 62%, #d8d0c4 62%); margin-bottom: 14px; }
.ar-sheet .btn { width: 100%; }
.ar-qr { width: 220px; margin: 4px auto 14px; background: #fff; }
.ar-qr svg { display: block; width: 100%; height: auto; }
.ar-status, .ar-note { font-size: 13.5px; color: var(--muted); margin: 10px 0 0; text-wrap: pretty; }

/* The occasional design to try: sits over the stage, never over the price or the form */
.pop { position: fixed; left: 16px; bottom: 44px; z-index: 30; display: flex; align-items: stretch; max-width: min(380px, calc(100vw - 32px)); background: var(--raise); border: 1px solid var(--line-strong); box-shadow: 0 12px 36px rgba(0, 0, 0, .5); animation: popIn .6s var(--ease) both; }
.pop[hidden] { display: none; }
.pop-body { display: flex; align-items: center; gap: 12px; padding: 10px 6px 10px 10px; border: 0; background: none; text-align: left; cursor: pointer; min-width: 0; }
.pop-body img { flex: none; width: 72px; height: 51px; object-fit: cover; }
.pop-text { display: grid; gap: 1px; min-width: 0; font-size: 12.5px; line-height: 1.35; color: var(--muted); }
.pop-title { font-size: 11px; color: var(--faint); }
.pop-text strong { font-weight: 500; font-size: 14px; color: var(--ink); }
.pop-go { color: var(--brass); margin-top: 2px; }
.pop-body:hover .pop-go { text-decoration: underline; text-underline-offset: 3px; }
.pop-close { flex: none; width: 34px; border: 0; background: none; color: var(--muted); cursor: pointer; display: grid; place-items: start center; padding-top: 12px; }
.pop-close svg { width: 11px; height: 11px; }
.pop-close:hover { color: var(--ink); }
@keyframes popIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@media (max-width: 900px) { .pop { left: 16px; right: 16px; max-width: none; bottom: auto; top: calc(var(--header-h) + env(safe-area-inset-top, 0px) + 8px); } }
