/* Расчёт уставок — компоненты в дизайн-системе шаблона kit.
   Переменные (--firmennyy-siniy, --svetlosiniy, --siniy, --krasnyy, --zelenyy,
   --font-family) приходят из style.css шаблона. */

.calc { font-family: var(--font-family); color: #000; width: 100%; }
.calc *, .calc *:before, .calc *:after { box-sizing: border-box; }
.calc__lead { font-size: 14px; line-height: 155%; margin-bottom: 30px; max-width: 900px; }

/* ---------------------------------------------------------- выбор расчёта */
.calc-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.calc-card { border: 1px solid var(--siniy); background: #fff; display: flex; flex-direction: column; }
.calc-card__top { background: var(--svetlosiniy); padding: 26px 24px; display: flex; align-items: center; gap: 18px; border-bottom: 1px solid var(--siniy); }
.calc-card__ico { width: 56px; height: 56px; min-width: 56px; border: 1px solid var(--siniy); background: #fff; display: flex; align-items: center; justify-content: center; color: var(--firmennyy-siniy); }
.calc-card__name { font-weight: 600; font-size: 18px; line-height: 120%; color: var(--firmennyy-siniy); }
.calc-card__sub { font-size: 12px; line-height: 130%; color: #737d8b; margin-top: 5px; }
.calc-card__body { padding: 22px 24px; display: flex; flex-direction: column; gap: 14px; flex: 1; }
.calc-card__text { font-size: 14px; line-height: 150%; }
.calc-card__params { display: flex; flex-direction: column; gap: 7px; margin-top: auto; }
.calc-card__param { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; border-bottom: 1px dashed #d1d7e0; padding-bottom: 6px; }
.calc-card__param span:last-child { color: #737d8b; text-align: right; }
.calc-card__foot { padding: 0 24px 24px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }

/* ---------------------------------------------------------------- кнопки */
.calc-btn { display: inline-flex; align-items: center; justify-content: center; gap: 9px; border: 1px solid var(--siniy); padding: 14px 24px; background: #2464b9; font-weight: 400; font-size: 14px; line-height: 114%; text-align: center; color: #fff; cursor: pointer; transition: all .2s ease; text-decoration: none; }
.calc-btn:hover { background: var(--firmennyy-siniy); color: #fff; }
.calc-btn--ghost { background: #fff; color: var(--firmennyy-siniy); }
.calc-btn--ghost:hover { background: var(--svetlosiniy); color: var(--firmennyy-siniy); }
.calc-btn--light { background: var(--svetlosiniy); color: var(--firmennyy-siniy); }
.calc-btn--light:hover { background: var(--siniy); color: var(--firmennyy-siniy); }
.calc-btn--green { background: var(--zelenyy); border-color: rgba(255, 255, 255, .5); color: #fff; }
.calc-btn--green:hover { filter: brightness(1.12); background: var(--zelenyy); }
.calc-btn--sm { padding: 10px 16px; font-size: 13px; }
.calc-btn[disabled] { opacity: .45; cursor: not-allowed; }
.calc-btn__i { width: 15px; height: 15px; flex: none; fill: currentColor; }
.calc-dl { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--firmennyy-siniy); text-decoration: underline; text-underline-offset: 3px; }
.calc-dl:hover { color: #2464b9; }
.calc-dl svg { width: 15px; height: 15px; flex: none; fill: currentColor; }

/* ----------------------------------------------------------- две колонки */
.calc-split { display: grid; grid-template-columns: 400px minmax(0, 1fr); gap: 30px; align-items: start; }
.calc-split > * { min-width: 0; }
.calc-aside { border: 1px solid var(--siniy); background: #fff; position: sticky; top: 20px; }
.calc-aside__head { background: var(--firmennyy-siniy); color: #fff; padding: 14px 20px; font-size: 14px; font-weight: 500; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.calc-aside__back { color: #fff; font-size: 12px; text-decoration: underline; text-underline-offset: 3px; background: none; border: 0; cursor: pointer; font-family: inherit; }
.calc-aside__body { padding: 20px; max-height: calc(100vh - 120px); overflow-y: auto; }
.calc-live { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--zelenyy); margin-bottom: 16px; }
.calc-live__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--zelenyy); }
.calc-live--busy { color: #737d8b; }
.calc-live--busy .calc-live__dot { background: #737d8b; }

/* ----------------------------------------------------------------- форма */
.calc-form__group { margin-bottom: 22px; }
.calc-form__legend { font-weight: 600; font-size: 14px; color: var(--firmennyy-siniy); padding-bottom: 9px; margin-bottom: 15px; border-bottom: 1px solid var(--siniy); }
.calc-form__grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
.calc-field { display: flex; flex-direction: column; gap: 6px; }
.calc-field__label { font-size: 13px; line-height: 135%; }
.calc-field__row { display: flex; align-items: center; gap: 9px; }
.calc-field__input, .calc-field__select { font-size: 14px; line-height: 114%; color: #000; width: 100%; border: 1px solid #d1d7e0; border-radius: 6px; padding: 11px 13px; background: #fff; transition: all .2s ease; font-family: inherit; }
.calc-field__input:hover, .calc-field__select:hover { border-color: #737d8b; }
.calc-field__input:focus, .calc-field__select:focus { border-color: var(--firmennyy-siniy); }
.calc-field__unit { font-size: 13px; color: #737d8b; min-width: 30px; }
.calc-field__hint { font-size: 11px; color: #737d8b; }
.calc-field--error .calc-field__input, .calc-field--error .calc-field__select { border-color: var(--krasnyy); background: #fffafa; }
.calc-field--error .calc-field__hint { color: var(--krasnyy); }
.calc-field--off { opacity: .45; }
.calc-check { display: flex; align-items: center; gap: 9px; font-size: 13px; }
.calc-check input { appearance: none; -webkit-appearance: none; width: 20px; height: 20px; min-width: 20px; border-radius: 2px; border: 1px solid #d5d5d5; background: #fff; cursor: pointer; position: relative; margin: 0; }
.calc-check input:checked { background: var(--firmennyy-siniy); border-color: var(--firmennyy-siniy); }
.calc-check input:checked:after { content: ""; position: absolute; left: 6px; top: 2px; width: 5px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.calc-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding-top: 6px; }

/* ----------------------------------------------------------------- вкладки */
.calc-tabs { display: flex; border: 1px solid var(--siniy); border-bottom: 0; background: #fff; flex-wrap: wrap; }
.calc-tab { padding: 14px 22px; font-size: 14px; color: #737d8b; border: 0; border-right: 1px solid var(--siniy); cursor: pointer; background: #fff; transition: all .2s; font-family: inherit; }
.calc-tab:hover { background: var(--svetlosiniy); color: var(--firmennyy-siniy); }
.calc-tab--active, .calc-tab--active:hover { background: var(--firmennyy-siniy); color: #fff; border-right-color: var(--firmennyy-siniy); }
.calc-pane { border: 1px solid var(--siniy); padding: 26px; background: #fff; }

/* ----------------------------------------------------------------- таблицы */
.calc-tablewrap { overflow-x: auto; margin-bottom: 22px; }
.calc-table { width: 100%; border-collapse: collapse; font-size: 13px; background: #fff; min-width: 640px; }
.calc-table th { background: var(--firmennyy-siniy); color: #fff; font-weight: 500; text-align: left; padding: 12px 14px; line-height: 130%; border: 1px solid var(--firmennyy-siniy); }
.calc-table td { border: 1px solid #d1d7e0; padding: 11px 14px; line-height: 145%; vertical-align: middle; }
.calc-table tbody tr:nth-child(even) td { background: #fbfcfe; }
.calc-table__sub td { background: var(--svetlosiniy) !important; font-weight: 600; color: var(--firmennyy-siniy); text-align: center; }
.calc-table__val { font-weight: 600; color: var(--firmennyy-siniy); white-space: nowrap; }
.calc-table .td_error { background: #fdeaea !important; }
.calc-table .td_error .calc-table__val { color: var(--krasnyy); }
.calc-table math { font-size: 15px; }
.calc-fdesc p { font-size: 12px; color: #737d8b; line-height: 170%; margin-top: 2px; }
.calc-fdesc math { font-size: 13px; }
.calc-note { font-size: 12px; color: #737d8b; line-height: 155%; margin-bottom: 20px; }

/* ----------------------------------------------------------------- сводка */
.calc-sum { border: 1px solid var(--siniy); background: var(--svetlosiniy); padding: 18px 22px; margin-bottom: 24px; display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; }
.calc-sum__t { font-size: 12px; color: #737d8b; }
.calc-sum__v { font-weight: 600; font-size: 15px; color: var(--firmennyy-siniy); margin-top: 4px; }

/* ----------------------------------------------------------------- ошибки */
.calc-alert { border: 1px solid var(--krasnyy); background: #fdeaea; color: var(--krasnyy); padding: 16px 20px; font-size: 13px; line-height: 150%; margin-bottom: 20px; }
.calc-alert__t { font-weight: 600; margin-bottom: 6px; }
.calc-alert ul { margin: 8px 0 0 18px; }
.calc-alert li { margin-bottom: 4px; }

/* ----------------------------------------------------------------- график */
.calc-chart { border: 1px solid #d1d7e0; background: #fff; padding: 18px; }
.calc-chart svg { width: 100%; height: auto; display: block; }
.calc-legend { display: flex; gap: 22px; flex-wrap: wrap; font-size: 12px; color: #494c50; margin-top: 14px; padding-top: 14px; border-top: 1px solid #e6e6e6; }
.calc-legend i { display: inline-block; width: 22px; height: 0; margin-right: 7px; vertical-align: 4px; }

@media (max-width: 1199px) { .calc-split { grid-template-columns: 340px minmax(0, 1fr); gap: 22px; } }
@media (max-width: 991px) {
  .calc-cards { grid-template-columns: 1fr; }
  .calc-split { grid-template-columns: minmax(0, 1fr); }
  .calc-aside { position: static; }
  .calc-aside__body { max-height: none; }
}
@media (max-width: 575px) {
  .calc-card__top { padding: 20px 16px; }
  .calc-card__body, .calc-card__foot { padding-left: 16px; padding-right: 16px; }
  .calc-pane { padding: 18px 14px; }
  .calc-tab { flex: 1 1 100%; border-right: 0; border-bottom: 1px solid var(--siniy); }
}
