/* Зачёт — стиль «Мягкий». Mobile-first.
   Светло-серый фон, белые скруглённые карточки без рамок, чёрный текст и кнопки.
   Цвет только у двух вещей: оливковая печать «ЗАЧЁТ» (--stamp, из настроек школы, inline в base.html)
   и пастельные статусы в процентах, прогрессе и статистике (ok / warn / bad / info). */
@import url("fonts.921325a5b51d.css");

:root {
  --bg: #F1F1F0;           /* фон страницы */
  --card: #FFFFFF;
  --ink: #161616;          /* текст и основные кнопки */
  --muted: #73736D;
  --line: #E7E7E4;         /* разделители */
  --soft: #EBEBE8;         /* заливки: поля, вторичные кнопки, дорожки прогресса */
  --stamp: #6E7A26;        /* оливковая печать */
  --accent: var(--ink);    /* совместимость со старыми шаблонами */
  --accent-soft: var(--soft);
  --on-accent: #FFFFFF;
  --marker: #F5E6A3;       /* пастельный маркер */
  /* пастельные статусы: текст / фон / заливка полосок */
  --ok: #3D7346;   --ok-soft: #DCEEDA;   --ok-fill: #A7D3A3;
  --warn: #8A6316; --warn-soft: #F7EBCA; --warn-fill: #EDCD82;
  --bad: #A6473E;  --bad-soft: #F8DFDB;  --bad-fill: #EDAAA1;
  --info: #3D5C8A; --info-soft: #E0E8F5; --info-fill: #A8C2E6;
  --shadow: 0 1px 2px rgba(22, 22, 22, .05), 0 8px 24px -14px rgba(22, 22, 22, .16);
  --shadow-up: 0 2px 4px rgba(22, 22, 22, .06), 0 14px 32px -16px rgba(22, 22, 22, .22);
  --radius: 20px;
  --nav-h: 64px;
  --nav-gap: 12px;         /* отступ плавающего меню от краёв на телефоне */
  --f-body: "Golos Text", "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-brand: "Dela Gothic One", "Golos Text", system-ui, sans-serif;  /* только логотип и печать */
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -2.2 1.9'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
  color-scheme: light only;  /* всегда светлая */
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 var(--f-body);
  padding-bottom: calc(var(--nav-h) + var(--nav-gap) * 2 + env(safe-area-inset-bottom));
  -webkit-font-smoothing: antialiased;
}
a { color: var(--ink); text-decoration: none; font-weight: 600; }
a:hover { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
img, svg, video, iframe { max-width: 100%; }
h1, h2, h3 { line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.02em; text-wrap: balance; }
h1 { font-size: 1.7rem; font-weight: 700; }
h2 { font-size: 1.2rem; font-weight: 700; }
h3 { font-size: 1.05rem; font-weight: 600; }
p { margin: 0 0 .75em; }
small, .muted { color: var(--muted); }
.muted { font-size: .92em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1rem 0; }
mark, .hl { background: linear-gradient(transparent 50%, var(--marker) 50%); color: inherit; padding: 0 2px; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* ── каркас ── */
.topbar {
  position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  display: flex; align-items: center; gap: .75rem; padding: .55rem 1rem; min-height: 58px;
}
.brand { display: flex; align-items: center; gap: .55rem; color: var(--ink); font: 400 1.25rem/1 var(--f-brand); letter-spacing: .01em; text-decoration: none !important; }
.brand img { height: 30px; width: auto; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--stamp); outline: 1px solid var(--stamp); outline-offset: 2px;
  color: var(--stamp); display: inline-grid; place-items: center; font: 400 13px/1 var(--f-brand); transform: rotate(-12deg); flex: none; margin: 3px;
}
.topbar .spacer { flex: 1; }
.bell { position: relative; color: var(--ink); padding: .3rem; line-height: 0; text-decoration: none !important; }
.bell .count {
  position: absolute; top: -3px; right: -6px; background: var(--bad-fill); color: var(--ink); font: 700 .7rem/18px var(--f-body);
  min-width: 18px; height: 18px; border-radius: 9px; text-align: center; padding: 0 4px; border: 2px solid var(--bg);
}
.avatar {
  width: 36px; height: 36px; border-radius: 50%; background: var(--card); color: var(--ink); box-shadow: var(--shadow);
  display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .8rem; flex: none; text-decoration: none !important;
}
main { max-width: 980px; margin: 0 auto; padding: 1.1rem 1rem; }
main.wide { max-width: 1280px; }

/* нижнее меню на телефоне — плавающая белая плашка */
.nav {
  position: fixed; left: var(--nav-gap); right: var(--nav-gap); bottom: calc(var(--nav-gap) + env(safe-area-inset-bottom)); z-index: 30;
  background: var(--card); border-radius: 22px; box-shadow: 0 6px 24px -8px rgba(22, 22, 22, .25), 0 1px 2px rgba(22, 22, 22, .06);
  display: flex; justify-content: space-around; height: var(--nav-h); padding: 0 .25rem;
}
.nav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--muted); font-size: .7rem; font-weight: 500; text-decoration: none !important; position: relative;
}
.nav a .ico { line-height: 0; }
.nav a.active { color: var(--ink); font-weight: 700; }
.nav a.active .i { stroke-width: 2.4; }
.i { flex: none; vertical-align: middle; }
.nav a .badge { position: absolute; top: 6px; left: 56%; }

@media (min-width: 900px) {
  body { padding-bottom: 0; padding-left: 228px; }
  .nav {
    top: 0; left: 0; bottom: 0; right: auto; width: 228px; height: 100vh; flex-direction: column; justify-content: flex-start; gap: 2px;
    border-radius: 0; box-shadow: none; background: var(--bg); padding: 76px .8rem 1rem;
  }
  .nav a { flex: 0 0 auto; flex-direction: row; justify-content: flex-start; gap: .75rem; font-size: .96rem;
           padding: .6rem .8rem; border-radius: 14px; }
  .nav a:hover { background: color-mix(in srgb, var(--card) 55%, transparent); }
  .nav a.active { background: var(--card); box-shadow: var(--shadow); }
  .nav a .badge { position: static; margin-left: auto; }
  .topbar { margin-left: -228px; padding-left: 1.25rem; }
  main { padding: 1.6rem 1.75rem; }
}

.dev-ribbon { position: fixed; z-index: 100; top: 0; left: 50%; transform: translateX(-50%); background: var(--warn-fill); color: var(--ink);
              font: 700 .72rem/1 var(--f-body); padding: .3rem .8rem; border-radius: 0 0 10px 10px; pointer-events: none; letter-spacing: .02em; }

/* ── карточки ── */
.card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 1.1rem; margin-bottom: 1rem;
}
.card > :last-child { margin-bottom: 0; }
.card-title { display: flex; align-items: center; gap: .5rem; justify-content: space-between; margin-bottom: .6rem; }
.card-title h2, .card-title h3 { margin: 0; }
a.card { color: var(--ink); transition: transform .15s, box-shadow .15s; }
a.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-up); text-decoration: none; }
.grid { display: grid; gap: 1rem; }
@media (min-width: 640px) { .grid.two { grid-template-columns: 1fr 1fr; } }
.grid.three { grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.grid > .card, .grid > div > .card:last-child { margin-bottom: 0; }
.stack > * + * { margin-top: .6rem; }
.row { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.page-head { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; justify-content: space-between; margin-bottom: 1.1rem; }
.page-head h1 { margin: 0; }
.crumbs { font-size: .86rem; color: var(--muted); margin-bottom: .6rem; display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; }
.crumbs a { color: var(--muted); font-weight: 500; }
/* первая ссылка в «хлебных крошках» — заметная кнопка «назад» */
.crumbs > a:first-child { display: inline-flex; align-items: center; gap: .35rem; min-height: 34px; padding: .2rem .8rem .2rem .6rem;
  background: var(--card, #fff); border-radius: 11px; color: var(--ink); box-shadow: var(--shadow, 0 1px 2px rgba(0,0,0,.06)); }
.crumbs > a:first-child::before { content: "←"; font-weight: 600; }
.crumbs > a:first-child:hover { text-decoration: none; background: #E9E9E6; }

.list { list-style: none; margin: 0; padding: 0; }
.list > li, .list > a.item {
  display: flex; gap: .75rem; align-items: center; padding: .75rem 0; border-bottom: 1px solid var(--line); color: var(--ink); font-weight: 400;
}
.list > li:last-child, .list > a.item:last-child { border-bottom: 0; }
.list a.item { border-radius: 12px; transition: background .12s; }
.list a.item:hover { text-decoration: none; background: var(--bg); margin: 0 -.6rem; padding-left: .6rem; padding-right: .6rem; }
.item-main { flex: 1; min-width: 0; }
.item-main .t { font-weight: 600; overflow-wrap: anywhere; color: var(--ink); }
.item-main .s { color: var(--muted); font-size: .86rem; }

.stat { text-align: center; padding: .4rem .2rem; }
.stat .v { font: 700 1.75rem/1.15 var(--f-body); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat .v small { font: 600 .9rem var(--f-body); }
.stat .l { color: var(--muted); font-size: .8rem; line-height: 1.25; margin-top: .2rem; }

/* ── бейджи и сроки ── */
.badge {
  display: inline-flex; align-items: center; gap: .25rem; border-radius: 999px; padding: .14rem .6rem;
  font-size: .76rem; font-weight: 600; background: var(--soft); color: var(--ink); white-space: nowrap;
}
.badge.accent { background: var(--info-soft); color: var(--info); }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.live { background: var(--bad-fill); color: var(--ink); animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .6; } }
.due {
  display: inline-block; font: 600 .76rem/1.2 var(--f-body); color: var(--ink); background: var(--soft);
  padding: .28rem .6rem; border-radius: 999px; white-space: nowrap;
}
.due.soon { color: var(--warn); background: var(--warn-soft); }
.due.late { color: var(--bad); background: var(--bad-soft); }

/* ── печать: круглая, два кольца, надпись по кругу (разметка — templates/parts/stamp.html) ── */
.stamp {
  display: inline-block; width: 7.5rem; aspect-ratio: 1; flex: none; color: var(--stamp); line-height: 0; vertical-align: middle;
  transform: rotate(-12deg); -webkit-mask-image: var(--grain); mask-image: var(--grain); -webkit-mask-size: 160px; mask-size: 160px;
  animation: slam .45s cubic-bezier(.2, .9, .3, 1.3) both;
}
.stamp svg { width: 100%; height: 100%; display: block; overflow: visible; }
.stamp text { fill: currentColor; }
.stamp .ring { font: 700 10px var(--f-body); }
.stamp .main { font: 400 15.5px var(--f-brand); }
.stamp .sub { font: 700 9.5px var(--f-body); }
.stamp.small { width: 3.9rem; }
.stamp.small .ring { display: none; }   /* маленькой печати хватает колец и центра */
.stamp.small .main { font-size: 17px; }
.stamp.big { width: 10.5rem; }
.stamp.bad { color: var(--bad); }
@keyframes slam {
  0% { opacity: 0; transform: rotate(-12deg) scale(2.3); }
  70% { opacity: 1; transform: rotate(-12deg) scale(.93); }
  100% { transform: rotate(-12deg) scale(1); }
}
.stamp.still { animation: none; }

/* ── кнопки и формы ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 44px;
  padding: .5rem 1.05rem; border-radius: 14px; border: 0; background: var(--soft);
  color: var(--ink); font: 600 .95rem/1.2 var(--f-body); cursor: pointer; text-decoration: none !important;
  transition: background .12s, transform .08s;
}
.btn:hover { background: #E1E1DD; }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--ink); color: #fff; }
.btn.primary:hover { background: #333331; }
.btn.danger { color: var(--bad); background: var(--bad-soft); }
.btn.small { min-height: 34px; padding: .25rem .75rem; font-size: .85rem; border-radius: 11px; }
.btn.block { width: 100%; }
.btn.tg { background: #229ED9; color: #fff; }
.btn.vk { background: #0077FF; color: #fff; }
.vk-mark { font: 800 .8rem/1 var(--f-body); background: #fff; color: #0077FF; border-radius: 6px; padding: .22rem .3rem; letter-spacing: .02em; }
.social { display: grid; gap: .55rem; margin-top: .9rem; }
.social .consent { font-size: .8rem; margin: .2rem 0 0; }
.btn[disabled], .btn.disabled { opacity: .5; pointer-events: none; }
.card .btn:not(.primary):not(.danger):not(.tg):not(.vk) { background: var(--soft); }

label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .3rem; }
.field { margin-bottom: .95rem; }
.field .help { font-size: .82rem; color: var(--muted); margin-top: .3rem; }
.field .err, .errorlist { color: var(--bad); font-size: .85rem; font-weight: 600; list-style: none; padding: 0; margin: .3rem 0 0; }
input:not([type]), input[type=text], input[type=email], input[type=password], input[type=url], input[type=number],
input[type=datetime-local], input[type=date], input[type=time], select, textarea {
  width: 100%; min-height: 46px; padding: .55rem .85rem; border-radius: 12px; border: 1.5px solid transparent;
  background: var(--soft); color: var(--ink); font: 500 16px var(--f-body); /* 16px — iOS не зумит */
  transition: border-color .12s, background .12s;
}
textarea { min-height: 96px; resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ink); background: var(--card); }
input[type=checkbox] { width: 20px; height: 20px; vertical-align: middle; accent-color: var(--ink); }
input[type=file] { font: inherit; max-width: 100%; }
.check { display: flex; gap: .5rem; align-items: center; font-weight: 600; }
.form-narrow { max-width: 430px; margin: 0 auto; }

.messages { list-style: none; padding: 0; margin: 0 0 1rem; }
.messages li { padding: .75rem 1rem; border-radius: 14px; background: var(--card); box-shadow: var(--shadow); margin-bottom: .5rem; font-weight: 600; }
.messages li.error { background: var(--bad-soft); color: var(--bad); box-shadow: none; }
.messages li.success { background: var(--ok-soft); color: var(--ok); box-shadow: none; }

/* вкладки — сегменты */
.tabs {
  display: flex; gap: .2rem; overflow-x: auto; margin-bottom: 1rem; scrollbar-width: none;
  width: max-content; max-width: 100%; padding: 4px; border-radius: 14px; background: #E4E4E1;
}
.tabs a { padding: .5rem .95rem; color: var(--muted); white-space: nowrap; border-radius: 11px; font-weight: 600; font-size: .92rem; }
.tabs a:hover { text-decoration: none; color: var(--ink); }
.tabs a.active { color: var(--ink); background: var(--card); box-shadow: 0 1px 3px rgba(22, 22, 22, .1); text-decoration: none; }

.empty { text-align: center; color: var(--muted); padding: 1.8rem 1rem; }
.empty .big { font-size: 2.2rem; }

/* ── задачи ── */
.task { scroll-margin-top: 74px; position: relative; }
.task-head { display: flex; gap: .45rem; align-items: center; flex-wrap: wrap; margin-bottom: .6rem; }
.task-n {
  min-width: 36px; height: 36px; border-radius: 11px; background: var(--ink); color: #fff; font: 700 .95rem/1 var(--f-body);
  display: inline-flex; align-items: center; justify-content: center; padding: 0 .45rem; flex: none; font-variant-numeric: tabular-nums;
}
.task.ok .task-n { background: var(--ok-soft); color: var(--ok); }
.task.bad .task-n { background: var(--bad-soft); color: var(--bad); }
.task-n.kind-homework { background: var(--info-soft); color: var(--info); }
.task-n.kind-classwork { background: var(--ok-soft); color: var(--ok); }
.task-n.kind-mock { background: var(--warn-soft); color: var(--warn); }
.task-n.kind-practice { background: var(--soft); color: var(--ink); }
.task-stamp { position: absolute; top: .5rem; right: .7rem; pointer-events: none; }
.task-text { overflow-wrap: anywhere; line-height: 1.55; }
.task-text table { border-collapse: collapse; margin: .5rem 0; max-width: 100%; display: block; overflow-x: auto; }
.task-text td, .task-text th { border: 1px solid #CFCFCA; padding: .3rem .5rem; }
.figure { margin: .75rem 0; overflow-x: auto; text-align: center; background: #fff; border-radius: 14px; border: 1px solid var(--line); padding: .5rem; }
.figure svg { max-width: 100%; height: auto; max-height: 340px; }
.options { margin: .5rem 0 .75rem; padding-left: 1.6rem; }
.options li { margin-bottom: .35rem; }
.options li::marker { font-weight: 700; }
.match { display: grid; gap: .75rem; margin: .5rem 0 .75rem; }
@media (min-width: 640px) { .match { grid-template-columns: 1fr 1fr; } }
.match h4 { margin: 0 0 .3rem; font-size: .74rem; text-transform: uppercase; color: var(--muted); letter-spacing: .06em; }
.match ol { margin: 0; padding-left: 1.6rem; }
.match ol li::marker { font-weight: 700; }
.match ol.letters { list-style: none; padding-left: 0; }
.match ol.letters li::before { content: attr(data-l) ") "; font-weight: 700; }
.answer-row { display: flex; gap: .5rem; align-items: stretch; margin-top: .85rem; }
.answer-row input { flex: 1 1 auto; min-width: 0; width: auto; font-size: 1.15rem; font-weight: 700; letter-spacing: .04em; }
.answer-row .unit { align-self: center; color: var(--muted); font-weight: 600; }
.verdict { margin-top: .8rem; padding: .65rem .9rem; border-radius: 14px; font-weight: 600; }
.verdict.ok { background: var(--ok-soft); color: var(--ok); }
.verdict.bad { background: var(--bad-soft); color: var(--bad); }
.verdict.wait { background: var(--warn-soft); color: var(--warn); }
.verdict b { color: var(--ink); }
.solution { margin-top: .8rem; border-left: 3px solid var(--line); padding: .2rem 0 .2rem .85rem; }
.solution summary { cursor: pointer; font-weight: 700; }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: .5rem; margin-top: .6rem; }
.photos a, .photos .ph { display: block; aspect-ratio: 1; border-radius: 14px; overflow: hidden; background: var(--soft); position: relative; }
.photos img { width: 100%; height: 100%; object-fit: cover; }
.upload-btn input { display: none; }

.sticky-actions {
  position: sticky; bottom: calc(var(--nav-h) + var(--nav-gap) * 2 + env(safe-area-inset-bottom)); z-index: 10;
  background: var(--card); border-radius: 18px; box-shadow: var(--shadow-up);
  padding: .6rem .8rem; display: flex; gap: .75rem; align-items: center; justify-content: space-between; flex-wrap: wrap;
}
@media (min-width: 900px) { .sticky-actions { bottom: 1rem; } }
.timer { font: 700 1.15rem/1 var(--f-body); font-variant-numeric: tabular-nums; }
.timer.low { color: var(--bad); }

/* прогресс: пастельные полоски */
.progress { height: 10px; border-radius: 99px; background: var(--soft); overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--info-fill); border-radius: inherit; }
.progress.ok > i { background: var(--ok-fill); }
.progress.warn > i { background: var(--warn-fill); }
.progress.bad > i { background: var(--bad-fill); }

/* карта по № КИМ */
.kim-map { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: .45rem; }
.kim-cell { border-radius: 14px; padding: .55rem .25rem; text-align: center; }
.kim-cell .n { font: 600 .82rem var(--f-body); opacity: .8; }
.kim-cell .p { font-size: .95rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.kim-cell.l0 { color: var(--muted); background: transparent; border: 1.5px dashed #D2D2CD; }
.kim-cell.l1 { color: var(--bad); background: var(--bad-soft); }
.kim-cell.l2 { color: var(--warn); background: var(--warn-soft); }
.kim-cell.l3 { color: var(--ok); background: var(--ok-soft); }

/* таблицы */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.t { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.t th, table.t td { padding: .55rem .6rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
table.t th { color: var(--muted); font-weight: 600; font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; }
table.t.board { width: auto; min-width: 50%; }
table.board td.c { text-align: center; width: 40px; padding: .25rem; }
.dot { display: inline-block; width: 28px; height: 28px; border-radius: 8px; background: var(--soft); line-height: 28px; text-align: center; font-size: .75rem; font-weight: 700; }
.dot.ok { background: var(--ok-soft); color: var(--ok); }
.dot.part { background: var(--warn-soft); color: var(--warn); }
.dot.bad { background: var(--bad-soft); color: var(--bad); }
.dot.try { background: var(--warn-soft); color: var(--warn); box-shadow: inset 0 0 0 1.5px var(--warn-fill); }
.dot.wait { background: var(--info-soft); color: var(--info); }
table.board th.sticky, table.board td.sticky { position: sticky; left: 0; background: var(--card); z-index: 1; }

/* документ и видео */
.doc-pages { display: flex; flex-direction: column; gap: .8rem; align-items: center; }
.doc-pages img { width: 100%; max-width: 900px; height: auto; background: #fff; border-radius: 10px; box-shadow: var(--shadow); }
.video-box { position: relative; aspect-ratio: 16/9; max-width: 100%; background: #000; border-radius: 16px; overflow: hidden; }
.video-box iframe, .video-box video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.live-banner {
  display: flex; gap: .75rem; align-items: center; justify-content: space-between; flex-wrap: wrap;
  background: var(--ink); color: #fff; border-radius: var(--radius); padding: .95rem 1.1rem; margin-bottom: 1rem;
}
.live-banner small { color: inherit; opacity: .8; }
.live-banner a.btn { background: var(--card); color: var(--ink); }
.copy { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .85rem; background: var(--bg); border: 1px dashed #CFCFCA;
        border-radius: 10px; padding: .5rem .65rem; overflow-wrap: anywhere; }
pre.copy { white-space: pre-wrap; }
code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .9em; background: var(--soft); padding: .05rem .3rem; border-radius: 5px; }

/* вход */
.auth-wrap { min-height: 82vh; display: flex; align-items: center; justify-content: center; }
.auth-brand { display: flex; align-items: center; gap: .7rem; font: 400 1.9rem/1 var(--f-brand); margin-bottom: 1.2rem; }
.auth-brand .brand-mark { width: 42px; height: 42px; font-size: 18px; border-width: 2.5px; outline-offset: 3px; }
.or { display: flex; align-items: center; gap: .75rem; color: var(--muted); margin: 1rem 0; font-size: .88rem; font-weight: 600; }
.or::before, .or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }

.greet { font-size: 1.7rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; margin: 0 0 1.1rem; }
.htmx-request .spin, .htmx-request.spin { opacity: .6; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition: none !important; } }

/* доска: в клетке — сам ответ ученика */
table.board td.c { width: auto; min-width: 46px; }
.dot { width: auto; min-width: 34px; padding: 0 .4rem; white-space: nowrap; max-width: 8ch; overflow: hidden; text-overflow: ellipsis; }
.who { font-weight: 600; }
.ans-val { font: 700 1.3rem/1.2 var(--f-body); letter-spacing: .03em; overflow-wrap: anywhere; }

/* статистика урока */
.grid.four-stats { grid-template-columns: repeat(2, 1fr); gap: .5rem; }
@media (min-width: 640px) { .grid.four-stats { grid-template-columns: repeat(4, 1fr); } }
.insights { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.insights li { padding: .65rem .85rem .65rem 2.1rem; border-radius: 14px; position: relative; font-weight: 500; line-height: 1.4; }
.insights li::before { position: absolute; left: .8rem; top: .63rem; font-weight: 700; }
.insights li.bad { background: var(--bad-soft); color: var(--bad); }
.insights li.bad::before { content: "!"; }
.insights li.warn { background: var(--warn-soft); color: var(--warn); }
.insights li.warn::before { content: "•"; }
.insights li.ok { background: var(--ok-soft); color: var(--ok); }
.insights li.ok::before { content: "✓"; }
.task-stats { display: grid; gap: .3rem; }
.ts { padding: .7rem 0; border-bottom: 1px solid var(--line); }
.ts:last-child { border-bottom: 0; }
.ts-head { display: flex; gap: .75rem; align-items: center; }
.ts-main { flex: 1; min-width: 0; display: grid; gap: .2rem; }
.ts-bar { display: flex; gap: .6rem; align-items: center; }
.ts-bar .progress { flex: 1; }
.ts-bar b { min-width: 3.2ch; text-align: right; font-variant-numeric: tabular-nums; }
.ts.hard .task-n { background: var(--bad-soft); color: var(--bad); }
.ts-wrong { margin: .45rem 0 0 calc(36px + .75rem); display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; font-size: .88rem; }
.wrong-chip { color: var(--bad); border-radius: 999px; padding: .08rem .6rem; background: var(--bad-soft); cursor: help; }

/* звёзды */
.star-chip { font: 700 .92rem/1 var(--f-body); color: var(--ink); border-radius: 999px; padding: .45rem .75rem;
             background: var(--marker); text-decoration: none !important; white-space: nowrap; }
.star-pop { position: absolute; right: .2rem; top: 3rem; font: 700 1rem var(--f-body); color: var(--stamp); animation: starpop 1.2s ease-out both; }
@keyframes starpop { 0% { opacity: 0; transform: translateY(8px) scale(.6); } 30% { opacity: 1; transform: translateY(0) scale(1.15); } 100% { opacity: 0; transform: translateY(-18px); } }
.stars-hero .star-big { font: 700 2.6rem/1.1 var(--f-body); letter-spacing: -.02em; }
.prize-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.prize { display: grid; gap: .4rem; align-content: start; margin: 0; }
.prize img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 14px; }
.prize h3 { margin: 0; }
.star-cost { font: 700 1.1rem var(--f-body); }

/* сводная статистика */
table.matrix td.c, table.matrix th.c { text-align: center; padding: .3rem .25rem; }
table.matrix th.sticky, table.matrix td.sticky { position: sticky; left: 0; background: var(--card); z-index: 1; min-width: 150px; }
.cell { display: inline-block; min-width: 38px; padding: .2rem .35rem; border-radius: 8px; font-weight: 700; font-size: .82rem; font-variant-numeric: tabular-nums; }
.cell.l0 { color: var(--muted); }
.cell.l1 { background: var(--bad-soft); color: var(--bad); }
.cell.l2 { background: var(--warn-soft); color: var(--warn); }
.cell.l3 { background: var(--ok-soft); color: var(--ok); }
.cell.late { box-shadow: inset 0 0 0 1.5px var(--bad-fill); }
tr.foot td { border-top: 1.5px solid #CFCFCA; font-weight: 700; }
.tnum { font-variant-numeric: tabular-nums; }

/* программы */
.kim-pick { display: flex; flex-wrap: wrap; gap: .4rem; }
.kim-box { display: inline-flex; margin: 0; cursor: pointer; }
.kim-box input { position: absolute; opacity: 0; }
.kim-box span { border-radius: 10px; padding: .35rem .6rem; font: 600 .85rem var(--f-body); background: var(--soft); }
.kim-box input:checked + span { background: var(--bad-soft); color: var(--bad); text-decoration: line-through; }
.kim-box input:focus-visible + span { outline: 2px solid var(--ink); }
.prog-chip { border: 1.5px dashed #C9C9C4; background: transparent; color: var(--muted); border-radius: 999px; padding: .1rem .55rem;
             font: 600 .74rem var(--f-body); cursor: pointer; }
.prog-chip.on { border-style: solid; border-color: transparent; color: var(--info); background: var(--info-soft); }

/* оплата */
.price-row { display: flex; gap: .7rem; align-items: baseline; flex-wrap: wrap; margin: .4rem 0; }
.t-price { font: 700 1.5rem var(--f-body); white-space: nowrap; letter-spacing: -.02em; }
.offer h3 { margin-top: 1.2rem; }

/* конструктор и банк задач */
.bank-task { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .8rem; align-items: start; cursor: pointer; font-weight: 400; }
.bank-task input { margin-top: .4rem; }
.bank-task:has(input:checked) { box-shadow: 0 0 0 2px var(--ink), var(--shadow); }
.field ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .3rem 1rem; }
.field ul label { font-weight: 500; display: flex; gap: .35rem; align-items: center; }
.figure img { max-width: 100%; height: auto; }

/* файлы и код урока */
.file-ext { font: 700 .72rem var(--f-body); background: var(--soft); border-radius: 9px; padding: .4rem .45rem; min-width: 44px; text-align: center; text-transform: uppercase; }
.snippet { margin-top: .9rem; }
.snippet pre { margin: .5rem 0 0; border-radius: 14px; overflow-x: auto; max-height: 460px; border: 1px solid var(--line); }
.snippet pre code { display: block; padding: .8rem 1rem; font: 13.5px/1.5 ui-monospace, Menlo, Consolas, monospace; white-space: pre; }

/* нейро-помощник */
.chat { display: flex; flex-direction: column; gap: .6rem; max-height: 60vh; overflow-y: auto; }
.msg { max-width: 85%; padding: .65rem .9rem; border-radius: 18px; line-height: 1.45; overflow-wrap: anywhere; }
.msg.me { align-self: flex-end; background: var(--ink); color: #fff; border-bottom-right-radius: 6px; }
.msg.me .muted { color: inherit; opacity: .75; }
.msg.bot { align-self: flex-start; background: var(--card); box-shadow: var(--shadow); border-bottom-left-radius: 6px; }
.msg.err { background: var(--bad-soft); color: var(--bad); box-shadow: none; }
.chat-form { display: flex; gap: .5rem; align-items: stretch; position: sticky; bottom: calc(var(--nav-h) + var(--nav-gap) * 2 + env(safe-area-inset-bottom)); }
.chat-form textarea { min-height: 52px; flex: 1; background: var(--card); box-shadow: var(--shadow); }
@media (min-width: 900px) { .chat-form { bottom: 1rem; } }
.assist-card { display: grid; gap: .2rem; color: var(--ink); text-decoration: none !important; box-shadow: none; border: 1.5px dashed #CFCFCA; background: transparent; }

/* подсказки после неверной попытки */
.hint { margin-top: .6rem; padding: .65rem .9rem; border-radius: 14px; background: var(--marker); color: var(--ink); line-height: 1.45; }
.hint b { display: block; font: 700 .74rem/1 var(--f-body); letter-spacing: .06em; text-transform: uppercase; margin-bottom: .35rem; }

/* анимированный прогресс: урок, курс, тренажёр */
.progress > i[data-pct] { width: 0; transition: width .9s cubic-bezier(.2, .8, .2, 1); }
@media (prefers-reduced-motion: reduce) { .progress > i[data-pct] { transition: none; } }
.lp { display: grid; gap: .55rem; }
.lp-row { display: grid; grid-template-columns: 7.5rem 1fr auto; gap: .7rem; align-items: center; font-size: .88rem; }
.lp-row b { font-variant-numeric: tabular-nums; min-width: 3.4ch; text-align: right; }
.lp-row.total { font-weight: 700; }
.mini-progress { height: 6px; margin-top: .4rem; }
details.block { padding: 0; }
details.block > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: .6rem; padding: 1rem 1.1rem; }
details.block > summary::-webkit-details-marker { display: none; }
details.block > summary h2 { margin: 0; flex: 1; }
details.block > summary::after { content: ""; width: 9px; height: 9px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg) translate(-2px, -2px); transition: transform .2s; margin-right: .3rem; }
details.block:not([open]) > summary::after { transform: rotate(-45deg); }
details.block > .block-body { padding: 0 1.1rem 1.1rem; }
.topic-head { margin: 1.5rem 0 .55rem .2rem; font: 700 .76rem var(--f-body); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.mock-card .big { font: 700 2.6rem/1 var(--f-body); letter-spacing: -.03em; }
.mock-card .delta.up { color: var(--ok); } .mock-card .delta.down { color: var(--bad); }
.kim-cell.l0 .p { opacity: .6; }
.block-body > .card, .block-body > .list { box-shadow: none; padding: 0; margin: 0 0 1rem; background: transparent; border-radius: 0; }
.block-body > .card:last-child { margin-bottom: 0; }
details.cheat { border-radius: 14px; padding: .6rem .9rem; margin-bottom: 1rem; background: var(--bg); }
details.cheat > summary { cursor: pointer; font-weight: 600; }
details.cheat[open] > summary { margin-bottom: .5rem; }

/* страницы ошибок (403/404/500) */
.err-page { text-align: center; padding: 2rem 1.2rem; margin-top: 1.5rem; }
.err-page .err-code { display: inline-block; font-size: .8rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  color: var(--muted); background: var(--soft); border-radius: 999px; padding: .25rem .8rem; margin-bottom: .8rem; }
.err-page h1 { margin: 0 0 .6rem; }
.err-page .row { margin-top: 1.2rem; }

/* всплывающие сообщения об ошибках запросов (app.js toast) */
.toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + var(--nav-gap) * 2 + env(safe-area-inset-bottom, 0px));
  z-index: 100; display: flex; flex-direction: column; gap: .5rem; width: min(440px, calc(100vw - 32px)); }
.toast { background: var(--ink); color: #fff; border-radius: 14px; padding: .75rem 1rem; box-shadow: var(--shadow-up); font-size: .92rem; cursor: pointer; }
.toast.bad { background: var(--bad); }

/* число подтверждения входа через Telegram */
.tg-confirm { font: 700 2.6rem var(--f-body); letter-spacing: .12em; margin: .4rem 0 .6rem; }
