/* ===== Платформа «Портал обучения» — оформление =====
   Идея: тетрадный лист. Чернила — основной цвет, красная ручка учителя — единственный «громкий» акцент
   (оценки, комментарии, проверка). Клетка и поля тетради — тихий фон. */

:root {
  --paper: #F5F7FB;
  --sheet: #FFFFFF;
  --ink: #1C2541;
  --ink-soft: #3A4566;
  --blue: #2D4BA0;
  --blue-dark: #223B82;
  --blue-tint: #E9EEF9;
  --red: #D7263D;
  --red-tint: #FCE9EC;
  --margin: #F2A7B0;
  --grid: #E6ECF5;
  --line: #DDE3EE;
  --green: #1F8A5B;
  --green-tint: #E3F4EC;
  --amber: #B7791F;
  --amber-tint: #FBF1DE;
  --muted: #66708A;
  --radius-s: 6px;
  --radius-m: 10px;
  --shadow: 0 1px 2px rgba(28, 37, 65, .06), 0 6px 20px rgba(28, 37, 65, .06);
  --font: "Golos Text", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --serif: "Literata", "PT Serif", Georgia, "Times New Roman", serif;
  --hand: "Caveat", "Segoe Print", "Comic Sans MS", cursive;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--blue); }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; line-height: 1.25; margin: 0; color: var(--ink); }
h1 { font-size: 30px; letter-spacing: -.01em; }
h2 { font-size: 21px; }
h3 { font-size: 17px; }
p { margin: 0 0 10px; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.hidden, [hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }

/* ---------- каркас ---------- */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  padding: 22px 14px 16px 18px;
  background: var(--sheet);
  border-right: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 6px 20px; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 8px; flex: none;
  background: var(--blue); color: #fff;
  display: grid; place-items: center;
  font-family: var(--serif); font-weight: 700; font-size: 20px;
}
.brand-name { font-family: var(--serif); font-weight: 600; font-size: 16px; line-height: 1.15; }
.brand-sub { font-size: 12px; color: var(--muted); }
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: var(--radius-s);
  color: var(--ink-soft); text-decoration: none; font-weight: 500;
}
.nav a svg { width: 18px; height: 18px; flex: none; color: var(--muted); }
.nav a > span:not(.count) { white-space: nowrap; }
.nav a:hover { background: var(--paper); color: var(--ink); }
.nav a.active { background: var(--blue-tint); color: var(--blue-dark); }
.nav a.active svg { color: var(--blue); }
.nav .count {
  margin-left: auto; min-width: 20px; padding: 0 6px; border-radius: 10px;
  background: var(--red); color: #fff; font-size: 12px; font-weight: 600; text-align: center;
}
.nav .live-dot { margin-left: auto; width: 8px; height: 8px; border-radius: 50%; background: var(--red); animation: pulse 1.6s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.side-foot { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 10px; }
.me { display: flex; align-items: center; gap: 10px; padding: 4px 6px 10px; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-weight: 600; font-size: 13px;
  background: var(--blue-tint); color: var(--blue-dark);
}
.me-name { font-weight: 600; font-size: 14px; line-height: 1.2; }
.me-role { font-size: 12px; color: var(--muted); }

/* поля тетради — красная двойная линия слева от рабочей области */
.main {
  position: relative; min-width: 0;
  padding: 30px 40px 60px 64px;
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 24px 24px;
}
.main::before, .main::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 1.5px; background: var(--margin);
}
.main::before { left: 36px; }
.main::after { left: 40px; }
.page { max-width: 1120px; }

.topbar { display: none; }

/* ---------- заголовки страниц ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head p { margin: 6px 0 0; color: var(--muted); }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); text-decoration: none; font-size: 14px; margin-bottom: 10px; }
.back:hover { color: var(--ink); }
.back svg { width: 16px; height: 16px; }

/* ---------- лист (основной контейнер) ---------- */
.sheet { background: var(--sheet); border: 1px solid var(--line); border-radius: var(--radius-m); box-shadow: var(--shadow); }
.sheet-pad { padding: 20px 22px; }
.sheet + .sheet, .sheet + .grid, .grid + .sheet, .grid + .grid { margin-top: 18px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 22px; border-bottom: 1px solid var(--line); }
.sheet-head h2 { font-size: 18px; }
.grid { display: grid; gap: 18px; }
.grid > .sheet { margin-top: 0 !important; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }

/* ---------- кнопки и поля ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 15px; border-radius: var(--radius-s);
  border: 1px solid var(--line); background: var(--sheet); color: var(--ink);
  font-weight: 500; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .15s, border-color .15s;
}
.btn:hover { background: var(--paper); border-color: #C9D2E3; }
.btn svg { width: 17px; height: 17px; flex: none; }
.btn-primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-dark); border-color: var(--blue-dark); }
.btn-red { background: var(--red); border-color: var(--red); color: #fff; }
.btn-red:hover { background: #B81F33; border-color: #B81F33; }
.btn-green { background: var(--green); border-color: var(--green); color: #fff; }
.btn-green:hover { background: #18714A; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-soft); }
.btn-ghost:hover { background: var(--blue-tint); border-color: transparent; }
.btn-sm { padding: 5px 10px; font-size: 13px; }
.btn-lg { padding: 13px 22px; font-size: 16px; }
.btn[disabled] { opacity: .5; cursor: default; }
.icon-btn { padding: 7px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.field > span { font-size: 13px; font-weight: 500; color: var(--ink-soft); }
.field .hint { font-size: 12px; color: var(--muted); }
.input, .select, .textarea {
  width: 100%; padding: 9px 11px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-s); background: var(--sheet);
  transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(45, 75, 160, .12); }
.textarea { min-height: 90px; resize: vertical; line-height: 1.45; }
.input-sm, .select-sm { padding: 5px 8px; font-size: 13px; }
.row { display: flex; gap: 12px; }
.row > * { flex: 1; min-width: 0; }
.check { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--blue); }

/* ---------- метки статусов ---------- */
.tag { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 20px; font-size: 12.5px; font-weight: 500; background: var(--paper); color: var(--ink-soft); white-space: nowrap; }
.tag svg { width: 13px; height: 13px; }
.tag-green { background: var(--green-tint); color: var(--green); }
.tag-amber { background: var(--amber-tint); color: var(--amber); }
.tag-red { background: var(--red-tint); color: var(--red); }
.tag-blue { background: var(--blue-tint); color: var(--blue-dark); }

/* ---------- таблицы как тетрадные строки ---------- */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-weight: 500; font-size: 13px; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 11px 12px; border-bottom: 1px solid var(--grid); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tbody tr.clickable { cursor: pointer; }
.table tbody tr.clickable:hover td { background: var(--sheet-2); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--ink); }
.table-wrap { overflow-x: auto; }

/* ---------- красная ручка учителя ---------- */
.pen { font-family: var(--hand); color: var(--red); font-size: 21px; line-height: 1.15; font-weight: 600; }
.grade {
  display: inline-grid; place-items: center; min-width: 34px; height: 34px; padding: 0 4px;
  font-family: var(--hand); font-weight: 700; font-size: 26px; color: var(--red);
  border: 2px solid var(--red); border-radius: 50%; line-height: 1;
}
.grade.wide { border-radius: 18px; font-size: 22px; padding: 0 8px; }
.note-pen { border-left: 3px solid var(--red); padding: 4px 0 4px 14px; margin: 10px 0; }
.note-pen .meta { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

/* ---------- оглавление тем ---------- */
.toc-section + .toc-section { margin-top: 26px; }
.toc-section h3 { font-size: 15px; color: var(--muted); font-family: var(--font); font-weight: 600; margin-bottom: 6px; }
.toc-item {
  display: flex; align-items: baseline; gap: 10px;
  padding: 11px 4px; border-bottom: 1px solid var(--grid);
  color: var(--ink); text-decoration: none;
}
.toc-item:last-child { border-bottom: none; }
.toc-item .title { font-family: var(--serif); font-size: 17px; }
.toc-item .dots { flex: 1; border-bottom: 2px dotted #CBD3E1; transform: translateY(-4px); min-width: 20px; }
.toc-item .state { display: flex; align-items: center; gap: 6px; font-size: 13px; white-space: nowrap; }
.toc-item .state svg { width: 16px; height: 16px; }
a.toc-item:hover .title { color: var(--blue); }
.toc-item.locked { color: #9AA3B8; cursor: default; }
.toc-item.locked .title { color: #9AA3B8; }
.toc-item.locked .state { color: #9AA3B8; }
.toc-item.open .state { color: var(--green); }
.toc-item .num { font-family: var(--serif); color: var(--muted); min-width: 22px; }

/* ---------- плитки и мелочи ---------- */
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat .v { font-family: var(--serif); font-size: 26px; font-weight: 600; line-height: 1.1; }
.stat .l { font-size: 13px; color: var(--muted); }
.bar { height: 8px; border-radius: 6px; background: var(--grid); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--blue); border-radius: 6px; }
.bar.green > i { background: var(--green); }
.list-plain { list-style: none; margin: 0; padding: 0; }
.list-plain > li { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--grid); }
.list-plain > li:last-child { border-bottom: none; }
.list-plain .grow { flex: 1; min-width: 0; }
.list-plain li > svg { width: 20px; height: 20px; flex: none; color: var(--muted); }
.empty { padding: 28px 10px; text-align: center; color: var(--muted); }
.empty svg { width: 30px; height: 30px; color: #B8C1D3; display: block; margin: 0 auto 8px; }
.divider { height: 1px; background: var(--line); margin: 16px 0; }
.pill-tabs { display: inline-flex; gap: 4px; padding: 4px; background: var(--sheet); border: 1px solid var(--line); border-radius: 8px; flex-wrap: wrap; }
.pill-tabs button { border: 0; background: transparent; padding: 6px 12px; border-radius: 6px; cursor: pointer; font-weight: 500; color: var(--ink-soft); }
.pill-tabs button.on { background: var(--blue); color: #fff; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 10px 14px; cursor: pointer; font-weight: 500; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button.on { color: var(--ink); border-bottom-color: var(--red); }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .input, .toolbar .select { width: auto; }
.search { min-width: 220px; }

/* ---------- урок: следующий урок / живой урок ---------- */
.next-lesson { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.next-lesson .when { font-family: var(--serif); font-size: 26px; font-weight: 600; }
.next-lesson .lbl { color: var(--muted); font-size: 14px; }
.live-banner {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 16px 20px; border-radius: var(--radius-m); margin-bottom: 18px;
  background: var(--ink); color: #fff;
}
.live-banner .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--red); animation: pulse 1.6s infinite; }
.live-banner .grow { flex: 1; min-width: 200px; }
.live-banner b { font-weight: 600; }

/* ---------- приветствие ---------- */
.hello h1 { font-size: 34px; }
.hello .date { color: var(--muted); margin-top: 4px; }

/* ---------- памятка ---------- */
.memo { font-size: 16px; line-height: 1.65; max-width: 72ch; }
.memo h3 { font-size: 20px; margin: 0 0 12px; }
.memo h4 { font-size: 16px; margin: 16px 0 6px; }
.memo ul, .memo ol { padding-left: 22px; margin: 6px 0 12px; }
.memo li { margin: 4px 0; }
.memo .rule, .memo blockquote { margin: 12px 0; padding: 10px 16px; border-left: 3px solid var(--red); background: var(--red-tint); border-radius: 0 8px 8px 0; }
.memo i { color: var(--ink-soft); }
.memo-editor { min-height: 240px; padding: 14px 16px; border: 1px solid var(--line-strong); border-radius: var(--radius-s); background: var(--sheet); }
.memo-editor:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(45, 75, 160, .12); }
.rte-bar { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 6px; }
.rte-bar button { border: 1px solid var(--line); background: var(--sheet); border-radius: 5px; padding: 4px 9px; cursor: pointer; min-width: 32px; }
.rte-bar button:hover { background: var(--paper); }

/* ---------- просмотр презентаций ---------- */
.viewer { background: #2A3150; border-radius: var(--radius-m); overflow: hidden; }
.viewer-stage { position: relative; display: grid; place-items: center; padding: 14px; min-height: 260px; }
.viewer-stage canvas { max-width: 100%; height: auto; display: block; border-radius: 4px; box-shadow: 0 4px 24px rgba(0,0,0,.35); background: #fff; }
.viewer-bar { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: #222842; color: #E6EAF5; flex-wrap: wrap; }
.viewer-bar .btn { background: transparent; color: #E6EAF5; border-color: #434B6B; }
.viewer-bar .btn:hover { background: #343C5E; }
.viewer-bar .count { font-variant-numeric: tabular-nums; min-width: 70px; text-align: center; }
.viewer-bar .grow { flex: 1; }
.viewer:fullscreen { display: flex; flex-direction: column; border-radius: 0; }
.viewer:fullscreen .viewer-stage { flex: 1; }
.viewer:fullscreen .viewer-stage canvas { max-height: calc(100vh - 80px); width: auto; }

/* ---------- тесты ---------- */
.q { padding: 18px 22px; border-bottom: 1px solid var(--grid); }
.q:last-child { border-bottom: none; }
.q-num { font-family: var(--serif); font-weight: 600; color: var(--muted); margin-right: 6px; }
.q-text { white-space: pre-line; font-size: 16px; margin-bottom: 12px; }
.q-img { max-width: 100%; max-height: 300px; border-radius: 6px; margin: 4px 0 12px; display: block; }
.q .answer-input { max-width: 340px; font-size: 16px; letter-spacing: .02em; }
.q .opts { display: flex; flex-direction: column; gap: 6px; }
.q .opt { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; background: var(--sheet); }
.q .opt:hover { border-color: #BCC6DA; }
.q .opt input { accent-color: var(--blue); width: 17px; height: 17px; }
.q.right { background: linear-gradient(90deg, var(--green-tint), transparent 60%); }
.q.wrong { background: linear-gradient(90deg, var(--red-tint), transparent 60%); }
.q .verdict { margin-top: 12px; display: flex; gap: 10px; align-items: flex-start; }
.q .verdict svg { width: 22px; height: 22px; flex: none; margin-top: 1px; }
.q.right .verdict svg { color: var(--green); }
.q.wrong .verdict svg { color: var(--red); }
.q .expl { color: var(--ink-soft); font-size: 14px; margin-top: 2px; }
.opt.is-right { border-color: var(--green); background: var(--green-tint); }
.opt.is-wrong { border-color: var(--red); background: var(--red-tint); }
.score-line { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.score-big { font-family: var(--hand); font-size: 64px; line-height: .9; color: var(--red); font-weight: 700; }

/* ---------- игры ---------- */
.game-tile { display: flex; flex-direction: column; gap: 6px; padding: 18px; text-decoration: none; color: var(--ink); background: var(--sheet); border: 1px solid var(--line); border-radius: var(--radius-m); transition: border-color .15s, transform .15s; }
a.game-tile:hover { border-color: var(--blue); transform: translateY(-1px); }
.game-tile .ico { width: 40px; height: 40px; border-radius: 9px; display: grid; place-items: center; background: var(--blue-tint); color: var(--blue); margin-bottom: 4px; }
.game-tile .ico svg { width: 22px; height: 22px; }
.game-tile h3 { font-size: 17px; }
.game-tile .sub { font-size: 13px; color: var(--muted); }
.game-tile.locked { opacity: .55; }
.game-tile.locked .ico { background: var(--paper); color: var(--muted); }
.game-tile.ext .ico { background: var(--violet-tint); color: #4F46E5; }
.game-frame { width: 100%; height: calc(100vh - 150px); min-height: 560px; border: 0; border-radius: var(--radius-m); background: #1e1b4b; display: block; }

.flash { perspective: 1200px; max-width: 560px; margin: 0 auto; }
.flash-card { position: relative; height: 280px; cursor: pointer; transform-style: preserve-3d; transition: transform .45s; }
.flash-card.flipped { transform: rotateY(180deg); }
.flash-face { position: absolute; inset: 0; backface-visibility: hidden; display: grid; place-items: center; text-align: center; padding: 28px; border-radius: 14px; background: var(--sheet); border: 1px solid var(--line); box-shadow: var(--shadow);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px); background-size: 22px 22px; }
.flash-face .t { font-family: var(--serif); font-size: 24px; font-weight: 600; background: rgba(255,255,255,.85); padding: 4px 8px; border-radius: 6px; }
.flash-back { transform: rotateY(180deg); }
.flash-back .t { color: var(--blue-dark); }
.flash-hint { text-align: center; color: var(--muted); font-size: 13px; margin: 10px 0 16px; }

/* ---------- статус ученика и доска почёта ---------- */
.status-banner { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; background: var(--amber-tint); color: var(--ink); flex-wrap: wrap; }
.status-banner.alumni { background: var(--blue-tint); }
.status-banner > svg { width: 22px; height: 22px; flex: none; color: var(--amber); }
.status-banner.alumni > svg { color: var(--blue); }
.tabs .tab-link svg { width: 15px; height: 15px; vertical-align: -2px; }
.honor-year { margin-bottom: 18px; }
.honor-year h2 { font-family: var(--serif); margin-bottom: 12px; }
.honor-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.honor-card { display: flex; flex-direction: column; gap: 3px; align-items: center; text-align: center; padding: 16px 12px; border: 1px solid var(--line); border-radius: 12px; background: linear-gradient(180deg, #FFFBEF, var(--sheet)); }
.honor-card[data-s] { cursor: pointer; }
.honor-card[data-s]:hover { border-color: var(--amber); }
.honor-card .medal { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--amber-tint); color: var(--amber); margin-bottom: 4px; }
.honor-card .medal svg { width: 24px; height: 24px; }

/* ---------- банк ФИПИ ---------- */
.fipi-task { margin: 4px 0; }
.fipi-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.fipi-num { display: inline-grid; place-items: center; min-width: 30px; height: 30px; padding: 0 6px; border-radius: 8px; background: var(--red-tint); color: var(--red); font-family: var(--serif); font-weight: 700; }
.fipi-q, .fipi-o, .fipi-text { line-height: 1.55; overflow-wrap: anywhere; }
.fipi-q p, .fipi-o p, .fipi-text p { margin: 0 0 6px; }
.fipi-q table, .fipi-o table { border-collapse: collapse; max-width: 100%; }
.fipi-q td, .fipi-o td { padding: 2px 6px; vertical-align: top; }
.fipi-o { margin-top: 6px; }
.fipi-text { font-family: var(--serif); font-size: 16px; }
.fipi-text-box { margin: 8px 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--sheet-2); }
.fipi-text-box summary { cursor: pointer; padding: 10px 14px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.fipi-text-box summary svg { width: 18px; height: 18px; }
.fipi-text-box .fipi-text { padding: 0 16px 14px; max-height: 60vh; overflow: auto; }
.fipi-ans { margin: 8px 0 4px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.fipi-stats tr.on td { background: var(--blue-tint); }
.review-card { max-width: 900px; }
.review-answer { margin-top: 14px; padding: 12px 14px; border-radius: 10px; background: var(--paper); }
.big-answer { font-family: var(--serif); font-size: 22px; color: var(--blue-dark); }
.num-picks { display: flex; flex-wrap: wrap; gap: 6px; }
.num-pick { position: relative; }
.num-pick input { position: absolute; opacity: 0; }
.num-pick span { display: inline-grid; place-items: center; width: 38px; height: 34px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; font-weight: 600; background: var(--sheet); }
.num-pick input:checked + span { background: var(--blue); border-color: var(--blue); color: #fff; }
.num-pick.off span { opacity: .4; cursor: not-allowed; }
.variant-grid { align-items: start; }
.fipi-q-wrap { padding: 16px 20px; border-bottom: 1px solid var(--line); }
.fipi-q-wrap .answer-input { max-width: 320px; margin-top: 10px; }
.fipi-q-wrap.right { background: var(--green-tint); }
.fipi-q-wrap.wrong { background: var(--note); }

/* вкладка «Подготовка к ЕГЭ» */
.ege-prep { align-items: start; }
.ege-prep h2 { margin-bottom: 4px; }
.num-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 6px; margin-top: 10px; }
.num-btn { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 7px 2px; border: 1px solid var(--line); border-radius: 9px; background: var(--sheet); cursor: pointer; color: var(--ink); }
.num-btn b { font-family: var(--serif); font-size: 18px; }
.num-btn span { font-size: 11px; color: var(--muted); }
.num-btn:not(:disabled):hover { border-color: var(--blue); }
.num-btn.on { background: var(--blue); border-color: var(--blue); color: #fff; }
.num-btn.on span { color: #DCE4F7; }
.num-btn:disabled { opacity: .45; cursor: not-allowed; }
.essay-note { margin-top: 10px; padding: 10px 14px; border-radius: 10px; background: var(--amber-tint); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.essay-note > svg { width: 20px; height: 20px; color: var(--amber); }
.fipi-q-wrap .btn-row .answer-input { margin-top: 0; }
.res-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.res-chip { min-width: 34px; height: 32px; padding: 0 6px; border-radius: 8px; border: 1px solid var(--line); background: var(--paper); color: var(--muted); font-weight: 600; cursor: pointer; }
.res-chip.ok { background: var(--green-tint); border-color: #B6E2CB; color: var(--green); }
.res-chip.bad { background: var(--red-tint); border-color: #F3B8C1; color: var(--red); }
.res-chip.essay { background: var(--amber-tint); border-color: #EBCF97; color: var(--amber); }
.res-chip:hover { border-color: var(--blue); }
.no-answer { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 13px; color: var(--muted); }
.no-answer svg, .fipi-q-wrap .verdict > svg { width: 18px; height: 18px; flex: none; }
/* в заданиях ФИПИ на соответствие есть пустые выпадающие списки — ответ вписывается в поле, они не нужны */
.fipi-q select, .fipi-o select { display: none; }

/* ---------- работы с фото ---------- */
.work-grid { grid-template-columns: minmax(0, 1.7fr) minmax(280px, 1fr); align-items: start; }
.annot { position: relative; line-height: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; }
.annot img { width: 100%; height: auto; display: block; user-select: none; -webkit-user-drag: none; }
.annot canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; }
.annot-tools { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.annot-tools .swatch { width: 24px; height: 24px; }
.annot-tools .swatch.on { border-color: var(--ink); box-shadow: 0 0 0 2px #fff inset; }
.annot-tools .tool-sep { background: var(--line); }
.photo-tabs { margin-bottom: 10px; }
.small-drop { padding: 22px; }
.photo-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; margin-top: 12px; }
.photo-thumb { position: relative; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; aspect-ratio: 3 / 4; background: var(--paper); }
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; }
.photo-thumb button { position: absolute; top: 6px; right: 6px; padding: 4px; }
.photo-thumb span { position: absolute; left: 6px; bottom: 6px; background: rgba(28,37,65,.75); color: #fff; font-size: 12px; padding: 1px 7px; border-radius: 10px; }
.photo-thumb.loading { display: grid; place-items: center; }
.photo-thumb.loading span { position: static; background: none; color: var(--muted); }
/* поддержка: «Сообщить об ошибке», страница сообщений, место на сервере, резервная копия */
.side-actions { display: flex; flex-wrap: wrap; gap: 4px; }
.side-actions .btn svg { width: 16px; height: 16px; }
.report-list { display: grid; gap: 12px; }
.report.done { opacity: .65; }
.report-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.report-text { white-space: pre-wrap; margin-bottom: 8px; }
.report-shot { width: 140px; margin-bottom: 8px; display: block; }
.report details { margin-bottom: 6px; }
.err-msg { color: var(--muted); word-break: break-word; }
.usage-row { margin-bottom: 14px; }
.usage-top { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 6px; flex-wrap: wrap; }
.bar.warn i { background: var(--red); }
.backup-progress { margin-top: 12px; display: grid; gap: 6px; }
.backup-progress[hidden] { display: none; }
/* личное досье ученика */
.tabs button svg { width: 15px; height: 15px; vertical-align: -2px; margin-right: 4px; }
.dossier-lock svg, .redo-box h2 svg, .redo-list li > svg, .dossier-list li > svg { width: 18px; height: 18px; flex: none; }
.dossier-lock { display: flex; align-items: center; gap: 8px; padding: 10px 14px; margin-bottom: 16px; border-radius: 12px; background: var(--note); color: var(--ink); font-size: 14px; }
.dossier { margin-bottom: 18px; align-items: start; }
.dossier h2 { margin-bottom: 12px; }
.dossier-list li { display: flex; align-items: flex-start; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); }
.dossier-list li:first-child { border-top: 0; }
.dossier-add { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.dossier-add input[name="contact"] { grid-column: 1 / -1; }
.dossier-add .btn { justify-self: start; }
.dossier-note { display: grid; gap: 8px; }
.dossier-note input[type="date"] { max-width: 190px; }
.dossier-note .btn { justify-self: start; }
.dossier-notes { margin-top: 12px; }
.dossier-notes li { display: flex; gap: 12px; align-items: flex-start; padding: 9px 0; border-top: 1px solid var(--line); }
.dossier-notes .date { flex: none; width: 110px; color: var(--muted); font-size: 13px; padding-top: 2px; }
.dossier-notes .text { white-space: pre-wrap; }
.pay-head { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 10px; }
.pay-head .field { margin: 0; width: 140px; }
.pay-balance { flex: 1; min-width: 180px; padding: 10px 14px; border-radius: 12px; background: var(--sheet-2); border: 1px solid var(--line); }
.pay-balance b { display: block; color: var(--green); }
.pay-balance.zero b { color: var(--ink); }
.pay-balance.debt b { color: var(--red); }
.pay-balance span { font-size: 13px; color: var(--muted); }
.pay-list { margin-top: 12px; }
.pay-list li.paid > svg { color: var(--green); }
@media (max-width: 560px) {
  .dossier-add, .dossier-note { grid-template-columns: 1fr; }
  .dossier-notes li { flex-wrap: wrap; }
  .dossier-notes .date { width: auto; }
}
/* работа над ошибками */
.redo-box { margin: 0 0 18px; }
.redo-box h2 { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.redo-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin-top: 12px; }
.redo-actions .btn-row { margin-top: 6px; }
.redo-list { margin-top: 12px; }
.redo-list li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.redo-list .res { white-space: nowrap; }
/* фото задания (ДЗ по фото): нажатие открывает фото целиком */
.task-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; margin: 10px 0 4px; }
button.photo-thumb { padding: 0; cursor: zoom-in; font: inherit; }
.answer-box { padding: 10px 12px; border-radius: 10px; margin-bottom: 12px; background: var(--sheet-2); border: 1px solid var(--line); }
.answer-text { white-space: pre-wrap; margin-top: 4px; }
.table.crit td { padding: 7px 6px; vertical-align: middle; }
.table.crit .select-sm { width: 64px; min-width: 64px; }
.table.crit td.num { white-space: nowrap; }
.crit-total { font-size: 18px; margin: 10px 0 4px; }
.crit-total b { font-family: var(--serif); font-size: 24px; color: var(--red); }
.assign-list { max-height: 220px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; display: grid; gap: 2px; }
.list-plain li.clickable { cursor: pointer; }
@media (max-width: 860px) { .work-grid { grid-template-columns: 1fr; } }

/* ---------- Подготовка к ЕГЭ ---------- */
.tabs { overflow-y: hidden; }
.tabs a.tab-link { display: inline-flex; align-items: center; gap: 5px; padding: 10px 14px 9px; font-weight: 500; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; text-decoration: none; }
.tabs a.tab-link.on { color: var(--ink); border-bottom-color: var(--red); }
.game-tile.ege .ico { background: var(--red-tint); color: var(--red); }
.ege-num { font-family: var(--serif); font-weight: 700; font-size: 18px; }
.ege-setup { max-width: 620px; }
.ege-setup .field > span { display: block; margin-bottom: 6px; }
.ege-start { width: 100%; justify-content: center; margin-top: 6px; }
.ege-game { max-width: 760px; margin: 0 auto; }
.ege-hud { display: flex; gap: 8px; justify-content: space-between; margin-bottom: 10px; }
.ege-hud .tag { font-size: 14px; padding: 4px 12px; }
.ege-card { margin: 16px 0; padding: 26px 22px; background: var(--sheet); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); text-align: center; transition: border-color .2s, background .2s; }
.ege-card.right { border-color: var(--green); background: var(--green-tint); }
.ege-card.wrong { border-color: var(--red); background: var(--note); }
.ege-ask { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 10px; }
.ege-q { font-family: var(--serif); font-size: 30px; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.ege-card.quote .ege-q { font-size: 20px; font-weight: 500; text-align: left; }
.ege-q .slot { color: var(--red); background: var(--red-tint); border-radius: 5px; padding: 0 4px; }
.ege-author { font-family: var(--font); font-size: 14px; color: var(--muted); text-align: right; margin-top: 8px; font-weight: 400; }
.ege-ctx { color: var(--muted); margin-top: 8px; font-size: 15px; }
.ege-opts { display: grid; gap: 10px; }
.ege-opts.n2, .ege-opts.n4 { grid-template-columns: 1fr 1fr; }
.ege-opts.n3 { grid-template-columns: 1fr 1fr 1fr; }
.ege-opts button { position: relative; min-height: 64px; padding: 14px 16px 14px 38px; font: 600 20px var(--font); color: var(--ink); border-radius: 12px; border: 2px solid var(--line); border-bottom-width: 4px; background: var(--sheet); cursor: pointer; text-align: left; overflow-wrap: anywhere; touch-action: manipulation; }
.ege-opts button .k { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-size: 12px; color: var(--muted); font-weight: 500; }
.ege-opts button:not(:disabled):hover { border-color: var(--blue); color: var(--blue); }
.ege-opts button:disabled { cursor: default; opacity: .8; }
.ege-opts button.ok { border-color: var(--green); background: var(--green-tint); opacity: 1; }
.ege-opts button.bad { border-color: var(--red); background: var(--red-tint); opacity: 1; }
.stress { color: var(--red); }
.fill { color: var(--green); }
.ege-feedback { margin-top: 14px; }
.ege-verdict { display: flex; gap: 10px; align-items: flex-start; padding: 14px 16px; border-radius: 10px; background: var(--green-tint); }
.ege-verdict.bad { background: var(--red-tint); }
.ege-verdict.bad .fill { color: var(--red); }
.ege-verdict > svg { width: 22px; height: 22px; flex: none; margin-top: 2px; }
.ege-verdict.ok > svg { color: var(--green); }
.ege-verdict.bad > svg { color: var(--red); }
.ege-rule { color: var(--ink-soft); margin-top: 4px; font-size: 14.5px; }
.ege-next { width: 100%; justify-content: center; margin-top: 12px; }
.ege-end { max-width: 760px; margin: 0 auto; text-align: center; }
.ege-mistakes { text-align: left; margin: 18px 0; }
.ege-mistakes h3 { margin-bottom: 8px; }
.ege-mistake { padding: 10px 0; border-top: 1px solid var(--line); }
.ege-mistake .w { font-family: var(--serif); font-size: 18px; }
.ege-mistake .r { color: var(--muted); font-size: 14px; margin-top: 2px; }
@media (max-width: 640px) {
  .ege-q { font-size: 24px; }
  .ege-card { padding: 20px 14px; }
  .ege-card.quote .ege-q { font-size: 17px; }
  .ege-opts.n2, .ege-opts.n3, .ege-opts.n4 { grid-template-columns: 1fr; }
  .game-tile.ege { display: grid; grid-template-columns: 44px 1fr; column-gap: 12px; row-gap: 2px; padding: 14px; }
  .game-tile.ege .ico { grid-row: span 3; margin: 0; }
  .ege-opts button { font-size: 18px; min-height: 56px; }
}

/* карточки с вводом ответа */
.card-quiz { max-width: 640px; margin: 0 auto; padding: 26px 22px; background: var(--sheet); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); text-align: center; transition: border-color .2s, background .2s; }
.card-quiz.right { border-color: var(--green); background: var(--green-tint); }
.card-quiz.wrong { border-color: var(--red); background: var(--note); }
.card-q { font-family: var(--serif); font-size: 26px; font-weight: 600; line-height: 1.35; margin-bottom: 18px; overflow-wrap: anywhere; }
.card-form { display: flex; gap: 10px; }
.card-input { flex: 1; font-size: 18px; padding: 12px 14px; min-width: 0; }
.card-quiz .ege-verdict { margin-top: 14px; text-align: left; }
.card-skip { margin-top: 12px; }
.link-btn { border: 0; background: none; padding: 0; margin-top: 6px; color: var(--blue); text-decoration: underline; cursor: pointer; font: inherit; font-size: 14px; }
@media (max-width: 640px) {
  .card-q { font-size: 21px; }
  .card-form { flex-direction: column; }
  .card-form .btn { width: 100%; justify-content: center; }
}

.blitz-q { font-family: var(--serif); font-size: 32px; font-weight: 600; text-align: center; padding: 34px 10px; }
.blitz-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; max-width: 560px; margin: 0 auto; }
.blitz-opts button { padding: 18px; font-size: 20px; font-weight: 600; border-radius: 12px; border: 2px solid var(--line); border-bottom-width: 4px; background: var(--sheet); cursor: pointer; }
.blitz-opts button:hover { border-color: var(--blue); color: var(--blue); }
.blitz-opts button.ok { border-color: var(--green); background: var(--green-tint); }
.blitz-opts button.bad { border-color: var(--red); background: var(--red-tint); }
.timer { font-family: var(--serif); font-size: 30px; font-weight: 600; font-variant-numeric: tabular-nums; }
.timer.low { color: var(--red); }

.jeo { display: grid; gap: 8px; }
.jeo-col-head { font-weight: 600; font-size: 13.5px; text-align: center; padding: 8px 6px; color: var(--ink-soft); min-height: 52px; display: grid; place-items: center; }
.jeo-cell { height: 72px; border-radius: 10px; border: 0; background: var(--blue); color: #fff; font-family: var(--serif); font-size: 26px; font-weight: 600; cursor: pointer; }
.jeo-cell:hover { background: var(--blue-dark); }
.jeo-cell.used { background: var(--grid); color: transparent; cursor: default; }
.jeo-cell.used.ok { background: var(--green-tint); }
.jeo-cell.used.bad { background: var(--red-tint); }

/* ---------- значки ---------- */
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.badge-item { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 14px 10px; border-radius: var(--radius-m); border: 1px dashed var(--line); color: #A3ABBE; }
.badge-item .medal { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--paper); }
.badge-item .medal svg { width: 26px; height: 26px; }
.badge-item b { font-size: 13.5px; font-weight: 600; }
.badge-item span { font-size: 12px; }
.badge-item.got { border-style: solid; border-color: var(--line); color: var(--ink); background: var(--sheet); }
.badge-item.got .medal { background: var(--red); color: #fff; }
.badge-item.got span { color: var(--muted); }

/* ---------- рейтинг ---------- */
.lb-row { display: flex; align-items: center; gap: 14px; padding: 10px 6px; border-bottom: 1px solid var(--grid); }
.lb-row:last-child { border-bottom: none; }
.lb-row .place { width: 30px; text-align: center; font-family: var(--serif); font-weight: 600; font-size: 18px; color: var(--muted); }
.lb-row.top1 .place { color: #C08A00; }
.lb-row.top2 .place { color: #7C8798; }
.lb-row.top3 .place { color: #A0623B; }
.lb-row .who { flex: 1; font-weight: 500; }
.lb-row .pts { font-variant-numeric: tabular-nums; font-weight: 600; }
.lb-row.me { background: var(--blue-tint); border-radius: 8px; }
.cmp-row { padding: 10px 0; border-bottom: 1px solid var(--grid); }
.cmp-row:last-child { border-bottom: none; }
.cmp-title { font-weight: 500; margin-bottom: 6px; }
.cmp-line { display: grid; grid-template-columns: 50px minmax(0, 1fr) 42px; gap: 10px; align-items: center; font-size: 13px; margin-top: 3px; }
.cmp-line .who { color: var(--muted); }
.cmp-line b, .cmp-line span:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.cmp-bar { position: relative; height: 8px; background: var(--grid); border-radius: 6px; }
.cmp-bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 6px; }

/* ---------- расписание ---------- */
.week { display: grid; grid-template-columns: 52px repeat(7, minmax(110px, 1fr)); min-width: 860px; }
.week .wh { position: sticky; top: 0; z-index: 2; background: var(--sheet); padding: 10px 8px; font-weight: 600; font-size: 13.5px; border-bottom: 1px solid var(--line); text-align: center; }
.week .wh.today { color: var(--red); }
.week .hours { position: relative; }
.week .hour { height: 52px; font-size: 12px; color: var(--muted); text-align: right; padding-right: 8px; transform: translateY(-8px); }
.week .day { position: relative; border-left: 1px solid var(--grid); }
.week .slot { height: 52px; border-bottom: 1px solid var(--grid); cursor: pointer; }
.week .slot:hover { background: var(--sheet-2); }
.week .day.today { background: var(--sheet-2); }
.lesson-block { position: absolute; left: 4px; right: 4px; border-radius: 7px; padding: 5px 8px; background: var(--blue-tint); border-left: 3px solid var(--blue); font-size: 12.5px; line-height: 1.3; cursor: pointer; overflow: hidden; }
.lesson-block:hover { background: #DCE4F7; }
.lesson-block b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lesson-block.g11 { border-left-color: #6A4BC4; background: #EEE9FA; }
.lesson-block.g9 { border-left-color: var(--green); background: var(--green-tint); }
.lesson-block.g7, .lesson-block.g8 { border-left-color: var(--amber); background: var(--amber-tint); }

/* ---------- модальные окна и уведомления ---------- */
.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(28, 37, 65, .42); display: grid; place-items: center; padding: 16px; animation: fade .15s ease-out; }
@keyframes fade { from { opacity: 0; } }
.modal { width: 100%; max-width: 520px; max-height: calc(100vh - 32px); overflow: auto; background: var(--sheet); border-radius: 12px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal.wide { max-width: 760px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px 0; }
.modal-head h2 { font-size: 20px; }
.modal-body { padding: 16px 22px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 0 22px 20px; flex-wrap: wrap; }
.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 60; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--ink); color: #fff; padding: 11px 16px; border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.2); max-width: 360px; animation: slidein .2s ease-out; }
.toast.xp { background: var(--red); font-weight: 600; }
@keyframes slidein { from { transform: translateY(10px); opacity: 0; } }

.cred { border: 2px dashed var(--blue); border-radius: 10px; padding: 16px 18px; background: var(--blue-tint); font-size: 15px; }
.cred .k { color: var(--muted); display: inline-block; min-width: 72px; }
.cred .v { font-family: Consolas, "Courier New", monospace; font-weight: 700; font-size: 17px; }

/* ---------- вход ---------- */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-left {
  position: relative; padding: 56px 56px 40px 96px; display: flex; flex-direction: column; justify-content: center;
  background-color: var(--sheet);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 24px 24px;
}
.login-left::before, .login-left::after { content: ""; position: absolute; top: 0; bottom: 0; width: 1.5px; background: var(--margin); }
.login-left::before { left: 60px; }
.login-left::after { left: 64px; }
.login-title { font-family: var(--serif); font-size: 44px; line-height: 1.1; font-weight: 600; max-width: 13ch; }
.login-lead { font-size: 17px; color: var(--ink-soft); max-width: 46ch; margin-top: 16px; }
.login-pen { margin-top: 30px; font-size: 30px; transform: rotate(-3deg); transform-origin: left; display: inline-block; }
.login-right { display: grid; place-items: center; padding: 40px 24px; background: var(--paper); }
.login-card { width: 100%; max-width: 380px; }
.login-card h2 { font-size: 24px; margin-bottom: 18px; }
.demo-box { margin-top: 22px; padding: 14px 16px; border-radius: 10px; background: var(--sheet); border: 1px solid var(--line); }
.demo-box p { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.demo-box .btn { width: 100%; justify-content: flex-start; margin-bottom: 6px; }
.err { color: var(--red); font-size: 14px; min-height: 20px; margin-bottom: 8px; }

/* ---------- живой урок ---------- */
.lesson-shell { position: fixed; inset: 0; z-index: 40; display: flex; flex-direction: column; background: #1F2540; color: #E6EAF5; }
.lesson-top { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: #171C33; flex-wrap: wrap; }
.lesson-top .title { font-weight: 600; }
.lesson-top .grow { flex: 1; }
.lesson-top .btn { background: transparent; color: #E6EAF5; border-color: #434B6B; }
.lesson-top .btn:hover { background: #2D3456; }
.lesson-top .btn-red { background: var(--red); border-color: var(--red); }
.rec { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: #FFB3BD; }
.rec i { width: 8px; height: 8px; border-radius: 50%; background: var(--red); animation: pulse 1.6s infinite; }
.lesson-stage { flex: 1; position: relative; display: grid; place-items: center; padding: 14px; min-height: 0; }
.lesson-board { position: relative; background: #fff; box-shadow: 0 6px 30px rgba(0,0,0,.35); border-radius: 4px; touch-action: none; }
.lesson-board canvas { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 4px; }
.lesson-board canvas.ink { cursor: crosshair; }
.lesson-board.no-draw canvas.ink { cursor: default; }
/* PowerPoint на уроке: просмотрщик под холстом; в режиме «листать» холст пропускает нажатия */
.office-holder { position: absolute; inset: 0; border-radius: inherit; overflow: hidden; background: #fff; }
.office-frame { display: block; width: 100%; height: 100%; border: 0; background: #fff; }
.lesson-board.pass canvas.ink { pointer-events: none; }
.office-none { height: 100%; display: grid; place-content: center; gap: 6px; padding: 24px; text-align: center; color: #1C2541; background: #fff; }
.office-none p { margin: 0; max-width: 460px; color: #5A6380; font-size: 14px; }
.viewer.office .viewer-stage { display: block; padding: 0; height: min(70vh, 620px); }
.viewer.office .office-frame, .viewer.office .office-none { border-radius: 8px; }
.flip-btn[hidden] { display: none; }
.laser { position: absolute; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; background: rgba(215, 38, 61, .9); box-shadow: 0 0 0 6px rgba(215, 38, 61, .25); pointer-events: none; display: none; }
.laser.s { background: rgba(45, 75, 160, .9); box-shadow: 0 0 0 6px rgba(45, 75, 160, .25); }
.lesson-tools { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 14px; background: #171C33; flex-wrap: wrap; }
.tool { width: 40px; height: 40px; border-radius: 9px; border: 1px solid #3A4262; background: #262D4A; color: #E6EAF5; display: grid; place-items: center; cursor: pointer; }
.tool:hover { background: #313961; }
.tool.on { border-color: #fff; background: #3A4370; }
.tool svg { width: 20px; height: 20px; }
.swatch { width: 26px; height: 26px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; }
.swatch.on { border-color: #fff; box-shadow: 0 0 0 2px #171C33 inset; }
.tool-sep { width: 1px; height: 26px; background: #3A4262; margin: 0 6px; }
.tool-group { display: contents; }
.tool.size i { display: block; border-radius: 50%; background: currentColor; }
.swatch.custom { position: relative; overflow: hidden; background: conic-gradient(#D7263D, #F08C00, #F5D90A, #1F8A5B, #2D4BA0, #7B3FC4, #D7263D); }
.swatch.custom input { position: absolute; inset: -6px; width: 40px; height: 40px; opacity: 0; cursor: pointer; }
.swatch[data-color="#FFFFFF"] { box-shadow: 0 0 0 1px #5A6386 inset; }
.lesson-board[data-tool="text"] canvas.ink { cursor: text; }
.lesson-board[data-tool="remove"] canvas.ink { cursor: not-allowed; }
.lesson-board[data-tool="eraser"] canvas.ink { cursor: cell; }
.lesson-text-input { position: absolute; z-index: 3; min-width: 140px; max-width: 70%; padding: 0 2px; margin: 0; border: 1px dashed #7B8AB8; background: rgba(255,255,255,.85); font-family: "Golos Text", "Segoe UI", Arial, sans-serif; font-weight: 600; line-height: 1.25; resize: none; outline: none; overflow: hidden; }
.layer-list li { gap: 6px; }
.layer-list .check { display: flex; align-items: center; gap: 8px; }
.layer-list .input-sm { max-width: 220px; }
.slide-count { min-width: 74px; text-align: center; font-variant-numeric: tabular-nums; }
.lesson-wait { text-align: center; color: #C5CCE0; }
.lesson-wait h2 { color: #fff; margin-bottom: 8px; }

/* ---------- конвертер ---------- */
.drop { display: block; border: 2px dashed #B9C4D9; border-radius: 12px; padding: 44px 20px; text-align: center; background: #fff; cursor: pointer; transition: border-color .15s, background .15s; }
.drop:hover, .drop.over { border-color: var(--blue); background: var(--blue-tint); }
.drop svg { width: 40px; height: 40px; color: var(--blue); display: block; margin: 0 auto 8px; }
.drop h3 { font-family: var(--font); font-weight: 600; font-size: 17px; margin-bottom: 4px; }
.thumbs { display: flex; gap: 10px; overflow-x: auto; padding: 6px 0 10px; }
.thumbs canvas { height: 120px; width: auto; border: 1px solid var(--line); border-radius: 4px; background: #fff; flex: none; }
.progress { height: 10px; border-radius: 6px; background: var(--grid); overflow: hidden; }
.progress > i { display: block; height: 100%; width: 0; background: var(--blue); transition: width .2s; }
.convert-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.ppt-mode { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 14px; }
.ppt-mode .muted { flex-basis: 100%; }
.convert-choice button { text-align: left; padding: 18px; border: 1px solid var(--line); border-radius: 10px; background: var(--sheet); cursor: pointer; display: flex; gap: 14px; align-items: flex-start; }
.convert-choice button:hover { border-color: var(--blue); background: var(--sheet-2); }
.convert-choice .fi { width: 44px; height: 52px; border-radius: 6px; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 13px; flex: none; }
.fi.pptx { background: #C43E1C; }
.fi.docx { background: #2B579A; }
.convert-choice b { display: block; font-size: 16px; margin-bottom: 3px; }
.convert-choice span { font-size: 13.5px; color: var(--muted); }

/* ---------- адаптив ---------- */
@media (max-width: 1100px) {
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-main { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 45; left: 0; top: 0; bottom: 0; width: 260px; transform: translateX(-100%); transition: transform .2s; box-shadow: 0 0 40px rgba(0,0,0,.2); }
  .side.open { transform: none; }
  .topbar { display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 30; padding: 10px 16px; background: var(--sheet); border-bottom: 1px solid var(--line); }
  .topbar .brand-name { font-size: 15px; }
  .main { padding: 20px 16px 50px 34px; }
  .main::before { left: 16px; }
  .main::after { left: 20px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  h1 { font-size: 25px; }
  .hello h1 { font-size: 27px; }
  .login-wrap { grid-template-columns: 1fr; }
  .login-left { padding: 36px 20px 30px 56px; }
  .login-left::before { left: 28px; }
  .login-left::after { left: 32px; }
  .login-title { font-size: 32px; }
  .convert-choice { grid-template-columns: 1fr; }
  .search { min-width: 0; width: 100%; }
  .row { flex-direction: column; gap: 0; }
  .blitz-q { font-size: 26px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* журнал в карточке ученика */
.journal { table-layout: fixed; min-width: 1000px; }
.journal col.c-topic { width: 24%; }
.journal col.c-access { width: 210px; }
.journal col.c-status { width: 165px; }
.journal col.c-grade { width: 150px; }
.journal col.c-test { width: 84px; }
.journal .select-sm { width: 100%; }
.pen-input { font-family: var(--hand); font-size: 19px; color: var(--red); font-weight: 600; }
.pen-input::placeholder { font-family: var(--font); font-size: 13px; font-weight: 400; color: #A3ABBE; }
.grade-input { width: 56px; text-align: center; padding: 1px 4px; font-size: 22px; }
