:root {
  --ink: #102033;
  --ink-soft: #334155;
  --muted: #64748b;
  --faint: #64748b;
  --line: #dbe7ff;
  --line-strong: #c7d6e6;
  --canvas: #f8fbff;
  --surface: #ffffff;
  --surface-soft: #eff6ff;
  --green: #18794e;
  --green-dark: #11613e;
  --green-soft: #e8f5ed;
  --green-pale: #f2faf5;
  --red: #c73d45;
  --red-soft: #fff0f1;
  --amber: #b56c16;
  --amber-soft: #fff7e8;
  --blue: #174eb6;
  --blue-dark: #0d347d;
  --blue-soft: #eff6ff;
  --warm: #fff7e9;
  --warm-soft: #fffbf5;
  --shadow-sm: 0 1px 2px rgba(16, 32, 51, .05);
  --shadow-md: 0 8px 24px rgba(13, 52, 125, .09);
  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 10px;
  --header-height: 58px;
  --quick-bar-height: 44px;
  --curriculum-bar-height: 42px;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--canvas); }

/* На узком экране полоса прокрутки уменьшает clientWidth. Жёсткие 320px у html
   тогда создают горизонтальную прокрутку даже при полностью адаптивном содержимом. */
@media (max-width: 520px) {
  html { min-width: 0; }
}
body { margin: 0; color: var(--ink); background: var(--canvas); font: 15px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; }
button, summary, label, select { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid rgba(24,121,78,.35); outline-offset: 3px; }
a { color: var(--green); text-underline-offset: 3px; }
a:hover { color: var(--green-dark); }
[hidden] { display: none !important; }
::selection { background: #ccebd8; color: var(--ink); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* Header and navigation */
.app-header {
  position: sticky; top: 0; z-index: 40; min-height: var(--header-height); padding: 0 24px;
  display: flex; align-items: center; gap: 28px; background: rgba(255, 255, 255, .94);
  border-bottom: 1px solid var(--line); box-shadow: 0 1px 0 rgba(28, 47, 35, .02); backdrop-filter: blur(16px);
}
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; flex: 0 0 auto; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; color: #fff; background: linear-gradient(145deg, #208a5a, #126a43); font-size: 17px; font-weight: 800; box-shadow: 0 6px 18px rgba(24, 121, 78, .2); }
.brand-copy { display: grid; line-height: 1.15; }
.brand-copy strong { font-size: 16px; letter-spacing: -.01em; }
.brand-copy small { margin-top: 4px; color: var(--muted); font-size: 11px; white-space: nowrap; }
.main-nav { display: flex; align-self: stretch; gap: 4px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.main-nav::-webkit-scrollbar { display: none; }
.tab { position: relative; flex: 0 0 auto; padding: 0 14px; display: flex; align-items: center; justify-content: center; border: 0; color: var(--muted); background: transparent; cursor: pointer; font-size: 13px; font-weight: 650; text-decoration: none; white-space: nowrap; transition: color .16s, background .16s; }
.tab::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: transparent; }
.tab:hover { color: var(--ink); background: var(--surface-soft); }
.tab.active { color: var(--green-dark); }
.tab.active::after { background: var(--green); }
.settings-nav { flex: 0 0 auto; width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); background: var(--surface); cursor: pointer; font-size: 17px; }
.settings-nav { text-decoration: none; }
.settings-nav:hover, .settings-nav.active { color: var(--green-dark); border-color: #a9cbb6; background: var(--green-pale); }
.header-account { margin-left: auto; display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.account-avatar { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 10px; color: var(--green-dark); background: var(--green-soft); font-size: 12px; font-weight: 850; text-transform: uppercase; }
.account-name { max-width: 130px; overflow: hidden; color: var(--ink-soft); font-size: 12px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.account-logout { min-height: 31px; padding: 5px 9px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: var(--surface); cursor: pointer; font-size: 11px; font-weight: 700; }
.account-logout:hover { color: var(--red); border-color: #e5b8bb; background: var(--red-soft); }
.quick-actions {
  position: sticky; top: var(--header-height); z-index: 35; min-height: var(--quick-bar-height); padding: 7px 24px;
  display: flex; align-items: center; justify-content: center; gap: 7px; overflow-x: auto; background: rgba(245,247,245,.96);
  border-bottom: 1px solid var(--line); box-shadow: 0 5px 16px rgba(25,48,34,.035); scrollbar-width: none; backdrop-filter: blur(12px);
}
.quick-actions::-webkit-scrollbar { display: none; }
.quick-actions-label { margin-right: 3px; color: var(--faint); font-size: 10px; font-weight: 850; letter-spacing: .09em; text-transform: uppercase; }
.quick-action {
  min-height: 36px; padding: 6px 12px 6px 8px; display: inline-flex; align-items: center; gap: 7px; flex: 0 0 auto;
  border: 1px solid var(--line); border-radius: 10px; color: var(--ink-soft); background: var(--surface); cursor: pointer;
  font-size: 12px; font-weight: 750; box-shadow: var(--shadow-sm); transition: border-color .15s, background .15s, transform .15s;
}
.quick-actions a.quick-action { color: var(--ink-soft); text-decoration: none; }
.quick-action:hover { transform: translateY(-1px); border-color: #b5cbbd; background: var(--green-pale); }
.quick-action.active { color: var(--green-dark); border-color: #9fc8ae; background: var(--green-soft); }
.quick-action-icon { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 7px; color: var(--green-dark); background: var(--green-soft); font-size: 12px; font-weight: 900; }
.quick-review-badge { display: inline-grid; min-width: 21px; height: 21px; padding: 0 6px; place-items: center; border-radius: 99px; color: #fff; background: #c94c3e; font-size: 11px; font-weight: 900; line-height: 1; box-shadow: 0 2px 7px rgba(160, 52, 40, .22); }
.quick-review-badge[hidden] { display: none; }
.curriculum-grade-bar {
  position: sticky; top: calc(var(--header-height) + var(--quick-bar-height)); z-index: 34;
  min-height: var(--curriculum-bar-height); padding: 7px 24px; display: flex; align-items: center; justify-content: center; gap: 14px;
  border-bottom: 1px solid var(--line); background: rgba(255,255,255,.96); box-shadow: 0 5px 16px rgba(25,48,34,.025); backdrop-filter: blur(12px);
}
.curriculum-grade-bar > span { display: grid; line-height: 1.1; }
.curriculum-grade-bar > span strong { font-size: 12px; }
.curriculum-grade-bar > span small,.curriculum-grade-note { color: var(--muted); font-size: 10px; }
.curriculum-grade-switch { padding: 3px; display: inline-flex; gap: 3px; border: 1px solid var(--line); border-radius: 11px; background: #eef3ef; }
.curriculum-grade-switch button { min-width: 45px; min-height: 31px; padding: 4px 12px; border: 0; border-radius: 8px; color: var(--muted); background: transparent; cursor: pointer; font-size: 12px; font-weight: 800; }
.curriculum-grade-switch button:hover { color: var(--green-dark); background: var(--green-pale); }
.curriculum-grade-switch button.active { color: #fff; background: var(--green); box-shadow: 0 2px 8px rgba(24,121,78,.2); }
.curriculum-grade-switch button:focus-visible { outline: 3px solid rgba(24,121,78,.28); outline-offset: 2px; }

/* Main shell */
.app-shell { display: grid; grid-template-columns: 390px minmax(0, 1fr); min-height: calc(100vh - var(--header-height) - var(--quick-bar-height) - var(--curriculum-bar-height)); }
.app-shell.wide { grid-template-columns: minmax(0, 1fr); }
.app-shell.wide .content { width: min(100%, 1240px); margin: 0 auto; }
.filter-sidebar { position: sticky; top: calc(var(--header-height) + var(--quick-bar-height) + var(--curriculum-bar-height)); align-self: start; height: calc(100vh - var(--header-height) - var(--quick-bar-height) - var(--curriculum-bar-height)); padding: 24px 22px 40px; overflow: auto; background: #fbfcfb; border-right: 1px solid var(--line); scrollbar-color: #cfd9d2 transparent; scrollbar-width: thin; }
.aside-title { display: flex; align-items: center; justify-content: space-between; margin: 0 5px 18px; }
.aside-title > div { display: grid; gap: 2px; }
.aside-title strong { font-size: 18px; letter-spacing: -.02em; }
.eyebrow { color: var(--green); font-size: 11px; line-height: 1.2; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.icon { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); color: var(--green); cursor: pointer; font-size: 21px; line-height: 1; box-shadow: var(--shadow-sm); transition: transform .15s, border-color .15s, background .15s; }
.icon:hover { transform: translateY(-1px); border-color: #a9cbb6; background: var(--green-pale); }
.search-field { position: relative; display: block; }
.search-field::before { content: "⌕"; position: absolute; left: 13px; top: 8px; z-index: 1; color: var(--muted); font-size: 20px; transform: rotate(-18deg); pointer-events: none; }
.filter-search { width: 100%; padding-left: 39px !important; margin: 0 !important; background: var(--surface) !important; }
.filter-help { margin: 9px 8px 14px; color: var(--faint); font-size: 11px; }
.school-quick-filter { margin: 0 0 16px; padding: 12px; border: 1px solid #c9ddd0; border-radius: 13px; background: linear-gradient(145deg,#edf8f1,#f9fcfa); box-shadow: var(--shadow-sm); }
.school-quick-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.school-quick-head > span { display: grid; }
.school-quick-head small { color: var(--green); font-size: 9px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.school-quick-head strong { font-size: 14px; }
.school-quick-head > button { padding: 6px 9px; border: 1px solid #a9cbb6; border-radius: 8px; color: var(--green-dark); background: #fff; cursor: pointer; font-size: 11px; font-weight: 800; }
.school-quick-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.school-quick-list button { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 6px 8px 6px 10px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink-soft); background: #fff; cursor: pointer; font-size: 11px; font-weight: 750; box-shadow: var(--shadow-sm); }
.school-quick-list button:hover { border-color: #8fbea1; background: var(--green-soft); }
.school-quick-head > button:focus-visible,.school-quick-list button:focus-visible,.builder-mode-switch button:focus-visible { outline: 3px solid rgba(42,126,78,.24); outline-offset: 2px; }
.school-quick-list b { min-width: 20px; padding: 2px 5px; border-radius: 99px; color: var(--green-dark); background: var(--green-soft); font-size: 10px; text-align: center; }
.school-quick-empty { color: var(--muted); font-size: 11px; }
.school-specific-profiles{margin:-5px 0 16px;padding:12px;border:1px solid #d8d0ee;border-radius:13px;background:linear-gradient(145deg,#f4f0ff,#fff)}.school-specific-profiles>div:first-child{display:grid}.school-specific-profiles small{color:#674ca1;font-size:9px;font-weight:850;letter-spacing:.08em;text-transform:uppercase}.school-specific-profiles strong{font-size:14px}.school-specific-profiles p{margin:5px 0 9px;color:var(--muted);font-size:11px}.school-profile-options{display:flex;flex-wrap:wrap;gap:6px}.school-profile-options button{padding:7px 10px;border:1px solid #d2c8ea;border-radius:99px;color:#57418d;background:#fff;cursor:pointer;font-size:11px;font-weight:800}.school-profile-options button.active{border-color:#765ab2;color:#fff;background:#765ab2}
.tag-match-control { margin: 0 0 16px; padding: 4px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; border: 1px solid var(--line); border-radius: 11px; background: #eef3ef; }
.tag-match-control legend { width: 100%; padding: 0 4px 6px; color: var(--muted); font-size: 11px; font-weight: 750; }
.tag-match-control label { position: relative; cursor: pointer; }
.tag-match-control input { position: absolute; opacity: 0; pointer-events: none; }
.tag-match-control span { min-height: 34px; display: grid; place-items: center; padding: 6px 10px; border-radius: 8px; color: var(--muted); font-size: 12px; font-weight: 750; transition: color .15s, background .15s, box-shadow .15s; }
.tag-match-control input:checked + span { color: var(--green-dark); background: var(--surface); box-shadow: var(--shadow-sm); }
.tag-match-control input:focus-visible + span { outline: 3px solid rgba(24,121,78,.35); outline-offset: 1px; }
.direction-group .super-entity-heading { cursor: default; }
.direction-group .super-entity-chevron { display: none; }
.entity[data-role="direction"] { margin: 0 0 12px; border: 0; background: transparent; }
.entity[data-role="direction"] .entity-head,
.entity[data-role="direction"] .add-tag,
.entity[data-role="direction"] .all-entity-tasks { display: none; }
.entity[data-role="direction"] .tags { padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.entity[data-role="direction"] .tag { min-height: 43px; margin: 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); box-shadow: var(--shadow-sm); }
.entity[data-role="direction"] .tag.selected { border-color: #95c5a7; background: var(--green-soft); }
.entity[data-role="direction"] .tag button { display: none; }
.entity[data-role="topic"] .entity-actions,
.entity[data-role="idea"] .entity-actions,
.entity[data-role="structure"] .entity-actions { display: none; }
.content { width: 100%; max-width: 1180px; min-width: 0; padding: 34px 44px 90px; }
.toolbar { min-height: 42px; margin-bottom: 20px; padding: 8px 10px 8px 13px; display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); background: rgba(255, 255, 255, .72); border: 1px solid var(--line); border-radius: 12px; font-size: 13px; }
.toolbar > div { display: flex; align-items: center; gap: 9px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px var(--green-soft); }
.section-tabs { min-height: 42px; margin: 0 2px 22px; padding: 4px; display: inline-flex; align-items: center; gap: 3px; border: 1px solid var(--line); border-radius: 12px; background: #edf2ee; }
.section-tab { min-height: 32px; padding: 5px 12px; border: 0; border-radius: 9px; color: var(--muted); background: transparent; cursor: pointer; font-size: 12px; font-weight: 750; white-space: nowrap; }
.section-tab:hover { color: var(--ink); }
.section-tab.active { color: var(--green-dark); background: var(--surface); box-shadow: var(--shadow-sm); }
.student-section-tabs, .material-section-tabs { margin-bottom: 20px; }
.material-section-tabs { max-width: 100%; overflow-x: auto; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin: 0 2px 24px; }
.page-heading h1 { margin: 5px 0 3px; font-size: clamp(25px, 3vw, 34px); line-height: 1.15; letter-spacing: -.035em; }
.page-heading p { max-width: 660px; margin: 0; color: var(--muted); }
.compact-heading { margin-bottom: 19px; }
.builder-mode-switch { width: fit-content; margin: 0 2px 18px; padding: 4px; display: flex; gap: 3px; border: 1px solid var(--line); border-radius: 11px; background: #edf2ee; }
.builder-mode-switch button { min-height: 34px; padding: 6px 12px; border: 0; border-radius: 8px; color: var(--muted); background: transparent; cursor: pointer; font-size: 12px; font-weight: 800; }
.builder-mode-switch button.active { color: var(--green-dark); background: #fff; box-shadow: var(--shadow-sm); }
.surface { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.editor-card { padding: 24px; }

/* Fields and controls */
input, textarea, select { width: 100%; color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 10px 12px; outline: none; transition: border-color .15s, box-shadow .15s, background .15s; }
input:hover, textarea:hover, select:hover { border-color: #aebeb3; }
input:focus, textarea:focus, select:focus { border-color: #70a98a; box-shadow: 0 0 0 4px rgba(24, 121, 78, .1); }
input::placeholder, textarea::placeholder { color: #9aa59e; }
input:disabled, textarea:disabled, select:disabled { color: #657168; background: #eef2ef; cursor: not-allowed; }
textarea { min-height: 112px; resize: vertical; }
.field-label { display: block; margin: 0 0 7px; color: var(--ink-soft); font-size: 12px; font-weight: 750; }
.title-input { margin-bottom: 18px; padding: 12px 14px; font-size: 18px; font-weight: 700; }
.task-body { min-height: 180px; margin-bottom: 18px; padding: 14px; line-height: 1.65; }
.editor-meta { display: grid; grid-template-columns: minmax(260px, 1fr) minmax(300px, 1fr); gap: 14px; align-items: stretch; }
.upload-field { position: relative; min-height: 74px; display: flex; align-items: center; gap: 12px; padding: 13px; border: 1px dashed #b9cabf; border-radius: 12px; background: var(--surface-soft); cursor: pointer; transition: border-color .15s, background .15s; }
.upload-field:hover { border-color: var(--green); background: var(--green-pale); }
.upload-field input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.upload-field > span:not(.upload-icon) { display: grid; }
.upload-field small, .difficulty small { color: var(--muted); font-size: 11px; }
.upload-icon { display: grid; place-items: center; width: 38px; height: 38px; flex: 0 0 auto; border-radius: 10px; background: var(--green-soft); color: var(--green); font-size: 21px; }
.difficulty { min-height: 74px; margin: 0; padding: 12px 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 12px; }
.difficulty > span { display: grid; flex: 0 0 auto; }
.difficulty > div { display: flex; gap: 6px; }
.difficulty button { width: 34px; height: 34px; padding: 0; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); cursor: pointer; font-weight: 700; transition: transform .15s, background .15s, color .15s, border-color .15s; }
.difficulty button:hover { transform: translateY(-1px); border-color: var(--green); color: var(--green); }
.difficulty button.active { color: #fff; background: var(--green); border-color: var(--green); box-shadow: 0 5px 12px rgba(24, 121, 78, .18); }
.universal-difficulty-field { min-height: 74px; padding: 12px 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; background: #f4f1ff; border: 1px solid #dcd3f7; border-radius: 12px; }
.universal-difficulty-field > span { display: grid; }
.universal-difficulty-field small { color: var(--muted); font-size: 11px; }
.universal-difficulty-field select { min-width: 120px; }
#materialPreview { margin-top: 12px; }
#materialPreview:empty { display: none; }
img.preview, .entity-material img { max-width: 100%; max-height: 220px; object-fit: contain; border-radius: 10px; }
.task-images-preview { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.task-image-preview { position: relative; margin: 0; padding: 7px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); }
.task-image-preview img { width: 100%; height: 120px; display: block; object-fit: contain; border-radius: 7px; background: #fff; }
.task-image-preview figcaption { padding: 6px 2px 0; color: var(--muted); font-size: 11px; }
.task-image-preview button { position: absolute; top: 11px; right: 11px; width: 26px; height: 26px; padding: 0; border: 0; border-radius: 8px; color: var(--red); background: rgba(255,255,255,.94); box-shadow: var(--shadow-sm); cursor: pointer; font-size: 18px; line-height: 1; }
.disclosure { margin-top: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); overflow: hidden; }
.disclosure summary { display: flex; justify-content: space-between; gap: 10px; padding: 13px 15px; cursor: pointer; font-weight: 700; list-style: none; }
.disclosure summary::-webkit-details-marker { display: none; }
.disclosure summary::after { content: "⌄"; color: var(--muted); font-size: 18px; transition: transform .15s; }
.disclosure[open] summary::after { transform: rotate(180deg); }
.disclosure summary small { margin-left: auto; color: var(--faint); font-weight: 500; }
.source-grid { display: grid; grid-template-columns: 1.3fr .7fr .55fr 1fr; gap: 9px; padding: 0 14px 14px; }
.source-grid #sourceUrl { grid-column: span 3; }
.task-school-fit { margin-top: 9px; }
.task-school-fit-body { display: grid; gap: 10px; padding: 0 14px 14px; }
.task-school-search input { width: 100%; min-height: 40px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.task-school-options { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; max-height: 280px; overflow: auto; padding: 2px; }
.target-school-choice { display: grid; grid-template-columns: 20px minmax(0,1fr); align-items: start; gap: 9px; min-width: 0; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; }
.target-school-choice:has(input:checked) { border-color: #80b995; background: #edf8f1; box-shadow: inset 0 0 0 1px #80b995; }
.target-school-choice input { width: 17px; height: 17px; margin: 2px 0 0; accent-color: var(--primary); }
.target-school-choice span { display: grid; gap: 2px; min-width: 0; }
.target-school-choice strong,.target-school-choice small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.target-school-choice strong { color: var(--text); font-size: 13px; }
.target-school-choice small,.task-school-help,.task-school-empty { color: var(--muted); font-size: 11px; }
.task-school-help,.task-school-empty { margin: 0; line-height: 1.45; }
.task-school-empty { grid-column: 1/-1; padding: 16px; border: 1px dashed var(--line); border-radius: 10px; text-align: center; }
.task-source-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 7px 12px; margin: 5px 0 8px; color: var(--muted); font-size: 11px; }
.task-source-meta a { font-weight: 700; }

/* Buttons */
.primary, .secondary { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border-radius: 10px; padding: 9px 15px; cursor: pointer; font-weight: 700; line-height: 1.1; transition: transform .15s, background .15s, border-color .15s, box-shadow .15s, color .15s; }
.primary { color: #fff; background: var(--green); border: 1px solid var(--green); box-shadow: 0 5px 14px rgba(24, 121, 78, .18); }
.primary:hover { background: var(--green-dark); border-color: var(--green-dark); transform: translateY(-1px); box-shadow: 0 7px 18px rgba(24, 121, 78, .22); }
.secondary { color: var(--ink-soft); background: var(--surface); border: 1px solid var(--line-strong); box-shadow: 0 1px 1px rgba(20, 40, 27, .03); }
.secondary:hover { color: var(--ink); background: var(--surface-soft); border-color: #aebeb3; transform: translateY(-1px); }
.primary:disabled, .secondary:disabled, button:disabled { opacity: .52; cursor: not-allowed; transform: none !important; box-shadow: none; }
.compact { min-height: 31px; padding: 6px 10px; border-radius: 8px; font-size: 12px; }
.add-button { min-height: 34px; padding: 7px 10px; color: var(--green); border-color: #bdd2c4; font-size: 12px; }

/* Catalog filters */
.entity { margin: 5px 0; border: 1px solid transparent; border-radius: 12px; overflow: hidden; transition: border-color .15s, background .15s, box-shadow .15s; }
.super-entity-group { margin-top: 15px; }
.super-entity-group:first-child { margin-top: 5px; }
.super-entity-heading { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 10px; border: 0; border-left: 4px solid var(--green); border-radius: 0 9px 9px 0; color: var(--green); background: #edf5f0; cursor: pointer; font-size: 12px; font-weight: 850; letter-spacing: .055em; text-align: left; text-transform: uppercase; }
.super-entity-heading:hover { background: #e3f0e8; }
.super-entity-chevron { font-size: 18px; line-height: 1; transition: transform .15s; }
.super-entity-group.collapsed .super-entity-chevron { transform: rotate(-90deg); }
.super-entity-group.collapsed .super-entity-items { display: none; }
.entity:not(.collapsed) { border-color: var(--line); background: var(--surface); box-shadow: var(--shadow-sm); }
.entity-head { min-height: 45px; display: flex; gap: 7px; align-items: center; padding: 5px 8px; cursor: pointer; }
.entity-head:hover { background: rgba(236, 244, 239, .55); }
.expand { width: 29px; height: 29px; flex: 0 0 auto; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; font-size: 19px; transition: transform .18s, background .15s; }
.collapsed .expand { transform: rotate(-90deg); }
.entity-name { min-width: 0; flex: 1; font-size: 13px; font-weight: 720; overflow-wrap: anywhere; }
.tag-count, .pill { padding: 3px 7px; border-radius: 99px; color: var(--muted); background: #edf1ee; font-size: 10px; font-weight: 700; white-space: nowrap; }
.entity-actions { display: flex; gap: 2px; opacity: 0; transition: opacity .15s; }
.entity:hover .entity-actions, .entity:focus-within .entity-actions { opacity: 1; }
.entity-actions button, .entity-actions label { width: 25px; height: 25px; display: grid; place-items: center; border: 0; border-radius: 7px; background: transparent; color: var(--muted); cursor: pointer; }
.entity-actions button:hover, .entity-actions label:hover { background: var(--surface); color: var(--ink); }
.entity-file { display: none; }
.tags { padding: 3px 8px 8px 43px; }
.tag { min-height: 35px; display: flex; gap: 8px; align-items: center; margin: 2px 0; padding: 6px 7px; border-radius: 8px; color: var(--ink-soft); cursor: pointer; font-size: 13px; }
.tag:hover { background: #f0f4f1; }
.tag.selected { color: var(--green-dark); background: var(--green-soft); font-weight: 650; }
.tag input { width: 15px; height: 15px; padding: 0; margin: 0; accent-color: var(--green); }
.tag-text { flex: 1; }
.tag button { width: 22px; height: 22px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--faint); opacity: 0; cursor: pointer; }
.tag:hover button { opacity: 1; }
.tag button:hover { color: var(--ink); background: var(--surface); }
.collapsed .tags, .collapsed .add-tag, .collapsed .all-entity-tasks, .collapsed .entity-material { display: none; }
.add-tag { margin: 0 8px 10px 43px; padding: 5px 7px; border: 0; background: transparent; color: var(--green); cursor: pointer; font-size: 12px; font-weight: 650; }
.all-entity-tasks { margin: 0 8px 5px 43px; padding: 5px 7px; border: 0; background: transparent; color: var(--blue); cursor: pointer; font-size: 12px; font-weight: 650; text-align: left; }
#appNotice { position: fixed; z-index: 100; right: 20px; bottom: 20px; max-width: 420px; padding: 13px 16px; border-radius: 10px; color: #fff; background: #a33a3a; box-shadow: 0 10px 30px rgba(45,20,20,.24); opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity .18s, transform .18s; }
#appNotice.visible { opacity: 1; transform: translateY(0); }
.student-form { display: grid; grid-template-columns: repeat(2,minmax(180px,1fr)); gap: 12px; margin: 14px 0; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.student-form label { display: grid; gap: 5px; font-size: 13px; font-weight: 650; }
.student-form > div { display: flex; align-items: end; gap: 8px; }
.student-access { display: grid; gap: 5px; margin: 14px 0; padding: 14px; border: 1px solid #a9d2b7; border-radius: 12px; color: #174b2d; background: var(--green-soft); }
.student-access code { padding: 2px 5px; border-radius: 4px; color: inherit; background: rgba(255,255,255,.7); }
.task-condition { white-space: pre-wrap; padding: 10px; border-radius: 8px; background: var(--surface-soft); }
.entity-material { padding: 3px 12px 8px 43px; }
.entity-material img { max-height: 100px; }

/* Editor blocks */
.blocks { display: grid; gap: 14px; margin: 16px 0; }
.blocks > section { padding: 16px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 5px; }
.section-head > div { display: flex; align-items: center; gap: 10px; }
.section-head > div > span:last-child { display: grid; }
.section-head strong { font-size: 14px; }
.section-head small { color: var(--muted); font-size: 11px; }
.section-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; font-weight: 850; }
.hint-icon { color: var(--amber); background: var(--amber-soft); }
.solution-icon { color: var(--blue); background: var(--blue-soft); }
.answer-icon { color: var(--green); background: var(--green-soft); }
.dynamic-list:empty::after { content: "Пока ничего не добавлено"; display: block; padding: 13px 44px; color: var(--faint); font-size: 12px; }
.form-row { position: relative; display: grid; grid-template-columns: minmax(130px, .8fr) minmax(220px, 2fr) auto; gap: 8px; margin: 10px 0 0; padding: 10px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-soft); }
.form-row > textarea:only-of-type { grid-column: 1 / 3; }
.form-row input, .form-row textarea, .form-row select { margin: 0; min-width: 0; }
.form-row textarea { min-height: 76px; }
.answer-fields { display: flex; gap: 8px; }
.answer-row { grid-template-columns: minmax(130px, .8fr) auto minmax(220px, 2fr) auto; }
.solution-row { display: block; padding: 14px; }
.solution-row > .solution-title { width: calc(100% - 42px); margin-bottom: 10px; font-weight: 700; }
.solution-row > .remove { position: absolute; top: 14px; right: 12px; }
.solution-editor-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.solution-editor-grid > label { min-width: 0; }
.solution-editor-grid > label > span, .solution-preview-head > span { display: block; margin-bottom: 6px; color: var(--ink-soft); font-size: 11px; font-weight: 750; }
.solution-html { min-height: 330px !important; font: 12px/1.55 ui-monospace, SFMono-Regular, Consolas, monospace !important; resize: vertical; }
.solution-preview-head { min-height: 31px; display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.solution-preview { width: 100%; min-height: 330px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: #fff; }
.multiple-numbers { display: flex; align-items: center; gap: 6px; color: var(--ink-soft); font-size: 12px; white-space: nowrap; }
.multiple-numbers input { width: auto; }
.answer-editor { margin: 18px 0; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); }
.answer-editor .section-head { margin: 0; }
.remove { width: 34px; height: 34px; align-self: start; padding: 0; border: 0; border-radius: 9px; background: transparent; color: var(--faint); cursor: pointer; font-size: 21px; }
.remove:hover { color: var(--red); background: var(--red-soft); }
.sticky-actions { position: sticky; z-index: 15; bottom: 14px; display: flex; align-items: center; gap: 9px; margin-top: 18px; padding: 11px; border: 1px solid rgba(198, 215, 203, .9); border-radius: 14px; background: rgba(255, 255, 255, .94); box-shadow: 0 10px 35px rgba(25, 48, 34, .13); backdrop-filter: blur(14px); }
.sticky-actions .primary { min-width: 160px; }
.action-hint { margin-left: auto; color: var(--muted); font-size: 12px; }

/* Assignment and task cards */
.assign-top { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); align-items: end; gap: 14px; margin-bottom: 16px; padding: 15px; }
.assign-top > label { min-width: 0; }
.assign-top select { min-width: 0; }
.assign-difficulty { min-width: 0; }
.assign-top .issued-filter { min-height: 41px; display: flex; align-items: center; gap: 8px; padding: 0 2px; color: var(--ink-soft); font-size: 13px; font-weight: 650; }
.assign-top .issued-filter input { width: 16px; height: 16px; flex: 0 0 auto; margin: 0; padding: 0; accent-color: var(--green); }
.assign-top > .primary { min-width: 0; }
.range-fields { min-height: 41px; display: flex; align-items: center; gap: 8px; }
.range-fields label { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }
.range-fields select { width: 68px; min-width: 68px; padding-right: 28px; }
.range-dash { color: var(--faint); }
.task-filter-summary { display: flex; justify-content: space-between; gap: 10px; margin: 4px 2px 12px; color: var(--muted); font-size: 12px; }
.task-filter-summary span:first-child { color: var(--ink-soft); font-weight: 750; }
.task-filter-empty { display: grid; gap: 4px; margin: 10px 0; padding: 26px 22px; border: 1px dashed var(--line-strong); border-radius: var(--radius); color: var(--muted); background: rgba(255,255,255,.58); }
.task-filter-empty strong { color: var(--ink-soft); }
.task-filter-empty span { font-size: 13px; }
.import-panel { max-width: 920px; }
.import-card { padding: 22px; }
.import-card + .import-card { margin-top: 14px; }
.import-upload { min-height: 120px; display: grid; place-items: center; gap: 7px; padding: 20px; border: 1px dashed #aac7b5; border-radius: 12px; color: var(--muted); background: var(--surface-soft); cursor: pointer; text-align: center; }
.import-upload:hover { border-color: var(--green); background: var(--green-pale); }
.import-upload input { display: none; }
.import-upload strong { color: var(--ink-soft); }
.import-status { margin: 14px 0 0; color: var(--muted); font-size: 13px; }
.import-error { color: var(--red); }
.import-preview { display: grid; gap: 14px; }
.import-summary { display: flex; flex-wrap: wrap; gap: 8px; }
.import-summary span { padding: 5px 9px; border-radius: 99px; color: var(--ink-soft); background: #edf1ee; font-size: 12px; font-weight: 700; }
.import-new-tags { padding: 13px 14px; border: 1px solid #efd2a1; border-radius: 10px; background: var(--amber-soft); }
.import-new-tags strong { display: block; margin-bottom: 5px; }
.import-new-tags ul { margin: 0; padding-left: 18px; color: var(--ink-soft); font-size: 13px; }
.import-task-list { margin: 0; padding-left: 21px; color: var(--ink-soft); font-size: 13px; }
.import-actions { display: flex; align-items: center; gap: 10px; margin-top: 18px; }
.import-note { color: var(--muted); font-size: 12px; }
.task-card { position: relative; display: flex; gap: 13px; margin: 10px 0; padding: 16px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); box-shadow: var(--shadow-sm); transition: border-color .15s, box-shadow .15s, transform .15s; }
.task-card:hover { border-color: #c4d3c9; box-shadow: 0 7px 22px rgba(25, 48, 34, .075); }
.task-card > div { min-width: 0; flex: 1; }
.task-card h3 { margin: 0 0 6px; font-size: 15px; line-height: 1.35; }
.task-card p { margin: 6px 0; color: var(--ink-soft); white-space: pre-wrap; }
.task-card > input[type="checkbox"] { width: 18px; height: 18px; padding: 0; accent-color: var(--green); }
.task-solution-peek { margin-top: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); overflow: hidden; }
.task-solution-peek > summary { display: flex; align-items: center; gap: 8px; padding: 10px 12px; color: var(--green-dark); cursor: pointer; font-weight: 800; list-style: none; }
.task-solution-peek > summary::-webkit-details-marker { display: none; }
.task-solution-peek > summary::before { content: '+'; display: grid; width: 23px; height: 23px; place-items: center; flex: 0 0 auto; border-radius: 50%; color: #fff; background: var(--green); font-size: 18px; line-height: 1; }
.task-solution-peek[open] > summary::before { content: '×'; }
.task-solution-peek iframe { display: block; width: 100%; min-height: 280px; border: 0; border-top: 1px solid var(--line); background: #fff; }
.task-card .task-hint-peek { margin: 0; padding: 10px 13px; border-top: 1px solid var(--line); color: var(--ink-soft); background: #fffdf4; white-space: normal; }
.task-card .task-no-solution { margin-top: 11px; color: var(--muted); font-size: 12px; }
.task-pagination { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 20px 0 6px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink-soft); }
.task-pagination span { min-width: 250px; text-align: center; }
.task-pagination button:disabled { opacity: .45; cursor: default; }
.pills { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 9px; }
.student-picker { display: block; max-width: 360px; margin-bottom: 17px; }
.student-task { margin: 12px 0; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.student-task > h3, .student-task summary h3 { margin-top: 0; }
.student-task details { margin-top: 10px; border-top: 1px solid var(--line); }
.student-task details summary { padding: 10px 0; cursor: pointer; font-weight: 650; }
.fraction { display: inline-grid; grid-template-rows: auto auto; text-align: center; vertical-align: middle; line-height: 1.1; }
.fraction b { padding: 0 4px; border-bottom: 1px solid; }

/* Statuses, statistics, management and materials created dynamically */
body .review-green { border-color: #9fd0b0 !important; border-left: 5px solid #25945d !important; background: var(--green-pale) !important; }
body .review-red { border-color: #efb7ba !important; border-left: 5px solid var(--red) !important; background: #fff7f7 !important; }
body .review-orange { border-color: #ebd19d !important; border-left: 5px solid #d68a27 !important; background: #fffaf0 !important; }
body .review-gray { border-left: 5px solid #9aa59e !important; }
.result-label { display: inline-flex; padding: 4px 8px; border-radius: 99px; background: rgba(255, 255, 255, .8); font-size: 12px; font-weight: 800; }
.expected { margin: 10px 0 !important; padding: 10px 12px !important; border: 1px solid var(--line); border-radius: 9px !important; background: rgba(255, 255, 255, .84) !important; color: var(--ink-soft); font-size: 12px !important; }
.teacher-panel, .material-editor { max-width: none !important; }
.material-editor { min-width: 0; --material-line: #e4e4e7; --material-line-strong: #d4d4d8; --material-muted: #71717a; --material-soft: #f7f7f8; }
.material-editor .section-tabs { border-color: var(--material-line); background: #f4f4f5; }
.material-editor .section-tab.active { color: #18181b; background: #fff; box-shadow: 0 1px 2px rgba(24,24,27,.07); }
.material-editor .primary { color: #fff; border-color: #18181b; background: #18181b; box-shadow: 0 4px 12px rgba(24,24,27,.14); }
.material-editor .primary:hover { border-color: #09090b; background: #09090b; box-shadow: 0 6px 16px rgba(24,24,27,.18); }
.material-editor .secondary { color: #3f3f46; border-color: var(--material-line-strong); background: #fff; box-shadow: 0 1px 1px rgba(24,24,27,.03); }
.material-editor .secondary:hover { color: #18181b; border-color: #a1a1aa; background: #fafafa; }
.student-title { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 20px; }
.student-title h2, .teacher-panel > h2, .material-editor > h2 { margin: 0; font-size: 27px; letter-spacing: -.03em; }
.teacher-row { display: flex; align-items: center; gap: 12px; margin: 8px 0; padding: 13px 14px !important; border: 1px solid var(--line) !important; border-radius: 11px; background: var(--surface); }
.teacher-row span { min-width: 0; flex: 1; }
.teacher-row small { color: var(--muted); }
.stats-grid { display: grid !important; grid-template-columns: repeat(5, minmax(110px, 1fr)) !important; gap: 10px !important; margin: 18px 0 25px !important; }
.stat { min-height: 92px; padding: 14px !important; border: 1px solid var(--line) !important; border-radius: 12px !important; background: var(--surface); box-shadow: var(--shadow-sm); color: var(--muted); }
.stat b { display: block; margin-bottom: 5px; color: var(--ink); font-size: 26px !important; letter-spacing: -.03em; }
.stats-table { width: 100%; margin: 10px 0 25px !important; border-spacing: 0; border-collapse: separate !important; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface); }
.stats-table th { color: var(--muted); background: var(--surface-soft); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.stats-table td, .stats-table th { padding: 10px 12px !important; border-bottom: 1px solid var(--line) !important; text-align: left; }
.stats-table tr:last-child td { border-bottom: 0 !important; }
.material-page-head { display: flex; min-width: 0; align-items: flex-start; justify-content: space-between; gap: 22px; margin: 0 2px 20px; }
.material-page-head > div:first-child { min-width: 0; }
.material-head-actions { display: flex; min-width: 0; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.material-head-actions > * { max-width: 100%; }
.material-analog-shortcut { color: #3f3f46 !important; border-color: var(--material-line-strong) !important; background: #f4f4f5 !important; font-weight: 800 !important; }
.material-analog-shortcut:hover { border-color: #a1a1aa !important; background: #e4e4e7 !important; }
.material-filter { display: flex; align-items: center; gap: 7px; color: var(--material-muted); font-size: 12px; font-weight: 700; white-space: nowrap; }
.material-filter select { width: auto; min-width: 74px; border-color: var(--material-line-strong); background: #fff; }
.material-page-head h2 { margin: 0; font-size: 27px; letter-spacing: -.035em; }
.material-page-head p { max-width: 650px; margin: 6px 0 0; color: var(--material-muted); }
.material-catalog-filters { display: grid; grid-template-columns: minmax(220px,2fr) minmax(170px,1.4fr) repeat(2,minmax(112px,.7fr)) auto; gap: 10px; margin: 0 2px 16px; padding: 13px; border: 1px solid var(--material-line); border-radius: 13px; background: var(--material-soft); }
.material-catalog-filters label { display: grid; min-width: 0; gap: 5px; color: var(--material-muted); font-size: 11px; font-weight: 800; }
.material-catalog-filters input, .material-catalog-filters select { width: 100%; min-width: 0; border-color: var(--material-line-strong); background: #fff; }
.material-catalog-filters > button { align-self: end; min-height: 42px; }
.material-grid { display: grid !important; grid-template-columns: 310px minmax(0, 1fr) !important; gap: 18px !important; min-width: 0; align-items: start; }
.material-list { position: static !important; height: auto !important; max-height: 760px; min-width: 0; padding: 9px !important; border: 1px solid var(--material-line) !important; border-radius: 14px; background: var(--material-soft); overflow: auto; scrollbar-color: #d4d4d8 transparent; scrollbar-width: thin; }
.material-list-summary { margin: 2px 3px 10px; color: var(--material-muted); font-size: 12px; }
.material-pagination { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:12px; margin-top:10px; padding-top:10px; border-top:1px solid var(--line); }
.material-page-count { color:var(--muted); font-size:12px; }
.material-page-buttons { display:flex; flex-wrap:wrap; align-items:center; gap:5px; }
.material-pagination button { min-height:36px; min-width:36px; padding:7px 9px; font-size:12px; }
.material-pagination button[aria-current="page"] { opacity:1; color:#fff; background:var(--blue); border-color:var(--blue); }
.material-pagination .material-page-gap { padding:0 3px; color:var(--muted); }
.material-page-size,.material-page-jump,.material-page-jump label { display:flex; align-items:center; flex-wrap:wrap; gap:7px; margin:0; font-size:12px; }
.material-page-size select,.material-page-jump input { width:74px; min-width:0; min-height:36px; padding:6px; }
.material-pagination-top { border-top:0; border-bottom:1px solid var(--line); }
@media(max-width:600px) { .material-page-buttons { flex-basis:100%; order:3; } .material-page-jump { flex-basis:100%; order:4; } }
.material-list-item { min-width: 0; margin: 4px 0; padding: 11px; border: 1px solid transparent; border-radius: 10px; background: transparent; transition: border-color .15s, background .15s, box-shadow .15s; }
.material-list-item:hover { border-color: var(--material-line); background: rgba(255,255,255,.72); }
.material-list-item.active { border-color: var(--material-line-strong); background: #fff; box-shadow: 0 2px 9px rgba(24,24,27,.05); }
.material-card-title { display: block; width: 100%; min-width: 0; padding: 0; border: 0; background: transparent; color: var(--ink); cursor: pointer; font: inherit; font-weight: 750; line-height: 1.38; overflow-wrap: anywhere; text-align: left; }
.material-card-title:hover { text-decoration: underline; text-underline-offset: 3px; }
.material-card-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; color: var(--material-muted); font-size: 11px; line-height: 1.4; overflow-wrap: anywhere; }
.material-card-tags button, .material-filter-chip, .material-difficulty-chip { border: 0; cursor: pointer; font: inherit; }
.material-card-tags button { padding: 3px 6px; border-radius: 6px; color: #52525b; background: #eceff3; font-size: 11px; font-weight: 750; }
.material-card-tags button:hover, .material-filter-chip:hover, .material-difficulty-chip:hover { box-shadow: inset 0 0 0 1px #a1a1aa; }
.material-card-tags.muted { color: #9aa7b5; }
.material-source-row { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.material-source, .material-grade { display: inline-flex; width: fit-content; padding: 4px 7px; border-radius: 7px; font-size: 11px; font-weight: 800; }
.material-source { max-width: 100%; color: #52525b; background: #f0f0f1; overflow-wrap: anywhere; }
.material-source.is-analog { color: #4a3c87; background: #eeeafb; }
.material-grade { color: #52525b; background: #f0f0f1; }
.material-difficulty-chip { width: fit-content; margin-top: 7px; }
.material-card-details { margin-top: 7px; }
.material-card-details > summary { width: fit-content; padding: 2px 0; color: var(--material-muted); cursor: pointer; font-size: 11px; font-weight: 700; list-style: none; }
.material-card-details > summary::-webkit-details-marker { display: none; }
.material-card-details > summary::after { margin-left: 5px; content: '⌄'; }
.material-card-details[open] > summary::after { content: '⌃'; }
.material-card-details > div { min-width: 0; padding: 1px 0 2px; }
.material-card-actions { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: 12px; margin-top: 9px; font-size: 12px; font-weight: 700; }
.material-card-actions small { min-width: 0; color: var(--material-muted); overflow-wrap: anywhere; }
.material-card-actions > span { display: flex; flex-wrap: wrap; gap: 10px; }
.material-card-actions a, .material-card-actions button { padding: 0; border: 0; color: var(--blue); background: transparent; cursor: pointer; font: inherit; text-decoration: underline; text-underline-offset: 3px; }
.material-card-actions button { color: var(--muted); }
.material-workspace { min-width: 0; max-width: 100%; padding: 18px; border: 1px solid var(--material-line); border-radius: 16px; background: #fff; box-shadow: 0 8px 26px rgba(24,24,27,.045); }
.material-viewer-head { display: flex; min-width: 0; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 13px; }
.material-viewer-head > div:first-child { min-width: 0; }
.material-viewer-head h3 { margin: 0; font-size: 20px; }
.material-viewer-head p { margin: 5px 0 0; color: var(--material-muted); font-size: 13px; overflow-wrap: anywhere; }
.material-viewer-actions { display: flex; min-width: 0; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.material-open { display: inline-flex; align-items: center; text-decoration: none; }
.material-code-editor { max-width: 100%; margin-top: 14px; border: 1px solid var(--material-line); border-radius: 12px; background: #fff; overflow: hidden; }
.material-code-editor > summary, .material-advanced-settings > summary, .material-student-assignments > summary { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 15px; cursor: pointer; color: var(--ink); font-weight: 700; list-style: none; }
.material-code-editor > summary::-webkit-details-marker, .material-advanced-settings > summary::-webkit-details-marker, .material-student-assignments > summary::-webkit-details-marker { display: none; }
.material-code-editor > summary > span, .material-advanced-settings > summary > span { min-width: 0; overflow-wrap: anywhere; }
.material-code-editor > summary::after, .material-advanced-settings > summary::after, .material-student-assignments > summary::after { flex: 0 0 auto; color: var(--material-muted); content: '⌄'; font-size: 17px; }
.material-code-editor[open] > summary::after, .material-advanced-settings[open] > summary::after, .material-student-assignments[open] > summary::after { transform: rotate(180deg); }
.material-code-editor > summary small, .material-advanced-settings > summary small { margin-left: auto; color: var(--material-muted); font-size: 11px; font-weight: 500; }
.material-code-editor[open] > summary { border-bottom: 1px solid var(--material-line); background: #fafafa; }
.material-fields { display: grid; min-width: 0; gap: 14px; padding: 16px; }
.material-field { display: grid; min-width: 0; gap: 6px; color: var(--ink-soft); font-size: 12px; font-weight: 750; }
.material-field > span { min-width: 0; }
.material-field input, .material-field textarea { min-width: 0; }
.material-fields > .material-field:nth-of-type(2) textarea { min-height: 230px !important; }
.material-fields textarea { min-height: 160px !important; font: 12px/1.55 ui-monospace, SFMono-Regular, Consolas, monospace !important; }
.material-actions { display: flex !important; min-width: 0; flex-wrap: wrap; gap: 9px !important; margin: 0 !important; }
.material-save-status { align-self: center; color: var(--green); font-size: 13px; font-weight: 700; }
.material-save-status.error { color: var(--red); }
.material-advanced-settings { min-width: 0; border: 1px solid var(--material-line); border-radius: 11px; background: var(--material-soft); overflow: hidden; }
.material-advanced-settings[open] > summary { border-bottom: 1px solid var(--material-line); background: #fafafa; }
.material-advanced-body { display: grid; min-width: 0; gap: 15px; padding: 15px; }
.material-meta-grid { display: grid; min-width: 0; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.material-meta-grid label { display: grid; min-width: 0; gap: 5px; color: var(--ink-soft); font-size: 11px; font-weight: 750; }
.material-meta-grid input, .material-meta-grid select { min-width: 0; }
.material-meta-wide { grid-column: 1 / -1; }
.material-switches { display: grid; min-width: 0; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; }
.material-switches label { display: grid; min-width: 0; grid-template-columns: 18px minmax(0,1fr); align-items: start; gap: 8px; padding: 10px; border: 1px solid var(--material-line); border-radius: 9px; color: var(--ink-soft); background: #fff; cursor: pointer; font-size: 12px; line-height: 1.4; }
.material-switches input { width: 17px; height: 17px; margin: 1px 0 0; padding: 0; accent-color: var(--green); }
.review-status-option { display: flex; align-items: center; gap: 11px; margin-top: 14px; padding: 13px 14px; border: 1px solid #ebd19d; border-radius: 11px; background: #fffaf0; cursor: pointer; }
.review-status-option input, .review-status-inline input { width: 18px; height: 18px; padding: 0; accent-color: var(--amber); }
.review-status-option span { display: grid; gap: 2px; }
.review-status-option small { color: var(--muted); }
.review-status-inline { color: #8a5a15; background: #fff6df !important; }
.review-queue { display: grid; gap: 18px; }
.review-queue .page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.review-queue-count { min-width: 38px; padding: 8px 12px; border-radius: 99px; color: #845410; background: #fff0cc; text-align: center; font-size: 16px; font-weight: 800; }
.review-queue-section { padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-sm); }
.review-content-list { display: grid; gap: 10px; margin-top: 13px; }
.review-content-card { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 14px 15px; border: 1px solid #ead7ad; border-left: 4px solid var(--amber); border-radius: 11px; background: #fffdf8; }
.review-content-card h3 { margin: 4px 0 5px; font-size: 16px; }
.review-content-card p { max-width: 760px; margin: 0; color: var(--muted); font-size: 13px; white-space: pre-wrap; }
.review-kind { color: #94631d; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; }
.unpublishTask { border-color: #dfbd79 !important; color: #875512 !important; background: #fffaf0 !important; }
.review-content-actions { display: flex; flex: 0 0 auto; gap: 8px; }
.review-content-actions a { display: inline-flex; align-items: center; text-decoration: none; }
.review-queue-empty, .review-queue-loading { color: var(--muted); }
.review-batches { display: grid; gap: 12px; }
.review-batch-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(250px,1fr)); gap: 10px; }
.review-batch-card { display: grid; gap: 9px; padding: 13px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-sm); }
.review-batch-card.active { border-color: #d2a34d; background: #fffaf0; }
.review-batch-card.has-answer-mismatch { border-color: #dc8479; background: #fff8f7; }
.review-batch-card > div:first-child { display: grid; gap: 3px; }
.review-batch-card small { color: var(--muted); }
.review-batch-card > div:nth-child(3) { color: var(--muted); font-size: 12px; }
.review-batch-card > div:nth-child(3) b { color: #8a5a15; font-size: 17px; }
.review-batch-progress { height: 7px; overflow: hidden; border-radius: 999px; background: #f0e5cf; }
.review-batch-progress span { display: block; height: 100%; border-radius: inherit; background: var(--green); }
.review-filter-bar { display: grid; grid-template-columns: minmax(220px,1.25fr) minmax(220px,1fr) minmax(180px,.8fr) 120px; gap: 10px; }
.review-filter-bar label { display: grid; gap: 5px; color: var(--muted); font-size: 12px; font-weight: 700; }
.review-filter-bar select { min-width: 0; }
.review-list-toolbar { display: flex; align-items: center; gap: 14px; margin-top: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.review-list-toolbar > div { display: grid; margin-right: auto; }
.review-list-toolbar small { color: var(--muted); }
.review-select-all { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 13px; }
.review-select-all input, .review-task-select { width: 18px; height: 18px; padding: 0; accent-color: var(--green); }
.compact-review-list { gap: 6px; }
.review-task-row { display: grid; grid-template-columns: 22px minmax(260px,1fr) 90px 90px auto; align-items: center; gap: 12px; padding: 10px 12px; }
.review-task-row.answer-check-mismatch { border-color: #d96f62; background: #fff8f7; box-shadow: inset 4px 0 #c94737; }
.review-task-row.answer-check-unsupported { border-color: #dab66d; background: #fffaf0; box-shadow: inset 4px 0 #c28b27; }
.answer-check-flag { display: inline-flex; align-items: center; width: fit-content; margin-top: 4px; padding: 4px 8px; border-radius: 7px; font-size: 11px; font-weight: 800; }
.answer-check-flag.match { color: #17643b; background: #e6f5eb; }
.answer-check-flag.mismatch { color: #9e2f23; background: #ffe5e1; }
.answer-check-flag.unsupported { color: #835d16; background: #fff0cc; }
.review-task-main { min-width: 0; }
.review-task-row h3 { margin: 2px 0; font-size: 14px; }
.review-task-row p { display: -webkit-box; max-width: none; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; line-height: 1.35; }
.review-difficulty { display: grid; gap: 3px; color: var(--muted); font-size: 10px; font-weight: 700; }
.review-difficulty select { min-width: 74px; padding: 7px 8px; }
@media (max-width: 1100px) {
  .review-filter-bar { grid-template-columns: 1fr 1fr; }
  .review-task-row { grid-template-columns: 22px 1fr 90px 90px; }
  .review-task-row .review-content-actions { grid-column: 2 / -1; }
}
@media (max-width: 720px) {
  .review-filter-bar { grid-template-columns: 1fr; }
  .review-list-toolbar { align-items: stretch; flex-direction: column; }
  .review-task-row { grid-template-columns: 22px 1fr; }
  .review-difficulty, .review-task-row .review-content-actions { grid-column: 2; }
}
.import-panel { display: grid; gap: 18px; }
.import-review-card { display: grid; gap: 14px; }
.import-json-text { min-height: 360px; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; line-height: 1.55; }
.import-preview-result { min-height: 24px; color: var(--muted); }
.import-preview-summary { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 10px; }
.import-preview-summary span { display: grid; gap: 2px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); }
.import-preview-summary strong { color: var(--ink); font-size: 22px; }
.import-preview-summary .answer-preview-error { border-color: #dc8479; background: #fff0ed; }
.import-preview-summary .answer-preview-error strong { color: #a33226; }
.material-options label { display: flex; align-items: center; gap: 6px; }
.material-options input { width: 16px; height: 16px; padding: 0; }
.common-material-css { min-width: 0; border-top: 1px solid var(--material-line); padding-top: 12px; }
.common-material-css > summary { width: fit-content; color: var(--material-muted); cursor: pointer; font-size: 12px; font-weight: 650; }
.common-material-css textarea { min-width: 0; margin-top: 10px; }
.common-material-css button { margin-top: 8px; }
.material-student-assignments { max-width: 100%; margin: 14px 0 0; border: 1px solid var(--material-line); border-radius: 12px; background: #fafafa; overflow: hidden; }
.material-student-assignments > summary > span { display: grid; min-width: 0; gap: 2px; }
.material-student-assignments > summary small { color: var(--material-muted); font-size: 11px; font-weight: 500; overflow-wrap: anywhere; }
.material-student-assignments[open] > summary { border-bottom: 1px solid var(--material-line); background: #f7f7f8; }
.material-student-assignments-body { min-width: 0; padding: 15px; }
.material-assignment-empty h3 { margin: 0; font-size: 16px; }
.material-assignment-empty p { margin: 5px 0 0; color: var(--material-muted); font-size: 13px; }
.material-assignment-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.material-assignment-head > div { min-width: 0; }
.material-assignment-head h3 { margin: 0; font-size: 17px; }
.material-assignment-head p { margin: 5px 0 0; color: var(--material-muted); font-size: 12px; overflow-wrap: anywhere; }
.material-assignment-head > span { padding: 5px 9px; border-radius: 999px; color: #3f3f46; background: #e4e4e7; font-size: 11px; font-weight: 750; white-space: nowrap; }
.material-student-grid { display: grid; min-width: 0; grid-template-columns: repeat(auto-fit,minmax(min(100%,210px),1fr)); gap: 8px; margin-top: 13px; }
.material-student-choice { display: flex; min-width: 0; align-items: center; gap: 9px; min-height: 52px; padding: 9px 11px; border: 1px solid var(--material-line); border-radius: 9px; background: #fff; cursor: pointer; }
.material-student-choice:has(input:checked) { border-color: #64a77e; background: #eef8f1; }
.material-student-choice input { width: 18px; height: 18px; flex: 0 0 auto; }
.material-student-choice span { display: grid; min-width: 0; gap: 2px; overflow-wrap: anywhere; }
.material-student-choice small { color: var(--muted); }
.material-audience { display: inline-flex; width: fit-content; max-width: 100%; margin-top: 5px; padding: 4px 7px; border-radius: 7px; color: #52525b; background: #f0f0f1; font-size: 11px; font-weight: 750; overflow-wrap: anywhere; }
.material-danger-zone { min-width: 0; padding-top: 2px; }
.material-danger-zone summary { width: fit-content; color: #a1a1aa; cursor: pointer; font-size: 12px; font-weight: 650; }
.material-danger-zone[open] { padding: 11px 12px; border: 1px solid #ead7d5; border-radius: 9px; background: #fffafa; }
.material-danger-zone[open] summary { color: #8b433d; }
.material-danger-zone p { color: var(--muted); font-size: 12px; }
.student-section-heading { margin: 24px 0 12px; }
.student-section-heading h2 { margin: 3px 0 0; }
.student-knowledge { min-width: 0; }
.student-title-actions, .materials-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.materials-panel-head { margin-bottom: 12px; }
.materials-panel-head h2 { margin: 3px 0 0; font-size: 20px; }
.materials-panel-head p { margin: 5px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.materials-mobile-open { display: inline-flex; }
.materials-close { display: grid; width: 44px; height: 44px; flex: 0 0 auto; place-items: center; border: 1px solid var(--line); border-radius: 11px; color: var(--ink); background: var(--surface-soft); font-size: 28px; line-height: 1; cursor: pointer; }
.materials-backdrop { position: fixed; z-index: 65; inset: 0; display: block; background: rgba(8,22,13,.48); opacity: 0; transition: opacity .18s ease; }
.materials-backdrop.is-open { opacity: 1; }
.knowledge-search { display: grid; gap: 6px; margin: 0 0 14px; color: var(--ink-soft); font-size: 13px; font-weight: 750; }
.knowledge-search input { min-height: 46px; margin: 0; font-size: 16px; }
.knowledge-tree { padding: 14px; border: 1px solid var(--line); border-radius: 13px; background: #f6faf7; }
.knowledge-tree-section + .knowledge-tree-section { margin-top: 7px; }
.knowledge-tree summary { display: flex; min-height: 44px; align-items: center; justify-content: space-between; gap: 10px; cursor: pointer; }
.knowledge-tree summary small { min-width: 24px; padding: 3px 7px; border-radius: 99px; color: var(--muted); background: var(--surface-soft); text-align: center; font-size: 11px; }
.knowledge-tree-section > summary { color: var(--green-dark); font-size: 15px; font-weight: 800; }
.knowledge-tree-topic { margin: 4px 0 5px 15px; }
.knowledge-tree-topic > summary { color: var(--ink-soft); font-size: 14px; font-weight: 750; }
.knowledge-tree ul { display: grid; gap: 5px; margin: 2px 0 5px 10px; padding: 0; list-style: none; }
.knowledge-tree li { min-width: 0; }
.knowledge-tree a { display: grid; min-height: 44px; align-content: center; gap: 2px; padding: 7px 10px; border-radius: 8px; color: var(--ink-soft); font-size: 14px; text-decoration: none; }
.knowledge-tree a small { color: var(--muted); font-size: 11px; font-weight: 600; }
.knowledge-tree a:hover { color: var(--green-dark); text-decoration: underline; }
.knowledge-search-empty { margin: 18px 4px; color: var(--muted); font-size: 14px; text-align: center; }
.knowledge-group { margin-bottom: 16px; padding: 15px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); }
.knowledge-group-head span { color: var(--muted); font-size: 12px; font-weight: 700; }
.knowledge-group-head h3 { margin: 3px 0 11px; font-size: 18px; }
.knowledge-cards { display: grid; grid-template-columns: repeat(auto-fill,minmax(220px,1fr)); gap: 9px; }
.knowledge-card { display: grid; gap: 7px; padding: 13px; border: 1px solid #cfe0d7; border-radius: 10px; background: #f5fbf7; color: var(--ink); text-decoration: none; }
.knowledge-card:hover { border-color: #64a77e; transform: translateY(-1px); }
.knowledge-card small { color: var(--muted); font-size: 11px; }
.knowledge-card span { color: var(--green); font-size: 12px; font-weight: 750; }

/* Homework builder overrides dynamic inline styles */
body .homework-box { margin: 0 0 18px !important; padding: 17px !important; border: 1px solid #bcd8c6 !important; border-radius: 14px !important; background: linear-gradient(145deg, #eff9f2, #f8fcf9) !important; box-shadow: 0 8px 25px rgba(22, 101, 52, .07) !important; }
body .battle-test-cart { border-color: #b9cce0 !important; background: linear-gradient(145deg,#edf5fb,#fafcff) !important; }
body .homework-head strong { font-size: 17px !important; }
body .homework-count { min-width: 28px; text-align: center; background: var(--green) !important; }
body .homework-items { gap: 8px !important; }
body .homework-item { padding: 11px 12px !important; border-color: #cfe2d5 !important; border-radius: 10px !important; box-shadow: 0 1px 2px rgba(20, 50, 31, .03); }
body .homework-requirements { padding: 5px 8px; border-radius: 8px; background: var(--surface-soft); }
body .homework-requirements input { width: 15px; height: 15px; padding: 0; accent-color: var(--green); }
body .task-card > .add-homework { align-self: flex-start; min-width: 168px; flex: 0 0 auto; border-color: var(--green) !important; border-radius: 9px !important; color: #fff !important; background: var(--green) !important; }
body .add-homework:hover { background: var(--green-dark) !important; }
.history-tasks { padding-top: 8px; }
.teacher-homework-card { padding: 0; overflow: hidden; }
.teacher-homework-card > .homework-summary { display: grid; grid-template-columns: minmax(230px, 1.45fr) minmax(210px, 1fr) minmax(145px, auto) 24px; align-items: center; gap: 18px; margin: 0; padding: 18px 20px; cursor: pointer; list-style: none; }
.teacher-homework-card > .homework-summary::-webkit-details-marker { display: none; }
.teacher-homework-card[open] > .homework-summary { border-bottom: 1px solid var(--line); background: var(--surface-soft); }
.homework-summary-person, .homework-summary-progress, .homework-summary-date { display: grid; gap: 6px; min-width: 0; }
.homework-summary-topline { display: flex; align-items: center; gap: 9px; min-width: 0; }
.homework-summary-topline strong { overflow: hidden; font-size: 17px; text-overflow: ellipsis; white-space: nowrap; }
.homework-summary-title { overflow: hidden; color: var(--muted); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.homework-status { display: inline-flex; width: max-content; padding: 5px 9px; border-radius: 99px; font-size: 11px; font-weight: 850; white-space: nowrap; }
.homework-status.is-issued { color: #765310; background: #fff0c9; }
.homework-status.is-review { color: #174d83; background: #e6f2ff; }
.homework-status.is-checked { color: #17633c; background: #e2f5e9; }
.homework-summary-progress b { color: var(--ink); font-size: 14px; }
.homework-summary-progress em { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; font-style: normal; font-weight: 600; }
.homework-progress-track { display: block; width: 100%; height: 7px; overflow: hidden; border-radius: 99px; background: #e5ece7; }
.homework-progress-track i { display: block; height: 100%; border-radius: inherit; background: var(--green); }
.homework-summary-date small, .inbox-card-side small { color: var(--muted); font-size: 10px; font-weight: 750; text-transform: uppercase; letter-spacing: .05em; }
.homework-summary-date time, .inbox-card-side time { color: var(--ink-soft); font-size: 12px; font-weight: 700; }
.homework-summary-chevron { width: 10px; height: 10px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .18s ease; }
.teacher-homework-card[open] .homework-summary-chevron { transform: rotate(225deg); }
.teacher-homework-card > .history-tasks { padding: 16px 18px 18px; }
.inbox-card { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 18px; margin: 12px 0; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-sm); }
.inbox-card-main { display: grid; justify-items: start; gap: 5px; min-width: 0; }
.inbox-card-main strong { font-size: 18px; }
.inbox-card-main h3 { margin: 0; font-size: 14px; font-weight: 750; }
.inbox-card-main > span:last-child { color: var(--muted); font-size: 12px; }
.inbox-card-side { display: grid; justify-items: end; gap: 5px; }
.inbox-card-side button { margin-top: 5px; }
.submission-needs-attention { border-color: #dda266 !important; box-shadow: 0 0 0 3px rgba(221, 162, 102, .17) !important; }
@media (max-width: 820px) {
  .teacher-homework-card > .homework-summary { grid-template-columns: 1fr auto; gap: 12px; }
  .homework-summary-progress, .homework-summary-date { grid-column: 1; }
  .homework-summary-chevron { grid-column: 2; grid-row: 1 / span 3; }
  .inbox-card { grid-template-columns: 1fr; }
  .inbox-card-side { justify-items: start; }
}
.solution-settings { display: grid; gap: 15px; }
.solution-settings-card { padding: 18px; }
.solution-settings-card h2 { margin: 0 0 5px; }
.solution-settings-card p { margin: 0 0 14px; color: var(--muted); }
.solution-settings-version { display: inline-flex; margin-bottom: 10px; padding: 4px 8px; border-radius: 99px; color: var(--green-dark); background: var(--green-soft); font-size: 11px; font-weight: 800; }
.solution-settings textarea { min-height: 420px; font: 12px/1.55 ui-monospace, SFMono-Regular, Consolas, monospace; }
.solution-settings-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 11px; }
.solution-settings-preview { width: 100%; min-height: 360px; border: 1px solid var(--line); border-radius: 11px; background: #fff; }

/* Authentication and student portal */
.login-page { min-height: 100vh; display: grid !important; grid-template-columns: 1fr !important; place-items: center; padding: 24px; background: radial-gradient(circle at 20% 15%, #e5f4eb 0, transparent 30%), radial-gradient(circle at 85% 85%, #eaf1ed 0, transparent 28%), var(--canvas); }
body .student-login { width: min(100%, 410px); max-width: 410px !important; margin: 0 !important; padding: 30px !important; border: 1px solid rgba(202, 215, 206, .95) !important; border-radius: var(--radius-lg) !important; background: rgba(255, 255, 255, .96) !important; box-shadow: var(--shadow-md) !important; }
.student-login::before { content: "З"; width: 46px; height: 46px; display: grid; place-items: center; margin-bottom: 20px; border-radius: 14px; color: #fff; background: var(--green); font-size: 19px; font-weight: 850; }
.student-login h2 { margin: 0 0 7px !important; font-size: 25px; letter-spacing: -.03em; }
.student-login h2::after { content: "Используйте выданные данные для входа"; display: block; margin-top: 6px; color: var(--muted); font-size: 12px; font-weight: 400; letter-spacing: 0; }
.student-login label { display: block; margin-top: 14px; color: var(--ink-soft); font-size: 12px; font-weight: 700; }
.student-login input { margin: 6px 0 0 !important; }
.student-login .primary { width: 100%; margin-top: 7px; }
.student-message { min-height: 20px; margin: 9px 0; color: var(--red); font-size: 12px; }
#studentApp.login-page { display: block !important; padding: 0; background: var(--canvas); }
#studentApp .student-login { margin: 8vh auto !important; }
.loading-state { min-height: 100vh; display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--muted); font-size: 13px; }
.loading-spinner { width: 18px; height: 18px; border: 2px solid var(--line-strong); border-top-color: var(--green); border-radius: 50%; animation: loading-spin .75s linear infinite; }
@keyframes loading-spin { to { transform: rotate(360deg); } }
.student-portal { display: block; width: min(100%,1040px); margin: 0 auto; padding: 28px 22px 70px; }
.student-portal > .student-title { position: sticky; top: 0; z-index: 10; margin: 0 -22px 22px; padding: 16px 22px; background: rgba(245, 247, 245, .94); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px); }
.student-portal > .student-title h1 { margin: 2px 0 0; font-size: 24px; }
.student-portal > .student-knowledge { position: fixed; z-index: 70; inset: 0 auto 0 0; width: min(92vw,420px); margin: 0; padding: 20px 18px 32px; overflow-y: auto; background: var(--surface); box-shadow: 18px 0 50px rgba(15,36,23,.22); transform: translateX(-105%); transition: transform .18s ease; }
.student-portal > .student-knowledge.is-open { transform: translateX(0); }
.student-portal > .student-homeworks { min-width: 0; }
body.materials-panel-open { overflow: hidden; }
.student-homeworks .student-section-heading { margin-top: 0; }
.student-portal .student-task { margin-bottom: 18px; padding: 18px; border-radius: 16px; }
.student-portal .student-task > h3 { padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.student-portal .task-card { box-shadow: none; background: #fff; }
.student-answer { width: 100%; margin-top: 8px; color: #12231a; background: #fff; font-size: 18px; }
.student-answer-short { min-height: 50px; padding: 11px 14px; }
.student-answer-text { min-height: 108px; padding: 12px 14px; line-height: 1.55; resize: vertical; }
.solution-photo { margin: 7px 0; padding: 10px; background: var(--surface); }
.student-welcome { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.empty-state, .fatal-state { max-width: 560px; margin: 9vh auto; padding: 38px 24px; border: 1px dashed var(--line-strong); border-radius: 18px; background: rgba(255,255,255,.65); text-align: center; }
.empty-state > span { width: 48px; height: 48px; display: grid; place-items: center; margin: 0 auto 14px; border-radius: 15px; color: var(--green); background: var(--green-soft); font-size: 22px; font-weight: 850; }
.empty-state h3, .fatal-state h2 { margin: 0 0 6px; }
.empty-state p, .fatal-state p { margin: 0 0 16px; color: var(--muted); }
.homework-card { padding: 0 !important; overflow: hidden; }
.homework-tabs { flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.homework-list-note { color: var(--muted); font-size: 13px; }
.homework-browser { display: grid; grid-template-columns: minmax(200px,270px) minmax(0,1fr); align-items: start; gap: 18px; }
.homework-choices { display: grid; gap: 9px; min-width: 0; }
.homework-choice { display: grid; gap: 6px; width: 100%; min-height: 90px; padding: 14px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); color: var(--ink); text-align: left; overflow-wrap: anywhere; }
.homework-choice span { color: var(--muted); font-size: 12px; }
.homework-choice.active { border-color: var(--green); background: var(--green-soft); box-shadow: inset 3px 0 var(--green); }
.homework-choice:focus-visible { outline: 3px solid var(--green); outline-offset: 2px; }
.homework-selected { min-width: 0; }
.homework-selected .empty-state { margin: 20px auto; }
.homework-state.is-checked { color: var(--blue); background: var(--blue-soft); }
.homework-detail-actions { display: flex; justify-content: flex-end; padding: 10px 18px 0; }
.homework-detail-actions:empty { display: none; }
.homework-student-filter { display: grid; gap: 6px; max-width: 360px; }
.submitted-answer { overflow-wrap: anywhere; }
.homework-deadline { display: block; margin-top: 4px; color: var(--ink-soft); font-size: 12px; font-weight: 650; overflow-wrap: anywhere; }
.homework-choice .homework-deadline { color: var(--ink-soft); }
.homework-deadline.is-overdue, .homework-choice .homework-deadline.is-overdue { color: var(--amber); }
.homework-due-controls { display: grid; grid-template-columns: minmax(180px,250px) minmax(0,1fr); align-items: end; gap: 10px 14px; margin: 14px 0; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.homework-due-controls label { min-width: 0; }
.homework-due-controls input { width: 100%; min-height: 44px; }
.homework-due-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.homework-due-actions button { min-height: 44px; }
.homework-due-controls p { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: 12px; }
@media (max-width: 520px) {
  .homework-due-controls { grid-template-columns: minmax(0,1fr); }
}
@media (max-width: 850px) {
  .homework-browser { grid-template-columns: minmax(0,1fr); }
  .homework-choices { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .homework-choices .homework-load-more { grid-column: 1 / -1; }
  .homework-tabs .section-tab { min-height: 44px; }
  .teacher-row > span:last-child { display: flex; flex-wrap: wrap; gap: 5px; }
}
@media (max-width: 360px) {
  .homework-choices { grid-template-columns: minmax(0,1fr); }
}
.homework-card-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 20px; border-bottom: 1px solid var(--line); background: var(--surface-soft); }
.homework-card-head h3 { margin: 7px 0 1px; font-size: 19px; letter-spacing: -.02em; }
.homework-card-head small { color: var(--muted); }
.homework-state { display: inline-flex; padding: 5px 9px; border-radius: 99px; font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.homework-state.is-open { color: var(--green-dark); background: var(--green-soft); }
.homework-state.is-submitted { color: var(--blue); background: var(--blue-soft); }
.locked-note { color: var(--muted); font-size: 11px; }
.draft-note { max-width: 250px; color: var(--muted); font-size: 12px; line-height: 1.45; text-align: right; }
.student-task-list { padding: 4px 16px 14px; }
.student-answer-card { display: block; margin: 12px 0; padding: 22px 24px; box-shadow: none; }
.student-answer-card.status-correct { border-left: 4px solid var(--green); background: var(--green-pale); }
.student-answer-card.status-wrong { border-left: 4px solid var(--red); background: #fff8f8; }
.student-answer-card.status-review { border-left: 4px solid var(--amber); background: #fffbf4; }
.student-answer-card.status-draft { border-left-color: var(--line); }
.task-card-meta { display: grid; grid-template-columns: auto minmax(0,1fr); align-items: center; gap: 10px; color: var(--muted); }
.task-number { width: auto; height: auto; display: inline; color: #738078; background: transparent; font-size: 13px; font-weight: 700; }
.student-task-title { overflow: hidden; margin: 0; color: #6a776f; font-size: 13px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.task-card-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.task-card-title h3 { margin: 3px 0 0; }
.task-status { grid-column: 3; flex: 0 0 auto; padding: 0; border: 0; color: #7c8981; background: transparent; font-size: 10px; font-weight: 650; }
.status-correct .task-status { color: var(--green); }
.status-wrong .task-status { color: var(--red); }
.status-review .task-status { color: var(--amber); }
.student-answer-card .task-card-title h3 { color: #10271a; font-size: 18px; font-weight: 750; letter-spacing: -.015em; }
.task-reading { margin: 16px 0 20px; padding: 0 0 20px; border-bottom: 1px solid #e9eeeb; }
.task-instruction { margin: 0 0 9px !important; color: #637168 !important; font-size: 14px; font-weight: 550; line-height: 1.45; }
.task-equation { max-width: 100%; overflow-x: auto; color: #0d1d14; font-family: "Cambria Math","STIX Two Math",Georgia,serif; font-size: clamp(25px,3.1vw,32px); font-weight: 500; letter-spacing: .005em; line-height: 1.5; }
.task-statement { max-width: 72ch; margin: 0 !important; color: #102219 !important; font-size: 20px; font-weight: 500; letter-spacing: .002em; line-height: 1.68; }
.task-illustrations { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin: 12px 0 14px; }
.task-illustration { display: block; width: 100%; max-height: 480px; border: 1px solid var(--line); border-radius: 10px; background: #fff; object-fit: contain; }
.response-requirements { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.response-requirements span { color: #69766e; font-size: 11px; font-weight: 650; }
.answer-field, .photo-field { display: block; margin-top: 12px; color: #59675f; font-size: 12px; font-weight: 650; }
.photo-link { display: inline-flex; margin-top: 8px; font-size: 12px; font-weight: 700; }
.draft-actions { display: flex; min-height: 24px; align-items: center; gap: 8px; margin-top: 9px; }
.save-draft { min-height: 32px; padding: 4px 0; border: 0; color: var(--red); background: transparent; cursor: pointer; font-family: inherit; font-size: 12px; font-weight: 650; line-height: 1.3; }
.save-state { color: #6c7971; font-size: 12px; }
.save-state.is-error { color: var(--red); }
.submit-homework { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px; border-top: 1px solid var(--line); background: var(--surface-soft); }
.submit-homework > div { display: grid; }
.submit-homework span { color: var(--muted); font-size: 12px; line-height: 1.45; }
.submit-homework .primary { min-height: 48px; }

/* Responsive */
@media (max-width: 1050px) {
  .app-header { gap: 16px; padding: 0 17px; }
  .brand-copy small { display: none; }
  .tab { padding: 0 10px; }
  .quick-actions { justify-content: flex-start; padding-right: 17px; padding-left: 17px; }
  .app-shell { grid-template-columns: 350px minmax(0, 1fr); }
  .content { padding: 30px 28px 80px; }
  .source-grid { grid-template-columns: 1fr 1fr; }
  .task-school-options { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(3, 1fr) !important; }
  .material-grid { grid-template-columns: minmax(0,1fr) !important; }
  .material-list { max-height: 260px; }
}

@media (hover: none) and (pointer: coarse), (max-width: 700px) {
  .student-portal { display: block; width: min(100%,900px); }
  .student-portal > .student-knowledge { width: min(94vw,390px); padding: 18px 14px 28px; }
  .knowledge-tree { border: 0; padding: 0; background: transparent; }
  .student-homeworks .student-section-heading { margin-top: 0; }
}

@media (max-width: 760px) {
  :root { --header-height: 116px; --quick-bar-height: 94px; --curriculum-bar-height: 58px; }
  .app-header { position: sticky; min-height: var(--header-height); padding: 10px 14px 0; display: block; }
  .brand { height: 48px; }
  .brand-mark { width: 34px; height: 34px; border-radius: 10px; }
  .brand-copy small { display: block; }
  .main-nav { height: 57px; margin: 0 -14px; padding: 0 10px; border-top: 1px solid var(--line); }
  .settings-nav { position: absolute; top: 16px; right: 93px; }
  .header-account { position: absolute; top: 17px; right: 14px; }
  .account-name { display: none; }
  .tab { padding: 0 11px; font-size: 12px; }
  .quick-actions { min-height: var(--quick-bar-height); padding: 8px 14px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: center; gap: 6px; overflow: visible; }
  .quick-actions-label { display: none; }
  .quick-action { width: 100%; min-height: 36px; padding: 5px 8px; justify-content: flex-start; font-size: 11px; }
  .quick-action-icon { width: 21px; height: 21px; flex: 0 0 21px; }
  .curriculum-grade-bar { min-height: var(--curriculum-bar-height); padding: 8px 14px; justify-content: space-between; gap: 8px; }
  .curriculum-grade-bar > span small,.curriculum-grade-note { display: none; }
  .curriculum-grade-switch { flex: 1; }
  .curriculum-grade-switch button { flex: 1; min-width: 0; padding: 4px 9px; }
  .app-shell { display: block; }
  .filter-sidebar { position: static; width: auto; height: auto; max-height: 45vh; padding: 17px 14px; border-right: 0; border-bottom: 1px solid var(--line); }
  .filter-sidebar[hidden] { display: none; }
  .content { padding: 22px 14px 70px; }
  .section-tabs { max-width: 100%; overflow-x: auto; }
  .toolbar { align-items: flex-start; }
  .page-heading { margin-bottom: 18px; }
  .page-heading h1 { font-size: 27px; }
  .page-heading p { font-size: 13px; }
  .editor-card { padding: 16px; }
  .editor-meta, .source-grid { grid-template-columns: 1fr; }
  .difficulty { align-items: flex-start; flex-direction: column; }
  .difficulty > div { width: 100%; justify-content: space-between; }
  .difficulty button { width: 38px; }
  .section-head { align-items: flex-start; }
  .section-head small { display: none; }
  .form-row { grid-template-columns: 1fr auto; }
  .form-row > select, .form-row > input, .form-row > textarea, .form-row > .multiple-numbers, .form-row > .answer-fields { grid-column: 1; }
  .form-row > .remove { grid-column: 2; grid-row: 1; }
  .answer-fields { flex-direction: column; }
  .solution-editor-grid { grid-template-columns: 1fr; }
  .solution-html, .solution-preview { min-height: 280px !important; }
  #taskList .task-card { flex-wrap: wrap; }
  body #taskList .task-card > .add-homework { width: calc(100% - 31px); margin-left: 31px; }
  .review-content-card { align-items: stretch; flex-direction: column; }
  .review-content-actions { flex-wrap: wrap; }
  .import-preview-summary { grid-template-columns: 1fr; }
  .sticky-actions { bottom: 8px; flex-wrap: wrap; }
  .sticky-actions .primary { flex: 1; }
  .action-hint { width: 100%; margin: 0; padding: 0 4px; }
  .assign-top { align-items: stretch; flex-direction: column; }
  .assign-top > label, .assign-top > label select, .assign-difficulty { min-width: 0; width: 100%; }
  .range-fields select { width: 74px; min-width: 74px; }
  body .homework-item { align-items: flex-start !important; flex-wrap: wrap; }
  body .homework-item > span { flex-basis: calc(100% - 70px) !important; }
  body .homework-requirements { width: 100%; order: 3; }
  .stats-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .material-page-head, .material-viewer-head { flex-direction: column; }
  .material-head-actions { width: 100%; justify-content: flex-start; }
  .material-catalog-filters { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .material-catalog-filters > button { width: 100%; }
  .material-viewer-actions { width: 100%; justify-content: flex-start; }
  .material-grid { grid-template-columns: 1fr !important; }
  .material-list { max-height: 220px; }
  .material-workspace { padding: 14px; }
  .material-meta-grid, .material-switches { grid-template-columns: minmax(0,1fr); }
  .material-meta-wide { grid-column: auto; }
  .material-assignment-head { flex-direction: column; gap: 9px; }
  .material-code-editor > summary small, .material-advanced-settings > summary small { display: none; }
  body .student-login { padding: 24px !important; }
  .homework-card-head, .submit-homework { align-items: stretch; flex-direction: column; }
  .draft-note { max-width: none; text-align: left; }
  .submit-homework .primary { width: 100%; }
  .task-card-title { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 430px) {
  .brand-copy small { display: none; }
  .toolbar { flex-direction: column; }
  .toolbar .secondary { align-self: flex-end; }
  .section-icon { display: none; }
  .stats-grid { grid-template-columns: 1fr 1fr !important; }
  .task-card { padding: 13px; }
  .task-pagination { gap: 8px; flex-wrap: wrap; }
  .task-pagination span { min-width: 100%; order: -1; }
  .student-portal { padding-left: 12px; padding-right: 12px; }
  .student-title-actions { flex-wrap: wrap; justify-content: flex-end; }
  .materials-mobile-open, .student-title-actions .secondary { min-height: 44px; padding: 9px 11px; }
  .material-head-actions .primary, .material-head-actions .secondary { flex: 1 1 auto; }
  .material-catalog-filters { grid-template-columns: minmax(0,1fr); margin-right: 0; margin-left: 0; }
  .material-filter { width: 100%; justify-content: space-between; }
  .material-viewer-actions > * { flex: 1 1 auto; }
  .material-actions > button { flex: 1 1 auto; }
  .material-card-actions { align-items: flex-start; flex-direction: column; gap: 7px; }
  .student-task-list { padding-right: 8px; padding-left: 8px; }
  .student-answer-card { padding: 18px 16px; }
  .student-answer { max-width: 100%; font-size: 16px; }
  .task-equation { font-size: clamp(22px,6vw,27px); line-height: 1.48; }
  .task-statement { font-size: 18px; line-height: 1.65; }
  .student-portal > .student-title { margin-left: -12px; margin-right: -12px; padding-left: 12px; padding-right: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
.school-analytics-page{background:#f3f6f4}
.school-analytics{width:min(1540px,calc(100% - 36px));margin:0 auto;padding:34px 0 70px}
.analytics-hero{display:flex;align-items:flex-end;justify-content:space-between;gap:28px;padding:34px;border:1px solid #cfe0d5;border-radius:24px;background:linear-gradient(135deg,#fff 0,#edf7f0 100%);box-shadow:0 18px 48px rgba(25,73,49,.08)}
.analytics-hero h1{margin:8px 0 10px;font-size:clamp(30px,4vw,52px);line-height:1.04;letter-spacing:-.045em}
.analytics-hero p{max-width:790px;margin:0;color:#52655b;font-size:17px;line-height:1.6}
.export-actions{display:flex;flex-wrap:wrap;gap:10px;justify-content:flex-end}
.export-actions a{display:inline-flex;align-items:center;justify-content:center;min-height:44px;text-decoration:none;white-space:nowrap}
.analytics-kpis{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;margin:18px 0}
.analytics-kpis article{display:grid;gap:5px;padding:20px 22px;border:1px solid #d7e1da;border-radius:16px;background:#fff}
.analytics-kpis span,.analytics-kpis small{color:#64766c}
.analytics-kpis strong{font-size:30px;line-height:1}
.analytics-kpis .missing-year{border-color:#e6cba1;background:#fffaf0}
.analytics-card{margin-top:18px;padding:24px;border:1px solid #d7e1da;border-radius:18px;background:#fff;box-shadow:0 10px 34px rgba(24,56,39,.045)}
.analytics-heading{display:flex;align-items:flex-end;justify-content:space-between;gap:24px;margin-bottom:18px}
.analytics-heading h2{margin:5px 0 0;font-size:25px;letter-spacing:-.025em}
.analytics-heading p{max-width:650px;margin:0;color:#64766c;line-height:1.5;text-align:right}
.table-scroll{overflow:auto;border:1px solid #dce5df;border-radius:13px}
.analytics-table{width:100%;border-collapse:separate;border-spacing:0;font-size:14px}
.analytics-table th,.analytics-table td{padding:11px 13px;border-right:1px solid #e4eae6;border-bottom:1px solid #e4eae6;text-align:left;white-space:nowrap}
.analytics-table thead th{position:sticky;top:0;z-index:2;color:#3d5146;background:#edf4ef;font-size:12px;text-transform:uppercase;letter-spacing:.045em}
.analytics-table tbody th{color:#203a2c;background:#f8faf9}
.analytics-table tr:last-child>*{border-bottom:0}
.analytics-table tr>*:last-child{border-right:0}
.missing-row th,.missing-row td,.missing-cell{color:#8c6740!important;background:#fff7e8!important}
.empty-row{color:#89958f}
.difficulty-pill{display:inline-flex;min-width:42px;justify-content:center;padding:4px 8px;border-radius:999px;color:#175d37;background:#e4f4e9;font-weight:800}
.task-difficulty-badges{display:flex;flex-wrap:wrap;gap:6px;margin:6px 0}
.school-difficulty-pill{color:#175d37;background:#e4f4e9}
.universal-difficulty-pill{color:#57418d;background:#eee8ff}
.target-school-choice{display:grid;gap:8px}
.target-school-main{display:flex;align-items:flex-start;gap:9px}
.target-school-main>span{display:grid}
.target-school-levels{display:flex;flex-wrap:wrap;gap:8px;padding-left:26px}
.target-school-levels label{display:grid;gap:3px;color:var(--muted);font-size:11px}
.target-school-levels select{min-width:112px;padding:7px 9px}
.target-school-profiles{flex:1 0 100%;display:flex;flex-wrap:wrap;gap:6px;margin:2px 0 0;padding:8px;border:1px solid #d6e2da;border-radius:9px}.target-school-profiles legend{padding:0 4px;color:var(--muted);font-size:10px;font-weight:800}.target-school-profiles label{position:relative;display:block}.target-school-profiles input{position:absolute;opacity:0;pointer-events:none}.target-school-profiles span{display:block;padding:6px 9px;border:1px solid #cbdad0;border-radius:99px;color:#4d6256;background:#fff;font-size:11px;font-weight:800;cursor:pointer}.target-school-profiles input:checked+span{border-color:#89b99a;color:#165b35;background:#e4f4e9}
.trend{display:inline-flex;padding:4px 8px;border-radius:999px;font-size:12px;font-weight:800}
.trend.up{color:#923e2f;background:#fff0ec}.trend.down{color:#2c5874;background:#eaf5fb}.trend.flat{color:#426052;background:#edf2ef}
.topic-matrix-scroll{max-height:660px}
.topic-matrix thead th:first-child,.topic-matrix tbody th{position:sticky;left:0;z-index:3}
.topic-matrix tbody td{text-align:center}
.topic-matrix td strong{display:block;font-size:14px}.topic-matrix td small{display:block;color:#77877f;font-size:11px}
.analytics-grid{display:grid;grid-template-columns:minmax(0,1.45fr) minmax(320px,.75fr);gap:18px}
.guide-list,.anomaly-list{display:grid;gap:10px}
.guide-list article{display:flex;align-items:center;justify-content:space-between;gap:18px;padding:14px 16px;border:1px solid #e0e7e2;border-radius:12px}
.guide-list article>div:first-child{display:grid;gap:3px}.guide-list small{color:#6c7d73}
.guide-facts{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:7px}
.guide-facts>span:not(.trend){padding:4px 8px;border-radius:999px;color:#4e6458;background:#f0f4f1;font-size:12px;font-weight:700}
.anomaly-list article{padding:16px;border-left:4px solid #d49b43;border-radius:9px;background:#fff9ee}
.anomaly-list article strong{font-size:18px}.anomaly-list article p{margin:5px 0 0;color:#5d655f;line-height:1.5}
.anomaly-list .source-note{border-left-color:#28734b;background:#eef8f1}
.analytics-source{margin-top:22px;padding:16px 4px;color:#63756b;font-size:14px}
.analytics-source a{color:#176b41}
@media(max-width:1000px){.analytics-kpis{grid-template-columns:repeat(2,1fr)}.analytics-grid{grid-template-columns:1fr}.analytics-hero{align-items:flex-start;flex-direction:column}.export-actions{justify-content:flex-start}.analytics-heading{align-items:flex-start;flex-direction:column}.analytics-heading p{text-align:left}}
@media(max-width:620px){.school-analytics{width:min(100% - 20px,1540px);padding-top:18px}.analytics-hero,.analytics-card{padding:18px}.analytics-kpis{grid-template-columns:1fr}.guide-list article{align-items:flex-start;flex-direction:column}.guide-facts{justify-content:flex-start}}

/* Общая история изменений задач, материалов и школьных работ. */
.content-history-dialog{width:min(760px,calc(100% - 28px));max-height:calc(100vh - 30px);padding:0;border:0;border-radius:18px;color:#20362a;background:#fff;box-shadow:0 25px 80px rgba(15,40,26,.25)}
.content-history-dialog::backdrop{background:rgba(20,39,29,.45);backdrop-filter:blur(2px)}
.content-history-shell{display:flex;max-height:calc(100vh - 30px);flex-direction:column;padding:24px}
.content-history-head{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;padding-bottom:14px;border-bottom:1px solid #e0e8e3}
.content-history-head h2{margin:4px 0 0;font-size:25px}.content-history-close{flex:0 0 auto}
.content-history-current{margin:14px 0 0;color:#4f675a;font-size:13px;font-weight:800}
.content-history-archive-hint{margin:10px 0 0;padding:10px 12px;border:1px solid #e7c58f;border-radius:10px;color:#765310;background:#fff8e8;font-size:13px;line-height:1.45}
.content-history-status{min-height:20px;margin:7px 0;color:#a33e2e;font-size:13px}
.content-history-list{display:grid;min-height:0;gap:10px;overflow:auto;overscroll-behavior:contain;padding:1px 3px 2px 0}
.content-history-item{border:1px solid #d9e4dc;border-radius:13px;background:#fbfcfb;overflow:hidden}
.content-history-item>summary{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:14px 15px;cursor:pointer;list-style:none}.content-history-item>summary::-webkit-details-marker{display:none}
.content-history-item>summary::before{content:'›';flex:0 0 auto;color:#28734b;font-size:22px;font-weight:900;line-height:1;transition:transform .15s ease}.content-history-item[open]>summary::before{transform:rotate(90deg)}
.content-history-item-copy{display:grid;min-width:0;gap:3px;margin-right:auto}.content-history-item-copy strong{font-size:15px}.content-history-item-copy small{overflow:hidden;color:#6d7d74;font-size:11px;text-overflow:ellipsis;white-space:nowrap}
.content-history-item>summary b{flex:0 0 auto;padding:5px 8px;border-radius:999px;color:#285a3e;background:#e7f3eb;font-size:11px}
.content-history-item-body{display:grid;gap:13px;padding:0 15px 15px;border-top:1px solid #e4ebe6;background:#fff}
.content-history-snapshot{min-width:0;padding-top:14px;color:#617168;font-size:13px}.content-history-snapshot.error{color:#a33e2e}
.content-history-snapshot-facts{display:grid;grid-template-columns:minmax(120px,.32fr) minmax(0,1fr);margin:0;border:1px solid #e1e8e3;border-radius:10px;overflow:hidden}
.content-history-snapshot-facts dt,.content-history-snapshot-facts dd{min-width:0;margin:0;padding:9px 10px;border-bottom:1px solid #e7ece9;white-space:pre-wrap;overflow-wrap:anywhere}.content-history-snapshot-facts dt{color:#607168;background:#f4f7f5;font-size:11px;font-weight:800}.content-history-snapshot-facts dd{max-height:240px;overflow:auto;color:#263b2f}.content-history-snapshot-facts>*:nth-last-child(-n+2){border-bottom:0}
.content-history-raw{margin-top:11px;border:1px solid #e0e7e2;border-radius:9px;background:#f8faf9}.content-history-raw>summary{padding:9px 11px;color:#52685c;cursor:pointer;font-size:12px;font-weight:800}.content-history-raw pre{max-height:300px;margin:0;overflow:auto;padding:12px;border-top:1px solid #e0e7e2;color:#263b2f;background:#fff;font:12px/1.5 ui-monospace,SFMono-Regular,Consolas,monospace;white-space:pre-wrap;overflow-wrap:anywhere}
.content-history-item-actions{display:flex;justify-content:flex-end}.content-history-restore:disabled{cursor:not-allowed;opacity:.55}
.content-history-empty{margin:0;padding:28px;border:1px dashed #c8d7cd;border-radius:12px;color:#64756b;background:#f8faf9;text-align:center}
.content-history-more{align-self:center;margin-top:14px}
@media(max-width:560px){.content-history-dialog{width:calc(100% - 16px);max-height:calc(100dvh - 16px);border-radius:14px}.content-history-shell{max-height:calc(100dvh - 16px);padding:17px 14px}.content-history-head h2{font-size:21px}.content-history-item>summary{align-items:flex-start;gap:9px;padding:13px 11px}.content-history-item-copy small{white-space:normal}.content-history-item>summary b{font-size:10px}.content-history-item-body{padding:0 11px 12px}.content-history-snapshot-facts{grid-template-columns:1fr}.content-history-snapshot-facts dt,.content-history-snapshot-facts dd{border-bottom:1px solid #e7ece9}.content-history-snapshot-facts>*:last-child{border-bottom:0}.content-history-restore,.content-history-more{width:100%}}

/* School workspace */
.school-workspace-page{background:#f2f5f3}
.school-workspace{display:grid;grid-template-columns:300px minmax(0,1fr);min-height:calc(100vh - var(--header-height) - var(--quick-bar-height))}
.school-directory{position:sticky;top:calc(var(--header-height) + var(--quick-bar-height));align-self:start;height:calc(100vh - var(--header-height) - var(--quick-bar-height));overflow:auto;padding:27px 18px;border-right:1px solid #d7e0da;background:#fbfcfb}
.school-directory-head,.school-section-head,.school-record-top,.dialog-head,.dialog-actions{display:flex;align-items:center;justify-content:space-between;gap:16px}
.school-directory-head h1{margin:3px 0 0;font-size:27px}
.school-directory-help{margin:15px 2px 20px;color:#64756c;font-size:13px;line-height:1.5}
.school-list{display:grid;gap:8px}
.school-list-item{display:grid;grid-template-columns:42px minmax(0,1fr) auto;align-items:center;gap:11px;padding:11px;border:1px solid transparent;border-radius:13px;color:#20362a;text-decoration:none}
.school-list-item:hover{border-color:#d7e3da;background:#f2f7f4}.school-list-item.active{border-color:#a9d2b8;background:#eaf6ee}
.school-list-item>span:nth-child(2){display:grid;gap:3px;min-width:0}.school-list-item strong,.school-list-item small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.school-list-item small{color:#6c7c73;font-size:11px}.school-list-item>b{display:grid;place-items:center;min-width:23px;height:23px;padding:0 6px;border-radius:999px;color:#8a4c0d;background:#fff0d8;font-size:11px}
.school-monogram{display:grid;place-items:center;width:42px;height:42px;border-radius:12px;color:#1e6942;background:#dff1e5;font-size:18px;font-weight:900}
.school-dossier{width:min(1240px,calc(100% - 40px));margin:0 auto;padding:30px 0 70px}
.school-profile{display:flex;align-items:flex-end;justify-content:space-between;gap:28px;padding:30px;border:1px solid #cfe0d5;border-radius:22px;background:linear-gradient(135deg,#fff 0,#edf7f0 100%);box-shadow:0 16px 42px rgba(23,69,46,.07)}
.school-profile h1{margin:7px 0 5px;font-size:clamp(30px,4vw,48px);line-height:1.05;letter-spacing:-.04em}.school-profile p{max-width:750px;margin:8px 0 0;color:#586b60;line-height:1.55}.school-profile .school-full-name{margin-top:0;font-weight:700}
.school-profile-badges{display:flex;flex-wrap:wrap;gap:7px;margin-top:13px}.school-profile-badges span{padding:6px 10px;border:1px solid #bcd5c5;border-radius:99px;color:#24593d;background:#fff;font-size:12px;font-weight:800}
.school-profile-actions{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:9px}.school-profile-actions a{display:inline-flex;align-items:center;text-decoration:none}
.school-kpis{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:13px;margin:16px 0}
.school-kpis article{display:grid;gap:4px;padding:18px 20px;border:1px solid #d7e1da;border-radius:15px;background:#fff}.school-kpis article.attention{border-color:#e7c58f;background:#fff9ee}
.school-kpis span,.school-kpis small{color:#697a70}.school-kpis strong{font-size:29px;line-height:1.1}
.school-admission-card{margin:16px 0;padding:23px;border:1px solid #cfdbe8;border-radius:18px;background:linear-gradient(145deg,#f8fbff,#fff);box-shadow:0 9px 30px rgba(24,56,90,.04)}
.school-admission-card .school-section-head p{max-width:760px;margin:5px 0 0;color:#627080;font-size:13px;line-height:1.45}.admission-empty{margin-top:15px;padding:18px;border:1px dashed #cbd7e4;border-radius:13px;color:#697887;background:#fff}
.admission-route-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-top:16px}.admission-route{padding:17px;border:1px solid #d4deea;border-left:5px solid #b5c2d0;border-radius:14px;background:#fff}.admission-route.evidence-confirmed{border-left-color:#4c9a68}.admission-route.evidence-scheme_only{border-left-color:#5d82bb}.admission-route.evidence-inferred{border-left-color:#c39443}.admission-route.evidence-not_found{border-left-color:#bd6c6c}
.admission-route-head{display:flex;align-items:center;justify-content:space-between;gap:8px;color:#536477;font-size:12px;font-weight:850;text-transform:uppercase;letter-spacing:.04em}.admission-route h3{margin:4px 0 2px;font-size:20px}.admission-route p{margin:8px 0 0;color:#596777;font-size:13px;line-height:1.45}.admission-route .route-name{margin-top:1px;color:#798492}.admission-route-facts{display:flex;flex-wrap:wrap;gap:7px;margin-top:12px}.admission-route-facts span{padding:7px 9px;border-radius:9px;color:#46576b;background:#eef3f8;font-size:11px}.admission-route-facts b{font-size:13px}.admission-route .route-format{color:#354d67;font-weight:800}.route-evidence{display:flex;flex-wrap:wrap;align-items:center;gap:7px 10px;margin-top:12px;padding:8px 10px;border-radius:9px;color:#47576a;background:#f1f5f9;font-size:11px}.route-evidence a{color:#2155a3;font-weight:750}.route-official-note{font-size:11px!important;color:#697584!important}
.school-json-archive{display:grid;grid-template-columns:minmax(250px,.65fr) minmax(0,1.35fr);align-items:center;gap:24px;margin:0 0 16px;padding:21px 23px;border:1px solid #cfe0d5;border-radius:18px;background:linear-gradient(135deg,#f7fbf8,#edf7f0)}
.school-json-archive h2{margin:4px 0 6px;font-size:22px}.school-json-archive p{margin:0;color:#62746a;font-size:13px;line-height:1.45}
.school-json-downloads{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:9px}.school-json-downloads a{display:grid;gap:2px;min-width:145px;padding:10px 12px;border:1px solid #bed8c7;border-radius:11px;color:#176b41;background:#fff;font-size:13px;font-weight:800;text-decoration:none}.school-json-downloads a:hover{border-color:#75ad89;background:#f9fffb}.school-json-downloads small{color:#6b7d72;font-size:10px;font-weight:600}
.school-archive-card{padding:23px;border:1px solid #d7e1da;border-radius:18px;background:#fff;box-shadow:0 9px 30px rgba(24,56,39,.04)}
.school-section-head{align-items:flex-end;margin-bottom:17px}.school-section-head h2{margin:4px 0 0;font-size:24px;letter-spacing:-.025em}
.school-record-catalog-head{align-items:center}.school-record-filter-panel{margin:-3px 0 17px;padding:12px;border:1px solid #dce5df;border-radius:13px;background:#f8faf9}.school-record-filter-panel>summary{display:none;align-items:center;justify-content:space-between;gap:10px;cursor:pointer;list-style:none}.school-record-filter-panel>summary::-webkit-details-marker{display:none}.school-record-filter-panel>summary span{font-weight:850}.school-record-filter-panel>summary b{display:grid;place-items:center;min-width:22px;height:22px;padding:0 6px;border-radius:999px;color:#fff;background:#28734b;font-size:11px}
.school-record-filters{display:flex;flex-wrap:wrap;justify-content:flex-start;gap:8px}.school-record-filters select,.school-record-filters input,.record-status select{min-height:38px;padding:7px 31px 7px 10px;border:1px solid #cddad1;border-radius:9px;background:#fff}.school-record-filters input{width:108px;padding-right:10px}.record-year-filter,.record-search-filter{position:relative;display:block}.record-year-filter>span,.record-search-filter>span{position:absolute;z-index:1;top:-6px;left:8px;padding:0 3px;color:#718078;background:#f8faf9;font-size:9px;font-weight:800}.record-search-filter input{width:250px}.record-route-filter{max-width:340px}.record-filter-reset{margin-left:auto}.school-record-list-summary{min-height:22px;margin:0 2px 12px;color:#61736a;font-size:13px}.school-record-groups[aria-busy=true]{min-height:130px;opacity:.55;pointer-events:none}
.school-record-groups{display:grid;gap:14px}.school-record-group{border:1px solid #dce5df;border-radius:14px;background:#f8faf9;overflow:hidden}.school-record-group[hidden]{display:none}.school-record-group>summary{display:flex;align-items:center;justify-content:space-between;gap:15px;padding:14px 16px;cursor:pointer;list-style:none}.school-record-group>summary::-webkit-details-marker{display:none}.school-record-group>summary strong{font-size:17px}.school-record-group>summary span{padding:4px 8px;border-radius:999px;color:#52675b;background:#e8efeb;font-size:11px}.school-record-group>.school-records{padding:0 12px 12px}
.school-records{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.school-record{display:flex;flex-direction:column;min-width:0;padding:16px;border:1px solid #dde5df;border-radius:14px;background:#fbfcfb}
.school-record.pinned{border-color:#b7d4c1;box-shadow:inset 0 3px #3c9662}.school-record.is-archived{background:#f7f8f7}.school-record[hidden]{display:none}
.school-record-top{justify-content:flex-start}.school-record-top .record-edit{margin-left:auto}
.record-kind,.record-pin{display:inline-flex;padding:4px 8px;border-radius:999px;font-size:11px;font-weight:800}.record-kind{color:#315747;background:#e9f2ed}
.kind-exam{color:#285b7d;background:#e8f3fa}.kind-table{color:#62519a;background:#f0edfb}.kind-analysis{color:#8a4d17;background:#fff1df}.kind-observation{color:#7b3f61;background:#f9eaf2}.record-pin{color:#78631f;background:#fff8d5}
.school-record h3{margin:13px 0 7px;font-size:18px;line-height:1.25}.school-record>p{display:-webkit-box;overflow:hidden;margin:0 0 13px;color:#5e6e65;line-height:1.48;-webkit-line-clamp:5;-webkit-box-orient:vertical}
.record-route-badge{display:grid;gap:2px;margin:0 0 10px;padding:8px 9px;border:1px solid #cbdde8;border-radius:9px;color:#31566f;background:#edf6fb}.record-route-badge>span{font-size:9px;font-weight:850;text-transform:uppercase;letter-spacing:.04em}.record-route-badge>strong{font-size:11px;line-height:1.35}.record-route-badge>em{color:#765310;font-size:10px;font-style:normal}.record-route-badge.needs-classification{border-color:#e4c47f;color:#704d0c;background:#fff7df}.record-route-badge.needs-classification>strong{font-size:12px}.record-route-badge.is-archived{border-color:#d8cfb6;background:#f8f4e9}
.record-exam-classification{display:flex;flex-wrap:wrap;gap:6px;margin:0 0 10px}.record-exam-classification span,.record-exam-classification em{padding:4px 7px;border-radius:7px;color:#4d6257;background:#eaf0ec;font-size:10px;font-style:normal;font-weight:800}.record-exam-classification .stage-stage_1{color:#285b7d;background:#e4f1f8}.record-exam-classification .stage-stage_2{color:#714c13;background:#fff0c9}.record-exam-classification .stage-stage_3,.record-exam-classification .stage-additional{color:#7b3f61;background:#f9eaf2}.record-exam-classification .stage-single{color:#17633c;background:#e2f5e9}.record-exam-classification .stage-unknown{color:#6b7470;background:#edf0ee}.record-exam-classification .confidence-confirmed{color:#17633c;background:#e2f5e9}.record-exam-classification .confidence-inferred{color:#765310;background:#fff0c9}.record-stage-note{display:block!important;margin:-2px 0 11px!important;padding:8px 9px;border-left:3px solid #cad8cf;color:#64736b!important;background:#f3f6f4;font-size:11px;-webkit-line-clamp:unset!important}
.record-official-check{display:flex;flex-wrap:wrap;align-items:center;gap:7px 10px;margin-top:9px;padding:8px 10px;border:1px solid #d8dee8;border-radius:10px;background:#f7f9fc;font-size:12px;color:#4b5565}.record-official-check strong{color:#273142}.record-official-check a{font-weight:700;color:#2155a3}.record-official-check.official-confirmed{border-color:#b9dec8;background:#eff9f3}.record-official-check.official-scheme_only{border-color:#c9d5ef;background:#f1f5fd}.record-official-check.official-not_found,.record-official-check.official-not_checked{border-color:#ead7aa;background:#fff9eb}.record-official-check.official-contradicted{border-color:#e8b7b7;background:#fff1f1}.record-official-note{margin:6px 0 0;color:#5d6573;font-size:12px;line-height:1.45}
.record-source{display:grid;gap:2px;margin:0 0 12px;padding:9px 10px;border-radius:9px;color:#5e665f;background:#f0f3f1;font-size:11px}.record-source strong{font-size:12px}.record-source.is-official{color:#17633c;background:#e2f5e9}.record-source.is-unofficial{color:#765310;background:#fff0c9}.record-source.is-unknown{color:#6b7470;background:#edf0ee}.record-reliability{width:max-content;margin-top:5px;padding:3px 6px;border-radius:999px;background:rgba(255,255,255,.72);font-size:10px;font-style:normal;font-weight:800}.record-reliability.is-high{color:#17633c}.record-reliability.is-medium{color:#765310}.record-reliability.is-low{color:#9b392c}.record-reliability.is-unknown{color:#68736d}
.record-meta{display:flex;flex-wrap:wrap;gap:6px;margin:auto 0 13px}.record-meta span,.record-meta a,.record-meta-action{padding:4px 7px;border:0;border-radius:7px;color:#52685c;background:#eef3f0;font:inherit;font-size:11px;text-decoration:none}.record-meta a,.record-meta-action{color:#176c40;cursor:pointer}.record-meta-action:hover{background:#dfeee4}.record-meta-action:disabled{cursor:wait;opacity:.6}
.record-status{display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;gap:9px;padding-top:11px;border-top:1px solid #e3e9e5}.record-status>span{color:#728078;font-size:11px}.record-status select{width:100%;min-width:0}
.school-record-archive-actions{display:flex;align-items:center;justify-content:space-between;gap:10px;padding-top:11px;border-top:1px solid #e1e7e3}.school-record-archive-actions>span{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:7px}.school-record-archive-actions small{color:#697970;font-size:11px}.school-record-pagination{display:grid;grid-template-columns:auto minmax(110px,1fr) auto;align-items:center;gap:12px;margin-top:17px;padding-top:16px;border-top:1px solid #e1e7e3}.school-record-pagination span{color:#5e7066;font-size:13px;font-weight:750;text-align:center}
.archive-empty,.analytics-placeholder,.school-empty{padding:34px;border:1px dashed #c8d7cd;border-radius:14px;color:#64756b;background:#f8faf9;text-align:center}.archive-empty p{margin:0 0 15px}
.school-empty{margin-top:80px}.school-empty>span{font-size:45px}.school-empty h2{margin:12px 0 6px;color:#263c30}.school-empty p{max-width:560px;margin:0 auto 18px;line-height:1.55}
.school-auto-analytics{margin-top:16px;border:1px solid #d7e1da;border-radius:18px;background:#fff;overflow:hidden}
.school-auto-analytics>summary{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:20px 23px;cursor:pointer;list-style:none}.school-auto-analytics>summary::-webkit-details-marker{display:none}
.school-auto-analytics>summary span{display:grid;gap:3px}.school-auto-analytics>summary small{color:#6f7e76}.school-auto-analytics>summary strong{font-size:22px}.school-auto-analytics>summary>b{padding:6px 10px;border-radius:999px;color:#256241;background:#e8f4ec;font-size:12px}
.auto-analytics-body{padding:0 23px 23px;border-top:1px solid #e3e9e5}.auto-analytics-grid{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(320px,.85fr);gap:24px;padding-top:22px}
.topic-bars{display:grid;gap:9px}.topic-bars article{display:grid;gap:6px}.topic-bars article>div{display:flex;align-items:center;justify-content:space-between;gap:15px;font-size:12px}.topic-bars article span{color:#6d7c73}.topic-bars i{display:block;height:7px;border-radius:99px;background:linear-gradient(90deg,#459968 var(--bar),#edf2ef var(--bar))}
.school-export-row{display:flex;flex-wrap:wrap;gap:9px;margin-top:20px}.school-export-row a{padding:8px 11px;border-radius:9px;color:#176b41;background:#edf6f0;font-size:12px;font-weight:800;text-decoration:none}
.school-dialog{width:min(680px,calc(100% - 28px));max-height:calc(100vh - 30px);padding:0;border:0;border-radius:18px;background:#fff;box-shadow:0 25px 80px rgba(15,40,26,.25)}.school-dialog::backdrop{background:rgba(20,39,29,.45);backdrop-filter:blur(2px)}
.school-dialog form{display:grid;gap:15px;padding:24px}.school-dialog h2{margin:4px 0 0;font-size:25px}.school-dialog label{display:grid;gap:6px;color:#42564b;font-size:13px;font-weight:700}.school-dialog label small{color:#718078;font-size:11px;font-weight:400}
.school-dialog input,.school-dialog textarea,.school-dialog select{width:100%;padding:10px 11px;border:1px solid #cdd9d1;border-radius:9px;background:#fff;color:#20362a;font:inherit}.school-dialog input.route-controlled{color:#315a43;background:#eef5f0}.school-dialog textarea{resize:vertical;line-height:1.45}
.form-pair{display:grid;grid-template-columns:1fr 1fr;gap:12px}.dialog-actions{display:grid;grid-template-columns:auto 1fr auto auto;margin-top:3px}.record-dialog .dialog-actions{grid-template-columns:auto auto 1fr auto auto}
.form-error{min-height:18px;margin:0;color:#a33e2e;font-size:13px}.form-error.success{color:#17633c}.danger.subtle{color:#9b392c;background:#fff0ed;border-color:#f0c9c2}
.school-file-field{padding:13px;border:1px dashed #afcbb8;border-radius:11px;background:#f3f8f5;cursor:pointer}.school-file-field input{padding:0;border:0}.school-file-field span{color:#1e7044}
.pin-check{display:flex!important;grid-template-columns:none!important;align-items:center;gap:9px!important}.pin-check input{width:18px;height:18px}.pin-check span{font-weight:600}
@media(max-width:1150px){.school-records{grid-template-columns:repeat(2,minmax(0,1fr))}.auto-analytics-grid{grid-template-columns:1fr}.school-kpis{grid-template-columns:repeat(2,1fr)}}
@media(max-width:820px){.school-workspace{display:block}.school-directory{position:static;width:100%;height:auto;padding:16px;border-right:0;border-bottom:1px solid #d7e0da}.school-directory-help{margin:8px 0 12px}.school-list{display:flex;overflow:auto}.school-list-item{min-width:230px}.school-dossier{width:min(100% - 22px,1240px);padding-top:16px}.school-profile{align-items:flex-start;flex-direction:column;padding:21px}.school-profile-actions{justify-content:flex-start}.school-json-archive{grid-template-columns:1fr}.school-json-downloads{justify-content:flex-start}.school-records,.admission-route-grid{grid-template-columns:1fr}}
@media(min-width:561px){details.school-record-filter-panel:not([open])>.school-record-filters{display:flex}}
@media(max-width:560px){.school-kpis{grid-template-columns:1fr 1fr}.school-archive-card,.school-admission-card{padding:15px}.school-section-head{align-items:flex-start;flex-direction:column}.school-record-catalog-head{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center}.school-record-catalog-head>button{white-space:nowrap}.school-record-filter-panel{padding:11px}.school-record-filter-panel>summary{display:flex}.school-record-filter-panel[open]>summary{margin-bottom:11px}.school-record-filters{width:100%;flex-direction:column}.school-record-filters select,.school-record-filters input,.record-filter-reset{width:100%;margin-left:0}.record-route-filter{max-width:none}.school-record-pagination{grid-template-columns:1fr 1fr}.school-record-pagination span{grid-column:1/-1;grid-row:1}.school-record-pagination button{grid-row:2;width:100%}.form-pair{grid-template-columns:1fr}.dialog-actions,.record-dialog .dialog-actions{grid-template-columns:1fr 1fr}.dialog-actions>span{display:none}.dialog-actions .danger{grid-column:1/-1}.record-dialog .dialog-actions .danger{grid-column:auto}.record-dialog .dialog-actions button{width:100%}.school-kpis article{padding:15px}.school-profile-actions{display:grid;grid-template-columns:1fr 1fr;width:100%}.school-profile-actions>*{width:100%;justify-content:center}.school-profile-actions .primary{grid-column:1/-1;grid-row:1}.school-auto-analytics>summary{padding:17px}.auto-analytics-body{padding:0 15px 15px}}

/* Strict neutral workspace: one visual language for dense everyday work. */
html { color-scheme: light; }
body { color: #18181b; background: #fafafa; font-size: 14px; line-height: 1.45; }
a { color: #3f3f46; }
a:hover { color: #09090b; }
::selection { color: #09090b; background: #e4e4e7; }
button:focus-visible,
a:focus-visible,
summary:focus-visible { outline-color: rgba(24,24,27,.28); }

/* The only persistent chrome is the compact primary header. */
.app-header {
  min-height: var(--header-height);
  padding: 0 20px;
  gap: 20px;
  border-color: #e4e4e7;
  background: rgba(255,255,255,.97);
  box-shadow: none;
  backdrop-filter: blur(10px);
}
.brand { gap: 9px; }
.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: #18181b;
  box-shadow: none;
  font-size: 14px;
}
.brand-copy strong { color: #18181b; font-size: 14px; }
.brand-copy small { margin-top: 2px; color: #71717a; font-size: 10px; }
.main-nav { gap: 1px; }
.tab { padding: 0 12px; color: #71717a; font-size: 12px; font-weight: 650; }
.tab::after { left: 12px; right: 12px; height: 2px; border-radius: 0; }
.tab:hover { color: #18181b; background: #fafafa; }
.tab.active { color: #09090b; }
.tab.active::after { background: #18181b; }
.settings-nav {
  width: 32px;
  height: 32px;
  border-color: #d4d4d8;
  border-radius: 6px;
  color: #71717a;
  background: #fff;
}
.settings-nav:hover,
.settings-nav.active { color: #18181b; border-color: #a1a1aa; background: #f4f4f5; }
.header-account { gap: 7px; }
.account-avatar {
  width: 29px;
  height: 29px;
  border-radius: 6px;
  color: #3f3f46;
  background: #e4e4e7;
}
.account-name { color: #3f3f46; }
.account-logout { border-color: #d4d4d8; border-radius: 6px; }

.quick-actions,
.curriculum-grade-bar {
  position: static;
  border-color: #e4e4e7;
  box-shadow: none;
  backdrop-filter: none;
}
.quick-actions {
  min-height: var(--quick-bar-height);
  padding: 5px 20px;
  justify-content: flex-start;
  gap: 6px;
  background: #fafafa;
}
.quick-actions-label { color: #a1a1aa; }
.quick-action {
  min-height: 32px;
  padding: 5px 10px;
  gap: 6px;
  border-color: #d4d4d8;
  border-radius: 6px;
  color: #52525b;
  background: #fff;
  box-shadow: none;
  font-size: 11px;
  transition: border-color .12s, background .12s, color .12s;
}
.quick-actions a.quick-action { color: #52525b; }
.quick-action:hover { transform: none; color: #18181b; border-color: #a1a1aa; background: #f4f4f5; }
.quick-action.active { color: #fff; border-color: #18181b; background: #18181b; }
.quick-action-icon {
  width: 19px;
  height: 19px;
  border-radius: 4px;
  color: inherit;
  background: transparent;
}
.quick-action.active .quick-action-icon { color: inherit; background: transparent; }
.quick-review-badge { box-shadow: none; }
.filter-sidebar-toggle,
.filter-drawer-backdrop { display: none; }
.curriculum-grade-bar {
  min-height: var(--curriculum-bar-height);
  padding: 5px 20px;
  justify-content: flex-start;
  gap: 12px;
  background: #fff;
}
.curriculum-grade-switch { padding: 2px; border-radius: 6px; background: #f4f4f5; }
.curriculum-grade-switch button {
  min-height: 28px;
  padding: 3px 10px;
  border-radius: 4px;
  color: #71717a;
  font-size: 11px;
}
.curriculum-grade-switch button:hover { color: #18181b; background: #e4e4e7; }
.curriculum-grade-switch button.active { color: #fff; background: #18181b; box-shadow: none; }

/* Dense page shell and filter rail. */
.app-shell { grid-template-columns: 320px minmax(0,1fr); }
.app-shell.wide .content { width: min(100%,1440px); }
.filter-sidebar {
  top: var(--header-height);
  height: calc(100vh - var(--header-height));
  padding: 20px 16px 32px;
  border-color: #e4e4e7;
  background: #fafafa;
  scrollbar-color: #d4d4d8 transparent;
}
.aside-title { margin: 0 3px 14px; }
.aside-title strong { font-size: 16px; }
.eyebrow { color: #71717a; font-size: 10px; }
.icon {
  width: 32px;
  height: 32px;
  border-color: #d4d4d8;
  border-radius: 6px;
  color: #52525b;
  box-shadow: none;
}
.icon:hover { transform: none; color: #18181b; border-color: #a1a1aa; background: #f4f4f5; }
.filter-help { color: #a1a1aa; }
.school-quick-filter,
.school-specific-profiles {
  padding: 11px;
  border-color: #e4e4e7;
  border-radius: 7px;
  background: #fff;
  box-shadow: none;
}
.school-quick-head small,
.school-specific-profiles small { color: #71717a; }
.school-quick-head > button,
.school-quick-list button,
.school-profile-options button {
  border-color: #d4d4d8;
  border-radius: 6px;
  color: #52525b;
  background: #fff;
  box-shadow: none;
}
.school-quick-list button:hover,
.school-profile-options button:hover { color: #18181b; border-color: #a1a1aa; background: #f4f4f5; }
.school-quick-list b { color: #3f3f46; background: #e4e4e7; }
.school-profile-options button.active { color: #fff; border-color: #18181b; background: #18181b; }
.tag-match-control,
.builder-mode-switch,
.section-tabs { border-radius: 7px; background: #f4f4f5; }
.tag-match-control span,
.builder-mode-switch button,
.section-tab { border-radius: 5px; }
.tag-match-control input:checked + span,
.builder-mode-switch button.active,
.section-tab.active { color: #18181b; background: #fff; box-shadow: 0 1px 2px rgba(24,24,27,.05); }
.entity { border-radius: 7px; }
.entity:not(.collapsed) { box-shadow: none; }
.super-entity-heading {
  border-left-width: 2px;
  border-left-color: #71717a;
  border-radius: 0 5px 5px 0;
  color: #52525b;
  background: #f4f4f5;
}
.super-entity-heading:hover { color: #18181b; background: #e4e4e7; }
.entity-head:hover,
.tag:hover { background: #f4f4f5; }
.tag.selected,
.entity[data-role="direction"] .tag.selected { color: #18181b; border-color: #a1a1aa; background: #e4e4e7; }
.tag-count,
.pill { color: #52525b; background: #e4e4e7; }
.entity[data-role="direction"] .tag { border-radius: 6px; box-shadow: none; }
.content { max-width: 1320px; padding: 24px 32px 72px; }
.toolbar {
  min-height: 38px;
  margin-bottom: 16px;
  padding: 7px 10px;
  border-radius: 7px;
  background: #fff;
}
.status-dot { box-shadow: none; }
.page-heading { margin-bottom: 19px; }
.page-heading h1 { font-size: clamp(24px,2.5vw,31px); }
.page-heading p { color: #71717a; }
.surface,
.editor-card,
.task-card,
.student-task,
.review-queue-section,
.review-batch-card,
.inbox-card,
.knowledge-group { border-radius: 8px; box-shadow: none; }
.editor-card { padding: 20px; }

/* Compact, predictable controls. */
input:not([type="checkbox"]):not([type="radio"]),
textarea,
select {
  min-height: 38px;
  padding: 8px 10px;
  border-color: #d4d4d8;
  border-radius: 6px;
  background: #fff;
}
input:not([type="checkbox"]):not([type="radio"]):hover,
textarea:hover,
select:hover { border-color: #a1a1aa; }
input:not([type="checkbox"]):not([type="radio"]):focus,
textarea:focus,
select:focus { border-color: #71717a; box-shadow: 0 0 0 3px rgba(24,24,27,.08); }
input:not([type="checkbox"]):not([type="radio"]):disabled,
textarea:disabled,
select:disabled { background: #f4f4f5; }
.primary,
.secondary {
  min-height: 38px;
  padding: 8px 13px;
  border-radius: 6px;
  box-shadow: none;
  transition: color .12s, background .12s, border-color .12s;
}
.primary { color: #fff; border-color: #18181b; background: #18181b; box-shadow: none; }
.primary:hover { transform: none; color: #fff; border-color: #09090b; background: #09090b; box-shadow: none; }
.secondary { color: #3f3f46; border-color: #d4d4d8; background: #fff; box-shadow: none; }
.secondary:hover { transform: none; color: #18181b; border-color: #a1a1aa; background: #f4f4f5; }
.compact { min-height: 30px; padding: 5px 9px; border-radius: 5px; }
.add-button { color: #3f3f46; border-color: #d4d4d8; }
.upload-field,
.difficulty,
.universal-difficulty-field,
.form-row,
.answer-editor,
.assign-top,
.import-upload { border-radius: 7px; background: #fafafa; }
.upload-field:hover,
.import-upload:hover { border-color: #71717a; background: #f4f4f5; }
.upload-icon { border-radius: 6px; color: #3f3f46; background: #e4e4e7; }
.universal-difficulty-field { border-color: #e4e4e7; background: #f4f4f5; }
.difficulty button { border-radius: 5px; }
.difficulty button:hover { transform: none; color: #18181b; border-color: #71717a; }
.difficulty button.active { color: #fff; border-color: #18181b; background: #18181b; box-shadow: none; }
.sticky-actions {
  bottom: 8px;
  border-color: #d4d4d8;
  border-radius: 8px;
  background: rgba(255,255,255,.97);
  box-shadow: 0 4px 14px rgba(24,24,27,.08);
}
.task-card { padding: 13px 14px; }
.task-card:hover { border-color: #a1a1aa; box-shadow: none; }
.task-solution-peek { border-radius: 6px; }
.task-solution-peek > summary { color: #3f3f46; }
.task-solution-peek > summary::before { color: #fff; background: #3f3f46; }
.task-pagination { border-radius: 7px; }
body .homework-box {
  border-color: #d4d4d8 !important;
  border-radius: 8px !important;
  background: #fff !important;
  box-shadow: none !important;
}
body .battle-test-cart { border-color: #d4d4d8 !important; background: #f4f4f5 !important; }
body .homework-count { background: #18181b !important; }
body .homework-item { border-color: #e4e4e7 !important; border-radius: 6px !important; box-shadow: none; }
body .task-card > .add-homework { border-color: #18181b !important; border-radius: 6px !important; background: #18181b !important; }
body .add-homework:hover { background: #09090b !important; }

/* Materials: one document, one scroll, compact catalog rows. */
body.materials-mode .app-shell { display: block; min-height: calc(100vh - var(--header-height) - var(--quick-bar-height)); }
body.materials-mode .app-shell > .content { width: min(100%,1440px); max-width: 1440px; margin: 0 auto; }
body.materials-mode .curriculum-grade-bar { display: none; }
body.materials-mode .filter-sidebar {
  position: fixed;
  z-index: 90;
  inset: 0 auto 0 0;
  width: min(390px,calc(100vw - 44px));
  height: 100dvh;
  padding: 22px 18px 40px;
  border-right: 1px solid #d4d4d8;
  background: #fff;
  box-shadow: 14px 0 36px rgba(24,24,27,.14);
  overflow-y: auto;
  visibility: hidden;
  transform: translateX(-104%);
  transition: transform .18s ease, visibility .18s;
}
body.materials-mode.materials-filter-open .filter-sidebar { visibility: visible; transform: translateX(0); }
.material-filter-close { margin-left: auto; font-size: 20px; line-height: 1; }
.material-filter-backdrop {
  position: fixed;
  z-index: 85;
  inset: 0;
  display: none;
  border: 0;
  background: rgba(24,24,27,.38);
}
body.materials-mode.materials-filter-open .material-filter-backdrop { display: block; }
body.materials-mode.materials-filter-open { overflow: hidden; }
.material-editor { --material-line: #e4e4e7; --material-line-strong: #d4d4d8; --material-muted: #71717a; --material-soft: #f4f4f5; }
.material-editor .primary { border-color: #18181b; background: #18181b; box-shadow: none; }
.material-editor .primary:hover { border-color: #09090b; background: #09090b; box-shadow: none; }
.material-page-head { margin: 0 0 16px; }
.material-page-head h2 { font-size: 24px; letter-spacing: -.025em; }
.material-page-head p { margin-top: 4px; }
.material-head-actions { gap: 7px; }
.material-catalog { display: grid; min-width: 0; gap: 12px; }
.material-catalog-toolbar {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.material-filter-summary,
.material-catalog-results { color: #71717a; font-size: 12px; }
.material-topic-trigger,
.material-back-to-catalog { flex: 0 0 auto; }
.material-catalog-filters {
  grid-template-columns: minmax(250px,2fr) auto minmax(180px,1.35fr) repeat(2,minmax(105px,.65fr)) auto;
  gap: 8px;
  margin: 0;
  padding: 11px;
  border-radius: 8px;
  background: #f4f4f5;
}
.material-catalog-filters label { gap: 4px; color: #71717a; font-size: 10px; }
.material-catalog-filters input,
.material-catalog-filters select { min-height: 36px; }
.material-catalog-filters > button { min-height: 36px; }
.material-topic-trigger { align-self: end; white-space: nowrap; }
.material-topic-trigger span {
  display: inline-grid;
  min-width: 18px;
  min-height: 18px;
  place-items: center;
  border-radius: 4px;
  color: #3f3f46;
  background: #e4e4e7;
  font-size: 10px;
}
.material-topic-trigger span:empty { display: none; }
.material-filter-summary {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.material-filter-summary > span { margin-right: 2px; font-weight: 700; }
.material-filter-summary button {
  min-height: 27px;
  padding: 4px 8px;
  border: 1px solid #d4d4d8;
  border-radius: 5px;
  color: #3f3f46;
  background: #fff;
  cursor: pointer;
  font-size: 11px;
}
.material-filter-summary button:hover { color: #18181b; border-color: #a1a1aa; background: #f4f4f5; }
.material-catalog-results { min-width: 0; color: inherit; }
.material-catalog-results-head {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 12px;
  border: 1px solid #e4e4e7;
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  background: #fff;
}
.material-catalog-results-head h3 { margin: 0; font-size: 15px; }
.material-catalog-results-head small { color: #a1a1aa; font-size: 10px; white-space: nowrap; }
.material-catalog-results-head kbd {
  padding: 2px 5px;
  border: 1px solid #d4d4d8;
  border-bottom-width: 2px;
  border-radius: 4px;
  color: #52525b;
  background: #fafafa;
  font: 10px/1.2 ui-monospace,SFMono-Regular,Consolas,monospace;
}
.material-catalog-results .material-list { border-radius: 0 0 8px 8px; }
.material-grid { display: grid !important; grid-template-columns: minmax(0,1fr) !important; gap: 14px !important; }
.material-list {
  height: auto !important;
  max-height: none !important;
  padding: 0 !important;
  border-radius: 8px;
  background: #fff;
  overflow: visible !important;
}
.material-list-summary { margin: 0; padding: 9px 12px; border-bottom: 1px solid #e4e4e7; }
.material-list-item {
  display: grid;
  grid-template-columns: minmax(220px,2fr) auto minmax(150px,.9fr) minmax(126px,auto);
  align-items: center;
  gap: 6px 14px;
  margin: 0;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid #e4e4e7;
  border-radius: 0;
  background: #fff;
  transition: background .12s, box-shadow .12s;
}
.material-list-item:last-of-type { border-bottom: 0; }
.material-list-item:hover { border-color: #e4e4e7; background: #fafafa; }
.material-list-item.active { border-color: #e4e4e7; background: #f4f4f5; box-shadow: inset 3px 0 #18181b; }
.material-card-title { grid-column: 1; grid-row: 1; font-weight: 700; line-height: 1.32; }
.material-card-title.is-static { cursor: default; }
.material-card-title.is-static:hover { text-decoration: none; }
.material-difficulty-chip { grid-column: 2; grid-row: 1; margin: 0; white-space: nowrap; }
.material-source-row { grid-column: 3; grid-row: 1; margin: 0; }
.material-card-details { grid-column: 1 / 4; grid-row: 2; margin: 0; }
.material-card-actions { grid-column: 4; grid-row: 1 / span 2; margin: 0; justify-content: flex-end; }
.material-card-actions > span { justify-content: flex-end; }
.material-card-tags button,
.material-source,
.material-grade,
.material-audience { border-radius: 4px; color: #52525b; background: #f4f4f5; }
.material-source.is-analog { color: #52525b; background: #e4e4e7; }
.material-pagination { margin: 0; padding: 10px 12px; }
.material-workspace {
  padding: 16px;
  border-radius: 8px;
  box-shadow: none;
  scroll-margin-top: calc(var(--header-height) + 12px);
}
.material-workspace[hidden] { display: none !important; }
.material-back-to-catalog { margin-bottom: 13px; }
.material-viewer-head { margin-bottom: 11px; }
.material-viewer-head h3 { font-size: 19px; }
.material-code-editor,
.material-advanced-settings,
.material-student-assignments { border-radius: 7px; }
.material-code-editor > summary,
.material-advanced-settings > summary,
.material-student-assignments > summary { padding: 11px 13px; }
.material-fields,
.material-advanced-body,
.material-student-assignments-body { padding: 13px; }
.material-editor-topics { display: flex; min-width: 0; align-items: center; gap: 10px; }
.material-editor-topics small { color: #71717a; }
.material-switches label,
.material-student-choice { border-radius: 6px; }

/* Authentication, student and reporting pages use the same quiet surfaces. */
.login-page { background: #fafafa; }
body .student-login {
  padding: 26px !important;
  border-color: #d4d4d8 !important;
  border-radius: 9px !important;
  background: #fff !important;
  box-shadow: 0 4px 18px rgba(24,24,27,.07) !important;
}
.student-login::before { width: 40px; height: 40px; border-radius: 6px; background: #18181b; }
.loading-spinner { border-top-color: #18181b; }
.student-portal > .student-title { background: rgba(250,250,250,.97); backdrop-filter: blur(8px); }
.student-portal .student-task { border-radius: 8px; }
.student-answer-card .task-card-title h3,
.task-statement,
.task-equation { color: #18181b !important; }
.empty-state,
.fatal-state { border-radius: 9px; background: #fff; }
.empty-state > span { border-radius: 6px; color: #3f3f46; background: #e4e4e7; }
.knowledge-tree { border-radius: 8px; background: #fafafa; }
.knowledge-tree-section summary,
.knowledge-tree a:hover { color: #18181b; }
.knowledge-tree li::before { color: #71717a; }
.knowledge-card { border-color: #e4e4e7; border-radius: 6px; background: #fff; }
.knowledge-card:hover { transform: none; border-color: #a1a1aa; }
.knowledge-card span { color: #52525b; }

.school-analytics-page,
.school-workspace-page { background: #fafafa; }
.school-analytics { width: min(1440px,calc(100% - 36px)); padding-top: 24px; }
.analytics-hero,
.school-profile {
  padding: 24px;
  border-color: #d4d4d8;
  border-radius: 9px;
  background: #fff;
  box-shadow: none;
}
.analytics-hero h1,
.school-profile h1 { font-size: clamp(29px,3.4vw,43px); }
.analytics-hero p,
.school-profile p { color: #52525b; font-size: 15px; }
.analytics-kpis article,
.analytics-card,
.school-kpis article,
.school-admission-card,
.school-json-archive,
.school-archive-card,
.school-auto-analytics {
  border-color: #e4e4e7;
  border-radius: 8px;
  background: #fff;
  box-shadow: none;
}
.analytics-card { padding: 20px; }
.analytics-table thead th { color: #3f3f46; background: #f4f4f5; }
.analytics-table tbody th { color: #18181b; background: #fafafa; }
.table-scroll { border-color: #e4e4e7; border-radius: 7px; }
.difficulty-pill,
.school-difficulty-pill,
.universal-difficulty-pill { color: #3f3f46; background: #e4e4e7; }
.target-school-profiles { border-color: #e4e4e7; }
.target-school-profiles span { border-color: #d4d4d8; border-radius: 5px; color: #52525b; }
.target-school-profiles input:checked + span { color: #fff; border-color: #18181b; background: #18181b; }
.guide-list article { border-radius: 7px; }
.guide-facts > span:not(.trend) { color: #52525b; background: #f4f4f5; }
.analytics-source a { color: #3f3f46; }

.school-workspace { grid-template-columns: 280px minmax(0,1fr); }
.school-directory {
  position: sticky;
  top: var(--header-height);
  height: calc(100vh - var(--header-height));
  padding: 22px 14px;
  border-color: #e4e4e7;
  background: #fafafa;
  overflow: auto;
}
.school-directory-head h1 { font-size: 23px; }
.school-list { gap: 3px; }
.school-list-item { padding: 8px; border-radius: 6px; color: #3f3f46; }
.school-list-item:hover { border-color: #e4e4e7; background: #f4f4f5; }
.school-list-item.active { color: #18181b; border-color: #d4d4d8; background: #e4e4e7; }
.school-monogram { width: 36px; height: 36px; border-radius: 6px; color: #3f3f46; background: #e4e4e7; font-size: 15px; }
.school-dossier { width: min(1540px,calc(100% - 32px)); min-width: 0; padding-top: 24px; }
.school-profile-badges span { border-color: #d4d4d8; border-radius: 5px; color: #52525b; }
.school-json-archive { background: #f4f4f5; }
.school-json-downloads a { border-color: #d4d4d8; border-radius: 6px; color: #3f3f46; }
.school-record-filter-panel,
.school-record-group { border-color: #e4e4e7; border-radius: 7px; background: #fafafa; }
.school-record-filter-panel > summary b { background: #18181b; }
.school-record-group > summary span { color: #52525b; background: #e4e4e7; }
.school-record { border-color: #e4e4e7; border-radius: 7px; background: #fff; }
.school-record.pinned { border-color: #a1a1aa; box-shadow: inset 0 2px #52525b; }
.record-meta span,
.record-meta a,
.record-meta-action { color: #52525b; background: #f4f4f5; }
.record-meta-action:hover { color: #18181b; background: #e4e4e7; }
.school-auto-analytics > summary > b { color: #3f3f46; background: #e4e4e7; }
.topic-bars i { background: linear-gradient(90deg,#52525b var(--bar),#e4e4e7 var(--bar)); }
.school-export-row a { color: #3f3f46; background: #f4f4f5; }
.school-dialog { border-radius: 9px; box-shadow: 0 20px 60px rgba(24,24,27,.24); }
.school-dialog::backdrop { background: rgba(24,24,27,.42); }
.teacher-row { border-radius: 7px; }
.stat { border-radius: 7px !important; box-shadow: none; }
.stats-table { border-radius: 7px; }
.content-history-dialog {
  border-radius: 9px;
  color: #18181b;
  box-shadow: 0 20px 60px rgba(24,24,27,.24);
}
.content-history-dialog::backdrop { background: rgba(24,24,27,.42); }
.content-history-head { border-color: #e4e4e7; }
.content-history-current { color: #52525b; }
.content-history-item { border-color: #e4e4e7; border-radius: 7px; background: #fafafa; }
.content-history-item > summary::before { color: #52525b; }
.content-history-item > summary b { color: #3f3f46; background: #e4e4e7; }
.content-history-item-body { border-color: #e4e4e7; }
.content-history-snapshot { color: #52525b; }
.content-history-snapshot-facts,
.content-history-raw { border-color: #e4e4e7; border-radius: 6px; }
.content-history-snapshot-facts dt { color: #52525b; background: #f4f4f5; }
.content-history-snapshot-facts dd,
.content-history-raw pre { color: #27272a; }
.content-history-raw > summary { color: #52525b; }
.content-history-empty { border-color: #d4d4d8; border-radius: 7px; color: #71717a; background: #fafafa; }

@media (max-width: 1100px) {
  .app-shell { grid-template-columns: 290px minmax(0,1fr); }
  .content { padding-right: 22px; padding-left: 22px; }
  .material-list-item { grid-template-columns: minmax(200px,1.7fr) auto minmax(130px,.8fr) minmax(118px,auto); column-gap: 10px; }
}

@media (max-width: 760px) {
  :root { --header-height: 100px; --quick-bar-height: 82px; --curriculum-bar-height: 46px; }
  .app-header { min-height: var(--header-height); padding: 7px 12px 0; }
  .brand { height: 43px; }
  .brand-mark { width: 30px; height: 30px; border-radius: 5px; }
  .main-nav { height: 50px; margin: 0 -12px; padding: 0 7px; }
  .settings-nav { top: 10px; right: 108px; }
  .header-account { top: 11px; right: 12px; }
  .quick-actions { min-height: var(--quick-bar-height); padding: 7px 12px; gap: 5px; }
  .quick-action { min-height: 31px; border-radius: 5px; }
  .curriculum-grade-bar { min-height: var(--curriculum-bar-height); padding: 6px 12px; }
  .filter-sidebar { max-height: none; padding: 15px 12px 24px; overflow: visible; }
  .filter-sidebar-toggle { display: inline-flex; align-items: center; justify-content: center; }
  body.teacher-shell:not(.materials-mode) .filter-sidebar {
    position: fixed;
    z-index: 70;
    inset: 0 auto 0 0;
    width: min(390px,calc(100vw - 44px));
    height: 100dvh;
    max-height: none;
    padding: 18px 14px 36px;
    border-right: 1px solid #d4d4d8;
    background: #fff;
    box-shadow: 14px 0 36px rgba(24,24,27,.14);
    overflow-y: auto;
    visibility: hidden;
    transform: translateX(-104%);
    transition: transform .18s ease, visibility .18s;
  }
  body.teacher-shell.filter-drawer-open:not(.materials-mode) .filter-sidebar { visibility: visible; transform: translateX(0); }
  .filter-drawer-backdrop {
    position: fixed;
    z-index: 65;
    inset: 0;
    border: 0;
    background: rgba(24,24,27,.38);
  }
  body.filter-drawer-open .filter-drawer-backdrop { display: block; }
  body.filter-drawer-open { overflow: hidden; }
  .content { padding: 18px 12px 58px; }
  .toolbar { margin-bottom: 13px; }
  .editor-card { padding: 14px; }
  .material-page-head { gap: 12px; }
  .material-catalog-toolbar { align-items: flex-start; flex-direction: column; }
  .material-catalog-filters { grid-template-columns: repeat(2,minmax(0,1fr)); padding: 9px; }
  .material-catalog-results-head small { display: none; }
  .material-list-item {
    grid-template-columns: minmax(0,1fr) auto;
    gap: 6px 10px;
    padding: 10px;
  }
  .material-card-title { grid-column: 1; grid-row: 1; }
  .material-difficulty-chip { grid-column: 2; grid-row: 1; }
  .material-source-row { grid-column: 1 / -1; grid-row: 2; }
  .material-card-details { grid-column: 1 / -1; grid-row: 3; }
  .material-card-actions { grid-column: 1 / -1; grid-row: 4; justify-content: flex-start; }
  .material-card-actions > span { justify-content: flex-start; }
  .material-workspace { padding: 12px; }
  .analytics-hero,
  .school-profile,
  .analytics-card { padding: 17px; }
  .school-workspace { display: block; }
  .school-directory { position: static; width: 100%; height: auto; padding: 14px 11px; }
}

@media (max-width: 430px) {
  .content { padding-right: 10px; padding-left: 10px; }
  .primary,
  .secondary { padding-right: 10px; padding-left: 10px; }
  .material-head-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); width: 100%; }
  .material-head-actions > * { width: 100%; }
  .material-catalog-filters { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .material-catalog-search { grid-column: 1 / -1; }
  #resetMaterialFilters { grid-column: 1 / -1; }
  .material-editor-topics { align-items: flex-start; flex-direction: column; }
  .material-viewer-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
  .material-viewer-actions > * { width: 100%; }
  .material-code-editor > summary,
  .material-advanced-settings > summary,
  .material-student-assignments > summary { padding: 10px; }
  .material-fields,
  .material-advanced-body,
  .material-student-assignments-body { padding: 10px; }
  .school-dossier,
  .school-analytics { width: calc(100% - 16px); }
}

/* Soft blue and warm workspace palette, adapted from the reference cabinet. */
html { background: #f8fbff; }
body {
  color: var(--ink);
  background:
    radial-gradient(circle at 7% -8%, rgba(82,183,232,.11), transparent 30rem),
    radial-gradient(circle at 98% 1%, rgba(245,155,56,.09), transparent 28rem),
    linear-gradient(135deg,#f8fbff 0%,#fff 54%,#fff7e9 100%);
  background-attachment: fixed;
}
a { color: var(--blue); }
a:hover { color: var(--blue-dark); }
::selection { color: var(--ink); background: #dbeafe; }
button:focus-visible,
a:focus-visible,
summary:focus-visible { outline-color: rgba(23,78,182,.32); }

.app-header {
  border-color: var(--line);
  background: rgba(255,255,255,.96);
  box-shadow: 0 1px 0 rgba(23,78,182,.04);
}
.brand-mark {
  background: linear-gradient(145deg,var(--blue),var(--blue-dark));
  box-shadow: 0 5px 14px rgba(23,78,182,.17);
}
.brand-copy strong { color: var(--ink); }
.brand-copy small,
.tab { color: var(--muted); }
.tab:hover { color: var(--ink); background: var(--blue-soft); }
.tab.active { color: var(--blue-dark); }
.tab.active::after { background: var(--blue); }
.settings-nav { color: var(--muted); border-color: var(--line-strong); }
.settings-nav:hover,
.settings-nav.active { color: var(--blue-dark); border-color: #9dbbe4; background: var(--blue-soft); }
.account-avatar { color: var(--blue-dark); background: var(--blue-soft); }
.account-name { color: var(--ink-soft); }
.account-logout { border-color: var(--line-strong); }

.quick-actions {
  border-color: var(--line);
  background: rgba(255,251,245,.95);
}
.quick-actions-label { color: var(--muted); }
.quick-action,
.quick-actions a.quick-action { color: var(--ink-soft); border-color: var(--line-strong); background: #fff; }
.quick-action:hover { color: var(--blue-dark); border-color: #a9c4e8; background: var(--blue-soft); }
.quick-action.active { color: #fff; border-color: var(--blue); background: var(--blue); }
.quick-action-icon { color: var(--blue-dark); background: var(--blue-soft); }
.quick-action.active .quick-action-icon { color: inherit; background: transparent; }
.curriculum-grade-bar { border-color: var(--line); background: rgba(255,255,255,.96); }
.curriculum-grade-switch { background: var(--blue-soft); }
.curriculum-grade-switch button { color: var(--muted); }
.curriculum-grade-switch button:hover { color: var(--blue-dark); background: #dbeafe; }
.curriculum-grade-switch button.active { color: #fff; background: var(--blue); }

.filter-sidebar {
  border-color: var(--line);
  background: rgba(255,251,245,.9);
  scrollbar-color: var(--line-strong) transparent;
}
.eyebrow { color: var(--blue); }
.icon { color: var(--blue); border-color: var(--line-strong); }
.icon:hover { color: var(--blue-dark); border-color: #a9c4e8; background: var(--blue-soft); }
.filter-help { color: var(--muted); }
.school-quick-filter,
.school-specific-profiles { border-color: var(--line); background: rgba(255,255,255,.92); }
.school-quick-head small,
.school-specific-profiles small { color: var(--muted); }
.school-quick-head > button,
.school-quick-list button,
.school-profile-options button { color: var(--ink-soft); border-color: var(--line-strong); background: #fff; }
.school-quick-list button:hover,
.school-profile-options button:hover { color: var(--blue-dark); border-color: #a9c4e8; background: var(--blue-soft); }
.school-quick-list b { color: var(--blue-dark); background: var(--blue-soft); }
.school-profile-options button.active { color: #fff; border-color: var(--blue); background: var(--blue); }
.tag-match-control,
.builder-mode-switch,
.section-tabs { background: var(--blue-soft); }
.tag-match-control input:checked + span,
.builder-mode-switch button.active,
.section-tab.active { color: var(--blue-dark); background: #fff; box-shadow: 0 1px 2px rgba(23,78,182,.07); }
.super-entity-heading { color: var(--blue-dark); border-left-color: var(--blue); background: var(--blue-soft); }
.super-entity-heading:hover { color: var(--blue-dark); background: #dbeafe; }
.entity-head:hover,
.tag:hover { background: var(--warm-soft); }
.tag.selected,
.entity[data-role="direction"] .tag.selected { color: var(--blue-dark); border-color: #9dbbe4; background: var(--blue-soft); }
.tag-count,
.pill { color: var(--blue-dark); background: #dbeafe; }

.toolbar,
.surface,
.editor-card,
.task-card,
.student-task,
.review-queue-section,
.review-batch-card,
.inbox-card,
.knowledge-group { border-color: var(--line); background-color: #fff; }
.page-heading p { color: var(--muted); }
input:not([type="checkbox"]):not([type="radio"]),
textarea,
select { color: var(--ink); border-color: var(--line-strong); background: #fff; }
input:not([type="checkbox"]):not([type="radio"]):hover,
textarea:hover,
select:hover { border-color: #9dbbe4; }
input:not([type="checkbox"]):not([type="radio"]):focus,
textarea:focus,
select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(23,78,182,.11); }
input:not([type="checkbox"]):not([type="radio"]):disabled,
textarea:disabled,
select:disabled { background: #f3f7fb; }
.primary { color: #fff; border-color: var(--blue); background: var(--blue); }
.primary:hover { color: #fff; border-color: var(--blue-dark); background: var(--blue-dark); }
.secondary { color: var(--ink-soft); border-color: var(--line-strong); background: #fff; }
.secondary:hover { color: var(--blue-dark); border-color: #9dbbe4; background: var(--blue-soft); }
.secondary.danger { color: #a33e2e; border-color: #ca7f75; background: #fff9f7; }
.secondary.danger:hover { color: #872f25; border-color: #b85f54; background: #fff0ed; }
.add-button { color: var(--blue); border-color: #afc8e9; }
.upload-field,
.difficulty,
.universal-difficulty-field,
.form-row,
.answer-editor,
.assign-top,
.import-upload { background: #fbfdff; }
.upload-field:hover,
.import-upload:hover { border-color: var(--blue); background: var(--blue-soft); }
.upload-icon { color: var(--blue-dark); background: var(--blue-soft); }
.universal-difficulty-field { border-color: var(--line); background: var(--blue-soft); }
.difficulty button:hover { color: var(--blue-dark); border-color: var(--blue); }
.difficulty button.active { color: #fff; border-color: var(--blue); background: var(--blue); }
.sticky-actions { border-color: var(--line-strong); box-shadow: 0 4px 14px rgba(13,52,125,.08); }
.task-card:hover { border-color: #a9c4e8; }
.task-solution-peek > summary { color: var(--blue-dark); }
.task-solution-peek > summary::before { color: #fff; background: var(--blue); }
body .homework-box { border-color: #bfd3ed !important; background: #f8fbff !important; }
body .battle-test-cart { border-color: #ead9bc !important; background: var(--warm-soft) !important; }
body .homework-count { background: var(--blue) !important; }
body .homework-item { border-color: var(--line) !important; }
body .task-card > .add-homework { border-color: var(--blue) !important; background: var(--blue) !important; }
body .add-homework:hover { background: var(--blue-dark) !important; }

body.materials-mode .filter-sidebar,
body.teacher-shell:not(.materials-mode) .filter-sidebar {
  border-color: var(--line-strong);
  background: #fff;
  box-shadow: 14px 0 36px rgba(13,52,125,.13);
}
.material-filter-backdrop,
.filter-drawer-backdrop { background: rgba(13,35,70,.34); }
.material-editor {
  --material-line: #dbe7ff;
  --material-line-strong: #c7d6e6;
  --material-muted: #64748b;
  --material-soft: #eff6ff;
}
.material-editor .primary { border-color: var(--blue); background: var(--blue); }
.material-editor .primary:hover { border-color: var(--blue-dark); background: var(--blue-dark); }
.material-filter-summary,
.material-catalog-results,
.material-catalog-filters label,
.material-editor-topics small { color: var(--muted); }
.material-catalog-filters {
  border: 1px solid var(--line);
  background: linear-gradient(110deg,rgba(239,246,255,.96),rgba(255,251,245,.96));
}
.material-topic-trigger span { color: var(--blue-dark); background: #dbeafe; }
.material-filter-summary button { color: var(--ink-soft); border-color: var(--line-strong); }
.material-filter-summary button:hover { color: var(--blue-dark); border-color: #9dbbe4; background: var(--blue-soft); }
.material-catalog-results-head,
.material-list,
.material-list-item,
.material-workspace { border-color: var(--line); background: #fff; }
.material-catalog-results-head small { color: var(--muted); }
.material-catalog-results-head kbd { color: var(--muted); border-color: var(--line-strong); background: var(--warm-soft); }
.material-list-summary,
.material-list-item { border-color: var(--line); }
.material-list-item:hover { border-color: var(--line); background: var(--warm-soft); }
.material-list-item.active { border-color: var(--line); background: var(--blue-soft); box-shadow: inset 3px 0 var(--blue); }
.material-card-tags button,
.material-source,
.material-grade,
.material-audience { color: var(--blue-dark); background: var(--blue-soft); }
.material-source.is-analog { color: #87561d; background: #fff1d6; }
.material-card-actions a,
.material-card-actions button { color: var(--blue); }

.login-page,
.school-analytics-page,
.school-workspace-page {
  background:
    radial-gradient(circle at 8% 0,rgba(82,183,232,.11),transparent 28rem),
    linear-gradient(135deg,#f8fbff 0%,#fff 57%,#fff7e9 100%);
}
#studentApp.login-page {
  background:
    radial-gradient(circle at 8% 0,rgba(82,183,232,.11),transparent 28rem),
    linear-gradient(135deg,#f8fbff 0%,#fff 57%,#fff7e9 100%);
}
body .student-login { border-color: var(--line-strong) !important; box-shadow: 0 8px 28px rgba(13,52,125,.09) !important; }
.student-login::before { background: linear-gradient(145deg,var(--blue),var(--blue-dark)); }
.loading-spinner { border-top-color: var(--blue); }
.student-portal > .student-title { background: rgba(248,251,255,.96); }
.student-answer-card .task-card-title h3,
.task-statement,
.task-equation { color: var(--ink) !important; }
.empty-state > span { color: var(--blue-dark); background: var(--blue-soft); }
.knowledge-tree { background: var(--warm-soft); }
.knowledge-tree-section summary,
.knowledge-tree a:hover { color: var(--blue-dark); }
.knowledge-tree li::before { color: var(--blue); }
.knowledge-card { border-color: var(--line); }
.knowledge-card:hover { border-color: #9dbbe4; }
.knowledge-card span { color: var(--blue); }

.analytics-hero,
.school-profile { border-color: var(--line-strong); box-shadow: 0 7px 24px rgba(13,52,125,.06); }
.analytics-hero p,
.school-profile p { color: var(--ink-soft); }
.analytics-kpis article,
.analytics-card,
.school-kpis article,
.school-admission-card,
.school-json-archive,
.school-archive-card,
.school-auto-analytics { border-color: var(--line); }
.analytics-table thead th { color: var(--ink-soft); background: var(--blue-soft); }
.analytics-table tbody th { color: var(--ink); background: var(--warm-soft); }
.table-scroll,
.target-school-profiles { border-color: var(--line); }
.difficulty-pill { color: var(--blue-dark); background: var(--blue-soft); }
.school-difficulty-pill { color: #17633c; background: #e5f4ea; }
.universal-difficulty-pill { color: #57418d; background: #eee8ff; }

.school-admission-notices { display: grid; gap: 4px; margin: 0 0 14px; color: #5f6671; font-size: 12px; }
.school-admission-notices span::before { content: "•"; margin-right: 7px; color: var(--blue-dark); }
.admission-overview-source-status { display: inline-flex; margin-bottom: 8px; padding: 4px 7px; border-radius: 5px; color: #315747; background: #e9f2ed; font-size: 10px; font-weight: 850; }
.admission-overview-source-status.status-current_secondary_primary_unavailable { color: #7c4a11; background: #fff1d8; }
.admission-overview-source-status.status-current_primary_with_historical_stage_detail { color: #3b5680; background: #eaf1fb; }
.admission-overview-links { display: grid; gap: 5px; }
.admission-overview-links a { color: var(--blue-dark); font-size: 10px; font-weight: 700; overflow-wrap: anywhere; }
.admission-evidence-open {
  display: block;
  min-height: 36px;
  margin-top: 11px;
  padding: 7px 11px;
  border: 1px solid #b8cdec;
  border-radius: 7px;
  color: var(--blue-dark);
  background: var(--blue-soft);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}
.admission-evidence-open:hover { border-color: #86aadf; background: #dceaff; }
.admission-evidence-dialog {
  width: 50vw;
  min-width: 560px;
  max-width: 760px;
  height: 100vh;
  height: 100dvh;
  max-height: none;
  margin: 0 0 0 auto;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 18px 0 0 18px;
  background: #fff;
  box-shadow: -24px 0 64px rgba(13,52,125,.24);
}
.admission-evidence-dialog[open] { animation: admission-evidence-enter .18s ease-out both; }
.admission-evidence-dialog::backdrop { background: rgba(13,35,70,.38); backdrop-filter: blur(2px); }
.admission-evidence-dialog-shell { height: 100%; padding: 24px; overflow-y: auto; }
.admission-evidence-dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 28px; }
.admission-evidence-dialog-head h2 { margin: 5px 0 0; font-size: 24px; }
.admission-evidence-close {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--ink);
  background: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}
.admission-evidence-dialog-label { margin: 0 0 9px; color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.admission-evidence-dialog .admission-overview-source-status { margin-bottom: 22px; }
.admission-evidence-dialog .admission-overview-links { gap: 10px; }
.admission-evidence-dialog .admission-overview-links a { padding: 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--warm-soft); font-size: 13px; }
@keyframes admission-evidence-enter {
  from { opacity: .75; transform: translateX(100%); }
  to { opacity: 1; transform: translateX(0); }
}
@media(max-width:720px) {
  .admission-evidence-dialog { width: calc(100% - 12px); min-width: 0; border-radius: 14px 0 0 14px; }
  .admission-evidence-dialog-shell { padding: 18px 16px; }
}
@media(prefers-reduced-motion:reduce) {
  .admission-evidence-dialog[open] { animation: none; }
}
.target-school-profiles span { color: var(--ink-soft); border-color: var(--line-strong); }
.target-school-profiles input:checked + span { color: #fff; border-color: var(--blue); background: var(--blue); }
.guide-facts > span:not(.trend) { color: var(--ink-soft); background: var(--warm-soft); }
.analytics-source a { color: var(--blue); }
.school-directory { border-color: var(--line); background: rgba(255,251,245,.92); }
.school-list-item { color: var(--ink-soft); }
.school-list-item:hover { border-color: var(--line); background: var(--blue-soft); }
.school-list-item.active { color: var(--blue-dark); border-color: #b8cdec; background: #e7f1ff; }
.school-monogram { color: var(--blue-dark); background: #dbeafe; }
.school-profile-badges span,
.school-json-downloads a { color: var(--ink-soft); border-color: var(--line-strong); }
.school-json-archive { background: var(--warm-soft); }
.school-record-filter-panel,
.school-record-group { border-color: var(--line); background: #fbfdff; }
.school-record-filter-panel > summary b { background: var(--blue); }
.school-record-group > summary span { color: var(--blue-dark); background: var(--blue-soft); }
.school-record { border-color: var(--line); }
.school-record.pinned { border-color: #9dbbe4; box-shadow: inset 0 2px var(--blue); }
.record-meta span,
.record-meta a,
.record-meta-action { color: var(--ink-soft); background: var(--blue-soft); }
.record-meta-action:hover { color: var(--blue-dark); background: #dbeafe; }
.school-auto-analytics > summary > b { color: var(--blue-dark); background: var(--blue-soft); }
.topic-bars i { background: linear-gradient(90deg,var(--blue) var(--bar),#dbe7ff var(--bar)); }
.school-export-row a { color: var(--blue-dark); background: var(--blue-soft); }
.school-dialog,
.content-history-dialog { color: var(--ink); box-shadow: 0 20px 60px rgba(13,35,70,.22); }
.school-dialog::backdrop,
.content-history-dialog::backdrop { background: rgba(13,35,70,.38); }
.content-history-head,
.content-history-item,
.content-history-item-body,
.content-history-snapshot-facts,
.content-history-raw { border-color: var(--line); }
.content-history-item { background: #fbfdff; }
.content-history-current,
.content-history-item > summary::before,
.content-history-snapshot,
.content-history-raw > summary { color: var(--muted); }
.content-history-item > summary b,
.content-history-snapshot-facts dt { color: var(--blue-dark); background: var(--blue-soft); }
.content-history-snapshot-facts dd,
.content-history-raw pre { color: var(--ink-soft); }
.content-history-empty { color: var(--muted); border-color: var(--line-strong); background: var(--warm-soft); }

/* Interactive boundaries stay visible on a shared-screen lesson. */
button:focus-visible,
a:focus-visible,
summary:focus-visible { outline-color: rgba(23,78,182,.6); }
input:not([type="checkbox"]):not([type="radio"]),
textarea,
select,
.secondary { border-color: #7d93aa; }
body.teacher-shell:not(.materials-mode) .filter-sidebar { background: rgba(255,251,245,.9); box-shadow: none; }
@media (max-width: 760px) {
  body.teacher-shell:not(.materials-mode) .filter-sidebar {
    background: #fff;
    box-shadow: 14px 0 36px rgba(13,52,125,.13);
  }
}

/* School catalog: the primary path is school → grade → downloadable work. */
.school-catalog-layout,
.school-detail-layout {
  min-width: 0;
  padding: 28px clamp(12px,2.4vw,36px) 72px;
}
.school-catalog,
.school-dossier-page {
  width: min(1540px,100%);
  min-width: 0;
  margin: 0 auto;
}
.school-dossier.school-dossier-page { padding: 0; }
.school-catalog-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
}
.school-catalog-head h1 { margin: 5px 0 6px; font-size: clamp(34px,4.5vw,54px); letter-spacing: -.045em; }
.school-catalog-head p { max-width: 720px; margin: 0; color: var(--ink-soft); font-size: 16px; line-height: 1.55; }
.school-catalog-head > button { flex: 0 0 auto; min-height: 44px; }
.school-catalog-tools {
  display: grid;
  grid-template-columns: minmax(260px,1fr) auto auto;
  align-items: end;
  gap: 12px;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,.9);
  box-shadow: var(--shadow-sm);
}
.school-catalog-search { display: grid; gap: 6px; color: var(--ink-soft); font-size: 12px; font-weight: 800; }
.school-catalog-search input[type="search"] { width: 100%; min-height: 44px; padding: 9px 12px; border: 1px solid var(--line-strong); border-radius: 8px; color: var(--ink); background: #fff; font: inherit; }
.school-catalog-scope { display: flex; flex-wrap: wrap; gap: 6px; }
.school-catalog-scope button {
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--ink-soft);
  background: #fff;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
.school-catalog-scope button.active { color: #fff; border-color: var(--blue); background: var(--blue); }
.school-catalog-count { min-width: 118px; padding-bottom: 13px; color: var(--muted); font-size: 12px; text-align: right; }
.school-catalog-note { margin-bottom: 18px; border: 1px solid var(--line); border-radius: 10px; background: var(--warm-soft); }
.school-catalog-note > summary { min-height: 44px; padding: 12px 14px; color: var(--ink-soft); cursor: pointer; font-weight: 800; }
.school-catalog-note[open] > summary { border-bottom: 1px solid var(--line); }
.school-catalog-note .school-admission-notices { padding: 13px 14px 4px; }
.school-catalog-note > p { margin: 5px 14px 14px; color: var(--muted); font-size: 12px; }
.school-card-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(285px,1fr)); gap: 14px; }
.school-catalog-card {
  min-width: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 5px 18px rgba(13,52,125,.045);
  transition: border-color .16s ease,box-shadow .16s ease,transform .16s ease;
}
.school-catalog-card[hidden] { display: none !important; }
.school-catalog-card:hover { border-color: #9dbbe4; box-shadow: 0 9px 26px rgba(13,52,125,.09); transform: translateY(-2px); }
.school-card-link { display: flex; flex-direction: column; min-width: 0; height: 100%; padding: 18px; color: inherit; text-decoration: none; }
.school-card-link:focus-visible { border-radius: 11px; outline: 3px solid rgba(23,78,182,.55); outline-offset: 3px; }
.school-card-title-row { display: grid; grid-template-columns: 48px minmax(0,1fr); align-items: start; gap: 12px; }
.school-card-title-row .school-monogram { width: 48px; height: 48px; border-radius: 10px; font-size: 19px; }
.school-card-title-row h2 { margin: 3px 0 0; font-size: 20px; line-height: 1.2; overflow-wrap: anywhere; }
.school-card-link:hover .school-card-title-row h2 { color: var(--blue-dark); text-decoration: underline; text-underline-offset: 3px; }
.school-card-city { color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.school-card-full-name { margin: 5px 0 0; color: var(--muted); font-size: 11px; line-height: 1.4; }
.school-card-grades { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 15px; }
.school-card-grades span { padding: 5px 8px; border-radius: 999px; color: var(--blue-dark); background: var(--blue-soft); font-size: 10px; font-weight: 850; }
.school-card-description {
  display: -webkit-box;
  margin: 14px 0 0;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}
.school-card-stats { display: flex; flex-wrap: wrap; gap: 7px; margin: 16px 0 0; }
.school-card-stats div { min-width: 76px; padding: 8px 9px; border-radius: 8px; background: #f5f8fc; }
.school-card-stats div.attention { background: #fff4df; }
.school-card-stats dt { color: var(--muted); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.school-card-stats dd { margin: 2px 0 0; color: var(--ink); font-size: 18px; font-weight: 900; }
.school-card-review { width: fit-content; margin-top: 12px; padding: 5px 8px; border-radius: 999px; color: #75500f; background: #fff2d5; font-size: 10px; font-weight: 850; }
.school-card-review.status-closed { color: #17633c; background: #e5f4ea; }
.school-card-review.status-out_of_scope { color: var(--blue-dark); background: var(--blue-soft); }
.school-card-downloads { width: fit-content; margin-top: 8px; padding: 5px 8px; border-radius: 999px; font-size: 10px; font-weight: 850; }
.school-card-downloads.available { color: #17633c; background: #e5f4ea; }
.school-card-downloads.unavailable { color: #71717a; background: #f4f4f5; }
.school-card-open {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  margin-top: auto;
  padding: 16px 1px 0;
  color: var(--blue-dark);
  font-size: 13px;
  font-weight: 850;
  text-decoration: none;
}
.school-card-open span { font-size: 18px; }
.school-catalog-no-results { padding: 42px 18px; border: 1px dashed var(--line-strong); border-radius: 10px; color: var(--muted); background: #fff; text-align: center; }

.school-breadcrumb { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; color: var(--muted); font-size: 13px; }
.school-breadcrumb a { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; color: var(--blue-dark); font-weight: 850; text-decoration: none; }
.school-breadcrumb a:hover { text-decoration: underline; text-underline-offset: 3px; }
.school-breadcrumb > span::before { content: "/"; margin-right: 10px; color: var(--line-strong); }
.school-breadcrumb > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.school-materials-hub,
.school-current-intake {
  margin: 16px 0;
  padding: 23px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}
.school-materials-head { align-items: center; }
.school-materials-head p,
.school-current-intake-head p { max-width: 800px; margin: 5px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.school-materials-head-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.school-materials-head-actions a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; text-decoration: none; }
.school-grade-tabs { display: grid; grid-template-columns: repeat(auto-fit,minmax(170px,1fr)); gap: 8px; margin: 4px 0 14px; }
.school-grade-tabs a {
  display: grid;
  gap: 3px;
  min-width: 0;
  min-height: 62px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  color: var(--ink-soft);
  background: #fff;
  text-decoration: none;
}
.school-grade-tabs a:hover { border-color: #9dbbe4; background: var(--blue-soft); }
.school-grade-tabs a[aria-current="page"] { color: #fff; border-color: var(--blue); background: var(--blue); box-shadow: 0 5px 16px rgba(23,78,182,.18); }
.school-grade-tabs strong { font-size: 14px; }
.school-grade-tabs small { color: inherit; opacity: .82; font-size: 10px; }
.school-grade-panel { padding: 18px; border: 1px solid #b8cdec; border-radius: 10px; background: #f7faff; }
.school-grade-panel:focus-visible { outline: 3px solid rgba(23,78,182,.32); outline-offset: 3px; }
.school-grade-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 14px; }
.school-grade-panel-head span { color: var(--blue-dark); font-size: 11px; font-weight: 850; text-transform: uppercase; letter-spacing: .04em; }
.school-grade-panel-head h3 { margin: 3px 0 0; color: var(--ink); font-size: 19px; }
.school-grade-panel-head > a { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; min-height: 44px; text-decoration: none; }
.school-corpus-trust-note { display: grid; gap: 4px; margin: 0 0 14px; padding: 12px 14px; border: 1px solid #d7ad4f; border-radius: 9px; color: #553b0a; background: #fff8df; line-height: 1.45; overflow-wrap: anywhere; }
.school-corpus-trust-note strong { font-size: 14px; }
.school-corpus-trust-note span { font-size: 12px; }
.school-corpus-groups { display: grid; gap: 14px; }
.school-corpus-group { min-width: 0; padding: 14px; border: 1px solid #ced9e8; border-radius: 10px; background: #eef4fb; }
.school-corpus-group-head { display: grid; grid-template-columns: minmax(0,1fr) minmax(220px,.75fr); gap: 18px; align-items: end; margin-bottom: 11px; }
.school-corpus-group-head span { color: var(--blue-dark); font-size: 10px; font-weight: 850; letter-spacing: .04em; text-transform: uppercase; }
.school-corpus-group-head h3 { margin: 3px 0 0; color: var(--ink); font-size: 18px; }
.school-corpus-group-head p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.school-corpus-works { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.school-corpus-work { display: flex; flex-direction: column; min-width: 0; padding: 15px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.school-corpus-work-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 10px; }
.school-corpus-work-head b { padding: 4px 7px; border-radius: 999px; color: #17633c; background: #e5f4ea; font-size: 9px; }
.school-corpus-work h3 { margin: 11px 0 15px; color: var(--ink); font-size: 16px; line-height: 1.35; overflow-wrap: anywhere; }
.school-corpus-work-meta { display: flex; flex-wrap: wrap; gap: 6px; margin: -7px 0 14px; color: var(--muted); font-size: 10px; }
.school-corpus-work-meta span,
.school-corpus-work-meta strong { padding: 5px 7px; border-radius: 6px; background: #f0f3f6; overflow-wrap: anywhere; }
.school-corpus-work-meta strong { color: #5c4210; background: #fff0c7; }
.school-corpus-work-meta .is-practice { color: #733e10; background: #ffe3bf; }
.school-corpus-work-meta .is-official { color: #17633c; background: #e5f4ea; }
.school-corpus-evidence { margin-top: 14px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.school-corpus-evidence > summary { min-height: 44px; padding: 13px 14px; cursor: pointer; color: var(--blue-dark); font-weight: 850; }
.school-corpus-evidence > p { margin: 0; padding: 0 14px 10px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.school-corpus-evidence > div { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; padding: 0 14px 14px; }
.school-corpus-evidence a { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 7px; color: var(--blue-dark); background: #f7faff; line-height: 1.35; overflow-wrap: anywhere; }
.school-corpus-work-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-top: auto; }
.school-corpus-work-actions a,
.school-work-pdf-missing,
.school-download-unavailable {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 8px 11px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 850;
  text-decoration: none;
}
.school-record .record-meta-action { min-height: 36px; }
.school-work-source { color: var(--blue-dark); background: transparent; }
.school-work-pdf-missing,
.school-download-unavailable { color: #71717a; border: 1px dashed #a1a1aa; background: #f4f4f5; }
.school-materials-empty,
.school-materials-unavailable { display: grid; gap: 6px; padding: 18px; border: 1px dashed var(--line-strong); border-radius: 9px; color: var(--muted); background: var(--warm-soft); line-height: 1.5; }
.school-materials-empty strong { color: var(--ink); }
.school-materials-empty-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 7px; }
.school-materials-empty-actions a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; text-decoration: none; }
.school-legacy-archive { display: grid; grid-template-columns: minmax(240px,.7fr) minmax(0,1.3fr); align-items: center; gap: 18px; margin-top: 14px; padding: 16px; border: 1px solid var(--line); border-radius: 9px; background: var(--warm-soft); }
.school-legacy-archive h3 { margin: 4px 0 5px; font-size: 18px; }
.school-legacy-archive p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.school-legacy-downloads { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.school-legacy-downloads a { display: grid; align-content: center; gap: 2px; min-height: 44px; text-decoration: none; }
.school-legacy-downloads small { color: inherit; opacity: .76; font-size: 9px; }

.school-current-intake-head { align-items: center; }
.school-current-intake-head .admission-evidence-open { flex: 0 0 auto; margin: 0; }
.school-intake-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.school-intake-grid article { min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 9px; background: #fbfdff; }
.school-intake-grid h3 { margin: 0 0 8px; font-size: 16px; line-height: 1.35; }
.school-intake-grid article > p { margin: 0 0 13px; color: var(--ink-soft); font-size: 12px; line-height: 1.5; }
.school-intake-grid dl { display: grid; gap: 9px; margin: 0; }
.school-intake-grid dl div { display: grid; gap: 2px; padding-top: 9px; border-top: 1px dashed var(--line); }
.school-intake-grid dt { color: var(--muted); font-size: 9px; font-weight: 850; text-transform: uppercase; }
.school-intake-grid dd { margin: 0; color: var(--ink-soft); font-size: 11px; line-height: 1.5; overflow-wrap: anywhere; }
.school-other-grades { margin-top: 10px; border: 1px solid var(--line); border-radius: 9px; }
.school-other-grades > summary { min-height: 44px; padding: 12px 14px; cursor: pointer; font-weight: 850; }
.school-other-grades > div { display: grid; gap: 8px; padding: 0 14px 14px; }
.school-other-grades p { display: grid; gap: 3px; margin: 0; padding: 10px; border-radius: 7px; background: var(--warm-soft); font-size: 11px; }
.school-other-grades p span { color: var(--muted); line-height: 1.45; }

@media(max-width:900px) {
  .school-catalog-tools { grid-template-columns: minmax(0,1fr) auto; }
  .school-catalog-count { grid-column: 1/-1; min-width: 0; padding: 0; text-align: left; }
  .school-corpus-group-head { grid-template-columns: 1fr; gap: 6px; }
  .school-corpus-works,
  .school-intake-grid { grid-template-columns: 1fr; }
}
@media(max-width:760px) {
  .school-catalog-layout,
  .school-detail-layout { padding: 18px 10px 52px; }
  .school-catalog-head { align-items: flex-start; flex-direction: column; gap: 14px; }
  .school-catalog-head > button { width: 100%; }
  .school-catalog-tools { grid-template-columns: 1fr; padding: 10px; }
  .school-catalog-scope { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
  .school-catalog-scope button { width: 100%; }
  .school-card-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
  .school-card-link { padding: 14px; }
  .school-materials-hub,
  .school-current-intake { padding: 15px; }
  .school-materials-head-actions { display: grid; grid-template-columns: 1fr; width: 100%; }
  .school-materials-head-actions > * { width: 100%; }
  .school-grade-tabs { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .school-grade-panel { padding: 12px; }
  .school-corpus-group { padding: 10px; }
  .school-corpus-evidence > div { grid-template-columns: 1fr; }
  .school-grade-panel-head { align-items: flex-start; flex-direction: column; }
  .school-grade-panel-head > a,
  .school-grade-panel-head > .school-download-unavailable { width: 100%; }
  .school-current-intake-head .admission-evidence-open { width: 100%; margin: 0; }
  .school-legacy-archive { grid-template-columns: 1fr; }
  .school-legacy-downloads { justify-content: flex-start; }
}
@media(max-width:520px) {
  .school-card-grid { grid-template-columns: 1fr; }
  .school-grade-tabs { grid-template-columns: 1fr; }
  .school-corpus-work-head { align-items: flex-start; flex-direction: column; }
  .school-corpus-work-actions,
  .school-materials-empty-actions { display: grid; grid-template-columns: 1fr; }
  .school-corpus-work-actions > *,
  .school-materials-empty-actions > * { width: 100%; }
  .school-legacy-downloads { display: grid; grid-template-columns: 1fr; }
  .school-legacy-downloads > * { width: 100%; }
  .school-breadcrumb > span { display: none; }
  .school-record .record-meta-action { min-height: 44px; }
}

/* Простой недельный календарь преподавателя. */
.schedule-panel { min-width: 0; }
.schedule-title { align-items: flex-end; }
.schedule-title .eyebrow { display: block; margin-bottom: 4px; }
.schedule-title p { margin: 5px 0 0; color: var(--muted); }
.schedule-title-actions { display: flex; align-items: center; gap: 8px; }
.schedule-title-actions a { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; text-decoration: none; }
.schedule-form { display: grid; grid-template-columns: repeat(3,minmax(150px,1fr)); gap: 12px; margin: 0 0 20px; padding: 16px; }
.schedule-form label { display: grid; gap: 5px; min-width: 0; color: var(--ink-soft); font-size: 12px; font-weight: 750; }
.schedule-notes-field { grid-column: span 2; }
.schedule-form-actions { display: flex; align-items: end; gap: 8px; }
.schedule-week { display: grid; grid-template-columns: repeat(7,minmax(145px,1fr)); gap: 9px; min-width: 1060px; padding-bottom: 8px; }
.schedule-panel { overflow-x: auto; }
.schedule-day { min-width: 0; overflow: hidden; }
.schedule-day > header { position: relative; min-height: 73px; padding: 12px; border-bottom: 1px solid var(--line); background: var(--surface-soft); }
.schedule-day > header span { color: var(--muted); font-size: 9px; font-weight: 850; letter-spacing: .07em; text-transform: uppercase; }
.schedule-day > header h3 { margin: 4px 24px 0 0; font-size: 14px; line-height: 1.2; }
.schedule-day > header b { position: absolute; top: 11px; right: 10px; min-width: 22px; padding: 3px 6px; border-radius: 99px; color: var(--muted); background: #fff; font-size: 10px; text-align: center; }
.schedule-day.is-today { border-color: #8bb5ee; box-shadow: 0 0 0 2px rgba(29,95,190,.1); }
.schedule-day.is-today > header { background: var(--blue-soft); }
.schedule-day.is-today > header span,
.schedule-day.is-today > header h3 { color: var(--blue-dark); }
.schedule-day-entries { display: grid; align-content: start; gap: 8px; min-height: 170px; padding: 8px; }
.schedule-entry { display: grid; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.schedule-entry.is-unscheduled { border-style: dashed; background: var(--warm-soft); }
.schedule-entry-main { display: grid; gap: 3px; min-width: 0; }
.schedule-entry time { width: max-content; padding: 3px 6px; border-radius: 5px; color: var(--blue-dark); background: var(--blue-soft); font-size: 12px; font-weight: 850; }
.schedule-entry strong { margin-top: 2px; overflow-wrap: anywhere; font-size: 14px; }
.schedule-entry small { color: var(--muted); font-size: 10px; line-height: 1.35; overflow-wrap: anywhere; }
.schedule-entry p { margin: 3px 0 0; color: #8a5a09; font-size: 10px; line-height: 1.35; overflow-wrap: anywhere; }
.schedule-entry-actions { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.schedule-entry-actions .secondary { min-height: 29px; padding: 5px 8px; font-size: 10px; }
.schedule-delete { width: 29px; height: 29px; padding: 0; border: 0; border-radius: 6px; color: var(--red); background: transparent; cursor: pointer; font-size: 18px; }
.schedule-delete:hover { background: #fff0f0; }
.schedule-empty { margin: 0; padding: 18px 4px; color: var(--muted); font-size: 11px; text-align: center; }

@media(max-width:760px) {
  .schedule-panel { overflow: visible; }
  .schedule-title { align-items: stretch; flex-direction: column; }
  .schedule-title > button { width: 100%; }
  .schedule-title-actions { display: grid; grid-template-columns: 1fr; }
  .schedule-title-actions > * { width: 100%; }
  .schedule-form { grid-template-columns: 1fr; }
  .schedule-notes-field { grid-column: auto; }
  .schedule-form-actions { align-items: stretch; flex-direction: column; }
  .schedule-form-actions button { width: 100%; }
  .schedule-week { grid-template-columns: 1fr; min-width: 0; }
  .schedule-day-entries { min-height: 0; }
}

/* Каталог материалов: характеристики и удобная вставка содержимого. */
.material-code-editor { margin:0 0 18px; }
.material-quality-chip,.material-audience-chip { font-size:12px; padding:5px 9px; border:1px solid #d3dae5; border-radius:20px; background:#f4f6fa; color:#42516a; }
.material-quality-chip.is-ideal { color:#166534; background:#ecfdf3; border-color:#bbf7d0; }
.material-insert-actions { display:flex; flex-wrap:wrap; align-items:center; gap:10px; }
.material-insert-actions>span { color:var(--muted); font-size:12px; }
.material-import-file { cursor:pointer; display:inline-flex; padding:9px 12px; border:1px solid var(--line); border-radius:8px; }
.material-paste-dialog { width:min(640px,calc(100vw - 32px)); max-height:90dvh; overflow:auto; padding:24px; border:1px solid #d5deeb; border-radius:16px; }
.material-paste-dialog::backdrop { background:rgba(20,32,50,.45); }
.material-paste-dialog label,.material-paste-dialog textarea { display:block; width:100%; box-sizing:border-box; }
.material-paste-dialog textarea { margin:10px 0 18px; min-height:200px; padding:12px; }
.material-paste-dialog form>div { display:flex; justify-content:flex-end; gap:10px; }
.material-catalog-filters { grid-template-columns:repeat(auto-fit,minmax(160px,1fr))!important; }
@media(max-width:480px){.material-catalog-filters { grid-template-columns:minmax(0,1fr)!important; }.material-paste-dialog { padding:16px; }.material-insert-actions>* { max-width:100%; }}
.teacher-inbox{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin:12px 24px}.teacher-inbox a{display:flex;align-items:center;gap:12px;padding:12px 16px;border:1px solid #d4e2d9;border-radius:12px;background:#fff;text-decoration:none;color:#34594a}.teacher-inbox strong{font-size:26px;color:#185d44}.teacher-inbox span{font-size:13px}.teacher-inbox a:hover{background:#edf7f1}@media(max-width:700px){.teacher-inbox{grid-template-columns:repeat(2,minmax(0,1fr));margin:10px;gap:7px}.teacher-inbox a{padding:9px;gap:8px}.teacher-inbox strong{font-size:22px}}

/* Каталог для урока: школы и темы слева, ограниченная подборка справа. */
.material-catalog-top{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:end;gap:12px}
.material-catalog-top .material-catalog-search{display:grid;gap:5px;min-width:0;color:#52627a;font-size:12px;font-weight:650}
.material-catalog-top input{width:100%;min-width:0;min-height:42px}
.material-catalog-layout{display:grid;grid-template-columns:265px minmax(0,1fr);align-items:start;gap:20px}
.material-catalog-main{min-width:0;display:grid;gap:12px}
.material-facet-sidebar{position:sticky;top:calc(var(--header-height) + var(--quick-bar-height) + 12px);max-height:calc(100dvh - var(--header-height) - var(--quick-bar-height) - 24px);overflow:auto;overscroll-behavior:contain;min-width:0;padding:16px;background:#fff;border:1px solid #d7e1ed;border-radius:12px;scrollbar-width:thin}
.material-facet-sidebar-head{display:flex;align-items:center;justify-content:space-between;gap:8px;color:#162c49;font-size:15px}
.material-facet-help{margin:8px 0 14px;color:#63738a;font-size:12px;line-height:1.5}
.material-facet-group{padding:12px 0;border-top:1px solid #e4eaf2}
.material-facet-group>summary{display:flex;align-items:center;gap:8px;cursor:pointer;list-style:none;color:#203955;font-size:13px;font-weight:750}
.material-facet-group>summary::after{content:'⌄';margin-left:auto;color:#75869b}
.material-facet-group:not([open])>summary::after{content:'›'}
.material-facet-selection-count:empty{display:none}
.material-facet-selection-count{padding:2px 6px;border-radius:5px;background:#eaf2ff;color:#174caa;font-size:11px}
.material-facet-options{display:grid;gap:1px;max-height:248px;overflow:auto;margin-top:9px;padding-right:3px;scrollbar-width:thin}
.material-facet-choice{display:grid!important;grid-template-columns:18px minmax(0,1fr) auto;align-items:center;gap:8px;min-height:34px;padding:4px 3px;border-radius:5px;cursor:pointer;color:#30455f;font-size:12px;font-weight:500;line-height:1.35}
.material-facet-choice:hover{background:#f0f5fd}
.material-facet-choice:has(input:checked){background:#edf4ff;color:#164c9c}
.material-facet-choice input{width:17px;height:17px;min-height:17px;margin:0;padding:0;accent-color:#1d57bc}
.material-facet-choice span{min-width:0;overflow-wrap:anywhere}
.material-facet-count{font-variant-numeric:tabular-nums;color:#73849b;font-size:11px}
.material-facet-choice.is-unavailable{opacity:.48;cursor:default}
.material-facet-choice[hidden]{display:none!important}
.material-school-search{display:block;margin-top:10px}
.material-school-search input{width:100%;min-height:34px;padding:7px 9px;font-size:12px}
.material-school-search .visually-hidden{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.material-school-search-empty{font-size:12px;color:#73849b;margin:10px 0 0}
.material-facet-advanced{margin-top:10px;border-top:1px solid #e4eaf2;padding:12px 0}
.material-facet-advanced>summary{cursor:pointer;font-size:12px;font-weight:650;color:#53647b}
.material-facet-advanced label{display:grid;gap:4px;margin-top:12px;color:#63738a;font-size:11px}
.material-facet-advanced select{width:100%;min-width:0}
.material-facet-reset,.material-all-tags{width:100%;min-height:36px;font-size:12px}
.material-facet-reset{margin-top:10px}
.material-facet-mobile-toggle,.material-facet-mobile-close,.material-facet-apply,.material-facet-backdrop{display:none}
.material-catalog-main .material-list{max-height:none;overflow:visible}
.material-catalog-main .material-list-item{grid-template-columns:minmax(0,1fr) auto;padding:14px 16px;gap:9px}
.material-catalog-main .material-card-title{grid-column:1/-1;grid-row:1;min-width:0;overflow-wrap:anywhere;font-size:14px;scroll-margin-top:calc(var(--header-height) + var(--quick-bar-height) + 20px)}
.material-catalog-main .material-source-row{grid-column:1;grid-row:2;min-width:0;flex-wrap:wrap}
.material-catalog-main .material-difficulty-chip{grid-column:2;grid-row:2}
.material-catalog-main .material-card-details{grid-column:1;grid-row:3;min-width:0}
.material-catalog-main .material-card-actions{grid-column:2;grid-row:3;min-width:0}
.material-catalog-main .material-card-title.is-static~.material-card-actions{grid-column:1/-1;grid-row:4}
.material-catalog{scroll-margin-top:calc(var(--header-height) + var(--quick-bar-height) + 12px)}
.material-catalog-main .material-source{max-width:100%;overflow:hidden;text-overflow:ellipsis}
.material-catalog-landing{display:grid;justify-items:center;gap:14px;padding:55px 28px;text-align:center}
.material-catalog-landing-icon{display:grid;place-items:center;width:64px;height:64px;border-radius:16px;background:#edf4ff;color:#2258ac;font-size:32px}
.material-catalog-landing h3{margin:0;color:#1d3554;font-size:21px}
.material-catalog-landing p{max-width:430px;margin:0;color:#61738b;font-size:14px;line-height:1.65}
.material-catalog-landing small{color:#8391a4;font-size:12px}
.material-catalog-error{padding:25px;text-align:center}
.material-list[aria-busy=true],#materialFacetGroups[aria-busy=true]{opacity:.65}
@media(max-width:1100px){.material-catalog-layout{grid-template-columns:240px minmax(0,1fr);gap:12px}.material-facet-sidebar{padding:13px}}
@media(max-width:900px){
 .material-catalog-layout{grid-template-columns:minmax(0,1fr)}
 .material-catalog-top{grid-template-columns:minmax(0,1fr) auto;gap:9px}
 .material-catalog-top .material-catalog-search{grid-column:1/-1}
 .material-facet-mobile-toggle,.material-facet-mobile-close{display:inline-flex;align-items:center;justify-content:center}
 .material-facet-sidebar{position:fixed;inset:0 auto 0 0;z-index:1101;width:min(340px,calc(100vw - 20px));max-height:100dvh;padding:20px 16px 95px;border-radius:0;transform:translateX(-105%);visibility:hidden;transition:transform .18s ease;box-shadow:12px 0 40px #15304a26}
 .material-catalog-filters-open .material-facet-sidebar{transform:translateX(0);visibility:visible}
 .material-catalog-filters-open .material-facet-backdrop:not([hidden]){display:block;position:fixed;inset:0;z-index:1100;border:0;background:#10233d66}
 body.material-catalog-filters-open{overflow:hidden}
 .material-facet-mobile-close{width:32px;min-height:32px;padding:0;font-size:22px}
 .material-facet-apply{display:block;position:sticky;bottom:-75px;width:100%;min-height:42px;margin-top:18px;box-shadow:0 -12px 20px #ffffffee}
 .material-catalog-main .material-list-item{padding:13px 11px}
 .material-catalog-main .material-catalog-results-head{padding:12px}
 .material-catalog-landing{padding:38px 18px}
 .material-catalog-landing h3{font-size:19px}
}
@media(prefers-reduced-motion:reduce){.material-facet-sidebar{transition:none}}

.practice-introduction { box-sizing: border-box; min-width: 0; max-width: 100%; margin: 20px 0; padding: 22px; border: 1px solid #d9e3ed; border-radius: 16px; background: #f5f9fd; color: #243b53; overflow-wrap: anywhere; }
.practice-introduction h4 { margin: 0 0 18px; font-size: 18px; line-height: 1.5; }
.practice-introduction p { margin: 0 0 18px; line-height: 1.9; }
.practice-introduction p:last-child { margin-bottom: 0; }
.practice-fraction { display: inline-grid; grid-template-columns: max-content; grid-template-rows: auto auto; gap: 0; flex: 0 0 auto; min-width: 1.6em; margin: .2em .22em; text-align: center; vertical-align: middle; line-height: 1.25; font-variant-numeric: tabular-nums; font-style: normal; color: inherit; }
.practice-fraction > span { display: block; padding: .08em .22em; }
.practice-fraction > span + span { border-top: 2px solid currentColor; }
.practice-expression { display: flex; align-items: center; gap: 14px; margin: 16px 0 20px; font-size: 30px; line-height: 1.4; }
.practice-instruction { line-height: 1.65; }
.practice-feedback-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; min-width: 0; margin: 12px 0; }
.practice-feedback { flex: 1 1 150px; overflow-wrap: anywhere; line-height: 1.5; }
.practice-feedback[data-status="correct"] { color: #166534; font-weight: 700; }
.practice-feedback[data-status="incorrect"],.practice-feedback[data-status="invalid"],.practice-feedback[data-status="error"] { color: #9b2929; }
@media (max-width: 480px) { .practice-introduction { padding: 16px; } .practice-expression { font-size: 28px; } }

.practice-arithmetic { display: block; overflow-wrap: anywhere; font-size: clamp(22px, 4.5vw, 30px); }

/* Справка остаётся рядом с тренировкой; на телефоне раскрывается над примерами. */
.practice-division-layout { display:grid; grid-template-columns:minmax(0,1fr) minmax(280px,340px); gap:20px; align-items:start; padding:16px; }
.practice-division-layout > .student-task-list { grid-column:1; grid-row:1; min-width:0; padding:0; }
.division-guide { grid-column:2; grid-row:1; position:sticky; top:16px; min-width:0; border:1px solid #cbded8; border-radius:18px; background:#f2f8f5; color:#253f37; overflow-wrap:anywhere; }
.division-guide summary { cursor:pointer; padding:18px; font-weight:750; font-size:17px; }
.division-guide-content { padding:0 18px 18px; max-height:calc(100dvh - 110px); overflow:auto; }
.division-guide h4 { font-size:23px; line-height:1.25; margin:8px 0 20px; }
.division-guide h5 { font-size:16px; margin:0 0 8px; line-height:1.45; }
.division-guide p,.division-guide li { font-size:14px; line-height:1.65; margin:8px 0; }
.division-guide section { margin:0 0 22px; }
.division-guide ol { padding-left:20px; }
.division-eyebrow { font-size:10px!important; letter-spacing:.12em; font-weight:800; color:#416c5d; }
.division-formula { border-left:3px solid #467b69; padding:10px 12px; margin:12px 0; background:#fff; border-radius:0 8px 8px 0; font-size:16px; font-weight:700; line-height:1.6; white-space:pre-line; font-variant-numeric:tabular-nums; }
.division-worked { padding-top:18px; border-top:1px solid #cbded8; }
.division-warning { background:#fff2d8; border-radius:10px; padding:12px; color:#694815; }
@media(max-width:1000px) { .practice-division-layout { grid-template-columns:minmax(0,1fr) 280px; gap:12px; padding:12px; } }
@media(max-width:899px) { .practice-division-layout { display:flex; flex-direction:column; padding:8px; gap:16px; } .division-guide { position:static; width:100%; box-sizing:border-box; } .division-guide-content { max-height:none; overflow:visible; } .practice-division-layout > .student-task-list { width:100%; } }
@media print { .practice-division-layout { display:block; } .division-guide { position:static; } .division-guide-content { max-height:none; overflow:visible; } }
/* Конец справки по делению. */
