/* Калькуляторы (страницы /kalkulyatory и /kalkulyator/*): подключается только на них, сборка Tailwind не нужна.
   Цвета и тени берутся из переменных дизайн-системы (--ds-*) с запасными значениями. */

.cx-page { padding-top: 28px; padding-bottom: 56px; }
.cx-layout { display: grid; grid-template-columns: minmax(0, 1fr) 390px; gap: 20px; align-items: start; }
.cx-form { grid-column: 1; }
.cx-side { grid-column: 2; grid-row: 1 / span 3; position: sticky; top: 84px; }
.cx-detail, .cx-info { grid-column: 1; }
@media (max-width: 1023px) {
    .cx-layout { grid-template-columns: minmax(0, 1fr); }
    .cx-side { grid-column: 1; grid-row: auto; position: static; }
}

.cx-card { background: var(--ds-surface, #fff); border: 1px solid var(--ds-line, #e3e7f0); border-radius: 18px; padding: 22px 24px; box-shadow: 0 1px 2px rgba(14, 26, 58, .04), 0 8px 24px -12px rgba(14, 26, 58, .12); }
.cx-card h2 { margin: 0; font-size: 18px; font-weight: 700; color: var(--ds-ink, #0e1a3a); }
.cx-card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.cx-card-tools { display: flex; gap: 6px; }
.cx-link { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 99px; font-size: 13px; font-weight: 600; color: var(--ds-brand, #2b50f5); background: var(--ds-brand-50, #eef2ff); border: 0; cursor: pointer; transition: .15s; }
.cx-link:hover { background: var(--ds-brand-100, #dfe7ff); }
.cx-link svg { width: 15px; height: 15px; }

/* форма */
.cx-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
.cx-field[hidden] { display: none; }
.cx-wide { grid-column: 1 / -1; }
@media (max-width: 640px) { .cx-fields { grid-template-columns: minmax(0, 1fr); } }
.cx-label { display: block; margin-bottom: 6px; font-size: 13.5px; font-weight: 600; color: var(--ds-ink, #0e1a3a); }
.cx-hint { margin: 6px 0 0; font-size: 12.5px; line-height: 1.45; color: var(--ds-ink-3, #66718f); }
.cx-inwrap { position: relative; display: flex; align-items: center; gap: 8px; }
.cx-input { width: 100%; height: 44px; padding: 0 14px; border: 1px solid var(--ds-line, #e3e7f0); border-radius: 12px; background: #fff; font: inherit; font-size: 15px; color: var(--ds-ink, #0e1a3a); transition: border-color .15s, box-shadow .15s; }
select.cx-input { padding-right: 34px; text-overflow: ellipsis; }
.cx-input:hover { border-color: #c9d2f5; }
.cx-input:focus { outline: 0; border-color: var(--ds-brand, #2b50f5); box-shadow: 0 0 0 4px var(--ds-brand-50, #eef2ff); }
.cx-unit { position: absolute; right: 14px; font-size: 14px; font-weight: 600; color: var(--ds-ink-3, #66718f); pointer-events: none; }
.cx-inwrap .cx-unit + * { margin: 0; }
.cx-inwrap input[inputmode="decimal"] { padding-right: 36px; }
.cx-chip { flex: none; height: 44px; padding: 0 12px; border-radius: 12px; border: 1px dashed #c9d2f5; background: transparent; font-size: 13px; font-weight: 600; color: var(--ds-brand, #2b50f5); cursor: pointer; }
.cx-chip:hover { background: var(--ds-brand-50, #eef2ff); }

.cx-seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 12px; background: var(--ds-line-2, #eef1f7); }
.cx-seg label { cursor: pointer; }
.cx-seg input { position: absolute; opacity: 0; pointer-events: none; }
.cx-seg span { display: block; padding: 8px 16px; border-radius: 9px; font-size: 14px; font-weight: 600; color: var(--ds-ink-2, #44506f); transition: .15s; }
.cx-seg input:checked + span { background: #fff; color: var(--ds-brand, #2b50f5); box-shadow: 0 1px 3px rgba(14, 26, 58, .16); }
.cx-seg input:focus-visible + span { outline: 2px solid var(--ds-brand, #2b50f5); }

.cx-check { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border: 1px solid var(--ds-line, #e3e7f0); border-radius: 12px; cursor: pointer; font-size: 14px; font-weight: 600; line-height: 1.4; color: var(--ds-ink, #0e1a3a); transition: .15s; }
.cx-check:hover { border-color: #c9d2f5; background: #fafbff; }
.cx-check input { width: 18px; height: 18px; margin-top: 1px; accent-color: var(--ds-brand, #2b50f5); flex: none; }
.cx-check + .cx-hint { padding-left: 4px; }

.cx-rows { display: grid; gap: 8px; }
.cx-row { display: flex; gap: 8px; align-items: center; }
.cx-row .cx-input { height: 40px; }
.cx-x { flex: none; width: 36px; height: 36px; border-radius: 10px; border: 0; background: var(--ds-line-2, #eef1f7); color: var(--ds-ink-3, #66718f); font-size: 20px; line-height: 1; cursor: pointer; }
.cx-x:hover { background: #fee2e2; color: #dc2626; }
.cx-add { margin-top: 8px; padding: 7px 14px; border-radius: 99px; border: 1px dashed #c9d2f5; background: transparent; color: var(--ds-brand, #2b50f5); font-size: 13px; font-weight: 600; cursor: pointer; }
.cx-add:hover { background: var(--ds-brand-50, #eef2ff); }

.cx-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 40px; padding: 0 16px; border-radius: 11px; border: 1px solid var(--ds-line, #e3e7f0); background: #fff; font-size: 14px; font-weight: 600; color: var(--ds-ink, #0e1a3a); cursor: pointer; transition: .15s; }
.cx-btn:hover { border-color: #c9d2f5; background: var(--ds-brand-50, #eef2ff); color: var(--ds-brand, #2b50f5); }
.cx-btn-sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.cx-btn svg { width: 15px; height: 15px; }

/* результат (правая колонка) */
.cx-result { padding: 0; overflow: hidden; }
.cx-empty { padding: 28px 24px; text-align: center; }
.cx-empty-ic { display: inline-grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; background: var(--ds-brand-50, #eef2ff); color: var(--ds-brand, #2b50f5); }
.cx-empty p { margin: 14px 0 16px; font-size: 14.5px; line-height: 1.5; color: var(--ds-ink-2, #44506f); }
.cx-empty.is-error p { color: #b91c1c; font-weight: 600; }
.cx-empty.is-error .cx-empty-ic { background: #fee2e2; color: #dc2626; }
.cx-empty[hidden], [data-cx-actions][hidden], .cx-detail[hidden] { display: none; }

.cx-hero { padding: 24px 24px 20px; background: linear-gradient(135deg, #0b1d4d 0%, #1b3a9a 100%); color: #fff; }
.cx-lab { display: block; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #aebcf0; }
.cx-big { display: block; margin: 6px 0 4px; font-size: 34px; line-height: 1.1; font-weight: 800; letter-spacing: -.01em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.cx-sub { display: block; font-size: 13.5px; line-height: 1.4; color: #cdd6f7; }
.cx-kpis { margin: 0; padding: 6px 24px; display: grid; }
.cx-kpis > div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--ds-line-2, #eef1f7); }
.cx-kpis > div:last-child { border-bottom: 0; }
.cx-kpis dt { font-size: 13.5px; color: var(--ds-ink-2, #44506f); }
.cx-kpis dd { margin: 0; font-size: 15px; font-weight: 700; text-align: right; color: var(--ds-ink, #0e1a3a); font-variant-numeric: tabular-nums; }
.cx-note { margin: 0; padding: 12px 24px; font-size: 13px; line-height: 1.5; border-top: 1px solid var(--ds-line-2, #eef1f7); color: var(--ds-ink-2, #44506f); }
.cx-note-warn { background: #fff7ed; color: #9a3412; }
.cx-note-info::before { content: 'i'; display: inline-grid; place-items: center; width: 16px; height: 16px; margin-right: 8px; border-radius: 50%; background: var(--ds-brand-50, #eef2ff); color: var(--ds-brand, #2b50f5); font-size: 11px; font-weight: 800; font-style: italic; vertical-align: 1px; }
.cx-note-warn::before { content: '!'; display: inline-grid; place-items: center; width: 16px; height: 16px; margin-right: 8px; border-radius: 50%; background: #f97316; color: #fff; font-size: 11px; font-weight: 800; vertical-align: 1px; }
.cx-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 24px 18px; border-top: 1px solid var(--ds-line-2, #eef1f7); }
.cx-disc { margin: 12px 4px 0; font-size: 12px; line-height: 1.5; color: var(--ds-ink-3, #66718f); }

/* подробный расчёт */
.cx-h { margin: 26px 0 12px; font-size: 15px; font-weight: 700; color: var(--ds-ink, #0e1a3a); }
.cx-h:first-child { margin-top: 0; }
.cx-chart { border: 1px solid var(--ds-line-2, #eef1f7); border-radius: 14px; padding: 12px 8px 8px; background: #fcfcfe; }
.cx-svg { display: block; width: 100%; height: auto; }
.cx-grid { stroke: #e3e7f0; stroke-width: 1; stroke-dasharray: 3 4; }
.cx-axis { font-size: 11px; fill: #66718f; }
.cx-hline { stroke: #d97706; stroke-width: 1.5; stroke-dasharray: 6 4; }
.cx-hlabel { font-size: 11.5px; font-weight: 700; fill: #b45309; }
.cx-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 4px 12px 2px; font-size: 12.5px; color: var(--ds-ink-2, #44506f); }
.cx-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; }

.cx-steps { margin: 0; padding: 0; list-style: none; counter-reset: s; display: grid; gap: 10px; }
.cx-steps li { counter-increment: s; display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 12px 14px 12px 48px; border: 1px solid var(--ds-line-2, #eef1f7); border-radius: 12px; position: relative; background: #fcfcfe; }
.cx-steps li::before { content: counter(s); position: absolute; left: 12px; top: 12px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--ds-brand-50, #eef2ff); color: var(--ds-brand, #2b50f5); font-size: 12px; font-weight: 800; }
.cx-steps b { display: block; font-size: 14px; color: var(--ds-ink, #0e1a3a); }
.cx-steps code { display: block; margin-top: 3px; font: inherit; font-size: 13px; line-height: 1.45; color: var(--ds-ink-2, #44506f); overflow-wrap: anywhere; }
.cx-steps small { display: block; margin-top: 3px; font-size: 12px; color: var(--ds-ink-3, #66718f); }
.cx-step-v { flex: none; font-size: 15px; font-weight: 700; color: var(--ds-ink, #0e1a3a); font-variant-numeric: tabular-nums; text-align: right; }

.cx-tablewrap { overflow-x: auto; border: 1px solid var(--ds-line-2, #eef1f7); border-radius: 12px; }
.cx-table { width: 100%; border-collapse: collapse; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.cx-table th { position: sticky; top: 0; padding: 10px 12px; text-align: left; background: var(--ds-line-2, #eef1f7); font-size: 12px; font-weight: 700; color: var(--ds-ink-2, #44506f); white-space: nowrap; }
.cx-table td { padding: 9px 12px; border-top: 1px solid var(--ds-line-2, #eef1f7); white-space: nowrap; }
.cx-table tr.is-hl td { background: var(--ds-brand-50, #eef2ff); font-weight: 700; color: var(--ds-brand, #2b50f5); }
.cx-table tfoot td { background: #fafbff; font-weight: 800; }
.cx-table td:last-child, .cx-table th:last-child { text-align: right; }

.cx-bars { display: grid; gap: 10px; }
.cx-bar { display: grid; grid-template-columns: 150px minmax(0, 1fr) auto; align-items: center; gap: 12px; font-size: 13.5px; }
.cx-bar-l { color: var(--ds-ink-2, #44506f); }
.cx-bar-t { height: 14px; border-radius: 99px; background: var(--ds-line-2, #eef1f7); overflow: hidden; }
.cx-bar-t i { display: block; height: 100%; border-radius: 99px; }
.cx-bar b { font-variant-numeric: tabular-nums; }
@media (max-width: 520px) { .cx-bar { grid-template-columns: minmax(0, 1fr) auto; } .cx-bar-t { grid-column: 1 / -1; order: 3; } }

.cx-tl-bar { position: relative; height: 14px; border-radius: 99px; background: var(--ds-line-2, #eef1f7); margin-top: 24px; }
.cx-tl-bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 99px; }
.cx-tl-bar em { position: absolute; top: -24px; transform: translateX(-50%); font-style: normal; font-size: 11.5px; font-weight: 700; color: var(--ds-ink, #0e1a3a); white-space: nowrap; }
.cx-tl-bar em::after { content: ''; position: absolute; left: 50%; top: 18px; width: 2px; height: 20px; margin-left: -1px; background: var(--ds-ink, #0e1a3a); }
.cx-tl-ends { display: flex; justify-content: space-between; margin-top: 10px; font-size: 14px; font-weight: 700; }
.cx-tl-ends small { display: block; font-size: 12px; font-weight: 500; color: var(--ds-ink-3, #66718f); }
.cx-tl-ends span:last-child { text-align: right; }
.cx-tl-over { color: #dc2626; font-size: 13px; align-self: center; }

.cx-notes { margin-top: 18px; border: 1px solid var(--ds-line-2, #eef1f7); border-radius: 12px; overflow: hidden; }
.cx-notes .cx-note:first-child { border-top: 0; }
.cx-claim { padding: 14px 16px; border: 1px dashed #c9d2f5; border-radius: 12px; background: #fafbff; }
.cx-claim p { margin: 0 0 10px; font-size: 14px; line-height: 1.55; color: var(--ds-ink, #0e1a3a); }

/* нормы и вопросы */
.cx-norms { margin: 14px 0 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.cx-norms a, .cx-norms span { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid var(--ds-line, #e3e7f0); border-radius: 11px; font-size: 14px; font-weight: 600; color: var(--ds-ink, #0e1a3a); text-decoration: none; transition: .15s; }
.cx-norms a:hover { border-color: #c9d2f5; background: var(--ds-brand-50, #eef2ff); color: var(--ds-brand, #2b50f5); }
.cx-norms svg { flex: none; width: 16px; height: 16px; color: var(--ds-brand, #2b50f5); }
.cx-faq-h { margin-top: 28px !important; }
.cx-faq { margin-top: 12px; border: 1px solid var(--ds-line, #e3e7f0); border-radius: 14px; overflow: hidden; }
.cx-faq details + details { border-top: 1px solid var(--ds-line-2, #eef1f7); }
.cx-faq summary { display: flex; justify-content: space-between; gap: 12px; padding: 14px 18px; cursor: pointer; list-style: none; font-size: 15px; font-weight: 600; color: var(--ds-ink, #0e1a3a); }
.cx-faq summary::-webkit-details-marker { display: none; }
.cx-faq summary::after { content: '+'; flex: none; font-size: 20px; line-height: 1; color: var(--ds-brand, #2b50f5); }
.cx-faq details[open] summary::after { content: '−'; }
.cx-faq p { margin: 0; padding: 0 18px 16px; font-size: 14.5px; line-height: 1.6; color: var(--ds-ink-2, #44506f); }
.cx-ask { display: flex; align-items: center; gap: 8px; margin: 22px 0 0; font-size: 14px; color: var(--ds-ink-2, #44506f); }
.cx-ask svg { color: var(--ds-violet, #7c3aed); }
.cx-ask a { color: var(--ds-brand, #2b50f5); font-weight: 600; }

.cx-others-h { margin: 36px 0 14px; font-size: 20px; font-weight: 700; color: var(--ds-ink, #0e1a3a); }
.cx-others { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.cx-others a { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: #fff; border: 1px solid var(--ds-line, #e3e7f0); border-radius: 14px; font-size: 14.5px; color: var(--ds-ink, #0e1a3a); text-decoration: none; transition: .15s; }
.cx-others a:hover { border-color: #c9d2f5; box-shadow: 0 0 0 4px var(--ds-brand-50, #eef2ff); }
.cx-oi { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: var(--ds-brand-50, #eef2ff); color: var(--ds-brand, #2b50f5); }

/* список калькуляторов */
.cx-index { padding-top: 28px; padding-bottom: 56px; }
.cx-toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 28px; }
.cx-search { position: relative; flex: 1 1 280px; max-width: 420px; }
.cx-search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--ds-ink-3, #66718f); }
.cx-search input { padding-left: 42px; }
.cx-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.cx-tabs button { height: 38px; padding: 0 16px; border-radius: 99px; border: 1px solid var(--ds-line, #e3e7f0); background: #fff; font-size: 14px; font-weight: 600; color: var(--ds-ink-2, #44506f); cursor: pointer; transition: .15s; }
.cx-tabs button:hover { border-color: #c9d2f5; }
.cx-tabs button[aria-pressed="true"] { background: var(--ds-brand, #2b50f5); border-color: var(--ds-brand, #2b50f5); color: #fff; }
.cx-group { margin-bottom: 34px; }
.cx-group[hidden], .cx-tile[hidden] { display: none; }
.cx-group-h { display: flex; align-items: baseline; gap: 12px; margin: 0 0 14px; flex-wrap: wrap; }
.cx-group-h h2 { margin: 0; font-size: 22px; font-weight: 800; color: var(--ds-ink, #0e1a3a); }
.cx-group-h span { font-size: 14px; color: var(--ds-ink-3, #66718f); }
.cx-grid-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.cx-tile { display: flex; flex-direction: column; gap: 10px; padding: 20px; background: #fff; border: 1px solid var(--ds-line, #e3e7f0); border-radius: 18px; text-decoration: none; color: inherit; box-shadow: 0 1px 2px rgba(14, 26, 58, .04); transition: .18s; position: relative; overflow: hidden; }
.cx-tile::after { content: ''; position: absolute; inset: 0 0 auto 0; height: 3px; background: linear-gradient(90deg, var(--ds-brand, #2b50f5), #7c3aed); opacity: 0; transition: .18s; }
.cx-tile:hover { transform: translateY(-3px); border-color: #c9d2f5; box-shadow: 0 14px 30px -14px rgba(43, 80, 245, .35); }
.cx-tile:hover::after { opacity: 1; }
.cx-tile-ic { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; background: var(--ds-brand-50, #eef2ff); color: var(--ds-brand, #2b50f5); }
.cx-tile h3 { margin: 4px 0 0; font-size: 17px; line-height: 1.3; font-weight: 700; color: var(--ds-ink, #0e1a3a); }
.cx-tile p { margin: 0; font-size: 13.5px; line-height: 1.55; color: var(--ds-ink-2, #44506f); }
.cx-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 4px; }
.cx-tags span { padding: 3px 9px; border-radius: 99px; background: var(--ds-line-2, #eef1f7); font-size: 12px; font-weight: 600; color: var(--ds-ink-2, #44506f); }
.cx-go { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 700; color: var(--ds-brand, #2b50f5); }
.cx-none { padding: 40px; text-align: center; color: var(--ds-ink-3, #66718f); }

/* печать: только результат и расчёт */
@media print {
    .ds-hdr, footer, .hero, .cx-form, .cx-actions, .cx-others-h, .cx-others, .cx-info .cx-ask, .cx-card-tools, .cx-disc, .cx-empty { display: none !important; }
    .cx-layout { display: block; }
    .cx-side { position: static; }
    .cx-card { box-shadow: none; border-color: #ccc; break-inside: avoid; margin-bottom: 12px; }
    .cx-hero { background: #fff !important; color: #000 !important; border-bottom: 2px solid #000; }
    .cx-lab, .cx-sub { color: #333 !important; }
    .cx-detail[hidden] { display: block !important; }
}
