.page-configurator footer {
  padding-bottom: 84px;
}
.cfg {
  display: grid;
  grid-template-columns: minmax(360px, 470px) minmax(0, 1fr);
  grid-template-areas: "panel stage";
  min-height: calc(100svh - 75px);
  background: var(--mist);
}
.cfg-stage {
  grid-area: stage;
  position: sticky;
  top: 0;
  height: calc(100svh - 76px);
  padding: 14px 14px 90px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cfg-view {
  position: relative;
  flex: 1;
  border-radius: var(--radius);
  overflow: hidden;
  background: #e4dfd4;
  touch-action: none;
}
.cfg-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  padding: 30px;
  background: #fff;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}
.cfg-fallback .cfg-plan {
  width: min(520px, 100%);
}
.cfg-fallback[hidden] {
  display: none;
}
.cfg-toolbar {
  position: absolute;
  top: 26px;
  left: 12px;
  right: 26px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  pointer-events: none;
  flex-wrap: wrap;
}
.cfg-views,
.cfg-toggles {
  pointer-events: auto;
  display: flex;
  gap: 2px;
  background: #fdfbf6e6;
  backdrop-filter: blur(6px);
  border-radius: 8px;
  padding: 4px;
}
.cfg-views button {
  border: 0;
  background: transparent;
  border-radius: 6px;
  min-height: 34px;
  padding: 0 11px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
}
.cfg-views button:hover {
  background: var(--ink);
  color: var(--mist);
}
.cfg-toggles label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  margin: 0;
  padding: 0 8px;
}
.cfg-toggles input {
  accent-color: var(--orange);
}
.cfg-sun {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 13px;
}
.cfg-sun summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  font-weight: 650;
  cursor: pointer;
  list-style: none;
}
.cfg-sun summary::-webkit-details-marker {
  display: none;
}
.cfg-sun-body {
  padding: 0 14px 12px;
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 4px 20px;
  align-items: end;
}
.sun-row label {
  display: flex;
  justify-content: space-between;
  margin: 4px 0 0;
  font-size: 12px;
}
.sun-row output {
  font-weight: 700;
  color: var(--accent-ink);
}
.sun-row input {
  height: 26px;
}
.cfg-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.cfg-chips label {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 7px 12px;
  font-size: 13px;
  cursor: pointer;
  background: var(--surface);
}
.cfg-chips input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.cfg-chips label:has(input:checked) {
  background: var(--ink);
  color: var(--mist);
  border-color: var(--ink);
}
.cfg-chips label:has(input:focus-visible) {
  outline: 3px solid #e2762c;
  outline-offset: 2px;
}
.time-chips {
  margin-top: 8px;
}
.time-chips label {
  padding: 5px 10px;
  font-size: 12px;
}

/* Panel */
.cfg-panel {
  grid-area: panel;
  padding: 24px 26px 120px;
}
.cfg-head h1 {
  font-size: clamp(34px, 3vw, 48px);
  margin: 10px 0 8px;
}
.cfg-head > p:last-child {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
  margin-bottom: 18px;
}
.cfg-step {
  border-top: 1px solid var(--line);
}
.cfg-step h2 {
  font-size: inherit;
  letter-spacing: 0;
}
.cfg-step-head {
  width: 100%;
  display: grid;
  grid-template-columns: 34px auto 1fr 20px;
  align-items: center;
  gap: 10px;
  background: none;
  border: 0;
  padding: 16px 0;
  text-align: left;
  color: var(--ink);
}
.cfg-n {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  font: 700 13px Manrope, Arial, sans-serif;
}
.cfg-step.is-open .cfg-n {
  background: var(--orange);
  border-color: var(--orange);
}
.cfg-t {
  font-family: Manrope, Arial, sans-serif;
  font-size: 22px;
  font-weight: 660;
}
.cfg-value {
  font: 500 12px Manrope, Arial, sans-serif;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: right;
}
.cfg-step.is-open .cfg-step-head > .icon {
  transform: rotate(180deg);
}
.cfg-step-body {
  padding: 0 0 22px;
}
.cfg-sub {
  font-family: Manrope, Arial, sans-serif;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin: 14px 0 8px;
  font-weight: 650;
}
.cfg-cards,
.side-options {
  display: grid;
  gap: 8px;
}
.cfg-cards {
  grid-template-columns: 1fr 1fr;
}
.cfg-cards:has(> :nth-child(3)) {
  grid-template-columns: 1fr;
}
.cfg-card {
  margin: 0;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.15s;
}
.cfg-card:hover {
  border-color: var(--ink);
}
.cfg-card:has(input:checked) {
  border-color: var(--orange);
  box-shadow: inset 0 0 0 1px var(--orange);
}
.cfg-card input {
  accent-color: var(--orange);
  margin-top: 3px;
}
.cfg-card strong {
  display: block;
  font-size: 15px;
}
.cfg-card small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 450;
  margin-top: 2px;
}
.cfg-card.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.cfg-dim {
  margin-bottom: 14px;
}
.cfg-dim > label {
  margin: 0;
  font-size: 13px;
}
.cfg-dim-row {
  display: grid;
  grid-template-columns: 1fr 120px;
  gap: 12px;
  align-items: center;
}
.mm-input {
  position: relative;
}
.mm-input input {
  margin: 0 !important;
  padding-right: 40px !important;
  font-variant-numeric: tabular-nums;
}
.mm-input small {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
}
.cfg-range-hint {
  font-size: 11px;
  color: var(--muted);
}
.side-tabs,
.zip-sides {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 8px;
}
.side-tabs button,
.zip-sides button {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 8px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  color: var(--ink);
  font-size: 12px;
}
.side-tabs b,
.zip-sides b {
  font-size: 18px;
}
.side-tabs small {
  color: var(--muted);
  font-size: 11px;
  min-height: 14px;
}
.side-tabs [aria-selected="true"],
.zip-sides [aria-selected="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--mist);
}
.side-tabs [aria-selected="true"] small {
  color: #ff9a5c;
}
.side-tabs button:disabled {
  opacity: 0.5;
}
.zip-sides {
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
}
.zip-sides button {
  flex-direction: row;
  justify-content: center;
  gap: 6px;
}
.building-note {
  margin-top: 12px;
  padding: 12px 14px;
  background: var(--stone);
  border-radius: var(--radius);
  font-size: 14px;
}
.building-note p {
  margin-bottom: 8px;
}
.cfg-plan {
  margin-top: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px;
}
.zip-rule {
  margin: 12px 0;
}
.zip-split {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  background: #ffe6d6;
  color: var(--accent-ink);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  margin: 8px 0;
}
.series-chips,
.tone-chips {
  margin: 10px 0;
}
.cfg-swatches {
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 8px;
  margin: 10px 0 14px;
}
.cfg-swatches .swatch-card img {
  aspect-ratio: 1.6;
}
.check.small {
  font-size: 13px;
  margin: 6px 0 12px;
}
.color-swatches {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.color-card {
  margin: 0;
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
}
.color-card input {
  position: absolute;
  opacity: 0;
}
.color-card i {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  flex: none;
  border: 1px solid #0002;
}
.custom-swatch {
  background: conic-gradient(#c33, #cc3, #3c3, #3cc, #33c, #c3c, #c33);
}
.color-card strong {
  display: block;
  font-size: 14px;
}
.color-card small {
  font-size: 12px;
  color: var(--muted);
  font-weight: 450;
}
.color-card .surcharge {
  color: var(--accent-ink);
  font-weight: 650;
}
.color-card:has(input:checked) {
  border-color: var(--orange);
  box-shadow: inset 0 0 0 1px var(--orange);
}
.color-card:has(input:focus-visible) {
  outline: 3px solid #e2762c;
}
.custom-ral {
  margin-top: 12px;
}
.custom-ral small {
  display: block;
}
.cfg-extra {
  border: 0;
  padding: 0;
  margin: 0 0 14px;
}
.cfg-extra legend {
  font-family: Manrope, Arial, sans-serif;
  font-size: 13px;
  font-weight: 650;
  margin-bottom: 8px;
  padding: 0;
}
.cfg-summary dl {
  margin: 14px 0;
  font-size: 13px;
}
.cfg-summary dl div {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
}
.cfg-summary dt {
  color: var(--muted);
}
.cfg-summary dd {
  margin: 0;
  font-weight: 600;
}
.cfg-shot {
  width: 100%;
  border-radius: var(--radius);
}
.cfg-summary-actions {
  display: grid;
  gap: 8px;
}
.saved-code {
  margin-top: 12px;
  padding: 12px;
  background: var(--stone);
  border-radius: 6px;
  font-size: 13px;
  overflow-wrap: anywhere;
}
.saved-code strong {
  font-size: 18px;
  letter-spacing: 0.1em;
  color: var(--accent-ink);
}
.load-code {
  margin-top: 18px;
}
.load-code label {
  font-size: 13px;
}
.load-code span {
  display: flex;
  gap: 8px;
  align-items: center;
}
.load-code input {
  text-transform: uppercase;
}
.cfg-next {
  margin-top: 16px;
}
.cfg-next:empty {
  display: none;
}

/* Bottom bar: "Поискай оферта" is always visible. */
.cfg-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  background: var(--surface);
  color: var(--ink);
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px var(--gutter);
  box-shadow: 0 -10px 30px #2226291a;
}
.cfg-bar-title {
  font-size: 14px;
  font-weight: 550;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cfg-bar-actions {
  display: flex;
  gap: 8px;
  flex: none;
}
.toast {
  position: fixed;
  left: 50%;
  bottom: 90px;
  transform: translate(-50%, 20px);
  background: var(--ink);
  color: var(--mist);
  padding: 12px 18px;
  border-radius: 8px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: 0.25s;
  z-index: 40;
}
.toast.is-on {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* Mobile: steps below the model. */
@media (max-width: 900px) {
  .cfg {
    grid-template-columns: 1fr;
    grid-template-areas: "stage" "panel";
  }
  /* The model stays visible while the steps scroll underneath. */
  .cfg-stage {
    position: sticky;
    top: 0;
    z-index: 6;
    height: auto;
    padding: 0 0 8px;
    display: block;
    background: var(--mist);
    box-shadow: 0 8px 16px -12px #0004;
  }
  .cfg-view {
    height: 40svh;
    min-height: 240px;
    border-radius: 0;
  }
  .cfg-toolbar {
    top: 10px;
    left: 10px;
    right: 10px;
  }
  .cfg-sun {
    margin: 8px var(--gutter) 0;
  }
  .cfg-sun summary {
    padding: 8px 12px;
  }
  .cfg-sun-body {
    grid-template-columns: 1fr;
  }
  .cfg-panel {
    padding: 16px var(--gutter) 110px;
  }
  .cfg-bar {
    padding: 10px 14px;
  }
  .cfg-bar-title {
    display: none;
  }
  .cfg-bar-actions {
    width: 100%;
  }
  .cfg-bar-actions .button {
    flex: 1;
    min-height: 46px;
    padding: 0 10px;
    font-size: 13px;
  }
}
@media (max-width: 420px) {
  .cfg-cards,
  .color-swatches {
    grid-template-columns: 1fr;
  }
  .cfg-dim-row {
    grid-template-columns: 1fr 104px;
  }
  .cfg-toggles {
    display: none;
  }
}

/* Options that are announced but not offered yet. */
.cfg-chips .is-soon {
  background: transparent;
  border-style: dashed;
  color: var(--muted);
  cursor: not-allowed;
}
.cfg-chips .is-soon small {
  background: var(--stone);
  color: var(--ink);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 11px;
  font-weight: 650;
}

/* Full screen: the model fills the window, the steps open beside it with "Опции". */
.cfg-full-actions button {
  display: flex;
  align-items: center;
  gap: 6px;
}
.cfg-full-actions [aria-expanded="true"] {
  background: var(--ink);
  color: var(--mist);
}
.cfg:not(.is-full) .cfg-options,
.cfg:not(.is-full) [data-full] .icon:nth-of-type(2),
.cfg.is-full [data-full] .icon:nth-of-type(1) {
  display: none;
}
.cfg-full-open {
  overflow: hidden;
}
.cfg.is-full {
  position: fixed;
  inset: 0;
  z-index: 50;
  width: 100%;
  height: 100%;
  min-height: 0;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  grid-template-areas: "stage";
}
.cfg.is-full .cfg-stage {
  position: relative;
  display: flex;
  height: auto;
  min-height: 0;
  padding: 0;
  gap: 0;
}
.cfg.is-full .cfg-view {
  flex: 1;
  height: auto;
  min-height: 0;
  border-radius: 0;
}
.cfg.is-full .cfg-toolbar {
  top: 12px;
  right: 12px;
}
.cfg.is-full .cfg-sun {
  margin: 0;
  border-width: 1px 0 0;
  border-radius: 0;
}
.cfg.is-full:not(.has-options) :is(.cfg-panel, .cfg-bar) {
  display: none;
}
.cfg.is-full.has-options {
  grid-template-columns: minmax(340px, 420px) minmax(0, 1fr);
  grid-template-areas: "panel stage";
  padding-bottom: 72px;
}
.cfg.is-full.has-options .cfg-panel {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-bottom: 24px;
}
@media (max-width: 900px) {
  .cfg.is-full.has-options {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 45% minmax(0, 1fr);
    grid-template-areas: "stage" "panel";
  }
  .cfg.is-full.has-options .cfg-sun {
    display: none;
  }
  .cfg:not(.is-full) [data-full] span {
    display: none;
  }
}
