/* [c13] Калькулятор из c4: раскладка, сцена с 3D-моделью, управление и результат — как в c4 (белая сцена из c12).
   Шрифт, цвета, кнопки, переключатели, ползунки и поля — из base.css (система c11): карточки белые на тёплой полосе,
   выбранное — чёрная пилюля, цифры — Manrope 500, графики — светлым оранжевым, главная кнопка — чёрная пилюля. */

.c4 .cfg { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap); row-gap: var(--gap); }
.c4 .lbl { font-size: var(--fs-s); font-weight: 500; line-height: 1.35; }
.c4 .cfg__stagewrap { grid-column: 1 / span 8; grid-row: 1; }
.c4 .cfg__stage { position: sticky; top: calc(var(--hdr) - 6px); align-self: start; height: clamp(420px, calc(100svh - var(--hdr) - 210px), 860px);
  background: radial-gradient(120% 90% at 60% 30%, #fff, var(--soft) 75%); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; color: var(--ink); }
.c4 .cfg__stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; touch-action: pan-y; }
.c4 .cfg__overlay { position: absolute; inset: 0; pointer-events: none; padding: clamp(16px, 1.6vw, 40px); display: grid; grid-template-rows: auto 1fr auto; }
.c4 .cfg__readout { display: flex; gap: 14px; color: var(--ink-3); }
.c4 .cfg__readout span + span::before { content: '·'; margin-right: 14px; }
.c4 .cfg__big { align-self: end; display: flex; align-items: flex-end; gap: 14px; }
.c4 .cfg__big b { font-size: var(--t-num); font-weight: 500; line-height: .82; letter-spacing: -.05em; font-variant-numeric: tabular-nums; }
.c4 .cfg__big span { font-size: var(--t-h3); font-weight: 500; line-height: 1.15; padding-bottom: .15em; }
.c4 .cfg__big em { font-style: normal; color: var(--sun); }
.c4 .cfg__compass { position: absolute; right: clamp(16px, 1.6vw, 40px); top: clamp(16px, 1.6vw, 40px); width: clamp(84px, 7vw, 130px); }
.c4 .cfg__compass svg { width: 100%; overflow: visible; }
.c4 .cfg__compass circle { fill: #fff; stroke: var(--line); }
.c4 .cfg__compass text { fill: var(--ink-2); font: 600 11px var(--font); text-anchor: middle; dominant-baseline: middle; }
.c4 #compassNeedle { fill: var(--sun); transition: transform .5s var(--ease); }
.c4 #compassTicks line { stroke: var(--ink-3); }
.c4 .cfg__hint { color: var(--ink-3); margin: 10px 0 0; justify-self: end; text-align: right; max-width: 28em; font-weight: 400; }

/* управление: белые карточки, переключатели — общие */
.c4 .cfg__ctl { grid-column: 9 / span 4; display: flex; flex-direction: column; gap: 10px; }
.c4 .cfg__ctl > .seg { margin-bottom: 4px; }
.c4 .field { background: #fff; border-radius: var(--r-s); padding: clamp(14px, 1.2vw, 30px); border: 1px solid transparent; }
.c4 .field__l { color: var(--ink-2); display: block; margin-bottom: 10px; }
.c4 .field__top { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }
.c4 .field__top .field__l { margin: 0; }
.c4 .field__v { font-size: var(--fs); font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.c4 .field__v--big { font-size: var(--t-num-s); font-weight: 500; letter-spacing: -.03em; margin: 6px 0 10px; }
.c4 .cfg .num { width: 5.4ch; font: inherit; color: inherit; border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: right; padding: 2px 0; border-radius: 0; -moz-appearance: textfield; }
.c4 .cfg .num::-webkit-inner-spin-button { -webkit-appearance: none; }
.c4 .cfg .num:focus { outline: 0; border-color: var(--ink); }
.c4 .field__v--big .num { width: 5ch; text-align: left; }
.c4 .num--s { width: 3.6ch; }
.c4 .row2 { display: grid; grid-template-columns: 1fr 1.5fr; gap: 10px; }
.c4 .row2 .field { padding: 12px; }
.c4 .row2 .seg button { font-size: var(--fs-s); padding: .4em .3em; }
.c4 .seg--5 { margin-bottom: 4px; }
.c4 .seg--5 button { padding: .4em .2em; }
.c4 .seg--sm { flex: 0 0 auto; }
.c4 .seg--sm button { min-height: 36px; padding: 0 14px; }
.c4 .cfg .link { background: none; border: 0; padding: 6px 0 0; color: var(--ink); cursor: pointer; text-decoration: underline; text-decoration-color: var(--sun); text-decoration-thickness: 1.5px; text-underline-offset: 4px; font-weight: 500; }
.c4 .dims { display: flex; align-items: end; gap: 10px; margin-top: 10px; font-size: var(--fs-s); }
.c4 .dims label { display: flex; flex-direction: column; gap: 4px; color: var(--ink-3); }
.c4 .dims .num { width: 6ch; text-align: left; font-size: var(--fs); font-weight: 600; color: var(--ink); }
.c4 .pane { display: flex; flex-direction: column; gap: 10px; }
.c4 .appl { background: #fff; border-radius: var(--r-s); padding: clamp(14px, 1.2vw, 30px); }
.c4 .appl summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 10px; color: var(--ink); }
.c4 .appl summary::-webkit-details-marker { display: none; }
.c4 .appl summary::after { content: ''; width: 22px; height: 22px; flex: none; background: linear-gradient(currentColor, currentColor) center/16px 1.5px no-repeat, linear-gradient(currentColor, currentColor) center/1.5px 16px no-repeat; }
.c4 .appl[open] summary::after { background: linear-gradient(currentColor, currentColor) center/16px 1.5px no-repeat; }
.c4 .appl__list { display: flex; flex-direction: column; margin-top: 10px; }
.c4 .ap { display: grid; grid-template-columns: 26px 1fr 52px 64px 52px; gap: 6px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line-2); font-size: var(--fs-s); }
.c4 .ap input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--ink); }
.c4 .ap .num { width: 100%; font-size: var(--fs-s); }
.c4 .ap__h { color: var(--ink-3); font-size: var(--t-eyebrow); }
.c4 .ap.is-off { opacity: .45; }
.c4 .appl__note { color: var(--ink-3); margin: 10px 0 0; font-weight: 400; }
.c4 .field.is-need { border-color: var(--sun); }

/* результат: чёрная карточка с главными цифрами, белые карточки графика и состава */
.c4 .cfg__res { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap); row-gap: var(--gap); margin-bottom: 4px; }
.c4 .res__main { grid-column: 1 / span 5; background: var(--ink); color: #fff; border-radius: var(--r); padding: clamp(20px, 2vw, 52px); display: flex; flex-direction: column; justify-content: space-between; gap: 20px; }
.c4 .res__hero small { display: block; color: var(--text-d); margin-bottom: 8px; font-size: var(--fs-s); }
.c4 .res__hero b { display: block; font-size: var(--t-num); font-weight: 500; line-height: .86; letter-spacing: -.05em; font-variant-numeric: tabular-nums; }
.c4 .res__hero b i { font-style: normal; font-size: var(--t-h3); letter-spacing: -.01em; margin-left: 8px; color: var(--sun); }
.c4 .res__hero p { margin: 12px 0 0; color: var(--text-d); font-size: var(--fs-s); max-width: 34em; }
.c4 .res__cells { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line-d); }
.c4 .res__cells div { padding: 12px 10px 0 0; }
.c4 .res__cells div + div { padding-left: 12px; border-left: 1px solid var(--line-d); }
.c4 .res__cells small { display: block; color: var(--text-d); font-size: var(--fs-s); margin-bottom: 6px; }
.c4 .res__cells b { font-size: var(--t-num-m); font-weight: 500; line-height: 1.05; letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.c4 .res__chart { grid-column: 6 / span 4; background: #fff; border-radius: var(--r); padding: clamp(18px, 1.6vw, 40px); display: flex; flex-direction: column; }
.c4 .res__chart-h { display: flex; justify-content: space-between; color: var(--ink-2); }
.c4 .res__chart-h span:last-child { color: var(--ink); font-weight: 600; }
.c4 .res__bars { flex: 1; min-height: 200px; display: grid; grid-template-columns: repeat(12, 1fr); gap: 4px; align-items: end; margin-top: 18px; }
.c4 .rb { height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: stretch; gap: 6px; }
.c4 .rb i { display: block; height: var(--h); background: var(--sun-2); border-radius: 4px 4px 1px 1px; transition: height .6s var(--ease); }
.c4 .rb span { font-size: var(--t-micro); text-align: center; color: var(--ink-3); }
.c4 .res__use { position: absolute; left: 0; right: 0; border-top: 1.5px dashed var(--ink); pointer-events: none; transition: bottom .6s; }
.c4 .res__use span { position: absolute; right: 0; bottom: 4px; font-size: var(--t-eyebrow); background: #fff; padding: 2px 4px; }
.c4 .res__kit { grid-column: 10 / span 3; background: #fff; border-radius: var(--r); padding: clamp(18px, 1.6vw, 40px); }
.c4 .res__kit-h { color: var(--ink-2); margin: 0 0 8px; }
.c4 .res__kit li { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: var(--fs-s); }
.c4 .res__kit li b { font-weight: 600; white-space: nowrap; }
.c4 .res__kit li:last-child { border: 0; }
.c4 .res__hero .need { color: var(--sun); font-weight: 600; }

/* плашка с ценой — липкая, белая, кнопка — основная чёрная пилюля */
.c4 .cfg__bar { grid-column: 1 / -1; position: sticky; bottom: 16px; z-index: 3; display: grid; grid-template-columns: auto 1fr auto; gap: clamp(14px, 2vw, 40px); align-items: center; background: #fff; border-radius: 999px; padding: 10px 10px 10px clamp(20px, 2vw, 44px); box-shadow: 0 12px 40px -18px rgba(23, 24, 26, .35), 0 0 0 1px var(--line-2); }
.c4 .cfg__price small { display: block; color: var(--ink-3); font-size: var(--fs-s); }
.c4 .cfg__price b { display: block; font-size: var(--t-num-m); font-weight: 500; line-height: 1.05; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.c4 .cfg__price span { color: var(--ink-3); font-size: var(--fs-s); font-weight: 400; }
.c4 .cfg__pb { display: flex; gap: clamp(14px, 2vw, 40px); }
.c4 .cfg__pb div small { display: block; color: var(--ink-3); font-size: var(--fs-s); }
.c4 .cfg__pb div b { font-size: var(--t-h4); font-weight: 500; line-height: 1.1; letter-spacing: -.02em; }

@media (max-width: 1360px) {
  .c4 .res__main { grid-column: 1 / span 6; }
  .c4 .res__chart { grid-column: 7 / span 6; }
  .c4 .res__kit { grid-column: 1 / -1; }
  .c4 .res__kit ul { columns: 2; column-gap: var(--gap); }
}
@media (max-width: 900px) {
  .c4 .cfg__stagewrap { grid-column: 1 / -1; grid-row: auto; }
  .c4 .cfg__stage { position: relative; top: auto; height: min(56svh, 470px); min-height: 340px; }
  .c4 .cfg__big b { font-size: var(--t-num); }
  .c4 .cfg__big span { font-size: var(--fs); }
  .c4 .res__cells b { font-size: var(--fs); white-space: normal; }
  .c4 .cfg__ctl { grid-column: 1 / -1; }
  .c4 .res__main, .c4 .res__chart, .c4 .res__kit { grid-column: 1 / -1; }
  .c4 .res__kit ul { columns: 1; }
  .c4 .cfg__bar { grid-template-columns: 1fr auto; padding: 8px 8px 8px 18px; bottom: 12px; }
  .c4 .cfg__pb { display: none; }
  .c4 .cfg__bar .btn { height: 52px; padding: 0 18px; font-size: var(--fs-s); white-space: normal; text-align: left; max-width: 190px; line-height: 1.15; gap: .6em; }
  .c4 .cfg__price b { font-size: var(--t-h4); white-space: nowrap; }
  .c4 .cfg__price span { display: none; }
  .c4 .ap { grid-template-columns: 26px 1fr 46px 58px 46px; }
}
@media (max-width: 480px) {
  .c4 .row2 { grid-template-columns: 1fr; }
  .c4 .cfg__readout { flex-direction: column; gap: 2px; }
  .c4 .cfg__readout span + span::before { display: none; }
}
