@import url("tokens.css");
@import url("themes.css");
@import url("stand.css");

/* Базовые элементы и доступность. */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: 24px; }
body { margin: 0; background: var(--page); color: var(--text); font: 400 16px/1.5 var(--font-family-sans); }
h1, h2, h3, p, ul, ol, dl, pre, fieldset { margin: 0; }
h1, h2, h3, strong, b { font-weight: 600; }
h1 { font-size: 40px; line-height: 1.2; letter-spacing: -.025em; }
h2 { font-size: 28px; line-height: 1.25; letter-spacing: -.015em; }
h3 { font-size: 20px; line-height: 1.35; }
a { color: var(--link); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
button, input, select, textarea { font: inherit; color: inherit; }
button, summary { cursor: pointer; }
button { border: 0; }
button:disabled, input:disabled { cursor: not-allowed; }
img { display: block; max-width: 100%; height: auto; }
svg { display: inline-block; vertical-align: middle; flex-shrink: 0; }
ul, ol { padding-left: 24px; }
fieldset { padding: 0; border: 0; min-width: 0; }
summary { list-style: none; }
summary::-webkit-details-marker { display: none; }
:focus-visible, .button--focus { outline: 2px solid var(--focus); outline-offset: 3px; }
[id] { scroll-margin-top: 24px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip-link { position: fixed; z-index: 100; top: 8px; left: 16px; padding: 12px 16px; background: var(--surface); transform: translateY(-150%); border: 2px solid var(--accent); border-radius: 8px; }
.skip-link:focus { transform: none; }
.container { width: min(1200px, calc(100% - 48px)); margin-inline: auto; }
.page { padding-block: 28px 64px; }
.surface { background: var(--surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-card); box-shadow: var(--shadow-card); }
.icon { width: 24px; height: 24px; fill: none; }
.muted { color: var(--text-muted); }
.button, .icon-button { min-height: 48px; display: inline-flex; justify-content: center; align-items: center; gap: 8px; padding: 11px 20px; border: 1px solid transparent; border-radius: var(--radius-control); font-weight: 600; line-height: 1.5; text-decoration: none; text-align: center; cursor: pointer; }
.button--primary { background: var(--accent); color: var(--accent-contrast); }
.button--primary:hover, .button--primary.button--hover { background: var(--accent-hover); }
.button--primary:active, .button--primary.button--pressed { background: var(--accent-active); }
.button--secondary, .icon-button { background: var(--surface); color: var(--accent); border-color: var(--accent); }
.button--secondary:hover, .icon-button:hover, .button--secondary.button--hover { background: var(--accent-soft); }
.button--secondary:active, .button--secondary.button--pressed { background: var(--accent-soft); box-shadow: inset 0 0 0 1px currentColor; }
.button--text { color: var(--accent); background: transparent; }
.button--text:hover, .button--text.button--hover { background: var(--accent-soft); }
.button--text:active, .button--text.button--pressed { background: var(--accent-soft); box-shadow: inset 0 0 0 1px currentColor; }
.button:disabled, .button--disabled { background: var(--field-disabled); border-color: var(--border-disabled); color: var(--text-disabled); }
.button--full { width: 100%; }
.icon-button { width: 48px; padding: 11px; }
.icon-button--hover { background: var(--accent-soft); }
.icon-button:active, .icon-button--pressed { background: var(--accent-soft); box-shadow: inset 0 0 0 1px currentColor; }
.icon-button--focus { outline: 2px solid var(--focus); outline-offset: 3px; }
.icon-button:disabled { background: var(--field-disabled); color: var(--text-disabled); border-color: var(--border-disabled); cursor: not-allowed; }

/* Шапка и навигация. */
.site-header { background: var(--surface); border-bottom: 1px solid var(--border-subtle); }
.site-header__inner { display: flex; align-items: center; gap: 24px; min-height: 88px; position: relative; }
.brand { display: inline-flex; align-items: center; gap: 10px; flex-shrink: 0; color: var(--text); font-size: 22px; font-weight: 600; text-decoration: none; letter-spacing: -.04em; }
.brand__mark { color: var(--accent); width: 32px; height: 32px; }
.site-header__desktop-search { flex: 1; min-width: 0; }
.site-header__desktop-search .search .button { display: none; }
.site-header__mobile-search { display: none; }
.site-menu > summary { display: flex; align-items: center; gap: 8px; min-height: 48px; color: var(--text); }
.site-menu__panel { position: absolute; right: 0; top: 76px; width: min(680px, 100%); padding: 24px; z-index: 20; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-card); }
.site-menu__panel ul { display: grid; grid-template-columns: 1fr 1fr; list-style: none; padding: 0; gap: 8px 24px; }
.site-menu__panel a { display: flex; align-items: center; gap: 12px; min-height: 44px; color: var(--text); text-decoration: none; }
.site-menu__panel a:hover { color: var(--accent); }
.site-menu__panel .icon { color: var(--accent); }
.site-menu__order { margin-top: 16px; border-top: 1px solid var(--border-subtle); padding-top: 16px; }
.site-header__order { font-size: 14px; font-weight: 600; white-space: nowrap; }
.search { display: flex; gap: 12px; width: 100%; }
.search__field { display: flex; align-items: center; gap: 12px; min-height: 48px; min-width: 0; flex: 1; padding-left: 16px; background: var(--field-bg); border: 1px solid var(--border); border-radius: 8px; }
.search__field .icon { color: var(--text-muted); }
.search__field:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.search input { border: 0; background: transparent; min-width: 0; width: 100%; height: 46px; padding: 10px 12px 10px 0; outline: none; }
input::placeholder, textarea::placeholder { color: var(--text-muted); opacity: 1; }
.site-footer { background: var(--surface); border-top: 1px solid var(--border-subtle); padding-block: 32px; }
.site-footer__inner { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.site-footer p { margin-top: 8px; color: var(--text-muted); font-size: 14px; }
.site-footer nav { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; justify-content: flex-end; }
.site-footer nav a { min-height: 44px; display: inline-flex; align-items: center; font-size: 14px; }
.site-footer__policy { grid-column: 1/-1; font-size: 14px; }
.site-footer__policy summary { text-decoration: underline; min-height: 44px; display: flex; align-items: center; }
.breadcrumbs { margin-bottom: 20px; color: var(--text-muted); font-size: 14px; }
.breadcrumbs ol { display: flex; gap: 8px; flex-wrap: wrap; list-style: none; padding: 0; }
.breadcrumbs li + li::before { content: "/"; margin-right: 8px; color: var(--text-muted); }
.breadcrumbs a { color: var(--text-muted); }
.page-heading { margin-bottom: 28px; }
.page-heading__description { color: var(--text-muted); margin-top: 12px; max-width: 850px; font-size: 18px; }
.eyebrow { font-size: 14px; color: var(--accent); margin-bottom: 12px; }
.page-section { margin-top: 48px; }
.page-section > h2 { margin-bottom: 24px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.section-heading > a { display: inline-flex; align-items: center; gap: 8px; }
.section-heading p { margin-top: 8px; }

/* Формы и результат. */
.calc-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.calc-layout > *, .calc-form__grid > * { min-width: 0; }
.calc-form { padding: 28px; }
.calc-form__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 20px; }
.calc-form > .button { margin-top: 24px; }
.calc-form__check { display: flex; align-items: center; padding-top: 28px; }
.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.field > label { font-weight: 600; line-height: 1.4; }
.field--wide { grid-column: 1/-1; }
.field__control { display: flex; align-items: center; min-height: 48px; border: 1px solid var(--border); border-radius: 8px; background: var(--field-bg); min-width: 0; overflow: hidden; }
.field__control:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.field--focus .field__control { outline: 2px solid var(--focus); outline-offset: 2px; }
.field input, .field select { width: 100%; min-width: 0; height: 46px; padding: 10px 12px; border: 0; outline: none; background: transparent; }
.field select { appearance: none; padding-right: 40px; }
.field__control--select { position: relative; }
.field__control--select > .icon { position: absolute; right: 12px; pointer-events: none; color: var(--text-muted); }
.field__unit { white-space: nowrap; padding-right: 12px; font-size: 14px; color: var(--text-muted); }
.field__help, .field__error { font-size: 14px; line-height: 1.4; }
.field__help { color: var(--text-muted); }
.field--error .field__control { border-color: var(--error); border-width: 2px; }
.field--error input { height: 44px; }
.field__error { color: var(--error); display: flex; align-items: flex-start; gap: 6px; }
.field__error .icon { width: 18px; height: 18px; }
.field__control:has(input:disabled) { background: var(--field-disabled); border-color: var(--border-disabled); color: var(--text-disabled); }
.field input:disabled { color: var(--text-disabled); }
.field textarea { border: 1px solid var(--border); border-radius: 8px; background: var(--field-bg); padding: 12px; resize: vertical; min-height: 128px; max-width: 100%; }
.check { display: flex; gap: 10px; align-items: flex-start; min-height: 44px; padding-block: 10px; cursor: pointer; }
.check input { width: 20px; height: 20px; flex-shrink: 0; margin: 2px 0 0; accent-color: var(--accent); }
.check:has(:disabled) { color: var(--text-disabled); cursor: not-allowed; }
.notice { background: var(--accent-soft); border-radius: 8px; padding: 16px; font-size: 14px; }
.notice .icon { margin-right: 8px; }
.notice--error { color: var(--error); background: var(--error-soft); margin-bottom: 24px; }
.notice--error a { color: inherit; }
.notice p { margin-top: 4px; }
.result { padding: 28px; background: var(--result-bg); color: var(--result-text); border-radius: 12px; min-width: 0; }
.result__label { font-size: 18px; line-height: 1.4; letter-spacing: 0; }
.result__value { font-weight: 600; font-size: 48px; line-height: 1.1; letter-spacing: -.025em; margin: 16px 0 28px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.result__value span { font-size: .65em; }
.result__details { display: grid; gap: 12px; }
.result__details > div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; }
.result__details dd { margin: 0; font-weight: 600; white-space: nowrap; }
.result__note { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--result-divider); font-size: 14px; }
.result__link { display: flex; align-items: center; gap: 8px; color: inherit; min-height: 44px; margin-top: 8px; }
.result a:focus-visible { outline-color: var(--result-text); }
.result--neutral { background: var(--surface); border: 1px solid var(--border); color: var(--text); min-height: 280px; }
.result--neutral h2 { font-size: 20px; }
.result__empty { color: var(--text-muted); padding-top: 40px; max-width: 280px; }
.result__empty > .icon { color: var(--accent); margin-bottom: 12px; }
.result__empty p { line-height: 1.6; }
.order-strip { display: flex; align-items: center; gap: 12px; padding: 18px 20px; color: var(--accent); background: var(--accent-soft); border-radius: 8px; margin-block: 24px; text-decoration: none; font-weight: 600; }
.order-strip > span { flex: 1; }
.order-strip:hover { text-decoration: underline; }
.order-banner { display: flex; align-items: center; gap: 20px; padding: 28px; background: var(--accent-soft); border-radius: 12px; margin-top: 48px; }
.order-banner > .icon { width: 36px; height: 36px; color: var(--accent); }
.order-banner > div { flex: 1; }
.order-banner h2 { font-size: 24px; }
.order-banner p { color: var(--text-muted); margin-top: 8px; }
.contents-nav, .component-nav { display: flex; gap: 8px 24px; flex-wrap: wrap; margin-block: 32px; }
.contents-nav a, .component-nav a { min-height: 44px; display: inline-flex; align-items: center; }

/* Контент под калькулятором. */
.content-section { padding: 32px; margin-top: 24px; }
.content-section__heading { display: flex; gap: 12px; align-items: center; margin-bottom: 24px; }
.content-section__heading > .icon { color: var(--accent); width: 28px; height: 28px; }
.prose h3 { margin-bottom: 12px; }
.prose p + p { margin-top: 12px; }
.prose li + li { margin-top: 8px; }
.prose--columns { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.formula { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--page); border: 1px solid var(--border-subtle); border-left: 3px solid var(--accent); padding: 20px; border-radius: 8px; margin-block: 16px; font: 400 16px/1.7 var(--font-family-mono); }
.formula code { font: inherit; }
.definitions { display: grid; gap: 12px; margin-top: 24px; }
.definitions > div { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 16px; }
.definitions dt { font-weight: 600; }
.definitions dd { margin: 0; color: var(--text-muted); }
.example { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--border-subtle); }
.example h3 { display: flex; align-items: center; gap: 12px; }
.example h3 .icon { color: var(--accent); }
.example p { margin-top: 16px; }
.example__list { display: flex; flex-wrap: wrap; list-style: none; padding: 0; gap: 16px 32px; margin-top: 16px; }
.example__list dt { color: var(--text-muted); font-size: 14px; }
.example__list dd { margin: 4px 0 0; font-weight: 600; }
.definitions + p { margin-top: 24px; }
.faq details { border-top: 1px solid var(--border-subtle); }
.faq summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 20px; font-weight: 600; min-height: 64px; }
.faq summary .icon { color: var(--accent); }
.faq details[open] summary .icon { transform: rotate(45deg); }
.faq details > p { color: var(--text-muted); padding-bottom: 24px; max-width: 900px; }
.sources { display: grid; gap: 16px; }
.sources { margin-top: 16px; }
.sources a { display: inline-flex; gap: 8px; align-items: center; }
.sources span, .sources small { display: block; color: var(--text-muted); font-size: 14px; }
.related { margin-top: 48px; }
.carousel__arrows { display: flex; gap: 8px; }
.carousel { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: 2px; list-style: none; padding: 2px 2px 16px; gap: 20px; scrollbar-width: thin; scrollbar-color: var(--border) var(--page); }
.carousel__item { flex: 0 0 calc((100% - 60px) / 4); scroll-snap-align: start; }
.carousel__hint { display: none; font-size: 14px; color: var(--text-muted); margin-top: 8px; }
.calculator-card { background: var(--surface); border: 1px solid var(--border-subtle); border-radius: 12px; overflow: hidden; min-width: 0; box-shadow: var(--shadow-card); list-style: none; }
.calculator-card > a { display: block; color: var(--text); text-decoration: none; height: 100%; }
.calculator-card:has(a:focus-visible) { outline: 2px solid var(--focus); outline-offset: 3px; }
.calculator-card > a:focus-visible { outline: none; }
.calculator-card:hover { border-color: var(--accent); }
.calculator-card__image { width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.calculator-card__fallback { display: grid; place-items: center; width: 100%; aspect-ratio: 4/3; background: var(--accent-soft); color: var(--accent); }
.calculator-card__fallback .icon { width: 64px; height: 64px; }
.calculator-card__body { padding: 20px; position: relative; }
.calculator-card__body h3 { font-size: 18px; padding-right: 12px; }
.calculator-card__body p { font-size: 14px; color: var(--text-muted); margin-top: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.calculator-card__body > .icon { position: absolute; right: 12px; top: 20px; width: 18px; height: 18px; color: var(--accent); }
.comments { list-style: none; padding: 0; }
.comment { padding-block: 24px; border-top: 1px solid var(--border-subtle); }
.comment__meta { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.comment__avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 600; }
.comment__meta time { color: var(--text-muted); font-size: 14px; margin-left: auto; }
.comment > p { margin-bottom: 12px; }
.comment > a { display: inline-flex; min-height: 44px; align-items: center; gap: 8px; }
.comment__reply { display: inline-flex; min-height: 44px; align-items: center; margin-top: 8px; }
.comment__replies { list-style: none; padding-left: 28px; margin-top: 16px; border-left: 2px solid var(--border-subtle); }
.comment__replies .comment { padding-bottom: 0; border: 0; }
.comment-form { padding: 28px; margin-top: 24px; }
.comment-form { display: grid; gap: 20px; padding: 0; }
.comment-form h2 { margin-bottom: 20px; }
.comment-form form { display: grid; gap: 16px; }
.comment-form .field { max-width: 800px; }
.comment-form__actions { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; }
.ad { display: flex; justify-content: center; padding-top: 40px; }
.ad__slot { flex: none; border: 1px dashed var(--border); background: var(--surface); display: grid; place-items: center; }
.ad__slot::after { content: attr(data-label); color: var(--text-muted); font-size: 14px; }
.ad__slot--desktop { width: 728px; height: 90px; }
.ad__slot--mobile { display: none; width: 300px; height: 250px; }

/* Главная и каталог. */
.home-search { padding: 28px 32px; }
.home-search h2 { font-size: 24px; margin-bottom: 16px; }
.home-search .search__field { min-height: 56px; }
.home-search .search input { height: 54px; }
.home-search .search .button { padding-inline: 32px; }
.popular-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; list-style: none; padding: 0; }
.popular-card { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--border-subtle); border-radius: 12px; padding: 20px 16px; min-height: 96px; height: 100%; text-decoration: none; color: var(--text); font-weight: 600; }
.popular-card > .icon:first-child { color: var(--accent); width: 28px; height: 28px; }
.popular-card > .icon:last-child { margin-left: auto; width: 16px; height: 16px; color: var(--text-muted); }
.popular-card:hover, .category-card:hover { border-color: var(--accent); }
.category-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; list-style: none; padding: 0; }
.category-card { display: flex; gap: 16px; align-items: center; padding: 20px; min-height: 96px; height: 100%; color: var(--text); text-decoration: none; background: var(--surface); border: 1px solid var(--border-subtle); border-radius: 12px; }
.category-card > .icon:first-child { width: 32px; height: 32px; color: var(--accent); }
.category-card > .icon:last-child { width: 20px; height: 20px; margin-left: auto; color: var(--text-muted); }
.category-card small { display: block; margin-top: 4px; color: var(--text-muted); font-size: 14px; }
.section-search { padding: 24px; margin-bottom: 24px; }
.catalog-filter, .chip-examples { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; }
.chip { position: relative; cursor: pointer; }
.chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip span { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 8px 20px; border: 1px solid var(--border); border-radius: 99px; background: var(--surface); }
.chip input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--accent-contrast); }
.chip input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 3px; }
.catalog__count { display: flex; justify-content: space-between; margin-bottom: 20px; font-weight: 600; }
.catalog__count span { font-size: 14px; font-weight: 400; color: var(--text-muted); }
.catalog__list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; list-style: none; padding: 0; }
/* Перенос: страница выдачи одна на отдачу — её считает сервер (?page=), а
   фильтр подтемы — адрес (?topic=). В эталоне все страницы лежали в DOM и
   переключались :target; для раздела на 210 карточек это 210 карточек в
   каждой отдаче и 210 картинок в вёрстке. */
.catalog__page { display: block; }
.catalog-more { margin-top: 24px; }
.catalog-more > summary { display: flex; justify-content: center; align-items: center; gap: 12px; border: 1px solid var(--accent); color: var(--accent); border-radius: 8px; min-height: 48px; font-weight: 600; background: var(--surface); }
.catalog-more[open] > summary { margin-bottom: 24px; }
.catalog-more[open] > summary .icon { transform: rotate(180deg); }
.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 24px; }
.pagination a, .pagination > span { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; height: 44px; border-radius: 8px; text-decoration: none; }
.pagination a { border: 1px solid var(--border); background: var(--surface); }
/* Текущая страница выдачи отмечена aria-current — состоянием разметки, а не
   совпадением якоря: так его слышит и читалка экрана. */
.pagination a[aria-current="page"] { background: var(--accent); color: var(--accent-contrast); border-color: var(--accent); }

/* Длинная форма и таблица. */
.form-group { background: var(--surface); border: 1px solid var(--border-subtle); border-radius: 12px; margin-bottom: 16px; }
.form-group > summary { display: flex; align-items: center; gap: 12px; padding: 20px; }
.form-group__number { width: 32px; height: 32px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); border-radius: 50%; flex-shrink: 0; }
.form-group__count { color: var(--text-muted); font-size: 14px; margin-left: auto; white-space: nowrap; }
.form-group[open] > summary > .icon { transform: rotate(180deg); }
.form-group__body { padding: 8px 24px 24px; }
.soil-layer { grid-column: 1/-1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; padding: 16px; border: 1px solid var(--border-subtle); border-radius: 8px; }
.soil-layer legend { padding-inline: 8px; font-weight: 600; }
.long-form > .button { width: 100%; }
.calc-layout__result--sticky { position: sticky; top: 24px; }
.calc-layout__note { font-size: 14px; padding: 16px 4px 0; }
.schedule { padding: 28px; margin-top: 32px; }
.table-scroll { overflow: auto; max-height: 640px; border: 1px solid var(--border); border-radius: 8px; scrollbar-color: var(--border) var(--page); }
.payment-table { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 900px; font-variant-numeric: tabular-nums; font-size: 14px; }
.payment-table th, .payment-table td { padding: 16px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--border-subtle); background: var(--surface); }
.payment-table th:first-child { text-align: left; position: sticky; left: 0; border-right: 1px solid var(--border-subtle); z-index: 1; }
.payment-table thead th { position: sticky; top: 0; background: var(--page); z-index: 2; font-weight: 600; }
.payment-table thead th:first-child { z-index: 3; }
.payment-table tbody tr:nth-child(even) > * { background: var(--page); }
.payment-table tfoot > tr > * { background: var(--accent-soft); color: var(--text); font-weight: 600; border-bottom: 0; }
.payment-table tfoot th:first-child { position: static; }
.scroll-hint { display: flex; align-items: center; gap: 8px; color: var(--text-muted); font-size: 14px; margin-bottom: 12px; }
.scroll-hint .icon { width: 18px; height: 18px; }
.schedule__note { font-size: 14px; margin-top: 16px; }
.state-section + .state-section { margin-top: 48px; }
.state-section > h2 { margin-bottom: 20px; }

/* Заказ и служебные страницы. */
.order-price { font-size: 32px; color: var(--accent); font-weight: 600; margin-top: -12px; margin-bottom: 32px; }
.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; list-style: none; padding: 0; margin-block: 24px 40px; }
.steps--three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.steps li { display: flex; gap: 12px; align-items: flex-start; }
.steps li > span { width: 36px; height: 36px; display: grid; place-items: center; flex-shrink: 0; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.steps h2, .steps h3 { font-size: 18px; line-height: 1.5; }
.steps p { color: var(--text-muted); font-size: 14px; margin-top: 8px; }
.order-layout { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.order-form, .order-summary { padding: 28px; min-width: 0; }
.order-form > p { margin-block: 12px 24px; }
.order-form > .check { margin-top: 16px; }
.order-summary { position: sticky; top: 24px; }
.order-summary h2 { font-size: 24px; }
.order-summary__price { display: grid; gap: 8px; margin-block: 24px; }
.order-summary__price span { color: var(--text-muted); }
.order-summary__price strong { font-size: 40px; line-height: 1.2; }
.order-summary .button { width: 100%; margin-block: 24px 12px; }
.order-summary > .muted { font-size: 14px; }
.thanks { padding: 48px; max-width: 800px; margin: 24px auto; text-align: center; }
.thanks__icon { display: grid; place-items: center; width: 64px; height: 64px; margin: 0 auto 24px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); }
.thanks__icon .icon { width: 36px; height: 36px; }
.thanks__intro { margin-top: 20px; color: var(--text-muted); font-size: 18px; }
.thanks__summary { padding: 24px; background: var(--page); margin-block: 28px; border-radius: 8px; text-align: left; }
.thanks__summary > div { display: flex; justify-content: space-between; gap: 16px; }
.thanks__summary > div + div { margin-top: 12px; }
.thanks__summary dd { margin: 0; font-weight: 600; }
.thanks h2 { font-size: 24px; margin-bottom: 12px; }
.thanks > .button { margin-top: 28px; }
.thanks__home { display: block; padding-block: 12px; }
.thanks__note { display: flex; justify-content: center; align-items: center; gap: 8px; color: var(--text-muted); border-top: 1px solid var(--border-subtle); padding-top: 24px; margin-top: 12px; font-size: 14px; }
.search-tips { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; list-style: none; padding: 0; margin-block: 40px 24px; }
.search-tips li { display: flex; gap: 12px; }
.search-tips .icon { color: var(--accent); margin-top: 2px; }
.search-tips h2 { font-size: 18px; line-height: 1.5; }
.search-tips p { color: var(--text-muted); margin-top: 8px; }
.text-link { display: inline-flex; gap: 8px; align-items: center; min-height: 44px; }

/* Встраивание и живая библиотека. */
.embed-root { max-width: 440px; margin-inline: auto; padding: 16px; }
.embed-widget { padding: 24px; min-width: 0; background: var(--surface); border: 1px solid var(--border-subtle); border-radius: 12px; }
.embed-widget h1 { font-size: 24px; line-height: 1.25; letter-spacing: -.02em; }
.embed-widget .embed-widget__title { font-size: 24px; line-height: 1.25; letter-spacing: -.02em; }
.embed-widget > p { font-size: 14px; margin-top: 8px; }
.embed-widget__fields { display: grid; gap: 20px; margin-block: 24px; }
.embed-widget form > .button { width: 100%; }
.embed-widget > .result { margin-top: 24px; padding: 20px; }
.embed-widget .result__value { font-size: 36px; margin-bottom: 20px; }
.embed-widget .result__details { font-size: 14px; }
.lead-form { border-top: 1px solid var(--border-subtle); margin-top: 24px; padding-top: 24px; }
.lead-form h2 { font-size: 20px; margin-bottom: 20px; }
.lead-form .check { margin-block: 12px; font-size: 14px; }
.lead-form__status { display: none; padding: 16px 0 0; color: var(--text); }
.lead-form__status:target { display: block; }
.embed-dark { color-scheme: dark; --focus: #93C5FD; }
.component-grid, .theme-grid, .embed-gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.component-grid--results { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.component-item { background: var(--surface); padding: 20px; border: 1px solid var(--border-subtle); border-radius: 12px; }
.component-item__label { color: var(--text-muted); font-size: 14px; margin-bottom: 12px; }
.component-note { margin-top: 24px; }
.radio-group legend { font-weight: 600; margin-bottom: 8px; }
.badge { display: inline-flex; align-items: center; border-radius: 4px; background: var(--field-disabled); color: var(--text-muted); font-size: 12px; padding: 4px 8px; }
.chip-examples { margin-top: 24px; align-items: center; }
.theme-sample { border: 1px solid var(--border-subtle); background: var(--surface); padding: 20px; border-radius: 12px; min-width: 0; }
.theme-sample > h3 { margin-bottom: 16px; }
.theme-sample > .result { margin-top: 16px; padding: 20px; }
.theme-sample .result__value { font-size: 32px; }
.theme-sample .result__label { font-size: 16px; }
.theme-sample .result__details { font-size: 14px; }
.icon-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.icon-tile { padding: 16px; background: var(--surface); border: 1px solid var(--border-subtle); border-radius: 8px; min-width: 0; }
.icon-tile > .icon { display: block; margin-bottom: 12px; color: var(--accent); width: 32px; height: 32px; }
.icon-tile strong { display: block; font-size: 14px; }
.icon-tile code { display: block; font: 12px/1.5 var(--font-family-mono); overflow-wrap: anywhere; color: var(--text-muted); margin-top: 8px; }

@media (max-width: 1279px) {
  .site-header__inner { gap: 16px; }
  .site-header__order { display: none; }
  .popular-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .result__value { font-size: 40px; }
  .carousel__item { flex-basis: calc((100% - 40px) / 3); }
  .theme-grid, .embed-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .icon-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
@media (max-width: 1023px) {
  .calc-layout { grid-template-columns: minmax(0, 1fr); }
  .calc-layout__result--sticky { position: static; }
  .calc-layout__result > .result { max-width: none; }
  .result__value { font-size: 48px; }
  .order-layout { grid-template-columns: minmax(0, 1fr); }
  .order-summary { position: static; }
  .category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .catalog__list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .carousel__item { flex-basis: calc((100% - 40px) / 3); }
  .ad__slot--desktop { display: none; }
  .ad__slot--mobile { display: grid; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps--three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .order-banner { flex-wrap: wrap; }
  .order-banner > div { flex-basis: calc(100% - 56px); }
  .component-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .icon-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .search-tips { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 767px) {
  .container { width: calc(100% - 32px); }
  .page { padding-block: 20px 40px; }
  h1 { font-size: 28px; line-height: 1.2; }
  h2 { font-size: 24px; }
  h3 { font-size: 18px; }
  .site-header__inner { min-height: 68px; gap: 8px; }
  .brand { font-size: 20px; gap: 8px; }
  .brand__mark { width: 28px; height: 28px; }
  .site-header__desktop-search { display: none; }
  .site-header__mobile-search { display: block; margin-left: auto; }
  .site-header__mobile-search summary, .site-menu > summary { display: flex; justify-content: center; align-items: center; width: 44px; height: 44px; }
  .site-menu__label { display: none; }
  .site-header__search-popover { position: absolute; top: 60px; left: 0; right: 0; z-index: 21; padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; }
  .site-menu__panel { top: 60px; padding: 16px; max-height: calc(100dvh - 88px); overflow-y: auto; }
  .site-menu__panel ul { grid-template-columns: 1fr; }
  .site-footer__inner { grid-template-columns: 1fr; gap: 16px; }
  .site-footer nav { justify-content: flex-start; }
  .breadcrumbs { font-size: 12px; margin-bottom: 16px; }
  .breadcrumbs__current { display: none; }
  .page-heading { margin-bottom: 24px; }
  .page-heading__description { font-size: 16px; margin-top: 12px; }
  .eyebrow { font-size: 12px; }
  .page-section, .related { margin-top: 32px; }
  .section-heading { align-items: flex-start; margin-bottom: 20px; }
  .section-heading > a { font-size: 14px; }
  .calc-form { padding: 20px; }
  .calc-form__grid { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .calc-form__check { padding-top: 0; }
  .calc-form > .button { margin-top: 20px; }
  .result { padding: 24px; }
  .result__value { font-size: 36px; }
  .result__label { font-size: 18px; }
  .result__details { font-size: 14px; }
  .result--neutral { min-height: 240px; }
  .order-strip { padding: 16px; font-size: 14px; gap: 10px; }
  .order-strip > .icon:last-child { width: 18px; }
  .order-banner { padding: 20px; gap: 16px; margin-top: 32px; }
  .order-banner > .icon { width: 28px; height: 28px; }
  .order-banner h2 { font-size: 20px; }
  .order-banner > .button { width: 100%; }
  .contents-nav, .component-nav { gap: 4px 20px; margin-block: 24px; }
  .content-section { padding: 20px; }
  .content-section__heading { gap: 10px; margin-bottom: 20px; }
  .content-section__heading > .icon { width: 24px; height: 24px; }
  .prose--columns { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .formula { padding: 16px; font-size: 14px; }
  .definitions > div { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .example__list { display: grid; gap: 12px; }
  .carousel__item { flex-basis: 78%; }
  .carousel { gap: 16px; }
  .carousel__arrows { display: none; }
  .carousel__hint { display: block; }
  .comment__meta { flex-wrap: wrap; gap: 8px; }
  .comment__meta time { width: 100%; margin-left: 48px; }
  .comment__replies { padding-left: 16px; }
  .comment-form { padding: 20px; }
  .comment-form__actions .button { width: 100%; }
  .home-search { padding: 20px; }
  .home-search h2 { font-size: 20px; }
  .search { gap: 8px; }
  .search > .button, .home-search .search .button { padding-inline: 16px; }
  .home-search .search { flex-wrap: wrap; }
  .home-search .search__field { flex-basis: 100%; }
  .home-search .search > .button { width: 100%; }
  .popular-grid { grid-template-columns: 1fr; gap: 12px; }
  .popular-card { min-height: 72px; padding: 16px; }
  .category-grid { grid-template-columns: 1fr; gap: 12px; }
  .category-card { min-height: 88px; padding: 16px; }
  .section-search { padding: 16px; }
  .chip span { padding-inline: 16px; }
  .catalog__list { gap: 12px; }
  .catalog__count { align-items: center; gap: 12px; font-size: 14px; }
  .catalog__count span { font-size: 12px; }
  .calculator-card__body { padding: 14px 12px; }
  .calculator-card__body h3 { font-size: 16px; padding-right: 0; overflow-wrap: anywhere; }
  .calculator-card__body p { font-size: 14px; }
  .calculator-card__body > .icon { display: none; }
  .pagination { gap: 4px; }
  .pagination a, .pagination > span { min-width: 40px; height: 44px; }
  .form-group > summary { padding: 16px; gap: 10px; flex-wrap: wrap; }
  .form-group > summary strong { flex: 1; }
  .form-group__count { margin-left: 42px; order: 4; width: 100%; }
  .form-group__body { padding: 4px 20px 20px; }
  .soil-layer { grid-template-columns: minmax(0, 1fr); padding: 12px; }
  .schedule { padding: 20px 16px; }
  .schedule .section-heading { flex-direction: column; }
  .schedule .section-heading .button { width: 100%; }
  .scroll-hint { font-size: 12px; gap: 4px; }
  .table-scroll { max-height: 560px; }
  .payment-table th, .payment-table td { padding: 14px 12px; }
  .steps, .steps--three { grid-template-columns: 1fr; gap: 20px; margin-bottom: 28px; }
  .order-price { font-size: 28px; }
  .order-form, .order-summary { padding: 20px; }
  .thanks { padding: 28px 20px; margin-top: 0; }
  .thanks__intro { font-size: 16px; }
  .thanks__summary { padding: 16px; font-size: 14px; }
  .thanks__summary > div { gap: 8px; }
  .thanks__note { align-items: flex-start; text-align: left; }
  .component-grid, .component-grid--results, .theme-grid, .embed-gallery { grid-template-columns: minmax(0, 1fr); }
  .icon-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .embed-root { padding: 16px; }
  .embed-widget { padding: 20px; }
  .embed-widget .result__value { font-size: 32px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
@media print {
  .site-header, .site-footer, .order-strip, .order-banner, .ad, .related, .comment-form, .contents-nav { display: none; }
  body { background: white; color: black; }
  .container { width: 100%; }
  .calc-layout { display: block; }
  .calc-form { margin-bottom: 24px; }
  .result { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .table-scroll { overflow: visible; max-height: none; border: 0; }
  .payment-table { min-width: 0; font-size: 10px; }
  .payment-table th, .payment-table td { padding: 8px 4px; position: static !important; }
}


/* ==========================================================================
   Перенос дизайна на живой сайт (заход 13, п.1).
   Ниже — только то, чего нет в эталоне, потому что в эталоне нет самого
   явления: элементы CalcSpec, которых не было в макете (радио, флажки,
   ползунок, повторяемые группы, картинка, текстовый блок), состояние «ещё не
   считали», плашка «черновик», honeypot и точки, за которые держится живой
   пересчёт (client/widget/entry.ts).
   ========================================================================== */

/* --- Раскладка калькулятора --------------------------------------------- */
/* Спека без result-элементов (только таблица или только текст) — форма во всю
   ширину: пустая правая колонка обещала бы результат, которого не будет. */
.calc-layout--single { grid-template-columns: minmax(0, 1fr); }
.long-form { display: block; }
.long-form > .calc-form__grid { background: var(--surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-card); box-shadow: var(--shadow-card); padding: 24px; margin-bottom: 16px; }
.long-form > .button { width: 100%; margin-top: 8px; }
.calc-form > .calc-form__grid + .calc-form__grid { margin-top: 24px; }

/* Состояние «ещё не считали» и «исправьте поля»: подсказка и значения лежат в
   ОДНОЙ секции, показывается одно из двух. Так живой пересчёт снимает
   подсказку, не перестраивая разметку (client/widget/entry.ts). */
.result--neutral .result__value,
.result--neutral .result__main,
.result--neutral .result__details,
.result--neutral .result__note { display: none; }
.result:not(.result--neutral) .result__empty { display: none; }
.result__main { margin: 0; }
.result__details .result-value { font-weight: 600; white-space: nowrap; }
/* Пояснение к прочеркам — одно на весь список и только пока список неполон. */
.result--complete .result__note--partial { display: none; }
.result__details dt { min-width: 0; overflow-wrap: anywhere; }
.result-note { margin-top: 12px; font-size: 14px; }

/* --- Элементы формы, которых не было в макете ---------------------------- */
.option-list { display: grid; gap: 4px; }
.field fieldset,
fieldset.field { border: 0; padding: 0; margin: 0; }
fieldset.field > legend { font-weight: 600; line-height: 1.4; padding: 0; margin-bottom: 8px; }
.field__control--slider { gap: 12px; padding-left: 12px; }
.field-slider { width: 100%; accent-color: var(--accent); }
.field-image-wrap img { border-radius: var(--radius-control); }
.text-block { grid-column: 1 / -1; }
.text-bold { font-weight: 600; }
.text-italic { font-style: italic; }
.align-left { text-align: left; }
.align-center { text-align: center; }
.align-right { text-align: right; }
.text-size-12 { font-size: 12px; }
.text-size-14 { font-size: 14px; }
.text-size-16 { font-size: 16px; }
.text-size-18 { font-size: 18px; }
.text-size-20 { font-size: 20px; }
.text-size-24 { font-size: 24px; }
.text-size-28 { font-size: 28px; }
.text-size-32 { font-size: 32px; }
.text-size-36 { font-size: 36px; }
.text-size-40 { font-size: 40px; }
.field-action { display: flex; }
.align-center.field-action { justify-content: center; }
.align-right.field-action { justify-content: flex-end; }

/* Группы: вложенная (не верхнего уровня) остаётся рамкой, повторяемая —
   строками с кнопками «добавить»/«удалить» (обычные submit, без JS). */
.group { grid-column: 1 / -1; border: 1px solid var(--border-subtle); border-radius: var(--radius-card); padding: 20px; }
.group > legend { font-weight: 600; padding-inline: 8px; }
.group-repeat-row { padding-block: 12px; }
.group-repeat-row + .group-repeat-row { border-top: 1px solid var(--border-subtle); }
.group-controls { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 16px; }

/* Результат вне панели (превью редактора, вставка без панели). */
.result-inline { padding: 16px 20px; border-radius: var(--radius-control); background: var(--accent-soft); }
.result-inline__title { font-size: 14px; color: var(--text-muted); }
.result-inline .result-value { font-size: 28px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* --- Блоки страницы ------------------------------------------------------ */
.draft-badge { display: inline-flex; align-items: center; margin-left: 8px; padding: 2px 8px; border-radius: var(--radius-sm); background: var(--field-disabled); color: var(--text-muted); font-size: 12px; font-weight: 400; vertical-align: middle; }
.calc-cta-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 8px; }
.calc-cta-actions form { margin: 0; }
.external-value-note, .external-rate-note { margin-bottom: 16px; }
.notice + .notice { margin-top: 8px; }
.formula-item + .formula-item { margin-top: 20px; }
.formula-item h3 { font-size: 16px; }
/* Блок формулы из текста страницы (product/content/markup.ts) — тот же вид,
   что и у формулы автоматического разбора: одно явление, один вид. */
.formula-block { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--page); border: 1px solid var(--border-subtle); border-left: 3px solid var(--accent); padding: 20px; border-radius: 8px; margin-block: 16px; font: 400 16px/1.7 var(--font-family-mono); }
.faq__answer { color: var(--text-muted); padding-bottom: 24px; max-width: 900px; }
.sources li { list-style: none; }
.sources ul { padding: 0; }
.calculator-card__body h3 .draft-badge { font-size: 11px; }

/* Карточка каталога: подпись темы не должна распирать плитку. */
.catalog__list .calculator-card__body p { color: var(--text-muted); }

/* Чипс-ссылка: тот же вид, что у чипса-радио эталона, но с адресом. */
.chip--link { text-decoration: none; color: inherit; }
.chip--link[aria-current="page"] span { background: var(--accent); border-color: var(--accent); color: var(--accent-contrast); }

/* Комментарии: форма — сетка полей, как в макете. */
.comment-form .calc-form__grid { gap: 20px; }
.comment__meta time { margin-left: auto; }

/* Заявка посетителя (CalcSpec.leadForm). */
.lead-form-wrap { display: block; }
.lead-form .calc-form__grid { margin-bottom: 16px; }
.lead-form > .button { width: 100%; }

/* Рекламное место: имя блока — на контейнере, размеры — на слотах. */
.ad[hidden] { display: none; }

/* Honeypot: человеку не видно и табом не доступно, боту-заполнителю видно. */
.hp-field { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Заглушка недоступной вставки. */
.embed-unavailable { text-align: center; color: var(--text-muted); }

@media (max-width: 767px) {
  .long-form > .calc-form__grid { padding: 16px; }
  .group { padding: 16px; }
  .result-inline .result-value { font-size: 24px; }
}


/* ==========================================================================
   Заход 14 — точное соответствие картинкам макетов
   (docs/design/final/mockups/screen-NN.png и образцы блоков набора
   docs/design/final/system/ui/*.svg). Ниже — только то, что расходилось;
   размеры взяты из образцов набора, а не подобраны на глаз:
   карточка 320×328 с превью 288×216 и полями 16 (calculator-card-preview),
   карточка раздела 320×104 (section-card), полоса заказа 760×64 с полями 20
   (order-strip), баннер 1200×152 с полями 32 (order-banner),
   чипс 112×44 r8 (topic-chip-*), страница выдачи 44×44 r8 (pagination).
   ========================================================================== */

/* --- Шапка: логотип · Разделы · поиск · «Разработка на заказ» ------------ */
.site-header__inner { min-height: 72px; gap: 20px; }
/* Поиск в шапке — серое поле без рамки и без кнопки (кнопку прячет правило
   захода 13 ниже по файлу); отправка — Enter, форма остаётся обычным GET. */
.site-header__desktop-search .search__field { background: var(--field-disabled); border-color: transparent; min-height: 44px; }
.site-header__desktop-search .search input { height: 42px; }
.site-header__order { color: var(--accent); text-decoration: none; }
.site-header__order:hover { text-decoration: underline; }
.site-menu > summary { font-weight: 400; }

/* --- Подвал: логотип и три ссылки --------------------------------------- */
.brand--footer { display: inline-flex; align-items: center; gap: 10px; }
.site-footer__inner { align-items: center; }

/* --- Хлебные крошки: «Главная / Финансы / Кредитный калькулятор» --------- */
.breadcrumbs a { text-decoration: none; }
.breadcrumbs a:hover { text-decoration: underline; }

/* --- Главная: подзаголовок, популярные, разделы -------------------------- */
.popular-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.popular-card { align-items: center; gap: 12px; padding: 16px 20px; min-height: 76px; font-weight: 400; }
.popular-card__body { display: block; flex: 1; min-width: 0; }
.popular-card__body strong { display: block; font-size: 16px; }
.popular-card__body small { display: block; margin-top: 2px; color: var(--text-muted); font-size: 14px; }
.popular-card__icon { display: grid; place-items: center; width: 40px; height: 40px; flex-shrink: 0; border-radius: var(--radius-control); background: var(--accent-soft); color: var(--accent); }
.popular-card__icon .icon { width: 22px; height: 22px; }
.popular-card > .icon:last-child { margin-left: auto; width: 20px; height: 20px; color: var(--accent); }

/* Разделы — список в две колонки (образец section-card: 320×104, иконка 32,
   «Название — N» и подпись из примеров). */
.category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.category-card { align-items: center; gap: 16px; padding: 16px 20px; min-height: 84px; }
.category-card__icon { width: 32px; height: 32px; }
.category-card__body { display: block; flex: 1; min-width: 0; }
.category-card__body strong { display: block; font-size: 18px; }
.category-card__body small { display: block; margin-top: 4px; color: var(--text-muted); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.category-card > .icon:last-child { width: 20px; height: 20px; margin-left: auto; color: var(--accent); }

/* --- Плитка каталога: превью с полями 16 внутри карточки ----------------- */
.calculator-card { overflow: visible; padding: 16px; }
.calculator-card > a { display: flex; flex-direction: column; }
.calculator-card__preview { display: block; border-radius: var(--radius-control); overflow: hidden; background: var(--accent-soft); }
.calculator-card__image, .calculator-card__fallback { border-radius: var(--radius-control); }
.calculator-card__fallback .icon { width: 140px; height: 140px; }
.calculator-card__body { padding: 14px 0 0; }
.calculator-card__body h3 { font-size: 18px; padding-right: 28px; }
.calculator-card__body p { margin-top: 6px; }
.calculator-card__body > .icon { top: 16px; right: 0; width: 20px; height: 20px; }

/* --- Раздел: поиск, чипсы, счётчик, «Показать ещё», выдача --------------- */
.section-search { padding: 20px 24px; }
.section-search .search { align-items: center; gap: 16px; }
.section-search__label { font-weight: 600; white-space: nowrap; }
.section-search .search__field { border-color: var(--border-subtle); }
.catalog-filter { align-items: center; margin-bottom: 20px; gap: 8px 12px; }
/* Чипс — прямоугольник r8 на светлой заливке (макет «Страница раздела»); в
   образце набора он белый с рамкой, на странице — заливка без рамки. */
.chip span { min-height: 40px; padding: 8px 16px; border-radius: var(--radius-control); border-color: transparent; background: var(--field-disabled); font-size: 14px; }
.chip--link[aria-current="page"] span, .chip input:checked + span { border-color: var(--accent); }
.catalog-filter__count { margin-left: auto; color: var(--text-muted); font-size: 14px; white-space: nowrap; }
.catalog__count { display: none; }
/* «Показать ещё» — светлая полоса без рамки со стрелкой вниз. */
.catalog-more > summary { background: var(--accent-soft); border-color: transparent; min-height: 56px; }
.catalog-more > summary:hover { background: var(--accent-soft-active); }
/* Пропуск в нумерации страниц — такая же рамка, как у номеров (макет). */
.pagination { gap: 12px; margin-top: 28px; }
.pagination a, .pagination > span { min-width: 44px; height: 44px; border-radius: var(--radius-control); }
.pagination > span { border: 1px solid var(--border); background: var(--surface); color: var(--text-muted); }

/* --- Полоса и баннер заказа --------------------------------------------- */
.order-strip { padding: 20px; gap: 16px; border-radius: var(--radius-control); }
.order-banner { padding: 32px; gap: 24px; }
.order-banner > .icon { width: 40px; height: 40px; }
.order-banner h2 { font-size: 24px; }
.order-banner p { margin-top: 6px; }

/* --- Калькулятор: оглавление, результат, блоки текста -------------------- */
/* Оглавление страницы: слева имя калькулятора, дальше короткие подписи через
   точку (макет «Нижняя часть страницы»). */
.contents-nav { align-items: center; gap: 4px 16px; margin-block: 28px; padding-bottom: 12px; border-bottom: 1px solid var(--border-subtle); }
.contents-nav strong { margin-right: 8px; }
.contents-nav a { color: var(--text-muted); text-decoration: none; font-size: 14px; }
.contents-nav a:hover { color: var(--accent); text-decoration: underline; }
.contents-nav a + a::before { content: "/"; margin-right: 16px; color: var(--border); }

/* Результат: строки разделены линиями, внизу примечание и ссылка. */
.result__value { margin-bottom: 0; padding-bottom: 20px; border-bottom: 1px solid var(--result-divider); }
.result__details { gap: 0; }
.result__details > div { padding-block: 14px; border-bottom: 1px solid var(--result-divider); }
.result__note { border-top: 0; padding-top: 0; margin-top: 16px; opacity: .85; }
.result__link { text-decoration: underline; }
.result--neutral { border-color: var(--border-subtle); min-height: 0; padding-bottom: 32px; }
.result--neutral .result__empty { padding-top: 24px; }

/* Формула — светлый блок без синей полосы слева (образец
   formula-block-desktop: заливка страницы, рамка subtle, r8). */
.formula, .formula-block { border-left-width: 1px; border-left-color: var(--border-subtle); padding: 16px 20px; }

/* «Пример расчёта» — строки «подпись — значение» с разделителями (образец
   example-block), а не сетка подписей над значениями. */
.example__list { display: block; margin-top: 0; }
.example__list > div { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding-block: 14px; border-bottom: 1px solid var(--border-subtle); }
.example__list dt { color: var(--text); font-size: 16px; }
.example__list dd { margin: 0; font-weight: 600; text-align: right; }

/* Частые вопросы — каждый вопрос отдельной плашкой (образцы faq-open/closed). */
.faq { display: grid; gap: 12px; }
.faq details { border: 1px solid var(--border-subtle); border-radius: var(--radius-control); background: var(--page); }
.faq summary { padding: 16px 20px; min-height: 56px; }
.faq details > .faq__answer, .faq details > p { padding: 0 20px 20px; }

/* Карусель в белой карточке. */
.related.surface { padding: 28px; }
.related.surface .carousel { padding-bottom: 4px; }

@media (max-width: 1023px) {
  .popular-grid, .category-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 767px) {
  .site-header__inner { min-height: 68px; }
  .site-menu { order: 3; }
  .site-header__mobile-search { order: 2; }
  .brand { order: 1; }
  .calculator-card { padding: 12px; }
  .calculator-card__body { padding-top: 12px; }
  .calculator-card__body h3 { font-size: 16px; padding-right: 0; }
  .calculator-card__fallback .icon { width: 96px; height: 96px; }
  .category-card, .popular-card { padding: 14px 16px; }
  .category-card__body strong { font-size: 16px; }
  .section-search { padding: 16px; }
  .section-search .search { flex-wrap: wrap; gap: 8px; }
  .section-search__label { flex-basis: 100%; font-size: 14px; }
  .catalog-filter__count { flex-basis: 100%; margin-left: 0; }
  .contents-nav { font-size: 12px; margin-block: 20px; }
  .contents-nav a + a::before { margin-right: 12px; }
  .order-banner { padding: 20px; }
  .related.surface { padding: 20px 16px; }
  .example__list > div { gap: 12px; }
}

/* --- Частые вопросы: «+» закрыт, «−» открыт (образцы faq-closed/faq-open) -- */
.faq details[open] summary .icon { transform: none; }
.faq__toggle { display: inline-flex; color: var(--accent); }
.faq__minus, .faq details[open] .faq__plus { display: none; }
.faq details[open] .faq__minus { display: inline-block; }

/* --- Источники: строка-плашка с иконкой слева ---------------------------- */
.sources li { background: var(--page); border: 1px solid var(--border-subtle); border-radius: var(--radius-control); }
.sources li > a, .sources li > .sources__mark + span { display: flex; align-items: center; gap: 12px; padding: 14px 16px; text-decoration: none; color: var(--text); }
.sources li > .sources__mark { display: none; }
.sources li > a > .sources__mark { display: inline-block; color: var(--accent); flex-shrink: 0; }
.sources li > a > span { flex: 1; min-width: 0; font-weight: 600; font-size: 15px; }
.sources li > a > span small { font-weight: 400; }
.sources li > a > .icon:last-child { color: var(--accent); flex-shrink: 0; }
.sources li > a:hover > span { text-decoration: underline; }

/* --- Примечание результата: иконка и текст в строку ---------------------- */
.result__note { display: flex; align-items: flex-start; gap: 8px; }
.result__note .icon { flex-shrink: 0; margin-top: 1px; }

/* Планшет: колонок две, плитка шире телефонной, но уже десктопной. Диапазон
   задан с обеих сторон намеренно — блок стоит ПОСЛЕ телефонного, и открытый
   сверху `max-width: 1023px` перебил бы его на 390 px. */
@media (min-width: 768px) and (max-width: 1023px) {
  .calculator-card__fallback .icon { width: 112px; height: 112px; }
}

/* Отказ расчёта — красный знак, как в образце result-error.svg. */
.result--error .result__empty > .icon { color: var(--error); }
.result--error .result-note { color: var(--text-muted); font-size: 14px; }

/* Выдача поиска: сколько показано из найденного. */
.catalog-more-note { margin-top: 20px; font-size: 14px; }

/* --- Логотип-надпись «КальКУлятор» (заход 14) ---------------------------- */
/* Высота задана, ширина считается по пропорции файла — надпись не обрезается
   и не сплющивается ни на одной ширине экрана. */
.brand { gap: 0; }
.brand__logo { display: block; height: 32px; width: auto; }
.brand--footer .brand__logo { height: 28px; }
@media (max-width: 767px) {
  /* Телефон: надпись целиком, только ниже — обрезать её нельзя. */
  .brand__logo { height: 24px; }
  .brand--footer .brand__logo { height: 24px; }
}
@media (max-width: 359px) {
  .brand__logo { height: 20px; }
}
