/* ==========================================================================
   «Твёрдый знак» — единая таблица стилей.
   Токены и размеры перенесены из утверждённого макета design/main-hero.dc.html.
   Радиусы везде 0 — брендовая «печатная» геометрия, кроме круглой кнопки темы.
   ========================================================================== */

/* ─── Шрифты (self-hosted, без запросов к сторонним доменам) ─────────────── */
@font-face {
  font-family: 'Constantine';
  src: url("../fonts/constantine-regular.017150764ece.woff2") format('woff2');
  font-weight: 400; font-display: swap;
}
@font-face {
  font-family: 'Constantine';
  src: url("../fonts/constantine-bold.67306620913e.woff2") format('woff2');
  font-weight: 700; font-display: swap;
}
@font-face {
  font-family: 'Bebas Cyr';
  src: url("../fonts/bebas-cyr.bdd1e6a9a470.woff2") format('woff2');
  font-weight: 400; font-display: swap;
}
@font-face {
  font-family: 'Manrope';
  src: url("../fonts/manrope-var-cyrillic.e58febde317b.woff2") format('woff2');
  font-weight: 400 700; font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Manrope';
  src: url("../fonts/manrope-var-latin.938c6e8019b6.woff2") format('woff2');
  font-weight: 400 700; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
                 U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
                 U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ─── Токены темы ────────────────────────────────────────────────────────── */
:root {
  --paper: #F5F1EA;
  --surface: #FFFFFF;
  --line: #E4DED3;
  /* Для клеток таблиц: тонкая линия текста здесь теряется. */
  --line-strong: #CFC5B6;
  --ink: #23201D;
  --ink-2: #4A443D;
  --ink-3: #8A837A;
  --accent: #E8783C;
  --accent-2: #C75B21;
  --mark: rgba(232, 120, 60, .045);
  --paper-blend: multiply;
  /* Текстура: крупные заломы + мелкое зерно. Меняется одной строкой.
     В светлой теме плотнее: multiply по светлой бумаге почти не читается. */
  --paper-texture: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%27420%27%20height%3D%27420%27%3E%3Cfilter%20id%3D%27c%27%20x%3D%270%27%20y%3D%270%27%20width%3D%27100%25%27%20height%3D%27100%25%27%3E%3CfeTurbulence%20type%3D%27fractalNoise%27%20baseFrequency%3D%270.008%27%20numOctaves%3D%272%27%20seed%3D%277%27%20stitchTiles%3D%27stitch%27%2F%3E%3CfeColorMatrix%20type%3D%27saturate%27%20values%3D%270%27%2F%3E%3C%2Ffilter%3E%3Cfilter%20id%3D%27g%27%20x%3D%270%27%20y%3D%270%27%20width%3D%27100%25%27%20height%3D%27100%25%27%3E%3CfeTurbulence%20type%3D%27fractalNoise%27%20baseFrequency%3D%270.9%27%20numOctaves%3D%272%27%20seed%3D%273%27%20stitchTiles%3D%27stitch%27%2F%3E%3CfeColorMatrix%20type%3D%27saturate%27%20values%3D%270%27%2F%3E%3C%2Ffilter%3E%3Crect%20width%3D%27420%27%20height%3D%27420%27%20filter%3D%27url%28%23c%29%27%20opacity%3D%270.3%27%2F%3E%3Crect%20width%3D%27420%27%20height%3D%27420%27%20filter%3D%27url%28%23g%29%27%20opacity%3D%270.1%27%2F%3E%3C%2Fsvg%3E");
  --track: #EFEAE1;
  --thumb-ring: #F5F1EA;
  --peach: #F8D9C2;
  --peach-soft: #F8EFE6;
  --grey: #B4B0AA;
  --ok: #2E7D53;
  --warn: #B4541C;
  --pad-y: clamp(26px, 4vw, 64px);
  --pad-x: clamp(16px, 4vw, 56px);
  --gap: clamp(28px, 4vw, 64px);
  --header-h: 73px;
}
[data-theme="dark"] {
  --paper: #1B1917;
  --surface: #252220;
  --line: #3A352F;
  --line-strong: #4C463E;
  --ink: #F5F1EA;
  --ink-2: #D6CFC4;
  --ink-3: #A39B90;
  --accent: #E8783C;
  --accent-2: #F0B98F;
  --mark: rgba(232, 120, 60, .05);
  --paper-blend: screen;
  --paper-texture: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%27420%27%20height%3D%27420%27%3E%3Cfilter%20id%3D%27c%27%20x%3D%270%27%20y%3D%270%27%20width%3D%27100%25%27%20height%3D%27100%25%27%3E%3CfeTurbulence%20type%3D%27fractalNoise%27%20baseFrequency%3D%270.008%27%20numOctaves%3D%272%27%20seed%3D%277%27%20stitchTiles%3D%27stitch%27%2F%3E%3CfeColorMatrix%20type%3D%27saturate%27%20values%3D%270%27%2F%3E%3C%2Ffilter%3E%3Cfilter%20id%3D%27g%27%20x%3D%270%27%20y%3D%270%27%20width%3D%27100%25%27%20height%3D%27100%25%27%3E%3CfeTurbulence%20type%3D%27fractalNoise%27%20baseFrequency%3D%270.9%27%20numOctaves%3D%272%27%20seed%3D%273%27%20stitchTiles%3D%27stitch%27%2F%3E%3CfeColorMatrix%20type%3D%27saturate%27%20values%3D%270%27%2F%3E%3C%2Ffilter%3E%3Crect%20width%3D%27420%27%20height%3D%27420%27%20filter%3D%27url%28%23c%29%27%20opacity%3D%270.1%27%2F%3E%3Crect%20width%3D%27420%27%20height%3D%27420%27%20filter%3D%27url%28%23g%29%27%20opacity%3D%270.045%27%2F%3E%3C%2Fsvg%3E");
  --track: #332E29;
  --thumb-ring: #1B1917;
  --peach: #3A2A20;
  --peach-soft: #241F1B;
  --ok: #63B98A;
  --warn: #F0B98F;
}

/* ─── База ───────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
/* Декоративный «Ъ» намеренно выходит за край макета. clip, а не hidden:
   hidden сломал бы position: sticky у шапки. Нужен и на html, и на body —
   иначе горизонтальный скролл остаётся на корневом элементе. */
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; overflow-x: clip; }
body {
  margin: 0;
  overflow-x: clip;
  color: var(--ink);

  /* Фактура слегка мятой бумаги из брендбука. Рисуется браузером из SVG
     в data-URI: ни одного запроса, около килобайта, масштабируется без
     потерь. Крупная турбулентность даёт мягкие заломы, мелкая — зерно.
     Светлая тема затемняет фактуру (multiply), тёмная подсвечивает (screen),
     поэтому картинка одна на обе темы. */
  background-color: var(--paper);
  background-image: var(--paper-texture);
  background-size: 420px 420px;
  background-blend-mode: var(--paper-blend);
  font-family: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background .35s ease, color .35s ease;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  body, * { transition: none !important; animation: none !important; }
}
a { color: var(--accent-2); text-decoration: none; }
a:hover { color: var(--accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3 { margin: 0; }
p { margin: 0; }

.container { max-width: 1440px; margin: 0 auto; }
.section { padding: var(--pad-y) var(--pad-x); }
.section + .section { border-top: 1px solid var(--line); }
[id] { scroll-margin-top: calc(var(--header-h) + 12px); }
.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 8px; top: 8px; z-index: 100; background: var(--surface); padding: 10px 14px; border: 1px solid var(--accent); }

.h-display { font-family: 'Constantine', Georgia, serif; font-weight: 700; letter-spacing: -.01em; }
h1.h-display { font-size: clamp(40px, 6vw, 86px); line-height: 1; text-wrap: balance; }
h2.h-display { font-size: clamp(28px, 3.4vw, 48px); line-height: 1.05; text-wrap: balance; }
.kicker {
  font-family: 'Bebas Cyr', Impact, sans-serif;
  font-size: clamp(14px, 1.2vw, 17px);
  letter-spacing: .14em;
  color: var(--accent-2);
  text-transform: uppercase;
}
.label { font-family: 'Bebas Cyr', Impact, sans-serif; letter-spacing: .08em; text-transform: uppercase; }
.lead { font-size: clamp(17px, 1.35vw, 20px); line-height: 1.5; color: var(--ink-2); text-wrap: pretty; }
.muted { color: var(--ink-3); }
.small { font-size: 14px; }
.numeral { font-family: 'Bebas Cyr', Impact, sans-serif; line-height: .9; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack--lg { gap: 20px; }

/* ─── Шапка ──────────────────────────────────────────────────────────────── */
.site-header {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px var(--pad-x);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: var(--paper); z-index: 20;
}
.logo { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.logo__mark { font-family: 'Constantine', Georgia, serif; font-weight: 700; font-size: 34px; line-height: .8; color: var(--accent); }
.logo__text { font-family: 'Bebas Cyr', Impact, sans-serif; font-size: 15px; letter-spacing: .16em; line-height: 1.1; }
.site-nav {
  display: flex; gap: 22px; align-items: center; flex: 1 1 auto; justify-content: center;
  overflow-x: auto; white-space: nowrap; scrollbar-width: none;
  /* Без min-width: 0 flex-элемент не сжимается меньше своего min-content,
     и nowrap-навигация растягивает всю страницу на мобильном. */
  min-width: 0;
}
.site-nav::-webkit-scrollbar { display: none; }
.site-nav a { font-size: 15px; color: var(--ink-2); min-height: 44px; display: flex; align-items: center; }
.header-actions { display: flex; align-items: center; gap: 10px; }
.nav-toggle {
  display: none;
  width: 44px; height: 44px; flex: 0 0 auto;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  cursor: pointer; align-items: center; justify-content: center;
}
.nav-toggle__bars, .nav-toggle__bars::before, .nav-toggle__bars::after {
  display: block; width: 20px; height: 2px; background: currentColor;
  transition: transform .2s ease, opacity .2s ease;
}
.nav-toggle__bars { position: relative; }
.nav-toggle__bars::before, .nav-toggle__bars::after { content: ''; position: absolute; left: 0; }
.nav-toggle__bars::before { top: -6px; }
.nav-toggle__bars::after { top: 6px; }
/* Открытое меню — крестик: понятно, что кнопка закроет, а не откроет ещё раз. */
.site-header.is-open .nav-toggle__bars { background: transparent; }
.site-header.is-open .nav-toggle__bars::before { transform: translateY(6px) rotate(45deg); }
.site-header.is-open .nav-toggle__bars::after { transform: translateY(-6px) rotate(-45deg); }

.theme-toggle {
  width: 44px; height: 44px; border: 1px solid var(--line); background: var(--surface);
  color: var(--ink); cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: 19px; font-family: inherit; border-radius: 50%;
}

/* ─── Кнопки ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 18px; border: 1px solid transparent;
  font: inherit; font-size: 15px; font-weight: 600; cursor: pointer;
  background: var(--accent); color: #FFF; border-radius: 0;
  transition: background .2s ease, border-color .2s ease, color .2s ease;
}
.btn:hover { background: var(--accent-2); color: #FFF; }
.btn--lg { min-height: 56px; padding: 0 28px; font-size: 17px; }
.btn--grow { flex: 1 1 260px; }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { background: transparent; color: var(--ink); border-color: var(--accent); }
.btn--quiet { background: var(--surface); color: var(--ink); border-color: var(--line); font-weight: 500; }
.btn--quiet:hover { background: var(--surface); color: var(--ink); border-color: var(--accent); }
/* Мелкая кнопка — только там, где их в строке несколько подряд. Палец
   всё равно должен попадать: 36px это нижняя граница, а не «поменьше». */
.btn--sm { min-height: 36px; padding: 0 12px; font-size: 14px; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

/* ─── Первый экран ───────────────────────────────────────────────────────── */
.hero {
  display: flex; flex-wrap: wrap; gap: var(--gap);
  padding: var(--pad-y) var(--pad-x) clamp(40px, 5vw, 80px);
  max-width: 1440px; margin: 0 auto; align-items: flex-start;
}
.hero__left { flex: 1 1 340px; min-width: 300px; display: flex; flex-direction: column; gap: 20px; position: relative; }
.hero__left > * { position: relative; z-index: 1; }
/* Водяной знак уходит ПОД текст, а не в просвет справа: в просвете он
   перетягивал внимание на себя. Прозрачность задаётся токеном --mark. */
.hero__mark {
  position: absolute; left: -46px; top: 30px; right: auto;
  z-index: 0;
  font-family: 'Constantine', Georgia, serif; font-weight: 700;
  font-size: clamp(240px, 26vw, 420px); line-height: .7;
  color: var(--mark); pointer-events: none; user-select: none;
}
.hero__price { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; padding-top: 4px; }
.hero__price .numeral { font-size: clamp(44px, 4.4vw, 64px); }
.stamps { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 8px; }
.stamp { font-size: 15px; color: var(--ink-2); border: 1px solid var(--line); padding: 9px 14px; }

/* ─── Панель 100-балльной шкалы ──────────────────────────────────────────── */
.scale-panel {
  flex: 1 1 320px; min-width: 300px; max-width: 520px;
  background: var(--surface); border: 1px solid var(--line);
  padding: clamp(18px, 2vw, 28px); display: flex; flex-direction: column; gap: 14px;
}
.scale-panel__head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.scale-panel__head .label { font-size: 20px; }
.scale-panel__value { display: flex; align-items: baseline; gap: 12px; }
.scale-panel__value .numeral { font-size: clamp(56px, 6vw, 80px); line-height: .85; color: var(--accent); }
.scale-track { position: relative; height: 44px; }
.scale-ticks { position: absolute; left: 0; right: 0; top: 9px; display: flex; gap: 3px; }
.scale-ticks span { flex: 1; height: 26px; background: var(--track); }
.scale-ticks span.is-on { background: var(--accent); }
.scale-hint { font-size: 16px; line-height: 1.5; color: var(--ink-2); min-height: 72px; text-wrap: pretty; }
.scale-rows { border-top: 1px solid var(--line); padding-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.scale-row { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; }
.scale-row__label { color: var(--ink-2); }
.scale-row__value { font-weight: 600; }

input[type=range] {
  -webkit-appearance: none; appearance: none; background: transparent;
  position: absolute; left: 0; top: 0; width: 100%; height: 44px; margin: 0;
}
input[type=range]::-webkit-slider-runnable-track { height: 44px; background: transparent; }
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 44px; height: 44px; border-radius: 50%;
  background: var(--accent); border: 5px solid var(--thumb-ring);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .28); cursor: grab;
}
input[type=range]::-moz-range-track { height: 44px; background: transparent; }
input[type=range]::-moz-range-thumb {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--accent); border: 5px solid var(--thumb-ring);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .28); cursor: grab;
}

/* ─── Сетки и карточки ───────────────────────────────────────────────────── */
.grid { display: flex; flex-wrap: wrap; gap: clamp(16px, 2vw, 24px); }
.grid > * { flex: 1 1 300px; }
.grid--tight > * { flex: 1 1 220px; }
.card { background: var(--surface); border: 1px solid var(--line); padding: clamp(16px, 2vw, 24px); }
.card--flat { background: transparent; }
.card__title { font-size: 17px; font-weight: 700; margin-bottom: 6px; }
.section__head { display: flex; flex-direction: column; gap: 10px; margin-bottom: clamp(20px, 3vw, 32px); max-width: 760px; }

.compare { display: flex; border: 1px solid var(--line); flex-wrap: wrap; }
.compare__cell { flex: 1 1 220px; padding: 18px 20px; }
.compare__cell + .compare__cell { border-left: 1px solid var(--line); }
.compare__cell--accent { background: var(--accent); color: #FFF; border-left-color: var(--accent); }
.compare__cell--accent .compare__label { color: rgba(255, 255, 255, .85); }
.compare__label { font-size: 13px; color: var(--ink-3); }
.compare__sum { font-family: 'Bebas Cyr', Impact, sans-serif; font-size: clamp(30px, 3vw, 40px); line-height: 1.1; color: var(--ink-2); }
.compare__cell--accent .compare__sum { color: #FFF; }

.segments { display: flex; flex-direction: column; gap: 2px; background: var(--line); }
.segment {
  text-align: left; background: var(--paper); border: 0; padding: 16px 18px; min-height: 44px;
  display: flex; flex-direction: column; gap: 4px; cursor: pointer; font: inherit; color: var(--ink);
}
.segment[aria-pressed="true"] { background: var(--surface); box-shadow: inset 3px 0 0 var(--accent); }
.segment__title { font-size: 16px; font-weight: 700; }
.segment__text { font-size: 15px; line-height: 1.4; color: var(--ink-2); }

.faq details { border: 1px solid var(--line); background: var(--surface); }
.faq details + details { border-top: 0; }
.faq summary {
  list-style: none; cursor: pointer; padding: 16px 20px; min-height: 44px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  font-size: 17px; font-weight: 600;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; font-family: 'Bebas Cyr', Impact, sans-serif; font-size: 26px; color: var(--accent); }
.faq details[open] summary::after { content: '−'; }
.faq__answer { padding: 0 20px 18px; color: var(--ink-2); }

/* Сетка карточек: grid, а не flex. На flex последняя карточка в неполном
   ряду растягивалась во всю ширину и уносила с собой пропорции фото. */
/* Тарифы */
.price-card { display: flex; flex-direction: column; }
.price-card__sum {
  font-size: clamp(38px, 4vw, 56px); color: var(--accent);
  margin-top: auto; padding-top: 14px;
  border-top: 1px solid var(--line);
}

/* Преимущества программы */
.benefits {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: clamp(12px, 1.6vw, 20px);
}
.benefits__item {
  background: var(--surface); border: 1px solid var(--line);
  padding: clamp(14px, 1.8vw, 20px);
  display: flex; gap: 14px; align-items: baseline;
  font-size: 16px; line-height: 1.45; color: var(--ink-2);
}
.benefits__number { font-size: 28px; color: var(--accent); flex: 0 0 auto; }

/* Пример учебного дня */
table.schedule th { color: var(--ink); font-weight: 700; white-space: nowrap; }
table.schedule td { color: var(--ink-2); }
table.schedule tr:last-child th, table.schedule tr:last-child td { border-bottom: 0; }

/* Программа ФГОС */
table.programme td:last-child, table.programme th:last-child { text-align: center; }
table.programme tfoot th { border-top: 2px solid var(--line); font-size: 15px; color: var(--ink); }

/* Шаги поступления */
.steps {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: clamp(16px, 2vw, 24px);
}
.steps__item {
  background: var(--surface); border: 1px solid var(--line);
  padding: clamp(16px, 2vw, 24px); display: flex; flex-direction: column; gap: 6px;
}
.steps__number {
  font-size: 40px; color: var(--accent); line-height: 1;
  border-bottom: 2px solid var(--accent); align-self: flex-start;
  padding-bottom: 4px; margin-bottom: 6px;
}

.teachers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: clamp(16px, 2vw, 24px);
}
.teacher-card { display: flex; flex-direction: column; }
.teacher-card .photo-placeholder { aspect-ratio: 4 / 5; font-size: clamp(48px, 6vw, 72px); }
.teacher-card__photo { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.teacher-card__bio { margin-top: 10px; font-size: 15px; line-height: 1.5; color: var(--ink-2); }
.teacher-card__bio p { margin: 0 0 6px; }
.teacher-card__bio p:last-child { margin-bottom: 0; }

/* Заглушка карты: до клика это кнопка, а не серый прямоугольник —
   человек должен видеть адрес, даже если карту не откроет. */
.map-teaser {
  width: 100%; display: grid; gap: 6px; justify-items: center; align-content: center;
  min-height: 180px; padding: 20px 16px; cursor: pointer;
  background: var(--peach-soft); border: 1px solid var(--line); color: var(--ink);
  font: inherit; text-align: center;
}
.map-teaser:hover { border-color: var(--accent); }
.map-teaser__mark {
  font-family: 'Constantine', Georgia, serif; font-weight: 700;
  font-size: 40px; line-height: 1; color: var(--peach);
}
.map-teaser__text { font-weight: 600; }
.map-teaser__hint { font-size: 14px; color: var(--ink-3); }

/* Программа в два столбца: тринадцать дисциплин в одну колонку тянут
   экран вниз, а половина ширины при этом пустует. На узком экране
   auto-fit сам сводит их обратно в один столбец. */
.programme-columns {
  display: grid; gap: clamp(12px, 2vw, 28px);
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  align-items: start;
}
.programme-total { margin-top: 16px; font-size: 17px; }

/* Педагог крупно: фото слева, текст справа. Так подан основатель
   на главной и на странице состава. */
.teacher-lead {
  display: grid; gap: clamp(16px, 3vw, 32px);
  grid-template-columns: minmax(0, 280px) minmax(0, 1fr);
  align-items: start;
  background: var(--surface); border: 1px solid var(--line);
  padding: clamp(16px, 2vw, 24px);
}
.teacher-lead__photo { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.teacher-lead__text p { margin: 0 0 8px; }
.teacher-lead__text p:last-child { margin-bottom: 0; }

/* Остальные — компактной лентой: педагогов будет больше, и одинаковыми
   карточками в ряд их уже не разглядеть. */
.teacher-strip {
  list-style: none; margin: clamp(16px, 2vw, 24px) 0 0; padding: 0;
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
}
/* Пункт списка растягивается по высоте строки сетки сам, а вот ссылка
   внутри — нет: без height: 100% карточки выходят разной высоты,
   и ряд смотрится рваным. Имя над предметом прижато к верху, поэтому
   строки подписей совпадают независимо от длины фамилии. */
.teacher-strip > li { display: grid; }
.teacher-chip {
  display: grid; gap: 2px; align-content: start; height: 100%;
  color: inherit; text-align: left;
  background: var(--surface); border: 1px solid var(--line); padding: 10px;
  transition: border-color .15s ease;
}
.teacher-chip:hover { border-color: var(--accent); color: inherit; }
.teacher-chip__photo {
  width: 100%; aspect-ratio: 1 / 1; object-fit: cover; object-position: center 22%;
  margin-bottom: 6px;
}
.teacher-chip .photo-placeholder { aspect-ratio: 1 / 1; font-size: 32px; }
.teacher-chip__name { font-weight: 600; font-size: 14px; line-height: 1.3; }
.teacher-chip__subject { font-size: 13px; color: var(--ink-3); line-height: 1.3; }

.teacher-modal {
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  padding: clamp(16px, 3vw, 28px); max-width: min(720px, 92vw); width: 100%;
  /* position здесь не задаём: модальный диалог браузер центрирует сам
     через position: fixed, и любое своё значение это ломает —
     окно уезжает за пределы экрана, видна только подложка. */
}
.teacher-modal::backdrop { background: rgba(0, 0, 0, .55); }
.teacher-modal .teacher-lead { border: 0; padding: 0; background: transparent; }
.teacher-modal__close {
  position: absolute; top: 8px; right: 10px;
  background: none; border: 0; color: var(--ink-3);
  font-size: 28px; line-height: 1; cursor: pointer; padding: 4px 8px;
}
.teacher-modal__close:hover { color: var(--accent); }

.photo-placeholder {
  aspect-ratio: 4 / 3; background: var(--peach-soft); border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Constantine', Georgia, serif; font-weight: 700; font-size: 64px; color: var(--peach);
}

/* ─── Формы ──────────────────────────────────────────────────────────────── */
.form { display: flex; flex-direction: column; gap: 16px; max-width: 560px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font-size: 15px; font-weight: 600; }
.field input[type=text], .field input[type=tel], .field input[type=email],
.field input[type=password], .field input[type=number], .field input[type=date],
.field select, .field textarea, .input {
  font: inherit; font-size: 16px; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: 0; min-height: 48px; padding: 10px 14px; width: 100%;
}
.field textarea { min-height: 88px; resize: vertical; }
.field .errorlist, .field-error { color: var(--accent-2); font-size: 14px; margin: 0; padding: 0; list-style: none; }
.field--invalid input, .field--invalid select, .field--invalid textarea { border-color: var(--accent-2); }
.checkbox { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; line-height: 1.45; }
.checkbox input[type=checkbox] { width: 24px; height: 24px; margin: 2px 0 0; flex: 0 0 auto; accent-color: var(--accent); }
.radio-row { display: flex; flex-direction: column; gap: 2px; background: var(--line); }
.radio-row label { background: var(--paper); padding: 12px 14px; min-height: 44px; display: flex; gap: 10px; align-items: center; cursor: pointer; }
.form-error { border: 1px solid var(--accent-2); color: var(--accent-2); padding: 12px 14px; font-size: 15px; }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Формы кабинета шире публичных: администратор заполняет их за столом,
   а не с телефона на бегу, и поля удобнее видеть в два столбца. */
.form--wide { max-width: 100%; }
.field-grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.field__label { font-size: 15px; font-weight: 600; }
.field__hint { font-size: 13px; color: var(--ink-3); }
.field__error { font-size: 14px; color: var(--accent-2); }
.field--error input, .field--error select, .field--error textarea { border-color: var(--accent-2); }
.fieldset { border: 1px solid var(--line); padding: clamp(14px, 2vw, 20px); margin: 0; }
.fieldset + .fieldset { margin-top: 20px; }
.fieldset legend { padding: 0 8px; font-weight: 700; }
.checkbox-grid { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.checkbox-grid ul { list-style: none; margin: 0; padding: 0; display: contents; }
.checkbox-grid li label { display: flex; gap: 8px; align-items: center; font-size: 15px; }
.btn--danger { background: var(--accent-2); border-color: var(--accent-2); color: #fff; }
.plain-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }

/* Окно с доступами. Пароль виден один раз, поэтому кнопка «скопировать»
   здесь не украшение: переписывать его руками — гарантированная опечатка. */
.creds { max-width: 640px; }
.creds__head { margin-bottom: 20px; }
.creds__card {
  background: var(--surface); border: 1px solid var(--line);
  padding: clamp(14px, 2vw, 20px); margin-bottom: 14px;
}
.creds__who { font-weight: 700; margin: 0 0 12px; }
.creds__list { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0 0 16px; }
.creds__list dt { color: var(--ink-3); font-size: 14px; }
.creds__list dd { margin: 0; }
.creds__list code { font-size: 15px; word-break: break-all; }
.creds__copied { margin-left: 10px; font-size: 14px; color: var(--ok); }

/* Переход между разделами кабинета: тонкая полоса сверху вместо
   белой вспышки. Показывается только если ответ идёт дольше мгновения. */
.cabinet__body { position: relative; }
body.htmx-request::after {
  content: ""; position: fixed; inset: 0 0 auto 0; height: 2px; z-index: 60;
  background: var(--accent);
  animation: tz-progress 1.2s ease-out infinite;
}
@keyframes tz-progress {
  0% { transform: scaleX(0); transform-origin: left; }
  60% { transform: scaleX(.8); transform-origin: left; }
  100% { transform: scaleX(1); transform-origin: left; opacity: .2; }
}
@media (prefers-reduced-motion: reduce) {
  body.htmx-request::after { animation: none; opacity: .6; }
}

/* «Поставить всем»: после занятия у большинства класса балл одинаковый,
   и вводить его по одному — двадцать кликов ради одного числа. */
.bulk-grade {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
  background: var(--surface); border: 1px solid var(--line); padding: 12px 14px;
}
.bulk-grade__label { font-weight: 600; }
.bulk-grade .input { width: 120px; }

/* ─── Балл: отметка в строке и полукруглый ползунок ──────────────────────── */

/* Отметка — крупная цель под палец, а не поле ввода: клавиатура на
   телефоне закрывает пол-списка, а попасть в узкий инпут стоя трудно. */
.grade-chip {
  flex: 0 0 auto; display: flex; flex-direction: column; align-items: center;
  min-width: 84px; min-height: 52px; gap: 1px;
  padding: 6px 12px; cursor: pointer;
  background: var(--surface); color: var(--ink-3);
  border: 1px solid var(--line-strong); border-radius: 12px;
  font: inherit; transition: border-color .12s ease, color .12s ease;
}
.grade-chip:hover, .grade-chip:focus-visible { border-color: var(--accent); }
.grade-chip__value { font-size: 22px; font-weight: 700; line-height: 1.05; font-variant-numeric: tabular-nums; }
.grade-chip__max { font-size: 11px; letter-spacing: .02em; }
.grade-chip--set { color: var(--ink); border-color: var(--accent); }
.grade-chip--set .grade-chip__value { color: var(--accent-2); }

.dial { position: fixed; inset: 0; z-index: 80; display: flex; align-items: flex-end; justify-content: center; }
/* display:flex перебивает hidden: закрытая панель осталась бы поверх
   страницы и ловила бы касания, не показываясь. */
.dial[hidden] { display: none; }
.dial__backdrop { position: absolute; inset: 0; background: rgba(20, 17, 14, .5); }
.dial__sheet {
  position: relative; width: min(460px, 100%);
  max-height: 100%; overflow-y: auto;
  display: grid; gap: 14px;
  background: var(--paper); border: 1px solid var(--line);
  border-radius: 18px 18px 0 0;
  padding: 16px clamp(14px, 4vw, 24px) calc(16px + env(safe-area-inset-bottom, 0px));
  animation: tz-dial-in .18s ease-out;
}
@keyframes tz-dial-in { from { transform: translateY(14px); opacity: .6; } }
@media (min-width: 620px) {
  .dial { align-items: center; }
  .dial__sheet { border-radius: 18px; }
}

.dial__head { display: flex; align-items: center; gap: 8px; }
.dial__who { flex: 1 1 auto; text-align: center; min-width: 0; }
.dial__name { margin: 0; font-weight: 700; font-size: 18px; }
.dial__sub { margin: 2px 0 0; }
.dial__nav {
  flex: 0 0 auto; width: 40px; height: 40px; border-radius: 50%;
  background: transparent; border: 1px solid var(--line-strong);
  color: var(--ink-2); font-size: 22px; line-height: 1; cursor: pointer;
}
.dial__nav[hidden] { display: none; }

.dial__gauge { position: relative; touch-action: none; cursor: pointer; user-select: none; }
.dial__gauge svg { display: block; width: 100%; height: auto; overflow: visible; }
.dial__track, .dial__fill { fill: none; stroke-width: 16; stroke-linecap: round; }
.dial__track { stroke: var(--track); }
.dial__fill { stroke: var(--accent); transition: stroke-dashoffset .08s linear; }
.dial__gauge--held .dial__fill { transition: none; }
.dial__knob {
  fill: var(--accent); stroke: var(--thumb-ring); stroke-width: 4;
  transition: cx .08s linear, cy .08s linear;
}
.dial__gauge--held .dial__knob { transition: none; r: 15; }
.dial__knob--empty { fill: var(--grey); }

/* Цифра стоит в чаше дуги — там, где взгляд и так остановился. */
.dial__readout {
  position: absolute; left: 0; right: 0; bottom: 6%;
  display: grid; justify-items: center; gap: 2px; pointer-events: none;
}
.dial__value {
  font-size: clamp(48px, 15vw, 72px); font-weight: 700; line-height: 1;
  font-variant-numeric: tabular-nums; color: var(--ink);
}

.dial__quick { display: flex; gap: 8px; }
.dial__quick .btn { flex: 1 1 auto; padding-inline: 4px; min-height: 44px; }
.dial__comment { margin: 0; }
.dial__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.dial__actions .btn { flex: 1 1 auto; min-height: 46px; }
.dial__actions .btn[hidden] { display: none; }

/* Пока панель открыта, страница под ней не прокручивается: иначе список
   уезжает из-под пальца вместе с дугой. */
body.is-dialed { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  .dial__sheet { animation: none; }
  .dial__fill, .dial__knob { transition: none; }
}

/* Оценка звёздами: radio-кнопки остаются радио-кнопками — так работает
   клавиатура и так понятно, что выбор один. */
.rating { display: flex; flex-wrap: wrap; gap: 14px; }
.rating ul { list-style: none; margin: 0; padding: 0; display: contents; }
.rating li label { display: flex; gap: 6px; align-items: center; cursor: pointer; font-size: 18px; color: var(--accent); }
.rating input[type=radio] { width: 20px; height: 20px; accent-color: var(--accent); }

/* Оценка педагога. Число рядом со звёздами обязательно: звёзды без
   цифры читаются как украшение, а не как оценка. */
.rating-badge {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin: 6px 0 0; font-size: 15px;
}
.rating-badge__stars { color: var(--accent); letter-spacing: 1px; }
.rating-badge__value { font-weight: 700; }
.rating-badge__count { font-size: 13px; color: var(--ink-3); }
.rating-badge__count:hover { color: var(--accent); }
.rating-badge--compact { font-size: 13px; gap: 5px; margin-top: 4px; }
.rating-badge--compact .rating-badge__count { display: none; }

/* Отзывы в карточке педагога на сайте. */
.reviews { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; display: grid; gap: 12px; }
.review__head { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.review__stars { color: var(--accent); letter-spacing: 1px; }
.review__who { font-size: 13px; color: var(--ink-3); }
.review__text { font-size: 14px; line-height: 1.5; margin: 4px 0 0; }

/* Реквизиты в шапке правового документа: они берутся из карточки
   организации, поэтому не устаревают вместе с текстом. */
.legal-requisites {
  margin-top: 24px; padding: clamp(14px, 2vw, 20px);
  background: var(--surface); border: 1px solid var(--line);
}
.legal-requisites dl {
  display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 10px 0 0;
}
.legal-requisites dt { color: var(--ink-3); font-size: 14px; }
.legal-requisites dd { margin: 0; font-size: 15px; }

/* ─── Мелкая анимация ────────────────────────────────────────────────────── */
/* Движения ровно столько, чтобы страница казалась живой. Всё ниже
   выключается при prefers-reduced-motion: анимация не должна мешать
   тем, кому она мешает физически. */

/* Логотип: «Ъ» приподнимается и чуть отклоняется — как буква,
   которую подхватили со страницы. */
.logo__mark {
  display: inline-block;
  transition: transform .35s cubic-bezier(.34, 1.56, .64, 1), color .35s ease;
}
.logo:hover .logo__mark,
.logo:focus-visible .logo__mark {
  transform: translateY(-3px) rotate(-8deg) scale(1.06);
  color: var(--accent);
}

/* Кнопки и карточки: подъём на 1–2 пикселя. Больше — и интерфейс
   начинает «плавать» под курсором. */
.btn { transition: transform .18s ease, background-color .18s ease, border-color .18s ease; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.card { transition: transform .22s ease, border-color .22s ease; }
.teacher-card:hover, .price-card:hover { transform: translateY(-2px); }

/* Сотня на шкале: цифра уходит, смайл появляется и подмигивает. */
.scale-panel__score { position: relative; display: inline-block; }
.scale-panel__score .numeral { transition: opacity .2s ease, transform .3s ease; }
.scale-panel__score.is-full .numeral { opacity: 0; transform: scale(.7); }
.scale-wink {
  /* Размер берём от самой цифры: смайл занимает её место, а не висит
     рядом крошечной иконкой. */
  position: absolute; left: 50%; top: 50%;
  width: clamp(56px, 6vw, 80px); height: clamp(56px, 6vw, 80px);
  color: var(--accent);
  opacity: 0; transform: translate(-50%, -50%) scale(.6);
  transition: opacity .25s ease, transform .35s cubic-bezier(.34, 1.56, .64, 1);
  pointer-events: none;
}
.scale-wink svg { width: 100%; height: 100%; display: block; }
.scale-panel__score.is-full .scale-wink { opacity: 1; transform: translate(-50%, -50%) scale(1); }
/* Подмигивает правый глаз — сплющивается и распрямляется обратно.
   Оба глаза нарисованы всегда: раньше один прятался, а второй появлялся
   вместо него, и смайл заканчивал подмигивание одноглазым. */
.scale-wink__eye { transform-box: fill-box; transform-origin: center; }
.scale-wink.is-winking .scale-wink__eye--right { animation: tz-wink 1.2s ease .35s 1; }
@keyframes tz-wink {
  0%, 24% { transform: scaleY(1); }
  32%, 46% { transform: scaleY(.14); }
  54%, 100% { transform: scaleY(1); }
}

/* Заголовок раздела появляется при прокрутке — один раз и без задержки
   содержимого: текст уже в разметке, анимируется только его подача. */
@media (prefers-reduced-motion: no-preference) {
  .section__head { animation: tz-rise .5s ease both; animation-timeline: view(); animation-range: entry 0% cover 22%; }
}
@keyframes tz-rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .logo__mark, .btn, .card { transition: none; }
  .logo:hover .logo__mark, .btn:hover, .teacher-card:hover, .price-card:hover { transform: none; }
  .scale-wink, .scale-panel__score .numeral { transition: none; }
  .scale-wink.is-winking .scale-wink__eye--right { animation: none; }
  .section__head { animation: none; }
}

/* ─── Конструктор расписания ─────────────────────────────────────────────── */
.builder-bar {
  display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-end;
  margin-bottom: 20px;
}
.builder { display: grid; gap: 20px; grid-template-columns: minmax(260px, 300px) minmax(0, 1fr); align-items: start; }
.builder__side { position: sticky; top: calc(var(--header-h) + 12px); }
.builder__grid-wrap { overflow-x: auto; }
.builder__grid { width: 100%; border-collapse: collapse; min-width: 720px; }
.builder__grid th, .builder__grid td { border: 1px solid var(--line-strong); padding: 4px; vertical-align: top; }
.builder__grid thead th { font-size: 14px; text-align: left; padding: 8px; background: var(--surface); }
.builder__grid thead th .muted { display: block; font-weight: 400; }
.builder__time { width: 74px; font-size: 14px; color: var(--ink-3); white-space: nowrap; }

/* Карточка педагога остаётся на месте после перетаскивания: одного
   человека ставят на несколько уроков подряд. */
/* Колода в два ряда: карточку не рассматривают, из неё таскают. Фамилия
   и предмет — всё, что нужно, чтобы не ошибиться, а чем меньше карточка,
   тем меньше до неё тянуться. */
.teacher-deck {
  list-style: none; margin: 12px 0 0; padding: 0;
  display: grid; gap: 8px; grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}
/* Выбор предмета живёт под своей карточкой, а не растягивает соседнюю. */
.teacher-deck > li { display: flex; flex-direction: column; }
.deck-card {
  display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 8px;
  align-items: center; min-height: 56px;
  background: var(--surface); border: 1px solid var(--line);
  padding: 8px; cursor: grab;
  /* touch-action не трогаем: пока карточку не подняли, палец должен
     листать страницу как обычно. Прокрутку отменяет уже сам скрипт —
     и только после того, как карточка оказалась в руке.
     Долгое нажатие на телефоне не должно звать меню «скопировать». */
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.deck-card:active { cursor: grabbing; }
.deck-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.deck-card--dragging { opacity: .45; }
/* Выбранная касанием карточка ждёт, куда её поставить. */
.deck-card--armed { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.deck-card__subject { width: 100%; min-height: 34px; padding: 4px 8px; font-size: 13px; margin-top: 4px; }

/* Призрак под пальцем: сама карточка остаётся в колоде, а по экрану едет
   её копия — иначе непонятно, что именно ты несёшь. */
.deck-ghost {
  position: fixed; z-index: 80; pointer-events: none;
  padding: 8px 12px; background: var(--accent); color: #FFF;
  font-size: 14px; font-weight: 600; box-shadow: 0 6px 18px rgba(0, 0, 0, .28);
  transform: translate(-50%, -50%);
}

/* Правая половина: переключение недель вплотную над сеткой. */
.builder__main { min-width: 0; display: grid; gap: 16px; }
.builder__weeks { display: flex; gap: 12px; align-items: center; }
.teacher-deck--blocks { gap: 6px; }
.deck-add { display: grid; gap: 8px; margin-top: 14px; }
.deck-card__body { display: grid; gap: 2px; min-width: 0; }
/* Фотография маленькая: по лицу человека узнают быстрее, чем по фамилии,
   но колода должна оставаться колодой, а не галереей портретов. */
.deck-card__photo {
  width: 34px; height: 34px; object-fit: cover; object-position: center 22%;
}
.deck-card .photo-placeholder {
  display: flex; align-items: center; justify-content: center;
  aspect-ratio: 1 / 1; font-size: 16px;
}
/* У блока дня фотографии нет — карточка занимает всю ширину. */
.deck-card--block { grid-template-columns: minmax(0, 1fr); min-height: 44px; }
.deck-card__name { font-weight: 600; font-size: 14px; line-height: 1.25; }
/* Имя и предметы — по одной строке с многоточием.
   Перенос в узкой колонке рвал слова посреди («Бабаджанов а А. А.»), а
   без переноса они обрезались вовсе без многоточия — и не было видно,
   что текст продолжается. Карточки заодно стали одной высоты: колода
   перестала разъезжаться из-за того, что у одного педагога четыре
   предмета, а у другого один. Полностью и то и другое видно в подсказке
   при наведении. */
.deck-card__name,
.deck-card__subjects { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.deck-card__subjects { font-size: 12px; color: var(--ink-3); line-height: 1.3; }
/* У блока дня имя длинное и одно — ему перенос как раз нужен. */
.deck-card--block .deck-card__name { white-space: normal; }
.deck-card__subject { font: inherit; font-size: 13px; margin-top: 4px; padding: 4px 6px; min-height: 32px; }

.slot {
  min-height: 62px; display: grid; gap: 2px; align-content: center;
  padding: 6px 8px; position: relative; font-size: 13px;
}
.slot--filled { background: var(--peach-soft); }
.slot--over { outline: 2px dashed var(--accent); outline-offset: -2px; }
.slot--busy { opacity: .5; }
.slot__subject { font-weight: 600; line-height: 1.2; }
.slot__teacher { color: var(--ink-3); line-height: 1.2; }
.slot__empty { color: var(--line); font-size: 20px; text-align: center; }
.slot__clear {
  position: absolute; top: 2px; right: 4px; border: 0; background: none;
  color: var(--ink-3); font-size: 18px; line-height: 1; cursor: pointer; padding: 2px 4px;
}
.slot__clear:hover { color: var(--accent-2); }
.builder__status { margin-top: 16px; min-height: 24px; color: var(--ok); }
.builder__status--error { color: var(--accent-2); }
.message--warning { border-color: var(--warn); }

/* ─── Подвал ─────────────────────────────────────────────────────────────── */
.site-footer { border-top: 1px solid var(--line); padding: var(--pad-y) var(--pad-x); color: var(--ink-2); font-size: 15px; }
.site-footer .grid > * { flex: 1 1 260px; }
.requisites { font-size: 14px; color: var(--ink-3); line-height: 1.6; }

/* ─── Cookie-баннер ──────────────────────────────────────────────────────── */
.cookie-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  background: var(--surface); border-top: 1px solid var(--line);
  padding: 16px var(--pad-x); display: flex; flex-wrap: wrap; gap: 14px;
  align-items: center; justify-content: space-between; font-size: 15px;
}
.cookie-bar[hidden] { display: none; }
.cookie-bar__actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ─── Кабинет ────────────────────────────────────────────────────────────── */
.cabinet__body { padding: clamp(16px, 3vw, 32px) var(--pad-x); max-width: 1440px; margin: 0 auto; width: 100%; }
/* Меню кабинета. Раскрывающиеся группы нельзя обрезать по горизонтали,
   поэтому overflow здесь видимый, а лишнее переносится на вторую строку. */
.cabinet-nav { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }
.cabinet-nav a {
  min-height: 44px; display: inline-flex; align-items: center; padding: 0 14px;
  border: 1px solid var(--line); color: var(--ink-2); font-size: 15px; background: var(--surface);
}
.cabinet-nav a[aria-current="page"] { border-color: var(--accent); color: var(--ink); }

/* Группа разделов: одно название наверху, список — под ним. Открывается
   наведением (мышь), фокусом (клавиатура) и нажатием (палец, см. site.js). */
.nav-group { position: relative; display: inline-flex; }
.nav-group__label {
  min-height: 44px; display: inline-flex; align-items: center; gap: 6px;
  padding: 0 14px; border: 1px solid var(--line); background: var(--surface);
  color: var(--ink-2); font: inherit; font-size: 15px; cursor: pointer;
}
.nav-group.is-current > .nav-group__label { border-color: var(--accent); color: var(--ink); }
.nav-group__chev { font-size: 11px; line-height: 1; color: var(--ink-3); }
.nav-group__items {
  position: absolute; top: 100%; left: 0; z-index: 30; min-width: 190px;
  display: none; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line);
  box-shadow: 0 10px 28px rgba(0, 0, 0, .12);
}
.nav-group:hover > .nav-group__items,
.nav-group:focus-within > .nav-group__items,
.nav-group.is-open > .nav-group__items { display: flex; }
.cabinet-nav .nav-group__items a {
  border: 0; border-bottom: 1px solid var(--line); min-height: 44px;
}
.cabinet-nav .nav-group__items a:last-child { border-bottom: 0; }
.cabinet-nav .nav-group__items a:hover { background: var(--mark); }
.cabinet-nav .nav-group__items a[aria-current="page"] { color: var(--ink); background: var(--mark); }
.page-title { display: flex; flex-wrap: wrap; gap: 12px; align-items: baseline; justify-content: space-between; margin-bottom: 20px; }

.stat-row { display: flex; flex-wrap: wrap; gap: 12px; }
.stat { flex: 1 1 180px; border: 1px solid var(--line); background: var(--surface); padding: 16px 18px; }
.stat__label { font-size: 14px; color: var(--ink-3); }
.stat__value { font-family: 'Bebas Cyr', Impact, sans-serif; font-size: 34px; line-height: 1.1; }

/* Уровень — цвет И текст: цвет не единственный носитель смысла */
.level { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }
.level::before { content: ''; width: 10px; height: 10px; flex: 0 0 auto; background: var(--ink-3); }
.level--failed::before { background: var(--warn); }
.level--base::before { background: var(--grey); }
.level--elevated::before { background: var(--accent); }
.level--advanced::before { background: var(--ok); }

.progress { height: 10px; background: var(--track); position: relative; }
.progress__fill { height: 100%; background: var(--accent); }
.progress__fill--failed { background: var(--warn); }
.progress__fill--advanced { background: var(--ok); }

.subject-row { display: flex; flex-direction: column; gap: 8px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.subject-row__head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.subject-row__points { font-family: 'Bebas Cyr', Impact, sans-serif; font-size: 24px; }

/* Строка предмета раскрывается: итог — на виду, «из чего он сложился» —
   по нажатию. Свой треугольник убираем, свой ставим справа: стандартный
   маркер прилипает к левому краю и на строке в две линии смотрится
   оторванным от неё. */
details.subject-row > summary {
  display: flex; flex-direction: column; gap: 8px;
  cursor: pointer; list-style: none;
}
details.subject-row > summary::-webkit-details-marker { display: none; }
.subject-row__note { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.subject-row__toggle { margin-left: auto; color: var(--accent); white-space: nowrap; }
details.subject-row[open] .subject-row__toggle::after { content: ' ↑'; }
details.subject-row:not([open]) .subject-row__toggle::after { content: ''; }
details.subject-row[open] > summary { margin-bottom: 8px; }

/* Из чего сложился балл */
.breakdown td, .breakdown th { vertical-align: top; }
.breakdown__points { text-align: right; white-space: nowrap; }
.breakdown__kind {
  display: block; font-size: 12px; letter-spacing: .06em;
  text-transform: uppercase; color: var(--ink-3);
}
.breakdown__what { display: block; }
.breakdown__note {
  display: block; margin-top: 4px; font-size: 14px; color: var(--ink-2);
  border-left: 2px solid var(--line-strong); padding-left: 8px;
}
/* Работа ещё впереди — это не ноль и выглядеть как ноль не должна. */
.breakdown__row--ahead td { opacity: .6; }
.breakdown tfoot td { border-top: 1px solid var(--line-strong); }

.journal-list { display: flex; flex-direction: column; gap: 2px; background: var(--line); }
.journal-row { background: var(--surface); padding: 14px 16px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.journal-row__name { flex: 1 1 180px; font-weight: 600; }
.journal-row__points { flex: 0 0 96px; }
.journal-row__points input { text-align: center; }
.journal-row__comment { flex: 1 1 220px; }
.journal-row__note { flex: 1 1 100%; order: 3; font-size: 13px; color: var(--ink-3); }
.journal-row__state { flex: 0 0 auto; font-size: 14px; min-width: 92px; }
.state--saved { color: var(--ok); }
.state--error { color: var(--accent-2); }
.state--pending { color: var(--ink-3); }
.state--offline { color: var(--warn); }

.budget {
  position: sticky; top: var(--header-h); z-index: 10;
  background: var(--surface); border: 1px solid var(--line); padding: 12px 16px;
  display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: baseline;
}
.budget--over { border-color: var(--accent-2); color: var(--accent-2); }

.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 15px; }
table.data th, table.data td { border-bottom: 1px solid var(--line); padding: 10px 12px; text-align: left; vertical-align: top; }
table.data th { font-size: 14px; color: var(--ink-3); font-weight: 600; }

.empty-state { border: 1px dashed var(--line); padding: clamp(20px, 4vw, 40px); text-align: center; color: var(--ink-2); }
.empty-state__title { font-size: 18px; font-weight: 700; margin-bottom: 6px; color: var(--ink); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--line); padding: 8px 12px; font-size: 14px; min-height: 44px; display: inline-flex; align-items: center; background: var(--surface); color: var(--ink-2); }
.chip[aria-current="true"] { border-color: var(--accent); color: var(--ink); }

.messages { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.message { border: 1px solid var(--line); padding: 12px 14px; font-size: 15px; background: var(--surface); }
.message--warning { border-color: var(--warn); color: var(--warn); }
.message--error { border-color: var(--accent-2); color: var(--accent-2); }

.htmx-indicator { opacity: 0; transition: opacity .15s ease; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { opacity: 1; }

.mood-scale { display: flex; flex-wrap: wrap; gap: 8px; }
.mood-scale button { min-height: 48px; min-width: 48px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; cursor: pointer; padding: 0 14px; }
.mood-scale button[aria-pressed="true"] { border-color: var(--accent); background: var(--peach-soft); }

/* QR второго фактора: тёмные модули на белом независимо от темы —
   инверсию читают не все сканеры. */
.qr {
  width: 220px; height: 220px; padding: 12px; margin: 14px 0 4px;
  background: #FFF; border: 1px solid var(--line);
}
.qr svg { display: block; }
.qr svg path { fill: #23201D; }
.qr-fallback summary {
  cursor: pointer; min-height: 44px; display: flex; align-items: center;
  font-size: 15px; color: var(--accent-2);
}
.qr-secret { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.qr-secret span {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 17px; letter-spacing: .08em;
  border: 1px solid var(--line); background: var(--paper); padding: 6px 10px;
}

.goal { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--line); }
.goal__badge { font-size: 13px; border: 1px solid var(--line); padding: 3px 8px; color: var(--ink-3); }
.goal__badge--hidden { border-color: var(--accent); color: var(--accent-2); }

/* Простой график без библиотек: колонка = средний балл за модуль.
   Столбец лежит в дорожке фиксированной высоты — иначе flex сжимает его
   и процент высоты перестаёт что-либо значить. */
.bars { display: flex; align-items: flex-end; gap: 8px; }
.bars__item { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.bars__track { width: 100%; height: 120px; display: flex; align-items: flex-end; background: var(--track); }
.bars__bar { width: 100%; background: var(--accent); min-height: 3px; flex: none; }
.bars__caption { font-size: 12px; color: var(--ink-3); text-align: center; }

/* Мобильный — основной сценарий, а не адаптив постфактум (ТЗ 5).
   На узком экране навигация уезжает на свою строку во всю ширину:
   зажатая между логотипом и CTA, она нечитаема и в неё не попасть пальцем. */
/* Расписание на неделю: колонки на большом экране, дни подряд на телефоне.
   Сетка auto-fit, чтобы семь дней не ломались на промежуточных ширинах. */
.week { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.week__day { background: var(--surface); border: 1px solid var(--line-strong); padding: 12px 14px; }
.week__day--today { border-color: var(--accent); }
.week__date {
  display: flex; justify-content: space-between; align-items: baseline; gap: 8px;
  font-size: 14px; text-transform: uppercase; letter-spacing: .06em;
  margin: 0 0 10px; padding-bottom: 8px; border-bottom: 1px solid var(--line);
}
.week__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.week__lesson { display: flex; gap: 10px; align-items: baseline; font-size: 15px; }
.week__time { flex: 0 0 auto; font-weight: 600; }
.week__lesson--quiet, .week__lesson--quiet .week__subject { color: var(--ink-3); font-weight: 400; }
.week__what { display: grid; gap: 2px; min-width: 0; }
.week__subject { font-weight: 600; }
.week__empty { margin: 0; font-size: 14px; }

/* Занятие, которое можно открыть, — вся строка целиком: на телефоне
   в стрелку сбоку не попасть. Стрелка только подсказывает, что тут есть куда
   нажать. Цель по высоте не меньше 44 px — палец меньше не берёт. */
a.week__lesson--open {
  color: inherit; text-decoration: none;
  align-items: center; min-height: 44px;
  margin: -6px -8px; padding: 6px 8px; border-radius: 10px;
  transition: background-color .12s ease;
}
a.week__lesson--open:hover, a.week__lesson--open:focus-visible { background: var(--mark); }
a.week__lesson--open .week__subject { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
.week__go { color: var(--ink-3); font-size: 20px; line-height: 1; }

@media (max-width: 760px) {
  :root { --header-h: 73px; }
  .site-header { flex-wrap: wrap; row-gap: 8px; }
  .nav-toggle { display: inline-flex; }

  /* Навигация свёрнута под кнопку и раскрывается вертикально:
     горизонтальный скролл в шапке пальцем не листается. */
  .site-nav, .cabinet-nav { display: none; }
  .site-header.is-open .site-nav,
  .site-header.is-open .cabinet-nav {
    display: flex; order: 3; flex: 1 0 100%;
    flex-direction: column; align-items: stretch; gap: 0;
    overflow: visible; white-space: normal;
    border-top: 1px solid var(--line); padding-top: 4px;
  }
  .site-header.is-open .site-nav a,
  .site-header.is-open .cabinet-nav a {
    min-height: 52px; font-size: 17px; border: 0;
    border-bottom: 1px solid var(--line); padding: 0 2px;
  }
  .site-header.is-open .site-nav a:last-child,
  .site-header.is-open .cabinet-nav a:last-child { border-bottom: 0; }

  /* В открытом бургере места по вертикали сколько угодно: прятать разделы
     под второе нажатие незачем. Группа становится подзаголовком. */
  .site-header.is-open .cabinet-nav .nav-group { display: block; }
  .site-header.is-open .cabinet-nav .nav-group__label {
    width: 100%; min-height: 40px; padding: 0 2px; border: 0;
    font-size: 13px; letter-spacing: .08em; text-transform: uppercase;
    color: var(--ink-3); cursor: default;
  }
  .site-header.is-open .cabinet-nav .nav-group__chev { display: none; }
  .site-header.is-open .cabinet-nav .nav-group__items {
    position: static; display: flex; min-width: 0; border: 0; box-shadow: none;
  }
}

@media (max-width: 640px) {
  /* Журнал на телефоне — карточки, а не таблица с горизонтальным скроллом.
     В колоночном flex-контейнере flex-basis задаёт высоту, поэтому базисы
     строчной раскладки здесь обязательно сбрасываются. */
  .journal-row { flex-direction: column; align-items: stretch; gap: 8px; }
  .journal-row__name,
  .journal-row__points,
  .journal-row__comment,
  .journal-row__state { flex: 0 0 auto; }
  .hero__mark { left: -28px; top: 20px; }

  /* На телефоне неделя читается сверху вниз: колонки по 200px там
     превращаются в нечитаемые обрезки. */
  .week { grid-template-columns: 1fr; }

  /* Конструктор на телефоне: колода педагогов над сеткой, а не сбоку. */
  .builder { grid-template-columns: 1fr; }
  /* Колода перестаёт быть липкой: в одной колонке она уехала бы вместе
     со страницей и закрыла бы сетку. */
  .builder__side { position: static; }
  /* На телефоне карточки те же два ряда, просто теснее: колонка одна на
     всю ширину, и одному ряду там слишком просторно. */
  .teacher-deck { gap: 6px; }
  .deck-card { min-height: 52px; padding: 6px; font-size: 14px; }

  /* Крупная карточка педагога на телефоне: фото сверху, текст под ним. */
  .teacher-lead { grid-template-columns: 1fr; }
  .teacher-lead__photo { max-width: 240px; }

  /* Главный экран родителя должен отвечать на три вопроса без прокрутки:
     на телефоне плитки идут по две в ряд, а не колонкой. */
  .stat { flex: 1 1 140px; padding: 12px 14px; }
  .stat__value { font-size: 26px; }
}

/* Полоса «вы смотрите чужой кабинет».
   Липкая и в цвете предупреждения: забыть, что смотришь чужими глазами,
   стоило бы слишком дорого — за этими экранами данные детей. */
.impersonation-bar {
  position: sticky;
  top: 0;
  z-index: 60;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 10px clamp(16px, 4vw, 40px);
  background: var(--warn);
  color: #fff;
  font-size: 15px;
  line-height: 1.4;
}
.impersonation-bar strong { font-weight: 700; }
.impersonation-bar .btn {
  background: rgba(255, 255, 255, .16);
  border-color: rgba(255, 255, 255, .5);
  color: #fff;
}
.impersonation-bar .btn:hover { background: rgba(255, 255, 255, .28); }

/* Раскрывающийся блок внутри формы — «если это педагог».
   Выглядит как обычный fieldset, но заголовок кликабельный. */
details.fieldset > summary {
  cursor: pointer;
  font-weight: 700;
  list-style: none;
}
details.fieldset > summary::-webkit-details-marker { display: none; }
details.fieldset > summary::after {
  content: ' +';
  color: var(--accent);
  font-weight: 700;
}
details.fieldset[open] > summary::after { content: ' −'; }

/* Разрушающее действие рядом с обычным: тихая кнопка, но в цвете
   предупреждения. Заливкой она перетягивала бы на себя внимание с той,
   которой пользуются каждый день. */
.btn--quiet.btn--danger {
  background: var(--surface);
  color: var(--accent-2);
  border-color: var(--accent-2);
}
.btn--quiet.btn--danger:hover { background: var(--accent-2); color: #FFF; }

/* Подсказка к конструктору: отдельной строкой под кнопками и свёрнутая.
   В колонке педагогов она занимала экран целиком, и до первой карточки
   приходилось прокручивать. */
.builder-help { flex: 1 0 100%; font-size: 14px; color: var(--ink-3); }
.builder-help > summary {
  cursor: pointer; list-style: none; width: max-content;
  color: var(--ink-2); font-weight: 600;
}
.builder-help > summary::-webkit-details-marker { display: none; }
.builder-help > summary::after { content: ' +'; color: var(--accent); }
.builder-help[open] > summary::after { content: ' −'; }
.builder-help p { margin: 8px 0 0; max-width: 78ch; line-height: 1.5; }

/* Блок дня в сетке: то же место, другой вес. Обед и утренний круг
   занимают время, но уроком не являются — и не должны выглядеть как он. */
.deck-card--block { border-style: dashed; }
.slot--block { background: color-mix(in srgb, var(--ink-3) 8%, transparent); }
.slot--block .slot__subject { font-weight: 500; color: var(--ink-2); }

/* ─── Тема и домашнее задание в журнале занятия ──────────────────────────── */
/* Два поля, которые педагог заполняет сразу после занятия. На телефоне
   они идут друг под другом на всю ширину — это первое, что должно быть
   под рукой. */
.lesson-meta {
  display: grid; gap: 16px; margin: 16px 0 8px;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  align-items: start;
}
.lesson-field {
  display: grid; gap: 10px;
  background: var(--surface); border: 1px solid var(--line);
  padding: clamp(12px, 2vw, 16px);
}
.lesson-field .field__label { display: flex; gap: 8px; align-items: baseline; }
/* «Сохранено» появляется рядом с подписью и само гаснет: подтверждение
   нужно на секунду, а место занимает постоянно. */
.lesson-field__state {
  font-size: 12px; font-weight: 500; color: var(--ok, #3F7A4B);
  animation: tz-fade-out 2.6s ease forwards;
}
.lesson-field__state:empty { animation: none; }
@keyframes tz-fade-out {
  0%, 55% { opacity: 1; }
  100% { opacity: 0; }
}
.lesson-field__row {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end;
}
.lesson-field__row .field { flex: 1 1 130px; min-width: 0; }
.lesson-field__row .btn { flex: 0 0 auto; }
.lesson-field textarea { min-height: 62px; }

@media (prefers-reduced-motion: reduce) {
  .lesson-field__state { animation: none; }
}

/* Домашнее задание в кабинете ученика и родителя: карточка с текстом,
   а не строка таблицы. «§12, задачи 3–7 письменно» в колонку не влезает,
   а прочитать надо именно это. */
.homework-card { border-left: 3px solid var(--line-strong); }
.homework-card--late { border-left-color: var(--warn); }
/* Сделанное не прячем — гасим: задолженность и выполненное должны быть
   в одном списке, иначе непонятно, сколько всего задано. */
.homework-card--done { border-left-color: var(--ok); opacity: .72; }
/* Возвращённое на доработку — снова дело ученика, поэтому оно не гаснет,
   а окрашено тревожно: это единственная карточка, требующая действия. */
.homework-card--redo { border-left-color: var(--warn); }
.homework-card--review { border-left-color: var(--grey); opacity: .85; }

/* Разделы «Сделать», «На проверке», «Проверено» */
.hw-head {
  display: flex; align-items: center; gap: 10px; margin: 24px 0 8px;
  font-family: 'Bebas Cyr', Impact, sans-serif; font-size: 17px;
  letter-spacing: .04em; text-transform: uppercase; font-weight: 400;
}
.hw-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 24px; height: 22px; padding: 0 7px; font-size: 13px;
  font-family: inherit; background: var(--mark); color: var(--ink-2);
}
.hw-archive > summary { cursor: pointer; list-style: none; }
.hw-archive > summary::-webkit-details-marker { display: none; }
.hw-archive > summary::after { content: '▾'; font-size: 13px; color: var(--ink-3); }
.hw-archive[open] > summary::after { content: '▴'; }

/* Состояние задания и слово педагога */
.hw-state { margin-top: 10px; font-size: 14px; font-weight: 600; }
.hw-state--ok { color: var(--ok); }
.hw-state--wait { color: var(--ink-3); }
.hw-note {
  margin-top: 10px; padding: 10px 12px;
  background: var(--mark); border-left: 3px solid var(--line-strong);
}
.hw-note--redo { border-left-color: var(--warn); }

/* Удаление работы — внизу её страницы, отдельно от баллов: рядом со
   списком учеников кнопка «удалить» читалась бы как «удалить балл». */
.item-delete {
  margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--line);
}
.item-delete form { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* Работы модуля рядом с занятием: проверочная, контрольная, зачёт.
   Строка целиком — ссылка: попасть пальцем в слово «выставить» на
   телефоне труднее, чем в строку. */
.lesson-works {
  background: var(--surface); border: 1px solid var(--line);
  padding: 16px clamp(12px, 2vw, 18px);
}
.works-list { display: flex; flex-direction: column; }
.works-row {
  display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: baseline;
  padding: 12px 0; border-top: 1px solid var(--line);
  color: var(--ink); text-decoration: none;
}
.works-row:first-child { border-top: 0; }
.works-row:hover, .works-row:focus-visible { background: var(--mark); }
.works-row__name { flex: 1 1 220px; font-weight: 600; display: grid; gap: 1px; }
.works-row__name .small { font-weight: 400; }
.works-row__max { flex: 0 0 auto; }
.works-row__state { flex: 0 0 auto; font-size: 14px; color: var(--ink-3); }
.works-row__state--done { color: var(--ok); }
.works-row__go { flex: 0 0 auto; color: var(--ink-3); font-size: 18px; line-height: 1; }

/* Проверка домашнего у педагога. Отдельной плашкой: ниже идёт список
   учеников для баллов — те же фамилии, и без границы два списка
   сливаются в один непонятный. */
.lesson-review {
  background: var(--surface); border: 1px solid var(--line);
  padding: 16px clamp(12px, 2vw, 18px);
}
.review { margin-top: 12px; }
.review__head {
  display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between;
  align-items: flex-start; margin-bottom: 12px;
}
.review__counts { margin: 0; flex: 0 0 auto; }
.review-list { display: flex; flex-direction: column; }
.review-row {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  padding: 10px 0; border-top: 1px solid var(--line);
}
.review-row--ok { border-left: 3px solid var(--ok); padding-left: 10px; }
.review-row--redo { border-left: 3px solid var(--warn); padding-left: 10px; }
.review-row--wait { border-left: 3px solid var(--grey); padding-left: 10px; }
.review-row__name { flex: 1 1 160px; font-weight: 600; }
.review-row__state { flex: 0 0 auto; font-size: 14px; color: var(--ink-2); }
.review-row__comment { flex: 2 1 220px; min-height: 36px; font-size: 14px; }
.review-row__actions { display: flex; gap: 8px; align-items: center; flex: 0 0 auto; }

@media (max-width: 640px) {
  /* На телефоне строка складывается: фамилия и состояние сверху, поле и
     кнопки под ними. Иначе комментарий сжимается до двух букв. */
  .review-row { align-items: stretch; }
  .review-row__name { flex: 1 1 100%; }
  .review-row__comment { flex: 1 1 100%; }
  .review-row__actions { flex: 1 1 100%; }
  .review-row__actions .btn { flex: 1 1 0; }
}

/* Вложения к заданию: картинка показывается, документ и таблица
   называются. По миниатюре задание узнают с одного взгляда, а по имени
   файла с типом и весом видно, чем открывать и стоит ли это делать
   с телефона. */
.attachments { display: grid; gap: 10px; }
.attachments__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.attachments__list--read { margin-top: 10px; }
.attachments__item {
  display: flex; gap: 10px; align-items: center;
  padding: 6px 8px; background: var(--paper);
  border: 1px solid var(--line); border-radius: 10px;
}
.attachments__thumb { flex: 0 0 auto; display: block; line-height: 0; }
.attachments__thumb img {
  display: block; width: 56px; height: 56px; object-fit: cover;
  border-radius: 8px; border: 1px solid var(--line);
}
.attachments__icon {
  flex: 0 0 auto; display: grid; place-items: center;
  width: 56px; height: 56px; border-radius: 8px;
  background: var(--surface); border: 1px solid var(--line-strong);
  font-size: 12px; font-weight: 700; letter-spacing: .02em; color: var(--ink-3);
}
.attachments__what { display: grid; gap: 2px; min-width: 0; flex: 1 1 auto; }
.attachments__what a { overflow-wrap: anywhere; }
.attachments__remove { flex: 0 0 auto; }

/* Подсказка «как в прошлый раз» — не кнопка на пол-экрана, а текст,
   на который можно нажать. */
.link-btn {
  background: none; border: 0; padding: 0; margin: 0;
  font: inherit; color: var(--accent-2); text-align: left;
  text-decoration: underline; text-underline-offset: 2px; cursor: pointer;
}
.link-btn:hover, .link-btn:focus-visible { color: var(--accent); }

/* Заголовок раздела в КТП: не строка данных, а надпись над ними. */
.ktp-section td { background: var(--mark); }

/* Состояние занятия и переключатель к нему: слева — как есть сейчас,
   справа — что будет, если нажать. Одна кнопка на весь экран: две для
   одного действия сбивают сильнее, чем отсутствие обеих. */
.lesson-switch {
  display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: center;
  justify-content: space-between;
  background: var(--surface); border: 1px solid var(--line);
  padding: 14px clamp(12px, 2vw, 18px);
}
.lesson-switch__text { flex: 1 1 260px; min-width: 0; }

/* Выход из отказа «сначала удалите баллы»: кто мешает — в тексте
   ошибки выше, а здесь объяснение про ноль и кнопка «снять с баллами». */
.grading-blocked {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
  justify-content: space-between; margin: -4px 0 12px;
  padding: 12px clamp(12px, 2vw, 18px);
  background: var(--surface); border: 1px solid var(--line);
  border-left: 3px solid var(--warn);
}
.grading-blocked p { flex: 1 1 320px; }
.lesson-switch__state { margin: 0 0 2px; font-size: 16px; }
.lesson-switch form { flex: 0 0 auto; }
.lesson-switch .btn { min-height: 44px; }
.form-error a { margin-left: 8px; white-space: nowrap; }

/* Под фамилией — сколько у ученика набрано в модуле. «Пять из пяти» без
   «а всего тридцать семь из ста» — половина картинки. */
.journal-row__name { display: grid; gap: 1px; }
.journal-row__name .small { font-weight: 400; }

/* Строка работы модуля правится на месте: раньше её можно было только
   удалить и завести заново — то есть потерять название и дату.

   Сетка, а не флексы: у поля даты своя, довольно широкая, встроенная
   ширина, и во флексах оно выпирало из отведённого места и наезжало на
   кнопки. Колонки заданы явно, поля тянутся по ним. */
.plan-list { display: grid; gap: 2px; background: var(--line); border: 1px solid var(--line); }
.plan-row {
  display: grid; gap: 10px 12px; align-items: end;
  grid-template-columns: minmax(160px, 1fr) 150px 88px 160px auto;
  background: var(--surface); padding: 12px clamp(10px, 1.6vw, 16px);
}
.plan-row__cell { display: grid; gap: 2px; min-width: 0; }
.plan-row .input { width: 100%; min-width: 0; }
.plan-row__actions { display: flex; gap: 6px; align-self: end; }
.plan-row__actions .btn { white-space: nowrap; }
.plan-row__note { grid-column: 1 / -1; margin: 0; }

@media (max-width: 900px) {
  .plan-row { grid-template-columns: 1fr 1fr; }
  .plan-row__cell--wide, .plan-row__actions { grid-column: 1 / -1; }
  .plan-row__actions .btn { flex: 1 1 auto; }
}
/* Метка оценивания в расписании — точка, а не надпись: в узкой колонке
   дня «без баллов» занимало больше места, чем само занятие. */
.week__dot {
  flex: 0 0 auto; margin-left: auto; align-self: center;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 1px var(--surface);
}
.week__dot--graded { background: var(--ok); }
.week__legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0 0 16px; }
.week__legend__item { display: inline-flex; align-items: center; gap: 6px; }
.week__legend .week__dot { margin-left: 0; }

/* Отказ сервера. Появляется поверх экрана и сам гаснет: он сообщает о том,
   что уже случилось, и закрывать его руками незачем. */
.request-error {
  position: fixed; left: 50%; bottom: 20px; transform: translate(-50%, 12px);
  z-index: 120; max-width: min(520px, calc(100vw - 24px));
  padding: 12px 16px; border-radius: 12px;
  background: var(--accent-2); color: #fff; font-size: 15px; line-height: 1.35;
  box-shadow: 0 8px 24px rgba(20, 17, 14, .28);
  opacity: 0; pointer-events: none; transition: opacity .16s ease, transform .16s ease;
}
.request-error.is-visible { opacity: 1; transform: translate(-50%, 0); }
@media (prefers-reduced-motion: reduce) { .request-error { transition: none; } }

/* Просмотр чужого кабинета — только чтение. Кнопки не прячем: спрятанная
   кнопка врёт о том, как кабинет выглядит у хозяина. Но видно, что они
   приглушены, а при нажатии сервер объяснит отказ. */
body.is-readonly .btn:not(.btn--quiet):not([data-allowed]),
/* Проверка домашнего — тоже действие за человека: в режиме просмотра
   кнопки гаснут все, включая тихие. Сервер их всё равно отклонит, но
   гасшая кнопка объясняет это до нажатия, а не после. */
body.is-readonly .review-row__actions .btn,
body.is-readonly .review-row__actions .link-btn,
body.is-readonly .grade-chip { opacity: .72; }
body.is-readonly form:not([action*="impersonate"]):not([action*="logout"]) { position: relative; }

/* «Сегодня» на главной ученика и родителя: несколько строк вместо
   недельной таблицы, которая дублировала раздел «Расписание». */
.page-head-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.today-strip { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; background: var(--line); border: 1px solid var(--line); }
.today-strip__item { display: flex; gap: 12px; align-items: baseline; background: var(--surface); padding: 10px 14px; }
.today-strip__time { flex: 0 0 auto; font-weight: 600; }
.today-strip__what { display: grid; gap: 2px; min-width: 0; }
.today-strip__subject { font-weight: 600; }

/* ─── Путь к цели ────────────────────────────────────────────────────────── */

/* Набор фигур для <use>: сам по себе не рисуется. */
.hero-sprite { display: none; }

.hero-picker { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 16px; }
.hero-picker__item {
  display: grid; justify-items: center; gap: 2px; cursor: pointer;
  padding: 6px 10px; min-width: 76px; font: inherit; color: var(--ink-3);
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
}
.hero-picker__item svg { width: 34px; height: 34px; }
.hero-picker__item.is-current { color: var(--ink); border-color: var(--accent); }
.hero-picker__item:hover { border-color: var(--accent); }

.goal {
  display: block; background: var(--surface); border: 1px solid var(--line);
  padding: clamp(12px, 2vw, 18px);
}
.goal__head { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; align-items: flex-start; }
.goal__title { margin: 0; font-size: 18px; }
.goal__hint { max-width: 66ch; margin: 14px 0 0; }
.goal__steps-editor { margin-top: 14px; }
.goal__steps-editor summary { cursor: pointer; color: var(--ink-3); }

/* Дорожка: пройденное позади и зелёное, спутник стоит там, докуда дошли. */
.goal-path { position: relative; margin: 20px 0 10px; padding: 46px 0 0 4px; }
.goal-path__track {
  position: relative; height: 6px; border-radius: 3px;
  background: var(--track); margin: 0 34px 0 0;
}
.goal-path__done {
  position: absolute; inset: 0 auto 0 0; width: var(--goal-progress, 0%);
  background: var(--ok); border-radius: 3px; transition: width .28s ease;
}
.goal-path__mark {
  position: absolute; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px;
  border-radius: 50%; background: var(--surface);
  border: 2px solid var(--line-strong);
  box-shadow: 0 0 0 2px var(--surface);
}
.goal-path__mark.is-done { background: var(--ok); border-color: var(--ok); }
.goal-path__hero {
  position: absolute; top: 4px; left: calc(var(--goal-progress, 0%) - 20px);
  width: 40px; height: 40px; color: var(--ink);
  transition: left .28s ease;
}
.goal-path__flag { position: absolute; right: 0; top: 12px; font-size: 24px; color: var(--accent); }
.goal-path__count { margin: 12px 0 0; }
.goal-path__praise { color: var(--ok); margin-left: 8px; }

.goal-steps { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 2px; }
.goal-steps__button {
  display: flex; gap: 10px; align-items: center; width: 100%;
  padding: 10px 12px; min-height: 44px; cursor: pointer; text-align: left;
  font: inherit; color: inherit; background: var(--paper);
  border: 1px solid var(--line); border-radius: 10px;
}
.goal-steps__button:hover { border-color: var(--accent); }
.goal-steps__box {
  flex: 0 0 auto; width: 22px; height: 22px; border-radius: 6px;
  border: 2px solid var(--line-strong); display: grid; place-items: center;
  font-size: 14px; line-height: 1; color: #fff;
}
.goal-steps__item.is-done .goal-steps__box { background: var(--ok); border-color: var(--ok); }
.goal-steps__item.is-done .goal-steps__text { color: var(--ink-3); text-decoration: line-through; }

@media (prefers-reduced-motion: reduce) {
  .goal-path__done, .goal-path__hero { transition: none; }
}

/* ─── Прогресс учеников ──────────────────────────────────────────────────── */

.progress-list { display: grid; gap: 2px; background: var(--line); border: 1px solid var(--line); margin-top: 20px; }
.progress-row {
  display: grid; gap: 10px 20px; align-items: center;
  grid-template-columns: minmax(150px, 200px) minmax(200px, 1fr) auto;
  background: var(--surface); padding: 14px clamp(10px, 1.6vw, 16px);
}
.progress-row__name { font-weight: 600; color: inherit; }

/* Путь по модулям: веха на модуль, заливка — доля набранного. В одну
   строку с прокруткой, а не переносом: перенесённый путь читается как два
   разных пути. Линия позади связывает вехи в дорогу. */
.progress-track {
  position: relative; display: flex; gap: 0 6px; align-items: flex-start;
  overflow-x: auto; padding-bottom: 4px;
}
.progress-track::before {
  content: ""; position: absolute; left: 22px; right: 22px; top: 13px;
  height: 2px; background: var(--line-strong);
}
.progress-track__stop {
  position: relative; display: grid; justify-items: center; gap: 2px;
  min-width: 52px; flex: 0 0 auto;
}
.progress-track__dot {
  width: 26px; height: 26px; border-radius: 50%;
  border: 2px solid var(--line-strong); background: var(--surface);
  /* Доля набранного — сектором. Проценты в conic-gradient задаются
     напрямую: умножать процент на градус нельзя, и заливка молча пропадала. */
  background-image: conic-gradient(var(--ok) var(--fill, 0%), transparent 0);
}
.progress-track__stop.is-current .progress-track__dot { border-color: var(--accent); }
.progress-track__stop.is-future { opacity: .45; }
.progress-track__points { font-weight: 600; font-size: 13px; }
.progress-track--wide { gap: 10px 22px; margin-top: 12px; }
.progress-track--wide .progress-track__stop { min-width: 120px; }

/* Лента состояния: клетка на день, пропуск — пустая клетка. */
.mood-ribbon { display: flex; gap: 2px; flex-wrap: wrap; }
.mood-ribbon--wide .mood-cell { width: 18px; height: 18px; }
.mood-cell {
  width: 12px; height: 12px; border-radius: 3px;
  background: var(--track); border: 1px solid var(--line-strong);
}
.mood-cell--1 { background: #C0492B; border-color: #C0492B; }
.mood-cell--2 { background: #D98324; border-color: #D98324; }
.mood-cell--3 { background: #C9AE5D; border-color: #C9AE5D; }
.mood-cell--4 { background: #6FA86B; border-color: #6FA86B; }
.mood-cell--5 { background: #2E7D53; border-color: #2E7D53; }
.mood-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 16px 0 0; }
.mood-legend__item { display: inline-flex; align-items: center; gap: 6px; }

@media (max-width: 860px) {
  .progress-row { grid-template-columns: 1fr; }
}

/* Выбранный спутник отмечен и цветом, и галочкой: одного оттенка рамки
   мало, чтобы понять, что выбор состоялся. */
.hero-picker__item { position: relative; }
.hero-picker__item.is-current {
  color: var(--ink); border-color: var(--accent); background: var(--mark);
}
.hero-picker__mark {
  position: absolute; top: 2px; right: 4px; font-size: 12px; color: var(--accent-2);
}

/* Архив достигнутых целей: свёрнут, пока есть активные. */
.goal-archive { margin-top: 20px; }
.goal-archive > summary { cursor: pointer; color: var(--ink-3); font-size: 14px; }
.goal--done { opacity: .8; border-left: 3px solid var(--ok); }

/* Шпаргалка по регламенту: списки читаются, а не сливаются. */
.rules-list { margin: 8px 0 0; padding-left: 22px; max-width: 78ch; }
.rules-list li { margin-bottom: 6px; line-height: 1.45; }
.rules-list--no li::marker { color: var(--accent-2); }

/* Зона перетаскивания файлов: документ уже лежит в открытой папке, и
   тащить его быстрее, чем искать в диалоге. Без скриптов остаётся
   обычная кнопка выбора — зона просто ничего не подсвечивает. */
.dropzone { position: relative; }
.dropzone__area {
  display: grid; gap: 10px; justify-items: center;
  padding: 16px 14px; border-radius: 12px;
  border: 1.5px dashed var(--line-strong); background: var(--paper);
  transition: border-color .12s ease, background-color .12s ease;
}
.dropzone__call { display: grid; gap: 2px; justify-items: center; text-align: center; color: var(--ink-2); }
.dropzone__input { max-width: 100%; }
.dropzone.is-over .dropzone__area { border-color: var(--accent); background: var(--mark); }
.dropzone.is-over .dropzone__call { color: var(--accent-2); }
.dropzone__chosen { color: var(--ink-2); overflow-wrap: anywhere; }

@media (prefers-reduced-motion: reduce) { .dropzone__area { transition: none; } }

/* Приписка под крупной цифрой: «академических часов» без «по 45 минут»
   читается как обычные часы, и путаница возвращается. */
.stat__note { margin-top: 2px; }

/* Пара двойников: слева та запись, что остаётся, справа — та, что исчезнет. */
.twins {
  display: grid; gap: 12px 18px; align-items: start;
  grid-template-columns: 1fr auto 1fr auto;
}
.twins__side { min-width: 0; }
.twins__side--drop { opacity: .8; }
.twins__arrow { align-self: center; color: var(--ink-3); font-size: 22px; }
.twins__action { min-width: 180px; }
@media (max-width: 900px) {
  .twins { grid-template-columns: 1fr; }
  .twins__arrow { display: none; }
}

/* Подпись исполнителя в подвале: заметна, но не спорит с реквизитами центра. */
.site-footer__author { margin-top: 10px; }
.site-footer__author a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.site-footer__author a:hover { color: var(--accent); }
