/* GetExact v2 — монохром с голубым акцентом (ссылки, кнопка, фокус, результат, выбранный вариант),
   светлая и темная тема по prefers-color-scheme или кнопке в шапке, системные шрифты. Mobile-first. Структура:
   1 токены · 2 база · 3 каркас (шапка, футер, колонки) · 4 типографика текста · 5 калькулятор
   6 результат · 7 блоки страницы · 8 хабы и карточки · 9 реклама · 10 cookie-плашка */

/* ---------------------------------------------------------------- 1. токены */
:root {
  color-scheme: light;
  --bg: #ffffff;
  --fg: #111111;
  --fg-2: #333333;
  --muted: #6b6b6b;
  --line: #e4e4e4;
  --line-2: #cdcdcd;
  --surface: #f7f7f7;
  --field: #ffffff;
  --field-line: #c9c9c9;
  --inv-bg: #111111;
  --inv-fg: #ffffff;
  --banner-bg: #1a1a1a;
  --banner-fg: #e6e6e6;
  --banner-btn-bg: #f2f2f2;
  --banner-btn-fg: #111111;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --radius: 12px;
  --radius-s: 8px;
  --h-control: 44px;
  --gutter: 16px;
  --content: 820px;
  --wide: 1120px;
  --floor-h: 0px;
  --cookie-h: 0px;
  --shade: #00000026;
  --accent: #0a74bd;        /* кнопка, рамка фокуса; белый текст на нем — контраст 4,9:1 */
  --accent-fg: #ffffff;
  --accent-text: #0a6aad;   /* ссылки и акцентный текст на белом — 5,6:1 */
  --accent-soft: #e7f2fb;   /* выбранный вариант в списке */
  --btn-bg: #0a74bd;        /* основная кнопка: белый текст — 4,9:1 */
  --btn-bg-hover: #0b82d3;
  --btn-fg: #ffffff;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --show-sun: none;          /* кнопка темы: в светлой видна луна, в темной солнце */
  --show-moon: inline-block;
}
/* Темная тема: по системе, если пользователь не выбрал светлую, или по выбору (кнопка в шапке, data-theme на <html>). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0e0f11;
    --fg: #f1f1f1;
    --fg-2: #d2d2d2;
    --muted: #9c9c9c;
    --line: #26282c;
    --line-2: #3b3d42;
    --surface: #141518;
    --field: #111215;
    --field-line: #383a3f;
    --inv-bg: #f1f1f1;
    --inv-fg: #0e0f11;
    --banner-bg: #1c1d21;
    --banner-fg: #d9d9d9;
    --banner-btn-bg: #ececec;
    --banner-btn-fg: #111111;
    --shade: #00000099;
    --accent: #7cc4fa;
    --accent-fg: #07131f;
    --accent-text: #8ccdfb;
    --accent-soft: #14283b;
    --btn-bg: #1f7fc8;      /* белый текст — 4,5:1 */
    --btn-bg-hover: #2a8fdb;
    --btn-fg: #ffffff;
    --show-sun: inline-block;
    --show-moon: none;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e0f11;
  --fg: #f1f1f1;
  --fg-2: #d2d2d2;
  --muted: #9c9c9c;
  --line: #26282c;
  --line-2: #3b3d42;
  --surface: #141518;
  --field: #111215;
  --field-line: #383a3f;
  --inv-bg: #f1f1f1;
  --inv-fg: #0e0f11;
  --banner-bg: #1c1d21;
  --banner-fg: #d9d9d9;
  --banner-btn-bg: #ececec;
  --banner-btn-fg: #111111;
  --shade: #00000099;
  --accent: #7cc4fa;
  --accent-fg: #07131f;
  --accent-text: #8ccdfb;
  --accent-soft: #14283b;
  --btn-bg: #1f7fc8;      /* белый текст — 4,5:1 */
  --btn-bg-hover: #2a8fdb;
  --btn-fg: #ffffff;
  --show-sun: inline-block;
  --show-moon: none;
}

/* ---------------------------------------------------------------- 2. база */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; scroll-padding-bottom: calc(var(--floor-h) + var(--cookie-h) + 16px); }
body {
  font-variant-numeric: lining-nums;
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.6 var(--font);
  overflow-wrap: break-word;
  padding-bottom: calc(var(--floor-h) + var(--cookie-h));
}
img, svg { max-width: 100%; height: auto; }
a { color: var(--accent-text); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent-text) 35%, transparent); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a { transition: color .15s, text-decoration-color .15s; }
a:hover { text-decoration-color: var(--accent-text); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2, h3 { line-height: 1.2; margin: 0; font-weight: 700; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
ul, ol { margin: 0 0 1em; padding-left: 1.3em; }
li + li { margin-top: 0.3em; }
code { font-family: var(--mono); font-size: 0.92em; }
/* Формула в тексте не рвется посередине: переносится целиком, а если шире колонки — прокручивается внутри себя. */
.prose code, .lead code, .faq-item__a code, .result-more__body code {
  display: inline-block; max-width: 100%; overflow-x: auto; white-space: nowrap; vertical-align: bottom;
  -webkit-overflow-scrolling: touch; scrollbar-width: thin;
}
small { font-size: 0.85em; }
[hidden] { display: none !important; }
.skip-link { position: absolute; left: -9999px; top: 0; }
.skip-link:focus { left: 16px; top: 8px; z-index: 100; background: var(--bg); padding: 6px 10px; }
.muted { color: var(--muted); }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------------------------------------------------------------- 3. каркас */
.wrap { width: 100%; max-width: var(--wide); margin: 0 auto; padding: 0 var(--gutter); }
.site-header { border-bottom: 1px solid var(--line); }
.site-header__inner { display: flex; align-items: stretch; justify-content: space-between; gap: 16px; min-height: 56px; }
.logo { align-self: center; }
.logo { font-weight: 700; font-size: 18px; letter-spacing: -0.02em; text-decoration: none; color: var(--fg); }
.logo b { font-weight: 800; color: var(--accent-text); transition: color .2s; }
.logo:hover b { color: var(--accent); }
.site-nav { display: flex; gap: 24px; font-size: 15px; }
.site-nav a { position: relative; display: flex; align-items: center; text-decoration: none; color: var(--fg-2); font-weight: 500; transition: color .2s; }
.site-nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; border-radius: 2px 2px 0 0;
  background: var(--accent); transform: scaleX(0); transition: transform .25s var(--ease);
}
.site-nav a:hover { color: var(--fg); }
.site-nav a:hover::after { transform: scaleX(.6); }
.site-nav a[aria-current] { color: var(--fg); }
.site-nav a[aria-current]::after { transform: scaleX(1); }
.site-nav { margin-left: auto; }
.theme-toggle {
  align-self: center; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; padding: 0; border: 1px solid var(--line); border-radius: 50%;
  background: transparent; color: var(--fg-2); cursor: pointer; transition: color .2s, border-color .2s, background-color .2s;
}
.theme-toggle:hover { color: var(--accent-text); border-color: var(--accent); }
.theme-toggle svg { width: 18px; height: 18px; transition: transform .35s var(--ease); }
.theme-toggle:active svg { transform: rotate(-30deg) scale(.9); }
.theme-toggle .i-sun { display: var(--show-sun); }
.theme-toggle .i-moon { display: var(--show-moon); }

.site-main { flex: 1 0 auto; padding: 16px 0 56px; }
.content { max-width: var(--content); margin: 0 auto; min-width: 0; }
.layout--sidebar .sidebar { display: none; }
@media (min-width: 1024px) {
  .layout--sidebar { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 40px; align-items: start; }
  .layout--sidebar .content { margin: 0; }
  .layout--sidebar .sidebar { display: block; position: sticky; top: 24px; }
}

.site-footer { flex-shrink: 0; border-top: 1px solid var(--line); padding: 24px 0 28px; font-size: 14px; color: var(--muted); }
.site-footer p { margin: 0 0 10px; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.footer-nav a { color: var(--muted); }
.footer-nav a:hover { color: var(--accent-text); }

.breadcrumbs ol { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-wrap: wrap; gap: 2px 0; font-size: 14px; color: var(--muted); }
.breadcrumbs li { margin: 0; }
.breadcrumbs li + li::before { content: "›"; margin: 0 8px; color: var(--line-2); }
.breadcrumbs a { color: var(--muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--accent-text); text-decoration: underline; }

/* ---------------------------------------------------------------- 4. текст */
h1 { font-size: 28px; }
.lead { font-size: 18px; line-height: 1.5; color: var(--fg-2); margin: 12px 0 24px; max-width: var(--content); }
.lead p { margin: 0 0 0.5em; }
@media (min-width: 720px) {
  h1 { font-size: 34px; }
  .lead { font-size: 19px; margin: 12px 0 22px; }
}
.block { margin-top: 48px; }
.block > h2 { font-size: 22px; margin-bottom: 16px; }
.block h3 { font-size: 17px; margin: 1.2em 0 0.5em; }
.prose > h1 { margin-bottom: 20px; }
.prose h2 { font-size: 22px; margin: 1.6em 0 0.6em; }
.prose h3 { font-size: 18px; margin: 1.4em 0 0.5em; }
.prose blockquote { margin: 1em 0; padding-left: 16px; border-left: 2px solid var(--line-2); color: var(--fg-2); }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }
.table-wrap {
  overflow-x: auto; margin: 0 0 1em; -webkit-overflow-scrolling: touch; max-width: 100%;
  /* Индикатор прокрутки: тень у края, за которым есть еще колонки (исчезает, когда край достигнут). */
  background:
    linear-gradient(to right, var(--bg) 30%, transparent) left / 32px 100% no-repeat local,
    linear-gradient(to left, var(--bg) 30%, transparent) right / 32px 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, var(--shade), transparent) left / 12px 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, var(--shade), transparent) right / 12px 100% no-repeat scroll;
}
/* Таблицы в текстах (политика, cookie) на телефоне не сжимаются до нечитаемого — прокручиваются с тенью у края. */
@media (max-width: 719px) { .prose .table-wrap table { min-width: 560px; } }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 600; color: var(--muted); }
caption { text-align: left; font-size: 14px; color: var(--muted); padding-bottom: 6px; }

/* ---------------------------------------------------------------- 5. калькулятор */
.calc { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 18px 16px; }
@media (min-width: 720px) { .calc { padding: 20px 24px; } }
.calc-form { margin: 0; display: flex; flex-wrap: wrap; align-items: flex-start; column-gap: 16px; }
.calc-form > .fields { flex: 1 1 100%; }
.fields { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px 20px; }
@media (min-width: 720px) {
  .fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fields--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  /* Одиночное поле в последнем ряду (нечетное число видимых полей; класс ставит calc-ui.js) — на всю ширину. */
  .fields:not(.fields--3) > .field--wide { grid-column: 1 / -1; }
}
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; margin: 0; }
.field > label, .field__label { font-size: 14px; color: var(--muted); line-height: 1.3; }
.control { position: relative; }
.control input, .control select {
  display: block; width: 100%; height: var(--h-control); margin: 0;
  padding: 0 12px; border: 1px solid var(--field-line); border-radius: var(--radius-s);
  background: var(--field); color: var(--fg); font: inherit; font-size: 16px; line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.control input, .dd__btn { transition: border-color .15s, box-shadow .15s; }
.control input:hover, .control select:hover { border-color: var(--muted); }
.control input::placeholder { color: var(--muted); opacity: 1; }
.control input.is-auto::placeholder { color: var(--fg); }
.control input:focus, .control select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.control .unit { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-size: 15px; color: var(--muted); pointer-events: none; white-space: nowrap; }
.control--unit input { padding-right: 3.4em; }
.control--unit-l input { padding-right: 6.6em; }
.control--select select { appearance: none; -webkit-appearance: none; padding-right: 36px; cursor: pointer; text-overflow: ellipsis; }
.control--select::after {
  content: ""; position: absolute; right: 15px; top: 50%; width: 7px; height: 7px; margin-top: -6px;
  border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: rotate(45deg); pointer-events: none;
}
.control [aria-invalid="true"], .control [aria-invalid="true"] ~ .dd__btn { border-color: var(--fg); box-shadow: 0 0 0 1px var(--fg); }
select option, select optgroup { background: var(--field); color: var(--fg); }

/* Свой выпадающий список (calc-ui.js → enhanceSelects): кнопка вместо select, список вариантов под ней. */
.dd__native { position: absolute; inset: 0; opacity: 0; pointer-events: none; }
.dd__btn {
  display: block; width: 100%; height: var(--h-control); margin: 0; padding: 0 36px 0 12px;
  border: 1px solid var(--field-line); border-radius: var(--radius-s); background: var(--field); color: var(--fg);
  font: inherit; font-size: 16px; line-height: calc(var(--h-control) - 2px); text-align: left; cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dd__btn:hover { border-color: var(--muted); }
.dd__btn:focus { outline: none; }
.dd__btn:focus-visible, .dd.is-open .dd__btn { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.dd.is-open::after { transform: rotate(-135deg); margin-top: -2px; }
.dd__list {
  position: absolute; z-index: 30; left: 0; top: calc(100% + 6px); min-width: 100%; max-width: calc(100vw - 2 * var(--gutter));
  max-height: min(340px, 55vh); overflow-y: auto; overscroll-behavior: contain; padding: 6px;
  background: var(--field); border: 1px solid var(--line-2); border-radius: var(--radius-s);
  box-shadow: 0 12px 32px var(--shade); scrollbar-width: thin;
}
.dd__list--up { top: auto; bottom: calc(100% + 6px); transform-origin: bottom; }
.dd__list { transform-origin: top; animation: dd-in .16s var(--ease); }
@keyframes dd-in { from { opacity: 0; transform: translateY(-4px) scale(.98); } }
.dd__list--up { animation-name: dd-in-up; }
@keyframes dd-in-up { from { opacity: 0; transform: translateY(4px) scale(.98); } }
.control--select::after { transition: transform .2s var(--ease), margin-top .2s var(--ease); }
.dd__opt { transition: background-color .12s; }
.dd__group + .dd__group, .dd__opt + .dd__group, .dd__group + .dd__opt { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--line); }
.dd__group-title { padding: 6px 10px 4px; font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.dd__opt { padding: 9px 10px; border-radius: 6px; font-size: 15px; line-height: 1.3; cursor: pointer; }
.dd__opt.is-active { background: var(--surface); }
.dd__opt.is-selected { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }

.result-more > summary, .sources > summary {
  cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 8px;
  font-size: 15px; color: var(--fg); user-select: none;
}
.result-more > summary::-webkit-details-marker,
.sources > summary::-webkit-details-marker, .faq-item > summary::-webkit-details-marker { display: none; }
.result-more > summary::after, .sources > summary::after {
  content: ""; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg); transition: transform .15s;
}
.result-more[open] > summary::after, .sources[open] > summary::after { transform: translateY(1px) rotate(-135deg); }
.calc-actions { margin-top: 18px; flex: 1 1 100%; }
.calc-actions .btn { min-width: 200px; }
.calc-notice, .calc-noscript { flex: 1 1 100%; margin: 12px 0 0; font-size: 13px; line-height: 1.45; color: var(--muted); }
.calc-noscript { color: var(--fg); font-weight: 600; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: var(--h-control); padding: 0 24px; border: 1px solid var(--btn-bg); border-radius: var(--radius-s);
  background: var(--btn-bg); color: var(--btn-fg); font: inherit; font-size: 16px; font-weight: 600;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background-color .18s, border-color .18s, color .18s, box-shadow .18s, transform .12s;
}
.btn:hover { background: var(--btn-bg-hover); border-color: var(--btn-bg-hover); box-shadow: 0 6px 18px color-mix(in srgb, var(--btn-bg) 30%, transparent); }
.btn:active { transform: scale(.98); box-shadow: none; }
.btn--ghost { background: transparent; color: var(--fg); border-color: var(--line-2); font-weight: 500; }
.btn--ghost:hover { background: transparent; border-color: var(--accent); color: var(--accent-text); box-shadow: none; }
.btn--s { height: 38px; padding: 0 16px; font-size: 14px; }

/* ---------------------------------------------------------------- 6. результат */
.result { margin-top: 14px; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 16px; animation: rise .35s var(--ease); }
/* Поля изменены, а «Рассчитать» еще не нажата — прежний результат приглушен. */
.result { transition: opacity .2s; }
.result--stale { opacity: .45; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.result__value.is-updated { animation: value-in .4s var(--ease); }
@keyframes value-in { from { opacity: .25; transform: translateY(4px); } }
.result__copy-status:not(:empty) { animation: fade-in .2s ease-out; }
@keyframes fade-in { from { opacity: 0; } }
@media (min-width: 720px) { .result { padding: 18px 24px; } }
.result__label { margin: 0; font-size: 14px; color: var(--muted); }
.result__value { margin: 0; font-size: 40px; line-height: 1.15; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; color: var(--accent-text); }
.result__value--text { font-size: 26px; line-height: 1.25; letter-spacing: -0.01em; }
.result__value .result__unit { font-size: 0.55em; font-weight: 600; letter-spacing: 0; margin-left: 4px; white-space: nowrap; }
.result__stats dd { white-space: nowrap; }
.result__stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px 20px; margin: 12px 0 0; }
.result__stats div { min-width: 0; }
.result__stats dt { font-size: 13px; color: var(--muted); }
.result__stats dd { margin: 0; font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
.result__note { margin: 12px 0 0; font-size: 13px; line-height: 1.45; color: var(--muted); }
.result__warn { margin: 8px 0 0; padding-left: 10px; border-left: 2px solid var(--fg); font-size: 13px; line-height: 1.45; color: var(--fg-2); }
.result__foot { margin-top: 12px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; }
.result-more { font-size: 14px; flex: 1 1 100%; order: 2; min-width: 0; max-width: 100%; }
.result-more > summary { font-size: 14px; }
.result-more[open] { padding-bottom: 4px; }
.result-more__body { margin-top: 10px; color: var(--fg-2); min-width: 0; }
.result-more__body td { min-width: 4em; }
.result-more__body table { font-size: 13px; }
.result-more__body th, .result-more__body td { padding: 6px 8px; }
.result-more__body ul { padding-left: 1.1em; margin: 0 0 0.8em; }
.result__copy { order: 1; }
.result__copy .btn { gap: 0; }
.result__copy-status { font-size: 13px; color: var(--muted); }
@media (min-width: 720px) {
  .result-more { flex: 0 1 auto; order: 0; }
  .result-more[open] { flex-basis: 100%; }
}
.result--error .result__error { margin: 0; padding-left: 12px; border-left: 3px solid var(--fg); font-weight: 600; }

/* ---------------------------------------------------------------- 7. блоки страницы калькулятора */
/* «Готовые расчеты» — таблица: строка целиком кликабельна (ссылка растянута на строку), результат справа. */
.ready .table-wrap { border: 1px solid var(--line); border-radius: var(--radius); background: none; margin: 0; }
.ready-table { font-size: 15px; }
.ready-table th { padding: 10px 16px; background: var(--surface); font-size: 13px; font-weight: 600; }
.ready-table td { padding: 11px 16px; vertical-align: middle; }
.ready-table tbody tr { position: relative; }
.ready-table tbody tr:last-child td { border-bottom: 0; }
.ready-table tbody tr { transition: background-color .15s; }
.ready-table tbody tr:hover { background: var(--surface); }
.ready-link { color: var(--fg); text-decoration: none; }
.ready-table .ready-link::after { content: ""; position: absolute; inset: 0; }

/* Готовые расчеты без результата — плитки-ссылки на подложке (у каждой своя рамка, чтобы колонки не сливались),
   две колонки на десктопе. */
.ready-list {
  list-style: none; margin: 0; padding: 8px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
@media (min-width: 720px) { .ready-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ready-list li { margin: 0; }
.ready-list .ready-link {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 100%;
  padding: 10px 12px; border-radius: var(--radius-s); font-size: 15px; line-height: 1.35;
  background: var(--bg); border: 1px solid var(--line);
  transition: background-color .15s, color .15s, border-color .15s;
}
.ready-list .ready-link::after { content: "→"; flex-shrink: 0; color: var(--muted); transition: transform .2s var(--ease), color .15s; }
.ready-list .ready-link:hover { border-color: var(--accent); color: var(--accent-text); }
.ready-list .ready-link:hover::after { color: var(--accent-text); transform: translateX(3px); }

/* Калькулятор после клика по готовому расчету — короткая подсветка, чтобы было видно, что поля заполнились. */
.calc--flash { animation: calc-flash 1.2s var(--ease); }
@keyframes calc-flash {
  0%, 25% { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
}
.ready-table tbody tr:hover .ready-link { color: var(--accent-text); }
.ready-table td.num { font-weight: 650; color: var(--accent-text); }
.ready-unit { font-weight: 500; color: var(--muted); }
.about { max-width: 720px; }
.faq-item { border-top: 1px solid var(--line); }
.faq-item:last-child { border-bottom: 1px solid var(--line); }
.faq-item > summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 16px; padding: 14px 0; font-weight: 600; }
.faq-item > summary { transition: color .15s; }
.faq-item > summary:hover { color: var(--accent-text); }
.faq-item > summary::after { content: "+"; font-weight: 400; font-size: 22px; line-height: 1; color: var(--muted); flex-shrink: 0; transition: transform .25s var(--ease), color .2s; }
.faq-item[open] > summary::after { transform: rotate(45deg); color: var(--accent-text); }
@supports selector(::details-content) {
  .faq-item, .sources, .result-more { interpolate-size: allow-keywords; }
  .faq-item::details-content, .sources::details-content, .result-more::details-content {
    block-size: 0; overflow: clip; opacity: 0;
    transition: block-size .3s var(--ease), opacity .25s, content-visibility .3s allow-discrete;
  }
  .faq-item[open]::details-content, .sources[open]::details-content, .result-more[open]::details-content { block-size: auto; opacity: 1; }
}
.faq-item__a { padding: 0 0 16px; color: var(--fg-2); max-width: 720px; }
.sources { margin-top: 40px; border-top: 1px solid var(--line); padding-top: 14px; font-size: 13px; line-height: 1.5; color: var(--muted); }
.sources > summary { font-size: 15px; color: var(--fg); }
.sources__body { margin-top: 12px; }
.sources__body h3 { font-size: 14px; color: var(--fg); margin: 1.2em 0 0.4em; }
.method-sources { list-style: none; padding: 0; margin: 0 0 12px; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 14px; }
.method-sources li { margin: 0; }
.sources__body .disclaimer { color: var(--fg-2); }
.others-list { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px 24px; }
.others-list li { margin: 0; }

/* ---------------------------------------------------------------- 8. хабы и карточки */
.hub-section { margin-top: 44px; }
.hub-section:first-of-type { margin-top: 36px; }
.section-title { font-size: 22px; padding-bottom: 14px; border-bottom: 1px solid var(--line-2); margin-bottom: 22px; }
.section-title a { text-decoration: none; }
.section-title a:hover { text-decoration: underline; }
.cards { list-style: none; margin: 0; padding: 0 1px 1px 0; display: grid; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 720px) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* Общие границы: у каждой карточки своя рамка, соседние перекрываются на 1px (пустая ячейка — без линий). */
.cards > li { margin: 0 -1px -1px 0; border: 1px solid var(--line); }
/* Нечетное число карточек: последняя — на всю ширину ряда, без пустой ячейки рядом. */
@media (min-width: 720px) { .cards > li:last-child:nth-child(odd) { grid-column: 1 / -1; } }
.card { display: block; height: 100%; padding: 20px 22px 22px; text-decoration: none; transition: background-color .2s; }
.card:hover { background: var(--surface); }
.card__title::after { content: " →"; display: inline-block; opacity: 0; transform: translateX(-6px); transition: opacity .2s, transform .25s var(--ease); }
.card:hover .card__title::after { opacity: 1; transform: none; }
.card__title { display: block; font-size: 17px; font-weight: 650; line-height: 1.3; margin-bottom: 6px; color: var(--accent-text); }
.card__desc { display: block; font-size: 15px; line-height: 1.5; color: var(--muted); }

/* ---------------------------------------------------------------- 9. реклама */
.ad-slot { margin: 24px 0 0; min-height: 0; }
.ad-preview { display: flex; align-items: center; justify-content: center; min-height: 120px; border: 1px dashed var(--line-2); border-radius: var(--radius-s); color: var(--muted); font-size: 13px; text-align: center; padding: 12px; }
.ad-slot--sidebarDesktop.ad-preview { min-height: 600px; margin: 0; }
.floor-preview { display: none; }
html.has-floor-mobile { --floor-h: 25vmax; }
html.has-floor-desktop { --floor-h: 120px; }
html.has-floor-mobile .floor-preview, html.has-floor-desktop .floor-preview {
  display: flex; align-items: center; justify-content: center; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  height: var(--floor-h); background: repeating-linear-gradient(45deg, #8a8a8a33 0 10px, #8a8a8a22 10px 20px); background-color: var(--surface);
  border-top: 1px dashed var(--line-2); color: var(--muted); font-size: 13px; padding: 12px; text-align: center;
}

/* ---------------------------------------------------------------- 9a. телефон: плотнее (цель — страница калькулятора ≤ 4 экранов 375×812) */
@media (max-width: 719px) {
  body { line-height: 1.5; }
  .about, .faq-item__a { font-size: 15px; line-height: 1.47; }
  .site-header__inner { min-height: 50px; gap: 8px; }
  /* Три раздела и кнопка темы в шапке: компактнее, а если не влезают (узкий экран) — меню прокручивается само, страница нет. */
  .site-nav { gap: 10px; font-size: 13px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
  .site-nav::-webkit-scrollbar { display: none; }
  .site-nav a { flex-shrink: 0; }
  .logo { font-size: 16px; flex-shrink: 0; }
  .theme-toggle { width: 28px; height: 28px; border: 0; margin-right: -4px; }
  .site-main { padding: 12px 0 36px; }
  .breadcrumbs ol { margin-bottom: 10px; font-size: 13px; }
  h1 { font-size: 25px; }
  .lead { font-size: 16px; line-height: 1.42; margin: 8px 0 14px; }
  .calc { padding: 14px 14px 16px; }
  .fields { gap: 10px; }
  .field { gap: 4px; }
  .field > label, .field__label { font-size: 13px; }
  .result { padding: 14px; margin-top: 10px; }
  .result__value { font-size: 36px; }
  .result__stats { gap: 8px 16px; margin-top: 10px; }
  .result__note { margin-top: 10px; }
  .block { margin-top: 28px; }
  .block > h2 { font-size: 20px; margin-bottom: 10px; }
  .prose p, .about p { margin-bottom: 0.7em; }
  .ready-table { font-size: 14px; }
  .ready-list .ready-link { padding: 9px 10px; font-size: 14.5px; }
  .ready-table th, .ready-table td { padding: 9px 12px; }
  .ready-table td { line-height: 1.35; }
  .faq-item > summary { padding: 9px 0; line-height: 1.35; }
  /* «Подробнее о расчете» и «Скопировать ссылку» — в один ряд. */
  .calc-actions { margin-top: 14px; }
  .calc-actions .btn { width: 100%; }
  .hide-m { display: none; }
  .result__foot { gap: 8px 12px; justify-content: flex-start; }
  .result-more { flex: 0 1 auto; order: 0; }
  .result-more[open] { flex-basis: 100%; order: 2; }
  .result__copy .btn--s { padding: 0 12px; font-size: 13.5px; height: 34px; }
  .result-more > summary { white-space: nowrap; font-size: 13.5px; }
  .sources { margin-top: 26px; padding-top: 10px; }
  .others-list { gap: 4px 18px; }
  .hub-section { margin-top: 30px; }
  .hub-section:first-of-type { margin-top: 22px; }
  .section-title { padding-bottom: 10px; margin-bottom: 14px; }
  .card { padding: 14px 16px 16px; }
  .site-footer { padding: 18px 0 20px; font-size: 13px; }
  .footer-nav { gap: 4px 16px; }
}

/* ---------------------------------------------------------------- 10. cookie-плашка */
.cookie {
  position: fixed; left: 6px; right: 6px; bottom: 6px; z-index: 60; max-width: 1100px; margin: 0 auto;
  display: flex; align-items: center; gap: 8px; padding: 7px 7px 7px 11px;
  background: var(--banner-bg); color: var(--banner-fg); border: 1px solid #ffffff14; border-radius: var(--radius);
  box-shadow: 0 6px 24px #0000002e; font-size: 12px; line-height: 1.38;
}
.cookie:not([hidden]) { animation: rise .4s var(--ease) .3s backwards; }
.cookie__text { margin: 0; flex: 1 1 auto; min-width: 0; text-wrap: pretty; }
.cookie__text p { margin: 0; }
.cookie a { color: inherit; text-decoration-color: currentColor; }
.cookie__btn { flex-shrink: 0; height: 34px; padding: 0 12px; font-size: 13.5px; background: var(--banner-btn-bg); color: var(--banner-btn-fg); border-color: var(--banner-btn-bg); }
.cookie__btn:hover { background: var(--banner-btn-bg); border-color: var(--banner-btn-bg); box-shadow: none; opacity: .88; }
@media (min-width: 720px) {
  /* Десктоп: одна строка — текст и кнопка в ряд. */
  .cookie { left: 24px; right: 24px; bottom: 16px; gap: 20px; padding: 10px 10px 10px 22px; font-size: 14px; line-height: 1.4; width: max-content; max-width: min(1100px, calc(100% - 48px)); }
  .cookie__btn { height: 38px; padding: 0 22px; font-size: 15px; }
}

/* ---------------------------------------------------------------- 11. справочники
   Таблица во всю ширину колонки без прокрутки: заголовок таблицы — как подзаголовок, строки подсвечиваются при наведении.
   На телефоне строка — карточка «подпись: значение» (подпись из data-label ячейки), горизонтальной прокрутки нет. */
.ref-tables .table-wrap { overflow: visible; background: none; margin: 0 0 36px; }
.ref-tables .table-wrap table, .prose .ref-tables .table-wrap table { min-width: 0; }
.ref-table { font-size: 15px; border-collapse: separate; border-spacing: 0; border: 1px solid var(--line); border-radius: var(--radius); }
.ref-table caption { caption-side: top; padding: 0 0 12px; font-size: 18px; font-weight: 650; line-height: 1.3; color: var(--fg); }
.ref-table th { padding: 11px 14px; background: var(--surface); font-size: 13px; font-weight: 600; line-height: 1.3; color: var(--muted); vertical-align: bottom; border-bottom: 1px solid var(--line); }
.ref-table thead th:first-child { border-top-left-radius: var(--radius); }
.ref-table thead th:last-child { border-top-right-radius: var(--radius); }
.ref-table td { padding: 10px 14px; vertical-align: top; border-bottom: 1px solid var(--line); transition: background-color .12s; }
.ref-table tbody tr:last-child td { border-bottom: 0; }
.ref-table tbody tr:hover td { background: var(--accent-soft); }
.ref-table td:first-child, .ref-table th:first-child { color: var(--fg); text-align: left; }
.ref-table th:first-child { color: var(--muted); }
.ref-table .num { font-variant-numeric: tabular-nums; }
.ref-tables .table-note { margin: 10px 2px 0; font-size: 14px; line-height: 1.5; color: var(--muted); }
@media (max-width: 719px) {
  .ref-table, .ref-table tbody, .ref-table tr, .ref-table td { display: block; width: 100%; }
  .ref-table { border: 0; font-size: 14.5px; }
  .ref-table caption { display: block; font-size: 17px; }
  /* Подписи колонок на телефоне — в каждой ячейке (data-label), шапка не нужна: display:none, иначе ее ячейки распирают страницу. */
  .ref-table thead { display: none; }
  .ref-table tbody tr { margin: 0 0 8px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius-s); }
  .ref-table td { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 3px 0; border: 0; text-align: right; }
  .ref-table td::before { content: attr(data-label); flex: 0 1 auto; min-width: 0; text-align: left; font-size: 13px; color: var(--muted); white-space: normal; }
  .ref-table td:first-child { display: block; padding: 2px 0 6px; text-align: left; font-weight: 650; }
  .ref-table td:first-child::before { content: none; }
  .ref-table tbody tr:hover td { background: none; }
  .ref-table tbody tr:hover { background: var(--accent-soft); }
}

@media (prefers-reduced-motion: reduce) { *, *::before, *::after, ::details-content { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }
@media print { .site-header, .site-footer, .cookie, .ad-slot, .sidebar, .floor-preview, .calc-actions, .result__copy { display: none !important; } }
