/* Урок-тренажёр, страница модуля 1.6, тест, вход и профиль — поверх tokens.css, bundle.css и site.css.
   Сцена — лист под лампой (уроки, тест) и ночь (вход). Сначала телефон 390 px, с 900 px — компьютер.
   Цвет не говорит один: у верно/неверно всегда есть слово и пиксельная иконка. */

.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.mm-icon { display: inline-block; vertical-align: -0.15em; }

/* Шапка урока: касса, режим, полоска шагов ------------------------------------------------ */
.lesson-head__bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-top: 4px; }
.cash { display: inline-flex; align-items: baseline; gap: 8px; margin: 0; font-size: 14px; line-height: 20px; }
.cash__label { color: var(--mm-text-3, var(--ink-3)); }
.cash__value { font-size: 15px; font-weight: 500; color: var(--mm-text, var(--ink)); white-space: nowrap; }
.cash--night { margin-top: 6px; }
.cash--night .cash__label { color: var(--night-ink-3); }
.cash--night .cash__value { color: var(--amber-text); }
.cash--big .cash__value { font-family: var(--font-display); font-size: 34px; font-weight: 300; }
.mode-switch { display: inline-flex; align-items: center; gap: 0; border: 1px solid var(--paper-control); border-radius: var(--radius-1); }
.mode-switch__label { padding: 0 10px; font-size: 13px; color: var(--ink-3); }
.mode-switch__btn { min-height: 44px; padding: 0 12px; border: 0; border-left: 1px solid var(--paper-control); background: transparent; color: var(--ink-2); font-size: 14px; cursor: pointer; }
.mode-switch__btn[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.mode-switch--paper .mode-switch__btn:first-child { border-left: 0; }

.lesson-steps { position: sticky; top: 0; z-index: 4; display: flex; align-items: center; gap: 10px; margin: 8px calc(-1 * var(--space-5)) 0; padding: 8px var(--space-5);
  background: var(--paper); border-bottom: 1px solid var(--paper-line); }
.lesson-steps__list { list-style: none; margin: 0; padding: 0; display: flex; flex: 1; gap: 4px; min-width: 0; }
.lesson-steps__item { flex: 1; min-width: 0; }
.lesson-steps__item a, .lesson-steps__item > span { display: flex; align-items: center; justify-content: center; min-height: 44px; text-decoration: none; }
.lesson-steps__num { display: block; width: 100%; padding: 4px 0; border-bottom: 4px solid var(--paper-dots); font-family: var(--font-mono); font-size: 12px; text-align: center; color: var(--ink-3); }
.lesson-steps__item.is-done .lesson-steps__num { border-color: var(--green-ink); color: var(--green-ink); }
.lesson-steps__item.is-here .lesson-steps__num { border-color: var(--amber); color: var(--ink); font-weight: 600; }
.lesson-steps__text { flex: none; font-size: 13px; color: var(--ink-3); }
.toc-steps { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 10px; counter-reset: step; }
.toc-steps__item { counter-increment: step; }
.toc-steps__item::before { content: counter(step) ". "; font-family: var(--font-mono); font-size: 12px; color: var(--night-ink-3); }
.toc-steps__item.is-done::before { color: var(--green); }
.toc-steps__item.is-here::before { color: var(--amber); }
.toc-steps__item.is-locked span { color: var(--night-ink-3); }
.preview-note { margin: 0 0 8px; padding: 10px 14px; border-left: 3px solid var(--amber-deep); background: var(--amber-tint); font-size: 14px; line-height: 20px; color: var(--ink); }

/* Поток урока ------------------------------------------------------------------------------ */
.trainer-flow > * + * { margin-top: 18px; }
.trainer-step { position: relative; scroll-margin-top: 72px; }
.trainer-step__num { display: inline-block; min-width: 1.6em; margin-right: 8px; font-family: var(--font-mono); font-size: 0.6em; color: var(--ochre); vertical-align: 0.25em; }
.flow-rest:empty { display: none; }
.trainer-flow pre, .trainer-flow .mm-table-wrap { max-width: 100%; }

/* Реплики героев --------------------------------------------------------------------------- */
.mm-chat { display: flex; flex-direction: column; gap: 10px; font-family: var(--font-sans); }
.mm-chat__line { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 10px; align-items: start; }
.mm-hero { display: block; width: 40px; height: 40px; background: var(--paper-inset); }
.mm-hero__svg { display: block; width: 40px; height: 40px; }
.mm-hero__eyes { animation: mm-blink 4.2s steps(1) infinite; }
.mm-chat__line:nth-child(2) .mm-hero__eyes { animation-delay: 1.3s; }
.mm-chat__line:nth-child(3) .mm-hero__eyes { animation-delay: 2.6s; }
@keyframes mm-blink { 0%, 94%, 100% { opacity: 1; } 95%, 98% { opacity: 0; } }
.mm-chat__bubble { margin: 0; padding: 9px 12px; border: 1px solid var(--paper-control); border-radius: var(--radius-1); background: var(--paper-field); font-size: 15px; line-height: 22px; color: var(--ink); overflow-wrap: anywhere; }
.mm-chat__name { display: block; font-size: 12px; line-height: 16px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.04em; }
.mm-chat__line--codex .mm-chat__bubble { font-family: var(--font-sans); }
.mm-chat--inline { margin-top: 12px; }

/* Действие --------------------------------------------------------------------------------- */
.mm-action { margin: 22px 0; padding: 16px; border-top: 3px solid var(--ink); background: var(--paper-inset); font-family: var(--font-sans); font-size: 16px; line-height: 23px; color: var(--ink); scroll-margin-top: 72px; }
.mm-action.is-resolved { border-top-color: var(--paper-control); }
.mm-action__form { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.mm-action__task { font-family: var(--font-serif); font-size: 17px; line-height: 26px; }
.mm-action__kicker { display: block; margin-bottom: 4px; font-family: var(--font-sans); font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ochre); }
.mm-action__submit { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.mm-action__submit .mm-btn { min-height: 52px; min-width: 160px; }
.mm-action__note { font-size: 13px; line-height: 18px; color: var(--ink-3); }
.mm-action__error { margin: 0; color: var(--red-ink); font-size: 14px; }
.mm-action__error .mm-icon { width: 12px; height: 12px; margin-right: 6px; }
.mm-action__verdict:empty { display: none; }
.mm-action__verdict > * + * { margin-top: 10px; }
.verdict { margin: 0; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.verdict .mm-icon { width: 14px; height: 14px; }
.verdict--wrong { color: var(--ochre); }
.verdict--right, .verdict--saved { color: var(--green-ink); }
.verdict--revealed { color: var(--ink); }
.verdict__label { font-weight: 600; }
.verdict__hint, .verdict__explain { margin: 0; font-size: 15px; line-height: 22px; }
.verdict__explain { padding-left: 12px; border-left: 3px solid var(--paper-control); }
.verdict__badge { margin: 0; padding: 8px 12px; background: var(--amber-tint); color: var(--ink); font-weight: 600; }
.verdict__badge .mm-icon { width: 12px; height: 12px; color: var(--amber-deep); margin-right: 6px; }
.mm-choices { margin: 0; padding: 0; border: 0; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.mm-choices .mm-option { align-items: flex-start; background: var(--paper); }
.mm-choices .mm-option input { margin-top: 1px; }
.mm-option__body { min-width: 0; overflow-wrap: anywhere; }
.mm-option--wrong { border: 2px solid var(--ochre); padding: 9px 13px; }
.mm-option--chosen { border: 2px solid var(--ink); padding: 9px 13px; }
.mm-option__mark { display: block; margin-top: 2px; font-size: 13px; line-height: 18px; font-weight: 600; color: var(--ochre); }
.mm-option--correct .mm-option__mark, .mm-option__mark--best { color: var(--green-ink); }
.mm-option__mark .mm-icon { width: 10px; height: 10px; margin-right: 4px; }
.mm-option__note { margin-top: 4px; color: var(--ink-2); }
fieldset[disabled] .mm-option { cursor: default; }

.mm-number { display: flex; flex-direction: column; gap: 6px; }
.mm-number__label { font-size: 14px; font-weight: 500; }
.mm-number__row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.mm-number__input { width: 12em; max-width: 100%; font-family: var(--font-mono); font-size: 16px; }
.mm-number__unit { font-size: 14px; color: var(--ink-2); }
.mm-number__given, .mm-number__answer, .mm-compare { margin: 0; }
.mm-compare { padding: 8px 12px; background: var(--paper); border-left: 3px solid var(--amber-deep); font-size: 15px; }

/* Таблица-расчёт */
.mm-calc-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.mm-calc { width: 100%; font-size: 14px; line-height: 20px; }
.mm-calc td, .mm-calc th { padding: 6px 8px; vertical-align: middle; }
.mm-calc__cell { min-width: 7.5em; white-space: nowrap; }
.mm-calc__input { width: 7em; min-height: 40px; padding: 0 8px; border: 1px solid var(--paper-field-edge); border-radius: var(--radius-1); background: var(--paper-field); font-family: var(--font-mono); font-size: 16px; text-align: right; }
.mm-calc__cell.is-wrong .mm-calc__input { border: 2px solid var(--ochre); }
.mm-calc__cell.is-wrong { background: var(--amber-tint); }
.mm-calc__cell.is-right { background: var(--green-soft); }
.mm-calc__mark { margin-left: 4px; color: var(--ochre); }
.mm-calc__mark .mm-icon { width: 10px; height: 10px; }
.mm-calc__answer { display: block; font-size: 12px; color: var(--green-ink); }

/* Ползунок */
.mm-slider { display: flex; flex-direction: column; gap: 14px; }
.mm-slider__param { display: flex; flex-direction: column; gap: 4px; }
.mm-slider__label { font-size: 15px; }
.mm-slider__value { font-weight: 600; }
.mm-slider__range { width: 100%; min-height: 44px; accent-color: var(--ink); }
.mm-slider__ends { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-3); }
.mm-slider__outputs { margin: 0; display: grid; gap: 6px; }
.mm-slider__output { display: flex; justify-content: space-between; gap: 12px; padding: 8px 10px; background: var(--paper); }
.mm-slider__output dt { min-width: 0; }
.mm-slider__output dd { margin: 0; font-weight: 600; white-space: nowrap; }
.mm-slider__marker { background: transparent; border: 1px dashed var(--paper-control); }
.mm-slider__series { font-size: 14px; }

/* Раскладка */
.mm-sort { display: flex; flex-direction: column; gap: 12px; }
.mm-sort__items, .mm-sort__ordered, .mm-sort__result, .mm-sort__bucket-items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.mm-sort__item { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; min-height: 44px; border: 1px solid var(--paper-control); border-radius: var(--radius-1); background: var(--paper); font-size: 15px; line-height: 21px; overflow-wrap: anywhere; }
.mm-sort__item.is-wrong { border: 2px solid var(--ochre); }
.mm-sort__mark { font-size: 13px; color: var(--ochre); font-weight: 600; }
.mm-sort__mark .mm-icon { width: 10px; height: 10px; margin-right: 4px; }
.mm-sort__choice select { min-height: 40px; max-width: 100%; font-size: 16px; }
.mm-sort.is-enhanced .mm-sort__choice { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.mm-sort.is-enhanced .mm-sort__item { cursor: pointer; }
.mm-sort.is-enhanced .mm-sort__item[aria-pressed="true"] { border: 2px solid var(--ink); background: var(--amber-tint); }
.mm-sort__buckets { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.mm-sort:not(.is-enhanced) .mm-sort__buckets { display: none; }
.mm-sort__bucket { padding: 10px; min-height: 64px; border: 1px dashed var(--ink-3); border-radius: var(--radius-1); background: var(--paper-field); cursor: pointer; }
.mm-sort--done .mm-sort__bucket { cursor: default; border-style: solid; }
.mm-sort__bucket-title { margin: 0 0 6px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.mm-sort__ordered { counter-reset: place; min-height: 52px; padding: 8px; border: 1px dashed var(--ink-3); border-radius: var(--radius-1); }
.mm-sort__ordered:empty::before { content: "Коснись первой карточки"; font-size: 13px; color: var(--ink-3); }
.mm-sort__ordered .mm-sort__item::before { counter-increment: place; content: counter(place) "."; font-family: var(--font-mono); font-size: 12px; color: var(--ochre); }
.mm-sort__result { counter-reset: place; }

/* Найди ошибку */
.mm-spot-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.mm-spot { width: 100%; font-size: 14px; line-height: 20px; }
.mm-spot td, .mm-spot th { padding: 6px 8px; vertical-align: top; overflow-wrap: anywhere; }
.mm-spot__mark-col { width: 44px; }
.mm-spot__check { display: flex; align-items: flex-start; gap: 10px; min-height: 44px; cursor: pointer; }
.mm-spot__check input { width: 20px; height: 20px; margin: 2px 0 0; flex: none; accent-color: var(--ink); }
.mm-spot tr.is-error td { background: var(--amber-tint); }
.mm-spot tr.is-false td { background: var(--paper-field); }
.mm-spot__why-row td { font-size: 13px; line-height: 19px; color: var(--ink-2); }
.mm-spot__label { font-weight: 600; color: var(--ink); }
.mm-spot__label .mm-icon { width: 10px; height: 10px; margin-right: 4px; color: var(--ochre); }
.mm-spot-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.mm-spot-list__item { padding: 8px 12px; border: 1px solid var(--paper-control); border-radius: var(--radius-1); background: var(--paper); overflow-wrap: anywhere; }
.mm-spot-list__item.is-error { border: 2px solid var(--ochre); }
.mm-spot-list__text { font-size: 15px; line-height: 21px; min-width: 0; }
.mm-spot-list__text code { white-space: pre-wrap; word-break: break-word; }
.mm-spot__why { margin: 6px 0 0; font-size: 13px; line-height: 19px; color: var(--ink-2); }

/* Решение */
.decision-result { display: flex; flex-direction: column; gap: 10px; padding-top: 4px; }
.decision-result p { margin: 0; }
.decision-result__cash .mono { font-size: 17px; }
.decision-result__truth { padding: 8px 12px; background: var(--paper); border-left: 3px solid var(--green-ink); }

/* «Углубиться», подсказки, «Знаю тему», финал ------------------------------------------- */
.deeper { border-top: 1px solid var(--paper-line); border-bottom: 1px solid var(--paper-line); font-size: 0.94em; }
.deeper__summary { list-style: none; cursor: pointer; min-height: 48px; padding: 12px 0; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; font-family: var(--font-sans); }
.deeper__summary::-webkit-details-marker { display: none; }
.deeper__summary::before { content: "[+]"; font-family: var(--font-mono); font-size: 13px; color: var(--ink-3); }
.deeper[open] > .deeper__summary::before { content: "[-]"; }
.deeper__label { font-weight: 600; color: var(--ochre); }
.deeper__title { color: var(--ink); }
.deeper__body { padding: 0 0 16px; }
.deeper__body > * + * { margin-top: 14px; }
.hints { padding: 12px 14px; background: var(--paper-inset); font-family: var(--font-sans); font-size: 15px; }
.hints__title { margin: 0 0 8px; font-weight: 600; }
.hints__item > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; color: var(--blue-ink); }
.hints__body { padding: 0 0 8px; }
.hints__last { margin: 8px 0 0; }
.skip-panel { margin: 8px 0 0; }
.skip-panel__body > * + * { margin-top: 12px; }
.skip-panel__done { margin: 0; }
.skip-outcome__text { margin: 0; font-weight: 600; }
.skip-outcome__text.is-passed { color: var(--green-ink); }
.skip-outcome__text .mm-icon { width: 12px; height: 12px; margin-right: 6px; }
.lesson-finish { margin-top: 32px; padding: 20px 16px; border-top: 3px solid var(--green-ink); background: var(--paper-inset); font-family: var(--font-sans); display: flex; flex-direction: column; gap: 14px; }
.lesson-finish__title { margin: 0 !important; display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 500; font-size: 28px; color: var(--green-ink); }
.lesson-finish__title .mm-icon { width: 20px; height: 20px; }
.lesson-finish__lead { margin: 0 !important; }
.lesson-finish__actions { display: flex; flex-direction: column; gap: 10px; }
.lesson-finish__actions .mm-btn, .lesson-finish__actions form .mm-btn { width: 100%; }
.feedback { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 !important; }
.feedback__btn { min-height: 48px; padding: 0 18px; border: 1px solid var(--ink); border-radius: var(--radius-1); background: transparent; color: var(--ink); font-size: 15px; cursor: pointer; }
.feedback__btn[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.feedback__note { flex-basis: 100%; font-size: 13px; color: var(--ink-3); }

/* Словарик -------------------------------------------------------------------------------- */
a.mm-term { color: inherit !important; text-decoration: underline dotted; text-underline-offset: 3px; cursor: help; }
.terms { margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--paper-line); font-family: var(--font-sans); }
.terms__title { margin: 0 0 8px !important; font-family: var(--font-display) !important; font-size: 22px !important; }
.terms__list { margin: 0; display: flex; flex-direction: column; gap: 12px; }
.terms__entry { scroll-margin-top: 72px; }
.terms__term { font-weight: 600; font-size: 15px; }
.terms__en, .terms__ru { font-weight: 400; color: var(--ink-3); }
.terms__meaning { margin: 2px 0 0; font-size: 15px; line-height: 22px; color: var(--ink-2); }
.terms__example { display: block; margin-top: 2px; font-size: 14px; color: var(--ink-3); }
.term-sheet { position: fixed; z-index: 60; left: 0; right: 0; bottom: 0; max-height: 60vh; overflow-y: auto; padding: 16px var(--space-5) calc(16px + env(safe-area-inset-bottom, 0px));
  background: var(--paper); color: var(--ink); border-top: 3px solid var(--amber); box-shadow: var(--shadow-sheet-phone); font-family: var(--font-sans); }
.term-sheet__body dt { font-weight: 600; font-size: 16px; }
.term-sheet__body dd { margin: 4px 0 0; font-size: 15px; line-height: 22px; }
.term-sheet__close { margin-top: 12px; min-height: 44px; padding: 0 16px; border: 1px solid var(--ink); border-radius: var(--radius-1); background: transparent; color: var(--ink); font-size: 15px; }
.glossary-search { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.glossary-search .mm-field { flex: 1 1 220px; }

/* Страница модуля 1.6 --------------------------------------------------------------------- */
.cover__subtitle { font-size: 15px; color: var(--night-ink-2); }
.module-cover { display: flex; flex-direction: column; gap: 10px; font-family: var(--font-serif); font-size: 17px; line-height: 26px; }
.module-cover p { margin: 0; }
.module-cover__label { font-family: var(--font-sans); font-weight: 600; }
.start-check { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.start-check p { margin: 0; }
.lessons__num { display: inline-block; min-width: 1.8em; font-size: 12px; color: var(--ink-3); }
.lessons__row.is-here a { box-shadow: inset 3px 0 0 var(--amber); padding-left: 10px; }
.lessons__meta .mm-status { margin-right: 6px; }
.badges { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border: 1px solid var(--paper-control); font-size: 13px; color: var(--ink-3); }
.badge .mm-icon { width: 12px; height: 12px; }
.badge.is-earned { border-color: var(--amber-deep); background: var(--amber-tint); color: var(--ink); }
.badge.is-earned .mm-icon { color: var(--amber-deep); }
.ref-links { margin: 0 0 12px; padding-left: 1.2em; display: flex; flex-direction: column; gap: 6px; }
.start-question { margin-top: 18px; }
.start-question__lesson { margin: 0 0 -10px; font-family: var(--font-sans); font-size: 13px; color: var(--ink-3); }
.start-summary { margin-top: 24px; padding: 16px; background: var(--paper-inset); font-family: var(--font-sans); display: flex; flex-direction: column; gap: 8px; }
.start-summary p, .start-summary ul { margin: 0; }

/* Тест ------------------------------------------------------------------------------------ */
.test-question { margin: 0; padding: 18px 0; border: 0; border-top: 1px solid var(--paper-line); display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.test-question__number { margin: 0; padding: 0; font-size: 13px; font-weight: 600; color: var(--ink-3); }
.test-question__stem { font-size: 17px; line-height: 26px; }
.test-open { min-height: 120px; height: auto; padding: 10px 14px; font-family: var(--font-sans); line-height: 22px; resize: vertical; }
.test-rubric { margin: 0; padding-left: 1.2em; font-size: 14px; color: var(--ink-2); }
.test-form { display: flex; flex-direction: column; gap: 4px; }
.test-form > .mm-btn { margin-top: 12px; align-self: flex-start; min-width: 220px; }
.test-result { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; padding-bottom: 12px; }
.test-result p { margin: 0; }
.test-result__big { font-family: var(--font-display); font-size: 44px; font-weight: 300; }
.test-wrong { color: var(--ochre); }
.test-wrong .mm-icon { width: 10px; height: 10px; margin-right: 4px; }
.test-review.is-wrong { border-top-color: var(--ochre); }
.test-reference { padding: 8px 12px; background: var(--paper-inset); border-left: 3px solid var(--green-ink); }
.test-mark { margin: 0; padding: 0; border: 0; display: flex; gap: 8px; flex-wrap: wrap; }
.test-mark legend { font-weight: 600; margin-bottom: 6px; }
.test-step-link { margin: 0; }
.test-status { margin: 0; }
.test-context { padding: 12px 14px; background: var(--paper-inset); }

/* Вход и профиль -------------------------------------------------------------------------- */
.login { position: relative; min-height: 100svh; overflow: hidden; }
.login__scene { position: absolute; inset: 0; }
.login__veil { position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(11, 11, 24, 0.2), rgba(11, 11, 24, 0.92) 60%); }
.login__inner { position: relative; min-height: 100svh; padding-top: 8px; padding-bottom: 32px; display: flex; flex-direction: column; gap: 24px; }
.login__text { margin-top: auto; display: flex; flex-direction: column; gap: 12px; }
.login__title { font-family: var(--font-display); font-weight: 300; font-size: 44px; line-height: 1; }
.login__lead { font-size: 16px; line-height: 24px; color: var(--night-ink-2); }
.login__form { display: flex; flex-direction: column; gap: 14px; border: 1px solid var(--night-edge); }
.login__form .mm-btn { min-height: 54px; }
.site-header__profile { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: var(--night-ink-2) !important; text-decoration: none; font-size: 15px; }
.site-header__profile .mm-icon { width: 18px; height: 18px; }
.site-header__profile span { max-width: 14em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site-header__profile.is-current { color: var(--amber) !important; }
.profile section { display: flex; flex-direction: column; gap: 10px; padding-top: 18px; border-top: 1px solid var(--paper-line); }
.profile section p { margin: 0; }
.profile-badges { display: flex; flex-direction: column; gap: 6px; }
.profile-badges__module { font-size: 14px; color: var(--ink-2); }
.profile-name, .preview-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.profile-name .mm-field, .preview-form .mm-field { flex: 1 1 240px; }

@media (min-width: 900px) {
  .lesson-steps { margin-left: 0; margin-right: 0; padding-left: 0; padding-right: 0; }
  .mm-action, .answer-field { padding: 20px 24px; }
  .mm-sort__buckets { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
  .lesson-finish__actions { flex-direction: row; flex-wrap: wrap; align-items: center; }
  .lesson-finish__actions .mm-btn, .lesson-finish__actions form .mm-btn { width: auto; }
  .login__inner { justify-content: center; max-width: 560px; margin: 0 auto; }
  .login__text { margin-top: 0; }
  .login__title { font-size: 68px; }
  .term-sheet { left: auto; right: 24px; bottom: 24px; width: 420px; border: 1px solid var(--paper-control); border-top: 3px solid var(--amber); }
}

@media (prefers-reduced-motion: reduce) {
  .mm-hero__eyes { animation: none !important; }
}

/* Поля формы не распирают телефонную колонку: длинные подписи вариантов списка обрезаются. */
.mm-field { min-width: 0; }
select.mm-field__input { width: 100%; max-width: 100%; min-width: 0; text-overflow: ellipsis; }
.profile-name .mm-field, .preview-form .mm-field, .glossary-search .mm-field { min-width: 0; }

/* Списки внутри действий — свои, без отступов текста урока; касание без системной подсветки. */
.prose .mm-action ul, .prose .mm-action ol { padding-left: 0; }
.prose .mm-action li + li { margin-top: 0; }
.prose .mm-action .mm-spot-list__item + .mm-spot-list__item, .prose .mm-action .mm-sort__item + .mm-sort__item { margin-top: 0; }
.mm-sort__item, .mm-sort__bucket, .mm-option, .mode-switch__btn, .feedback__btn, .lesson-steps a { -webkit-tap-highlight-color: transparent; }
.mm-sort__bucket:focus-visible { outline: 2px solid var(--focus-paper); outline-offset: 2px; }

/* T-037: игра на карте курса и в профиле, задача дня, повторение, калькуляторы ---------------------------- */
.game-strip { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; margin: 6px 0 0; }
.game-strip__item { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.game-strip dt { font-size: 12px; line-height: 16px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--night-ink-3); }
.game-strip dd { margin: 0; font-size: 15px; line-height: 21px; color: var(--night-ink); overflow-wrap: anywhere; }
.game-strip dd.mono, .game-strip dd .mono { color: var(--amber-text); }
.game-strip__hint { color: var(--night-ink-3); font-size: 13px; }
.game-strip--paper dt { color: var(--ink-3); }
.game-strip--paper dd { color: var(--ink); }
.course-focus { display: flex; flex-direction: column; gap: 4px; }
.course-focus__title { font-size: 13px; line-height: 18px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--night-ink-3); }
.requirements__list--night { border-color: var(--night-edge); }
.requirements__list--night li { border-color: var(--night-edge); color: var(--night-ink); }
.requirements__list--night a { color: var(--night-ink) !important; }
.requirements__list--night span a { color: var(--blue-night, #9db8ff) !important; }
.requirements__list--night .requirements__value { color: var(--amber-text); }
.requirements__list--status li { align-items: baseline; }
.requirements__list--status li > :first-child { min-width: 0; overflow-wrap: anywhere; }
.requirements__list--status .requirements__value { flex: 0 1 auto; max-width: 55%; text-align: right; }
.requirements__list--status li.is-done .requirements__value { color: var(--green-ink); }
.requirements__list--night li.is-done .requirements__value { color: var(--green); }
.requirements__blocked { margin-top: 8px; }
.daily { padding-bottom: 24px; }
.daily__sheet { padding: 20px var(--space-5); border-radius: var(--radius-sheet-phone, 0); }
.daily__sheet > * + * { margin-top: 14px; }
.daily .sheet-head { flex-wrap: wrap; row-gap: 4px; }
.daily .sheet-title--big { white-space: nowrap; }
.course-map__row.is-closed .mm-map__note { color: var(--green); }
.mm-map__note .mm-icon { margin-right: 4px; }
.review-list > * + * { margin-top: 18px; }
.review-list__item > * + * { margin-top: 8px; }
.review-daily { padding-bottom: 18px; border-bottom: 1px solid var(--paper-line); margin-bottom: 18px; }
.calculators + .calculators { margin-top: 28px; }
.calculators__item { margin-top: 14px; }
.calculators__item > * + * { margin-top: 8px; }
.mm-calculator { padding: 16px; border: 1px solid var(--paper-control); border-radius: var(--radius-1); background: var(--paper-field); }
.mm-action__again { margin-top: 12px; }
.site-header__streak { display: none; font-size: 13px; line-height: 18px; color: var(--night-ink-2) !important; text-decoration: none; white-space: nowrap; }
.site-header__streak.is-today .mono { color: var(--amber-text); }
.site-header__streak-label { color: var(--night-ink-3); }

/* Пиксельное окно «модуль закрыт», открытки ------------------------------------------------------------ */
.closed-event { display: flex; flex-direction: column; gap: 14px; margin: 0 0 18px; }
.closed-event__text { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.closed-event__text p { margin: 0; }
.closed-event__reason { margin: 0; font-size: 18px; line-height: 24px; font-weight: 600; }
.closed-event__actions { display: flex; flex-wrap: wrap; gap: 10px; }
.mm-pixel--closed .mm-pixel__title { top: 22px; }
.mm-pixel__coin--1 { left: 12%; animation-duration: 2.6s; }
.mm-pixel__coin--2 { left: 28%; animation-duration: 3.1s; animation-delay: 0.7s; }
.mm-pixel__coin--3 { left: 64%; animation-duration: 2.8s; animation-delay: 0.3s; }
.mm-pixel__coin--4 { left: 80%; animation-duration: 3.4s; animation-delay: 1.1s; }
.mm-pixel__coin--5 { left: 46%; animation-duration: 3s; animation-delay: 1.6s; }
.mm-pixel__coin, .mm-pixel__sprite { image-rendering: pixelated; }
.postcards { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.postcard { margin: 0; padding: 12px 14px; border: 1px solid var(--paper-control); border-left: 3px solid var(--amber-deep); border-radius: var(--radius-1); background: var(--paper-field); }
.postcard--grade { border-left-color: var(--green-ink); }
.postcard__kicker { font-size: 12px; line-height: 16px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-3); }
.postcard__text { margin-top: 4px !important; font-size: 15px; line-height: 22px; color: var(--ink); }
.postcard__label { color: var(--ink-3); }

/* Сдача проекта с самопроверкой ---------------------------------------------------------------------- */
.submit { display: flex; flex-direction: column; gap: 18px; margin-top: 28px; scroll-margin-top: 72px; }
.project-main .submit { align-items: stretch; }  /* секции страницы проекта прижаты влево; шаги сдачи — во всю ширину */
.submit__step { display: flex; flex-direction: column; gap: 10px; padding-top: 16px; border-top: 1px solid var(--paper-line); scroll-margin-top: 72px; }
.submit__step .mm-disclosure, .submit__rubric { align-self: stretch; }
.submit__upload input[type=file] { min-height: 44px; padding: 8px; }
.submit__step form { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.submit__step form .mm-field { width: 100%; }
.submit__title { display: flex; align-items: baseline; gap: 10px; font-size: 19px; line-height: 24px; font-weight: 600; color: var(--ink); }
.submit__num { display: inline-flex; justify-content: center; min-width: 26px; padding: 1px 6px; border: 1px solid var(--paper-control); font-size: 13px; color: var(--ochre); }
.submit__answer { min-height: 200px; resize: vertical; font-family: var(--font-sans); }
.submit__done { margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; font-size: 15px; line-height: 21px; }
.submit__locked { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--ink-3); }
.submit__rubric { padding: 12px 14px; border: 1px solid var(--paper-control); background: var(--paper-field); }
.submit__messages { display: flex; flex-direction: column; gap: 6px; }
.submit__message { margin: 0; padding: 10px 12px; border-left: 3px solid var(--green-ink); background: var(--paper-field); font-size: 15px; line-height: 21px; color: var(--ink); }
.submit__message--error { border-left-color: var(--red-ink, #a33b2a); }
.submit__message .mm-icon { margin-right: 6px; }
/* Поле письменного ответа mm-answer — на месте блока на странице проекта (решение 28) */
.answer-field { margin: 22px 0; padding: 16px; border-top: 3px solid var(--ochre); background: var(--paper-inset); font-family: var(--font-sans); color: var(--ink); scroll-margin-top: 72px; }
.answer-field.is-sent { border-top-color: var(--green-ink); }
.answer-field__form { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.answer-field__kicker { font-size: 12px; line-height: 16px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ochre); }
.answer-field.is-sent .answer-field__kicker { color: var(--green-ink); }
.answer-field__label { font-family: var(--font-serif); font-size: 17px; line-height: 26px; }
.answer-field__label > :first-child { margin-top: 0; }
.answer-field__label > :last-child { margin-bottom: 0; }
.answer-field__input { width: 100%; height: auto; min-height: 150px; padding: 10px 14px; line-height: 23px; resize: vertical; }
.answer-field__hint { font-size: 14px; line-height: 20px; color: var(--ink-3); }
.answer-field__submit { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.answer-field__submit .mm-btn { min-height: 52px; min-width: 160px; }
.answer-field__status { font-size: 13px; line-height: 18px; color: var(--ink-3); }
.answer-field.is-sent .answer-field__status { color: var(--green-ink); }
.answer-field__error { margin: 0; color: var(--red-ink); font-size: 14px; }
.answer-field__error .mm-icon { width: 12px; height: 12px; margin-right: 6px; }
.answer-list { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 15px; line-height: 21px; }
.answer-list li.is-done, .answer-list__total.is-done { color: var(--green-ink); }
.answer-list a { color: inherit; }
.answer-list__total { margin: 0; font-size: 14px; font-weight: 600; }
.submit-steps { margin: 0 0 10px; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 15px; line-height: 21px; }
.submit-steps li.is-done { color: var(--green-ink); }
.submit-steps a { color: inherit; }
.locked { display: flex; flex-direction: column; gap: 12px; padding-top: 28px; padding-bottom: 40px; }
.locked__panel { display: flex; flex-direction: column; gap: 10px; max-width: 640px; }
.locked__panel .panel__title { display: flex; align-items: center; gap: 8px; }

/* Портреты студии: 32×32 в целом масштабе ×2; второй кадр сменяется шагами (Heroes, решение 24). */
.mm-hero:has(.mm-hero__portrait) { width: 64px; height: 64px; background: none; }
.mm-chat__line:has(.mm-hero__portrait) { grid-template-columns: 64px minmax(0, 1fr); }
.mm-hero__portrait { position: relative; display: block; width: 64px; height: 64px; }
.mm-hero__frame { position: absolute; inset: 0; width: 64px; height: 64px; image-rendering: pixelated; }
.mm-hero__frame--2 { opacity: 0; animation: mm-hero-frame 1.6s steps(1) infinite; }
@keyframes mm-hero-frame { 0%, 74% { opacity: 0; } 75%, 100% { opacity: 1; } }

@media (min-width: 900px) {
  .game-strip { grid-template-columns: repeat(4, minmax(0, auto)); gap: 10px 28px; }
  .daily__sheet { padding: 24px 32px; }
  .site-header__streak { display: inline; }
  .closed-event { flex-direction: row; align-items: center; }
  .closed-event .mm-pixel { flex: 0 0 360px; }
}

@media (prefers-reduced-motion: reduce) {
  .mm-hero__frame--2 { animation: none !important; opacity: 0 !important; }
  .mm-pixel__coin, .mm-pixel__sprite { animation: none !important; }
}
