/* Кабинет Botahist — те же токены, что у сайта (design/blueprint.md): вода, бумага, чернила, киноварь */
:root {
  --water: #DCE7EC;
  --paper: #F8FBFC;
  --ink: #0F1B2D;
  --cinnabar: #D8341D;
  --steel: #566B7F;
  --depth: #123B5E;
  --line: #C3D3DB;
  --tint: #E8EFF3;
  --series-1: #2C6E9E;  /* графики: результат, часть 1 (проверено на различимость при дальтонизме) */
  --series-2: #D8341D;  /* графики: часть 2 */

  --good: #2F7A55;
  --good-soft: #E2EEE8;
  --mid: #8A5A0E;
  --mid-soft: #F4ECDD;
  --bad: #B92A15;
  --bad-soft: #F8E3DF;

  --radius: 18px;
  --voice: 'Literata', Georgia, serif;
  --sans: 'Geologica', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --shadow: 0 1px 0 var(--line), 0 24px 48px -36px rgba(15, 27, 45, .35);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--water); color: var(--ink); font: 400 16px/1.6 var(--sans); }
a { color: var(--ink); text-decoration-color: color-mix(in srgb, var(--ink) 35%, transparent); text-underline-offset: 4px; }
a:hover { color: var(--cinnabar); text-decoration-color: var(--cinnabar); }
:focus-visible { outline: 3px solid var(--cinnabar); outline-offset: 3px; border-radius: 4px; }
img { max-width: 100%; height: auto; border-radius: 10px; }
::selection { background: var(--cinnabar); color: #fff; }

h1, h2 { font-family: var(--voice); font-weight: 300; letter-spacing: -.015em; line-height: 1.1; margin: 0 0 .5em; text-wrap: balance; }
h1 { font-size: clamp(34px, 4.2vw, 52px); }
h2 { font-size: 26px; font-weight: 400; }
h3 { font: 700 18px/1.3 var(--sans); margin: 0 0 .5em; }

.mono, .num { font-family: var(--mono); }
.muted { color: var(--steel); }
.small { font-size: 14px; }

/* шапка */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner { max-width: 1160px; margin: 0 auto; padding: 8px 16px 0; display: flex; flex-wrap: wrap; align-items: flex-end; gap: 4px 28px; }
.brand { font: 800 20px var(--sans); letter-spacing: -.02em; color: var(--ink); text-decoration: none; margin-right: auto; padding-bottom: 12px; }
.brand span { color: var(--cinnabar); }
.brand:hover { color: var(--ink); }
.tabs { display: flex; gap: 22px; overflow-x: auto; scrollbar-width: none; max-width: 100%; }
.tabs a { color: var(--steel); text-decoration: none; padding: 6px 0 12px; white-space: nowrap; font-size: 15px; border-bottom: 2px solid transparent; }
.tabs a:hover { color: var(--ink); }
.tabs a.active { color: var(--ink); border-bottom-color: var(--cinnabar); }
.userbox { width: 100%; display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 4px 18px; font-size: 13px; order: -1; color: var(--steel); }
.userbox a, .userbox button { color: var(--steel); background: none; border: 0; font: inherit; cursor: pointer; padding: 0; text-decoration: none; }
.userbox a:hover, .userbox button:hover { color: var(--cinnabar); }

main { max-width: 1160px; margin: 0 auto; padding: 40px 16px 80px; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px 20px; margin-bottom: 32px; }
.page-head h1 { margin: 0; }
.eyebrow { font-size: 15px; color: var(--steel); margin: 0 0 10px; }
.sub { font-size: 16px; color: var(--steel); margin: 10px 0 0; }

/* сетка и карточки */
.grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-2 { display: grid; gap: 20px; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
@media (max-width: 800px) { .grid-2 { grid-template-columns: minmax(0, 1fr); } }
select { max-width: 100%; }  /* длинные варианты (68 уроков) не растягивают колонку */

.card { background: var(--paper); border-radius: var(--radius); padding: 24px 26px; box-shadow: var(--shadow); }
.card + .card { margin-top: 20px; }
.grid > .card + .card, .grid-2 > * + * { margin-top: 0; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.card-head h2 { margin: 0; }

.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 13px 0; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.list li:first-child { border-top: 0; padding-top: 0; }
.list li:last-child { padding-bottom: 0; }
.list .grow { flex: 1; min-width: 0; }
.empty { color: var(--steel); margin: 0; }

/* дата-метка и бейджи */
.stamp { display: inline-block; font-size: 13px; font-weight: 500; white-space: nowrap; padding: 3px 10px; border-radius: 99px; background: var(--tint); color: var(--ink); }
.stamp.late { background: var(--bad-soft); color: var(--bad); }
.stamp.soon { background: var(--mid-soft); color: var(--mid); }

.badge { display: inline-block; font: 500 13px var(--sans); padding: 3px 10px; border-radius: 99px; white-space: nowrap; background: var(--good-soft); color: var(--good); }
.badge.warn { background: var(--mid-soft); color: var(--mid); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.plain { background: var(--tint); color: var(--steel); }

.good { color: var(--good); }
.mid { color: var(--mid); }
.bad { color: var(--bad); }

/* результат теста — кольцо прогресса */
.seal {
  --c: var(--good); --p: 0;
  width: 140px; height: 140px; border-radius: 50%; flex: none; position: relative;
  background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--paper) 0);
  display: grid; place-items: center; text-align: center;
}
.seal::before { content: ''; position: absolute; inset: 11px; border-radius: 50%; background: var(--water); }
.seal > div { position: relative; }
.seal.mid { --c: #C98516; }
.seal.bad { --c: var(--cinnabar); }
.seal b { display: block; font: 300 30px/1.1 var(--voice); }
.seal small { color: var(--steel); font-size: 13px; }
@property --p { syntax: '<number>'; inherits: true; initial-value: 0; }
@media (prefers-reduced-motion: no-preference) {
  .seal.press { animation: fill 1.1s cubic-bezier(.3, .8, .3, 1) both; }
  @keyframes fill { from { --p: 0; } }
}

/* кнопки и формы */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 22px;
  border: 0; border-radius: 999px; background: var(--cinnabar); color: #fff; cursor: pointer; text-decoration: none;
  font: 700 15px/1.2 var(--sans); text-align: center; transition: background .2s, transform .15s;
}
.btn:hover { background: #B92A15; color: #fff; }
.btn:active { transform: scale(.98); }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }
.btn.ghost:hover { background: var(--ink); color: var(--paper); }
.btn.sm { min-height: 34px; padding: 0 14px; font-size: 14px; }
.row-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
form.row-actions { margin-top: 20px; }

form p { margin: 0 0 16px; }
label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 6px; color: var(--steel); }
input[type=text], input[type=password], input[type=number], input[type=email], input[type=url],
input[type=date], input[type=datetime-local], input[type=search], select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: #fff; border: 1.5px solid var(--line);
  border-radius: 10px; padding: 10px 12px;
}
input::placeholder, textarea::placeholder { color: #8A9BAB; }
input:focus, select:focus, textarea:focus { border-color: var(--ink); outline: 3px solid var(--tint); }
input[type=file] { color: var(--steel); font: inherit; max-width: 100%; }
.helptext { display: block; font-size: 13px; color: var(--steel); margin-top: 4px; }
.errorlist { color: var(--bad); list-style: none; padding: 0; margin: 0 0 6px; font-size: 14px; }
.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline-form select { width: auto; padding: 6px 10px; font-size: 14px; }
.inline-form input:not([type=checkbox]):not([type=radio]):not([type=file]) { width: auto; flex: 1 1 200px; min-width: 0; }  /* поле и кнопка — в одну строку, а не друг под другом */

.messages { list-style: none; padding: 0; margin: 0 0 24px; }
.messages li { padding: 14px 18px; border-radius: 12px; background: var(--good-soft); color: var(--good); }
.messages li.error { background: var(--bad-soft); color: var(--bad); }

/* таблицы */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th { text-align: left; font-weight: 500; font-size: 13px; color: var(--steel); padding: 8px 10px; border-bottom: 1.5px solid var(--ink); }
td { padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; }

/* текст конспекта */
.prose { max-width: 72ch; font-size: 17px; }
.prose h1, .prose h2, .prose h3 { margin-top: 1.4em; }
.prose h1:first-child, .prose h2:first-child { margin-top: 0; }
.prose table { margin: 1em 0; }
.prose td, .prose th { border: 1px solid var(--line); }
.prose th { background: var(--tint); }
.prose blockquote { margin: 1em 0; padding: 14px 18px; background: var(--tint); border-left: 4px solid var(--cinnabar); border-radius: 0 12px 12px 0; }
.prose blockquote p { margin: 0; }
.prose code { font-family: var(--mono); background: var(--tint); padding: 1px 6px; border-radius: 6px; }

/* тест */
.question .qnum { color: var(--steel); font-size: 14px; font-weight: 500; }
.choice { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; font-size: 16px; color: var(--ink); padding: 10px 12px; border-radius: 10px; cursor: pointer; margin: 0; }
.choice:hover { background: var(--tint); }
.choice input { margin-top: 6px; accent-color: var(--cinnabar); }
.answer-input { font-family: var(--mono); max-width: 360px; }
.timer { position: sticky; top: 80px; z-index: 5; display: inline-block; background: var(--ink); color: var(--paper); font-family: var(--mono); padding: 6px 16px; border-radius: 99px; }
.verdict { border-left: 3px solid var(--line); padding-left: 16px; }
.verdict.ok { border-color: var(--good); }
.verdict.part { border-color: #C98516; }
.verdict.no { border-color: var(--cinnabar); }
.verdict.wait { border-color: var(--steel); border-left-style: dashed; }
.explain { background: var(--tint); border-radius: 12px; padding: 12px 16px; margin-top: 10px; font-size: 15px; }

/* неделя расписания */
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 900px) { .week { grid-template-columns: minmax(0, 1fr); } .day { min-height: 0; } }
.day { background: var(--paper); border-radius: 14px; padding: 12px 10px; min-height: 120px; box-shadow: var(--shadow); }
.day.today { box-shadow: inset 0 0 0 2px var(--cinnabar); }
.day-title { font-size: 13px; font-weight: 500; color: var(--steel); margin-bottom: 8px; }
.day.today .day-title { color: var(--cinnabar); }
.slot { border-radius: 10px; padding: 8px 9px; margin-bottom: 6px; background: var(--tint); font-size: 14px; }
.slot.done { background: var(--good-soft); }
.slot.cancelled { background: transparent; border: 1px dashed var(--line); color: var(--steel); text-decoration: line-through; }
.slot.missed { background: var(--bad-soft); }
.slot b { font-family: var(--mono); font-weight: 500; }
.slot select { margin-top: 5px; width: 100%; padding: 4px 6px; font-size: 13px; }

.stat { display: flex; flex-direction: column; }
.stat .val { font: 300 40px/1.1 var(--voice); letter-spacing: -.02em; }
.stats { display: flex; flex-wrap: wrap; gap: 32px; }

details summary { cursor: pointer; font-weight: 500; }

/* вход */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login .card { width: 100%; max-width: 420px; padding: 36px 32px; }
.login h1 { font-size: 40px; }

/* таблица по 22 заданиям ЕГЭ */
.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--tint); }
.seg a { display: inline-flex; align-items: center; min-height: 32px; padding: 0 12px; border-radius: 999px; font-size: 14px; color: var(--steel); text-decoration: none; }
.seg a[aria-current] { background: var(--paper); color: var(--ink); box-shadow: 0 1px 2px rgba(15, 27, 45, .12); }
.kim-note { margin: -4px 0 12px; }
.kim td { padding: 9px 10px; vertical-align: middle; }
.kim-res { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.kim-bar { flex: 0 0 72px; height: 6px; border-radius: 99px; background: var(--tint); overflow: hidden; }
.kim-bar span { display: block; height: 100%; border-radius: 99px; background: currentColor; }

/* Конструктор домашки */
.builder { display: grid; gap: 20px; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: start; }
.builder-side { position: sticky; top: 88px; max-height: calc(100vh - 104px); overflow-y: auto; overscroll-behavior: contain;
  margin: -4px; padding: 4px 4px 24px; scrollbar-width: thin; }  /* форма выше окна — крутится сама, а не обрезается */
@media (max-width: 960px) { .builder { grid-template-columns: minmax(0, 1fr); } .builder-side { position: static; max-height: none; overflow: visible; margin: 0; padding: 0; } }
.builder-side .card + .card { margin-top: 20px; }
.row-2 { display: grid; gap: 0 16px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
fieldset { border: 0; padding: 0; margin: 0 0 16px; min-width: 0; }
legend { font-size: 14px; font-weight: 500; color: var(--steel); padding: 0; margin-bottom: 6px; }
.check { display: flex; gap: 10px; align-items: center; min-height: 44px; margin: 0; color: var(--ink); font-weight: 400; font-size: 16px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 0; accent-color: var(--cinnabar); flex: none; }
.students { display: flex; flex-wrap: wrap; gap: 0 24px; }
.students legend { width: 100%; }
.check-line { display: flex; align-items: flex-end; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 32px 0 14px; }
.section-head h2 { margin: 0; }
#questions .card + .card { margin-top: 16px; }
.question.is-editing { box-shadow: inset 0 0 0 2px var(--cinnabar), var(--shadow); }
.q-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.q-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.q-tools form { display: flex; gap: 4px; margin: 0; }
.icon-btn { width: 44px; height: 44px; border: 0; border-radius: 999px; background: var(--tint); color: var(--ink); font: 500 17px var(--sans); cursor: pointer; }
.icon-btn:hover:not(:disabled) { background: var(--ink); color: var(--paper); }
.icon-btn.danger:hover { background: var(--cinnabar); }
.icon-btn:disabled { opacity: .35; cursor: default; }
.icon-btn.sm { width: 34px; height: 34px; font-size: 15px; }
.course-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.course-actions form { display: flex; gap: 6px; margin: 0; }
.course-add { margin: 14px 0 0; }
.card-head > div > h2 { margin-bottom: 2px; }
.preview { border-left: 3px solid var(--line); padding-left: 16px; }
.preview .choice { cursor: default; }
.preview .choice:hover { background: none; }
.key { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); }
.key .explain { margin-top: 10px; }
.choice-row { display: grid; grid-template-columns: 44px 1fr; align-items: center; margin-bottom: 8px; }
.choice-row input[type=checkbox] { width: 20px; height: 20px; justify-self: center; accent-color: var(--cinnabar); }
.issue h3 { margin-bottom: 4px; }
[hidden] { display: none !important; }

/* «буква → цифра (ЕГЭ)»: клетки как в бланке */
.cells { width: auto; border-collapse: collapse; margin: 4px 0 8px; }
.cells th, .cells td { width: 52px; text-align: center; border: 1.5px solid var(--line); padding: 0; }
.cells th { font: 500 15px var(--sans); color: var(--steel); background: var(--tint); padding: 6px 0; }
.cells input { width: 100%; height: 48px; border: 0; border-radius: 0; padding: 0; text-align: center;
  font: 500 20px var(--mono); background: #fff; }
.cells input:focus { outline: 3px solid var(--cinnabar); outline-offset: -3px; }
.cells input:disabled { background: #fff; }
.cells.result td { height: 44px; font: 500 18px var(--mono); background: #fff; vertical-align: middle; }
.cells.result td.bad { background: var(--bad-soft); }
.cells .cap { width: auto; padding: 0 12px; text-align: left; font-size: 13px; background: var(--tint); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Банк вопросов */
.bank-filter { display: flex; flex-wrap: wrap; gap: 0 16px; align-items: flex-end; margin-bottom: 20px; }
.bank-filter p { margin: 0 0 12px; min-width: 180px; }
.bank-filter .grow { flex: 1 1 220px; }
.bank-filter-go { display: flex; gap: 12px; align-items: center; min-width: 0 !important; }
.bank .card + .card { margin-top: 16px; }
.bank-img { max-height: 160px; width: auto; }
.bank-item .key { margin: 10px 0 0; }

/* Выдача по расписанию */
.schedule { display: grid; gap: 14px; justify-items: start; }
.schedule p { margin: 0; width: 100%; }
.schedule .inline-form input { flex: 1 1 180px; width: auto; }
.sched-student { max-width: 760px; }

/* Критерии развёрнутого ответа */
.crit-row { display: grid; grid-template-columns: 34px 1fr 72px; gap: 8px; align-items: center; margin-bottom: 8px; }
.crit-code { color: var(--steel); font-size: 14px; }
.crit-list { margin: 0; padding-left: 0; list-style: none; }
.crit-list li + li { margin-top: 4px; }
.crit-grade { margin-top: 14px; display: grid; gap: 12px; }
.crit-line legend { font-size: 15px; color: var(--ink); font-weight: 400; margin-bottom: 6px; }
.crit-line { margin: 0; }
.seg.pick label { position: relative; display: inline-flex; margin: 0; }
.seg.pick input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg.pick span { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 40px;
  border-radius: 999px; font: 500 16px var(--mono); color: var(--steel); }
.seg.pick input:checked + span { background: var(--paper); color: var(--ink); box-shadow: 0 1px 3px rgba(15, 27, 45, .18); }
.seg.pick input:focus-visible + span { outline: 3px solid var(--cinnabar); outline-offset: 2px; }
.crit-result { list-style: none; padding: 0; margin: 12px 0 0; }
.crit-result li { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0; border-top: 1px solid var(--line); }
.crit-result b { white-space: nowrap; font-weight: 500; }

/* Шаблоны заданий ЕГЭ — как в КИМ: формулировка, два столбца с заголовками капсом */
.kim-task { max-width: 72ch; }
.kim-instr { font-size: 17px; margin: 0 0 16px; }
.kim-match { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 28px;
  border-top: 1.5px solid var(--ink); padding-top: 12px; margin-bottom: 18px; }
.kim-col-title { font: 500 13px/1.35 var(--sans); letter-spacing: .06em; color: var(--steel); margin: 0 0 8px; }
.kim-list { list-style: none; margin: 0; padding: 0; }
.kim-list li { display: grid; grid-template-columns: 2.1em 1fr; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 16px; line-height: 1.45; }
.kim-mark { font: 500 15px var(--mono); color: var(--steel); }
@media (max-width: 560px) { .kim-match { grid-template-columns: minmax(0, 1fr); } .kim-col + .kim-col { margin-top: 16px; } }
.match-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 16px; }
.match-cols > div > input { margin-bottom: 8px; }
.match-row { display: grid; grid-template-columns: 28px 1fr; align-items: center; margin-bottom: 6px; }
.match-row .mono { color: var(--steel); font-size: 14px; }
.kim-single { margin-bottom: 18px; border-top: 1.5px solid var(--ink); }
.kim-table { margin: 0 0 18px; font-size: 15px; }
.kim-table th { font: 500 13px/1.35 var(--sans); color: var(--steel); vertical-align: bottom; border-bottom: 1.5px solid var(--ink); }
.kim-table td { border: 1px solid var(--line); vertical-align: top; }
.kim-gap { font-family: var(--mono); color: var(--steel); white-space: nowrap; }
.kim-source { margin: 0 0 16px; padding: 16px 18px; background: var(--tint); border-radius: 12px; }
.kim-source blockquote { margin: 0; font-size: 16px; line-height: 1.6; }
.kim-source blockquote p:last-child { margin-bottom: 0; }
.kim-source figcaption { margin-top: 10px; font-size: 14px; color: var(--steel); }
.kim-source .kim-source-title { margin: 0 0 8px; font-weight: 500; color: var(--ink); }
.stimulus { border-left: 3px solid var(--depth); }
.stimulus-head { font-weight: 500; }
.stimulus-img img { max-height: 560px; width: auto; }
#questions .stimulus { margin-top: 16px; }
.stimuli details { margin-top: 12px; }
.stimuli summary { list-style: none; cursor: pointer; }
.stimuli summary::-webkit-details-marker { display: none; }
.stim-form { margin-top: 14px; }
.tpl-grid { min-width: 480px; }
.tpl-grid th, .tpl-grid td { padding: 4px; border: 0; }
.tpl-grid input { padding: 8px 10px; font-size: 14px; }
.tpl-grid th input { font-weight: 500; }

/* Часть 2: поля ответа и проверка по элементам */
.kim-no { color: var(--steel); font-weight: 400; }
.part2-fields label { margin-top: 10px; color: var(--ink); font-weight: 500; }
.part2-fields label:first-child { margin-top: 0; }
.kim-instr p { margin: 0 0 8px; }
.check.element, .check.level { align-items: flex-start; min-height: 0; padding: 8px 0; border-top: 1px solid var(--line); font-size: 15px; }
.check.element input, .check.level input { margin-top: 3px; }
.check.level b { min-width: 1.2em; }

/* Задание 17: картинки-варианты 1)–4) */
.kim-options { list-style: none; margin: 4px 0 18px; padding: 0; display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); }
.kim-options li { display: grid; grid-template-columns: 2.1em 1fr; align-items: start; }
.kim-options img { width: 100%; max-height: 300px; object-fit: contain; background: #fff; border: 1px solid var(--line); }
.opt-row { display: grid; grid-template-columns: 28px auto 1fr; gap: 10px; align-items: center; margin-bottom: 8px; }
.opt-row img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; }
.opt-row .check { min-height: 0; font-size: 13px; }

/* Вход по коду */
.code-input { font: 500 24px var(--mono); letter-spacing: .12em; text-transform: uppercase; text-align: center; }
.code-input::placeholder { letter-spacing: .12em; }
.login-alt { margin: 18px 0 0; text-align: center; }
.login-code { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 12px; }
.login-code .mono { font-size: 22px; letter-spacing: .08em; }

/* Главные страницы: верхний ряд — две колонки одной высоты, широкие блоки — во всю ширину под ними */
.dash-top { display: grid; gap: 20px; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: stretch; }
.dash-col { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.dash-col > .card { margin-top: 0; }
.dash-col > .card:last-child { flex: 1; }
.dash-top + .card, .dash-wide { margin-top: 20px; }
@media (max-width: 800px) { .dash-top { grid-template-columns: minmax(0, 1fr); } }
.kim-split { display: grid; gap: 0 32px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); align-items: start; }
.kim-n { width: 2.5em; text-align: right; }
th.kim-n { font-family: var(--sans); }
/* Главная ученика: ряд коротких карточек (занятия, прогресс), ряд списков (сделать, тесты); на телефоне — по важности */
.dash-student { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-areas: "next prog" "todo tests"; }
.dash-student > .card { margin-top: 0; }
.area-todo { grid-area: todo; } .area-tests { grid-area: tests; } .area-next { grid-area: next; } .area-prog { grid-area: prog; }
.dash-student ~ .card { margin-top: 20px; }  /* «~», а не «+»: между рядом и картой стоит скрипт с данными графиков */
@media (max-width: 800px) { .dash-student { grid-template-columns: minmax(0, 1fr); grid-template-areas: "todo" "next" "tests" "prog"; } }
.dash-top.even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
@media (max-width: 800px) { .dash-top.even { grid-template-columns: minmax(0, 1fr); } }

/* Вставка списком */
.paste-inputs { display: grid; gap: 20px; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 900px) { .paste-inputs { grid-template-columns: minmax(0, 1fr); } }
.paste textarea { font: 15px/1.5 var(--mono); }
.paste-help ul { padding-left: 18px; margin: 0; }
.paste-help li + li { margin-top: 6px; }
.paste-item + .paste-item, .paste-group + .paste-item { margin-top: 16px; }
.paste-item.has-errors { box-shadow: inset 0 0 0 2px var(--bad-soft), var(--shadow); }
.paste-warn { display: block; width: fit-content; margin: 0 0 10px; white-space: normal; }
.paste-group { margin: 24px 0 8px; padding-left: 12px; border-left: 3px solid var(--depth); color: var(--steel); font-size: 15px; }
.paste-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }

/* Графики успеваемости (static/js/charts.js) */
.charts-pair { display: grid; gap: 8px 32px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); }
.chart-fig { margin: 0; min-width: 0; }
.chart-fig figcaption { font: 500 15px var(--sans); margin-bottom: 6px; }
.chart { position: relative; }
.chart-svg { display: block; overflow: visible; font: 12px var(--sans); }
.chart-svg:focus-visible { outline: 3px solid var(--cinnabar); outline-offset: 4px; border-radius: 6px; }
.chart-grid { stroke: var(--line); stroke-width: 1; opacity: .7; }
.chart-base { stroke: var(--line); stroke-width: 1; }
.chart-axis { fill: var(--steel); font-variant-numeric: tabular-nums; }
.chart-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart-dot { stroke: var(--paper); stroke-width: 2; }
.chart-line.s1 { stroke: var(--series-1); } .chart-dot.s1 { fill: var(--series-1); }
.chart-line.s2 { stroke: var(--series-2); } .chart-dot.s2 { fill: var(--series-2); }
.chart-cross { stroke: var(--steel); stroke-width: 1; opacity: .5; }
.chart-bar { fill: var(--series-1); }
.chart-none { stroke: var(--line); stroke-width: 3; stroke-linecap: round; }
.chart-zero { stroke: var(--series-1); stroke-width: 3; stroke-linecap: round; }
.chart-hit { fill: transparent; cursor: default; }
.chart-hit.is-on { fill: var(--tint); fill-opacity: .55; }
.chart-tip { position: absolute; z-index: 3; max-width: 260px; padding: 8px 12px; border-radius: 10px; background: var(--ink);
  color: #fff; font-size: 13px; line-height: 1.45; pointer-events: none; box-shadow: 0 8px 24px -12px rgba(15, 27, 45, .5); }
.chart-tip .muted { color: #B8C5D0; }
.tip-row { display: flex; align-items: center; gap: 6px; }
.tip-key { display: inline-block; width: 12px; height: 3px; border-radius: 2px; background: var(--series-1); flex: none; }
.tip-key.s2 { background: var(--series-2); }
.chart-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0 0 4px; color: var(--steel); }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-table { margin-top: 12px; }
.chart-table summary { cursor: pointer; color: var(--steel); }
.kim-chart { margin: 4px 0 16px; }
.chart-value { fill: var(--ink); font: 500 12px var(--sans); font-variant-numeric: tabular-nums; }
.chart-cap { fill: var(--steel); font-size: 12px; }
.chart-how { margin: 0 0 8px; color: var(--steel); font-size: 14px; }
.charts-note { margin: -6px 0 16px; }
/* Генерация заданий ИИ */
.ai-form .btn { vertical-align: middle; }
.ai-wait { margin-left: 12px; }
.ai-error { margin-top: 16px; }
.ai-check { margin: 24px 0 -8px; }
.ai-off p { margin: 0; }
.ai-grid { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); align-items: start; }
@media (max-width: 900px) { .ai-grid { grid-template-columns: minmax(0, 1fr); } }
.ai-tasks { list-style: none; margin: 0; padding: 0; }
.ai-tasks li { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); }
.ai-tasks li:first-child { border-top: 0; }
.ai-tasks .check { min-height: 44px; font-size: 15px; }
.ai-tasks select { width: 64px; flex: none; padding: 6px 8px; }
.ai-tasks .badge { margin-left: 4px; }
.ai-levels { margin-bottom: 16px; }
.ai-actions { margin: 20px 0 6px; }
.ai-fix { display: flex; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); }
.ai-fix input { flex: 1; min-width: 0; }
@media (max-width: 560px) { .ai-fix { flex-direction: column; } }
/* Подсказка ИИ при проверке */
.ai-grade { margin-bottom: 20px; }
.ai-grade p { margin: 0 0 10px; }
.ai-why { display: block; margin: 4px 0 0; font-size: 13px; color: var(--depth); }
.ai-why::before { content: ''; }

/* Страницы преподавателя: материал, урок, профиль */
.content-form { max-width: 720px; }
.content-form textarea { min-height: 7em; }
.form-more { margin: 4px 0 16px; padding-top: 8px; border-top: 1px solid var(--line); }
.form-more summary { cursor: pointer; color: var(--steel); min-height: 40px; display: flex; align-items: center; }
.form-actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 20px 0 0; }
.content-delete { max-width: 720px; margin-top: 16px; }
.danger-text { color: var(--bad); box-shadow: inset 0 0 0 1.5px var(--bad-soft); }
.danger-text:hover { background: var(--bad); color: #fff; }
.content-form .field { margin: 0 0 16px; }

/* чат с ИИ в конструкторе домашки */
.chat-layout { display: grid; gap: 20px; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 800px) { .chat-layout { grid-template-columns: minmax(0, 1fr); } }
.chat-log { display: flex; flex-direction: column; gap: 14px; max-height: 60vh; overflow-y: auto; padding-bottom: 6px; }
.chat .msg { max-width: 92%; padding: 10px 14px; border-radius: 14px; background: var(--field, rgba(0,0,0,.05)); }
.chat .msg.user { align-self: flex-end; background: var(--accent-soft, #fbe3de); }
.chat .msg .who { font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.chat .msg .report { margin-top: 8px; font-size: 14px; }
.chat .msg .report ul { margin: 4px 0 0; padding-left: 18px; }
.chat .msg-undo { margin: 10px 0 0; }
.chat-form { margin-top: 14px; }
.chat-form textarea { width: 100%; }
.chat-send { display: flex; gap: 12px; align-items: center; margin: 8px 0 0; }
.chat-tasks { margin: 0 0 12px; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }
