:root {
  --bg: #f4f1ec;
  --card: #ebe7e0;
  --card-strong: #e3ded6;
  --white: #ffffff;
  --sage: #b7c6ab;
  --sage-soft: #d6dfcf;
  --forest: #2f3b2f;
  --terracotta: #c8957b;
  --terracotta-deep: #a46c54;
  --text: #1e1f1c;
  --muted: #7b7a75;
  --muted-2: #a8a6a0;
  --badge: #d8d3cb;
  --ok-bg: #d7e1cf;
  --ok-text: #2f3b2f;
  --warn-bg: #ecd9ce;
  --warn-text: #5a3a2c;
  --err-bg: #f0d4cf;
  --err-text: #7a2e22;
  --lock: #e8963a;
  --radius: 22px;
  --radius-sm: 16px;
  --nav-h: 64px;
  --font: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --hand: "Caveat", "Segoe Script", cursive;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); font-family: var(--font); }
body { font-size: 15px; line-height: 1.35; -webkit-font-smoothing: antialiased; overscroll-behavior-y: none; }
button, input { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }

.app { max-width: 560px; margin: 0 auto; min-height: 100vh; }
.view {
  padding: 14px 16px calc(var(--nav-h) + 24px + env(safe-area-inset-bottom));
  animation: fade .18s ease-out;
}
.view.no-nav { padding-bottom: 24px; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---------- Типографика ---------- */
h1 { font-size: 30px; font-weight: 800; letter-spacing: -0.5px; margin: 4px 0 10px; line-height: 1.1; }
h2 { font-size: 20px; font-weight: 700; margin: 0 0 8px; }
.sub { color: var(--muted); font-size: 14px; margin: -4px 0 14px; }
.label {
  font-size: 11px; font-weight: 700; letter-spacing: 1.6px; text-transform: uppercase; color: var(--muted);
  margin: 18px 0 8px 4px;
}
.label .hint { text-transform: none; letter-spacing: 0; font-weight: 600; color: var(--muted); font-size: 12px; }
.label:first-child { margin-top: 6px; }
.label-row { display: flex; align-items: baseline; justify-content: space-between; }
.label-row .link { font-size: 13px; letter-spacing: 0; text-transform: none; font-weight: 600; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.xsmall { font-size: 12px; }
.bold { font-weight: 700; }
.big { font-size: 40px; font-weight: 800; letter-spacing: -1px; line-height: 1; }
.right { margin-left: auto; }
.center { text-align: center; }

/* ---------- Шапка ---------- */
.topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.topbar .date { font-size: 11px; font-weight: 700; letter-spacing: 1.6px; text-transform: uppercase; color: var(--muted); margin: 4px 0 0 2px; }
.topbar h1 { margin: 4px 0 0; }
.icon-btn {
  width: 42px; height: 42px; border-radius: 50%; background: var(--card); display: grid; place-items: center;
  flex: 0 0 auto; color: var(--text);
}
.icon-btn svg { width: 20px; height: 20px; }
.teacher-line { color: var(--terracotta-deep); font-weight: 700; font-size: 14px; margin: 2px 0 4px 2px; }

/* ---------- Карточки ---------- */
.card { background: var(--card); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; }
.card.white { background: var(--white); }
.card.sage { background: var(--sage); }
.card-link { position: relative; cursor: pointer; }
.card-hit { position: absolute; inset: 0; border-radius: inherit; z-index: 0; }
.card-link .link, .card-link .inner-card { position: relative; z-index: 1; }
.card.terra { background: var(--terracotta); color: #2f1f17; }
a.card.terra { display: block; color: inherit; }
.card.sage .label, .card.terra .label { color: #41503f; margin-top: 0; margin-left: 0; }
.card.terra .label { color: #5a3a2c; }
.card.terra .card-head .chev { color: #5a3a2c; display: grid; flex: 0 0 auto; }
.card.terra .card-head .chev svg { width: 18px; height: 18px; }
.balance-tariff {
  margin-top: 12px; padding-top: 12px;
  border-top: 1px solid rgba(47, 31, 23, .14);
}
.balance-tariff-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.balance-tariff .label { display: block; margin: 0; }
.balance-tariff .title { display: block; margin-top: 2px; font-weight: 700; font-size: 15px; line-height: 1.25; }
.balance-tariff .price { font-weight: 700; white-space: nowrap; }
.card .label:first-child { margin-top: 0; margin-left: 0; }
.card .big + .inline { margin-left: 6px; }
.inline { display: inline; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card-head .link { font-size: 13px; font-weight: 700; color: #2f3b2f; }
.hero-number { display: flex; align-items: baseline; gap: 8px; margin: 8px 0 6px; }
.hero-number .big { font-size: 46px; }
.hero-number .after { font-size: 15px; font-weight: 600; }

/* прогресс-бар */
.bar { height: 8px; border-radius: 6px; background: rgba(255,255,255,.65); overflow: hidden; margin: 10px 0 6px; }
.card:not(.sage) .bar { background: rgba(0,0,0,.08); }
.bar > i { display: block; height: 100%; background: var(--forest); border-radius: 6px; transition: width .4s ease; }
.bar.thin { height: 6px; }
.bar-meta { display: flex; justify-content: space-between; color: #41503f; font-size: 12px; font-weight: 600; }
.card:not(.sage) .bar-meta { color: var(--muted); }

/* ---------- Строки списка ---------- */
.rows { display: flex; flex-direction: column; }
.row {
  display: flex; align-items: center; gap: 12px; padding: 12px 4px; width: 100%; text-align: left;
  border-top: 1px solid rgba(0,0,0,.06); color: var(--text);
}
.rows .row:first-child, .card > .row:first-child { border-top: 0; }
.row .ico { width: 30px; height: 30px; display: grid; place-items: center; font-size: 20px; flex: 0 0 auto; }
.row .body { flex: 1; min-width: 0; }
.row .title { font-weight: 600; font-size: 15px; }
.row .desc { color: var(--muted); font-size: 13px; margin-top: 2px; }
.row .chev { color: var(--muted-2); flex: 0 0 auto; }
.row .chev svg { width: 16px; height: 16px; }
.row.disabled { opacity: .55; }
.lock { color: var(--lock); font-size: 15px; line-height: 1; flex: 0 0 auto; }
.lock.inline-lock { margin-left: 6px; }
.count-badge {
  min-width: 30px; height: 30px; padding: 0 9px; border-radius: 15px; background: var(--badge); display: grid;
  place-items: center; font-weight: 700; font-size: 13px; flex: 0 0 auto;
}
.rows-card { padding: 4px 14px; }
.rows-card .row:first-child { border-top: 0; }

/* бейджи */
.lvl {
  width: 36px; height: 36px; border-radius: 50%; background: var(--badge); display: grid; place-items: center;
  font-weight: 800; font-size: 13px; flex: 0 0 auto;
}
.lvl.sm { width: 26px; height: 26px; font-size: 11px; border-radius: 8px; }
.pill-badge {
  display: inline-block; padding: 4px 10px; border-radius: 12px; background: var(--badge); font-size: 12px; font-weight: 700;
  vertical-align: middle; margin-left: 8px;
}
.score { padding: 5px 12px; border-radius: 14px; font-weight: 700; font-size: 13px; flex: 0 0 auto; }
.score.ok { background: var(--ok-bg); color: var(--ok-text); }
.score.mid { background: var(--warn-bg); color: var(--warn-text); }
.score.bad { background: var(--err-bg); color: var(--err-text); }
.icon-x {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 auto;
  color: var(--muted); background: var(--white);
}
.icon-x svg { width: 16px; height: 16px; }
.date-box {
  width: 50px; height: 50px; border-radius: 14px; background: var(--ok-bg); color: var(--ok-text); display: flex;
  flex-direction: column; align-items: center; justify-content: center; line-height: 1; flex: 0 0 auto;
}
.date-box b { font-size: 18px; font-weight: 800; }
.date-box span { font-size: 10px; text-transform: uppercase; font-weight: 700; margin-top: 2px; }

/* ---------- Сетка статистики ---------- */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.stat { background: var(--card); border-radius: var(--radius); padding: 16px; min-height: 96px; }
.stat .num { font-size: 30px; font-weight: 800; letter-spacing: -0.5px; line-height: 1; }
.stat .num small { font-size: 15px; font-weight: 600; color: var(--muted); margin-left: 4px; }
.stat .cap { color: var(--muted); font-size: 13px; margin-top: 8px; line-height: 1.3; }
.stat .cap b { color: var(--text); }
.stat.with-ico { display: flex; gap: 12px; align-items: flex-start; }
.stat .ico { font-size: 20px; width: 34px; height: 34px; border-radius: 50%; background: rgba(0,0,0,.05); display: grid; place-items: center; flex: 0 0 auto; }

/* ---------- Кнопки ---------- */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 16px 18px;
  border-radius: 18px; font-weight: 700; font-size: 16px; transition: transform .08s ease, opacity .2s;
}
.btn:active { transform: scale(.985); }
.btn.primary { background: var(--forest); color: #fff; }
.btn.start { background: #c5e3a4; color: #3d5a24; }
.btn.secondary { background: var(--white); color: var(--text); }
.btn.soft { background: var(--card); color: var(--text); }
.btn.sm { padding: 10px 14px; font-size: 14px; border-radius: 14px; width: auto; }
.btn.ghost { background: transparent; color: var(--muted); font-weight: 600; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn-row { display: flex; gap: 10px; }
.btn-row .btn { flex: 1; }
.play-btn {
  width: 50px; height: 50px; border-radius: 50%; background: var(--forest); color: #fff; display: grid; place-items: center; flex: 0 0 auto;
}
.play-btn svg { width: 18px; height: 18px; margin-left: 3px; }
.inner-card { background: var(--white); border-radius: 18px; padding: 14px 16px; display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.inner-card .body { flex: 1; }
.inner-card .title { font-weight: 700; font-size: 15px; }
.inner-card .desc { font-size: 13px; color: var(--muted); margin-top: 2px; }
.more-btn { display: inline-flex; padding: 10px 16px; border-radius: 14px; background: var(--card); font-weight: 700; font-size: 14px; }

/* сегмент / пилюли */
.pills { display: flex; gap: 8px; flex-wrap: wrap; }
.pill { padding: 10px 16px; border-radius: 16px; background: var(--white); font-weight: 700; font-size: 14px; color: var(--text); }
.pill.active { background: var(--sage); }
.pill.sm { padding: 7px 12px; font-size: 13px; border-radius: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 4px; }
.chip { padding: 9px 13px; border-radius: 14px; font-weight: 600; font-size: 13px; background: var(--card); }
.chip.white { background: var(--white); }

/* формы */
.field { display: flex; gap: 10px; align-items: stretch; margin-top: 12px; }
.input {
  flex: 1; background: var(--white); border-radius: 14px; padding: 14px 16px; border: 2px solid transparent; outline: none;
  font-weight: 600; font-size: 16px; width: 100%;
}
.input:focus { border-color: var(--sage); }
.input.ok { border-color: #8fae7e; background: #eef3ea; }
.input.err { border-color: #d9958a; background: #f7e7e3; }
textarea.input { resize: vertical; min-height: 90px; }
.field-label { font-size: 13px; color: var(--muted); font-weight: 600; margin: 14px 0 6px 4px; }
.note { color: var(--muted); font-size: 12.5px; line-height: 1.4; margin: 10px 4px 0; }

/* заметка преподавателя */
.handnote { font-family: var(--hand); font-size: 22px; line-height: 1.2; color: #2b2d28; }
.handnote .sig { font-weight: 600; }

/* график */
.chart-wrap { display: flex; align-items: flex-start; gap: 8px; }
.chart-y {
  display: flex; flex-direction: column; justify-content: space-between; height: 150px;
  min-width: 32px; padding-top: 6px; font-size: 10.5px; font-weight: 700; color: var(--muted); text-align: right;
}
.chart-main { flex: 1; min-width: 0; }
.chart { display: flex; align-items: flex-end; gap: 8px; height: 150px; padding: 6px 2px 0; }
.chart .col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: stretch; height: 100%; }
.chart .seg.total { background: var(--sage); border-radius: 6px 6px 0 0; width: 100%; }
.chart .seg.self { background: var(--sage-soft); border-radius: 6px 6px 0 0; }
.chart .seg.lessons { background: var(--sage); border-radius: 0 0 6px 6px; margin-top: 2px; }
.chart .seg.lessons.only { border-radius: 6px; }
.chart .seg.self.only { border-radius: 6px; }
.chart-labels { display: flex; gap: 8px; margin-top: 6px; }
.chart-labels span { flex: 1; text-align: center; font-size: 10.5px; color: var(--muted); }
.legend { display: flex; gap: 14px; margin-top: 10px; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -2px; margin-right: 5px; }

/* точки шагов */
.dots { display: inline-flex; gap: 4px; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: rgba(0,0,0,.12); }
.dots i.on { background: var(--forest); }

/* ---------- Сессия слов / упражнения ---------- */
.session-top { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.session-top .bar { flex: 1; margin: 0; }
.session-top .counter { font-size: 13px; font-weight: 700; color: var(--muted); min-width: 48px; text-align: right; }
.session-top .close { width: 36px; height: 36px; border-radius: 50%; background: var(--card); display: grid; place-items: center; }
.session-top .close svg { width: 16px; height: 16px; }
.q-topic { font-size: 11px; font-weight: 700; letter-spacing: 1.4px; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.q-title { font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 10px; }
.word-card { background: var(--card); border-radius: var(--radius); padding: 22px 18px; text-align: center; margin-bottom: 14px; min-height: 150px; display: flex; flex-direction: column; justify-content: center; }
.word-card .w { font-size: 30px; font-weight: 800; letter-spacing: -0.5px; }
.word-card .tr { color: var(--muted); font-size: 15px; margin-top: 4px; }
.word-card .pos { font-size: 11px; text-transform: uppercase; letter-spacing: 1.2px; font-weight: 700; color: var(--muted-2); margin-top: 8px; }
.word-card .meaning { font-size: 20px; font-weight: 700; margin-top: 14px; }
.word-card .ex { margin-top: 14px; font-size: 15px; line-height: 1.4; }
.word-card .ex-tr { color: var(--muted); font-size: 13.5px; margin-top: 4px; }
.word-card .hint { margin-top: 12px; background: var(--white); border-radius: 14px; padding: 10px 12px; font-size: 14px; }
.prompt { font-size: 19px; font-weight: 700; line-height: 1.35; margin: 4px 0 16px; }
.prompt .gap { display: inline-block; min-width: 48px; border-bottom: 2px solid var(--forest); }
.options { display: flex; flex-direction: column; gap: 10px; }
.opt {
  background: var(--white); border-radius: 16px; padding: 15px 16px; text-align: left; font-weight: 600; font-size: 16px;
  border: 2px solid transparent; width: 100%;
}
.opt.correct { background: var(--ok-bg); border-color: #8fae7e; }
.opt.wrong { background: var(--err-bg); border-color: #d9958a; }
.opt.dim { opacity: .5; }
.opt[disabled] { pointer-events: none; }
.explain { margin-top: 14px; border-radius: 16px; padding: 14px 16px; font-size: 14px; line-height: 1.4; }
.explain.ok { background: var(--ok-bg); color: var(--ok-text); }
.explain.err { background: var(--err-bg); color: var(--err-text); }
.explain b { display: block; margin-bottom: 4px; }
.sticky-actions { position: sticky; bottom: calc(12px + env(safe-area-inset-bottom)); margin-top: 16px; }
.result-hero { text-align: center; padding: 30px 16px 20px; }
.result-hero .big { font-size: 64px; }
.result-hero p { color: var(--muted); margin: 10px 0 0; }

/* ---------- Навигация ---------- */
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom); background: rgba(244,241,236,.94); backdrop-filter: blur(12px);
  border-top: 1px solid rgba(0,0,0,.06); display: flex; justify-content: space-around; z-index: 20;
}
.nav.hidden { display: none; }
.nav a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted-2); font-size: 10.5px; font-weight: 700; max-width: 112px; }
.nav a svg { width: 24px; height: 24px; }
.nav a.active { color: var(--forest); }
.nav a.active svg { stroke-width: 2.4; }

/* ---------- Прочее ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + 20px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--forest); color: #fff; padding: 12px 18px; border-radius: 14px; font-weight: 600; font-size: 14px; z-index: 50;
  max-width: 90vw; box-shadow: 0 6px 20px rgba(0,0,0,.18);
}
.loader { display: flex; justify-content: center; padding: 60px 0; color: var(--muted); font-weight: 600; }
.loader::before { content: ""; width: 22px; height: 22px; border-radius: 50%; border: 3px solid rgba(0,0,0,.1); border-top-color: var(--forest); animation: spin .8s linear infinite; margin-right: 10px; }
@keyframes spin { to { transform: rotate(360deg); } }
.error-box { background: var(--err-bg); color: var(--err-text); border-radius: var(--radius); padding: 16px; }
.empty { color: var(--muted); font-size: 14px; padding: 8px 4px; }
.checkbox { width: 24px; height: 24px; border-radius: 8px; border: 2px solid rgba(0,0,0,.18); display: grid; place-items: center; flex: 0 0 auto; background: var(--white); }
.checkbox.on { background: var(--forest); border-color: var(--forest); color: #fff; }
.checkbox svg { width: 14px; height: 14px; }
.spacer { height: 8px; }
.fade-in { animation: fade .25s ease-out; }

/* ---------- Кабинет преподавателя ---------- */
select.input { appearance: auto; }
textarea.input { line-height: 1.4; }
.checkline { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 14px; margin: 10px 2px; }
.checkline input { width: 18px; height: 18px; accent-color: var(--forest); }
.admin-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.admin-actions .btn { width: auto; }
.q-tools { display: flex; gap: 6px; flex: 0 0 auto; }
.q-tools button, .linkish {
  background: var(--white); border-radius: 10px; padding: 6px 8px; font-size: 12px; font-weight: 700; color: var(--muted);
}
.opt-line { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.opt-line input[type="radio"] { width: 18px; height: 18px; accent-color: var(--forest); flex: 0 0 auto; }
.opt-line input[type="file"] { max-width: 140px; font-size: 12px; }

/* редактор пар: сопоставление и слова в пропуски */
.pair-card { background: rgba(255,255,255,.55); border-radius: 16px; padding: 10px; margin-bottom: 10px; display: flex; flex-direction: column; gap: 8px; }
.pair-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12.5px; font-weight: 700; color: var(--muted); padding: 0 2px; }
.pair-head .linkish + .linkish { margin-left: 6px; }
.item-edit { display: flex; gap: 8px; align-items: center; }
.item-edit .input { min-width: 0; padding: 12px 14px; }
.img-pick {
  flex: 0 0 auto; width: 48px; height: 48px; border-radius: 12px; background: var(--white); display: grid; place-items: center;
  font-size: 10.5px; font-weight: 700; color: var(--muted); text-align: center; line-height: 1.15; cursor: pointer; overflow: hidden;
}
.img-pick img { width: 100%; height: 100%; object-fit: cover; }
.img-pick.busy { opacity: .45; pointer-events: none; }
.pair-card textarea.input { min-height: 0; }

.match-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: start; }
.match-col { display: flex; flex-direction: column; gap: 8px; }
.match-item {
  background: var(--white); border-radius: 16px; padding: 12px; text-align: left; border: 2px solid transparent;
  display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 14px; line-height: 1.35;
}
.match-item img { width: 100%; max-height: 110px; object-fit: cover; border-radius: 12px; }
.match-item b { font-size: 13px; color: var(--forest); }
.match-item.picked { border-color: var(--forest); }
.match-item.linked { background: var(--sage-soft); }
.match-item.correct { background: var(--ok-bg); border-color: #8fae7e; }
.match-item.wrong { background: var(--err-bg); border-color: #d9958a; }
.bank { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-word {
  background: var(--white); border-radius: 14px; padding: 9px 12px; font-weight: 700; font-size: 14px; border: 2px solid transparent;
}
.chip-word.picked { border-color: var(--forest); background: var(--sage-soft); }
.chip-word.used { opacity: .35; }
.bank-line { margin: 0 0 12px; font-size: 16px; line-height: 1.5; }
.slot {
  display: inline-block; min-width: 72px; padding: 2px 8px; border: 0; border-bottom: 2px solid var(--forest);
  background: transparent; font-weight: 800; color: var(--forest);
}
.slot.filled { background: var(--sage-soft); border-radius: 8px; }
.slot.correct { color: var(--ok-text); border-color: #8fae7e; }
.slot.wrong { color: var(--err-text); border-color: #d9958a; }
.table-wrap { overflow-x: auto; }
.task-table { width: 100%; border-collapse: collapse; background: var(--white); border-radius: 12px; }
.task-table th, .task-table td { border: 1px solid rgba(0,0,0,.08); padding: 8px; vertical-align: top; font-size: 14px; }
.task-table th { background: #f4e7b2; font-weight: 800; text-align: center; }
.cell-input { min-width: 90px; padding: 8px 10px; }
.write-box { min-height: 180px; }
.rec-row { display: flex; align-items: center; gap: 10px; margin: 8px 0; }
.rec-row audio, .card audio { width: 100%; margin-top: 10px; }
.rec-row .btn { width: auto; flex: 0 0 auto; }
.rec-time { font-weight: 700; font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.rec-row.live .rec-time { color: var(--err-text); }
.rec-row.live .rec-time::before {
  content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #d0453a;
  margin-right: 6px; animation: rec-pulse 1s ease-in-out infinite;
}
@keyframes rec-pulse { 50% { opacity: .25; } }
.rec-file { display: inline-block; margin: 6px 0 2px; padding: 9px 12px; border-radius: 12px; background: var(--white); font-size: 13px; font-weight: 700; color: var(--forest); cursor: pointer; }
.submission { padding: 12px 0; border-top: 1px solid rgba(0,0,0,.06); }
.submission:first-child { border-top: 0; }
.row .body p, .submission p { white-space: pre-wrap; margin: 8px 0 0; }
.row .body .btn.sm { width: auto; margin-top: 8px; }
.draft-pill { background: var(--warn-bg); color: var(--warn-text); }

.course-head { display: flex; align-items: center; gap: 8px; }
.course-head h1 { margin: 0; font-size: 28px; }
.back { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-size: 28px; line-height: 1; color: var(--text); }
.course-caption { color: #8a5a62; font-size: 18px; margin: 8px 0 18px; }
.unit-no { margin: 18px 0 0; font-size: 28px; }
.unit-name { margin: 0 0 12px; font-size: 18px; color: #3c3c3c; }
.lesson-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 8px; }
.tile { position: relative; aspect-ratio: 1.15; border-radius: 16px; background: #ece7df; color: #2a2a28; display: grid; place-items: center; font-weight: 800; font-size: 22px; }
.tile i { position: absolute; right: 7px; bottom: 7px; width: 16px; height: 16px; border-radius: 5px; background: #d7d2ea url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path d='M6 4l4 4-4 4' fill='none' stroke='%236b6794' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/></svg>") center/10px no-repeat; }
.tile.done { background: #d7ebc4; }
.tile.current { background: #c5e3a4; }
.tile.next { background: #f6e7a8; }
.tile.locked { color: #8d8a84; }
.home-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 4px 0 14px; }
.home-actions a { background: var(--white); border-radius: 18px; padding: 16px 8px 14px; text-align: center; min-height: 84px; }
.home-actions b { display: block; font-size: 14px; margin-bottom: 4px; }
.home-actions span { color: var(--muted); font-size: 12px; font-weight: 600; }
/* Запись на занятие и заявки */
.booking-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.booking-grid label { display: block; min-width: 0; }
.booking-grid .input { width: 100%; min-width: 0; }
.form-error { background: var(--err-bg); color: var(--err-text); border-radius: 14px; padding: 10px 12px; font-size: 13.5px; line-height: 1.4; margin-top: 12px; }
.form-error[hidden] { display: none; }
.req-status { font-weight: 700; }
.req-status.wait { color: #8a6a12; }
.req-status.no { color: var(--err-text); }
.req-card .req-when { font-weight: 800; font-size: 15px; }
.req-card .req-warn { color: var(--warn-text); font-size: 13px; font-weight: 600; margin-top: 4px; }
/* Домашка: жёлтая — есть что сдавать, салатовая — всё сдано, нейтральная — заданий пока нет */
.home-actions a.hw-todo { background: #f6e7a8; box-shadow: inset 0 0 0 1px rgba(180, 150, 40, .22); }
.home-actions a.hw-todo span { color: #6b5a12; }
.home-actions a.hw-done { background: #c5e3a4; box-shadow: inset 0 0 0 1px rgba(90, 140, 50, .2); }
.home-actions a.hw-done span { color: #3d5a24; }
.home-actions a.hw-empty { background: var(--white); }
.home-actions a.hw-empty span { color: var(--muted); }
.mod-tabs { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 12px; margin: 0 -2px 4px; }
.mod-tabs a { flex: 0 0 auto; padding: 10px 14px; border-radius: 999px; background: var(--white); font-weight: 700; font-size: 14px; color: var(--text); display: inline-flex; align-items: center; gap: 6px; }
.mod-tabs a.active { background: var(--text); color: #fff; }
.mod-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text); display: inline-block; }
.mod-tabs a.active .mod-dot { background: #fff; }
.theory { border-radius: 22px; padding: 18px 18px 16px; margin: 0 0 12px; }
.theory.lilac { background: #e4dcf8; }
.theory.sage { background: #d7e6cc; }
.theory-kicker { font-size: 12px; font-weight: 800; letter-spacing: 1.4px; text-transform: uppercase; margin-bottom: 10px; }
.theory h3 { margin: 0 0 10px; font-size: 22px; }
.theory p { margin: 0 0 8px; font-size: 15px; line-height: 1.4; }
.theory-rows { margin-top: 12px; }
.theory-row { display: grid; grid-template-columns: 92px 1fr; gap: 12px; padding: 10px 0; border-top: 1px solid rgba(0,0,0,.12); font-size: 14px; }
.theory-row span { color: #3d3a55; }
.theory.sage .theory-row span { color: #2f3b2f; }
.theory-pair { display: flex; gap: 8px; align-items: baseline; font-size: 18px; margin: 8px 0; }
.theory-pair span { color: var(--muted); }
.theory-note { margin-top: 12px !important; font-size: 14px !important; color: #2c3a28; }
