/* ===== Токены ===== */
:root {
  --bg: #FFF7EE;
  --surface: #FFFFFF;
  --surface-2: #FFF0E0;
  --ink: #2A1E3B;
  --muted: #6E6480;
  --line: #2A1E3B;
  --soft-line: #EADFD3;
  --shadow-color: #2A1E3B;
  --on-accent: #2A1E3B;

  --pink: #FF5FA2;
  --yellow: #FFD23F;
  --lime: #B6EE56;
  --sky: #62C9FF;
  --lilac: #B9A2FF;
  --orange: #FF8A3D;

  --radius: 22px;
  --radius-sm: 14px;
  --shadow: 4px 4px 0 var(--shadow-color);
  --shadow-sm: 2px 2px 0 var(--shadow-color);
  --font-head: 'Unbounded', 'Arial Black', sans-serif;
  --font: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1A1424; --surface: #251D33; --surface-2: #2F2540; --ink: #FFF4E8; --muted: #BDB2CC;
    --line: #FFF4E8; --soft-line: #3C3150; --shadow-color: #000000; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #1A1424; --surface: #251D33; --surface-2: #2F2540; --ink: #FFF4E8; --muted: #BDB2CC;
  --line: #FFF4E8; --soft-line: #3C3150; --shadow-color: #000000; color-scheme: dark;
}

/* ===== База ===== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 500 16px/1.55 var(--font); -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.no-scroll { overflow: hidden; }
h1, h2, h3 { font-family: var(--font-head); line-height: 1.12; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: clamp(25px, 5.4vw, 60px); font-weight: 800; overflow-wrap: break-word; hyphens: auto; }
h2 { font-size: clamp(26px, 3.6vw, 42px); font-weight: 800; }
h3 { font-size: 17px; font-weight: 700; }
p { margin: 0; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: var(--ink); }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--pink); outline-offset: 2px; }
.container { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .container { padding: 0 28px; } }
.muted { color: var(--muted); }

/* ===== Кнопки и мелочи ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border: 2px solid var(--line); border-radius: 999px;
  background: var(--yellow); color: var(--on-accent); font-weight: 800; text-decoration: none;
  box-shadow: var(--shadow-sm); transition: transform .12s, box-shadow .12s; white-space: nowrap;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--shadow-color); }
.btn:active { transform: translate(2px, 2px); box-shadow: 0 0 0 var(--shadow-color); }
.btn-lg { padding: 14px 26px; font-size: 17px; }
.btn-block { width: 100%; }
.btn-pink { background: var(--pink); }
.btn-yellow { background: var(--yellow); }
.btn-sky { background: var(--sky); }
.btn-lime { background: var(--lime); }
.btn-ghost { background: var(--surface); color: var(--ink); }
.link-btn { background: none; border: 0; padding: 4px 0; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 2px; text-decoration-color: var(--pink); }
.link-btn:hover { color: var(--pink); }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--line); background: var(--surface); font-size: 16px; font-weight: 800; }
.pill { display: inline-block; padding: 6px 14px; border: 2px solid var(--line); border-radius: 999px; font-weight: 800; font-size: 13px; color: var(--on-accent); }
.pill-lime { background: var(--lime); }
.pill-yellow { background: var(--yellow); }
.kicker { display: inline-block; font-weight: 800; text-transform: uppercase; letter-spacing: .12em; font-size: 13px; color: var(--pink); margin-bottom: 10px; }

/* ===== Шапка ===== */
.topbar { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 2px solid var(--line); }
.topbar-in { display: flex; align-items: center; gap: 24px; height: 66px; }
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.logo-text { font: 800 22px/1 var(--font-head); letter-spacing: -0.02em; white-space: nowrap; }
.logo-eyes { width: 58px; height: auto; flex: none; overflow: visible; }
.logo-pupils { transition: transform .12s ease-out; }
@media (max-width: 480px) { .logo { gap: 6px; } .logo-eyes { width: 38px; } .logo-text { font-size: 15px; } }
.nav { display: none; gap: 22px; margin-left: auto; font-weight: 700; }
.nav a { text-decoration: none; padding: 6px 0; border-bottom: 2px solid transparent; }
.nav a:hover { border-color: var(--pink); }
@media (min-width: 960px) { .nav { display: flex; } }
.cart-btn {
  margin-left: auto; display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border: 2px solid var(--line); border-radius: 999px; background: var(--surface);
  font-weight: 800; box-shadow: var(--shadow-sm);
}
@media (min-width: 960px) { .cart-btn { margin-left: 8px; } }
.cart-btn span { display: none; }
@media (min-width: 520px) { .cart-btn span { display: inline; } }
.cart-count { min-width: 24px; height: 24px; padding: 0 6px; border-radius: 999px; background: var(--pink); color: var(--on-accent); border: 2px solid var(--line); font-size: 12px; display: inline-grid; place-items: center; }
.cart-count.is-empty { background: var(--surface-2); color: var(--ink); }
.cart-btn.bump { animation: bump .5s; }
@keyframes bump { 30% { transform: scale(1.15) rotate(-4deg); } 60% { transform: scale(.95) rotate(2deg); } }

/* ===== Первый экран ===== */
.hero { position: relative; padding: 40px 0 0; overflow: hidden; }
.hero-in { display: grid; gap: 28px; align-items: center; }
@media (min-width: 900px) { .hero-in { grid-template-columns: 1.05fr 1fr; padding-bottom: 30px; } }
.hero-copy { display: grid; gap: 20px; justify-items: start; min-width: 0; }
.lead { font-size: clamp(17px, 1.6vw, 20px); color: var(--muted); max-width: 34em; }
.hero-copy > * { max-width: 100%; }
.hero-copy h1 { font-size: clamp(26px, 7.2vw, 60px); }
@media (min-width: 900px) { .hero-copy h1 { font-size: clamp(34px, 3.9vw, 58px); } }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; width: 100%; }
.hero-facts { list-style: none; padding: 0; margin: 4px 0 0; display: flex; flex-wrap: wrap; gap: 10px; }
.hero-facts li { padding: 10px 16px; border: 2px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); display: grid; }
.hero-facts b { font: 800 18px/1.2 var(--font-head); }
.hero-facts span { font-size: 13px; color: var(--muted); }
.hero-art { position: relative; height: clamp(300px, 46vw, 500px); }
.hero-plate { position: absolute; filter: drop-shadow(5px 7px 0 rgba(42, 30, 59, .15)); }
.hero-plate svg { width: 100%; height: auto; display: block; }
.hp-0 { width: 52%; left: 4%; top: 6%; transform: rotate(-8deg); animation: float 6s ease-in-out infinite; z-index: 2; }
.hp-1 { width: 44%; right: 2%; top: 0; transform: rotate(9deg); animation: float 7s ease-in-out -2s infinite; }
.hp-2 { width: 34%; right: 2%; bottom: 6%; transform: rotate(-3deg); animation: float 8s ease-in-out -4s infinite; z-index: 3; }
.hp-3 { width: 60%; left: 2%; bottom: 0; transform: rotate(23deg); animation: float 7.5s ease-in-out -3s infinite; z-index: 4; }
@keyframes float { 50% { translate: 0 -12px; } }
.blob { position: absolute; border-radius: 50%; border: 2px solid var(--line); z-index: 0; }
.b1 { width: 64px; height: 64px; background: var(--lime); left: 58%; top: 44%; }
.b2 { width: 38px; height: 38px; background: var(--yellow); right: 4%; bottom: 44%; }
.b3 { width: 24px; height: 24px; background: var(--sky); left: 50%; top: 2%; }
.marquee { border-block: 2px solid var(--line); background: var(--yellow); color: var(--on-accent); overflow: hidden; margin-top: 30px; }
.marquee-track { display: flex; gap: 22px; padding: 12px 0; width: max-content; align-items: center; animation: marquee 40s linear infinite; font: 700 18px/1 var(--font-head); text-transform: lowercase; }
.marquee i { font-style: normal; display: inline-flex; }
.mq-ic { height: 24px; width: auto; display: block; color: var(--line); }
.mq-pink { color: var(--pink); }
@keyframes marquee { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .marquee-track, .hero-plate { animation: none; } html { scroll-behavior: auto; } }

/* ===== Секции ===== */
.section { padding: 64px 0; }
@media (min-width: 900px) { .section { padding: 90px 0; } }
.section-head { max-width: 720px; margin-bottom: 32px; }
.section-head p { margin-top: 12px; color: var(--muted); font-size: 17px; }

/* ===== Конструктор ===== */
.builder { background: var(--surface-2); border-bottom: 2px solid var(--line); }
.builder-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; align-items: start; }
@media (min-width: 980px) { .builder-grid { grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); gap: 28px; } }
.stage { position: sticky; top: 74px; z-index: 5; }
@media (max-width: 979px) { .stage { top: 66px; margin: 0 -16px; } .stage-card { border-radius: 0; border-inline: 0; } }
.stage-card { background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
@media (max-width: 979px) { .stage-card { box-shadow: none; } }
.stage-tabs { margin: 12px; }
.stage-canvas { position: relative; background: var(--wall, #F4EFE6); aspect-ratio: 4 / 3; border-block: 2px solid var(--line); transition: background .3s; }
@media (max-width: 979px) { .stage-canvas { aspect-ratio: auto; height: 36vh; min-height: 220px; } }
@media (min-width: 980px) { .stage-canvas { aspect-ratio: auto; height: clamp(300px, calc(100vh - 320px), 600px); } }
.preview2d, .preview3d { position: absolute; inset: 0; }
.preview2d svg { width: 100%; height: 100%; display: block; }
.preview3d canvas { width: 100% !important; height: 100% !important; display: block; touch-action: none; cursor: grab; }
.stage-hint { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); background: rgba(42, 30, 59, .75); color: #fff; font-size: 12px; font-weight: 700; padding: 5px 12px; border-radius: 999px; pointer-events: none; white-space: nowrap; }
.stage-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; padding: 10px 14px; }
.walls { display: flex; gap: 6px; }
.wall-sw { width: 26px; height: 26px; border-radius: 8px; border: 2px solid var(--line); background: var(--c); }
.wall-sw[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--pink); }
.size-readout { margin-left: auto; font-weight: 800; font-size: 14px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--pink); }
.check.is-disabled { opacity: .4; pointer-events: none; white-space: nowrap; }

.panel { display: grid; gap: 14px; min-width: 0; grid-template-columns: minmax(0, 1fr); }
.step { background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius); padding: 18px; display: grid; gap: 14px; min-width: 0; }
@media (max-width: 360px) { .step { padding: 14px; } }
.step-head { display: flex; align-items: center; gap: 12px; }
.step-num { width: 32px; height: 32px; flex: none; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; font: 800 14px/1 var(--font-head); background: var(--yellow); color: var(--on-accent); }
.step:nth-child(2) .step-num { background: var(--pink); }
.step:nth-child(3) .step-num { background: var(--sky); }
.step:nth-child(4) .step-num { background: var(--lime); }
.step:nth-child(5) .step-num { background: var(--lilac); }
.step:nth-child(6) .step-num { background: var(--orange); }
.step:nth-child(7) .step-num { background: var(--sky); }
.step:nth-child(8) .step-num { background: var(--lime); }
.chosen { margin-left: auto; font-weight: 700; font-size: 14px; color: var(--muted); }
.hint { color: var(--muted); font-size: 14px; }
.sub-label { font-weight: 800; font-size: 14px; display: flex; gap: 8px; align-items: baseline; }
#patternOpts, #thickWrap { display: grid; gap: 12px; margin-top: 4px; }
#patternOpts[hidden], #thickWrap[hidden] { display: none; }
.row-between { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; }

.seg { display: inline-flex; padding: 3px; border: 2px solid var(--line); border-radius: 999px; background: var(--surface-2); gap: 2px; }
.seg button { border: 0; background: none; padding: 7px 14px; border-radius: 999px; font-weight: 700; font-size: 14px; }
.seg button[aria-pressed="true"], .seg button[aria-selected="true"] { background: var(--ink); color: var(--bg); }
.seg.is-disabled { opacity: .45; pointer-events: none; white-space: nowrap; }
.seg-wrap { flex-wrap: wrap; border-radius: 18px; }
.stage-tabs { display: flex; width: max-content; }
.stage-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding-right: 12px; }
.tryon-open { padding: 8px 14px; font-size: 14px; }
@media (max-width: 979px) { .tryon-open { padding: 6px 10px; font-size: 13px; } .stage-top { padding-right: 10px; } }
/* Примерка: при первом заходе кнопка мягко «дышит» и рядом подсказка, одна и та же для всех ширин */
.stage-card { position: relative; }
.tryon-open.is-new { animation: tryon-ping 1.6s ease-out 3; }
@keyframes tryon-ping { 0% { box-shadow: 0 0 0 0 rgba(182, 238, 86, .95), var(--shadow-sm, 0 3px 0 var(--line)); } 70%, 100% { box-shadow: 0 0 0 12px rgba(182, 238, 86, 0), var(--shadow-sm, 0 3px 0 var(--line)); } }
@media (prefers-reduced-motion: reduce) { .tryon-open.is-new { animation: none; } }
.tryon-tip { position: absolute; z-index: 6; top: 62px; right: 12px; max-width: 250px; display: grid; gap: 2px; padding: 10px 34px 10px 14px; border: 2px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink); font-size: 13px; line-height: 1.35; box-shadow: 0 4px 0 rgba(0,0,0,.12); }
.tryon-tip::before { content: ""; position: absolute; top: -9px; right: 28px; width: 14px; height: 14px; background: inherit; border-left: 2px solid var(--line); border-top: 2px solid var(--line); transform: rotate(45deg); }
.tryon-tip b { font-size: 14px; }
.tryon-tip-x { position: absolute; top: 4px; right: 4px; width: 28px; height: 28px; border: 0; border-radius: 50%; background: none; color: inherit; font-size: 20px; line-height: 1; cursor: pointer; }
.tryon-tip-x:hover { background: rgba(0,0,0,.08); }

.stepper { display: inline-flex; align-items: center; border: 2px solid var(--line); border-radius: 999px; background: var(--surface); overflow: hidden; }
.stepper button { width: 42px; height: 42px; border: 0; background: none; font-size: 20px; font-weight: 800; }
.stepper button:hover:not(:disabled) { background: var(--yellow); color: var(--on-accent); }
.stepper button:disabled { opacity: .3; cursor: default; }
.stepper output { min-width: 34px; text-align: center; font: 800 18px/1 var(--font-head); }
.stepper-sm button { width: 38px; height: 38px; }
.stepper-xs button { width: 30px; height: 30px; font-size: 16px; }
.stepper-xs output { min-width: 24px; font-size: 14px; }

.sections { display: grid; gap: 10px; }
.sec-row { display: grid; gap: 6px; }
.sec-label { font-size: 13px; font-weight: 800; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border: 2px solid var(--soft-line); border-radius: 12px; background: var(--surface); font-weight: 700; font-size: 14px; }
.chip:hover { border-color: var(--line); }
.chip[aria-pressed="true"] { border-color: var(--line); background: var(--lime); color: var(--on-accent); box-shadow: var(--shadow-sm); }

.dims-inputs { display: flex; align-items: end; gap: 10px; flex-wrap: wrap; }
.field { display: grid; gap: 4px; position: relative; }
.field span { font-size: 13px; font-weight: 800; color: var(--muted); }
.field input { width: 100%; min-width: 120px; padding: 10px 40px 10px 12px; border: 2px solid var(--line); border-radius: 12px; background: var(--surface); font-weight: 800; font-size: 17px; }
.field em { position: absolute; right: 12px; bottom: 12px; font-style: normal; color: var(--muted); font-weight: 700; font-size: 14px; }
.times { font-weight: 800; padding-bottom: 10px; color: var(--muted); }

.range { display: grid; gap: 6px; }
.range > span { display: flex; justify-content: space-between; font-weight: 700; font-size: 14px; }
.range output { font-weight: 800; }
input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 10px; border-radius: 999px; background: var(--surface-2); border: 2px solid var(--line); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 24px; height: 24px; border-radius: 50%; background: var(--pink); border: 2px solid var(--line); box-shadow: var(--shadow-sm); cursor: pointer; }
input[type="range"]::-moz-range-thumb { width: 20px; height: 20px; border-radius: 50%; background: var(--pink); border: 2px solid var(--line); cursor: pointer; }

.tiles { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
.tile { position: relative; display: grid; justify-items: center; gap: 6px; padding: 10px 6px 8px; border: 2px solid var(--soft-line); border-radius: var(--radius-sm); background: var(--surface); font-weight: 700; font-size: 12.5px; line-height: 1.2; text-align: center; min-width: 0; overflow-wrap: anywhere; hyphens: auto; }
.tile:hover { border-color: var(--line); }
.tile[aria-pressed="true"] { border-color: var(--line); box-shadow: var(--shadow-sm); background: var(--surface-2); }
.tile svg { width: 56px; height: 56px; }
.tile em { position: absolute; top: 4px; right: 4px; font-style: normal; font-size: 10px; font-weight: 800; background: var(--yellow); color: var(--on-accent); border-radius: 6px; padding: 1px 4px; }
.tile-shape { fill: var(--plate, var(--pink)); stroke: var(--line); stroke-width: 1.6; }
.tile-frame { fill: #fff; stroke: var(--line); stroke-width: 1.2; opacity: .9; }
.tile-pat svg { border-radius: 10px; border: 2px solid var(--line); width: 52px; height: 52px; }

.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.sw { width: 36px; height: 36px; border-radius: 50%; background: var(--c); border: 2px solid var(--line); transition: transform .1s; }
.sw:hover { transform: scale(1.1); }
.sw[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--pink); }
.swatches-sm .sw { width: 28px; height: 28px; }

.upload { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; cursor: pointer; }
.upload input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.upload small { color: var(--muted); }
.upload:focus-within .btn { outline: 3px solid var(--pink); outline-offset: 2px; }

.buybar {
  position: sticky; bottom: 12px; z-index: 20; margin-top: 22px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px;
  padding: 14px 18px; background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.buy-price { display: grid; flex: none; min-width: max-content; margin-right: auto; }
.buy-label { font-size: 13px; color: var(--muted); font-weight: 700; }
.buy-price > b { font: 800 28px/1.2 var(--font-head); white-space: nowrap; padding-right: .12em; }
.buy-tools { display: flex; flex-wrap: wrap; gap: 4px 16px; width: 100%; }
@media (min-width: 1100px) { .buy-tools { width: auto; } }
@media (max-width: 560px) {
  .buybar { bottom: 0; margin-inline: -16px; border-radius: 18px 18px 0 0; border-inline: 0; box-shadow: 0 -4px 0 rgba(0,0,0,.06); padding: 10px 16px; gap: 10px; flex-wrap: nowrap; }
  .buy-label, .buy-tools { display: none; }
  .buy-price > b { font-size: 20px; white-space: nowrap; }
  .buybar .stepper-sm button { width: 32px; height: 36px; }
  .buybar .stepper-sm output { min-width: 22px; font-size: 16px; }
  #addToCart { padding: 10px 16px; font-size: 15px; }
}
@media (max-width: 979px) {
  .stage-tabs { margin: 8px 10px; }
  .stage-tabs button { padding: 6px 12px; font-size: 13px; }
  .stage-canvas { height: 28vh; min-height: 190px; }
  .stage-foot { padding: 6px 10px; gap: 6px 12px; }
  .wall-sw { width: 22px; height: 22px; border-radius: 6px; }
  .stage-foot .check { font-size: 13px; }
  .size-readout { font-size: 12px; white-space: nowrap; }
}
@media (max-width: 380px) { .size-readout { display: none; } }
.step-files { display: none; }
@media (max-width: 560px) { .step-files { display: grid; } }
.files-row { display: flex; flex-wrap: wrap; gap: 8px; }
.files-row .btn { padding: 9px 14px; font-size: 14px; }

/* ===== Идеи ===== */
.ideas-filter { margin-bottom: 18px; }
.idea[hidden] { display: none; }
.idea-set { display: flex; align-items: center; gap: 6px; width: 100%; height: 100%; }
.idea-set > div { flex: 1; min-width: 0; display: grid; place-items: center; }
.idea-set svg { width: 100%; height: auto; max-height: 100%; }
.idea-meta.idea-meta-set { display: grid; justify-content: start; align-content: start; gap: 4px; }
.idea-meta-set span { color: var(--ink); font-size: 16px; }
.idea-meta-set small { order: 2; color: var(--muted); font-weight: 600; font-size: 13px; }
.ideas-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.idea { position: relative; display: flex; flex-direction: column; text-align: left; padding: 0; border: 2px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; box-shadow: var(--shadow-sm); transition: transform .15s, box-shadow .15s; }
.idea:hover { transform: translate(-2px, -3px) rotate(-.6deg); box-shadow: var(--shadow); }
.idea-art { aspect-ratio: 1; display: grid; place-items: center; padding: 16px; border-bottom: 2px solid var(--line); }
.idea-art svg { width: 100%; height: 100%; }
.idea-meta { flex: 1; display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 12px 14px; }
.idea-meta b { font-weight: 800; }
.idea-meta span { font-weight: 700; color: var(--muted); font-size: 14px; white-space: nowrap; }
.idea-tag { position: absolute; top: 10px; left: 10px; font-size: 12px; padding: 3px 10px; }

/* ===== Как это работает ===== */
.how { background: var(--surface); border-block: 2px solid var(--line); }
.how-grid { list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.how-card { position: relative; padding: 24px 20px 22px; border: 2px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); color: var(--on-accent); display: grid; gap: 10px; align-content: start; }
.how-card p { opacity: .85; }
.how-num { font: 800 46px/1 var(--font-head); }
.c-yellow { background: var(--yellow); } .c-pink { background: var(--pink); } .c-sky { background: var(--sky); } .c-lime { background: var(--lime); }

/* ===== Цены ===== */
.price-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.price-card { position: relative; padding: 24px 20px; border: 2px solid var(--line); border-radius: var(--radius); background: var(--surface); display: grid; gap: 10px; align-content: start; grid-auto-rows: max-content; }
.price-card:has(.btn) { grid-template-rows: auto auto auto 1fr auto; }
.price-card .pill { justify-self: start; }
.price-big { font: 800 34px/1 var(--font-head); }
.price-card p { color: var(--muted); }
.price-card-hot { background: var(--lilac); color: var(--on-accent); box-shadow: var(--shadow); }
.price-card-hot2 { background: var(--pink); color: var(--on-accent); box-shadow: var(--shadow); }
.price-card-hot p, .price-card-hot2 p { color: var(--on-accent); opacity: .8; }
.price-card .btn { justify-self: stretch; align-self: end; margin-top: 6px; white-space: normal; text-align: center; }

/* ===== FAQ ===== */
.faq-in { display: grid; gap: 10px; }
@media (min-width: 900px) { .faq-in { grid-template-columns: 1fr 1.6fr; gap: 40px; } }
.faq-list { display: grid; gap: 10px; }
.faq-list details { border: 2px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); padding: 0 18px; }
.faq-list summary { cursor: pointer; list-style: none; padding: 16px 30px 16px 0; font-weight: 800; position: relative; }
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after { content: '+'; position: absolute; right: 0; top: 50%; transform: translateY(-50%); font: 800 22px/1 var(--font-head); color: var(--pink); transition: transform .2s; }
.faq-list details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq-list details p { padding-bottom: 16px; color: var(--muted); }

/* ===== Подвал ===== */
.footer { background: var(--ink); color: var(--bg); padding: 40px 0; }
.footer .logo-dots i { border-color: var(--bg); }
.footer-in { display: grid; gap: 16px; }
@media (min-width: 900px) { .footer-in { grid-template-columns: auto 1fr auto; align-items: center; gap: 40px; } }
.footer p { opacity: .75; max-width: 40em; }
.footer-contacts { display: flex; flex-wrap: wrap; gap: 10px 20px; font-weight: 700; }

/* ===== Корзина ===== */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(26, 20, 36, .45); z-index: 60; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 100%); z-index: 70;
  background: var(--bg); border-left: 2px solid var(--line); transform: translateX(105%); transition: transform .28s ease;
  display: flex; flex-direction: column;
}
.drawer.open { transform: none; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 2px solid var(--line); }
.drawer-head h2 { font-size: 24px; }
.drawer-body { overflow-y: auto; padding: 16px 18px 28px; display: grid; gap: 16px; align-content: start; }
.cart-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.cart-item { display: grid; grid-template-columns: 96px 1fr; gap: 12px; padding: 10px; border: 2px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.cart-thumb { border-radius: 10px; border: 2px solid var(--line); padding: 6px; aspect-ratio: 1; }
.cart-thumb svg { width: 100%; height: 100%; display: block; }
.cart-info { display: grid; gap: 4px; align-content: start; min-width: 0; }
.cart-info small { color: var(--muted); font-size: 12px; line-height: 1.4; }
.cart-ctrl { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 4px; }
.cart-price { font: 800 16px/1 var(--font-head); }
.cart-links { display: flex; gap: 14px; font-size: 13px; }
.cart-empty { text-align: center; display: grid; gap: 14px; justify-items: center; padding: 30px 0; color: var(--muted); }
.cart-sum { display: grid; gap: 6px; }
.sum-row { display: flex; justify-content: space-between; font-weight: 700; }
.sum-disc { color: #1f9d55; }
.sum-total { font: 800 20px/1.3 var(--font-head); padding-top: 6px; border-top: 2px dashed var(--soft-line); }
.sum-hint { font-size: 13px; background: var(--yellow); color: var(--on-accent); border: 2px solid var(--line); border-radius: 12px; padding: 8px 12px; font-weight: 700; }
.order-form { display: grid; gap: 10px; padding-top: 6px; }
.order-form h3 { font-size: 20px; }
.order-form .check { align-items: flex-start; font-weight: 600; font-size: 14px; }
.order-form .check input { flex: none; margin-top: 1px; }
.order-form .btn[disabled] { opacity: .6; pointer-events: none; }
.footer-legal { grid-column: 1 / -1; font-size: 13px; color: var(--bg); opacity: .6; max-width: none; }
.footer-legal a { color: inherit; }
.field-block { display: grid; gap: 4px; }
.field-block span { font-size: 13px; font-weight: 800; color: var(--muted); }
.field-block input, .field-block select, .field-block textarea { width: 100%; padding: 11px 12px; border: 2px solid var(--line); border-radius: 12px; background: var(--surface); }

/* ===== Модалка и тост ===== */
.modal { position: fixed; inset: 0; z-index: 90; background: rgba(26, 20, 36, .5); display: grid; place-items: center; padding: 16px; }
.modal-card { position: relative; width: min(560px, 100%); max-height: 90vh; overflow: auto; background: var(--bg); border: 2px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 26px 22px 22px; display: grid; gap: 14px; }
.modal-card h2 { font-size: 26px; padding-right: 40px; }
.modal-x { position: absolute; top: 14px; right: 14px; }
#modalBody { display: grid; gap: 12px; }
.set-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.set-list li { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.set-list b { display: block; font-weight: 800; }
.set-list span { color: var(--muted); font-size: 14px; }
.set-thumb { width: 64px; height: 64px; border: 2px solid var(--line); border-radius: var(--radius-sm); display: grid; place-items: center; padding: 4px; }
.set-thumb svg { width: 100%; height: 100%; }
.set-edit { padding: 7px 12px; font-size: 14px; }
.set-sum { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding-top: 10px; border-top: 2px dashed var(--soft-line); }
.set-sum s { color: var(--muted); }
.set-total { font: 800 22px/1.1 var(--font-head); }
.order-text { width: 100%; padding: 12px; border: 2px solid var(--line); border-radius: 12px; background: var(--surface); font: 500 13px/1.5 ui-monospace, monospace; resize: vertical; }
.modal-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.toast { position: fixed; left: 50%; bottom: 96px; transform: translate(-50%, 20px); z-index: 100; background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 999px; font-weight: 700; opacity: 0; pointer-events: none; transition: .25s; max-width: calc(100% - 32px); text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ===== Тип накладки и сменные панели ===== */
.mounts { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }

.mount { position: relative; display: grid; gap: 4px; justify-items: start; text-align: left; padding: 12px; border: 2px solid var(--soft-line); border-radius: var(--radius-sm); background: var(--surface); }
.mount:hover { border-color: var(--line); }
.mount[aria-pressed="true"] { border-color: var(--line); background: var(--surface-2); box-shadow: var(--shadow-sm); }
.mount b { font-weight: 800; font-size: 15px; }
.mount small { color: var(--muted); font-size: 12px; line-height: 1.35; }
.mount em { position: absolute; top: 8px; right: 8px; font-style: normal; font-size: 11px; font-weight: 800; background: var(--yellow); color: var(--on-accent); border-radius: 6px; padding: 1px 5px; }
.mount-art svg { width: 48px; height: 48px; display: block; color: var(--ink); }
@media (max-width: 560px) {
  .mount { justify-items: center; text-align: center; padding: 10px 6px 8px; }
  .mount small { display: none; }
  .mount b { font-size: 13px; line-height: 1.2; }
  .mount em { top: 4px; right: 4px; }
  .mount-art svg { width: 40px; height: 40px; }
  .toast { font-size: 14px; padding: 9px 14px; bottom: 84px; border-radius: 14px; }
}
#facesBar { display: grid; gap: 8px; padding-top: 6px; border-top: 2px dashed var(--soft-line); }
.faces { display: flex; flex-wrap: wrap; gap: 8px; }
.face-chip { display: inline-flex; align-items: center; border: 2px solid var(--soft-line); border-radius: 12px; background: var(--surface); }
.face-chip[aria-current="true"] { border-color: var(--line); box-shadow: var(--shadow-sm); background: var(--surface-2); }
.face-chip button { border: 0; background: none; padding: 7px 10px; font-weight: 700; font-size: 14px; display: inline-flex; align-items: center; gap: 6px; }
.face-chip i { width: 16px; height: 16px; border-radius: 50%; background: var(--c); border: 2px solid var(--line); }
.face-chip .face-x { padding: 7px 9px 7px 2px; font-size: 12px; color: var(--muted); }
.face-chip .face-x:hover { color: var(--pink); }
.face-add { border: 2px dashed var(--line); border-radius: 12px; background: none; padding: 7px 12px; font-weight: 800; font-size: 14px; }
.face-add em { font-style: normal; color: var(--muted); font-weight: 700; }
.face-add:hover { background: var(--yellow); color: var(--on-accent); }
.sw-same { background: conic-gradient(var(--plate, #FF9EC8) 0 25%, #fff 0 50%, var(--plate, #FF9EC8) 0 75%, #fff 0); }
.explode-btn { position: absolute; top: 10px; right: 10px; padding: 7px 14px; font-size: 14px; }
.explode-btn[aria-pressed="true"] { background: var(--pink); }

/* ===== Примерка на фото ===== */
.tryon { position: fixed; inset: 0; z-index: 95; background: var(--bg); display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.tryon-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px max(16px, env(safe-area-inset-right, 0px)) 10px max(16px, env(safe-area-inset-left, 0px)); border-bottom: 2px solid var(--line); }
.tryon-head h2 { font-size: clamp(18px, 2.4vw, 24px); }
.tryon-stage { position: relative; min-height: 0; display: grid; place-items: center; background: #1d1726; overflow: hidden; }
.tryon-canvas { position: relative; }
#tryonPhoto, #tryonGL, #tryonGL canvas, #tryonQuad { position: absolute; inset: 0; width: 100% !important; height: 100% !important; display: block; }
#tryonQuad { pointer-events: none; overflow: visible; }
#tryonQuad polygon { fill: rgba(255, 95, 162, .08); stroke: #fff; stroke-width: 1.5; stroke-dasharray: 6 4; }
.tryon.is-editing #tryonGL { opacity: .82; }
#tryonHandles { position: absolute; inset: 0; pointer-events: none; }
.tryon-h { position: absolute; width: 34px; height: 34px; margin: -17px 0 0 -17px; border-radius: 50%; border: 3px solid #fff; background: rgba(255, 95, 162, .35); box-shadow: 0 2px 8px rgba(0,0,0,.45); pointer-events: auto; touch-action: none; cursor: grab; display: none; padding: 0; }
.tryon-h i { position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; background: #FF5FA2; box-shadow: 0 0 0 1.5px #fff; }
.tryon-h.is-drag { cursor: grabbing; background: rgba(255, 95, 162, .15); transform: scale(1.25); }
.tryon.is-editing .tryon-h { display: block; }
.tryon-empty { display: grid; gap: 18px; justify-items: center; text-align: center; color: #f4efe6; padding: 24px 16px; width: 100%; max-width: 520px; min-width: 0; }
.tryon-empty .btn { white-space: normal; max-width: 100%; text-align: center; }
.tryon-empty small { opacity: .75; }
.tryon-steps { text-align: left; display: grid; gap: 10px; margin: 0; padding-left: 22px; }
.tryon-steps b { color: #fff; }
.tryon-bar { display: grid; gap: 10px; padding: 12px max(16px, env(safe-area-inset-right, 0px)) calc(12px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); border-top: 2px solid var(--line); max-height: 46vh; overflow-y: auto; }
.tryon-hint { font-size: 14px; color: var(--muted); }
.tryon-hint b { color: var(--ink); }
.tryon-row { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; }
.tryon-sliders .range { flex: 1 1 160px; min-width: 0; }
.tryon-actions .btn { padding: 9px 16px; font-size: 14px; }
#tryonCompare { touch-action: none; user-select: none; -webkit-user-select: none; }
.tryon-more summary { cursor: pointer; font-weight: 800; font-size: 14px; }
.tryon-more[open] summary { margin-bottom: 8px; }
@media (max-width: 560px) {
  .tryon-bar { gap: 8px; padding-top: 10px; max-height: 42vh; }
  .tryon-hint { font-size: 13px; }
  .tryon-row.tryon-sliders { gap: 6px 12px; }
  .tryon-actions { gap: 6px; }
  .tryon-actions .btn { flex: 1 1 calc(50% - 6px); padding: 8px 10px; font-size: 13px; white-space: normal; }
  .tryon #tryonColors .sw { width: 26px; height: 26px; }
  .tryon-head { padding-block: 8px; }
}

.tryon-loupe { position: absolute; width: 120px; height: 120px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 4px 16px rgba(0,0,0,.5); pointer-events: none; z-index: 3; }
.tryon-result { position: absolute; inset: 0; z-index: 5; background: rgba(20, 15, 28, .94); display: grid; align-content: center; justify-items: center; gap: 14px; padding: 16px max(16px, env(safe-area-inset-right, 0px)) 16px max(16px, env(safe-area-inset-left, 0px)); color: #f4efe6; text-align: center; overflow-y: auto; }
.tryon-result img { max-width: 100%; max-height: 62vh; border-radius: 12px; border: 2px solid #fff; -webkit-touch-callout: default; user-select: auto; }
.tryon-result p { max-width: 36em; font-size: 14px; }
.tryon-result .tryon-row { justify-content: center; }
.tryon.is-orbit #tryonGL canvas { cursor: grab; touch-action: none; }
.tryon.is-orbit #tryonGL { pointer-events: auto; }

/* ===== Служебные страницы: оплата, оферта ===== */
.doc-page { max-width: 760px; margin: 0 auto; padding: 32px 16px 64px; }
.doc-page h1 { font-family: Unbounded, sans-serif; font-size: clamp(24px, 5vw, 34px); margin: 18px 0 12px; }
.doc-page h2 { font-size: 19px; margin: 24px 0 8px; }
.doc-page p, .doc-page li { line-height: 1.6; }
.doc-page p, .doc-page ol { margin: 10px 0; }
.doc-page ol { padding-left: 22px; }
.doc-page .note { padding: 12px 16px; border: 2px dashed var(--line); border-radius: 16px; background: var(--surface); }
.pay-status { text-align: center; padding-top: 10vh; }
.pay-status .big { font-size: 64px; }
.pay-status .btn { margin-top: 20px; }
@media (max-width: 360px) { .mount b { font-size: 12px; overflow-wrap: anywhere; } }

/* ===== Подставка под ноутбук ===== */
.page-title { font-size: clamp(28px, 4.6vw, 52px); }
.nav a[aria-current="page"] { border-color: var(--pink); }
.nav .nav-new::after { content: "new"; margin-left: 6px; padding: 1px 6px; border-radius: 6px; background: var(--lime); color: var(--on-accent); font-size: 11px; font-weight: 800; vertical-align: 2px; }
.promo-stand { padding-top: 0; }
.promo-card { display: grid; gap: 20px; align-items: center; padding: clamp(20px, 4vw, 40px); border: 2px solid var(--line); border-radius: var(--radius); background: var(--sky); color: var(--on-accent); text-decoration: none; box-shadow: var(--shadow); }
.promo-card:hover .btn { transform: translate(-1px, -1px); }
.promo-copy { display: grid; gap: 14px; justify-items: start; min-width: 0; }
.promo-copy h2 { font-size: clamp(24px, 3.4vw, 40px); }
.promo-copy p { max-width: 34em; }
.promo-art svg { width: 100%; max-width: 420px; height: auto; display: block; margin: 0 auto; filter: drop-shadow(5px 7px 0 rgba(42, 30, 59, .18)); }
@media (min-width: 820px) { .promo-card { grid-template-columns: 1.1fr 1fr; } }
.tiles-cut { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }
/* «На магнитах»: баннер с настоящей накладкой, панель которой приподнимается над основанием с магнитами. */
.mag-promo { display: flex; align-items: center; gap: 16px; margin-top: 12px; padding: 14px; border: 2px solid var(--line); border-radius: 18px; background: #FFE3EF; color: #2A1E3B; box-shadow: 3px 3px 0 var(--shadow-color); }
.mag-ill { position: relative; flex: none; width: 116px; aspect-ratio: 1; }
.mag-base, .mag-panel { position: absolute; inset: 0; display: grid; }
.mag-base svg { width: 100%; height: 100%; }
.mag-panel { filter: drop-shadow(3px 4px 0 rgba(42, 30, 59, .25)); transition: transform .35s cubic-bezier(.3, 1.5, .6, 1); }
.mag-panel svg { width: 100%; height: 100%; }
.mag-promo.is-on .mag-panel { transform: translate(-6px, -8px) rotate(-4deg); }
@media (prefers-reduced-motion: no-preference) { .mag-promo:not(.is-on) .mag-panel { animation: mag-peek 3s ease-in-out 1s 3; } }
@keyframes mag-peek { 0%, 50%, 100% { transform: none; } 65%, 85% { transform: translate(-6px, -8px) rotate(-4deg); } }
.mag-txt { display: grid; gap: 6px; min-width: 0; }
.mag-txt b { font: 700 15px/1.25 var(--font-head); }
.mag-txt small { font-size: 13px; line-height: 1.35; color: #5A4F6B; }
.mag-btn { justify-self: start; position: relative; padding: 8px 16px; border: 2px solid #2A1E3B; border-radius: 999px; background: #fff; font-weight: 800; font-size: 14px; cursor: pointer; box-shadow: 2px 2px 0 #2A1E3B; }
.mag-btn input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.mag-btn:has(input:focus-visible) { outline: 3px solid var(--pink); outline-offset: 2px; }
.mag-btn .mag-on { display: none; }
.mag-btn:has(input:checked) { background: var(--pink); }
.mag-btn:has(input:checked) .mag-on { display: inline; } .mag-btn:has(input:checked) .mag-off { display: none; }
@media (max-width: 420px) { .mag-ill { width: 84px; } }
.switch { appearance: none; flex: none; position: relative; width: 48px; height: 28px; margin: 0; border: 2px solid var(--line); border-radius: 999px; background: var(--surface-2); cursor: pointer; transition: background .15s; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: var(--surface); border: 2px solid var(--line); box-sizing: border-box; transition: transform .15s; }
.switch:checked { background: var(--pink); }
.switch:checked::after { transform: translateX(20px); }
.switch:focus-visible { outline: 3px solid var(--pink); outline-offset: 2px; }
.tiles-tip { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); }
.tiles-tip svg { width: 40px; height: 40px; }
.tiles-cut svg { width: 84px; height: 40px; }
.sub-block { display: grid; gap: 10px; }
.sub-block[hidden] { display: none; }
.swatches[hidden], .sub-label[hidden] { display: none; }

/* ===== Экраны: выбор товара и генераторы ===== */
.pick { padding-top: 56px; }
.pick-grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.pick-card { display: grid; grid-template-rows: auto 1fr; border: 2px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); overflow: hidden; text-decoration: none; color: inherit; transition: transform .12s, box-shadow .12s; }
.pick-card:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--shadow-color); }
.pick-art { display: grid; place-items: center; aspect-ratio: 16 / 9; border-bottom: 2px solid var(--line); padding: 14px; }
.pick-n .pick-art { background: #FFE3EF; } .pick-s .pick-art { background: #E3F4FF; }
.pick-art svg { max-width: 82%; max-height: 100%; width: auto; height: 100%; filter: drop-shadow(4px 6px 0 rgba(42, 30, 59, .14)); }
.pick-s .pick-art svg { width: 82%; height: auto; }
.pick-body { display: flex; flex-direction: column; gap: 10px; padding: 18px 20px 20px; }
.pick-title { font: 800 clamp(19px, 2vw, 24px)/1.15 var(--font-head); }
.pick-list { display: grid; gap: 2px; color: var(--muted); }
.pick-list span::before { content: "• "; color: var(--pink); }
.pick-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 4px; }   /* кнопки карточек — на одном уровне */
.pick-price { font: 800 19px var(--font-head); }
.pick-soon { display: grid; gap: 6px; align-content: center; padding: 20px; border: 2px dashed var(--soft-line); border-radius: var(--radius); color: var(--muted); }
.pick-soon b { color: var(--ink); font-family: var(--font-head); font-size: 17px; }
.pick-soon a { color: var(--ink); font-weight: 800; }

.genbar { padding-top: 22px; background: var(--surface-2); }
.genbar-in { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; justify-content: space-between; }
.genbar + .builder, .genbar ~ .builder { padding-top: 18px; }
.nav a[aria-current="page"] { border-color: var(--pink); }

/* Сворачиваемые шаги */
.step-head[role="button"] { cursor: pointer; user-select: none; }
.step-head[role="button"]:focus-visible { outline: 3px solid var(--pink); outline-offset: 4px; border-radius: 8px; }
.step-head h3 { flex: none; }
.step-sum { flex: 1; min-width: 0; color: var(--muted); font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: right; }
.step-chev { flex: none; margin-left: auto; transition: transform .15s; }
.step:not(.is-collapsed) .step-chev { transform: rotate(180deg); }
.step:not(.is-collapsed) .step-sum { display: none; }
.step.is-collapsed .step-head .chosen { display: none; }
.step.is-collapsed > :not(.step-head) { display: none !important; }
.step.is-collapsed { padding-block: 14px; }
@media (prefers-reduced-motion: reduce) { .step-chev { transition: none; } }

/* На телефоне превью закреплено: держим его в одном блоке с шагами, чтобы «липкость» работала по всей высоте */
@media (max-width: 979px) { .builder-grid { display: block; } .builder-grid > .panel { margin-top: 18px; } }
@media (max-width: 560px) {
  /* Компактное превью на телефоне: больше места шагам */
  .tryon-open { padding: 8px 12px; } .tryon-more { display: none; }
  .tryon-tip { top: 56px; right: 10px; max-width: min(250px, calc(100% - 20px)); }
  .stage-top { flex-wrap: nowrap; }
  .stage-canvas { height: 26vh; min-height: 180px; }
  .stage-foot { padding-block: 6px; }
  .stage-foot .size-readout { display: none; }
}
.step { grid-template-columns: minmax(0, 1fr); } .step-head { min-width: 0; }
@media (max-width: 360px) { .buy-price b { font-size: 20px; } .buybar .btn-lg { padding: 11px 13px; font-size: 15px; } .buybar { gap: 6px; } }
/* Очень узкий телефон: вкладки и «Примерить» в одну строку */
@media (max-width: 360px) {
  .stage-top .stage-tabs button { padding: 6px 9px; font-size: 13px; white-space: nowrap; }
  .tryon-open { padding: 7px 10px; font-size: 13px; } .tryon-open svg { display: none; }
}

/* Цвета в шаге «Дизайн»: что красим + одна палитра */
.cslots { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.cslot { display: inline-grid; place-items: center; align-content: center; min-width: 96px; min-height: 46px; padding: 4px 16px; border: 0; border-radius: 999px; background: var(--surface-2); color: var(--ink); line-height: 1.1; cursor: pointer; transition: background .15s; }
.cslot b { font-size: 14px; font-weight: 600; }
.cslot small { font-size: 11px; color: var(--muted); }
.cslot:hover { filter: brightness(.97); }
.cslot[aria-checked="true"] { background: var(--c); color: var(--ci); box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.cslot[aria-checked="true"] small { color: inherit; opacity: .8; }
.cname { font-size: 14px; color: var(--muted); margin: 0 0 10px; }
.cname b { color: var(--ink); font-weight: 600; }
.swatches.pal { display: grid; grid-template-columns: repeat(6, 48px); gap: 14px; margin-bottom: 6px; }
.pal .sw { width: 48px; height: 48px; border: 1px solid rgba(0,0,0,.08); }
.pal .sw[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--ink); }
@media (max-width: 560px) { .swatches.pal { grid-template-columns: repeat(6, 1fr); gap: 10px; } .pal .sw { width: 100%; height: auto; aspect-ratio: 1; } .cslot { min-width: 0; padding: 4px 12px; } }
/* Рисунков много: держим их в коробке с прокруткой, чтобы цвета оставались рядом */
#patternGrid { max-height: 360px; overflow-y: auto; overscroll-behavior: contain; padding: 4px 6px 4px 2px; margin-bottom: 10px; scrollbar-gutter: stable; }

/* ---------- Конструктор накладки: вкладки слева, превью и цена справа ---------- */
.cfg { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; align-items: start; }
/* Конструкторы шире остальной страницы: больше воздуха вокруг настроек и крупнее модель. */
.builder > .container { max-width: 1560px; }
@media (min-width: 1100px) { .cfg-panel { padding: 26px 32px 22px; gap: 18px; } }
/* Превью — квадрат, как фото товара; ширину колонки подбираем так, чтобы квадрат и цена помещались в экран. */
@media (min-width: 980px) { .cfg { grid-template-columns: minmax(0, 1fr) clamp(380px, calc(100vh - 300px), 760px); } }
.cfg-panel { background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 22px 16px; display: grid; gap: 14px; min-width: 0; }
.cfg-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-bottom: 2px solid var(--soft-line); }
.cfg-tabs button { padding: 12px 6px; margin-bottom: -2px; border: 2px solid transparent; border-radius: 12px 12px 0 0; background: none; color: var(--muted); font-weight: 700; font-size: 16px; cursor: pointer; }
.cfg-tabs button:hover { color: var(--ink); }
.cfg-tabs button[aria-selected="true"] { color: var(--ink); border-color: var(--line); border-bottom-color: var(--surface); background: var(--surface); }
.cfg-pane { display: grid; gap: 10px; align-content: start; min-height: 440px; }
.cfg-pane > .sub-label { font-size: 16px; margin-top: 12px; }
.cfg-pane > .sub-label:first-child { margin-top: 0; }
.cfg-pane[hidden] { display: none; }
.cfg-pane .sub-label { margin-top: 4px; }
.cfg-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.cfg-orient { justify-self: start; }
.cfg-orient[hidden] { display: none; }
.cfg-more { border-top: 1px dashed var(--soft-line); padding-top: 10px; }
.cfg-more summary { cursor: pointer; font-weight: 800; padding: 4px 0; }
.cfg-more[open] { display: grid; gap: 10px; }
.cfg-pane #patternGrid { max-height: 470px; }
.cfg-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 14px; padding-top: 10px; border-top: 1px dashed var(--soft-line); }
.cfg-files { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; }

.cfg-side { position: sticky; top: 74px; display: grid; gap: 14px; min-width: 0; }
.cfg-stage { background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; position: relative; }
.cfg-stage .stage-canvas { aspect-ratio: 1 / 1; height: auto; min-height: 320px; width: 100%; border-block: 0; border-bottom: 2px solid var(--line); }
.cfg-stage .stage-foot { padding: 8px 14px; }
.cfg-pane .tile span { font-size: 12px; hyphens: auto; -webkit-hyphens: auto; overflow-wrap: normal; word-break: normal; }
.cfg-views { position: absolute; left: 12px; top: 12px; z-index: 4; }
.cfg-views button { padding: 6px 12px; font-size: 13px; }
.cfg-tools { position: absolute; right: 12px; top: 12px; z-index: 4; display: flex; gap: 8px; }
.cfg-tools .icon-btn { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; color: var(--ink); background: var(--surface); box-shadow: var(--shadow-sm); cursor: pointer; padding: 0; }
.cfg-tools .icon-btn:hover { background: var(--yellow); color: var(--on-accent); }
.cfg-tools .tryon-open.is-new { animation: tryon-ping 1.6s ease-out 3; }
.cfg-stage .tryon-tip { top: 66px; right: 12px; }
.cfg-stage .stage-hint { left: 14px; bottom: 14px; transform: none; background: none; color: var(--muted); padding: 0; font-weight: 600; white-space: normal; max-width: 120px; line-height: 1.3; }
.cfg-viewbtns { position: absolute; right: 12px; bottom: 12px; z-index: 4; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.cfg-viewbtns[hidden] { display: none; }
.pill-btn { padding: 7px 13px; border: 2px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); font-size: 13px; font-weight: 700; cursor: pointer; }
.pill-btn:hover, .pill-btn[aria-pressed="true"] { background: var(--yellow); color: var(--on-accent); }

.cfg-buy { position: static; margin: 0; padding: 16px 20px; display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.cfg-buy .buy-price { display: flex; align-items: center; gap: 10px; margin-right: auto; }
.cfg-buy .buy-price > b { font-size: 40px; line-height: 1.1; }
.buy-note { flex-basis: 100%; margin: -4px 0 0; font-size: 13px; color: var(--muted); }
.price-info { position: relative; }
.price-info summary { list-style: none; width: 24px; height: 24px; border: 2px solid var(--muted); border-radius: 50%; display: grid; place-items: center; color: var(--muted); font: 700 13px/1 var(--font); cursor: pointer; }
.price-info summary::-webkit-details-marker { display: none; }
.price-info-pop { position: absolute; z-index: 30; left: 0; bottom: calc(100% + 10px); width: min(360px, 80vw); padding: 12px 14px; border: 2px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); font-size: 13px; line-height: 1.45; }

@media (max-width: 1099px) { .cfg-buy .buy-price > b { font-size: 32px; } .cfg-tabs button { font-size: 14px; } }
@media (max-width: 979px) {
  .cfg { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .cfg-side { position: static; order: -1; }
  .cfg-stage { position: sticky; top: 66px; z-index: 6; margin: 0 -16px; border-radius: 0; border-inline: 0; box-shadow: none; }
  .cfg-stage .stage-canvas { aspect-ratio: auto; height: 24vh; min-height: 170px; max-height: none; }
  .cfg-stage .stage-foot { display: none; }
  .cfg-pane { min-height: 0; }
  .cfg-buy { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; border-radius: 18px 18px 0 0; border-inline: 0; border-bottom: 0; padding: 8px 14px; gap: 10px; box-shadow: 0 -4px 0 rgba(0,0,0,.06); }
  .cfg-buy .buy-price > b { font-size: 22px; }
  .cfg-buy .buy-note { display: none; }   /* на телефоне подпись — в окошке «i» */
  #constructor { padding-bottom: 72px; }
}
@media (max-width: 560px) {
  .cfg-panel { padding: 12px 12px 14px; }
  .cfg-tabs button { font-size: 13px; padding: 10px 2px; }
  .cfg-views button { padding: 5px 9px; font-size: 12px; }
  .cfg-viewbtns .pill-btn { padding: 5px 9px; font-size: 12px; }
  .cfg-stage .stage-hint { display: none; }
  .cfg-buy .btn-lg { padding: 9px 14px; font-size: 14px; }
  .cfg-buy .price-info { position: static; }
  .cfg-buy .price-info-pop { left: 12px; right: 12px; width: auto; bottom: calc(100% + 8px); }
  .cfg-pane #patternGrid, .cfg-pane #st-patternGrid { max-height: none; overflow: visible; }   /* на телефоне без прокрутки внутри прокрутки */
}
@media (max-width: 420px) { .cfg-buy .stepper { display: none; } }
.cfg-tabs-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.cfg-tabs-auto { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
.cfg-tabs-5 button { font-size: 15px; }
@media (max-width: 979px) { #standBuilder { padding-bottom: 72px; } }
@media (max-width: 560px) { .cfg-tabs-5 button { font-size: 12px; padding: 10px 0; } }
.stage-error { position: absolute; inset: 0; display: grid; place-content: center; gap: 8px; padding: 24px; text-align: center; color: var(--ink); background: var(--surface); }
.stage-error span { font: 600 13px/1.4 ui-monospace, monospace; color: #C0392B; word-break: break-word; }
.stage-error small { color: var(--muted); }

/* Кнопка темы в шапке: в светлой теме — луна, в тёмной — солнце */
.theme-btn { display: grid; place-items: center; width: 42px; height: 42px; flex: none; border: 2px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--ink); cursor: pointer; margin-left: auto; }
.theme-btn:hover { background: var(--yellow); color: var(--on-accent); }
.theme-btn .ic-sun { display: none; }
:root[data-theme="dark"] .theme-btn .ic-sun { display: block; }
:root[data-theme="dark"] .theme-btn .ic-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-btn .ic-sun { display: block; }
  :root:not([data-theme="light"]) .theme-btn .ic-moon { display: none; }
}
@media (min-width: 960px) { .theme-btn { margin-left: 8px; } }
.theme-btn + .cart-btn { margin-left: 8px; }
.tip-target { display: grid; gap: 8px; justify-items: start; }
.tip-target[hidden], #tipSame[hidden] { display: none; }
.tile[aria-disabled="true"] { opacity: .38; cursor: not-allowed; }
.cfg-tools .icon-btn[hidden] { display: none; }

/* ===== Опрос «насколько удобно» (js/analytics.js) ===== */
.ux-survey { position: relative; display: grid; gap: 10px; justify-items: center; text-align: center; margin-top: 18px; padding: 16px 18px; border: 2px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow-sm); color: var(--ink); }
.ux-survey > b { font-size: 15px; max-width: 30ch; }
.ux-survey-float { position: fixed; z-index: 60; right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); width: min(360px, calc(100vw - 32px)); margin: 0; box-shadow: var(--shadow); }
@media (max-width: 979px) { .ux-survey-float { bottom: calc(80px + env(safe-area-inset-bottom, 0px)); } }
.ux-scale { display: flex; gap: 8px; }
.ux-scale button { width: 44px; height: 44px; border: 2px solid var(--line); border-radius: 12px; background: var(--surface-2); font: 800 16px var(--font); color: var(--ink); cursor: pointer; }
.ux-scale button[aria-pressed="true"] { background: var(--pink); color: #2A1E3B; box-shadow: var(--shadow-sm); }
.ux-legend { display: flex; justify-content: space-between; width: 252px; font-size: 12px; color: var(--muted); }
.ux-more { display: grid; gap: 8px; width: 100%; }
.ux-more textarea { width: 100%; padding: 8px 10px; border: 2px solid var(--soft-line); border-radius: 12px; background: var(--surface); color: var(--ink); font: 500 14px var(--font); resize: vertical; }
.ux-x { position: absolute; top: 6px; right: 8px; width: 32px; height: 32px; border: 0; background: none; font-size: 22px; color: var(--muted); cursor: pointer; }
