/* ===== Тема «Яркие плитки» =====
   Светлый тёплый фон с цветными пятнами, белое «стеклянное» меню, у каждого раздела свой цвет:
   ДЗ — коралловый, темы — фиолетовый, ЕГЭ — синий, работы — зелёный, игры — жёлтый, рейтинг — розовый.
   Цвет раздела задаётся атрибутом data-sec (на <main>, пунктах меню и плитках) и доступен как --c1 / --c2 / --ct / --ci / --on.
   Подключается после style.css. Мобильная версия — внизу файла. */

:root {
  --paper: #FFF8EF;
  --sheet: #FFFFFF;
  --ink: #1E1B3A;
  --ink-soft: #46425F;
  --muted: #6E6A86;
  --line: #EFE7DB;
  --grid: #F3EDE4;
  --margin: transparent;
  --red: #E5364F;
  --red-tint: #FFE9EC;
  --green: #12A06D;
  --green-tint: #E2F7EE;
  --amber: #C47A06;
  --amber-tint: #FFF3DA;
  --violet: #7B5CFF;
  --violet-tint: #F1ECFF;
  --teal: #0FA39C;
  --teal-tint: #DDF7F4;
  --sun: #FFC53D;
  --sheet-2: #FFFCF7;
  --note: #FFF6F7;
  --line-strong: #E6DED1;
  --track: #F1EBE2;
  --glass: rgba(255, 255, 255, .72);
  --glass-strong: rgba(255, 255, 255, .92);
  --topbar: rgba(255, 248, 239, .85);
  color-scheme: light;
  --radius-s: 14px;
  --radius-m: 24px;
  --shadow: 0 1px 2px rgba(30, 27, 58, .04), 0 8px 24px rgba(30, 27, 58, .06);
  --shadow-hover: 0 2px 6px rgba(30, 27, 58, .06), 0 18px 40px rgba(30, 27, 58, .12);
  /* цвет по умолчанию — индиго */
  --c1: #5B4CF0; --c2: #8B5CF6; --ct: #EEEBFF; --ci: #3A2DB8; --on: #fff;
  --blue: var(--c1); --blue-dark: var(--ci); --blue-tint: var(--ct);
}

/* ---------- цвета разделов ---------- */
[data-sec="indigo"]                { --c1: #5B4CF0; --c2: #8B5CF6; --ct: #EEEBFF; --ci: #3A2DB8; --on: #fff; }
[data-sec="coral"], .c-red         { --c1: #FF5F45; --c2: #FF9A3C; --ct: #FFEDE6; --ci: #C2391B; --on: #fff; }
[data-sec="violet"], .c-violet     { --c1: #8B5CF6; --c2: #C46BF0; --ct: #F3ECFF; --ci: #6431C9; --on: #fff; }
[data-sec="blue"], .c-blue         { --c1: #2F7BFF; --c2: #22B5F0; --ct: #E7F0FF; --ci: #1C55C7; --on: #fff; }
[data-sec="green"], .c-green       { --c1: #10B07A; --c2: #4CD17A; --ct: #E2F7EE; --ci: #0B7A53; --on: #fff; }
[data-sec="yellow"], .c-amber      { --c1: #FFA41B; --c2: #FFD03A; --ct: #FFF3DA; --ci: #9A5800; --on: #3D2300; }
[data-sec="pink"]                  { --c1: #F43F8E; --c2: #FF7AB6; --ct: #FFE8F2; --ci: #B81C64; --on: #fff; }
[data-sec="teal"], .c-teal         { --c1: #0FB5AE; --c2: #3DD6C4; --ct: #DDF7F4; --ci: #087F7A; --on: #fff; }
[data-sec="gray"]                  { --c1: #5E6A85; --c2: #8A94AD; --ct: #EEF0F5; --ci: #3E4760; --on: #fff; }
.main[data-sec] { --blue: var(--c1); --blue-dark: var(--ci); --blue-tint: var(--ct); }

/* ---------- фон: светлый, с мягкими цветными пятнами ---------- */
body { background: var(--paper); color: var(--ink); }
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(42vw 42vw at 92% -8%, rgba(139, 92, 246, .16), transparent 70%),
    radial-gradient(38vw 38vw at 18% 108%, rgba(255, 154, 60, .16), transparent 70%),
    radial-gradient(30vw 30vw at 58% 46%, rgba(47, 123, 255, .07), transparent 70%);
}
::selection { background: #FFE08A; }
.main { background: none; padding: 34px 44px 70px; }
.main::before, .main::after { display: none; }
.page { max-width: 1160px; margin: 0 auto; animation: pagein .2s ease-out; }
@keyframes pagein { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- шрифты: заголовки и цифры — Golos Text, крупно и жирно ---------- */
h1, h2, h3, h4 { font-family: var(--font); font-weight: 700; letter-spacing: -.02em; color: var(--ink); }
h1 { font-size: 34px; line-height: 1.15; }
h2 { font-size: 20px; letter-spacing: -.01em; }
h3 { font-size: 17px; }
.stat .v, .ring b, .hero-next .when, .next-lesson .when, .num-btn b, .fipi-num, .ege-num, .crit-total b, .lb-row .place,
.jeo-cell, .timer, .brand-mark, .brand-name, .toc-item .num, .q-num, .big-answer, .login-title, .honor-year h2 {
  font-family: var(--font); font-weight: 800; letter-spacing: -.02em;
}
.toc-item .title { font-family: var(--font); font-weight: 500; font-size: 16.5px; }

/* ---------- меню слева: белое стекло, цветные иконки ---------- */
.shell { grid-template-columns: 264px 1fr; }
.side {
  background: var(--glass); backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border-right: 1px solid var(--line); padding: 22px 14px 14px; color: var(--ink);
}
.brand { padding: 0 6px 22px; }
.brand-mark { width: 40px; height: 40px; border-radius: 13px; font-size: 20px; color: #fff; transform: rotate(-6deg);
  background: linear-gradient(135deg, #FF5F45, #8B5CF6); box-shadow: 0 8px 18px rgba(139, 92, 246, .35); }
.brand-name { font-size: 16px; color: var(--ink); }
.brand-sub { color: var(--muted); }
.nav { gap: 4px; }
.nav a { padding: 7px 10px 7px 7px; border-radius: 16px; color: var(--ink-soft); font-weight: 600; gap: 12px; transition: background .15s, color .15s, transform .12s; }
.nav a svg { width: 34px; height: 34px; padding: 8px; border-radius: 11px; background: var(--ct); color: var(--c1); transition: background .15s, color .15s; }
.nav a:hover { background: rgba(30, 27, 58, .04); color: var(--ink); }
.nav a:active { transform: scale(.98); }
.nav a.active { background: linear-gradient(135deg, var(--c1), var(--c2)); color: var(--on); box-shadow: 0 8px 20px -6px var(--c1); }
.nav a.active svg { background: rgba(255, 255, 255, .25); color: var(--on); }
.nav a.active::before { display: none; }
.nav .count { min-width: 24px; height: 22px; line-height: 22px; border-radius: 11px; font-weight: 700; background: var(--red); box-shadow: 0 0 0 2px #fff; }
.nav a.active .count { background: #fff; color: var(--c1); box-shadow: none; }
.side-foot { border-top: 1px solid var(--line); }
.side .me-name { color: var(--ink); }
.side .me-role { color: var(--muted); }
.avatar { background: linear-gradient(135deg, #FFC53D, #FF9A3C); color: #3D2300; font-weight: 700; }
.side-foot .btn-ghost { color: var(--muted); }
.side-foot .btn-ghost:hover { background: rgba(30, 27, 58, .05); color: var(--ink); }

/* ---------- заголовок страницы ---------- */
.page-head { margin-bottom: 26px; align-items: center; }
.page-head h1 { display: flex; align-items: center; gap: 12px; }
.page-head h1::before { content: ""; width: 12px; height: 34px; border-radius: 6px; background: linear-gradient(180deg, var(--c1), var(--c2)); flex: none; }
.page-head p { font-size: 15.5px; max-width: 70ch; }
.back { font-weight: 600; color: var(--muted); padding: 6px 12px 6px 8px; margin-left: -8px; border-radius: 12px; }
.back:hover { background: rgba(30, 27, 58, .05); }
.hl { background: linear-gradient(transparent 58%, rgba(255, 197, 61, .6) 58%); padding: 0 2px; border-radius: 2px; }

/* ---------- карточки ---------- */
.sheet { border: 1px solid var(--line); border-radius: var(--radius-m); box-shadow: var(--shadow); }
.sheet-pad { padding: 22px 24px; }
.sheet-head { padding: 18px 24px; border-bottom: 1px solid var(--grid); }
.sheet-head h2 { font-size: 18px; }
.sheet-head a.small { font-weight: 600; text-decoration: none; }
.grid { gap: 20px; }
.sheet + .sheet, .sheet + .grid, .grid + .sheet, .grid + .grid { margin-top: 20px; }
.modal { border-radius: 26px; }
.modal h2 { font-size: 22px; }

/* ---------- кнопки ---------- */
.btn { border-radius: var(--radius-s); border: 1px solid var(--line-strong); background: var(--sheet); font-weight: 600; padding: 10px 17px; min-height: 42px;
  transition: background .15s, border-color .15s, transform .12s, box-shadow .15s; }
.btn:hover { background: var(--sheet-2); border-color: var(--line-strong); }
.btn:active { transform: translateY(1px) scale(.99); }
.btn-primary { background: linear-gradient(135deg, var(--c1), var(--c2)); border: 0; color: var(--on); box-shadow: 0 8px 18px -8px var(--c1); }
.btn-primary:hover { background: linear-gradient(135deg, var(--c1), var(--c1)); box-shadow: 0 10px 22px -8px var(--c1); }
.btn-red { background: linear-gradient(135deg, #E5364F, #FF5F6D); border: 0; box-shadow: 0 8px 18px -8px #E5364F; }
.btn-red:hover { background: #D42A42; }
.btn-green { background: linear-gradient(135deg, #10B07A, #4CD17A); border: 0; box-shadow: 0 8px 18px -8px #10B07A; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--ink-soft); }
.btn-ghost:hover { background: var(--ct); border-color: transparent; color: var(--ci); }
.btn-sm { min-height: 34px; padding: 6px 12px; border-radius: 11px; font-size: 13.5px; }
.btn-lg { min-height: 52px; padding: 14px 24px; font-size: 16px; border-radius: 16px; }
.icon-btn { min-height: 0; }

/* ---------- поля ---------- */
.input, .select, .textarea { border: 1.5px solid var(--line-strong); border-radius: 13px; background: var(--sheet); padding: 10px 13px; }
.input:hover, .select:hover, .textarea:hover { border-color: #DED3C3; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--c1); box-shadow: 0 0 0 4px var(--ct); }
.input-sm, .select-sm { padding: 5px 9px; border-radius: 10px; }
.field > span { font-weight: 600; color: var(--ink-soft); }
.check input { accent-color: var(--c1); }

/* ---------- вкладки-пилюли ---------- */
.tabs { display: flex; width: fit-content; max-width: 100%; gap: 4px; padding: 5px; margin-bottom: 20px; border: 1px solid var(--line);
  background: var(--glass); border-radius: 18px; box-shadow: var(--shadow); }
.tabs button, .tabs a.tab-link { border: 0; margin: 0; padding: 9px 16px; border-radius: 13px; color: var(--ink-soft); font-weight: 600; transition: background .15s, color .15s; }
.tabs button:hover, .tabs a.tab-link:hover { background: var(--ct); color: var(--ci); }
.tabs button.on, .tabs a.tab-link.on { background: linear-gradient(135deg, var(--c1), var(--c2)); color: var(--on); border: 0; box-shadow: 0 6px 14px -6px var(--c1); }
.tabs button.on .muted, .tabs a.tab-link.on .muted { color: inherit; opacity: .8; }
.pill-tabs { border-radius: 16px; border-color: var(--line); padding: 5px; }
.pill-tabs button { border-radius: 12px; font-weight: 600; }
.pill-tabs button.on { background: linear-gradient(135deg, var(--c1), var(--c2)); color: var(--on); box-shadow: 0 6px 14px -6px var(--c1); }

/* ---------- метки, таблицы, полосы ---------- */
.tag { border-radius: 20px; padding: 3px 11px; font-weight: 600; }
.tag-blue { background: var(--ct); color: var(--ci); }
.table th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; font-weight: 700; color: #9A95AE; border-bottom: 1px solid var(--grid); padding: 12px 14px; }
.table td { padding: 13px 14px; border-bottom-color: var(--grid); }
.table tbody tr.clickable:hover td { background: var(--ct); }
.table tbody tr.clickable td:first-child { border-radius: 14px 0 0 14px; }
.table tbody tr.clickable td:last-child { border-radius: 0 14px 14px 0; }
.bar, .progress { height: 10px; border-radius: 6px; background: var(--track); }
.bar > i, .progress > i { background: linear-gradient(90deg, var(--c1), var(--c2)); border-radius: 6px; }
.bar.green > i { background: linear-gradient(90deg, #10B07A, #4CD17A); }
.list-plain > li { border-bottom-color: var(--grid); }
.divider { background: var(--grid); }
.status-banner { border-radius: 18px; }

/* ---------- пустые состояния ---------- */
.empty { padding: 34px 14px; }
.empty svg { width: 64px; height: 64px; padding: 17px; border-radius: 50%; background: var(--ct); color: var(--c1); margin-bottom: 12px; }

/* ---------- приветствие-обложка ---------- */
.hero { position: relative; overflow: hidden; border-radius: 30px; padding: 30px 32px; margin-bottom: 22px; color: #fff;
  background:
    radial-gradient(70% 120% at 100% 0%, rgba(255, 122, 182, .55) 0%, transparent 60%),
    radial-gradient(60% 90% at 0% 100%, rgba(34, 181, 240, .35) 0%, transparent 60%),
    linear-gradient(135deg, #4B3BE0 0%, #7B5CFF 55%, #A55CF6 100%);
  box-shadow: 0 22px 44px -18px rgba(91, 76, 240, .55); }
.hero::before, .hero::after { content: ""; position: absolute; border-radius: 50%; pointer-events: none; }
.hero::before { width: 260px; height: 260px; right: -70px; bottom: -150px; background: rgba(255, 197, 61, .35); }
.hero::after { width: 130px; height: 130px; right: 150px; top: -80px; background: rgba(255, 255, 255, .12); }
.hero h1 { color: #fff; font-size: 38px; }
.hero h1 .wave { display: inline-block; color: #FFD34D; font-size: .9em; margin-left: 6px; transform: rotate(-8deg); font-family: var(--font); }
.hero .date { color: rgba(255, 255, 255, .8); margin-top: 6px; font-weight: 500; }
.hero-row { position: relative; z-index: 1; display: flex; align-items: center; gap: 22px; flex-wrap: wrap; justify-content: space-between; }
.hero-next { margin-top: 20px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; position: relative; z-index: 1;
  padding: 14px 16px; border-radius: 20px; background: rgba(255, 255, 255, .14); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.hero-next .when { font-size: 22px; }
.hero-next .lbl { font-size: 13px; color: rgba(255, 255, 255, .78); font-weight: 500; }
.hero .btn { background: #fff; color: #3A2DB8; border: 0; box-shadow: 0 10px 20px -10px rgba(0, 0, 0, .35); }
.hero .btn:hover { background: #F6F3FF; }
.hero .btn-sun { background: linear-gradient(135deg, #FFC53D, #FFE07A); color: #3D2300; }
.hero-stats { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.hero-stats span { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 20px; background: rgba(255, 255, 255, .18); font-size: 13.5px; font-weight: 600; }
.hero-stats svg { width: 16px; height: 16px; }
/* кольцо уровня */
.ring { --p: 0; width: 100px; height: 100px; border-radius: 50%; flex: none; display: grid; place-items: center; position: relative;
  background: conic-gradient(#FFD34D calc(var(--p) * 1%), rgba(255, 255, 255, .22) 0); }
.ring::before { content: ""; position: absolute; inset: 9px; border-radius: 50%; background: #6A4EF5; }
.ring > div { position: relative; text-align: center; line-height: 1.1; }
.ring b { display: block; font-size: 26px; }
.ring span { font-size: 11px; color: rgba(255, 255, 255, .8); }

/* ---------- блок «Что сделать сегодня» ---------- */
.block-title { display: flex; align-items: baseline; gap: 10px; margin: 6px 0 12px; }
.block-title h2 { font-size: 22px; }
.block-title .muted { font-size: 14px; }
.todo { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; margin-bottom: 26px; }
.todo-card { position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 6px; min-height: 164px; padding: 18px 18px 16px;
  border-radius: 24px; text-decoration: none; color: var(--on); background: linear-gradient(135deg, var(--c1), var(--c2));
  box-shadow: 0 16px 30px -16px var(--c1); transition: transform .15s, box-shadow .15s; }
.todo-card::after { content: ""; position: absolute; width: 150px; height: 150px; right: -50px; bottom: -70px; border-radius: 50%; background: rgba(255, 255, 255, .16); }
.todo-card:hover { transform: translateY(-3px); box-shadow: 0 22px 36px -16px var(--c1); }
.todo-card .ti { width: 46px; height: 46px; border-radius: 15px; display: grid; place-items: center; background: rgba(255, 255, 255, .24); margin-bottom: 6px; }
.todo-card .ti svg { width: 24px; height: 24px; }
.todo-card .kicker { font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; opacity: .85; }
.todo-card b { font-size: 18px; line-height: 1.25; letter-spacing: -.01em; }
.todo-card .go { margin-top: auto; display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 14px; position: relative; z-index: 1; }
.todo-card .go svg { width: 16px; height: 16px; }
.todo-card .num { position: absolute; top: 14px; right: 16px; font-size: 42px; font-weight: 800; line-height: 1; opacity: .9; letter-spacing: -.04em; }
.todo-done { display: flex; align-items: center; gap: 14px; padding: 18px 20px; border-radius: 22px; background: var(--sheet); border: 1px dashed var(--line-strong); margin-bottom: 26px; color: var(--ink-soft); }
.todo-done svg { width: 44px; height: 44px; padding: 10px; border-radius: 14px; background: var(--green-tint); color: var(--green); flex: none; }

/* быстрые плитки разделов */
.quick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
.quick a { display: flex; flex-direction: column; gap: 6px; padding: 18px; border-radius: 22px; text-decoration: none; color: var(--ink); background: var(--sheet);
  border: 1px solid var(--line); box-shadow: var(--shadow); position: relative; overflow: hidden; transition: transform .15s, box-shadow .15s; }
.quick a::after { content: ""; position: absolute; width: 110px; height: 110px; right: -40px; top: -40px; border-radius: 50%; background: var(--ct); }
.quick a:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.quick .qi { width: 48px; height: 48px; border-radius: 16px; display: grid; place-items: center; position: relative; z-index: 1;
  background: linear-gradient(135deg, var(--c1), var(--c2)); color: var(--on); box-shadow: 0 8px 16px -8px var(--c1); margin-bottom: 4px; }
.quick .qi svg { width: 24px; height: 24px; }
.quick b { font-size: 16px; position: relative; z-index: 1; }
.quick span { font-size: 13px; color: var(--muted); position: relative; z-index: 1; }
.quick .badge { position: absolute; top: 14px; right: 14px; z-index: 2; min-width: 28px; height: 28px; padding: 0 8px; border-radius: 14px; background: var(--red); color: #fff;
  font-size: 13px; font-weight: 800; display: grid; place-items: center; box-shadow: 0 4px 10px -4px var(--red); }

/* ---------- плитки игр ---------- */
.game-tile { border-radius: 22px; border-color: var(--line); box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s; }
a.game-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); border-color: transparent; }
.game-tile .ico { width: 50px; height: 50px; border-radius: 16px; color: #fff; background: linear-gradient(135deg, var(--c1), var(--c2)); box-shadow: 0 8px 16px -8px var(--c1); }
.grid > .game-tile:nth-child(6n + 1) { --c1: #2F7BFF; --c2: #22B5F0; }
.grid > .game-tile:nth-child(6n + 2) { --c1: #FF5F45; --c2: #FF9A3C; }
.grid > .game-tile:nth-child(6n + 3) { --c1: #10B07A; --c2: #4CD17A; }
.grid > .game-tile:nth-child(6n + 4) { --c1: #8B5CF6; --c2: #C46BF0; }
.grid > .game-tile:nth-child(6n + 5) { --c1: #FFA41B; --c2: #FFD03A; }
.grid > .game-tile:nth-child(6n + 6) { --c1: #F43F8E; --c2: #FF7AB6; }
.grid > .game-tile .ico { background: linear-gradient(135deg, var(--c1), var(--c2)); color: #fff; }
.game-tile.ege .ico { background: linear-gradient(135deg, #2F7BFF, #22B5F0); color: #fff; }

/* ---------- ЕГЭ и банк: номера-кнопки ---------- */
.num-btn { border-radius: 14px; border: 1.5px solid #EDE5D9; padding: 9px 2px; transition: transform .12s, border-color .15s, box-shadow .15s; }
.num-btn:not(:disabled):hover { border-color: var(--c1); transform: translateY(-2px); box-shadow: 0 8px 16px -10px var(--c1); }
.num-btn.on { background: linear-gradient(135deg, var(--c1), var(--c2)); border-color: transparent; color: var(--on); box-shadow: 0 8px 16px -8px var(--c1); }
.num-pick span { width: 44px; height: 40px; border-radius: 12px; border: 1.5px solid #EDE5D9; }
.num-pick input:checked + span { background: linear-gradient(135deg, var(--c1), var(--c2)); border-color: transparent; color: var(--on); }
.fipi-num { border-radius: 10px; background: var(--ct); color: var(--ci); }
/* таблицы заданий ФИПИ: слова целиком (с переносом по слогам), номера «1)» «А)» не разрываются */
.fipi-q, .fipi-o { overflow-wrap: break-word; }
.fipi-q td, .fipi-o td { overflow-wrap: normal; word-break: normal; -webkit-hyphens: auto; hyphens: auto; }
.fipi-q td.fipi-lbl, .fipi-o td.fipi-lbl { white-space: nowrap; width: 1%; padding-right: 8px; font-weight: 700; -webkit-hyphens: none; hyphens: none; }
.fipi-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 10px 0; }
.fipi-col { min-width: 0; padding: 12px 14px; border-radius: 16px; background: var(--sheet-2); border: 1px solid var(--line); }
.fipi-col-h { font-size: 12.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--ci); margin-bottom: 6px; }
.fipi-col-h u { text-decoration: none; }
.fipi-col table { width: 100%; }
.fipi-col p { margin: 0 0 4px; }
/* внешняя таблица-обёртка с пустой ячейкой-отступом слева не должна отъедать ширину */
.fipi-q table[align="center"] { width: 100%; }
.fipi-text-box { border-radius: 16px; border-color: var(--line); background: var(--sheet-2); }
.fipi-q-wrap { border-bottom-color: var(--grid); }
.res-chip { border-radius: 11px; }
.essay-note { border-radius: 16px; }

/* ---------- красная ручка учителя ---------- */
.note-pen { border-left: 0; position: relative; padding: 12px 16px 12px 22px; margin: 10px 0; background: var(--note); border-radius: 16px; }
.note-pen::before { content: ""; position: absolute; left: 9px; top: 12px; bottom: 12px; width: 4px; border-radius: 2px; background: var(--red); }

/* ---------- урок: баннер ---------- */
.live-banner { border-radius: 22px; padding: 16px 20px; background: linear-gradient(135deg, #1E1B3A, #3A2DB8); box-shadow: 0 16px 30px -16px rgba(58, 45, 184, .7); }

/* ---------- вход ---------- */
.login-left { background: transparent; }
.login-left::before, .login-left::after { display: none; }
.login-title { font-size: 46px; }
.login-title .hl { background: linear-gradient(transparent 60%, rgba(255, 197, 61, .7) 60%); }
.login-right { background: linear-gradient(135deg, #4B3BE0 0%, #7B5CFF 55%, #A55CF6 100%); }
.login-card { background: var(--sheet); padding: 30px 28px; border-radius: 28px; box-shadow: 0 30px 60px -20px rgba(30, 27, 58, .45); }
.demo-box { background: var(--paper); border-color: var(--line); border-radius: 16px; }

/* окна и уведомления — поверх нижнего меню и выдвижного меню */
.overlay { z-index: 80; background: rgba(30, 27, 58, .45); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.toasts { z-index: 90; }
.lesson-shell { z-index: 75; }

/* нижнее меню и шапка телефона по умолчанию скрыты */
.tabbar, .side-backdrop { display: none; }
.topbar .avatar { margin-left: auto; }

@media (max-width: 1100px) {
  .main { padding: 28px 26px 60px; }
  .quick { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* =====================================================================
   Телефон и планшет
   ===================================================================== */
@media (max-width: 860px) {
  body { font-size: 15.5px; }
  .shell { grid-template-columns: 1fr; }
  /* шапка */
  .topbar { padding: 10px 14px; padding-top: max(10px, env(safe-area-inset-top)); background: var(--topbar); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); gap: 10px; }
  .topbar .brand-mark { width: 32px; height: 32px; font-size: 17px; border-radius: 10px; }
  .topbar .top-title { font-weight: 700; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .topbar .avatar { width: 34px; height: 34px; border: 0; cursor: pointer; }
  .topbar [data-menu] { display: none; }
  /* меню «Ещё» — выезжает слева, под ним затемнение */
  .side { width: 284px; border-radius: 0 26px 26px 0; z-index: 70; box-shadow: none; visibility: hidden; background: var(--sheet); transition: transform .22s ease, visibility .22s; }
  .side.open { box-shadow: 0 0 40px rgba(0, 0, 0, .25); visibility: visible; }
  .toc-item { flex-wrap: wrap; row-gap: 2px; }
  .toc-item .dots { display: none; }
  .toc-item .title { flex: 1 1 0; min-width: 0; font-size: 16px; }
  .toc-item .state { flex-basis: 100%; padding-left: 32px; white-space: normal; flex-wrap: wrap; }
  .side-backdrop { display: block; position: fixed; inset: 0; z-index: 65; background: rgba(30, 27, 58, .45); opacity: 0; pointer-events: none; transition: opacity .2s; }
  .side.open + .side-backdrop, .side-backdrop.on { opacity: 1; pointer-events: auto; }
  /* нижнее меню */
  .tabbar { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; left: 10px; right: 10px; bottom: max(10px, env(safe-area-inset-bottom)); z-index: 60;
    padding: 6px; background: var(--glass-strong); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--line); border-radius: 24px; box-shadow: 0 14px 34px -10px rgba(30, 27, 58, .28); }
  .tabbar a, .tabbar button { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 2px 6px; border: 0; background: none; color: var(--muted);
    text-decoration: none; font-size: 11px; font-weight: 700; border-radius: 18px; cursor: pointer; -webkit-tap-highlight-color: transparent; transition: background .15s, color .15s; }
  .tabbar svg { width: 23px; height: 23px; }
  .tabbar .on { color: var(--on); background: linear-gradient(135deg, var(--c1), var(--c2)); box-shadow: 0 8px 16px -8px var(--c1); }
  .tabbar .on svg { background: none; padding: 0; width: 23px; height: 23px; margin: 0; }
  .tabbar .count { position: absolute; top: 2px; left: 50%; margin-left: 8px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--red); color: #fff; font-size: 11px; display: grid; place-items: center; box-shadow: 0 0 0 2px #fff; }
  .tabbar .dot { position: absolute; top: 4px; left: 50%; margin-left: 10px; width: 8px; height: 8px; border-radius: 50%; background: var(--red); }
  /* рабочая область с отступом под нижнее меню */
  .main { padding: 16px 14px calc(104px + env(safe-area-inset-bottom)); }
  .page-head { margin-bottom: 16px; }
  .page-head h1::before { width: 9px; height: 26px; }
  .page-head .actions { width: 100%; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
  .page-head .actions .btn { white-space: normal; text-align: center; line-height: 1.25; padding: 10px 10px; font-size: 14px; }
  .page-head .actions .btn-primary { grid-column: 1 / -1; font-size: 15px; }
  .page-head .actions > .tag, .page-head .actions > .score-big, .page-head .actions > span { justify-self: start; }
  h1 { font-size: 26px; }
  h2 { font-size: 19px; }
  .sheet { border-radius: 22px; }
  .sheet-pad { padding: 16px; }
  .sheet-head { padding: 14px 16px; flex-wrap: wrap; }
  .grid { gap: 14px; }
  .sheet + .sheet, .sheet + .grid, .grid + .sheet, .grid + .grid { margin-top: 14px; }
  /* крупнее для пальца; 16px — чтобы iPhone не увеличивал страницу при вводе */
  .input, .select, .textarea { font-size: 16px; padding: 11px 12px; }
  .btn { padding: 11px 16px; min-height: 46px; }
  .btn-sm { padding: 8px 12px; font-size: 14px; min-height: 38px; }
  .toolbar { gap: 8px; }
  .toolbar .input, .toolbar .select { width: auto; flex: 1 1 140px; min-width: 0; }
  .toolbar .search { flex-basis: 100%; }
  .tabs { width: auto; overflow-x: auto; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .table th, .table td { padding: 10px 10px; }
  .table-wrap { -webkit-overflow-scrolling: touch; }
  .list-plain > li { flex-wrap: wrap; }
  .list-plain > li > .btn:last-child, .list-plain > li > a.btn:last-child { margin-left: auto; }
  /* приветствие */
  .hero { padding: 22px 18px; border-radius: 26px; }
  .hero h1 { font-size: 27px; }
  .hero-row { flex-wrap: nowrap; gap: 12px; align-items: flex-start; }
  .ring { width: 74px; height: 74px; }
  .ring::before { inset: 8px; }
  .ring span { font-size: 10px; }
  .ring b { font-size: 20px; }
  .status-banner { padding: 12px 14px; gap: 10px; align-items: center; }
  .status-banner .grow { flex: 1 1 180px; font-size: 14.5px; }
  .status-banner .btn { margin-left: auto; }
  .hero-next { margin-top: 14px; padding: 12px; }
  .hero-next .when { font-size: 19px; }
  .hero-next .btn { width: 100%; }
  .todo { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
  .todo-card { min-height: 150px; padding: 15px; border-radius: 22px; }
  .todo-card b { font-size: 16px; }
  .todo-card .num { font-size: 34px; }
  .quick { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
  .quick a { padding: 15px; border-radius: 20px; }
  /* окна — снизу, как в приложениях */
  .overlay { align-items: end; padding: 0; }
  .modal, .modal.wide { max-width: none; border-radius: 26px 26px 0 0; max-height: 92vh; padding-bottom: env(safe-area-inset-bottom); animation: sheetup .22s ease-out; }
  .modal-foot { position: sticky; bottom: 0; background: var(--sheet); padding-top: 12px; border-top: 1px solid var(--line); flex-wrap: nowrap; }
  .modal-foot .btn { flex: 1 1 0; white-space: normal; line-height: 1.2; }
  .toasts { left: 12px; right: 12px; bottom: calc(96px + env(safe-area-inset-bottom)); align-items: center; }
  /* вход */
  .login-left { padding: 32px 22px 26px; }
  .login-right { padding: 22px 14px 34px; }
  .login-card { padding: 22px 18px; }
  .login-title { font-size: 34px; }
}
/* таблицы на телефоне — карточками: первая ячейка заголовком, остальные с подписями */
@media (max-width: 640px) {
  .table-wrap { overflow: visible; }
  .table thead { display: none; }
  .table, .table tbody { display: block; width: 100%; }
  .table tr { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 13px 16px; border-bottom: 1px solid var(--grid); }
  .table tr:last-child { border-bottom: 0; }
  .table td { display: block; padding: 0 !important; border: 0 !important; background: none !important; text-align: left !important; border-radius: 0 !important; }
  .table td:first-child { flex: 1 1 100%; font-size: 15.5px; }
  .table td[data-label]:not(:first-child)::before { content: attr(data-label); display: block; font-size: 11.5px; color: var(--muted); font-weight: 600; margin-bottom: 1px; }
  .table td:empty, .table td[data-label=""]::before { display: none; }
  .table td:last-child:has(> .btn, > a.btn, > button) { margin-left: auto; }
  .table tbody tr.clickable:active { background: var(--ct); }
  /* журнал: поля ввода на всю ширину карточки */
  .journal { min-width: 0 !important; table-layout: auto; }
  .journal colgroup { display: none; }
  .journal td { flex: 1 1 140px; }
  .journal td:nth-child(5) { flex-basis: 100%; }
  .journal .select-sm, .journal .input-sm { width: 100%; }
  .journal td:nth-child(4) { white-space: nowrap; }
  .journal td:nth-child(4) .select-sm { width: auto; }
  .journal .grade-input { width: 64px !important; }
  /* три плитки статистики — в ряд */
  .grid-3:has(> .sheet .stat) { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .grid-3:has(> .sheet .stat) > .sheet { padding: 12px 10px; }
  .grid-3:has(> .sheet .stat) .stat .v { font-size: 19px; }
  .grid-3:has(> .sheet .stat) .stat .l { font-size: 11.5px; line-height: 1.3; }
  .grid-3:has(> .sheet .stat) .bar { margin-top: 6px !important; }
  .grid-3:has(> .sheet .stat) .muted.small { font-size: 11px; }
}
@media (max-width: 640px) {
  .fipi-cols { grid-template-columns: 1fr; }
  .fipi-q td, .fipi-o td { padding-left: 2px; padding-right: 2px; }
}
@media (max-width: 380px) {
  .tabbar a, .tabbar button { font-size: 10px; }
  .quick b { font-size: 14px; }
  .todo { grid-template-columns: 1fr; }
}
@keyframes sheetup { from { transform: translateY(40px); opacity: .6; } to { transform: none; opacity: 1; } }

/* =====================================================================
   Экран урока: тёмная сцена, плавающая капсула инструментов
   ===================================================================== */
.lesson-shell { background: radial-gradient(80% 60% at 50% 0%, #2B2660 0%, #17142F 70%); color: #E9E7F7; }
.lesson-top { gap: 12px; padding: 12px 18px; background: rgba(20, 17, 42, .7); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid rgba(255, 255, 255, .07); }
.lesson-top { flex-wrap: nowrap; }
.lesson-top > * { flex: none; }
.lesson-top .grow { flex: 1 1 0; }
.lesson-top .title { font-weight: 700; font-size: 16px; flex: 0 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lesson-top .btn { white-space: nowrap; }
@media (max-width: 1180px) { .lesson-top .btn[data-act="studwin"], .lesson-top .btn[data-act="material"] { font-size: 0; gap: 0; padding: 8px 10px; } .lesson-top .btn[data-act] svg { margin: 0; } }
.lesson-top .btn { min-height: 38px; background: rgba(255, 255, 255, .08); color: #E9E7F7; border: 1px solid rgba(255, 255, 255, .12); }
.lesson-top .btn:hover { background: rgba(255, 255, 255, .16); }
.lesson-top .btn-red { background: linear-gradient(135deg, #E5364F, #FF5F6D); border: 0; color: #fff; box-shadow: 0 8px 18px -8px #E5364F; }
.rec { padding: 5px 11px; border-radius: 20px; background: rgba(229, 54, 79, .18); color: #FFB4BF; font-weight: 700; }
.who-pill { display: inline-flex; align-items: center; gap: 7px; padding: 5px 12px; border-radius: 20px; background: rgba(255, 255, 255, .08); color: #C9C5E6; font-size: 13px; font-weight: 600; }
.who-pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #FFA41B; }
.who-pill.joined::before { background: #4CD17A; box-shadow: 0 0 0 4px rgba(76, 209, 122, .2); }
.switch.dark { align-items: center; gap: 10px; color: #E9E7F7; font-size: 13.5px; font-weight: 600; }
.switch.dark .sw { background: rgba(255, 255, 255, .18); margin: 0; width: 44px; height: 26px; }
.switch.dark .sw::after { width: 20px; height: 20px; }
.switch.dark input:checked + .sw { background: linear-gradient(135deg, #10B07A, #4CD17A); }
.switch.dark input:checked + .sw::after { transform: translateX(18px); }
.lesson-stage { padding: 16px 16px 96px; }
.lesson-board { border-radius: 10px; box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .6); }
.lesson-board canvas { border-radius: 10px; }
.lesson-tools { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 4; max-width: calc(100% - 24px);
  display: flex; align-items: center; gap: 4px; flex-wrap: nowrap; padding: 7px; border-radius: 22px;
  background: rgba(28, 24, 58, .86); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, .1); box-shadow: 0 18px 40px -12px rgba(0, 0, 0, .6); }
.tool { width: 42px; height: 42px; border-radius: 14px; border: 0; background: transparent; color: #DAD6F2; transition: background .12s, color .12s, transform .1s; }
.tool:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.tool:active { transform: scale(.94); }
.tool.on { background: linear-gradient(135deg, #7B5CFF, #A55CF6); color: #fff; box-shadow: 0 6px 14px -6px #7B5CFF; }
.tool-sep { width: 1px; height: 26px; background: rgba(255, 255, 255, .14); margin: 0 4px; }
.slide-count { min-width: 64px; font-weight: 700; color: #fff; font-size: 14px; white-space: nowrap; padding: 0 4px; }
.pop-wrap { position: relative; display: inline-flex; }
.brush-btn .cur-dot { --d: 12px; display: block; width: var(--d); height: var(--d); max-width: 26px; max-height: 26px; border-radius: 50%; background: #D7263D; box-shadow: 0 0 0 2px rgba(255, 255, 255, .85); }
.tool-pop { position: absolute; bottom: calc(100% + 14px); left: 50%; transform: translateX(-50%); z-index: 6; display: flex; flex-direction: column; gap: 8px;
  min-width: 220px; padding: 12px; border-radius: 18px; background: #26214F; border: 1px solid rgba(255, 255, 255, .12); box-shadow: 0 20px 40px -12px rgba(0, 0, 0, .65); }
.tool-pop[hidden] { display: none; }
.tool-pop.right { left: auto; right: -6px; transform: none; }
.pop-title { font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: #A9A3D6; }
.pop-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.pop-row .swatch { width: 30px; height: 30px; }
.swatch.on { border-color: #fff; box-shadow: 0 0 0 2px #26214F inset; }
.pop-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: 0; border-radius: 12px; background: transparent; color: #E9E7F7; font-weight: 600; cursor: pointer; text-align: left; white-space: nowrap; }
.pop-item svg { width: 18px; height: 18px; }
.pop-item:hover { background: rgba(255, 255, 255, .1); }
.pop-item.danger { color: #FF9AA8; }
.lesson-wait { padding: 30px; border-radius: 26px; background: rgba(255, 255, 255, .05); }
@media (max-width: 860px) {
  .lesson-top { padding: 8px 10px; gap: 8px; }
  .lesson-top .who-pill { display: none; }
  .lesson-stage { padding: 6px 6px 84px; }
  .lesson-tools { bottom: max(10px, env(safe-area-inset-bottom)); overflow-x: auto; scrollbar-width: none; justify-content: flex-start; }
  .lesson-tools::-webkit-scrollbar { display: none; }
  .lesson-tools > *, .tool-group > * { flex: none; }
  .tool { width: 40px; height: 40px; }
  /* в прокручиваемой капсуле всплывающие панели крепим к экрану */
  .tool-pop, .tool-pop.right { position: fixed; left: 12px; right: 12px; bottom: calc(80px + env(safe-area-inset-bottom)); transform: none; min-width: 0; }
}

/* =====================================================================
   Работы с фото: карточки и проверка
   ===================================================================== */
.work-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.work-card { display: flex; flex-direction: column; text-align: left; padding: 0; border-radius: 22px; overflow: hidden; background: var(--sheet); cursor: pointer;
  border: 1px solid var(--line); box-shadow: var(--shadow); color: var(--ink); transition: transform .15s, box-shadow .15s; }
.work-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.wc-thumb { position: relative; height: 150px; display: grid; place-items: center; background: linear-gradient(135deg, var(--ct), var(--sheet)); color: var(--c1); overflow: hidden; }
.wc-thumb > svg { width: 40px; height: 40px; opacity: .6; }
.wc-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.wc-count { position: absolute; right: 10px; bottom: 10px; padding: 2px 9px; border-radius: 10px; background: rgba(30, 27, 58, .7); color: #fff; font-size: 12px; font-weight: 600; }
.wc-body { display: flex; flex-direction: column; gap: 3px; padding: 14px 16px 16px; }
.wc-body b { font-size: 15.5px; line-height: 1.3; }
.wc-who { font-weight: 600; color: var(--ink-soft); font-size: 14px; }
.wc-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-top: 6px; }

.review-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 20px; align-items: start; }
.photo-pane { min-height: 60vh; }
.photo-pane .annot { border-radius: 16px; border: 1px solid var(--line); box-shadow: 0 8px 24px -14px rgba(30, 27, 58, .3); }
.ph-strip { display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 12px; }
.ph-thumb { position: relative; flex: none; width: 72px; height: 92px; padding: 0; border-radius: 12px; overflow: hidden; border: 2px solid transparent; background: var(--grid); cursor: pointer; }
.ph-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ph-thumb span { position: absolute; left: 5px; bottom: 5px; min-width: 20px; height: 20px; border-radius: 10px; background: rgba(30, 27, 58, .75); color: #fff; font-size: 11.5px; font-weight: 700; display: grid; place-items: center; }
.ph-thumb.on { border-color: var(--c1); box-shadow: 0 6px 14px -6px var(--c1); }
.ph-thumb.on span { background: var(--c1); }
.annot-tools { gap: 6px; padding: 8px; border-radius: 16px; background: var(--paper); border: 1px solid var(--line); }
.annot-tools .btn-sm { min-height: 36px; }
.annot-tools .swatch { width: 28px; height: 28px; }
.annot-tools .swatch.on { border-color: var(--ink); box-shadow: 0 0 0 3px #fff inset; }

.score-pane { position: sticky; top: 20px; max-height: calc(100vh - 40px); display: flex; flex-direction: column; overflow: hidden; }
.score-head { display: flex; align-items: center; gap: 16px; padding: 20px 22px 14px; border-bottom: 1px solid var(--grid); }
.score-head h2 { margin-bottom: 2px; }
.score-head p { margin: 0; line-height: 1.4; }
.score-ring { --p: 0; flex: none; width: 86px; height: 86px; border-radius: 50%; display: grid; place-items: center; position: relative;
  background: conic-gradient(var(--c1) calc(var(--p) * 1%), var(--track) 0); transition: background .2s; }
.score-ring::before { content: ""; position: absolute; inset: 8px; border-radius: 50%; background: var(--sheet); }
.score-ring > div { position: relative; text-align: center; line-height: 1; }
.score-ring b { display: block; font-size: 28px; font-weight: 800; color: var(--ci); }
.score-ring span { font-size: 12px; color: var(--muted); }
.score-body { padding: 8px 22px 6px; overflow-y: auto; flex: 1; min-height: 0; }
.crit-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--grid); }
.crit-row .ck { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.crit-row .ck b { font-size: 15px; }
.crit-row .ck span { font-size: 12px; color: var(--muted); }
.pts { display: flex; gap: 4px; flex: none; }
.pt { width: 34px; height: 34px; border-radius: 11px; border: 1.5px solid var(--line-strong); background: var(--sheet); font-weight: 800; color: var(--ink-soft); cursor: pointer; transition: transform .1s, background .12s; }
.pt:hover { border-color: var(--c1); }
.pt:active { transform: scale(.94); }
.pt.on { background: linear-gradient(135deg, var(--c1), var(--c2)); border-color: transparent; color: var(--on); box-shadow: 0 6px 12px -6px var(--c1); }
.grade-pick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; padding: 10px 0; }
.gp { height: 64px; border-radius: 18px; border: 2px solid var(--line-strong); background: var(--sheet); font-family: var(--hand); font-size: 38px; font-weight: 700; color: var(--red); cursor: pointer; }
.gp:hover { border-color: var(--red); }
.gp.on { background: var(--red); color: #fff; border-color: var(--red); box-shadow: 0 8px 16px -8px var(--red); }
.score-foot { display: flex; gap: 8px; padding: 14px 22px; border-top: 1px solid var(--grid); background: var(--sheet); }
.score-foot .btn-primary { flex: 1; }
.score-extra { display: flex; justify-content: space-between; gap: 6px; padding: 0 14px 12px; background: var(--sheet); flex-wrap: wrap; }
@media (max-width: 1100px) {
  .review-layout { grid-template-columns: 1fr; }
  .score-pane { position: static; max-height: none; overflow: visible; }
  .score-body { overflow: visible; }
}
@media (max-width: 860px) {
  .work-cards { grid-template-columns: 1fr 1fr; gap: 10px; }
  .wc-thumb { height: 110px; }
  .wc-body { padding: 10px 12px 12px; }
  .score-head { padding: 16px; }
  .score-body { padding: 4px 16px; }
  .score-foot { position: sticky; bottom: calc(86px + env(safe-area-inset-bottom)); padding: 12px 16px; }
  .pt { width: 38px; height: 38px; }
}
@media (max-width: 420px) { .work-cards { grid-template-columns: 1fr; } }

/* =====================================================================
   Банк заданий: стартовый экран и мастер «Задать ДЗ»
   ===================================================================== */
.hub { display: grid; grid-template-columns: 1.35fr 1fr 1fr; gap: 18px; }
.hub-card { position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 8px; min-height: 210px; padding: 22px; border-radius: 26px;
  text-decoration: none; color: var(--ink); background: var(--sheet); border: 1px solid var(--line); box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s; }
.hub-card::after { content: ""; position: absolute; width: 170px; height: 170px; right: -60px; top: -60px; border-radius: 50%; background: var(--ct); }
.hub-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.hub-card .ti { position: relative; z-index: 1; width: 52px; height: 52px; border-radius: 17px; display: grid; place-items: center; color: var(--on);
  background: linear-gradient(135deg, var(--c1), var(--c2)); box-shadow: 0 10px 18px -10px var(--c1); margin-bottom: 6px; }
.hub-card .ti svg { width: 26px; height: 26px; }
.hub-card b { font-size: 21px; letter-spacing: -.015em; position: relative; z-index: 1; }
.hub-card .desc { color: var(--muted); font-size: 14px; line-height: 1.45; position: relative; z-index: 1; }
.hub-card .go { margin-top: auto; display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--ci); position: relative; z-index: 1; }
.hub-card .go svg { width: 17px; height: 17px; }
.hub-card .num { position: absolute; z-index: 1; top: 18px; right: 20px; min-width: 34px; height: 34px; padding: 0 10px; border-radius: 17px; display: grid; place-items: center;
  background: var(--red); color: #fff; font-weight: 800; box-shadow: 0 6px 14px -6px var(--red); }
.hub-card .kicker { position: relative; z-index: 1; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; opacity: .85; }
.hub-card.big { color: var(--on); background: linear-gradient(135deg, var(--c1), var(--c2)); border: 0; box-shadow: 0 20px 36px -18px var(--c1); }
.hub-card.big::after { background: rgba(255, 255, 255, .16); width: 220px; height: 220px; right: -70px; top: auto; bottom: -110px; }
.hub-card.big .ti { background: rgba(255, 255, 255, .24); box-shadow: none; }
.hub-card.big b { font-size: 26px; }
.hub-card.big .desc, .hub-card.big .go { color: var(--on); opacity: .95; }
.hub-links { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.hub-links a { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 14px; background: var(--glass); border: 1px solid var(--line);
  color: var(--ink-soft); font-weight: 600; text-decoration: none; }
.hub-links a:hover { background: var(--sheet); color: var(--ink); }
.hub-links svg { width: 17px; height: 17px; color: var(--c1); }

.sent-list { display: grid; gap: 8px; padding: 12px; }
.sent-item { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; padding: 12px 16px 12px 20px; border: 1px solid var(--grid); border-radius: 16px; background: var(--sheet);
  cursor: pointer; position: relative; overflow: hidden; transition: background .15s, border-color .15s; }
.sent-item::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: var(--line-strong); }
.sent-item.good::before { background: #10B07A; }
.sent-item.mid::before { background: #2F7BFF; }
.sent-item.low::before { background: #FFA41B; }
.sent-item.wait::before { background: var(--red); }
.sent-item:hover { background: var(--ct); border-color: transparent; }
.sent-item .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sent-item .res { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; }
.sent-item .res b { font-size: 20px; font-weight: 800; }

/* шаги мастера */
.stepper { display: flex; align-items: center; gap: 10px; margin: 0 0 22px; flex-wrap: wrap; scroll-margin-top: 80px; }
.step { display: inline-flex; align-items: center; gap: 10px; border: 0; background: none; padding: 6px 6px; border-radius: 16px; font-weight: 700; color: var(--muted); cursor: pointer; }
.step:disabled { cursor: default; }
.step .dot { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--sheet); border: 2px solid var(--line-strong); font-weight: 800; color: var(--muted); }
.step .dot svg { width: 18px; height: 18px; }
.step.on { color: var(--ink); }
.step.on .dot { background: linear-gradient(135deg, var(--c1), var(--c2)); border-color: transparent; color: var(--on); box-shadow: 0 8px 16px -8px var(--c1); }
.step.done { color: var(--ink-soft); }
.step.done .dot { background: var(--ct); border-color: transparent; color: var(--ci); }
.step.done:hover .lbl { text-decoration: underline; }
.step-line { flex: 0 1 60px; height: 3px; border-radius: 2px; background: var(--line-strong); }

.choice-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.choice { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; text-align: left; padding: 22px; border-radius: 24px; background: var(--sheet); cursor: pointer;
  border: 2px solid var(--line); box-shadow: var(--shadow); color: var(--ink); transition: transform .15s, border-color .15s, box-shadow .15s; }
.choice:hover { transform: translateY(-3px); border-color: var(--c1); box-shadow: var(--shadow-hover); }
.choice .ti { width: 52px; height: 52px; border-radius: 17px; display: grid; place-items: center; background: var(--ct); color: var(--c1); margin-bottom: 4px; }
.choice .ti svg { width: 26px; height: 26px; }
.choice b { font-size: 19px; }
.choice > span:last-child { color: var(--muted); font-size: 14px; }
.choice.on { border-color: var(--c1); background: linear-gradient(180deg, var(--sheet), var(--ct)); }
.choice.on .ti { background: linear-gradient(135deg, var(--c1), var(--c2)); color: var(--on); }

.wiz-box { max-width: 860px; }
.wiz-box h2 { margin-bottom: 4px; }
.num-grid.big { grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); gap: 8px; margin-top: 12px; }
.num-grid.big .num-btn { padding: 10px 2px 8px; }
.num-grid.big .num-btn b { font-size: 20px; }
.pill-tabs.big { margin-top: 10px; }
.pill-tabs.big button { min-width: 54px; padding: 10px 14px; font-size: 16px; font-weight: 700; }
.switch { display: flex; align-items: flex-start; gap: 14px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .sw { flex: none; width: 50px; height: 30px; border-radius: 15px; background: var(--line-strong); position: relative; transition: background .15s; margin-top: 2px; }
.switch .sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .2); transition: transform .18s; }
.switch input:checked + .sw { background: linear-gradient(135deg, var(--c1), var(--c2)); }
.switch input:checked + .sw::after { transform: translateX(20px); }
.switch input:focus-visible + .sw { outline: 2px solid var(--c1); outline-offset: 2px; }
.switch > span:last-child { display: flex; flex-direction: column; gap: 2px; }
.wiz-nav { display: flex; align-items: center; gap: 10px; margin-top: 20px; max-width: 860px; }
.wiz-nav .grow { flex: 1; }
.wiz-final { grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); align-items: start; }
.wiz-send { position: sticky; top: 20px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; max-height: 320px; overflow: auto; padding: 2px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 20px; border: 1.5px solid var(--line-strong); background: var(--sheet); cursor: pointer; font-weight: 600; color: var(--ink-soft); }
.chip span { font-size: 12px; color: var(--muted); font-weight: 500; }
.chip svg { width: 15px; height: 15px; }
.chip:hover { border-color: var(--c1); }
.chip.on { background: linear-gradient(135deg, var(--c1), var(--c2)); border-color: transparent; color: var(--on); }
.chip.on span { color: var(--on); opacity: .85; }

@media (max-width: 1200px) {
  .hub { grid-template-columns: 1fr 1fr; }
  .hub-card.big { grid-column: 1 / -1; }
  .wiz-final { grid-template-columns: 1fr; }
  .wiz-send { position: static; order: -1; }
}
@media (max-width: 860px) {
  .hub { grid-template-columns: 1fr; gap: 12px; }
  .hub-card { min-height: 0; padding: 18px; }
  .choice-grid { grid-template-columns: 1fr; gap: 10px; }
  .choice { flex-direction: row; align-items: center; padding: 16px; gap: 14px; }
  .choice .ti { margin: 0; flex: none; }
  .choice > b + span { flex-basis: 100%; }
  .choice { flex-wrap: wrap; }
  .stepper { flex-wrap: nowrap; gap: 4px; }
  .step { padding: 4px; flex: none; }
  .step .lbl { display: none; }
  .step.on .lbl { display: inline; white-space: nowrap; }
  .step-line { flex: 1 1 12px; min-width: 12px; }
  .num-grid.big { grid-template-columns: repeat(auto-fill, minmax(54px, 1fr)); gap: 6px; }
  .wiz-nav { position: sticky; bottom: calc(86px + env(safe-area-inset-bottom)); z-index: 5; background: var(--topbar); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); padding: 10px 0; }
  .wiz-nav .btn-lg { flex: 1; }
}

/* ===================== «Кабинет», а не «дневник» ===================== */
/* меню: «Ещё» — второстепенные разделы помельче */
.nav-sep { margin: 14px 10px 4px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.nav-sep ~ a { padding-top: 4px; padding-bottom: 4px; font-size: 14px; }
.nav-sep ~ a svg { width: 28px; height: 28px; padding: 6px; border-radius: 9px; }

/* звёзды вместо процентов */
.stars { display: inline-flex; letter-spacing: 1px; color: #FFB020; font-size: 16px; line-height: 1; white-space: nowrap; text-shadow: 0 1px 0 rgba(154, 88, 0, .15); }
.stars i { font-style: normal; color: #E9E1D3; text-shadow: none; }
.stars.big { font-size: 44px; letter-spacing: 4px; }

/* ученики — карточками */
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; padding-bottom: 80px; }
.person { display: flex; flex-direction: column; gap: 14px; padding: 18px; border-radius: 22px; background: var(--sheet); box-shadow: var(--shadow); color: var(--ink); text-decoration: none; transition: transform .15s, box-shadow .15s; }
.person:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.person-top { display: flex; align-items: center; gap: 12px; }
.ava { flex: none; width: 48px; height: 48px; border-radius: 16px; display: grid; place-items: center; font-weight: 800; font-size: 17px; color: var(--on); background: linear-gradient(135deg, var(--c1), var(--c2)); }
.person .who { display: flex; flex-direction: column; min-width: 0; }
.person .who b { font-size: 17px; }
.person .who span { font-size: 13px; color: var(--muted); }
.person-prog { display: flex; flex-direction: column; gap: 6px; }
.person-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-top: auto; }

/* круглая кнопка «+» */
.fab { position: fixed; right: 32px; bottom: 32px; z-index: 30; width: 64px; height: 64px; border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center;
  color: var(--on); background: linear-gradient(135deg, var(--c1), var(--c2)); box-shadow: 0 14px 30px -10px var(--c1), 0 4px 10px rgba(30, 27, 58, .12); transition: transform .15s; }
.fab:hover { transform: scale(1.06) rotate(90deg); }
.fab svg { width: 30px; height: 30px; stroke-width: 2.4; }
@media (max-width: 860px) { .fab { right: 18px; bottom: calc(86px + env(safe-area-inset-bottom)); width: 58px; height: 58px; } }

/* лента «Что новенького» */
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.feed li:last-child { border-bottom: 0; }
.feed li.clickable { cursor: pointer; }
.feed .ava { width: 40px; height: 40px; border-radius: 13px; font-size: 14px; }

/* «Как идут дела» в карточке ученика — лента тем */
.topic-feed { padding: 4px 18px 10px; }
.topic-row { display: grid; grid-template-columns: 1fr auto; gap: 8px 14px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.topic-row:last-child { border-bottom: 0; }
.topic-row .tr-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.topic-row:not(.open) .tr-main b { color: var(--muted); font-weight: 600; }
.topic-row .tr-ctrl { display: flex; gap: 8px; align-items: center; }
.topic-row .tr-note { grid-column: 1 / -1; }
.topic-row:not(.open) .tr-note, .topic-row:not(.open) [data-f="status"] { display: none; }
.topic-row.done .tr-main b::after { content: " ✓"; color: var(--green); }
.topic-row.repeat .tr-main b::after { content: " · повторить"; color: var(--amber); font-weight: 600; font-size: 13px; }
@media (max-width: 640px) { .topic-row { grid-template-columns: 1fr; } }

/* работы: «зачтено / на доработку» */
.pass-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 10px 0; }
.pp { display: flex; align-items: center; justify-content: center; gap: 8px; height: 60px; border-radius: 18px; border: 2px solid var(--line); background: var(--sheet); font-weight: 700; font-size: 16px; color: var(--ink-soft); cursor: pointer; }
.pp svg { width: 20px; height: 20px; }
.pp.yes:hover, .pp.yes.on { border-color: var(--green); }
.pp.no:hover, .pp.no.on { border-color: var(--amber); }
.pp.yes.on { background: var(--green); color: #fff; }
.pp.no.on { background: var(--amber); color: #fff; }

/* ===================== Материалы ===================== */
.lib-drop { display: flex; align-items: center; gap: 18px; padding: 22px 24px; margin-bottom: 18px; border-radius: 22px; border: 2px dashed color-mix(in srgb, var(--c1) 40%, transparent);
  background: color-mix(in srgb, var(--ct) 60%, transparent); cursor: pointer; transition: background .15s, border-color .15s; }
.lib-drop > svg { flex: none; width: 52px; height: 52px; padding: 13px; border-radius: 16px; background: var(--sheet); color: var(--c1); }
.lib-drop.over { background: var(--ct); border-color: var(--c1); border-style: solid; }
.lib-filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 18px; }
.lib-filters .input { max-width: 280px; }
.lib-filters .chips { max-height: none; overflow: visible; }
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.lib-card { display: flex; gap: 14px; align-items: flex-start; text-align: left; padding: 14px; border: 0; border-radius: 20px; background: var(--sheet); box-shadow: var(--shadow); color: var(--ink); cursor: pointer; font: inherit; transition: transform .15s, box-shadow .15s; }
.lib-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.lib-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.lib-body b { overflow-wrap: anywhere; line-height: 1.3; }
.lib-body .tag { align-self: flex-start; }
.lib-body .tag svg { width: 13px; height: 13px; }
.lib-ic { flex: none; width: 54px; height: 64px; border-radius: 12px; display: grid; place-items: center; overflow: hidden; background: linear-gradient(160deg, var(--c1), var(--c2)); color: var(--on); }
.lib-ic b { font-size: 12px; letter-spacing: .04em; }
.lib-ic img { width: 100%; height: 100%; object-fit: cover; background: #fff; }
.lib-topics { margin-top: 22px; padding: 4px 20px; }
.lib-topics summary { cursor: pointer; padding: 12px 0; }
.lib-detail { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(260px, 1fr); gap: 22px; align-items: start; }
.lib-preview img { display: block; max-width: 100%; max-height: 70vh; margin: 0 auto; border-radius: 12px; background: #fff; }
.lib-nopreview { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 30px 16px; text-align: center; border-radius: 18px; background: var(--ct); }
.lib-nopreview .lib-ic { width: 80px; height: 96px; }
.lib-form .assign-list { margin-top: 6px; }
.lib-mini { margin-bottom: 6px; }
.lib-mini .lib-ic { width: 36px; height: 42px; border-radius: 9px; }
.lib-mini .lib-ic b { font-size: 9px; }
@media (max-width: 860px) { .lib-upbtn { display: none; } .lib-detail { grid-template-columns: 1fr; } .lib-filters .input { max-width: none; } .lib-drop { padding: 16px; } }

/* ===================== Тёмная тема — включается сама вместе с тёмной темой телефона или компьютера ===================== */
/* Фото работ, слайды презентаций и доска урока остаются светлыми — их так удобнее читать. */
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --paper: #15131F;
    --sheet: #211E30;
    --sheet-2: #282539;
    --ink: #EEECF7;
    --ink-soft: #CBC7DF;
    --muted: #9D99B6;
    --line: #353149;
    --line-strong: #423D5A;
    --grid: #2C2940;
    --track: #322E47;
    --note: #33212B;
    --red: #FF6377;
    --red-tint: #3B1F28;
    --green: #3AD08C;
    --green-tint: #173328;
    --amber: #F4B544;
    --amber-tint: #3A2D14;
    --violet-tint: #2B2448;
    --teal-tint: #14332F;
    --glass: rgba(33, 30, 48, .78);
    --glass-strong: rgba(33, 30, 48, .95);
    --topbar: rgba(21, 19, 31, .86);
    --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 8px 24px rgba(0, 0, 0, .3);
    --shadow-hover: 0 2px 6px rgba(0, 0, 0, .4), 0 18px 40px rgba(0, 0, 0, .45);
    --ct: #2A2552; --ci: #C2B9FF;
  }
  [data-sec="indigo"]             { --ct: #2A2552; --ci: #C2B9FF; }
  [data-sec="coral"], .c-red      { --ct: #3C2220; --ci: #FFB09F; }
  [data-sec="violet"], .c-violet  { --ct: #30234D; --ci: #D5BCFF; }
  [data-sec="blue"], .c-blue      { --ct: #1C2B4A; --ci: #A9C8FF; }
  [data-sec="green"], .c-green    { --ct: #173328; --ci: #8FE6BE; }
  [data-sec="yellow"], .c-amber   { --ct: #3A2D14; --ci: #FFD58A; }
  [data-sec="pink"]               { --ct: #3D1D2E; --ci: #FFA9CE; }
  [data-sec="teal"], .c-teal      { --ct: #123430; --ci: #8BE8DD; }
  [data-sec="gray"]               { --ct: #2A2D3A; --ci: #C3C9DA; }

  body::before {
    background:
      radial-gradient(42vw 42vw at 92% -8%, rgba(139, 92, 246, .14), transparent 70%),
      radial-gradient(38vw 38vw at 18% 108%, rgba(255, 154, 60, .08), transparent 70%);
  }
  ::selection { background: #5B4CF0; color: #fff; }
  .nav a:hover { background: rgba(255, 255, 255, .05); }
  .nav .count { box-shadow: 0 0 0 2px var(--sheet); }
  .stars i { color: #4A4560; }
  .tag { background: var(--sheet-2); color: var(--ink-soft); }
  .tag-green { background: var(--green-tint); color: var(--green); }
  .tag-red { background: var(--red-tint); color: var(--red); }
  .tag-amber { background: var(--amber-tint); color: var(--amber); }
  .tag-blue { background: var(--ct); color: var(--ci); }
  .table th { color: var(--muted); }
  .table td { border-color: var(--line); }
  .table tbody tr.clickable:hover td { background: var(--sheet-2); }
  .modal, .login-card { background: var(--sheet); }
  .overlay { background: rgba(5, 4, 12, .66); }
  .toast { background: #F0EEF8; color: #15131F; }
  .input::placeholder, .textarea::placeholder { color: #77738F; }
  .btn:hover { background: var(--sheet-2); }
  .btn-ghost { background: transparent; }
  .btn-ghost:hover { background: rgba(255, 255, 255, .06); }
  .memo, .fipi-text, .q, .ege-q { color: var(--ink); }
  .note-pen .pen, .pen { color: #FF8A9A; }
  .hero .btn { background: #fff; color: #3A2DB8; }
  .lib-ic img, .lib-preview img, .annot, .photo-thumb img { background: #fff; }
  .switch .sw { background: var(--line-strong); }
}

/* ===================== ОГЭ ===================== */
.exam-switch { display: inline-flex; margin-bottom: 18px; }
.exam-switch button span { font-size: 12px; font-weight: 500; opacity: .75; margin-left: 4px; }
.audio-box { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; padding: 14px 16px; border-radius: 16px; background: var(--ct); }
.audio-box audio { width: 100%; max-width: 520px; }
