/* ===================== Шрифт ===================== */
@font-face { font-family: "Onest"; font-style: normal; font-weight: 400 800; font-display: swap; src: url("vendor/fonts/onest-cyrillic.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Onest"; font-style: normal; font-weight: 400 800; font-display: swap; src: url("vendor/fonts/onest-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Onest"; font-style: normal; font-weight: 400 800; font-display: swap; src: url("vendor/fonts/onest-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* ===================== Токены ===================== */
:root {
  --bg: #f2f3f5;
  --surface: #ffffff;
  --surface-2: #f2f3f5;
  --surface-3: #e8eaee;
  --text: #0d1014;
  --muted: #5c6370;
  --faint: #8d94a0;
  --line: #e4e6ea;
  --line-2: #d2d6dc;
  --field-line: #8a909b;
  --brand: #ff5a1f;
  --accent: #c2410c;
  --sel: #f05a1a;
  --sel-soft: #fff1e9;
  --primary: #0d1014;
  --primary-hover: #2b313b;
  --primary-ink: #ffffff;
  --ok: #15803d;
  --ok-soft: #e7f6ec;
  --warn: #7c4500;
  --warn-soft: #fff4de;
  --err: #c0262d;
  --err-soft: #fdecec;
  --viewer-a: #fbfbfc;
  --viewer-b: #e6e8ec;
  --plate: #d8dbe0;
  --plate-line: #b7bcc5;
  --r-lg: 20px;
  --r: 14px;
  --r-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
  --shadow-lg: 0 18px 48px rgba(16, 24, 40, .16);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1012; --surface: #171a1e; --surface-2: #1f2328; --surface-3: #292e35;
    --text: #f1f3f5; --muted: #a4abb6; --faint: #6f7782; --line: #272b31; --line-2: #383e47; --field-line: #6f7682;
    --brand: #ff6a33; --accent: #ff8b5e; --sel: #ff6a33; --sel-soft: #2b1a12;
    --primary: #f1f3f5; --primary-hover: #d6dae0; --primary-ink: #0e1012;
    --ok: #4ade80; --ok-soft: #12291b; --warn: #f5b95a; --warn-soft: #2e2413; --err: #ff7b7b; --err-soft: #331a1b;
    --viewer-a: #22262c; --viewer-b: #14171a; --plate: #2b3037; --plate-line: #454b55;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .35); --shadow-lg: 0 18px 48px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1012; --surface: #171a1e; --surface-2: #1f2328; --surface-3: #292e35;
  --text: #f1f3f5; --muted: #a4abb6; --faint: #6f7782; --line: #272b31; --line-2: #383e47; --field-line: #6f7682;
  --brand: #ff6a33; --accent: #ff8b5e; --sel: #ff6a33; --sel-soft: #2b1a12;
  --primary: #f1f3f5; --primary-hover: #d6dae0; --primary-ink: #0e1012;
  --ok: #4ade80; --ok-soft: #12291b; --warn: #f5b95a; --warn-soft: #2e2413; --err: #ff7b7b; --err-soft: #331a1b;
  --viewer-a: #22262c; --viewer-b: #14171a; --plate: #2b3037; --plate-line: #454b55;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .35); --shadow-lg: 0 18px 48px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

/* ===================== База ===================== */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
:focus-visible { outline: 2px solid var(--sel); outline-offset: 2px; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 "Onest", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
a { color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; letter-spacing: -.015em; }
h2 { font-size: 26px; font-weight: 750; margin-bottom: 18px; }
button, input, select, textarea { font: inherit; color: inherit; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 20px; }
.ico { width: 18px; height: 18px; flex: none; }

/* ===================== Кнопки ===================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px;
  border: 1px solid transparent; border-radius: 12px; padding: 10px 18px;
  font-weight: 650; font-size: 15px; line-height: 1.2; cursor: pointer; text-decoration: none;
  transition: background .15s, border-color .15s, color .15s, transform .06s;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--primary); color: var(--primary-ink); }
.btn--primary:hover { background: var(--primary-hover); }
.btn--primary:disabled { opacity: .45; cursor: not-allowed; }
.btn--ghost { background: var(--surface); border-color: var(--line-2); color: var(--text); }
.btn--ghost:hover { border-color: var(--muted); }
.btn--lg { width: 100%; min-height: 52px; font-size: 16px; border-radius: 14px; }
.linkbtn { border: 0; background: none; color: var(--accent); font-weight: 600; font-size: 14px; cursor: pointer; padding: 0; text-decoration: none; }
.linkbtn:hover { text-decoration: underline; }

/* ===================== Шапка ===================== */
.top {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(12px); backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.top__in { display: flex; align-items: center; gap: 28px; height: 60px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; letter-spacing: -.02em; text-decoration: none; }
.logo__mark {
  width: 28px; height: 28px; border-radius: 8px; background: var(--brand);
  background-image: repeating-linear-gradient(0deg, transparent 0 4px, rgba(255, 255, 255, .38) 4px 6px);
}
.top__nav { display: flex; gap: 22px; margin-left: auto; }
.top__nav a { text-decoration: none; color: var(--muted); font-weight: 550; font-size: 14.5px; }
.top__nav a:hover { color: var(--text); }
.top__contacts { display: flex; gap: 16px; font-weight: 650; font-size: 14.5px; }
.top__contacts a { text-decoration: none; }
.top__contacts:empty { display: none; }

/* ===================== Первый экран ===================== */
.hero { padding: 30px 20px 18px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 32px; }
.hero h1 { font-size: clamp(26px, 3vw, 34px); font-weight: 800; letter-spacing: -.025em; }
.hero__facts { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.hero__facts li {
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px 6px 10px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); color: var(--muted); font-size: 13.5px; font-weight: 550; white-space: nowrap;
}
.hero__facts .ico { width: 16px; height: 16px; color: var(--brand); }

/* ===================== Калькулятор ===================== */
.calc {
  display: grid; gap: 16px 20px; align-items: start;
  grid-template-columns: minmax(0, 1fr) 380px;
  grid-template-rows: auto 1fr;
  grid-template-areas: "stage side" "config side";
}
.stage, .config { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.stage { grid-area: stage; overflow: hidden; }
.viewer {
  position: relative; height: clamp(340px, 46vh, 520px);
  background: radial-gradient(120% 95% at 50% 0%, var(--viewer-a), var(--viewer-b));
}
.viewer canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.viewer.is-drag::after { content: ""; position: absolute; inset: 12px; border: 2px dashed var(--sel); border-radius: 16px; pointer-events: none; }

.drop {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; text-align: center; padding: 24px; color: var(--muted);
  background: radial-gradient(70% 70% at 50% 50%, color-mix(in srgb, var(--surface) 88%, transparent), color-mix(in srgb, var(--surface) 55%, transparent));
}
.drop__icon { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 20px; background: var(--sel-soft); color: var(--brand); margin-bottom: 4px; flex: none; }
.drop__icon svg { width: 34px; height: 34px; }
.drop b { color: var(--text); font-size: 20px; font-weight: 750; letter-spacing: -.01em; }
.drop__or { margin-top: -6px; font-size: 14.5px; }
.drop .btn { margin-top: 6px; min-width: 200px; }
.drop small { max-width: 360px; color: var(--faint); font-size: 13px; }
.drop__alt { color: var(--accent); font-weight: 600; font-size: 14px; text-decoration: none; }
.drop__alt:hover { text-decoration: underline; }
.viewer.has-model .drop { display: none; }

.viewer__busy {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 12px; padding: 24px; text-align: center;
  background: color-mix(in srgb, var(--surface) 72%, transparent); font-weight: 600;
}
.spinner { width: 22px; height: 22px; flex: none; border-radius: 50%; border: 2.5px solid var(--line-2); border-top-color: var(--brand); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.viewer__hint, .viewer__plate {
  position: absolute; bottom: 12px; padding: 4px 11px;
  background: color-mix(in srgb, var(--surface) 88%, transparent); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border: 1px solid var(--line); border-radius: 999px; font-size: 12.5px; color: var(--muted);
}
.viewer__hint { left: 12px; }
.viewer__plate { right: 12px; }
.plates {
  position: absolute; top: 12px; left: 12px; display: flex; align-items: center; gap: 2px; padding: 3px;
  background: color-mix(in srgb, var(--surface) 90%, transparent); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border: 1px solid var(--line); border-radius: 12px; font-weight: 650; font-size: 13.5px; font-variant-numeric: tabular-nums;
}
.plates span { padding: 0 8px; }
.plates button { width: 32px; height: 32px; border: 0; border-radius: 9px; background: transparent; font-size: 18px; line-height: 1; cursor: pointer; }
.plates button:hover:not(:disabled) { background: var(--surface-2); }
.plates button:disabled { opacity: .3; cursor: default; }
.viewer__fit {
  position: absolute; top: 12px; right: 12px; display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px;
  background: color-mix(in srgb, var(--surface) 90%, transparent); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border: 1px solid var(--line); border-radius: 12px; font-size: 13px; font-weight: 600; cursor: pointer;
}
.viewer__fit:hover { border-color: var(--line-2); }

/* Панель выбранной модели */
.modelbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; border-top: 1px solid var(--line); padding: 14px 18px; }
.modelbar__dims { margin-right: auto; min-width: 0; font-variant-numeric: tabular-nums; }
.modelbar__name { display: block; font-size: 13px; font-weight: 550; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 52ch; }
.modelbar__dims [data-dims] { font-size: 17px; font-weight: 750; }
.modelbar__dims small { display: block; font-size: 13px; color: var(--muted); margin-top: 1px; }
.modelbar__ctl { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.modelbar label { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 13px; }
.modelbar select, .modelbar input {
  height: 36px; font-size: 14px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 0 10px;
}
.modelbar input { width: 72px; }
.modelbar__more { flex-basis: 100%; }
.modelbar__more summary { cursor: pointer; font-size: 13.5px; font-weight: 600; color: var(--accent); list-style: none; width: fit-content; }
.modelbar__more summary::-webkit-details-marker { display: none; }
.modelbar__more[open] summary { color: var(--muted); }
.modelbar__more .modelbar__ctl { padding-top: 10px; }
.modelbar__parts { flex-basis: 100%; font-size: 13px; }
.modelbar__parts:empty { display: none; }
.modelbar__parts summary { cursor: pointer; color: var(--muted); width: fit-content; }
.modelbar__parts ul { margin: 8px 0 0; padding-left: 18px; color: var(--muted); font-variant-numeric: tabular-nums; }
.modelbar__parts .bad { color: var(--err); }
.modelbar__warns { flex-basis: 100%; display: flex; flex-direction: column; gap: 8px; }
.modelbar__warns:empty { display: none; }
.modelbar__warn { margin: 0; font-size: 13.5px; line-height: 1.45; color: var(--text); background: var(--warn-soft); padding: 10px 14px; border-radius: 12px; }
.modelbar__warn--err { background: var(--err-soft); }
.modelbar__warn button, .model__act {
  margin: 8px 8px 0 0; height: 32px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--line-2);
  background: var(--surface); font-size: 13px; font-weight: 600; cursor: pointer;
}
.modelbar__warn button:hover, .model__act:hover { border-color: var(--muted); }
.notice { margin: 0; font-size: 14px; background: var(--warn-soft); padding: 12px 18px; border-top: 1px solid var(--line); }
.notice a { color: var(--accent); font-weight: 600; }

/* ---------- Параметры печати ---------- */
.config { grid-area: config; align-self: start; padding: 4px 24px; }
.row { display: grid; grid-template-columns: 116px minmax(0, 1fr); gap: 18px; padding: 18px 0; border-top: 1px solid var(--line); }
.row:first-child { border-top: 0; }
.row__label { font-weight: 650; font-size: 14.5px; padding-top: 6px; }
.row__ctl { min-width: 0; }
.row__ctl--inline { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.row__val { font-weight: 600; font-size: 14px; color: var(--muted); }
.row__hint { margin: 10px 0 0; font-size: 13px; color: var(--muted); }
.row__sum { display: none; }

.purposes { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; align-items: center; }
.purposes::before { content: "Для чего:"; font-size: 13px; color: var(--muted); margin-right: 4px; flex: none; }
.purposes button {
  height: 32px; padding: 0 13px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2);
  font-size: 13px; font-weight: 550; cursor: pointer; white-space: nowrap; flex: none;
}
.purposes button:hover { border-color: var(--line-2); }
.purposes button[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: var(--surface); }

.mats { display: grid; grid-template-columns: repeat(auto-fill, minmax(136px, 1fr)); gap: 10px; }
.mat {
  position: relative; text-align: left; border: 1.5px solid var(--line); background: var(--surface);
  border-radius: var(--r); padding: 12px 34px 12px 14px; cursor: pointer; display: flex; flex-direction: column; gap: 2px;
  transition: border-color .15s, box-shadow .15s;
}
.mat::after {
  content: ""; position: absolute; top: 12px; right: 12px; width: 18px; height: 18px; border-radius: 50%;
  border: 1.5px solid var(--line-2); background: var(--surface);
}
.mat b { font-size: 16px; font-weight: 750; letter-spacing: -.01em; }
.mat span { font-size: 12.5px; color: var(--muted); line-height: 1.3; }
.mat em { font-style: normal; font-size: 13px; font-weight: 650; font-variant-numeric: tabular-nums; margin-top: 6px; }
.mat em:empty { display: none; }
.mat:hover { border-color: var(--line-2); }
.mat[aria-pressed="true"] { border-color: var(--sel); box-shadow: 0 0 0 3px var(--sel-soft); }
.mat[aria-pressed="true"]::after {
  border-color: var(--sel); background: var(--sel) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.2 6.6 10.8 12 5.4' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px no-repeat;
}

.swatches { display: flex; flex-wrap: wrap; gap: 10px; padding: 3px 0; }
.sw { width: 32px; height: 32px; border-radius: 50%; cursor: pointer; padding: 0; border: 1px solid rgba(0, 0, 0, .16); box-shadow: inset 0 -3px 6px rgba(0, 0, 0, .1); }
.sw[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--sel); }
.sw:focus-visible { outline: 2px solid var(--text); outline-offset: 5px; }

.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; background: var(--surface-2); padding: 4px; border-radius: 13px; max-width: 100%; }
.seg--fill { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
.seg button {
  border: 0; background: transparent; color: var(--muted); font-weight: 650; font-size: 14px;
  padding: 8px 16px; border-radius: 10px; cursor: pointer; line-height: 1.25; text-align: center;
}
.seg button small { display: block; font-weight: 500; font-size: 12px; color: var(--faint); margin-top: 1px; }
.seg button em { display: block; font-style: normal; font-weight: 600; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.seg button em:empty { display: none; }
.seg button:hover { color: var(--text); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: inset 0 0 0 1.5px var(--sel), var(--shadow-sm); }
.seg button[aria-pressed="true"] small { color: var(--muted); }
.seg button:disabled { opacity: .4; cursor: not-allowed; }

/* ---------- Правая колонка: заказ одной карточкой ---------- */
.side {
  grid-area: side; position: sticky; top: 80px; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); overflow: hidden;
}
.side__models { padding: 16px 16px 12px; border-bottom: 1px solid var(--line); }
.side__head { display: flex; align-items: center; justify-content: space-between; margin: 0 2px 10px; }
.side__head h3 { font-size: 16px; font-weight: 750; }
.side__head h3 span { color: var(--faint); font-weight: 600; margin-left: 4px; }
#models-title:focus { outline: none; }

.models {
  list-style: none; margin: 0 -6px; padding: 0; display: flex; flex-direction: column; gap: 2px;
  max-height: clamp(220px, calc(100vh - 600px), 480px); overflow-y: auto; overscroll-behavior: contain;
}
.model {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: "name price x" "meta qty qty" "acts acts acts";
  align-items: center; gap: 2px 10px; border-radius: 12px; padding: 10px 6px 10px 12px; cursor: pointer; position: relative;
}
.model:hover { background: var(--surface-2); }
.model.is-active { background: var(--sel-soft); }
.model.is-active::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 3px; background: var(--sel); }
.model__name { grid-area: name; font-weight: 650; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; border: 0; background: none; padding: 0; cursor: pointer; min-width: 0; }
.model__price { grid-area: price; font-weight: 750; font-size: 14.5px; font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.model__price small { display: block; font-weight: 500; font-size: 12px; color: var(--muted); }
.model__x { grid-area: x; width: 30px; height: 30px; border-radius: 8px; border: 0; background: none; color: var(--faint); font-size: 18px; line-height: 1; cursor: pointer; }
.model__x:hover { color: var(--err); background: var(--surface); }
.model__meta { grid-area: meta; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.model__meta--err { color: var(--err); }
.model__act { grid-area: acts; justify-self: start; margin-top: 6px; color: var(--accent); }
.qty { grid-area: qty; justify-self: end; display: flex; align-items: center; height: 32px; border: 1px solid var(--line-2); border-radius: 10px; overflow: hidden; background: var(--surface); }
.qty button { width: 30px; height: 100%; border: 0; background: transparent; font-weight: 700; font-size: 16px; cursor: pointer; }
.qty button:hover:not(:disabled) { background: var(--surface-2); }
.qty button:disabled { color: var(--faint); cursor: default; }
.qty input { width: 38px; height: 100%; border: 0; text-align: center; font-size: 14px; font-weight: 650; background: transparent; -moz-appearance: textfield; font-variant-numeric: tabular-nums; }
.qty input::-webkit-inner-spin-button { -webkit-appearance: none; }
.models__common { margin: 8px 2px 0; font-size: 12.5px; color: var(--muted); }

.checkout { padding: 16px; display: flex; flex-direction: column; gap: 16px; }
.checkout__opt { display: flex; flex-direction: column; gap: 8px; }
.checkout__opt .row__hint { margin: 0; font-size: 12.5px; }
.checkout__opt .row__hint:empty { display: none; }
.checkout__label { font-size: 13px; font-weight: 650; color: var(--muted); }
.dchips { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dchips button {
  text-align: left; border: 1.5px solid var(--line); background: var(--surface); border-radius: 12px; padding: 9px 12px;
  font-size: 14px; font-weight: 650; line-height: 1.25; cursor: pointer; transition: border-color .15s, box-shadow .15s;
}
.dchips button small { display: block; font-size: 12.5px; font-weight: 500; color: var(--muted); margin-top: 2px; }
.dchips button:hover { border-color: var(--line-2); }
.dchips button[aria-pressed="true"] { border-color: var(--sel); box-shadow: 0 0 0 3px var(--sel-soft); }

.total { border-top: 1px solid var(--line); padding-top: 16px; }
.total__empty { color: var(--muted); margin: 6px 0 16px; font-size: 14px; }
.total__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.total__head span { color: var(--muted); font-weight: 600; font-size: 15px; }
.total__sum { font-size: 32px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.03em; }
.total__sum--empty { color: var(--faint); }
.total__tiers { margin: 2px 0 10px; font-size: 13px; color: var(--muted); }
.total__tiers b { color: var(--text); }
.total__hint { margin: 0 0 12px; font-size: 13px; line-height: 1.45; background: var(--warn-soft); border-radius: 12px; padding: 9px 12px; }
.total__more { margin: 0 0 12px; }
.total__more summary {
  cursor: pointer; list-style: none; font-size: 13.5px; color: var(--muted); display: flex; justify-content: space-between; gap: 8px; padding: 2px 0;
}
.total__more summary::-webkit-details-marker { display: none; }
.total__more summary::after { content: "▾" / ""; transition: transform .15s; }
.total__more[open] summary::after { transform: rotate(180deg); }
.total__more summary:hover { color: var(--text); }
.total__rows { margin: 8px 0 0; padding: 10px 0 0; border-top: 1px dashed var(--line-2); display: flex; flex-direction: column; gap: 5px; }
.total__rows div { display: flex; justify-content: space-between; gap: 12px; font-size: 13.5px; }
.total__rows dt { color: var(--muted); }
.total__rows dd { margin: 0; font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 550; }
.total__eta { margin: 0 0 14px; font-size: 14px; color: var(--muted); }
.total__eta b { color: var(--text); font-weight: 650; }
.total__note { margin: 12px 0 0; font-size: 12.5px; line-height: 1.45; color: var(--muted); }
.total__note .linkbtn { font-size: 12.5px; }
.total__manual { margin: 0 0 12px; font-size: 13.5px; color: var(--warn); }

/* Нижняя панель с ценой */
.mbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  background: color-mix(in srgb, var(--surface) 92%, transparent); -webkit-backdrop-filter: saturate(1.4) blur(12px); backdrop-filter: saturate(1.4) blur(12px);
  border-top: 1px solid var(--line); box-shadow: 0 -8px 24px rgba(16, 24, 40, .08);
  padding: 10px 0 calc(10px + env(safe-area-inset-bottom));
}
.mbar__in { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.mbar__in > div { min-width: 0; }
.mbar .btn { white-space: nowrap; flex: none; min-height: 48px; }
.mbar small { display: block; color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mbar b { font-size: 22px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
body.has-mbar { padding-bottom: 80px; }

/* ===================== Остальные разделы ===================== */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 64px; }
.step { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; }
.step b { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; background: var(--surface-2); font-weight: 750; font-size: 14px; margin-bottom: 12px; }
.step h3 { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.step p { margin: 0; color: var(--muted); font-size: 14px; }

.nomodel { display: grid; grid-template-columns: 1fr 1fr; gap: 36px; margin-top: 64px; align-items: start; }
.nomodel__text p { color: var(--muted); font-size: 16px; line-height: 1.6; }
.nomodel__text b { color: var(--text); }

.form { display: flex; flex-direction: column; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px; box-shadow: var(--shadow-sm); }
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; font-weight: 650; }
.field i { font-style: normal; font-weight: 450; color: var(--muted); }
.field input, .field textarea {
  font-weight: 450; font-size: 15px; background: var(--surface); border: 1px solid var(--field-line);
  border-radius: 12px; padding: 11px 13px; width: 100%; resize: vertical; min-height: 46px; transition: border-color .15s, box-shadow .15s;
}
.field input::placeholder, .field textarea::placeholder { color: var(--faint); }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--sel); box-shadow: 0 0 0 3px var(--sel-soft); }
.field__err { display: none; color: var(--err); font-weight: 500; font-size: 13px; }
.is-bad .field__err { display: block; }
.field.is-bad input, .field.is-bad textarea { border-color: var(--err); }
.field.is-bad input:focus, .field.is-bad textarea:focus { box-shadow: 0 0 0 3px var(--err-soft); }

.filepick { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.filepick__btn { position: relative; font-size: 14px; min-height: 40px; padding: 8px 14px; cursor: pointer; }
.filepick__btn:focus-within { outline: 2px solid var(--sel); outline-offset: 2px; }
.filepick__input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; font-size: 0; }
.filepick__empty { font-weight: 450; color: var(--muted); }
.filepick__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.filepick__list li { display: flex; align-items: center; gap: 10px; font-weight: 450; font-size: 14px; background: var(--surface-2); border-radius: 10px; padding: 6px 6px 6px 10px; }
.filepick__list img { width: 40px; height: 40px; object-fit: cover; border-radius: 8px; flex: none; }
.filepick__list span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filepick__list small { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.filepick__list button { border: 0; background: none; color: var(--muted); font-size: 18px; line-height: 1; cursor: pointer; width: 32px; height: 32px; border-radius: 8px; }
.filepick__list button:hover { color: var(--err); background: var(--surface); }

.check { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; font-size: 14px; color: var(--muted); }
.check label { display: flex; gap: 10px; align-items: center; cursor: pointer; padding: 4px 0; }
.check a { color: var(--accent); }
.check .field__err { flex-basis: 100%; }
.check input { accent-color: var(--brand); width: 20px; height: 20px; flex: none; margin: 0; }
.check.is-bad label { color: var(--err); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.progress { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: var(--brand); transition: width .2s; }
.form__err { margin: 0; color: var(--err); font-size: 14px; }
.form__err a { color: var(--accent); }
.form__note { margin: 0; font-size: 13px; color: var(--muted); text-align: center; }
.form__done { font-size: 16px; }
.form__done:focus { outline: none; }
.form__done b { color: var(--ok); }
.form__done .btn { margin-top: 14px; }

.payer { display: flex; gap: 4px; background: var(--surface-2); border-radius: 13px; padding: 4px; }
.payer label { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 6px 10px; border-radius: 10px; font-size: 14px; font-weight: 650; color: var(--muted); cursor: pointer; text-align: center; }
.payer input { accent-color: var(--brand); margin: 0; }
.payer label:has(input:checked) { background: var(--surface); color: var(--text); box-shadow: inset 0 0 0 1.5px var(--sel), var(--shadow-sm); }

.materials { margin-top: 64px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-sm); }
.mtable { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.mtable th, .mtable td { text-align: left; padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
.mtable tr:last-child td { border-bottom: 0; }
.mtable th { color: var(--muted); font-weight: 600; font-size: 13px; }
.mtable td:first-child { font-weight: 750; white-space: nowrap; }
.mtable td:first-child .linkbtn { display: block; margin-top: 4px; font-size: 13px; font-weight: 600; }
.mtable .dots { display: flex; gap: 5px; flex-wrap: wrap; }
.mtable .dots i { width: 16px; height: 16px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, .16); }

.faq { margin-top: 64px; }
.faq details { max-width: 840px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 0 18px; margin-bottom: 8px; }
.faq summary { cursor: pointer; padding: 16px 0; font-weight: 650; font-size: 16px; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+" / ""; color: var(--muted); font-weight: 500; font-size: 20px; line-height: 1; transition: transform .15s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin: 0 0 16px; color: var(--muted); line-height: 1.6; }
.faq details p:empty { display: none; }

.foot { margin-top: 72px; border-top: 1px solid var(--line); padding: 28px 0 44px; color: var(--muted); font-size: 14px; }
.foot__in { display: flex; flex-wrap: wrap; gap: 12px 32px; justify-content: space-between; }
.foot__contacts { display: flex; gap: 16px; }
.foot__contacts:empty { display: none; }
.foot__legal a { color: var(--muted); }

/* ===================== Окно заказа ===================== */
.dlg {
  width: min(600px, calc(100vw - 24px)); max-height: calc(100dvh - 32px); padding: 0; border: 0; border-radius: 24px;
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg);
}
.dlg::backdrop { background: rgba(10, 12, 16, .5); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
.dlg .form { border: 0; box-shadow: none; padding: 24px; }
.dlg__head { display: flex; align-items: center; justify-content: space-between; }
.dlg__head h2 { margin: 0; font-size: 22px; font-weight: 750; }
.dlg__x { border: 0; background: none; color: var(--muted); font-size: 26px; line-height: 1; cursor: pointer; width: 40px; height: 40px; margin: -6px -8px -6px 0; border-radius: 10px; }
.dlg__x:hover { background: var(--surface-2); color: var(--text); }
.dlg__sum { background: var(--surface-2); border-radius: 16px; padding: 14px 16px; font-size: 14px; }
.dlg__sum table { width: 100%; border-collapse: collapse; margin: 8px 0; font-size: 13.5px; }
.dlg__sum td { padding: 4px 0; vertical-align: top; }
.dlg__sum td + td { text-align: right; white-space: nowrap; padding-left: 12px; font-variant-numeric: tabular-nums; font-weight: 550; }
.dlg__sum .muted { color: var(--muted); font-weight: 450; }
.dlg__sum p { margin: 6px 0 0; }
.dlg__submit { position: sticky; bottom: 0; background: linear-gradient(transparent, var(--surface) 14px); padding: 18px 0 2px; margin-top: -6px; display: flex; flex-direction: column; gap: 8px; }
.dlg__done { padding: 36px 28px; text-align: center; }
.dlg__done:focus { outline: none; }
.dlg__done h2 { margin-bottom: 8px; }
.dlg__done p { color: var(--muted); }
.dlg__done .big { display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); font-size: 28px; font-weight: 800; margin-bottom: 12px; }
.dlg__done ol { text-align: left; margin: 18px auto; padding-left: 22px; max-width: 440px; display: flex; flex-direction: column; gap: 10px; }
.dlg__done ol li::marker { font-weight: 750; color: var(--brand); }
.dlg__done .acts { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 18px; }

/* ===================== Панель выбора снизу (телефон) ===================== */
.sheet {
  margin: auto 0 0; inset: auto 0 0 0; width: 100%; max-width: 100%; max-height: 88dvh; padding: 0; border: 0;
  border-radius: 24px 24px 0 0; background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg);
  flex-direction: column;
}
.sheet[open] { display: flex; animation: sheet-up .22s ease-out; }
@keyframes sheet-up { from { transform: translateY(40px); opacity: .6; } }
.sheet::backdrop { background: rgba(10, 12, 16, .45); }
.sheet__head { position: relative; display: flex; align-items: center; justify-content: space-between; padding: 22px 18px 8px; }
.sheet__head::before { content: ""; position: absolute; top: 8px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 4px; background: var(--line-2); }
.sheet__head h3 { font-size: 19px; font-weight: 750; }
.sheet__body { padding: 4px 18px 16px; overflow-y: auto; overscroll-behavior: contain; }
.sheet__body .row__hint { margin-top: 12px; }
.sheet__body .seg { width: 100%; display: grid; grid-template-columns: 1fr !important; }
.sheet__body .seg button { text-align: left; padding: 12px 14px; font-size: 15px; display: grid; grid-template-columns: 1fr auto; align-items: center; column-gap: 12px; }
.sheet__body .seg button small { grid-column: 1; margin: 0; font-size: 12.5px; }
.sheet__body .seg button em { grid-column: 2; grid-row: 1 / span 2; font-size: 13px; }
.sheet__body .mats { grid-template-columns: 1fr 1fr; }
.sheet__body .purposes { flex-wrap: wrap; }
.sheet__body .swatches { gap: 12px; }
.sheet__body .dchips { grid-template-columns: 1fr; }
.sheet__body .dchips button { padding: 12px 14px; display: flex; justify-content: space-between; align-items: center; font-size: 15px; }
.sheet__body .dchips button small { margin: 0; font-size: 13.5px; }
.sheet__foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 18px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line); background: var(--surface);
}
.sheet__foot b { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
.sheet__foot small { display: block; font-size: 12.5px; color: var(--muted); }
.sheet__foot .btn { min-width: 140px; }

/* ===================== Всплывающее сообщение ===================== */
.toast {
  position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 50;
  background: var(--text); color: var(--surface); padding: 10px 12px 10px 16px; border-radius: 14px; display: flex; gap: 12px; align-items: center;
  box-shadow: var(--shadow-lg); max-width: calc(100vw - 32px); font-size: 14px;
}
.toast button { background: transparent; color: inherit; border: 1px solid color-mix(in srgb, currentColor 40%, transparent); border-radius: 9px; padding: 5px 12px; font-weight: 650; cursor: pointer; }
body.has-mbar .toast { bottom: calc(92px + env(safe-area-inset-bottom)); }

/* ===================== Адаптив ===================== */
/* Невысокий экран ноутбука: правая колонка прокручивается со страницей, цена — в нижней панели */
@media (min-width: 961px) and (max-height: 820px) {
  .side { position: static; }
}

@media (max-width: 1100px) {
  .calc { grid-template-columns: minmax(0, 1fr) 340px; }
  .row { grid-template-columns: 1fr; gap: 10px; }
  .row__label { padding-top: 0; }
}

@media (max-width: 960px) {
  /* Одна колонка: сцена → модели → параметры → заказ */
  .calc { grid-template-columns: minmax(0, 1fr); grid-template-areas: "stage" "models" "config" "total"; gap: 12px; }
  .side { display: contents; }
  .side__models, .checkout { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
  .side__models { grid-area: models; }
  .checkout { grid-area: total; }
  .models { max-height: none; }
  .top__in { gap: 14px; }
  .top__nav { gap: 16px; overflow-x: auto; white-space: nowrap; min-width: 0; scrollbar-width: none; }
  .top__nav a[href="#calc"] { display: none; }
  .top__contacts { display: none; }
  .hero { justify-content: flex-start; }
  .steps { grid-template-columns: 1fr 1fr; }
  .nomodel { grid-template-columns: 1fr; gap: 8px; }
}

/* Телефон: параметры — строками, выбор — в панели снизу */
@media (max-width: 760px) {
  .wrap { padding: 0 14px; }
  .hero { padding: 18px 14px 12px; gap: 10px; }
  .hero h1 { font-size: 25px; }
  .hero__facts { flex-wrap: nowrap; overflow-x: auto; margin: 0 -14px; padding: 0 14px 2px; scrollbar-width: none; width: calc(100% + 28px); }
  .hero__facts::-webkit-scrollbar { display: none; }
  .hero__facts li { font-size: 13px; padding: 5px 11px 5px 9px; }
  .viewer { height: 300px; }
  .viewer__plate { display: none; }
  .viewer__hint { right: 12px; text-align: center; font-size: 12px; }
  .modelbar { padding: 12px 16px; }

  .config { padding: 0; }
  .config .row { display: block; padding: 0; }
  .config .row > .row__label, .config .row > .row__ctl { display: none; }
  .checkout__opt > :not(.row__sum) { display: none; }
  .checkout__opt { gap: 0; }
  .row__sum {
    display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 10px 16px; border: 0; background: none;
    text-align: left; cursor: pointer;
  }
  .row__sum > span { color: var(--muted); font-size: 14.5px; flex: none; }
  .row__sum > b { margin-left: auto; font-size: 15px; font-weight: 650; text-align: right; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 8px; }
  .row__sum > b i { width: 14px; height: 14px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, .2); flex: none; }
  .row__sum::after { content: ""; width: 8px; height: 8px; flex: none; margin: 0 2px 0 2px; border-right: 2px solid var(--faint); border-bottom: 2px solid var(--faint); transform: rotate(-45deg); }
  .row__sum:active { background: var(--surface-2); }
  .checkout { padding: 4px 0 16px; gap: 0; }
  .checkout__opt { border-bottom: 1px solid var(--line); }
  .checkout .total { border-top: 0; padding: 16px 16px 0; }
  .side__models { padding: 14px 12px 10px; }

  .steps { gap: 8px; margin-top: 40px; }
  .step { padding: 14px; border-radius: 16px; }
  .step b { width: 26px; height: 26px; font-size: 13px; margin-bottom: 8px; }
  .step h3 { font-size: 14.5px; }
  .step p { font-size: 13px; line-height: 1.4; }
  .nomodel, .materials, .faq { margin-top: 44px; }
  h2 { font-size: 22px; }
  .form { padding: 18px; }
  .form__row { grid-template-columns: 1fr; }

  /* Таблица материалов — карточками */
  .table-wrap { border: 0; background: none; box-shadow: none; overflow: visible; }
  .mtable, .mtable tbody, .mtable tr, .mtable td { display: block; }
  .mtable thead { display: none; }
  .mtable tr { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 12px 16px; margin-bottom: 8px; }
  .mtable td { border: 0; padding: 2px 0; }
  .mtable td:first-child { display: flex; justify-content: space-between; align-items: baseline; font-size: 16px; margin-bottom: 4px; }
  .mtable td:first-child .linkbtn { margin: 0; }
  .mtable td[data-l]::before { content: attr(data-l) ": "; color: var(--muted); }

  .dlg { width: 100vw; max-width: 100vw; max-height: 100dvh; height: 100dvh; border-radius: 0; margin: 0; }
  .dlg .form { min-height: 100%; padding: 18px; }
  .payer label { font-size: 13px; }
}

@media (max-width: 420px) {
  .top__nav a[href="#materials"], .top__nav a[href="#how"] { display: none; }
}

/* Пальцем: крупные цели касания */
@media (pointer: coarse) {
  .qty { height: 40px; }
  .qty button { width: 40px; }
  .qty input { width: 44px; font-size: 16px; }
  .model__x { width: 40px; height: 40px; }
  .sw { width: 36px; height: 36px; }
  .plates button { width: 40px; height: 40px; }
  .linkbtn { padding: 8px 2px; }
  .total__more summary { padding: 8px 0; }
  .modelbar select, .modelbar input, .field input, .field textarea { font-size: 16px; }
  .viewer canvas { touch-action: pan-y; }
}

@media (max-height: 500px) {
  .top { position: static; }
  .mbar small { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
  .spinner { animation-duration: 1.6s !important; }
}

/* Тёмная тема: чёрные кружки видны на тёмном фоне */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .sw, :root:not([data-theme="light"]) .mtable .dots i { border-color: rgba(255, 255, 255, .35); }
}
:root[data-theme="dark"] .sw, :root[data-theme="dark"] .mtable .dots i { border-color: rgba(255, 255, 255, .35); }

/* Подсказки разной длины не двигают остальную страницу */
@media (min-width: 761px) {
  #material-hint { min-height: 2.9em; }
}

/* Модель-пример при первом заходе */
.demo { display: flex; align-items: center; gap: 12px 20px; padding: 14px 18px; border-top: 1px solid var(--line); background: var(--sel-soft); }
.demo p { margin: 0; font-size: 14px; flex: 1; min-width: 0; }
.demo .btn { flex: none; }
.model__tag { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: var(--surface-3); color: var(--muted); font-size: 11.5px; font-weight: 650; vertical-align: 1px; }
@media (max-width: 760px) {
  .demo { flex-direction: column; align-items: stretch; padding: 14px 16px; }
  .demo .btn { width: 100%; }
}

/* ===================== Готовые модели ===================== */
.library { margin-top: 64px; }
.library__head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 24px; margin-bottom: 20px; }
.library__head h2 { margin-bottom: 8px; }
.library__head p { margin: 0; color: var(--muted); font-size: 16px; line-height: 1.55; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips button {
  border: 1px solid var(--line-2); background: var(--surface); color: var(--text); font: inherit; font-size: 14px; font-weight: 600;
  padding: 8px 14px; border-radius: 999px; cursor: pointer; transition: background .15s, border-color .15s;
}
.chips button:hover { border-color: var(--text); }
.chips button[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: var(--surface); }
.shop__more { display: flex; margin: 16px auto 0; min-width: 220px; justify-content: center; }
.library__foot { margin: 20px 0 0; text-align: center; color: var(--muted); font-size: 14.5px; }
.library__foot a, .library__foot .linkbtn { color: var(--text); font-weight: 600; text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
@media (max-width: 760px) {
  .library { margin-top: 44px; }
  .chips { flex-wrap: nowrap; overflow-x: auto; margin: 0 -14px; padding: 0 14px 2px; scrollbar-width: none; }
  .chips::-webkit-scrollbar { display: none; }
  .chips button { white-space: nowrap; }
}

/* ===================== Каталог готовых моделей ===================== */
.shop { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.item { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-sm); transition: border-color .15s, transform .15s; }
.item:hover { border-color: var(--line-2); transform: translateY(-2px); }
.item__img { aspect-ratio: 4 / 3; background: radial-gradient(90% 90% at 50% 30%, var(--viewer-a), var(--viewer-b)); display: grid; place-items: center; border: 0; padding: 0; cursor: zoom-in; overflow: hidden; }
.item__img img { width: 100%; height: 100%; object-fit: contain; display: block; }
.item--photo .item__img img { object-fit: cover; transition: transform .25s; }
.item--photo .item__img:hover img { transform: scale(1.03); }
.item__body { display: flex; flex-direction: column; padding: 10px 12px 12px; flex: 1; }
.item__name { border: 0; background: none; padding: 0; font: inherit; font-size: 14.5px; font-weight: 650; line-height: 1.3; text-align: left; color: var(--text); cursor: pointer; }
.item__name:hover { text-decoration: underline; text-underline-offset: 3px; }
.item__foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 10px; }
.item__foot em { font-style: normal; font-size: 16.5px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.item__foot .btn { min-height: 36px; padding: 7px 13px; font-size: 14px; border-radius: 10px; }
@media (max-width: 1100px) { .shop { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 900px) { .shop { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .shop { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .item__body { padding: 9px 10px 10px; }
  .item__name { font-size: 13.5px; }
  .item__foot { flex-wrap: wrap; gap: 6px; }
  .item__foot em { font-size: 15.5px; }
  .item__foot .btn { width: 100%; }
}

/* Окно с подробностями модели */
.dlg--product { width: min(920px, calc(100vw - 24px)); }
.product { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
.product__gallery { background: radial-gradient(90% 90% at 50% 30%, var(--viewer-a), var(--viewer-b)); padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.product__main { aspect-ratio: 4 / 3; border-radius: 16px; overflow: hidden; display: grid; place-items: center; }
.product__main img { width: 100%; height: 100%; object-fit: contain; display: block; }
.dlg--product.is-photo .product__main { background: var(--surface); }
.product__thumbs { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.product__thumbs:empty { display: none; }
.product__thumbs button { flex: 0 0 64px; height: 48px; padding: 0; border: 2px solid transparent; border-radius: 10px; overflow: hidden; cursor: pointer; background: var(--surface); }
.product__thumbs button[aria-pressed="true"] { border-color: var(--text); }
.product__thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }
.product__info { padding: 22px 24px 24px; display: flex; flex-direction: column; gap: 12px; }
.product__info .dlg__head { align-items: flex-start; gap: 12px; }
.product__info h2 { font-size: 22px; line-height: 1.25; }
.product__desc { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.5; }
.product__desc:empty { display: none; }
.product__facts { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; font-size: 14px; }
.product__facts li { padding-left: 16px; position: relative; }
.product__facts li::before { content: ''; position: absolute; left: 2px; top: .6em; width: 5px; height: 5px; border-radius: 50%; background: var(--faint); }
.product__buy { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap; padding-top: 14px; border-top: 1px solid var(--line); }
.product__buy b { display: block; font-size: 26px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.product__buy small { display: block; color: var(--muted); font-size: 12.5px; max-width: 220px; line-height: 1.35; }
.product__note { margin: 0; color: var(--faint); font-size: 13px; line-height: 1.45; }
@media (max-width: 760px) {
  .product { grid-template-columns: minmax(0, 1fr); }
  .product__gallery { padding: 10px; }
  .product__info { padding: 16px 16px 20px; }
  .product__info h2 { font-size: 19px; }
  .product__buy .btn { width: 100%; }
}

/* ===================== Начало: «Что будем печатать?» ===================== */
.drop > b { font-size: 21px; }
.start { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; width: min(760px, 100%); margin: 6px 0 2px; }
.start__tile {
  display: flex; flex-direction: column; align-items: flex-start; gap: 3px; text-align: left; padding: 14px; border-radius: 16px;
  background: var(--surface); border: 1.5px solid var(--line); color: var(--text); text-decoration: none; cursor: pointer;
  font: inherit; box-shadow: var(--shadow-sm); transition: border-color .15s, transform .15s;
}
.start__tile:hover { border-color: var(--line-2); transform: translateY(-2px); }
.start__tile svg { width: 38px; height: 38px; padding: 8px; border-radius: 11px; background: var(--surface-2); color: var(--text); margin-bottom: 6px; }
.start__tile b { font-size: 15px; font-weight: 700; color: var(--text); }
.start__tile span { font-size: 12.5px; color: var(--muted); line-height: 1.35; }
.start__tile--main { background: var(--primary); border-color: var(--primary); }
.start__tile--main svg { background: color-mix(in srgb, var(--primary-ink) 14%, transparent); color: var(--primary-ink); }
.start__tile--main b, .start__tile--main span { color: var(--primary-ink); }
.start__tile--main span { opacity: .75; }
.demo__acts { display: flex; flex-wrap: wrap; gap: 8px; flex: none; }
.demo__acts .btn { min-height: 40px; padding: 8px 14px; font-size: 14px; }

/* Меню «+ Добавить» в заказе */
.addmenu { position: relative; }
.addmenu summary { list-style: none; cursor: pointer; }
.addmenu summary::-webkit-details-marker { display: none; }
.addmenu__list {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 10; min-width: 190px; padding: 6px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lg); display: flex; flex-direction: column;
}
.addmenu__list button, .addmenu__list a { text-align: left; padding: 10px 12px; border-radius: 9px; border: 0; background: none; font: inherit; font-size: 14.5px; font-weight: 600; color: var(--text); text-decoration: none; cursor: pointer; }
.addmenu__list button:hover, .addmenu__list a:hover { background: var(--surface-2); }

/* Настройки надписи под сценой */
.namebar { flex-basis: 100%; display: grid; grid-template-columns: minmax(0, 1.2fr) auto auto; gap: 10px 18px; align-items: end; }
.namebar__text { display: flex; flex-direction: column; align-items: stretch; gap: 5px; font-size: 13px; color: var(--muted); }
.namebar__text input { font: inherit; font-size: 19px; font-weight: 700; color: var(--text); height: 46px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--field-line); background: var(--surface); width: 100%; }
.namebar__text input:focus { outline: none; border-color: var(--sel); box-shadow: 0 0 0 3px var(--sel-soft); }
.namebar__row { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--muted); }
.namebar .seg button { padding: 8px 12px; }

@media (max-width: 1100px) {
  .namebar { grid-template-columns: 1fr 1fr; }
  .namebar__text { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .start { grid-template-columns: 1fr 1fr; gap: 8px; }
  .start__tile { padding: 12px; }
  .start__tile svg { width: 34px; height: 34px; padding: 7px; margin-bottom: 4px; }
  .start__tile b { font-size: 14px; }
  .start__tile span { font-size: 12px; }
  .drop { padding: 16px; gap: 8px; }
  .drop > b { font-size: 18px; }
  .demo__acts { width: 100%; }
  .demo__acts .btn { flex: 1; }
  .namebar { grid-template-columns: 1fr; }
  .namebar .seg { width: 100%; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; }
}

/* Пустая рабочая область растёт по содержимому, сцена остаётся фоном */
.viewer:not(.has-model) { height: auto; min-height: clamp(340px, 46vh, 520px); }
.viewer:not(.has-model) canvas { position: absolute; inset: 0; }
.viewer:not(.has-model) .drop { position: relative; inset: auto; min-height: inherit; }
@media (max-width: 760px) {
  .viewer:not(.has-model) { min-height: 300px; }
}
.modelbar .namebar__text { flex-direction: column; align-items: stretch; gap: 5px; }
.namebar { grid-template-columns: minmax(220px, 1fr) auto auto; }
@media (max-width: 1100px) { .namebar { grid-template-columns: 1fr 1fr; } }
@media (max-width: 760px) { .namebar { grid-template-columns: 1fr; } }
/* Надпись: поле — строкой сверху, высота и способ печати — в ряд под ним */
.namebar { grid-template-columns: max-content max-content; justify-content: start; column-gap: 24px; }
.modelbar .namebar__text { grid-column: 1 / -1; max-width: 460px; }
.namebar .seg { flex-wrap: nowrap; }
@media (max-width: 760px) {
  .namebar { grid-template-columns: 1fr; }
  .modelbar .namebar__text { max-width: none; }
}
