/* ZoltanBuilds "Reimagine my space" (homepage): the floating glass-house orb and the AI concept
   preview it opens. Behaviour and markup: zb-reimagine.js, which renders both into <body>. */

/* ===== The orb: a small glass house lit from within, in a smoked-glass disc =====
   Ported from the judged "lantern-glow" prototype. zb-reimagine.js only adds it once
   /api/reimagine/status says concepts can be made, so it's never a dead end. */
.zb-rm-orb {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 60;
  display: inline-flex;
  align-items: center;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: none;
  color: #F4E9DC;
  font: 600 14px/1 'Bricolage Grotesque', Inter, system-ui, sans-serif;
  letter-spacing: .01em;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  /* visibility flips at once on the way in (and only after the fade on the way out, below) */
  transition: transform .4s, opacity .45s ease, translate .6s cubic-bezier(.2, .8, .2, 1), scale .3s ease, bottom .45s cubic-bezier(.2, .8, .2, 1), visibility 0s;
}
/* Phones: above the 72px bottom nav */
@media (max-width: 767px) {
  .zb-rm-orb { bottom: calc(72px + 1rem + env(safe-area-inset-bottom)); }
}
/* 768-1023px shows the side nav (48px buttons, 2rem from the right, centred). On a short screen
   (a phone on its side) its Get a Quote button reaches down into this corner, so step left of it */
@media (min-width: 768px) and (max-width: 1023px) and (max-height: 430px) {
  .zb-rm-orb { right: calc(2rem + 48px + .75rem); }
}
.zb-rm-orb:is(:hover, :focus-visible) { transform: translateY(-2px); }
.zb-rm-orb:active { transform: scale(.97); }
/* The dark halo keeps the gold ring visible over the page's white sections */
.zb-rm-orb:focus-visible { outline: 2px solid #E5C49A; outline-offset: 3px; box-shadow: 0 0 0 6px #0F0F0F; }

/* Label pill: smoked glass, lantern light spilling in from the orb end */
.zb-rm-orb__label {
  position: relative;
  display: flex;
  align-items: center;
  height: 40px;
  margin-right: -24px; /* tucks under the orb */
  padding: 0 36px 0 18px;
  border: 1px solid #E5C49A38;
  border-radius: 999px;
  background:
    radial-gradient(64px 40px at 100% 50%, #F0A85852, #F0A85800),
    linear-gradient(90deg, #161412DB, #221B15E6);
  box-shadow: 0 8px 22px -8px #000B, inset 0 1px #FFECD214, inset 0 0 12px #E5A8601F;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  white-space: nowrap;
}
.zb-rm-orb__label::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: radial-gradient(110px 46px at 100% 50%, #F4AE5C4D, #F4AE5C00);
  box-shadow: inset 0 0 14px #ECAC6238;
  opacity: 0;
  transition: opacity .4s;
}
/* Two-tone, like the hero headline's gold phrase */
.zb-rm-orb__label em { font-style: normal; color: #E5C49A; }

/* The orb is the perspective root. Its dusk disc (::before) and halo (::after) are siblings of
   the 3D house, never its ancestors, so nothing flattens the house's preserve-3d */
.zb-rm-orb__orb {
  position: relative;
  flex: none;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  perspective: 150px;
}
.zb-rm-orb__orb::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid #E5C49A40;
  background:
    radial-gradient(64% 34% at 50% 0, #FFFFFF1F, #FFFFFF00),
    radial-gradient(40% 11% at 50% 80%, #FAB6648C, #FAB66400),
    radial-gradient(50% 48% at 50% 46%, #E29E5642, #E29E5600),
    linear-gradient(172deg, #1C2232F0, #16161CF0 45%, #14100CF2 78%);
  box-shadow: 0 10px 24px -6px #000B, inset 0 1px #FFF0DC3D, inset 0 -10px 18px -8px #E2A05A59;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.zb-rm-orb__orb::after {
  content: '';
  position: absolute;
  inset: -9px;
  z-index: -1;
  border-radius: 50%;
  background: radial-gradient(closest-side, #ECAA5E80 72%, #ECAA5E00);
  opacity: .3;
  transition: opacity .4s;
}
.zb-rm-orb:is(:hover, :focus-visible) :is(.zb-rm-orb__label, .zb-rm-orb__orb)::after { opacity: 1; }

/* The house: 24w x 20d x 14h glass walls under a 45deg gable roof, on a lit floor. Its only
   animation is a slow yaw sway. Faces in DOM order: floor, back gable, FRONT gable, left wall,
   RIGHT wall, roof, roof */
.zb-rm-orb__house {
  position: absolute;
  left: 28px;
  top: 25px;
  transform-style: preserve-3d;
  transform: rotateX(-14deg) rotateY(-29deg); /* the static three-quarter view */
  animation: zb-rm-yaw 10s ease-in-out infinite;
}
.zb-rm-orb i {
  position: absolute;
  box-sizing: border-box;
  border: 1px solid #F5D4A480;
  background:
    linear-gradient(118deg, #FFFAF000 30%, #FFF8E838 40%, #FFFAF000 52%),
    linear-gradient(#FFE2B433, #FFB86485);
  box-shadow: 0 0 2px #F2B264A6;
}
.zb-rm-orb :is(.g + .g, .w + .w, .r) { border-color: #F5D4A4EB; }
.zb-rm-orb .g {
  left: -12px;
  top: -13px;
  width: 24px;
  height: 26px;
  clip-path: polygon(50% 0, 100% 46.2%, 100% 100%, 0 100%, 0 46.2%);
  transform: translateZ(-10px);
  box-shadow: inset 0 -7px 9px -4px #FFCC848C;
}
.zb-rm-orb .g + .g { transform: translateZ(10px); }
.zb-rm-orb .w {
  left: -10px;
  top: -1px;
  width: 20px;
  height: 14px;
  transform: rotateY(-90deg) translateZ(12px);
}
.zb-rm-orb .w + .w { transform: rotateY(90deg) translateZ(12px); }
.zb-rm-orb .r {
  left: 0;
  top: -24px;
  width: 18px;
  height: 22px;
  transform-origin: 0 50%;
  transform: rotateZ(45deg) rotateX(90deg);
  background: linear-gradient(90deg, #543E288C, #8C663E61 55%, #FFE0B257);
}
.zb-rm-orb .r + .r { transform: rotateY(180deg) rotateZ(45deg) rotateX(90deg); }
.zb-rm-orb .f {
  left: -24px;
  top: -11px;
  width: 48px;
  height: 48px;
  border: 0;
  box-shadow: none;
  transform: rotateX(90deg);
  background:
    radial-gradient(7px 5px at 50% 73%, #FFE2AAD9, #FFE2AA00),
    radial-gradient(closest-side, #FFD898F2, #F6AA5A6B 42%, #F0A05000);
}
/* Lit door (front gable) and window (right wall) */
.zb-rm-orb :is(.g + .g, .w + .w)::before {
  content: '';
  position: absolute;
  background: linear-gradient(#FFF0CF, #F4B466);
  box-shadow: 0 0 4px 1px #FFBA68BF;
}
.zb-rm-orb .g + .g::before {
  left: 8px;
  bottom: 0;
  width: 6px;
  height: 9px;
  border-radius: 1px 1px 0 0;
}
.zb-rm-orb .w + .w::before {
  left: 6px;
  top: 3px;
  width: 7px;
  height: 5px;
  border-radius: 1px;
}
@keyframes zb-rm-yaw {
  0%, 100% { transform: rotateX(-14deg) rotateY(-42deg); }
  50%      { transform: rotateX(-14deg) rotateY(-16deg); }
}

/* ----- Orb states ----- */
/* Hidden: before its first show (.is-pending), while the quote form (or, on phones, the hero
   form) is in view (.is-away, set by zb-reimagine.js), and while the Text Zoltan panel is open.
   visibility flips only after the fade, so a hidden orb can't be tabbed to or tapped.
   The :has() rule stands alone: a browser without :has() drops a whole selector list. */
.zb-rm-orb.is-pending,
.zb-rm-orb.is-away {
  opacity: 0;
  scale: .92;
  pointer-events: none;
  visibility: hidden;
  transition: transform .4s, opacity .25s ease, translate .25s ease, scale .25s ease, visibility 0s linear .25s;
}
body:has(#zb-chat-panel:not([hidden])) .zb-rm-orb {
  opacity: 0;
  scale: .92;
  pointer-events: none;
  visibility: hidden;
  transition: transform .4s, opacity .25s ease, translate .25s ease, scale .25s ease, visibility 0s linear .25s;
}
/* The one entrance: a fade with an 8px rise */
.zb-rm-orb.is-pending { scale: 1; translate: 0 8px; }
@media (max-width: 767px) {
  /* Typing on a phone (keyboard up): out of the way, like the bottom nav (same list as index.html) */
  body:has(:is(input:not([type="checkbox"], [type="radio"], [type="button"], [type="submit"], [type="reset"], [type="range"], [type="color"], [type="file"]), textarea, select, [contenteditable="true"]):focus) .zb-rm-orb {
    opacity: 0;
    scale: .92;
    pointer-events: none;
    visibility: hidden;
    transition: transform .4s, opacity .25s ease, scale .25s ease, visibility 0s linear .25s;
  }
  /* Compact (house only) while the cookie pill shows; the label stays as the button's accessible
     name. The pill runs ~350px across a phone, so the house also steps up just above it
     (72px nav + .75rem + the 48px pill) rather than covering its Decline button. */
  body:has(.zb-cookie-pill.is-visible) .zb-rm-orb { bottom: calc(72px + .75rem + 48px + .6rem + env(safe-area-inset-bottom)); }
  body:has(.zb-cookie-pill.is-visible) .zb-rm-orb__label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    border: 0;
    overflow: hidden;
    clip-path: inset(50%);
  }
}
/* The sway rests while the preview is open (.zb-rm-open on <html>, from zb-reimagine.js) or the
   orb is out of sight */
html.zb-rm-open .zb-rm-orb__house,
.zb-rm-orb.is-away .zb-rm-orb__house { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) {
  .zb-rm-orb__house { animation: none; } /* holds the static three-quarter view */
  .zb-rm-orb { transition: none !important; } /* beats every state's transition: no entrance, no fades */
}

/* ===== The preview: a native <dialog> opened with showModal() (top layer, focus trap, Esc) ===== */
/* The page behind stays put; the gutter keeps it from shifting where scrollbars take space.
   .zb-rm-open is set by zb-reimagine.js while the preview is open (works without :has()). */
html.zb-rm-open {
  overflow: hidden;
  scrollbar-gutter: stable;
}
.zb-rm {
  position: fixed; /* what :modal gives it anyway; keeps a non-modal fallback in place too */
  inset: 0;
  box-sizing: border-box;
  width: min(1040px, 100vw - 3rem);
  max-width: none;
  height: min(760px, 100vh - 3rem); /* fixed, so the stage doesn't jump between steps */
  height: min(760px, 100dvh - 3rem);
  max-height: calc(100vh - 3rem);
  max-height: calc(100dvh - 3rem);
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(212, 165, 116, .15);
  border-radius: 1.75rem;
  background: #141414;
  color: #E5E5E5;
  font-family: Inter, system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  box-shadow: 0 50px 120px -30px rgba(0, 0, 0, .85), 0 0 0 1px rgba(0, 0, 0, .35);
}
.zb-rm::backdrop {
  background: rgba(8, 8, 8, .72);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.zb-rm[open] { animation: zb-rm-in .34s cubic-bezier(.2, .8, .2, 1); }
.zb-rm[open]::backdrop { animation: zb-rm-fade .34s ease; }
@keyframes zb-rm-in {
  from { opacity: 0; transform: translateY(14px) scale(.985); }
}
@keyframes zb-rm-fade {
  from { opacity: 0; }
}
.zb-rm *,
.zb-rm *::before,
.zb-rm *::after { box-sizing: border-box; }
.zb-rm [hidden] { display: none !important; }
.zb-rm :focus-visible { outline: 2px solid #D4A574; outline-offset: 2px; }
.zb-rm-sr {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.zb-rm-i {
  width: 1.1em;
  height: 1.1em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Desktop studio: the preview stage on the left, a 340px column of controls on the right */
.zb-rm__panel {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-areas:
    "stage head"
    "stage controls"
    "stage foot";
  height: 100%;
  padding: .75rem;
  background: radial-gradient(420px 320px at 100% 0, rgba(212, 165, 116, .07), rgba(212, 165, 116, 0) 70%);
}
.zb-rm__head { grid-area: head; padding: 1.15rem 1.4rem .1rem; }
.zb-rm__kicker {
  display: flex;
  align-items: center;
  gap: .4rem;
  margin: 0 2.4rem .55rem 0; /* clear of the close button */
  color: #D4A574;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .12em;
  line-height: 1.2;
  text-transform: uppercase;
}
.zb-rm__title {
  margin: 0 2.4rem 0 0;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 1.9rem;
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.04;
  color: #F2EDE6;
}
/* Two-tone like the orb's label; "your space" stays together on its line */
.zb-rm__title span { color: #E5C49A; white-space: nowrap; }
.zb-rm__sub { margin: .6rem 0 0; color: #B3B3B3; font-size: .86rem; line-height: 1.55; text-wrap: pretty; }
.zb-rm.is-result .zb-rm__sub { display: none; } /* set-up instructions; the result has its own heading */
.zb-rm__close {
  position: absolute;
  top: 1.1rem;
  right: 1.1rem;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(212, 165, 116, .2);
  border-radius: 999px;
  background: rgba(20, 20, 20, .6);
  color: #B3B3B3;
  font-size: 1.15rem;
  cursor: pointer;
  transition: color .15s ease, border-color .15s ease, background-color .15s ease;
}
.zb-rm__close:hover { color: #FFFFFF; border-color: rgba(212, 165, 116, .55); background: #222; }

/* ----- Shared buttons ----- */
/* Primary: the gold pill, full width at the foot of the column */
.zb-rm-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  width: 100%;
  height: 3.25rem;
  margin: 0;
  padding: 0 1.5rem;
  border: 0;
  border-radius: 999px;
  background: #D4A574;
  color: #0F0F0F;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -.01em;
  cursor: pointer;
  box-shadow: 0 14px 32px -14px rgba(212, 165, 116, .75);
  transition: background-color .2s ease, color .2s ease, box-shadow .2s ease, transform .15s ease;
}
.zb-rm-cta:hover { background: #E5C49A; }
.zb-rm-cta:active { transform: scale(.985); }
.zb-rm-cta .zb-rm-i { font-size: 1.1rem; }
/* Not ready yet (aria-disabled keeps it focusable, so a click can point at what's missing) */
.zb-rm-cta[aria-disabled="true"] {
  background: rgba(212, 165, 116, .14);
  color: rgba(229, 196, 154, .55);
  box-shadow: inset 0 0 0 1px rgba(212, 165, 116, .18);
  cursor: not-allowed;
}
.zb-rm-cta.is-busy { cursor: progress; }
/* Secondary: transparent pill with a gold hairline */
.zb-rm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  min-height: 2.75rem;
  margin: 0;
  padding: .55rem 1.1rem;
  border: 1px solid rgba(212, 165, 116, .35);
  border-radius: 999px;
  background: transparent;
  color: #E5E5E5;
  font: inherit;
  font-size: .86rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.zb-rm-btn .zb-rm-i { color: #D4A574; font-size: 1.05rem; }
.zb-rm-btn:hover { border-color: rgba(212, 165, 116, .7); background: rgba(212, 165, 116, .07); }
.zb-rm-btn:disabled { opacity: .45; cursor: not-allowed; }
.zb-rm-btn.is-gold { border-color: #D4A574; background: #D4A574; color: #0F0F0F; }
.zb-rm-btn.is-gold .zb-rm-i { color: inherit; }
.zb-rm-btn.is-gold:hover { border-color: #E5C49A; background: #E5C49A; }
.zb-rm-link {
  margin: 0;
  padding: .35rem .5rem;
  border: 0;
  background: none;
  color: #999;
  font: inherit;
  font-size: .8rem;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: rgba(153, 153, 153, .45);
  text-underline-offset: 3px;
  cursor: pointer;
}
.zb-rm-link:hover { color: #E5E5E5; }

/* ----- The stage: dropzone, then the photo, the generating state, then before/after ----- */
.zb-rm__stage {
  --ar: 1.3393; /* the 4:3 size until a photo sets its own */
  position: relative;
  grid-area: stage;
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 0;
  padding: 1rem;
  overflow: hidden;
  border: 1px solid rgba(212, 165, 116, .1);
  border-radius: 1rem;
  background:
    radial-gradient(90% 60% at 50% 0, rgba(212, 165, 116, .09), rgba(212, 165, 116, 0) 70%),
    #0E0E0E;
}
/* Sized from the photo: cq units fit the frame inside the stage both ways */
.zb-rm__stage:not([data-view="empty"]) { container-type: size; }
/* The photo itself, blurred and darkened, fills the letterbox around it */
.zb-rm__stage::before {
  content: '';
  position: absolute;
  inset: -48px;
  background: var(--photo, none) center / cover no-repeat;
  filter: blur(40px) saturate(1.15) brightness(.32);
  opacity: 0;
  transition: opacity .6s ease;
  pointer-events: none;
}
.zb-rm__stage:not([data-view="empty"])::before { opacity: 1; }

.zb-rm__drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .85rem;
  width: 100%;
  height: 100%;
  padding: 1.5rem;
  border: 1.5px dashed rgba(212, 165, 116, .26);
  border-radius: .75rem;
  text-align: center;
  transition: border-color .2s ease, background-color .2s ease;
}
.zb-rm__stage.is-over .zb-rm__drop { border-color: #D4A574; background: rgba(212, 165, 116, .06); }
.zb-rm__drop-icon {
  display: grid;
  place-items: center;
  width: 3.75rem;
  height: 3.75rem;
  margin-bottom: .2rem;
  border: 1px solid rgba(212, 165, 116, .28);
  border-radius: 999px;
  background: radial-gradient(closest-side, rgba(212, 165, 116, .16), rgba(212, 165, 116, .04));
  color: #E5C49A;
  font-size: 1.6rem;
  box-shadow: 0 0 40px -6px rgba(212, 165, 116, .35);
}
.zb-rm__drop-title {
  margin: 0;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.15;
  color: #F2EDE6;
}
.zb-rm__drop-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .6rem; }
.zb-rm__drop-or { margin: -.2rem 0 0; color: #8C8C8C; font-size: .78rem; }
@media (pointer: coarse) { .zb-rm__drop-or { display: none; } }
.zb-rm__tip { max-width: 27rem; margin: .35rem 0 0; color: #999; font-size: .8rem; line-height: 1.55; text-wrap: pretty; }
.zb-rm__drop-error { max-width: 26rem; margin: 0; color: #FCA5A5; font-size: .85rem; font-weight: 600; }
.zb-rm__drop-error:empty { display: none; }
.zb-rm__stage:not([data-view="empty"]) .zb-rm__drop { display: none; }

/* The frame takes the photo's aspect ratio (the crop the model saw); both layers cover it.
   Full width, or (with container query units, below) fitted inside the stage both ways. */
.zb-rm__frame {
  position: relative;
  z-index: 1;
  width: 100%;
  aspect-ratio: var(--ar);
  overflow: hidden;
  border-radius: .75rem;
  background: #0A0A0A;
  box-shadow: 0 24px 60px -24px rgba(0, 0, 0, .9), 0 0 0 1px rgba(255, 255, 255, .04);
  --pos: 100%;
}
/* Guarded: with var() in it, a browser without cq units (Safari < 16) would keep this
   declaration, find it invalid only at computed-value time and size the frame to 0x0 */
@supports (width: 1cqw) {
  .zb-rm__frame { width: min(100cqw, 100cqh * var(--ar)); }
}
.zb-rm__stage[data-view="empty"] .zb-rm__frame { display: none; }
.zb-rm__frame img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
}
/* Before sits on top, clipped to the left of the divider */
.zb-rm__before {
  clip-path: inset(0 calc(100% - var(--pos)) 0 0);
  transition: filter .6s ease;
}
.zb-rm__divider,
.zb-rm__tag,
.zb-rm__range,
.zb-rm__after { display: none; }
.zb-rm__stage[data-view="result"] :is(.zb-rm__divider, .zb-rm__tag, .zb-rm__range, .zb-rm__after) { display: block; }
.zb-rm__stage:not([data-view="result"]) .zb-rm__frame { --pos: 100% !important; }
.zb-rm__divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--pos);
  width: 2px;
  margin-left: -1px;
  background: #E5C49A;
  box-shadow: 0 0 14px rgba(229, 196, 154, .55);
  pointer-events: none;
}
.zb-rm__knob {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 1.5px solid #E5C49A;
  border-radius: 999px;
  background: rgba(18, 16, 14, .7);
  color: #F2D9B8;
  font-size: 1.2rem;
  transform: translate(-50%, -50%);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  box-shadow: 0 6px 22px rgba(0, 0, 0, .5), 0 0 0 4px rgba(229, 196, 154, .12);
  transition: box-shadow .2s ease, background-color .2s ease;
}
.zb-rm__frame:has(.zb-rm__range:focus-visible) .zb-rm__knob { outline: 2px solid #D4A574; outline-offset: 3px; }
.zb-rm__frame.is-dragging .zb-rm__knob { background: rgba(212, 165, 116, .3); box-shadow: 0 6px 22px rgba(0, 0, 0, .5), 0 0 0 7px rgba(229, 196, 154, .16); }
.zb-rm__tag {
  position: absolute;
  top: .75rem;
  padding: .32rem .7rem;
  border-radius: 999px;
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .12em;
  line-height: 1.2;
  text-transform: uppercase;
  pointer-events: none;
  transition: opacity .2s ease;
}
.zb-rm__tag.is-before {
  left: .75rem;
  background: rgba(12, 12, 12, .7);
  color: #E5E5E5;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.zb-rm__tag.is-after { right: .75rem; background: #D4A574; color: #0F0F0F; box-shadow: 0 4px 14px rgba(0, 0, 0, .3); }
.zb-rm__tag.is-off { opacity: 0; }
/* The slider: a transparent range over the whole frame takes pointer and keyboard */
.zb-rm__range {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  opacity: 0;
  cursor: ew-resize;
  touch-action: pan-y; /* a vertical swipe still scrolls the sheet on phones */
  -webkit-appearance: none;
  appearance: none;
}
.zb-rm__range:focus-visible { outline: none; } /* the knob shows focus instead */

.zb-rm__change {
  position: absolute;
  top: .75rem;
  right: .75rem;
  z-index: 2;
  min-height: 2.25rem;
  padding: .4rem .85rem;
  border-color: rgba(229, 196, 154, .4);
  background: rgba(12, 12, 12, .66);
  font-size: .8rem;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.zb-rm__stage:not([data-view="photo"], [data-view="error"]) .zb-rm__change { display: none; }
.zb-rm__small {
  position: absolute;
  left: 50%;
  bottom: .75rem;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: .45rem;
  width: max-content;
  max-width: calc(100% - 1.5rem);
  margin: 0;
  padding: .45rem .85rem;
  border-radius: 999px;
  background: rgba(12, 12, 12, .72);
  color: #E5E5E5;
  font-size: .78rem;
  line-height: 1.35;
  text-wrap: balance;
  transform: translateX(-50%);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.zb-rm__small .zb-rm-i { color: #E5C49A; }

/* Generating: the photo dims under a slow, soft gold light sweep (transform only) */
.zb-rm__stage:is([data-view="generating"], [data-view="error"]) .zb-rm__before { filter: brightness(.42) saturate(.75); }
.zb-rm__sweep {
  position: absolute;
  inset: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity .5s ease;
}
.zb-rm__sweep::before {
  content: '';
  position: absolute;
  top: -25%;
  bottom: -25%;
  left: 0;
  width: 55%;
  background: linear-gradient(100deg, rgba(229, 196, 154, 0) 10%, rgba(229, 196, 154, .16) 42%, rgba(255, 236, 205, .3) 50%, rgba(229, 196, 154, .16) 58%, rgba(229, 196, 154, 0) 90%);
  transform: translateX(-110%) skewX(-14deg);
}
.zb-rm__stage[data-view="generating"] .zb-rm__sweep { opacity: 1; }
.zb-rm__stage[data-view="generating"] .zb-rm__sweep::before { animation: zb-rm-sweep 3.6s cubic-bezier(.45, 0, .3, 1) infinite; }
@keyframes zb-rm-sweep {
  from { transform: translateX(-110%) skewX(-14deg); }
  to   { transform: translateX(200%) skewX(-14deg); }
}
/* The status pill; its text is the polite live region, so it stays in the DOM when hidden */
.zb-rm__working {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  display: grid;
  justify-items: center;
  gap: .6rem;
  width: max-content;
  max-width: calc(100% - 3rem);
  padding: .85rem 1.2rem .8rem;
  border: 1px solid rgba(212, 165, 116, .28);
  border-radius: 1rem;
  background: rgba(14, 13, 12, .78);
  transform: translate(-50%, -50%);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 18px 50px -12px rgba(0, 0, 0, .7);
  text-align: center;
  transition: opacity .3s ease;
}
.zb-rm__stage:not([data-view="generating"]) .zb-rm__working { opacity: 0; pointer-events: none; }
.zb-rm__status {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin: 0;
  color: #F4E9DC;
  font-size: .88rem;
  font-weight: 600;
  line-height: 1.35;
}
.zb-rm__status .zb-rm-i { color: #E5C49A; }
.zb-rm__status.is-swap { animation: zb-rm-swap .45s ease; }
@keyframes zb-rm-swap {
  from { opacity: 0; transform: translateY(4px); }
}
.zb-rm__progress {
  position: relative;
  width: 100%;
  min-width: 12rem;
  height: 2px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(212, 165, 116, .18);
}
.zb-rm__progress i {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #B8864F, #E5C49A);
  transform: scaleX(0);
  transform-origin: 0 50%;
}
/* Eases toward the end over ~25 s ("about 20 seconds") and never claims to be done */
.zb-rm__stage[data-view="generating"] .zb-rm__progress i {
  transform: scaleX(.94);
  transition: transform 25s cubic-bezier(.1, .55, .25, 1);
}

/* Errors: a card over the dimmed photo, with the one thing to do next */
.zb-rm__alert {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 3;
  display: grid;
  justify-items: center;
  gap: .85rem;
  width: min(24rem, calc(100% - 2rem));
  padding: 1.25rem 1.25rem 1rem;
  border: 1px solid rgba(212, 165, 116, .28);
  border-radius: 1rem;
  background: rgba(14, 13, 12, .88);
  transform: translate(-50%, -50%);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: 0 24px 60px -16px rgba(0, 0, 0, .8);
  text-align: center;
  animation: zb-rm-swap .3s ease;
}
.zb-rm__stage:not([data-view="error"]) .zb-rm__alert { display: none; }
.zb-rm__alert-icon {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  background: rgba(212, 165, 116, .12);
  color: #E5C49A;
  font-size: 1.25rem;
}
.zb-rm__alert-msg { margin: 0; color: #EDE7DF; font-size: .92rem; line-height: 1.5; text-wrap: pretty; }
.zb-rm__alert-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .35rem .5rem; }

/* ----- Controls column ----- */
.zb-rm__controls {
  grid-area: controls;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 1.25rem 1.4rem .75rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(212, 165, 116, .25) transparent;
}
.zb-rm__group { min-width: 0; margin: 0 0 1.2rem; padding: 0; border: 0; }
.zb-rm__group:disabled { opacity: .55; }
.zb-rm__label {
  margin: 0 0 .65rem;
  color: #D4A574;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .12em;
  line-height: 1.2;
  text-transform: uppercase;
}

/* Which room? Three tiles in a radio group */
.zb-rm__rooms { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; }
.zb-rm-room {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  min-height: 4.25rem;
  padding: .6rem .35rem .55rem;
  border: 1px solid rgba(212, 165, 116, .16);
  border-radius: 1rem;
  background: #1A1A1A;
  color: #B3B3B3;
  font-size: .82rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s ease, background-color .2s ease, color .2s ease, box-shadow .2s ease;
}
.zb-rm-room .zb-rm-i { font-size: 1.45rem; color: #9C8466; transition: color .2s ease; }
.zb-rm-room:hover { border-color: rgba(212, 165, 116, .4); color: #E5E5E5; }
/* .is-checked comes from zb-reimagine.js (render), so the pick shows without :has() too */
.zb-rm-room.is-checked {
  border-color: #D4A574;
  background: linear-gradient(rgba(212, 165, 116, .13), rgba(212, 165, 116, .05)), #1A1A1A;
  color: #F4E9DC;
  box-shadow: inset 0 0 0 1px #D4A574;
}
.zb-rm-room.is-checked .zb-rm-i { color: #E5C49A; }
.zb-rm-room:has(:focus-visible),
.zb-rm-style:has(:focus-visible) { outline: 2px solid #D4A574; outline-offset: 2px; }
/* Without :has() (Firefox < 121, Chrome < 105) the ring shows on any focus instead */
@supports not selector(:has(a)) {
  .zb-rm-room:focus-within,
  .zb-rm-style:focus-within { outline: 2px solid #D4A574; outline-offset: 2px; }
}

/* Pick a style: 2x2 cards, each with a four-colour swatch strip */
.zb-rm__styles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
.zb-rm-style {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: .12rem;
  padding: .45rem .45rem .65rem;
  border: 1px solid rgba(212, 165, 116, .15);
  border-radius: 1rem;
  background: #1A1A1A;
  cursor: pointer;
  transition: border-color .2s ease, background-color .2s ease, box-shadow .2s ease;
}
.zb-rm-style:hover { border-color: rgba(212, 165, 116, .4); }
.zb-rm-style.is-checked {
  border-color: #D4A574;
  background: linear-gradient(rgba(212, 165, 116, .1), rgba(212, 165, 116, .02)), #1A1A1A;
  box-shadow: inset 0 0 0 1px #D4A574, 0 12px 30px -16px rgba(212, 165, 116, .55);
}
.zb-rm-style__swatch,
.zb-rm-pill__swatch {
  position: relative;
  display: flex;
  height: 2.1rem;
  margin-bottom: .4rem;
  overflow: hidden;
  border-radius: .6rem;
}
:is(.zb-rm-style__swatch, .zb-rm-pill__swatch) i { flex: 1; }
:is(.zb-rm-style__swatch, .zb-rm-pill__swatch) i:first-child { flex: 1.35; }
/* A soft sheen and edge, so the strip reads as material samples rather than flat paint chips */
.zb-rm-style__swatch::after,
.zb-rm-pill__swatch::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, .14), rgba(255, 255, 255, 0) 45%, rgba(0, 0, 0, .14));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .07);
}
.zb-rm-style__check {
  position: absolute;
  top: .85rem;
  right: .85rem;
  display: grid;
  place-items: center;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 999px;
  background: #D4A574;
  color: #0F0F0F;
  font-size: .8rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .35);
  opacity: 0;
  transform: scale(.6);
  transition: opacity .2s ease, transform .25s cubic-bezier(.34, 1.56, .64, 1);
}
.zb-rm-style__check .zb-rm-i { stroke-width: 2.6; }
.zb-rm-style.is-checked .zb-rm-style__check { opacity: 1; transform: none; }
.zb-rm-style__name {
  padding: 0 .2rem;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: .98rem;
  font-weight: 700;
  letter-spacing: -.01em;
  line-height: 1.2;
  color: #EDE7DF;
}
.zb-rm-style__desc { padding: 0 .2rem; color: #999; font-size: .72rem; line-height: 1.35; }

/* ----- Result ----- */
.zb-rm__result-title {
  margin: 0 0 1.25rem;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.15;
  color: #F2EDE6;
}
.zb-rm__result-title:focus { outline: none; }
.zb-rm__result-title span { color: #E5C49A; }
/* Try another style: the other three as mini swatch cards */
.zb-rm__more { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; margin-bottom: 1.2rem; }
.zb-rm-pill {
  position: relative;
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: .4rem .4rem .55rem;
  border: 1px solid rgba(212, 165, 116, .18);
  border-radius: .9rem;
  background: #1A1A1A;
  color: #E5E5E5;
  font: inherit;
  font-size: .8rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s ease, background-color .15s ease;
}
.zb-rm-pill:hover { border-color: rgba(212, 165, 116, .6); background: #1F1F1F; }
.zb-rm-pill:disabled { opacity: .45; cursor: not-allowed; }
.zb-rm-pill__swatch { height: 1.5rem; margin-bottom: .45rem; border-radius: .5rem; }
/* Already made: switching to it is instant */
.zb-rm-pill__ready {
  position: absolute;
  top: .15rem;
  right: .15rem;
  display: none;
  place-items: center;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 999px;
  background: #D4A574;
  color: #0F0F0F;
  font-size: .62rem;
  box-shadow: 0 0 0 2px #1A1A1A;
}
.zb-rm-pill__ready .zb-rm-i { stroke-width: 3; }
.zb-rm-pill.is-ready .zb-rm-pill__ready { display: grid; }
.zb-rm__tools { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin-bottom: 1.1rem; }
.zb-rm__tools .zb-rm-btn { padding-inline: .6rem; }
.zb-rm__disclaimer {
  display: flex;
  gap: .55rem;
  margin: 0;
  padding: .8rem .9rem;
  border: 1px solid rgba(255, 255, 255, .06);
  border-radius: 1rem;
  background: rgba(255, 255, 255, .025);
  color: #999;
  font-size: .74rem;
  line-height: 1.5;
}
.zb-rm__disclaimer .zb-rm-i { margin-top: .1rem; color: #B89A74; font-size: .95rem; }

/* ----- Foot: the one primary action ----- */
.zb-rm__foot { grid-area: foot; padding: .5rem 1.4rem .9rem; }
.zb-rm__paused {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  margin: 0 0 .6rem;
  padding: .45rem .7rem;
  border: 1px solid rgba(212, 165, 116, .22);
  border-radius: 999px;
  background: rgba(212, 165, 116, .07);
  color: #E5C49A;
  font-size: .76rem;
  font-weight: 600;
  line-height: 1.35;
}
.zb-rm__hint {
  margin: .55rem 0 0;
  color: #A3A3A3;
  font-size: .78rem;
  line-height: 1.4;
  text-align: center;
}
.zb-rm__hint:empty { display: none; }
.zb-rm__hint.is-nudge { color: #E5C49A; animation: zb-rm-nudge .4s ease; }
@keyframes zb-rm-nudge {
  25% { transform: translateX(-4px); }
  50% { transform: translateX(4px); }
  75% { transform: translateX(-2px); }
}
/* #B3B3B3: still 5:1 where the line sits in the gold button's glow */
.zb-rm__privacy,
.zb-rm__cta-sub {
  margin: .6rem 0 0;
  color: #B3B3B3;
  font-size: .72rem;
  line-height: 1.45;
  text-align: center;
  text-wrap: balance;
}
.zb-rm__privacy .zb-rm-i {
  display: inline-block;
  margin-right: .3rem;
  color: #8F7A60;
  font-size: .85rem;
  vertical-align: -.17em;
}
.zb-rm__privacy a {
  color: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: rgba(179, 179, 179, .45);
  text-underline-offset: 2px;
}
.zb-rm__privacy a:hover { color: #E5E5E5; }

/* Shorter desktop windows (a 1366x768 laptop, a zoomed browser): fewer words in the column, so
   all four styles still fit above the button */
@media (min-width: 768px) and (min-height: 561px) and (max-height: 760px) {
  .zb-rm__sub,
  .zb-rm-style__desc { display: none; } /* both still describe things to screen readers */
  .zb-rm__head { padding-top: .9rem; }
  .zb-rm__controls { padding-top: .85rem; }
  .zb-rm__group { margin-bottom: 1rem; }
}

/* ===== Phones, and any screen under 561px tall (a phone on its side): a full-screen sheet;
   stage on top, controls below, the primary button in a sticky footer ===== */
@media (max-width: 767px), (max-height: 560px) {
  .zb-rm {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    max-height: none;
    border: 0;
    border-radius: 0;
  }
  .zb-rm[open] { animation-name: zb-rm-up; }
  @keyframes zb-rm-up {
    from { opacity: 0; transform: translateY(28px); }
  }
  .zb-rm__panel {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overscroll-behavior: contain;
    scroll-padding-bottom: 10rem; /* a control scrolled to by Tab stays clear of the sticky footer */
    padding: env(safe-area-inset-top) 0 0;
    background: radial-gradient(360px 260px at 100% 0, rgba(212, 165, 116, .08), rgba(212, 165, 116, 0) 70%);
  }
  .zb-rm__head { padding: 1.1rem 4rem .9rem 1rem; }
  .zb-rm__kicker { margin-bottom: .45rem; }
  .zb-rm__title { font-size: 1.6rem; }
  .zb-rm__sub { margin-top: .4rem; font-size: .82rem; }
  .zb-rm__close { top: calc(.85rem + env(safe-area-inset-top)); right: .85rem; }
  .zb-rm__stage {
    flex: none;
    margin: 0 1rem;
    padding: .6rem;
  }
  /* The stage fits the photo's shape, within limits */
  .zb-rm__stage:not([data-view="empty"]) {
    height: calc((100vw - 3.2rem) / (var(--ar)) + 1.2rem);
    min-height: 15.5rem;
    max-height: 60vh;
    max-height: 60dvh;
  }
  .zb-rm__drop { padding: 1.25rem 1rem; gap: .75rem; }
  .zb-rm__drop-icon { width: 3.25rem; height: 3.25rem; font-size: 1.4rem; }
  .zb-rm__drop-title { font-size: 1.2rem; }
  .zb-rm__tip { font-size: .76rem; }
  .zb-rm__change { top: .6rem; right: .6rem; }
  .zb-rm__small { bottom: .6rem; max-width: calc(100% - 1.2rem); padding: .4rem .75rem; font-size: .72rem; }
  .zb-rm__alert { padding: 1rem 1rem .8rem; gap: .65rem; }
  .zb-rm__alert-icon { display: none; }
  .zb-rm__alert-msg { font-size: .86rem; }
  .zb-rm__working { max-width: calc(100% - 2rem); }
  .zb-rm__progress { min-width: 10rem; }
  .zb-rm__controls {
    flex: 1 0 auto;
    overflow: visible;
    padding: 1.25rem 1rem .5rem;
  }
  .zb-rm__foot {
    position: sticky;
    bottom: 0;
    z-index: 4;
    padding: .75rem 1rem calc(.8rem + env(safe-area-inset-bottom));
    border-top: 1px solid rgba(212, 165, 116, .12);
    background: rgba(20, 20, 20, .94);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    box-shadow: 0 -16px 32px -18px rgba(0, 0, 0, .9);
  }
  .zb-rm__privacy,
  .zb-rm__cta-sub { margin-top: .45rem; }
  .zb-rm__hint { margin-top: .45rem; }
}

@media (prefers-reduced-motion: reduce) {
  .zb-rm[open],
  .zb-rm[open]::backdrop,
  .zb-rm__status.is-swap,
  .zb-rm__alert,
  .zb-rm__hint.is-nudge { animation: none; }
  .zb-rm__stage[data-view="generating"] .zb-rm__sweep { display: none; }
  /* The progress bar keeps its slow 25 s fill: without it, it would jump straight to "almost done" */
}
