/* ==========================================================================
   Fitness Marka v0.32.0 — слой внутренних страниц на дизайн-коде главной.
   Грузится после styles.css (вёрстка, без изменений), bridge.css и videos.css.
   Только токены :root из styles.css; значения — из компонентов главной и страницы кейса
   (размеры, радиусы, тени, отступы). Сводка: design/DESIGN-CODE.md.
   Брейкпоинты те же: ≥1200 desktop · 768–1199 tablet · <768 mobile.
   ========================================================================== */

/* ---------- Оболочка ---------- */
.fm-rd-inner .fm-main { display: flow-root; }
.container--narrow > * { max-width: 800px; }
.sr-only, .screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.h3 { font-family: var(--serif); font-weight: 600; font-size: 32px; line-height: 1.1; }
.fm-rd-inner .h2 span { color: var(--brown); }
.meta-line { display: flex; flex-wrap: wrap; gap: 6px 10px; font-size: 14px; color: var(--muted); }

/* ---------- Герой внутренней страницы (.hero + .cp__hero главной) ---------- */
.ph { padding-top: 24px; }
.ph .crumbs { margin-bottom: 36px; }
.crumbs a:hover { color: var(--red); }
.ph__grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 48px; align-items: center; }
.ph--media .ph__grid { grid-template-columns: minmax(0, 1fr) 470px; }
.ph__text { display: flex; flex-direction: column; align-items: flex-start; gap: 24px; max-width: 880px; min-width: 0; }
.ph__title { font-family: var(--serif); font-weight: 600; font-size: 72px; line-height: .95; letter-spacing: -.02em; text-wrap: balance; overflow-wrap: break-word; }
.ph__title em { font-style: normal; color: var(--red); }
.ph__lead { font-size: 18px; color: var(--ink-2); max-width: 620px; }
.ph__lead p + p { margin-top: 10px; }
.ph__actions { display: flex; align-items: center; gap: 16px 28px; flex-wrap: wrap; }
.ph__price .money { font-size: 48px; color: var(--red); }
.ph .stats { width: 100%; }
.ph__media { position: relative; min-width: 0; }
.ph__media > img, .ph__img { display: block; width: 100%; height: auto; border-radius: 32px; }
.ph__media--wide > img { aspect-ratio: 16 / 9; object-fit: cover; }
.ph__media .fm-video__frame { border-radius: 32px; }
.ph__media .chip-money { left: -60px; bottom: -28px; }
.ph__media .chip-name { right: -24px; bottom: 56px; }
.ph--hero .ph__title { font-size: 96px; line-height: .92; }
.ph--article .ph__title, .ph--doc .ph__title { font-size: 56px; line-height: 1.02; }
.ph--solo { padding-top: 64px; }
.ph .fm-form--inline { width: 100%; max-width: 560px; }

/* ---------- Секции (ритм главной: --section, белые полосы как «Кейсы») ---------- */
.sec { padding-top: var(--section); }
.sec--first { padding-top: 56px; }
.sec--white { background: #fff; padding: var(--section) 0; margin-top: var(--section); }
.sec--white.sec--first { margin-top: 56px; }
.sec--white + .sec--white { margin-top: 0; padding-top: 0; }
.fm-main > .sec:last-child:not(.sec--white) { padding-bottom: var(--section); }
.sec__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 40px; margin-bottom: 40px; }
.sec__intro { display: flex; flex-direction: column; gap: 18px; max-width: 760px; }
.sec__lead { color: var(--ink-2); }
.sec__head .link-u { flex-shrink: 0; white-space: nowrap; }
.sec__title { margin-bottom: 40px; }
.stack { display: flex; flex-direction: column; min-width: 0; }
.stack > .sec__head { margin-bottom: 24px; }
.stack > .h3 { margin-bottom: 20px; }
.stack > .link-u { margin-top: 24px; align-self: flex-start; }

/* CTA главной на внутренних страницах: белая полоса с тем же воздухом */
.cta-wrap--inner { padding: var(--section) 0; margin-top: var(--section); }
.sec--white + .cta-wrap--inner { margin-top: 0; padding-top: 0; }

/* Видео: те же размеры заголовка, что на главной */
.fm-rd-inner .vids--inner { padding: var(--section) 0 0; }
@media (min-width: 1200px) { .fm-rd-inner .vids--inner .vids__title { font-size: 52px; } }
/* Сетка видео: у горизонтальных роликов единый кадр 16:9 (постеры 5:4 с полосами иначе ломают линию карточек). */
.fm-rd-inner .vids__grid--grid > .vcard:not(.vcard--vertical) .vcard__media { aspect-ratio: 16 / 9; }
.sec--white + .vids--inner { padding-top: var(--section); }

/* ---------- Сетки ---------- */
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.grid--top { align-items: start; gap: 48px 64px; }
.grid > li { display: flex; min-width: 0; }
.grid > li > .card, .grid > li > a, .grid > li > button { flex: 1; }
.niches__cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.cases__featured > li, .cases__item { display: flex; min-width: 0; }
.cases__item > .case-f { flex: 1; }
.sec:not(.sec--white) .case-f--light { background: #fff; }

/* ---------- Карточка (why__item / case-c / dir главной) ---------- */
.card { position: relative; display: flex; flex-direction: column; gap: 14px; min-width: 0; width: 100%; padding: 26px; border: 0; border-radius: 24px; background: #fff; color: inherit; font: inherit; text-align: left; }
.sec--white .card { background: var(--cream); }
.card--link { cursor: pointer; transition: box-shadow .15s ease; }
.card--link:hover { color: inherit; box-shadow: 0 10px 30px rgba(60,40,20,.1); }
.card--link:hover .round { transform: translateX(2px); }
.card__media { display: block; margin: -26px -26px 4px; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 24px 24px 0 0; background: var(--sand-2); }
.card__media img { width: 100%; height: 100%; object-fit: cover; }
.card__icon svg { display: block; width: 32px; height: 32px; }
.card__num { font-size: 12px; font-weight: 700; letter-spacing: .1em; color: var(--red); }
.card__tag { font-size: 11px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.card__title { font-family: var(--serif); font-size: 24px; font-weight: 600; line-height: 1.12; }
.card__title--sm { font-size: 22px; }
.card__title--lg { font-size: 40px; line-height: 1.02; }
.card__text { font-size: 14px; line-height: 1.5; color: var(--ink-2); }
.card__meta { font-size: 13px; font-weight: 500; color: var(--muted); }
.card__foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 14px; font-weight: 700; }
.card__price { font-size: 42px; color: var(--red); }
.card--dark, .sec--white .card--dark { background: var(--dark); color: #fff; }
.card--dark .card__price { color: var(--red-on-dark); }
.card--dark .card__text, .card--dark .card__meta { color: #D6CEC6; }
.card--dark .card__foot { border-color: rgba(255,255,255,.18); }
.card--wide { flex-direction: row; gap: 0; padding: 0; margin-bottom: 24px; overflow: hidden; }
.card--wide .card__media { width: 50%; flex-shrink: 0; margin: 0; aspect-ratio: 16 / 9; border-radius: 0; }
.card--wide .card__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 14px; padding: 36px; }
.award { text-align: left; }
.award--clickable:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }

/* ---------- Список с галочками (иконка .checks, карточки .steps) ---------- */
.ticks { display: grid; gap: 10px; }
.ticks li { display: flex; align-items: flex-start; gap: 14px; padding: 16px 18px; border-radius: 18px; background: #fff; font-size: 15px; line-height: 1.45; }
.sec--white .ticks li { background: var(--cream); }
.ticks svg { width: 24px; height: 24px; flex-shrink: 0; color: var(--red); }
.card .ticks li, .sec--white .card .ticks li { padding: 0; background: none; font-size: 14px; }
.card--dark .ticks svg { color: var(--red-on-dark); }

/* ---------- Этапы (.steps страницы кейса) ---------- */
.steps--rich li { align-items: flex-start; }
.steps__body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.steps__title { font-size: 16px; font-weight: 600; line-height: 1.35; }
.steps__body p { font-size: 14px; color: var(--ink-2); }
.steps__meta { font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.sec--white .steps li { background: var(--cream); }

/* ---------- FAQ ---------- */
.faq, .fm-accordion { display: grid; gap: 10px; }
.faq__item, .fm-accordion__item { border-radius: 18px; background: #fff; }
.sec--white .faq__item, .sec--white .fm-accordion__item { background: var(--cream); }
.faq__q, .fm-accordion__q { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 20px 22px; font-size: 16px; font-weight: 600; line-height: 1.4; }
.faq__q::-webkit-details-marker, .fm-accordion__q::-webkit-details-marker { display: none; }
.faq__q:hover { color: var(--red); }
.faq__icon { position: relative; width: 32px; height: 32px; flex-shrink: 0; border-radius: 50%; background: var(--ink); transition: transform .2s ease, background .2s ease; }
.faq__icon::before, .faq__icon::after { content: ""; position: absolute; left: 50%; top: 50%; width: 12px; height: 1.5px; background: #fff; transform: translate(-50%, -50%); }
.faq__icon::after { transform: translate(-50%, -50%) rotate(90deg); }
.faq__item[open] .faq__icon { transform: rotate(45deg); background: var(--red); }
.faq__a, .fm-accordion__a { padding: 0 22px 22px; font-size: 15px; }

/* ---------- Текст редактора ---------- */
.prose { font-size: 17px; line-height: 1.7; color: var(--ink-2); overflow-wrap: break-word; }
.prose > * + * { margin-top: 1em; }
.prose > :first-child { margin-top: 0; }
.prose h2 { margin-top: 1.6em; font-family: var(--serif); font-weight: 600; font-size: 38px; line-height: 1.05; color: var(--ink); }
.prose h3 { margin-top: 1.4em; font-family: var(--serif); font-weight: 600; font-size: 28px; line-height: 1.1; color: var(--ink); }
.prose h4 { margin-top: 1.4em; font-size: 17px; font-weight: 700; color: var(--ink); }
.prose h2 + *, .prose h3 + *, .prose h4 + * { margin-top: .6em; }
.prose ul, .prose ol { display: grid; gap: .45em; }
.prose ul > li { position: relative; padding-left: 22px; }
.prose ul > li::before { content: ""; position: absolute; left: 4px; top: .72em; width: 7px; height: 7px; border-radius: 50%; background: var(--red); }
.prose ol { counter-reset: fm-ol; }
.prose ol > li { position: relative; padding-left: 30px; counter-increment: fm-ol; }
.prose ol > li::before { content: counter(fm-ol) "."; position: absolute; left: 0; font-weight: 700; color: var(--red); }
.prose li > ul, .prose li > ol { margin-top: .45em; }
.prose a { color: var(--ink); text-decoration: underline; text-decoration-color: rgba(198,36,51,.45); text-underline-offset: 3px; }
.prose a:hover { color: var(--red); }
.prose strong, .prose b { font-weight: 700; color: var(--ink); }
.prose blockquote { margin: 1.4em 0; padding: 22px 26px; border-radius: 22px; background: #fff; font-family: var(--serif); font-size: 24px; line-height: 1.3; color: var(--ink); }
.sec--white .prose blockquote { background: var(--cream); }
.prose img { height: auto; border-radius: 22px; }
.prose figure { margin: 1.4em 0; }
.prose figcaption { margin-top: 8px; font-size: 13px; color: var(--muted); }
.prose table { display: block; width: 100%; overflow-x: auto; border-collapse: collapse; font-size: 15px; }
.prose th, .prose td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.prose th { font-weight: 700; color: var(--ink); }
.prose hr { height: 1px; margin: 2em 0; border: 0; background: var(--line); }
.prose--doc { font-size: 16px; }
.prose--doc h2 { font-size: 30px; }
.prose--doc h3 { font-size: 24px; }

/* ---------- Текст + медиа (конструктор) ---------- */
.split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 64px; align-items: center; }
.split--media-left .split__media { order: -1; }
.split--text { grid-template-columns: minmax(0, 800px); }
.split__text { display: flex; flex-direction: column; align-items: flex-start; gap: 24px; min-width: 0; }
.split__text .prose { font-size: 16px; }
.split__media { min-width: 0; }
.split__media > img, .split__img { display: block; width: 100%; height: auto; border-radius: 28px; }
.split__media .fm-video__frame { border-radius: 28px; }

/* ---------- Статья / медиа ---------- */
.article__inner { display: flex; flex-direction: column; gap: 40px; }
.article__cover { margin: 0; }
.article__cover img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 28px; }
.article__cover--natural img { aspect-ratio: auto; }
.article__video .fm-video__frame { border-radius: 28px; }
.article__audio iframe { width: 100%; border: 0; border-radius: 22px; }
.toc { display: flex; flex-direction: column; gap: 12px; padding: 22px 26px; border-radius: 22px; background: #fff; }
.toc ol { display: grid; gap: 8px; }
.toc li { font-size: 15px; font-weight: 500; line-height: 1.4; }
.toc .toc__l3 { padding-left: 18px; font-size: 14px; }
.toc a:hover { color: var(--red); }
.author { display: flex; align-items: center; gap: 18px; padding: 20px; border-radius: 22px; background: #fff; }
.author__img { width: 64px; height: 64px; flex-shrink: 0; border-radius: 50%; object-fit: cover; }
.author__name { font-weight: 700; }
.author__bio { font-size: 14px; color: var(--muted); }
.cp__cta .cp__h2 { color: #fff; }

/* ---------- Подписка (тёмная карточка, как .cta) ---------- */
.subscribe { display: flex; flex-direction: column; gap: 14px; padding: 36px; border-radius: 28px; background: var(--dark); color: #fff; }
.subscribe .eyebrow { color: var(--muted-dark); }
.subscribe .h2 { font-size: 38px; line-height: 1.05; }
.subscribe__text { font-size: 15px; color: #D6CEC6; }
.subscribe .fm-input { background: var(--dark-3); border-color: rgba(255,255,255,.14); color: #fff; }
.subscribe .fm-input::placeholder { color: #A89E95; }
.subscribe .fm-form__consent { color: var(--muted-dark); }
.subscribe .fm-form__consent a { color: #fff; }

/* ---------- Строки (читают сейчас, поиск) ---------- */
.rows { display: grid; gap: 10px; }
.row { display: flex; align-items: center; gap: 16px; padding: 14px 18px 14px 14px; border-radius: 18px; background: #fff; transition: box-shadow .15s ease; }
.sec--white .row { background: var(--cream); }
.row:hover { color: inherit; box-shadow: 0 10px 30px rgba(60,40,20,.1); }
.row__media { width: 72px; height: 72px; flex-shrink: 0; overflow: hidden; border-radius: 14px; }
.row__media img { width: 100%; height: 100%; object-fit: cover; }
.row__body { display: flex; flex: 1; flex-direction: column; gap: 4px; min-width: 0; }
.row__title { font-family: var(--serif); font-size: 22px; font-weight: 600; line-height: 1.15; }
.row__meta { font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.row__text { font-size: 14px; color: var(--ink-2); }
.row__arrow { width: 18px; height: 18px; flex-shrink: 0; }
.row:only-child { padding-left: 18px; }

/* ---------- Контакты ---------- */
.channels { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.channel { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "label round" "value round"; align-items: center; gap: 6px 16px; height: 100%; padding: 22px 24px; border-radius: 20px; background: #fff; transition: box-shadow .15s ease; }
.channel:hover { color: inherit; box-shadow: 0 10px 30px rgba(60,40,20,.1); }
.channel__label { grid-area: label; font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.channel__value { grid-area: value; font-family: var(--serif); font-size: 26px; font-weight: 600; line-height: 1.1; overflow-wrap: anywhere; }
.channel .round { grid-area: round; }
.channel--plain { grid-template-columns: minmax(0, 1fr); grid-template-areas: "label" "value"; cursor: text; user-select: text; -webkit-user-select: text; }
.channel--plain:hover { box-shadow: none; }
.form-card { display: flex; flex-direction: column; gap: 14px; padding: 36px; border-radius: 28px; background: var(--cream); min-width: 0; }
.form-card .h2 { font-size: 38px; line-height: 1.05; }
.form-card__text { margin-bottom: 8px; font-size: 15px; color: var(--ink-2); }

/* ---------- Формы темы на токенах .field / .consent вёрстки ---------- */
.fm-form { display: flex; flex-direction: column; gap: 14px; }
.fm-form__field { display: flex; flex-direction: column; gap: 6px; }
.fm-form__field > span { font-size: 13px; font-weight: 600; }
.fm-input, .fm-textarea, .fm-filters select { width: 100%; height: 52px; padding: 0 16px; border: 1px solid var(--line); border-radius: 14px; background: #fff; color: inherit; font: inherit; }
textarea.fm-input, .fm-textarea { height: auto; min-height: 120px; padding: 14px 16px; }
select.fm-input, .fm-filters select { appearance: none; -webkit-appearance: none; padding-right: 44px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6' fill='none' stroke='%231C1A19' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 16px center; background-size: 18px; cursor: pointer; }
.fm-input:focus, .fm-textarea:focus, .fm-filters select:focus { outline: 2px solid var(--red); outline-offset: 0; border-color: transparent; }
.sec--white .fm-input, .form-card .fm-input { background: #fff; }
.fm-form__consents { display: grid; gap: 8px; margin: 4px 0 6px; }
.fm-form__consent { display: flex; align-items: flex-start; gap: 10px; font-size: 12px; line-height: 1.5; color: var(--muted); }
.fm-form__consent input { width: 18px; height: 18px; margin: 1px 0 0; flex-shrink: 0; accent-color: var(--red); }
.fm-form__consent a { text-decoration: underline; }
.fm-form > .btn { align-self: flex-start; }
.fm-form__inline-row { display: flex; gap: 10px; }
.fm-form__inline-row .fm-input { flex: 1; min-width: 0; }
.fm-form--inline { flex-direction: row; }
.fm-form--inline .fm-input { flex: 1; min-width: 0; }
.fm-form__status { margin: 0; padding: 10px 14px; border-radius: 12px; font-size: 13px; line-height: 1.45; }
.fm-form__status[hidden] { display: none; }
.fm-form__status.is-error { background: #FBE9EA; color: #9B1C28; }
.fm-form__status.is-success { background: var(--green-bg); color: var(--green); }
.fm-form.is-loading [type="submit"] { opacity: .7; cursor: progress; }
.fm-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.fm-field-error { font-size: 12px; color: var(--red); }

/* ---------- Фильтры, табы, пагинация ---------- */
.fm-filters { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 32px; }
.fm-filters__field { display: flex; flex-direction: column; gap: 6px; min-width: 240px; }
.fm-filters__label { font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.fm-filters select { height: 48px; border-radius: 999px; padding-left: 20px; font-size: 14px; font-weight: 600; }
.sec--white .fm-filters select { background-color: var(--cream); }
.chips-nav { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 32px; }
.fm-tabs__btn { padding: 10px 18px; border: 1px solid rgba(28,26,25,.22); border-radius: 999px; background: transparent; color: var(--ink); font-size: 14px; font-weight: 600; cursor: pointer; transition: background .15s ease, border-color .15s ease; }
.fm-tabs__btn:hover { border-color: var(--ink); }
.fm-tabs__btn.is-active, .fm-tabs__btn[aria-selected="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.fm-tabs__panel[hidden] { display: none; }
.tabs-h { margin: 48px 0 20px; }
.fm-tabs__panel > .tabs-h:first-child { margin-top: 0; }
.pager { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 40px; }
.pager .page-numbers { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; height: 44px; padding: 0 14px; border-radius: 999px; background: #fff; font-size: 14px; font-weight: 600; }
.sec--white .pager .page-numbers { background: var(--cream); }
.pager .current { background: var(--ink); color: #fff; }
.pager .dots { background: none; }
.empty { padding: 32px; border-radius: 22px; background: #fff; font-size: 15px; color: var(--muted); text-align: center; }
.sec--white .empty { background: var(--cream); }
.empty-state { display: flex; flex-direction: column; align-items: center; gap: 20px; }
.empty-state .empty { width: 100%; }

/* ---------- Отзывы ---------- */
.reviews { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; align-items: start; }
.reviews.reviews--single { grid-template-columns: minmax(0, 1fr); margin: 0 0 32px; }
.archive__group + .archive__group { margin-top: 64px; }
.review { display: flex; flex-direction: column; gap: 16px; min-width: 0; padding: 22px; border-radius: 24px; background: #fff; }
.sec--white .review { background: var(--cream); }
.review__video .fm-video__frame, .review__shot img { border-radius: 16px; }
.review__video .fm-video--portrait { max-width: none; }
.review__shot img { width: 100%; height: auto; }
.review__quote { margin: 0; font-size: 15px; line-height: 1.6; color: var(--ink-2); }
.review__author { display: flex; align-items: center; gap: 12px; }
.review__photo { width: 48px; height: 48px; flex-shrink: 0; overflow: hidden; border-radius: 50%; }
.review__photo img { width: 100%; height: 100%; object-fit: cover; }
.review__meta { display: flex; flex-direction: column; gap: 2px; font-size: 13px; color: var(--muted); }
.review__meta strong { font-size: 15px; color: var(--ink); }

/* ---------- Галерея ---------- */
.gallery__item { display: block; flex: 1; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 20px; }
.gallery__item img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Квиз ---------- */
.fm-quiz { display: flex; flex-direction: column; gap: 18px; width: 100%; max-width: none; margin: 0; padding: 40px; border-radius: 28px; background: #fff; }
.sec--white .fm-quiz { background: var(--cream); }
.fm-quiz__intro { color: var(--ink-2); }
.fm-quiz__progress-wrap { display: flex; flex-direction: column; gap: 8px; }
.fm-quiz__counter { font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.fm-quiz__progress { height: 6px; overflow: hidden; border-radius: 999px; background: var(--sand-2); }
.fm-quiz__progress-bar { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--red); transition: width .3s ease; }
.fm-quiz__step { display: grid; gap: 10px; min-width: 0; margin: 0; padding: 0; border: 0; }
.fm-quiz__step[hidden], .fm-quiz__final[hidden], .fm-quiz__nav [hidden] { display: none; }
.fm-quiz__step legend { margin-bottom: 12px; padding: 0; font-family: var(--serif); font-size: 30px; font-weight: 600; line-height: 1.1; }
.fm-quiz__option { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--cream); font-size: 15px; font-weight: 500; cursor: pointer; transition: border-color .15s ease; }
.sec--white .fm-quiz__option { background: #fff; }
.fm-quiz__option:hover { border-color: var(--ink); }
.fm-quiz__option input { width: 18px; height: 18px; margin: 0; flex-shrink: 0; accent-color: var(--red); }
.fm-quiz__option:has(input:checked) { border-color: var(--red); box-shadow: inset 0 0 0 1px var(--red); background: #fff; }
.fm-quiz__other { display: grid; gap: 6px; }
.fm-quiz__other[hidden], .fm-quiz__other-error[hidden] { display: none; }
.fm-quiz__other .fm-input { width: 100%; padding: 14px 18px; border: 1px solid var(--line); border-radius: 16px; background: #fff; font: inherit; font-size: 15px; color: var(--ink); }
.fm-quiz__other .fm-input:focus { outline: none; border-color: var(--red); box-shadow: inset 0 0 0 1px var(--red); }
.fm-quiz__other-error { font-size: 13px; color: var(--red); }
.fm-quiz__final { display: flex; flex-direction: column; gap: 14px; }
.fm-quiz__final-title { font-family: var(--serif); font-size: 30px; font-weight: 600; line-height: 1.1; }
.fm-quiz__final-text { color: var(--ink-2); }
.fm-quiz__nav { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- Плеер темы (fm_render_video) ---------- */
.fm-video { --fm-video-ratio: 16 / 9; position: relative; width: 100%; max-width: 100%; }
.fm-video--portrait { --fm-video-ratio: 9 / 16; max-width: 360px; margin-inline: auto; }
.fm-video__facade { display: block; width: 100%; margin: 0; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.fm-video__frame { position: relative; display: block; width: 100%; aspect-ratio: var(--fm-video-ratio); overflow: hidden; border-radius: 22px; background: var(--dark); }
.fm-video__poster { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; }
.fm-video__poster--empty { background: var(--dark); }
.fm-video__bracket { display: none; }
.fm-video__play { position: absolute; left: 50%; top: 50%; z-index: 2; width: 64px; height: 64px; margin: -32px 0 0 -32px; border-radius: 50%; background: var(--red); box-shadow: 0 12px 28px rgba(198,36,51,.28); transition: transform .15s ease; }
.fm-video__play::before { content: ""; position: absolute; left: 50%; top: 50%; transform: translate(-35%, -50%); border-style: solid; border-width: 10px 0 10px 16px; border-color: transparent transparent transparent #fff; }
.fm-video__facade:hover .fm-video__play { transform: scale(1.05); }
.fm-video__duration { position: absolute; right: 12px; bottom: 12px; z-index: 2; padding: 4px 10px; border-radius: 999px; background: rgba(30,26,24,.8); color: #fff; font-size: 12px; font-weight: 600; }
.fm-video__label { display: block; margin-top: 12px; font-size: 15px; font-weight: 600; }
.fm-video__player { position: relative; width: 100%; aspect-ratio: var(--fm-video-ratio); overflow: hidden; border-radius: 22px; background: #000; }
.fm-video__player[hidden], .fm-video.is-playing .fm-video__facade[hidden] { display: none !important; }
.fm-video__el { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }

/* ---------- Лайтбокс (gallery.js) ---------- */
.fm-lightbox { position: fixed; inset: 0; z-index: 300; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 64px 80px 20px; background: rgba(20,17,16,.94); }
.fm-lightbox[hidden] { display: none !important; }
.fm-lightbox__stage { display: flex; flex: 1 1 auto; flex-direction: column; align-items: center; justify-content: center; gap: 12px; width: 100%; min-height: 0; margin: 0; touch-action: pan-y; }
.fm-lightbox__img { display: block; width: auto; height: auto; max-width: min(100%, 1200px); max-height: calc(100vh - 150px); max-height: calc(100dvh - 150px); object-fit: contain; border-radius: 16px; transition: opacity .2s ease; }
.fm-lightbox--thumbs .fm-lightbox__img { max-height: calc(100vh - 230px); max-height: calc(100dvh - 230px); }
.fm-lightbox.is-loading .fm-lightbox__img { opacity: .45; }
.fm-lightbox__caption { max-width: 900px; margin: 0; font-size: 13px; line-height: 1.4; color: rgba(255,255,255,.82); text-align: center; }
.fm-lightbox__caption[hidden], .fm-lightbox__thumbs[hidden], .fm-lightbox__counter[hidden], .fm-lightbox__nav[hidden] { display: none; }
.fm-lightbox__close { position: absolute; top: 16px; right: 16px; z-index: 2; width: 44px; height: 44px; border: 0; border-radius: 50%; background: #fff; color: var(--ink); font-size: 24px; line-height: 1; cursor: pointer; }
.fm-lightbox__nav { position: absolute; top: 50%; z-index: 2; width: 52px; height: 52px; border: 0; border-radius: 50%; background: rgba(255,255,255,.16); color: #fff; font-size: 28px; line-height: 1; transform: translateY(-50%); cursor: pointer; }
.fm-lightbox__nav:hover { background: rgba(255,255,255,.26); }
.fm-lightbox__prev { left: 16px; }
.fm-lightbox__next { right: 16px; }
.fm-lightbox__counter { position: absolute; top: 28px; left: 24px; margin: 0; font-size: 14px; font-weight: 600; color: rgba(255,255,255,.85); }
.fm-lightbox__thumbs { display: flex; flex: 0 0 auto; gap: 6px; max-width: 100%; padding: 3px; overflow-x: auto; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.3) transparent; }
.fm-lightbox__thumb { flex: 0 0 72px; height: 54px; padding: 0; overflow: hidden; border: 0; border-radius: 10px; background: rgba(255,255,255,.08); opacity: .55; cursor: pointer; transition: opacity .15s ease; }
.fm-lightbox__thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.fm-lightbox__thumb:hover { opacity: .9; }
.fm-lightbox__thumb.is-active { opacity: 1; box-shadow: 0 0 0 2px var(--red); }
.fm-lightbox button:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
body.fm-lightbox-open { overflow: hidden; }

/* ---------- Галерея мероприятия (template-parts/media/event-gallery.php) ---------- */
.egal { display: flex; flex-direction: column; gap: 12px; }
.egal__stage { position: relative; aspect-ratio: 3 / 2; overflow: hidden; border-radius: 28px; background: var(--sand-2); touch-action: pan-y; }
.egal__open { display: block; width: 100%; height: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.egal__img { display: block; width: 100%; height: 100%; max-width: none; object-fit: contain; transition: opacity .2s ease; }
.egal__img.is-loading { opacity: .45; }
.egal__nav { position: absolute; top: 50%; z-index: 2; display: grid; place-items: center; width: 48px; height: 48px; margin-top: -24px; padding: 0; border: 0; border-radius: 50%; background: rgba(255,255,255,.92); color: var(--ink); box-shadow: 0 6px 18px rgba(30,26,24,.18); cursor: pointer; }
.egal__nav svg { width: 20px; height: 20px; }
.egal__nav:hover { background: #fff; }
.egal__prev { left: 14px; }
.egal__next { right: 14px; }
.egal__full { position: absolute; left: 14px; bottom: 14px; z-index: 2; display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border: 0; border-radius: 999px; background: #fff; color: var(--ink); font: 600 13px/1 var(--sans); cursor: pointer; }
.egal__full svg { width: 14px; height: 14px; }
.egal__count { position: absolute; right: 14px; bottom: 14px; z-index: 2; margin: 0; padding: 7px 12px; border-radius: 999px; background: rgba(30,26,24,.72); color: #fff; font: 600 13px/1 var(--sans); pointer-events: none; }
.egal__thumbs { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 3px; list-style: none; }
.egal__ti { min-width: 0; margin: 0; }
.egal__ti::before { content: none; }
.egal__thumb { position: relative; display: block; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 14px; background: var(--sand-2); }
.egal__thumb img { display: block; width: 100%; height: 100%; object-fit: cover; transition: opacity .15s ease; }
.egal__thumb:hover img { opacity: .85; }
.egal__thumb.is-active { box-shadow: 0 0 0 3px var(--red); }
.egal__more { position: absolute; inset: 0; display: grid; place-items: center; padding: 4px 6px; background: rgba(31,58,107,.82); color: #fff; font: 700 13px/1.15 var(--sans); text-align: center; }
.egal__more--m { display: none; }
.egal__open:focus-visible, .egal__nav:focus-visible, .egal__full:focus-visible, .egal__thumb:focus-visible { outline: 3px solid var(--navy); outline-offset: 3px; }
.egal__open:focus-visible { outline-offset: -3px; }
@media (prefers-reduced-motion: reduce) {
  .fm-lightbox__img, .fm-lightbox__thumb, .egal__img, .egal__thumb img { transition: none; }
}

/* ---------- Запасные стили редких блоков конструктора, уроков и демо-страницы ----------
   Те же токены; основные шаблоны на них не опираются. */
.fm-eyebrow, .fm-kicker { font-size: 12px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--red); }
.fm-script { font-family: var(--hand); font-size: 28px; line-height: 1.05; color: var(--ink-2); }
.fm-list { display: grid; gap: 10px; }
.fm-list > li { position: relative; padding: 16px 18px 16px 44px; border-radius: 18px; background: #fff; font-size: 15px; }
.fm-list > li::before { content: ""; position: absolute; left: 20px; top: 24px; width: 8px; height: 8px; border-radius: 50%; background: var(--red); }
.sec--white .fm-list > li { background: var(--cream); }
.fm-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.fm-cards--cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fm-card { display: flex; flex-direction: column; gap: 12px; padding: 26px; border-radius: 24px; background: #fff; }
.sec--white .fm-card { background: var(--cream); }
.fm-card__link { display: flex; flex-direction: column; gap: 12px; }
.fm-card__title { font-family: var(--serif); font-size: 24px; font-weight: 600; line-height: 1.12; }
.fm-card__excerpt { font-size: 14px; color: var(--ink-2); }
.fm-card__meta { font-size: 13px; color: var(--muted); }
.fm-card__media, .fm-card__img { width: 100%; height: auto; border-radius: 16px; }
.fm-cta-band { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px 48px; padding: 48px 56px; border-radius: 32px; background: var(--dark); color: #fff; }
.fm-cta-band__title { font-family: var(--serif); font-size: 44px; font-weight: 600; line-height: 1.02; }
.fm-cta-band__text { margin-top: 12px; color: #D6CEC6; }
.fm-stats { display: flex; flex-wrap: wrap; gap: 8px; }
.fm-stat-badge { display: flex; flex-direction: column; gap: 4px; padding: 14px 18px; border-radius: 16px; background: #fff; }
.fm-stat { font-family: var(--serif); font-size: 42px; font-weight: 600; line-height: 1; }
.fm-stat-badge__label { font-size: 13px; color: var(--muted); }
.fm-timeline { display: grid; gap: 10px; }
.fm-timeline__item { display: flex; gap: 16px; padding: 18px; border-radius: 18px; background: #fff; }
.fm-step-num, .fm-timeline__num { font-family: var(--serif); font-size: 24px; font-weight: 700; color: var(--red); }
.fm-timeline__title { font-size: 16px; font-weight: 600; }
.fm-timeline__text { font-size: 14px; color: var(--ink-2); }
.fm-gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.fm-gallery img { width: 100%; height: auto; border-radius: 20px; }
.fm-lesson-list { display: grid; gap: 10px; }
.fm-lesson-list__link { display: flex; align-items: center; gap: 16px; padding: 16px 20px; border-radius: 18px; background: var(--cream); }
.fm-lesson-list__num { font-family: var(--serif); font-size: 24px; font-weight: 700; color: var(--red); }
.fm-lesson-list__body { display: flex; flex: 1; flex-direction: column; gap: 2px; }
.fm-lesson-list__title { font-weight: 600; }
.fm-lesson-list__mod, .fm-lesson-list__dur, .fm-lesson-list__state { font-size: 13px; color: var(--muted); }
.fm-lesson-player iframe, .fm-lesson-player video { width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 22px; background: #000; }
.fm-lesson-locked__panel, .fm-access-invalid__box { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; padding: 32px; border-radius: 28px; background: var(--cream); }
.fm-lesson-materials, .fm-lesson-nav { margin-top: 32px; }
.fm-lesson-nav { display: flex; justify-content: space-between; gap: 12px; }
.fm-section { padding: 24px 0 var(--section); }
.fm-demo-block { margin-top: 48px; display: flex; flex-direction: column; gap: 16px; }
.fm-demo-block h2 { font-family: var(--serif); font-size: 38px; font-weight: 600; line-height: 1.05; }
.fm-demo-row { display: flex; flex-wrap: wrap; gap: 12px; }
.bg-linen { background: var(--sand); }
.fm-section-pad { padding: 32px; border-radius: 28px; }

/* ==========================================================================
   TABLET 768–1199
   ========================================================================== */
@media (max-width: 1199px) {
  .ph__title { font-size: 60px; }
  .ph--hero .ph__title { font-size: 76px; }
  .ph--media .ph__grid { grid-template-columns: minmax(0, 1fr) 400px; gap: 32px; }
  .ph__media .chip-money { left: -24px; }
  .grid:not(.grid--2), .fm-cards, .reviews { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--top { gap: 40px; }
  .split { gap: 40px; }
  .card__title--lg { font-size: 32px; }
}

@media (max-width: 1023px) {
  .ph--media .ph__grid { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .ph__media { width: 100%; max-width: 560px; }
  .ph__media--portrait { max-width: 480px; margin: 0 auto; }
  .grid--2, .grid--top, .split, .niches__cards, .fm-cards--cols-2 { grid-template-columns: minmax(0, 1fr); }
  .split--media-left .split__media { order: 0; }
  .card--wide { flex-direction: column; }
  .card--wide .card__media { width: 100%; }
}

/* ==========================================================================
   MOBILE <768
   ========================================================================== */
@media (max-width: 767px) {
  .ph { padding-top: 20px; }
  .ph .crumbs { margin-bottom: 20px; }
  .ph__text { gap: 18px; }
  .ph__title, .ph--hero .ph__title { font-size: 44px; line-height: .98; }
  .ph--hero .ph__title { font-size: 56px; line-height: .92; }
  .ph--article .ph__title, .ph--doc .ph__title { font-size: 38px; }
  .ph__lead { font-size: 16px; }
  .ph__actions { flex-direction: column; align-items: stretch; gap: 12px; width: 100%; }
  .ph__actions .btn { width: 100%; }
  .ph__media > img, .ph__img, .ph__media .fm-video__frame { border-radius: 28px; }
  .ph__media .chip-money { left: 12px; right: 12px; bottom: 12px; }
  .ph__price .money { font-size: 40px; }
  .ph--solo { padding-top: 40px; }
  .ph .fm-form--inline { flex-direction: column; }
  .fm-form--inline .fm-input, .fm-form__inline-row .fm-input { flex: 0 0 auto; }

  .sec--first { padding-top: 32px; }
  .sec--white.sec--first { margin-top: 32px; }
  .sec__head { flex-direction: column; align-items: flex-start; gap: 16px; margin-bottom: 24px; }
  .sec__intro { gap: 14px; }
  .sec__lead { font-size: 14px; }
  .sec__title { margin-bottom: 24px; }
  .h3 { font-size: 26px; }

  .grid, .grid:not(.grid--2), .grid--2, .fm-cards, .fm-gallery, .reviews { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .grid--top { gap: 40px; }
  .niches__cards { gap: 14px; }
  .card { padding: 20px; border-radius: 22px; gap: 10px; }
  .card__media { margin: -20px -20px 4px; border-radius: 22px 22px 0 0; }
  .card__title { font-size: 22px; }
  .card__title--lg { font-size: 28px; }
  .card__price { font-size: 38px; }
  .card--wide { padding: 0; }
  .card--wide .card__media { margin: 0; border-radius: 0; }
  .card--wide .card__body { padding: 20px; }
  .ticks li { padding: 14px 16px; font-size: 14px; }
  .ticks svg { width: 22px; height: 22px; }
  .split { gap: 28px; }
  .split__media > img, .split__img { border-radius: 24px; }

  .faq__q, .fm-accordion__q { padding: 16px 18px; font-size: 15px; }
  .faq__a, .fm-accordion__a { padding: 0 18px 18px; font-size: 14px; }
  .prose { font-size: 16px; }
  .prose h2, .prose--doc h2 { font-size: 30px; }
  .prose h3, .prose--doc h3 { font-size: 24px; }
  .prose blockquote { padding: 18px 20px; font-size: 21px; }

  .article__inner { gap: 32px; }
  .article__cover img, .article__video .fm-video__frame { border-radius: 24px; }
  .toc { padding: 18px 20px; }
  .subscribe { padding: 26px 22px; border-radius: 26px; }
  .subscribe .h2, .form-card .h2 { font-size: 30px; }
  .fm-form__inline-row { flex-direction: column; }
  .fm-form > .btn, .fm-form__inline-row .btn { width: 100%; align-self: stretch; }
  .form-card { padding: 24px 20px; border-radius: 26px; }
  .channels { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .channel { padding: 18px 20px; }
  .channel__value { font-size: 22px; }
  .row__title { font-size: 20px; }
  .row__media { width: 60px; height: 60px; }

  .fm-filters__field { flex: 1 1 100%; min-width: 0; }
  .chips-nav { flex-wrap: nowrap; overflow-x: auto; margin-right: calc(var(--gutter) * -1); padding-right: var(--gutter); scrollbar-width: none; }
  .chips-nav::-webkit-scrollbar { display: none; }
  .fm-tabs__btn { flex-shrink: 0; padding: 9px 16px; font-size: 13px; }
  .tabs-h { margin: 32px 0 16px; }

  .fm-quiz { padding: 24px 20px; border-radius: 26px; }
  .fm-quiz__step legend, .fm-quiz__final-title { font-size: 24px; }
  .fm-quiz__nav .btn { flex: 1; }
  .review { padding: 18px; border-radius: 22px; }
  .fm-cta-band { padding: 28px 22px; border-radius: 28px; }
  .fm-cta-band__title { font-size: 32px; }
  .fm-lightbox { padding: 60px 12px 14px; }
  .fm-lightbox__nav { width: 40px; height: 40px; font-size: 24px; }
  .fm-lightbox__prev { left: 8px; }
  .fm-lightbox__next { right: 8px; }
  .fm-lightbox__counter { top: 26px; left: 16px; }
  .fm-lightbox__thumb { flex-basis: 56px; height: 42px; }
  .egal { gap: 10px; }
  .egal__stage { aspect-ratio: 4 / 3; border-radius: 22px; }
  .egal__nav, .egal__full { display: none; }
  .egal__count { right: 10px; bottom: 10px; }
  .egal__thumbs { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
  .egal__ti--d { display: none; }
  .egal__thumb { border-radius: 12px; }
  .egal__more--d { display: none; }
  .egal__more--m { display: grid; font-size: 12px; }
}

/* v0.33.23 «Обо мне»: фото во всю ширину, как первый экран главной, без кадрирования */
.ph--wide { position: relative; padding-top: 0; overflow: hidden; }
.ph--wide .ph__media--full { position: static; }
.ph__wide-pic, .ph__wide-img { display: block; width: 100%; height: auto; border-radius: 0; }
@media (min-width: 1024px) {
  .ph--wide { aspect-ratio: 2048 / 1336; }
  .ph--wide .ph__media--full { position: absolute; inset: 0; z-index: 0; max-width: none; }
  .ph--wide .container { position: static; height: 100%; display: flex; flex-direction: column; padding-top: 24px; }
  .ph--wide.ph--media .ph__grid { grid-template-columns: minmax(0, 1fr); flex: 1; align-content: center; }
  .ph--wide .ph__text { max-width: 560px; }
  .ph--wide .crumbs, .ph--wide .ph__text { position: relative; z-index: 1; }
  .ph--wide .ph__media--full .chip-name { position: absolute; top: 9%; right: 3%; bottom: auto; }
}
@media (max-width: 1023px) {
  .ph--wide .ph__media--full { width: 100vw; max-width: none; margin-left: calc(50% - 50vw); }
  .ph--wide .ph__media--full .chip-name { display: none; }
}
