/* See it on your wall: the room stage, the framed print drawn to scale, the order panel, the size guide and the
   gifts / business strip. Plan: _work/design-plan.md (Tool). Corners: surfaces 32px top-left only, pills for buttons. */

/* ---------- Opener ---------- */
.tool {
  position: relative; isolation: isolate; overflow: clip;
  background: var(--night); color: var(--on-night);
  padding: calc(var(--head-h) + 14px) 0 clamp(28px, 4.5vh, 48px);
}
.tool__glow {
  position: absolute; inset: -25% -10%; z-index: -1; pointer-events: none;
  background: url("../img/pour-fill.webp") 50% 50% / cover;
  opacity: .2; filter: blur(70px) saturate(1.4);
}
.tool::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(ellipse 70% 90% at 30% 60%, rgba(27, 12, 23, .2), rgba(27, 12, 23, .85) 75%);
}
.tool__grid { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 456px; gap: clamp(28px, 3.2vw, 48px); align-items: start; }
.on-night .tool__panel p { color: var(--ink); }
.on-night .tool__panel .tool__parts { color: var(--ink-soft); }
.on-night .stage__chip { color: var(--on-night); }
.tool__intro h1 { font-size: clamp(2.4rem, 4.2vw, 4rem); margin: 0 0 .16em; }
.tool__intro .lede { margin: 0 0 20px; color: var(--on-night-soft); }

/* ---------- Stage: the room fills the height, centred on the hanging point (container units keep the scale) ---------- */
.stage-wrap { position: relative; }
.stage-wrap__line { position: absolute; inset: 14px -14px -14px 14px; border: 1.5px solid var(--gold); border-radius: var(--r-one); pointer-events: none; z-index: -1; }
.stage {
  position: relative; display: block; overflow: clip; isolation: isolate;
  height: clamp(360px, calc(100svh - 330px), 720px);
  border-radius: var(--r-one); background: #cfc8c3;
  container-type: size; perspective: 1600px;
}
.stage__tilt, .stage__cam { position: absolute; inset: 0; display: block; }
.stage__tilt { transform-style: preserve-3d; }
.stage__cam { transform-origin: 0 0; }
.stage .stage__room, .wp {
  /* room height fills the stage (or its width on very wide stages); u = one original pixel on screen */
  --rh: max(100cqh, calc(100cqw * 1536 / 2752));
  --rw: calc(var(--rh) * 2752 / 1536);
  --u: calc(var(--rh) / 1536);
  --rl: clamp(calc(100cqw - var(--rw)), calc(50cqw - var(--cx) * var(--u)), 0px);
  --rt: clamp(calc(100cqh - var(--rh)), calc(50cqh - var(--cy) * var(--u)), 0px);
}
.stage .stage__room {
  position: absolute; left: var(--rl); top: var(--rt); width: var(--rw); height: var(--rh); max-width: none;
  object-fit: fill; opacity: 0; visibility: hidden;
}
.stage .stage__room.is-on { opacity: 1; visibility: visible; }

/* Window light drifting across the wall (tool.js moves --sx; CSS keeps a still patch without JS) */
.stage__sun {
  position: absolute; inset: 0; z-index: 3; pointer-events: none; display: block;
  --sx: 22%;
  background:
    radial-gradient(46% 70% at var(--sx) 30%, rgba(255, 236, 200, .8), rgba(255, 236, 200, 0) 62%),
    linear-gradient(180deg, rgba(255, 255, 255, .08), rgba(0, 0, 0, .06));
  mix-blend-mode: soft-light;
}
.stage__sun::before {
  /* the beam travels by background-position (not left), so its drift never counts as a layout shift */
  content: ""; position: absolute; top: 4%; left: 0; width: 100%; height: 64%;
  background: linear-gradient(90deg, rgba(255, 246, 226, 0), rgba(255, 246, 226, .7) 30%, rgba(255, 246, 226, .7) 70%, rgba(255, 246, 226, 0)) no-repeat;
  background-size: 20% 100%; background-position: calc((var(--sx) - 9%) * 1.25) 0;
  transform: skewX(-16deg); filter: blur(20px); opacity: .95;
}
.stage::after {
  content: ""; position: absolute; inset: 0; z-index: 4; pointer-events: none;
  background: radial-gradient(ellipse 85% 85% at 50% 45%, rgba(27, 12, 23, 0) 60%, rgba(27, 12, 23, .32));
}

/* ---------- The framed print: every size is cm x (px per cm at the wall) x (screen px per original px) ---------- */
.wp {
  --k: calc(var(--ppc) * var(--u));
  --F: calc(var(--f) * var(--k));
  --M: calc(var(--m) * var(--k));
  --shx: 1;
  position: absolute; z-index: 2; display: block;
  --W: calc((var(--pw) + 2 * var(--m) + 2 * var(--f)) * var(--k));
  --H: calc((var(--ph) + 2 * var(--m) + 2 * var(--f)) * var(--k));
  /* hung from the centre line, bottom edge on the hanging line (no translate: GSAP owns the transform) */
  left: calc(var(--rl) + var(--cx) * var(--u) - var(--W) / 2);
  top: calc(var(--rt) + var(--by) * var(--u) - var(--H));
  width: var(--W);
  height: var(--H);
  transform-origin: 50% 0;
  box-shadow:
    calc(var(--k) * .9 * var(--depth) * var(--shx)) calc(var(--k) * 1.5 * var(--depth)) calc(var(--k) * 2.6 * var(--depth)) rgba(30, 18, 10, .32),
    calc(var(--k) * .25 * var(--depth) * var(--shx)) calc(var(--k) * .4 * var(--depth)) calc(var(--k) * .6 * var(--depth)) rgba(30, 18, 10, .28);
}
.wp > span { position: absolute; display: block; }
.wp__fin { inset: 0; opacity: 0; }
.wp[data-frame="black"] .wp__fin--black, .wp[data-frame="white"] .wp__fin--white,
.wp[data-frame="oak"] .wp__fin--oak, .wp[data-frame="gold"] .wp__fin--gold { opacity: 1; }
.wp__fin--black { background: linear-gradient(135deg, #46403f 0%, #171415 38%, #2b2627 64%, #0e0c0d 100%); }
.wp__fin--white { background: linear-gradient(135deg, #ffffff 0%, #eeebe6 45%, #faf8f4 70%, #dcd7cf 100%); }
.wp__fin--gold { background: linear-gradient(135deg, #7d5a18 0%, #e7c264 20%, #b38834 40%, #f6df92 58%, #a77a26 78%, #d8b45a 100%); }
.wp__fin--oak {
  background:
    repeating-linear-gradient(0deg, rgba(92, 56, 24, 0) 0 1.5px, rgba(92, 56, 24, .2) 1.5px 2.5px, rgba(92, 56, 24, 0) 2.5px 5px),
    linear-gradient(180deg, #cfa06a, #b5844f 45%, #c99862 62%, #a67443);
}
.wp__fin--oak::before, .wp__fin--oak::after {
  content: ""; position: absolute; inset: 0;
  background:
    repeating-linear-gradient(90deg, rgba(92, 56, 24, 0) 0 1.5px, rgba(92, 56, 24, .2) 1.5px 2.5px, rgba(92, 56, 24, 0) 2.5px 5px),
    linear-gradient(90deg, #c99a63, #ad7c48 50%, #c4935b);
}
.wp__fin--oak::before { clip-path: polygon(0 0, var(--F) var(--F), var(--F) calc(100% - var(--F)), 0 100%); }
.wp__fin--oak::after { clip-path: polygon(100% 0, 100% 100%, calc(100% - var(--F)) calc(100% - var(--F)), calc(100% - var(--F)) var(--F)); }
/* Mitred bevel: light from the window on the left, so top and left faces catch it */
.wp__bevel {
  inset: 0; border: var(--F) solid;
  border-color: rgba(255, 255, 255, .32) rgba(0, 0, 0, .16) rgba(0, 0, 0, .32) rgba(255, 255, 255, .14);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .3), 0 0 0 1px rgba(0, 0, 0, .14);
  opacity: var(--glass);
}
.wp__bevel::after {
  content: ""; position: absolute; inset: calc(var(--F) * -.55);
  border: 1px solid rgba(255, 255, 255, .2); box-shadow: 0 0 0 1px rgba(0, 0, 0, .1);
}
.wp__mount {
  inset: var(--F);
  background: linear-gradient(160deg, #fdfcf9, #f1eee7);
  box-shadow: inset calc(var(--k) * .35) calc(var(--k) * .45) calc(var(--k) * .9) rgba(30, 20, 10, calc(.3 * var(--glass)));
}
.wp__win {
  position: absolute; display: block; inset: var(--M); overflow: hidden; background: #d9d4cd;
  box-shadow: 0 0 0 calc(min(var(--m), .3) * var(--k)) #fff, 0 0 0 calc(min(var(--m), .3) * var(--k) + 1px) rgba(0, 0, 0, .1);
}
.wp__win::after { content: ""; position: absolute; inset: 0; box-shadow: inset 1px 1px 2px rgba(0, 0, 0, .22); pointer-events: none; }
.stage .wp__img, .wp .wp__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; max-width: none; }
.wp__img:not(.is-on) { opacity: 0; }
.wp__glass {
  inset: var(--F); pointer-events: none; opacity: calc(var(--glass) * .95);
  background: linear-gradient(115deg, rgba(255, 255, 255, 0) 38%, rgba(255, 255, 255, .26) 47%, rgba(255, 255, 255, .08) 53%, rgba(255, 255, 255, 0) 62%);
  background-size: 320% 100%; background-position: var(--gx, 22%) 0; mix-blend-mode: screen;
}

.wp > .wp__glint { inset: var(--F); overflow: hidden; pointer-events: none; --gl: -130%; }
.wp__glint::before { content: ""; position: absolute; top: -10%; bottom: -10%; left: 0; width: 38%; transform: translateX(var(--gl)) skewX(-18deg); background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, .55), rgba(255, 255, 255, 0)); mix-blend-mode: soft-light; }

/* Measuring lines: framed width under the print, height beside it */
.wp > .dim { position: absolute; color: var(--ink); font: 650 .875rem/1 var(--f-body); white-space: nowrap; pointer-events: none; }
.dim i { position: absolute; display: block; background: rgba(42, 20, 36, .7); }
.dim i::before, .dim i::after { content: ""; position: absolute; background: rgba(42, 20, 36, .7); }
.dim b { position: absolute; display: block; padding: 4px 8px; background: rgba(255, 255, 255, .92); border-radius: var(--r-one-sm); font-weight: 650; box-shadow: 0 2px 8px rgba(27, 12, 23, .15); }
.dim--w { left: 0; right: 0; top: calc(100% + 12px); height: 9px; }
.dim--w i { left: 0; right: 0; top: 4px; height: 1px; }
.dim--w i::before, .dim--w i::after { top: -4px; width: 1px; height: 9px; }
.dim--w i::before { left: 0; } .dim--w i::after { right: 0; }
.dim--w b { left: 50%; top: 50%; translate: -50% -50%; }
.dim--h { top: 0; bottom: 0; left: calc(100% + 12px); width: 9px; }
.dim--h i { top: 0; bottom: 0; left: 4px; width: 1px; }
.dim--h i::before, .dim--h i::after { left: -4px; height: 1px; width: 9px; }
.dim--h i::before { top: 0; } .dim--h i::after { bottom: 0; }
.dim--h b { top: 50%; left: 0; translate: 0 -50%; margin-left: 8px; }

/* Stage chip and zoom pill */
.stage__chip {
  position: absolute; left: 16px; bottom: 16px; z-index: 6; margin: 0; max-width: calc(100% - 200px);
  padding: 9px 14px; border-radius: var(--r-one-sm);
  background: rgba(27, 12, 23, .74); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  color: var(--on-night); font-size: .88rem; font-weight: 550; line-height: 1.35;
}
.stage__btns { position: absolute; right: 16px; bottom: 16px; z-index: 6; display: flex; gap: 8px; }
.stage__btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 18px 0 14px;
  border: 1.5px solid rgba(255, 255, 255, .5); border-radius: var(--r-pill); cursor: pointer;
  background: rgba(27, 12, 23, .74); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  color: #fff; font-weight: 650; font-size: .92rem; transition: background .3s, color .3s, border-color .3s;
}
.stage__btn[hidden] { display: none; }
.stage__btn .ico { width: 18px; height: 18px; }
.stage__btn:hover, .stage__btn:focus-visible, .stage__zoom[aria-pressed="true"] { background: var(--gold); border-color: var(--gold); color: var(--ink); }
.no-js .stage__btns, .no-js .stage__hint, .no-js .roomopt--own { display: none; }
.no-js .rooms { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* The print can be dragged and moved with the arrow keys */
.wp:focus-visible { outline: 3px solid var(--gold); outline-offset: 8px; }
.js .wp { touch-action: none; }

/* ---------- Your own wall: the photo never leaves the browser ---------- */
.stage__own { position: absolute; inset: 0; display: block; overflow: hidden; background: var(--night); opacity: 0; visibility: hidden; }
.stage__own.is-on { opacity: 1; visibility: visible; }
.stage__own img { position: absolute; max-width: none; }
.stage__own-bg { inset: -8%; width: 116%; height: 116%; object-fit: cover; filter: blur(26px) brightness(.42) saturate(1.2); }
.stage__own-img { inset: 0; width: 100%; height: 100%; object-fit: contain; }
.stage.is-own .wp { left: calc(var(--ox) - var(--W) / 2); top: calc(var(--oy) - var(--H) / 2); }
.stage.is-own .stage__sun, .stage.is-own .stage__hint-room { display: none; }
.stage.is-empty .wp, .stage.is-empty .stage__chip, .stage.is-empty .stage__btns { visibility: hidden; }
.stage__drop {
  position: absolute; inset: 0; z-index: 7; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(ellipse at 30% 30%, rgba(29, 100, 103, .55), rgba(27, 12, 23, .96) 70%), var(--night);
  color: var(--on-night); text-align: center;
}
.stage__drop[hidden] { display: none; }
.stage__drop::before { content: ""; position: absolute; inset: 18px; border: 1.5px dashed rgba(243, 236, 241, .35); border-radius: var(--r-one); pointer-events: none; }
.stage__drop-in { position: relative; display: grid; justify-items: center; gap: 10px; max-width: 460px; }
.stage__drop-ico { width: 52px; height: 52px; color: var(--gold); }
.on-night .stage__drop-h { margin: 0; font-family: var(--f-display); font-size: clamp(1.5rem, 2.2vw, 2rem); font-weight: 560; font-variation-settings: "SOFT" 100, "opsz" 48; line-height: 1.1; color: #fff; }
.on-night .stage__drop-p { margin: 0; color: var(--on-night-soft); font-size: 1rem; line-height: 1.5; }
.stage__drop-btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 6px; }
.on-night .stage__drop-note { margin: 2px 0 0; font-size: .875rem; color: var(--on-night); font-weight: 550; }
.ownbar {
  position: absolute; top: 14px; left: 14px; z-index: 8; width: min(400px, calc(100% - 28px));
  padding: 10px 14px 9px; border-radius: var(--r-one-sm);
  background: rgba(27, 12, 23, .8); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); color: var(--on-night);
}
.ownbar[hidden] { display: none; }
.ownbar__q { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 0 12px; font-size: .9rem; font-weight: 600; line-height: 1.3; }
.ownbar__q output { font-family: var(--f-display); font-size: 1.2rem; font-weight: 600; color: var(--gold); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ownbar__range { --p: 28.6%; width: 100%; height: 28px; margin: 0; background: transparent; -webkit-appearance: none; appearance: none; cursor: pointer; }
.ownbar__range::-webkit-slider-runnable-track { height: 5px; border-radius: 3px; background: linear-gradient(90deg, var(--gold) var(--p), rgba(243, 236, 241, .25) var(--p)); }
.ownbar__range::-moz-range-track { height: 5px; border-radius: 3px; background: linear-gradient(90deg, var(--gold) var(--p), rgba(243, 236, 241, .25) var(--p)); }
.ownbar__range::-webkit-slider-thumb { -webkit-appearance: none; width: 24px; height: 24px; margin-top: -9.5px; border-radius: 50%; background: var(--gold); border: 3px solid var(--night); box-shadow: 0 0 0 1.5px var(--gold); }
.ownbar__range::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--gold); border: 3px solid var(--night); }
.ownbar__range:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.on-night .ownbar__foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 4px 10px; margin: 0; font-size: .875rem; line-height: 1.3; color: var(--on-night-soft); }
.ownbar__change { min-height: 30px; padding: 0 12px; border: 1.5px solid rgba(243, 236, 241, .6); border-radius: var(--r-pill); background: transparent; color: #fff; font-size: .875rem; font-weight: 650; cursor: pointer; transition: background .3s, color .3s; }
.ownbar__change:hover, .ownbar__change:focus-visible { background: var(--gold); border-color: var(--gold); color: var(--ink); }

/* ---------- Order panel ---------- */
.tool__panel {
  position: relative; background: var(--paper); color: var(--ink);
  border-radius: var(--r-one); padding: 20px 26px 22px;
  box-shadow: 0 50px 90px -40px rgba(0, 0, 0, .75);
}
.opt { position: absolute; inset: 0; z-index: 3; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.roomopt, .sizeopt, .toggle label { position: relative; }
.tf { border: 0; margin: 0; padding: 0 0 12px; min-width: 0; }
.tf + .tf, .tf-row, .tool__sum { border-top: 1px solid var(--line); padding-top: 11px; }
.tf legend { float: left; width: 100%; padding: 0; margin: 0 0 8px; display: flex; align-items: baseline; gap: 10px; line-height: 1.3; }
.tf legend + * { clear: both; }
.tf .label { color: var(--rasp-deep); font-size: .875rem; letter-spacing: .1em; }
.tf__val { font-size: .93rem; font-weight: 550; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-bottom: 2px; }

.picks { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 7px; }
.pick { position: relative; display: block; aspect-ratio: 1; cursor: pointer; }
.pick__img { display: block; width: 100%; height: 100%; overflow: hidden; background: var(--mist); outline: 2.5px solid transparent; outline-offset: 2px; transition: outline-color .3s, transform .4s var(--ease); }
.pick__img img { width: 100%; height: 100%; object-fit: cover; transition: transform .7s var(--ease), filter .4s; }
.pick:hover .pick__img img { transform: scale(1.12); }
.pick input:checked + .pick__img { outline-color: var(--rasp); transform: scale(.94); }
.pick input:focus-visible + .pick__img { outline: 3px solid var(--gold); }
.pick__tip, .swatch__tip {
  position: absolute; left: 50%; bottom: calc(100% + 9px); z-index: 8; pointer-events: none;
  width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
  background: var(--ink); color: #fff; border-radius: var(--r-one-sm);
  font-size: .875rem; font-weight: 600; line-height: 1.2;
}
.pick:hover .pick__tip, .pick .opt:focus-visible ~ .pick__tip,
.swatch:hover .swatch__tip, .swatch .opt:focus-visible ~ .swatch__tip {
  width: auto; height: auto; padding: 6px 11px; overflow: visible; clip-path: none; translate: -50% 0;
  animation: tip-in .3s var(--ease) both;
}
.pick:nth-child(5n+1):hover .pick__tip, .pick:nth-child(5n+1) .opt:focus-visible ~ .pick__tip,
.swatch:first-child:hover .swatch__tip, .swatch:first-child .opt:focus-visible ~ .swatch__tip { left: 0; translate: 0 0; }
.pick:nth-child(5n):hover .pick__tip, .pick:nth-child(5n) .opt:focus-visible ~ .pick__tip,
.pick:nth-child(5n+4):hover .pick__tip, .pick:nth-child(5n+4) .opt:focus-visible ~ .pick__tip { left: auto; right: 0; translate: 0 0; }
@keyframes tip-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.pick--more {
  display: grid; place-content: center; justify-items: center; gap: 2px; text-align: center; text-decoration: none;
  background: var(--ink); color: #fff; font-size: .875rem; font-weight: 650; line-height: 1.15; padding: 4px;
  transition: background .3s;
}
.pick--more .ico { width: 16px; height: 16px; transition: transform .35s var(--ease); }
.pick--more:hover, .pick--more:focus-visible { background: var(--rasp); }
.pick--more:hover .ico { transform: translateX(3px); }

.rooms { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.roomopt { display: block; cursor: pointer; }
.roomopt__card { position: relative; display: block; aspect-ratio: 16 / 10; overflow: hidden; background: var(--mist); outline: 2.5px solid transparent; outline-offset: 2px; transition: outline-color .3s; }
.roomopt__card img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 88%; transition: transform .8s var(--ease); }
.roomopt__card span { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 8px 5px; background: linear-gradient(transparent, rgba(27, 12, 23, .78)); color: #fff; font-size: .875rem; font-weight: 650; line-height: 1.1; }
.roomopt:hover img { transform: scale(1.08); }
.roomopt input:checked + .roomopt__card { outline-color: var(--rasp); }
.roomopt__card--own { display: grid; place-items: center; background: var(--ink); color: #fff; }
.roomopt__card--own svg { width: 28px; height: 28px; margin-top: -14px; color: var(--gold); transition: transform .5s var(--ease); }
.roomopt--own:hover .roomopt__card--own svg { transform: scale(1.12) rotate(-6deg); }
.roomopt__card--own span { background: none; }
.roomopt input:focus-visible + .roomopt__card { outline: 3px solid var(--gold); }

.sizes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.sizeopt { display: block; cursor: pointer; }
.sizeopt__card {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 6px; height: 54px; padding: 7px 10px 7px 9px;
  border: 1.5px solid var(--line); border-radius: var(--r-one-sm); background: #fff;
  transition: background .3s, color .3s, border-color .3s;
}
.sizeopt__sheet { display: block; flex: none; width: calc(var(--sw) * 28px); height: calc(var(--sh) * 40px); border: 1.5px solid currentColor; background: var(--mist); transition: width .5s var(--ease), height .5s var(--ease), background .3s; }
.sizes.is-land .sizeopt__sheet { width: calc(var(--sh) * 40px); height: calc(var(--sw) * 28px); }
.sizeopt__name { font-family: var(--f-display); font-size: 1.3rem; font-weight: 600; font-variation-settings: "SOFT" 100, "opsz" 36; line-height: 1; }
.sizeopt:hover .sizeopt__card { border-color: var(--ink); }
.sizeopt input:checked + .sizeopt__card { background: var(--ink); border-color: var(--ink); color: #fff; }
.sizeopt input:checked + .sizeopt__card .sizeopt__sheet { background: var(--rasp); }
.sizeopt input:focus-visible + .sizeopt__card { outline: 3px solid var(--gold); outline-offset: 2px; }

.tf-row { display: flex; flex-wrap: wrap; gap: 4px 14px; justify-content: space-between; align-items: flex-start; }
.tf-row .tf { flex: none; padding-top: 0; border: 0; }
@media (min-width: 601px) { .tf-row .tf legend { float: none; width: auto; } }
.swatches { display: flex; gap: 8px; }
.swatch { position: relative; display: block; cursor: pointer; }
.swatch__dot { display: block; width: 38px; height: 38px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .18); outline: 2.5px solid transparent; outline-offset: 3px; transition: outline-color .3s, transform .35s var(--ease); }
.swatch:hover .swatch__dot { transform: scale(1.08); }
.swatch input:checked + .swatch__dot { outline-color: var(--rasp); }
.swatch input:focus-visible + .swatch__dot { outline: 3px solid var(--gold); }
.swatch__dot--none { background: linear-gradient(135deg, transparent 46%, var(--rasp) 46% 54%, transparent 54%), #fff; }
.swatch__dot--black { background: linear-gradient(135deg, #4a4443, #141112 55%, #2b2627); }
.swatch__dot--white { background: linear-gradient(135deg, #fff, #e6e2db); }
.swatch__dot--oak { background: repeating-linear-gradient(100deg, rgba(92, 56, 24, 0) 0 3px, rgba(92, 56, 24, .22) 3px 4px), linear-gradient(135deg, #d4a56e, #a87645); }
.swatch__dot--gold { background: linear-gradient(135deg, #8a6420, #f1d27c 35%, #b38834 60%, #f5dc8d 85%); }
.toggle { display: inline-flex; padding: 3px; border: 1.5px solid var(--ink); border-radius: var(--r-pill); }
.toggle label { display: block; cursor: pointer; }
.toggle span { display: block; padding: 0 15px; height: 34px; line-height: 34px; border-radius: var(--r-pill); font-weight: 650; font-size: .9rem; transition: background .3s, color .3s; }
.toggle input:checked + span { background: var(--ink); color: #fff; }
.toggle input:focus-visible + span { outline: 3px solid var(--gold); outline-offset: 2px; }

.tool__sum { display: grid; gap: 8px; }
.tool__words { margin: 0; font-size: .98rem; font-weight: 550; line-height: 1.45; }
.tool__price { display: flex; align-items: center; gap: 16px; }
.tool__total { margin: 0; display: grid; flex: none; }
.tool__total-label { font-size: .875rem; letter-spacing: .1em; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); }
.tool__amount { font-family: var(--f-display); font-size: 2.5rem; font-weight: 600; font-variation-settings: "SOFT" 100, "opsz" 72; line-height: 1; font-variant-numeric: tabular-nums; }
.tool__parts { margin: 0; padding-left: 16px; border-left: 2px solid var(--gold); font-size: .875rem; line-height: 1.45; color: var(--ink-soft); }
.tool__parts strong { color: var(--rasp-deep); font-weight: 650; }
.tool__update { margin-top: 12px; }
.js .tool__update { display: none; }
.tool__ctas { margin-top: 14px; flex-wrap: nowrap; }
.tool__ctas .btn { flex: 1 1 auto; padding: 0 18px; min-height: 52px; }

/* ---------- Size guide ---------- */
.guide { background: var(--paper); padding: clamp(72px, 8vw, 116px) 0; overflow: clip; }
.guide__grid { position: relative; display: grid; grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr); gap: clamp(32px, 5vw, 80px); align-items: center; }
.guide__copy > p { font-size: 1.08rem; }
.guide__ctrl { background: #fff; border-radius: var(--r-one); padding: 20px 24px 22px; margin: 20px 0 18px; box-shadow: 0 0 0 1px var(--line), 0 24px 50px -30px rgba(42, 20, 36, .35); }
.guide__label { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 2px 12px; font-weight: 600; }
.guide__label output { white-space: nowrap; font-family: var(--f-display); font-size: 1.6rem; font-weight: 600; font-variation-settings: "SOFT" 100, "opsz" 48; color: var(--rasp); font-variant-numeric: tabular-nums; }
.guide__range { --p: 57%; width: 100%; height: 44px; margin: 8px 0 4px; background: transparent; -webkit-appearance: none; appearance: none; cursor: pointer; }
.guide__range::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: linear-gradient(90deg, var(--rasp) var(--p), var(--mist) var(--p)); }
.guide__range::-moz-range-track { height: 6px; border-radius: 3px; background: linear-gradient(90deg, var(--rasp) var(--p), var(--mist) var(--p)); }
.guide__range::-webkit-slider-thumb { -webkit-appearance: none; width: 28px; height: 28px; margin-top: -11px; border-radius: 50%; background: var(--rasp); border: 4px solid #fff; box-shadow: 0 0 0 1.5px var(--rasp), 0 6px 14px rgba(181, 55, 90, .4); transition: transform .3s var(--ease); }
.guide__range::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: var(--rasp); border: 4px solid #fff; box-shadow: 0 0 0 1.5px var(--rasp); }
.guide__range:active::-webkit-slider-thumb { transform: scale(1.15); }
.guide__range:focus-visible { outline: 3px solid var(--gold); outline-offset: 4px; }
.guide__result { margin: 10px 0 12px; color: var(--ink-soft); }
.guide__result strong { color: var(--ink); }
.no-js .guide__range, .no-js .guide__label output { display: none; }
.guide__chips { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.guide__chips li { padding: 8px 14px; background: var(--mist); border-radius: var(--r-one-sm); font-size: .92rem; color: var(--ink-soft); }
.guide__chips strong { font-family: var(--f-display); font-weight: 600; color: var(--ink); margin-right: 4px; font-size: 1.05rem; }
.guide__fig { margin: 0; }
.guide__board { position: relative; display: grid; justify-items: center; background: #fff; border-radius: var(--r-one); padding: 20px 20px 16px; overflow: hidden; }
.guide__board::before { content: ""; position: absolute; inset: 0; pointer-events: none; background-image: linear-gradient(rgba(29, 100, 103, .07) 1px, transparent 1px), linear-gradient(90deg, rgba(29, 100, 103, .07) 1px, transparent 1px); background-size: 22px 22px; animation: g-grid 9s linear infinite; }
.guide__board::after { content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 45%; pointer-events: none; background: linear-gradient(100deg, rgba(216, 164, 44, 0), rgba(216, 164, 44, .1) 50%, rgba(216, 164, 44, 0)); animation: g-sweep 7s ease-in-out infinite; }
@keyframes g-grid { to { background-position: 22px 22px, 22px 22px; } }
@keyframes g-sweep { 0% { transform: translateX(-110%); } 60%, 100% { transform: translateX(260%); } }
.guide__svg { position: relative; width: 100%; height: auto; max-height: calc(100svh - 330px); overflow: visible; }
.guide__svg g { transform-box: view-box; }
.g-line { fill: none; stroke: var(--ink); stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
.g-floor { stroke: var(--ink); stroke-width: 1.1; }
.g-skirt { stroke: rgba(42, 20, 36, .22); stroke-width: .8; }
.g-guide { fill: none; stroke: var(--rasp); stroke-width: 1; stroke-dasharray: 3 3; animation: g-march 1.4s linear infinite; }
.g-frame { fill: var(--ink); fill-rule: evenodd; stroke: var(--ink); stroke-width: .8; }
.g-dim { fill: none; stroke: var(--ink-soft); stroke-width: .8; }
.g-dim--rasp { stroke: var(--rasp); stroke-width: 1; }
.g-txt { font-family: var(--f-body); font-size: 8px; font-weight: 650; fill: var(--ink-soft); }
.g-txt--rasp { fill: var(--rasp-deep); }
.guide .tlink { color: var(--rasp-deep); }
@keyframes g-march { to { stroke-dashoffset: -12; } }
.guide__svg .g-slot { transform-box: fill-box; transform-origin: 50% 0; animation: g-sway 3.6s ease-in-out infinite alternate; }
.guide__svg .g-slot:nth-child(2) { animation-delay: -1.3s; }
.guide__svg .g-slot:nth-child(3) { animation-delay: -2.4s; }
@keyframes g-sway { from { transform: rotate(-1.4deg); } to { transform: rotate(1.4deg); } }
.guide__cap { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 8px; font-size: .88rem; color: var(--ink-soft); }
.guide__key { display: inline-block; width: 22px; height: 0; border-top: 2px dashed var(--rasp); }
.guide__key--solid { width: 14px; height: 14px; border: 3px solid var(--ink); margin-left: 10px; }

/* ---------- Gifts and business ---------- */
.uses { background: var(--mist); padding: clamp(72px, 8vw, 116px) 0; overflow: clip; }
.uses__h { margin-bottom: clamp(28px, 4vw, 48px); }
.uses__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(24px, 3.4vw, 52px); }
.use { display: block; text-decoration: none; color: inherit; will-change: transform; }
.use__media { display: block; }
.use__media .frame { display: block; height: min(44vh, 420px); }
.use__media .frame > img { transform-origin: 50% 50%; }
.stage--mini { position: absolute; inset: 0; height: auto; border-radius: 0; perspective: none; }
.stage--mini::after { display: none; }
.use__glare { position: absolute; inset: 0; z-index: 7; display: block; pointer-events: none; opacity: 0; transition: opacity .45s; background: radial-gradient(circle at var(--gx, 50%) var(--gy, 20%), rgba(255, 255, 255, .45), rgba(255, 255, 255, 0) 55%); mix-blend-mode: soft-light; }
.use:hover .use__glare { opacity: 1; }
.use__body { display: grid; gap: 6px; padding: 22px 6px 0; }
.use__title { font-family: var(--f-display); font-size: clamp(1.5rem, 2vw, 1.95rem); font-weight: 560; font-variation-settings: "SOFT" 100, "opsz" 48; line-height: 1.1; }
.use__text { color: var(--ink-soft); font-size: .98rem; }
.use__go { display: inline-flex; align-items: center; gap: 8px; margin-top: 4px; color: var(--rasp-deep); font-weight: 650; }
.use__go .ico { width: 18px; height: 18px; transition: transform .35s var(--ease); }
.use:hover .use__go .ico, .use:focus-visible .use__go .ico { transform: translateX(5px); }
.js [data-use-reveal] { clip-path: inset(0 100% 100% 0 round 32px 0 0 0); }

.pg-wall .cta-band h2 { font-size: clamp(2rem, 3.5vw, 3.6rem); }

/* ---------- Short desktop screens: the whole tool still fits the first screen ---------- */
@media (min-width: 961px) and (max-height: 860px) {
  .tool { padding-bottom: 20px; }
  .tool__intro h1 { font-size: clamp(2.2rem, 3.6vw, 3.4rem); }
  .tool__intro .lede { font-size: 1rem; margin-bottom: 14px; }
  .stage { height: clamp(340px, calc(100svh - 290px), 720px); }
  .tool__panel { padding: 16px 22px 18px; }
  .tf { padding-bottom: 9px; }
  .tf + .tf, .tf-row, .tool__sum { padding-top: 8px; }
  .tf legend { margin-bottom: 6px; }
  .pick { aspect-ratio: 1.45; }
  .roomopt__card { aspect-ratio: 16 / 8; }
  .sizeopt__card { height: 46px; }
  .sizeopt__sheet { width: calc(var(--sw) * 22px); height: calc(var(--sh) * 32px); }
  .sizes.is-land .sizeopt__sheet { width: calc(var(--sh) * 32px); height: calc(var(--sw) * 22px); }
  .swatch__dot { width: 34px; height: 34px; }
  .tool__sum { gap: 4px; }
  .tool__words { font-size: .94rem; line-height: 1.35; }
  .tool__amount { font-size: 2.1rem; }
  .tool__ctas { margin-top: 10px; }
  .tool__ctas .btn { min-height: 48px; }
}
@media (min-width: 961px) and (max-height: 760px) {
  .picks { grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 5px; }
  .pick { aspect-ratio: .8; }
  .pick--more span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .pick:nth-child(10n+1):hover .pick__tip { left: 0; right: auto; translate: 0 0; }
  .pick:nth-child(n+6):hover .pick__tip { left: auto; right: 0; translate: 0 0; }
  .pick:nth-child(-n+5):hover .pick__tip { left: 0; right: auto; translate: 0 0; }
  .tool__words { font-size: .9rem; }
  .tool__parts { line-height: 1.3; }
}

/* ---------- Smaller screens ---------- */
@media (max-width: 1180px) {
  .tool__grid { grid-template-columns: minmax(0, 1fr) 400px; }
  .tool__panel { padding: 18px 20px 20px; }
  .tool__ctas { flex-wrap: wrap; }
}
@media (max-width: 960px) {
  /* One column; the stage sticks under the header while the visitor works through the panel */
  .tool { padding-top: calc(var(--head-h) + 8px); }
  .tool__grid { display: block; }
  .tool__view { display: contents; }
  .tool__intro .lede { margin-bottom: 16px; }
  .stage-wrap { position: sticky; top: 72px; z-index: 6; margin: 0 calc(var(--gut) * -1); }
  .stage-wrap__line { display: none; }
  .stage { height: clamp(250px, 76vw, 46svh); border-radius: 0; }
  .ownbar { position: relative; top: auto; left: auto; width: auto; border-radius: 0; background: var(--night-2); padding: 10px var(--gut) 10px; }
  .tool__panel { margin-top: 16px; }
  .guide__grid, .uses__grid { grid-template-columns: 1fr; }
  .guide__grid { gap: 0; }
  .guide__copy { display: contents; }
  .guide__copy > h2 { order: 1; } .guide__copy > p { order: 2; } .guide__fig { order: 3; margin: 6px 0 4px; }
  .guide__ctrl { order: 4; } .guide__chips { order: 5; }
  .guide__svg { max-height: none; }
  .use__media .frame { height: min(56vw, 380px); }
}
@media (max-width: 600px) {
  .tool__intro h1 { font-size: 2.3rem; }
  .tool__intro .lede { font-size: 1rem; }
  .stage__chip { left: 16px; bottom: 12px; max-width: calc(100% - 84px); font-size: .875rem; padding: 6px 10px; line-height: 1.25; }
  .dim b { padding: 3px 6px; }
  .g-txt { font-size: 13px; }
  .tool__panel { padding: 16px 16px 18px; }
  .picks { gap: 6px; }
  .tf-row { flex-direction: column; gap: 0; }
  .tf-row .tf--mount { box-shadow: inset 0 1px 0 var(--line); padding-top: 11px; width: 100%; }
  .rooms { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .roomopt__card { aspect-ratio: 16 / 7; }
  .ownbar__q output { font-size: 1.1rem; }
  .stage__btns { right: 12px; bottom: 12px; gap: 6px; }
  .stage__btn { width: 44px; padding: 0; justify-content: center; }
  .stage__btn span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .stage__drop { padding: 16px; }
  .stage__drop::before { inset: 10px; }
  .stage__drop-ico { width: 40px; height: 40px; }
  .on-night .stage__drop-p { font-size: .94rem; }
  .tool__ctas { flex-direction: column; align-items: stretch; }
  .tool__amount { font-size: 2.2rem; }
}

@media (prefers-reduced-motion: reduce) {
  .g-guide, .guide__board::before, .guide__board::after, .guide__svg .g-slot { animation: none; }
  .guide__board::after { display: none; }
  .js [data-use-reveal] { clip-path: none; }
}

@media (min-width: 901px) { .tool__parts { white-space: nowrap; } }

/* File inputs are opened by the visible buttons; kept off screen at full tap size rather than shrunk to 1px */
.own-file { position: fixed; left: -10000px; top: 0; width: 48px; height: 48px; opacity: 0; }
