:root {
  --bg: #f5f6f8;
  --card: #ffffff;
  --text: #1c2330;
  --muted: #5b6472;
  --accent: #0f62fe;
  --accent-dark: #0043ce;
  --border: #dde1e7;
  --ok: #198038;
  --warn: #b45309;
  --radius: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
}

.container {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Header */
.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 10px;
  padding-bottom: 10px;
  flex-wrap: wrap;
}
.logo {
  font-weight: 700;
  font-size: 18px;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}
.logo span { color: var(--accent); }
.main-nav { display: flex; gap: 4px; flex-wrap: wrap; }
.main-nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 15px;
}
.main-nav a:hover { background: var(--bg); color: var(--text); }
.main-nav a.active {
  color: var(--accent-dark);
  background: #e8efff;
  font-weight: 600;
}

main { padding: 24px 0 48px; }

h1 { font-size: 28px; line-height: 1.25; margin: 8px 0 12px; }
h2 { font-size: 21px; margin: 32px 0 12px; }
p { margin: 10px 0; }
.lead { color: var(--muted); font-size: 17px; }
a { color: var(--accent); }

/* Calculator card */
.calc {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin: 20px 0;
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.05);
}
.calc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}
.field label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
}
.field .hint {
  font-size: 13px;
  color: var(--muted);
  font-weight: 400;
}
.field input,
.field select {
  width: 100%;
  padding: 10px 12px;
  font-size: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
}
.field input:focus,
.field select:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
  border-color: var(--accent);
}

.results {
  margin-top: 20px;
  border-top: 1px dashed var(--border);
  padding-top: 16px;
}
.result-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid #f0f2f5;
}
.result-row:last-child { border-bottom: none; }
.result-row .label { color: var(--muted); }
.result-row .value { font-weight: 600; white-space: nowrap; }
.result-row.total .value { color: var(--accent-dark); font-size: 19px; }
.result-row.total .label { color: var(--text); font-weight: 600; }

.note {
  margin-top: 14px;
  font-size: 14px;
  color: var(--muted);
  background: #f0f2f5;
  border-radius: 8px;
  padding: 10px 14px;
}
.note.warn { background: #fdf3e3; color: var(--warn); }

/* Article content */
article {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-top: 24px;
}
article ul { padding-left: 22px; }
article li { margin: 6px 0; }

table.data {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0;
  font-size: 15px;
}
table.data th,
table.data td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
}
table.data th { color: var(--muted); font-weight: 600; font-size: 14px; }
table.data td.num { text-align: right; white-space: nowrap; }

.faq details {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
  margin: 10px 0;
  background: #fff;
}
.faq summary { font-weight: 600; cursor: pointer; }
.faq details p { margin: 8px 0 2px; }

/* Cards on home / cross-links */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
  margin: 18px 0;
}
.card-link {
  display: block;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.card-link:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(15, 98, 254, 0.12);
}
.card-link strong { display: block; color: var(--accent-dark); margin-bottom: 4px; }
.card-link span { font-size: 14px; color: var(--muted); }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--card);
  padding: 20px 0;
  font-size: 14px;
  color: var(--muted);
}

@media (max-width: 560px) {
  h1 { font-size: 23px; }
  .calc, article { padding: 16px; }
  .result-row .value { font-size: 15px; }
}

/* Прижатый к низу подвал: на высоких экранах не «висит» под контентом */
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
main { flex: 1; }

/* Плавное раскрытие FAQ */
.faq details[open] > *:not(summary) {
  animation: faq-open 0.25s ease;
}
@keyframes faq-open {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: none; }
}

/* Подвал по центру */
.site-footer { text-align: center; }

/* FAQ: убираем браузерную рамку фокуса и «ссылочный» вид после клика */
.faq summary { color: var(--text); }
.faq summary:focus { outline: none; }
.faq summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}
.faq summary:hover { color: var(--accent-dark); }

/* Навигация-хаб: вся менюшка в одной кнопке «Калькуляторы» */
.menu { position: relative; }
.menu summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  background: #fff;
  white-space: nowrap;
}
.menu summary::-webkit-details-marker { display: none; }
.menu summary::after { content: "▾"; margin-left: 6px; color: var(--muted); }
.menu[open] summary { border-color: var(--accent); color: var(--accent-dark); }
.menu-list {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 240px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.12);
  padding: 6px;
  z-index: 30;
}
.menu[open] .menu-list { display: block; }
.menu-list a {
  display: block;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  font-size: 15px;
}
.menu-list a:hover { background: var(--bg); }
.menu-list a.active { color: var(--accent-dark); background: #e8efff; font-weight: 600; }

/* Мобильные правки: широкие таблицы и длинные значения не ломают вёрстку */
@media (max-width: 560px) {
  table.data {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .result-row { flex-wrap: wrap; }
  .result-row .value { white-space: normal; }
}

/* Ссылки в подвале */
.footer-links { margin-top: 6px; }
.footer-links a { color: var(--muted); text-decoration: none; }
.footer-links a:hover { color: var(--accent); text-decoration: underline; }

/* Герой-результат калькулятора (прототип на кредите) */
.hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  background: linear-gradient(135deg, #1c2330, #2b3446);
  color: #fff;
  border-radius: 12px;
  padding: 20px 22px;
  flex-wrap: wrap;
}
.hero-label { font-size: 14px; opacity: 0.85; display: block; }
.hero-value { font-size: 34px; font-weight: 700; line-height: 1.2; }
.hero-side { display: flex; flex-direction: column; gap: 10px; }
.hero-side > div > span { font-size: 13px; opacity: 0.85; display: block; }
.hero-side strong { font-size: 18px; }

/* Доля тела долга и процентов */
.share-bar {
  display: flex;
  height: 10px;
  border-radius: 6px;
  overflow: hidden;
  margin-top: 16px;
  background: #e8efff;
}
.share-p { background: #0f62fe; }
.share-i { background: #f5a524; } /* как «проценты» на графике платежей */
.share-legend { font-size: 13px; color: var(--muted); margin-top: 6px; }

/* Слайдеры под полями */
input.slider { width: 100%; margin-top: 8px; accent-color: var(--accent); }

@media (max-width: 560px) {
  .hero-value { font-size: 27px; }
}

/* Выравнивание полей в ряд: подписи разной высоты больше не сдвигают инпуты */
.field {
  display: flex;
  flex-direction: column;
}
.field label { flex: 1; }

/* Выровнять инпуты по верху: подпись — фиксированная высота, слайдер — внизу ячейки */
.field label { flex: 0 0 auto; min-height: 45px; } /* auto: длинная подсказка не уходит под поле */
.field input.slider { margin-top: auto; }

/* Чекбокс в ячейке формы и выравнивание числовых заголовков таблиц */
.field label.check {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 0;
  margin-top: auto;
  padding: 10px 0;
  font-weight: 400;
  font-size: 15px;
  cursor: pointer;
}
.field label.check input { width: auto; margin: 0; }
table.data th.num { text-align: right; }
/* атрибут hidden должен скрывать и элементы с display: flex/grid */
[hidden] { display: none !important; }

/* Хлебные крошки, дата обновления, список калькуляторов в футере */
.breadcrumbs {
  font-size: 14px;
  color: var(--muted);
  margin: 0 0 8px;
}
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--accent); }
.updated {
  font-size: 13px;
  color: var(--muted);
  margin-top: 24px;
}
.footer-calcs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
  text-align: left;
}
.footer-calcs strong { display: block; margin-bottom: 6px; font-size: 14px; }
.footer-calcs a { display: block; padding: 3px 0; font-size: 14px; }

/* ---------- Данные ЦБ: плитки на главной, изменения, график ---------- */
.data-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin: 20px 0 6px;
}
.tile {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  text-decoration: none;
  color: var(--text);
}
.tile:hover { border-color: var(--accent); }
.tile-label { font-size: 13px; color: var(--muted); font-weight: 600; }
.tile-value { font-size: 22px; font-weight: 700; line-height: 1.3; }
.tile-sub { font-size: 13px; color: var(--muted); }
.strip-note { font-size: 13px; color: var(--muted); margin: 0 0 8px; }
@media (max-width: 560px) {
  .data-strip { grid-template-columns: repeat(2, 1fr); }
}

.chg { white-space: nowrap; font-weight: 600; }
.chg.up { color: var(--ok); }
.chg.down { color: #c62828; }
.hero .chg.up { color: #7ee2a0; }
.hero .chg.down { color: #ff9b9b; }

.rate-hero { margin: 16px 0 8px; }
.rate-hero .hero-value { display: block; }
.hero-chg { display: block; font-size: 14px; opacity: 0.9; margin-top: 2px; }
.calc-title { margin: 0 0 12px; font-size: 18px; }

table.rates td a { text-decoration: none; color: var(--text); }
table.rates td a:hover { color: var(--accent); }
table.rates td a strong { color: var(--accent); margin-right: 4px; }

.chart {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 12px 6px;
  margin: 12px 0 20px;
}
.chart-periods { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.chart-periods button {
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  border-radius: 8px;
  padding: 4px 12px;
  font-size: 14px;
  cursor: pointer;
}
.chart-periods button.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.chart-svg { width: 100%; overflow: hidden; }
.chart-svg svg { display: block; width: 100%; height: auto; touch-action: pan-y; }
.chart .grid { stroke: var(--border); stroke-width: 1; }
.chart .ylab, .chart .xlab { fill: var(--muted); font-size: 12px; }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; }
.chart .area { fill: var(--accent); opacity: 0.08; }
.chart .cross { stroke: var(--muted); stroke-dasharray: 3 3; }
.chart .dot { fill: var(--accent); stroke: #fff; stroke-width: 2; }
.chart-tip {
  position: absolute;
  top: 46px;
  transform: translateX(-50%);
  background: #1c2330;
  color: #fff;
  font-size: 13px;
  padding: 4px 10px;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
}

/* ---------- Таблица курсов: вся строка — ссылка ---------- */
table.rates tbody tr { position: relative; transition: background .15s; }
table.rates tbody tr:hover { background: #eef3ff; }
table.rates td a::after { content: ""; position: absolute; inset: 0; } /* клик по любой части строки */
table.rates td.go, table.rates th.go { width: 24px; text-align: right; color: var(--muted); font-size: 20px; padding-left: 0; }
table.rates tbody tr:hover td.go { color: var(--accent); }
table.rates tbody tr:hover td a strong { text-decoration: underline; }

/* ---------- Плитки разделов на главной ---------- */
.cat-tiles {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
  margin: 22px 0 8px;
}
.cat-tile {
  grid-column: span 2;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 170px;
  padding: 18px 20px;
  border-radius: 16px;
  text-decoration: none;
  color: #fff;
  background:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px) 0 0 / 22px 22px,
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px) 0 0 / 22px 22px,
    linear-gradient(150deg, #1b3466, #0f1f3f 70%);
  box-shadow: 0 1px 2px rgba(16, 24, 40, .1);
  transition: transform .2s, box-shadow .2s;
}
.cat-tile { grid-column: span 3; } /* по две плитки в ряд; «Налоги» и «Кредиты» выше */
.cat-tile.cat-taxes, .cat-tile.cat-credit { min-height: 220px; }
.cat-tile:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(15, 31, 63, .35); }
.cat-title { position: relative; z-index: 1; font-size: 22px; font-weight: 800; line-height: 1.2; }
.cat-taxes .cat-title, .cat-credit .cat-title { font-size: 28px; }
.cat-sub { position: relative; z-index: 1; font-size: 14px; opacity: .75; margin-top: 4px; }
.cat-tile svg {
  position: absolute;
  right: -6px;
  bottom: -4px;
  width: 62%;
  max-width: 260px;
  height: auto;
  transition: transform .3s;
}
.cat-tile:hover svg { transform: scale(1.05) translateY(-2px); }
@media (max-width: 700px) {
  .cat-tiles { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .cat-tile, .cat-tile.cat-taxes, .cat-tile.cat-credit { grid-column: span 1; min-height: 150px; padding: 14px; }
  .cat-tile.cat-taxes, .cat-tile.cat-credit { grid-column: span 2; min-height: 180px; }
  .cat-title, .cat-taxes .cat-title, .cat-credit .cat-title { font-size: 19px; }
  .cat-tile svg { width: 70%; max-width: 200px; }
}
html { scroll-behavior: smooth; }
h2[id] { scroll-margin-top: 70px; }
table.rates .per { color: var(--muted); font-size: 13px; white-space: nowrap; }

/* Длинные числа переносятся и не растягивают страницу (огромные суммы в конвертере и калькуляторах) */
.result-row .value { white-space: normal; overflow-wrap: anywhere; text-align: right; min-width: 0; }
.result-row .label { flex-shrink: 0; max-width: 60%; }
.hero-main, .hero-side { min-width: 0; max-width: 100%; }
.hero-value, .hero-side strong, .tile-value { overflow-wrap: anywhere; }
main .container { overflow-wrap: break-word; }

/* Страница раздела */
.hub-head { margin: 4px 0 14px; min-height: 180px; }
.hub-head h1 { margin: 0; color: #fff; }
.hub-head:hover { transform: none; box-shadow: none; }
.hub-head svg { width: 46%; max-width: 250px; }
h2 .h-link { color: inherit; text-decoration: none; }
h2 .h-link:hover { color: var(--accent); }
h2 .h-link::after { content: " ›"; color: var(--muted); }
.footer-calcs strong a { color: inherit; text-decoration: none; }

/* ---------- Производственный календарь ---------- */
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 16px 0; }
.stat { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; }
.stat span { display: block; font-size: 13px; color: var(--muted); }
.stat strong { font-size: 24px; }
@media (max-width: 560px) { .stat-row { grid-template-columns: repeat(2, 1fr); } }

.cal-year { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 12px 0 8px; }
@media (max-width: 760px) { .cal-year { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 560px) { .cal-year { grid-template-columns: repeat(2, 1fr); gap: 10px; } }
.cal-month { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; }
.cal-title { font-weight: 700; margin-bottom: 6px; }
.cal-title a { color: var(--text); text-decoration: none; }
.cal-title a:hover { color: var(--accent); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; font-size: 12px; }
.cal-dow { color: var(--muted); font-size: 11px; }
.cal-dow.we { color: #c62828; }
.cal-d { border-radius: 4px; padding: 2px 0; line-height: 1.6; }
.cal-d.work { background: #f3f5f8; }
.cal-d.short { background: #fff4d6; color: #8a5a00; font-weight: 600; }
.cal-d.off { background: #fde8e8; color: #c62828; font-weight: 600; }
.cal-d.today { outline: 2px solid var(--accent); outline-offset: -1px; }
.cal-single { max-width: 460px; }
.cal-big .cal-grid { font-size: 16px; gap: 4px; }
.cal-big .cal-dow { font-size: 13px; }
.cal-big .cal-d { padding: 8px 0; }
.cal-big .cal-title { font-size: 18px; }
.cal-legend { font-size: 13px; color: var(--muted); margin: 8px 0 4px; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.cal-legend .cal-d { display: inline-block; width: 22px; text-align: center; font-size: 12px; }
table.data tr.sub-total td { color: var(--muted); font-style: italic; }
table.data tr.total td { font-weight: 700; border-top: 2px solid var(--border); }
.month-links { display: flex; flex-wrap: wrap; gap: 6px; }
.month-links a { padding: 4px 12px; border: 1px solid var(--border); border-radius: 8px; text-decoration: none; background: var(--card); }
.month-links a.current { background: var(--accent); color: #fff; border-color: var(--accent); }
.cal-nav { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }

/* ---------- График платежей ---------- */
.schedule h3 { margin: 22px 0 6px; font-size: 18px; }
.sched-legend { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.sched-legend .sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-left: 6px; }
.sched-chart { width: 100%; height: 180px; display: block; margin: 8px 0 4px; }
.b-p { fill: var(--accent); }
.b-i { fill: #f5a524; }
.sched-legend .b-p { background: var(--accent); }
.sched-legend .b-i { background: #f5a524; }
.sched-table { font-size: 14px; }
.schedule details { margin-top: 10px; }
.schedule summary { cursor: pointer; color: var(--accent); font-weight: 600; }
.sched-scroll { max-height: 420px; overflow-y: auto; }
.cat-sub { max-width: 58%; }
.cat-taxes .cat-sub, .cat-credit .cat-sub { max-width: 52%; }
@media (max-width: 700px) { .cat-sub { max-width: 62%; } }
.cat-tile:not(.cat-taxes):not(.cat-credit) svg { width: 42%; max-width: 230px; }
@media (max-width: 700px) { .cat-tile:not(.cat-taxes):not(.cat-credit) svg { width: 62%; } }
table.data tr.hl td { background: #fff4d6; }

/* ---------- Подсказки под полями ---------- */
.field-hint { display: block; font-size: 13px; color: var(--muted); line-height: 1.4; margin-top: 6px; }
.field input.slider + .field-hint { margin-top: 2px; }

/* ---------- Меню по разделам ---------- */
.menu-list {
  width: min(760px, calc(100vw - 32px));
  padding: 14px;
}
.menu[open] .menu-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px 18px;
}
.menu-group { display: flex; flex-direction: column; }
.menu-list a.menu-group-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
  padding: 6px 12px 4px;
}
.menu-list a.menu-group-title:hover { color: var(--accent); background: none; }
@media (max-width: 700px) {
  /* на телефоне — панель на весь экран под шапкой, со своей прокруткой */
  .menu[open] .menu-list {
    position: fixed;
    top: var(--menu-top, 60px);
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    border-radius: 0;
    border-width: 1px 0 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    grid-template-columns: 1fr 1fr;
    align-content: start;
    padding: 12px 12px 32px;
  }
  .menu-list a { padding: 10px 12px; }
  html.menu-open, html.menu-open body { overflow: hidden; }
}
@media (max-width: 380px) {
  .menu[open] .menu-list { grid-template-columns: 1fr; }
}

/* ---------- Поиск на главной ---------- */
.site-search { position: relative; margin: 14px 0 4px; }
.site-search input {
  width: 100%;
  padding: 13px 16px 13px 42px;
  font-size: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%235b6472' stroke-width='2'%3E%3Ccircle cx='8' cy='8' r='6'/%3E%3Cpath d='m13 13 4 4'/%3E%3C/svg%3E") no-repeat 14px center;
}
.site-search input:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
.search-results {
  position: absolute;
  left: 0; right: 0; top: calc(100% + 4px);
  z-index: 20;
  list-style: none;
  margin: 0; padding: 6px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.12);
}
.search-results a { display: block; padding: 8px 10px; border-radius: 8px; text-decoration: none; color: var(--text); }
.search-results a span { display: block; font-size: 13px; color: var(--muted); }
.search-results li.active a, .search-results a:hover { background: #eef3ff; }
.search-results .empty { padding: 8px 10px; color: var(--muted); }

/* ---------- Ближайшие события ---------- */
.events { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 760px) { .events { grid-template-columns: repeat(2, 1fr); } }
.event {
  display: flex; flex-direction: column;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 14px; text-decoration: none; color: var(--text);
}
.event:hover { border-color: var(--accent); }
.event-date { font-size: 20px; font-weight: 700; color: var(--accent-dark); }
.event-days { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.event strong { font-size: 14px; line-height: 1.35; }
.event-sub { font-size: 13px; color: var(--muted); margin-top: 2px; }

/* Рекламные места: высота зарезервирована заранее, чтобы контент не прыгал */
.ad-slot { min-height: 280px; margin: 20px 0; display: flex; justify-content: center; align-items: center; }
@media (max-width: 560px) { .ad-slot { min-height: 250px; } }

/* ---------- Статьи ---------- */
.post h2 { margin-top: 30px; }
.post-meta { font-size: 14px; color: var(--muted); margin: -4px 0 8px; }
.post ol, .post ul { padding-left: 22px; }
.post li { margin: 6px 0; }
.calc-embed { margin: 18px 0 8px; }
.calc-embed .calc { margin-bottom: 6px; }
.calc-embed-link { font-size: 14px; margin: 0 0 8px; }
.sources { font-size: 14px; }
.post-list { display: grid; gap: 12px; margin-top: 16px; }
.post-card {
  display: block; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 18px; text-decoration: none; color: var(--text);
}
.post-card:hover { border-color: var(--accent); }
.post-card strong { display: block; font-size: 18px; color: var(--accent-dark); margin: 2px 0 4px; }
.post-card span { color: var(--muted); font-size: 15px; }
.post-card .post-date { font-size: 13px; }

/* ---------- Шапка: «Статьи» рядом с меню калькуляторов ---------- */
.header-nav { display: flex; align-items: center; gap: 8px; }
.nav-link {
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}
.nav-link:hover { background: var(--bg); color: var(--accent-dark); }
.nav-link.active { color: var(--accent-dark); background: #e8efff; }
.menu-list a.menu-all {
  grid-column: 1 / -1;
  border-top: 1px solid var(--border);
  border-radius: 0;
  margin-top: 4px;
  padding-top: 12px;
  font-weight: 600;
  color: var(--accent-dark);
}
@media (max-width: 380px) { .nav-link { padding: 8px 10px; } }

/* ---------- Фильтр статей ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 4px; }
.chip {
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 14px;
  cursor: pointer;
}
.chip span { color: var(--muted); margin-left: 2px; }
.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip.active span { color: #dbe6ff; }

/* ---------- Шапка: «Калькуляторы» и «Статьи» — пункты одного вида ---------- */
.header-nav { gap: 4px; }
.header-nav .menu summary,
.header-nav .nav-link {
  display: inline-flex;
  align-items: center;
  height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
}
.header-nav .menu summary:hover,
.header-nav .nav-link:hover { background: #eef2f8; color: var(--text); }
.header-nav .menu[open] summary,
.header-nav .nav-link.active { background: #e8efff; color: var(--accent-dark); }
.header-nav .menu summary::after { content: ""; width: 7px; height: 7px; margin: -3px 0 0 8px;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); opacity: .6; }
.header-nav .menu[open] summary::after { transform: rotate(-135deg); margin-top: 3px; }

/* Убираем пустоту над первым заголовком в текстовых блоках */
article > h2:first-child, article > script:first-child + h2, .post > h1:first-child { margin-top: 0; }
article.post { padding-top: 24px; }
/* На телефоне поля идут в одну колонку — выравнивать подписи по высоте не нужно */
@media (max-width: 560px) {
  .field label { min-height: 0; }
  .calc-grid { gap: 14px; }
}

/* Таблица нормативных чисел на «Методике» */
table.rules td { vertical-align: top; font-size: 14px; }
table.rules .rules-where { font-size: 13px; color: var(--muted); }
table.rules .rules-where a { color: var(--muted); }
table.rules .rules-next { display: inline-block; margin-top: 6px; font-size: 13px; color: var(--accent, #2563eb); }
@media (max-width: 560px) { table.rules { font-size: 13px; } }

/* ---------- Праздники: информер «Сегодня», карточки, дни месяца ---------- */
.informer {
  display: grid; grid-template-columns: 1fr 260px; gap: 0;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  margin: 14px 0 24px; overflow: hidden;
}
.inf-main { padding: 16px 18px; }
.inf-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; margin-bottom: 8px; }
.inf-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #fff; background: var(--accent); border-radius: 6px; padding: 2px 8px; }
.inf-date { font-size: 20px; font-weight: 700; color: var(--text); text-decoration: none; }
.inf-date:hover { color: var(--accent-dark); }
.inf-kind { font-size: 13px; color: var(--muted); }
.inf-list { list-style: none; margin: 0 0 8px; padding: 0; }
.inf-list li { display: flex; align-items: baseline; gap: 8px; padding: 3px 0; font-size: 15px; line-height: 1.4; }
.inf-list a { color: var(--text); text-decoration: none; font-weight: 600; }
.inf-list a:hover { color: var(--accent-dark); text-decoration: underline; }
.inf-none { color: var(--muted); }
.inf-more { font-size: 14px; }
.inf-side { background: linear-gradient(160deg, #1f2a44, #2c3e6b); color: #fff; padding: 16px 18px; display: flex; flex-direction: column; gap: 14px; }
.inf-count { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.inf-num { font-size: 34px; font-weight: 800; line-height: 1; }
.inf-cap { font-size: 14px; opacity: .85; }
.inf-rest { display: flex; flex-direction: column; color: #fff; text-decoration: none; border-top: 1px solid rgba(255,255,255,.18); padding-top: 12px; font-size: 13px; }
.inf-rest span { opacity: .8; }
.inf-rest strong { font-size: 16px; margin: 2px 0; }
.inf-rest:hover strong { text-decoration: underline; }
@media (max-width: 640px) { .informer { grid-template-columns: 1fr; } }

.hol-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; display: inline-block; position: relative; top: -1px; }
.hol-badge { display: inline-block; font-size: 12px; font-weight: 600; border-radius: 999px; padding: 2px 10px; color: #fff; }
.t-state { background: #d93025; } .t-military { background: #4d6b2f; } .t-memorial { background: #5b6472; }
.t-church { background: #b07d12; } .t-russia { background: #e8590c; } .t-prof { background: #0f62fe; } .t-intl { background: #0e8a87; } .t-other { background: #8a3ffc; }
.hol-list { display: grid; gap: 10px; margin: 8px 0 16px; }
.hol-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px; }
.hol-card .hol-badge { margin-bottom: 4px; }
.hol-name { display: block; font-weight: 700; font-size: 17px; color: var(--text); text-decoration: none; line-height: 1.35; }
.hol-name:hover { color: var(--accent-dark); text-decoration: underline; }
.hol-card p { margin: 6px 0 0; font-size: 15px; color: var(--muted); }
.hol-when { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 10px;
  background: linear-gradient(160deg, #1f2a44, #2c3e6b); color: #fff; border-radius: var(--radius); padding: 16px 20px; margin: 10px 0 16px; }
.hol-when > div:first-child { display: flex; flex-direction: column; }
.hol-when-label { font-size: 13px; opacity: .8; }
.hol-when strong { font-size: 26px; line-height: 1.25; }
.hol-when span:last-child { opacity: .85; font-size: 14px; }
.hol-when-past { font-size: 13px; opacity: .75; }
.hol-month { display: grid; gap: 12px; margin: 12px 0; }
.hol-day { display: grid; grid-template-columns: 150px 1fr; gap: 12px; align-items: start; }
.hol-day-date { color: var(--text); text-decoration: none; font-size: 14px; color: var(--muted); padding-top: 10px; }
.hol-day-date strong { display: block; font-size: 18px; color: var(--text); }
.hol-day.off .hol-day-date strong { color: #d93025; }
.hol-day .hol-list { margin: 0; }
@media (max-width: 560px) { .hol-day { grid-template-columns: 1fr; gap: 4px; } .hol-day-date { padding-top: 0; } .hol-day-date strong { display: inline; } }
.day-nav { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.month-links { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.month-links a { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; text-align: center; text-decoration: none; color: var(--text); font-weight: 600; }
.month-links a:hover { border-color: var(--accent); color: var(--accent-dark); }
.hol-group { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 16px; margin: 8px 0; }
.hol-group summary { cursor: pointer; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.hol-group ul { margin: 8px 0 4px; padding-left: 20px; columns: 2; column-gap: 24px; }
.hol-group li { break-inside: avoid; font-size: 15px; }
@media (max-width: 640px) { .hol-group ul { columns: 1; } }
.muted { color: var(--muted); font-weight: 400; }

/* ---------- Как отдыхаем и обратный отсчёт ---------- */
.cal-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; margin: 8px 0; }
.card-link.vac { cursor: default; }
.card-link.vac strong { color: var(--ok); }
.hol-when-link { color: #fff; font-weight: 600; white-space: nowrap; }
.btn-link { display: inline-block; background: var(--accent); color: #fff; font-weight: 600; text-decoration: none; border-radius: 10px; padding: 10px 16px; }
.btn-link:hover { background: var(--accent-dark); }
.countdown { background: linear-gradient(160deg, #1f2a44, #2c3e6b); color: #fff; border-radius: var(--radius); padding: 24px; text-align: center; margin: 12px 0 20px; }
.cd-main { display: flex; justify-content: center; align-items: baseline; gap: 12px; }
.cd-num { font-size: 72px; font-weight: 800; line-height: 1; }
.cd-cap { font-size: 24px; opacity: .9; }
.cd-clock { font-size: 18px; margin-top: 10px; opacity: .9; font-variant-numeric: tabular-nums; }
.cd-sub { font-size: 14px; opacity: .75; margin-top: 4px; }

/* ---------- Широкая раскладка: контейнер 1200, текст и калькулятор ≤ 820, справа — колонка ---------- */
.container { max-width: 1200px; }
.page-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; }
.page-aside { display: none; }
@media (min-width: 1100px) {
  .page-grid { grid-template-columns: minmax(0, 1fr) 300px; }
  .page-aside { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 76px; align-self: start; padding-top: 34px; }
}
.page-main { max-width: 840px; min-width: 0; }
.aside-box { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; }
.aside-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 6px; }
.aside-date { font-weight: 700; font-size: 17px; color: var(--text); text-decoration: none; }
.aside-date:hover { color: var(--accent-dark); }
.aside-kind { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.aside-hol { display: flex; align-items: baseline; gap: 8px; font-size: 14px; color: var(--text); text-decoration: none; padding: 2px 0; line-height: 1.35; }
.aside-hol:hover { color: var(--accent-dark); text-decoration: underline; }
.aside-ny { font-size: 13px; color: var(--muted); margin-top: 8px; border-top: 1px solid var(--border); padding-top: 8px; }
.aside-rates { width: 100%; border-collapse: collapse; font-size: 14px; }
.aside-rates td { padding: 4px 0; }
.aside-rates td.num { text-align: right; white-space: nowrap; font-weight: 600; }
.aside-rates .chg { display: block; font-size: 12px; font-weight: 400; }
.aside-rates a { color: var(--text); text-decoration: none; }
.aside-rates a:hover { color: var(--accent-dark); text-decoration: underline; }
.aside-link { font-size: 14px; color: var(--text); text-decoration: none; padding: 5px 8px; margin: 0 -8px; border-radius: 8px; }
.aside-link:hover { background: var(--bg); color: var(--accent-dark); }
.aside-link.active { background: #e8efff; color: var(--accent-dark); font-weight: 600; }
.page-aside .ad-slot { margin: 0; min-height: 250px; }
/* главная — во всю ширину: разделы по три в ряд */
@media (min-width: 1000px) {
  .cat-tile, .cat-tile.cat-taxes, .cat-tile.cat-credit { grid-column: span 2; min-height: 200px; }
  .cat-taxes .cat-title, .cat-credit .cat-title { font-size: 24px; }
}

/* ---------- Информеры для сайтов ---------- */
.widget-demo { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; }
.widget-demo h2 { margin-top: 12px; }
pre.code { background: #1f2a44; color: #e8efff; border-radius: 10px; padding: 12px 14px; overflow-x: auto; font-size: 13px; white-space: pre; }

/* ---------- Меню калькуляторов: разделы в сбалансированных колонках (как в газете), без пустот ---------- */
.menu[open] .menu-list { display: block; }
.menu-cols { column-count: 2; column-gap: 12px; }
.menu-group { display: block; break-inside: avoid; page-break-inside: avoid; margin-bottom: 10px; }
.menu-list a.menu-group-title { color: var(--accent-dark); }
.menu-cols a { overflow-wrap: anywhere; }
.menu-list a.menu-all { display: block; border-top: 1px solid var(--border); margin-top: 4px; padding-top: 12px; }
@media (max-width: 380px) { .menu-cols { column-count: 1; } }
@media (min-width: 701px) {
  .site-header .container { position: relative; }
  .header-nav .menu { position: static; }
  .menu[open] .menu-list {
    position: absolute; left: 16px; right: 16px; width: auto; top: calc(100% - 2px);
    max-height: calc(100vh - 90px); overflow-y: auto; overscroll-behavior: contain;
    padding: 18px 20px 12px;
  }
  .menu-cols { column-count: 3; column-gap: 28px; }
  .menu-list a { padding: 5px 10px; font-size: 14.5px; line-height: 1.35; }
  .menu-list a.menu-group-title { padding: 4px 10px 6px; font-size: 11.5px; white-space: nowrap; }
}
@media (min-width: 1100px) {
  .menu-cols { column-count: 5; }
}
