:root {
  --bg: #111;
  --card: #f5f5f7;
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --line: #d2d2d7;
  --blue: #e17100;
  --blue-d: #a45200;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { --bn: 0px; font-family: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif; -webkit-font-smoothing: antialiased; min-height: 100dvh; }
button { font: inherit; color: inherit; cursor: pointer; }
[hidden] { display: none !important; }


.app { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 24px; align-items: start; max-width: 1400px; margin: 0 auto; padding: 8px 24px; }
/* the 3D shower stays in view while the options scroll past on the right (or underneath, on a phone) */
.stage { position: sticky; top: var(--bn); height: calc(100vh - var(--bn)); height: calc(100dvh - var(--bn)); padding: 8px 0; display: flex; flex-direction: column; align-items: center; gap: 8px; background: var(--bg); z-index: 2; }
.stage { --avail: calc(100dvh - var(--bn) - 74px); justify-content: center; }
.frame { position: relative; flex: none; width: min(100%, calc(var(--avail) * 0.72)); aspect-ratio: 0.72; border-radius: 20px; overflow: hidden; background: var(--bg); }
#view { width: 100%; height: 100%; display: block; touch-action: pan-y; cursor: grab; }
#view:active { cursor: grabbing; }
.hint { position: absolute; left: 0; right: 0; bottom: 10px; text-align: center; font-size: 12px; color: #9a9a9a; pointer-events: none; opacity: .8; }
.under { text-align: center; color: #fff; min-height: 46px; max-width: 100%; width: 100%; padding: 0 12px; box-sizing: border-box; }
.pickline { font-size: 15px; }
.pickline b { font-weight: 600; }
.onsite { font-size: 12px; color: #a8a8a8; margin-top: 3px; }
body.view .onsite, body.view .toggles { display: none; }
.toggles { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); display: grid; gap: 10px; }
.tg { display: flex; flex-direction: column; align-items: center; gap: 3px; width: 64px; padding: 9px 4px 7px; border-radius: 16px; border: 1.5px solid rgba(255,255,255,.28); background: rgba(17,17,17,.62); backdrop-filter: blur(6px); color: #fff; font-size: 12px; font-weight: 600; }
.tg svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; }
.tg[aria-pressed="true"] { background: var(--blue); border-color: var(--blue); }
.tg[aria-pressed="true"] svg { fill: rgba(255,255,255,.25); }

.panel { background: var(--card); border-radius: 28px; padding: 26px 28px 24px; box-shadow: 0 30px 80px rgba(0,0,0,.35); margin: 8px 0; }
.brand { display: flex; align-items: center; gap: 12px; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.brand img { height: 40px; width: auto; background: #111; border-radius: 8px; padding: 4px 8px; }
.progress { display: flex; gap: 5px; margin: 12px 0 6px; }
.progress i { flex: 1; height: 4px; border-radius: 2px; background: var(--line); }
.progress i.on { background: var(--blue); }
.stepno { font-size: 13px; color: var(--muted); }
h1 { font-size: 30px; line-height: 1.1; letter-spacing: -.02em; margin: 14px 0 6px; font-weight: 700; }
.sub { color: var(--muted); font-size: 15px; line-height: 1.4; margin: 0 0 18px; }

.opts { display: grid; gap: 10px; }
.opts.two { grid-template-columns: 1fr 1fr; }
.opts.colors { grid-template-columns: repeat(4, 1fr); gap: 12px 8px; }
.opt { display: flex; align-items: center; gap: 14px; text-align: left; background: #fff; border: 1.5px solid var(--line); border-radius: 16px; padding: 12px 14px; transition: border-color .15s, box-shadow .15s; }
.opt:hover { border-color: #a1a1a6; }
.opt[aria-pressed="true"] { border-color: var(--blue); box-shadow: 0 0 0 1.5px var(--blue); }
.opt svg { flex: none; width: 64px; height: 44px; }
.opt b { display: block; font-size: 16px; font-weight: 600; }
.opt span { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; }
.opts.two .opt { flex-direction: column; text-align: center; gap: 8px; padding: 14px 8px; }
.opts.two .opt svg { width: 72px; height: 50px; }

.sw { display: flex; flex-direction: column; align-items: center; gap: 6px; background: none; border: 0; padding: 0; }
.sw i { width: 100%; aspect-ratio: 1; border-radius: 14px; border: 1.5px solid var(--line); background-size: cover; background-position: center; box-shadow: inset 0 0 0 2px #fff; }
.sw[aria-pressed="true"] i { border-color: var(--blue); box-shadow: inset 0 0 0 2px #fff, 0 0 0 1.5px var(--blue); }
.sw span { font-size: 11.5px; line-height: 1.15; color: var(--ink); text-align: center; }
.row-label { font-size: 13px; font-weight: 600; color: var(--muted); margin: 20px 0 8px; }
.chips { display: flex; gap: 8px; }
.chip { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; background: #fff; border: 1.5px solid var(--line); border-radius: 12px; padding: 9px 6px; font-size: 14px; }
.chip i { width: 14px; height: 14px; border-radius: 4px; border: 1px solid rgba(0,0,0,.2); }
.chip[aria-pressed="true"] { border-color: var(--blue); box-shadow: 0 0 0 1.5px var(--blue); }

.pick { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.pick .opt { justify-content: center; font-size: 22px; font-weight: 600; padding: 16px 0; }

.note { margin-top: 16px; font-size: 14px; color: var(--ink); background: #e8e8ed; border-radius: 12px; padding: 12px 14px; line-height: 1.4; }

.nav { display: flex; gap: 10px; margin-top: 22px; }
.btn { border: 0; border-radius: 980px; padding: 13px 22px; font-size: 16px; font-weight: 600; background: var(--blue); color: #fff; text-align: center; text-decoration: none; display: inline-block; }
.btn:hover { background: var(--blue-d); }
.btn.ghost { background: #e8e8ed; color: var(--ink); }
.btn.ghost:hover { background: #dcdce1; }
.btn.block { display: block; width: 100%; }
.nav .btn { flex: 1; }
.nav .btn[disabled] { opacity: .35; cursor: default; }

.list { margin: 4px 0 14px; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.list li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.list li span { color: var(--muted); }
.list li b { font-weight: 600; text-align: right; }
.rep { font-size: 12px; color: var(--muted); margin: 0 0 14px; }
.actions { display: grid; gap: 10px; }
.actions.two { grid-template-columns: 1fr 1fr; }
.send { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.send h2 { font-size: 17px; margin: 0 0 10px; }
.send input { width: 100%; font: inherit; font-size: 16px; padding: 11px 12px; border: 1.5px solid var(--line); border-radius: 12px; margin-bottom: 8px; background: #fff; }
.send input:focus { outline: none; border-color: var(--blue); }
.sent { background: #e6f4ea; color: #14532d; border-radius: 12px; padding: 14px; font-size: 15px; line-height: 1.4; }
.fine { font-size: 12px; color: var(--muted); margin: 8px 0 0; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: #1d1d1f; color: #fff; padding: 10px 18px; border-radius: 980px; font-size: 14px; opacity: 0; pointer-events: none; transition: .25s; z-index: 10; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* customer view (?view=1) */
body.view .app { grid-template-columns: minmax(0, 1fr) 380px; }

/* phone, small tablets and iPad portrait: 3D shower pinned on top, options scroll underneath (same as the showroom) */
@media (max-width: 700px), (max-width: 1100px) and (orientation: portrait) {
  .app { display: block; padding: 0 0 24px; }
  .stage { height: calc(56dvh - var(--bn)); min-height: 330px; padding: 0 0 6px; }
  .stage { justify-content: flex-start; }
  .frame { width: 100%; aspect-ratio: auto; border-radius: 0; flex: 1 1 0; min-height: 0; }
  .panel { margin: 10px 10px 0; padding: 22px 18px 20px; border-radius: 24px; }
  h1 { font-size: 26px; }
  .tiles { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 701px) and (max-width: 1000px) and (orientation: landscape) { .app { grid-template-columns: minmax(0, 1fr) 360px; gap: 14px; padding: 8px 12px; } .tiles { grid-template-columns: repeat(3, 1fr); } }

.buy { display: flex; gap: 12px; align-items: center; background: #fff; border: 1.5px solid var(--line); border-radius: 16px; padding: 12px; margin: 4px 0 14px; }
.buy i { flex: none; width: 60px; height: 60px; border-radius: 10px; background-size: cover; background-position: center; border: 1px solid var(--line); }
.buy small { display: block; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.buy b { display: block; font-size: 17px; }
.buy span { display: block; font-size: 13px; color: var(--muted); }
.buy a { display: inline-block; margin-top: 4px; font-size: 13px; color: var(--blue); text-decoration: none; font-weight: 600; }
.buy a:hover { text-decoration: underline; }

/* vein labels + filter */
.sw em { font-style: normal; font-size: 10.5px; color: var(--muted, #6e6e73); margin-top: -3px; }
.chips.filter { flex-wrap: wrap; margin-bottom: 14px; }
.chips.filter .chip { flex: 0 0 auto; padding: 7px 12px; font-size: 13px; }

/* sample badge */
u.sample { text-decoration: none; position: absolute; top: 4px; left: 4px; background: #111; color: #f79822; font-size: 9px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 2px 5px; border-radius: 5px; }
.sw i { position: relative; }
.buy small u.sample { position: static; padding: 1px 5px; margin-left: 2px; }

/* send form */
.sub.small { font-size: 13px; margin: 0 0 10px; }
.send textarea { width: 100%; font: inherit; font-size: 16px; padding: 11px 12px; border: 1.5px solid var(--line); border-radius: 12px; margin-bottom: 8px; background: #fff; resize: vertical; }
.send textarea:focus { outline: none; border-color: var(--blue); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.err { color: #b00020; font-size: 14px; margin: 0 0 8px; }
.btn[disabled] { opacity: .5; cursor: default; }

/* link banner + expired screen */
.banner { background: #1d1d1d; color: #f79822; text-align: center; font-size: 13px; padding: 8px 12px; }
.expired { max-width: 460px; margin: 0 auto; padding: 24px 16px; min-height: 100dvh; display: flex; align-items: center; }
.expired .panel { width: 100%; }
.expired .big-phone { display: block; margin-top: 16px; text-align: center; }

/* one-page flow */
.sec { font-size: 19px; letter-spacing: -.01em; margin: 26px 0 10px; font-weight: 700; }
.panel section:first-of-type .sec { margin-top: 18px; }
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px 8px; }
.sw span { font-size: 12px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.seg button { display: flex; align-items: center; justify-content: center; gap: 10px; background: #fff; border: 1.5px solid var(--line); border-radius: 14px; padding: 10px; font-size: 15px; }
.seg button svg { width: 38px; height: 28px; }
.seg button[aria-pressed="true"] { border-color: var(--blue); box-shadow: 0 0 0 1.5px var(--blue); }
.foot { font-size: 12px; color: var(--muted); line-height: 1.4; margin: 22px 0 0; text-align: center; }
.send { border-top: 1px solid var(--line); margin-top: 26px; padding-top: 4px; }
.send .sec { margin-top: 18px; }
.dl { margin-top: 10px; }

/* the 24-hour banner stays pinned above the 3D view and takes its height out of it */
.banner { position: sticky; top: 0; z-index: 5; height: 33px; line-height: 17px; }
body:has(.banner:not([hidden])) { --bn: 33px; }

/* ---------- task 68 ---------- */
/* no WebGL: same message as the showroom */
.nogl { max-width: 460px; margin: 0 auto; padding: 24px 16px; min-height: 100dvh; display: flex; align-items: center; }
.nogl .panel { width: 100%; text-align: center; }

/* tap-to-full-screen: a CSS overlay (not the Fullscreen API, so it works in iOS Safari) */
.fsb { position: absolute; z-index: 3; display: flex; align-items: center; justify-content: center; gap: 6px; border: 1.5px solid rgba(255,255,255,.28); background: rgba(17,17,17,.62); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); color: #fff; font-size: 12px; font-weight: 600; }
.fsb svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.fs-close { display: none; top: max(12px, env(safe-area-inset-top)); right: 12px; width: 44px; height: 44px; border-radius: 50%; }
.fs-toggle { left: 10px; bottom: 10px; height: 36px; padding: 0 12px 0 10px; border-radius: 18px; }
.fs-toggle .i-half, body.fs .fs-toggle .i-full { display: none; }
body.fs .fs-toggle .i-half { display: inline; }
body.view .fs-toggle { bottom: 10px; }
body.fs { overflow: hidden; }
body.fs .stage { z-index: 30; }
body.fs .frame { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; aspect-ratio: auto; border-radius: 0; z-index: 30; animation: sd-fs-in 450ms cubic-bezier(.2,.8,.2,1); }
body.fs #view { touch-action: none; }
body.fs .fs-close { display: flex; }
body.fs .hint { bottom: max(14px, env(safe-area-inset-bottom)); }
body.fs .fs-toggle { bottom: max(10px, env(safe-area-inset-bottom)); }
@media (min-width: 769px) { body.fs .fs-toggle { display: none; } } /* full / half is the phone toggle; bigger screens close with the X or Esc */
@keyframes sd-fs-in { from { opacity: .4; transform: scale(.96); } to { opacity: 1; transform: none; } }

/* selected-option feedback and section fade-in */
.sw, .opt, .chip, .seg button, .tg { transition: border-color .4s ease, box-shadow .4s ease, background-color .4s ease, color .4s ease; }
.sw i { transition: box-shadow .4s ease, transform .4s ease; }
.pop { animation: sd-pop 440ms cubic-bezier(.2,.8,.2,1); }
@keyframes sd-pop { 0% { transform: scale(1); } 35% { transform: scale(.93); } 70% { transform: scale(1.03); } 100% { transform: scale(1); } }
.panel > * { animation: sd-rise 560ms cubic-bezier(.2,.7,.2,1) both; }
.panel > :nth-child(2) { animation-delay: 60ms; } .panel > :nth-child(3) { animation-delay: 120ms; } .panel > :nth-child(4) { animation-delay: 180ms; }
.panel > :nth-child(5) { animation-delay: 240ms; } .panel > :nth-child(n+6) { animation-delay: 300ms; }
@keyframes sd-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* task 68 round 2: ?fps=1 meter for checking real devices */
.fps-meter { position: fixed; left: 8px; top: calc(8px + env(safe-area-inset-top)); z-index: 60; padding: 4px 8px; border-radius: 6px; background: rgba(0, 0, 0, 0.72); color: #7dff9a; font: 600 12px/1.3 ui-monospace, Menlo, monospace; pointer-events: none; }

/* ---------- task 69: shower size step ---------- */
.size .seg button { flex-direction: column; gap: 4px; padding: 10px 6px; }
.size .seg button svg { width: 50px; height: 40px; }
.size .seg b { font-size: 14px; font-weight: 600; }
.sidepick { display: flex; align-items: center; gap: 12px; margin: 0 0 12px; }
.sidepick > span { flex: none; font-size: 13px; font-weight: 600; color: var(--muted); }
.sidepick .chips { flex: 1; }
.dims { display: grid; gap: 10px; }
.dim { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 8px; background: #fff; border: 1.5px solid var(--line); border-radius: 16px; padding: 8px 8px 8px 14px; }
.dl b { display: block; font-size: 15px; font-weight: 600; }
.dl span { display: block; font-size: 12px; color: var(--muted); }
.step { display: flex; align-items: center; background: #f0f0f3; border-radius: 14px; }
.step button { width: 48px; height: 48px; border: 0; background: none; border-radius: 14px; font-size: 24px; line-height: 1; font-weight: 500; color: var(--ink); touch-action: manipulation; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.step button:active:not(:disabled) { background: #e1e1e6; }
.step button:disabled { color: #c2c2c7; cursor: default; }
.step button:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
.step output { min-width: 42px; text-align: center; font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.dimmsg { min-height: 18px; margin: 8px 2px 0; font-size: 13px; color: var(--blue-d); }
.dimmsg:empty { min-height: 0; margin: 0; }
/* #1051: below ~460px the two steppers leave the label ~18px wide ("Wid…"); put the label on its own line above them */
@media (max-width: 460px) {
  .dim { grid-template-columns: 1fr 1fr; padding: 10px 8px 8px; row-gap: 6px; }
  .dl { grid-column: 1 / -1; display: flex; align-items: baseline; gap: 6px; padding-left: 6px; }
  .dl b, .dl span { display: inline; }
  .dim .step { justify-content: space-between; }
}
.size .row-label { margin: 14px 0 8px; }
.presets { flex-wrap: wrap; }
.presets .chip { flex: 1 1 calc(25% - 8px); min-width: 0; padding: 9px 4px; font-size: 13px; white-space: nowrap; }
@media (max-width: 380px) { .step button { width: 44px; } .step output { min-width: 36px; } .presets .chip { flex-basis: calc(50% - 8px); } }
/* task 69 v2: caption under the 3D view on one line (tile · tile size · W×D×H · type); fitPickline() drops the tile size
   (fit1), then shortens the type (fit2) when it would wrap */
.pickline { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pickline .pl-short, .pickline.fit1 .pl-long { display: none; }
.pickline.fit1 .pl-short { display: inline; }
.pickline.fit2 { font-size: 13px; }
.pickline.fit3 .pl-tsz { display: none; }
.pickline.fit4 { font-size: 12px; }
@media (max-width: 420px) { .pickline { font-size: 14px; } }
#shelfOut { flex: 1; min-width: 96px; } /* task 1067 */
