/**
 * МосСтеклоМонтаж — оболочка калькулятора /kupit-steklo/
 * Перекрывает Place style.css: фирменные токены, шрифты, кнопки, карточки, модалки.
 * Не трогает логику engine.js / app.js.
 */

:root {
  /* Сырые с визитки / tokens-corporate */
  --brand-orange: #ee791c;
  --brand-blue-sky: #3ba9e0;
  --brand-blue-bright: #00b1eb;
  --brand-blue-700: #007db3;
  --brand-blue-600: #008dd2;
  --brand-blue-800: #0060aa;
  --brand-navy: #274066;
  --brand-charcoal: #2b2a29;

  --ink-1000: #070d12;
  --ink-900: #0c1822;
  --ink-800: #122433;
  --ink-700: #1a3550;
  --ink-500: #4a667d;
  --ink-300: #8fa6b5;

  --paper-1000: #f4f7fa;
  --paper-900: #e8eef5;
  --paper-800: #d5dee9;
  --paper-700: #b4c4d4;

  --brass-600: var(--brand-orange);
  --brass-500: #f28f3d;
  --brass-300: #fbc9a6;
  --crystal-500: var(--brand-blue-sky);

  /* Homepage catalog/hero: Onest geometric grotesque — NOT Source Serif */
  --ff-display: 'Onest', 'Source Sans 3', system-ui, sans-serif;
  --ff-body: 'Onest', 'Source Sans 3', system-ui, sans-serif;
  --ff-tech: 'IBM Plex Mono', ui-monospace, 'Cascadia Code', monospace;
  --ff-hero: 'Onest', 'Source Sans 3', system-ui, sans-serif;

  --fs-xs: 0.6875rem;
  --fs-sm: 0.8125rem;
  --fs-md: 0.9375rem;
  --tracking-tech: 0.1em;
  --tracking-display: -0.02em;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast: 220ms;
  --dur-base: 450ms;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --shadow-soft: 0 30px 60px -20px rgba(7, 13, 18, 0.14);

  /* Place selection UI → ink, not orange (Сценарии language) */
  --ink: var(--ink-1000);
  --blue: var(--ink-1000);
  --mint: var(--paper-900);
  --line: var(--paper-800);
  --muted: var(--ink-500);
  --paper: var(--paper-1000);
  --white: #ffffff;
  --orange: var(--brand-orange);
  --surface2: var(--paper-900);
  --accent-dim: color-mix(in srgb, var(--ink-1000) 6%, transparent);
  --accent-soft: var(--paper-900);
  --hairline: 1px solid color-mix(in srgb, var(--ink-1000) 12%, transparent);
  --select-border: var(--ink-1000);
}

/* ---------- Base ---------- */
body {
  background: var(--paper-1000);
  color: var(--ink-1000);
  font-family: var(--ff-body);
  font-size: var(--fs-md);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--brand-orange);
  color: var(--paper-1000);
}

/* ---------- Isolate Place style.css from real MSM chrome (do NOT restyle header) ---------- */
body.page-kupit-steklo {
  padding-top: 5.75rem; /* clearance for fixed .site-header from index chrome */
}

body.page-kupit-steklo > header.site-header {
  /* Undo Place `header { height; max-width; flex; margin }` — keep site-chrome/brand look */
  height: auto !important;
  max-width: none !important;
  width: 100% !important;
  margin: 0 !important;
  display: block !important;
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 100 !important;
  padding-inline: 0 !important;
}

/* Undo Place `nav {…}` chrome — never force display:flex (that kills mobile hide). */
body.page-kupit-steklo > header.site-header .primary-nav {
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  border-radius: 0 !important;
  overflow: visible !important;
  gap: clamp(1rem, 2vw, 2rem) !important;
}

@media (min-width: 1281px) {
  body.page-kupit-steklo > header.site-header .primary-nav {
    display: flex !important;
  }
}

@media (max-width: 1280px) {
  body.page-kupit-steklo > header.site-header .primary-nav {
    display: none !important;
  }
}

/* Place `nav{display:flex}` also poisons the burger drawer — keep column stack */
body.page-kupit-steklo .mobile-drawer > nav {
  display: block !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  border-radius: 0 !important;
  overflow: visible !important;
}

body.page-kupit-steklo .mobile-drawer .mobile-drawer__list {
  display: flex !important;
  flex-direction: column !important;
  width: 100% !important;
  max-width: 100% !important;
}

body.page-kupit-steklo > footer.site-footer {
  max-width: none !important;
  margin: 0 !important;
  display: block !important;
  border-top: 0 !important;
  letter-spacing: normal !important;
  text-transform: none !important;
  font-size: inherit !important;
}

/* Floating cart below header — never replaces ЗАЯВКА */
.msm-calc-cart {
  position: fixed;
  top: calc(5.75rem + 0.65rem);
  right: clamp(0.75rem, 3vw, 1.5rem);
  z-index: 90;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.7rem 1.15rem;
  border: 1px solid var(--paper-800);
  border-radius: 999px;
  background: var(--white);
  color: var(--ink-1000);
  font-family: var(--ff-tech);
  font-size: var(--fs-xs);
  font-weight: 500;
  letter-spacing: var(--tracking-tech);
  text-transform: uppercase;
  box-shadow: 0 12px 28px -18px rgba(7, 13, 18, 0.35);
  cursor: pointer;
}

.msm-calc-cart:hover {
  border-color: var(--ink-1000);
  background: var(--paper-900);
}

.msm-calc-cart span {
  background: var(--ink-1000);
  color: var(--paper-1000);
  border-radius: 999px;
  padding: 0.15rem 0.45rem;
}

body.page-kupit-steklo main {
  padding-top: clamp(1.25rem, 3vw, 2rem);
}

body.page-kupit-steklo .brand.brand--official {
  font-family: inherit;
}

.msm-mark {
  width: 36px;
  height: 36px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  flex-shrink: 0;
}

.msm-mark span {
  background: var(--brand-blue-700);
  border-radius: 2px;
}

.msm-mark span:nth-child(5) {
  background: var(--ink-1000);
}

.msm-word {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--ink-1000);
  line-height: 1.15;
}

.msm-word em {
  font-style: normal;
  color: var(--brand-orange);
}

.brand small {
  display: block;
  font-family: var(--ff-tech);
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: var(--tracking-tech);
  text-transform: uppercase;
  color: var(--ink-500);
  margin-top: 0.2rem;
}

.cart-button {
  background: var(--white);
  color: var(--ink-1000);
  border: 1px solid var(--paper-800);
  border-radius: 999px;
  font-family: var(--ff-tech);
  font-size: var(--fs-xs);
  font-weight: 500;
  letter-spacing: var(--tracking-tech);
  text-transform: uppercase;
  padding: 0.7rem 1.15rem;
  transition: border-color var(--dur-fast) var(--ease-out),
    background var(--dur-fast) var(--ease-out);
}

.cart-button:hover {
  border-color: var(--ink-1000);
  background: var(--accent-soft);
}

.cart-button span {
  background: var(--ink-1000);
  color: var(--paper-1000);
  border-radius: 999px;
  padding: 0.15rem 0.45rem;
  margin-left: 0.5rem;
}

.test {
  color: var(--ink-500);
  font-family: var(--ff-body);
  font-size: 0.8125rem;
  font-weight: 500;
}

header .header-right a.test {
  display: inline;
  text-decoration: none;
}

header .header-right a.test:hover {
  color: var(--brand-orange);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- Intro / typography ---------- */
main {
  padding-top: clamp(1.75rem, 4vw, 2.75rem);
}

.eyebrow,
.step-label,
.preview-head > span,
.bottom-info > div > span,
.intro-note > span {
  font-family: var(--ff-tech);
  font-weight: 500;
  font-size: var(--fs-xs);
  letter-spacing: var(--tracking-tech);
  text-transform: uppercase;
  color: var(--brand-orange);
}

h1 {
  font-family: var(--ff-hero);
  font-weight: 700;
  font-size: clamp(2rem, 4.5vw, 3.25rem);
  letter-spacing: -0.03em;
  line-height: 1.08;
  color: var(--ink-1000);
}

h1 span {
  color: var(--ink-1000);
  font-style: normal;
}

.intro {
  gap: clamp(1.5rem, 3vw, 2.5rem);
  margin-bottom: clamp(1.5rem, 3vw, 2rem);
}

.intro p {
  color: var(--ink-500);
  font-size: 1.0625rem;
  line-height: 1.65;
  max-width: 42ch;
  font-family: var(--ff-body);
}

.intro-note {
  padding: 1.25rem 1.35rem;
  border: 1px solid var(--paper-800);
  border-left: 2px solid var(--brand-orange);
  background: var(--white);
  border-radius: var(--radius-md);
  width: min(310px, 100%);
}

.intro-note p {
  color: var(--ink-1000);
  margin: 0.85rem 0;
  font-family: var(--ff-body);
}

.trust {
  color: var(--ink-500);
  font-size: 0.75rem;
}

h2 {
  font-family: var(--ff-hero);
  font-weight: 700;
  font-size: clamp(1.25rem, 2vw, 1.5rem);
  letter-spacing: -0.025em;
  color: var(--ink-1000);
}

h3 {
  font-family: var(--ff-body);
  font-weight: 600;
  color: var(--ink-1000);
}

.subtitle,
.helper,
.small.muted {
  color: var(--ink-500);
}

.helper {
  font-size: 0.75rem;
}

/* ---------- Steps nav ---------- */
nav {
  background: var(--white);
  border: 1px solid var(--paper-800);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

nav button {
  color: var(--ink-500);
  font-family: var(--ff-body);
  font-weight: 600;
  transition: background var(--dur-fast) var(--ease-out),
    color var(--dur-fast) var(--ease-out);
}

nav button.active {
  background: var(--ink-1000);
  color: var(--paper-1000);
}

nav .num {
  border-color: var(--paper-800);
  font-family: var(--ff-tech);
  font-size: 0.625rem;
}

nav button.active .num {
  border-color: color-mix(in srgb, var(--paper-1000) 35%, transparent);
  color: var(--paper-1000);
}

/* ---------- Panels ---------- */
.settings,
.preview,
.modal-inner {
  background: var(--white);
  border: 1px solid var(--paper-800);
  border-radius: var(--radius-lg);
  box-shadow: 0 18px 40px -28px rgba(7, 13, 18, 0.18);
}

.settings,
.preview {
  border-radius: var(--radius-lg);
}

/* ---------- Forms ---------- */
input,
select,
textarea {
  background: var(--white);
  color: var(--ink-1000);
  border: 1px solid var(--paper-800);
  border-radius: var(--radius-md);
  color-scheme: light;
  transition: border-color var(--dur-fast) var(--ease-out),
    box-shadow var(--dur-fast) var(--ease-out);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--ink-1000);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ink-1000) 10%, transparent);
}

input::placeholder,
textarea::placeholder {
  color: var(--ink-300);
}

.unit span {
  color: var(--ink-500);
}

label {
  color: var(--ink-800);
  font-weight: 600;
}

/* ---------- Tabs / chips / cards — Сценарии language (black active, hairline cards) ---------- */
.tabs {
  background: var(--paper-900);
  border: 1px solid var(--paper-800);
  border-radius: 999px;
  padding: 4px;
  gap: 4px;
}

.tabs button {
  color: var(--ink-1000);
  border-radius: 999px;
  background: transparent;
  border: 0;
  font-weight: 500;
}

.tabs button.selected {
  background: var(--ink-1000);
  color: var(--paper-1000);
  box-shadow: none;
  font-weight: 600;
}

.chip,
.small-btn,
.secondary,
.shape,
.material-card,
.pattern,
.construction-card,
.shape-menu-card {
  background: var(--white);
  color: var(--ink-1000);
  border: 1px solid var(--paper-800);
  border-radius: 999px;
  box-shadow: none;
  transition: border-color var(--dur-fast) var(--ease-out),
    background var(--dur-fast) var(--ease-out),
    color var(--dur-fast) var(--ease-out);
}

.shape,
.material-card,
.pattern,
.construction-card,
.shape-menu-card {
  border-radius: var(--radius-md);
}

.chip.selected,
.tabs button.selected {
  background: var(--ink-1000);
  color: var(--paper-1000);
  border-color: var(--ink-1000);
  box-shadow: none;
}

.shape.selected,
.material-card.selected,
.construction-card.selected,
.shape-menu-card.selected,
.pattern.selected {
  background: var(--white);
  border-color: var(--ink-1000);
  border-width: 1.5px;
  box-shadow: none;
  padding: inherit; /* cancel Place 2px border padding hacks where possible */
}

.material-card.selected,
.construction-card.selected,
.shape-menu-card.selected,
.pattern.selected {
  padding: 12px; /* keep layout stable vs Place selected padding shrink */
}

.chip:hover,
.shape:hover,
.material-card:hover,
.construction-card:hover,
.shape-menu-card:hover,
.small-btn:hover {
  border-color: var(--ink-1000);
  background: var(--white);
}

.chip.selected:hover {
  background: var(--ink-1000);
  color: var(--paper-1000);
}

/* Primary = solid black pill (no orange hover) */
.primary {
  background: var(--ink-1000);
  color: var(--paper-1000);
  border: 0;
  border-radius: 999px;
  font-family: var(--ff-tech);
  font-size: var(--fs-xs);
  font-weight: 500;
  letter-spacing: var(--tracking-tech);
  text-transform: uppercase;
  padding: 0.95rem 1.6rem;
  box-shadow: none;
  transition: background var(--dur-fast) var(--ease-out),
    transform var(--dur-fast) var(--ease-out);
}

.primary:hover {
  background: var(--ink-800);
  box-shadow: none;
}

.primary:active {
  transform: scale(0.98);
}

.secondary {
  border-radius: 999px;
  font-family: var(--ff-tech);
  font-size: var(--fs-xs);
  font-weight: 500;
  letter-spacing: var(--tracking-tech);
  text-transform: uppercase;
  background: var(--white);
  border: 1px solid var(--ink-1000);
  color: var(--ink-1000);
  padding: 0.85rem 1.4rem;
}

.secondary:hover {
  background: var(--ink-1000);
  color: var(--paper-1000);
  border-color: var(--ink-1000);
}

.option {
  background: var(--white);
  border: 1px solid var(--paper-800);
  border-radius: var(--radius-md);
}

.option.selected {
  background: var(--white);
  border-color: var(--ink-1000);
  border-width: 1.5px;
}

.radio {
  border-color: var(--paper-700);
}

.option.selected .radio {
  border: 5px solid var(--ink-1000);
}

.option.selected .radio:after {
  background: var(--ink-1000);
}

.material-card:after,
.material-card.selected:after {
  background: var(--ink-1000);
  color: var(--paper-1000);
}

body.page-kupit-steklo .material-card .material-check {
  position: absolute;
  right: 9px;
  top: 9px;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: var(--ink-1000);
  color: #fff;
  font: 700 12px/21px Arial, Helvetica, sans-serif;
  text-align: center;
  line-height: 21px;
  z-index: 2;
  pointer-events: none;
}
body.page-kupit-steklo .material-card.selected:after {
  content: none !important;
  display: none !important;
  background: none !important;
  background-image: none !important;
}

.material-card strong {
  color: var(--ink-1000);
}

.material-card small {
  color: var(--ink-500);
}

.material-grid .swatch.photo {
  background: var(--paper-900);
}

.chosen-material,
.checkrow,
.corner,
.hole,
.laminate-builder,
.receiving-summary,
.summary-block {
  background: var(--paper-900);
  border-color: var(--paper-800);
  border-radius: var(--radius-md);
}

.hole.active,
.corner.active {
  background: var(--white);
  border-color: var(--ink-1000);
}

.notice {
  background: color-mix(in srgb, var(--brand-orange) 12%, var(--paper-1000));
  color: color-mix(in srgb, var(--ink-1000) 70%, var(--brand-orange));
  border-radius: var(--radius-md);
}

.notice.good {
  background: color-mix(in srgb, var(--brand-blue-sky) 14%, var(--paper-1000));
  color: var(--brand-blue-800);
}

.notice.error {
  background: #f8e8ea;
  color: #8a3038;
}

.field-error,
.error-list {
  color: #8a3038;
}

.review-list {
  color: color-mix(in srgb, var(--ink-1000) 65%, var(--brand-orange));
}

.badge {
  background: var(--accent-dim);
  color: var(--brand-orange);
  border-radius: var(--radius-sm);
  font-family: var(--ff-tech);
  font-size: 0.625rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.delete {
  color: #8a3038;
}

.price-line {
  color: var(--ink-500);
}

.price-line span:last-child,
.price-line b {
  color: var(--ink-1000);
}

.price-box button {
  background: var(--white);
  border: 1px solid var(--paper-800);
  color: var(--brand-orange);
}

.price-box strong {
  font-family: var(--ff-display);
  font-weight: 500;
  color: var(--ink-1000);
  letter-spacing: -0.02em;
}

.cart-thumb {
  background: linear-gradient(135deg, var(--paper-900), var(--paper-800));
  color: var(--ink-700);
  border: 1px solid var(--paper-800);
}

.total {
  color: var(--ink-1000);
  font-family: var(--ff-display);
  font-weight: 500;
}

/* ---------- Modal / toast ---------- */
/* Above fixed .site-header (100) and mega-menu (200) */
.modal {
  background: color-mix(in srgb, var(--ink-1000) 55%, transparent);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 320;
}

body.page-kupit-steklo .modal {
  z-index: 320 !important;
}

.modal-inner {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}

.close {
  background: var(--paper-900);
  color: var(--ink-500);
  border-radius: 999px;
}

.close:hover {
  color: var(--ink-1000);
  background: var(--paper-800);
}

#toast {
  background: var(--ink-1000);
  color: var(--paper-1000);
  border-radius: 999px;
  font-family: var(--ff-tech);
  font-size: var(--fs-xs);
  letter-spacing: var(--tracking-tech);
  text-transform: uppercase;
}

.nav-bottom {
  background: var(--white);
  border-top-color: var(--paper-800);
}

/* ---------- Preview ---------- */
.preview-head > div {
  background: var(--paper-900);
  border-radius: var(--radius-sm);
}

.preview-head button {
  color: var(--ink-500);
}

.preview-head button.selected {
  background: var(--white);
  color: var(--ink-1000);
  box-shadow: 0 1px 3px rgba(7, 13, 18, 0.08);
}

.preview-meta span {
  background: var(--paper-900);
  color: var(--ink-500);
  border-radius: var(--radius-sm);
}

#drawing {
  background-color: var(--paper-900);
  background-image: radial-gradient(
    color-mix(in srgb, var(--ink-300) 45%, transparent) 1px,
    transparent 1px
  );
  background-size: 18px 18px;
  border: 1px solid var(--paper-800);
  border-radius: var(--radius-md);
}

.shape svg,
.shape-menu-card svg {
  fill: color-mix(in srgb, var(--brand-blue-sky) 18%, var(--paper-900));
  stroke: var(--brand-blue-700);
}

.stack-glass {
  background: linear-gradient(
    100deg,
    color-mix(in srgb, var(--brand-blue-sky) 35%, var(--paper-900)),
    color-mix(in srgb, var(--brand-blue-sky) 18%, var(--white))
  );
  color: var(--ink-800);
}

.stack-glass small {
  color: var(--ink-500);
}

.stack-section {
  border-color: var(--paper-700);
}

.stack-film {
  background: var(--ink-1000);
}

.pattern svg {
  background: var(--paper-900);
}

.bottom-info strong {
  color: var(--ink-1000);
  font-family: var(--ff-body);
}

.bottom-info p {
  color: var(--ink-500);
}

footer {
  border-top: var(--hairline);
  color: var(--ink-500);
  font-family: var(--ff-tech);
  font-size: 0.625rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

footer a:hover {
  color: var(--brand-orange);
}

/* ---------- Paint / RAL ---------- */
.paint-builder {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--paper-800);
}

.paint-methods {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 8px;
}

.paint-colors {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.paint-color {
  padding: 8px;
  border: 1px solid var(--paper-800);
  border-radius: var(--radius-md);
  background: var(--white);
  color: var(--ink-1000);
  text-align: left;
  min-width: 0;
}

.paint-color > span {
  display: block;
  height: 42px;
  border: 1px solid color-mix(in srgb, var(--ink-1000) 12%, transparent);
  border-radius: var(--radius-sm);
  margin-bottom: 7px;
}

.paint-color strong {
  display: block;
  font-size: 10px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.paint-color small {
  color: var(--ink-500);
  font-size: 9px;
}

.paint-color.selected {
  border: 1.5px solid var(--ink-1000);
  padding: 7px;
  background: var(--accent-soft);
}

.paint-color:hover {
  border-color: var(--ink-1000);
}

.ral-row {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  margin-top: 4px;
}

.ral-swatch {
  width: 96px;
  height: 96px;
  border-radius: var(--radius-md);
  border: 1px solid var(--paper-800);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink-1000) 6%, transparent);
  background: var(--paper-900);
}

.ral-swatch.unknown {
  background: repeating-linear-gradient(
    -45deg,
    var(--paper-900),
    var(--paper-900) 8px,
    var(--paper-800) 8px,
    var(--paper-800) 16px
  );
}

.ral-meta {
  margin-top: 8px;
}

.ral-meta strong {
  display: block;
  font-size: 14px;
  color: var(--ink-1000);
}

.ral-meta small {
  display: block;
  margin-top: 2px;
  color: var(--ink-500);
  font-size: 12px;
  line-height: 1.4;
}

.color-sample-label {
  position: absolute;
  bottom: 8px;
  left: 8px;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--ink-1000) 78%, transparent);
  padding: 5px 8px;
  font-size: 10px;
  color: var(--paper-1000);
}

.colored-swatch {
  position: relative;
}

.lacobel-request {
  margin-top: 20px;
}

.lacobel-request summary {
  color: var(--ink-500);
  line-height: 1.6;
}

.request-factory {
  margin-top: 12px;
}

/* ---------- Construction illustrations ---------- */
.summary-block .price-line span:last-child {
  white-space: normal;
  text-align: right;
  overflow-wrap: anywhere;
  min-width: 0;
}

.price-box strong {
  overflow-wrap: anywhere;
}

.price-line b {
  flex-shrink: 0;
}

.construction-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  overflow: hidden;
}

.construction-illustration {
  display: block;
  width: 100%;
  height: 116px;
  margin: 0 auto 5px;
  flex-shrink: 0;
}

.construction-illustration .glass-face {
  fill: var(--brand-blue-sky);
  fill-opacity: 0.28;
  stroke: var(--brand-blue-700);
  stroke-width: 1.5;
  stroke-linejoin: round;
}

.construction-illustration .glass-side {
  fill: var(--brand-navy);
  fill-opacity: 0.55;
  stroke: var(--brand-blue-sky);
  stroke-width: 1;
  stroke-linejoin: round;
}

.construction-illustration .glass-shine {
  fill: none;
  stroke: var(--paper-1000);
  stroke-opacity: 0.7;
  stroke-width: 2;
  stroke-linecap: round;
}

.construction-illustration .film-face {
  fill: var(--brand-orange);
  fill-opacity: 0.75;
  stroke: var(--brass-500);
  stroke-width: 1.3;
  stroke-linejoin: round;
}

.construction-legend {
  font-size: 11px;
  color: var(--ink-500);
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 18px;
}

.construction-legend i {
  width: 13px;
  height: 4px;
  border-radius: 2px;
  background: var(--ink-1000);
  display: inline-block;
}

.construction-card:first-child:after {
  content: '';
  height: 18px;
  order: 1;
}

.construction-card:first-child strong,
.construction-card:first-child small {
  order: 2;
}

.construction-card strong {
  margin-top: 10px;
}

.construction-card:focus-visible {
  outline: 2px solid var(--ink-1000);
  outline-offset: 3px;
}

/* ---------- Number steppers ---------- */
.number-control {
  display: flex;
  align-items: stretch;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  background: var(--white);
  border: 1px solid var(--paper-800);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.number-control:focus-within {
  border-color: color-mix(in srgb, var(--brand-orange) 55%, var(--paper-800));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-orange) 16%, transparent);
}

.number-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  min-width: 40px;
  min-height: 44px;
  flex-shrink: 0;
  padding: 0;
  background: var(--paper-900);
  border: 0;
  color: var(--ink-500);
  font-size: 20px;
  font-weight: 600;
  line-height: 1;
}

.number-button:hover {
  background: var(--paper-800);
  color: var(--ink-1000);
}

.number-button:active {
  color: var(--brand-orange);
}

.number-button:focus-visible {
  outline: 2px solid var(--ink-1000);
  outline-offset: -3px;
}

.number-control input,
.primary-sizes .number-control input,
.size-field .number-control input {
  flex: 1;
  min-width: 0;
  width: 0;
  min-height: 44px;
  padding: 8px 4px;
  border: 0;
  border-left: 1px solid var(--paper-800);
  border-right: 1px solid var(--paper-800);
  border-radius: 0;
  background: var(--white);
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  font-variant-numeric: tabular-nums;
  appearance: textfield;
  -moz-appearance: textfield;
}

.number-control input:focus,
.primary-sizes .number-control input:focus,
.size-field .number-control input:focus {
  outline: none;
  box-shadow: none;
}

.number-control input::-webkit-inner-spin-button,
.number-control input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.unit:has(.number-control) {
  display: flex;
  align-items: center;
  gap: 7px;
}

.unit:has(.number-control) > span {
  position: static;
  flex-shrink: 0;
  font-size: 12px;
}

.number-control input::placeholder {
  font-size: 11px;
}

.row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.primary-sizes,
.extra-sizes {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.row > * {
  min-width: 0;
}

.number-control {
  min-width: 140px;
}

.number-control input,
.primary-sizes .number-control input,
.size-field .number-control input {
  min-width: 60px;
}

.number-button {
  width: 36px;
  min-width: 36px;
}

.corner .row {
  grid-template-columns: 1fr;
  gap: 7px;
}

.corner .row .helper {
  margin: 0;
}

.hole-grid {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.hole-grid > div {
  min-width: 0;
}

.corners {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.weight-summary {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 24px;
  margin: 12px 0 8px;
  padding: 12px 14px;
  border: 1px solid var(--paper-800);
  border-radius: var(--radius-md);
  background: var(--paper-900);
  text-align: center;
}

.weight-summary > div {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.weight-summary span {
  font-size: 12px;
  color: var(--ink-500);
}

.weight-summary strong {
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  color: var(--ink-1000);
}

.weight-summary small {
  flex-basis: 100%;
  font-size: 10px;
  color: var(--ink-500);
}

/* ---------- Bridge + FAQ (MSM sections) ---------- */
.msm-bridge {
  margin: 28px 0 8px;
  padding: 1.25rem 1.35rem;
  border: 1px solid var(--paper-800);
  border-radius: var(--radius-lg);
  background: var(--white);
  display: flex;
  flex-wrap: wrap;
  gap: 14px 24px;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 12px 32px -28px rgba(7, 13, 18, 0.16);
}

.msm-bridge p {
  margin: 0;
  max-width: 52ch;
  color: var(--ink-500);
  font-size: 0.9375rem;
  line-height: 1.55;
}

.msm-bridge a {
  color: var(--brand-orange);
  text-decoration: none;
  font-weight: 600;
  white-space: nowrap;
  font-family: var(--ff-body);
}

.msm-bridge a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.msm-faq {
  margin: 36px 0 12px;
  padding: 1.75rem 1.35rem;
  border: 1px solid var(--paper-800);
  border-radius: var(--radius-lg);
  background: var(--white);
  box-shadow: 0 12px 32px -28px rgba(7, 13, 18, 0.16);
}

.msm-faq h2 {
  margin: 0 0 1.1rem;
  font-size: clamp(1.25rem, 2vw, 1.5rem);
}

.msm-faq details {
  border-top: 1px solid var(--paper-800);
  padding: 0.85rem 0;
}

.msm-faq details:first-of-type {
  border-top: 0;
}

.msm-faq summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--ink-1000);
  font-family: var(--ff-body);
  font-size: 0.95rem;
}

.msm-faq details p {
  margin: 0.65rem 0 0;
  color: var(--ink-500);
  line-height: 1.6;
  max-width: 70ch;
}

summary {
  color: var(--brand-orange);
}

.more-shapes summary {
  color: var(--brand-orange);
  font-weight: 700;
}

.editing {
  color: var(--brand-orange);
}

.dimension-target:focus line:last-of-type {
  stroke: var(--brand-orange);
  stroke-width: 4;
}

.primary-sizes input:focus,
.size-field input:focus {
  outline: 2px solid color-mix(in srgb, var(--brand-orange) 45%, transparent);
  outline-offset: 2px;
}

.shape-menu-card:focus-visible {
  outline: 3px solid var(--ink-1000);
  outline-offset: 2px;
}

.empty-preview .empty-mark {
  color: var(--ink-300);
}

.empty-preview strong {
  color: var(--ink-1000);
}

/* ---------- Responsive ---------- */
@media (max-width: 850px) {
  h1 {
    font-size: clamp(1.85rem, 6vw, 2.5rem);
  }

  .paint-colors {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .msm-word {
    font-size: 1.2rem;
  }

  header .header-right a.test {
    display: inline;
  }
}

@media (max-width: 640px) {
  html {
    scroll-padding-bottom: calc(168px + env(safe-area-inset-bottom, 0px));
  }

  /* Do not clamp fixed .site-header — Place leftover `header{}` target */
  header:not(.site-header) {
    height: 72px;
  }

  .msm-mark {
    width: 29px;
    height: 29px;
    gap: 2px;
  }

  .msm-word {
    font-size: 1.05rem;
  }

  .brand small {
    font-size: 0.5rem;
  }

  .brand {
    gap: 8px;
  }

  main {
    padding-top: 1.4rem;
  }

  .settings {
    padding: 1.25rem 1.25rem 1.75rem;
  }

  #mobileTools {
    background: var(--white);
    border-color: var(--paper-800);
    box-shadow: 0 -8px 28px -12px rgba(7, 13, 18, 0.18);
    z-index: 50;
    pointer-events: none;
  }

  #mobileTools > * {
    pointer-events: auto;
  }

  .mobile-total strong {
    color: var(--ink-1000);
    font-family: var(--ff-display);
  }

  .nav-bottom {
    background: var(--white);
  }

  .nav-bottom .primary {
    display: none;
  }

  .paint-color > span {
    height: 44px;
  }

  .paint-color strong {
    font-size: 12px;
  }

  .paint-color small {
    font-size: 10px;
  }

  .ral-row {
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 12px;
  }

  .ral-swatch {
    width: 72px;
    height: 72px;
    border-radius: 10px;
  }

  button,
  a,
  .chip,
  .number-button {
    scroll-margin-bottom: calc(148px + env(safe-area-inset-bottom, 0px));
  }

  .modal {
    z-index: 320;
  }

  body:has(#modal:not([hidden])) #mobileTools {
    display: none !important;
  }

  .msm-bridge {
    align-items: flex-start;
  }

  .msm-bridge a {
    white-space: normal;
  }

  .row {
    grid-template-columns: 1fr;
  }

  .primary-sizes,
  .extra-sizes {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }

  .construction-grid {
    gap: 9px;
  }

  .construction-illustration {
    height: 90px;
  }

  .construction-legend {
    font-size: 10px;
    line-height: 1.4;
  }

  .construction-card strong {
    font-size: 15px;
  }

  .construction-card small {
    font-size: 11px;
  }

  .number-button {
    width: 36px;
    min-width: 36px;
  }
}

@media (max-width: 480px) {
  .corners {
    grid-template-columns: 1fr;
  }
}

@media print {
  /* Beat site-chrome `display:block !important` on header/footer */
  body.page-kupit-steklo > *:not(.print-only),
  body.page-kupit-steklo > header.site-header,
  body.page-kupit-steklo > footer.site-footer,
  body.page-kupit-steklo .msm-calc-cart,
  body.page-kupit-steklo .modal,
  body.page-kupit-steklo .mobile-drawer,
  body.page-kupit-steklo .mega-menu,
  body.page-kupit-steklo .mega-menu--v2,
  body.page-kupit-steklo #toast,
  body.page-kupit-steklo #mobileTools,
  body.page-kupit-steklo .scroll-top {
    display: none !important;
    visibility: hidden !important;
  }

  body.page-kupit-steklo,
  body.page-kupit-steklo > .print-only {
    display: block !important;
    visibility: visible !important;
    padding: 0 !important;
    margin: 0 !important;
    background: white !important;
    color: #0a121c !important;
  }

  .print-only {
    color: var(--ink-1000);
    background: white;
    position: static !important;
    inset: auto !important;
    width: 100% !important;
    max-width: none !important;
    box-shadow: none !important;
  }

  .print-only h1,
  .print-only h2,
  .print-only .price-line span,
  .print-only .total {
    color: var(--ink-1000);
  }

  .print-only .summary-block {
    background: white;
    border-color: #bbb;
  }

  .print-only small,
  .print-only .helper,
  .print-only .print-note,
  .print-doc-head span,
  .print-doc-meta span {
    color: var(--ink-500);
  }

  .print-drawing {
    background: #f6f8f4;
    border-color: #ddd;
  }
}

/* ========== Swiss / Сценарии final overrides (win over Place style.css) ========== */
body.page-kupit-steklo .settings,
body.page-kupit-steklo .preview,
body.page-kupit-steklo .modal-inner {
  box-shadow: none;
  border: 1px solid var(--paper-800);
  background: var(--white);
}

body.page-kupit-steklo .chip.selected,
body.page-kupit-steklo .material-kinds .chip.selected {
  background: var(--ink-1000) !important;
  color: var(--paper-1000) !important;
  border-color: var(--ink-1000) !important;
}

body.page-kupit-steklo .material-card.selected,
body.page-kupit-steklo .construction-card.selected,
body.page-kupit-steklo .shape.selected,
body.page-kupit-steklo .shape-menu-card.selected,
body.page-kupit-steklo .pattern.selected {
  background: var(--white) !important;
  border: 1.5px solid var(--ink-1000) !important;
  box-shadow: none !important;
}

body.page-kupit-steklo .material-card .material-check {
  position: absolute;
  right: 9px;
  top: 9px;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: var(--ink-1000);
  color: #fff;
  font: 700 12px/21px Arial, Helvetica, sans-serif;
  text-align: center;
  line-height: 21px;
  z-index: 2;
  pointer-events: none;
}
body.page-kupit-steklo .material-card.selected:after {
  content: none !important;
  display: none !important;
  background: none !important;
  background-image: none !important;
}

body.page-kupit-steklo .option.selected {
  background: var(--white) !important;
  border-color: var(--ink-1000) !important;
}

body.page-kupit-steklo .paint-color.selected {
  border: 1.5px solid var(--ink-1000) !important;
  background: var(--white) !important;
  padding: 8px;
}

body.page-kupit-steklo .number-control:focus-within {
  border-color: var(--ink-1000);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ink-1000) 8%, transparent);
}

body.page-kupit-steklo .number-button:active,
body.page-kupit-steklo .number-button:focus-visible {
  color: var(--ink-1000);
  outline-color: var(--ink-1000);
}

body.page-kupit-steklo nav#steps button.active,
body.page-kupit-steklo #steps button.active {
  background: var(--ink-1000);
  color: var(--paper-1000);
}

body.page-kupit-steklo .step-label,
body.page-kupit-steklo .eyebrow,
body.page-kupit-steklo .preview-head > span,
body.page-kupit-steklo .bottom-info > div > span,
body.page-kupit-steklo .intro-note > span {
  color: var(--ink-500);
}

body.page-kupit-steklo .eyebrow::before {
  content: '';
  display: inline-block;
  width: 1.25rem;
  height: 2px;
  margin-right: 0.55rem;
  vertical-align: middle;
  background: linear-gradient(90deg, var(--brand-orange), var(--brand-blue-700));
}

body.page-kupit-steklo .badge {
  background: var(--paper-900);
  color: var(--ink-500);
}

body.page-kupit-steklo .msm-bridge a,
body.page-kupit-steklo summary,
body.page-kupit-steklo .more-shapes summary,
body.page-kupit-steklo .editing {
  color: var(--ink-1000);
}

body.page-kupit-steklo .msm-bridge a:hover {
  color: var(--brand-orange);
}

body.page-kupit-steklo .shape svg,
body.page-kupit-steklo .shape-menu-card svg {
  stroke: var(--ink-700);
  fill: color-mix(in srgb, var(--ink-300) 22%, var(--paper-900));
}

body.page-kupit-steklo .stack-film {
  background: var(--ink-500);
}

body.page-kupit-steklo .construction-legend i {
  background: var(--ink-500);
}

body.page-kupit-steklo .construction-illustration .film-face {
  fill: var(--ink-500);
  stroke: var(--ink-700);
}

body.page-kupit-steklo .primary-sizes input:focus,
body.page-kupit-steklo .size-field input:focus,
body.page-kupit-steklo .dimension-target:focus line:last-of-type {
  outline-color: var(--ink-1000);
  stroke: var(--ink-1000);
}

body.page-kupit-steklo .shape-menu-card:focus-visible,
body.page-kupit-steklo .construction-card:focus-visible {
  outline-color: var(--ink-1000);
}

body.page-kupit-steklo #toast {
  background: var(--ink-1000);
  color: var(--paper-1000);
}

