/* Onest (Google Fonts, SIL OFL 1.1: /fonts/OFL-Onest.txt), the same face as SabaqLab: one variable file per subset for
   300–800, self-hosted under content-hashed names in /fonts/ (cached for a year). Subsets cyrillic (incl. Kazakh in
   cyrillic-ext), latin, latin-ext, math. Headings, numbers and text are all Onest; tabular figures only where numbers tick or stand in columns. */
/* cyrillic-ext */
@font-face {
  font-family: 'Onest';
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url(/fonts/onest-cbc5c553.woff2) format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
/* cyrillic */
@font-face {
  font-family: 'Onest';
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url(/fonts/onest-18c7b203.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* math */
@font-face {
  font-family: 'Onest';
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url(/fonts/onest-881eb477.woff2) format('woff2');
  unicode-range: U+0302-0303, U+0305, U+0307-0308, U+0310, U+0312, U+0315, U+031A, U+0326-0327, U+032C, U+032F-0330, U+0332-0333, U+0338, U+033A, U+0346, U+034D, U+0391-03A1, U+03A3-03A9, U+03B1-03C9, U+03D1, U+03D5-03D6, U+03F0-03F1, U+03F4-03F5, U+2016-2017, U+2034-2038, U+203C, U+2040, U+2043, U+2047, U+2050, U+2057, U+205F, U+2070-2071, U+2074-209F, U+20D0-20DC, U+20E1, U+20E5-20EF, U+2100-2112, U+2114-2115, U+2117-2121, U+2123-214F, U+2190, U+2192, U+2194-21AE, U+21B0-21E5, U+21F1-21F2, U+21F4-2211, U+2213-2214, U+2216-22FF, U+2308-230B, U+2310, U+2319, U+231C-2321, U+2336-237A, U+237C, U+2395, U+239B-23B7, U+23D0, U+23DC-23E1, U+2474-2475, U+25AF, U+25B3, U+25B7, U+25BD, U+25C1, U+25CA, U+25CC, U+25FB, U+266D-266F, U+27C0-27FF, U+2900-2AFF, U+2B0E-2B11, U+2B30-2B4C, U+2BFE, U+3030, U+FF5B, U+FF5D, U+1D400-1D7FF, U+1EE00-1EEFF;
}
/* latin-ext */
@font-face {
  font-family: 'Onest';
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url(/fonts/onest-23d453c5.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Onest';
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url(/fonts/onest-49b3b333.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ISMA cabinet in the SabaqLab look: a light blue-white ground (#F5F7FF), white cards with 20px corners and a soft
   shadow, cobalt blue for actions and state, Onest throughout. The variable names are the cabinet's own (every rule below
   reads them); the values are SabaqLab's tokens (chem web/src/styles/app.css :root). No lime: where SabaqLab is lime
   ISMA uses its blue or a neutral. Greys are a step darker than SabaqLab's --ink-3 so small text keeps AA contrast. */
:root {
  --bg: #F5F7FF;           /* SabaqLab --paper: the page */
  --bg-alt: #F0F3FB;       /* --line-2: quiet fills, hover */
  --paper: #FFFFFF;        /* --card */
  --ink: #17191F;
  --ink-soft: #555D70;     /* --ink-2 */
  --ink-muted: #636C82;    /* between --ink-2 and --ink-3: 4.7:1 on the page */
  --ink-faint: #768096;    /* --ink-3: icons and large text only */
  --line: #E0E5F2;
  --line-2: #F0F3FB;
  --line-strong: #C9D2E8;
  --primary: #2147F5;      /* --accent */
  --primary-deep: #1035C9; /* --accent-ink */
  --primary-ink: #0F2C9E;
  --primary-soft: #E4EBFF; /* --accent-soft */
  --primary-soft-2: #F1F4FF; /* --accent-soft-2 */
  --accent-2: #D9623F;
  --accent-3: #E9A91C;     /* stars, the abacus's active beads */
  --gold: #F2B53A;
  --gold-deep: #D48F12;
  --ok: #26834F;
  --ok-soft: #DFF3E7;
  --ok-ink: #1A5E3A;
  --warn: #A0670C;
  --warn-soft: #FBF0D6;
  --bad: #B6412E;
  --bad-soft: #FBE4DF;
  --bad-ink: #7E2620;
  --violet: #6B5BD2;
  --violet-soft: #ECE8FB;
  --sky: #2F7FD1;
  --sky-soft: #E2EEFB;
  --info-soft: #E4EBFF;
  --table-head: #F1F4FF;
  --table-side: #E8EDFA;
  --radius-xs: 8px;
  --radius-sm: 12px;       /* buttons, inputs, chips (SabaqLab --r-btn) */
  --radius-md: 12px;       /* rows, boxes (--r-sm) */
  --radius-lg: 20px;       /* cards (--r) */
  --shadow-sm: 0 1px 2px rgba(22, 38, 42, 0.04), 0 8px 24px -16px rgba(22, 38, 42, 0.18);
  --shadow-card: 0 6px 24px -22px rgba(25, 69, 239, 0.25);
  --shadow-md: 0 24px 60px -24px rgba(22, 38, 42, 0.35);
  --font-display: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --spring: cubic-bezier(0.34, 1.45, 0.5, 1);
  --top-h: 0px;        /* no sticky top bar on desktop (sidebar layout) */
  --bar-h: 0px;        /* the lesson bar's height while it is shown (LessonBarBox sets it on <html>) */
  --side-w: 236px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body.app-body {
  margin: 0;
  overflow-x: hidden;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
button, input, select, textarea { font: inherit; color: inherit; }
button, input, select, a, summary { touch-action: manipulation; } /* no 300ms delay / double-tap zoom on touch */
button { cursor: pointer; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--font-body); font-weight: 700; line-height: 1.2; margin: 0; letter-spacing: -0.02em; text-wrap: balance; }
h1 { font-size: clamp(26px, 2.4vw, 34px); letter-spacing: -0.035em; }
h2 { font-size: clamp(18px, 2vw, 21px); }
h3 { font-size: 16px; }
p { margin: 0; }
.muted { color: var(--ink-muted); }
.hide-sm { display: inline; }
@media (max-width: 600px) { .hide-sm { display: none; } }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
/* Onest's tabular figures put a lone «1» in a wide cell (11 reads as «1 1», which a child may take for two numbers), so
   numbers keep the proportional figures; only what ticks (timers, clocks, countdowns) is tabular, so it does not jitter */
.tnum { font-variant-numeric: lining-nums proportional-nums; }
[class*="timer"], [class*="clock"], .time-box, .flash-count, .lesson-timer { font-variant-numeric: lining-nums tabular-nums; }

/* ---- top bar ---- */
.app-top {
  position: sticky; top: 0; z-index: 20; min-height: var(--top-h);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 16px;
  background: color-mix(in oklab, var(--bg) 86%, white);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.app-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; font-family: var(--font-display); font-weight: 600; font-size: 19px; }
.app-brand img { height: 46px; width: auto; object-fit: contain; }
.app-top-right { display: flex; align-items: center; gap: 8px; }
.app-user { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-soft); font-weight: 600; font-size: 14px; padding: 0 6px; max-width: 40vw; }
.app-user span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lang-pill { display: inline-flex; padding: 3px; border-radius: var(--radius-sm); background: var(--bg-alt); border: 1px solid var(--line); }
.lang-pill button { border: 0; background: transparent; padding: 6px 12px; border-radius: var(--radius-sm); font-weight: 700; font-size: 13px; color: var(--ink-muted); min-height: 32px; }
.lang-pill button.active { background: var(--paper); color: var(--ink); box-shadow: var(--shadow-sm); }

/* ---- layout ---- */
.app-main { max-width: 1120px; width: 100%; margin: 0 auto; padding: 28px 32px 80px; }
.app-main.narrow { max-width: 680px; }
.app-main.wide { max-width: 1320px; }
.app-main.centered { display: flex; justify-content: center; padding-top: 80px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head .kicker { color: var(--ink-muted); font-weight: 600; font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 4px; }
.back-link { display: inline-flex; align-items: center; gap: 4px; color: var(--ink-muted); font-weight: 600; text-decoration: none; margin-bottom: 14px; min-height: 44px; padding-right: 8px; }
.back-link:hover { color: var(--ink); }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.grow { flex: 1; }

/* ---- buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: var(--radius-sm); font-weight: 600; white-space: nowrap;
  transition: transform 0.08s, box-shadow 0.15s var(--ease), background 0.12s, border-color 0.12s, color 0.12s;
  text-decoration: none;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn-sm { min-height: 32px; padding: 0 10px; font-size: 13px; }
.btn-md { min-height: 40px; padding: 0 16px; font-size: 14px; }
.btn-lg { min-height: 48px; padding: 0 22px; font-size: 15px; }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); box-shadow: 0 4px 10px -7px rgba(25, 69, 239, 0.56); }
.btn-primary:hover:not(:disabled) { background: var(--primary-deep); border-color: var(--primary-deep); }
.btn-default { background: var(--paper); border-color: var(--line); color: var(--ink); }
.btn-default:hover:not(:disabled) { background: var(--bg-alt); border-color: var(--line-strong); }
.btn-outline { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-outline:hover:not(:disabled) { background: var(--bg-alt); border-color: var(--line-strong); }
.btn-ghost { background: transparent; color: var(--ink-soft); }
.btn-ghost:hover:not(:disabled) { background: var(--bg-alt); color: var(--ink); }
.btn-danger { background: var(--paper); color: var(--bad); border-color: var(--bad-soft); }
.btn-danger:hover:not(:disabled) { background: var(--bad-soft); border-color: var(--bad-soft); }
.btn-block { width: 100%; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid rgba(23, 25, 31, 0.12); border-top-color: currentColor; animation: spin 0.8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- cards / badges ---- */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 20px; box-shadow: var(--shadow-card); }
.card.pad-sm { padding: 16px; }
.badge { display: inline-flex; align-items: center; gap: 6px; min-height: 22px; padding: 2px 8px; border-radius: var(--radius-xs); font-size: 13px; font-weight: 600; line-height: 1.25; white-space: nowrap; }
.badge-new { background: var(--bg-alt); color: var(--ink-muted); }
.badge-active { background: var(--warn-soft); color: #7A4A10; }
.badge-done { background: var(--ok-soft); color: var(--ok-ink); }
.badge-bad { background: var(--bad-soft); color: var(--bad-ink); }
.badge-info { background: var(--primary-soft); color: var(--primary-deep); }
.skeleton { display: inline-block; border-radius: var(--radius-md); background: linear-gradient(90deg, var(--bg-alt), #E6EBF8, var(--bg-alt)); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.error-box { background: var(--bad-soft); color: var(--bad-ink); border-radius: var(--radius-md); padding: 16px 18px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.empty { text-align: center; padding: 48px 20px; background: var(--paper); border: 1px dashed var(--line-strong); border-radius: var(--radius-lg); }
.empty-icon { width: 60px; height: 60px; border-radius: 50%; background: var(--primary-soft); color: var(--primary-deep); display: inline-flex; align-items: center; justify-content: center; margin-bottom: 14px; }
.empty p { color: var(--ink-muted); margin-top: 6px; max-width: 420px; margin-inline: auto; }
.icon { flex: none; }

/* ---- progress ---- */
.progress { height: 10px; border-radius: 999px; background: var(--bg-alt); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--primary), var(--primary-deep)); transition: width 0.6s var(--ease); }

/* ---- toasts / modal ---- */
.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 50; pointer-events: none; }
.toast { background: var(--ink); color: #fff; padding: 11px 16px; border-radius: var(--radius-md); font-weight: 500; font-size: 14px; box-shadow: var(--shadow-md); max-width: min(92vw, 480px); animation: rise 0.25s var(--ease); }
.toast-error { background: var(--bad); }
.toast-ok { background: var(--ok); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.modal-backdrop { position: fixed; inset: 0; background: rgba(22, 38, 42, 0.32); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 40; animation: fade 0.18s; }
.modal { background: var(--paper); border-radius: var(--radius-lg); padding: 24px; width: min(440px, 100%); box-shadow: var(--shadow-md); animation: pop 0.2s cubic-bezier(0.2, 0.9, 0.3, 1); }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(0.98); } to { opacity: 1; transform: none; } }
.modal p { color: var(--ink-soft); margin-top: 8px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ---- forms ---- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-weight: 600; font-size: 14px; color: var(--ink-soft); }
.input { border: 1px solid var(--line-strong); border-radius: var(--radius-md); padding: 11px 14px; min-height: 46px; background: var(--paper); width: 100%; transition: border-color 0.12s, box-shadow 0.12s; }
.input::placeholder { color: var(--ink-faint); }
.input:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px var(--primary-soft); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ---- login ---- */
.login { padding-top: clamp(24px, 8vh, 80px); }
.login-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 36px 28px 28px; text-align: center; position: relative; overflow: hidden; }
.login-card h1 { margin-top: 6px; }
.login-art { display: flex; justify-content: center; gap: 10px; margin-bottom: 18px; }
.login-art span { width: 22px; height: 22px; border-radius: 50%; background: var(--primary); box-shadow: inset -4px -4px 0 rgba(0,0,0,0.12); animation: bead 2.4s var(--ease) infinite; }
.login-art span:nth-child(2) { animation-delay: 0.15s; background: var(--accent-3); }
.login-art span:nth-child(3) { animation-delay: 0.3s; background: var(--accent-2); }
.login-art span:nth-child(4) { animation-delay: 0.45s; background: var(--ok); }
.login-art span:nth-child(5) { animation-delay: 0.6s; }
@keyframes bead { 0%, 100% { transform: translateY(0); } 30% { transform: translateY(-7px); } }
.pin-cells { display: flex; justify-content: center; gap: 12px; margin: 28px 0 10px; }
.pin-cell {
  width: 64px; height: 76px; text-align: center; font-family: var(--font-display); font-size: 34px; font-weight: 600;
  border: 2px solid var(--line-strong); border-radius: var(--radius-md); background: var(--bg); caret-color: var(--primary-deep);
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.pin-cell:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 5px rgba(33, 71, 245, 0.22); transform: translateY(-2px); }
.pin-cell.filled { background: var(--primary-soft); border-color: var(--primary); }
.pin-cell:disabled { opacity: 0.6; }
.shake { animation: shake 0.4s; }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20%, 60% { transform: translateX(-7px); } 40%, 80% { transform: translateX(7px); } }
.login-error { min-height: 26px; color: var(--bad); font-weight: 600; font-size: 14px; margin-bottom: 10px; }
@media (max-width: 400px) { .pin-cell { width: 56px; height: 68px; font-size: 30px; } .pin-cells { gap: 8px; } }

/* ---- student home ---- */
.book-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.book-card { display: flex; flex-direction: column; gap: 12px; padding: 22px 24px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); transition: box-shadow 0.2s, border-color 0.2s; }
.book-card.is-clickable { cursor: pointer; }
.book-card:hover, .book-card:focus-visible { box-shadow: var(--shadow-md); border-color: rgba(33, 71, 245, 0.35); }
.book-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.book-card h2 { font-size: 22px; }
.book-pct { font-weight: 800; font-size: 13px; color: var(--primary); }
.book-card .progress { height: 6px; }
.book-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; color: var(--ink-muted); font-size: 14px; min-height: 22px; }
.book-live { display: inline-flex; align-items: center; gap: 5px; color: var(--warn); font-weight: 700; }
.book-card-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; padding-top: 10px; }
.book-link { display: inline-flex; align-items: center; gap: 2px; font-weight: 700; font-size: 14px; color: var(--ink-soft); text-decoration: none; min-height: 44px; padding: 0 4px; white-space: nowrap; }
.book-link:hover { color: var(--primary); }
@media (max-width: 420px) { .book-card-actions { flex-direction: column; align-items: stretch; } .book-card-actions .btn { width: 100%; } .book-link { justify-content: center; } }

/* ---- page list ---- */
.weeks { display: flex; flex-direction: column; gap: 26px; }
.week-title { display: flex; align-items: center; gap: 12px; font-size: 20px; margin-bottom: 10px; position: sticky; top: calc(var(--top-h) + var(--bar-h, 0px)); background: var(--bg); padding: 8px 0; z-index: 5; }
.week-no { width: 36px; height: 36px; border-radius: var(--radius-md); background: var(--primary); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-family: var(--font-body); font-weight: 800; font-size: 15px; }
.page-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
/* weeks fold; a «go to page» box on top */
.weeks:has(> .weeks-bar) { gap: 10px; }
.weeks-bar { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 12px 20px; padding: 14px 16px; margin-bottom: 4px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.page-jump { display: flex; flex-direction: column; gap: 6px; }
.page-jump label { font-size: 13px; font-weight: 700; color: var(--ink-soft); }
.page-jump-row { display: flex; gap: 8px; }
.page-jump-input { width: 120px; min-height: 44px; padding: 6px 12px; font-size: 18px; font-weight: 700; text-align: center; transition: border-color 0.15s, box-shadow 0.15s, background 0.15s; }
.page-jump-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.page-jump.is-bad .page-jump-input { border-color: var(--bad); background: #FDF3F2; box-shadow: 0 0 0 4px rgba(201, 70, 61, 0.14); color: var(--bad); }
.page-jump .btn:disabled { background: var(--line); border-color: var(--line); color: var(--ink-muted); opacity: 1; }
.page-jump-err { color: var(--bad); font-size: 13px; font-weight: 600; }
.weeks-all { font-size: 14px; min-height: 44px; }
.week { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.week.is-open { border-color: var(--line-strong); }
.week-head { width: 100%; display: flex; align-items: center; gap: 14px; padding: 12px 16px; border: 0; border-radius: var(--radius-lg); background: transparent; font: inherit; color: inherit; text-align: left; cursor: pointer; transition: background 0.15s; }
.week-head:hover { background: var(--bg); }
.week-head:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.week.is-open .week-head { position: sticky; top: calc(var(--top-h) + var(--bar-h, 0px)); z-index: 5; background: var(--paper); border-bottom: 1px solid var(--line); border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.week-head.is-live .week-no { background: var(--warn); }
.week-head.is-done .week-no { background: var(--ok); }
.week-head-main { flex: 1; display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.week-head-main b { font-size: 17px; }
.week-range { font-size: 14px; color: var(--ink-muted); }
.week-done { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 700; color: var(--ink-soft); white-space: nowrap; }
.week-done.is-all { color: var(--ok); }
.week-chev { display: inline-flex; color: var(--ink-muted); transition: transform 0.18s var(--ease); }
.week.is-open .week-chev { transform: rotate(90deg); }
.week > .page-list { padding: 12px; }
@media (max-width: 640px) {
  .weeks-bar { flex-direction: column; align-items: stretch; }
  .page-jump-input { flex: 1; width: auto; }
  .weeks-all { align-self: flex-start; min-height: 36px; }
  .week-head { gap: 10px; padding: 10px 12px; }
  .week-done { display: none; }
  .week > .page-list { padding: 8px; }
}
.page-row { display: grid; grid-template-columns: 84px 1fr auto; align-items: center; gap: 12px; min-height: 64px; padding: 10px 14px; background: var(--paper); border: 1.5px solid var(--line); border-radius: var(--radius-md); text-decoration: none; transition: border-color 0.15s, transform 0.15s var(--ease), box-shadow 0.15s; }
.page-row:hover { border-color: var(--primary); transform: translateX(2px); box-shadow: var(--shadow-sm); }
.page-row.is-done { border-color: color-mix(in oklab, var(--ok) 35%, var(--line)); }
.page-row.is-active, .page-row.is-current { border-color: var(--warn); background: color-mix(in oklab, var(--warn-soft) 45%, var(--paper)); }
.page-no { font-family: var(--font-display); font-weight: 600; font-size: 19px; }
.page-meta { display: flex; flex-direction: column; line-height: 1.3; font-size: 14px; }
.page-kind { font-weight: 700; }
.page-status { display: flex; align-items: center; gap: 8px; color: var(--ink-muted); }
@media (max-width: 520px) {
  .page-row { grid-template-columns: 70px 1fr; }
  .page-status { grid-column: 1 / -1; justify-content: space-between; }
  .page-no { font-size: 17px; }
}

/* ---- book page renderer ---- */
.page-view { display: flex; flex-direction: column; gap: 22px; }
.block { display: flex; flex-direction: column; gap: 8px; }
.block-tag { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; color: var(--ink-soft); }
.block-tag-no { width: 26px; height: 26px; border-radius: var(--radius-md); background: var(--table-head); color: var(--ink); display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 800; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius-md); border: 1px solid var(--line-strong); background: var(--paper); }
.book-table { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 15px; }
.book-table th, .book-table td { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 5px 6px; text-align: center; white-space: nowrap; }
.book-table th:last-child, .book-table td:last-child { border-right: 0; }
.book-table thead th { background: var(--table-head); font-weight: 700; font-size: 13px; padding: 7px 6px; position: sticky; top: 0; }
.book-table .th-no, .book-table .td-no { background: var(--table-side); font-weight: 700; font-size: 13px; color: var(--ink-soft); position: sticky; left: 0; z-index: 1; min-width: 36px; }
.book-table .td-num { min-width: 68px; font-weight: 600; }
.book-table .tr-answer td { border-bottom: 0; background: color-mix(in oklab, var(--primary-soft) 45%, var(--paper)); padding: 6px; }
.book-table .td-answer-label { font-size: 12px; padding: 6px 8px; white-space: nowrap; }
.num-blank { display: inline-block; width: 42px; height: 14px; border-radius: var(--radius-md); background: var(--bg-alt); }
.num-blank.wide { width: 86px; }
.ans-blank { display: inline-block; width: 56px; height: 38px; border-radius: var(--radius-md); border: 1.5px dashed var(--line-strong); }
.ans-input {
  width: 76px; min-height: 44px; text-align: center; font-weight: 700; font-size: 15px; border: 1.5px solid var(--line-strong); border-radius: var(--radius-md);
  background: #fff; padding: 4px 6px; transition: border-color 0.12s, box-shadow 0.12s;
}
.ans-input::placeholder { color: #c9c3b8; font-weight: 500; }
.ans-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(33, 71, 245, 0.22); }
.ans-input.has-value { background: #fff; border-color: var(--primary-deep); }
.ans-key { font-weight: 800; }
.ans-result { display: inline-flex; flex-direction: column; align-items: center; min-width: 64px; padding: 4px 8px; border-radius: var(--radius-md); line-height: 1.2; }
.ans-result.is-checked { animation: rise 0.22s var(--ease); }
.result-line { margin: 2px 0 4px; font-weight: 600; color: var(--ink-soft); }
.ans-result.is-ok { background: var(--ok-soft); color: var(--ok-ink); }
.ans-result.is-bad { background: var(--bad-soft); color: var(--bad-ink); }
.ans-given { font-weight: 800; }
.is-bad .ans-given { text-decoration: none; }
.ans-expected { font-weight: 800; font-size: 13px; color: var(--ok-ink); background: var(--ok-soft); border-radius: var(--radius-md); padding: 1px 6px; margin-top: 3px; }
/* two tries: the wrong first try (small, struck through) with the second box / the second try right under it */
.ans-tries { display: inline-flex; flex-direction: column; align-items: center; gap: 3px; vertical-align: middle; }
.ans-tries .is-try1 { min-width: 0; padding: 2px 8px; font-size: 13px; }
/* the second «Ответ» row / column: the second try, the right answer under a wrong one; an empty slot stays quiet */
.tr-answer2 td { border-top: 1px dashed var(--line); }
.tr-answer2 .td-answer-label { font-size: 11px; color: var(--ink-muted); }
.ans-slot-empty { display: inline-block; min-height: 28px; }
.expr-table .td-answer2 { border-left: 1px dashed var(--line); }
.ans-input.is-try2 { border-color: var(--bad); }
.ans-input.is-try2:focus { border-color: var(--primary); }
.ans-input.is-try2::placeholder { font-size: 11px; }
.col-card .ans-tries, .expr-row .ans-tries { width: 100%; align-items: stretch; }
.col-card .ans-tries .is-try1 { align-self: flex-end; width: auto; }
.page-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 14px; padding-top: 4px; }
.time-box { min-width: 96px; height: 36px; border: 1.5px solid var(--line-strong); border-radius: var(--radius-md); display: inline-flex; align-items: center; justify-content: center; font-weight: 800; background: var(--paper); }

/* mul / div / sqrt pages */
.muldiv-grid { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-start; }
.muldiv-section { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.muldiv-pair { display: grid; gap: 8px; }
.expr-table { width: 100%; border: 1px solid var(--line-strong); border-radius: var(--radius-md); overflow: hidden; background: var(--paper); font-size: 14px; }
.expr-table .td-no { min-width: 30px; width: 1%; position: static; }
.expr-table .td-expr { text-align: left; padding-left: 8px; font-weight: 600; min-width: 96px; white-space: nowrap; }
.expr-table .td-answer { padding: 3px 4px; width: 1%; }
.expr-table .ans-input { width: 70px; min-height: 44px; font-size: 14px; }
.expr-table .ans-blank { width: 56px; height: 30px; }
.expr-table tr:last-child td { border-bottom: 0; }
.pct-section { display: flex; flex-direction: column; gap: 8px; }
.pct-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(236px, 1fr)); gap: 8px; }
.pct-table .td-expr { min-width: 110px; }
.pct-table .ans-input { width: 92px; }
/* decimal answers such as 650,06368 stay fully visible */
.round-note { margin: 14px 0 0; padding: 10px 14px; border-radius: var(--radius-md); background: var(--primary-soft); color: var(--ink-soft); font-size: 14px; line-height: 1.45; max-width: 760px; }

@media (max-width: 520px) {
  .muldiv-pair { grid-template-columns: 1fr; }
  .book-table { font-size: 14px; }
  .book-table .td-num { min-width: 58px; }
  .ans-input { width: 66px; }
}

/* ---- solve page ---- */
.solve-bar { position: sticky; top: calc(var(--top-h) + var(--bar-h, 0px) + 6px); z-index: 10; display: flex; align-items: center; gap: 16px; padding: 10px 14px; margin-bottom: 16px; background: color-mix(in oklab, var(--paper) 92%, white); border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: var(--shadow-md); }
.solve-timer { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-display); font-weight: 600; font-size: 26px; min-width: 110px; color: var(--primary-deep); }
.solve-progress { flex: 1; display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 700; color: var(--ink-soft); }
.solve-body { position: relative; }
.start-overlay { position: absolute; inset: 0; z-index: 6; display: flex; justify-content: center; align-items: flex-start; padding-top: 60px; background: linear-gradient(180deg, rgba(245, 249, 253, 0.55), rgba(245, 249, 253, 0.88)); backdrop-filter: blur(2px); border-radius: var(--radius-md); }
.start-card { position: sticky; top: 120px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: var(--shadow-md); padding: 30px 28px; width: min(420px, 100%); text-align: center; display: flex; flex-direction: column; gap: 12px; align-items: center; }
.start-card p { color: var(--ink-soft); }
.start-warn { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: #7A4A10; background: var(--warn-soft); padding: 8px 12px; border-radius: var(--radius-md); }
.start-card .btn { margin-top: 6px; min-width: 200px; }
.is-idle .page-view { pointer-events: none; user-select: none; }
.result-card { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: var(--shadow-md); padding: 20px 24px; margin-bottom: 18px; animation: rise 0.3s var(--ease); }
.result-score { display: flex; align-items: center; gap: 18px; }
.result-ring { width: 92px; height: 92px; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; font-family: var(--font-display); font-weight: 600; font-size: 32px; border: 5px solid var(--ok); color: var(--ok-ink); background: var(--ok-soft); flex: none; }
.result-ring small { font-family: var(--font-body); font-size: 13px; font-weight: 700; margin-top: 2px; }
.result-ring.is-perfect { border-color: var(--accent-3); background: #FFF4D6; color: #6B4A00; }
.result-ring.is-low { border-color: var(--bad); background: var(--bad-soft); color: var(--bad-ink); }
.result-actions { display: flex; gap: 10px; flex-wrap: wrap; }
@media (max-width: 640px) {
  /* thin strip under the header instead of a floating card */
  .solve-bar { top: calc(var(--top-h) + var(--bar-h, 0px)); margin: 0 -14px 14px; padding: 6px 14px; border-radius: 0; border-left: 0; border-right: 0; box-shadow: 0 6px 16px rgba(16, 36, 62, 0.06); gap: 10px; background: color-mix(in oklab, var(--bg) 90%, white); }
  .solve-timer { font-size: 20px; min-width: 0; }
  .solve-progress { font-size: 12px; gap: 3px; }
  .solve-progress .progress { height: 5px; }
  .solve-bar .btn { min-height: 38px; padding: 0 14px; font-size: 14px; }
  .result-actions { width: 100%; }
  .result-actions .btn { flex: 1; }
}
@media (max-width: 480px) { :root { --top-h: 56px; } .app-brand span { display: none; } .app-brand img { height: 40px; } .app-top { padding: 6px 12px; gap: 8px; } .app-user span { display: none; } .app-user { padding: 0; } .app-top-right { gap: 4px; } }

/* ---- teacher ---- */
.count-pill { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; height: 30px; padding: 0 9px; margin-left: 10px; border-radius: var(--radius-sm); background: var(--bg-alt); font-family: var(--font-body); font-size: 14px; font-weight: 800; vertical-align: middle; color: var(--ink-soft); }
.student-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.student-row { display: grid; grid-template-columns: 48px 1fr auto auto 20px; align-items: center; gap: 14px; padding: 12px 16px; min-height: 76px; background: var(--paper); border: 1.5px solid var(--line); border-radius: var(--radius-md); text-decoration: none; transition: border-color 0.15s, transform 0.15s var(--ease), box-shadow 0.15s; color: var(--ink-muted); }
.student-row:hover { border-color: var(--primary); transform: translateX(2px); box-shadow: var(--shadow-sm); }
.student-avatar { width: 48px; height: 48px; border-radius: var(--radius-md); background: linear-gradient(135deg, var(--primary-soft), var(--primary)); color: #fff; font-family: var(--font-display); font-weight: 700; font-size: 22px; display: flex; align-items: center; justify-content: center; }
.student-main { display: flex; flex-direction: column; min-width: 0; color: var(--ink); }
.student-name { font-weight: 800; font-size: 17px; }
.student-sub { font-size: 13px; }
.stat { display: flex; flex-direction: column; line-height: 1.2; color: var(--ink); }
.stat b { font-size: 15px; }
.stat small { color: var(--ink-muted); font-size: 11px; font-weight: 600; }
.pin-chip { display: inline-flex; align-items: center; gap: 6px; border: 1.5px dashed var(--line-strong); background: var(--bg); border-radius: var(--radius-md); padding: 6px 10px; font-weight: 800; letter-spacing: 0.12em; font-size: 15px; color: var(--ink); min-height: 36px; }
.pin-chip:hover { border-color: var(--primary); background: var(--primary-soft); }
.pin-chip.is-hidden { color: var(--ink-muted); letter-spacing: 0.2em; }
.pin-chip.is-hidden .icon { color: var(--primary); }
/* the login cells show a dot for every typed digit, never the digit */
.pin-cell[type="password"] { -webkit-text-security: disc; }
.pin-reveal { margin: 14px 0; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.pin-big { display: flex; gap: 8px; }
.pin-big span { width: 52px; height: 64px; border-radius: var(--radius-md); background: var(--primary-soft); border: 2px solid var(--primary); display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-size: 30px; font-weight: 600; }
.teacher-books { margin-top: 34px; display: flex; flex-direction: column; gap: 12px; }
.section-title { margin: 26px 0 12px; }
.access-card h3 { margin-bottom: 10px; }
.access-list { display: flex; flex-direction: column; gap: 6px; }
.access-row { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 14px; padding: 10px 12px; border-radius: var(--radius-md); cursor: pointer; }
.access-row:hover { background: var(--bg); }
.access-row.is-on .access-title { font-weight: 800; }
.switch { width: 50px; height: 30px; border-radius: var(--radius-sm); background: var(--line-strong); position: relative; transition: background 0.2s; flex: none; }
.switch.on { background: var(--ok); }
.switch-knob { position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform 0.2s var(--ease); }
.switch.on .switch-knob { transform: translateX(20px); }
.results-block { margin-bottom: 26px; }
.results-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 10px; flex-wrap: wrap; }
.results-table { border-collapse: collapse; width: 100%; font-size: 14px; background: var(--paper); }
.results-table th, .results-table td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.results-table th { background: var(--table-head); font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; }
.results-table tr.is-new td { color: var(--ink-muted); }
.results-table tr.is-active td { background: color-mix(in oklab, var(--warn-soft) 40%, var(--paper)); }
.results-table tr.is-link { cursor: pointer; }
.results-table tr.is-link:hover td { background: var(--bg); }
.results-table .td-actions { text-align: right; }
.results-table .td-actions .btn { margin-left: 6px; }
.results-table thead th[colspan] { text-align: center; border-bottom: 1px solid var(--line); padding-bottom: 4px; }
.results-table thead .th-sub { text-align: center; text-transform: none; letter-spacing: 0; font-size: 12px; padding-top: 4px; }
.results-table .td-try { text-align: center; }
.res-prog { display: flex; flex-direction: column; gap: 4px; min-width: 130px; font-size: 13px; }
.res-bar { display: flex; height: 8px; border-radius: var(--radius-sm); background: var(--bg-alt); overflow: hidden; }
.res-bar > span { height: 100%; }
.res-bar .is-1 { background: var(--ok); }
.res-bar .is-2 { background: var(--warn); }
.res-bar .is-bad { background: var(--bad); }
.res-bar .is-fill { background: var(--primary); }
.results-table .th-wrong { text-align: center; }
.res-prog.is-new { color: var(--ink-muted); }
.res-try { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; padding: 2px 8px; border-radius: var(--radius-sm); font-weight: 700; }
.res-try.is-1 { background: var(--ok-soft); color: var(--ok-ink); }
.res-try.is-2 { background: var(--warn-soft); color: var(--warn-ink, #7A4E0C); }
.res-try.is-bad { background: var(--bad-soft); color: var(--bad-ink); }
.res-try.is-zero { background: transparent; color: var(--ink-muted); font-weight: 600; }
.res-card .res-prog { margin-top: 4px; }
.res-card-row .res-try { font-size: 13px; }
.review-summary { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-size: 15px; }
@media (max-width: 720px) {
  .review-summary { align-items: flex-start; }
}
/* results as cards on phones */
.res-cards { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.res-card { position: relative; background: var(--paper); border: 1.5px solid var(--line); border-radius: var(--radius-md); padding: 12px 40px 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.res-card.is-link { cursor: pointer; }
.res-card.is-link:active { border-color: var(--primary); }
.res-card.is-active { border-color: var(--warn); background: color-mix(in oklab, var(--warn-soft) 40%, var(--paper)); }
.res-card.is-new { opacity: 0.75; padding-right: 14px; }
.res-card > .icon { position: absolute; right: 12px; top: 14px; color: var(--ink-muted); }
.res-card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.res-card-sub { font-size: 13px; }
.res-card-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 14px; margin-top: 4px; }
.res-card-row .btn { margin-left: auto; }

/* ---- legend (book page 3) ---- */
.legend { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-md); margin-bottom: 20px; box-shadow: var(--shadow-sm); }
.legend summary { display: flex; align-items: center; gap: 12px; padding: 14px 16px; cursor: pointer; font-weight: 800; list-style: none; min-height: 56px; }
.legend summary::-webkit-details-marker { display: none; }
.legend summary .icon { margin-left: auto; transition: transform 0.2s var(--ease); color: var(--ink-muted); }
.legend[open] summary .icon { transform: rotate(90deg); }
.legend-icon { width: 30px; height: 30px; border-radius: var(--radius-md); background: var(--primary-soft); color: var(--primary-ink); display: inline-flex; align-items: center; justify-content: center; font-family: var(--font-display); font-weight: 700; flex: none; }
.legend-body { padding: 4px 16px 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 18px 28px; border-top: 1px solid var(--line); }
.legend-list { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.legend-list > div { display: grid; grid-template-columns: 44px 1fr; gap: 10px; align-items: baseline; }
.legend-list dt { font-weight: 800; font-family: var(--font-display); font-size: 17px; }
.legend-list dd { margin: 0; color: var(--ink-soft); }
.legend-marks dt { font-family: var(--font-body); }
.legend-parents { grid-column: 1 / -1; background: var(--bg); border-radius: var(--radius-md); padding: 14px 16px; }
.legend-parents h3 { font-size: 16px; margin-bottom: 6px; }
.legend-parents ul { margin: 0; padding-left: 18px; color: var(--ink-soft); display: flex; flex-direction: column; gap: 4px; }
@media (max-width: 640px) { .legend-body { grid-template-columns: 1fr; } }

/* ---- page picker / legend extras ---- */
.page-select { min-height: 40px; border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--paper); padding: 0 14px; font-weight: 700; font-size: 14px; max-width: 260px; }
.page-select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(33, 71, 245, 0.2); }
.legend-page { color: var(--primary-deep); }
.legend-icon.small { width: 22px; height: 22px; border-radius: var(--radius-md); font-size: 13px; margin-right: 2px; }
.modal-wide { width: min(880px, 100%); max-height: 90vh; overflow: auto; }
.modal-wide .legend-body { border-top: 0; padding: 8px 0 0; }
h1 .btn { font-family: var(--font-body); vertical-align: middle; }
@media (max-width: 640px) { .page-nav { display: grid; grid-template-columns: 1fr 1fr; width: 100%; } .page-select { grid-column: 1 / -1; grid-row: 1; max-width: none; width: 100%; } }
/* modals may be rendered inside a heading (legend button) — reset inherited type */
.modal { font-family: var(--font-body); font-size: 16px; font-weight: 400; line-height: 1.5; letter-spacing: normal; text-align: left; }
.modal h3 { font-family: var(--font-display); font-size: 19px; font-weight: 600; }

/* link back to the public site */
.app-site { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-soft); font-weight: 700; font-size: 14px; text-decoration: none; padding: 6px 10px; border-radius: var(--radius-sm); min-height: 36px; }
.app-site:hover { background: var(--bg-alt); color: var(--ink); }

/* ---- touch devices: 16px inputs so iOS never auto-zooms (the page "jumping" sideways) ---- */
@media (max-width: 768px) {
  .ans-input, .expr-table .ans-input, .page-select, .input, select { font-size: 16px; }
  .ans-input { width: 72px; }
  .expr-table .ans-input { width: 74px; }
  .page-head { gap: 12px; margin-bottom: 14px; }
  .page-head .kicker { font-size: 11px; }
  h1 { font-size: 26px; }
  .app-main { padding: 18px 14px 72px; }
  .block-tag { font-size: 13px; }
  .table-scroll { border-radius: var(--radius-md); }
  .modal { padding: 18px; }
  .results-table th, .results-table td { padding: 8px; }
}

/* ---- phone layout for book pages (no horizontal scroll) ---- */
.col-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.col-card { background: var(--paper); border: 1px solid var(--line-strong); border-radius: var(--radius-md); padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.col-card-no { font-size: 12px; font-weight: 800; color: var(--primary); }
.col-terms { display: flex; flex-direction: column; align-items: flex-end; font-weight: 600; font-size: 17px; line-height: 1.4; padding-right: 4px; }
.col-terms > span { display: block; min-height: 1.4em; }
.col-terms > span:last-child { border-bottom: 2px solid var(--ink); padding-bottom: 2px; min-width: 60%; text-align: right; }
.col-terms .num-blank { width: 56px; height: 12px; }
.col-card-ans { display: flex; justify-content: flex-end; }
.col-card .ans-input { width: 100%; text-align: right; font-size: 18px; min-height: 46px; }
.col-card .ans-blank { width: 100%; height: 44px; }
.col-card .ans-result { width: 100%; align-items: flex-end; }
.expr-rows { display: flex; flex-direction: column; background: var(--paper); border: 1px solid var(--line-strong); border-radius: var(--radius-md); overflow: hidden; }
.expr-row { display: grid; grid-template-columns: 26px minmax(0, 1fr) 96px; align-items: center; gap: 8px; padding: 6px 10px 6px 12px; border-bottom: 1px solid var(--line); min-width: 0; }
.expr-row:last-child { border-bottom: 0; }
.expr-row .no { font-size: 12px; font-weight: 700; color: var(--ink-muted); }
.expr-row .expr { font-weight: 600; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.expr-row .ans-input { width: 100%; font-size: 17px; min-height: 44px; }
.expr-row .ans-blank { width: 100%; height: 40px; }
.expr-row .ans-result { width: 100%; }
.is-compact .page-foot { font-size: 13px; }

/* ---- teacher live view ---- */
.live-panel { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 16px; font-size: 14px; }
.live-panel .icon { vertical-align: -3px; }
.live-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 rgba(31, 157, 98, 0.5); animation: livepulse 1.6s infinite; }
@keyframes livepulse { 0% { box-shadow: 0 0 0 0 rgba(31, 157, 98, 0.5); } 70% { box-shadow: 0 0 0 8px rgba(31, 157, 98, 0); } 100% { box-shadow: 0 0 0 0 rgba(31, 157, 98, 0); } }
.live-hint { font-size: 13px; margin: -6px 0 14px; }
.ans-live-empty { display: inline-block; width: 64px; height: 36px; border-radius: var(--radius-md); border: 1.5px dashed var(--line-strong); background: var(--paper); vertical-align: middle; }
.expr-table .ans-live-empty { width: 56px; height: 32px; }
.col-card .ans-live-empty, .expr-row .ans-live-empty { width: 100%; height: 40px; }
.is-focus { outline: 3px solid var(--primary); outline-offset: 2px; animation: focuspulse 1.2s ease-in-out infinite; }
@keyframes focuspulse { 0%, 100% { outline-color: var(--primary); } 50% { outline-color: rgba(33, 71, 245, 0.35); } }
@media (max-width: 640px) { .live-panel { width: 100%; border-radius: var(--radius-md); } }

/* ---- stage 1: stars, homework, generator, progress, rating ---- */
.star { fill: var(--accent-3); stroke: #D99A1C; stroke-width: 1.2; stroke-linejoin: round; flex: none; }
.star.is-dim { fill: var(--bg-alt); stroke: var(--line-strong); }
.star-row { display: inline-flex; gap: 4px; align-items: center; }
.star-row.is-anim .star { animation: pop 0.5s var(--ease) both; }
.star-row.is-anim .star:nth-child(2) { animation-delay: 0.08s; } .star-row.is-anim .star:nth-child(3) { animation-delay: 0.16s; }
.star-row.is-anim .star:nth-child(4) { animation-delay: 0.24s; } .star-row.is-anim .star:nth-child(5) { animation-delay: 0.32s; }
@keyframes pop { 0% { transform: scale(0.3); opacity: 0; } 70% { transform: scale(1.18); opacity: 1; } 100% { transform: scale(1); } }
.star-chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: var(--radius-sm); background: #FFF4D6; color: #6B4A00; font-weight: 800; font-size: 13px; line-height: 1.2; white-space: nowrap; }
.star-chip.is-muted { background: var(--bg-alt); color: var(--ink-muted); }
.flame { color: var(--accent-2); display: inline-flex; }
.small { font-size: 13px; }
.space-between { justify-content: space-between; }
.link-btn { border: 0; background: transparent; padding: 0; font: inherit; font-size: 13px; font-weight: 700; color: var(--primary-deep); cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.is-good { color: var(--ok-ink); } .is-bad { color: var(--bad-ink); }

/* student home */
.stars-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.stars-cell { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 12px 10px; text-align: center; }
.stars-cell-v { display: flex; align-items: center; justify-content: center; gap: 6px; font-family: var(--font-display); font-weight: 700; font-size: 24px; line-height: 1.1; }
.stars-cell-l { font-size: 12px; font-weight: 700; color: var(--ink-muted); margin-top: 2px; }
.hw-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); padding: 18px 18px 14px; margin-bottom: 14px; display: flex; flex-direction: column; gap: 10px; }
.hw-card.is-late { border-color: color-mix(in oklab, var(--bad) 40%, var(--line)); }
.hw-card.is-past { opacity: 0.9; }
.hw-card.is-empty p { margin: 0; }
.hw-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.hw-head h2 { font-size: 20px; margin: 0; }
.hw-sub { margin: 0; font-size: 13px; color: var(--ink-soft); font-weight: 600; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.hw-items { display: flex; flex-direction: column; gap: 8px; }
.hw-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius-md); background: var(--bg); text-decoration: none; min-height: 52px; border: 1.5px solid transparent; transition: border-color 0.15s; }
.hw-item:hover { border-color: var(--primary); }
.hw-item.is-active { border-color: var(--primary); background: var(--paper); }
.hw-item-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.hw-item-title { font-weight: 800; font-size: 14px; }
.hw-item-sub { font-size: 12px; }
.hw-ico { width: 30px; height: 30px; border-radius: var(--radius-sm); display: inline-flex; align-items: center; justify-content: center; flex: none; font-weight: 800; font-size: 13px; }
.hw-ico.is-done { background: var(--ok-soft); color: var(--ok-ink); }
.hw-ico.is-active { background: var(--primary-soft); color: var(--primary-deep); }
.hw-ico.is-new { background: var(--bg-alt); color: var(--ink-muted); }
.hw-done { margin-bottom: 14px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.hw-done .hw-card { width: 100%; margin: 0; }

/* timed start card + countdown */
.start-card.is-timed { width: min(460px, 100%); text-align: center; }
.start-timed-icon { width: 68px; height: 68px; border-radius: var(--radius-sm); background: var(--primary-soft); color: var(--primary-deep); display: flex; align-items: center; justify-content: center; }
.start-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; }
.start-stats > div { background: var(--bg); border-radius: var(--radius-md); padding: 10px; display: flex; flex-direction: column; gap: 2px; }
.start-stats b { font-family: var(--font-display); font-size: 28px; line-height: 1; }
.start-stats small { font-size: 12px; font-weight: 700; color: var(--ink-muted); }
.start-rules { margin: 0; padding-left: 20px; text-align: left; font-size: 13px; color: var(--ink-soft); display: flex; flex-direction: column; gap: 6px; }
.solve-bar.is-timed .solve-timer { color: var(--primary-ink); }
.solve-bar.is-low .solve-timer { color: var(--bad); animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0.45; } }
.result-stars { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.result-stars-title { font-weight: 800; font-size: 14px; color: var(--ink-soft); }
.result-note { margin: 8px 0 0; padding: 8px 12px; border-radius: var(--radius-md); background: var(--primary-soft); color: var(--primary-ink); font-size: 14px; }
.result-note .icon { vertical-align: -2px; }

/* teacher home */
.teacher-nav { margin-bottom: 18px; }

/* tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tab { padding: 10px 16px; font-weight: 700; font-size: 15px; color: var(--ink-muted); text-decoration: none; border-bottom: 3px solid transparent; white-space: nowrap; }
.tab:hover { color: var(--ink); }
.tab.is-active { color: var(--ink); border-bottom-color: var(--primary); font-weight: 800; }

/* assign dialog */
.modal-wide { width: min(820px, 100%); max-height: calc(100vh - 32px); overflow: auto; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.modal-head h3 { margin: 0; }
.assign-body { display: grid; grid-template-columns: minmax(200px, 1fr) minmax(0, 2fr); gap: 18px; }
@media (max-width: 680px) { .assign-body { grid-template-columns: 1fr; } }
.assign-col { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.assign-col-head { display: flex; align-items: center; justify-content: space-between; font-size: 14px; }
.assign-students { display: flex; flex-direction: column; gap: 6px; max-height: 320px; overflow: auto; }
.assign-student { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--radius-md); background: var(--bg); cursor: pointer; min-height: 44px; font-size: 14px; }
.assign-student.is-on { background: var(--primary-soft); }
.assign-student input { width: 18px; height: 18px; accent-color: var(--primary); margin: 0; }
.assign-student-name { font-weight: 700; flex: 1; }
.assign-student .muted { font-size: 12px; }
.assign-warn { margin: 0; padding-left: 18px; font-size: 12px; color: #7A4A10; }
.assign-warn.is-info { color: var(--primary-ink); }
.assign-items { display: flex; flex-direction: column; gap: 8px; }
.assign-items > p { margin: 0; font-size: 14px; }
.assign-item { border: 1px solid var(--line); border-radius: var(--radius-md); padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; background: var(--paper); }
.assign-item.is-timed { border-color: var(--primary); }
.assign-item-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.assign-item-title { font-weight: 800; font-size: 14px; flex: 1 1 120px; }
.book-spine { width: 28px; height: 34px; border-radius: 2px; background: var(--primary); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-family: var(--font-display); font-weight: 700; font-size: 15px; flex: none; }
.book-spine.is-custom { background: var(--ink-muted); }
.book-spine.is-exam { background: var(--warn-ink, #7A4E0C); }
.assign-item-cond { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field-inline { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 700; color: var(--ink-muted); }
.field-inline .input { min-height: 40px; padding: 0 10px; }
.assign-add { display: flex; flex-direction: column; gap: 8px; padding-top: 6px; }
.assign-add-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto; gap: 8px; align-items: center; }
.assign-add-row:last-of-type { grid-template-columns: minmax(0, 1fr) auto; }
.assign-add-row .input { min-height: 40px; padding: 0 10px; }
.assign-add p, .assign-due p { margin: 0; }
.assign-due { border-top: 1px solid var(--line); padding-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.assign-due .field { max-width: 240px; }
.field-label, .field > span:first-child { display: block; font-size: 12px; font-weight: 700; color: var(--ink-muted); margin-bottom: 4px; }
.assign-foot { justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
@media (max-width: 520px) { .assign-add-row { grid-template-columns: 1fr; } .assign-item-cond { grid-template-columns: 1fr; } }

/* teacher homework tab */
.hw-tcard { display: flex; flex-direction: column; gap: 12px; }
.hw-tcard.is-current { border-color: var(--primary); }
.hw-tcard.is-late { border-color: color-mix(in oklab, var(--bad) 40%, var(--line)); }
.hw-tcard-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.hw-tcard-head .muted { font-size: 13px; }
.hw-tcard-progress { display: flex; align-items: center; gap: 12px; }
.hw-tcard-progress .progress { flex: 1; }
.hw-tcard-progress span { font-size: 13px; white-space: nowrap; }
.input-sm { min-height: 36px; padding: 4px 10px; width: auto; }
.hw-table td .badge .live-dot { margin-right: 4px; }
@media (max-width: 640px) { .hw-tcard-progress { flex-direction: column; align-items: stretch; } .hw-tcard-progress span { white-space: normal; } }

/* note editor */
.note-editor { display: flex; flex-direction: column; gap: 8px; margin: 0 0 16px; max-width: 720px; }
.note-label { display: flex; align-items: center; gap: 6px; font-weight: 800; font-size: 14px; }
.note-editor textarea { resize: vertical; min-height: 56px; line-height: 1.4; }
.note-editor .btn { align-self: flex-start; }

/* progress */
.seg button { min-height: 32px; }
.progress-controls { gap: 8px; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 760px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kpi { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; }
.kpi-l { font-size: 12px; font-weight: 700; color: var(--ink-muted); }
.kpi-v { font-family: var(--font-display); font-weight: 700; font-size: 28px; line-height: 1.1; }
.kpi-s { font-size: 12px; font-weight: 700; }
.charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.chart-card { margin: 0; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.chart-card figcaption, .chart-card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 15px; }
.chart-card .muted { font-size: 12px; }
.chart-card p { margin: 0; font-size: 13px; }
.chart { width: 100%; height: auto; display: block; }
.chart-grid { stroke: rgba(16, 36, 62, 0.08); stroke-width: 1; }
.chart-tick { fill: var(--ink-muted); font-size: 11px; font-family: var(--font-body); }
.chart-val { fill: var(--ink); font-size: 11px; font-weight: 700; font-family: var(--font-body); }
.chart-line { fill: none; stroke: var(--primary); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.chart-dot { fill: var(--primary); stroke: #fff; stroke-width: 2; }
.chart-hit { fill: transparent; }
.chart-pt:hover .chart-dot { r: 6.5; }
.chart-bar { fill: var(--primary); }
.chart-pt:hover .chart-bar { fill: var(--primary-deep); }
.type-bars { display: flex; flex-direction: column; gap: 10px; }
.type-bar { display: grid; grid-template-columns: minmax(110px, 150px) minmax(0, 1fr) 44px auto; gap: 10px; align-items: center; font-size: 14px; }
.type-bar-l { font-weight: 700; }
.type-bar-p { height: 12px; border-radius: 4px; }
.type-bar-p > span { border-radius: 4px; background: var(--primary); }
.type-bar-v { text-align: right; font-weight: 800; }
.type-bar-n { font-size: 12px; white-space: nowrap; }
@media (max-width: 520px) { .type-bar { grid-template-columns: minmax(0, 1fr) 44px; } .type-bar-l { grid-column: 1 / -1; } .type-bar-n { display: none; } }
.weak-list { display: flex; flex-direction: column; gap: 8px; }
.weak { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius-md); }
.weak.is-bad { background: var(--bad-soft); color: var(--bad-ink); }
.weak.is-warn { background: var(--warn-soft); color: #7A4A10; }
.weak-main { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 14px; }
.weak-main span { font-size: 12px; color: var(--ink-soft); }
/* a weak spot unfolds the pages with the mistakes */
.weak { flex-direction: column; align-items: stretch; gap: 0; padding: 0; }
.weak-head { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border: 0; background: transparent; font: inherit; color: inherit; text-align: left; cursor: pointer; border-radius: var(--radius-md); }
.weak-head > .icon:last-child { color: var(--ink-muted); transform: rotate(90deg); transition: transform 0.15s; }
.weak.is-open .weak-head > .icon:last-child { transform: rotate(-90deg); }
.weak-pages { list-style: none; margin: 0; padding: 0 12px 10px; display: flex; flex-direction: column; gap: 4px; }
.weak-pages a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: var(--radius-sm); background: rgba(255, 255, 255, 0.75); color: var(--ink); text-decoration: none; font-size: 14px; }
.weak-pages a:hover { background: #fff; }
.weak-pages a > span:first-child { flex: 1; font-weight: 700; }
.weak-pages a > .icon { color: var(--ink-muted); }
.weak-assign { padding-top: 6px; }
/* the review page: finish / reset */
.attempt-actions { gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.solve-end-note { margin: -6px 0 12px; }
/* settings: stacked cards, a row = label + one helper line on the left, the value or control on the right */
.setting-stack { display: flex; flex-direction: column; gap: 12px; max-width: 720px; }
.setting-card { padding: 16px 20px 4px; }
.setting-card-head { padding-bottom: 12px; }
.setting-card-title { margin: 0; font-size: 16px; font-weight: 700; }
.setting-card > .setting-card-title { padding-bottom: 12px; }
.setting-card-head .setting-help { margin-top: 2px; }
.setting-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; min-height: 56px; padding: 10px 0; border-top: 1px solid var(--line); }
.setting-main { flex: 1 1 120px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.setting-label { display: inline-flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 500; color: var(--ink); }
.setting-help { margin: 0; font-size: 13px; color: var(--ink-muted); }
.setting-value { margin-left: auto; font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.setting-value.is-empty { font-weight: 400; color: var(--ink-muted); }
.setting-control { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.setting-row > .voice-inline-switch { margin-left: auto; }
.setting-phone { width: 220px; }
@media (max-width: 480px) { .setting-phone { width: 170px; } }
.setting-info { position: relative; display: inline-flex; }
.setting-info-btn { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--ink-muted); cursor: help; }
.setting-info-btn:hover, .setting-info-btn:focus-visible, .setting-info.is-open .setting-info-btn { color: var(--primary); background: var(--primary-soft); outline: none; }
/* the bubble: under the «i», a small arrow pointing at it; a dark tooltip reads at a glance on the white card */
/* .setting-tip keeps the line break of its text: «Выключено: …» and «Включено: …» on lines of their own */
.setting-tip { position: absolute; z-index: 50; top: calc(100% + 8px); left: 50%; transform: translateX(-50%); width: max-content; max-width: min(320px, 80vw); padding: 10px 12px; border-radius: var(--radius-md); background: #1F2430; color: #fff; font-size: 13px; font-weight: 500; line-height: 1.45; white-space: normal; box-shadow: 0 10px 28px rgba(16, 36, 62, 0.22); animation: setting-tip-in 0.14s ease-out; }
/* its own entrance: the shared «rise» sets a transform of its own and dropped the centring for a frame (a jump from the right) */
@keyframes setting-tip-in { from { opacity: 0; transform: translate(-50%, 4px); } to { opacity: 1; transform: translate(-50%, 0); } }
.setting-tip::before { content: ''; position: absolute; top: -5px; left: 50%; width: 10px; height: 10px; background: #1F2430; transform: translateX(-50%) rotate(45deg); border-radius: 2px; }
/* a phone: the bubble spans the whole row under the label instead of hanging off the «i» past the screen edge */
@media (max-width: 640px) {
  .setting-row { position: relative; }
  .setting-info { position: static; }
  .setting-tip { left: 0; right: 0; top: calc(100% - 6px); transform: none; width: auto; max-width: none; animation-name: setting-tip-in-phone; }
  @keyframes setting-tip-in-phone { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
  .setting-tip::before { display: none; }
}
.setting-foot { margin: 8px 4px 0; }
/* the administrator edits a teacher's name and branch in place */
.teacher-branch { display: block; }
/* the administrator's view of a teacher: one card — avatar, name, «Изменить», then the details as tiles */
.teacher-card { padding: 20px 22px; margin-bottom: 8px; }
.teacher-card-head { display: flex; align-items: center; gap: 14px; }
.teacher-ava { width: 52px; height: 52px; flex: none; border-radius: 50%; background: var(--primary-soft); color: var(--primary-deep); display: inline-flex; align-items: center; justify-content: center; font-family: var(--font-display); font-size: 22px; font-weight: 700; }
.teacher-card-name { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.teacher-card-name h1 { margin: 0; font-size: 26px; line-height: 1.15; overflow-wrap: anywhere; }
.teacher-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 18px 0 0; }
.teacher-facts > div { padding: 10px 12px; border-radius: var(--radius-md); background: var(--bg); min-width: 0; }
.teacher-facts dt { font-size: 12px; font-weight: 700; color: var(--ink-muted); }
.teacher-facts dd { margin: 4px 0 0; font-weight: 700; font-size: 15px; overflow-wrap: anywhere; }
.teacher-facts dd.is-empty { color: var(--ink-muted); font-weight: 600; }
.teacher-facts dd a { color: inherit; text-decoration: none; }
.teacher-facts dd a:hover { color: var(--primary); }
.teacher-facts .pin-chip { min-height: 30px; padding: 3px 8px; font-size: 14px; }
.teacher-edit-dialog { width: min(420px, 100%); display: flex; flex-direction: column; gap: 12px; }
.teacher-edit-dialog .modal-head { margin-bottom: 0; }
.teacher-edit-dialog .field { display: flex; flex-direction: column; gap: 6px; }
.teacher-edit-dialog .modal-actions { margin-top: 6px; }
/* «Доступ к книгам» in the add / edit teacher dialogs */
.teacher-books-dialog { width: min(560px, 100%); max-height: calc(100dvh - 32px); overflow: auto; }
.books-access { display: flex; flex-direction: column; gap: 10px; }
.ba-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.ba-head .field-label, .ba-sub { font-weight: 700; font-size: 14px; color: var(--ink-soft); }
.ba-upto { display: flex; align-items: center; gap: 8px 10px; flex-wrap: wrap; }
.ba-chips { gap: 4px; }
.ba-chips .chip.ba-n { min-width: 34px; min-height: 34px; padding: 0 6px; justify-content: center; }
.ba-tools { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.ba-count { font-weight: 700; font-size: 14px; margin-right: auto; }
.ba-groups { display: flex; flex-direction: column; border: 1.5px solid var(--line); border-radius: var(--radius-md); }
.ba-group { display: grid; grid-template-columns: 112px 1fr; gap: 6px 8px; align-items: center; padding: 6px 10px; }
.ba-group + .ba-group { border-top: 1px solid var(--line); }
.ba-level { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; min-height: 34px; }
.ba-level input { width: 18px; height: 18px; accent-color: var(--primary); margin: 0; flex: none; }
.ba-group:not(.has-on) .ba-level b { color: var(--ink-soft); font-weight: 600; }
.ba-books { display: flex; flex-wrap: wrap; gap: 4px; }
.chip.ba-book { min-height: 32px; padding: 0 10px; font-size: 13px; gap: 4px; }
@media (max-width: 480px) {
  .ba-group { grid-template-columns: 1fr; gap: 2px; padding: 6px 8px 8px; }
  .ba-level { min-height: 30px; }
  .chip.ba-book { padding: 0 8px; }
  .chip.ba-book svg { display: none; }
  .ba-count { flex-basis: 100%; }
  .ba-tools .btn:nth-child(2) { padding-left: 0; }
}
.teacher-books-line { display: inline-flex; align-items: center; align-self: flex-start; gap: 6px; margin-top: 2px; }
@media (max-width: 640px) { .teacher-card { padding: 16px; } .teacher-card-head { flex-wrap: wrap; } .teacher-card-name h1 { font-size: 22px; } }

/* generator */
.gen-layout { display: grid; grid-template-columns: minmax(280px, 360px) minmax(0, 1fr); gap: 22px; align-items: start; }
@media (max-width: 900px) { .gen-layout { grid-template-columns: 1fr; } }
.gen-form { display: flex; flex-direction: column; gap: 14px; }
.gen-form .field { display: flex; flex-direction: column; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { min-height: 38px; padding: 0 14px; border-radius: var(--radius-sm); border: 1.5px solid var(--line-strong); background: var(--paper); font: inherit; font-weight: 700; font-size: 14px; cursor: pointer; display: inline-flex; align-items: center; }
.chip.is-on { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-ink); font-weight: 800; }
.chip.is-bonus { background: #FFF4D6; color: #6B4A00; border-color: transparent; }
.scale-card .chip { cursor: default; min-height: 32px; font-size: 13px; }
.scale-card { display: flex; flex-direction: column; gap: 8px; }
.check-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius-md); background: var(--bg); cursor: pointer; min-height: 44px; font-size: 14px; }
.check-row input { width: 18px; height: 18px; accent-color: var(--primary); margin: 0; }
.check-row .muted { font-size: 12px; }
.gen-actions { padding-top: 4px; }
.gen-actions .btn { flex: 1; }
.gen-preview .section-title { margin: 0; }
.gen-card { transition: opacity 0.2s; }
.gen-card.is-busy { opacity: 0.55; }
.custom-expr-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; }
.saved-pages { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.saved-page { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 12px 14px; }
.saved-page-main { display: flex; flex-direction: column; min-width: 0; flex: 1 1 200px; }
.saved-page-main a { text-decoration: none; }
.saved-page-main .muted { font-size: 12px; }

/* rating */
.podium { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: end; }
.podium.n1 { grid-template-columns: minmax(0, 320px); justify-content: center; }
.podium.n2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.podium-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 16px 12px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; font: inherit; color: inherit; cursor: pointer; transition: transform 0.15s var(--ease), box-shadow 0.15s; }
.podium-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.podium-card.place-1 { border: 1.5px solid var(--accent-3); box-shadow: var(--shadow-md); padding: 22px 12px; }
.podium-rank { width: 36px; height: 36px; border-radius: var(--radius-sm); display: inline-flex; align-items: center; justify-content: center; font-weight: 800; background: var(--bg-alt); }
.place-1 .podium-rank { background: var(--accent-3); width: 42px; height: 42px; font-size: 17px; }
.place-2 .podium-rank { background: #D6E6F7; }
.place-3 .podium-rank { background: #F0D9C9; }
.podium-card .student-avatar { width: 56px; height: 56px; font-size: 20px; }
.place-1 .student-avatar { width: 64px; height: 64px; font-size: 22px; }
.podium-name { font-size: 16px; }
.podium-stars { display: inline-flex; align-items: center; gap: 4px; font-family: var(--font-display); font-weight: 700; font-size: 26px; line-height: 1; }
.place-1 .podium-stars { font-size: 30px; }
@media (max-width: 480px) { .podium { gap: 6px; } .podium-card { padding: 12px 6px; } .podium-name { font-size: 14px; } .podium-card .student-avatar { width: 44px; height: 44px; font-size: 16px; } }
@media (max-width: 480px) { .tab { padding: 10px 10px; font-size: 14px; } }
@media (max-width: 640px) { .result-score { flex-direction: column; align-items: stretch; gap: 10px; } .result-stars { align-items: center; } .result-score h2 { font-size: 22px; } }

/* ---- stage 2/3: lesson, abacus, flash, board, trainers, report ---- */
.live-dot.big { width: 14px; height: 14px; }
.live-dot.is-off { background: var(--ink-muted); box-shadow: none; animation: none; }
.conn { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; text-transform: none; letter-spacing: 0; color: var(--ink-muted); }
.conn.is-open { color: var(--ok-ink); }
.conn.is-poll { color: #7A4A10; }
.members { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; }
.member-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: var(--radius-sm); background: var(--bg-alt); font-size: 13px; font-weight: 700; color: var(--ink-muted); }
.member-chip.is-online { background: var(--ok-soft); color: var(--ok-ink); }
.member-dot { width: 8px; height: 8px; border-radius: var(--radius-sm); background: var(--line-strong); display: inline-block; flex: none; }
.member-dot.is-online, .member-chip.is-online .member-dot { background: var(--ok); }
.members-edit { margin-top: 8px; max-height: 200px; }
.lesson-tabs .tab { display: inline-flex; align-items: center; gap: 6px; background: transparent; border: 0; border-bottom: 3px solid transparent; cursor: pointer; font: inherit; font-weight: 700; }
.lesson-panel { display: flex; flex-direction: column; gap: 14px; margin-bottom: 24px; }
/* the reactions: a toolbar under the tabs, in the flow — never over the answers or the history */
.reactions-bar { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: -6px 0 16px; padding: 8px 10px; background: var(--bg); border-radius: var(--radius-md); }
.reactions-label { font-size: 13px; font-weight: 700; margin-right: 2px; }
.reactions-to { min-width: 120px; }
.react-btn.is-great { color: #6B4A00; } .react-btn.is-think { color: var(--primary-deep); } .react-btn.is-stop { color: var(--bad-ink); } .react-btn.is-faster { color: var(--accent-2); }
.reaction-overlay { position: fixed; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center; gap: 14px; pointer-events: none; font-family: var(--font-display); font-weight: 700; font-size: clamp(32px, 7vw, 64px); animation: reaction 2.2s var(--ease) both; }
.reaction-overlay span { padding: 14px 30px; border-radius: var(--radius-md); background: var(--paper); box-shadow: var(--shadow-md); border: 3px solid currentColor; }
.reaction-overlay .icon { width: 1em; height: 1em; }
.reaction-overlay.is-great { color: #B8860B; } .reaction-overlay.is-think { color: var(--primary-deep); } .reaction-overlay.is-stop { color: var(--bad); } .reaction-overlay.is-faster { color: var(--accent-2); }
@keyframes reaction { 0% { opacity: 0; transform: scale(0.6); } 12% { opacity: 1; transform: scale(1.05); } 20% { transform: scale(1); } 85% { opacity: 1; } 100% { opacity: 0; } }
.lesson-banner { display: flex; align-items: center; gap: 12px; padding: 12px 16px; margin-bottom: 14px; border-radius: var(--radius-md); background: var(--primary); color: #fff; text-decoration: none; box-shadow: 0 6px 18px rgba(33, 71, 245, 0.32); }
.lesson-banner b { font-size: 16px; } .lesson-banner span:not(.live-dot) { flex: 1; font-size: 14px; opacity: 0.9; }
.lesson-banner .live-dot { background: #fff; box-shadow: 0 0 0 4px rgba(255,255,255,0.3); }

/* soroban (Soroban.jsx): a light frame with a thin rounded border, pale blue beads at rest, warm gold beads counted
   in, a thin beam. A bead is drawn at its resting place and its group slides by a CSS transform: a short spring when it
   moves (taps, drags, a new number in a card); prefers-reduced-motion stops it (the global rule above). */
.soroban {
  --bead-off: #DCE5FD; --bead-off-line: #B7C7F2; --bead-off-hover: #CCD9FC;
  --bead-on: #F3B23A; --bead-on-line: #D08F14; --bead-on-hover: #F6BE52;
  display: inline-flex; flex-direction: column; align-items: center; gap: 8px; max-width: 100%; min-width: 0;
}
.soroban-label { font-size: 12px; font-weight: 700; color: var(--ink-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.soroban svg { display: block; }
.soroban.is-playable { width: 100%; }
.soroban-scroll { max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
.sb-frame { stroke: #D3DCF1; stroke-width: 1.5; transition: stroke 0.25s, stroke-width 0.25s; }
.sb-wire { stroke: #C9D3EC; stroke-width: 1.5; stroke-linecap: round; }
.sb-wire.is-unit { stroke: rgba(33, 71, 245, 0.45); stroke-width: 2; }
.sb-beam { stroke: #8C9AC4; stroke-width: 2; stroke-linecap: round; }
.sb-unit-band { fill: var(--primary-soft-2); stroke: #DFE7FF; stroke-width: 1; }
.sb-dot { fill: #8C9AC4; }
.sb-dot.is-unit { fill: #fff; stroke: var(--primary); stroke-width: 2; }
.sb-unit-mark { fill: var(--primary); }
.sb-place { font-size: 10px; font-weight: 600; fill: var(--ink-faint); font-family: var(--font-body); letter-spacing: 0.02em; }
.soroban-sm .sb-place { font-size: 8px; }
.sb-place.is-unit { fill: var(--primary); font-weight: 800; }
.sb-place.is-neg { fill: #9AA5BF; }
.sb-bead { transition: transform 0.36s var(--spring); }
.sb-bead-in { transform-box: fill-box; transform-origin: center; transition: transform 0.12s var(--ease); }
.sb-bead.is-press .sb-bead-in { transform: scale(0.9); }
.sb-body { fill: var(--bead-off); stroke: var(--bead-off-line); stroke-width: 1; transition: fill 0.24s var(--ease), stroke 0.24s var(--ease); }
.sb-bead.is-on .sb-body { fill: var(--bead-on); stroke: var(--bead-on-line); }
.sb-sheen { pointer-events: none; }
.sb-shine { fill: #fff; opacity: 0.6; pointer-events: none; transition: opacity 0.24s; }
.sb-bead.is-on .sb-shine { opacity: 0.5; }
.sb-rod.is-rest .sb-body { fill: #E6ECFC; stroke: #C8D4F3; }
.sb-rod.is-rest .sb-bead.is-on .sb-body { fill: var(--bead-on); stroke: var(--bead-on-line); }
.soroban.is-readonly .sb-rod.is-rest .sb-body { fill: var(--bead-off); stroke: var(--bead-off-line); }
.soroban.is-readonly .sb-rod.is-rest .sb-bead.is-on .sb-body { fill: var(--bead-on); stroke: var(--bead-on-line); }
.soroban:not(.is-readonly) .sb-bead { cursor: pointer; }
.soroban:not(.is-readonly) .sb-rod.is-rest .sb-bead { cursor: default; }
@media (hover: hover) {
  .soroban:not(.is-readonly) .sb-rod:not(.is-rest) .sb-bead:hover .sb-body { fill: var(--bead-off-hover); }
  .soroban:not(.is-readonly) .sb-rod:not(.is-rest) .sb-bead.is-on:hover .sb-body { fill: var(--bead-on-hover); }
}
.sb-bead:focus-visible .sb-body { stroke: var(--primary); stroke-width: 2.5; }
.soroban-value { display: flex; gap: 4px; margin-bottom: 2px; }
.soroban-digit { min-width: 30px; padding: 2px 6px; border-radius: var(--radius-xs); background: var(--primary-soft); color: var(--primary-deep); font-family: var(--font-body); font-weight: 700; font-size: 26px; line-height: 1.2; text-align: center; transition: background 0.2s, color 0.2s; }
.soroban-digit.is-zero { color: #93A6E0; }
.soroban-lg .soroban-digit { min-width: 44px; font-size: 38px; padding: 4px 8px; border-radius: var(--radius-sm); }
.soroban-sm .soroban-digit { min-width: 20px; font-size: 16px; padding: 1px 3px; border-radius: 6px; }
.soroban.is-hit .sb-frame { stroke: var(--ok); stroke-width: 3; }
.soroban.is-hit .soroban-digit { background: var(--ok-soft); color: var(--ok-ink); }

.abacus-panel .abacus-teacher { display: flex; flex-direction: column; gap: 12px; }
.abacus-target { margin: 0; text-align: center; font-weight: 800; color: var(--primary-ink); }
.abacus-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.abacus-student { display: flex; flex-direction: column; gap: 8px; align-items: center; }
.abacus-student > .row { width: 100%; }
.abacus-student.is-offline { opacity: 0.6; }
.abacus-student-panel { align-items: center; }
.abacus-student-panel .card { display: flex; justify-content: center; width: 100%; }
.abacus-target-card { width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: var(--radius-md); background: var(--primary-soft); color: var(--primary-ink); }
.abacus-target-card b { font-family: var(--font-display); font-size: 26px; flex: 1; }
.abacus-target-card.is-hit { background: var(--ok-soft); color: var(--ok-ink); }

/* flash */
.flash-stage { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 160px; position: relative; }
.flash-stage.is-big { min-height: min(60vh, 420px); }
.flash-num { font-family: var(--font-display); font-weight: 700; font-size: clamp(56px, 14vw, 140px); line-height: 1; color: var(--ink); opacity: 0; transform: scale(0.9); }
.flash-num.is-on { opacity: 1; transform: scale(1); animation: flashpop 0.08s var(--ease); }
.flash-num.is-neg { color: var(--bad); }
.flash-stage:not(.is-big) .flash-num { font-size: 56px; }
@keyframes flashpop { from { transform: scale(0.85); } to { transform: scale(1); } }
.flash-wait { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.flash-count { font-family: var(--font-display); font-weight: 700; font-size: 56px; color: var(--primary-deep); line-height: 1; }
.flash-done { font-size: 18px; font-weight: 700; }
.flash-sum { font-size: 72px; font-weight: 800; line-height: 1; color: var(--ok); letter-spacing: -0.02em; animation: flashSum 0.25s var(--ease); }
.flash-stage.is-big .flash-sum { font-size: min(26vh, 200px); }
@keyframes flashSum { from { transform: scale(0.85); opacity: 0; } to { transform: none; opacity: 1; } }
.flash-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: var(--bg-alt); border-radius: var(--radius-sm); overflow: hidden; }
.flash-progress span { display: block; height: 100%; background: var(--primary); }
.flash-answer { display: flex; flex-direction: column; gap: 14px; align-items: center; padding: 10px 0; }
.flash-answer-row { display: flex; gap: 10px; justify-content: center; align-items: center; flex-wrap: wrap; }
/* on-screen keypad: answers without a keyboard */
.keypad { display: grid; grid-template-columns: repeat(3, 84px); gap: 10px; }
.keypad-key { height: 58px; border: 1.5px solid var(--line); border-radius: var(--radius-lg); background: var(--paper); box-shadow: 0 1px 2px rgba(16, 36, 62, 0.06); font-family: var(--font-body); font-size: 24px; font-weight: 700; color: var(--ink); cursor: pointer; user-select: none; -webkit-user-select: none; touch-action: manipulation; transition: background 0.1s, transform 0.08s, border-color 0.1s; display: inline-flex; align-items: center; justify-content: center; }
.keypad-key:hover { border-color: var(--line-strong); background: #FBFBFA; }
.keypad-key:active { transform: scale(0.96); background: var(--primary-soft); border-color: var(--primary); }
.keypad-key.is-text, .keypad-key.is-icon { border-color: transparent; background: transparent; box-shadow: none; font-size: 14px; font-weight: 600; color: var(--ink-muted); }
.keypad-key.is-text:hover, .keypad-key.is-icon:hover { color: var(--ink); background: var(--bg); }
.keypad-key:disabled { opacity: 0.5; cursor: not-allowed; }
/* a decimal answer: «,» stands where «Очистить» was, and «Очистить» gets a low row of its own */
.keypad-key.is-wide { grid-column: 1 / -1; height: 40px; }
@media (max-width: 400px) { .keypad { grid-template-columns: repeat(3, 1fr); width: 100%; } .keypad-key { height: 54px; } }
/* flash: the whole series at once, in a column */
.flash-col { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.04; font-family: var(--font-display); font-weight: 700; color: var(--ink-deep, var(--ink)); font-size: clamp(22px, calc(58vh / (var(--rows) + 0.6)), 110px); }
.flash-stage:not(.is-big) .flash-col { font-size: clamp(16px, calc(300px / (var(--rows) + 0.6)), 52px); }
.flash-col-num { padding: 0 0.1em; }
.flash-col-num.is-neg { color: var(--bad); }
.flash-col-num.is-cur { background: var(--primary-soft); border-radius: 8px; } /* the number being said */
/* trainer «Абакус» */
.read-stage { align-items: center; }
.read-beads { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 100%; }
.read-beads .abacus-read-bar { width: min(560px, 100%); }
.read-gone { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--paper); font-weight: 700; color: var(--ink-soft); }
.trainer-result .soroban { margin: 4px 0; }
.flash-input { width: 200px; min-height: 64px; font-size: 32px; font-weight: 800; text-align: center; }
.flash-params { display: flex; flex-direction: column; gap: 12px; }
.flash-meta { display: flex; gap: 14px; flex-wrap: wrap; font-size: 14px; margin: 8px 0; }
.flash-answers { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.flash-ans { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: var(--radius-md); background: var(--bg); font-size: 14px; }
.flash-ans.is-ok { background: var(--ok-soft); color: var(--ok-ink); } .flash-ans.is-bad { background: var(--bad-soft); color: var(--bad-ink); }
.flash-ans-name { font-weight: 800; flex: 1; }
.flash-ans-given { font-weight: 800; font-size: 16px; }
.flash-result { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; }
.flash-result-icon { width: 64px; height: 64px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; }
.flash-result.is-ok .flash-result-icon { background: var(--ok-soft); color: var(--ok-ink); } .flash-result.is-bad .flash-result-icon { background: var(--bad-soft); color: var(--bad-ink); }
.flash-result h2, .trainer-result h2 { margin: 0; }
.flash-result p { margin: 0; }

/* board */
.board { width: 100%; display: flex; flex-direction: column; gap: 8px; }
.board-canvas { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-md); touch-action: none; display: block; max-width: 100%; }
.board-canvas.can-draw { cursor: crosshair; }
.board-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.board-colors { display: flex; gap: 6px; }
.board-color { width: 28px; height: 28px; border-radius: var(--radius-sm); border: 3px solid transparent; cursor: pointer; }
.board-color.is-on { border-color: var(--accent-3); box-shadow: 0 0 0 2px #fff inset; }

/* live grid */
.live-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.live-card { display: flex; flex-direction: column; gap: 8px; }
.live-card.is-active { border-color: var(--warn); }
.live-card.is-link { cursor: pointer; }
.live-card-title { font-weight: 800; }
.live-card-row { display: flex; gap: 12px; font-size: 13px; flex-wrap: wrap; }
.live-card p { margin: 0; }

/* trainers */
.trainer-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-bottom: 6px; }
.trainer-card { display: flex; flex-direction: column; gap: 4px; padding: 14px; border-radius: var(--radius-md); background: var(--paper); border: 1.5px solid var(--line); text-decoration: none; transition: border-color 0.15s, transform 0.15s var(--ease); }
.trainer-card:hover { border-color: var(--primary); transform: translateY(-1px); }
.trainer-card-ico { width: 36px; height: 36px; border-radius: var(--radius-md); background: var(--primary-soft); color: var(--primary-deep); display: inline-flex; align-items: center; justify-content: center; margin-bottom: 4px; }
.trainer-kinds { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
@media (max-width: 760px) { .trainer-kinds { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.trainer-kind { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 8px; border-radius: var(--radius-md); background: var(--paper); border: 1.5px solid var(--line); font: inherit; cursor: pointer; text-align: center; color: inherit; }
.trainer-kind.is-on { border-color: var(--primary); background: var(--primary-soft); }
.trainer-kind b { font-size: 14px; }
@media (max-width: 520px) { .trainer-kinds { grid-template-columns: 1fr; } .trainer-kind { flex-direction: row; text-align: left; } .trainer-kind span { display: none; } }
.trainer-head { margin-bottom: 14px; }
.trainer-progress { display: flex; align-items: center; gap: 12px; font-size: 14px; font-weight: 700; }
.trainer-progress .progress { flex: 1; }
.trainer-stage { display: flex; flex-direction: column; align-items: center; gap: 14px; min-height: 280px; justify-content: center; }
.trainer-idle { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.trainer-result { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.trainer-result.is-ok { color: var(--ok-ink); } .trainer-result.is-bad { color: var(--bad-ink); }
.trainer-result p { margin: 0; color: var(--ink); }
.table-task { font-family: var(--font-display); font-weight: 700; font-size: clamp(44px, 10vw, 72px); line-height: 1; }
.table-feedback { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 800; }
.table-feedback.is-ok { color: var(--ok-ink); } .table-feedback.is-bad { color: var(--bad-ink); }
.formulas-stage { gap: 10px; }
.formula-task { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.formula-task b { font-family: var(--font-display); font-size: 40px; line-height: 1.1; }
.formulas-stage > .row { width: 100%; }
.formulas-legend { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.formulas-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.formulas-cols ul { margin: 4px 0 0; padding-left: 18px; font-size: 13px; display: flex; flex-direction: column; gap: 2px; }
@media (max-width: 520px) { .formulas-cols { grid-template-columns: 1fr; } }
.trainer-results { margin: 14px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; counter-reset: tr; }
.trainer-results li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto 20px; gap: 10px; align-items: center; padding: 8px 12px; border-radius: var(--radius-md); background: var(--paper); border: 1px solid var(--line); font-size: 14px; }
.trainer-results li.is-ok .icon { color: var(--ok); } .trainer-results li.is-bad .icon { color: var(--bad); }
.trainer-done { flex-direction: column; align-items: stretch; }
.assign-trainer-params { padding: 10px 12px; border-radius: var(--radius-md); background: var(--bg); }
.assign-item.is-trainer { border-style: dashed; }

/* report */
.report .page-head p { margin: 4px 0 0; }
.report-section { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.report-section h2 { margin: 0; font-size: 20px; }
.kpis-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 480px) { .kpis-3 { grid-template-columns: 1fr 1fr; } }
.report-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.report-list li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 12px; border-radius: var(--radius-md); background: var(--bg); font-size: 14px; }
.report-list li > span:first-child { flex: 1 1 120px; font-weight: 700; }
.report-notes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.report-notes li { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: var(--radius-md); background: var(--primary-soft); color: var(--primary-ink); font-size: 14px; }
.sb-bead:focus { outline: none; }

.gen-sections { display: flex; flex-direction: column; gap: 10px; }
.gen-section { border: 1px solid var(--line); border-radius: var(--radius-md); padding: 12px; display: flex; flex-direction: column; gap: 12px; background: var(--bg); }
.gen-section.is-bad { border-color: var(--bad); }
.gen-section-head { display: flex; align-items: center; gap: 8px; }
.gen-section-head b { flex: 1; }
.custom-blocks { display: flex; flex-direction: column; gap: 22px; }
.custom-blocks .custom-expr { max-width: 560px; }

/* assign dialog, step layout */
.modal-wide.assign { width: min(720px, 100%); padding: 22px 22px 16px; }
.asteps { display: flex; flex-direction: column; gap: 22px; }
.astep { display: flex; flex-direction: column; gap: 10px; }
.astep-head { display: flex; align-items: center; gap: 10px; }
.astep-head h4 { margin: 0; font-family: var(--font-body); font-size: 17px; font-weight: 800; flex: 1; }
.astep-no { width: 30px; height: 30px; border-radius: var(--radius-sm); background: var(--primary); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 14px; flex: none; }
.astudents { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.astudent { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius-md); border: 1.5px solid var(--line); background: var(--paper); cursor: pointer; min-height: 56px; font-size: 15px; }
.astudent input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.astudent .student-avatar { width: 36px; height: 36px; font-size: 15px; }
.astudent-name { font-weight: 800; flex: 1; }
.astudent > .icon { opacity: 0; color: var(--primary-deep); }
.astudent.is-on { border-color: var(--primary); background: var(--primary-soft); }
.astudent.is-on > .icon { opacity: 1; }
.astudent:focus-within { outline: 3px solid color-mix(in oklab, var(--primary) 70%, white); }
.aitems { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.aitem { border: 1.5px solid var(--line); border-radius: var(--radius-md); background: var(--paper); padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.aitem.is-timed { border-color: var(--primary); }
.aitem-row { display: flex; align-items: center; gap: 10px; }
.aitem-main { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 15px; }
.aitem-cond { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 10px; border-radius: var(--radius-md); background: var(--bg); }
.aitem-cond p { grid-column: 1 / -1; margin: 0; }
.aadd { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 60px; border-radius: var(--radius-md); border: 2px dashed var(--primary); background: var(--primary-soft); color: var(--primary-ink); font: inherit; font-weight: 800; font-size: 16px; cursor: pointer; }
.aadd:hover { background: color-mix(in oklab, var(--primary-soft) 80%, white); }
.apicker { border: 1.5px solid var(--primary); border-radius: var(--radius-md); background: var(--paper); overflow: hidden; }
.apicker-tabs { display: flex; gap: 4px; padding: 8px; background: var(--bg); border-bottom: 1px solid var(--line); align-items: center; }
.apicker-tab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 6px; border-radius: var(--radius-md); border: 1.5px solid transparent; background: transparent; font: inherit; font-weight: 700; font-size: 13px; cursor: pointer; color: var(--ink-soft); min-height: 60px; }
.apicker-tab.is-on { background: var(--paper); border-color: var(--primary); color: var(--primary-ink); }
.apicker-close { flex: none; }
.picker { padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.seg.big button { min-height: 40px; font-size: 14px; padding: 6px 16px; }
.page-pick { display: flex; flex-direction: column; gap: 8px; max-height: 300px; overflow: auto; padding-right: 4px; }
.page-pick-week { display: grid; grid-template-columns: 76px 1fr; gap: 8px; align-items: start; }
.page-pick-wk { font-size: 12px; font-weight: 800; color: var(--ink-muted); padding-top: 10px; }
.page-pick-nums { display: flex; flex-wrap: wrap; gap: 6px; }
.page-pick-btn { width: 44px; height: 40px; border-radius: var(--radius-md); border: 1.5px solid var(--line-strong); background: var(--paper); font: inherit; font-weight: 800; font-size: 15px; cursor: pointer; }
.page-pick-btn.is-home { background: var(--bg); }
.page-pick-btn.is-on { background: var(--primary); border-color: var(--primary); color: #fff; }
.page-pick-btn.is-used { opacity: 0.35; cursor: default; }
.pick-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.pick-list li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius-md); background: var(--bg); }
.pick-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.adue { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.adue-input { width: auto; min-width: 180px; }
.assign-foot .btn-lg { min-height: 52px; padding: 0 28px; }
@media (max-width: 640px) {
  .modal-backdrop.is-sheet { padding: 0; align-items: stretch; }
  .modal-wide.assign { width: 100%; max-height: 100vh; border-radius: 0; padding: 16px 14px; }
  .modal:not(.assign) { width: min(420px, calc(100% - 32px)); border-radius: var(--radius-md); padding: 22px 20px; }
  .modal:not(.assign) .modal-actions { gap: 8px; }
  .modal:not(.assign) .modal-actions .btn { flex: 1; }
  .page-pick-week { grid-template-columns: 1fr; gap: 4px; }
  .page-pick-wk { padding-top: 0; }
  .apicker-tab span { font-size: 12px; }
  .assign-foot { flex-direction: column; align-items: stretch; }
  .assign-foot .row { justify-content: stretch; }
  .assign-foot .row .btn { flex: 1; }
}
.saved-page { padding: 14px 18px; }
.saved-page-main b { font-size: 16px; }
.saved-page-main a:hover b { color: var(--primary-deep); }
.board-canvas.is-erasing { cursor: cell; }

.page-opener { display: flex; flex-direction: column; gap: 10px; }
.page-opener-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.page-opener-row .input { width: auto; min-width: 220px; flex: 1 1 220px; }
.page-open-now { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius-md); background: var(--ok-soft); color: var(--ok-ink); }
.page-open-main { flex: 1; display: flex; flex-direction: column; }
.page-open-title { align-self: flex-start; padding: 0; border: 0; background: none; font: inherit; font-weight: 700; color: inherit; text-align: left; cursor: pointer; text-decoration: underline; text-decoration-color: color-mix(in oklab, currentColor 35%, transparent); text-underline-offset: 3px; }
.page-open-title:hover { text-decoration-color: currentColor; }
.live-card-peek { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 13px; font-weight: 700; color: var(--primary-deep); }
.live-card.is-link:hover { border-color: var(--primary); }
.page-answers-modal { width: min(1180px, 100%); }
.book-switch { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 700; color: var(--ink-soft); }
.book-switch .page-select { min-width: 240px; }
@media (max-width: 640px) { .book-switch { width: 100%; } .book-switch .page-select { width: 100%; min-width: 0; } }
.page-answers-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.page-answers-head h3 { margin: 2px 0 0; }
.open-page-card { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; }
.open-page-card h2 { margin: 0; }
.hw-card.is-class { border-color: color-mix(in oklab, var(--primary) 30%, var(--line)); }
.live-card-done { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; padding-top: 6px; border-top: 1px dashed var(--line); }
.page-pick-tall { max-height: 420px; }
.apicker-tab .book-spine { width: 26px; height: 30px; font-size: 13px; }
.apicker-tabs { flex-wrap: wrap; }
.apicker-tab { flex: 1 1 160px; flex-direction: row; justify-content: center; min-height: 52px; font-size: 14px; }
.page-open-now .row { flex: none; }
.start-card.is-paused .start-timed-icon { background: var(--warn-soft); color: #7A4A10; }
.start-card.is-paused p { margin: 0; }
.is-paused .page-view { pointer-events: none; user-select: none; opacity: 0.6; }

/* lesson page opener: compact tabs, status marks in the grid */
.opener .apicker-tabs { justify-content: flex-start; gap: 6px; }
.opener .apicker-tab { flex: 0 1 auto; padding: 8px 14px; min-height: 44px; }
.opener .apicker-close { margin-left: auto; }
.opener .page-pick-btn { width: 50px; height: 44px; position: relative; }
.page-pick-btn.is-done { background: var(--ok-soft); border-color: var(--ok); color: var(--ok-ink); }
.page-pick-btn.is-active { background: var(--warn-soft); border-color: var(--warn); color: #7A4A10; }
.page-pick-btn.is-on { background: var(--primary); border-color: var(--primary); color: #fff; }
.page-pick-btn > .icon { position: absolute; top: 2px; right: 3px; }
.page-pick-btn .mini { position: absolute; bottom: 1px; right: 3px; font-size: 9px; font-weight: 800; }
.pick-legend { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.pick-legend i { display: inline-block; width: 16px; height: 14px; border-radius: 4px; border: 1.5px solid var(--line-strong); vertical-align: -2px; margin-right: 4px; background: var(--paper); }
.pick-legend i.is-home { background: var(--bg); }
.opener .picker { max-width: 760px; }
.opener .pick-legend i.page-pick-btn { width: 18px; height: 16px; min-width: 0; border-radius: 4px; position: static; }
.pick-legend span { display: inline-flex; align-items: center; gap: 4px; }
.hw-ico.is-paused { background: var(--info-soft); color: #2A4A80; }
.book-live.is-paused { color: #2A4A80; }

/* phones: lesson screens */
@media (max-width: 640px) {
  .reactions-bar { display: none; }
  .lesson .page-head { flex-direction: column; align-items: stretch; }
  .lesson .page-head .btn { align-self: flex-start; }
  .lesson-tabs { gap: 0; }
  .lesson-tabs .tab { padding: 10px 10px; font-size: 14px; }
  .lesson-panel { margin-bottom: 24px; }
  .flash-answers .flash-ans { flex-wrap: wrap; }
  .abacus-grid { grid-template-columns: 1fr; }
  .abacus-teacher .row.space-between { flex-direction: column; align-items: stretch; }
  .abacus-teacher form.row { flex-wrap: wrap; }
  .abacus-teacher form .input { flex: 1 1 120px; }
  .page-open-now { flex-wrap: wrap; }
  .page-open-now .row { width: 100%; }
  .page-open-now .row .btn { flex: 1; }
  .opener .apicker-tab { flex: 1 1 100%; justify-content: flex-start; }
  .opener .page-pick-btn { width: 44px; height: 40px; }
  .page-pick-week { grid-template-columns: 1fr; gap: 4px; }
  .page-pick-wk { padding-top: 0; }
  .live-grid { grid-template-columns: 1fr; }
  .board-tools { gap: 6px; }
  .hw-ico.is-new { background: var(--bg-alt); color: var(--ink-muted); }
}
.hw-ico.is-new { background: var(--bg-alt); color: var(--ink-muted); }

/* ================= shell: sidebar layout ================= */
.live-dot, .member-dot, .spinner, .login-art span { border-radius: 50%; }
.app-layout { display: flex; min-height: 100vh; }
.sidebar { width: var(--side-w); flex: none; position: sticky; top: 0; height: 100vh; height: 100dvh; /* the visible screen: on iPhone 100vh reaches under Safari's bottom bar */ display: flex; flex-direction: column; background: var(--paper); border-right: 1px solid var(--line); z-index: 30; }
.sidebar-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 14px 10px; }
.sidebar-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.sidebar-brand img { height: 30px; width: auto; }
.sidebar-brand b { font-family: var(--font-display); font-weight: 600; font-size: 17px; letter-spacing: -0.01em; }
.sidebar-role { margin: 0 14px 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-md); display: flex; align-items: center; gap: 10px; font-size: 13px; }
.sidebar-role .student-avatar { width: 26px; height: 26px; font-size: 12px; border-radius: var(--radius-sm); }
.sidebar-role-main { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.sidebar-role-main b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-role-main span { color: var(--ink-muted); font-size: 12px; }
.sidebar-nav { display: flex; flex-direction: column; gap: 2px; padding: 4px 8px; flex: 1; overflow: auto; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--radius-md); color: var(--ink-soft); text-decoration: none; font-size: 14px; font-weight: 500; min-height: 40px; }
.nav-item .icon { color: var(--ink-muted); flex: none; }
.nav-item:hover { background: var(--bg); color: var(--ink); }
.nav-item.is-active { background: var(--bg-alt); color: var(--ink); font-weight: 600; }
.nav-item.is-active .icon { color: var(--ink); }
.nav-item .nav-dot { margin-left: auto; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px rgba(30, 142, 90, 0.18); }
.nav-item .nav-badge { margin-left: auto; font-size: 11px; font-weight: 600; padding: 1px 6px; border-radius: var(--radius-sm); background: var(--primary-soft); color: var(--primary-ink); }
.nav-section { padding: 14px 10px 4px; font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-muted); }
.sidebar-foot { flex: none; border-top: 1px solid var(--line); padding: 10px 8px calc(12px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 2px; }
.sidebar-foot .lang-pill { margin: 6px 10px 2px; align-self: flex-start; }
.app-content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.app-tabbar { display: none; }
.lang-pill { padding: 2px; }
.lang-pill button { padding: 4px 10px; min-height: 28px; font-weight: 600; }
.lang-pill button.active { box-shadow: none; border: 1px solid var(--line-strong); }
.page-head { margin-bottom: 18px; }
.page-head h1 + p, .page-head .muted { font-size: 14px; }
.table-scroll { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--paper); }
.results-table th { background: var(--table-head); font-weight: 600; letter-spacing: 0.04em; color: var(--ink-muted); }
.student-row { border-width: 1px; }
.student-row:hover, .page-row:hover { transform: none; box-shadow: none; border-color: var(--line-strong); background: var(--primary-soft-2); }
.book-card:hover, .book-card:focus-visible { box-shadow: none; border-color: var(--line-strong); }
.page-row { border-width: 1px; }
.student-avatar { border-radius: var(--radius-sm); background: var(--bg-alt); color: var(--ink); }
.result-ring { border-radius: var(--radius-md); border-width: 2px; }
.empty-icon { border-radius: var(--radius-md); background: var(--bg-alt); color: var(--ink-soft); }
.toast { border-radius: var(--radius-md); background: var(--ink); }
.modal { border-radius: var(--radius-lg); box-shadow: var(--shadow-md); }
.count-pill { border-radius: var(--radius-sm); font-size: 12px; min-width: 24px; height: 22px; }
.kicker { color: var(--ink-muted); }
.aadd { border-width: 1px; background: var(--paper); color: var(--ink); }
.aadd:hover { background: var(--bg); }
.star-chip { background: #FBF3DC; color: #6B4A00; }
.hw-item:hover { border-color: var(--line-strong); }
.hw-item.is-active { border-color: var(--line-strong); }
.lesson-banner { box-shadow: none; background: var(--ink); }
.solve-bar { box-shadow: var(--shadow-sm); border-radius: var(--radius-lg); background: var(--paper); }
.result-card { box-shadow: none; }
.start-overlay { border-radius: var(--radius-lg); }
.start-card { box-shadow: var(--shadow-md); }
.week-title { top: 0; background: var(--bg); }
.teacher-nav { display: none; }
/* books index */
.books-list { display: flex; flex-direction: column; gap: 10px; }
.book-row { display: grid; grid-template-columns: 44px 1fr auto 20px; align-items: center; gap: 14px; padding: 14px 16px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg); text-decoration: none; }
.book-row:hover { border-color: var(--line-strong); background: var(--primary-soft-2); }
.book-spine.lg { width: 36px; height: 44px; font-size: 18px; }
.book-row-main { display: flex; flex-direction: column; min-width: 0; }
.book-row-main b { font-size: 16px; }
.book-row-main .progress { margin-top: 6px; height: 5px; max-width: 360px; }
.book-row-meta { font-size: 13px; color: var(--ink-muted); text-align: right; white-space: nowrap; }
.book-row-meta.has-names { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-soft); font-weight: 600; white-space: normal; max-width: 420px; text-align: left; }
.book-row-meta.has-names svg { flex: none; color: var(--ok); }
@media (max-width: 640px) {
  .book-row.with-access { grid-template-columns: 44px 1fr 20px; row-gap: 4px; }
  .book-row.with-access > .book-spine { grid-row: 1 / 3; }
  .book-row.with-access > .book-row-meta { grid-column: 2; grid-row: 2; justify-self: start; text-align: left; max-width: none; }
  .book-row.with-access > svg { grid-column: 3; grid-row: 1 / 3; }
}
.book-access h3 { display: flex; align-items: baseline; gap: 8px; }
.book-access h3 .muted { font-size: 14px; font-weight: 600; }
.book-access-names { display: flex; flex-wrap: wrap; gap: 8px; }
.book-access-names .access-chip { border-radius: var(--radius-md); height: 36px; padding: 0 12px; }
/* phones: top bar + drawer */
@media (max-width: 900px) {
  :root { --top-h: 56px; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; overscroll-behavior: contain; transform: translateX(-100%); transition: transform 0.2s var(--ease); box-shadow: none; width: min(300px, 86vw); }
  .sidebar.is-open { transform: none; box-shadow: var(--shadow-md); }
  /* a light, blurred veil instead of a dark one: Safari colours the status bar after the page's top edge, and a dark
     veil turned it grey (and left it grey after the menu closed); the page fades back, the menu stands on a shadow */
  .sidebar-scrim { position: fixed; inset: 0; background: rgba(245, 247, 255, 0.6); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); z-index: 29; animation: fade 0.18s; }
  .sidebar.is-open { box-shadow: 0 0 0 1px var(--line), 0 12px 40px rgba(22, 38, 42, 0.18); }
  .app-main { padding: 18px 14px 60px; }
  .app-main.centered { padding-top: 40px; }
  /* the tab bar at the bottom: four sections and the menu */
  .app-tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: grid; grid-template-columns: repeat(5, 1fr); background: var(--paper); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px)); }
  .tab-item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-width: 0; min-height: 50px; padding: 4px 2px; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--ink-muted); text-decoration: none; font: inherit; font-size: 11px; font-weight: 500; line-height: 1.2; cursor: pointer; -webkit-tap-highlight-color: transparent; }
  .tab-item .icon { stroke-width: 2; }
  .tab-item span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tab-item.is-active { color: var(--primary); font-weight: 600; }
  .tab-item.is-active .icon { stroke-width: 2.6; }
  .has-tabbar .app-main { padding-bottom: calc(90px + env(safe-area-inset-bottom, 0px)); }
  /* with the tab bar there is no top bar: the sticky strips (lesson bar, week titles) start at the very top */
  .has-tabbar { --top-h: 0px; }
  .has-tabbar .app-main { padding-top: calc(22px + env(safe-area-inset-top, 0px)); }
  .has-tabbar .toasts { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
}
@media (max-width: 480px) { .app-main { padding: 14px 12px 60px; } .has-tabbar .app-main { padding-bottom: calc(90px + env(safe-area-inset-bottom, 0px)); } }
/* held upright (a phone, a tablet in portrait) the menu slides in from the right, under the thumb of the right hand;
   in landscape it comes from the left, as the sidebar of a laptop stands */
@media (max-width: 900px) and (orientation: portrait) {
  .sidebar { left: auto; right: 0; transform: translateX(100%); border-right: 0; border-left: 1px solid var(--line); }
}
.hide-desktop { display: none; }
@media (max-width: 900px) { .hide-desktop { display: inline-flex; } }
.app-layout.no-shell .app-content .app-top { position: static; background: transparent; border: 0; justify-content: space-between; padding: 14px 20px; }
.sidebar-foot button.nav-item { background: transparent; border: 0; font: inherit; cursor: pointer; width: 100%; text-align: left; }
.login { margin: 0 auto; }
.app-layout.no-shell .app-content { align-items: center; }
.app-layout.no-shell .app-content > .app-top { width: 100%; max-width: 1200px; }

/* ---- student home: dashboard grid + compact homework ---- */
.home-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(300px, 2fr); gap: 24px; align-items: start; }
.home-aside .section-title:first-child { margin-top: 0; }
.home-aside .book-grid { grid-template-columns: 1fr; gap: 12px; }
.home-aside .book-card { padding: 16px 18px; gap: 8px; }
.home-aside .book-card h2 { font-size: 17px; }
.home-aside .trainer-cards { grid-template-columns: 1fr; gap: 8px; }
.home-aside .trainer-card { flex-direction: row; align-items: center; gap: 12px; padding: 10px 12px; border-width: 1px; color: var(--ink-muted); }
.home-aside .trainer-card:hover { transform: none; border-color: var(--line-strong); background: var(--primary-soft-2); }
.trainer-card-main { display: flex; flex-direction: column; flex: 1; min-width: 0; color: var(--ink); }
.trainer-card-main b { font-size: 14px; }
.hw-block { padding: 16px 18px; display: flex; flex-direction: column; gap: 0; }
.hw-block > .hw-head { margin-bottom: 4px; }
.hw-block.is-empty p { margin-top: 6px; }
.hw-group { padding: 12px 0 14px; border-top: 1px solid var(--line); }
.hw-group:first-of-type { border-top: 0; }
.hw-group-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.hw-group-count { font-weight: 600; font-size: 13px; }
.hw-group.is-past { opacity: 0.85; }
.hw-item { padding: 8px 10px; }
.hw-item-title { font-weight: 600; }
.hw-ico { width: 28px; height: 28px; }
.hw-done .hw-block { padding-top: 4px; }
@media (max-width: 1100px) { .home-grid { grid-template-columns: 1fr; } .home-aside .section-title:first-child { margin-top: 26px; } }

/* ---- trainer run: focus screen ---- */
.app-main.trainer { max-width: 1000px; display: flex; flex-direction: column; min-height: calc(100vh - var(--top-h)); padding-bottom: 24px; }
.trainer-head-row { display: flex; align-items: center; gap: 14px; }
.trainer-head-row .back-link { margin: 0; }
.trainer-head-row .kicker { margin: 0; }
.app-main.trainer .trainer-stage { flex: 1; min-height: max(420px, calc(100vh - 230px)); }
.app-main.trainer .flash-stage.is-big { flex: 1; align-self: stretch; min-height: 0; }
.app-main.trainer .flash-num { font-size: clamp(120px, 34vh, 360px); }
.app-main.trainer .flash-count { font-size: 96px; }
.app-main.trainer .flash-input { width: 280px; min-height: 84px; font-size: 44px; }
.app-main.trainer .flash-answer .btn { min-height: 84px; font-size: 20px; padding: 0 28px; }
.app-main.trainer .table-task { font-size: clamp(64px, 14vh, 140px); }
.app-main.trainer .trainer-idle .muted { font-size: 16px; }
@media (max-width: 900px) { .app-main.trainer .trainer-stage { min-height: max(360px, calc(100vh - 220px)); } .app-main.trainer .flash-num { font-size: clamp(96px, 26vh, 200px); } }

.flash-stage { container-type: inline-size; }
.app-main.trainer .flash-num { font-size: min(34vh, calc(150cqw / var(--flash-len, 3)), 360px); }
@media (max-width: 900px) { .app-main.trainer .flash-num { font-size: min(26vh, calc(150cqw / var(--flash-len, 3)), 200px); } }
/* in a lesson the number is big but not the whole screen: a child reads it at arm's length */
.flash-stage.is-big .flash-num { font-size: min(26vh, calc(110cqw / var(--flash-len, 3)), 220px); }
@media (max-width: 900px) { .flash-stage.is-big .flash-num { font-size: min(20vh, calc(120cqw / var(--flash-len, 3)), 150px); } }
.hw-all { display: inline-flex; align-items: center; gap: 4px; margin-top: 12px; align-self: flex-start; font-weight: 600; font-size: 14px; color: var(--primary-deep); text-decoration: none; min-height: 36px; }
.hw-all:hover { text-decoration: underline; }
.hw-card.is-class .hw-items + .hw-all { margin-top: 10px; }
.hw-card.is-class { display: flex; flex-direction: column; }

/* ---- administrator: teachers ---- */
.teacher-row { display: grid; grid-template-columns: 48px 1fr auto auto; align-items: center; gap: 14px; padding: 12px 16px; min-height: 72px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.teacher-row.is-admin { background: var(--primary-soft-2); }
.teacher-row .student-name { font-size: 16px; font-weight: 600; gap: 8px; }
.teacher-row-actions { gap: 2px; flex-wrap: nowrap; }
@media (max-width: 900px) {
  .teacher-row { grid-template-columns: 40px 1fr auto; }
  .teacher-row-actions { grid-column: 1 / -1; justify-content: flex-end; flex-wrap: wrap; }
}
.lang-pill button { padding: 4px 9px; }
@media (max-width: 480px) { .lang-pill button { padding: 4px 7px; font-size: 12px; } }

/* ---- homework dialog: whose progress colours the page picker ---- */
.afocus { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; margin: 2px 0 4px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-md); }
.afocus-label { font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-muted); }
.afocus-chips { display: flex; gap: 6px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; min-width: 0; flex: 1; }
.afocus-chips::-webkit-scrollbar { display: none; }
.afocus-chip { display: inline-flex; align-items: center; gap: 8px; flex: none; padding: 5px 10px 5px 5px; border: 1px solid var(--line-strong); border-radius: var(--radius-md); background: var(--paper); font: inherit; font-size: 14px; color: var(--ink-soft); cursor: pointer; }
.afocus-chip:hover { border-color: var(--ink-muted); }
.afocus-chip.is-on { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-ink); font-weight: 600; }
.afocus-ava { width: 24px; height: 24px; display: grid; place-items: center; border-radius: var(--radius-sm); background: var(--bg-alt); color: var(--ink); font-size: 12px; font-weight: 700; }
.afocus-chip.is-on .afocus-ava { background: var(--primary); color: #fff; }
.afocus-count { font-size: 12px; font-weight: 700; padding: 1px 6px; border-radius: var(--radius-sm); background: var(--paper); color: var(--ok-ink); border: 1px solid color-mix(in oklab, var(--ok) 35%, transparent); }
.afocus-empty { display: flex; align-items: center; gap: 8px; margin: 2px 0 4px; padding: 10px 12px; border: 1px dashed var(--line-strong); border-radius: var(--radius-md); font-size: 13.5px; color: var(--ink-muted); }
.page-pick-btn { position: relative; }
.page-pick-btn:disabled { cursor: not-allowed; }
.page-pick-btn.is-assigned { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.page-pick-btn .pp-dot { position: absolute; top: 4px; right: 4px; width: 6px; height: 6px; border-radius: 50%; background: var(--primary); }
.page-pick-btn.is-on .pp-dot { background: #fff; }
.page-pick-btn.is-on > .icon { color: #fff; }
.page-pick-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--ink-muted); }
.page-pick-legend span { display: inline-flex; align-items: center; gap: 6px; }
.page-pick-legend i.page-pick-btn { width: 14px; height: 14px; padding: 0; display: inline-block; border-width: 1.5px; cursor: default; }
.assign-warn-inline { display: flex; align-items: flex-start; gap: 8px; margin: 0; padding: 9px 12px; border-radius: var(--radius-md); background: var(--ok-soft); color: var(--ok-ink); font-size: 13.5px; }
.assign-warn-inline .icon { flex: none; margin-top: 2px; }
.pick-mark { display: inline-block; margin-top: 4px; font-size: 12.5px; font-weight: 600; }
.pick-mark.is-done { color: var(--ok-ink); }
.pick-mark.is-active { color: #7A4A10; }
.pick-mark.is-assigned { color: var(--primary-ink); }

/* lesson stopwatch */
.lesson-timer { display: inline-flex; align-items: center; gap: 6px; margin-left: 6px; padding: 3px 10px; border-radius: var(--radius-sm); background: var(--bg-alt); color: var(--ink-soft); font-family: var(--font-body); font-size: 15px; font-weight: 600; letter-spacing: 0; }
/* homework: how many stars can still be earned */
.hw-earn { display: flex; align-items: center; gap: 6px; margin: -2px 0 8px; font-size: 13px; color: #6B4A00; }
.hw-earn .star-icon, .hw-earn svg { color: var(--accent-3, #E3A51B); flex: none; }
.hw-earn.is-late { color: var(--ink-muted); }
.hw-upto { font-size: 12px; font-weight: 600; color: #8A6A1F; white-space: nowrap; margin-right: 4px; }
@media (max-width: 480px) { .hw-upto { display: none; } }

/* ---- student home v2: aligned columns, section headers outside cards ---- */
.home-grid { align-items: start; }
.home-main > .section-head:first-child, .home-aside > .section-title:first-child { margin-top: 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 26px 0 12px; }
.section-head .section-title { margin: 0; }
.section-meta { font-size: 13px; color: var(--ink-muted); white-space: nowrap; }
.section-hint { display: flex; align-items: center; gap: 6px; margin: -4px 0 10px; font-size: 13px; color: #6B4A00; }
.section-hint svg { flex: none; }
.hw-block { padding: 6px 16px 12px; }
.hw-group { padding: 12px 0; }
.hw-group-head { gap: 10px; flex-wrap: nowrap; }
.hw-group-count { white-space: nowrap; }
.hw-group-bar { flex: 1; min-width: 40px; height: 6px; border-radius: 3px; background: var(--bg-alt); overflow: hidden; }
.hw-group-bar > span { display: block; height: 100%; background: var(--ok); border-radius: 3px; }
.hw-max { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: var(--radius-sm); background: #FBF3DC; color: #6B4A00; font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.hw-max.is-late { background: var(--bg-alt); color: var(--ink-muted); }
.hw-earn.is-late { margin: 0 0 8px; }
.hw-upto { display: none; }
.home-aside .book-card { box-shadow: none; }
@media (max-width: 480px) { .hw-group-head { flex-wrap: wrap; } .hw-group-bar { flex-basis: 100%; order: 5; } }

/* ---- teacher «Главная»: lesson card, students, books, my pages ---- */
.dash .page-head { margin-bottom: 20px; }
/* lesson card «Небо»: pale brand blue fading to white, navy text, solid blue button, the abacus in its own column */
.dash-lesson {
  --sky-ink: #0F2A55; --sky-text: #41597D; --sky-line: #D3E1F5;
  position: relative; overflow: hidden; isolation: isolate;
  display: grid; grid-template-columns: minmax(0, 1fr) clamp(150px, 26%, 270px); grid-template-areas: "main art" "btn art";
  column-gap: 48px; row-gap: 20px; align-items: start;
  padding: 28px 40px 28px 32px;
  border: 1px solid var(--sky-line); border-radius: var(--radius-lg);
  background: radial-gradient(120% 140% at 0% 0%, #DCE8FA 0%, rgba(220, 232, 250, 0) 60%), linear-gradient(110deg, #E6EFFC 0%, #F1F6FE 48%, #FFFFFF 100%);
  color: var(--sky-ink);
}
.dash-lesson.is-loading { min-height: 228px; background: var(--bg-alt); border-color: var(--line); }
.dash-lesson-main { grid-area: main; position: relative; z-index: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; max-width: 580px; }
.dash-lesson-kicker { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--primary-deep); }
.dash-lesson h2 { margin: 2px 0 0; font-family: var(--font-display); font-size: 32px; font-weight: 600; line-height: 1.12; letter-spacing: -0.01em; color: var(--sky-ink); }
.dash-lesson p { margin: 0; font-size: 15px; line-height: 1.5; color: var(--sky-text); }
.dash-acts, .dash-members { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 0; padding: 0; list-style: none; }
.dash-acts li { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border: 1px solid var(--sky-line); border-radius: var(--radius-sm); background: rgba(255, 255, 255, 0.85); font-size: 13px; color: var(--sky-ink); }
.dash-acts li .icon { color: var(--primary); }
.dash-lesson-btn { grid-area: btn; justify-self: start; position: relative; z-index: 1; display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 54px; padding: 0 26px; border-radius: var(--radius-md); background: var(--primary); color: #fff; font-size: 16px; font-weight: 700; text-decoration: none; white-space: nowrap; box-shadow: 0 1px 2px rgba(15, 42, 85, 0.14), 0 6px 14px -6px rgba(33, 71, 245, 0.55); transition: background 0.15s, transform 0.15s var(--ease); }
.dash-lesson-btn:hover { background: var(--primary-deep); }
.dash-lesson-btn:active { transform: translateY(1px); }
.dash-lesson-btn:focus-visible { outline: 3px solid var(--sky-ink); outline-offset: 3px; }
/* the abacus: an illustration in its own column, never under the text or the button (shows 2 0 2 6 1 0 5) */
.dash-abacus { grid-area: art; align-self: center; position: relative; width: 100%; height: auto; pointer-events: none; }
.dash-abacus rect { fill: rgba(255, 255, 255, 0.6); stroke: rgba(33, 71, 245, 0.28); stroke-width: 2; }
.dash-abacus .beam { stroke: rgba(33, 71, 245, 0.28); stroke-width: 2; }
.dash-abacus .rod { stroke: rgba(33, 71, 245, 0.2); stroke-width: 1.5; }
.dash-abacus path:not(.rod):not(.beam) { fill: rgba(33, 71, 245, 0.2); }
.dash-abacus path.on:not(.rod):not(.beam) { fill: var(--accent-3); }
/* live */
.dash-lesson.is-live .dash-lesson-kicker { color: var(--ok-ink); }
.dash-lesson .live-dot { background: var(--ok); }
.dash-lesson .lesson-timer { margin-left: 4px; padding: 1px 8px; border: 1px solid var(--sky-line); background: #fff; color: var(--sky-ink); font-size: 13px; letter-spacing: 0; }
/* «Войти в урок» stays the same blue as «Создать урок» (the kicker and the dot show that the lesson is live) */
.dash-members li { display: inline-flex; align-items: center; gap: 7px; padding: 3px 10px 3px 3px; border: 1px solid var(--sky-line); border-radius: var(--radius-sm); background: rgba(255, 255, 255, 0.85); font-size: 13px; color: var(--sky-text); }
.dash-members li.is-on { color: var(--sky-ink); }
.dash-members .dash-ava { position: relative; width: 22px; height: 22px; font-size: 11px; background: var(--primary-soft); color: var(--primary-deep); }
.dash-members li.is-on .dash-ava::after { content: ""; position: absolute; right: -3px; bottom: -3px; width: 9px; height: 9px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 2px #fff; }
.dash-members .dash-more-n { padding: 3px 10px; }
.dash-member-name { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 900px) {
  .dash-lesson { grid-template-columns: 1fr; grid-template-areas: "main" "btn"; row-gap: 18px; padding: 22px 20px 20px; }
  .dash-lesson h2 { font-size: 26px; padding-right: 84px; }
  .dash-lesson-kicker { flex-wrap: wrap; row-gap: 6px; padding-right: 84px; }
  .dash-lesson .lesson-timer { margin-left: 0; }
  .dash-lesson-btn { justify-self: stretch; }
  /* small, whole abacus in the top-right corner; the heading keeps clear of it */
  .dash-abacus { position: absolute; top: 18px; right: 16px; width: 72px; }
}
@media (prefers-reduced-motion: reduce) { .dash-lesson .live-dot { animation: none; } }

.dash-grid { margin-top: 26px; }
.dash-grid .home-main > .section-head:first-child { margin-top: 0; }
.dash-head { align-items: center; flex-wrap: wrap; min-height: 34px; }
.dash-grid .home-aside > .section-head:first-child { margin-top: 0; }
.dash-head-actions { gap: 6px; }
.dash-card { display: flex; flex-direction: column; padding: 6px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.dash-card > .error-box { margin: 6px; }
.dash-card > .stack { padding: 8px; }
.dash-rows { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
.dash-rows li + li { border-top: 1px solid var(--line); }
.dash-row { display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 10px; border-radius: var(--radius-md); color: var(--ink); text-decoration: none; transition: background 0.12s; }
.dash-row:hover { background: var(--bg); }
.dash-row:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.dash-row > .icon:last-child { flex: none; color: var(--ink-muted); }
.dash-ava { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: var(--radius-sm); background: var(--bg-alt); color: var(--ink); font-family: var(--font-display); font-size: 16px; font-weight: 700; }
.dash-row-main { flex: 1; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.dash-row-main b { overflow: hidden; font-size: 15px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.dash-row-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; }
.dash-row-sub .badge { font-size: 12px; }
.dash-tile { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: var(--radius-sm); background: var(--primary-soft); color: var(--primary-deep); }
.dash-rank { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: var(--radius-sm); background: var(--bg-alt); color: var(--ink-soft); font-size: 15px; font-weight: 700; }
.dash-rank.place-1 { background: #FBF0CF; color: #6B4A00; }
.dash-rank.place-2 { background: #ECEFF3; color: #3F4A57; }
.dash-rank.place-3 { background: #F6E5D8; color: #7A4520; }
.dash-card .book-spine { width: 28px; height: 34px; margin: 0 3px; font-size: 14px; }
.dash-all { display: inline-flex; align-items: center; align-self: flex-start; gap: 4px; min-height: 36px; margin: 2px 10px 4px; color: var(--primary-deep); font-size: 14px; font-weight: 600; text-decoration: none; }
.dash-all:hover { text-decoration: underline; }
.dash-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 8px 6px; border-top: 1px solid var(--line); }
.dash-foot .dash-all { margin: 0; }
.dash-empty { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: 14px; }
.dash-empty p, .dash-empty-text { margin: 0; color: var(--ink-muted); font-size: 14px; line-height: 1.5; }
.dash-empty-text { padding: 10px 10px 12px; }
.dash-grid .section-head { margin-top: 24px; }
.dash-grid .section-head .section-title { margin: 0; }
@media (max-width: 1100px) { .dash-grid .home-aside > .section-head:first-child { margin-top: 6px; } }
@media (max-width: 480px) {
  .dash-lesson p { font-size: 14px; }
  .dash-row { gap: 10px; padding: 9px 8px; }
  .dash-row .star-chip { font-size: 12px; padding: 2px 7px; }
}

/* ---- teacher: new lesson, same «Sky» look as the lesson card on «Главная» ---- */
.lesson-new-main { max-width: 1120px; } /* as wide as the history card under it */
.lesson-new { --sky-ink: #0F2A55; --sky-text: #41597D; --sky-line: #D3E1F5; padding: 24px 28px; border: 1px solid var(--sky-line); border-radius: var(--radius-lg); background: radial-gradient(120% 140% at 0% 0%, #DCE8FA 0%, rgba(220, 232, 250, 0) 60%), linear-gradient(110deg, #E6EFFC 0%, #F1F6FE 48%, #FFFFFF 100%); color: var(--sky-ink); }
.lesson-new-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.lesson-new-head h2 { margin: 0; font-family: var(--font-display); font-size: 24px; font-weight: 600; line-height: 1.2; color: var(--sky-ink); }
.lesson-new-head .link-btn { font-size: 14px; white-space: nowrap; }
.lesson-new-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; max-height: 450px; margin: -6px; padding: 6px; overflow: auto; list-style: none; }
.lesson-pick { position: relative; display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 10px 12px; border: 1px solid var(--sky-line); border-radius: var(--radius-md); background: rgba(255, 255, 255, 0.85); cursor: pointer; user-select: none; transition: border-color 0.12s, box-shadow 0.12s, background 0.12s; }
.lesson-pick:hover { border-color: #A9C3EA; background: #fff; }
.lesson-pick.is-on { border-color: var(--primary); background: #fff; box-shadow: inset 0 0 0 1px var(--primary), 0 4px 12px -6px rgba(33, 71, 245, 0.45); }
.lesson-pick input { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none; }
.lesson-pick:has(input:focus-visible) { outline: 2px solid var(--primary); outline-offset: 3px; }
.lesson-pick .dash-ava { background: var(--primary-soft); color: var(--primary-deep); transition: background 0.12s, color 0.12s; }
.lesson-pick.is-on .dash-ava { background: var(--primary); color: #fff; }
.lesson-pick-main { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.lesson-pick-main b { overflow: hidden; font-size: 15px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.lesson-pick-main span { overflow: hidden; font-size: 12.5px; color: var(--sky-text); text-overflow: ellipsis; white-space: nowrap; }
.lesson-pick-check { flex: none; display: grid; place-items: center; width: 22px; height: 22px; border: 1.5px solid #A9C3EA; border-radius: 50%; background: #fff; color: transparent; transition: background 0.12s, border-color 0.12s; }
.lesson-pick.is-on .lesson-pick-check { border-color: var(--primary); background: var(--primary); color: #fff; }
.lesson-new-empty { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; color: var(--sky-text); }
.lesson-new-empty p { margin: 0; }
.lesson-new-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--sky-line); }
.lesson-new-count { font-size: 14px; color: var(--sky-text); }
.lesson-start-btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 54px; padding: 0 28px; border: 0; border-radius: var(--radius-md); background: var(--primary); color: #fff; font: inherit; font-size: 16px; font-weight: 700; white-space: nowrap; cursor: pointer; box-shadow: 0 1px 2px rgba(15, 42, 85, 0.14), 0 6px 14px -6px rgba(33, 71, 245, 0.55); transition: background 0.15s, transform 0.15s var(--ease); }
.lesson-start-btn:hover:not(:disabled) { background: var(--primary-deep); }
.lesson-start-btn:active:not(:disabled) { transform: translateY(1px); }
.lesson-start-btn:focus-visible { outline: 3px solid var(--sky-ink); outline-offset: 3px; }
.lesson-start-btn:disabled { background: #B9CDEC; box-shadow: none; cursor: not-allowed; }
.lesson-start-btn .spinner { border-color: rgba(255, 255, 255, 0.35); border-top-color: #fff; }
@media (max-width: 640px) {
  .lesson-new { padding: 18px 16px; }
  .lesson-new-head h2 { font-size: 20px; }
  .lesson-new-grid { grid-template-columns: 1fr; max-height: none; }
  .lesson-new-foot { flex-direction: column-reverse; align-items: stretch; text-align: center; }
}

/* soroban: beads can be dragged (press and move), so touch gestures on an interactive abacus must not scroll the page */
.soroban:not(.is-readonly) svg { touch-action: none; user-select: none; -webkit-user-select: none; }
.soroban:not(.is-readonly) .sb-bead { cursor: grab; }
.soroban:not(.is-readonly) .sb-bead:active { cursor: grabbing; }

/* ---- lesson abacus: tasks «Набери число» / «Прочитай абакус» ---- */
.abacus-task { display: flex; flex-direction: column; gap: 12px; }
.abacus-task-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.abacus-mode button { padding: 7px 14px; font-size: 14px; font-weight: 600; }
.abacus-rods { display: flex; align-items: center; gap: 8px; }
.abacus-task-hint { margin: 0; }
.abacus-task-controls { display: flex; align-items: flex-end; gap: 14px 20px; flex-wrap: wrap; }
.abacus-task-controls .field { gap: 6px; }
.digit-seg button { min-width: 36px; }
.abacus-task-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.abacus-own { flex-wrap: nowrap; }
.abacus-own .input { width: 170px; }
.abacus-now { display: flex; align-items: center; gap: 8px 14px; flex-wrap: wrap; padding: 12px 16px; border-radius: var(--radius-md); background: var(--primary-soft); color: var(--primary-ink); }
.abacus-now .kicker { margin: 0; color: inherit; opacity: 0.75; }
.abacus-now b { font-family: var(--font-display); font-size: 26px; line-height: 1.1; }
.abacus-now-meta { flex: 1; font-size: 14px; }
.abacus-now.is-read { background: var(--ok-soft); color: var(--ok-ink); }
.abacus-now .abacus-read-number { font-family: var(--font-body); font-size: 40px; font-weight: 800; letter-spacing: 0.02em; color: var(--ok); }
.abacus-read-teacher { display: grid; grid-template-columns: minmax(0, 3fr) minmax(260px, 2fr); gap: 12px; align-items: start; }
.abacus-read-board { display: flex; justify-content: center; }
.abacus-read-student .flash-answer { justify-content: center; }
@media (max-width: 900px) { .abacus-read-teacher { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .abacus-own { flex: 1 1 100%; } .abacus-own .input { flex: 1; width: auto; } .abacus-task-actions { width: 100%; } .abacus-task-actions > .btn { flex: 1; } }

/* lesson header: student chips open the student's profile */
.member-chip.is-link { text-decoration: none; cursor: pointer; transition: box-shadow 0.12s, background 0.12s; }
.member-chip.is-link:hover { box-shadow: inset 0 0 0 1px currentColor; }
.member-chip.is-link:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.member-chip.is-link .icon { opacity: 0.55; margin-left: -2px; }

/* student lesson abacus: «Как двигать косточки» — video + tips, can be hidden */
.abacus-help, .abacus-student-panel .abacus-help { display: grid; grid-template-columns: minmax(0, 420px) minmax(0, 1fr); justify-content: stretch; gap: 18px; align-items: start; padding: 14px; }
.abacus-help-video { display: block; width: 100%; aspect-ratio: 16 / 9; border-radius: var(--radius-md); background: #EEF2F7; object-fit: contain; }
.abacus-help-main { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.abacus-help-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.abacus-help-head h3 { margin: 0; font-size: 17px; }
.abacus-help-tips { display: flex; flex-direction: column; gap: 8px; margin: 0; padding-left: 18px; font-size: 14.5px; line-height: 1.45; color: var(--ink-soft); }
.abacus-help-show { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; padding: 6px 12px; border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); background: var(--paper); font: inherit; font-size: 13.5px; font-weight: 600; color: var(--primary-deep); cursor: pointer; }
.abacus-help-show:hover { border-style: solid; border-color: var(--primary); }
@media (max-width: 760px) { .abacus-help, .abacus-student-panel .abacus-help { grid-template-columns: 1fr; } }

/* student result: how long the answer took */
.flash-time { display: inline-flex; align-items: center; gap: 6px; margin: 2px 0 0; padding: 4px 12px; border-radius: var(--radius-sm); background: var(--bg-alt); font-size: 15px; font-weight: 700; color: var(--ink-soft); }

/* teacher watching a page in class: the answer key sits in the empty cells */
.ans-live-empty.has-key { display: inline-flex; align-items: center; justify-content: center; border-style: solid; border-color: var(--line); background: var(--bg); }
.ans-livekey { font-size: 13px; font-weight: 700; color: var(--ink-muted); }
.check-row.is-inline { margin: 0; padding: 4px 8px; width: auto; }
.abacus-help-media { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.abacus-help-hide { align-self: stretch; justify-content: center; }

/* ================= «Sky» pass: blue primary actions, blue nav, roomier empty states ================= */
/* the SabaqLab look: primary actions are blue everywhere (they were black before the redesign); the live-lesson strip is green */
.btn-primary:focus-visible { outline: 3px solid rgba(33, 71, 245, 0.3); outline-offset: 2px; }
.nav-item.is-active { background: var(--primary); color: #fff; font-weight: 600; box-shadow: 0 4px 12px -7px rgba(25, 69, 239, 0.5); }
.nav-item.is-active .icon { color: #fff; }
.nav-item:hover:not(.is-active) { background: var(--bg-alt); }
.lesson-banner { background: var(--primary); box-shadow: none; }
.toast { background: var(--ink); }
.tab.is-active { color: var(--primary-ink); border-bottom-color: var(--primary); }
.lang-pill button.active { border-color: var(--primary); color: var(--primary-ink); }
.page-pick-btn.is-on, .chip.is-on, .apicker-tab.is-on .book-spine { background: var(--primary); color: #fff; }

/* empty states: air between the icon, the title, the text and the button */
.empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 44px 20px 40px; border-style: solid; border-color: var(--line); }
.empty-icon { width: 64px; height: 64px; margin-bottom: 8px; border-radius: var(--radius-md); background: var(--primary-soft); color: var(--primary-deep); }
.empty h3 { margin: 0; font-size: 18px; }
.empty p { margin: 0; max-width: 460px; line-height: 1.55; }
.empty .btn { margin-top: 14px; }

/* «Урок идёт» strip on every page */
.lesson-bar { position: sticky; top: var(--top-h); z-index: 19; display: flex; align-items: center; gap: 10px; padding: 4px 32px; background: var(--ok-soft); border-bottom: 1px solid #C9E5D5; color: var(--ok-ink); font-size: 13px; min-height: 36px; }
.lesson-bar .btn-sm { min-height: 28px; padding: 3px 10px; font-size: 13px; }
.lesson-bar b { font-weight: 700; }
.lesson-bar .lesson-timer { margin: 0; padding: 1px 8px; background: #fff; color: var(--ok-ink); font-size: 13px; }
.lesson-bar .spacer { flex: 1; }
.lesson-bar .lesson-bar-note { opacity: 0.8; } /* on the page the teacher opened: a note in place of the button */
.lesson-bar .btn-primary { background: var(--ok); border-color: var(--ok); box-shadow: none; }
.lesson-bar .btn-primary:hover:not(:disabled) { background: var(--ok-ink); border-color: var(--ok-ink); }
@media (max-width: 900px) { .lesson-bar { padding: 8px 14px; } }
@media (max-width: 480px) { .lesson-bar b { display: none; } }

/* rating: leaders as a clean row of cards */
.rating-range { margin: -4px 0 4px; }
.rating-top { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.rating-top-card { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--paper); font: inherit; color: var(--ink); text-align: left; cursor: pointer; transition: border-color 0.12s, box-shadow 0.12s; }
.rating-top-card:hover { border-color: var(--primary); box-shadow: 0 4px 14px -8px rgba(33, 71, 245, 0.45); }
.rating-top-card .dash-ava { width: 40px; height: 40px; font-size: 17px; }
.rating-top-rank { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: var(--radius-sm); background: var(--bg-alt); color: var(--ink-soft); font-size: 14px; font-weight: 800; }
.place-1 .rating-top-rank { background: #FBF0CF; color: #6B4A00; }
.place-2 .rating-top-rank { background: #ECEFF3; color: #3F4A57; }
.place-3 .rating-top-rank { background: #F6E5D8; color: #7A4520; }
.rating-top-card.place-1 { border-color: #F1D98C; background: linear-gradient(90deg, #FFFBEF, var(--paper) 60%); }
.rating-top-main { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.rating-top-main b { overflow: hidden; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.rating-top-main .muted { font-size: 12.5px; }
.rating-top-stars { display: inline-flex; align-items: center; gap: 4px; font-size: 22px; font-weight: 800; color: var(--ink); }
@media (max-width: 760px) { .rating-top { grid-template-columns: 1fr; } }

.picker-head { margin-bottom: 10px; }

/* ---- colour balance: one blue action per block, everything else quiet ----
   Rows (homework, classwork) are themselves the link: their buttons are white with a border and turn blue only on
   hover. Icons in tiles are neutral. The live-lesson banner is green like the «Урок идёт» strip everywhere else. */
.hw-item .btn-primary { background: var(--paper); border-color: var(--line-strong); color: var(--ink); box-shadow: none; }
.hw-item:hover .btn-primary, .hw-item .btn-primary:hover { background: var(--primary); border-color: var(--primary); color: #fff; }
.hw-ico.is-active, .hw-ico.is-paused { background: var(--bg-alt); color: var(--ink-soft); }
.book-live, .book-live.is-paused { color: var(--ink-soft); font-weight: 600; }
.trainer-card-ico { background: var(--bg-alt); color: var(--ink-soft); }
.home-aside .trainer-card:hover .trainer-card-ico { background: var(--primary-soft); color: var(--primary-deep); }
.progress > span { background: var(--primary); }
.lesson-banner { background: var(--ok-soft); color: var(--ok-ink); border: 1px solid #C9E5D5; }
.lesson-banner .live-dot { background: var(--ok); box-shadow: 0 0 0 4px rgba(30, 142, 90, 0.18); }
.lesson-banner span:not(.live-dot) { opacity: 1; color: var(--ok-ink); }
.lesson-banner .icon { color: var(--ok-ink); }
.hw-all, .dash-all { color: var(--ink-soft); }
.hw-all:hover, .dash-all:hover { color: var(--primary-deep); }
.section-meta { color: var(--ink-muted); }

/* trainers (student): the chosen kind is outlined blue, like the settings tabs */
.app-main.trainer-setup .trainer-kind.is-on { border-color: var(--primary); background: var(--primary-soft-2); box-shadow: inset 0 0 0 1px var(--primary); }
.app-main.trainer-setup .trainer-kind.is-on .trainer-kind-ico, .app-main.trainer-setup .trainer-kind.is-on .icon { color: var(--primary); }

/* generator: the name is required — the field turns red when «Сохранить» is pressed without it */
.field.is-invalid .input { border-color: var(--bad); box-shadow: 0 0 0 4px rgba(201, 70, 61, 0.15); }
.field-error { font-size: 13px; font-weight: 600; color: var(--bad-ink); }
.gen-save-hint { margin: -4px 0 0; }

/* homework / classwork rows: a page that is started shows how much of it is filled in */
.hw-item-bar { display: block; width: min(100%, 220px); height: 4px; margin-top: 5px; border-radius: 2px; background: var(--bg-alt); overflow: hidden; }
.hw-item-bar > span { display: block; height: 100%; border-radius: 2px; background: var(--primary); }
/* a disabled «Сохранить» must not swallow the click: the wrapper explains what is missing */
.gen-save-wrap .btn:disabled { pointer-events: none; }

/* students list: presence dot on the avatar (green = the cabinet is open right now, grey = not) */
.student-row { overflow: visible; }
.student-avatar.has-presence { position: relative; }
.student-avatar.has-presence::after { content: ""; position: absolute; right: -4px; bottom: -4px; width: 12px; height: 12px; border-radius: 50%; background: var(--line-strong); box-shadow: 0 0 0 2px var(--paper); }
.student-avatar.has-presence.is-online::after { background: var(--ok); }
.is-online-text { display: inline-flex; align-items: center; gap: 6px; color: var(--ok-ink); }
.is-online-text .live-dot { width: 8px; height: 8px; }

/* dashboard student rows: presence dot + «в сети / был в сети» before the homework status */
.dash-ava.has-presence { position: relative; }
.dash-ava.has-presence::after { content: ""; position: absolute; right: -3px; bottom: -3px; width: 10px; height: 10px; border-radius: 50%; background: var(--line-strong); box-shadow: 0 0 0 2px var(--paper); }
.dash-ava.has-presence.is-online::after { background: var(--ok); }
.dash-presence { color: var(--ink-muted); }
.dash-presence.is-online { color: var(--ok-ink); font-weight: 600; }
.dash-sep { color: var(--line-strong); }

/* dashboard section titles and the teachers list link to their sections */
.section-link, .teacher-link { color: inherit; text-decoration: none; }
.section-link:hover, .teacher-link:hover { color: var(--primary-deep); text-decoration: underline; text-underline-offset: 3px; }

/* parent report: the teacher's share bar on top (parents never see it) */
.report-share { display: flex; flex-direction: column; gap: 10px; margin-bottom: 22px; padding: 18px 20px 20px; background: linear-gradient(110deg, #E6EFFC 0%, #F1F6FE 48%, #FFFFFF 100%); border: 1px solid #D3E1F5; border-radius: var(--radius-lg); }
.report-share-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.report-share-head .back-link { margin: 0; }
.report-share h2 { margin: 4px 0 0; font-family: var(--font-display); font-size: 22px; color: #0F2A55; }
.report-share > p { margin: 0; }
.report-share-url { display: flex; gap: 8px; align-items: stretch; }
.report-share-url .input { flex: 1; min-width: 0; min-height: 44px; padding: 8px 12px; font-size: 14px; color: var(--ink-soft); background: var(--paper); }
.report-share-url .btn { flex: none; min-height: 44px; }
.report-share-actions { gap: 8px; }
.btn-wa-app { background: #25D366; border-color: #25D366; color: #fff; }
.btn-wa-app:hover { background: #1EBE5A; border-color: #1EBE5A; color: #fff; }
@media (max-width: 520px) { .report-share-url { flex-direction: column; } .report-share-url .btn { width: 100%; } .report-share-actions .btn, .report-share-actions .btn-wa-app { flex: 1; justify-content: center; } }

/* generator opened from the homework dialog: a note that the draft is kept */
.gen-assign-note { display: flex; align-items: flex-start; gap: 8px; margin: -6px 0 14px; padding: 10px 12px; border-radius: var(--radius-md); background: var(--primary-soft); color: var(--primary-ink); font-size: 13.5px; }
.gen-assign-note .icon { flex: none; margin-top: 2px; }

/* level 11+: ragged column blocks (cells below a shorter column) and 2-section ×÷√ pages */
.book-table .td-void { background: transparent; }

/* administrator: upload a workbook PDF */
.book-upload { display: flex; flex-direction: column; gap: 14px; margin-top: 18px; padding: 18px 20px 20px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.book-upload-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.book-upload h2 { margin: 0; font-family: var(--font-display); font-size: 20px; }
.book-upload-form { display: grid; grid-template-columns: 120px 1fr; gap: 12px 14px; align-items: end; }
.book-upload-form .field { display: flex; flex-direction: column; gap: 6px; }
.book-upload-form .field > span { font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.book-upload-form .input { min-height: 44px; }
.book-upload-drop { grid-column: 1 / -1; display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 76px; padding: 14px; border: 2px dashed var(--line-strong, #C9D3E3); border-radius: var(--radius-md); background: var(--bg); color: var(--ink-soft); cursor: pointer; text-align: center; transition: border-color .15s, background .15s; }
.book-upload-drop:hover, .book-upload-drop.is-over { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-ink); }
.book-upload-drop.has-file { border-style: solid; border-color: var(--ok, #2E7D32); background: #F1F8F2; color: var(--ink); }
.book-upload-drop input { display: none; }
.book-upload-actions { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.book-upload-status { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: var(--radius-md); font-size: 14px; }
.book-upload-status.is-running { background: var(--primary-soft); color: var(--primary-ink); }
.book-upload-status.is-done { background: #EAF6EC; color: #1B5E20; }
.book-upload-status.is-error { background: #FDECEC; color: #8A1C1C; }
.book-upload-status .icon { flex: none; margin-top: 1px; }
.book-upload-status ul { margin: 6px 0 0; padding-left: 18px; }
.book-upload-status .spin { animation: book-spin 1s linear infinite; }
@keyframes book-spin { to { transform: rotate(360deg); } }
.book-upload-steps { margin: 0; padding-left: 18px; color: var(--ink-soft); font-size: 13.5px; display: flex; flex-direction: column; gap: 2px; }
@media (max-width: 520px) { .book-upload-form { grid-template-columns: 1fr 1fr; } }

/* lesson history: series × students */
.lesson-history { display: flex; flex-direction: column; gap: 10px; }
.lesson-history-title { margin: 0; font-size: 16px; }
.history-table { width: 100%; }
.history-table th { text-align: left; white-space: nowrap; }
.history-table .hist-series { display: flex; align-items: baseline; gap: 8px; white-space: nowrap; min-width: 120px; }
.history-table td.hist-series { display: table-cell; }
.history-table td.hist-series b { margin-right: 8px; }
.hist-cell { white-space: nowrap; font-weight: 700; }
.hist-cell .icon { vertical-align: -2px; margin-right: 4px; }
.hist-cell.is-ok { color: var(--ok-ink); background: var(--ok-soft); } .hist-cell.is-bad { color: var(--bad-ink); background: var(--bad-soft); } .hist-cell.is-none { color: var(--ink-faint, #9AA3B2); text-align: center; }
.hist-given { margin-right: 6px; text-decoration: line-through; opacity: 0.8; }
.hist-sec { font-weight: 500; opacity: 0.85; }
.hist-total { white-space: nowrap; } .hist-total b { display: block; } .hist-total .muted { font-size: 12.5px; }
.history-table tfoot td { background: var(--bg); border-top: 2px solid var(--line); }

/* «read the abacus» with a show timer */
.abacus-now-timer { font-weight: 700; font-size: 14px; }
.abacus-now.is-hidden { background: var(--primary-soft); color: var(--primary-ink); }
.abacus-now.is-hidden .abacus-read-number { color: var(--primary); }
.abacus-read-board.is-hidden { opacity: 0.45; }
.abacus-read-left { font-weight: 800; font-size: 20px; }
.abacus-read-bar { height: 6px; margin-top: 10px; border-radius: 3px; background: var(--line); overflow: hidden; width: 100%; }
.abacus-read-bar span { display: block; height: 100%; background: var(--primary); }
.timer-bar-run { width: 100%; animation-name: timer-bar; animation-timing-function: linear; animation-fill-mode: both; }
@keyframes timer-bar { from { width: 100%; } to { width: 0%; } }
.abacus-read-student .card { flex-direction: column; align-items: center; }
.abacus-read-gone { gap: 10px; color: var(--ink-soft); font-size: 16px; font-weight: 600; flex-direction: row !important; }
.abacus-read-hint { margin: 0; }
.abacus-read-waiting { min-height: 160px; align-items: center; }

/* lesson history: desktop numbers do not stretch the table; phone cards */
.history-table .hist-nums { display: inline; white-space: normal; }
.history-table td.hist-series { text-align: left; width: 60%; }
.history-table .hist-series { white-space: normal; }
.hist-cards { display: flex; flex-direction: column; gap: 10px; }
.hist-total-card { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border-radius: var(--radius-md); background: var(--bg); font-size: 14px; }
.hist-total-line { display: flex; justify-content: space-between; gap: 10px; }
.hist-total-line .hist-name { font-weight: 700; }
.hist-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.hist-item { display: flex; flex-direction: column; gap: 6px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-md); }
.hist-item-head { display: flex; align-items: baseline; gap: 10px; font-size: 15px; }
.hist-item-head > b { min-width: 22px; }
.hist-series-head { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hist-series-head > b .muted { font-weight: 500; font-size: 13px; }
.hist-series-nums { font-size: 13.5px; line-height: 1.5; word-break: break-word; }
.hist-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.hist-chip { display: inline-flex; align-items: center; gap: 4px; padding: 5px 10px; border-radius: 999px; background: var(--bg); font-size: 13.5px; font-weight: 700; }
.hist-chip .hist-name { margin-right: 2px; }
.hist-chip.is-ok { background: var(--ok-soft); color: var(--ok-ink); } .hist-chip.is-bad { background: var(--bad-soft); color: var(--bad-ink); } .hist-chip.is-none { color: var(--ink-faint, #9AA3B2); }
.hist-chip .icon { vertical-align: -2px; }

/* result views: a skipped problem is a quiet dash, no answer key */
.ans-result.is-skip { background: var(--bg); color: var(--ink-faint, #9AA3B2); }

/* planned end of the lesson */
.ends-in { margin-left: 4px; padding: 1px 8px; border-radius: 999px; background: var(--bg); color: var(--ink-soft); font-size: 13px; font-weight: 600; }
.ends-in.is-soon { background: var(--bad-soft); color: var(--bad-ink); }
.end-soon { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; }
.end-soon h2 { margin: 0; font-family: var(--font-display); font-size: 24px; }
.end-soon p { margin: 0; }
.end-soon-clock { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; background: var(--bad-soft); color: var(--bad-ink); font-weight: 800; font-size: 20px; }
.end-soon-actions { justify-content: center; gap: 8px; margin-top: 4px; }
.end-soon-actions .btn { flex: 1; }

/* past lessons */
.past-list-main { padding-top: 0; }
/* the history sits right under the «Новый урок» block: no page padding between the two mains, a short gap only */
.lesson-new-main { padding-bottom: 8px; }
.past-list-main .dash-head { margin-top: 10px; }
/* the lesson screen: the last lessons as a home-style card (rows parted by lines, «Все уроки ›» at the foot) */
.past-list-main .section-title, .app-main .dash-head + .dash-card { margin-top: 0; }
.past-lessons.in-card { gap: 0; }
.past-lessons.in-card .past-lesson { border: 0; border-top: 1px solid var(--line); border-radius: 0; padding: 12px 10px; }
.past-lessons.in-card li:first-child .past-lesson { border-top: 0; }
.past-lessons.in-card .past-lesson:hover { background: var(--bg); }
/* the history screen: the pager with a box to jump to a page */
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; }
.pager .btn.pager-next span { display: inline-flex; align-items: center; gap: 2px; }
.pager-pick { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; }
@media (max-width: 480px) { .pager-pick > span:first-child { display: none; } }
/* phone: the three sections of the «Задания» tab as a row of chips */
.sub-tabs { display: none; }
@media (max-width: 900px) {
  .sub-tabs { display: flex; gap: 6px; margin: -4px 0 16px; overflow-x: auto; scrollbar-width: none; }
  .sub-tabs::-webkit-scrollbar { display: none; }
  .sub-tab { flex: 1 1 auto; justify-content: center; white-space: nowrap; min-height: 36px; padding: 0 10px; border-radius: var(--radius-sm); border: 1.5px solid var(--line-strong); background: var(--paper); color: var(--ink-soft); font-weight: 600; font-size: 13px; text-decoration: none; display: inline-flex; align-items: center; }
  .sub-tab.is-active { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-ink); font-weight: 700; }
}
.past-section { display: flex; flex-direction: column; gap: 10px; margin-top: 22px; }
.past-section h2 { display: flex; align-items: center; gap: 8px; margin: 0; font-family: var(--font-display); font-size: 20px; }
.past-section > .muted.small { margin: -4px 0 0; }
.past-lessons { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.past-lesson { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--paper); color: inherit; text-decoration: none; }
.past-lesson:hover { border-color: var(--primary); }
.past-lesson-main { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.past-lesson-meta { white-space: nowrap; font-size: 13px; }
.past-lesson-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.past-lesson-head b { margin-right: 4px; }
.name-chip { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); font-size: 13px; font-weight: 700; white-space: nowrap; }
.past-pages { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.past-page { display: flex; flex-direction: column; gap: 8px; }
.past-page-students { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.past-page-students li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; }
.past-page-name { font-weight: 700; min-width: 90px; }
.past-page-res { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.past-page-link { display: inline-flex; align-items: center; gap: 6px; color: inherit; text-decoration: none; padding: 4px 8px; border-radius: var(--radius-md); background: var(--bg); }
.past-page-link:hover { background: var(--primary-soft); }
.stars-mini { color: #E8A317; letter-spacing: 1px; }
.past-board { pointer-events: none; }
@media (max-width: 640px) { .past-lesson { flex-wrap: wrap; position: relative; padding-right: 40px; } .past-lesson > svg { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); } .past-lesson-meta { width: 100%; white-space: normal; } .past-page-name { min-width: 0; width: 100%; } }

/* login: on-screen keypad (light, like the rest of the cabinet) */
.pin-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: 100%; max-width: 312px; margin: 2px auto 22px; }
.pin-key {
  position: relative; height: 62px; display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: 16px; background: var(--paper); color: var(--ink);
  font-family: var(--font-display); font-size: 28px; font-weight: 600; line-height: 1; cursor: pointer;
  box-shadow: 0 1px 0 rgba(16, 36, 62, 0.06), 0 3px 10px -4px rgba(16, 36, 62, 0.12);
  transition: transform 0.08s var(--ease), background 0.15s, border-color 0.15s, box-shadow 0.15s, color 0.15s;
  -webkit-tap-highlight-color: transparent; user-select: none; touch-action: manipulation;
}
.pin-key:hover:not(:disabled) { background: var(--primary-soft); border-color: #BCD1EE; color: var(--primary-ink); }
.pin-key:active:not(:disabled), .pin-key.is-lit { transform: translateY(1px) scale(0.96); background: var(--primary-soft); border-color: var(--primary); color: var(--primary-ink); box-shadow: 0 0 0 4px rgba(33, 71, 245, 0.14); }
.pin-key:focus-visible { outline: 3px solid rgba(33, 71, 245, 0.4); outline-offset: 2px; }
.pin-key:disabled { cursor: default; opacity: 0.45; box-shadow: none; }
.pin-key.is-fn { background: transparent; border-color: transparent; box-shadow: none; font-family: var(--font-body); font-size: 14px; font-weight: 600; color: var(--ink-soft); }
.pin-key.is-fn:hover:not(:disabled) { background: var(--bg); border-color: var(--line); color: var(--ink); }
.pin-key.is-fn:active:not(:disabled), .pin-key.is-fn.is-lit { background: var(--bg); border-color: var(--line-strong); color: var(--ink); box-shadow: none; }
.pin-key.is-fn:disabled { opacity: 0.35; }
/* touch screens: the cell that the next tap fills shows a blinking caret */
.pin-cell.is-next { border-color: var(--primary); box-shadow: 0 0 0 5px rgba(33, 71, 245, 0.18); }
.pin-cells { position: relative; }
@media (pointer: coarse) { .pin-cell { caret-color: transparent; cursor: default; } }
.pin-cell.is-next { background-image: linear-gradient(var(--primary), var(--primary)); background-size: 2px 34px; background-position: center; background-repeat: no-repeat; animation: pin-caret 1s steps(1) infinite; }
@keyframes pin-caret { 50% { background-size: 0 0; } }
@media (max-width: 400px) { .pin-pad { gap: 8px; } .pin-key { height: 58px; font-size: 26px; border-radius: 14px; } }

/* login digits: the body face (clearer «1», «4», «7» for kids than the display serif) */
.pin-cell, .pin-key:not(.is-fn) { font-family: var(--font-body); font-weight: 700; font-variant-numeric: tabular-nums; }
.pin-key:not(.is-fn) { font-size: 26px; }

/* level + book picker (22 books) */
.blp { display: flex; flex-direction: column; gap: 8px; }
.blp-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.blp-label { font-size: 12px; font-weight: 700; color: var(--ink-muted); min-width: 64px; }
.blp-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.blp-chip { min-width: 40px; height: 38px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--paper); font-weight: 700; font-size: 15px; color: var(--ink); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.blp-chip:hover { border-color: var(--line-strong); background: var(--bg); }
.blp-chip.is-on { background: var(--primary); border-color: var(--primary); color: #fff; }
.blp-chip.wide { min-width: 110px; }
.blp-sub { font-size: 12px; font-weight: 500; opacity: .7; }
/* the lesson's page picker: «1. Уровень / 2. Книга / 3. Страница», a row opens once the one before is chosen;
   a chip the students have carries a count (a tick with one student) — a filled chip would look chosen, and nothing
   is chosen for the teacher. Above the steps, «Книги учеников»: a row per student, the books as buttons */
.opener-steps { gap: 12px; }
.opener-steps .blp-row.is-top { align-items: flex-start; }
.opener-steps .blp-label { min-width: 92px; font-size: 13px; color: var(--ink); }
.opener-steps .blp-label.is-off { color: var(--ink-muted); }
.opener-steps .blp-row.is-top .blp-label { padding-top: 10px; }
.opener-pages { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.opener-pages > p { margin: 0; }
.blp-groups { display: flex; flex-direction: column; gap: 6px; }
.blp-cnt { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--ok-soft); color: var(--ok-ink); font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.blp-chip.is-on .blp-cnt { background: rgba(255, 255, 255, 0.18); color: #fff; }
.blp-cnt .icon { margin: 0; }
.who-books { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--bg); }
.who-books-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.who-books-label { font-size: 13px; font-weight: 700; }
.who-books ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.who-row { display: flex; align-items: center; gap: 6px; min-height: 30px; }
.who-name { display: inline-flex; align-items: center; gap: 8px; min-width: 128px; margin-right: 4px; font-size: 13px; font-weight: 600; flex: none; }
.who-name .student-avatar { width: 24px; height: 24px; font-size: 12px; border-radius: var(--radius-sm); }
.who-name .student-avatar.has-presence::after { width: 9px; height: 9px; right: -3px; bottom: -3px; }
/* the books stay on one line; a long list scrolls sideways inside its row (a phone), never wraps under the name */
.who-codes { display: flex; gap: 6px; flex: 1; min-width: 0; overflow-x: auto; padding: 2px 0; scrollbar-width: thin; }
.who-code { flex: none; height: 28px; padding: 0 9px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--paper); font: inherit; font-size: 13px; font-weight: 700; color: var(--ink); cursor: pointer; transition: background 0.12s, border-color 0.12s; }
.who-code:hover { border-color: var(--ink-muted); }
.who-code:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.who-code.is-on { background: var(--primary); border-color: var(--primary); color: #fff; }
@media (max-width: 600px) { .who-row { flex-wrap: wrap; } .who-name { min-width: 100%; margin-right: 0; } .who-codes { flex-basis: 100%; } }
/* student access: levels × А/В */
.access-hint { margin: -2px 0 8px; }
/* a level's box holds all its books (level 1: А, В and the three guides) — the buttons are square and of one fixed
   width, so a tick on a chosen book never widens it past the box */
.access-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(330px, 100%), 1fr)); gap: 8px; }
.access-level { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--paper); min-width: 0; }
.access-level.has-on { border-color: #BFE3CC; background: #F3FBF6; }
.access-level-n { font-weight: 700; font-size: 14px; white-space: nowrap; }
.access-level-books { display: flex; gap: 4px; flex: none; }
.access-chip { position: relative; display: inline-flex; align-items: center; justify-content: center; min-width: 40px; height: 32px; padding: 0 8px; white-space: nowrap; border-radius: var(--radius-sm); border: 1px solid var(--line-strong); background: #fff; font-size: 13px; font-weight: 700; color: var(--ink-soft); cursor: pointer; transition: background 0.12s, border-color 0.12s; }
/* the tick of an open book sits in the corner as a small badge: the button keeps its width */
.access-tick { position: absolute; top: -6px; right: -6px; width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 1.5px solid var(--ok); color: var(--ok); display: inline-flex; align-items: center; justify-content: center; }
.access-chip:hover { border-color: var(--ink-soft); }
.access-chip.is-on { background: var(--ok); border-color: var(--ok); color: #fff; }
/* home: books by level */
.dash-levels { display: flex; flex-direction: column; padding: 2px 4px; }
/* a level per row: the number on the left, its books on the right wrapping as needed (books А, В, then the guides) */
.dash-level { display: flex; align-items: flex-start; gap: 8px; padding: 7px 0; border-top: 1px solid var(--line); }
.dash-level:first-child { border-top: 0; }
.dash-level-n { flex: 0 0 84px; font-weight: 700; font-size: 14px; color: var(--ink-soft); padding: 7px 0 0 6px; white-space: nowrap; }
.dash-level-books { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.dash-level-book { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; background: var(--bg); color: var(--ink); text-decoration: none; font-size: 13px; font-weight: 700; white-space: nowrap; }
.dash-level-book.is-guide { background: var(--paper); border: 1px solid var(--line-strong); color: var(--ink-soft); }
.dash-level-book svg { color: var(--ink-muted); }
.dash-level-book.is-guide svg { color: var(--primary); }
.dash-level-book:hover { background: var(--primary-soft); color: var(--primary-ink); border-color: var(--primary-soft); }
.dash-level-book .muted { font-weight: 500; font-size: 12px; }

/* homework: «Кому» folded to names; pages «с … по …»; a week's name picks the whole week */
.awho { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.awho-chip { display: inline-flex; align-items: center; gap: 10px; padding: 8px 14px 8px 8px; border: 1.5px solid var(--primary); border-radius: var(--radius-md); background: var(--primary-soft); }
.awho-chip .student-avatar { width: 32px; height: 32px; font-size: 15px; }
.arange { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--bg); }
.arange-label, .arange-dash { font-size: 14px; font-weight: 700; color: var(--ink-soft); }
.arange-input { width: 76px; min-height: 40px; padding: 4px 8px; font-size: 17px; font-weight: 700; text-align: center; }
.arange-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.arange-input.is-bad { border-color: var(--bad); background: #FDF3F2; color: var(--bad); box-shadow: 0 0 0 4px rgba(201, 70, 61, 0.14); }
.arange .btn:disabled { background: var(--line); border-color: var(--line); color: var(--ink-muted); opacity: 1; }
.arange-err { flex-basis: 100%; color: var(--bad); font-size: 13px; font-weight: 600; }
.page-pick-wk.is-btn { border: 0; background: none; padding: 4px 6px; margin-left: -6px; border-radius: var(--radius-sm); font-family: inherit; text-align: left; cursor: pointer; }
.page-pick-wk.is-btn:hover { background: var(--primary-soft); color: var(--primary-deep); }

/* student search (Ученики, «Кого позвать на урок», «Кому») */
.search-box { position: relative; display: flex; align-items: center; max-width: 460px; }
.search-box > svg { position: absolute; left: 14px; color: var(--ink-muted); pointer-events: none; }
.search-input { width: 100%; min-height: 46px; padding: 10px 42px 10px 42px; border: 1.5px solid var(--line-strong); border-radius: var(--radius-md); background: var(--paper); font: inherit; font-size: 16px; color: var(--ink); transition: border-color 0.15s, box-shadow 0.15s; }
.search-input::-webkit-search-cancel-button { display: none; }
.search-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.search-box.has-value .search-input { border-color: var(--primary); }
.search-clear { position: absolute; right: 8px; width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 999px; background: var(--bg); color: var(--ink-soft); cursor: pointer; }
.search-clear:hover { background: var(--line); }
.search-none { margin: 6px 0 12px; color: var(--ink-muted); font-weight: 600; }
.students-search { margin-bottom: 14px; }
.lesson-new-search { margin: -4px 0 12px; }
.lesson-new-search .search-box { max-width: none; }
.astudents-search { margin-bottom: 10px; }
.astudents-search .search-box { max-width: none; }
.picked-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.picked-chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 8px 0 12px; border: 0; border-radius: 999px; background: var(--primary); color: #fff; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.picked-chip:hover { background: var(--primary-deep); }
.picked-chip svg { opacity: 0.85; }

/* voice for flash dictation / times table */
.voice-settings { margin-top: 14px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--paper); overflow: hidden; }
.voice-settings.is-on { border-color: color-mix(in oklab, var(--primary) 40%, var(--line)); }
.voice-toggle { width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 0; background: transparent; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.voice-toggle:hover { background: var(--bg); }
.voice-toggle > svg { flex: none; color: var(--ink-muted); }
.voice-toggle.is-on > svg { color: var(--primary); }
.voice-toggle > span:nth-child(2) { flex: 1; display: flex; flex-direction: column; line-height: 1.3; }
.voice-toggle small { color: var(--ink-muted); font-size: 13px; }
.voice-switch { flex: none; width: 44px; height: 26px; border-radius: 999px; background: var(--line-strong); position: relative; transition: background 0.15s; }
.voice-switch i { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2); transition: transform 0.15s var(--ease); }
.voice-toggle.is-on .voice-switch { background: var(--primary); }
.voice-toggle.is-on .voice-switch i { transform: translateX(18px); }
.voice-rows { display: flex; flex-direction: column; gap: 12px; padding: 4px 14px 14px; align-items: flex-start; }
.voice-rows .field { width: 100%; }
.voice-select { max-width: 360px; min-height: 44px; padding: 8px 12px; }
.voice-bar { display: inline-flex; align-items: center; gap: 10px; }
.trainer-head-row .voice-bar { margin-left: auto; }
.lesson-panel > .voice-bar { align-self: flex-end; margin-bottom: 6px; }
.voice-chip { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border: 1.5px solid var(--line-strong); border-radius: var(--radius-md); background: var(--paper); font: inherit; font-size: 13px; font-weight: 700; color: var(--ink-soft); cursor: pointer; }
.voice-chip.is-on { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-deep); }
.voice-chip, .voice-bar .link-btn { white-space: nowrap; }
.voice-volume { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--ink-soft); }
.flash-stage-card > .voice-volume { align-self: flex-end; margin-bottom: 6px; }
.voice-volume-mute { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border: 1.5px solid var(--line-strong); border-radius: var(--radius-md); background: var(--paper); color: var(--primary-deep); cursor: pointer; }
.voice-volume.is-off .voice-volume-mute { color: var(--ink-muted); background: var(--line); }
.voice-volume input[type="range"] { width: 120px; accent-color: var(--primary); margin: 0; }
.voice-volume.is-off input[type="range"] { accent-color: var(--ink-muted); }
.voice-volume-val { min-width: 3.2em; text-align: right; }
@media (max-width: 480px) { .voice-volume-label { display: none; } }
@media (max-width: 480px) { .voice-chip-text { display: none; } .voice-chip { padding: 0 9px; } .trainer-head-row .kicker { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } }
.voice-modal { width: min(460px, 100%); }
.voice-modal .voice-settings { margin-top: 10px; }

/* date pickers (Calendar.jsx) */
.datepick { position: relative; display: inline-block; }
.datepick-btn { display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 16px; border: 1.5px solid var(--line-strong); border-radius: var(--radius-md); background: var(--paper); font: inherit; font-weight: 700; color: var(--ink); cursor: pointer; white-space: nowrap; transition: border-color 0.15s, box-shadow 0.15s; }
.datepick-btn svg { color: var(--primary); }
.datepick-btn:hover { border-color: var(--ink-soft); }
.datepick-btn.is-open, .datepick-btn:focus-visible { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.datepick.is-sm .datepick-btn { min-height: 36px; padding: 0 12px; font-size: 14px; }
.cal-pop { position: absolute; z-index: 60; top: calc(100% + 8px); left: 0; width: 320px; padding: 14px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: 0 18px 40px rgba(16, 36, 62, 0.16), 0 2px 6px rgba(16, 36, 62, 0.06); animation: rise 0.16s var(--ease); }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cal-head b { font-size: 16px; }
.cal-nav { width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 10px; background: transparent; color: var(--ink-soft); cursor: pointer; }
.cal-nav:hover:not(:disabled) { background: var(--bg); color: var(--ink); }
.cal-nav:disabled { opacity: 0.3; cursor: default; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-wd { text-align: center; font-size: 12px; font-weight: 700; color: var(--ink-muted); padding: 4px 0 6px; text-transform: lowercase; }
.cal-wd.is-weekend { color: color-mix(in oklab, var(--bad) 70%, var(--ink-muted)); }
.cal-day { height: 38px; border: 0; border-radius: 10px; background: transparent; font: inherit; font-size: 14px; font-weight: 600; color: var(--ink); cursor: pointer; font-variant-numeric: tabular-nums; transition: background 0.1s; }
.cal-day:hover:not(:disabled) { background: var(--primary-soft); }
.cal-day.is-out { color: var(--ink-muted); opacity: 0.55; }
.cal-day.is-today { box-shadow: inset 0 0 0 1.5px var(--primary); }
.cal-day.is-in { background: var(--primary-soft); border-radius: 0; }
.cal-day.is-on, .cal-day.is-edge { background: var(--primary); color: #fff; }
.cal-day:disabled { color: var(--line-strong); cursor: not-allowed; text-decoration: line-through; opacity: 0.6; }
.cal-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
/* the period: quick choices on the left, two months side by side, «С … По …» boxes and the buttons under them */
.cal-range { display: flex; gap: 16px; width: auto; }
.cal-range-main { display: flex; flex-direction: column; min-width: 0; }
.cal-months { display: flex; gap: 20px; }
.cal-month { width: 272px; }
.cal-nav-ghost, .cal-nav-m1 { visibility: hidden; } /* on a computer the two months share one pair of arrows */
.cal-presets { display: flex; flex-direction: column; gap: 2px; min-width: 150px; padding-right: 14px; border-right: 1px solid var(--line); }
.cal-preset { text-align: left; padding: 8px 10px; border: 0; border-radius: var(--radius-sm); background: transparent; font: inherit; font-size: 14px; font-weight: 600; color: var(--ink-soft); cursor: pointer; }
.cal-preset:hover { background: var(--bg); color: var(--ink); }
.cal-preset.is-on { background: var(--primary-soft); color: var(--primary-deep); }
.cal-range-foot { justify-content: space-between; flex-wrap: wrap; }
.cal-range-inputs { display: flex; align-items: center; gap: 8px; }
.cal-range-inputs label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.cal-range-inputs .input { height: 36px; padding: 0 8px; width: 150px; font-size: 13px; }
.cal-range-dash { color: var(--ink-muted); }
/* the lessons list's filters: the period, the student */
.history-filters { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.history-filters .period-btn { min-height: 42px; padding: 0 12px; font-weight: 700; font-size: 14px; }
.history-filters .period-btn.is-set { border-color: var(--primary); color: var(--primary-deep); background: var(--primary-soft); }
.period-btn > .icon:last-child { color: var(--ink-muted); transform: rotate(90deg); }
.period-btn.is-open > .icon:last-child { transform: rotate(-90deg); }
.history-filters .history-student { min-width: 200px; }
@media (max-width: 640px) {
  .cal-pop { position: fixed; left: 0; right: 0; top: auto; bottom: 0; width: auto; border-radius: 18px 18px 0 0; padding: 16px 16px calc(16px + env(safe-area-inset-bottom, 0px)); animation: sheet-up 0.2s var(--ease); }
  .cal-range { flex-direction: column; }
  .cal-month { width: auto; }
  .cal-month-2 { display: none; }
  .cal-nav-m1 { visibility: visible; }
  .cal-range-inputs .input { width: 128px; }
  .cal-presets { flex-direction: row; flex-wrap: wrap; border-right: 0; padding-right: 0; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
  .cal-day { height: 42px; }
}
@keyframes sheet-up { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.period-pick { position: relative; display: inline-flex; }
@media (min-width: 641px) { .period-pick .cal-pop { top: calc(100% + 8px); left: 0; } }
.report-period { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 16px; margin-bottom: 14px; }
.report-period h2 { margin: 0; }
.report-period p, .report-section > div > p { margin: 2px 0 0; }
/* the homework in the report: each task with its pages and how far each got */
.report-hw { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.report-hw-item { border: 1px solid var(--line); border-radius: var(--radius-md); padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; background: var(--paper); }
.report-hw-item.is-done { background: var(--bg); }
.report-hw-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-weight: 700; font-size: 14px; }
.report-hw-due { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-soft); }
.report-hw-due svg { color: var(--primary); }
.report-hw-sum { display: inline-flex; align-items: center; gap: 8px; }
.report-hw-pages { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.hw-page { display: flex; flex-direction: column; gap: 6px; padding: 8px 12px; border-radius: var(--radius-md); background: var(--paper); border: 1px solid var(--line); font-size: 14px; }
.hw-page.is-new { color: var(--ink-soft); background: var(--bg); }
.hw-page-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hw-page-title { flex: 1 1 160px; font-weight: 700; }
.hw-page-prog { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; color: var(--ink-soft); }
.hw-page-prog .progress { flex: 1 1 120px; height: 8px; }
.hw-page.is-full .hw-page-prog { font-size: 14px; color: var(--ink); }
/* the lessons in the report: one card per lesson, the date on top, the two tasks under it */
.report .lesson-task-list .lesson-task-row { grid-template-columns: 1fr; gap: 4px; padding: 10px 12px; }
.report .lesson-task-list .lesson-task-row > b { font-size: 14px; }
.report .lesson-task-list .lesson-task-row > span { font-size: 13px; }
.lesson-tasks-more { align-self: flex-start; margin-top: 8px; }
.report-period .seg button { display: inline-flex; align-items: center; gap: 5px; }
.report-section.is-loading .kpis { opacity: 0.5; transition: opacity 0.15s; }
/* progress: lesson flash / abacus */
.lesson-tasks { display: flex; flex-direction: column; gap: 12px; }
.kpis.kpis-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.lesson-task-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.lesson-task-list a, .lesson-task-row { display: grid; grid-template-columns: 150px 1fr 1fr 16px; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-md); color: inherit; text-decoration: none; font-size: 14px; }
.lesson-task-list a:hover { border-color: var(--primary); }
.lesson-task-list a > span, .lesson-task-row > span { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.lesson-task-list svg { color: var(--ink-muted); flex: none; }
@media (max-width: 760px) { .lesson-task-list a, .lesson-task-row { grid-template-columns: 1fr 16px; } .lesson-task-list a > span, .lesson-task-row > span { grid-column: 1; } .lesson-task-list a > svg:last-child { grid-row: 1 / 4; grid-column: 2; } }
.report .charts, .report .chart-card { margin-top: 14px; }
.report .charts { grid-template-columns: 1fr; } /* the report page is narrow: one chart per row, full width */

/* lesson · flash dictation for the teacher: settings left (stay put), the series and the answers right, all in view */
.flash-split { display: grid; grid-template-columns: minmax(340px, 430px) minmax(0, 1fr); gap: 16px; align-items: start; }
.flash-settings { position: sticky; top: calc(var(--top-h) + var(--bar-h, 0px) + 12px); max-height: calc(100vh - var(--top-h) - var(--bar-h, 0px) - 28px); display: flex; flex-direction: column; overflow: hidden; }
.flash-settings-scroll { flex: 1; min-height: 0; overflow: auto; margin: 0 -4px; padding: 0 4px; }
.flash-settings .flash-params { gap: 8px; }
.flash-settings .field-label { margin-bottom: 4px; }
.flash-settings .chips { gap: 5px; }
.flash-settings .chip { min-height: 30px; padding: 0 9px; font-size: 13px; }
/* on a laptop every setting is a row — the label on the left, the choice on the right — so all of them are in sight */
@media (min-width: 1001px) {
  .flash-settings .field { display: grid; grid-template-columns: 88px minmax(0, 1fr); align-items: center; gap: 4px 10px; }
  .flash-settings .field-label { margin: 0; line-height: 1.2; }
  .flash-settings .voice-inline-row { gap: 6px; }
  .flash-settings .check-row { min-height: 38px; padding: 6px 10px; }
}
.flash-actions { display: flex; flex-direction: column; gap: 8px; margin: 10px 0 0; padding-top: 10px; border-top: 1px solid var(--line); }
.flash-actions .btn { width: 100%; justify-content: center; }
.flash-actions.is-row { flex-direction: row; margin: 10px 0 0; padding-top: 0; border-top: 0; }
.flash-actions.is-row .btn { flex: 1; }
.flash-stage-card { min-height: 320px; display: flex; flex-direction: column; }
.flash-stage-card .flash-stage { flex: 1; min-height: 220px; }
.flash-stage-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; color: var(--ink-muted); padding: 30px 20px; }
.flash-stage-empty svg { color: var(--primary); width: 42px; height: 42px; padding: 8px; border-radius: 12px; background: var(--primary-soft); }
.flash-stage-empty p { max-width: 380px; margin: 0; }
.flash-meta-answer b { font-size: 18px; }
.flash-meta-nums { flex: 1; min-width: 0; }
.flash-answers.is-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 6px; }
.flash-settings-sum { width: 100%; display: flex; align-items: center; gap: 10px; padding: 4px 0; border: 0; background: none; font: inherit; font-weight: 700; color: var(--ink); text-align: left; cursor: pointer; }
.flash-settings-sum > span:nth-child(2) { flex: 1; }
.flash-settings-sum svg { color: var(--primary); }
@media (max-width: 1000px) {
  .flash-split { grid-template-columns: 1fr; }
  .flash-settings { position: static; max-height: none; }
  .flash-stage-card { min-height: 0; }
}

/* «Озвучка» as one row of a settings form */
.voice-inline-row { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.voice-inline-line { display: flex; align-items: center; gap: 8px; width: 100%; flex-wrap: wrap; }
.voice-inline-line .voice-pick { flex: 1; min-width: 160px; }
.voice-inline-line .voice-pick select { flex: 1; min-width: 0; text-overflow: ellipsis; }
.voice-gender, .voice-listen { flex: none; }
.voice-inline-switch { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px 0 8px; border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--paper); font: inherit; font-size: 13px; font-weight: 700; color: var(--ink-soft); cursor: pointer; }
.voice-inline-switch .voice-switch { width: 36px; height: 22px; }
.voice-inline-switch .voice-switch i { width: 16px; height: 16px; }
.voice-inline-switch.is-on { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-deep); }
.voice-inline-switch.is-on .voice-switch { background: var(--primary); }
.voice-inline-switch.is-on .voice-switch i { transform: translateX(14px); }
.voice-gender { display: inline-flex; padding: 3px; border-radius: var(--radius-sm); background: var(--bg); border: 1px solid var(--line); }
.voice-gender button { height: 30px; padding: 0 12px; border: 0; border-radius: 6px; background: transparent; font: inherit; font-size: 13px; font-weight: 700; color: var(--ink-soft); cursor: pointer; }
.voice-gender button.is-on { background: var(--paper); color: var(--ink); box-shadow: 0 1px 2px rgba(16, 36, 62, 0.12); }
.voice-pick { position: relative; display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 10px; border: 1.5px solid var(--line-strong); border-radius: 999px; background: var(--paper); color: var(--ink-soft); }
.voice-pick select { appearance: none; -webkit-appearance: none; border: 0; background: transparent; font: inherit; font-size: 13px; font-weight: 700; color: var(--ink); padding: 0 2px; cursor: pointer; }
.voice-pick select:focus { outline: none; }
.voice-pick:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.voice-pick > svg:last-child { transform: rotate(90deg); pointer-events: none; }
.voice-listen { width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: var(--radius-sm); background: var(--primary); color: #fff; cursor: pointer; }
.voice-listen:hover { background: var(--primary-deep); }

/* voice picker (VoiceMenu) */
.voice-dd { position: relative; flex: 1; min-width: 0; }
.voice-dd-btn { width: 100%; display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 6px 12px 6px 6px; border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--paper); font: inherit; color: var(--ink); text-align: left; cursor: pointer; transition: border-color 0.15s, box-shadow 0.15s; }
.voice-dd-btn:hover { border-color: var(--ink-soft); }
.voice-dd.is-open .voice-dd-btn, .voice-dd-btn:focus-visible { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.voice-dd-btn > svg { flex: none; color: var(--ink-muted); transform: rotate(90deg); transition: transform 0.15s; }
.voice-dd.is-open .voice-dd-btn > svg { transform: rotate(-90deg); }
.voice-ava { flex: none; width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; background: var(--primary-soft); color: var(--primary-deep); font-weight: 800; font-size: 15px; }
.voice-ava.is-f { background: #FCE8EF; color: #9B2C55; }
.voice-dd-main { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.voice-dd-main b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.voice-dd-main small { font-size: 12px; color: var(--ink-muted); }
.voice-dd-menu { position: absolute; z-index: 1000; overflow: auto; top: calc(100% + 6px); left: 0; right: 0; min-width: 220px; margin: 0; padding: 6px; list-style: none; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: 0 16px 36px rgba(16, 36, 62, 0.16), 0 2px 6px rgba(16, 36, 62, 0.06); animation: rise 0.14s var(--ease); }
.voice-dd-menu li { display: flex; align-items: center; gap: 10px; padding: 6px 8px 6px 6px; border-radius: 8px; cursor: pointer; }
.voice-dd-menu li.is-hi { background: var(--bg); }
.voice-dd-menu li.is-on .voice-dd-main b { color: var(--primary-deep); }
.voice-dd-play { flex: none; width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; border: 1.5px solid var(--line-strong); border-radius: 6px; background: var(--paper); color: var(--ink-soft); cursor: pointer; }
.voice-dd-play:hover { border-color: var(--primary); color: var(--primary); }
.voice-dd-check { flex: none; width: 18px; color: var(--primary); display: inline-flex; }

/* the series in the middle of its card, as tall as the settings beside it */
@media (min-width: 1001px) {
  .flash-split { align-items: stretch; }
  .flash-stage-card { justify-content: center; position: relative; }
  .flash-stage-card .flash-stage { flex: 0 0 auto; min-height: 260px; }
  .flash-stage-card > .voice-volume { position: absolute; top: 14px; right: 16px; margin: 0; }
}

/* «только на слух»: no numbers, a pulsing speaker while they are said */
.flash-listen { display: flex; flex-direction: column; align-items: center; gap: 10px; animation: rise 0.2s var(--ease); }
.flash-listen-ico { width: 96px; height: 96px; display: inline-flex; align-items: center; justify-content: center; border-radius: 24px; background: var(--primary-soft); color: var(--primary); animation: listen-pulse 1.1s ease-in-out infinite; }
.flash-listen b { font-size: 22px; }
@keyframes listen-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(33, 71, 245, 0.25); } 50% { box-shadow: 0 0 0 16px rgba(33, 71, 245, 0); } }
.flash-listen-note { display: flex; align-items: center; gap: 6px; margin: 6px 0 0; font-size: 13px; font-weight: 600; color: var(--primary-deep); }
.sound-ask { display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 16px; border: 1.5px solid var(--primary); border-radius: var(--radius-md); background: var(--primary-soft); color: var(--primary-deep); font: inherit; text-align: left; cursor: pointer; animation: rise 0.2s var(--ease); }
.sound-ask span { display: flex; flex-direction: column; gap: 2px; }
.sound-ask small { color: var(--ink-soft); font-size: 13px; }

/* dropdown (Select): the cabinet's own look on every device */
.dd { position: relative; display: inline-block; min-width: 0; }
.dd-btn { width: 100%; display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 10px 0 14px; border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--paper); font: inherit; font-weight: 700; color: var(--ink); text-align: left; cursor: pointer; transition: border-color 0.15s, box-shadow 0.15s; }
.dd-sm .dd-btn { min-height: 32px; padding: 0 6px 0 10px; font-size: 13px; }
.dd-btn:hover { border-color: var(--ink-soft); }
.dd.is-open .dd-btn, .dd-btn:focus-visible { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.dd-cur { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd-btn > svg { flex: none; color: var(--ink-muted); transform: rotate(90deg); transition: transform 0.15s; }
.dd.is-open .dd-btn > svg { transform: rotate(-90deg); }
.dd-menu { position: absolute; z-index: 1000; top: calc(100% + 6px); left: 0; min-width: max(100%, 180px); max-height: 320px; overflow: auto; margin: 0; padding: 6px; list-style: none; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: 0 16px 36px rgba(16, 36, 62, 0.16), 0 2px 6px rgba(16, 36, 62, 0.06); animation: rise 0.14s var(--ease); }
.dd-menu li { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 10px; border-radius: 8px; cursor: pointer; white-space: nowrap; }
.dd-menu-sm li { padding: 6px 8px 6px 10px; font-size: 13px; }
.dd-menu li.is-hi { background: var(--bg); }
.dd-opt { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.dd-opt b { font-weight: 600; }
.dd-menu li.is-on .dd-opt b { color: var(--primary-deep); font-weight: 700; }
.dd-opt small { font-size: 12px; color: var(--ink-muted); }
.dd-check { flex: none; width: 18px; color: var(--primary); display: inline-flex; }

/* the student's result in a lesson: calm and warm, made for a child */
.result-card { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 28px 20px 24px; border: 0; border-radius: 16px; animation: rise 0.22s var(--ease); }
.result-card.is-ok { background: linear-gradient(180deg, #EAF7EF 0%, #F6FBF8 100%); }
.result-card.is-soft { background: linear-gradient(180deg, #FFF3E8 0%, #FFF9F4 100%); }
.result-badge { width: 64px; height: 64px; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin-bottom: 4px; }
.result-card.is-ok .result-badge { background: #CFEEDB; color: var(--ok-ink); }
.result-card.is-soft .result-badge { background: #FFE0C7; color: #B5481C; }
.result-card h2 { margin: 0; font-size: 24px; }
.result-card.is-soft h2 { color: #8A3A17; }
.result-answer { display: flex; flex-direction: column; align-items: center; gap: 2px; margin-top: 4px; }
.result-answer .muted { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.result-answer b { font-size: 44px; line-height: 1.1; color: var(--ok-ink); font-weight: 800; }
.result-given { margin: 0; color: var(--ink-soft); font-size: 15px; }
.result-given s { color: var(--ink-muted); text-decoration-thickness: 2px; }
.result-series { margin: 0; padding: 6px 12px; border-radius: 999px; background: rgba(255, 255, 255, 0.7); color: var(--ink-soft); font-size: 14px; }
.result-foot { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 6px; font-size: 14px; }
.chip-soft { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.8); font-weight: 700; font-size: 13px; color: var(--ink-soft); }

.books-filter { margin: -6px 0 14px; }

/* the voice's gender always on its own line under the switch (in English both fit the line and the box got clipped) */
.flash-settings .voice-inline-line:first-child { flex-direction: column; align-items: flex-start; }
.flash-settings-scroll { overflow-x: hidden; }
/* flash dictation: «a × b» as one line; the guide's problem counter */
.flash-mul { display: inline-flex; align-items: baseline; gap: 0.25em; white-space: nowrap; }
.flash-mul .op { color: var(--ink-muted); font-size: 0.7em; }
.flash-guide-pos { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; background: var(--primary-soft); color: var(--primary-deep); font-size: 13px; font-weight: 700; }
.guide-pick { display: flex; flex-direction: column; gap: 8px; }

/* administrator: speech at Microsoft this month */
.tts-usage-now { display: flex; flex-direction: column; gap: 8px; padding: 14px 0 6px; border-top: 1px solid var(--line); }
.tts-usage-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.tts-usage-head b { font-family: var(--font-display); font-size: 24px; }
.tts-usage-past { list-style: none; margin: 0; padding: 8px 0 2px; display: flex; flex-direction: column; gap: 4px; font-size: 13px; border-top: 1px solid var(--line); }
.tts-usage-past li { display: flex; justify-content: space-between; gap: 12px; }
.setting-card-title { display: flex; align-items: center; gap: 6px; }
.tts-usage-bar { height: 8px; border-radius: 999px; background: var(--bg); overflow: hidden; }
.tts-usage-bar span { display: block; height: 100%; background: var(--primary); border-radius: 999px; min-width: 2px; }

/* a column of numbers: every digit in its own cell, the units under the units */
.flash-col { align-items: center; }
.flash-ch { display: inline-block; width: 0.62em; text-align: center; }
.flash-ch.is-sign { width: 0.5em; }
.flash-ch.is-comma { width: 0.28em; } /* a decimal of the fractions book: the comma takes little room */
/* the teacher's preview of the next guide problem */
.flash-preview { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 14px; border: 1px dashed var(--line-strong); border-radius: var(--radius-md); background: var(--bg); margin-top: 10px; }
.flash-preview.is-big { margin-top: 0; padding: 18px 24px; }
.flash-preview-head { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--primary-deep); }
.flash-preview-col { display: flex; flex-direction: column; align-items: center; font-family: var(--font-display); font-weight: 700; font-size: 22px; line-height: 1.1; }
.flash-preview.is-big .flash-preview-col { font-size: 40px; }
.flash-preview-col .flash-col-num.is-neg { color: var(--bad); }
.flash-preview-mul { font-family: var(--font-display); font-weight: 700; font-size: 28px; }
.flash-preview.is-big .flash-preview-mul { font-size: 48px; }
.flash-preview-mul .op { color: var(--ink-muted); font-size: 0.7em; }
.flash-preview-ans { font-weight: 700; color: var(--ok-ink); }

/* the student's speaker for the teacher's series: one compact row under the waiting / result card */
.student-voice-pick { margin-top: 12px; }
.student-voice-pick .voice-inline { margin: 0; }
.student-voice-pick .voice-inline-row { flex-direction: row; align-items: center; flex-wrap: wrap; gap: 8px; }
.student-voice-pick .voice-inline-line { width: auto; }
.student-voice-pick .voice-inline-line .voice-dd { min-width: 220px; }

/* scrolling inside an open list never scrolls the page behind it */
.dd-menu, .voice-dd-menu { overscroll-behavior: contain; }


/* the book's problems are not for copying: no text selection or touch callout on a page, in a guide preview;
   the answer boxes stay selectable. Printing a page gives only a notice (print-to-PDF is a copy too) */
.no-copy, .no-copy * { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.no-copy input, .no-copy textarea { -webkit-user-select: text; user-select: text; }
@media print {
  .page-view, .flash-preview { display: none !important; }
  body::before { content: 'Печать страниц книги недоступна / Кітап беттерін басып шығару мүмкін емес / Printing book pages is not available'; display: block; padding: 24px; font: 16px sans-serif; }
}

/* billing: the plan now, the tariffs as cards, the payment dialog with a QR */
.plan-now { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.plan-now.is-paid { border-color: #BFE3CC; background: #F3FBF6; }
.plan-now h2 { margin: 2px 0 4px; font-size: 24px; }
.plan-now p { margin: 0; }
.billing-note { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; }
.billing-free { margin: 12px 0 18px; }
.pay-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.pay-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; width: 100%; padding: 8px 12px; border: 0; border-radius: var(--radius-md); background: var(--bg); color: var(--ink); font: inherit; font-size: 14px; text-align: left; }
.pay-row > span:nth-child(2) { flex: 1 1 140px; font-weight: 700; }
/* a pending payment reopens its dialog */
button.pay-row { cursor: pointer; box-shadow: inset 0 0 0 1px var(--line); }
button.pay-row:hover { background: var(--primary-soft-2); box-shadow: inset 0 0 0 1px var(--primary); }
button.pay-row > .icon { margin-left: auto; color: var(--primary); }
.pay-dialog { width: min(420px, 100%); text-align: center; }
.pay-dialog .modal-head { text-align: left; }
.pay-sum { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; margin: 0 0 12px; font-size: 16px; }
.pay-qr { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-bottom: 14px; }
.pay-qr img { width: 220px; height: 220px; border: 1px solid var(--line); border-radius: var(--radius-md); background: #fff; }
.pay-open { display: inline-flex; width: 100%; justify-content: center; }
.pay-wait { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 12px 0 0; }
.pay-done { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 18px 0; color: var(--ok-ink); }
.pay-done.is-bad { color: var(--bad-ink); }
.pay-done svg { color: var(--ok); }
.pay-done.is-bad svg { color: var(--bad); }
.billing-history, .billing-admin { margin-top: 16px; }
.session-list { list-style: none; margin: 0 0 10px; padding: 0; }
.plan-admin { margin-bottom: 16px; }
.plan-admin p { margin: 4px 0 10px; }
.plan-admin-row { gap: 8px; flex-wrap: wrap; }
.plan-admin-row .dd { min-width: 180px; }

/* the inline «✓ Сохранено» beside a setting's control: appears, then fades */
.setting-saved { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; color: var(--ok-ink); animation: setting-saved 2.2s var(--ease) forwards; }
.setting-saved .icon { color: var(--ok); }
@keyframes setting-saved { 0% { opacity: 0; transform: translateX(4px); } 12% { opacity: 1; transform: none; } 75% { opacity: 1; } 100% { opacity: 0; } }

.setting-edit { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; }
.setting-tip-p { display: block; }
.setting-tip-p + .setting-tip-p { margin-top: 6px; }

/* «Ты здесь?»: the whole screen listens for a tap; a calm card with the countdown in a ring */
.idle-ask { position: fixed; inset: 0; z-index: 45; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(245, 249, 253, 0.72); backdrop-filter: blur(3px); cursor: pointer; animation: fade 0.2s; }
.idle-ask-card { width: min(380px, 100%); padding: 26px 24px 22px; border-radius: var(--radius-lg); background: var(--paper); border: 1px solid var(--line); box-shadow: 0 18px 40px rgba(16, 36, 62, 0.16); text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; animation: rise 0.2s var(--ease); }
.idle-ask-card h2 { margin: 6px 0 0; font-size: 22px; }
.idle-ask-card p { margin: 0; color: var(--ink-soft); }
.idle-ask-ring { width: 64px; height: 64px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-family: var(--font-display); font-size: 26px; font-weight: 700; color: var(--primary-deep); background: var(--primary-soft); box-shadow: inset 0 0 0 3px var(--primary); }
.idle-ask-tap { margin-top: 6px; font-size: 14px; font-weight: 700; color: var(--primary); }

/* the homework bonus: a gold «+1 ★ в срок» beside a task's stars; a quiet «без бонуса» says why on hover */
.stars-cell { display: inline-flex; align-items: center; gap: 6px; flex-wrap: nowrap; white-space: nowrap; }
.bonus-chip { display: inline-flex; align-items: center; gap: 3px; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 800; color: #7A4A10; background: linear-gradient(180deg, #FFF3D6, #FFE7B3); box-shadow: inset 0 0 0 1px #F2C46D; white-space: nowrap; }
.bonus-chip .star-icon, .bonus-chip svg { color: #E2A013; }
.bonus-chip-l { font-weight: 700; }
.bonus-chip.is-miss { color: var(--ink-muted); background: var(--bg); box-shadow: inset 0 0 0 1px var(--line); font-weight: 600; cursor: help; }
/* the homework card's summary: three short chips */
.hw-sum { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.hw-sum-item { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; background: var(--bg); font-weight: 700; color: var(--ink-soft); }
.hw-sum-item svg { color: #E2A013; }
.hw-sum-item.is-bonus { color: #7A4A10; background: #FFF3D6; box-shadow: inset 0 0 0 1px #F2C46D; cursor: help; }
.hw-sum-item.is-bonus.is-zero { color: var(--ink-muted); background: var(--bg); box-shadow: none; }
/* ---- separate logins: 6 student cells, the teacher's e-mail + password, the password checklist ---- */
.pin-cells.is-6 { gap: 10px; }
.pin-cells.is-6 .pin-cell { width: 54px; height: 66px; font-size: 28px; }
@media (max-width: 440px) { .pin-cells.is-6 { gap: 6px; } .pin-cells.is-6 .pin-cell { width: 42px; height: 56px; font-size: 24px; } }
.pin-cells.is-6 .pin-cell.is-next { background-size: 2px 28px; }
.login-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 22px; margin-top: 16px; }
.login-links .link-btn, .login-switch { font-size: 14px; font-weight: 700; color: var(--primary-deep); text-decoration: none; }
.login-switch:hover { text-decoration: underline; }
.pw-form { display: flex; flex-direction: column; gap: 12px; text-align: left; margin-top: 20px; }
.login-fields { margin-bottom: 8px; }
.pw-card .kicker { margin-top: 4px; }
.pw-box { position: relative; display: block; }
.pw-box .input { padding-right: 48px; }
.pw-eye { position: absolute; top: 50%; right: 4px; transform: translateY(-50%); width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--ink-muted); cursor: pointer; }
.pw-eye:hover { color: var(--primary-deep); background: var(--primary-soft); }
.pw-rules { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--ink-soft); text-align: left; }
.pw-rules li { display: flex; align-items: flex-start; gap: 8px; line-height: 1.35; }
.pw-tick { flex: none; width: 18px; height: 18px; margin-top: 1px; border-radius: 50%; border: 1.5px solid var(--line-strong); display: inline-flex; align-items: center; justify-content: center; color: transparent; transition: background 0.15s, border-color 0.15s, color 0.15s; }
.pw-rules li.is-ok { color: var(--ok-ink); }
.pw-rules li.is-ok .pw-tick { background: var(--ok); border-color: var(--ok); color: #fff; }
.pw-mismatch { min-height: 18px; margin-top: -6px; font-size: 13px; font-weight: 600; color: var(--bad); }
.pw-dialog .pw-form { margin-top: 8px; }
.pw-dialog .login-error { margin: 8px 0 0; }
.pw-temp { display: flex; gap: 8px; }
.pw-temp .input { flex: 1; min-width: 0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 0.02em; }
.pw-temp + .setting-help, .pw-temp ~ .pw-rules { margin-top: 6px; }
.teacher-edit-dialog .field + .field { margin-top: 0; }
.teacher-access { display: flex; flex-direction: column; gap: 10px; margin: 14px 0; }
.teacher-access > div { display: flex; flex-direction: column; gap: 4px; }
.teacher-access dt { font-size: 12px; font-weight: 700; color: var(--ink-muted); }
.teacher-access dd { margin: 0; }
.copy-text { letter-spacing: 0.02em; max-width: 100%; }
.copy-text span { overflow-wrap: anywhere; text-align: left; }
.teacher-email { font-size: 14px; color: var(--ink-soft); overflow-wrap: anywhere; }
.teacher-email.is-empty { color: var(--ink-muted); }
@media (max-width: 900px) { .teacher-row .teacher-email { grid-column: 2 / -1; } }
@media (max-width: 440px) { .pin-big span { width: 42px; height: 56px; font-size: 26px; } .pin-big { gap: 6px; } }

/* ---- exam: one page in sections (A, B, …) ---- */
.exam-sections { display: flex; flex-direction: column; gap: 18px; }
.exam-section { display: flex; flex-direction: column; gap: 14px; padding: 16px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.exam-sec-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.exam-sec-id { display: inline-grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: var(--radius-sm); background: var(--primary); color: #fff; font-weight: 800; font-size: 20px; }
.exam-sec-id.is-sm { width: 26px; height: 26px; font-size: 14px; margin-right: 6px; vertical-align: middle; }
.exam-sec-title { display: flex; flex-direction: column; gap: 2px; line-height: 1.2; }
.exam-sec-title .kicker { margin: 0; }
.exam-sec-title b { font-size: 17px; }
.exam-sec-note { margin-left: auto; display: inline-flex; gap: 6px; }
.exam-lists { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px 16px; }
.exam-list { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.exam-score { margin-bottom: 16px; }
.exam-score .section-title { margin: 0 0 10px; }
.exam-score-table td.is-1 b { color: var(--ok-ink); }
.exam-score-table td.is-2 b { color: var(--warn-ink, #7A4E0C); }
.exam-score-table tfoot th, .exam-score-table tfoot td { border-bottom: 0; background: var(--bg); font-size: 15px; }
.exam-score-table tfoot th { text-transform: none; letter-spacing: 0; color: var(--ink); }
@media (max-width: 640px) {
  .exam-section { padding: 12px; }
  .exam-sec-note { margin-left: 52px; }
}

/* ---- the level exam: the lesson's «Экзамен» tab and the result card (results, parent report) ---- */
.exam-flag { display: inline-grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: var(--radius-sm); background: var(--warn-soft); color: var(--warn-ink, #7A4E0C); }
.exam-picker { display: flex; flex-direction: column; gap: 12px; }
.exam-picker > p { margin: 0; }
.exam-pick { background: var(--paper); border: 1.5px solid var(--line); border-radius: var(--radius-md); padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.exam-pick.is-open { border-color: var(--primary); }
.exam-pick-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.exam-pick-main { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 160px; }
.exam-pick-main b { font-size: 17px; }
.exam-pick-who { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; border-top: 1px solid var(--line); padding-top: 10px; }
.exam-pick-who li { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.exam-results { display: flex; flex-direction: column; gap: 10px; }
.exam-result { position: relative; background: var(--paper); border: 1.5px solid var(--line); border-radius: var(--radius-md); padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.exam-result.is-link { cursor: pointer; }
.exam-result.is-link:hover, .exam-result.is-link:focus-visible { border-color: var(--primary); outline: none; }
.exam-result-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.exam-result-title { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 160px; }
.exam-result-title b { font-size: 17px; }
.exam-progress { display: flex; align-items: center; gap: 12px; }
.exam-progress .res-bar { flex: 1; }
.exam-score-row { display: flex; align-items: center; gap: 16px; }
.exam-score-row .result-ring { width: 56px; height: 56px; font-size: 15px; border-width: 2px; flex: none; }
.exam-score-row .result-ring small { display: none; }
.exam-score-main { display: flex; flex-direction: column; gap: 8px; }
.exam-score-main > b { font-size: 17px; }
.exam-score-chips { gap: 6px; flex-wrap: wrap; }
.exam-sections { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.exam-sections li { display: grid; grid-template-columns: 26px minmax(120px, 1.2fr) minmax(80px, 1fr) auto; align-items: center; gap: 10px; padding: 6px 10px; border-radius: var(--radius-sm); background: var(--bg); font-size: 14px; }
.exam-sections .exam-sec-id.is-sm { margin: 0; }
.exam-sections .exam-sec-score { white-space: nowrap; min-width: 92px; text-align: right; }
.exam-sections .exam-sec-name { font-weight: 600; }
.exam-takes { display: flex; flex-direction: column; gap: 4px; }
.exam-takes .kicker { color: var(--ink-muted); font-weight: 600; font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; }
.exam-takes ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.exam-takes li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 6px 10px; border-radius: var(--radius-sm); background: var(--bg); font-size: 14px; }
.exam-takes li > span:last-child { margin-left: auto; }
.exam-result-link { display: inline-flex; align-items: center; gap: 2px; color: var(--primary-ink); font-weight: 700; font-size: 14px; align-self: flex-end; }
/* the student's current level: one small chip, «Текущий уровень · 10» */
.report-level { display: inline-flex; align-items: center; gap: 8px; padding: 5px 10px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--paper); white-space: nowrap; align-self: flex-start; }
.report-level .kicker { margin: 0; font-size: 11px; }
.report-level b { font-size: 15px; color: var(--primary-ink); }
@media (max-width: 640px) {
  .exam-sections li { grid-template-columns: 26px 1fr auto; }
  .exam-sections .res-bar { grid-column: 2 / -1; }
  .exam-sections .exam-sec-name { font-size: 13px; }
}

/* ================= SabaqLab look (2026-11 redesign) =================
   The cabinet takes SabaqLab's visual system: a light #F5F7FF ground, a white 236px sidebar with the profile card under
   the logo and a filled blue active item, a wide centred column, Onest 700 headings, white cards with 20px corners and a
   soft shadow, 12px controls, blue primary actions, settings tabs as a row of rounded segment buttons. No lime (that
   colour is SabaqLab's): ISMA's blue or a neutral stands where SabaqLab has it. Rules here come last on purpose: they
   settle the older passes above. */

/* ---- shell ---- */
.sidebar { background: var(--paper); border-right: 1px solid var(--line); }
.sidebar-head { padding: 18px 14px 12px 18px; }
.sidebar-brand { gap: 10px; color: var(--ink); }
.sidebar-brand img { height: 32px; }
.sidebar-brand b { font-family: var(--font-body); font-weight: 700; font-size: 17px; letter-spacing: -0.03em; }
.sidebar-role { margin: 2px 12px 14px; padding: 10px 12px; border: 0; border-radius: var(--radius-md); background: var(--primary-soft-2); gap: 10px; }
.sidebar-role .student-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--primary-soft); color: var(--primary-deep); font-size: 14px; font-weight: 700; }
.sidebar-role-main b { font-size: 14px; font-weight: 600; }
.sidebar-role-main span { font-size: 12px; color: var(--ink-muted); }
.sidebar-nav { padding: 0 12px 8px; gap: 2px; }
.nav-item { gap: 11px; padding: 9px 12px; border-radius: var(--radius-md); font-size: 14.5px; font-weight: 500; color: var(--ink-soft); min-height: 42px; transition: background 0.12s, color 0.12s; }
.nav-item .icon { color: var(--ink-faint); transition: color 0.12s; }
.nav-item:hover:not(.is-active) { background: var(--bg-alt); color: var(--ink); }
.nav-item:hover:not(.is-active) .icon { color: var(--ink-soft); }
.nav-item .nav-badge { border-radius: var(--radius-xs); }
.nav-item.is-active .nav-badge { background: rgba(255, 255, 255, 0.22); color: #fff; }
.sidebar-foot { padding: 12px 12px calc(14px + env(safe-area-inset-bottom, 0px)); gap: 2px; }
.lang-pill { display: inline-flex; gap: 2px; padding: 3px; border: 0; border-radius: var(--radius-md); background: var(--bg-alt); }
.lang-pill button { min-height: 30px; padding: 0 12px; border: 1px solid transparent; border-radius: 9px; background: transparent; color: var(--ink-muted); font-size: 13px; font-weight: 600; box-shadow: none; }
.lang-pill button:hover:not(.active) { color: var(--ink); }
.lang-pill button.active { background: var(--paper); border-color: var(--primary); color: var(--primary-deep); box-shadow: 0 1px 2px rgba(22, 38, 42, 0.06); }
.sidebar-foot .lang-pill { margin: 2px 0 8px; }
@media (min-width: 901px) and (max-height: 760px) {
  .sidebar-head { padding-top: 12px; padding-bottom: 8px; }
  .sidebar-role { margin-bottom: 8px; padding: 8px 10px; }
  .nav-item { min-height: 36px; padding-block: 6px; }
  .sidebar-foot { padding-top: 8px; }
}

/* the column: wide and centred, as SabaqLab's (up to 1600px of content), forms and settings narrower */
.app-main { max-width: 1664px; padding: 26px 32px 72px; }
.app-main.wide { max-width: 1664px; }
.app-main.narrow { max-width: 824px; }
.app-main.account { max-width: 1024px; }
.app-main.lesson-new-main { max-width: 1664px; }
.page-head { align-items: flex-end; margin-bottom: 22px; }
.page-head h1 { font-size: clamp(26px, 2.2vw, 34px); font-weight: 700; letter-spacing: -0.035em; line-height: 1.15; }
.page-head .kicker, .kicker { color: var(--primary); font-size: 12px; font-weight: 700; letter-spacing: 0.06em; }
.page-head h1 + p, .page-head .muted { color: var(--ink-soft); }
.section-title, h2.section-title { font-size: 21px; font-weight: 700; letter-spacing: -0.025em; }
.back-link { color: var(--ink-soft); font-weight: 500; font-size: 14px; }

/* ---- surfaces: white cards, 20px corners, a soft blue-tinted shadow ---- */
.dash-card, .book-card, .week, .weeks-bar, .result-card, .rating-top-card, .empty, .teacher-card, .book-row, .setting-card { border-radius: var(--radius-lg); box-shadow: var(--shadow-card); border-color: var(--line); }
.dash-card { padding: 6px 8px; }
.empty { border-style: solid; background: var(--paper); }
.empty-icon { border-radius: 50%; background: var(--primary-soft); color: var(--primary); }
.student-row, .page-row, .hw-item { border-width: 1px; border-color: var(--line); border-radius: var(--radius-md); }
.student-row { box-shadow: var(--shadow-card); }
.student-row:hover, .page-row:hover, .book-row:hover { border-color: var(--line-strong); background: var(--paper); box-shadow: var(--shadow-sm); transform: none; }
.dash-row { border-radius: var(--radius-md); }
.dash-row:hover { background: var(--bg-alt); }
.dash-rows li + li { border-top-color: var(--line-2); }
.dash-all { color: var(--primary-deep); font-weight: 600; }
.dash-all:hover, .hw-all:hover { color: var(--primary); text-decoration: none; }
.hw-all { color: var(--primary-deep); }
.dash-foot { border-top-color: var(--line-2); }

/* avatars: initials on soft blue, blue letters (SabaqLab's person rows) */
.student-avatar, .dash-ava { border-radius: 50%; background: var(--primary-soft); color: var(--primary-deep); font-family: var(--font-body); font-weight: 700; }
.student-avatar { font-size: 18px; }
.dash-ava { font-size: 14px; }
.lesson-pick.is-on .dash-ava { background: var(--primary); color: #fff; }
.dash-tile { border-radius: var(--radius-md); background: var(--primary-soft); color: var(--primary); }
.dash-rank { border-radius: var(--radius-md); }
.count-pill { border-radius: var(--radius-xs); background: var(--bg-alt); color: var(--ink-soft); font-weight: 700; }

/* ---- controls ---- */
.chip { border-width: 1px; border-color: var(--line); border-radius: var(--radius-sm); font-weight: 600; color: var(--ink-soft); transition: background 0.12s, border-color 0.12s, color 0.12s; }
.chip:hover:not(.is-on):not(:disabled) { border-color: var(--line-strong); color: var(--ink); }
.page-pick-btn.is-on, .chip.is-on { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 700; }
.switch { border-radius: 999px; background: var(--line-strong); }
.switch.on { background: var(--primary); }
.switch-knob { box-shadow: 0 1px 3px rgba(22, 38, 42, 0.2); }
.seg button { border-radius: 9px; }
.star-chip { border-radius: var(--radius-xs); background: #FFF4D6; color: #6B4A00; font-weight: 700; }
.ans-input { border-width: 1px; border-radius: 10px; }
.ans-input:focus { box-shadow: 0 0 0 3px var(--primary-soft); }
.ans-input.has-value { border-color: var(--primary); }
.time-box, .page-jump-input { border-width: 1px; }
.pin-chip { border-width: 1px; border-radius: var(--radius-sm); }

/* tabs (student profile, lesson activities): a quiet underline row, the active one blue */
.tabs { gap: 4px; border-bottom-color: var(--line); }
.tab { padding: 10px 14px; font-weight: 600; font-size: 15px; color: var(--ink-soft); border-bottom-width: 2px; }
.tab:hover { color: var(--ink); }
.tab.is-active { color: var(--primary-deep); border-bottom-color: var(--primary); font-weight: 600; }

/* settings «Профиль · Оплата · Безопасность»: a row of rounded white segment buttons, the active one outlined blue (SabaqLab .account-tab) */
.tabs.account-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 22px; border-bottom: 0; overflow: visible; }
.account-tabs .tab { display: flex; align-items: center; justify-content: center; height: 46px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--paper); color: var(--ink-soft); font-size: 14.5px; font-weight: 600; white-space: nowrap; transition: border-color 0.12s, color 0.12s, background 0.12s; }
.account-tabs .tab:hover { color: var(--ink); border-color: var(--line-strong); }
.account-tabs .tab.is-active { border-color: var(--primary); background: var(--primary-soft-2); color: var(--primary-deep); box-shadow: inset 0 0 0 1px var(--primary); }
.app-main.account .setting-stack { max-width: none; }
.app-main.account .setting-card { padding: 20px 24px 6px; }
.setting-card-title { font-size: 17px; letter-spacing: -0.015em; }
.setting-row { border-top-color: var(--line-2); }
.setting-tip, .setting-tip::before { background: var(--ink); }
@media (max-width: 640px) {
  .tabs.account-tabs { gap: 8px; }
  .account-tabs .tab { height: 44px; font-size: 13.5px; padding: 0 6px; }
  .app-main.account .setting-card { padding: 16px 16px 4px; }
}

/* ---- modals ---- */
.modal { border-radius: var(--radius-lg); }
.modal h3, .modal h2 { letter-spacing: -0.02em; }

/* ---- teacher «Главная»: the lesson card is SabaqLab's blue hero, a white «Создать урок» on it ---- */
.dash-lesson {
  --sky-ink: #fff; --sky-text: rgba(255, 255, 255, 0.86); --sky-line: rgba(255, 255, 255, 0.24);
  border: 0; border-radius: var(--radius-lg); padding: 32px 40px 32px 36px;
  background: radial-gradient(90% 140% at 100% 0%, #3D63FF 0%, rgba(61, 99, 255, 0) 55%), var(--primary);
  color: #fff; box-shadow: 0 18px 40px -26px rgba(25, 69, 239, 0.75);
}
.dash-lesson.is-loading { background: var(--primary-soft); box-shadow: none; }
.dash-lesson-kicker, .dash-lesson.is-live .dash-lesson-kicker { color: #E3ECFF; font-weight: 700; }
.dash-lesson h2 { font-family: var(--font-body); font-size: clamp(28px, 2.6vw, 36px); font-weight: 700; letter-spacing: -0.035em; color: #fff; }
.dash-lesson p { color: rgba(255, 255, 255, 0.86); }
.dash-acts li, .dash-members li { border-color: rgba(255, 255, 255, 0.26); border-radius: var(--radius-sm); background: rgba(255, 255, 255, 0.1); color: #fff; padding: 5px 12px; font-size: 13.5px; }
.dash-members li { padding: 3px 12px 3px 3px; }
.dash-acts li .icon { color: #fff; }
.dash-members li.is-on { color: #fff; }
.dash-members .dash-ava { background: rgba(255, 255, 255, 0.95); color: var(--primary-deep); }
.dash-members li.is-on .dash-ava::after { box-shadow: 0 0 0 2px var(--primary); background: #5BE38F; }
.dash-lesson .live-dot { background: #5BE38F; box-shadow: 0 0 0 4px rgba(91, 227, 143, 0.25); }
.dash-lesson .lesson-timer { border-color: rgba(255, 255, 255, 0.3); background: rgba(255, 255, 255, 0.14); color: #fff; }
.dash-lesson-btn { min-height: 56px; padding: 0 28px; border-radius: var(--radius-sm); background: #fff; color: var(--primary-deep); font-size: 16px; font-weight: 700; box-shadow: 0 8px 20px -12px rgba(8, 20, 90, 0.6); }
.dash-lesson-btn:hover { background: #EEF2FF; }
.dash-lesson-btn:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
/* the illustration: a light abacus on the blue, gold beads counted in, the rest pale; the beads breathe once on load */
.dash-abacus rect { fill: rgba(255, 255, 255, 0.08); stroke: rgba(255, 255, 255, 0.4); stroke-width: 1.5; }
.dash-abacus .beam { stroke: rgba(255, 255, 255, 0.55); stroke-width: 1.5; }
.dash-abacus .rod { stroke: rgba(255, 255, 255, 0.28); stroke-width: 1.5; }
.dash-abacus path:not(.rod):not(.beam) { fill: rgba(255, 255, 255, 0.28); }
.dash-abacus path.on:not(.rod):not(.beam) { fill: var(--gold); }
@media (prefers-reduced-motion: no-preference) {
  .dash-abacus path.on:not(.rod):not(.beam) { animation: dash-bead-in 0.7s var(--spring) both; }
  .dash-abacus g:nth-child(3) path.on { animation-delay: 0.05s; } .dash-abacus g:nth-child(4) path.on { animation-delay: 0.1s; }
  .dash-abacus g:nth-child(5) path.on { animation-delay: 0.15s; } .dash-abacus g:nth-child(6) path.on { animation-delay: 0.2s; }
  .dash-abacus g:nth-child(7) path.on { animation-delay: 0.25s; } .dash-abacus g:nth-child(8) path.on { animation-delay: 0.3s; }
}
@keyframes dash-bead-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (max-width: 900px) { .dash-lesson { padding: 24px 20px 20px; } .dash-lesson-btn { justify-self: stretch; } }

/* «Новый урок»: the same blue family, but light (it holds a list to choose from) */
.lesson-new { --sky-ink: var(--ink); --sky-text: var(--ink-soft); --sky-line: var(--line); border-radius: var(--radius-lg); background: var(--paper); box-shadow: var(--shadow-card); }
.lesson-new-head h2 { font-family: var(--font-body); font-weight: 700; letter-spacing: -0.025em; }
.lesson-pick { border-radius: var(--radius-md); background: var(--paper); }
.lesson-pick:hover { border-color: var(--line-strong); }
.lesson-pick.is-on { background: var(--primary-soft-2); border-color: var(--primary); }
.lesson-start-btn { border-radius: var(--radius-sm); box-shadow: 0 6px 16px -10px rgba(25, 69, 239, 0.7); }
.lesson-start-btn:disabled { background: #B8C6F5; }

/* ---- numbers: Onest ---- */
.page-no, .solve-timer, .result-ring, .pin-cell, .pin-big span, .week-no, .book-spine, .abacus-now b, .rating-top-stars, .stat b { font-family: var(--font-body); }
.page-no { font-weight: 700; letter-spacing: -0.02em; }
.solve-timer { font-weight: 700; color: var(--primary-deep); }
.result-ring { font-weight: 700; border-radius: 50%; border-width: 4px; }
.result-ring small { font-weight: 600; }
.week-no { border-radius: var(--radius-md); background: var(--primary); }
.book-spine { border-radius: 6px; font-weight: 700; }
.pin-cell { font-weight: 700; border-width: 1px; border-radius: var(--radius-md); background: var(--paper); }
.pin-cell:focus { box-shadow: 0 0 0 4px var(--primary-soft); }
.pin-cell.filled { background: var(--primary-soft-2); }

/* ---- login: the card on a light blue wash ---- */
.app-layout.no-shell { background: linear-gradient(160deg, #EAF0FF 0%, var(--bg) 38%, #FFFFFF 100%); min-height: 100vh; }
.app-top { background: transparent; border-bottom: 0; }
.app-brand { font-family: var(--font-body); font-weight: 700; letter-spacing: -0.03em; }
.login-card { border-radius: var(--radius-lg); border-color: var(--line); box-shadow: 0 18px 60px -42px rgba(25, 69, 239, 0.45), var(--shadow-card); padding: 36px 32px 30px; }
.login-card h1 { font-size: clamp(24px, 3vw, 30px); letter-spacing: -0.035em; }
.login-art span { background: var(--primary-soft); box-shadow: none; }
.login-art span:nth-child(2), .login-art span:nth-child(4) { background: var(--gold); }
.login-art span:nth-child(3) { background: var(--primary); }

/* ---- phone: the tab bar and the «Меню» sheet ---- */
@media (max-width: 900px) {
  .app-tabbar { padding: 4px 6px calc(4px + env(safe-area-inset-bottom, 0px)); border-top-color: var(--line); background: rgba(255, 255, 255, 0.96); -webkit-backdrop-filter: saturate(1.4) blur(12px); backdrop-filter: saturate(1.4) blur(12px); }
  .tab-item { min-height: 54px; gap: 4px; color: var(--ink-muted); font-size: 11px; font-weight: 500; border-radius: 0; }
  .tab-item .icon { stroke-width: 1.8; }
  .tab-item.is-active { color: var(--primary); font-weight: 650; }
  .tab-item.is-active .icon { stroke-width: 2.4; }
  .sidebar { width: min(320px, 86vw); padding-top: env(safe-area-inset-top, 0px); }
  .sidebar.is-open { box-shadow: 0 0 0 1px var(--line), var(--shadow-md); }
  .sidebar-scrim { background: rgba(245, 247, 255, 0.6); }
  .app-main { padding: 20px 16px 64px; }
  .has-tabbar .app-main { padding-top: calc(20px + env(safe-area-inset-top, 0px)); }
}
@media (max-width: 480px) { .app-main { padding-left: 14px; padding-right: 14px; } }

/* ---- the live-lesson strip ---- */
.lesson-bar { border-bottom-color: #C5E6D3; }
.lesson-bar .lesson-timer { border-radius: var(--radius-xs); }

/* ---- tables ---- */
.table-scroll { border-radius: var(--radius-md); border-color: var(--line); }
.results-table th { color: var(--ink-muted); font-weight: 600; }
.book-table thead th { color: var(--ink-soft); font-weight: 600; }
.book-table .th-no, .book-table .td-no { color: var(--ink-muted); }

/* student home: the three numbers as SabaqLab's KPI tiles (the homework rows reuse .stars-cell as an inline group, so
   the strip's cells are scoped: they stack and may wrap on a narrow phone instead of running off the screen) */
.stars-strip .stars-cell { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; padding: 14px 16px; border-radius: var(--radius-lg); white-space: normal; text-align: left; box-shadow: var(--shadow-card); }
.stars-strip .stars-cell-v { justify-content: flex-start; font-family: var(--font-body); font-size: 26px; letter-spacing: -0.02em; }
.stars-strip .stars-cell-l { margin: 0; font-size: 13px; font-weight: 500; color: var(--ink-soft); overflow-wrap: anywhere; }
@media (max-width: 480px) {
  .stars-strip { gap: 8px; }
  .stars-strip .stars-cell { padding: 12px 12px; }
  .stars-strip .stars-cell-v { font-size: 22px; gap: 5px; }
  .stars-strip .stars-cell-v svg { width: 18px; height: 18px; }
  .stars-strip .stars-cell-l { font-size: 12px; line-height: 1.3; }
}
@media (max-width: 420px) { .access-level { flex-wrap: wrap; } .access-level-books { flex: 1 1 auto; flex-wrap: wrap; justify-content: flex-end; } }

/* numbers that stand alone (big counts, prices, the flash number, a level) are proportional even where an older rule
   asked for tabular figures (see .tnum above) */
.plan-card-n, .stars-cell-v, .rating-top-stars, .result-ring, .abacus-now b, .flash-num, .table-task, .formula-task b, .page-no, .week-no, .dash-rank, .rating-top-rank, .count-pill, .star-chip, .kpi b, .kpi-n { font-variant-numeric: proportional-nums lining-nums; }
.plan-card-n, .flash-num, .table-task, .formula-task b { letter-spacing: -0.02em; }
.setting-card > .setting-row:first-child { border-top: 0; }
/* The lesson screen without a lesson: the start card and the history under it are two mains; the redesign's .app-main
   padding (above) had won over their own, leaving ~150 px of air between them. */
.app-main.lesson-new-main, .has-tabbar .app-main.lesson-new-main { padding-bottom: 8px; }
.app-main.past-list-main, .has-tabbar .app-main.past-list-main { padding-top: 0; }

/* students list: one grid on every row, fixed tracks (avatar · name · stars · homework · last seen · code · chevron), so
   the columns line up whatever the values; each value sits on a line of the same height over its caption. The stats'
   wrapper is not a box on the wide layouts (display: contents). Narrower: no «Был(-а) в сети»; a phone: name and code
   on top, stars and homework under the name in two fixed columns. */
.student-row { grid-template-columns: 44px minmax(0, 1fr) 76px 196px 140px 124px 18px; column-gap: 16px; align-items: center; }
.student-row .student-avatar { width: 44px; height: 44px; }
.student-stats { display: contents; }
.student-stats .stat { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 0; }
.stat .stat-v { display: flex; align-items: center; min-height: 24px; max-width: 100%; font-size: 14px; font-weight: 600; white-space: nowrap; }
.stat b.stat-v { font-size: 14px; }
.stat-hw .badge { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat-hw .stat-v > .muted { font-weight: 500; font-size: 13.5px; }
.student-pin { display: flex; justify-content: flex-start; min-width: 0; }
.student-row .pin-chip { min-width: 108px; justify-content: space-between; }
.student-main { min-width: 0; }
.student-name, .student-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 1180px) {
  .student-row { grid-template-columns: 44px minmax(0, 1fr) 76px 196px 124px 18px; }
  .student-stats .stat-seen { display: none; }
}
@media (max-width: 720px) {
  .student-row { grid-template-columns: 40px minmax(0, 1fr) auto; grid-template-rows: auto auto; column-gap: 12px; row-gap: 10px; padding: 12px 14px; }
  .student-row .student-avatar { width: 40px; height: 40px; font-size: 16px; }
  .student-avatar { grid-row: 1; }
  .student-main { grid-row: 1; grid-column: 2; }
  .student-pin { grid-row: 1; grid-column: 3; justify-content: flex-end; }
  .student-row .pin-chip { min-width: 112px; }
  .student-stats { display: grid; grid-row: 2; grid-column: 2 / -1; grid-template-columns: 64px minmax(0, 1fr); column-gap: 14px; }
  .student-row > .icon { display: none; }
}

/* students «По уровням»: a card per level with its count, the rows inside lighter */
.students-tools { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.students-tools .students-search { flex: 1 1 280px; margin-bottom: 0; }
.students-view { flex: none; margin-left: auto; }
.student-groups { display: flex; flex-direction: column; gap: 16px; }
.student-group { padding: 16px 16px 14px; }
.student-group-title { display: flex; align-items: baseline; gap: 10px; margin: 0 4px 12px; font-size: 17px; font-weight: 700; }
.student-group-n { color: var(--ink-muted); font-size: 13.5px; font-weight: 500; }
.student-group .student-list { gap: 8px; }
.student-group .student-row { box-shadow: none; background: var(--paper); }
.student-group .student-row:hover { background: var(--primary-soft-2); }
@media (max-width: 720px) {
  .students-view { margin-left: 0; }
  .student-group { padding: 12px 10px 10px; }
  .student-group-title { margin: 2px 6px 10px; font-size: 16px; }
}

/* billing: the plans as SabaqLab's tariff cards (its .tier in account.css), in ISMA's colours (no lime): the period
   switch with discount pills, Free Trial muted, Premium filled blue, «Ваш тариф» on the current one. Five in a row from
   880 px of room (the settings column), else a row that scrolls sideways with snapping (a phone, a tablet). */
.tiers { margin-top: 20px; }
.tiers-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.tiers-head .section-title { margin: 0; }
.tier-periods button { display: inline-flex; align-items: center; gap: 6px; }
.period-off { padding: 1px 6px; border-radius: 999px; background: var(--primary-soft); color: var(--primary-deep); font-size: 11.5px; font-style: normal; font-weight: 700; line-height: 16px; }
.tier-scroll { container-type: inline-size; }
.tier-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
@container (max-width: 879px) {
  .tier-row { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: 2px; padding: 4px 2px 12px; margin: -4px -2px 0; scrollbar-width: thin; }
  .tier { flex: 0 0 min(236px, 78%); scroll-snap-align: start; }
}
.tier { position: relative; display: flex; flex-direction: column; gap: 8px; min-width: 0; padding: 20px 16px 16px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--paper); box-shadow: var(--shadow-card); }
.tier-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-height: 24px; }
.tier h3 { margin: 0; font-size: 17px; font-weight: 700; letter-spacing: -0.01em; white-space: nowrap; }
.tier-flag { padding: 2px 8px; border-radius: 999px; background: var(--primary-soft); color: var(--primary-deep); font-size: 11.5px; font-weight: 650; white-space: nowrap; }
.tier-old { display: flex; align-items: center; gap: 6px; min-height: 20px; color: var(--ink-muted); font-size: 13px; line-height: 20px; }
.tier-off { padding: 0 6px; border-radius: 999px; background: var(--primary); color: #fff; font-size: 11px; font-style: normal; font-weight: 700; line-height: 18px; white-space: nowrap; }
.tier-price { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-height: 54px; }
.tier-price b { font-size: 28px; line-height: 1.15; letter-spacing: -0.03em; font-weight: 700; }
.tier-price span { color: var(--ink-soft); font-size: 13px; white-space: nowrap; }
.tier-sub { min-height: 20px; color: var(--ink-soft); font-size: 12.5px; line-height: 20px; }
.tier ul { display: flex; flex: 1 1 auto; flex-direction: column; gap: 8px; margin: 4px 0; padding: 0; list-style: none; }
.tier li { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; line-height: 1.4; color: var(--ink); }
.tier li .icon { flex: none; margin-top: 1px; color: var(--primary); }
.tier-note { color: var(--ink-muted); font-size: 12px; line-height: 1.35; }
.tier .tier-go { width: 100%; }
.tier-state { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; border-radius: var(--radius-sm); background: var(--paper); color: var(--ink-muted); font-size: 13px; font-weight: 600; }
.tier.is-trial { background: var(--bg-alt); border-color: transparent; box-shadow: none; }
.tier.is-trial .tier-price b, .tier.is-trial h3 { color: var(--ink-soft); }
.tier.is-trial li .icon { color: var(--ink-muted); }
.tier.is-current { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary), 0 10px 28px rgba(33, 71, 245, 0.16); }
.tier.is-trial.is-current { background: var(--paper); }
.tier.is-trial.is-current .tier-state { background: var(--primary-soft); color: var(--primary-deep); }
.tier.is-trial.is-current .tier-state::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.tier.is-featured { border-color: var(--primary); background: var(--primary); color: #fff; box-shadow: 0 12px 30px rgba(33, 71, 245, 0.26); }
.tier.is-featured h3, .tier.is-featured li, .tier.is-featured .tier-price b { color: #fff; }
.tier.is-featured .tier-price span, .tier.is-featured .tier-sub, .tier.is-featured .tier-old, .tier.is-featured .tier-note { color: rgba(255, 255, 255, 0.8); }
.tier.is-featured li .icon { color: #fff; }
.tier.is-featured .tier-off { background: #fff; color: var(--primary-deep); }
.tier.is-featured .tier-flag { background: rgba(255, 255, 255, 0.2); color: #fff; }
.tier.is-featured .tier-go { background: #fff; border-color: #fff; color: var(--primary-deep); }
.tier.is-featured .tier-go:hover:not(:disabled) { background: var(--primary-soft); border-color: var(--primary-soft); }
.tier.is-featured.is-current { box-shadow: 0 0 0 3px var(--primary-soft), 0 12px 30px rgba(33, 71, 245, 0.3); }
.tier .tier-go:disabled { opacity: 1; background: var(--bg-alt); border-color: var(--line); color: var(--ink-muted); }
.tier.is-featured .tier-go:disabled { background: rgba(255, 255, 255, 0.16); border-color: transparent; color: rgba(255, 255, 255, 0.85); }
.tiers-note { margin: 10px 0 0; }
.tiers-offer { margin: 12px 0 0; }
.tiers-offer a { color: var(--primary); text-decoration: underline; text-underline-offset: 2px; }
@media (max-width: 720px) {
  .tiers-head .tier-periods { width: 100%; }
  .tier-periods button { flex: 1 1 0; justify-content: center; gap: 4px; padding: 0 4px; font-size: 12.5px; white-space: nowrap; }
  .tier-periods .period-off { padding: 1px 4px; font-size: 10.5px; }
}

/* ---- settings 2026-11-07: SabaqLab's account pages (account.css) in ISMA's colours ----
   Tabs with icons (user, card, shield); a lead under «Настройки»; .acc-row = SabaqLab .form-row (a label with a grey hint
   on the left, the value or the control on the right, one column on a phone); .acc-info = .info-row (an icon tile, a
   title and a grey line, a button on the right); initials on soft blue. */
.account-tabs .tab { gap: 8px; }
.account-tabs .tab .icon { flex: none; color: var(--ink-faint); transition: color 0.12s; }
.account-tabs .tab.is-active .icon { color: var(--primary); }
.tabs.account-tabs.is-two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.app-main.account .page-head h1 + p { margin: 4px 0 0; font-size: 14.5px; }
.acc-card { padding-bottom: 8px; }
.acc-row { display: grid; grid-template-columns: minmax(170px, 250px) minmax(0, 1fr); gap: 6px 28px; align-items: center; min-height: 60px; padding: 12px 0; border-top: 1px solid var(--line-2); }
.acc-row-label { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.acc-row-label b, .acc-row-label label { font-size: 14.5px; font-weight: 600; color: var(--ink); }
.acc-row-label span { font-size: 12.5px; line-height: 1.4; color: var(--ink-muted); }
.acc-row-control { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; min-width: 0; }
.acc-row-control.setting-control { margin-left: 0; }
.acc-value { font-size: 15px; font-weight: 500; color: var(--ink); overflow-wrap: anywhere; }
.acc-value.is-empty { color: var(--ink-muted); font-weight: 400; }
.acc-avatar-row { display: flex; align-items: center; gap: 14px; min-width: 0; }
.acc-avatar { flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--primary-soft); color: var(--primary-deep); font-weight: 700; letter-spacing: 0.01em; }
.acc-avatar-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.acc-avatar-text .acc-value { font-size: 16px; font-weight: 600; }
.acc-sub { font-size: 13px; color: var(--ink-muted); }
.acc-lang button { min-height: 34px; padding: 0 14px; }
.acc-info { display: flex; align-items: center; gap: 14px; min-height: 68px; padding: 14px 0; border-top: 1px solid var(--line-2); }
.acc-info-icon { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--bg-alt); color: var(--ink-soft); }
.acc-info-main { flex: 1 1 auto; min-width: 0; }
.acc-info-main b { display: block; font-size: 14.5px; font-weight: 600; color: var(--ink); }
.acc-info-main p { margin: 2px 0 0; font-size: 13px; line-height: 1.45; color: var(--ink-muted); overflow-wrap: anywhere; }
.acc-info > .btn { flex: none; }
.acc-code { flex: none; display: flex; align-items: center; gap: 4px; padding: 2px 2px 2px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg); }
.acc-code-value { min-width: 4.2em; font-size: 18px; font-weight: 700; letter-spacing: 0.14em; color: var(--ink); }
.acc-code-value.is-hidden { letter-spacing: 0.22em; color: var(--ink-soft); }
.acc-eye { width: 36px; padding: 0; justify-content: center; color: var(--ink-soft); }
.acc-eye:hover { color: var(--primary); }
@media (max-width: 640px) {
  .acc-row { grid-template-columns: minmax(0, 1fr); gap: 8px; min-height: 0; }
  .acc-info { flex-wrap: wrap; }
  .acc-info > .btn, .acc-info > .acc-code { margin-left: 54px; }
  /* a phone: the icon over the label, a long label on two lines (all three tabs stay in sight) */
  .account-tabs .tab { flex-direction: column; gap: 3px; height: auto; min-height: 58px; padding: 7px 6px; font-size: 12.5px; line-height: 1.2; white-space: normal; text-align: center; }
  .tabs.account-tabs.is-two .tab { flex-direction: row; gap: 8px; min-height: 46px; font-size: 13.5px; }
}

/* self-study «Доступ»: the terms as the teacher's tariff cards (.tier), three in a row, one under another on a phone;
   6 months is the featured blue card. */
.solo-tiers { margin-top: 0; }
.tier-row.solo-tier-row { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.solo-tier { padding: 22px 20px 18px; gap: 10px; }
.solo-tier h3 { font-size: 19px; }
.solo-tier .tier-price b { font-size: 34px; }
.solo-tier .tier-price span, .solo-tier .tier-sub { font-size: 13.5px; }
.solo-tier li { font-size: 14px; }
.solo-tier .tier-go { min-height: 48px; font-size: 16px; }
.solo-tier .solo-wa { min-height: 48px; font-size: 15px; }
.solo-tier.is-featured .tier-flag { background: #fff; color: var(--primary-deep); }
@container (max-width: 879px) {
  .tier-row.solo-tier-row { display: grid; overflow: visible; padding: 0; margin: 0; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .solo-tier-row .tier { flex: none; }
}
@container (max-width: 640px) {
  .tier-row.solo-tier-row { grid-template-columns: minmax(0, 1fr); }
}
.solo-pay-embedded { display: flex; flex-direction: column; gap: 20px; }
.solo-pay .pay-row > .icon { margin-left: auto; color: var(--ink-faint); }
.solo-pay .pay-row.is-open > .icon { color: var(--primary); }
@container (max-width: 640px) {
  .solo-tier .tier-old:empty, .solo-tier .tier-sub:empty { display: none; }
}

/* ---- flash «столбиком» without a timer: the column stays with the answer field (under it on a phone, beside it on a laptop) ---- */
.flash-stage.is-still { min-height: 0; padding: 4px 0; container-type: normal; } /* sized by its column, not by the row */
.flash-stage.is-still .flash-col { font-size: clamp(16px, calc((100svh - 620px) / (var(--rows) + 0.6)), 64px); }
.flash-stage.is-still .flash-col-num { white-space: nowrap; }
.app-main.trainer .flash-stage.is-still { flex: 0 0 auto; }
@media (max-width: 900px) { /* a phone: the field and «Ответить» in one row, so the keypad fits under the column */
  .app-main.trainer .trainer-stage.is-free .flash-input { width: 160px; min-height: 68px; font-size: 34px; }
  .app-main.trainer .trainer-stage.is-free .flash-answer .btn { min-height: 68px; font-size: 18px; padding: 0 20px; }
}
@media (min-width: 901px) {
  .flash-stage.is-still .flash-col { font-size: clamp(18px, calc((100svh - 300px) / (var(--rows) + 0.6)), 80px); }
  .lesson-panel.flash-free, .app-main.trainer .trainer-stage.is-free { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: center; gap: 24px 56px; }
  .lesson-panel.flash-free > .flash-stage, .trainer-stage.is-free > .flash-stage { flex: none; }
}

/* ---- the teacher types a student's answer (said on a video call): a small field and ✓ in the student's row ---- */
.flash-ans.is-for { padding-top: 5px; padding-bottom: 5px; }
.ans-for { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; }
.ans-for-input.input { width: 84px; min-height: 34px; height: 34px; padding: 0 8px; font-size: 15px; font-weight: 700; text-align: center; border-radius: 10px; }
.ans-for-ok { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border: 0; border-radius: 10px; background: var(--primary); color: #fff; cursor: pointer; }
.ans-for-ok:disabled { background: var(--line); color: var(--ink-muted); cursor: default; }
.ans-for-ok:focus-visible, .ans-for-edit:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.ans-for-edit { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; margin-left: -4px; border: 0; border-radius: 8px; background: transparent; color: inherit; opacity: 0.7; cursor: pointer; }
.ans-for-edit:hover { opacity: 1; background: rgba(255, 255, 255, 0.6); }
.by-teacher { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; border-radius: 50%; background: rgba(33, 71, 245, 0.12); color: var(--primary-deep); flex: none; vertical-align: middle; }
.hist-cell .by-teacher, .hist-chip .by-teacher { margin-left: 4px; }

/* ---- hero abacus on the teacher's «Главная»: beads glide to each number of the sequence (DashAbacus) ---- */
.dash-abacus path.db { animation: none; }
.dash-abacus path.db.is-on:not(.rod) { fill: var(--gold); }
.dash-abacus.is-moving path.db { transition: transform 0.9s cubic-bezier(0.5, 0, 0.15, 1), fill 0.6s ease; will-change: transform; }
@media (prefers-reduced-motion: reduce) { .dash-abacus path.db { transition: none; } }

/* ---- weekly limits, «Новый код», the student's sessions (server/src/limits.js, sessions.js) ---- */
.lesson-pick-main .lesson-pick-left { color: var(--primary-deep); font-weight: 600; white-space: normal; }
.lesson-pick.is-limit { cursor: not-allowed; opacity: 0.55; background: var(--bg); }
.lesson-pick.is-limit:hover { border-color: var(--sky-line); background: var(--bg); }
.lesson-pick.is-limit .lesson-pick-left { color: var(--ink-muted); }
.lesson-pick.is-limit .lesson-pick-check { visibility: hidden; }
.assign-student.is-limit { cursor: not-allowed; opacity: 0.55; }
.modal p .modal-note { display: block; margin-top: 10px; font-size: 14px; font-weight: 600; color: var(--ink-muted); }
.modal p .modal-note + .modal-note { margin-top: 2px; font-weight: 500; }
.modal p .modal-note.is-out { color: var(--bad-ink); }
.limit-reset { margin: -8px 0 14px; font-size: 13px; color: var(--ink-muted); }
.members-edit + .limit-reset { margin: 6px 0 0; }
.dash-foot .limit-reset { margin: 0; }
.dash-limit { color: var(--ink-muted); }
.dash-limit.is-out { font-weight: 600; }
.modal .new-pin { margin: 14px 0 4px; font-size: 34px; font-weight: 700; letter-spacing: 0.18em; color: var(--ink); text-align: center; }
.page-head .kicker.student-code { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.page-head .kicker.student-code .link-btn { text-transform: none; letter-spacing: normal; }
.modal.student-sessions { width: min(560px, 100%); }
.modal.student-sessions .session-list { margin: 12px 0 0; }
.modal.student-sessions .setting-row { gap: 12px; }
