/* Zaezzd — компоненты дизайн-системы.
   Mobile-first: база 360, брейкпоинты 768 и 1200 (дизайн-система §04, §14 «Адаптив»). */

/* ─── Сброс и основа ─────────────────────────────────────────────── */
* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
}

@media (min-width: 768px) { body { padding-bottom: 0; } }

img, svg { max-width: 100%; }
svg { flex: 0 0 auto; }

/* [hidden] обязан выигрывать у компонентных display: иначе скрытые кнопки
   и блоки остаются видимыми (.btn — inline-flex, .ad — flex). */
[hidden] { display: none !important; }

a { color: var(--acc); text-decoration: none; }
a:hover { color: var(--acc-hover); text-decoration: underline; }

button {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

input, select, textarea { font-family: inherit; }

/* Фокус: обводка 2px acc с отступом 2px, никогда outline:none (§14 «Доступность») */
:focus-visible {
  outline: 2px solid var(--acc);
  outline-offset: 2px;
  border-radius: 4px;
}

h1, h2, h3, h4, p, figure, blockquote { margin: 0; }
ul, ol { margin: 0; padding-left: 1.2em; }

.tnum { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.vh {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* ─── Типографика (§03) ──────────────────────────────────────────── */
.t-display { font-size: 26px; font-weight: 700; line-height: 1.15; letter-spacing: -.02em; }
.t-h2 { font-size: 19px; font-weight: 700; line-height: 1.25; letter-spacing: -.015em; }
.t-h3 { font-size: 18px; font-weight: 700; line-height: 1.3; }
.t-num-xl { font-size: 40px; font-weight: 700; line-height: 1; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.t-num-l { font-size: 40px; font-weight: 700; line-height: 1; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.t-num-m { font-size: 22px; font-weight: 700; line-height: 1.2; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.t-lead { font-size: 15px; line-height: 1.5; color: var(--ink-2); }
.t-body-s { font-size: 13.5px; line-height: 1.45; color: var(--ink-3); }
.t-caption { font-size: 12px; line-height: 1.4; color: var(--ink-4); font-variant-numeric: tabular-nums; }
.t-label {
  font-size: 11px; font-weight: 700; line-height: 1.3; letter-spacing: .09em;
  text-transform: uppercase; color: var(--ink-4);
}
.t-label--acc { color: var(--acc); letter-spacing: .08em; font-size: 10.5px; }

@media (min-width: 768px) {
  .t-display { font-size: 40px; line-height: 1.1; letter-spacing: -.025em; }
  .t-h2 { font-size: 26px; line-height: 1.25; }
  .t-num-xl { font-size: 56px; letter-spacing: -.035em; }
  .t-lead { font-size: 17px; }
}

/* ─── Раскладка ──────────────────────────────────────────────────── */
.wrap {
  max-width: calc(var(--content) + var(--gutter) * 2);
  margin: 0 auto;
  padding: 0 var(--gutter-mob);
}
@media (min-width: 768px) { .wrap { padding: 0 var(--gutter); } }

.stack { display: flex; flex-direction: column; gap: 26px; }
.stack > * { min-width: 0; }
.section { display: flex; flex-direction: column; gap: 12px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.section-title { font-size: 19px; font-weight: 700; letter-spacing: -.01em; }
@media (min-width: 768px) {
  .stack { gap: 40px; }
  .section { gap: 18px; }
  .section-title { font-size: 22px; }
}
@media (min-width: 1200px) { .stack { gap: 44px; } }

main { padding: 18px 0 32px; }
@media (min-width: 768px) { main { padding: 26px 0 56px; } }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
@media (min-width: 768px) { .grid-2 { gap: 20px; } }

/* ─── Шапка ──────────────────────────────────────────────────────── */
.hdr {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 40;
}
.hdr__top {
  display: flex; align-items: center; gap: 10px;
  min-height: 56px; padding: 8px 0;
}
@media (min-width: 768px) { .hdr__top { min-height: var(--header-h); gap: 22px; padding: 0; } }

.logo { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; color: var(--ink); }
.logo:hover { text-decoration: none; color: var(--ink); }
.logo__word { font-size: 18px; font-weight: 800; letter-spacing: -.02em; }
.logo__word i { font-style: normal; color: var(--acc); }
@media (min-width: 768px) { .logo__word { font-size: 20px; } }

.hdr__spacer { flex: 1 1 auto; }

.hdr__nav { display: none; }
@media (min-width: 768px) {
  .hdr__nav {
    display: flex; align-items: center; gap: 24px;
    height: 46px; border-top: 1px solid var(--line-soft);
    overflow-x: auto; scrollbar-width: none;
  }
  .hdr__nav::-webkit-scrollbar { display: none; }
  .hdr__nav a { font-size: 14.5px; color: var(--ink-25); white-space: nowrap; }
  .hdr__nav a:hover { color: var(--acc); text-decoration: none; }
  .hdr__nav a[aria-current="true"] { font-weight: 600; color: var(--ink); }
}

/* Внутренняя мобильная шапка: назад + крошка + поиск */
.hdr__back {
  width: 44px; height: 44px; flex: 0 0 44px;
  display: flex; align-items: center; justify-content: center; border-radius: var(--r-ctl);
}
.hdr__back:hover { background: var(--bg); }
@media (min-width: 768px) { .hdr__back { display: none; } }

/* Внутренняя страница на телефоне: логотип уступает место крошке и названию.
   Стрелка «назад» и так ведёт на главную, а имени раздела в узкой строке
   места не остаётся. */
@media (max-width: 767px) {
  .hdr--inner .logo,
  .hdr--inner .hdr__spacer { display: none; }
}

.hdr__title { flex: 1 1 auto; min-width: 0; }
.hdr__crumb { font-size: 11px; color: var(--ink-3); line-height: 1.2; }
.hdr__name {
  font-size: 14.5px; font-weight: 600; line-height: 1.25;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
@media (min-width: 768px) { .hdr__title { display: none; } }

.hdr__search { display: none; }
@media (min-width: 768px) {
  .hdr__search {
    display: flex; align-items: center; gap: 10px; flex: 1 1 auto; max-width: 480px;
    height: 42px; padding: 0 14px; background: var(--bg);
    border: 1px solid var(--line); border-radius: var(--r-ctl);
  }
  .hdr__search input {
    flex: 1 1 auto; min-width: 0; border: 0; background: none;
    font-size: 15px; color: var(--ink); outline: none;
  }
  /* Фокус с клавиатуры обязан быть видимым (§14): outline снят с input,
     поэтому индикатор несёт контейнер — как у .search:focus-within */
  .hdr__search:focus-within { border-color: var(--acc); }
}
.hdr__icon {
  width: 44px; height: 44px; flex: 0 0 44px;
  display: flex; align-items: center; justify-content: center; border-radius: var(--r-ctl);
}
.hdr__icon:hover { background: var(--bg); }
.hdr__cta { display: none; }
@media (min-width: 768px) {
  .hdr__icon { display: none; }
  .hdr__cta {
    display: inline-flex; align-items: center; gap: 8px; flex: 0 0 auto;
    height: 42px; padding: 0 15px; border-radius: var(--r-ctl);
    font-size: 14px; font-weight: 600;
  }
  .hdr__cta--dark { background: var(--ink); color: var(--surface); }
  .hdr__cta--dark:hover { background: #000; color: var(--surface); text-decoration: none; }
  .hdr__cta--ghost { color: var(--ink); border: 1px solid var(--line); }
  .hdr__cta--ghost:hover { border-color: var(--ink); color: var(--ink); text-decoration: none; }
}

/* Крошки на десктопе */
.crumbs { display: none; }
@media (min-width: 768px) {
  .crumbs { display: block; padding: 14px 0 0; font-size: 12.5px; color: var(--ink-4); }
  .crumbs a { color: var(--ink-4); }
  .crumbs a:hover { color: var(--acc); }
}

/* ─── Таб-бар (до 768) ───────────────────────────────────────────── */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  display: flex; background: var(--surface); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.tabbar a {
  flex: 1 1 0; min-height: var(--tabbar-h);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-size: 10.5px; font-weight: 500; color: var(--ink-3); text-decoration: none;
}
.tabbar a:hover { text-decoration: none; }
.tabbar a[aria-current="page"] { color: var(--ink); font-weight: 600; }
.tabbar a[aria-current="page"] svg path { stroke: var(--acc); stroke-width: 2; }
@media (min-width: 768px) { .tabbar { display: none; } }
body.no-tabbar { padding-bottom: 0; }
body.no-tabbar .tabbar { display: none; }

/* ─── Кнопки — три уровня (§05) ──────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 18px; border-radius: var(--r-ctl);
  font-size: 15px; font-weight: 700; text-align: center; text-decoration: none;
  transition: background-color .12s ease, border-color .12s ease, color .12s ease;
}
.btn:hover { text-decoration: none; }
.btn--block { width: 100%; }
.btn--1 { background: var(--acc); color: #fff; }
.btn--1:hover { background: var(--acc-hover); color: #fff; }
.btn--2 { background: var(--surface); color: var(--ink); border: 1px solid var(--line); font-weight: 600; }
.btn--2:hover { border-color: var(--ink); color: var(--ink); }
.btn--3 { background: none; color: var(--acc); font-weight: 600; padding: 0 6px; }
.btn--3:hover { color: var(--acc-hover); }
.btn--dark { background: var(--ink); color: #fff; }
.btn--dark:hover { background: #000; color: #fff; }
.btn--yellow { background: var(--yellow); color: var(--ink); }
.btn--yellow:hover { background: var(--yellow-hover); color: var(--ink); }
.btn--danger { background: var(--err); color: #fff; }
.btn--danger:hover { background: #A11F17; color: #fff; }
.btn--lg { min-height: 56px; font-size: 17px; }
.btn--sm { min-height: 44px; font-size: 14px; padding: 0 14px; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; pointer-events: none; }
@media (min-width: 768px) { .btn { min-height: 48px; } }

/* ─── Поля и контролы (§06) ──────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 6px; }
.field__label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field__hint { font-size: 12px; color: var(--ink-3); line-height: 1.4; }
.field__err { font-size: 12.5px; color: var(--err); font-weight: 500; }

.input, .select, .textarea {
  width: 100%; min-height: 46px; padding: 11px 13px;
  background: var(--surface); color: var(--ink);
  border: 1.5px solid var(--line); border-radius: var(--r-ctl);
  font-size: 16px; /* меньше 16 нельзя: iOS зумит (§14) */
  line-height: 1.35; outline: none;
}
.textarea { min-height: 92px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--acc); }
.input::placeholder, .textarea::placeholder { color: var(--ink-3); }
.input[aria-invalid="true"] { border-color: var(--err); }
.field--marked .input, .field--marked .select { border-left: 3px solid var(--yellow); }

.search {
  display: flex; align-items: center; gap: 9px;
  min-height: 46px; padding: 0 13px;
  background: var(--surface); border: 1.5px solid var(--ink); border-radius: 11px;
}
.search input {
  flex: 1 1 auto; min-width: 0; height: 44px; border: 0; background: none;
  font-size: 16px; color: var(--ink); outline: none;
}
.search--soft { background: var(--bg); border-color: var(--line); }
.search:focus-within { border-color: var(--acc); }
@media (min-width: 768px) {
  .search { min-height: 56px; padding: 0 18px; border-radius: var(--r-card); }
  .search input { height: 54px; font-size: 17px; }
}

/* Степпер объёма/значения */
.stepper { display: flex; align-items: center; gap: 8px; }
.stepper button {
  width: 46px; height: 46px; flex: 0 0 46px; display: flex; align-items: center; justify-content: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-ctl);
  font-size: 20px; font-weight: 600; color: var(--ink);
}
.stepper button:hover { border-color: var(--ink); }
.stepper .input { text-align: center; font-variant-numeric: tabular-nums; font-weight: 600; }

input[type="range"] { width: 100%; accent-color: var(--acc); height: 44px; }

/* Сегменты и чипы */
.chips { display: flex; gap: 7px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 13px;
  background: var(--surface); color: var(--ink-25);
  border: 1px solid var(--line); border-radius: var(--r-pill);
  font-size: 13.5px; font-weight: 500; text-decoration: none;
}
.chip:hover { border-color: var(--ink); color: var(--ink-25); text-decoration: none; }
.chip[aria-pressed="true"], .chip--on {
  background: var(--ink); border-color: var(--ink); color: #fff; font-weight: 600;
}
.chip--sq { border-radius: var(--r-ctl); }
.chip--sm { min-height: 38px; font-size: 13px; padding: 0 11px; }

.seg { display: inline-flex; padding: 3px; background: var(--bg); border: 1px solid var(--line); border-radius: 11px; gap: 3px; }
.seg button {
  min-height: 38px; padding: 0 12px; border-radius: 8px;
  font-size: 13px; font-weight: 600; color: var(--ink-3);
}
.seg button[aria-pressed="true"] { background: var(--ink); color: #fff; }

.switch { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch__track {
  width: 44px; height: 26px; border-radius: 13px; background: var(--line);
  position: relative; transition: background-color .15s ease; flex: 0 0 auto;
}
.switch__track::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px;
  border-radius: 50%; background: #fff; box-shadow: var(--sh-sm); transition: transform .15s ease;
}
.switch input:checked + .switch__track { background: var(--acc); }
.switch input:checked + .switch__track::after { transform: translateX(18px); }
.switch input:focus-visible + .switch__track { outline: 2px solid var(--acc); outline-offset: 2px; }

/* ─── Бейджи и alert (§07) ───────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 7px; border-radius: var(--r-badge);
  font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
}
.badge--ok { background: var(--ok-soft); color: var(--ok); }
.badge--warn { background: var(--warn-soft); color: var(--warn-ink); }
.badge--err { background: var(--err-soft); color: var(--err); }
.badge--info { background: var(--info-soft); color: var(--info); }
.badge--neutral { background: var(--bg); color: var(--ink-3); }
.badge--lg { font-size: 12px; padding: 5px 9px; letter-spacing: .02em; text-transform: none; }

.alert {
  display: flex; gap: 11px; padding: 13px 14px;
  border-radius: var(--r-card); border: 1px solid transparent;
  font-size: 13.5px; line-height: 1.5;
}
.alert__body { min-width: 0; }
.alert__title { font-weight: 700; margin-bottom: 3px; }
.alert__src { display: block; margin-top: 6px; font-size: 12px; color: inherit; opacity: .8; }
.alert--law { background: var(--warn-soft); border-color: #F0C86A; color: #6B4700; }
.alert--info { background: var(--info-soft); border-color: #B9CDE6; color: #123F6D; }
.alert--ok { background: var(--ok-soft); border-color: #A9D9BF; color: #0C5B38; }
.alert--danger { background: var(--err-soft); border-color: #EFB4AE; color: #93201A; }
.alert a { color: inherit; text-decoration: underline; }

/* ─── Карточки (§08) ─────────────────────────────────────────────── */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-card); padding: 14px;
}
@media (min-width: 768px) { .card { padding: 20px; } }
.card--pad-sm { padding: 12px; }
.card--dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.card--dark .t-lead, .card--dark .t-body-s { color: #B8BCC4; }
.card--paper { background: var(--paper); border-color: #E8E0CE; }
.card--outline { border: 1.5px solid var(--ink); }
a.card, button.card { display: block; width: 100%; text-align: left; color: inherit; }
a.card, button.card, .tool {
  transition: border-color .12s ease, transform .12s ease, box-shadow .12s ease;
}
a.card:hover, button.card:hover { border-color: var(--ink); text-decoration: none; color: inherit; }
@media (prefers-reduced-motion: no-preference) {
  a.card:hover, button.card:hover, .tool:hover { transform: translateY(-2px); box-shadow: var(--sh-md); }
}
a.card--dark:hover, button.card--dark:hover { background: #000; border-color: #000; }

/* Карточка инструмента — единый компонент сетки */
.tool {
  display: flex; flex-direction: column; gap: 8px;
  min-height: 116px; padding: 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card);
  color: inherit; text-decoration: none;
}
.tool:hover { border-color: var(--ink); text-decoration: none; color: inherit; }
.tool__name { font-size: 14.5px; font-weight: 600; line-height: 1.25; }
.tool__note { font-size: 12px; color: var(--ink-3); line-height: 1.35; }
.tool--dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.tool--dark:hover { background: #000; border-color: #000; color: #fff; }
.tool--dark .tool__note { color: #A8ACB5; }
@media (min-width: 768px) {
  .tool { min-height: 168px; padding: 20px; gap: 11px; border-radius: 14px; }
  .tool__name { font-size: 17px; font-weight: 700; }
  .tool__note { font-size: 13.5px; line-height: 1.45; }
}

.tools-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
@media (min-width: 768px) { .tools-grid { grid-template-columns: repeat(3, 1fr); gap: 20px; } }
@media (min-width: 1200px) { .tools-grid { grid-template-columns: repeat(3, 1fr); gap: 24px; } }

/* Карточка статьи.
   Важно: селекторы a.post/button.post нужны, чтобы перебить a.card { display: block }
   (иначе заголовок и аннотация склеиваются в одну строку). */
.post, a.post, button.post { display: flex; flex-direction: column; gap: 6px; padding: 13px; }
.post__meta { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.post__title { font-size: 15px; font-weight: 600; line-height: 1.3; }
.post__note { font-size: 12.5px; color: var(--ink-3); line-height: 1.4; }
@media (min-width: 768px) {
  .post { gap: 9px; padding: 20px; }
  .post__title { font-size: 18px; font-weight: 700; }
  .post__note { font-size: 13.5px; line-height: 1.45; }
}

/* Строка-ссылка «вопрос → сумма» */
.row-link {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  min-height: 52px; padding: 12px 13px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  font-size: 14px; line-height: 1.35; color: inherit; text-decoration: none;
}
.row-link:hover { border-color: var(--ink); text-decoration: none; color: inherit; }
.row-link b { flex: 0 0 auto; font-weight: 700; font-variant-numeric: tabular-nums; }

/* Блок результата */
.result {
  background: var(--ink); color: #fff; border-radius: var(--r-res); padding: 18px;
}
.result__label { font-size: 11px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: #8A8F99; }
.result__sum { font-size: 40px; font-weight: 700; line-height: 1; letter-spacing: -.03em; font-variant-numeric: tabular-nums; margin: 8px 0 4px; }
.result__sub { font-size: 13.5px; color: #B8BCC4; line-height: 1.45; }
.result__rows { margin-top: 16px; display: flex; flex-direction: column; }
.result__row {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding: 10px 0; border-top: 1px solid #2C3039; font-size: 13.5px;
}
.result__row b { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.result__row span small { display: block; font-size: 12px; color: #8A8F99; margin-top: 2px; }
@media (min-width: 768px) {
  .result { padding: 24px; }
  .result__sum { font-size: 56px; letter-spacing: -.035em; }
}

/* Липкий итог на мобильном (§14 Sticky) */
.sticky-sum {
  position: sticky; bottom: 0; z-index: 30;
  background: var(--ink); color: #fff; border-radius: var(--r-card);
  padding: 12px 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  box-shadow: var(--sh-lg);
}
.sticky-sum b { font-size: 22px; font-weight: 700; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.sticky-sum small { display: block; font-size: 11.5px; color: #8A8F99; }
@media (min-width: 1200px) { .sticky-sum { display: none; } }

.sticky-side { position: sticky; top: 96px; }

/* ─── Таблица и мобильный режим (§09) ────────────────────────────── */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 12px 14px; text-align: left; vertical-align: top; }
.table thead th {
  font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--ink-3); background: var(--bg); border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table tbody tr { border-bottom: 1px solid var(--line-soft); }
.table tbody tr:nth-child(even) { background: #FBFAF8; }
.table td.num { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.table caption {
  caption-side: bottom; padding-top: 10px; text-align: left;
  font-size: 12px; color: var(--ink-4);
}

/* На 360 таблица разворачивается в карточки-строки */
.rows { display: flex; flex-direction: column; gap: 9px; }
.rowcard {
  display: block; width: 100%; text-align: left; color: inherit; text-decoration: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 12px;
}
.rowcard:hover { border-color: var(--ink); text-decoration: none; color: inherit; }
.rowcard__top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.rowcard__art { font-size: 11.5px; font-weight: 700; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.rowcard__name { font-size: 14.5px; font-weight: 600; line-height: 1.3; margin-bottom: 8px; }
.rowcard__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.rowcard__cell { min-width: 0; }
.rowcard__k { font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-4); }
.rowcard__v { font-size: 13.5px; font-weight: 600; font-variant-numeric: tabular-nums; margin-top: 2px; }

/* ─── Герой главной (T1) ─────────────────────────────────────────── */
.hero { display: grid; gap: 16px; }
.hero__lead { margin: 10px 0 14px; }
.hero__search { margin-bottom: 12px; }
.hero__find { display: none; }
.hero__season-t { font-size: 17px; font-weight: 700; line-height: 1.25; margin: 10px 0 8px; }
.hero__season-d { margin-bottom: 14px; }
.posts { display: grid; gap: 9px; }
@media (min-width: 768px) {
  .hero { grid-template-columns: repeat(12, 1fr); gap: 32px; align-items: start; }
  .hero__main { grid-column: span 8; }
  .hero__season { grid-column: span 4; }
  .hero__lead { margin: 12px 0 22px; max-width: 600px; }
  .hero__find { display: inline-flex; }
  .hero__season-t { font-size: 19px; }
  .posts { grid-template-columns: repeat(3, 1fr); gap: 32px; }
}

/* ─── Результаты поиска ──────────────────────────────────────────── */
.searchbox { position: relative; }
.sres {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 45;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card);
  box-shadow: var(--sh-md); overflow: hidden; max-height: 62vh; overflow-y: auto;
}
.sres[hidden] { display: none; }
.sres__item {
  display: flex; flex-direction: column; gap: 2px;
  padding: 11px 14px; border-top: 1px solid var(--line-soft);
  color: inherit; text-decoration: none;
}
.sres__item:first-child { border-top: 0; }
.sres__item b { font-size: 14px; font-weight: 600; line-height: 1.3; }
.sres__item span { font-size: 12.5px; color: var(--ink-3); line-height: 1.4; }
.sres__item:hover, .sres__item.is-active, .sres__item:focus {
  background: var(--bg); text-decoration: none; color: inherit; outline: none;
}
.sres__empty { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; padding: 14px; }
.sres__empty b { font-size: 14px; }
.sres__empty span { font-size: 12.5px; color: var(--ink-3); line-height: 1.45; }

/* Подсказки Dadata в полях форм (ДКП): выпадающий список под полем */
.field--sugg { position: relative; }
.sres button.sres__item { width: 100%; border-left: 0; border-right: 0; border-bottom: 0; }

/* ─── Навигация внутри страниц (§10) ─────────────────────────────── */
.toc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 14px; }
.toc ol { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-direction: column; gap: 2px; }
.toc a {
  display: block; padding: 9px 10px; border-left: 2px solid transparent; border-radius: 6px;
  font-size: 13.5px; color: var(--ink-25); line-height: 1.35;
}
.toc a:hover { background: var(--bg); text-decoration: none; }
.toc a.is-active { font-weight: 700; color: var(--ink); border-left-color: var(--acc); background: var(--bg); }

.progress { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--acc); border-radius: 3px; transition: width .2s ease; }

.steps { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.steps__label { font-size: 13px; font-weight: 600; color: var(--ink-2); }

.acc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 4px 14px; }
.acc details { border-top: 1px solid var(--line-soft); }
.acc details:first-of-type { border-top: 0; }
.acc summary {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  min-height: 52px; padding: 11px 0; cursor: pointer; list-style: none;
  font-size: 13.5px; font-weight: 500; line-height: 1.35;
}
.acc summary::-webkit-details-marker { display: none; }
.acc summary::after { content: '+'; flex: 0 0 auto; color: var(--ink-3); font-size: 18px; }
.acc details[open] summary::after { content: '−'; }
.acc__body { padding: 0 0 14px; font-size: 13.5px; line-height: 1.55; color: var(--ink-2); }

/* ─── Виджет подписки (§11) ──────────────────────────────────────── */
.sub__head { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 12px; }
.sub__title { font-size: 16px; font-weight: 700; line-height: 1.3; margin-bottom: 5px; }
.sub__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.sub__actions > * { flex: 1 1 160px; }
@media (min-width: 768px) {
  .sub { display: flex; align-items: center; justify-content: space-between; gap: 40px; padding: 28px 32px; border-radius: var(--r-res); }
  .sub__head { margin-bottom: 0; max-width: 640px; }
  .sub__title { font-size: 24px; }
  .sub__actions { flex: 0 0 auto; }
  .sub__actions > * { flex: 0 0 auto; }
}

/* ─── Рекламные контейнеры (§12): высота зарезервирована, CLS 0 ───
   Пустое состояние (без JS) — нейтральная плашка с подписью формата.
   Заглушка (core.js → decorateAds): фото, мелкий лейбл «Реклама» в углу,
   для видео-слота — play-бейдж. Реальная сеть заменит содержимое слота. */
.ad {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  background: var(--ad-bg); border: 1px dashed var(--ad-line); border-radius: 10px;
  color: var(--ad-ink); text-align: center; overflow: hidden;
}
.ad::before {
  content: 'Реклама';
  font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
}
.ad span { font-size: 11.5px; }
.ad--a2 { height: 250px; }
.ad--a3 { height: 250px; }
.ad--a4 { height: 250px; }
.ad--a5 { height: 100px; }
.ad--a1 { height: 400px; display: none; }
@media (min-width: 768px) {
  .ad--a2 { height: 90px; }
  .ad--a3 { height: 280px; }
  .ad--a5 { height: 250px; }
  .ad--a1 { display: flex; }
}

/* Заглушка с фото */
.ad.is-filled { border: 1px solid var(--line); background: #14161B; }
.ad.is-filled::before,
.ad.is-filled > span:not(.ad__tag):not(.ad__play) { display: none; }
.ad__img {
  position: absolute; inset: 0; z-index: 0;
  width: 100%; height: 100%; object-fit: cover; object-position: center;
}
.ad__tag {
  position: absolute; top: 7px; right: 8px; z-index: 2;
  padding: 2px 7px; border-radius: var(--r-badge);
  background: rgba(20, 22, 27, .52); color: rgba(255, 255, 255, .82);
  font-size: 9.5px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase;
  pointer-events: none;
}
/* Видео-слот: только A5 (футер-борд) — большой формат после контента,
   единственное место, где ролик не мешает чтению. A1/A2/A3/A6 — статичные. */
.ad__play {
  position: absolute; left: 50%; top: 50%; z-index: 1;
  width: 52px; height: 52px; margin: -26px 0 0 -26px;
  border-radius: 50%; background: rgba(20, 22, 27, .55);
  border: 1.5px solid rgba(255, 255, 255, .65);
}
.ad__play::after {
  content: ''; position: absolute; left: 50%; top: 50%;
  margin: -8px 0 0 -5px;
  border: 8px solid transparent; border-left: 13px solid rgba(255, 255, 255, .92);
  border-right: 0;
}
.ad--a6 .ad__tag { top: 50%; transform: translateY(-50%); }

/* ─── Подвал ─────────────────────────────────────────────────────── */
.ftr { border-top: 1px solid var(--line); margin-top: 32px; padding: 20px 0 28px; }
.ftr__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 16px; }
.ftr__grid a { font-size: 13px; color: var(--ink-25); min-height: 44px; display: flex; align-items: center; }
.ftr__grid a:hover { color: var(--acc); }
.ftr__second { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 4px; border-top: 1px solid var(--line-soft); margin-top: 12px; }
.ftr__second a { font-size: 12px; color: var(--ink-3); min-height: 44px; display: flex; align-items: center; padding: 0 6px; }
.ftr__note { font-size: 11.5px; color: var(--ink-4); line-height: 1.45; margin-top: 12px; }
@media (min-width: 768px) {
  .ftr { margin-top: 48px; padding: 28px 0 36px; }
  /* Колонки по числу пунктов, а не «ровно четыре»: добавили раздел — сетка
     подстроилась, а не поехала. */
  .ftr__grid { display: flex; flex-wrap: wrap; gap: 4px 28px; }
  .ftr__grid a { min-height: 32px; font-size: 13.5px; font-weight: 500; color: var(--ink-2); }
}

/* ─── Тосты, шторка, скелетоны, пустые состояния (§13) ───────────── */
.toast-host {
  position: fixed; left: 12px; right: 12px; bottom: calc(var(--tabbar-h) + 12px);
  z-index: 60; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none;
}
@media (min-width: 768px) { .toast-host { bottom: 24px; left: auto; right: 24px; align-items: flex-end; } }
.toast {
  max-width: 420px; background: var(--ink); color: #fff;
  padding: 12px 15px; border-radius: 11px; box-shadow: var(--sh-lg);
  font-size: 13.5px; line-height: 1.4; animation: rise .18s ease-out;
}
@keyframes rise { from { transform: translateY(10px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.empty {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 28px 16px; text-align: center;
  background: var(--surface); border: 1px dashed var(--line); border-radius: var(--r-card);
}
.empty__t { font-size: 15px; font-weight: 700; }
.empty__d { font-size: 13.5px; color: var(--ink-3); line-height: 1.45; max-width: 380px; }

.skel {
  background: linear-gradient(90deg, #EDECE8 0%, #F6F5F2 40%, #EDECE8 80%);
  background-size: 400px 100%; border-radius: 6px; animation: shine 1.2s linear infinite;
}
@keyframes shine { 0% { background-position: -200px 0; } 100% { background-position: 400px 0; } }

/* ─── Статья (T3) ────────────────────────────────────────────────── */
.article__body { font-family: var(--serif); font-size: 18px; line-height: 1.6; color: var(--ink); }
.article__body > * + * { margin-top: 18px; }
.article__body h2 { font-family: var(--sans); font-size: 19px; font-weight: 700; line-height: 1.25; letter-spacing: -.015em; margin-top: 32px; }
.article__body h3 { font-family: var(--sans); font-size: 18px; font-weight: 700; line-height: 1.3; margin-top: 24px; }
.article__body ul, .article__body ol { padding-left: 22px; }
.article__body li + li { margin-top: 8px; }
.article__lead { font-weight: 700; }
.article__body a { text-decoration: underline; }
@media (min-width: 768px) {
  .article__body h2 { font-size: 26px; }
  .article__body { max-width: 680px; }
}

.quote {
  border-left: 3px solid var(--yellow); padding: 4px 0 4px 16px;
  font-family: var(--serif); font-style: italic; font-size: 17px; line-height: 1.55; color: var(--ink-2);
}
.quote cite {
  display: block; margin-top: 8px; font-family: var(--sans); font-style: normal;
  font-size: 12px; color: var(--ink-4);
}

/* ─── Схемы тренажёра ПДД ────────────────────────────────────────── */
.scheme {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card);
  padding: 12px; display: flex; align-items: center; justify-content: center;
}
.scheme svg { width: 100%; height: auto; }

/* ─── Аккаунт в шапке и таб-баре (рисует auth.js) ────────────────── */
.hdr__ava {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--ink); color: var(--yellow);
  font-size: 12px; font-weight: 700; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
}
@media (min-width: 768px) { .hdr__acc { gap: 8px; } }

/* ─── Печать (§14 Print) ─────────────────────────────────────────── */
@media print {
  @page { size: A4; margin: 15mm; }
  body { background: #fff; padding: 0; font-size: 11pt; }
  .hdr, .tabbar, .ad, .ftr, .crumbs, .toast-host, .no-print, .sticky-sum { display: none !important; }
  .print-only { display: block !important; }
  a[href^="http"]::after { content: ' (' attr(href) ')'; font-size: 9pt; color: #444; }
  .card, .result { break-inside: avoid; box-shadow: none; }
}
.print-only { display: none; }
