:root {
  --ink: #1b1b1b;
  --ink-2: #4a4a4a;
  --muted: #8b8b8b;
  --line: #e6e6e6;
  --line-2: #d6d6d6;
  --panel: #ffffff;
  --chip: #e3e3e2;
  --chip-hover: #d7d7d6;
  --stage-a: #f4f4f3;
  --stage-b: #e4e4e3;
  --panel-w: clamp(300px, 26vw, 372px);
  --radius: 2px;
  --font: 'Jost', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--stage-b);
  color: var(--ink);
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

button { font: inherit; color: inherit; }

.app {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--panel-w);
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

/* ---------------- stage ---------------- */

.stage {
  position: relative;
  min-width: 0;
  overflow: hidden;
  background: radial-gradient(ellipse 75% 75% at 50% 45%, var(--stage-a) 0%, var(--stage-b) 100%);
}

.viewport { position: absolute; inset: 0; }
.viewport canvas { display: block; width: 100%; height: 100%; outline: none; cursor: grab; touch-action: none; }
.viewport canvas:active { cursor: grabbing; }

.icon-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  background: var(--chip);
  color: var(--ink);
  cursor: pointer;
  transition: background-color .15s ease, opacity .15s ease, transform .15s var(--ease);
}
.icon-btn svg { width: 19px; height: 19px; }
.icon-btn:hover { background: var(--chip-hover); }
.icon-btn:active { transform: scale(0.94); }
.icon-btn:disabled { opacity: .38; cursor: default; transform: none; background: var(--chip); }
.icon-btn:focus-visible, .stepper__stop:focus-visible, .swatch:focus-visible, .tile:focus-visible,
.finish:focus-visible, .acc__head:focus-visible, .segmented__btn:focus-visible, .btn-primary:focus-visible, .btn-secondary:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}
.icon-btn--plain { background: transparent; }
.icon-btn--plain:hover { background: #f1f1f1; }

/* tooltips (pointer devices only) */
@media (hover: hover) {
  [data-tip]::after {
    content: attr(data-tip);
    position: absolute;
    left: 50%;
    top: calc(100% + 8px);
    transform: translate(-50%, -3px);
    padding: 5px 8px;
    border-radius: var(--radius);
    background: var(--ink);
    color: #fff;
    font-size: 11px;
    line-height: 1.2;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity .15s ease, transform .15s var(--ease);
    z-index: 30;
  }
  [data-tip]:hover::after { opacity: 1; transform: translate(-50%, 0); transition-delay: .35s; }
  [data-tip-side="left"]::after { left: auto; right: calc(100% + 8px); top: 50%; transform: translate(3px, -50%); }
  [data-tip-side="left"]:hover::after { transform: translate(0, -50%); }
  .swatch[data-tip]::after, .finish[data-tip]::after { top: auto; bottom: calc(100% + 6px); }
}

.toolbar {
  position: absolute;
  top: 18px;
  left: 18px;
  display: flex;
  gap: 6px;
  align-items: center;
  z-index: 5;
}
.toolbar__sep { width: 1px; height: 20px; background: var(--line-2); margin: 0 4px; }

.brand {
  position: absolute;
  top: 26px;
  right: 22px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: #636363;
  pointer-events: none;
}

.viewctrl {
  position: absolute;
  right: 18px;
  bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 5;
}

.popover {
  position: absolute;
  right: 64px;
  bottom: 18px;
  width: 250px;
  padding: 16px 18px;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: 0 12px 40px rgba(0, 0, 0, .1), 0 1px 3px rgba(0, 0, 0, .06);
  z-index: 6;
  animation: pop-in .2s var(--ease);
}
.popover h3 { margin: 0 0 10px; font-size: 13px; font-weight: 500; }
.popover dl { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; margin: 0 0 12px; }
.popover dt { color: var(--muted); }
.popover dd { margin: 0; font-variant-numeric: tabular-nums; }
.popover p { margin: 0; color: var(--muted); font-size: 12px; }
@keyframes pop-in { from { opacity: 0; transform: translateY(4px); } }

.hint {
  position: absolute;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 15px 8px 12px;
  border-radius: 999px;
  background: rgba(27, 27, 27, .86);
  color: #fff;
  font-size: 12px;
  letter-spacing: .02em;
  white-space: nowrap;
  pointer-events: none;
  transition: opacity .5s ease, transform .5s var(--ease);
  z-index: 4;
}
.hint svg { width: 18px; height: 18px; }
.hint.is-gone { opacity: 0; transform: translate(-50%, 8px); }

.meta {
  position: absolute;
  left: 20px;
  bottom: 20px;
  color: #636363; /* AA on the studio sweep */
  font-size: 12px;
  pointer-events: none;
  z-index: 3;
}
.meta__name { color: var(--ink-2); font-weight: 500; }
.meta__dims { font-variant-numeric: tabular-nums; }

.loader {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--muted);
  background: radial-gradient(ellipse 75% 75% at 50% 45%, var(--stage-a) 0%, var(--stage-b) 100%);
  z-index: 20;
  transition: opacity .6s ease, visibility .6s;
  text-align: center;
  padding: 24px;
}
.loader.is-gone { opacity: 0; visibility: hidden; }
.loader.is-error .spinner { display: none; }
.loader.is-error span { color: var(--ink); max-width: 340px; }
.spinner {
  width: 26px;
  height: 26px;
  border: 1.5px solid var(--line-2);
  border-top-color: var(--ink);
  border-radius: 50%;
  animation: spin .9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------- panel ---------------- */

.panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--panel);
  border-left: 1px solid var(--line);
}
.panel__head { padding: 22px 22px 16px; border-bottom: 1px solid var(--line); }
.panel__head h1 { margin: 0; font-size: 17px; font-weight: 500; letter-spacing: .01em; }
.panel__body { flex: 1; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }

.acc { border-bottom: 1px solid var(--line); }
.acc__head {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 15px 22px;
  border: 0;
  background: #fff;
  text-align: left;
  cursor: pointer;
  transition: background-color .25s ease, color .25s ease;
}
.acc__head:hover { background: #f7f7f7; }
.acc__titles { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.acc__title { font-size: 14px; font-weight: 500; }
.acc__summary { display: flex; flex-direction: column; font-size: 11.5px; color: var(--muted); line-height: 1.45; }
.acc__summary span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc__chev { width: 18px; height: 18px; flex: none; transition: transform .3s var(--ease); }
.acc__chev svg { width: 100%; height: 100%; }
.acc.is-open .acc__head { background: var(--ink); color: #fff; }
.acc.is-open .acc__summary { color: rgba(255, 255, 255, .62); }
.acc.is-open .acc__chev { transform: rotate(180deg); }

.acc__body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .38s var(--ease); }
.acc.is-open .acc__body { grid-template-rows: 1fr; }
.acc__clip { overflow: hidden; min-height: 0; }
.acc__inner { padding: 20px 22px 24px; display: flex; flex-direction: column; gap: 18px; }

.opt-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin: 0 0 10px;
  padding: 0;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}
.opt-label__price, .opt-label__value { letter-spacing: .04em; text-transform: none; font-size: 11.5px; color: var(--ink-2); font-weight: 400; }
.opt-block { display: flex; flex-direction: column; }
.opt-block[hidden] { display: none; }
.opt-block.is-hidden { display: none; }
.note { margin: -4px 0 0; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }

/* stepper */
.stepper {
  --n: 5;
  --i: 0;
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--n), 1fr);
  padding-top: 4px;
}
.stepper__track {
  position: absolute;
  top: 13px;
  left: calc(100% / var(--n) / 2);
  right: calc(100% / var(--n) / 2);
  height: 1px;
  background: var(--line-2);
}
.stepper__fill {
  height: 100%;
  width: calc(100% * var(--i) / (var(--n) - 1));
  background: var(--ink);
  transition: width .45s var(--ease);
}
.stepper__stop {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  padding: 0 2px 2px;
  border: 0;
  background: none;
  cursor: pointer;
}
.stepper__dot {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
}
.stepper__dot::before {
  content: '';
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #fff;
  border: 1.5px solid #bdbdbd;
  transition: all .3s var(--ease);
}
.stepper__stop:hover .stepper__dot::before { border-color: var(--ink); }
.stepper__stop.is-selected .stepper__dot::before { width: 18px; height: 18px; background: var(--ink); border-color: var(--ink); box-shadow: inset 0 0 0 4px var(--ink), inset 0 0 0 5.5px #fff; }
.stepper__label { font-size: 11.5px; line-height: 1.2; color: var(--muted); text-align: center; transition: color .2s ease; }
.stepper__stop.is-selected .stepper__label { color: var(--ink); font-weight: 500; }

.segmented { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line-2); border-radius: var(--radius); }
.segmented__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 8px;
  border: 0;
  background: #fff;
  cursor: pointer;
  transition: background-color .2s ease, color .2s ease;
}
.segmented__btn + .segmented__btn { border-left: 1px solid var(--line-2); }
.segmented__btn svg { width: 20px; height: 20px; }
.segmented__btn.is-selected { background: var(--ink); color: #fff; }

/* radios */
.radio-group { margin: 0; padding: 0; border: 0; min-width: 0; }
.radio-group legend { width: 100%; }
.radio {
  position: relative; /* keeps the hidden input inside the scrolling panel instead of stretching the page */
  display: grid;
  grid-template-columns: 18px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  cursor: pointer;
}
.radio + .radio { border-top: 1px solid #f0f0f0; }
.radio input { position: absolute; opacity: 0; pointer-events: none; }
.radio__mark {
  grid-column: 1;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1.5px solid #9a9a9a;
  display: grid;
  place-items: center;
  transition: border-color .2s ease;
}
.radio__mark::after { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--ink); transform: scale(0); transition: transform .25s var(--ease); }
.radio input:checked ~ .radio__mark { border-color: var(--ink); }
.radio input:checked ~ .radio__mark::after { transform: scale(1); }
.radio input:focus-visible ~ .radio__mark { outline: 2px solid var(--ink); outline-offset: 2px; }
.radio__text { font-size: 13px; }
.radio__price { font-size: 12px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.radio:hover .radio__mark { border-color: var(--ink); }

/* fabric */
.fabric-current { display: flex; gap: 12px; align-items: center; padding-bottom: 16px; border-bottom: 1px solid #f0f0f0; }
.fabric-current__swatch { flex: none; width: 46px; height: 46px; border-radius: 50%; background-size: cover; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08), inset 0 -6px 10px rgba(0, 0, 0, .12); }
.fabric-current__name { font-size: 14px; font-weight: 500; }
.fabric-current__meta { margin-top: 2px; font-size: 11.5px; color: var(--muted); line-height: 1.4; }

.swatches { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin: -2px 0 6px; }
.swatch {
  position: relative;
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08), inset 0 -5px 9px rgba(0, 0, 0, .14), inset 0 4px 6px rgba(255, 255, 255, .12);
  transition: transform .2s var(--ease), box-shadow .2s ease;
}
.swatch:hover { transform: scale(1.06); }
.swatch.is-selected { box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px var(--ink), inset 0 -5px 9px rgba(0, 0, 0, .14); }

.badge {
  position: absolute;
  top: -3px;
  right: -3px;
  display: grid;
  place-items: center;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  box-shadow: 0 0 0 1.5px #fff;
  opacity: 0;
  transform: scale(.5);
  transition: opacity .2s ease, transform .25s var(--ease);
  pointer-events: none;
}
.badge svg { width: 11px; height: 11px; }
.is-selected > .badge, .is-selected > .finish__chip > .badge { opacity: 1; transform: scale(1); }

/* leg tiles */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 16px; }
.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 4px 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fafafa;
  cursor: pointer;
  transition: border-color .2s ease, background-color .2s ease;
}
.tile:hover { border-color: #b8b8b8; }
.tile.is-selected { border-color: var(--ink); box-shadow: inset 0 0 0 0.5px var(--ink); background: #fff; }
.tile__art { width: 100%; max-width: 64px; aspect-ratio: 1; color: var(--ink); }
.tile__art svg { width: 100%; height: 100%; }
.tile__label { font-size: 12px; }
.tile__price { font-size: 11px; color: var(--muted); }

.finishes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.finish { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 0; border: 0; background: none; cursor: pointer; text-align: center; }
.finish__chip {
  position: relative;
  display: block;
  aspect-ratio: 1;
  border-radius: var(--radius);
  background-size: cover;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .1);
  transition: box-shadow .2s ease;
}
.finish:hover .finish__chip { box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .1), 0 0 0 1px #b8b8b8; }
.finish.is-selected .finish__chip { box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px var(--ink); }
.finish__label { font-size: 11px; line-height: 1.25; color: var(--muted); }
.finish.is-selected .finish__label { color: var(--ink); }

/* footer */
.panel__foot {
  padding: 16px 22px calc(18px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: #fff;
}
.price { display: flex; align-items: baseline; gap: 8px; }
.price__value { font-size: 23px; font-weight: 500; letter-spacing: .005em; font-variant-numeric: tabular-nums; }
.price__vat { font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.price__note { margin: 2px 0 12px; font-size: 11.5px; color: var(--muted); }

.btn-primary, .btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  padding: 0 22px;
  border-radius: var(--radius);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color .2s ease, transform .15s var(--ease);
}
.btn-primary { width: 100%; border: 0; background: var(--ink); color: #fff; }
.btn-primary:hover { background: #333; }
.btn-primary:active, .btn-secondary:active { transform: scale(.985); }
.btn-primary--auto { width: auto; }
.btn-secondary { border: 1px solid var(--line-2); background: #fff; color: var(--ink); }
.btn-secondary:hover { border-color: var(--ink); }
.btn-primary svg, .btn-secondary svg { width: 18px; height: 18px; }

/* ---------------- dialog ---------------- */

.dialog {
  width: min(860px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 0;
  border-radius: 4px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .25);
  color: var(--ink);
}
.dialog[open] { animation: dlg-in .3s var(--ease); }
.dialog::backdrop { background: rgba(20, 20, 20, .35); backdrop-filter: blur(2px); }
@keyframes dlg-in { from { opacity: 0; transform: translateY(10px) scale(.99); } }
.dialog__inner { display: flex; flex-direction: column; max-height: calc(100dvh - 32px); }
.dialog__head { display: flex; align-items: center; justify-content: space-between; padding: 16px 16px 12px 24px; border-bottom: 1px solid var(--line); }
.dialog__head h2 { margin: 0; font-size: 16px; font-weight: 500; }
.dialog__body { padding: 20px 24px; overflow-y: auto; }
.dialog__foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 24px 18px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.dialog__notice { margin: 0 0 16px; padding: 10px 12px; background: #f4f4f3; border-radius: var(--radius); color: var(--ink-2); font-size: 12.5px; }

.sum { display: grid; grid-template-columns: 1.15fr 1fr; gap: 24px; align-items: start; }
.sum__img { margin: 0; background: radial-gradient(ellipse at 50% 45%, var(--stage-a), var(--stage-b)); border-radius: var(--radius); overflow: hidden; }
.sum__img img { display: block; width: 100%; height: auto; }
.sum__brand { margin: 0; font-size: 10.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.sum__name { margin: 4px 0 2px; font-size: 18px; font-weight: 500; }
.sum__dims { margin: 0 0 14px; font-size: 12px; color: var(--muted); }
.sum__table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.sum__table th, .sum__table td { padding: 7px 0; border-bottom: 1px solid #efefef; vertical-align: top; text-align: left; }
.sum__table th { font-weight: 400; color: var(--muted); padding-right: 10px; white-space: nowrap; }
.sum__table td.num { text-align: right; white-space: nowrap; padding-left: 10px; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.sum__total { display: flex; justify-content: space-between; align-items: baseline; margin-top: 14px; font-size: 13px; }
.sum__total small { font-size: 10px; letter-spacing: .1em; color: var(--muted); }
.sum__total strong { font-size: 21px; font-weight: 500; font-variant-numeric: tabular-nums; }
.sum__code { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; padding: 10px 12px; background: #f4f4f3; border-radius: var(--radius); font-size: 12px; color: var(--muted); }
.sum__code code { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 13px; color: var(--ink); letter-spacing: .04em; }
.sum__url { word-break: break-all; font-size: 10px; color: var(--muted); }
.sum__date { font-size: 10px; color: var(--muted); }

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 12px);
  padding: 10px 16px;
  border-radius: var(--radius);
  background: var(--ink);
  color: #fff;
  font-size: 12.5px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease, transform .3s var(--ease);
  z-index: 50;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }


/* ---------------- configuration code bar (panel header) ---------------- */

.codebar { margin-top: 10px; }
.codebar__row { display: flex; align-items: center; gap: 8px; min-height: 28px; }
.codebar__label { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.codebar__value { white-space: nowrap; font-family: var(--font); font-size: 13px; font-weight: 500; letter-spacing: .06em; font-variant-numeric: tabular-nums; color: var(--ink); }
.codebar__copy { width: 28px; height: 28px; margin-left: -4px; }
.codebar__copy svg { width: 16px; height: 16px; }
.codebar__link { white-space: nowrap; margin-left: auto; padding: 4px 0; border: 0; background: none; font-size: 12px; color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.codebar__link:hover { color: var(--ink); }
.codebar__link:focus-visible, .codebar__input:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.codebar__form { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 8px; }
.codebar__form[hidden] { display: none; }
.codebar__input { min-width: 0; height: 38px; padding: 0 11px; border: 1px solid var(--line-2); border-radius: var(--radius); font: inherit; font-size: 14px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink); background: #fff; }
.codebar__input::placeholder { text-transform: none; letter-spacing: 0; color: #a5a5a5; }
.codebar__input[aria-invalid="true"] { border-color: #b3261e; }
.codebar__submit { height: 38px; padding: 0 14px; }
.codebar__error { grid-column: 1 / -1; margin: 0; font-size: 12px; line-height: 1.35; color: #b3261e; }
.codebar__error:empty { display: none; }

/* ---------------- 3D download dialog ---------------- */

.formats { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.format { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 18px; padding: 16px 0; border-top: 1px solid var(--line); }
.format h3 { margin: 0 0 4px; font-size: 14px; font-weight: 500; }
.format h3 small { margin-left: 6px; font-size: 11.5px; font-weight: 400; color: var(--muted); }
.format p { margin: 0; font-size: 12.5px; line-height: 1.45; color: var(--ink-2); max-width: 52ch; }
.format .btn-secondary:disabled { opacity: .5; cursor: progress; }

/* ---------------- AR call to action ---------------- */

.ar-pill {
  position: absolute;
  left: 50%;
  bottom: 96px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 9px;
  height: 38px;
  padding: 0 16px 0 12px;
  border: 0;
  border-radius: 999px;
  background: rgba(27, 27, 27, .92);
  color: #fff;
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: .01em;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(0, 0, 0, .16);
  transition: transform .2s var(--ease), background-color .15s ease;
  z-index: 5;
}
.ar-pill svg { width: 19px; height: 19px; }
.ar-pill:hover { background: #000; transform: translateX(-50%) translateY(-1px); }
.ar-pill:focus-visible, .ar-row:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.ar-row { display: none; }
.hint { bottom: 146px; }

.ar { display: grid; gap: 12px; }
.ar--qr { grid-template-columns: 208px 1fr; gap: 26px; align-items: center; }
.ar__code { display: grid; place-items: center; width: 208px; min-height: 208px; padding: 8px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.ar__code svg { display: block; width: 100%; height: auto; }
.ar__local { margin: 0; padding: 10px; font-size: 12.5px; line-height: 1.45; color: var(--ink-2); text-align: center; }
.ar__lead { margin: 0; font-size: 15px; font-weight: 500; line-height: 1.35; }
.ar__text { margin: 0; font-size: 13px; line-height: 1.5; color: var(--ink-2); max-width: 56ch; }
.ar__note { margin: 0; font-size: 12px; line-height: 1.45; color: #6b6b6b; max-width: 56ch; }
.ar__stage { display: grid; justify-items: center; gap: 10px; padding: 20px 12px; border: 1px solid var(--line); border-radius: var(--radius); text-align: center; font-size: 13px; color: var(--ink-2); }
.ar__launch { display: block; line-height: 0; }
.ar__launch img { display: block; max-width: 100%; height: auto; }
.ar__hint { font-size: 12px; color: #6b6b6b; }
.ar__error { color: #b3261e; }

/* ---------------- view switcher (studio / rooms) ---------------- */

.views {
  position: absolute;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  padding: 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, .78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 2px 14px rgba(0, 0, 0, .08);
  z-index: 5;
}
.views.is-busy { cursor: progress; }
.views.is-busy .view { pointer-events: none; }
.views.is-busy .view.is-selected .view__thumb::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .55) 50%, transparent 70%) 0 0 / 200% 100%;
  animation: view-busy .9s linear infinite;
}
@keyframes view-busy { from { background-position: 120% 0; } to { background-position: -80% 0; } }
.view {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 4px;
  width: 76px;
  padding: 3px 3px 4px;
  border: 0;
  border-radius: 3px;
  background: transparent;
  cursor: pointer;
  font-size: 10.5px;
  line-height: 1.15;
  color: var(--ink-2);
  transition: background-color .15s ease, color .15s ease;
}
.view:hover { background: rgba(0, 0, 0, .05); }
.view:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }
.view.is-selected { color: var(--ink); font-weight: 500; }
.view__thumb {
  position: relative;
  width: 70px;
  height: 42px;
  border-radius: 2px;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .1);
  transition: box-shadow .15s ease;
}
.view.is-selected .view__thumb { box-shadow: 0 0 0 2px var(--ink); }
.view__label { white-space: nowrap; }
.view.is-suggested::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #b7791f;
  border: 2px solid #fff;
  z-index: 1;
}
.view[data-tip]::after { top: auto; bottom: calc(100% + 8px); }
/* thumbnails are drawn in CSS so no room has to be built just to show its button */
.view__thumb--studio { background: radial-gradient(ellipse 60% 22% at 50% 78%, rgba(0, 0, 0, .13), transparent 70%), linear-gradient(#f3f3f2, #e2e2e0); }
.view__thumb--jasny {
  background:
    linear-gradient(115deg, transparent 38%, rgba(255, 244, 214, .9) 39%, rgba(255, 244, 214, .9) 52%, transparent 53%) 0 100% / 100% 36% no-repeat,
    linear-gradient(#cfe3fb, #f7fbff) 8% 22% / 24% 44% no-repeat,
    linear-gradient(#f1eee8 64%, #c9a67c 64%);
}
.view__thumb--wieczor {
  background:
    radial-gradient(circle at 78% 34%, rgba(255, 205, 140, .95), rgba(255, 190, 120, .25) 22%, transparent 46%),
    linear-gradient(#1c2a4a, #4a5578) 8% 22% / 22% 44% no-repeat,
    linear-gradient(#2c3a34 64%, #4a3526 64%);
}
.view__thumb--biuro {
  background:
    repeating-linear-gradient(90deg, #b99668 0 3px, #2a2622 3px 5px) 100% 0 / 70% 64% no-repeat,
    linear-gradient(#eef1f4, #f6f7f8) 0 0 / 30% 64% no-repeat,
    linear-gradient(#e9e9e6 64%, #9a9892 64%);
}


/* Over a room the background behind an overlay can be anything (pale wall, dark rug, sunlit floor) and
   changes while orbiting, so text and controls get an opaque-enough frosted chip of their own instead of
   relying on the scene for contrast. The studio keeps its bare, lighter look. */
.stage:not([data-setting="studio"]) :is(.meta, .brand) {
  padding: 7px 11px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 2px 14px rgba(0, 0, 0, .1);
}
.stage:not([data-setting="studio"]) .meta { left: 18px; bottom: 16px; color: var(--ink-2); }
.stage:not([data-setting="studio"]) .meta__name { color: var(--ink); }
.stage:not([data-setting="studio"]) .brand { top: 18px; right: 18px; color: var(--ink-2); }
.stage:not([data-setting="studio"]) .icon-btn:not(.icon-btn--plain) { background: rgba(255, 255, 255, .9); box-shadow: 0 2px 14px rgba(0, 0, 0, .1); }
.stage:not([data-setting="studio"]) .icon-btn:not(.icon-btn--plain):hover { background: #fff; }
.stage:not([data-setting="studio"]) .icon-btn:disabled { opacity: 1; color: #a9a9a9; background: rgba(255, 255, 255, .9); }
.stage:not([data-setting="studio"]) .toolbar__sep { background: rgba(255, 255, 255, .7); }
.stage:not([data-setting="studio"]) .views { background: rgba(255, 255, 255, .9); }

/* when the stage is too narrow for the label and the switcher side by side, the label moves above it */
@media (min-width: 861px) and (max-width: 1320px) {
  .meta, .stage:not([data-setting="studio"]) .meta { bottom: 144px; }
  .hint { bottom: 196px; }
}

/* ---------------- product switcher and Heaven controls ---------------- */

.product-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 0 0 16px;
  padding: 3px;
  border-radius: 4px;
  background: #f1f1f0;
}
.product-switch__btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 6px 8px;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: .02em;
  cursor: pointer;
  transition: background-color .2s ease, color .2s ease, box-shadow .2s ease;
}
.product-switch__btn:hover { color: var(--ink); }
.product-switch__btn.is-selected { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .1), 0 0 0 1px rgba(0, 0, 0, .04); }
.product-switch__btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }

.segmented--3 { grid-template-columns: repeat(3, 1fr); }
.stepper__label small { font-size: 10.5px; color: var(--muted); font-weight: 400; }

.tiles--plans { grid-template-columns: repeat(2, 1fr); margin-bottom: 0; }
.tile--plan { padding: 10px 8px 9px; }
.tile--plan .tile__art { max-width: 92px; aspect-ratio: auto; height: 48px; }
.tile--plan.is-mirrored .tile__art svg { transform: scaleX(-1); }
.tile__art--wide { max-width: 72px; aspect-ratio: 64 / 40; }

.el-list .opt-label { margin: 6px 0 8px; }
.el-list .opt-label:first-child { margin-top: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  padding: 6px 10px 7px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fafafa;
  text-align: left;
  font-size: 12px;
  line-height: 1.25;
  cursor: pointer;
  transition: border-color .2s ease, background-color .2s ease;
}
.chip:hover { border-color: #b8b8b8; }
.chip.is-selected { border-color: var(--ink); background: #fff; box-shadow: inset 0 0 0 0.5px var(--ink); }
.chip__dims { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.chip:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.catdims { padding: 10px 12px; border-radius: var(--radius); background: #f6f6f5; font-size: 12px; }
.catdims__row { display: flex; justify-content: space-between; gap: 10px; padding: 2px 0; }
.catdims__row span { color: var(--muted); }
.catdims__row strong { font-weight: 500; font-variant-numeric: tabular-nums; text-align: right; }
.catdims__src { margin-top: 4px; font-size: 11px; color: var(--muted); }
.note--small { margin: 0; font-size: 11.5px; line-height: 1.4; }

.counter { display: inline-grid; grid-template-columns: 36px 44px 36px; align-items: center; border: 1px solid var(--line-2); border-radius: var(--radius); width: max-content; }
.counter__btn { width: 36px; height: 34px; }
.counter__btn svg { width: 16px; height: 16px; }
.counter__value { text-align: center; font-size: 14px; font-weight: 500; font-variant-numeric: tabular-nums; }
.opt-block .counter + .note { margin-top: 8px; }

.swatches--photo { grid-template-columns: repeat(6, 1fr); gap: 8px; }
.swatch--photo { border-radius: 3px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); }
.swatch--photo.is-selected { box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px var(--ink); }
.fabric-current__swatch--photo { border-radius: 4px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); width: 56px; height: 56px; background-position: center; }
.fabric-current__link { display: inline-block; margin-top: 4px; font-size: 11.5px; color: var(--ink-2); text-underline-offset: 3px; }
.popover__note { margin: -4px 0 10px !important; color: var(--ink-2) !important; font-size: 11.5px !important; line-height: 1.4; }
.finish__sub { display: block; font-size: 10px; color: var(--muted); }
.finish__sub:empty { display: none; }
.note--change { margin-top: 8px; padding: 7px 9px; background: #f4f4f3; border-radius: var(--radius); color: var(--ink-2); }
.note--change[hidden] { display: none; }
.sum__note { margin: 6px 0 0; font-size: 11.5px; color: var(--muted); text-align: right; }

.loadchip {
  position: absolute;
  left: 50%;
  top: 18px;
  transform: translateX(-50%);
  display: grid;
  gap: 6px;
  min-width: 210px;
  padding: 9px 14px 10px;
  border-radius: 4px;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 2px 14px rgba(0, 0, 0, .1);
  font-size: 12px;
  color: var(--ink-2);
  text-align: center;
  z-index: 6;
  pointer-events: none;
}
.loadchip[hidden] { display: none; }
.loadchip__bar { display: block; height: 2px; background: var(--line); overflow: hidden; border-radius: 1px; }
.loadchip__fill { display: block; height: 100%; background: var(--ink); transform-origin: 0 50%; transform: scaleX(0); transition: transform .2s ease; }
.loadchip.is-error { color: #b3261e; }

/* ---------------- mobile: viewport on top, panel as a sheet below ---------------- */

@media (max-width: 860px) {
  .app {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(260px, 50dvh) minmax(0, 1fr);
  }
  .panel {
    border-left: 0;
    border-radius: 14px 14px 0 0;
    margin-top: -14px;
    position: relative;
    z-index: 10;
    box-shadow: 0 -8px 30px rgba(0, 0, 0, .07);
  }
  .panel::before {
    content: '';
    position: absolute;
    top: 7px;
    left: 50%;
    width: 36px;
    height: 4px;
    margin-left: -18px;
    border-radius: 2px;
    background: #ddd;
  }
  .panel__head { padding: 20px 18px 12px; }
  .panel__head h1 { font-size: 16px; }
  .acc__head { padding: 13px 18px; }
  .acc__inner { padding: 18px 18px 22px; }
  .panel__foot {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    column-gap: 14px;
    padding: 12px 18px calc(12px + env(safe-area-inset-bottom));
    box-shadow: 0 -6px 18px rgba(0, 0, 0, .05);
  }
  .price { grid-column: 1; grid-row: 1; }
  .price__value { font-size: 19px; }
  .price__note { grid-column: 1; grid-row: 2; margin: 0; font-size: 11px; }
  .panel__foot .btn-primary { grid-column: 2; grid-row: 1 / span 2; width: auto; height: 46px; padding: 0 18px; font-size: 11.5px; letter-spacing: .1em; }
  .toolbar { top: 12px; left: 12px; gap: 5px; }
  .icon-btn { width: 34px; height: 34px; }
  .brand { display: none; }
  .viewctrl { right: 12px; bottom: 26px; gap: 5px; }
  .popover { right: 56px; bottom: 26px; width: min(250px, calc(100vw - 80px)); }
  .meta { left: 14px; bottom: 26px; font-size: 11px; max-width: calc(100% - 70px); }
  .stage:not([data-setting="studio"]) .meta { left: 12px; bottom: 24px; padding: 5px 9px; }
  .hint { bottom: auto; top: 58px; font-size: 11.5px; padding: 6px 13px 6px 10px; }
  /* thumbnails only, stacked on the left edge clear of the product name and the view buttons */
  .views { left: 12px; bottom: auto; top: 58px; transform: none; flex-direction: column; gap: 4px; padding: 4px; }
  .view { width: auto; padding: 2px; }
  .view__thumb { width: 44px; height: 28px; }
  .view__label { display: none; }
  .view[data-tip]::after { display: none; }
  /* on phones the AR invitation is a row directly under the viewport instead of a pill over it */
  .ar-pill { display: none; }
  .ar-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 11px;
    width: 100%;
    margin-top: 12px;
    padding: 11px 12px;
    border: 0;
    border-radius: 4px;
    background: var(--ink);
    color: #fff;
    text-align: left;
    cursor: pointer;
  }
  .ar-row svg { width: 22px; height: 22px; }
  .ar-row svg:last-child { width: 16px; height: 16px; transform: rotate(-90deg); opacity: .7; }
  .ar-row strong { display: block; font-size: 13.5px; font-weight: 500; }
  .ar-row small { display: block; margin-top: 2px; font-size: 11.5px; line-height: 1.35; color: rgba(255, 255, 255, .72); }
  .ar--qr { grid-template-columns: 1fr; justify-items: center; }
  .sum { grid-template-columns: 1fr; gap: 16px; }
  .dialog__body { padding: 16px; }
  .dialog__foot { padding: 12px 16px 16px; }
  .dialog__foot > * { flex: 1; padding: 0 10px; font-size: 11.5px; letter-spacing: .05em; white-space: nowrap; }
  .swatches { gap: 12px; }
  .swatches--photo { grid-template-columns: repeat(6, 1fr); gap: 8px; }
  .product-switch { margin-bottom: 12px; }
  .product-switch__btn { min-height: 34px; padding: 4px 6px; font-size: 12px; }
  /* with the product switcher the header is taller: on phones the header scrolls away with the options
     (the price bar stays pinned), so the options get the whole sheet instead of a sliver under the header */
  .panel { overflow-y: auto; overscroll-behavior: contain; }
  .panel__body { flex: none; overflow: visible; }
  .panel__foot { position: sticky; bottom: 0; z-index: 2; margin-top: auto; }
  .loadchip { top: auto; bottom: 26px; min-width: 180px; }
}

@media (max-width: 380px) {
  .toolbar__sep { display: none; }
  .icon-btn { width: 32px; height: 32px; }
  .stepper__label { font-size: 10.5px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
