/* v15 «Витрина-конфигуратор»: общее. Раскладки — v15-m.css (телефон) и v15-d.css (компьютер). */
:root {
  --bg: #f6f3ee; --ink: #1d1b19; --mute: #6a645d; --line: #e2ddd5; --card: #fff;
  --acc: #1f5b4a; --acc-ink: #fff; --ok: #1f7a4d; --bad: #b3261e; --warn: #9a6200;
  --chip: #ece7df; --chip-on: #1d1b19; --chip-on-ink: #fff;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141312; --ink: #f2eee8; --mute: #a8a198; --line: #2e2b28; --card: #1d1b19;
    --acc: #7fd1b3; --acc-ink: #0d1f19; --ok: #6fd39c; --bad: #ff8a80; --warn: #f2b84b;
    --chip: #2a2724; --chip-on: #f2eee8; --chip-on-ink: #141312;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.45 var(--font); overflow-x: hidden; }
button, input, textarea { font: inherit; color: inherit; }
a { color: var(--acc); }
:focus-visible { outline: 3px solid var(--acc); outline-offset: 2px; }
.boot { display: grid; place-items: center; min-height: 60vh; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--acc); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.fatal { padding: 24px 16px; max-width: 40ch; }

/* шапка */
.top { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--bg); }
.brand { font-weight: 800; letter-spacing: -0.02em; font-size: 19px; color: var(--ink); text-decoration: none; }
.tag { color: var(--mute); font-size: 14px; min-width: 0; }
.top-nav { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.lang { font-size: 14px; padding: 8px 10px; text-decoration: none; border-radius: 999px; white-space: nowrap; }
.cart-link { position: relative; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; color: var(--ink); }
.cart-ico { width: 22px; height: 18px; border: 2px solid currentColor; border-top-width: 0; border-radius: 0 0 6px 6px; position: relative; margin-top: 4px; }
.cart-ico::before { content: ""; position: absolute; left: 3px; right: 3px; top: -8px; height: 9px; border: 2px solid currentColor; border-bottom: 0; border-radius: 8px 8px 0 0; }
.cart-n:not(:empty) { position: absolute; top: 4px; right: 2px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: var(--acc); color: var(--acc-ink); font-size: 11px; font-weight: 700; display: grid; place-items: center; }

/* сцена: фон по яркости изделия (светлое → тёмный, тёмное → светлый) в любой теме */
.stage { position: relative; overflow: hidden; touch-action: none; isolation: isolate;
  background: radial-gradient(120% 90% at 50% 30%, #3b3a3f 0%, #1c1b1f 70%); transition: background-color .4s; }
.stage[data-tone="dark"] { background: radial-gradient(120% 90% at 50% 30%, #fbf8f3 0%, #e4ded4 75%); }
.stage-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; outline: none; }
.stage-canvas:focus-visible { box-shadow: inset 0 0 0 3px var(--acc); }
.stage-ph { position: absolute; left: 50%; top: 50%; width: 90px; height: 140px; margin: -70px 0 0 -45px; border-radius: 40px 40px 14px 14px;
  background: rgba(255,255,255,.12); animation: breathe 1.6s ease-in-out infinite; }
.stage.live .stage-ph { display: none; }
@keyframes breathe { 50% { opacity: .45; } }
.nogl { position: absolute; inset: auto 16px 50% 16px; text-align: center; color: #fff; }
.stage[data-tone="dark"] .nogl { color: #1d1b19; }
.attr { position: absolute; left: 12px; right: 12px; bottom: 6px; margin: 0; font-size: 10.5px; line-height: 1.3; opacity: .7; color: #fff; pointer-events: none; overflow-wrap: anywhere; }
.stage[data-tone="dark"] .attr { color: #3a352f; }

/* пилюля статуса — единственное поверх 3D */
.pill { position: absolute; z-index: 2; top: 12px; left: 12px; display: inline-flex; align-items: center; gap: 8px; max-width: calc(100% - 140px); text-align: left;
  padding: 8px 12px 8px 10px; border: 0; border-radius: 999px; cursor: pointer; font-size: 14px; font-weight: 600;
  background: rgba(255,255,255,.94); color: #1d1b19; box-shadow: 0 4px 16px rgba(0,0,0,.18); transition: background-color .3s var(--ease), color .3s; min-height: 40px; }
.pill-t { min-width: 0; line-height: 1.2; }
.pill-more { font-weight: 500; font-size: 12px; opacity: .65; border-left: 1px solid currentColor; padding-left: 8px; white-space: nowrap; }
.pill-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: #9a948c; }
.pill[data-state="wait"] .pill-dot, .pill[data-state="busy"] .pill-dot { background: transparent; border: 2px solid #9a948c; border-top-color: transparent; animation: spin .8s linear infinite; }
.pill[data-state="ok"] .pill-dot { background: #1f9a5b; box-shadow: 0 0 0 4px rgba(31,154,91,.2); }
.pill[data-state="bad"] { background: #b3261e; color: #fff; }
.pill[data-state="bad"] .pill-dot { background: #fff; }
.pill[data-state="down"] .pill-dot { background: #c98a00; }
.pill[data-state="ok"], .pill[data-state="bad"] { animation: pop .35s var(--ease); }
@keyframes pop { 0% { transform: scale(.92); } 60% { transform: scale(1.04); } 100% { transform: none; } }
.share { position: absolute; z-index: 2; top: 12px; right: 12px; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 8px 12px;
  border: 0; border-radius: 999px; background: rgba(255,255,255,.94); color: #1d1b19; font-size: 14px; font-weight: 600; cursor: pointer; box-shadow: 0 4px 16px rgba(0,0,0,.18); }
.share-ico { width: 14px; height: 14px; border: 2px solid currentColor; border-radius: 3px; border-top-color: transparent; position: relative; }
.share-ico::after { content: ""; position: absolute; left: 3px; top: -7px; width: 4px; height: 10px; border-left: 2px solid currentColor; }

/* панель ручек */
.ttl-wrap { min-height: 64px; }
.ttl { margin: 0; font-size: clamp(24px, 6vw, 34px); line-height: 1.12; letter-spacing: -0.02em; font-weight: 800; }
.ttl .w { display: inline-block; clip-path: inset(-0.1em -0.15em -0.2em -0.15em); vertical-align: top; }
.ttl .w > span { display: inline-block; animation: rise .55s var(--ease) both; animation-delay: calc(var(--i) * 60ms); }
@keyframes rise { from { transform: translateY(105%); } to { transform: none; } }
.dims { margin: 4px 0 0; color: var(--mute); font-variant-numeric: tabular-nums; min-height: 1.45em; }
.rail { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x proximity; overscroll-behavior-x: contain; scrollbar-width: none; padding: 2px 16px; margin: 0 -16px; touch-action: pan-x pan-y; }
.rail::-webkit-scrollbar { display: none; }
.chip { flex: none; scroll-snap-align: center; min-height: 44px; padding: 10px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--chip); cursor: pointer; white-space: nowrap; font-size: 15px; transition: background-color .2s, color .2s, transform .15s; }
.chip:active { transform: scale(.97); }
.chip[aria-pressed="true"] { background: var(--chip-on); color: var(--chip-on-ink); border-color: var(--chip-on); }
.kinds { margin-top: 14px; }
.tabs { display: flex; gap: 4px; margin-top: 14px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: none; min-height: 44px; padding: 10px 12px; border: 0; background: none; cursor: pointer; color: var(--mute); font-weight: 600; border-bottom: 3px solid transparent; white-space: nowrap; }
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--acc); }
.pane { padding: 14px 0 6px; animation: fade .3s var(--ease); }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } }
.knob { display: block; margin: 0 0 16px; }
.knob-h { display: flex; justify-content: space-between; gap: 12px; font-weight: 600; }
.knob-h output { font-variant-numeric: tabular-nums; color: var(--acc); white-space: nowrap; }
.knob input[type=range] { width: 100%; height: 44px; margin: 0; accent-color: var(--acc); touch-action: pan-y; }
.knob-r { display: flex; justify-content: space-between; font-size: 12px; color: var(--mute); margin-top: -6px; }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.sw { width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--line); background: var(--c); cursor: pointer; transition: transform .2s var(--ease), box-shadow .2s; }
.sw[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--ink); transform: scale(1.06); }
.sub { margin: 14px 0 8px; font-weight: 600; }
.tlabel { display: grid; gap: 6px; font-weight: 600; }
.tlabel textarea { width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: var(--card); font-size: 17px; resize: none; }
.terr { color: var(--bad); margin: 6px 0 10px; font-size: 14px; min-height: 0; }
.terr:empty { display: none; }
.linkish { border: 0; background: none; color: var(--acc); padding: 8px 0; margin-bottom: 8px; cursor: pointer; text-decoration: underline; min-height: 44px; }
.fills { display: grid; gap: 8px; }
.fill { display: flex; gap: 12px; align-items: center; text-align: left; width: 100%; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); cursor: pointer; min-height: 56px; }
.fill[aria-pressed="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.fill-dot { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--c); border: 1px solid rgba(0,0,0,.15); }
.fill-t { display: grid; min-width: 0; }
.fill-t small { color: var(--mute); }
.note { color: var(--mute); font-size: 13px; margin: 8px 0 0; }

/* кнопка заказа */
.add { width: 100%; min-height: 52px; border: 0; border-radius: 999px; background: var(--acc); color: var(--acc-ink); font-weight: 700; font-size: 17px; cursor: pointer; transition: opacity .2s, transform .15s; }
.add:disabled { opacity: .45; cursor: not-allowed; }
.buy-msg { margin: 6px 0 0; font-size: 14px; text-align: center; }
.buy-msg:empty { display: none; }

/* протокол проверки */
.report { background: var(--card); color: var(--ink); display: flex; flex-direction: column; }
.report-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 16px 8px; }
.report-head h2 { margin: 0; font-size: 20px; }
.x { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--bg); font-size: 24px; line-height: 1; cursor: pointer; }
.report-body { padding: 0 16px 24px; overflow-y: auto; overscroll-behavior: contain; }
.r-lead { margin: 0 0 12px; font-weight: 600; }
.r-bad { color: var(--bad); }
.r-ok { color: var(--ok); }
.problems { margin: 0 0 12px; padding: 0; list-style: none; display: grid; gap: 8px; }
.problems li { padding: 10px 12px; border-left: 4px solid var(--bad); background: color-mix(in srgb, var(--bad) 8%, transparent); border-radius: 0 10px 10px 0; }
.facts { margin: 0; display: grid; gap: 0; }
.fact { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.fact dt { color: var(--mute); }
.fact dd { margin: 0; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.report h3 { font-size: 15px; margin: 14px 0 6px; }
.adv { margin: 0; padding-left: 18px; }
.r-note, .r-hint, .r-slow { color: var(--mute); font-size: 14px; margin: 10px 0 0; }
.retry { min-height: 44px; padding: 10px 18px; border-radius: 999px; border: 0; background: var(--acc); color: var(--acc-ink); font-weight: 700; cursor: pointer; }

/* вступление под конфигуратором */
.intro { padding: 24px 16px 32px; }
.lede { margin: 0 0 16px; max-width: 60ch; color: var(--mute); }
.how { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.how li { display: flex; gap: 12px; align-items: center; }
.how b { flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--chip); }

.toast { position: fixed; z-index: 60; left: 16px; right: 16px; bottom: calc(96px + env(safe-area-inset-bottom)); margin: 0 auto; max-width: 480px;
  padding: 12px 16px; border-radius: 14px; background: var(--ink); color: var(--bg); display: grid; gap: 8px; opacity: 0; transform: translateY(8px); transition: opacity .25s, transform .25s var(--ease); }
.toast.on { opacity: 1; transform: none; }
.toast input { width: 100%; padding: 8px; border-radius: 8px; border: 0; color: #1d1b19; background: #fff; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
