/* Калькулятор Games Board. Цвета и шрифт от сайта games-board.ru: акцент #ba4f0c, текст #333, Roboto.
   Встраивается в страницу сайта после assets/css/styles.css: правила на теги ограничены областью калькулятора,
   шрифт Roboto подключает сайт (на стенде: stand.css). */

:root {
  --accent: #ba4f0c;
  --accent-hover: #a9470a;
  --accent-soft: #fdf2ea;
  --accent-line: #f3d2bd;
  --text: #2b2b2b;
  --text-2: #565a61;
  --muted: #6a6e75;
  --line: #e2e4e8;
  --line-strong: #c9cdd4;
  --bg: #ffffff;
  --bg-soft: #f6f7f9;
  --ok: #1d7a46;
  --ok-soft: #e8f5ee;
  --err: #c42a1b;
  --err-soft: #fdeeec;
  --warn: #7a5200;
  --warn-soft: #fff5dc;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 4px 16px rgba(16, 24, 40, .06);
  --head-h: 72px;
  --mbar-h: 0px;
  --focus: 0 0 0 3px #fff, 0 0 0 5px #1f5fd6;
}

/* только внутри калькулятора: псевдоэлементы шапки и подвала сайта остаются как на других страницах */
:where(.calc, .mbar, .msheet, .msheet-back, .dlg, .print-spec, .skip), :where(.calc, .mbar, .msheet, .dlg, .print-spec) *,
:where(.calc, .mbar, .msheet, .dlg, .print-spec) *::before, :where(.calc, .mbar, .msheet, .dlg, .print-spec) *::after,
:where(.calc, .mbar, .msheet, .dlg, .print-spec)::before, :where(.calc, .mbar, .msheet, .dlg, .print-spec)::after { box-sizing: border-box; }
/* --top-pdd задаёт сайт: высота его закреплённой шапки */
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--top-pdd, var(--head-h)) + 16px); scroll-padding-bottom: calc(var(--mbar-h) + 16px); }
/* Правила на теги только внутри калькулятора (:where не повышает вес, классы калькулятора сильнее).
   Они же гасят сброс стилей сайта: отступы у section и p, серый цвет label, списки без маркеров. */
/* корни калькулятора с весом класса: сброс сайта ставит div { font: inherit } и иначе отдал бы межстрочный 1 от body */
.calc, .mbar, .msheet, .dlg, .print-spec { font-family: "Roboto", system-ui, -apple-system, "Segoe UI", sans-serif; font-size: 16px; line-height: 1.5; color: var(--text); }
:where(.calc, .mbar, .msheet, .dlg, .print-spec) img { max-width: 100%; height: auto; display: block; }
:where(.calc, .mbar, .msheet, .dlg, .print-spec) a { color: var(--accent); }
:where(.calc, .mbar, .msheet, .dlg, .print-spec) a:hover { color: var(--accent-hover); }
:where(.calc, .mbar, .msheet, .dlg) :is(button, input, select, textarea) { font: inherit; color: inherit; }
:where(.calc, .mbar, .msheet, .dlg, .print-spec) :is(h1, h2, h3, h4) { margin: 0; line-height: 1.2; font-weight: 700; overflow-wrap: anywhere; hyphens: auto; }
:where(.calc, .mbar, .msheet, .dlg, .print-spec) :is(b, strong) { font-weight: 700; }
:where(.calc, .mbar, .msheet, .dlg, .print-spec) p { margin: 0; line-height: inherit; }
:where(.calc, .mbar, .msheet, .dlg, .print-spec) section { min-width: 0; padding: 0; position: static; }
:where(.calc, .mbar, .msheet, .dlg) label { color: inherit; }
:where(.calc, .msheet, .dlg, .print-spec) :is(ul, ol) { list-style: revert; }
:where(.calc, .mbar, .msheet, .dlg) :focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }
/* атрибут hidden сильнее сброса стилей сайта (section { display: block } перебивает браузерное правило) */
:where(.calc, .mbar, .msheet, .dlg) [hidden], .msheet[hidden], .msheet-back[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; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 1000; background: var(--accent); color: #fff; padding: 10px 16px; border-radius: 8px; }
.skip:focus { top: 12px; color: #fff; }
/* Ширина и боковые отступы задаются общим контейнером .pocket сайта. */
.muted { color: var(--muted); }
.accent { color: var(--accent); }
.ic { display: inline-block; width: 24px; height: 24px; flex: none; background: currentColor;
  -webkit-mask: var(--ic) center / contain no-repeat; mask: var(--ic) center / contain no-repeat; }
/* картинка компонента, загруженная в админке, вместо значка */
.ic.ic-img { background: none; -webkit-mask: none; mask: none; object-fit: contain; border-radius: 4px; }

/* ── шапка как на сайте ── */
.site-head { position: sticky; top: 0; z-index: 30; background: #fff; border-bottom: 1px solid var(--line); }
.head-row { display: flex; align-items: center; gap: 24px; min-height: var(--head-h); }
.logo { display: flex; flex-direction: column; gap: 2px; text-decoration: none; flex: none; }
.logo img { width: 141px; height: 33px; }
.logo-tag { font-size: 12px; color: var(--text-2); line-height: 1.2; }
.head-nav { display: none; gap: 26px; margin-left: 16px; }
.head-nav a { color: var(--text); text-decoration: none; font-weight: 500; padding: 10px 0; border-bottom: 2px solid transparent; }
.head-nav a:hover { color: var(--accent); }
.head-nav a.is-current { color: var(--accent); border-bottom-color: var(--accent); }
.head-tools { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.link-btn { display: none; background: none; border: 0; padding: 10px 12px; min-height: 44px; cursor: pointer; font-weight: 500; color: var(--text); }
.link-btn:hover { color: var(--accent); }
.help-btn { display: inline-flex; align-items: center; gap: 8px; background: none; border: 1px solid var(--line); border-radius: 999px; min-height: 44px; min-width: 44px; padding: 0 12px; cursor: pointer; color: var(--text-2); }
.help-btn:hover { border-color: var(--accent); color: var(--accent); }
.help-txt { display: none; }

/* ── сетка страницы ── */
.calc { display: block; padding-top: 24px; padding-bottom: 48px; }
.calc-main { min-width: 0; }
.title-block h1 { font-size: clamp(28px, 2.2vw + 18px, 46px); font-weight: 700; letter-spacing: -.01em; }
.title-tools { display: flex; flex-wrap: wrap; gap: 0 20px; margin-top: 6px; }
.title-tools .link-btn { display: inline-flex; align-items: center; padding: 0; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.title-tools .link-btn:hover { color: var(--accent-hover); }
.head-phone { color: var(--text); text-decoration: none; font-weight: 500; white-space: nowrap; min-height: 44px; display: inline-flex; align-items: center; }
.head-phone:hover { color: var(--accent); }
.title-block .lead { margin-top: 10px; color: var(--text-2); font-size: clamp(16px, .5vw + 14px, 20px); }
.loading { display: flex; align-items: center; gap: 12px; padding: 40px 0; color: var(--text-2); }
.spinner { width: 20px; height: 20px; border-radius: 50%; border: 3px solid var(--accent-line); border-top-color: var(--accent); animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── шаги ── */
.stepper { display: none; margin-top: 28px; }
.stepper ol { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 12px; }
.stepper li { display: flex; align-items: center; gap: 12px; flex: 1 1 auto; min-width: 0; }
.stepper li:last-child { flex: none; }
.stepper li:not(:last-child)::after { content: ""; flex: 1 1 auto; height: 2px; background: var(--line); min-width: 24px; }
.stepper li.done:not(:last-child)::after { background: var(--accent); }
.step-btn { display: inline-flex; align-items: center; gap: 10px; background: none; border: 0; padding: 4px 4px; min-height: 44px; cursor: pointer; color: var(--text-2); font-weight: 500; white-space: nowrap; border-radius: 10px; }
.step-btn[disabled] { cursor: default; }
.step-num { width: 40px; height: 40px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--bg-soft); border: 1px solid var(--line); font-weight: 500; flex: none; }
.step-btn[aria-current="step"] { color: var(--accent); }
.step-btn[aria-current="step"] .step-num { background: var(--accent); border-color: var(--accent); color: #fff; }
.done .step-num { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent); }
.done .step-num::before { content: ""; width: 16px; height: 16px; background: currentColor; -webkit-mask: url(img/icons/check.svg) center / contain no-repeat; mask: url(img/icons/check.svg) center / contain no-repeat; }
.done .step-num span { display: none; }
.step-btn:not([disabled]):hover { color: var(--accent); }

.mobile-progress { margin-top: 18px; }
.mp-bars { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.mp-bars span { height: 5px; border-radius: 3px; background: var(--line); }
.mp-bars span.on { background: var(--accent); }
.mp-row { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; color: var(--text-2); font-size: 15px; }

.context { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 8px; }
.context:empty { display: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--bg-soft); border: 1px solid var(--line); font-size: 14px; color: var(--text-2); max-width: 100%; }
.chip b { color: var(--text); font-weight: 500; }

.banner-slot:empty { display: none; }
.notice { margin-top: 16px; padding: 14px 16px; border-radius: var(--radius-sm); background: var(--bg-soft); border: 1px solid var(--line); display: flex; gap: 12px; align-items: flex-start; }
.notice .ic { color: var(--text-2); margin-top: 1px; }
.notice-info { background: #eef4fd; border-color: #cfdcf3; }
.notice-info .ic { color: #1f5fd6; }
.notice-warn { background: var(--warn-soft); border-color: #f0dca6; color: var(--warn); }
.notice-warn .ic { color: var(--warn); }
.notice-err { background: var(--err-soft); border-color: #f2c4bd; color: var(--err); }
.notice-ok { background: var(--ok-soft); border-color: #bfe3cc; color: var(--ok); }
.notice b { color: inherit; }
.notice .notice-actions { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 8px; }

/* ── секции шага ── */
.step { margin-top: 26px; }
.step > h2 { font-size: clamp(24px, 1.2vw + 18px, 36px); font-weight: 700; }
.sec { margin-top: 28px; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.sec h3 { font-size: 20px; font-weight: 700; }
.sec .sec-sub { color: var(--text-2); margin-top: 6px; }
:where(.calc, .msheet, .dlg) fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
:where(.calc, .msheet, .dlg) legend { padding: 0; }

/* карточки выбора (радио) */
.choices { display: grid; gap: 12px; margin-top: 14px; grid-template-columns: 1fr; }
.choice { position: relative; display: flex; gap: 14px; align-items: flex-start; padding: 16px; border: 1.5px solid var(--line); border-radius: var(--radius); background: #fff; cursor: pointer; min-height: 64px; transition: border-color .15s, background .15s; }
.choice:hover { border-color: var(--line-strong); }
.choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choice:focus-within { box-shadow: var(--focus); }
.choice .ic { width: 32px; height: 32px; color: var(--accent); margin-top: 2px; }
.choice-t { display: block; font-weight: 700; font-size: 17px; line-height: 1.3; }
.choice-h { display: block; color: var(--text-2); font-size: 15px; margin-top: 2px; }
.choice-why { display: block; }
.choice.is-on { border-color: var(--accent); background: var(--accent-soft); }
.choice .tick { position: absolute; top: 12px; right: 12px; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: #fff; display: none; place-items: center; }
.choice .tick::before { content: ""; width: 14px; height: 14px; background: #fff; -webkit-mask: url(img/icons/check.svg) center / contain no-repeat; mask: url(img/icons/check.svg) center / contain no-repeat; }
.choice.is-on .tick { display: grid; }
.choice.is-off { cursor: not-allowed; opacity: .55; }
.choice.is-off:hover { border-color: var(--line); }
.choice-body { min-width: 0; padding-right: 26px; }
.choice-why { font-size: 14px; color: var(--warn); margin-top: 6px; }

/* сетка типов игр */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.fbtn { min-height: 44px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-size: 15px; }
.fbtn[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: #fff; }
/* поиск по типам игр: поле и фильтры одной строкой, на телефоне поле во всю ширину */
.tbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; margin-top: 14px; }
.tbar .filters { margin-top: 0; min-width: 0; max-width: 100%; }
.tsearch { position: relative; flex: 1 1 260px; max-width: 420px; }
.tsearch .tsearch-ic { position: absolute; left: 14px; top: 50%; width: 20px; height: 20px; margin-top: -10px; color: var(--muted); pointer-events: none; }
.tsearch .tsearch-in { min-height: 44px; padding: 9px 46px 9px 44px; border-radius: 999px; }
.tsearch-in::-webkit-search-cancel-button, .tsearch-in::-webkit-search-decoration { -webkit-appearance: none; appearance: none; }
.tsearch-x { position: absolute; top: 0; right: 0; width: 44px; height: 100%; min-height: 44px; border: 0; border-radius: 999px; background: none; color: var(--muted); font-size: 24px; line-height: 1; cursor: pointer; }
.tsearch-x:hover { color: var(--text); }
.tsearch-st { margin: 10px 0 0; font-size: 14px; color: var(--muted); }
.tsearch-st:empty { margin: 0; }
.tsearch-all { min-height: 44px; padding: 0 4px; border: 0; background: none; color: var(--accent); font: inherit; font-weight: 500; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.tsearch-all:hover { color: var(--accent-hover); }
.types { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.type { position: relative; display: flex; flex-direction: column; border: 1.5px solid var(--line); border-radius: var(--radius); background: #fff; cursor: pointer; overflow: hidden; text-align: left; transition: border-color .15s, box-shadow .15s; }
.type:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.type input { position: absolute; opacity: 0; width: 1px; height: 1px; }
/* шаблон не подходит выбранной задаче */
.type.is-off { cursor: not-allowed; border-style: dashed; }
.type.is-off .type-img { opacity: .45; }
.type.is-off:hover { border-color: var(--line); box-shadow: none; }
.type:focus-within { box-shadow: var(--focus); }
.type-img { aspect-ratio: 5 / 4; background: #fff; display: grid; place-items: center; }
.type-img img { width: 100%; height: 100%; object-fit: cover; }
.type-img.noimg { background: var(--bg-soft); color: var(--accent); }
.type-img.noimg .ic { width: 44px; height: 44px; }
.type-t { padding: 10px 12px 2px; font-weight: 700; font-size: 15px; line-height: 1.25; overflow-wrap: anywhere; hyphens: auto; }
.type-f { padding: 0 12px 12px; font-size: 13px; color: var(--muted); }
.type.is-on { border-color: var(--accent); background: var(--accent-soft); }
.type .tick { position: absolute; top: 10px; right: 10px; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); display: none; place-items: center; box-shadow: 0 0 0 3px #fff; }
.type .tick::before { content: ""; width: 15px; height: 15px; background: #fff; -webkit-mask: url(img/icons/check.svg) center / contain no-repeat; mask: url(img/icons/check.svg) center / contain no-repeat; }
.type.is-on .tick { display: grid; }

/* поля */
.grid2 { display: grid; grid-template-columns: 1fr; gap: 16px 20px; margin-top: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .field > .lbl { font-weight: 500; font-size: 15px; }
.field .hint { font-size: 14px; color: var(--muted); }
.req::after { content: " *"; color: var(--err); }
.input, .select, textarea.input { width: 100%; min-height: 48px; padding: 11px 14px; border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm); background: #fff; font-size: 16px; }
textarea.input { min-height: 96px; resize: vertical; }
.select { appearance: none; -webkit-appearance: none; padding-right: 42px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23565a61' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.input:hover, .select:hover { border-color: #aeb3bb; }
.input:focus, .select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); outline: none; }
.input[aria-invalid="true"], .select[aria-invalid="true"] { border-color: var(--err); background: #fffafa; }
.field-err { color: var(--err); font-size: 14px; display: flex; gap: 6px; align-items: flex-start; }
.field-err:empty { display: none; }
.field-err:not(:empty) { margin-top: 10px; padding: 10px 12px; border-radius: 8px; background: var(--err-soft); border: 1px solid #f2c4bd; border-left: 4px solid var(--err); font-size: 15px; font-weight: 500; }
.sec.has-error .choice, .sec.has-error .type { border-color: #e48b7f; }
.step-errors { margin-top: 28px; padding: 14px 16px; border-radius: 12px; background: var(--err-soft); border: 1px solid #f2c4bd; border-left: 4px solid var(--err); color: var(--err); }
.step-errors[hidden] { display: none; }
.step-errors ul { margin: 6px 0 0; padding-left: 20px; }
.link-err { background: none; border: 0; padding: 0; min-height: 44px; color: var(--err); text-decoration: underline; cursor: pointer; font: inherit; font-weight: 500; text-align: left; }
.field-err::before { content: "!"; flex: none; width: 18px; height: 18px; border-radius: 50%; background: var(--err); color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center; margin-top: 1px; }
.field-note { font-size: 14px; color: var(--text-2); background: var(--bg-soft); border-radius: 8px; padding: 8px 10px; }
.field-note:empty { display: none; }

.stepper-input { display: flex; align-items: stretch; border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm); background: #fff; overflow: hidden; }
.stepper-input:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.stepper-input.is-invalid { border-color: var(--err); }
.stepper-input button { flex: none; width: 52px; min-height: 48px; border: 0; background: var(--bg-soft); cursor: pointer; font-size: 22px; line-height: 1; color: var(--text); }
.stepper-input button:hover { background: #eceef2; }
.stepper-input button:disabled { color: #b3b7be; cursor: default; }
.stepper-input input { flex: 1 1 auto; min-width: 0; border: 0; text-align: center; font-size: 17px; padding: 0 8px; background: transparent; }
.stepper-input input:focus { outline: none; }
.with-unit { position: relative; }
.unit { font-size: 14px; color: var(--muted); }
.inline { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* у сайта свои правила для любого label с флажком (label:has(input[type=checkbox]): кегль 13px, отступы 1rem):
   правила флажков калькулятора сильнее за счёт родителя */
:is(.calc, .msheet, .dlg) .check { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; min-height: 44px; padding: 10px 0; margin: 0; font-size: inherit; line-height: inherit; color: inherit; }
:is(.calc, .msheet, .dlg) .check input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--accent); flex: none; }
.check span { min-width: 0; }
.check small { display: block; color: var(--muted); font-size: 14px; }

.qchips { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 10px; }
.qchip { min-height: 46px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: #fff; cursor: pointer; font-size: 16px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.qchip:hover { border-color: var(--line-strong); }
.qchip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 500; }
.qty-big .stepper-input input { font-size: 30px; font-weight: 700; }
.qty-big .stepper-input button { width: 64px; min-height: 64px; font-size: 26px; }

.swatches { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 8px; }
.swatch { position: relative; border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: #fff; cursor: pointer; overflow: hidden; display: flex; flex-direction: column; text-align: center; }
.swatch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.swatch:focus-within { box-shadow: var(--focus); }
.swatch-img { height: 56px; background: var(--bg-soft) center / cover no-repeat; }
.swatch-t { padding: 8px 6px; font-size: 14px; }
.swatch.is-on { border-color: var(--accent); }
.swatch.is-on .swatch-t { color: var(--accent); font-weight: 500; }
.swatch .tick { position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); display: none; place-items: center; }
.swatch .tick::before { content: ""; width: 12px; height: 12px; background: #fff; -webkit-mask: url(img/icons/check.svg) center / contain no-repeat; mask: url(img/icons/check.svg) center / contain no-repeat; }
.swatch.is-on .tick { display: grid; }

/* ── комплектация ── */
.kit-top { display: grid; gap: 16px; margin-top: 18px; grid-template-columns: 1fr; }
.preview { border-radius: var(--radius); background: #fff; border: 1px solid var(--line); overflow: hidden; }
.preview img { width: 100%; aspect-ratio: 5 / 4; object-fit: cover; }
.preview figcaption { padding: 10px 14px 12px; font-size: 14px; color: var(--text-2); border-top: 1px solid var(--line); }
.preview figcaption b { display: block; color: var(--text); font-size: 15px; }
.kit-facts { display: grid; gap: 10px; align-content: start; }
.fact { padding: 12px 14px; border-radius: var(--radius-sm); background: var(--bg-soft); }
.fact-t { font-size: 14px; color: var(--muted); }
.fact-v { font-weight: 500; margin-top: 2px; }
.fact.is-check .fact-v { color: var(--warn); }

.groups { margin-top: 22px; display: grid; gap: 12px; }
.cgroup { border: 1.5px solid var(--line); border-radius: var(--radius); background: #fff; }
.cgroup.has-conflict { border-color: #e9b3aa; }
.group-head { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.group-toggle { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 12px; background: none; border: 0; text-align: left; cursor: pointer; padding: 4px 0; min-height: 52px; }
.group-toggle .ic { width: 34px; height: 34px; color: var(--accent); }
.group-name { font-weight: 700; font-size: 17px; overflow-wrap: anywhere; }
.group-sum { color: var(--text-2); font-size: 14px; margin-top: 2px; overflow-wrap: anywhere; }
.group-toggle .chev { margin-left: auto; width: 22px; height: 22px; color: var(--text-2); transition: transform .2s; }
.cgroup.is-open .group-toggle .chev { transform: rotate(180deg); }
.group-sum { display: block; }
.badge[hidden] { display: none; }
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 500; padding: 3px 8px; border-radius: 999px; background: var(--err-soft); color: var(--err); margin-left: 8px; vertical-align: 2px; white-space: nowrap; }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-demo { background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent-line); }
.group-body { padding: 0 14px 16px; border-top: 1px solid var(--line); }
.group-body[hidden] { display: none; }
.detail-line { margin-top: 14px; font-size: 14px; color: var(--text-2); }
.detail-line b { color: var(--text); font-weight: 500; }
.detail-toggle { margin-top: 10px; display: inline-flex; align-items: center; gap: 8px; background: none; border: 0; padding: 8px 0; min-height: 44px; color: var(--accent); font-weight: 500; cursor: pointer; }
.detail-toggle .chev { width: 18px; height: 18px; transition: transform .2s; }
.detail-toggle[aria-expanded="true"] .chev { transform: rotate(180deg); }
.group-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--line); }
.conflicts { display: grid; gap: 10px; margin-top: 14px; }
.conflict { padding: 12px 14px; border-radius: var(--radius-sm); background: var(--err-soft); color: var(--err); }
.conflict p { color: var(--err); }
.conflict .notice-actions { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 8px; }
.total-line { margin-top: 12px; font-size: 15px; }
.total-line b { font-size: 17px; }
.add-row { margin-top: 14px; position: relative; }
.add-menu { margin-top: 10px; display: grid; gap: 8px; grid-template-columns: 1fr; }
.add-item { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 14px; border: 1.5px dashed var(--line-strong); border-radius: var(--radius-sm); background: #fff; cursor: pointer; text-align: left; }
.add-item:hover { border-color: var(--accent); }
.add-item .ic { color: var(--accent); width: 28px; height: 28px; }
.add-item small { display: block; color: var(--muted); font-size: 13px; }
.add-item[disabled] { opacity: .5; cursor: not-allowed; }
.rename { display: flex; gap: 8px; flex: 1 1 auto; }
.rename .input { min-height: 44px; }

/* ── кнопки ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 0 24px; border-radius: var(--radius-sm); border: 1.5px solid var(--accent); background: var(--accent); color: #fff; font-weight: 500; font-size: 17px; cursor: pointer; text-decoration: none; text-align: center; }
.btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.btn[disabled] { opacity: .6; cursor: progress; }
.btn .ic { width: 20px; height: 20px; }
.btn-ghost { background: #fff; color: var(--accent); }
.btn-ghost:hover { background: var(--accent-soft); color: var(--accent-hover); }
.btn-sm { min-height: 44px; padding: 0 14px; font-size: 15px; }
.btn-plain { min-height: 44px; padding: 0 12px; background: none; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; color: var(--text); display: inline-flex; align-items: center; gap: 8px; }
.btn-plain:hover { border-color: var(--accent); color: var(--accent); }
.btn-danger { color: var(--err); }
.btn-danger:hover { border-color: var(--err); color: var(--err); }
.step-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 34px; padding-top: 22px; border-top: 1px solid var(--line); }
.back-btn { display: inline-flex; align-items: center; gap: 10px; background: none; border: 0; min-height: 52px; padding: 0 8px; cursor: pointer; font-size: 17px; color: var(--text); }
.back-btn:hover { color: var(--accent); }
.arrow { width: 20px; height: 20px; }

/* ── правая смета ── */
.summary { display: none; }
.sum-card { background: var(--accent-soft); border: 1px solid var(--accent-line); border-radius: 18px; padding: 24px; }
.sum-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.sum-head h2 { font-size: 26px; }
.sum-sub { margin-top: 14px; font-size: 17px; }
.sum-sub b { font-weight: 500; }
.sum-sub .muted { display: block; font-size: 15px; margin-top: 2px; }
.sum-total { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--accent-line); transition: opacity .2s; }
.sum-total .amt { font-size: clamp(34px, 2vw + 18px, 52px); font-weight: 700; line-height: 1.05; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.sum-total .amt-range { font-size: clamp(26px, 1.4vw + 16px, 38px); }
.sum-total .cap { margin-top: 6px; color: var(--text-2); font-size: 15px; }
.sum-total.is-stale { opacity: .45; }
.sum-total.is-stale .amt { text-decoration: line-through; text-decoration-thickness: 2px; }
.recalc { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--accent); margin-top: 8px; }
.recalc .spinner { width: 14px; height: 14px; border-width: 2px; }
.sum-rows { margin-top: 18px; display: grid; gap: 10px; }
.sum-row { display: flex; justify-content: space-between; gap: 12px; font-size: 16px; }
.sum-row span:last-child { font-weight: 500; white-space: nowrap; font-variant-numeric: tabular-nums; }
.sum-units { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--accent-line); display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.sum-unit b { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.sum-unit span { display: block; color: var(--text-2); font-size: 14px; margin-top: 2px; }
.sum-note { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--accent-line); display: flex; gap: 10px; font-size: 14px; color: var(--text-2); }
.sum-note .ic { width: 20px; height: 20px; color: var(--text-2); }
.sum-unres { margin-top: 14px; font-size: 15px; color: var(--warn); background: var(--warn-soft); border-radius: 10px; padding: 10px 12px; }
.sum-err { margin-top: 14px; }
.sum-cta { margin-top: 18px; width: 100%; }
.sum-concept { margin-top: 12px; text-align: right; font-size: 13px; color: var(--muted); }

/* ── нижняя панель на телефоне ── */
.mbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: var(--accent-soft); border-top: 1px solid var(--accent-line); padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); box-shadow: 0 -6px 20px rgba(16, 24, 40, .08); }
.mbar[hidden] { display: none; }
.mbar.is-hidden { transform: translateY(110%); }
.mbar { transition: transform .2s; }
.mbar-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.mbar-cap { font-size: 13px; color: var(--accent); font-weight: 500; }
.mbar-amt { font-size: 26px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.mbar-amt.is-stale { opacity: .45; text-decoration: line-through; }
.mbar-sub { font-size: 13px; color: var(--text-2); }
.mbar-exp { flex: none; width: 44px; height: 44px; border: 0; background: none; color: var(--accent); cursor: pointer; display: grid; place-items: center; }
.mbar-exp .chev { width: 22px; height: 22px; transform: rotate(180deg); }
.mbar .btn { width: 100%; margin-top: 10px; min-height: 50px; }
.mbar-foot { text-align: center; font-size: 12px; color: var(--muted); margin-top: 6px; }
.msheet-back { position: fixed; inset: 0; background: rgba(16, 24, 40, .45); z-index: 44; }
.msheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; max-height: 86vh; overflow: auto; background: #fff; border-radius: 18px 18px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); }
.msheet .sum-card { border: 0; padding: 0; background: none; }
.msheet-close { float: right; }

/* ── расчёт ── */
.result-head { margin-top: 18px; padding: 22px; border-radius: 18px; background: var(--accent-soft); border: 1px solid var(--accent-line); }
.result-status { font-size: 15px; font-weight: 500; color: var(--accent); }
.result-amt { margin-top: 6px; font-size: clamp(34px, 2.4vw + 18px, 56px); font-weight: 700; line-height: 1.05; font-variant-numeric: tabular-nums; }
.result-meta { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px; }
.result-meta .chip { background: #fff; }
.result-units { margin-top: 16px; display: grid; gap: 12px; grid-template-columns: 1fr; }
.unit-tile { background: #fff; border-radius: 12px; padding: 12px 14px; border: 1px solid var(--accent-line); }
.unit-tile b { font-size: 24px; }
.unit-tile span { display: block; font-size: 14px; color: var(--text-2); }
.lines { margin-top: 22px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.lines-group { border-top: 1px solid var(--line); }
.lines-group:first-child { border-top: 0; }
.lines-gh { display: flex; justify-content: space-between; gap: 12px; padding: 14px 16px; background: var(--bg-soft); font-weight: 700; }
.line { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; padding: 12px 16px; border-top: 1px solid var(--line); }
.line-l { min-width: 0; overflow-wrap: anywhere; }
.line-q { grid-column: 1; font-size: 14px; color: var(--text-2); }
.line-inc { grid-column: 1 / -1; font-size: 13px; color: var(--muted); }
.line-a { grid-row: 1; grid-column: 2; text-align: right; font-weight: 500; white-space: nowrap; font-variant-numeric: tabular-nums; }
.line.is-manual .line-a { color: var(--warn); font-weight: 500; white-space: normal; max-width: 160px; }
.line.is-manual .line-reason { grid-column: 1 / -1; font-size: 14px; color: var(--warn); }
.lines-total { display: flex; justify-content: space-between; gap: 12px; padding: 16px; border-top: 2px solid var(--text); font-size: 18px; font-weight: 700; }
.listbox { margin-top: 18px; padding: 16px; border-radius: var(--radius); border: 1px solid var(--line); }
.listbox h3 { font-size: 17px; }
.listbox ul { margin: 10px 0 0; padding-left: 20px; display: grid; gap: 6px; }
.listbox.warn { background: var(--warn-soft); border-color: #f0dca6; }
.cmp { margin-top: 18px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.cmp-col { border: 1.5px solid var(--line); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cmp-col.is-sel { border-color: var(--accent); background: var(--accent-soft); }
.cmp-q { font-weight: 700; }
.cmp-t { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.cmp-u { font-size: 14px; color: var(--text-2); }
.cmp-col .btn-plain { margin-top: 6px; min-height: 44px; justify-content: center; font-size: 14px; }
.actions-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }

.form { margin-top: 28px; padding: 22px 18px; border-radius: 18px; border: 1.5px solid var(--line); }
.form h3 { font-size: 22px; }
.form .sec-sub { margin-top: 6px; color: var(--text-2); }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form .btn { width: 100%; margin-top: 18px; }
.form-err { margin-top: 14px; }
.success { margin-top: 28px; padding: 26px 20px; border-radius: 18px; background: var(--ok-soft); border: 1px solid #bfe3cc; }
.success h3 { font-size: 24px; color: var(--ok); }
.success p { margin-top: 10px; }
.success .num { font-size: 28px; font-weight: 700; color: var(--text); margin-top: 6px; }

/* ── диалоги ── */
.dlg { border: 0; border-radius: 18px; padding: 0; width: min(560px, calc(100vw - 32px)); box-shadow: 0 20px 60px rgba(16, 24, 40, .25); color: var(--text); }
.dlg::backdrop { background: rgba(16, 24, 40, .5); }
.dlg-body { padding: 24px; }
.dlg h2 { font-size: 24px; margin-bottom: 14px; }
.dlg p { margin-top: 10px; }
.how-list { margin: 0; padding-left: 20px; display: grid; gap: 10px; }
.dlg-actions { margin-top: 22px; display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }

/* ── подвал как на сайте ── */
.site-foot { border-top: 1px solid var(--line); background: var(--bg-soft); padding: 28px 0; margin-top: 24px; }
.foot-row { display: grid; gap: 20px; grid-template-columns: 1fr; }
.foot-brand p, .foot-req p { margin-top: 8px; font-size: 14px; color: var(--text-2); }
.foot-nav { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.foot-nav a { color: var(--text); text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }
.foot-nav a:hover { color: var(--accent); }
.foot-phone { font-weight: 700; color: var(--text); text-decoration: none; font-size: 18px; }

.print-spec { display: none; }

/* ── адаптивность ── */
@media (min-width: 560px) {
  .choices.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .choices.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .types { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .result-units { grid-template-columns: 1fr 1fr; }
  .add-menu { grid-template-columns: 1fr 1fr; }
  .form { padding: 26px 24px; }
}
@media (min-width: 768px) {
  .stepper { display: block; }
  .mobile-progress { display: none; }
  .help-txt { display: inline; }
  .link-btn { display: inline-flex; }
  .kit-top { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); }
  .types { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .foot-row { grid-template-columns: 1.2fr 1fr 1fr; }
  .step-nav .btn { min-width: 300px; }
}
@media (max-width: 899px) {
  .stepper .step-lbl { display: none; }
  .stepper li[aria-current] .step-lbl, .stepper .is-cur .step-lbl { display: inline; }
}
@media (min-width: 1100px) {
  .calc { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 48px; align-items: start; }
  .summary { display: block; position: sticky; top: calc(var(--top-pdd, var(--head-h)) + 20px); margin-top: 154px; }
  .head-nav { display: flex; }
  .stepper .step-lbl { display: inline; }
}
@media (max-width: 1099px) {
  /* нижняя панель закреплена: место под неё в конце страницы, чтобы подвал сайта не уходил под панель */
  /* --mbar-h: высота панели, её замеряет app.js при показе */
  body.has-mbar { padding-bottom: var(--mbar-h); }
  body.has-mbar .calc { padding-bottom: 32px; }
}
@media (max-width: 559px) {
  .tsearch { flex-basis: 100%; max-width: none; }
}
@media (max-width: 380px) {
  .types { gap: 8px; }
  .type-t { font-size: 14px; padding: 8px 10px 2px; }
  .cmp { grid-template-columns: 1fr; }
  .qchips { grid-template-columns: repeat(2, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation-duration: .01ms !important; }
}

/* ── версия для печати: только спецификация (ТЗ §11) ── */
@media print {
  @page { size: A4; margin: 14mm; }
  body { font-size: 11pt; }
  /* на печать идёт только спецификация: шапка, подвал и окна сайта тоже скрыты */
  body > *:not(.print-spec) { display: none !important; }
  body { padding-top: 0 !important; }
  .print-spec { display: block !important; color: #000; }
  .print-spec h1 { font-size: 18pt; }
  .print-spec h2 { font-size: 13pt; margin-top: 14pt; }
  .print-spec table { width: 100%; border-collapse: collapse; margin-top: 6pt; }
  .print-spec th, .print-spec td { border-bottom: .5pt solid #999; padding: 4pt 4pt; text-align: left; vertical-align: top; }
  .print-spec td.r, .print-spec th.r { text-align: right; white-space: nowrap; }
  .print-spec .ps-note { margin-top: 10pt; font-size: 9.5pt; color: #333; }
  .print-spec .ps-head { display: flex; justify-content: space-between; border-bottom: 1.5pt solid #000; padding-bottom: 6pt; }
}
