/* v18 — the showroom. Existing colour and type tokens remain the identity. */
:root { --text-3: #939393; --r2: 14px; --r3: 22px; }
html[data-theme="light"], body[data-theme="light"] { --text-3: #64615c; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 4px; }
button, input, select { -webkit-tap-highlight-color: transparent; }
.btn { min-height: 42px; }
header { padding-inline: clamp(20px, 3vw, 48px); }
.lead-card h1 { font-size: clamp(36px, 4vw, 64px); letter-spacing: -.05em; line-height: 1.04; max-width: 9em; }
.lead-card .eyebrow { margin-bottom: 28px; }
.lead-intro { line-height: 1.7; max-width: 31em; }
.lead-card .field input { min-height: 52px; border-radius: 10px; }
.lead-go { margin-top: 14px; min-height: 54px; }
.hub, .browse, .prof-wrap { max-width: 1400px; padding: 44px clamp(22px, 4vw, 64px) 80px; }
.hub-intro { margin-bottom: 36px; text-align: left; }
.hub-intro h1 { max-width: 17em; font-size: clamp(32px, 4.1vw, 62px); letter-spacing: -.045em; line-height: 1.1; margin-top: 15px; }
.hub-subtitle { color: var(--text-2); font-size: 16px; margin-top: 15px; }
.hub-cards { gap: 22px; }
.hub-card { border-radius: 20px; text-align: left; box-shadow: none; overflow: hidden; }
.hub-card img { height: clamp(210px, 24vw, 340px); object-fit: cover; }
.hub-body { padding: 25px 28px; }
.hub-body h2 { font-size: 24px; letter-spacing: -.025em; }
.hub-body p { line-height: 1.65; }
.studio-invitation { display: flex; align-items: center; gap: 28px; width: 100%; text-align: left; margin-top: 24px; padding: 27px 34px; border: 1px solid var(--line-2); border-radius: 20px; color: var(--text); background: var(--surface); }
.studio-invitation > span:nth-child(2) { display: grid; gap: 8px; }
.studio-invitation strong { font: 500 clamp(22px, 2vw, 30px) Archivo, sans-serif; letter-spacing: -.025em; }
.studio-invitation span span:last-child { color: var(--text-2); font-size: 14px; }
.studio-invitation > b { margin-left: auto; font-size: 30px; font-weight: 400; }
.studio-invitation-art { display: flex; gap: 4px; align-items: center; width: 98px; height: 80px; transform: rotate(-16deg); flex-shrink: 0; }
.studio-invitation-art i { height: 70px; width: 23px; background: url('/materials/newtechwood-uh61-teak/thumbnail.jpg') center/cover; border: 1px solid #a77f53; box-shadow: 7px 6px 0 #342719; }
.studio-invitation:hover { border-color: var(--text-2); }
.browse-head h1, .prof-head h1 { font-size: clamp(32px, 3.5vw, 48px); letter-spacing: -.04em; }
.mat-grid { gap: 22px; }
.prof-card { border-radius: 18px; }
.prof-stage { min-height: 320px; }
.prof-actions { flex-wrap: wrap; }
.toolbar { border-radius: 16px; padding: 7px; box-shadow: 0 12px 32px #0002; }
.side-body { padding-top: 10px; }
.side-section, .mode-section, .plane-section { padding-block: 24px; }
.material-card { border-radius: 16px; }
.result-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 24px clamp(20px, 3vw, 48px) 18px; flex-shrink: 0; }
.result-heading h1 { font-size: clamp(22px, 2vw, 31px); letter-spacing: -.03em; margin-top: 7px; }
.result-stage { margin: 0 20px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); min-height: min(64vh, 720px); }
.result-controls { padding: 24px; gap: 20px 28px; }
.rc-label { color: var(--text-2); letter-spacing: .1em; font-size: 11px; }
.seg { background: var(--surface-2); border: 1px solid var(--line); padding: 3px; }
.seg button { min-height: 38px; }
.versions button { border-radius: 10px; }
.estimate { margin: 0 24px 20px; border-radius: 18px; }
.result-actions { padding: 18px 24px; }
.scale-check { line-height: 1.7; max-width: 1100px; margin: 0 auto; padding: 14px 24px 20px; color: var(--text-2); }
/* Native dialogs provide the modal focus boundary and Escape behaviour. */
.showroom-dialog, .presentation-dialog { color: var(--text); background: var(--bg); border: 1px solid var(--line-2); padding: 0; max-width: none; max-height: none; width: min(1440px, calc(100vw - 48px)); height: min(900px, calc(100dvh - 48px)); border-radius: 24px; overflow: hidden; margin: auto; }
.showroom-dialog::backdrop, .presentation-dialog::backdrop { background: #000b; backdrop-filter: blur(10px); }
.showroom-dialog[open] { display: flex; flex-direction: column; }
.showroom-head, .presentation-head { position: static; flex-shrink: 0; height: auto; display: flex; align-items: center; justify-content: space-between; padding: 24px 30px; border-bottom: 1px solid var(--line); background: transparent; gap: 12px; }
.showroom-head h2 { font: 500 26px Archivo, sans-serif; letter-spacing: -.035em; margin-top: 8px; }
.studio-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 340px; }
.studio-stage { position: relative; min-width: 0; overflow: hidden; background: radial-gradient(ellipse at 50% 42%, var(--surface-3), var(--surface) 70%); }
.studio-marker { position: absolute; top: 28px; left: 30px; text-transform: uppercase; letter-spacing: .17em; font-size: 11px; color: var(--text-2); pointer-events: none; }
.studio-room { position: absolute; inset: 0; pointer-events: none; }
.studio-back-wall { position: absolute; inset: 0 0 25%; background: repeating-linear-gradient(90deg, transparent 0, transparent calc(25% - 1px), var(--line) calc(25% - 1px), var(--line) 25%), linear-gradient(180deg, transparent 65%, #0000000d); border-bottom: 1px solid var(--line-2); }
.studio-ground { position: absolute; top: 75%; width: 100%; height: 25%; background: linear-gradient(180deg, #00000012, transparent); }
.studio-ground path { fill: none; stroke: var(--line-2); stroke-width: 1; vector-effect: non-scaling-stroke; }
.studio-bearing { position: absolute; top: 23px; right: 24px; z-index: 2; pointer-events: none; text-align: right; padding: 8px 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--glass); font-size: 11px; line-height: 1.7; }
.studio-bearing span { display: block; color: var(--text-2); }
.studio-bearing strong { font-weight: 500; }
#studio-canvas { display: block; position: relative; width: 100%; height: 100%; min-height: 320px; z-index: 1; touch-action: pan-y pinch-zoom; cursor: grab; }
#studio-canvas:active { cursor: grabbing; }
.studio-floor { position: absolute; width: 50%; height: 8%; bottom: 16%; left: 25%; border-radius: 50%; background: #0005; filter: blur(24px); pointer-events: none; }
#studio-status { position: absolute; bottom: 28px; left: 24px; right: 130px; z-index: 2; font-size: 12px; line-height: 1.6; color: var(--text-2); pointer-events: none; }
#studio-reset { position: absolute; bottom: 23px; right: 24px; z-index: 3; background: var(--glass); }
.studio-controls { padding: 28px; border-left: 1px solid var(--line); overflow-y: auto; }
.studio-controls h3 { font: 500 32px/1.08 Archivo, sans-serif; letter-spacing: -.04em; margin: 16px 0 9px; }
#studio-colour { color: var(--text-2); font-size: 14px; }
.studio-materials { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 24px 0; }
.studio-materials button { border: 1px solid var(--line-2); border-radius: 9px; padding: 5px; background: var(--surface); color: var(--text-2); text-align: left; }
.studio-materials button.on { border-color: var(--text); color: var(--text); }
.studio-materials img { width: 100%; height: 45px; object-fit: cover; border-radius: 5px; }
.studio-materials span { display: block; padding: 7px 3px 3px; font-size: 11px; }
.studio-control { margin: 24px 0; }
.studio-control > label { display: block; font-size: 13px; margin-bottom: 16px; }
.studio-control .seg { margin-top: 10px; display: flex; }
.studio-control .seg button { flex: 1; padding: 7px; font-size: 12px; }
.studio-control p, .studio-source { font-size: 12px; line-height: 1.6; color: var(--text-2); margin-top: 12px; }
.studio-control input { width: 100%; accent-color: var(--accent); }
#studio-specs { display: grid; grid-template-columns: 1fr 1.5fr; border-top: 1px solid var(--line); padding-top: 16px; gap: 12px; font-size: 12px; line-height: 1.5; }
#studio-specs dt { color: var(--text-2); }
#studio-specs dd { margin: 0; text-align: right; }
.studio-source { margin-bottom: 22px; }
.studio-controls > .btn { width: 100%; margin-top: 8px; }
#wallar-title small { font: 400 11px Inter, sans-serif; letter-spacing: .07em; text-transform: uppercase; vertical-align: middle; margin-left: 9px; color: var(--text-2); }
.wallar-body { display: grid; grid-template-columns: minmax(0, 1fr) 390px; min-height: 0; flex: 1; }
.wallar-scene { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 35px; min-height: 0; overflow: hidden; background: radial-gradient(ellipse at center, var(--surface-3), var(--surface)); text-align: center; }
.wallar-scene h3 { font: 500 clamp(25px,3vw,44px)/1.1 Archivo,sans-serif; letter-spacing: -.045em; margin: 18px 0 12px; }
.wallar-diagram { display: flex; align-items: center; justify-content: center; width: min(100%,420px); height: min(38vh,360px); min-height: 140px; margin: 22px 0; }
#wallar-panel { display: flex; max-height: 100%; max-width: 100%; box-shadow: 12px 14px 0 #0002, 18px 30px 35px #0002; border: 1px solid #61482f; }
#wallar-panel span { flex: 1; min-width: 0; min-height: 0; background-size: cover; background-position: center; border-right: 1px solid #0005; }
#wallar-size { font-size: 16px; margin: 12px 0; font-variant-numeric: tabular-nums; }
.wallar-scene small { color: var(--text-2); font-size: 11px; line-height: 1.5; }
.wallar-controls { overflow-y: auto; padding: 28px; border-left: 1px solid var(--line); }
.wallar-intro { font-size: 15px; line-height: 1.65; margin: 0 0 25px; }
.wallar-controls label { display: block; font-size: 12px; margin: 18px 0 9px; color: var(--text-2); }
.wallar-controls select, .wallar-controls input { width: 100%; background: var(--surface); color: var(--text); border: 1px solid var(--line-2); border-radius: 8px; padding: 13px 10px; font: inherit; }
.wallar-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.wallar-fields > div { min-width: 0; }
.wallar-controls .btn { width: 100%; margin-top: 14px; }
#wallar-status { font-size: 12px; color: var(--text-2); line-height: 1.65; }
#wallar-open img { width: 24px; height: 24px; object-fit: cover; border-radius: 3px; }
#wallar-open[hidden], #wallar-download[hidden] { display: none !important; }
.wallar-controls ol { padding-left: 19px; font-size: 12px; line-height: 1.65; margin: 24px 0; }
.wallar-controls li { margin: 10px 0; }
.wallar-limits { font-size: 11px; line-height: 1.6; color: var(--text-2); border-top: 1px solid var(--line); padding-top: 18px; }
.wallar-polish { border-top: 1px solid var(--line); margin-top: 24px; padding-top: 18px; }
.wallar-polish p { font-size: 12px; line-height: 1.65; color: var(--text-2); }
.polish-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0,1fr) 360px; }
.polish-preview { min-width: 0; min-height: 0; display: flex; flex-direction: column; padding: 28px; gap: 18px; background: var(--surface); }
.polish-picture { display: flex; flex: 1; align-items: center; justify-content: center; min-height: 0; overflow: hidden; border-radius: 14px; border: 1px solid var(--line); }
#polish-image { width: 100%; height: 100%; object-fit: contain; }
#polish-empty { text-align: center; max-width: 320px; color: var(--text-2); font-size: 14px; line-height: 1.8; padding: 30px; }
.polish-choices { display: flex; justify-content: center; }
.polish-choices button { flex: 1; max-width: 240px; }
#polish-caption { min-height: 2em; font-size: 12px; line-height: 1.6; color: var(--text-2); text-align: center; }
.polish-controls { overflow-y: auto; padding: 28px; border-left: 1px solid var(--line); }
.polish-controls h3 { font: 500 28px/1.15 Archivo, sans-serif; letter-spacing: -.035em; margin: 18px 0; }
.polish-controls p { font-size: 13px; line-height: 1.7; color: var(--text-2); margin: 14px 0; }
.polish-controls .btn { width: 100%; margin-top: 12px; white-space: normal; }
#polish-context { color: var(--text); font-size: 12px; }
#ar-polish [hidden] { display: none !important; }
#polish-status { min-height: 3.4em; }
@media (max-width: 760px) {
  .polish-body { display: block; overflow-y: auto; }
  .polish-preview { min-height: 340px; height: 44svh; padding: 18px; gap: 12px; }
  .polish-controls { overflow: visible; border-left: 0; border-top: 1px solid var(--line); padding: 24px; }
  .studio-bearing { top: 15px; right: 16px; font-size: 10px; }
}
@media (max-width: 760px) {
  .wallar-body { display: block; overflow-y: auto; }
  .wallar-scene { padding: 25px; min-height: 360px; }
  .wallar-diagram { height: 220px; margin: 18px 0; }
  .wallar-controls { overflow: visible; border-left: 0; border-top: 1px solid var(--line); padding: 24px; }
}
.ceiling-body { display: grid; grid-template-columns: minmax(0,1fr) 360px; min-height: 0; flex: 1; }
.ceiling-stage { display: flex; flex-direction: column; min-height: 0; min-width: 0; background: var(--surface); padding: 24px; gap: 16px; }
.ceiling-picture { display: flex; flex: 1; align-items: center; justify-content: center; min-height: 200px; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: radial-gradient(ellipse at center, var(--surface-3), var(--surface)); }
#ceiling-empty { text-align: center; padding: 24px; }
#ceiling-empty h3 { font: 500 clamp(24px,3vw,38px)/1.15 Archivo,sans-serif; letter-spacing: -.04em; margin: 22px 0 12px; }
#ceiling-empty p { color: var(--text-2); font-size: 13px; line-height: 1.8; margin-bottom: 24px; }
.ceiling-line-art { display: block; transform: perspective(180px) rotateX(40deg); font: 200 54px/1 Archivo,sans-serif; letter-spacing: 10px; color: var(--text-2); }
#ceiling-canvas { display: block; touch-action: none; cursor: crosshair; max-width: 100%; outline-offset: -3px; }
#ceiling-canvas:focus-visible { outline: 2px solid var(--text); }
#ceiling-views { display: flex; width: 100%; }
#ceiling-views button { flex: 1; padding: 10px 6px; min-height: 42px; font-size: 12px; }
#ceiling-hint { margin: 0; min-height: 3.3em; font-size: 12px; line-height: 1.65; color: var(--text-2); text-align: center; }
.ceiling-controls { overflow-y: auto; padding: 26px; border-left: 1px solid var(--line); }
.ceiling-controls fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
.ceiling-controls .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.ceiling-step { margin-bottom: 25px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.ceiling-step:last-child { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }
.ceiling-controls p { font-size: 12px; line-height: 1.75; color: var(--text-2); margin: 12px 0; }
.ceiling-controls small { display: block; font-size: 11px; line-height: 1.65; color: var(--text-2); margin: 12px 0; }
.ceiling-controls label { display: block; font-size: 12px; margin: 16px 0 9px; }
.ceiling-controls select { width: 100%; min-height: 44px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface); color: var(--text); padding: 10px; font: inherit; font-size: 12px; }
.ceiling-controls input[type=range] { width: 100%; min-height: 32px; accent-color: var(--accent); }
.ceiling-controls .btn { width: 100%; min-height: 42px; margin-top: 8px; white-space: normal; }
.ceiling-tools,.ceiling-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ceiling-tools .btn { font-size: 11px; padding: 10px 8px; }
.ceiling-tools [aria-pressed=true] { border-color: var(--text); background: var(--surface-3); }
.ceiling-controls .ceiling-confirm { display: flex; gap: 10px; align-items: flex-start; line-height: 1.6; cursor: pointer; }
.ceiling-confirm input { width: 18px; height: 18px; flex: 0 0 auto; margin-top: 1px; accent-color: var(--accent); }
.ceiling-range-labels { display: flex; justify-content: space-between; font-size: 10px; color: var(--text-2); }
#ceiling-studio [hidden] { display: none !important; }
@media (max-width: 760px) {
  .ceiling-body { display: block; overflow-y: auto; }
  .ceiling-stage { min-height: 350px; height: 52svh; padding: 16px; gap: 12px; }
  .ceiling-picture { min-height: 200px; }
  .ceiling-controls { overflow: visible; border-left: 0; border-top: 1px solid var(--line); padding: 24px; }
  #ceiling-empty { padding: 12px; }
  .ceiling-line-art { font-size: 32px; }
  #ceiling-empty h3 { font-size: 24px; margin-top: 10px; }
  #ceiling-empty p { margin-bottom: 12px; }
  #ceiling-hint { font-size: 11px; }
}
.presentation-dialog { width: 100vw; height: 100dvh; border: 0; border-radius: 0; }
.presentation-dialog[open] { display: flex; flex-direction: column; }
.presentation-head { padding: 24px 38px; border: 0; }
.presentation-head h2 { font: 500 clamp(22px, 2vw, 32px) Archivo, sans-serif; letter-spacing: -.035em; margin-top: 7px; }
.presentation-stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 0 32px; overflow: hidden; }
.presentation-image { position: relative; height: 100%; max-width: 100%; max-height: 100%; overflow: hidden; border-radius: 16px; }
.presentation-image img { width: 100%; height: 100%; object-fit: contain; display: block; }
#presentation-after { position: absolute; inset: 0; }
#presentation-line { position: absolute; height: 100%; top: 0; width: 1px; background: #fff9; pointer-events: none; }
.presentation-tag { position: absolute; top: 20px; left: 20px; font-size: 10px; letter-spacing: .13em; text-transform: uppercase; background: #0009; color: #fff; border: 1px solid #ffffff40; padding: 10px 14px; border-radius: 99px; }
.presentation-tag.after { right: 20px; left: auto; }
.presentation-footer { padding: 24px 38px 32px; display: grid; grid-template-columns: 1fr minmax(180px, 300px) minmax(180px, 260px); align-items: center; gap: 32px; }
.presentation-footer p { font-size: 18px; margin: 7px 0; }
.presentation-footer small { display: block; font-size: 11px; color: var(--text-2); max-width: 400px; line-height: 1.5; }
.presentation-footer label { display: block; color: var(--text-2); font-size: 12px; margin-bottom: 12px; }
.presentation-footer input, .presentation-footer select { width: 100%; accent-color: var(--accent); }
.presentation-footer select { background: var(--surface); color: var(--text); border: 1px solid var(--line-2); border-radius: 8px; min-height: 42px; padding: 8px; }
@media (min-width: 1100px) { .hub-cards { grid-template-columns: 1.15fr 1fr; } .result-controls { align-items: flex-start; } }
@media (max-width: 720px) {
  .hub, .browse, .prof-wrap { padding: 26px 20px 96px; }
  .hub-cards { grid-template-columns: 1fr; }
  .hub-card img { height: 205px; }
  .hub-body { padding: 21px; }
  .studio-invitation { padding: 22px; gap: 20px; }
  .studio-invitation-art { width: 52px; height: 80px; }
  .studio-invitation-art i { width: 13px; }
  .studio-invitation span span:last-child { font-size: 12px; }
  .studio-invitation > b { display: none; }
  .result-heading { padding: 20px 16px 16px; align-items: flex-start; }
  .result-heading h1 { font-size: 22px; max-width: 8em; }
  .result-heading .btn { max-width: 130px; white-space: normal; line-height: 1.4; padding: 10px 13px; }
  .result-stage { margin: 0 10px; min-height: 330px; height: 48svh; border-radius: 16px; }
  .result-stage .compare-wrap { max-height: 100%; }
  .result-controls { padding: 20px 16px; gap: 18px; }
  .estimate { margin: 0 16px 18px; }
  .view-toggle button { padding: 8px 12px; font-size: 11px; }
  .showroom-dialog { width: 100vw; height: 100dvh; border: 0; border-radius: 0; }
  .showroom-head, .presentation-head { padding: 18px 20px; }
  .showroom-head h2 { font-size: 23px; }
  .studio-body { display: block; overflow-y: auto; }
  .studio-stage { height: 48svh; min-height: 350px; }
  .studio-controls { border-left: 0; border-top: 1px solid var(--line); padding: 25px; overflow: visible; }
  .studio-controls h3 { font-size: 30px; }
  .studio-materials { grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .studio-materials span { font-size: 10px; }
  .studio-marker { top: 20px; left: 22px; }
  #studio-status { bottom: 20px; left: 20px; right: 180px; font-size: 11px; }
  #studio-reset { bottom: 19px; right: 18px; }
  .presentation-stage { padding: 0 12px; }
  .presentation-image { width: 100%; height: auto; }
  .presentation-footer { padding: 20px; gap: 20px; grid-template-columns: 1fr 1fr; }
  .presentation-footer > div:first-child { grid-column: 1 / -1; }
  .presentation-footer p { font-size: 16px; }
  .presentation-tag { top: 12px; left: 12px; padding: 7px 10px; font-size: 9px; }
  .presentation-tag.after { right: 12px; }
}
@media (prefers-reduced-motion: reduce) { .showroom-dialog *, .presentation-dialog *, .studio-invitation * { transition: none !important; animation: none !important; } }
