:root {
  --bg: #f6f7f9;
  --card: #fff;
  --text: #1d2330;
  --muted: #667085;
  --line: #e3e6eb;
  --accent: #004fe5;
  --good: #15803d;
  --mid: #b45309;
  --bad: #b91c1c;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); }
.wrap { max-width: 860px; margin: 0 auto; padding: 0 16px; }

.top { background: var(--card); border-bottom: 1px solid var(--line); }
.top-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 56px; flex-wrap: wrap; }
.logo { font-weight: 700; font-size: 20px; color: var(--text); text-decoration: none; }
.menu ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 16px; flex-wrap: wrap; }
.menu a { color: var(--text); text-decoration: none; }

main { padding: 16px 0 40px; }
.breadcrumb { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; font-size: 14px; color: var(--muted); }
h1 { font-size: 28px; line-height: 1.2; margin: 12px 0; }
.lead { font-size: 18px; color: var(--muted); margin-top: 0; }

.calc { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 20px; margin: 20px 0; }
.calc-form fieldset { border: 0; padding: 0; margin: 0 0 16px; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px 16px; }
.calc-form legend { font-weight: 600; margin-bottom: 8px; }
.calc-form label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: var(--muted); }
.calc-form input { font: inherit; font-size: 17px; color: var(--text); padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.calc-form select { font: inherit; font-size: 17px; color: var(--text); padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.calc-form input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.calc-form small { font-size: 12px; }
.calc-form label.check { flex-direction: row; align-items: center; gap: 8px; color: var(--text); font-size: 15px; align-self: end; padding-bottom: 10px; }
.calc-form label.check input { width: 18px; height: 18px; padding: 0; margin: 0; flex: none; }

.btn { display: inline-block; background: var(--accent); color: #fff; border: 0; border-radius: 8px; padding: 11px 20px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }

.calc-result { margin-top: 20px; padding: 16px; border-radius: 10px; border-left: 5px solid var(--muted); background: var(--bg); }
.calc-result.is-good { border-color: var(--good); }
.calc-result.is-mid { border-color: var(--mid); }
.calc-result.is-bad { border-color: var(--bad); }
.res-title { font-size: 22px; font-weight: 700; }
.is-good .res-title { color: var(--good); }
.is-mid .res-title { color: var(--mid); }
.is-bad .res-title { color: var(--bad); }
.res-sub { margin: 4px 0 12px; }
.res-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.res-table th { font-weight: 600; font-size: 13px; color: var(--muted); }
.res-table th, .res-table td { text-align: right; padding: 6px 4px; border-bottom: 1px solid var(--line); }
.res-table th:first-child, .res-table td:first-child { text-align: left; color: var(--muted); }
.res-scroll { overflow-x: auto; }
.res-notes { margin: 12px 0 0; padding-left: 20px; }

.offers { display: grid; gap: 12px; margin-top: 16px; }
.offer { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
.offer-t { font-weight: 700; margin-bottom: 4px; }
.offer p { margin: 0 0 10px; }
.offer-ad { margin-top: 8px; font-size: 12px; color: var(--muted); }

.content { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 4px 20px; }
.content table { border-collapse: collapse; width: 100%; }
.content td, .content th { border: 1px solid var(--line); padding: 6px 8px; }

.faq { margin-top: 24px; }
.faq-item { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; margin-bottom: 8px; }
.faq-item summary { cursor: pointer; font-weight: 600; }
.faq-a { margin-top: 8px; }

.updated { font-size: 13px; color: var(--muted); }
.bottom { border-top: 1px solid var(--line); padding: 20px 0; font-size: 13px; color: var(--muted); }

@media (max-width: 520px) {
  h1 { font-size: 24px; }
  .calc { padding: 14px 12px; }
  .calc-result { padding: 12px 8px 12px 10px; }
  .res-table { font-size: 13px; }
  .res-table th, .res-table td { padding: 6px 2px; }
  .content table { display: block; overflow-x: auto; }
  .content { overflow-wrap: anywhere; }
  .content h2, .content h3 { hyphens: auto; }
}

.section { margin: 28px 0; }
.section h2 { font-size: 21px; margin: 0 0 12px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.card { display: flex; flex-direction: column; gap: 6px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; color: var(--text); text-decoration: none; }
.card:hover { border-color: var(--accent); }
.card-t { font-weight: 700; font-size: 17px; line-height: 1.3; }
.card-d { font-size: 14px; color: var(--muted); }

/* Логотип */
.logo { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; letter-spacing: -.02em; }
.logo svg { flex: none; }
.logo img { display: block; height: 36px; width: auto; }
.logo i { font-style: normal; color: var(--accent); }

/* Шапка на телефоне: меню в одну строку с прокруткой */
@media (max-width: 560px) {
  .top-in { flex-wrap: nowrap; gap: 12px; }
  .logo { flex: none; }
  .logo svg { width: 28px; height: 28px; }
  .logo img { height: 28px; }
  .menu { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .menu ul { flex-wrap: nowrap; white-space: nowrap; gap: 14px; font-size: 15px; }
}

/* Меню по разделам */
.menu .active a { color: var(--accent); font-weight: 600; }
.menu a:hover { color: var(--accent); }
.hsec { scroll-margin-top: 16px; }

/* Кнопка «Наверх» */
.totop { position: fixed; right: 20px; bottom: 20px; z-index: 50; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: var(--accent); color: #fff; box-shadow: 0 8px 20px -6px rgba(0, 79, 229, .55); }
.totop[hidden] { display: none; }
.totop:hover { background: #003fbf; }
@media (max-width: 560px) { .totop { right: 14px; bottom: 14px; width: 42px; height: 42px; } }

/* Реклама: картинка в оффере и слоты для кода РСЯ */
.offer img { display: block; max-width: 100%; height: auto; border-radius: 8px; margin-bottom: 10px; }
.offers:empty, .ad-slot:empty { display: none; }
.ad-slot { margin: 20px 0; }
#sl-ad-top { margin: 0 0 16px; }
#sl-ad-bottom { margin: 20px 0; }

/* Поля в одном ряду стоят на одной линии: подпись, поле и подсказка — три общие строки сетки.
   Длинная подпись прижимается к полю снизу, подсказка висит под полем. */
@supports (grid-template-rows: subgrid) {
  .calc-form fieldset { row-gap: 0; }
  .calc-form label { display: grid; grid-row: span 3; grid-template-rows: subgrid; grid-template-columns: minmax(0, 1fr); min-width: 0; row-gap: 4px; align-items: end; margin-bottom: 12px; }
  .calc-form label > small { align-self: start; }
  .calc-form input:not([type=checkbox]), .calc-form select { height: 48px; width: 100%; min-width: 0; }
  .calc-form label.check { display: flex; grid-row: span 3; align-self: center; margin-bottom: 12px; padding-bottom: 0; }
}

/* Скрытые блоки формы, которые переключает калькулятор */
.calc-form [hidden] { display: none !important; }

/* Похожие калькуляторы */
.related { margin: 32px 0 8px; }
.related h2 { font-size: 21px; margin: 0 0 12px; }

/* Анимации (отключаются, если в системе включено «уменьшить движение») */
@media (prefers-reduced-motion: no-preference) {
  .reveal { opacity: 0; transform: translateY(14px); transition: opacity .5s ease, transform .5s ease; }
  .reveal.in { opacity: 1; transform: none; }
  .card { transition: border-color .15s, box-shadow .15s, transform .15s; }
  .calc-result:not([hidden]) { animation: sl-in .4s ease both; }
  .totop:not([hidden]) { animation: sl-in .25s ease both; }
  @keyframes sl-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
  @keyframes sl-drop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
}

/* Меню разделов с выпадающими списками */
.top { position: relative; z-index: 30; }
.top .wrap { max-width: 1080px; }
.top-in { flex-wrap: nowrap; }
.nav { position: static; }
.nav-list { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 4px; }
.nav-item { position: relative; display: flex; align-items: center; }
.nav-link { display: inline-flex; align-items: center; gap: 4px; padding: 7px 10px 7px 12px; border-radius: 999px; color: var(--text); text-decoration: none; font-size: 15px; font-weight: 500; white-space: nowrap; transition: background .15s, color .15s; }
.nav-chev { color: var(--muted); transition: transform .2s ease; }
.nav-item:hover .nav-link, .nav-item:focus-within .nav-link { background: var(--soft, #eef3ff); color: var(--accent); }
.nav-item:hover .nav-chev, .nav-item:focus-within .nav-chev { transform: rotate(180deg); color: var(--accent); }
.nav-item.is-active .nav-link { background: var(--accent); color: #fff; }
.nav-item.is-active .nav-chev { color: rgba(255, 255, 255, .8); }
.nav-tg, .burger { display: none; }
.nav-dd { position: absolute; top: 100%; left: 0; padding-top: 10px; opacity: 0; visibility: hidden; transform: translateY(6px); transition: opacity .18s ease, transform .18s ease, visibility 0s linear .18s; z-index: 40; }
.nav-item:nth-last-child(-n+3) .nav-dd { left: auto; right: 0; }
.nav-item:hover .nav-dd, .nav-item:focus-within .nav-dd { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.nav-dd-in { min-width: 260px; max-width: 340px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 10px; box-shadow: 0 20px 40px -18px rgba(15, 23, 42, .35); }
.nav-dd-h { display: block; padding: 8px 10px; margin-bottom: 4px; border-bottom: 1px solid var(--line); font-weight: 700; font-size: 14.5px; color: var(--text); text-decoration: none; }
.nav-dd-h:hover { color: var(--accent); }
.nav-dd ul { list-style: none; margin: 0; padding: 0; }
.nav-dd li a { display: block; padding: 7px 10px; border-radius: 8px; font-size: 14.5px; line-height: 1.35; color: #344054; text-decoration: none; }
.nav-dd li a:hover, .nav-dd li a:focus-visible { background: var(--soft, #eef3ff); color: var(--accent); }

/* Планшет и телефон: меню по кнопке, разделы раскрываются по нажатию */
@media (max-width: 1100px) {
  .burger { display: inline-flex; flex-direction: column; justify-content: center; gap: 4px; width: 42px; height: 42px; padding: 0 11px; border: 0; border-radius: 10px; background: var(--accent); cursor: pointer; }
  .burger span { display: block; height: 2px; border-radius: 2px; background: #fff; transition: transform .2s ease, opacity .2s ease; }
  .nav.open .burger span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  .nav.open .burger span:nth-child(2) { opacity: 0; }
  .nav.open .burger span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
  .nav-list { position: absolute; left: 0; right: 0; top: 100%; display: block; background: #fff; border-bottom: 1px solid var(--line); box-shadow: 0 24px 40px -20px rgba(15, 23, 42, .35); padding: 8px 16px 16px; max-height: calc(100vh - 64px); overflow-y: auto; opacity: 0; visibility: hidden; transform: translateY(-6px); transition: opacity .2s ease, transform .2s ease, visibility 0s linear .2s; }
  .nav.open .nav-list { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
  .nav-item { flex-wrap: wrap; border-bottom: 1px solid var(--line); }
  .nav-item:last-child { border-bottom: 0; }
  .nav-link { flex: 1; padding: 13px 4px; border-radius: 0; font-size: 16px; font-weight: 600; background: none !important; color: var(--text) !important; }
  .nav-item.is-active .nav-link { color: var(--accent) !important; }
  .nav-chev { display: none; }
  .nav-tg { display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 10px; background: var(--bg); color: var(--muted); cursor: pointer; }
  .nav-tg svg { transition: transform .25s ease; }
  .nav-item.open .nav-tg { color: var(--accent); }
  .nav-item.open .nav-tg svg { transform: rotate(180deg); }
  .nav-dd, .nav-item:nth-last-child(-n+3) .nav-dd { position: static; flex-basis: 100%; padding: 0; opacity: 1; visibility: visible; transform: none; display: grid; grid-template-rows: 0fr; transition: grid-template-rows .3s ease; }
  .nav-item:hover .nav-dd, .nav-item:focus-within .nav-dd { transition: grid-template-rows .3s ease; }
  .nav-item.open .nav-dd { grid-template-rows: 1fr; }
  .nav-dd-in { overflow: hidden; min-height: 0; max-width: none; border: 0; box-shadow: none; padding: 0; border-radius: 0; }
  .nav-dd-h { display: none; }
  .nav-dd ul { padding: 0 0 10px 8px; }
}
@media (prefers-reduced-motion: reduce) { .nav-dd, .nav-list, .nav-chev, .burger span { transition: none !important; } }

/* Ссылка к результату вместо кнопки «Посчитать», только на узких экранах */
.to-result { display: none; }
@media (max-width: 760px) {
  .to-result:not([hidden]) { display: inline-block; margin-top: 4px; font-weight: 600; color: var(--accent); text-decoration: none; }
}

/* Печать и PDF (25.10.2026): кнопка под результатом и стили для бумаги */
.calc-print { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.calc-print[hidden] { display: none; }
.btn-share { padding-inline: 14px; }
.calc-report { flex-basis: 100%; margin-top: 4px; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; font-size: 14px; color: var(--muted); text-decoration: underline; cursor: pointer; }
.link-btn:hover { color: var(--accent); }
.calc-report-f { display: grid; gap: 6px; max-width: 520px; margin-top: 8px; font-size: 14px; }
.calc-report-f[hidden] { display: none; }
.calc-report-f textarea { font: inherit; font-size: 16px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; resize: vertical; }
.calc-report-f small { color: var(--muted); font-size: 12.5px; }
.calc-report-s { font-size: 14px; color: var(--muted); margin-left: 6px; }
.calc-report .hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.btn-line { display: inline-flex; align-items: center; gap: 8px; background: #fff; color: var(--accent); border: 1px solid var(--accent); border-radius: 8px; padding: 9px 16px; font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; }
.btn-line:hover, .btn-line:focus-visible { background: var(--soft, #eef3ff); }
.print-meta { display: none; }
@media print {
  @page { margin: 14mm 12mm; }
  html, body { background: #fff !important; color: #000; }
  body { font-size: 11pt; }
  .top, .bottom, .breadcrumb, .offers, .ad-slot, .content, .faq, .section, .related, .totop, .slc, .calc-print, .to-result, #sl-calc button { display: none !important; }
  .wrap { max-width: none; padding: 0; margin: 0; }
  .print-meta { display: block; margin: 0 0 6px; font-size: 9pt; color: #555; }
  h1 { font-size: 18pt; margin: 0 0 6px; }
  .lead { font-size: 11pt; color: #333; margin-bottom: 10px; }
  .calc-form fieldset { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px 12px; margin-bottom: 8px; break-inside: avoid; }
  .calc-form label { color: #333; font-size: 9.5pt; margin-bottom: 4px; }
  .calc-form input:not([type=checkbox]), .calc-form select { height: auto; padding: 3px 6px; font-size: 11pt; border: 1px solid #999; border-radius: 4px; }
  .calc-form small { display: none; }
  .calc-result { margin-top: 10px; padding: 10px 12px; background: #fff; border: 1px solid #999; border-left-width: 5px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .res-title { font-size: 15pt; }
  .res-scroll { overflow: visible; }
  .res-table { font-size: 10pt; }
  .res-table tr { break-inside: avoid; }
  .updated { margin-top: 10px; font-size: 9pt; color: #555; }
  a { color: #000; text-decoration: none; }
}

/* Справочник «Цифры» (25.10.2026): крупная цифра, график ключевой ставки */
.sp-now { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin: 14px 0 6px; }
.sp-num { font-size: 36px; font-weight: 700; line-height: 1.1; color: var(--text); }
.sp-when { font-size: 14px; color: var(--muted); }
.kr-chart { display: block; width: 100%; height: auto; margin: 8px 0 12px; }
.kr-grid { stroke: var(--line); stroke-width: 1; }
.kr-lab { fill: var(--muted); font-size: 12px; }
.kr-line { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; }
.kr-dot { fill: var(--accent); }
.kr-all { margin: 8px 0 16px; }
.kr-all summary { cursor: pointer; font-weight: 600; color: var(--accent); }
.kr-all table { margin-top: 10px; }
.content .sp-t td:last-child { white-space: nowrap; overflow-wrap: normal; }

/* Подборки по ситуациям (25.10.2026): шаги по порядку */
.pd-steps { list-style: none; counter-reset: pd; margin: 16px 0; padding: 0; display: grid; gap: 10px; }
.pd-steps li { counter-increment: pd; position: relative; padding: 12px 14px 12px 52px; border: 1px solid var(--line); border-radius: 10px; }
.pd-steps li::before { content: counter(pd); position: absolute; left: 14px; top: 12px; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 700; font-size: 14px; display: grid; place-items: center; }
.pd-steps h3 { margin: 0 0 4px; font-size: 17px; }
.pd-steps p { margin: 0; color: var(--muted); }
