/* Оформление учебной платформы.

   Направление — учебник. Светлая кремовая страница, книжная типографика
   с засечками, минимум рамок и заливок. Теорию по математике читают
   подолгу: на светлом фоне формулы и чертежи не «плывут», а текст
   не утомляет глаза так, как светлые буквы на чёрном.

   Засечки — для содержания: заголовки, теория, условия задач, примеры.
   Рубленый шрифт — для интерфейса: кнопки, поля, ярлыки, номера заданий.
   Так с первого взгляда видно, где учебник, а где управление.

   Цветом помечается только состояние: что освоено, что в работе, где
   ошибка. Фирменный приём один — лист экзамена: сетка из 25 заданий,
   по которой сразу видно, где ты силён, а где нет. Он же задаёт
   структуру страницы предмета, потому что школьник думает «не умею
   четырнадцатое», а не «не освоен раздел алгебры». */

:root {
  /* бумага: страница кремовая, карточки белые — как лист поверх обложки */
  --bg:         #FBFAF7;
  --shell:      #FFFDF9;
  --surface:    #FFFFFF;
  --surface-2:  #F4F1E9;
  --surface-3:  #E9E4D7;
  --line:       #E6E0D4;
  --line-2:     #D3CBBA;

  --text:       #1D1B18;
  --text-dim:   #58524A;
  --text-faint: #7A7265;

  --accent:     #2E4B9B;
  --accent-ink: #FFFFFF;
  --accent-dim: #E4EAF6;

  --ok:         #1C7A48;
  --ok-dim:     #E3F2E8;
  --bad:        #B02A20;
  --bad-dim:    #FBE8E6;
  --warn:       #8A6410;
  --warn-dim:   #FBF1DA;

  /* шрифты: засечки читают, рубленый — управляют */
  --serif: "Charter", "Bitstream Charter", "Iowan Old Style", Georgia,
           "Times New Roman", "Liberation Serif", serif;
  --ui: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  /* шкала размеров фиксированная: интерфейс смотрят с одного расстояния */
  --t--1: 0.8125rem;
  --t-0:  1rem;
  --t-1:  1.125rem;
  --t-2:  1.3125rem;
  --t-3:  1.5rem;
  --t-4:  1.875rem;

  --r:    10px;
  --r-sm: 7px;
  --shadow: 0 1px 2px rgba(60,50,30,.06), 0 8px 24px rgba(60,50,30,.07);
  --speed: 160ms;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: var(--t-0)/1.65 var(--serif);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Поверхности браузера тоже часть оформления. */
::selection { background: var(--accent-dim); color: var(--text); }
:root { accent-color: var(--accent); caret-color: var(--accent); }
* { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background-color: var(--line-2); border: 3px solid transparent;
  background-clip: content-box; border-radius: 99px;
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* Всё, чем управляют, набрано рубленым: кнопки, поля, ярлыки, номера
   заданий, служебные подписи. Текст, который читают, остаётся с засечками. */
button, input, select, textarea { font: inherit; color: inherit; font-family: var(--ui); }
.chip, .group, .legend, .faint, .cell, .tabs button, .seg button,
.topic .num, .map-head .h, .criteria .k, .selfcheck .k, .review .k,
.applies .k, .example .n, .item .no, .cta .k, .status-note, .topic .s,
.subject .meta, .topic-status, .past-row, .auth label, .legend { font-family: var(--ui); }
button {
  cursor: pointer; background: var(--surface-2); color: var(--text);
  border: 1px solid var(--line-2); border-radius: var(--r-sm);
  padding: 9px 16px; font-weight: 600;
  transition: background var(--speed), border-color var(--speed), color var(--speed);
}
button:hover:not(:disabled) { background: var(--surface-3); border-color: var(--text-faint); }
button:disabled { opacity: .42; cursor: not-allowed; }
/* Выключенная залитая кнопка теряла читаемость: белый текст на выцветшем
   синем. Неактивность показываем не прозрачностью, а нейтральным цветом —
   надпись остаётся видимой, и сразу понятно, что нажать нельзя. */
button.primary:disabled, .cta:disabled {
  background: var(--surface-2); border-color: var(--line);
  color: var(--text-faint); opacity: 1; filter: none;
}
button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
/* Общее правило наведения специфичнее, чем button.primary, и перекрашивало
   залитую кнопку в светлый фон с белым текстом — читать было невозможно.
   Поэтому у залитых кнопок наведение задано явно. */
button.primary:hover:not(:disabled) {
  background: var(--accent); border-color: var(--accent);
  color: var(--accent-ink); filter: brightness(1.14);
}
button.ghost { background: transparent; border-color: transparent; color: var(--text-dim); }
button.ghost:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }
button.quiet { background: transparent; border-color: var(--line-2); color: var(--text-dim); }
button.quiet:hover:not(:disabled) { color: var(--text); background: var(--surface-2); }
button.big { padding: 12px 24px; font-size: var(--t-1); }
button.sm { padding: 5px 11px; font-size: var(--t--1); }

input, select, textarea {
  background: var(--surface); border: 1px solid var(--line-2);
  border-radius: var(--r-sm); padding: 10px 13px; width: 100%;
  transition: border-color var(--speed);
}
input:hover, select:hover { border-color: var(--text-faint); }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
::placeholder { color: var(--text-faint); }

.hidden { display: none !important; }
.dim { color: var(--text-dim); }
.faint { color: var(--text-faint); font-size: var(--t--1); }

/* ===================== оболочка ===================== */
header.top {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 14px;
  padding: 11px 22px; background: var(--shell);
  border-bottom: 1px solid var(--line);
}
.brand { font-weight: 700; font-size: var(--t-1); display: flex; gap: 10px; align-items: center; }
.brand .mark {
  width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink); font-weight: 800;
  font-size: var(--t--1); letter-spacing: -.02em;
}
header.top .spacer { flex: 1; }
.crumbs { display: flex; gap: 9px; align-items: center; color: var(--text-dim);
          font-size: var(--t-0); min-width: 0; }
/* Длинное название темы не должно разваливать шапку на три строки. */
.crumbs > :last-child { overflow: hidden; text-overflow: ellipsis;
                        white-space: nowrap; max-width: 34ch; }
.crumbs button { background: none; border: none; padding: 0; color: var(--accent); font-weight: 600; }
.crumbs button:hover { background: none; text-decoration: underline; }

main { max-width: 940px; margin: 0 auto; padding: 28px 22px 96px; }

h1, h2, h3, h4 { font-family: var(--serif); }
h1 { font-size: var(--t-4); margin: 0 0 6px; letter-spacing: -.02em; line-height: 1.2; }
h2 { font-size: var(--t-2); margin: 36px 0 14px; letter-spacing: -.01em; }
h3 { font-size: var(--t-1); margin: 26px 0 10px; }
p.lead { color: var(--text-dim); margin: 0 0 24px; max-width: 68ch; }

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); padding: 18px 20px;
}

/* ===================== иерархия страницы =====================
   Порядок важности задан размером, весом и воздухом, а не цветом:
   1) где вы сейчас → 2) одно главное действие → 3) подробности.
   Залитый акцентом элемент на экране ровно один — кнопка продолжения. */

h1 { font-size: var(--t-4); margin: 0 0 22px; letter-spacing: -.02em; line-height: 1.15; }

.sec { margin: 44px 0 14px; }
.sec h2 { font-size: var(--t-2); margin: 0 0 6px; letter-spacing: -.01em; }
.sec p { margin: 0; color: var(--text-dim); font-size: var(--t--1); max-width: 62ch; }

.group {
  color: var(--text-faint); font-size: var(--t--1); font-weight: 700;
  letter-spacing: .04em; margin: 26px 0 10px;
}

/* ---- 1. где вы сейчас ---- */
.status {
  background: var(--surface); border: 1px solid var(--line-2);
  border-radius: 14px; padding: 22px 24px;
}
.verdict-line { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
.verdict-line > span:first-child {
  font-size: var(--t-3); font-weight: 700; letter-spacing: -.02em;
}
.verdict-line .g5 { color: var(--ok); }
.verdict-line .g4 { color: var(--accent); }
.verdict-line .g3 { color: var(--warn); }
.verdict-line .g2 { color: var(--bad); }
.verdict-line .score { color: var(--text-dim); font-size: var(--t-0);
                       margin-left: auto; white-space: nowrap; }
/* Пустой счёт: заголовок вместо оценки. */
.intro-head {
  font-size: var(--t-3); font-weight: 700; letter-spacing: -.02em;
  margin-bottom: 8px;
}
.intro-head + .status-note { margin-top: 0; font-size: var(--t-0); max-width: 66ch; }

.status-note { margin: 12px 0 0; color: var(--text-dim); font-size: var(--t--1); max-width: 64ch; }
.status-note b { color: var(--text); }

/* ---- 2. одно главное действие ---- */
.cta {
  display: flex; align-items: center; gap: 18px; width: 100%; text-align: left;
  background: var(--accent); border: 1px solid var(--accent); color: var(--accent-ink);
  border-radius: 14px; padding: 18px 22px; margin-top: 14px; font-weight: 400;
}
.cta:hover:not(:disabled) { filter: brightness(1.08); background: var(--accent); }
.cta .k { font-size: var(--t--1); font-weight: 700; opacity: .72; letter-spacing: .03em; }
.cta .v { font-size: var(--t-2); font-weight: 700; letter-spacing: -.01em; margin-top: 1px; }
.cta .why { font-size: var(--t--1); opacity: .78; margin-top: 2px; }
.cta .go { margin-left: auto; font-size: var(--t-3); font-weight: 700; }
.cta + .topic { margin-top: 10px; }

/* ---- 5. карта экзамена ---- */
.map {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); padding: 18px 20px; margin-top: 14px;
}
.map-row { display: flex; gap: 18px; align-items: flex-start; margin-bottom: 16px; }
.map-head { flex: 0 0 104px; padding-top: 3px; }
.map-head .l { font-weight: 700; font-size: var(--t-0); }
.map-head .h { color: var(--text-faint); font-size: var(--t--1); line-height: 1.35; }
.map-grid { display: flex; flex-wrap: wrap; gap: 7px; flex: 1; }

.cell {
  position: relative; width: 44px; height: 44px; border-radius: var(--r-sm);
  border: 1px solid var(--line-2); background: var(--surface-2);
  display: grid; place-items: center; font-weight: 700; font-size: var(--t-0);
  color: var(--text-dim); padding: 0; overflow: hidden;
  transition: border-color var(--speed), color var(--speed);
}
.cell span { position: relative; z-index: 1; }
/* Заливка снизу вверх — это доля готовности, а не украшение. */
.cell i { position: absolute; left: 0; right: 0; bottom: 0; display: block;
          background: var(--accent); opacity: .20; transition: height var(--speed); }
.cell.done { color: var(--text); border-color: var(--ok); }
.cell.done i { background: var(--ok); opacity: .22; }
.cell.part { color: var(--text); }
.cell.miss { color: var(--text-faint); border-style: dashed; }
.cell:hover:not(:disabled) { border-color: var(--accent); color: var(--text); }
.cell:disabled { cursor: default; }

.map-extra { flex: 1; font-family: var(--ui); font-size: var(--t--1);
             color: var(--text-dim); line-height: 1.55; }
.map-extra b { color: var(--text); }
.map-extra .bar { margin-top: 10px; max-width: 320px; }

.legend { display: flex; gap: 16px; flex-wrap: wrap; color: var(--text-faint);
          font-size: var(--t--1); padding-top: 4px; border-top: 1px solid var(--line); }
.legend span { display: inline-flex; align-items: center; gap: 6px; padding-top: 10px; }
.legend i { width: 12px; height: 12px; border-radius: 3px; display: block;
            border: 1px solid var(--line-2); background: var(--surface-2); }
.legend i.done { background: var(--ok); border-color: var(--ok); }
.legend i.part { background: var(--accent); border-color: var(--accent); opacity: .55; }
.legend i.miss { border-style: dashed; background: transparent; }

/* ---- строки тем ---- */
.topic {
  display: grid; grid-template-columns: 78px 1fr auto; gap: 16px; align-items: center;
  width: 100%; text-align: left; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r);
  padding: 13px 16px; margin-bottom: 8px; font-weight: 400;
  transition: background var(--speed), border-color var(--speed);
}
.topic:hover { background: var(--surface-2); border-color: var(--line-2); }
.topic .num { text-align: center; }
.topic .num .w { display: block; font-size: 11px; color: var(--text-faint);
                 letter-spacing: .04em; }
.topic .num .n { display: block; font-size: var(--t-1); font-weight: 700;
                 color: var(--text-dim); line-height: 1.1; }
.topic.done .num .n { color: var(--ok); }
.topic .t { font-weight: 650; font-size: var(--t-0); }
.topic .s { color: var(--text-dim); font-size: var(--t--1); margin-top: 1px; }
.topic .right { display: flex; align-items: center; gap: 12px; }

.chip {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  border: 1px solid var(--line-2); border-radius: 99px;
  padding: 2px 11px; font-size: var(--t--1); color: var(--text-dim);
}
.chip.ok   { color: var(--ok);   border-color: var(--ok);   background: var(--ok-dim); }
.chip.warn { color: var(--warn); border-color: var(--warn); background: var(--warn-dim); }
.chip.bad  { color: var(--bad);  border-color: var(--bad);  background: var(--bad-dim); }

.dots { display: inline-flex; gap: 4px; }
.dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--surface-3); display: block; }
.dots i.on { background: var(--ok); }

.bar { height: 7px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: 99px;
           transition: width var(--speed); }
.bar.ok > i { background: var(--ok); }

.past { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px; }
.past-row {
  display: flex; gap: 14px; width: 100%; text-align: left; background: none;
  border: none; border-radius: var(--r-sm); padding: 7px 9px; font-weight: 400;
  color: var(--text-dim); font-size: var(--t--1);
}
.past-row:hover { background: var(--surface-2); color: var(--text); }
.past-row .faint { margin-left: auto; }

/* ===================== предметы ===================== */
.subject .go { font-size: var(--t-3); font-weight: 700; color: var(--text-faint); }
.subject:hover:not(:disabled) .go { color: var(--accent); }
.subject {
  display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center;
  width: 100%; text-align: left; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r);
  padding: 18px 20px; margin-bottom: 10px; font-weight: 400;
  transition: background var(--speed), border-color var(--speed);
}
.subject:hover:not(:disabled) { background: var(--surface-2); border-color: var(--line-2); }
.subject:disabled { opacity: .5; cursor: default; }
.subject .name { font-size: var(--t-1); font-weight: 700; }
.subject .meta { color: var(--text-dim); font-size: var(--t--1); margin-top: 3px; }
.subject .bar { width: 170px; margin-top: 8px; }

/* ===================== тема: чтение =====================
   Страница темы — это текст, который надо прочитать и понять. Поэтому весь
   экран темы собран в одну колонку: заголовок, абзацы, формулы, чертежи и
   примеры стоят на одной левой оси. Раньше теория лежала в узкой карточке
   внутри широкой страницы — получался столбик в пустом поле. Теперь текст
   лежит прямо на фоне: карточка внутри карточки читать только мешает. */

.reading { max-width: 752px; margin: 0 auto; }

/* шапка темы: заголовок, о чём она, и тонкая строка состояния */
/* Номера заданий ОГЭ — служебная подпись, а не часть фразы: отдельной
   строкой рубленым, иначе «·» повисает в конце строки. */
.topic-head .nums {
  display: block; margin-top: 5px; font-family: var(--ui);
  font-size: var(--t--1); color: var(--text-faint); letter-spacing: .03em;
}
.topic-head h1 { margin-bottom: 10px; }
.topic-head .lead { font-size: var(--t-1); margin-bottom: 18px; max-width: none; }
.topic-status {
  display: flex; align-items: center; gap: 8px 18px; flex-wrap: wrap;
  padding-bottom: 20px; border-bottom: 1px solid var(--line);
  color: var(--text-dim); font-size: var(--t--1);
}
.topic-status .streak { display: inline-flex; align-items: center; gap: 8px; }
.topic-status .streak b { color: var(--text); font-weight: 700; }
.topic-status .goal { color: var(--text-faint); }

/* вкладки темы: подчёркивание, а не таблетка — видно, что это разделы
   одной страницы, а не две кнопки */
.tabs {
  display: flex; gap: 28px; border-bottom: 1px solid var(--line);
  margin: 26px 0 32px;
}
.tabs button {
  border: none; background: none; border-radius: 0; padding: 0 0 13px;
  color: var(--text-faint); font-size: var(--t-1); font-weight: 600;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs button:hover:not(.on) { background: none; color: var(--text-dim); }
.tabs button.on { color: var(--text); border-bottom-color: var(--accent); }

/* зачем это нужно — читается как первая мысль темы, а не как плашка сбоку */
.applies {
  border-left: 3px solid var(--accent); padding: 1px 0 1px 20px;
  margin: 0 0 34px; font-size: var(--t-2); line-height: 1.55;
  color: var(--text-dim);
}
.applies .k {
  font-size: var(--t--1); font-weight: 700; color: var(--accent);
  letter-spacing: .06em; text-transform: uppercase; margin-bottom: 7px;
}

.prose { font-size: var(--t-1); line-height: 1.75; color: var(--text); }
.prose > :first-child { margin-top: 0; }
.prose h4 {
  margin: 44px 0 12px; font-size: var(--t-3); font-weight: 700;
  color: var(--text); letter-spacing: -.01em; line-height: 1.3;
}
.prose h4:first-child { margin-top: 0; }
.prose p { margin: 14px 0; }
.prose b, .prose strong { color: var(--text); font-weight: 650; }
.prose ul, .prose ol { padding-left: 24px; margin: 14px 0; }
.prose li { margin-bottom: 8px; }
.prose li::marker { color: var(--text-faint); }

/* формула всегда ярче окружающего текста: за ней глаз возвращается */
.f {
  font-family: "Cambria Math", Georgia, "Times New Roman", serif;
  color: var(--text); background: var(--surface);
  border: 1px solid var(--line); border-radius: 4px;
  padding: 1px 7px; font-size: 1.04em; white-space: nowrap;
}
.warn {
  border-left: 3px solid var(--warn); background: var(--warn-dim);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  padding: 14px 18px; margin: 24px 0; color: var(--text-dim);
}
.warn b { color: var(--warn); }

.frac { display: inline-grid; vertical-align: -0.55em; text-align: center; font-size: .95em; }
.frac .n { border-bottom: 1.5px solid currentColor; padding: 0 4px; }
.frac .d { padding: 0 4px; }

/* разобранные примеры: не карточки, а записи в тетради, разделённые линией */
.example { border-top: 1px solid var(--line); padding: 24px 0 4px; }
.example .n {
  font-size: var(--t--1); font-weight: 700; color: var(--text-faint);
  letter-spacing: .06em; text-transform: uppercase; margin-bottom: 8px;
}
.example .q { color: var(--text); font-size: var(--t-1); font-weight: 600; margin-bottom: 12px; }
.example ol { margin: 0; padding-left: 22px; color: var(--text-dim); }
.example li { margin-bottom: 7px; }
.example li::marker { color: var(--text-faint); font-weight: 700; }

/* ===================== таблицы и код в условии =====================
   У информатики условие нередко содержит таблицу расстояний или
   программу. И то и другое — часть задачи, а не оформление, поэтому
   набирается так, чтобы читалось без усилий. */
.tbl {
  border-collapse: collapse; margin: 18px 0; font-family: var(--ui);
  font-size: var(--t--1); background: var(--surface);
}
.tbl th, .tbl td {
  border: 1px solid var(--line-2); padding: 7px 14px;
  text-align: center; min-width: 44px;
}
.tbl th { background: var(--surface-2); font-weight: 700; }
.tbl td:empty { background: var(--surface-2); }

.code {
  font-family: "SF Mono", "Cascadia Mono", Consolas, "Liberation Mono", monospace;
  font-size: var(--t--1); line-height: 1.75;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: 14px 18px; margin: 18px 0;
  white-space: pre-wrap; overflow-x: auto;
}

/* ===================== чертежи ===================== */
/* Линии наследуют цвет текста, поэтому рисунок одинаково верно смотрится
   и на тёмном, и на светлом фоне. */
/* Чертёж сохраняет пропорции задачи, поэтому «узкий» треугольник при
   ширине в 360px вытягивался на пол-экрана. Ограничиваем и по высоте —
   тогда любая фигура занимает соразмерное место. */
.fig {
  display: block; width: auto; height: auto;
  max-width: min(380px, 100%); max-height: 320px;
  margin: 18px 0; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--r);
  /* Отступ задаётся внутри самого чертежа (pad в scene), поэтому
     внешний padding здесь лишний: с ним картинка не помещалась
     в отведённую ширину и обрезалась по краю. */
}
.fig .face { fill: var(--accent); fill-opacity: .09; }
.fig .lbl { fill: var(--text); font-weight: 600; }
.fig .lbl.accent { fill: var(--accent); }
.fig .mark { fill: var(--accent); }
.fig .dim { opacity: .55; }
.fig .accent-stroke { color: var(--accent); }
.fig .grid { stroke: var(--line-2); stroke-width: 1; opacity: .5; }
.fig .axis { stroke: var(--text-faint); stroke-width: 1.4; }
.fig .axis-fill { fill: var(--text-faint); }

/* Несколько чертежей в ряд: задание на соответствие графиков и формул. */
.fig-row {
  display: flex; gap: 14px; flex-wrap: wrap; margin: 18px 0;
}
.fig-cell { margin: 0; flex: 0 1 auto; }
.fig-cell .fig { margin: 0; max-width: 190px; max-height: 190px; }
.fig-cell figcaption {
  text-align: center; margin-top: 6px; font-family: var(--ui);
  font-weight: 700; font-size: var(--t-0);
}
@media (max-width: 560px) { .fig-cell .fig { max-width: 140px; } }

/* ===================== тренажёр ===================== */
.task {
  background: var(--surface); border: 1px solid var(--line-2);
  border-radius: 14px; padding: 26px 28px; box-shadow: var(--shadow);
}
.task .statement { font-size: var(--t-2); line-height: 1.55; }
.answer { display: flex; gap: 12px; align-items: center; margin-top: 22px; flex-wrap: wrap; }
.answer input { max-width: 220px; font-size: var(--t-2); text-align: center; font-weight: 650; }
.answer .unit { color: var(--text-dim); }

/* Пронумерованный список утверждений в условии — как в бланке ОГЭ,
   где в ответ пишут номер, а не текст. */
.statement ol.claims { margin: 14px 0; padding-left: 26px; }
.statement ol.claims li { margin-bottom: 8px; line-height: 1.5; }

.choices { display: grid; gap: 9px; margin-top: 20px; }
.choice {
  display: grid; grid-template-columns: 26px 1fr; gap: 12px; align-items: start;
  text-align: left; background: var(--surface-2); border: 1px solid var(--line-2);
  border-radius: var(--r); padding: 13px 16px; font-weight: 400; line-height: 1.5;
}
.choice:hover:not(:disabled) { border-color: var(--accent); background: var(--surface-3); }
.choice .k {
  width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid var(--line-2); font-size: var(--t--1); font-weight: 700;
  color: var(--text-dim);
}
.choice.on { border-color: var(--accent); }
.choice.on .k { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.choice:disabled { cursor: default; }

.verdict { margin-top: 22px; border-radius: var(--r); padding: 16px 18px; border: 1px solid; }
.verdict.ok  { background: var(--ok-dim);  border-color: var(--ok); }
.verdict.bad { background: var(--bad-dim); border-color: var(--bad); }
.verdict .head { font-weight: 700; font-size: var(--t-1); margin-bottom: 4px; }
.verdict.ok .head  { color: var(--ok); }
.verdict.bad .head { color: var(--bad); }

.steps { counter-reset: step; margin: 14px 0 0; padding: 0; list-style: none; }
.steps li {
  counter-increment: step; position: relative; padding: 8px 0 8px 38px;
  border-top: 1px solid var(--line);
}
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: 9px;
  width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface-3); color: var(--text-dim);
  font-size: var(--t--1); font-weight: 700;
}

.seg { display: inline-flex; gap: 4px; padding: 4px; background: var(--surface-2);
       border: 1px solid var(--line); border-radius: var(--r); margin: 22px 0 16px; }
.seg button { border: none; background: none; border-radius: var(--r-sm); color: var(--text-dim); }
.seg button.on { background: var(--surface-3); color: var(--text); }

/* ---- помощь с решением ----
   Разбор отдают только по явной просьбе: он снимает задачу с зачёта,
   поэтому сначала предупреждение с подтверждением, и лишь потом сам разбор. */
.confirm {
  margin-top: 18px; border: 1px solid var(--warn); background: var(--warn-dim);
  border-radius: var(--r); padding: 16px 18px;
}
.confirm .k {
  font-size: var(--t-1); font-weight: 700; color: var(--warn); margin-bottom: 6px;
  font-family: var(--serif);
}
.confirm p { margin: 0 0 14px; color: var(--text-dim); }
.confirm-row { display: flex; gap: 10px; flex-wrap: wrap; }

.helped {
  margin-top: 22px; border: 1px solid var(--line-2); border-radius: var(--r);
  padding: 20px 22px; background: var(--surface);
}
.helped .head { font-family: var(--serif); font-size: var(--t-2); font-weight: 700; }
.helped .note {
  margin: 4px 0 0; color: var(--warn); font-size: var(--t--1); font-family: var(--ui);
}
.how { margin-top: 20px; }
.how .k {
  font-family: var(--ui); font-size: var(--t--1); font-weight: 700;
  letter-spacing: .05em; text-transform: uppercase; color: var(--text-faint);
  margin-bottom: 10px;
}
.how ol { margin: 0; padding-left: 22px; color: var(--text-dim); line-height: 1.65; }
.how ol.steps { padding-left: 0; }
.how li { margin-bottom: 8px; }
/* Переключатель на подробное объяснение: во всю колонку, чтобы его было
   видно, но негромко — основной путь всё-таки короткая теория и задачи. */
button.wide {
  display: block; width: 100%; margin-top: 30px; padding: 14px;
  font-size: var(--t-0);
}
.prose.deep {
  margin-top: 26px; padding-top: 26px; border-top: 1px solid var(--line);
}
.prose.deep h4:first-child { margin-top: 0; }

.extra-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.ex-answer {
  margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line);
  color: var(--text-dim);
}
.ex-answer b { color: var(--text); }

.answer-line {
  margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line);
  font-size: var(--t-2);
}
.answer-line b { color: var(--accent); }

/* ---- развёрнутое решение ---- */
/* Предупреждение о самопроверке: спокойное, но заметное. Это не ошибка
   и не опасность, а правило игры, которое ученик должен знать заранее. */
.notice {
  border-left: 3px solid var(--line-2); background: var(--surface-2);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  padding: 14px 18px; margin-top: 20px;
  color: var(--text-dim); font-size: var(--t--1); font-family: var(--ui);
  line-height: 1.6;
}
.notice b { color: var(--text); }
.hint-line {
  margin: -4px 0 12px; color: var(--text-dim);
  font-size: var(--t--1); font-family: var(--ui); line-height: 1.55;
}

.solution-input {
  margin-top: 20px; min-height: 190px; line-height: 1.7;
  font-size: var(--t-0); resize: vertical;
}
.criteria, .selfcheck, .review {
  margin-top: 18px; border: 1px solid var(--line);
  border-radius: var(--r); padding: 15px 18px; background: var(--surface-2);
}
.criteria .k, .selfcheck .k, .review .k {
  font-size: var(--t--1); font-weight: 700; color: var(--text-faint);
  letter-spacing: .05em; text-transform: uppercase; margin-bottom: 10px;
}
.crit { display: grid; grid-template-columns: 30px 1fr; gap: 12px; padding: 6px 0; }
.crit .pts {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface-3); color: var(--text); font-weight: 700;
  font-size: var(--t--1);
}
/* Кнопки самооценки. Правило привязано к .score-row, а не к .score:
   тот же класс носит строка баллов в шапке предмета, и ширина в 54px
   выдавливала её за край карточки. */
.score-row { display: flex; gap: 10px; }
.score-row .score {
  width: 54px; height: 48px; font-size: var(--t-2); font-weight: 700;
  display: grid; place-items: center;
}
.score-row .score.on, .score-row .score.on:disabled {
  background: var(--accent); border-color: var(--accent);
  color: var(--accent-ink); opacity: 1;
}
.review .body { white-space: pre-wrap; }

/* ===================== состояния ===================== */
.skeleton {
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 37%, var(--surface-2) 63%);
  background-size: 400% 100%; border-radius: var(--r-sm);
  animation: shimmer 1.3s ease-in-out infinite;
}
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }
.skeleton.line { height: 14px; margin-bottom: 10px; }
.skeleton.line.short { width: 42%; }
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

.empty {
  border: 1px dashed var(--line-2); border-radius: var(--r);
  padding: 34px 24px; text-align: center; color: var(--text-dim);
}
.empty b { color: var(--text); display: block; margin-bottom: 4px; font-size: var(--t-1); }

/* ===================== пробник ===================== */
.item {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); padding: 16px 18px; margin-bottom: 10px;
  display: grid; grid-template-columns: 36px 1fr; gap: 16px; align-items: start;
}
.item .no {
  width: 36px; height: 36px; border-radius: var(--r-sm); display: grid; place-items: center;
  background: var(--surface-2); border: 1px solid var(--line-2);
  font-weight: 700; color: var(--text-dim);
}
.item.correct { border-color: var(--ok); }
.item.correct .no { background: var(--ok-dim); border-color: var(--ok); color: var(--ok); }
.item.wrong { border-color: var(--bad); }
.item.wrong .no { background: var(--bad-dim); border-color: var(--bad); color: var(--bad); }
.item input { max-width: 190px; margin-top: 10px; text-align: center; font-weight: 650; }

.sticky {
  position: sticky; bottom: 0; background: var(--shell);
  border-top: 1px solid var(--line); padding: 14px 0; margin-top: 22px;
  display: flex; gap: 14px; align-items: center; flex-wrap: wrap;
}

/* ===================== опасная зона =====================
   Необратимое действие внизу страницы, набрано спокойно: не кнопка-ловушка,
   но и не спрятано. Цветом здесь ничего не подсвечиваем — подтверждение
   паролем защищает надёжнее, чем красная рамка. */
.danger {
  margin-top: 56px; padding-top: 22px; border-top: 1px solid var(--line);
  max-width: 62ch;
}
.danger .k {
  font-family: var(--ui); font-size: var(--t--1); font-weight: 700;
  letter-spacing: .05em; text-transform: uppercase; color: var(--text-faint);
  margin-bottom: 8px;
}
.danger p { margin: 0 0 14px; color: var(--text-dim); font-size: var(--t--1);
            font-family: var(--ui); }

/* ===================== вход ===================== */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 22px; }
.auth { width: 100%; max-width: 390px; }
.auth .hero { text-align: center; margin-bottom: 26px; }
.auth .hero h1 { font-size: var(--t-4); }
.auth .hero p { color: var(--text-dim); margin: 8px auto 0; max-width: 34ch; }
.auth .seg { display: flex; width: 100%; margin: 0 0 20px; }
.auth .seg button { flex: 1; }
.auth label { display: block; font-size: var(--t--1); color: var(--text-dim); margin-bottom: 15px; }
.auth label input { margin-top: 6px; }
.auth .err { color: var(--bad); font-size: var(--t--1); margin-top: 12px; }

.chart { display: flex; gap: 5px; align-items: flex-end; height: 84px; margin-top: 8px; }
.chart .col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; }
.chart .col .b { background: var(--ok); border-radius: 3px 3px 0 0; min-height: 2px; }
.chart .col .b.miss { background: var(--bad); border-radius: 0 0 3px 3px; }
.chart .col .lbl { font-size: 11px; color: var(--text-faint); text-align: center; }

@media (max-width: 720px) {
  main { padding: 20px 14px 72px; }
  h1 { font-size: var(--t-3); }
  .task { padding: 20px 18px; }
  .task .statement { font-size: var(--t-1); }

  /* Шапка: кнопки важнее имени и крошек. */
  header.top { padding: 10px 14px; gap: 10px; }
  header.top #who { display: none; }
  .crumbs { font-size: var(--t--1); min-width: 0; overflow: hidden; }
  .crumbs span:not(:last-child), .crumbs button:not(:last-child) { display: none; }

  /* Баллы не должны уезжать за край — переносим на свою строку. */
  .verdict-line { gap: 4px; }
  .verdict-line .score { margin-left: 0; width: 100%; text-align: left; }

  /* Номер задания становится подписью над названием, а не узкой колонкой. */
  .topic { grid-template-columns: 1fr auto; row-gap: 4px; }
  .topic .num { grid-column: 1 / -1; display: flex; gap: 5px; align-items: baseline;
                text-align: left; }
  .topic .num .w, .topic .num .n { display: inline; }
  .topic .num .n { font-size: var(--t-0); }

  /* Карта: подпись части над сеткой. */
  .map-row { flex-direction: column; gap: 8px; margin-bottom: 20px; }
  .map-head { flex: none; display: flex; gap: 8px; align-items: baseline; padding: 0; }
  .cell { width: 40px; height: 40px; font-size: var(--t--1); }

  /* Тема: на узком экране колонка и так во всю ширину, нужен лишь воздух. */
  .prose { font-size: var(--t-0); }
  .prose h4 { font-size: var(--t-2); margin-top: 34px; }
  .applies { font-size: var(--t-1); padding-left: 15px; margin-bottom: 26px; }
  .tabs { gap: 20px; margin: 20px 0 24px; }
  .tabs button { font-size: var(--t-0); }
  .topic-status { gap: 10px; }
}
