/* Единая система оформления Marketing Master (решение владельца, 2026-10-20).
   Файл подключён последним, после trainer.css, и перекрывает прежние правила порядком: те же селекторы, тот же вес.
   Откат всей системы: убрать ссылку на этот файл из pages/templates/pages/base.html.

   Один шрифт: IBM Plex Sans, начертания 400 и 600. Моноширинный остаётся для кода, пиксельный — для пиксельных окон.
   Четыре размера: 28 / 20 / 16 / 14, на компьютере (от 900 px) 36 / 24 / 18 / 14.
   Два цвета текста: основной и приглушённый. Янтарь только у главной кнопки, полосы прогресса и «ты здесь».
   Зелёный и красный только в «верно / неверно». Отступы шкалой 4 · 8 · 12 · 16 · 24 · 32, поля экрана 16. */

/* 1. Шрифт, размеры и цвета текста как переменные ---------------------------------------------------- */
:root {
  --font-display: var(--font-sans);
  --font-serif: var(--font-sans);
  --ink-2: var(--ink-3);                 /* на листе два цвета текста: основной и приглушённый */
  --night-ink-3: var(--night-ink-2);     /* на ночи тоже два */
  --space-5: 16px;                       /* поля экрана 16 вместо 20 */
  --fs-title: 28px; --lh-title: 34px;
  --fs-section: 20px; --lh-section: 28px;
  --fs-text: 16px; --lh-text: 24px; --lh-prose: 26px;
  --fs-note: 14px; --lh-note: 20px;
}
@media (min-width: 900px) {
  :root {
    --fs-title: 36px; --lh-title: 44px;
    --fs-section: 24px; --lh-section: 32px;
    --fs-text: 18px; --lh-text: 28px; --lh-prose: 30px;
  }
}
body { font-size: var(--fs-text); line-height: var(--lh-text); font-weight: 400; }
strong, b { font-weight: 600; }
.mono, .sheet-head__note, .phone-bar__mark, .lessons__num, .trainer-step__num, .lesson-steps__num, .mm-calc__input, .mm-number__input,
.mm-table td.mm-num, .mm-table .mm-key, .mm-disclosure__count, .mm-bar, .mm-steps__num, .toc-steps__item::before,
.reading__lessons li[aria-current="page"] a::before, .mm-sort__ordered .mm-sort__item::before, .deeper__summary::before {
  font-family: var(--font-sans);
}
.mono, .cash__value, .lesson-row__num, .lesson-row__meta, .mm-calc__input, .mm-number__input, .mm-table td.mm-num { font-variant-numeric: tabular-nums; }

/* 2. Цвет: цвет текста один, ссылки им же и подчёркнуты ------------------------------------------------- */
.mm-night { --mm-link: var(--night-ink); --mm-link-hover: #ffffff; --mm-here: var(--amber-text); }
.mm-paper { --mm-link: var(--ink); --mm-link-hover: var(--ink); --mm-here: var(--ink); }
.kicker--amber { color: var(--mm-text-2); }
.note a, .preview-note a, .module-about a, .info__text a, .facts-list a, .prose a:not(.mm-term), .answer-list a, .submit-steps a, .profile a {
  text-decoration: underline; text-decoration-color: var(--mm-control); text-underline-offset: 3px;
}
.note a:hover, .preview-note a:hover { text-decoration-color: currentColor; }
.hints__item > summary { color: var(--ink); text-decoration: underline; text-decoration-color: var(--paper-control); text-underline-offset: 3px; }
.reading__next-title, .requirements__list span a { color: var(--ink) !important; }

/* 3. Четыре размера ---------------------------------------------------------------------------------- */
/* название страницы */
.course-hero__title, .cover__title, .reading__title, .sheet-header__title {
  font-family: var(--font-sans); font-weight: 600; font-size: var(--fs-title); line-height: var(--lh-title); letter-spacing: 0; text-wrap: balance;
}
/* заголовок раздела */
.section-title, .sheet-title, .sheet-title--big, .aside-block__title, .panel__title, .prose h1, .prose h2, .terms__title {
  font-family: var(--font-sans) !important; font-weight: 600; font-size: var(--fs-section) !important; line-height: var(--lh-section); letter-spacing: 0;
}
/* текст */
.back-link, .cover__lead, .reading__sheet, .mm-chat__bubble, .mm-action, .module-about, .info__text, .course-hero__lead, .night-page__lead,
.panel, .aside-block, .env__lead, .login__lead { font-size: var(--fs-text); line-height: var(--lh-text); }
.prose { font-size: var(--fs-text); line-height: var(--lh-prose); }
.prose h3 { font-size: var(--fs-text); line-height: var(--lh-text); font-weight: 600; margin-top: 24px; }
.prose h4, .prose h5, .prose h6 { font-size: var(--fs-note); line-height: var(--lh-note); font-weight: 600; margin-top: 16px; }
/* пояснения */
.kicker, .reading__kicker, .reading__meta, .cover__subtitle, .note, .note--body, .cash, .cash__label, .mode-switch__label, .mode-switch__btn,
.lesson-steps__text, .lesson-steps__num, .mm-action__note, .mm-chat__name, .badge, .mm-disclosure__hint, .sheet-head__note, .mm-map__note,
.mm-status, .preview-note, .tabbar a, .mm-disclosure__count, .game-strip dt, .postcard__kicker, .answer-field__kicker, .mm-action__kicker {
  font-size: var(--fs-note); line-height: var(--lh-note);
}
.tabbar a { line-height: 18px; }
.mm-chat__name, .game-strip dt, .postcard__kicker, .answer-field__kicker, .mm-action__kicker { text-transform: none; letter-spacing: 0; }
.mm-chat__name { color: var(--ink-3); font-weight: 600; }
.mm-action__kicker, .answer-field__kicker { color: var(--ink-3); }
.cash__value { font-size: var(--fs-text); font-weight: 600; color: var(--mm-text, var(--ink)); }

/* 4. Кнопки: один шрифт и размер ------------------------------------------------------------------------- */
.mm-btn { font-size: var(--fs-text); line-height: var(--lh-text); font-weight: 600; }
.mm-btn--primary { min-height: 56px; padding: 0 24px; }
.mm-btn--continue { min-height: 64px; padding: 12px 16px; gap: 2px; }
.mm-btn__title { font-size: var(--fs-text); line-height: var(--lh-text); font-weight: 600; }
.mm-btn__sub { font-size: var(--fs-note); line-height: var(--lh-note); font-weight: 400; color: var(--on-amber); }
.site-header__telegram { font-size: var(--fs-note); }

/* 5. Заметка о просмотре: тихая, без цветной заливки ---------------------------------------------------- */
.preview-note { margin: 0; padding: 4px 0 4px 12px; border: 0; border-left: 2px solid var(--mm-control); background: transparent; color: var(--mm-text-3); }
.mm-night .preview-note { background: var(--night-veil); }
.mm-night .mm-paper .preview-note { background: transparent; }

/* 6. Шапка и нижняя панель --------------------------------------------------------------------------- */
.site-logo span { font-family: var(--font-sans); font-size: var(--fs-section); line-height: var(--lh-section); font-weight: 600; letter-spacing: 0; }
.site-nav a { font-size: var(--fs-text); }
.site-nav a[aria-current="page"] { font-weight: 600; }
.site-header__profile, .site-header__streak { font-size: var(--fs-note); line-height: var(--lh-note); }
.phone-bar { justify-content: flex-start; }

/* 7. Строки-ссылки, строки «название — значение», блоки-пояснения ---------------------------------------- */
.info { display: flex; flex-direction: column; gap: 8px; padding-top: 32px; padding-bottom: 0; }
.info:last-of-type { padding-bottom: 32px; }
.info__text { margin: 0; color: var(--mm-text-2); }
.facts-list { margin: 4px 0 0; border-top: 1px solid var(--mm-line); }
.facts-list > div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--mm-line); }
.facts-list dt { color: var(--mm-text-2); }
.facts-list dd { margin: 0; text-align: right; font-weight: 600; color: var(--mm-text); }

.rows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--mm-line); }
.rows li { border-bottom: 1px solid var(--mm-line); }
.rows a { display: grid; grid-template-columns: minmax(0, 1fr) 16px; column-gap: 12px; align-items: center; padding: 12px 0; text-decoration: none; }
.rows__title { grid-column: 1; font-size: var(--fs-text); line-height: var(--lh-text); color: var(--mm-text); }
.rows__note { grid-column: 1; font-size: var(--fs-note); line-height: var(--lh-note); color: var(--mm-text-3); }
.rows a::after { content: ""; grid-column: 2; grid-row: 1 / span 2; width: 8px; height: 8px; justify-self: end; border-top: 2px solid var(--mm-text-3); border-right: 2px solid var(--mm-text-3); transform: rotate(45deg); }
.rows a.is-download::after { content: none; }
.rows a.is-download .mm-icon { grid-column: 2; grid-row: 1 / span 2; width: 16px; height: 16px; color: var(--mm-text-3); }
.rows a:hover .rows__title { text-decoration: underline; }
.rows__done { display: inline-flex; align-items: center; gap: 6px; }
.rows__done .mm-icon { width: 12px; height: 12px; }
.rows__group { padding: 12px 0 0; }
.rows__group > .rows__title, .rows__group > .rows__note { display: block; margin: 0; }
.rows__group > .rows { margin: 8px 0 0 16px; }
.rows__group > .rows > li:last-child { border-bottom: 0; }
.requirements__blocked { margin-top: 8px; }

/* 8. «Мой курс» ------------------------------------------------------------------------------------- */
.course-hero__text { gap: 8px; }
.course-hero__text .mm-btn--continue { margin-top: 8px; }
.progress { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.progress__text { font-size: var(--fs-note); line-height: var(--lh-note); color: var(--night-ink-2); }
.progress__bar { display: block; width: 100%; height: 4px; margin: 0; border: 0; appearance: none; -webkit-appearance: none; background: var(--night-edge); color: var(--amber); }
.progress__bar::-webkit-progress-bar { background: var(--night-edge); }
.progress__bar::-webkit-progress-value { background: var(--amber); }
.progress__bar::-moz-progress-bar { background: var(--amber); }
.progress .note { margin: 0; color: var(--night-ink-3); }

.course-map__head { margin-bottom: 8px; }
.course-map__count { margin: 0; font-size: var(--fs-note); line-height: var(--lh-note); color: var(--night-ink-3); }
.course-map__row.is-closed .mm-map__note { color: var(--night-ink-2); }
.mm-map__note { display: flex; align-items: center; gap: 4px; }
.mm-map__note .mm-icon { margin-right: 0; }

/* 9. Страница модуля --------------------------------------------------------------------------------- */
.cover__lead { color: var(--night-ink-2); }
.cover__inner { gap: 8px; }
.module-col { display: contents; }
.preview-note, .closed-event { order: 0; }
.next-step { order: 1; }
.module-about { order: 2; }
.module-lessons { order: 3; }
.module-close { order: 4; }
.module-more { order: 5; }
.module-game { order: 6; }
.next-step { display: flex; flex-direction: column; gap: 12px; }
.next-step .note { margin: 0; }
.module-about { display: flex; flex-direction: column; gap: 12px; }
.module-about p { margin: 0; }
.module-lessons, .module-close, .module-more, .module-game { display: flex; flex-direction: column; gap: 8px; }
.module-sheet .note { margin: 0; }
.sheet-head { align-items: baseline; }
.sheet-head__note { color: var(--ink-3); }
.module-terms { margin-top: -8px; border-top: 0; }
.module-terms > summary { padding: 12px 0; font-size: var(--fs-text); line-height: var(--lh-text); color: var(--mm-text); }
.module-terms > summary::after { content: ""; flex: none; width: 8px; height: 8px; margin: -4px 4px 0 8px; border-right: 2px solid var(--mm-text-3); border-bottom: 2px solid var(--mm-text-3); transform: rotate(45deg); }
.module-terms[open] > summary::after { margin-top: 4px; transform: rotate(-135deg); }
.module-terms > summary > span:first-child { flex: 1; }
.module-terms .mm-disclosure__count { color: var(--mm-text-3); }
.module-terms .mm-disclosure__body { padding: 8px 0 16px; }

.lesson-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--paper-line); }
.lesson-row { position: relative; border-bottom: 1px solid var(--paper-line); }
.lesson-row a { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; column-gap: 8px; align-items: baseline; padding: 12px 0; color: var(--ink) !important; text-decoration: none; }
.lesson-row a:hover .lesson-row__title { text-decoration: underline; }
.lesson-row__num { color: var(--ink); }
.lesson-row__title { font-size: var(--fs-text); line-height: var(--lh-text); }
.lesson-row__meta { white-space: nowrap; display: inline-flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 4px 8px; font-size: var(--fs-note); line-height: var(--lh-text); color: var(--ink-3); }
.lesson-row__cartoon, .lesson-row__done { display: inline-flex; align-items: center; gap: 4px; }
.lesson-row__cartoon .mm-icon, .lesson-row__done .mm-icon { width: 12px; height: 12px; }
.lesson-row.is-here::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; background: var(--amber); }
.lesson-row.is-here .lesson-row__title { font-weight: 600; }
.lesson-row.is-done .lesson-row__title, .lesson-row.is-done .lesson-row__num { color: var(--ink-3); }

.badges { gap: 8px; }
.badge { padding: 4px 10px; }

/* 10. Страница урока ------------------------------------------------------------------------------- */
.reading__head { gap: 8px; }
.lesson-head__bar { margin-top: 4px; }
.cash { gap: 8px; }
.mode-switch__btn[aria-pressed="true"] { font-weight: 600; }
.lesson-steps { margin-top: 8px; }
.lesson-steps__item.is-done .lesson-steps__num { border-color: var(--ink); color: var(--ink); }
.lesson-steps__item.is-here .lesson-steps__num { font-weight: 600; }
.skip-panel { margin: 0; }
.mm-disclosure > summary { font-size: var(--fs-text); line-height: var(--lh-text); color: var(--mm-text); }
.toc-steps__item.is-done::before { color: var(--night-ink-2); }
.reading__lessons li[aria-current="page"] a { box-shadow: inset 3px 0 0 var(--amber); padding-left: 10px; }
.reading__lessons li[aria-current="page"] a::before { content: none; }

.trainer-flow > * + *, .prose > * + * { margin-top: 16px; }
.prose h1, .prose h2 { margin-top: 32px; }
.prose > h2:first-child { margin-top: 8px; }
.trainer-flow > h2 + *, .prose h2 + * { margin-top: 12px; }
.prose strong { font-weight: 600; }
.trainer-step { scroll-margin-top: 72px; }
.trainer-step__num { display: inline; min-width: 0; margin: 0 6px 0 0; font-size: inherit; color: inherit; vertical-align: baseline; }
.trainer-step__num::after { content: "."; }
.mm-chat { gap: 12px; }
.mm-chat__line { gap: 12px; }
.mm-action { margin: 8px 0; }
.mm-action__task { font-family: var(--font-sans); font-size: var(--fs-text); line-height: var(--lh-text); font-weight: 400; }
.mm-action__form { gap: 16px; }
.prose .mm-table, .prose .mm-calc, .mm-calc { font-size: var(--fs-note); line-height: var(--lh-note); }
.mm-calc__input { font-size: var(--fs-text); }
.mm-action__submit .mm-btn { min-height: 56px; }
.deeper__label { color: var(--ink); }

/* полоски таблицы-расчёта: без зелёной заливки, строки отделяет линия */
.mm-calc tbody tr:nth-child(odd) { background: transparent; }
.mm-calc tbody tr { border-bottom: 1px solid var(--paper-control); }
.mm-calc tbody tr:last-child { border-bottom: 0; }

/* 11. Проверка ответа: верно зелёным, неверно красным, оба со словом и значком; охра не нужна -------------------- */
.verdict--saved { color: var(--mm-text); }
.verdict--wrong, .mm-option__mark, .mm-calc__mark, .mm-sort__mark, .mm-spot__label .mm-icon, .test-wrong { color: var(--red-ink); }
.mm-option--wrong, .mm-calc__cell.is-wrong .mm-calc__input, .mm-sort__item.is-wrong, .mm-spot-list__item.is-error { border-color: var(--red-ink); }
.test-review.is-wrong { border-top-color: var(--red-ink); }
.mm-option--correct .mm-option__mark, .mm-option__mark--best { color: var(--green-ink); }
.test-threshold { color: var(--mm-text); font-weight: 600; }
.mm-table .mm-flag { color: var(--red-ink); }
.submit__num, .answer-field { color: var(--ink); }
.answer-field { border-top-color: var(--ink); }
.answer-field.is-sent { border-top-color: var(--green-ink); }

/* 12. Игра и профиль: подписи без прописных и разрядки ------------------------------------------------- */
.game-strip dd, .game-strip dd.mono, .game-strip dd .mono { font-size: var(--fs-text); line-height: var(--lh-text); font-weight: 600; color: var(--mm-text); }
.game-strip--paper dd { color: var(--ink); }
.cash--night .cash__value { color: var(--mm-text); }

/* 15. Остаточные размеры страниц приложения приведены к четырём: прежние 12, 13, 15, 17, 19 и 22 px ------------------ */
.verdict__hint, .verdict__explain, .mm-compare, .mm-slider__label, .mm-sort__item, .mm-spot-list__text, .hints, .feedback__btn, .terms__term,
.terms__meaning, .term-sheet__body dd, .term-sheet__close, .test-question__stem, .answer-field__label, .submit__done, .submit__message,
.answer-list, .submit-steps, .postcard__text, .mm-tab, .transcript, .facts, .env__steps p, .mm-video__title, .site-header__profile,
.decision-result__cash .mono, .reading__next-title, .lessons__title, .requirements__list li, .requirements__value, .mm-field__input, .mm-steps__title, .mm-steps__num, .mm-command__done {
  font-size: var(--fs-text); line-height: var(--lh-text);
}
.terms__title, .submit__title { font-size: var(--fs-section); line-height: var(--lh-section); }
.toc-steps__item::before, .mm-option__mark, .mm-option__note, .mm-calc__answer, .mm-slider__ends, .mm-sort__mark, .mm-sort__bucket-title,
.mm-sort__ordered:empty::before, .mm-sort__ordered .mm-sort__item::before, .mm-spot__why-row td, .mm-spot__why, .deeper__summary::before,
.feedback__note, .start-question__lesson, .test-question__number, .game-strip__hint, .course-focus__title, .submit__num, .answer-field__status,
.mm-status--soon, .mm-field__hint, .mm-field__error, .mm-table caption, .mm-table td.mm-num, .mm-video__time, .mm-video__note, .lessons__num,
.lessons__meta, .work__status, .reading__next-label, .test-facts dt, .mm-slider__ends {
  font-size: var(--fs-note); line-height: var(--lh-note);
}
.deeper { font-size: var(--fs-text); }
.cash--big .cash__value, .test-result__big { font-size: var(--fs-title); line-height: var(--lh-title); font-weight: 600; }

/* 16. Мелочи, найденные проверкой по всем страницам ---------------------------------------------------------- */
.mm-field__label, .mm-number__label, .mm-table .mm-key, .mm-table .mm-key .mono, .mm-field__label .mono { font-weight: 600; }
option, .mm-video__time { font-family: var(--font-sans); }
.test-facts dd, .night-page__title, .login__title { font-family: var(--font-sans); font-weight: 600; font-size: var(--fs-title); line-height: var(--lh-title); }
.night-page__subtitle { font-size: var(--fs-section); line-height: var(--lh-section); }
.night-page__kicker { font-family: var(--font-sans); font-size: var(--fs-note); line-height: var(--lh-note); }
.mm-map__row--here .mm-map__name { font-weight: 600; }

/* 13. Телефон (до 900 px) ------------------------------------------------------------------------------ */
@media (max-width: 899px) {
  .course-hero { padding-top: 96px; padding-bottom: 8px; gap: 0; }
  .course-hero__scene { height: 232px; }
  .course-map { padding-top: 32px; padding-bottom: 8px; }
  .mm-map__row { grid-template-columns: 28px minmax(0, 1fr); padding: 12px 0; }
  .mm-map__row:first-child .mm-map__rail { top: 24px; }
  .mm-map__row:last-child .mm-map__rail { height: 24px; }
  .mm-map__station { margin-top: 7px; }
  .mm-map__name { font-size: var(--fs-text); line-height: var(--lh-text); }
  .mm-map__text { gap: 0; }
  .mm-map__row--here { padding: 12px 0; }
  .mm-map__row--here .mm-map__rail { top: 24px; }
  .mm-map__row--here::before { height: 24px; }
  .mm-map__row--here .mm-map__station { margin: 5px 0 0 7px; }
  .mm-map__row--here .mm-map__name { font-size: var(--fs-text); }

  .cover__inner { padding-top: 0; padding-bottom: 32px; }
  .cover__inner .back-link { margin-bottom: 8px; }
  .mm-sheet { padding-top: 24px; padding-bottom: 32px; }
  .reading__sheet { padding-top: 24px; padding-bottom: 32px; gap: 16px; }
}

/* 14. Компьютер (от 900 px) ---------------------------------------------------------------------------- */
@media (min-width: 900px) {
  .course-hero { padding-top: 40px; padding-bottom: 32px; gap: 48px; }
  .course-hero__scene { height: 440px; }
  .course-hero__title { max-width: 560px; }
  .course-hero__lead { max-width: 520px; }
  .course-hero__text .mm-btn--continue { max-width: 440px; }
  .course-map { padding-top: 32px; padding-bottom: 32px; }
  .course-map .section-title { font-weight: 600; }
  .course-map__row { grid-template-rows: 12px auto; grid-template-areas: "station" "text"; row-gap: 12px; }
  .course-map__row .mm-map__rail, .course-map__row:first-child .mm-map__rail, .course-map__row:last-child .mm-map__rail { top: 5px; }
  .course-map__row.mm-map__row--here::before { display: none; }
  .course-map__row .mm-map__name { font-size: var(--fs-note); line-height: var(--lh-note); }
  .info > * { max-width: 640px; }

  .cover { min-height: 0; }
  .cover__inner { padding-top: 24px; padding-bottom: 80px; }
  .cover__inner .back-link { margin-bottom: 40px; }
  .cover__title { max-width: 760px; }
  .cover__lead { max-width: 640px; }
  .mm-sheet { padding: 48px max(var(--space-6), 4%) 64px; }
  .module-sheet { grid-template-columns: minmax(0, 1fr) 340px; gap: 48px; }
  .module-col { display: flex; flex-direction: column; gap: 32px; min-width: 0; }
  .next-step .mm-btn { max-width: 440px; }

  .reading__sheet { gap: 24px; }
  .prose > * + *, .trainer-flow > * + * { margin-top: 16px; }
  .prose h1, .prose h2 { margin-top: 32px; }
}
