/* site.css - «Ставка»: тёмно-хвойный хиро, тёплая бумага, лаймовый акцент */

:root {
  --paper: #fbfaf2;
  --canvas: #eef1e7;
  --sage: #e2e8d9;
  --ink: #11201b;
  --forest: #0e3b31;
  --forest-deep: #092a23;
  --muted: #5d6b62;
  --line: #d5dccf;
  --hair: #e1e7da;          /* штриховые разделители внутри карточек */
  --card: #fff;
  --card-line: #e6eadf;     /* границы карточек и подписей */
  --input-line: #d9dfd2;    /* границы полей ввода */
  --accent: #0e5b45;
  --lime: #c8e86b;
  --lime-soft: #dfeeae;
  --amber: #d99b4e;
  --shadow-card: 0 40px 70px -38px rgba(4, 18, 14, .55), 0 1px 0 rgba(255, 255, 255, .6) inset;
  --radius: 20px;
  --max: 1140px;
  --display: "Unbounded", "Onest", system-ui, sans-serif;
  --sans: "Onest", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* атрибут hidden должен побеждать любой display из классов */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* Сообщение для браузеров без JS */
.noscript-message {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px 28px;
  margin: 24px auto;
  max-width: 760px;
}
.noscript-message h2 {
  font-family: var(--display);
  font-size: 26px;
  color: var(--forest);
  margin-bottom: 12px;
}
.noscript-message p {
  margin-bottom: 10px;
  color: var(--ink);
}
.noscript-message p:last-child {
  margin-bottom: 0;
}

a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
/* на тёмных поверхностях хвойный контур невидим - переключаем на лайм */
.site-header :focus-visible,
.hero :focus-visible,
.page-head :focus-visible,
.site-footer :focus-visible { outline-color: var(--lime); }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px; }

/* ---------- Header ---------- */

.site-header {
  position: sticky; top: 0; z-index: 30;
  background: var(--forest);
  border-bottom: 1px solid rgba(200, 232, 107, .16);
}
.header-inner {
  max-width: var(--max); margin: 0 auto; padding: 0 24px;
  height: 72px; display: flex; align-items: center; gap: 44px;
}
.logo { display: flex; align-items: center; gap: 11px; flex: none; }
.logo svg { color: var(--lime); }
.logo-name {
  font-family: var(--display); font-size: .92rem; font-weight: 600;
  letter-spacing: -.03em; line-height: 1; color: #f4f7ee; display: block;
  white-space: nowrap;
}
.logo-sub {
  display: block; font-size: .68rem; color: #93ac9f;
  letter-spacing: .01em; margin-top: 4px; font-weight: 400;
}

.main-nav { display: flex; gap: 24px; font-size: .92rem; }
.main-nav .nav-short { display: none; }
.main-nav a { color: #b5c8bd; padding: 6px 0; position: relative; }
.main-nav a:hover { color: #fff; }
.main-nav a.is-active,
.main-nav a[aria-current="page"] { color: #f4f7ee; }
.main-nav a.is-active::after,
.main-nav a[aria-current="page"]::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0;
  height: 3px; background: var(--lime); border-radius: 3px;
}

/* ---------- Hero ---------- */

.hero {
  position: relative; overflow: hidden;
  padding: 52px 0 34px;
  color: #eef4ea;
  background-color: var(--forest);
  background-image:
    radial-gradient(620px 460px at 88% 2%, rgba(200, 232, 107, .26), transparent 62%),
    radial-gradient(560px 520px at 66% 102%, rgba(66, 160, 126, .40), transparent 64%),
    radial-gradient(420px 380px at 4% 112%, rgba(200, 232, 107, .10), transparent 60%),
    linear-gradient(rgba(243, 246, 236, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(243, 246, 236, .045) 1px, transparent 1px);
  background-size: auto, auto, auto, 44px 44px, 44px 44px;
}

.hero-orbits {
  position: absolute; top: -240px; right: -220px;
  width: 1000px; height: 1000px; z-index: 0; pointer-events: none;
}

/* столбцы выплат - только правый край, уходят вниз под градиент */
.hero-bars {
  position: absolute; left: 50%; transform: translateX(-50%); bottom: 24px;
  width: 72%; max-width: 940px; height: 34%;
  z-index: 1; pointer-events: none;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 24%, #000 76%, transparent 100%),
                      linear-gradient(0deg, transparent 2%, #000 26%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(90deg, transparent 0%, #000 24%, #000 76%, transparent 100%),
              linear-gradient(0deg, transparent 2%, #000 26%);
  mask-composite: intersect;
}
.hero-bars svg { width: 100%; height: 100%; display: block; }
.hero-bars .hb { fill: rgba(200, 232, 107, .16); }
.hero-bars .hb2 { fill: rgba(200, 232, 107, .24); }
.hero-bars .hb-acc { fill: #c8e86b; fill-opacity: .5; }

/* кривая остатка долга с подсветкой */
.hero-curve {
  position: absolute; left: 50%; transform: translateX(-50%); bottom: 30px;
  width: 82%; max-width: 1040px; height: 52%;
  z-index: 1; pointer-events: none;
}
.hero-curve svg { width: 100%; height: 100%; display: block; }
.hero-curve .curve-glow {
  filter: drop-shadow(0 0 12px rgba(200, 232, 107, .75)) drop-shadow(0 0 30px rgba(200, 232, 107, .35));
}
.hero-curve .curve-line {
  stroke-dasharray: 1700; stroke-dashoffset: 1700;
  animation: curve-draw 2.4s cubic-bezier(.4, 0, .2, 1) .15s forwards;
}
@keyframes curve-draw { to { stroke-dashoffset: 0; } }
.hero-curve .curve-dot { opacity: 0; animation: dot-in .5s ease 2.3s forwards; }
@keyframes dot-in { to { opacity: 1; } }
.hero-grid { position: relative; z-index: 2; display: grid; grid-template-columns: 1.02fr .98fr; gap: 56px; align-items: start; padding-bottom: 44px; }
.hero-grid > *, .page-grid > * { min-width: 0; }

.eyebrow {
  display: inline-block; font-size: .78rem; letter-spacing: .01em;
  color: #e2f3b0; background: rgba(200, 232, 107, .13);
  border: 1px solid rgba(200, 232, 107, .28);
  border-radius: 999px; padding: 5px 14px; margin-bottom: 22px;
}

h1 {
  font-family: var(--display); font-weight: 600;
  font-size: clamp(1.65rem, 2.7vw, 2.4rem);
  line-height: 1.1; letter-spacing: -.035em;
  margin-bottom: 20px; max-width: 19ch; color: #f6f8f0;
}
.hero-lead { color: #b9cbc0; font-size: 1.05rem; max-width: 44ch; margin-bottom: 24px; }
.sec-head { margin-bottom: 28px; }
.sec-head h2 { max-width: 26ch; }

.hero-fact {
  display: flex; gap: 16px; align-items: center;
  margin-top: 24px; padding-top: 18px; max-width: 46ch;
  border-top: 1px solid rgba(200, 232, 107, .22);
}
.hero-fact b {
  font-family: var(--display); font-size: 1.75rem; font-weight: 600;
  letter-spacing: -.04em; color: var(--lime); flex: none; line-height: 1;
  margin-top: -2px;
}
.hero-fact span { font-size: .86rem; line-height: 1.5; color: #a9bfb3; }

.hero-points { display: grid; gap: 13px; list-style: none; font-size: .95rem; }
.hero-points li { display: flex; gap: 11px; align-items: flex-start; color: #dbe6db; }
.hero-points li::before {
  content: ""; flex: none; width: 18px; height: 18px; margin-top: 3px; border-radius: 6px;
  background: rgba(200, 232, 107, .16) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath d='M5 9.2l2.6 2.6L13 6.4' fill='none' stroke='%23c8e86b' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/15px no-repeat;
}

/* компактная версия калькулятора для главной */
.calc-compact { padding: 22px; }
.calc-compact .calc-head { margin-bottom: 16px; }
.calc-compact .field { margin-bottom: 14px; }
.calc-compact .amount-input { font-size: 1.14rem; padding: 9px 0 9px 13px; }
.calc-compact .mini-input { width: 84px; padding: 7px 9px; font-size: .9rem; }
.calc-compact .term-value { height: 34px; font-size: .9rem; min-width: 84px; }
.calc-compact input[type=range] { margin-top: 9px; height: 18px; }
/* на главной значение поля чуть ниже поля срока: выравниваем ползунки */
.calc-compact .two-col > .field > input[type=range] { margin-top: 9px; height: 18px; }
.calc-compact .segmented button { padding: 8px 6px; font-size: .8rem; }
.calc-compact .calc-results { margin-top: 16px; padding-top: 14px; }
.calc-compact .res-v { font-size: 1.5rem; }
.calc-compact .res-list { gap: 6px; margin-top: 12px; }
.calc-compact .res-list > div { font-size: .85rem; padding-top: 6px; }
.calc-compact .chart-compact { margin-top: 12px; padding-top: 10px; }

.calc-extra { margin-top: 2px; }
.calc-extra summary {
  cursor: pointer; font-size: .8rem; color: var(--muted);
  list-style: none; display: inline-flex; align-items: center; gap: 6px;
}
.calc-extra summary::-webkit-details-marker { display: none; }
.calc-extra summary::before {
  content: "+"; display: inline-grid; place-items: center;
  width: 16px; height: 16px; border-radius: 5px;
  background: var(--sage); color: var(--accent); font-size: 13px; line-height: 1;
}
.calc-extra summary:hover { color: var(--accent); }
.calc-field {
  background: var(--paper);
  border: 1px solid var(--input-line);
  border-radius: 10px;
  padding: 12px 14px;
}

/* ---------- Calculator ---------- */

.calc {
  background: var(--card); border: 1px solid var(--card-line); border-radius: 24px; padding: 26px;
  min-width: 0; color: var(--ink);
  box-shadow: var(--shadow-card);
}
.calc-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 22px; gap: 12px; }
.calc-head h2 {
  font-family: var(--display); font-size: .98rem; font-weight: 600; letter-spacing: -.02em;
}
.calc-head span { font-size: .74rem; color: var(--muted); }

.field { margin-bottom: 20px; }
.field > label { display: block; font-size: .8rem; color: var(--muted); margin-bottom: 7px; }
.field-row { display: flex; align-items: center; gap: 10px; }
.field-row > .cur, .field-row > .mini-input { flex: none; }

.amount-wrap {
  display: flex; align-items: center; gap: 9px; background: var(--card);
  border: 1px solid var(--input-line); border-radius: 12px; padding-right: 14px;
}
.amount-wrap:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(14, 91, 69, .12); }
.amount-wrap .amount-input {
  flex: 1 1 auto; min-width: 0; width: auto;
  border: 0; background: transparent; box-shadow: none;
  padding: 11px 0 11px 14px;
}
.amount-wrap .cur { flex: none; }

.amount-input {
  width: 100%; border: 1px solid var(--input-line); border-radius: 12px;
  padding: 11px 14px; font-family: var(--display); font-size: 1.28rem;
  font-weight: 500; letter-spacing: -.02em; color: var(--ink);
  background: var(--card); -moz-appearance: textfield; appearance: textfield;
}
.amount-input:focus, .mini-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(14, 91, 69, .12); }
.amount-input::-webkit-outer-spin-button,
.amount-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.cur { font-size: .95rem; color: var(--muted); }

/* ---------- Ползунки: кастомный трек и бегунок вместо нативного ---------- */

input[type=range] {
  -webkit-appearance: none; appearance: none;
  width: 100%; margin-top: 12px; height: 22px;
  background: transparent; cursor: pointer;
}
input[type=range]::-webkit-slider-runnable-track {
  height: 6px; border-radius: 999px;
  background: var(--sage);
  box-shadow: inset 0 1px 1px rgba(9, 42, 35, .08);
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 20px; height: 20px; margin-top: -7px; border-radius: 50%;
  background: var(--forest); border: 3px solid var(--card);
  box-shadow: 0 1px 3px rgba(9, 42, 35, .35);
  transition: transform .15s ease, box-shadow .15s ease;
}
input[type=range]:hover::-webkit-slider-thumb { transform: scale(1.08); }
input[type=range]:active::-webkit-slider-thumb {
  transform: scale(1.08);
  box-shadow: 0 0 0 6px rgba(14, 91, 69, .12), 0 1px 3px rgba(9, 42, 35, .35);
}
input[type=range]:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 0 0 4px rgba(200, 232, 107, .85), 0 1px 3px rgba(9, 42, 35, .35);
}
input[type=range]::-moz-range-track {
  height: 6px; border-radius: 999px; background: var(--sage);
}
input[type=range]::-moz-range-progress {
  height: 6px; border-radius: 999px; background: var(--forest);
}
input[type=range]::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--forest); border: 3px solid var(--card);
  box-shadow: 0 1px 3px rgba(9, 42, 35, .35);
}

.mini-input {
  width: 92px; border: 1px solid var(--input-line); border-radius: 10px; padding: 8px 10px;
  font-family: var(--sans); font-size: .95rem; font-weight: 500;
  font-variant-numeric: tabular-nums; background: var(--card); color: var(--ink);
}
.mini-input:disabled { background: var(--canvas); color: var(--muted); }
.term-value {
  display: inline-flex; align-items: center; height: 38px; padding: 0 13px;
  border: 1px solid var(--input-line); border-radius: 10px; background: var(--card);
  font-size: .95rem; font-weight: 500; font-variant-numeric: tabular-nums; min-width: 92px;
}

.term-presets { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.term-presets button {
  border: 1px solid #cdd7c6; background: transparent; border-radius: 999px;
  padding: 3px 10px; font: inherit; font-size: .72rem; color: var(--muted); cursor: pointer;
  transition: border-color .15s, color .15s;
}
.term-presets button:hover { border-color: var(--forest); color: var(--forest); }

/* ---------- Пара полей «ставка / срок» ----------
   Значение в обоих полях одной высоты, иначе ползунки встают на разной высоте.
   Стоит ниже .term-value и .mini-input, чтобы перебить их height. */
.two-col > .field > .mini-input,
.two-col > .field > .field-row { min-height: 36px; height: 36px; align-items: center; }
.two-col > .field > .field-row { display: flex; }
.two-col > .field .term-value { height: 36px; }
.calc-compact .two-col > .field > .mini-input,
.calc-compact .two-col > .field > .field-row,
.calc-compact .two-col > .field .term-value { height: 34px; min-height: 34px; }

.is-neg { color: #a16207; }

/* Пара полей «ставка / срок» выравнивается по строкам сетки: подпись,
   значение, ползунок, примечание. Иначе обёртка значения в одном поле
   и отсутствие её в другом сдвигают ползунки на разную высоту. */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 18px; }
.two-col > * { min-width: 0; }
.two-col > .field {
  display: grid;
  grid-template-rows: auto auto auto auto;
  align-content: start;
  row-gap: 0;
  margin-bottom: 0;
}
.two-col > .field > label:first-child { margin-bottom: 7px; }
.two-col > .field > input[type=range] { margin-top: 9px; align-self: center; }
.two-col > .field > .check,
.two-col > .field > .field-row:has(+ input[type=range]) { display: flex; }
.two-col > .field > .check { margin-top: 6px; }

.segmented { display: flex; background: #e7ebde; border-radius: 12px; padding: 4px; gap: 2px; }
.segmented button {
  flex: 1; min-width: 0; border: 0; background: transparent; padding: 9px 6px;
  border-radius: 9px; font-family: var(--sans); font-size: .84rem; font-weight: 500;
  color: var(--muted); cursor: pointer; overflow-wrap: anywhere; line-height: 1.2;
  transition: background .15s, color .15s;
}
.segmented button:hover:not(.is-active) { color: var(--ink); background: rgba(255, 255, 255, .55); }
.segmented button.is-active { background: var(--forest); color: #f2f6ea; }

/* ---------- Результаты, график, досрочные ----------
   Блок вырезан коммитом 1a77c8d и не вернулся при восстановлении
   базового слоя. Возвращён целиком из 1a77c8d^ (211 строк). */

.check { display: flex; align-items: center; gap: 9px; font-size: .86rem; color: var(--muted); cursor: pointer; }
.check input { accent-color: var(--forest); width: 16px; height: 16px; }

.calc-results { border-top: 1px solid var(--line); margin-top: 24px; padding-top: 18px; }

.tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.tab {
  position: relative; background: none; border: 0; padding: 0 0 11px;
  font: inherit; font-size: .86rem; font-weight: 500; color: var(--muted); cursor: pointer;
}
.tab:hover { color: var(--ink); }
.tab.is-active { color: var(--ink); }
.tab.is-active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px;
  height: 3px; background: var(--forest); border-radius: 3px;
}
.tab-panel { display: none; }
.tab-panel.is-active { display: block; }

.res-k { display: block; font-size: .78rem; color: var(--muted); margin-bottom: 3px; }
.res-v {
  display: block; font-family: var(--display); font-size: 1.72rem; font-weight: 600;
  letter-spacing: -.04em; color: var(--forest); line-height: 1.15;
}
.res-v.is-good { color: var(--accent); }
.res-v.is-bad { color: #a1321f; }
.res-context { display: block; font-size: .79rem; color: var(--muted); margin-top: 4px; }
.res-context.warn { color: #a16207; }

.term-table { display: grid; gap: 8px; margin-top: 16px; }
.term-table > div {
  display: flex; justify-content: space-between; gap: 16px; font-size: .88rem;
  border-top: 1px dashed var(--hair); padding-top: 8px;
}
.term-table dt { color: var(--muted); }
.term-table dd { font-variant-numeric: tabular-nums; font-weight: 500; }
.term-table-title { font-size: .78rem; color: var(--muted); margin-top: 18px; }
.group-label {
  font-size: .74rem; letter-spacing: .04em; color: var(--accent);
  margin: 2px 0 14px; padding-bottom: 8px; border-bottom: 1px solid var(--card-line);
}
.group-label + .field { margin-top: 0; }

.res-list { display: grid; gap: 9px; margin-top: 17px; }
.res-list > div {
  display: flex; justify-content: space-between; gap: 16px; font-size: .9rem;
  border-top: 1px dashed var(--hair); padding-top: 9px;
}
.res-list dt { color: var(--muted); }
/* подпись может переноситься, сумма - нет: иначе «101» и «366,64 ₽» разъезжаются */
.res-list dd { font-variant-numeric: tabular-nums; font-weight: 500; white-space: nowrap; text-align: right; }

/* ---------- Chart ---------- */

.chart { margin-top: 20px; border-top: 1px dashed var(--hair); padding-top: 16px; }
.chart-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 10px; }
.chart-title { font-size: .8rem; font-weight: 500; }
.chart-legend { display: flex; gap: 14px; font-size: .74rem; color: var(--muted); }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.dot { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }
.dot-body { background: var(--forest); }
.dot-interest { background: var(--amber); }
.chart-box svg { display: block; width: 100%; height: auto; }
.bar-body { fill: var(--forest); }
.bar-interest { fill: var(--amber); }
.bar-label { font-family: var(--sans); font-size: 10px; fill: var(--muted); }
.bar:hover { opacity: .8; }
.chart-caption { font-size: .75rem; color: var(--muted); margin-top: 6px; }

/* ---------- Досрочные платежи ---------- */

.extras { margin-top: 6px; padding-top: 16px; border-top: 1px dashed var(--hair); }
.extras-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.extras-head > span { font-size: .8rem; color: var(--muted); }
.link-btn {
  background: none; border: 0; padding: 0; font: inherit; font-size: .78rem;
  color: var(--accent); cursor: pointer; border-bottom: 1px dashed rgba(14, 91, 69, .35);
}
.link-btn:hover { color: var(--forest); }

/* Кнопка «добавить» внутри калькулятора: пунктирная капсула.
   Пунктир читается как «здесь можно продолжить», а не как готовая кнопка.
   Радиус и палитра - из системы сайта (.feedback button, .term-presets). */
.calc-action {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  width: 100%; padding: 10px 18px;
  border: 1px dashed rgba(14, 91, 69, .38); border-radius: 999px;
  background: transparent;
  font: inherit; font-size: .82rem; font-weight: 500; color: var(--accent);
  cursor: pointer;
  transition: border-color .15s, background .15s, color .15s;
}
.calc-action:hover {
  border-color: var(--accent); border-style: solid;
  background: var(--sage); color: var(--forest);
}
.calc-action:active { transform: translateY(1px); }
.calc-action:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 999px; }

/* удобный плюс вместо текстового «+» */
.calc-action::before {
  content: "+"; font-size: 1.05em; font-weight: 400; line-height: 1;
  margin-top: -1px;
}
.calc-action.is-compact { width: auto; padding: 8px 16px; }

/* ---------- Строка досрочного платежа: как строка квитанции ---------- */

.extra-row {
  position: relative;
  display: grid; grid-template-columns: 72px 1fr 26px;
  column-gap: 10px; row-gap: 8px;
  padding: 10px 10px 11px 14px;
  margin-bottom: 8px;
  background: var(--card);
  border: 1px solid var(--card-line);
  border-left: 3px solid var(--lime);
  border-radius: 12px;
}
.extra-row > .extra-field:nth-child(1) { grid-column: 1; grid-row: 1; }
.extra-row > .extra-field:nth-child(2) { grid-column: 2; grid-row: 1; }
.extra-row > .extra-field:nth-child(3) { grid-column: 1 / 3; grid-row: 2; }
.extra-row > .remove { grid-column: 3; grid-row: 1; align-self: end; margin-bottom: 2px; }
.extra-row:focus-within { border-color: var(--input-line); border-left-color: var(--accent); }
.extra-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.extra-field > span {
  font-size: .68rem; color: var(--muted);
  letter-spacing: .01em;
}
.extra-row .mini-input { width: 100%; padding: 8px 9px; }

.mini-input.wide, .mini-input.grow { width: 100%; }

/* Выбор «срок или платёж»: своя стрелка, вид ближе к .segmented, чем к нативному браузерному */
.select-wrap { position: relative; display: block; }
.select-wrap::after {
  content: "";
  position: absolute; right: 11px; top: 50%;
  width: 7px; height: 7px; margin-top: -5px;
  border-right: 1.6px solid var(--muted); border-bottom: 1.6px solid var(--muted);
  transform: rotate(45deg);
  pointer-events: none;
}
.select-wrap:focus-within::after { border-color: var(--accent); }

select.mini-input {
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  width: 100%; padding: 8px 28px 8px 10px;
  font-size: .8rem; font-weight: 500; color: var(--ink);
  background: var(--card); border-radius: 9px; cursor: pointer;
  text-overflow: ellipsis;
}
select.mini-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(14, 91, 69, .12); }
select.mini-input option { font-family: var(--sans); color: var(--ink); background: var(--card); }

.remove {
  width: 26px; height: 26px; border: 1px solid transparent; border-radius: 50%;
  background: transparent; color: var(--muted); cursor: pointer;
  font-size: 15px; line-height: 1;
  align-self: end; margin-bottom: 3px;
  transition: background .15s, color .15s, border-color .15s;
}
.remove:hover { background: var(--canvas); border-color: var(--card-line); color: var(--ink); }
.remove:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.compare { margin-top: 16px; border-top: 1px dashed var(--hair); padding-top: 16px; }
.cmp-row {
  display: grid; grid-template-columns: 118px 1fr auto; gap: 12px;
  align-items: center; font-size: .78rem; color: var(--muted); margin-bottom: 10px;
}
.cmp-track { display: block; height: 10px; border-radius: 6px; background: #eef1e7; overflow: hidden; }
.cmp-fill { display: block; height: 100%; border-radius: 6px; background: var(--forest); transition: width .25s ease; }
.cmp-fill.alt { background: #b8d95f; }
.cmp-row b { color: var(--ink); font-weight: 500; font-variant-numeric: tabular-nums; }
.cmp-caption { font-size: .75rem; color: var(--muted); margin-top: 2px; }

/* ---------- Feedback ---------- */

.feedback {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-top: 18px; border-top: 1px solid var(--line); padding-top: 15px;
  font-size: .83rem; color: var(--muted);
}
.feedback button {
  border: 1px solid #cdd7c6; background: transparent; border-radius: 999px;
  padding: 4px 15px; font: inherit; font-size: .79rem; color: var(--muted); cursor: pointer;
  transition: border-color .15s, color .15s;
}
.feedback button:hover { border-color: var(--forest); color: var(--forest); }
.feedback-thanks { color: var(--accent); font-weight: 500; }

/* ---------- Table ---------- */

.sched-scroll { max-height: 330px; overflow: auto; margin-top: 4px; max-width: 100%; }

/* Строка с досрочным платежом: подсветка и метка */
tr.has-extra td { background: rgba(200, 232, 107, .16); }
.sched-mark {
  display: inline-block; margin-left: 6px; padding: 1px 6px;
  border-radius: 999px; background: var(--sage);
  font-size: .66rem; font-weight: 500; color: var(--forest);
  text-transform: uppercase; letter-spacing: .02em;
}
table { width: 100%; border-collapse: collapse; font-size: .84rem; font-variant-numeric: tabular-nums; }
th, td { text-align: right; padding: 8px; border-bottom: 1px solid var(--card-line); white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
th {
  color: var(--muted); font-weight: 500; font-size: .74rem;
  position: sticky; top: 0; background: var(--card); z-index: 1;
  box-shadow: 0 1px 0 var(--card-line);
}

/* ---------- Сравнение стратегий ---------- */

.strategy-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 20px; }
.strategy-card {
  border: 1px solid var(--input-line); border-radius: 16px; padding: 18px;
  background: var(--card); display: flex; flex-direction: column; gap: 12px;
}
.strategy-card.is-best {
  border-color: var(--forest); box-shadow: 0 18px 34px -28px rgba(9, 42, 35, .55);
}
.strategy-card h3 {
  font-family: var(--display); font-size: .82rem; font-weight: 600;
  letter-spacing: -.02em; line-height: 1.3;
}
.strategy-badge {
  display: inline-block; align-self: flex-start; padding: 3px 9px; border-radius: 999px;
  background: var(--lime-soft); color: #41531f; font-size: .68rem; font-weight: 500;
}
.strategy-card dl { display: grid; gap: 7px; margin-top: auto; }
.strategy-card dl > div { display: flex; justify-content: space-between; gap: 10px; font-size: .8rem; border-top: 1px dashed #e1e7da; padding-top: 7px; }
.strategy-card dt { color: var(--muted); }
.strategy-card dd { font-variant-numeric: tabular-nums; font-weight: 500; }
.strategy-card dd.good { color: var(--accent); }
.strategy-note { font-size: .74rem; color: var(--muted); line-height: 1.45; }

.plan-legend { margin: 4px 0 10px; font-size: .78rem; flex-wrap: wrap; gap: 14px; }
.dot-cushion { background: rgba(200, 232, 107, .55); }
.plan-chart { margin-bottom: 8px; }
.plan-chart svg { width: 100%; height: auto; display: block; }
.plan-label { font-family: var(--sans); font-size: 15px; }
.plan-label-term { fill: #0e3b31; font-weight: 600; }
.plan-label-plan { fill: #a9772a; }

/* на узких экранах SVG масштабируется вниз - компенсируем размер подписей */
@media (max-width: 700px) {
  .plan-label { font-size: 27px; }
  .plan-chart .bar-label { font-size: 24px; }
}

/* Таблицы: одинаковое оформление на всех страницах и всех ширинах.
   Заголовки всегда горизонтальные: вертикальный текст читается плохо
   и сжимает колонки до состояния, когда пятый столбец уже не разобрать. */
.table-scroll {
  overflow-x: auto;
  margin-top: 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  padding: 16px 18px 6px;
}

.plan-table { min-width: 560px; width: 100%; font-size: .88rem; border-collapse: collapse; }

.plan-table th {
  font-size: .68rem; font-weight: 500; letter-spacing: .07em; text-transform: uppercase;
  color: var(--muted); text-align: center; vertical-align: bottom;
  padding: 0 6px 12px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.plan-table th:first-child { padding-left: 12px; }
.plan-table th:last-child { padding-right: 12px; }

.plan-table td {
  padding: 9px 6px; text-align: center; font-variant-numeric: tabular-nums;
  white-space: nowrap; border-bottom: 1px solid #edf1e6;
}
.plan-table td:first-child { padding-left: 12px; color: var(--muted); }
.plan-table td:last-child { padding-right: 12px; }

.plan-table tbody tr:nth-child(even) { background: rgba(17, 32, 27, .022); }
.plan-table tbody tr:last-child td { border-bottom: none; }

.plan-table td.is-key { background: rgba(200, 232, 107, .22); font-weight: 600; color: var(--ink); }
.plan-table tr.is-key td { background: rgba(200, 232, 107, .24); font-weight: 600; }
.plan-table tr.row-total td { border-top: 1px solid var(--line); font-weight: 600; background: #f6f8f0; }
.plan-table tr.row-total td:first-child { font-weight: 500; color: var(--muted); }
.plan-table tr.row-last td { background: #f4f7ec; font-weight: 600; }

/* Компактная таблица: три колонки, длинные подписи, скролл не нужен.
   Правила тоже потерялись в 1a77c8d, вернулись из 1a77c8d^. */
.plan-table.is-tight { min-width: 0; width: 100%; }
.table-scroll:has(.plan-table.is-tight) + .table-hint { display: none; }
@media (max-width: 700px) {
  .plan-table.is-tight { font-size: .7rem; }
  .plan-table.is-tight th { font-size: .64rem; }
  .plan-table.is-tight th,
  .plan-table.is-tight td { padding-left: 3px; padding-right: 3px; }
}

/* Подзаголовок над таблицей внутри секции статьи */
.plan-subtitle {
  font-family: var(--display);
  font-size: 1.12rem;
  font-weight: 600;
  letter-spacing: -.02em;
  margin: 40px 0 0;
}
.plan-subtitle:first-of-type { margin-top: 0; }

/* Подсказка под таблицей. Правило с .article-page нужно потому,
   что .article-page p задаёт кегль 1.2rem и перебивает одиночный клас. */
.table-hint,
.article-page .table-hint {
  display: none; font-size: .78rem; line-height: 1.5;
  color: var(--muted); margin-top: 10px;
}

/* Планшет: та же карточка, шрифт на шаг меньше */
@media (max-width: 1024px) {
  .plan-table { font-size: .84rem; }
}

/* Телефон: все колонки на месте, заголовки стоят под 90 градусов.
   Вертикальный текст без поворота читается сверху вниз (наклонять голову
   вправо), поэтому vertical-rl плюс rotate(180deg): буквы идут снизу вверх. */
@media (max-width: 700px) {
  .plan-table { min-width: 0; width: 100%; font-size: .8rem; }

  .plan-table th {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    text-orientation: mixed;
    white-space: nowrap;
    text-align: center;
    vertical-align: middle;
    font-size: .64rem;
    font-weight: 600;
    letter-spacing: .06em;
    padding: 4px 2px 8px;
    border-bottom: 1px solid var(--line);
  }

  .plan-table td { padding: 7px 3px; font-size: .8rem; vertical-align: middle; }

  .plan-table th + th,
  .plan-table td + td { border-left: 1px solid #eef2e7; }

  .table-scroll {
    padding: 10px 8px 4px;
    border-color: #dfe6d5;
  }

  .table-hint { display: none; }
}

/* Уже 520px: цифры разворачиваются под 60 градусов.
   Длинная сумма в повёрнутом виде занимает в ширину вдвое меньше места,
   поэтому колонки сжимаются, а шрифт растёт с 9px до 11px.
   Углы разные не для красоты: заголовки под 90 (стоят ровно),
   цифры под 60 (наклонный столбик, зато влезают в любую ширину).
   Между 520 и 700 поворот не нужен: там цифры помещаются лежа. */
@media (max-width: 520px) {
  /* Повёрнутая цифра в ширину занимает втрое меньше места, чем в разметке,
     поэтому ширины колонок задаются жёстко, а не по содержимому. */
  .plan-table { font-size: .72rem; table-layout: fixed; }

  /* Таблица, где первый столбец - слова, а не месяцы: ему почти половина. */
  .plan-table.is-text-col th:first-child { width: 35%; }
  .plan-table th:first-child { width: 34px; }

  /* Высота строки задана руками: повёрнутое число стоит абсолютно
     и высоту ячейки не растит. Значения длиннее - строки выше. */
  .plan-table.is-text-col td { height: 90px; }
  /* Суммы с копейками и знаком рубля длиннее остальных: шрифт на шаг меньше,
     иначе повёрнутое число упирается в рамку. */
  .plan-table.is-text-col td .v { font-size: .64rem; }
  .plan-table.is-long td { height: 106px; }

  .plan-table td {
    position: relative;
    height: 78px;
    padding: 2px 1px;
    font-size: .72rem;
    font-weight: 500;
  }

  /* Число в ячейке: спозиционировано абсолютно, иначе длинная сумма
     распирает ячейку и сдвигает колонки. Центр ячейки - центр поворота. */
  .plan-table td .v {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) rotate(-60deg);
    transform-origin: center;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
  }

  /* Месяц читается горизонтально: две цифры поворачивать нечего. */
  .plan-table td:first-child .v {
    position: static;
    transform: none;
  }

  /* Прочерк в числовом столбце - горизонтально и по центру, как цифры. */
  .plan-table td.dash {
    text-align: center;
    vertical-align: middle;
  }

  /* Длинный текст (название предложения) остаётся горизонтальным:
     в повёрнутом виде строка в три слова стала бы в пол-экрана высотой. */
  .plan-table td.tx {
    height: auto;
    padding: 8px 6px;
    font-size: .72rem;
    line-height: 1.3;
    text-align: left;
    white-space: normal;
    hyphens: manual;
  }

  /* Симметричные отступы: повёрнутое число центруется по ячейке,
     а не сдвигается вправо от старого padding у крайних колонок. */
  .plan-table th:first-child,
  .plan-table th:last-child { padding-left: 0; padding-right: 0; }
  .plan-table td:first-child { padding-left: 2px; padding-right: 2px; }
  .plan-table td:last-child { padding-left: 0; padding-right: 0; }

  .table-scroll { padding: 10px 6px 4px; }

  /* Цифры повёрнуты только здесь: тут и говорим про разворот телефона. */
  .table-hint,
  .article-page .table-hint { display: block; }
}

/* ---------- Sections ---------- */

.section { padding: 76px 0; }
/* Опора из шапки не уезжает под прилипший Header */
section[id], .page-grid > :target { scroll-margin-top: 92px; }
.section h2 {
  font-family: var(--display); font-size: clamp(1.4rem, 2.3vw, 1.9rem);
  font-weight: 600; letter-spacing: -.03em; margin-bottom: 14px; max-width: 22ch;
}
.section-lead { color: var(--muted); max-width: 60ch; margin-bottom: 44px; font-size: 1rem; }

#features { background: var(--canvas); }
#about { background: var(--paper); }
#blog { background: var(--paper); }

.features { display: grid; grid-template-columns: 1fr 1fr; gap: 0 56px; }
.feature { padding: 24px 0; border-top: 1px solid var(--line); }
.feature h3 { font-size: 1.02rem; font-weight: 600; margin-bottom: 7px; letter-spacing: -.01em; }
.feature p { font-size: .94rem; color: var(--muted); max-width: 46ch; }

.prose { max-width: 64ch; }
.prose p { margin-bottom: 16px; color: #26332d; }
.prose p:last-child { margin-bottom: 0; }
.prose a { color: var(--accent); border-bottom: 1px solid rgba(14, 91, 69, .35); }

/* Иллюстрации внутри статей */
.article-fig { margin: 34px 0 14px; max-width: 620px; }
.article-fig img {
  display: block; width: 100%; height: auto;
  border-radius: 18px; background: #fff;
}
.article-fig figcaption {
  margin-top: 12px; font-size: .82rem; line-height: 1.5;
  color: var(--muted); max-width: 60ch;
}
@media (max-width: 760px) {
  .article-fig { max-width: none; }
}

/* ============================================================
   Статья в одну колонку: srok-ili-platezh.html
   Всё внутри .article-page живёт в одной мере 720px:
   заголовки, текст, таблицы, картинки и карточки.
   Остальные страницы эти правила не задевают.
   ============================================================ */

.article-page {
  --measure: 940px;
  --rule: #edf1e6;
}

.article-page .wrap {
  max-width: calc(var(--measure) + 40px);
  padding-left: 20px;
  padding-right: 20px;
}

.article-page .prose {
  max-width: calc(var(--measure) + 40px);
}

.article-page .section-lead,
.article-page .note {
  max-width: none;
}

/* Заголовки: без искусственного ограничения по ширине */
.article-page h1 {
  font-size: clamp(2rem, 1.2rem + 2.6vw, 2.75rem);
  line-height: 1.08;
  letter-spacing: -.035em;
  max-width: 30ch;
}

.article-page h2 {
  font-size: 1.75rem;
  line-height: 1.2;
  letter-spacing: -.025em;
  max-width: none;
  margin: 0 0 16px;
}

.article-page h3 {
  font-size: 1.14rem;
  line-height: 1.32;
  letter-spacing: -.01em;
}

/* Текст: колонка шире, поэтому кегль и интерлиньяж выше,
   иначе строка выходит длиннее 100 знаков */
.article-page p {
  font-size: 1.2rem;
  line-height: 1.7;
}

.article-page p + p {
  margin-top: 14px;
}

.article-page .page-head p {
  font-size: 1.25rem;
  line-height: 1.6;
  max-width: none;
}

.article-page .article-meta {
  font-size: .8rem;
  margin-top: 10px;
}

/* Вертикальный ритм */
.article-page .page-head {
  padding-bottom: 4px;
}

.article-page .section {
  padding: 52px 0;
}

.article-page .section-lead {
  margin-bottom: 20px;
}

/* Картинки: по центру, в половину колонки, подпись по ширине картинки */
.article-page .article-fig {
  max-width: 600px;
  margin: 30px auto 12px;
}

.article-page .article-fig img {
  display: block;
  width: 100%;
  height: auto;
  background: #fff;
  border-radius: 16px;
}

.article-page .article-fig figcaption {
  margin-top: 12px;
  font-size: .9rem;
  line-height: 1.5;
  max-width: none;
}

/* Картинки: ширина по брейкпоинтам, высота всегда по пропорции */
@media (max-width: 1024px) {
  .article-page .article-fig {
    max-width: 520px;
  }
}
.article-page .features {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 40px;
  margin-top: 18px;
  border-top: 1px solid var(--line);
}

.article-page .feature {
  padding: 22px 0 0;
  border-top: none;
}

.article-page .feature h3 {
  margin-bottom: 8px;
}

.article-page .feature p {
  max-width: none;
  font-size: 1.02rem;
  line-height: 1.62;
}

/* Пятая карточка в сетке из двух колонок занимает всю ширину,
   иначе в правом столбце остаётся дыра */
.article-page .features > .feature:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

/* Частые вопросы: спойлеры, открываются по клику */
.article-page .faq-list {
  margin-top: 22px;
  border-top: 1px solid var(--line);
}

.article-page .faq-item {
  border-bottom: 1px solid var(--line);
  padding: 18px 0;
}

.article-page .faq-item summary {
  cursor: pointer;
  list-style: none;
  position: relative;
  padding-right: 48px;
  font-family: var(--display);
  font-size: 1.08rem;
  font-weight: 500;
  line-height: 1.35;
  color: var(--forest);
}

.article-page .faq-item summary::-webkit-details-marker {
  display: none;
}

.article-page .faq-item summary::after {
  content: '+';
  position: absolute;
  right: 6px;
  top: -4px;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--accent);
}

.article-page .faq-item[open] summary::after {
  content: '−';
}

.article-page .faq-item p {
  margin-top: 10px;
  font-size: 1.05rem;
  line-height: 1.6;
  color: #26332d;
}

@media (max-width: 680px) {
  .article-page .features {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .article-page .feature {
    padding-top: 0;
    border-top: none;
  }

  .article-page .feature + .feature {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
  }

  .article-page .section {
    padding: 40px 0;
  }

  .article-page .article-fig {
    max-width: 100%;
    margin: 26px 0 10px;
  }
}

/* Подзаголовок ошибки внутри статьи */
.prose .sub-title {
  font-family: var(--display);
  font-size: 1.06rem;
  font-weight: 600;
  letter-spacing: -.02em;
  color: var(--forest);
  margin: 32px 0 10px;
}
.prose .sub-title:first-of-type { margin-top: 8px; }

/* Нумерованный список шагов внутри статьи */
.prose .steps { counter-reset: step; list-style: none; margin: 6px 0 20px; padding: 0; }
.prose .steps li { position: relative; padding-left: 44px; margin-bottom: 13px; color: #26332d; }
.prose .steps li:last-child { margin-bottom: 0; }
.prose .steps li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: 1px; width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: var(--sage); color: var(--forest);
  font-family: var(--display); font-size: .82rem; font-weight: 500;
}
@media (max-width: 560px) {
  .prose .steps li { padding-left: 38px; }
  .prose .steps li::before { width: 26px; height: 26px; font-size: .76rem; }
}

.note {
  margin-top: 26px; padding: 18px 20px; background: var(--sage);
  border-left: 4px solid var(--forest); border-radius: 0 14px 14px 0;
  font-size: .89rem; color: #46564c; max-width: 68ch;
}

/* ---------- Blog cards ---------- */

.posts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
.section h2 + .posts { margin-top: 26px; }
.post {
  display: flex; flex-direction: column; gap: 10px;
  border-top: 3px solid var(--forest); padding-top: 18px;
  transition: transform .15s ease, border-color .15s ease;
}
.post:hover { border-color: var(--lime); transform: translateY(-2px); }
.post-meta { font-size: .75rem; color: var(--muted); letter-spacing: .01em; }
.post h3 {
  font-family: var(--display); font-size: 1rem; font-weight: 500;
  line-height: 1.35; letter-spacing: -.02em;
}
.post p { font-size: .91rem; color: var(--muted); }

/* живая статья: остальные - заглушки "скоро" */
.post.is-live { border-top-color: var(--accent); }
.post.is-live .post-meta { color: var(--accent); }
.post.is-live .post-meta::after { content: " · можно читать"; }
.post:not(.is-live) { opacity: .68; }
.post:not(.is-live) .post-meta::after { content: " · скоро"; }

/* ---------- Calculator hub ---------- */

.hub-title {
  font-family: var(--display); font-size: 1.02rem; font-weight: 600;
  letter-spacing: -.02em; margin: 44px 0 16px;
}
.hub-title:first-child { margin-top: 0; }
.hub-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.hub-card {
  display: flex; flex-direction: column; gap: 8px;
  background: var(--card); border: 1px solid var(--card-line); border-radius: 18px;
  padding: 22px 22px 18px; min-height: 186px;
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
a.hub-card:hover {
  border-color: var(--forest); transform: translateY(-2px); color: var(--ink);
  box-shadow: 0 20px 34px -26px rgba(9, 42, 35, .55);
}
.hub-card h3 {
  font-family: var(--display); font-size: .93rem; font-weight: 600;
  letter-spacing: -.02em; line-height: 1.3;
}
.hub-card p { font-size: .87rem; color: var(--muted); }
.hub-meta { margin-top: auto; padding-top: 12px; font-size: .74rem; color: var(--muted); }
.badge {
  display: inline-block; padding: 3px 11px; border-radius: 999px;
  background: var(--lime-soft); color: #41531f; font-size: .72rem; font-weight: 500;
}
.hub-card.is-soon { background: transparent; border-style: dashed; border-color: #cfd8c6; }
.hub-card.is-soon h3 { color: var(--muted); }

/* ---------- Cookie banner ---------- */

.cookie {
  position: fixed; left: 50%; bottom: 18px; z-index: 80;
  width: min(780px, calc(100% - 32px));
  transform: translate(-50%, calc(100% + 24px)); opacity: 0;
  transition: transform .35s cubic-bezier(.4, 0, .2, 1), opacity .3s ease;
  display: flex; align-items: center; gap: 20px;
  padding: 18px 20px; background: var(--card);
  border: 1px solid var(--input-line); border-radius: 18px;
  box-shadow: 0 28px 60px -32px rgba(9, 42, 35, .6);
}
.cookie.is-visible { transform: translate(-50%, 0); opacity: 1; }

body.has-cookie { padding-bottom: 108px; }
body.has-cookie .site-footer { padding-bottom: 84px; }
.cookie p { font-size: .85rem; color: var(--muted); line-height: 1.45; }
.cookie a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.cookie-actions { display: flex; gap: 8px; flex: none; margin-left: auto; }
.cookie button {
  border: 0; border-radius: 999px; padding: 9px 16px;
  font: inherit; font-size: .82rem; cursor: pointer; transition: background .15s, color .15s, border-color .15s;
}
.cookie-accept { background: var(--forest); color: #fff; }
.cookie-accept:hover { background: #0a2f27; }
.cookie-decline { background: transparent; border: 1px solid var(--input-line); color: var(--muted); }
.cookie-decline:hover { border-color: var(--forest); color: var(--forest); }

@media (max-width: 700px) {
  .cookie { flex-direction: column; align-items: flex-start; gap: 12px; }
  .cookie-actions { margin-left: 0; width: 100%; }
  .cookie-actions button { flex: 1; }
  body.has-cookie { padding-bottom: 168px; }
  body.has-cookie .site-footer { padding-bottom: 140px; }
}

@media (prefers-reduced-motion: reduce) {
  .cookie { transition: none; }
}

/* ---------- Footer ---------- */

.site-footer { background: var(--forest-deep); color: #a9bcb1; }
.footer-inner {
  max-width: var(--max); margin: 0 auto; padding: 56px 24px 30px;
  display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px;
}
.footer-brand .logo svg { color: var(--lime); }
.footer-brand .logo-name { color: #f4f7ee; }
.footer-brand p { font-size: .89rem; max-width: 30ch; margin-top: 16px; color: #93a89c; }
.site-footer h4 { font-size: .8rem; font-weight: 500; color: #8fa79a; margin-bottom: 15px; }
.site-footer ul { list-style: none; display: grid; gap: 9px; font-size: .91rem; }
.site-footer a { color: #c6d6cc; }
.site-footer a:hover { color: var(--lime); }
.footer-bottom {
  max-width: var(--max); margin: 0 auto; padding: 18px 24px 38px;
  border-top: 1px solid #1d3a31; font-size: .78rem; color: #93a89c;
  display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap;
}

/* ---------- Inner pages ---------- */

.page-head {
  padding: 58px 0 48px; color: #eef4ea;
  background-color: var(--forest);
  background-image:
    radial-gradient(800px 360px at 90% -20%, rgba(200, 232, 107, .14), transparent 65%),
    linear-gradient(rgba(243, 246, 236, .04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(243, 246, 236, .04) 1px, transparent 1px);
  background-size: auto, 44px 44px, 44px 44px;
}

/* 404: крупная цифра в page-head */
.error-code {
  display: block;
  font-family: var(--display); font-weight: 600;
  font-size: clamp(3.2rem, 10vw, 5.6rem); line-height: .92;
  letter-spacing: -.05em; color: var(--lime); margin: 0 0 6px;
}
.page-head h1 { font-size: clamp(1.6rem, 2.9vw, 2.3rem); max-width: 20ch; color: #f6f8f0; }
.page-head p { color: #b9cbc0; max-width: 56ch; margin-top: 16px; }
.page-head .article-meta { font-size: .8rem; margin-top: 6px; opacity: .7; max-width: none; }

/* Подсказка с пошаговой инструкцией */
.res-note {
  background: var(--sage);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 20px;
}
.res-note :is(h3, h4) {
  font-size: 1rem;
  font-weight: 600;
  color: var(--forest);
  margin: 0 0 10px;
}
.res-note ol {
  margin: 0;
  padding-left: 20px;
  font-size: 0.95rem;
}
.res-note li {
  margin-bottom: 6px;
}
.res-note li:last-child {
  margin-bottom: 0;
}
.res-note a {
  color: var(--accent);
}

.page-grid { display: grid; grid-template-columns: 1.12fr .88fr; gap: 56px; align-items: start; }
.page-grid h2 { font-family: var(--display); font-size: 1.35rem; font-weight: 600; letter-spacing: -.03em; }

/* ---------- Responsive ---------- */

/* большие экраны: простор Hero, крупнее типографика */
@media (min-width: 1440px) {
  .hero { padding: 76px 0 52px; }
  h1 { font-size: 3rem; max-width: 18ch; }
  .hero-lead { font-size: 1.12rem; }
  .hero-orbits { width: 1180px; height: 1180px; top: -300px; right: -260px; }
  .hero-bars { width: 86%; height: 36%; }
  .hero-curve { width: 96%; height: 64%; }
}

/* планшеты в альбомной ориентации: колонка калькулятора шире текста */
@media (max-width: 1024px) {
  .hero-grid, .page-grid { gap: 40px; }
  .page-grid { grid-template-columns: 1.05fr .95fr; }
  .section { padding: 60px 0; }
  .hub-grid { gap: 16px; }
}

@media (max-width: 900px) {
  .header-inner { flex-wrap: wrap; height: auto; padding-top: 10px; padding-bottom: 8px; row-gap: 4px; }
  /* Меню одной строкой: четыре пункта помещаются, переносить нечего. */
  .main-nav { width: 100%; flex-wrap: nowrap; gap: 18px; font-size: .82rem; }
  .main-nav a { padding: 4px 0; white-space: nowrap; }
  .main-nav a.is-active::after { bottom: 0; height: 2px; }
  .hero { padding: 44px 0 32px; }
  .hero-orbits { display: none; }
  .hero-grid, .page-grid { grid-template-columns: 1fr; gap: 36px; }
  /* на мобильном графика живёт под карточкой, а не под текстом */
  .hero-grid { padding-bottom: 150px; }
  .hero-bars { width: 92%; height: 120px; }
  .hero-curve { width: 100%; height: 130px; }
  .section { padding: 52px 0; }
  .features { grid-template-columns: 1fr; gap: 0; }
  .hub-grid { grid-template-columns: 1fr 1fr; }
  .posts { grid-template-columns: 1fr 1fr; gap: 24px; }
  .footer-inner { grid-template-columns: 1fr 1fr; gap: 32px; }
  .footer-brand { grid-column: 1 / -1; }
  .page-head { padding: 40px 0 32px; }
}

/* планшеты в портрете: карточки в одну колонку, поля формы - в две */
@media (max-width: 700px) {
  .hub-grid { grid-template-columns: 1fr; }
  .hub-card { min-height: 0; }
  .posts { grid-template-columns: 1fr; gap: 26px; }
  .hero-grid { padding-bottom: 130px; }
  .features { gap: 0; }
}

/* телефон: полные подписи меню не влезают в одну строку, включаются короткие */
@media (max-width: 760px) {
  .main-nav .nav-long { display: none; }
  .main-nav .nav-short { display: inline; }
  .main-nav { gap: 16px; }
}

@media (max-width: 560px) {
  body { font-size: 16px; }
  .wrap, .header-inner { padding-left: 16px; padding-right: 16px; }
  .header-inner { height: auto; gap: 14px; padding-top: 8px; padding-bottom: 6px; }
  .main-nav { gap: 16px; font-size: .85rem; }
  .logo-sub { display: none; }
  .calc { padding: 18px; border-radius: 18px; }
  .two-col { grid-template-columns: 1fr; gap: 0; }
  .two-col > .field { margin-bottom: 18px; }
  .two-col > .field:last-child { margin-bottom: 0; }
  .extra-row { grid-template-columns: 64px 1fr 26px; padding: 10px 9px 11px 12px; }
  .cmp-row { grid-template-columns: 82px 1fr auto; font-size: .74rem; }
  .segmented button { font-size: .78rem; padding: 9px 4px; }
  .res-v { font-size: 1.5rem; }
  h1 { font-size: 1.62rem; }
  .page-head h1 { font-size: 1.5rem; }
  .section h2 { font-size: 1.3rem; }
  /* в две колонки «Калькулятор кредита» переносится посреди слова - одна */
  .footer-inner { grid-template-columns: 1fr; gap: 26px; }
  .footer-brand { grid-column: auto; }
}

/* Горизонтальная ориентация телефона: экран шириной 667px и высотой 375px,
   прилипший Header съедает четверть высоты. Отвязываем его: меню остаётся
   в начале страницы, а таблицу в горизонтали видно целиком. */
@media (orientation: landscape) and (max-height: 620px) {
  .site-header { position: static; }
  .header-inner { padding-top: 8px; padding-bottom: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
  .hero-curve .curve-line { animation: none; stroke-dashoffset: 0; }
  .hero-curve .curve-dot { animation: none; opacity: 1; }
}

/* узкие телефоны: шрифт меню мельче, строка остаётся одна */
@media (max-width: 480px) {
  .header-inner { flex-wrap: wrap; height: auto; padding-top: 12px; padding-bottom: 10px; row-gap: 6px; }
  .main-nav { gap: 14px; font-size: .8rem; }
}
