/* ============================================================
   Калькулятор фасада — /calculator (functions/calculator.js, calc-ui.js), v2.
   Подключается только на этой странице.

   Раскладка: слева, в обычном потоке, — белые карточки: «Объект»
   (площадь на всю ширину, стена, проект), заголовок «Комплект по
   этапам монтажа» и четыре карточки этапов (1 подсистема, 2 утепление,
   3 мембрана, 4 облицовка — с подборщиком панели прямо в карточке и
   дополнительными зонами), под ними — вопрос AI, сноски, визит.
   Справа — только короткая липкая тёмная карточка цены: она никогда
   не выше окна (max-height) и ничего не накрывает.
   Строка комплекта: картинка, роль и товар (ссылка — в новой вкладке),
   наличие, «заменить»; количество (поле), цена за единицу, сумма,
   «убрать»; под ней — формула на белой полосе, множители — поля.
   На телефоне: площадь → цена → стена и проект → этапы → сноски → визит;
   строки — в две ступени, поля не меньше 44 px; внизу полоса с ценой.

   2026-11-16 (Лука: «серое, белое, как матрёшка»): один уровень заливки. Страница — бумага,
   карточки — белые, внутри карточки строки разделены тонкой линией, без своих плашек; серым
   бывают только поля, чипы и плитки — и в них уже ничего белого. Этапы сворачиваются
   (заголовок — кнопка с суммой этапа). Тот же калькулятор встраивается под результат
   визуализации на /private-houses (.cx-body.is-embed, viz-block.js).

   Токены — из styles.css: --ink, --paper, --soft, --yellow, --yellow-soft,
   --gold-ink, --dark, --r, --r-sm, --display, --ease. Без рамок и обводок,
   без теней при наведении, без надписей-«бровок». Зелёного нет нигде —
   «в наличии» отмечаем тёмной точкой, цвета зон — палитра студии
   (янтарь, синий, коралл…, без зелёного и бирюзового).
   ============================================================ */

:root { --fill: #ececec; --fill-hover: #e2e2e2; }
.page-calc main { background: var(--paper); }
.page-calc .container { width: min(calc(100% - 64px), 1320px); }
html.cx-lock { overflow: hidden; }
.cx-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* у многих блоков свой display — атрибут hidden должен побеждать */
[data-calc] [hidden] { display: none !important; }
[data-calc] svg, .cx-from svg, .cx-bar svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
/* искра Urban AI — залитая, как у кнопки чата */
[data-calc] .cx-spark { fill: currentColor; stroke: none; }
.page-calc main button:focus-visible, .page-calc main a:focus-visible, .page-calc main select:focus-visible,
.cx-dlg button:focus-visible, .cx-dlg a:focus-visible, .cx-dlg select:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--yellow); }
.page-calc main button, .cx-dlg button, [data-calc] button { cursor: pointer; font: inherit; }
[data-calc] button:focus-visible, [data-calc] a:focus-visible, [data-calc] select:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--yellow); }

/* хлебные крошки — как в catalog.css (тот файл здесь не подключаем) */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 14px; color: #8a908e; font-size: 12px; font-weight: 600; }
.crumbs a { color: #5d6463; transition: color .2s var(--ease); }
.crumbs a:hover { color: var(--gold-ink); }
.crumbs span[aria-hidden] { opacity: .5; }
.crumbs [aria-current] { color: var(--ink); }
.rate-note { display: none; }

/* ————— шапка ————— */
.cx-head { padding: 104px 0 0; }
.cx-head-row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px 32px; }
.cx-head-t { min-width: 0; }
.cx-head h1 { margin: 0; font-family: var(--display); font-size: clamp(32px, 3.3vw, 50px); line-height: 1.04; letter-spacing: -.025em; font-weight: 700; }
.cx-head h1 em, .cx-kit-head h2 em, .cx-dlg h2 em { font-family: var(--display); font-style: normal; color: var(--gold-ink); }
.cx-lead { max-width: 660px; margin: 10px 0 0; color: #59605f; font-size: 15px; line-height: 1.55; }
/* «Sandrift Oak · 2037 SF ↗︎» — назад к товару */
.cx-from { display: inline-flex; flex: none; align-items: center; gap: 10px; max-width: 100%; padding: 5px 16px 5px 5px; border-radius: 999px; background: #fff; color: var(--ink); font-size: 13px; font-weight: 700; transition: background .2s var(--ease), color .2s var(--ease); }
.cx-from:hover { background: var(--ink); color: #fff; }
.cx-from-img { flex: none; width: 34px; height: 34px; overflow: hidden; border-radius: 50%; background: #e9e8e1; }
.cx-from-img img { width: 100%; height: 100%; object-fit: cover; }
.cx-from-t { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.cx-from-i { display: grid; color: var(--gold-ink); }
.cx-from:hover .cx-from-i { color: var(--yellow-soft); }
.cx-from-i svg { width: 15px; height: 15px; stroke-width: 2; }

/* ————— раскладка ————— */
.cx-body { padding: 22px 0 96px; }
.cx-grid { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 20px; }
.cx-main { display: grid; align-content: start; gap: 16px; min-width: 0; }
.cx-side { min-width: 0; }
/* липкая колонка: не выше окна; если вдруг не влезет — листается сама, ничего не прячет */
.cx-sticky { position: sticky; top: 92px; max-height: calc(100vh - 108px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; border-radius: var(--r); }
.cx-sticky::-webkit-scrollbar { display: none; }

/* ————— номер этапа / значок карточки ————— */
.cx-badge { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--ink); color: var(--yellow-soft); font-family: var(--display); font-size: 15px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.cx-badge svg { width: 18px; height: 18px; stroke-width: 1.9; }

/* ————— карточка «Объект» ————— */
.cx-cfg { display: grid; gap: 24px; padding: 24px 28px 28px; border-radius: var(--r); background: #fff; }
.cx-blk { min-width: 0; }
.cx-card-h { display: flex; align-items: center; gap: 14px; margin: 0 0 18px; }
.cx-card-t { margin: 0; font-family: var(--display); font-size: 20px; line-height: 1.2; font-weight: 700; letter-spacing: -.01em; }
.cx-blk-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.cx-k-lbl { margin: 0; color: #4a5150; font-size: 13px; font-weight: 700; line-height: 1.35; }

/* площадь: −  [ 150 м² ]  + на всю ширину */
[data-calc] .cx-how { display: inline-flex; flex: none; align-items: center; gap: 6px; height: 30px; padding: 0 10px 0 6px; border: 0; border-radius: 999px; background: transparent; color: var(--gold-ink); font-size: 12.5px; font-weight: 700; transition: background .2s var(--ease), color .2s var(--ease); }
.cx-how svg { width: 17px; height: 17px; }
.cx-how:hover, .cx-how[aria-expanded="true"] { background: var(--fill); color: var(--ink); }
.cx-how-pop { margin: 14px 0 0; padding: 14px 0 0; border-top: 1px solid var(--cx-line, #eeede7); }
.cx-how-pop p { margin: 0 0 12px; color: #4a5150; font-size: 13px; line-height: 1.5; }
.cx-helper { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; }
.cx-helper label { display: grid; flex: 1 1 78px; gap: 4px; min-width: 0; }
.cx-helper label span { color: #6b7270; font-size: 11px; font-weight: 700; }
.cx-helper input { width: 100%; height: 40px; padding: 0 10px; border: 0; border-radius: 8px; outline: none; background: var(--fill); color: var(--ink); font-size: 14px; }
.cx-helper input:focus { background: #fff; box-shadow: 0 0 0 2px var(--yellow); }
.cx-helper > b { padding-bottom: 10px; color: #8a908e; }
.cx-apply { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px; border: 0; border-radius: 8px; background: var(--ink); color: #fff; font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.cx-apply output { color: var(--yellow-soft); }
.cx-area { display: flex; gap: 8px; }
.cx-step { flex: none; display: grid; place-items: center; width: 68px; height: 66px; border: 0; border-radius: var(--r-sm); background: var(--fill); color: var(--ink); transition: background .2s var(--ease), color .2s var(--ease); }
.cx-step svg { width: 20px; height: 20px; stroke-width: 2.2; }
.cx-step:hover { background: var(--ink); color: #fff; }
.cx-area-field { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; min-width: 0; height: 66px; padding: 0 18px; border-radius: var(--r-sm); background: var(--fill); cursor: text; transition: background .2s var(--ease); }
.cx-area-field:focus-within { background: #fff; box-shadow: 0 0 0 2px var(--yellow); }
/* styles.css на телефонах ставит полям 16px !important — площади нужен крупный шрифт, он и так больше 16 */
.cx-area-field input { flex: 0 1 auto; width: auto; max-width: 100%; min-width: 0; padding: 0; border: 0; outline: none; background: transparent; color: var(--ink); font-family: var(--display); font-size: 36px !important; font-weight: 700; letter-spacing: -.02em; text-align: right; font-variant-numeric: tabular-nums; }
.cx-area-field span { color: #6b7270; font-size: 17px; font-weight: 700; }
.cx-presets { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; margin-top: 10px; }
[data-calc] .cx-presets button { min-width: 0; height: 40px; padding: 0 4px; border: 0; border-radius: 999px; background: var(--fill); color: #3a4140; font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; transition: background .2s var(--ease), color .2s var(--ease); }
.cx-presets small { margin-left: 3px; color: #8a908e; font-size: 10.5px; font-weight: 600; }
.cx-presets button:hover { background: var(--fill-hover); color: var(--ink); }
.cx-presets button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.cx-presets button[aria-pressed="true"] small { color: rgba(255, 255, 255, .6); }
/* «Нет замеров? AI-студия посчитает площадь по фото →» */
.cx-studio { display: inline-flex; align-items: flex-start; gap: 8px; margin-top: 14px; color: #59605f; font-size: 13px; font-weight: 600; line-height: 1.45; transition: color .2s var(--ease); }
.cx-studio .cx-spark { flex: none; width: 16px; height: 16px; margin-top: 1px; color: var(--yellow); }
.cx-studio-a { color: var(--gold-ink); }
.cx-studio:hover { color: var(--ink); }
.cx-flag { margin: 10px 0 0; padding: 10px 14px; border-radius: var(--r-sm); background: #fbf1da; color: #6b4f10; font-size: 13px; }

/* стена и проект */
.cx-rows { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); gap: 16px 28px; }
.cx-row { display: grid; align-content: start; gap: 8px; min-width: 0; }
.cx-row-k { color: #4a5150; font-size: 13px; font-weight: 700; }
.cx-seg { display: flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--fill); }
[data-calc] .cx-seg button { flex: 1 1 0; min-width: 0; min-height: 38px; padding: 4px 10px; border: 0; border-radius: 999px; background: transparent; color: #4a5150; font-size: 13.5px; font-weight: 700; line-height: 1.2; transition: background .2s var(--ease), color .2s var(--ease); }
.cx-seg button:hover { color: var(--ink); }
.cx-seg button[aria-pressed="true"], .cx-seg button[aria-selected="true"] { background: var(--ink); color: #fff; }
/* четыре стены — ровная сетка; на узком экране 2 × 2, грузинские подписи не обрезаются */
.cx-seg.is-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cx-switch { position: relative; display: flex; align-items: center; gap: 12px; min-height: 42px; cursor: pointer; }
.cx-switch input { position: absolute; opacity: 0; pointer-events: none; }
.cx-switch-ui { position: relative; flex: none; width: 44px; height: 26px; border-radius: 999px; background: #cfd0c9; transition: background .2s var(--ease); }
.cx-switch-ui::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .2s var(--ease), background .2s var(--ease); }
.cx-switch input:checked + .cx-switch-ui { background: var(--ink); }
.cx-switch input:checked + .cx-switch-ui::after { transform: translateX(18px); background: var(--yellow-soft); }
.cx-switch input:focus-visible + .cx-switch-ui { box-shadow: 0 0 0 2px var(--yellow); }
.cx-switch small { color: #59605f; font-size: 13px; line-height: 1.4; }

/* наличие: тёмная точка — есть, золотая — не хватает, серая — под заказ */
.cx-st { display: inline-flex; align-items: flex-start; gap: 6px; color: #3a4140; font-size: 12px; font-weight: 600; line-height: 1.35; }
.cx-st::before { content: ""; flex: none; width: 7px; height: 7px; margin-top: .42em; border-radius: 50%; background: var(--ink); }
.cx-st.is-part { color: var(--gold-ink); }
.cx-st.is-part::before { background: var(--yellow); }
.cx-st.is-order { color: var(--muted); }
.cx-st.is-order::before { background: #c6c8c2; }

/* ————— липкая карточка цены ————— */
.cx-price { padding: 22px 22px 18px; border-radius: var(--r); background: var(--dark); color: #fff; }
.cx-price-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cx-price .cx-k { margin: 0; color: rgba(255, 255, 255, .62); font-size: 13px; font-weight: 600; line-height: 1.35; }
.cx-cur { display: inline-flex; flex: none; padding: 3px; border-radius: 999px; background: rgba(255, 255, 255, .08); }
.cx-cur button { width: 38px; height: 30px; border: 0; border-radius: 999px; background: transparent; color: rgba(255, 255, 255, .7); font-family: var(--display); font-size: 15px; font-weight: 700; transition: background .2s var(--ease), color .2s var(--ease); }
.cx-cur button:hover { color: #fff; }
.cx-cur button[aria-pressed="true"] { background: var(--yellow-soft); color: var(--ink); }
/* до запуска скрипта: если на сайте выбраны лари — подсвечиваем ₾ (суммы уже в лари через .money) */
:root[data-cur="gel"] .cx-cur:not(.is-live) button[aria-pressed="true"] { background: transparent; color: rgba(255, 255, 255, .7); }
:root[data-cur="gel"] .cx-cur:not(.is-live) button[data-cx-cur="GEL"] { background: var(--yellow-soft); color: var(--ink); }
.cx-per { margin: 10px 0 0; font-family: var(--display); font-size: clamp(38px, 3.3vw, 52px); line-height: 1.02; letter-spacing: -.03em; font-weight: 700; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.cx-per .cx-c, .cx-total .cx-c { margin-left: .14em; color: var(--yellow-soft); font-size: .62em; letter-spacing: 0; }
.cx-tot { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 12px; margin-top: 16px; padding: 14px 0 0; border-top: 1px solid rgba(255, 255, 255, .12); }
.cx-total { margin: 0; font-family: var(--display); font-size: 24px; line-height: 1.15; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
/* разбивка по этапам; под облицовкой — зоны с цветной точкой */
.cx-break { display: grid; gap: 7px; margin: 12px 0 0; padding: 12px 0 0; border-top: 1px solid rgba(255, 255, 255, .12); list-style: none; }
.cx-break li { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; color: rgba(255, 255, 255, .62); font-size: 12.5px; line-height: 1.35; }
.cx-break b { color: #fff; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cx-break li.is-zone { margin-top: -2px; padding-left: 12px; font-size: 12px; }
.cx-break li.is-zone span { display: inline-flex; align-items: center; gap: 7px; min-width: 0; }
.cx-break li.is-zone b { color: rgba(255, 255, 255, .82); font-weight: 600; }
.cx-break .cx-zdot { width: 8px; height: 8px; box-shadow: none; }
/* под «Облицовкой» — какая панель: одна тихая строка («Sandrift Oak · 2037 SF + 2 панели») */
.cx-break li.is-prod { margin-top: -4px; font-size: 12px; color: rgba(255, 255, 255, .5); }
.cx-break li.is-prod span { overflow: hidden; min-width: 0; white-space: nowrap; text-overflow: ellipsis; }
/* панели с ценой по запросу: итог без них — «+ по запросу» у сумм, «По запросу» вместо цены 1 м², подпись под итогом */
.cx-per .cx-reqv { color: var(--yellow-soft); font-size: .56em; letter-spacing: -.015em; }
.cx-tot-req { flex: 1 1 100%; margin: 2px 0 0; color: var(--yellow-soft); font-size: 12.5px; font-weight: 600; line-height: 1.4; }
.cx-break .cx-plus { margin-left: 6px; color: var(--yellow-soft); font-size: 11px; font-weight: 600; }
.cx-stage-tot .cx-plus { display: block; color: var(--gold-ink); font-family: Inter, Arial, sans-serif; font-size: 12px; font-weight: 700; line-height: 1.3; }
.cx-dlg-sum .cx-dlg-req { flex: 1 1 100%; color: var(--gold-ink); font-size: 12.5px; font-weight: 600; text-align: right; }
.cx-acts { display: grid; gap: 8px; margin-top: 16px; }
.cx-acts .button { width: 100%; min-height: 50px; padding: 10px 16px; font-size: 13.5px; gap: 10px; }
/* «записаться на визит» — вторая сильная кнопка: белая, с календарём и ближайшим свободным временем */
.cx-vbtn { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 8px 16px 8px 12px; border: 0; border-radius: var(--r-sm); background: rgba(255, 255, 255, .09); color: #fff; text-align: left; transition: background .2s var(--ease); }
.cx-vbtn:hover { background: rgba(255, 255, 255, .16); }
.cx-vbtn-i { flex: none; display: grid; place-items: center; width: 30px; height: 30px; color: var(--yellow-soft); }
.cx-vbtn-i svg { width: 22px; height: 22px; }
.cx-vbtn-t { display: grid; flex: 1; gap: 2px; min-width: 0; }
.cx-vbtn-t b { font-size: 13.5px; font-weight: 700; line-height: 1.25; }
.cx-vbtn-t small { overflow: hidden; color: rgba(255, 255, 255, .6); font-size: 11.5px; font-weight: 600; line-height: 1.3; white-space: nowrap; text-overflow: ellipsis; }
.cx-vbtn-t small.is-slot { color: var(--yellow-soft); }
.cx-vbtn-a { flex: none; font-size: 15px; }
/* «спросить AI» — под кнопками: искра, короткие вопросы чипами */
.cx-ai { display: grid; gap: 8px; margin-top: 12px; }
[data-calc] .cx-ai-btn { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 0 12px; border: 0; border-radius: var(--r-sm); background: transparent; color: #fff; font-size: 13px; font-weight: 600; line-height: 1.3; text-align: left; transition: background .2s var(--ease); }
.cx-ai-btn:hover { background: rgba(255, 255, 255, .08); }
.cx-ai-btn .cx-spark { flex: none; width: 18px; height: 18px; color: var(--yellow); }
.cx-ai-chips { display: flex; flex-wrap: wrap; gap: 6px; }
[data-calc] .cx-aiq { min-height: 30px; padding: 5px 12px; border: 0; border-radius: 999px; background: rgba(255, 255, 255, .06); color: rgba(255, 255, 255, .8); font-size: 12.5px; font-weight: 500; line-height: 1.3; text-align: left; transition: background .2s var(--ease), color .2s var(--ease); }
.cx-aiq:hover { background: var(--yellow-soft); color: var(--ink); }
.cx-fine { display: flex; flex-wrap: wrap; gap: 2px 10px; margin: 12px 0 0; color: rgba(255, 255, 255, .45); font-size: 11px; line-height: 1.5; }
.cx-rates span { white-space: nowrap; }
.is-loading .cx-per, .is-loading .cx-total, .is-loading .cx-break, .is-loading .cx-stages { opacity: .25; }

/* открыт сохранённый расчёт */
.cx-snap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 14px; margin: 0 0 10px; padding: 14px 16px; border-radius: var(--r-sm); background: #fbf1da; }
.cx-snap p { margin: 0; color: #6b4f10; font-size: 13px; line-height: 1.45; }
.cx-snap .cx-snap-t { color: var(--ink); font-weight: 800; }
.cx-snap .cx-snap-s, .cx-snap .cx-snap-b { margin-top: 2px; }
.cx-snap a { color: var(--gold-ink); font-weight: 700; }
.is-snapshot .cx-cfg { opacity: .55; }

/* ————— комплект по этапам монтажа ————— */
.cx-kit { display: grid; gap: 14px; min-width: 0; }
.cx-kit-head { padding: 12px 2px 0; }
.cx-kit-ht { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; }
[data-calc] .cx-all { flex: none; min-height: 34px; padding: 0 14px; border: 0; border-radius: 999px; background: #fff; color: var(--ink); font-size: 12.5px; font-weight: 700; transition: background .2s var(--ease), color .2s var(--ease); }
.cx-all:hover { background: var(--ink); color: #fff; }
.cx-kit-head h2 { margin: 0; font-family: var(--display); font-size: clamp(23px, 2vw, 28px); line-height: 1.15; letter-spacing: -.015em; font-weight: 700; }
.cx-kit-lead { max-width: 720px; margin: 6px 0 0; color: #6b7270; font-size: 13.5px; line-height: 1.5; }
.cx-stages { display: grid; gap: 14px; min-width: 0; transition: opacity .2s var(--ease); }
.cx-stage { min-width: 0; border-radius: var(--r); background: #fff; }
/* заголовок этапа — кнопка во всю ширину карточки: номер, название и состав, сумма, стрелка */
.cx-stage-h { margin: 0; font: inherit; letter-spacing: normal; }
[data-calc] .cx-stage-tg { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto 30px; grid-template-areas: "b t tot c"; gap: 14px; align-items: center; width: 100%; padding: 18px 20px 18px 24px; border: 0; border-radius: var(--r); background: transparent; color: var(--ink); text-align: left; transition: background .2s var(--ease); }
.cx-stage-tg:hover { background: #fbfaf7; }
.cx-stage:not(.is-closed) .cx-stage-tg { border-radius: var(--r) var(--r) 0 0; }
.cx-stage-tg .cx-badge { grid-area: b; }
.cx-stage-t { grid-area: t; display: grid; gap: 3px; min-width: 0; }
.cx-stage-n { font-family: var(--display); font-size: 19px; line-height: 1.25; font-weight: 700; letter-spacing: -.01em; }
.cx-stage-d { color: #6b7270; font-size: 13px; font-weight: 500; line-height: 1.45; }
.cx-stage-tot { grid-area: tot; font-family: var(--display); font-size: 19px; font-weight: 700; line-height: 1.25; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cx-stage-chev { grid-area: c; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--fill); color: var(--ink); transition: transform .25s var(--ease), background .2s var(--ease), color .2s var(--ease); }
.cx-stage-chev svg { width: 15px; height: 15px; stroke-width: 2.3; }
.cx-stage-tg:hover .cx-stage-chev { background: var(--ink); color: #fff; }
.cx-stage-tg[aria-expanded="true"] .cx-stage-chev { transform: rotate(180deg); }
.cx-stage-b { padding: 0 24px 20px; animation: cx-in .22s var(--ease); }
.cx-stage > .cx-warn { margin: 0 24px 18px; }
.cx-stage.is-closed > .cx-warn { margin-top: -4px; }
.cx-stage-tot .cx-offn, .cx-stage-tot .cx-req { font-size: 13px; }
/* цена этапа за 1 м² — под суммой этапа и в тёмной карточке */
.cx-stage-tot .cx-pm2 { display: block; color: var(--muted, #6b6b66); font-family: Inter, Arial, sans-serif; font-size: 12.5px; font-weight: 600; line-height: 1.35; }
.cx-break b .cx-pm2 { display: block; color: rgba(255, 255, 255, .55); font-size: 11.5px; font-weight: 600; text-align: right; }
.cx-nil { color: #b9bcb6; font-weight: 400; }
.cx-stage-ctl { margin: 0 0 14px 48px; }
.cx-seg-ins { display: inline-flex; min-width: min(380px, 100%); }
.cx-stage-ctl .cx-switch small { max-width: 460px; }
.cx-lines { display: grid; gap: 0; min-width: 0; }
.cx-lines:empty { display: none; }
.cx-stage-empty { margin: 0; padding: 14px 16px; border-radius: var(--r-sm); background: var(--fill); color: #6b7270; font-size: 13px; line-height: 1.5; }

/* ————— строка комплекта —————
   картинка | роль, товар, наличие, «заменить» | количество и цена за единицу | сумма | убрать
            | формула на всю ширину; под ней — список «заменить» */
.cx-line { display: grid; grid-template-columns: 52px minmax(0, 1fr) 176px 120px 34px; grid-template-areas: "img main q t x" ". f f f f" ". alts alts alts alts"; column-gap: 14px; align-items: start; min-width: 0; padding: 16px 0; border-top: 1px solid var(--cx-line, #eeede7); }
.cx-line-img { grid-area: img; position: relative; display: block; width: 52px; height: 52px; overflow: hidden; border-radius: 8px; background: var(--fill); }
.cx-line-img img { width: 100%; height: 100%; object-fit: cover; }
.cx-line-main { grid-area: main; display: grid; align-content: start; justify-items: start; gap: 2px; min-width: 0; }
.cx-line-role { margin: 0; color: var(--ink); font-size: 14px; font-weight: 700; line-height: 1.3; }
.cx-line-name { color: #59605f; font-size: 12.5px; line-height: 1.4; transition: color .2s var(--ease); }
.cx-line-name span { color: var(--gold-ink); font-size: 11px; }
/* код товара в названии («ALS-0001») — без переноса на дефисе, цветом и размером названия */
.cx-line-name .cx-nw { color: inherit; font-size: inherit; white-space: nowrap; }
.cx-line-name:hover { color: var(--gold-ink); }
.cx-line-hint { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.4; }
.cx-line-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; margin-top: 3px; }
.cx-line-q { grid-area: q; display: grid; justify-items: end; align-content: start; gap: 5px; min-width: 0; }
.cx-qin { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 12px 0 4px; border-radius: 9px; background: var(--fill); cursor: text; transition: box-shadow .2s var(--ease), background .2s var(--ease); }
.cx-qin:focus-within { background: #fff; box-shadow: 0 0 0 2px var(--yellow); }
.cx-qin input { width: 80px; height: 34px; padding: 0 4px; border: 0; outline: none; background: transparent; color: var(--ink); font-size: 15px !important; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.cx-qin input:disabled { color: #9aa09e; }
.cx-qin span { color: #6b7270; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.cx-qv { padding-top: 7px; font-size: 14px; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cx-line-u { color: #6b7270; font-size: 12px; line-height: 1.35; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cx-line-u small { font-size: inherit; }
/* «вручную» и возврат расчётного количества */
.cx-man { display: inline-flex; align-items: center; gap: 4px; padding: 2px 2px 2px 9px; border-radius: 999px; background: var(--yellow-soft); color: #4a3a12; font-size: 11px; font-weight: 700; line-height: 1.3; }
.cx-man-r { display: grid; place-items: center; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%; background: rgba(16, 17, 17, .08); color: var(--ink); transition: background .2s var(--ease), color .2s var(--ease); }
.cx-man-r svg { width: 13px; height: 13px; stroke-width: 2.2; }
.cx-man-r:hover { background: var(--ink); color: #fff; }
.cx-line-t { grid-area: t; padding-top: 7px; font-family: var(--display); font-size: 16px; font-weight: 700; line-height: 1.35; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cx-line-x { grid-area: x; display: flex; justify-content: flex-end; padding-top: 3px; }
.cx-rm { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: #8a908e; transition: background .2s var(--ease), color .2s var(--ease); }
.cx-rm svg { width: 15px; height: 15px; stroke-width: 2.2; }
.cx-rm:hover { background: var(--ink); color: #fff; }
.cx-rm[aria-pressed="true"] { background: var(--ink); color: var(--yellow-soft); }
.cx-line.is-off .cx-line-img, .cx-line.is-off .cx-line-main, .cx-line.is-off .cx-line-q, .cx-line.is-off .cx-f, .cx-line.is-off .cx-zone-h { opacity: .45; }
.cx-offn { color: #8a908e; font-family: Inter, Arial, sans-serif; font-size: 12px; font-weight: 700; }
.cx-req { color: var(--gold-ink); font-family: Inter, Arial, sans-serif; font-size: 12px; font-weight: 700; }
/* «заменить» */
[data-calc] .cx-swap { display: inline-flex; align-items: center; gap: 5px; min-height: 26px; padding: 0 2px; border: 0; background: none; color: var(--gold-ink); font-size: 12px; font-weight: 700; transition: color .2s var(--ease); }
.cx-swap svg { width: 15px; height: 15px; stroke-width: 2; }
.cx-swap:hover, .cx-swap[aria-expanded="true"] { color: var(--ink); }

/* формула: белая полоса, множители — поля на бумаге, изменённые — золотистые */
.cx-f { grid-area: f; display: flex; align-items: center; gap: 10px; min-width: 0; margin-top: 8px; padding: 0; }
.cx-f-i { flex: none; display: grid; color: var(--gold-ink); }
.cx-f-i svg { width: 16px; height: 16px; }
.cx-f-x { flex: 1; min-width: 0; margin: 0; color: #4a5150; font-size: 12.5px; line-height: 30px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.cx-f.is-ro .cx-f-x { padding: 4px 0; line-height: 1.5; }
.cx-fx { width: 56px; height: 26px; margin: 0 1px; padding: 0 6px; border: 0; border-radius: 7px; outline: none; background: var(--fill); color: var(--ink); font-size: 13px !important; font-weight: 700; text-align: center; vertical-align: middle; font-variant-numeric: tabular-nums; cursor: text; transition: background .2s var(--ease), box-shadow .2s var(--ease); }
.cx-fx:hover { background: var(--fill-hover); }
.cx-fx:focus { background: #fff; box-shadow: 0 0 0 2px var(--yellow); }
.cx-fx.is-changed, .cx-fx.is-changed:hover { background: var(--yellow-soft); }
.cx-fx.is-changed:focus { background: #fff; }
.cx-fv { display: inline-block; min-width: 28px; padding: 0 6px; border-radius: 7px; color: var(--ink); font-weight: 700; line-height: 1.6; text-align: center; }
.cx-fv.is-changed { background: var(--yellow-soft); }
[data-calc] .cx-f-reset { flex: none; display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 10px; border: 0; border-radius: 999px; background: var(--fill); color: var(--gold-ink); font-size: 12px; font-weight: 700; white-space: nowrap; transition: background .2s var(--ease), color .2s var(--ease); }
.cx-f-reset svg { width: 13px; height: 13px; stroke-width: 2.2; }
.cx-f-reset:hover { background: var(--ink); color: #fff; }

/* список «заменить»: другие товары и артикулы роли, точка — что движок берёт сам */
.cx-alts { grid-area: alts; display: grid; gap: 2px; margin-top: 10px; padding: 8px; border-radius: 10px; background: var(--fill); }
.cx-alts-k { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px; margin: 2px 6px 4px; color: #6b7270; font-size: 12px; font-weight: 700; }
.cx-legend { display: inline-flex; align-items: center; gap: 6px; color: #8a908e; font-size: 11.5px; font-weight: 600; }
.cx-dot { flex: none; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--yellow); }
[data-calc] .cx-alt { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 40px; padding: 6px 12px; border: 0; border-radius: 8px; background: transparent; color: #3a4140; font-size: 13px; line-height: 1.35; text-align: left; transition: background .2s var(--ease), color .2s var(--ease); }
[data-calc] .cx-alt:hover { background: var(--fill-hover); color: var(--ink); }
[data-calc] .cx-alt[aria-pressed="true"] { background: var(--ink); color: #fff; }
.cx-alt-n { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; min-width: 0; }
.cx-alt-n b { font-weight: 700; }
.cx-alt-n span { color: #6b7270; }
.cx-alt-p { flex: none; font-family: var(--display); font-size: 13.5px; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cx-alt-p small { color: #8a908e; font-family: Inter, Arial, sans-serif; font-size: 11px; font-weight: 600; }
.cx-alt[aria-pressed="true"] .cx-alt-n span, .cx-alt[aria-pressed="true"] .cx-alt-p small { color: rgba(255, 255, 255, .62); }

/* ————— облицовка: панель крупно ————— */
.cx-line.is-hero { grid-template-columns: 136px minmax(0, 1fr) 176px 120px 34px; padding: 18px 0; }
.cx-line.is-hero .cx-line-img { width: 136px; height: 102px; border-radius: 10px; }
.cx-hero-name { color: var(--ink); font-family: var(--display); font-size: 18px; font-weight: 700; line-height: 1.25; letter-spacing: -.005em; transition: color .2s var(--ease); }
.cx-hero-name span { color: var(--gold-ink); font-size: 13px; }
.cx-hero-name:hover { color: var(--gold-ink); }
.cx-hero-meta { margin: 0; color: #6b7270; font-size: 12.5px; line-height: 1.45; }
.cx-line.is-hero .cx-line-u, .cx-line.is-zone .cx-line-u { color: var(--ink); font-size: 13px; font-weight: 700; }
.cx-line.is-hero .cx-line-u small, .cx-line.is-zone .cx-line-u small { color: #6b7270; font-weight: 600; }
.cx-hero-miss { margin: 0; color: #6b4f10; font-size: 13px; line-height: 1.45; }
.cx-line.is-empty { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; }
.cx-line.is-zone.is-empty .cx-zone-h { flex: 1 1 100%; margin: 0; }
/* образец декора поверх фото */
.cx-tile-sw { position: absolute; left: 8px; bottom: 8px; width: 22px; height: 22px; border-radius: 50%; background-position: center; background-size: cover; box-shadow: 0 0 0 2px #fff; }
/* зона: цветная точка, название и «остальная площадь» */
.cx-ztag { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; margin: 0 0 6px; color: #6b7270; font-size: 12px; line-height: 1.4; }
.cx-ztag b { color: var(--ink); font-size: 12.5px; }
.cx-line-main > .cx-ztag { justify-self: stretch; }
.cx-ztag > span { flex: 0 1 auto; min-width: 0; }
.cx-ztag [data-zone-area] { white-space: nowrap; }
.cx-zdot { flex: none; display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--z, #8a94a6); }
/* толщины панели */
.cx-vchips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.cx-vchips-k { margin-right: 2px; color: #6b7270; font-size: 12px; font-weight: 700; }
[data-calc] .cx-chip { min-height: 34px; padding: 4px 13px; border: 0; border-radius: 999px; background: var(--fill); color: #3a4140; font-size: 12.5px; font-weight: 700; line-height: 1.25; transition: background .2s var(--ease), color .2s var(--ease); }
.cx-chip small { color: #8a908e; font-size: 11.5px; font-weight: 600; }
.cx-chip:hover { background: var(--fill-hover); color: var(--ink); }
.cx-chip[aria-pressed="true"] { background: var(--ink); color: #fff; }
.cx-chip[aria-pressed="true"] small { color: rgba(255, 255, 255, .62); }
/* «Выбрать другую панель» — раскрывает подборщик тут же */
[data-calc] .cx-pickb { display: inline-flex; align-items: center; gap: 8px; height: 40px; margin-top: 10px; padding: 0 14px 0 12px; border: 0; border-radius: 999px; background: var(--ink); color: #fff; font-size: 13px; font-weight: 700; white-space: nowrap; transition: background .2s var(--ease); }
.cx-pickb svg { flex: none; width: 16px; height: 16px; }
.cx-pickb svg:last-child { width: 15px; height: 15px; stroke-width: 2.2; transition: transform .25s var(--ease); }
.cx-pickb[aria-expanded="true"] { background: #303534; }
.cx-pickb[aria-expanded="true"] svg:last-child { transform: rotate(180deg); }
.cx-pickb:hover { background: #303534; }
/* у дополнительных зон кнопка тише — главная остаётся у основной панели */
.cx-line.is-zone .cx-pickb { background: var(--fill); color: var(--ink); }
.cx-line.is-zone .cx-pickb:hover, .cx-line.is-zone .cx-pickb[aria-expanded="true"] { background: var(--ink); color: #fff; }
.cx-line.is-hero .cx-tile-sw { left: 9px; bottom: 9px; width: 26px; height: 26px; }

/* ————— дополнительная зона ————— */
.cx-line.is-zone { grid-template-columns: 96px minmax(0, 1fr) 176px 120px 34px; grid-template-areas: "zh zh zh zh zh" "img main q t x" ". f f f f"; }
.cx-line.is-zone .cx-line-img { width: 96px; height: 72px; border-radius: 9px; }
.cx-zone-h { grid-area: zh; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: 0 0 12px; min-width: 0; }
.cx-zone-h .cx-zdot { width: 12px; height: 12px; }
.cx-zsel { min-width: 0; max-width: 100%; }
.cx-zsel select { max-width: 100%; height: 36px; padding: 0 32px 0 14px; border: 0; border-radius: 999px; background: var(--fill) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6' fill='none' stroke='%23101111' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 11px center / 13px; color: var(--ink); font-size: 13px !important; font-weight: 700; text-overflow: ellipsis; -webkit-appearance: none; appearance: none; cursor: pointer; }
.cx-zsel select:focus { outline: none; box-shadow: 0 0 0 2px var(--yellow); }
.cx-zarea { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: 999px; background: var(--fill); color: #6b7270; font-size: 12.5px; font-weight: 600; cursor: text; }
.cx-zarea:focus-within { box-shadow: 0 0 0 2px var(--yellow); }
.cx-zarea input { width: 58px; height: 30px; padding: 0; border: 0; outline: none; background: transparent; color: var(--ink); font-size: 14px !important; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
[data-calc] .cx-zdel { display: inline-flex; align-items: center; gap: 5px; height: 36px; margin-left: auto; padding: 0 12px 0 10px; border: 0; border-radius: 999px; background: transparent; color: #6b7270; font-size: 12px; font-weight: 700; white-space: nowrap; transition: background .2s var(--ease), color .2s var(--ease); }
.cx-zdel svg { width: 14px; height: 14px; stroke-width: 2.2; }
.cx-zdel:hover { background: var(--fill); color: var(--ink); }
.cx-zname { color: var(--ink); font-size: 13.5px; }
.cx-zarea-v { color: #6b7270; font-size: 12.5px; font-weight: 600; }
/* «+ Панель для другой зоны» */
/* 2026-11-18 (Лука: «добавить новую зону неудобно»): заголовок и кнопки по типам зон — «+ ცოკოლი», «+ სვეტები»… */
.cx-xadd { display: grid; gap: 10px; padding: 16px 0 4px; border-top: 1px solid var(--cx-line, #eeede7); }
.cx-xadd-h { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; margin: 0; }
.cx-xadd-h b { font-size: 13.5px; font-weight: 700; line-height: 1.3; color: var(--ink); }
.cx-xadd-h small { color: #6b7270; font-size: 12px; font-weight: 500; line-height: 1.4; }
.cx-xadd-chips { display: flex; flex-wrap: wrap; gap: 8px; }
[data-calc] .cx-xchip { display: inline-flex; align-items: center; gap: 7px; min-height: 38px; padding: 0 15px 0 9px; border: 0; border-radius: 999px; background: var(--fill); color: var(--ink); font-size: 13px; font-weight: 700; line-height: 1.2; transition: background .2s var(--ease), color .2s var(--ease); }
.cx-xchip > svg { flex: none; width: 20px; height: 20px; padding: 4px; border-radius: 50%; background: var(--ink); color: var(--yellow-soft); stroke-width: 2.6; transition: background .2s var(--ease), color .2s var(--ease); }
[data-calc] .cx-xchip:hover { background: var(--ink); color: #fff; }
.cx-xchip:hover > svg { background: var(--yellow); color: var(--ink); }

/* ————— подборщик панели: раскрывается в карточке, без окна ————— */
.cx-pick-slot:empty { display: none; }
.cx-picker { padding: 16px 0 6px; border-top: 1px solid var(--cx-line, #eeede7); animation: cx-in .22s var(--ease); }
@keyframes cx-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.cx-pick-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 12px; }
.cx-pick-h { margin: 0 4px 0 2px; font-size: 14px; font-weight: 700; }
.cx-tabs { flex: 0 1 auto; background: var(--fill); }
[data-calc] .cx-tabs button { flex: 0 1 auto; padding: 4px 14px; white-space: nowrap; }
.cx-tabs small { margin-left: 3px; opacity: .55; font-weight: 600; }
.cx-search { display: flex; flex: 1 1 200px; align-items: center; gap: 8px; height: 42px; padding: 0 14px; border-radius: 999px; background: var(--fill); color: #6b7270; }
.cx-search svg { flex: none; width: 17px; height: 17px; }
.cx-search input { flex: 1; min-width: 0; height: 100%; padding: 0; border: 0; outline: none; background: transparent; color: var(--ink); font-size: 14px; }
.cx-search:focus-within { box-shadow: 0 0 0 2px var(--yellow); }
.cx-x { flex: none; display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; background: var(--fill); color: var(--ink); transition: background .2s var(--ease), color .2s var(--ease); }
.cx-x svg { width: 18px; height: 18px; stroke-width: 2; }
.cx-x:hover { background: var(--ink); color: #fff; }
.cx-pick-x { background: var(--fill); }
/* два ряда плиток и краешек третьего — видно, что дальше есть ещё; «показать все» снимает высоту */
.cx-pick-grid { position: relative; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-content: start; gap: 10px; max-height: 470px; margin: 0 -4px; padding: 4px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.cx-picker.is-all .cx-pick-grid { max-height: none; overflow: visible; }
.cx-tile { display: grid; align-content: start; gap: 2px; min-width: 0; padding: 8px 8px 10px; border: 0; border-radius: var(--r-sm); background: var(--fill); color: var(--ink); text-align: left; transition: background .2s var(--ease), color .2s var(--ease); }
.cx-tile-img { position: relative; display: block; aspect-ratio: 4 / 3; margin-bottom: 8px; overflow: hidden; border-radius: 7px; background: #e9e8e1; }
.cx-tile-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s var(--ease); }
.cx-tile:hover .cx-tile-img img { transform: scale(1.04); }
.cx-tile:not([aria-pressed="true"]):hover { background: var(--fill-hover); }
.cx-tile-name { padding: 0 4px; font-size: 13px; font-weight: 700; line-height: 1.25; }
.cx-tile-code { padding: 0 4px; color: #8a908e; font-size: 11px; font-weight: 600; }
.cx-tile-row { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 8px; margin-top: 6px; padding: 0 4px; }
.cx-tile-price { font-family: var(--display); font-size: 14px; font-weight: 700; white-space: nowrap; }
.cx-tile-price small { color: #8a908e; font-family: Inter, Arial, sans-serif; font-size: 11px; font-weight: 600; }
.cx-tile .cx-st { font-size: 11px; }
.cx-tile[aria-pressed="true"] { background: var(--ink); color: #fff; }
.cx-tile[aria-pressed="true"] .cx-tile-code, .cx-tile[aria-pressed="true"] .cx-tile-price small, .cx-tile[aria-pressed="true"] .cx-st { color: rgba(255, 255, 255, .62); }
.cx-tile[aria-pressed="true"] .cx-st::before { background: var(--yellow-soft); }
.cx-tile[aria-pressed="true"] .cx-tile-price { color: var(--yellow-soft); }
.cx-pick-empty { margin: 4px 2px 6px; color: #6b7270; font-size: 14px; }
[data-calc] .cx-pick-all { display: block; height: 38px; margin: 10px auto 0; padding: 0 18px; border: 0; border-radius: 999px; background: var(--fill); color: var(--ink); font-size: 12.5px; font-weight: 700; transition: background .2s var(--ease), color .2s var(--ease); }
.cx-pick-all:hover { background: var(--ink); color: #fff; }

/* предупреждения: в карточке своего этапа и общие — под этапами */
.cx-warn { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.cx-stage .cx-warn { margin-top: 10px; }
.cx-warn li { position: relative; padding: 10px 14px 10px 38px; border-radius: var(--r-sm); background: #fbf1da; color: #6b4f10; font-size: 12.5px; line-height: 1.45; }
.cx-warn li::before { content: "!"; position: absolute; top: 10px; left: 12px; display: grid; place-items: center; width: 17px; height: 17px; border-radius: 50%; background: var(--yellow); color: var(--ink); font-size: 11px; font-weight: 800; line-height: 1; }

/* ————— под этапами: вопрос AI, что не входит, оговорка ————— */
.cx-inc { display: grid; gap: 16px; min-width: 0; padding: 22px 24px 24px; border-radius: var(--r); background: #fff; }
/* «спросить AI»: тёмная плашка, как кнопка Urban AI */
.cx-aibox { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 14px; color: var(--ink); }
.cx-aibox-i { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--ink); color: var(--yellow); }
.cx-aibox-i .cx-spark { width: 20px; height: 20px; }
.cx-aibox-t { display: grid; gap: 4px; min-width: 0; }
[data-calc] .cx-aibox-h { justify-self: start; padding: 0; border: 0; background: none; color: var(--ink); font-family: var(--display); font-size: 17px; font-weight: 600; line-height: 1.3; text-align: left; transition: color .2s var(--ease); }
.cx-aibox-h span { color: var(--gold-ink); }
.cx-aibox-h:hover { color: var(--gold-ink); }
.cx-aibox p { margin: 0; color: #6b7270; font-size: 12.5px; line-height: 1.45; }
.cx-aibox-q { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
[data-calc] .cx-aibox .cx-aiq { min-height: 32px; padding: 6px 13px; background: var(--fill); color: #3a4140; }
[data-calc] .cx-aibox .cx-aiq:hover { background: var(--yellow-soft); color: var(--ink); }
.cx-notes { padding-top: 16px; border-top: 1px solid var(--cx-line, #eeede7); }
.cx-notes-k { margin: 0 0 8px; color: #6b7270; font-size: 12px; font-weight: 700; }
.cx-notes ul { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.cx-notes li { padding: 6px 11px; border-radius: 999px; background: var(--fill); color: #4a5150; font-size: 12px; line-height: 1.4; }
.cx-disc { margin: 0; color: #7a807e; font-size: 12px; line-height: 1.55; }

/* визит в шоурум — в конце левой колонки */
.cx-vcard { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 18px; align-items: center; padding: 22px 24px; border-radius: var(--r); background: #fff; }
.cx-vcard-i { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 14px; background: var(--yellow-soft); color: var(--ink); }
.cx-vcard-i svg { width: 26px; height: 26px; }
.cx-vcard-t { min-width: 0; }
.cx-vcard h2 { margin: 0; font-family: var(--display); font-size: 20px; line-height: 1.2; letter-spacing: -.01em; font-weight: 700; }
.cx-vcard h2 em { font-family: var(--display); font-style: normal; color: var(--gold-ink); }
.cx-vcard p { margin: 6px 0 0; color: #59605f; font-size: 13.5px; line-height: 1.5; }
.cx-vcard-a { display: grid; justify-items: center; gap: 6px; }
.cx-vcard-a .button { min-height: 50px; padding: 12px 20px; font-size: 13px; gap: 10px; white-space: nowrap; }
.cx-vcard-a small { color: #6b7270; font-size: 11.5px; font-weight: 600; text-align: center; }
.cx-vcard-a small.is-slot { color: var(--gold-ink); }

/* календарь в нижней полосе (видна только на телефоне) */
.cx-bar-ic { flex: none; display: grid; place-items: center; width: 46px; height: 46px; border: 0; border-radius: var(--r-sm); background: rgba(255, 255, 255, .1); color: #fff; cursor: pointer; transition: background .2s var(--ease), color .2s var(--ease); }
.cx-bar-ic svg { width: 22px; height: 22px; }
.cx-bar-ic:hover { background: var(--yellow-soft); color: var(--ink); }

/* ————— окна: предложение, визит ————— */
.cx-dlg { width: min(560px, calc(100% - 32px)); max-width: none; max-height: none; padding: 0; border: 0; border-radius: 18px; background: #fff; color: var(--ink); overflow: hidden; }
.cx-dlg::backdrop { background: rgba(16, 17, 17, .5); backdrop-filter: blur(3px); }
.cx-dlg[open] { animation: cx-pop .24s var(--ease); }
.cx-dlg:not([open]) { display: none; }
@keyframes cx-pop { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes cx-up { from { transform: translateY(100%); } to { transform: none; } }
.cx-dlg-in { box-sizing: border-box; max-height: min(88vh, 860px); padding: 22px 24px 26px; overflow-y: auto; overscroll-behavior: contain; }
.cx-dlg-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.cx-dlg h2 { margin: 4px 0 0; font-family: var(--display); font-size: 26px; line-height: 1.12; letter-spacing: -.02em; font-weight: 700; }
.cx-dlg-text { margin: 8px 0 16px; color: #59605f; font-size: 14px; line-height: 1.55; }
.cx-dlg-sum { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 6px; margin: 0 0 18px; padding: 12px 14px; border-radius: var(--r-sm); background: var(--fill); color: #4a5150; font-size: 13px; line-height: 1.4; }
.cx-dlg-sum b { color: var(--ink); }
.cx-dlg-sum strong { margin-left: auto; color: var(--ink); font-family: var(--display); font-size: 17px; white-space: nowrap; }

/* формы в окнах */
.cx-form { display: grid; gap: 12px; }
.cx-form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.cx-field { display: grid; gap: 6px; min-width: 0; }
.cx-field > span { color: #4a5150; font-size: 12px; font-weight: 700; }
.cx-field small { color: #8a908e; font-weight: 600; }
.cx-field input, .cx-phone select { width: 100%; height: 50px; padding: 0 14px; border: 0; border-radius: var(--r-sm); outline: none; background: var(--fill); color: var(--ink); font-size: 15px; }
.cx-field input:focus, .cx-phone select:focus { background: #fff; box-shadow: 0 0 0 2px var(--yellow); }
.cx-phone { display: flex; gap: 8px; }
.cx-phone select { flex: none; width: 112px; padding: 0 8px 0 12px; font-size: 13px; font-weight: 700; cursor: pointer; }
.cx-phone input { flex: 1; min-width: 0; }
.cx-consent { display: flex; align-items: flex-start; gap: 10px; color: #59605f; font-size: 12.5px; line-height: 1.45; cursor: pointer; }
.cx-consent input { flex: none; width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--ink); }
.cx-consent a { color: var(--gold-ink); text-decoration: underline; text-underline-offset: 2px; }
.cx-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.cx-error { margin: 0; padding: 10px 14px; border-radius: var(--r-sm); background: #fbe6e1; color: #8f2d1b; font-size: 13px; }
.cx-hint { margin: 0; color: #7a807e; font-size: 12.5px; line-height: 1.5; }
.cx-submit { width: 100%; min-height: 52px; font-size: 13.5px; gap: 10px; }
.cx-saved { display: grid; gap: 10px; }
.cx-saved-t { margin: 0; font-family: var(--display); font-size: 20px; font-weight: 700; }
.cx-saved-code { margin: 0; color: #4a5150; font-size: 13.5px; line-height: 1.5; }
.cx-linkrow { display: flex; gap: 8px; }
.cx-linkrow input { flex: 1; min-width: 0; height: 46px; padding: 0 12px; border: 0; border-radius: var(--r-sm); outline: none; background: var(--fill); color: var(--ink); font-size: 13px; }
.cx-linkrow .button { min-height: 46px; }
.cx-open { justify-self: start; color: var(--gold-ink); font-size: 13px; font-weight: 700; }
.cx-open:hover { color: var(--ink); }
.cx-changed { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; border-radius: var(--r-sm); background: #fbf1da; color: #6b4f10; font-size: 12.5px; }
.cx-mini { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border: 0; border-radius: 8px; background: #fff; color: #3a4140; font-size: 12px; font-weight: 700; white-space: nowrap; transition: background .2s var(--ease), color .2s var(--ease); }
.cx-mini:hover { background: var(--ink); color: #fff; }
.cx-mini-d { background: var(--ink); color: #fff; }
.cx-mini-d:hover { background: #303534; }

/* слоты визита */
.cx-office { margin: -6px 0 16px; color: #4a5150; font-size: 13px; line-height: 1.5; }
.cx-office a { color: var(--gold-ink); font-weight: 700; }
.cx-slots .cx-k { margin: 0 0 8px; color: #6b7270; font-size: 12.5px; font-weight: 700; }
.cx-days { display: flex; gap: 8px; margin: 0 0 16px; padding-bottom: 4px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.cx-days::-webkit-scrollbar { display: none; }
.cx-day { flex: none; display: grid; justify-items: center; gap: 1px; width: 62px; padding: 9px 0; border: 0; border-radius: var(--r-sm); background: var(--fill); color: var(--ink); transition: background .2s var(--ease), color .2s var(--ease); }
.cx-day small { color: #6b7270; font-size: 11px; font-weight: 700; }
.cx-day b { font-family: var(--display); font-size: 19px; line-height: 1.15; }
.cx-day:hover { background: var(--fill-hover); }
.cx-day[aria-pressed="true"] { background: var(--ink); color: #fff; }
.cx-day[aria-pressed="true"] small { color: var(--yellow-soft); }
.cx-day:disabled { opacity: .4; cursor: default; }
.cx-times { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.cx-time { min-width: 76px; height: 42px; padding: 0 14px; border: 0; border-radius: var(--r-sm); background: var(--fill); color: var(--ink); font-size: 14px; font-weight: 700; transition: background .2s var(--ease); }
.cx-time:hover { background: var(--fill-hover); }
.cx-time[aria-pressed="true"] { background: var(--yellow); }
.cx-time:disabled { opacity: .35; text-decoration: line-through; cursor: default; }
.cx-fallback { margin: 0; padding: 14px 16px; border-radius: var(--r-sm); background: var(--fill); font-size: 14px; line-height: 1.5; }
.cx-fallback a { color: var(--gold-ink); font-weight: 700; white-space: nowrap; }

/* ————— встроенный под результатом визуализации (/private-houses, viz-block.js) ————— */
.cx-body.is-embed { padding: 0; }
.cx-body.is-embed .cx-kit-head { padding-top: 6px; }

/* ————— нижняя полоса — только на телефоне и планшете ————— */
.cx-bar { display: none; }

@media (max-width: 1180px) {
  .cx-grid { grid-template-columns: minmax(0, 1fr) 356px; }
  .cx-rows { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .cx-price { padding: 20px 18px 16px; }
  .cx-per { font-size: 40px; }
}

/* строка в две ступени: узкая левая колонка рядом с ценой (981–1120 px) и телефоны —
   товар на всю ширину, ниже количество, сумма и «убрать», ещё ниже формула */
@media (min-width: 981px) and (max-width: 1120px), (max-width: 680px) {
  .cx-line, .cx-line.is-hero, .cx-line.is-zone { grid-template-columns: 52px minmax(0, 1fr) auto auto; grid-template-areas: "img main main main" "q q t x" "f f f f" "alts alts alts alts"; row-gap: 10px; }
  .cx-line.is-hero { grid-template-columns: 96px minmax(0, 1fr) auto auto; }
  .cx-line.is-hero .cx-line-img { width: 96px; height: 72px; }
  .cx-line.is-zone { grid-template-columns: 72px minmax(0, 1fr) auto auto; grid-template-areas: "zh zh zh zh" "img main main main" "q q t x" "f f f f"; }
  .cx-line.is-zone .cx-line-img { width: 72px; height: 54px; }
  .cx-zone-h { margin-bottom: 2px; }
  .cx-line-q { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
  .cx-line-u { text-align: left; }
  .cx-line-t, .cx-line-x { align-self: center; padding-top: 0; }
  .cx-f, .cx-alts { margin-top: 0; }
}

/* невысокое окно: разбивку по этапам убираем из липкой карточки — она есть слева */
@media (min-width: 981px) and (max-height: 700px) {
  .cx-break, .cx-ai-chips { display: none; }
  .cx-per { font-size: 36px; }
  .cx-tot { margin-top: 12px; }
}

@media (max-width: 980px) {
  .page-calc .container { width: calc(100% - 32px); }
  .cx-head { padding-top: 88px; }
  .cx-body { padding: 16px 0 calc(var(--uh-dock-b, 16px) + var(--uh-dock-size, 52px) + 104px); }
  .cx-body.is-embed { padding: 0; }
  /* порядок на телефоне: площадь → цена → стена и проект → этапы → сноски → визит */
  .cx-grid { display: flex; flex-direction: column; gap: 12px; }
  .cx-main, .cx-cfg, .cx-side { display: contents; }
  .cx-blk-area { order: 1; }
  .cx-sticky { order: 2; position: static; max-height: none; overflow: visible; }
  .cx-rows { order: 3; }
  .cx-kit { order: 4; }
  .cx-inc { order: 5; }
  .cx-vcard { order: 6; }
  .cx-blk { padding: 20px 18px; border-radius: var(--r); background: #fff; }
  .cx-kit-head { padding-top: 6px; }
  .is-snapshot .cx-blk { opacity: .55; }
  .cx-per { font-size: 44px; }
  .cx-bar { display: block; position: fixed; right: 12px; bottom: calc(var(--uh-dock-b, 16px) + var(--uh-dock-size, 52px) + 10px); left: 12px; z-index: 22; transform: translateY(150%); opacity: 0; pointer-events: none; transition: transform .35s var(--ease), opacity .35s var(--ease); }
  .cx-bar.is-on { transform: none; opacity: 1; pointer-events: auto; }
  .cx-bar-in { display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 16px; border-radius: var(--r); background: var(--dark); color: #fff; }
  .cx-bar-sum { display: grid; flex: 1; min-width: 0; }
  .cx-bar-sum small { overflow: hidden; color: rgba(255, 255, 255, .62); font-size: 11.5px; font-weight: 600; white-space: nowrap; text-overflow: ellipsis; }
  .cx-bar-sum b { overflow: hidden; font-family: var(--display); font-size: 18px; white-space: nowrap; text-overflow: ellipsis; }
  .cx-bar .button { flex: none; min-height: 46px; border-radius: var(--r-sm); background: var(--yellow); color: var(--ink); }
  .cx-bar .money .m-gel { display: none; }
  :root[data-cur="gel"] .cx-bar .money .m-usd { display: none; }
  :root[data-cur="gel"] .cx-bar .money .m-gel { display: inline; }
  body.uh-ai-open .cx-bar, body.nav-open .cx-bar, html.cx-lock .cx-bar { display: none; }
}

@media (max-width: 680px) {
  .cx-head h1 { font-size: clamp(30px, 8.6vw, 40px); }
  .cx-lead { font-size: 14.5px; }
  .cx-from { padding-right: 14px; font-size: 12.5px; }
  .cx-blk, .cx-inc { padding: 18px 16px; }
  .cx-card-h { margin-bottom: 16px; }
  .cx-price { padding: 18px 16px 16px; }
  .cx-per { font-size: 42px; }
  /* разбивка по этапам — ниже, в карточках этапов; здесь цена и кнопки помещаются в первый экран */
  .cx-break { display: none; }
  .cx-step { width: 56px; height: 60px; }
  .cx-area-field { height: 60px; padding: 0 12px; }
  .cx-area-field input { font-size: 32px !important; }
  .cx-presets { gap: 5px; }
  [data-calc] .cx-presets button { height: 44px; font-size: 13.5px; }
  .cx-presets small { display: none; }
  /* четыре стены — 2 × 2, все подписи целиком; кнопки не ниже 44 px */
  .cx-seg.is-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px; border-radius: 18px; }
  [data-calc] .cx-seg.is-4 button { border-radius: 14px; }
  [data-calc] .cx-seg button { min-height: 44px; padding: 4px 6px; font-size: 13.5px; }
  .cx-kit-head h2 { font-size: 22px; }
  .cx-kit-lead { font-size: 13px; }
  [data-calc] .cx-stage-tg { grid-template-columns: 30px minmax(0, 1fr) 30px; grid-template-areas: "b t c" ". tot ."; gap: 6px 12px; padding: 16px 14px; }
  .cx-badge { width: 30px; height: 30px; font-size: 14px; }
  .cx-stage-n { font-size: 18px; }
  .cx-stage-d { font-size: 12.5px; }
  .cx-stage-tot { padding-top: 2px; font-size: 17px; text-align: left; }
  .cx-stage-b { padding: 0 14px 14px; }
  .cx-stage > .cx-warn { margin: 0 14px 14px; }
  .cx-stage-ctl { margin: 0 0 12px; }
  .cx-seg-ins { display: flex; min-width: 0; width: 100%; }
  .cx-line { padding: 14px 0; column-gap: 12px; }
  .cx-line-img { width: 44px; height: 44px; }
  .cx-line, .cx-line.is-hero, .cx-line.is-zone { grid-template-columns: 44px minmax(0, 1fr) auto auto; }
  .cx-line.is-hero { grid-template-columns: 76px minmax(0, 1fr) auto auto; }
  .cx-line.is-hero .cx-line-img { width: 76px; height: 57px; }
  .cx-line.is-zone { grid-template-columns: 64px minmax(0, 1fr) auto auto; }
  .cx-line.is-zone .cx-line-img { width: 64px; height: 48px; }
  .cx-hero-name { font-size: 16px; }
  .cx-line.is-hero .cx-tile-sw { left: 6px; bottom: 6px; width: 18px; height: 18px; }
  /* поля и кнопки в строках — не меньше 44 px; количество и цена за единицу — столбиком, сумма справа */
  .cx-line-q { display: grid; justify-items: start; gap: 4px; }
  .cx-line-t { align-self: start; padding-top: 11px; }
  .cx-line-x { align-self: start; }
  .cx-qin { height: 44px; }
  .cx-qin input { width: 76px; height: 40px; font-size: 16px !important; }
  .cx-rm { width: 44px; height: 44px; }
  .cx-man { padding: 0 0 0 10px; }
  .cx-man-r { width: 44px; height: 44px; }
  [data-calc] .cx-swap { min-height: 44px; }
  /* остальные кнопки на телефоне — тоже не меньше 44 px */
  [data-calc] .cx-how { height: 44px; }
  .cx-studio { min-height: 44px; align-items: center; }
  .cx-switch { min-height: 44px; }
  [data-calc] .cx-pick-all { height: 44px; }
  [data-calc] .cx-aibox-h { min-height: 44px; }
  .cx-cur button { width: 44px; height: 40px; }
  [data-calc] .cx-aiq { min-height: 40px; }
  /* формула: множители и под ними результат «= 133,9 м» отдельной строкой */
  .cx-f { flex-wrap: wrap; gap: 4px 10px; padding: 2px 8px 8px 10px; }
  .cx-f-i { display: none; }
  .cx-f-x { flex: 1 1 100%; line-height: 50px; }
  .cx-f-x [data-f-r] { display: block; margin-top: -8px; line-height: 1.45; }
  .cx-f.is-ro .cx-f-x { line-height: 1.5; }
  .cx-fx { width: 64px; height: 44px; font-size: 16px !important; }
  [data-calc] .cx-f-reset { height: 44px; margin-left: auto; }
  /* зона: точка и тип — первой строкой, площадь и «убрать» — второй */
  .cx-zone-h { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; align-items: center; gap: 8px 10px; }
  .cx-zsel { grid-column: 2 / 4; }
  .cx-zarea { grid-column: 1 / 3; justify-self: start; }
  [data-calc] .cx-zdel { grid-column: 3; margin-left: 0; }
  [data-calc] .cx-alt { min-height: 48px; }
  [data-calc] .cx-chip { min-height: 44px; }
  /* «Выбрать другую панель» — во всю ширину; длинная подпись (ru, ka) переносится, а не вылезает из карточки */
  [data-calc] .cx-pickb { width: 100%; height: auto; min-height: 44px; padding: 8px 14px 8px 12px; justify-content: center; line-height: 1.25; text-align: center; white-space: normal; }
  .cx-zsel, .cx-zsel select { width: 100%; }
  .cx-zsel select { height: 44px; font-size: 16px !important; }
  .cx-zarea { height: 44px; }
  .cx-zarea input { font-size: 16px !important; }
  [data-calc] .cx-zdel { height: 44px; }
  .cx-pick-bar { gap: 8px; }
  .cx-pick-h { flex: 1 1 auto; }
  .cx-tabs { order: 3; flex: 1 1 100%; }
  [data-calc] .cx-tabs button { flex: 1 1 0; min-height: 44px; padding: 4px 8px; white-space: normal; }
  .cx-tabs small { display: none; }
  .cx-search { order: 4; flex: 1 1 100%; height: 44px; }
  .cx-search input { font-size: 16px; }
  .cx-pick-x { width: 44px; height: 44px; }
  .cx-pick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; max-height: 540px; }
  .cx-tile-row { flex-direction: column; align-items: flex-start; gap: 2px; }
  .cx-picker { padding: 14px 0 4px; }
  .cx-aibox { grid-template-columns: 32px minmax(0, 1fr); gap: 12px; }
  .cx-aibox-i { width: 32px; height: 32px; }
  .cx-aibox-i .cx-spark { width: 17px; height: 17px; }
  .cx-aibox-h { font-size: 16px; }
  .cx-vcard { grid-template-columns: 48px minmax(0, 1fr); align-items: start; gap: 14px; padding: 18px 16px; }
  .cx-vcard-i { width: 48px; height: 48px; border-radius: 12px; }
  .cx-vcard h2 { font-size: 18px; }
  .cx-vcard-a { grid-column: 1 / -1; justify-items: stretch; }
  .cx-vcard-a .button { width: 100%; }
  /* окна — шторкой снизу */
  .cx-dlg { width: 100%; margin: auto 0 0; border-radius: 18px 18px 0 0; }
  .cx-dlg[open] { animation: cx-up .3s var(--ease); }
  .cx-dlg-in { max-height: 90vh; padding: 18px 16px calc(22px + env(safe-area-inset-bottom)); }
  .cx-dlg h2 { font-size: 22px; }
  .cx-form-row { grid-template-columns: minmax(0, 1fr); }
}

/* узкий телефон: панель крупно — фото во всю ширину сверху, под ним название, наличие, толщины и
   подборщик (рядом с фото 76 px им тесно: на 360–390 px «Выбрать другую панель» вылезала из карточки) */
@media (max-width: 480px) {
  .cx-line.is-hero { grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: "img img img" "main main main" "q t x" "f f f"; }
  .cx-line.is-hero .cx-line-img { width: 100%; height: auto; aspect-ratio: 16 / 9; }
  .cx-line.is-hero .cx-tile-sw { left: 10px; bottom: 10px; width: 26px; height: 26px; }
}

@media (prefers-reduced-motion: reduce) {
  .cx-picker, .cx-dlg[open] { animation: none; }
  .cx-tile-img img, .cx-pickb svg, .cx-stages { transition: none; }
}
