/* ===== Өнгөний палитр: гол өнгөнүүд эндээс. Хавтгай, тод, гэгээлэг. ===== */
:root {
  --primary: #4f46e5;
  --primary-dark: #312e81;
  --violet: #7c3aed;
  --pink: #db2777;
  --orange-deep: #ea580c;
  --green: #059669;
  --sky: #0284c7;
  --amber: #d97706;
  --teal-deep: #0e7490;
  --sun: #ffd60a;

  /* Үүрэг (цайвар горим) */
  --page: #f6f8ff;
  --surface: #ffffff;
  --border: #e3e8fb;
  --soft: #eef0ff;
  --on-primary: #ffffff;
  --side-bg: #5b21b6;
  --side-ink: #ffffff;
  --side-muted: #ffe58a;
  --side-line: #ffffff33;
  --side-hover: #ffffff26;

  /* Зургийн өнгө: бүх SVG эндээс авна */
  --il-olive: #23864a;
  --il-olive-dark: #14593a;
  --il-pink-light: #ffe3f2;
  --il-pink: #ff5fa8;
  --il-cream: #fff9e6;
  --il-wood: #e8590c;
  --il-gold: #ffb340;
  --il-sun: #ffd60a;
  --il-sky: #a8e4ff;
}
/* Үүрэг (харанхуй горим) */
body.dark-mode {
  --page: #11152a;
  --surface: #1a2033;
  --border: #303a5c;
  --soft: #272e52;
  --side-bg: #33156b;
}

:root {
  font-family: "Segoe UI", Arial, sans-serif;
  color: #17233c;
  background: #f5f7fc;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --ink: #17233c;
  --muted: #55607a;
  --line: #e8ecf4;
  --blue: #4268ef;
  --purple: #8062e8;
  --teal: #24a99e;
  --orange: #f3a347;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 85px; }
body { margin: 0; min-width: 320px; background: #f5f7fc; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; }
.app-shell { min-height: 100vh; }

.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 20; display: flex; flex-direction: column;
  width: 246px; overflow-y: auto; overscroll-behavior-y: contain;
  padding: 27px 18px 17px; background: #fff; border-right: 1px solid #edf0f6;
}
.brand { display: flex; gap: 7px; align-items: center; padding: 0 8px; }
.brand-link { display: flex; min-width: 0; flex: 1; gap: 12px; align-items: center; }
.brand-mark { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 14px; color: #fff; background: #5278f8; font: 800 24px "Segoe UI",Arial,sans-serif; box-shadow: 0 7px 17px #5971e63d; object-fit: cover; }
.brand-name { min-width: 0; }
.brand-name strong { display: block; color: #192541; font: 800 18px "Segoe UI",Arial,sans-serif; letter-spacing: -.7px; }
.brand-name small { display: block; margin-top: 2px; color: var(--muted); font-size: 13px; }
.brand-logo-change { display: grid; width: 27px; height: 27px; flex: 0 0 auto; place-items: center; padding: 0; color: var(--muted); border: 1px solid #e8ecf4; border-radius: 8px; background: #fff; font-size: 13px; }
.brand-logo-change:hover { color: #4268ef; border-color: #bfcafa; }
.sidebar-label { margin: 44px 10px 12px; color: var(--muted); font-size: 13px; font-weight: 700; letter-spacing: 1.3px; }
.side-nav { display: grid; gap: 7px; }
.nav-link { display: flex; align-items: center; gap: 13px; padding: 12px 13px; color: var(--muted); border-radius: 11px; font-size: 13px; font-weight: 600; transition: .2s ease; }
.nav-link:hover { color: #3b5fda; background: #f5f7ff; }
.nav-link.active { color: #4567e9; background: #eff2ff; }
.nav-icon { display: grid; width: 19px; height: 19px; flex: 0 0 19px; place-items: center; }
.nav-icon svg { width: 18px; height: 18px; stroke-width: 1.8; }
.sidebar-bottom { margin-top: auto; }
.sidebar-note { padding: 16px 15px 14px; border: 1px solid #ebeaff; border-radius: 14px; background: #f7f5ff; }
.note-icon { display: grid; width: 25px; height: 25px; place-items: center; margin-bottom: 11px; border-radius: 8px; color: #7556df; background: #ebe5ff; }
.sidebar-note strong { font-size: 13px; }
.sidebar-note p { margin: 6px 0 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.profile-button { display: flex; width: 100%; align-items: center; gap: 10px; margin-top: 15px; padding: 13px 5px 3px; text-align: left; border: 0; border-top: 1px solid #edf0f5; background: transparent; }
.avatar { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 50%; color: #5549bb; background: #ece9ff; font-weight: 700; }
.profile-button strong { display: block; font-size: 13px; }
.profile-button small { display: block; margin-top: 3px; color: var(--muted); font-size: 13px; }
.more-icon { margin-left: auto; color: var(--muted); letter-spacing: 2px; }

.main-content { max-width: 1600px; margin-left: 246px; padding: 0 47px; }
.topbar { position: sticky; top: 0; z-index: 10; display: flex; height: 74px; align-items: center; justify-content: space-between; margin: 0 -47px; padding: 0 47px; background: rgb(245 247 252 / 92%); backdrop-filter: blur(12px); }
.breadcrumb { color: var(--muted); font-size: 13px; }
.breadcrumb span { margin: 0 8px; color: var(--muted); }
.breadcrumb strong { color: #58647c; font-weight: 600; }
.top-actions { display: flex; gap: 18px; align-items: center; }
.theme-toggle { display: grid; width: 36px; height: 36px; place-items: center; padding: 0; color: var(--muted); border: 1px solid #e5e9f1; border-radius: 10px; background: #fff; transition: .2s ease; }
.theme-toggle:hover { color: #4b63d2; border-color: #bfcafa; background: #f7f8ff; }
.theme-toggle svg { width: 17px; height: 17px; stroke-width: 1.8; }
.footer-status i { display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: #41bd91; }
.role-switch, .filter-button { padding: 9px 13px; color: #59667d; border: 1px solid #e5e9f1; border-radius: 9px; background: #fff; font-size: 13px; font-weight: 600; transition: .2s; }
.role-switch:hover, .filter-button:hover { border-color: #bfcafa; color: #4268ef; }
.role-switch span { margin-right: 5px; font-size: 14px; }
.mobile-menu { display: none; }

.welcome-section { position: relative; display: flex; min-height: 252px; align-items: center; overflow: hidden; padding: 30px 36px; border-radius: 20px; color: #fff; background: #202a62; box-shadow: 0 13px 30px #566be524; }
.cover-image-change { position: absolute; top: 16px; right: 16px; z-index: 3; padding: 8px 12px; color: #fff; border: 1px solid #ffffff70; border-radius: 9px; background: #11143b80; font-size: 13px; font-weight: 600; backdrop-filter: blur(8px); }
.cover-image-change:hover { background: #11143bbd; }
.welcome-copy { position: relative; z-index: 2; }
.eyebrow { color: #e0e6ff; font-size: 13px; font-weight: 700; letter-spacing: 1.1px; }
.eyebrow-dot { display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: #a7f2ce; }
.welcome-section h1 { margin: 17px 0 7px; font: 800 clamp(24px,3vw,34px) "Segoe UI",Arial,sans-serif; letter-spacing: -1.2px; }
.welcome-section h1 span:first-child { color: #fff; }
.welcome-section p { margin: 0 0 23px; color: #e3e7ff; font-size: 13px; }
.wave { color: #ffe48c; font-size: 20px; vertical-align: 7px; }
.primary-button { display: inline-flex; min-height: 39px; align-items: center; justify-content: center; gap: 19px; padding: 0 16px; color: #4b5cbd; border: 0; border-radius: 9px; background: #fff; font-size: 13px; font-weight: 700; box-shadow: 0 4px 10px #293e9517; transition: transform .18s ease, box-shadow .18s ease; }
.primary-button:hover { transform: translateY(-2px); box-shadow: 0 7px 16px #293e952b; }
.primary-button span { font-size: 17px; line-height: 1; }
/* АШИГЛАГДАХГҮЙ (2026-12 шалгалт): .welcome-art-аас .welcome-decoration хүртэлх хуучин нүүр хуудасны чимэглэл. CLEANUP_NOTES.md-г үз. */
.welcome-art { position: absolute; top: 0; right: 3%; width: 40%; height: 100%; }
.art-orbit { position: absolute; top: 50%; left: 50%; border: 1px solid #ffffff24; border-radius: 50%; transform: translate(-50%,-50%) rotate(-24deg); }
.orbit-one { width: 270px; height: 170px; }
.orbit-two { width: 320px; height: 230px; transform: translate(-50%,-50%) rotate(31deg); }
.art-card-main { position: absolute; top: 50%; left: 50%; display: flex; width: 150px; height: 112px; flex-direction: column; align-items: center; justify-content: center; border: 1px solid #ffffff45; border-radius: 21px; background: #ffffff; box-shadow: 0 16px 35px #25298e35; transform: translate(-50%,-50%) rotate(-7deg); backdrop-filter: blur(5px); }
.art-symbol { color: #ffeaab; font: 500 56px Georgia,serif; }
.art-caption { color: #f0efff; font-size: 8px; letter-spacing: .3px; }
.floating-symbol { position: absolute; color: #ffffffac; font-family: Georgia,serif; }
.symbol-pi { top: 28px; right: 34px; font-size: 30px; transform: rotate(12deg); }
.symbol-root { bottom: 23px; left: 13%; font-size: 25px; transform: rotate(-12deg); }
.floating-dot { position: absolute; width: 8px; height: 8px; border-radius: 50%; background: #ffe18d; box-shadow: 0 0 0 5px #ffe18d24; }
.dot-a { top: 34px; left: 24%; }
.dot-b { right: 15%; bottom: 33px; width: 5px; height: 5px; background: #a8f3d9; box-shadow: 0 0 0 5px #a8f3d922; }
.welcome-decoration { position: absolute; right: -37px; bottom: -96px; width: 178px; height: 178px; border: 1px solid #ffffff16; border-radius: 50%; }

.stats-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 16px; margin: 24px 0; }
.study-picker-section { margin-top: 24px; }
.study-picker-controls { display: grid; grid-template-columns: repeat(2,minmax(180px,280px)); gap: 14px; }
.study-picker-controls label { display: grid; gap: 7px; color: #56627a; font-size: 13px; font-weight: 700; }
.study-picker-controls select { min-height: 42px; padding: 0 12px; color: #33415d; border: 1px solid #e1e7f1; border-radius: 10px; background: #fff; }
.study-picker-message { margin-top: 14px; padding: 12px 14px; color: var(--muted); border: 1px solid #e5eaf3; border-radius: 10px; background: #f8faff; font-size: 13px; }
.study-picker-message strong { color: #435ed0; }
.study-picker-message a, .learning-source-note a { margin-left: 8px; color: #526ee7; font-weight: 800; }
.learning-chapter-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.learning-chapter-grid .learning-chapter { display: grid; gap: 8px; padding: 15px; border: 1px solid #e5eaf3; border-radius: 12px; background: #fff; }
.learning-chapter-grid .learning-chapter strong { color: #33415e; font-size: 13px; }
.learning-chapter-grid .learning-chapter > span { color: var(--muted); font-size: 13px; }
.grade11-book-viewer { margin-top: 16px; overflow: hidden; border: 1px solid #e1e7f1; border-radius: 14px; background: #f7f9fd; }
.grade11-book-viewer iframe { display: block; width: 100%; height: 760px; border: 0; }
@media (max-width: 720px) { .learning-chapter-grid { grid-template-columns: 1fr; } }
@media (max-width: 620px) { .study-picker-controls { grid-template-columns: 1fr; } }
.stat-card { position: relative; display: flex; min-height: 112px; align-items: flex-start; gap: 14px; overflow: hidden; padding: 20px; border: 1px solid #edf0f5; border-radius: 16px; background: #fff; transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease; }
.stat-card:hover { transform: translateY(-4px); border-color: #dfe4f4; box-shadow: 0 13px 26px #34446a16; }
.stat-icon { display: grid; width: 35px; height: 35px; flex: 0 0 35px; place-items: center; border-radius: 11px; font-size: 17px; font-weight: 700; }
.icon-blue { color: #4b63d2; background: #edf1ff; }.icon-purple { color: #8869e9; background: #f2edff; }.icon-teal { color: #18876f; background: #e6f8f0; }.icon-orange { color: #ec9c42; background: #fff4e5; }
.stat-copy { min-width: 0; }
.stat-copy span, .stat-copy small { display: block; color: var(--muted); font-size: 13px; }
.stat-copy strong { display: block; margin: 5px 0 3px; color: #1d2b49; font: 800 23px "Segoe UI",Arial,sans-serif; letter-spacing: -.6px; }
.stat-copy small { color: var(--muted); font-size: 13px; }
.stat-spark { position: absolute; right: 12px; bottom: 12px; font-size: 13px; }
.spark-blue { color: #98aafd; }.spark-purple { color: #c2b1f5; }.spark-teal { color: #8eddd1; }.spark-orange { color: #f8cc8f; }

.section-hidden { display: none !important; }
.content-section { margin: 0 0 24px; }
.section-heading { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 20px; margin-bottom: 19px; }
.muted-eyebrow { color: var(--muted); font-size: 13px; letter-spacing: 1.25px; }
.section-heading h2 { margin: 7px 0 5px; color: #1c2945; font: 800 22px "Segoe UI",Arial,sans-serif; letter-spacing: -.6px; }
.section-heading p { margin: 0; color: var(--muted); font-size: 13px; }
.heading-actions { display: flex; gap: 8px; }
.filter-button.selected { color: #6146c8; border-color: #d7cdf8; background: #f6f3ff; }
.search-row { display: flex; align-items: center; gap: 11px; margin-bottom: 16px; }
.search-box { display: flex; max-width: 420px; min-width: 220px; height: 44px; flex: 1; align-items: center; gap: 9px; padding: 0 14px; border: 1px solid #e8ecf3; border-radius: 11px; background: #fff; color: var(--muted); transition: border-color .18s ease, box-shadow .18s ease; }
.search-box:focus-within { border-color: #6879e8; box-shadow: 0 0 0 3px #6475e825, 0 4px 12px #354bb014; }
.search-box span { font-size: 20px; }
.search-box input { width: 100%; color: #34425e; border: 0; outline: 0; background: transparent; font-size: 13px; }
.search-box input::placeholder { color: var(--muted); }
.source-pill { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 13px; }
.source-check { display: grid; width: 17px; height: 17px; place-items: center; border-radius: 50%; color: #26a987; background: #e5f7f0; font-size: 13px; }
.chapter-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 13px; align-items: start; }
.chapter-card { overflow: hidden; border: 1px solid #e9edf4; border-radius: 13px; background: #fff; transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease; }
.chapter-card:hover { border-color: #dbe2f0; box-shadow: 0 8px 22px #32436a0a; transform: translateY(-1px); }
.chapter-card.expanded { border-color: #d5defe; box-shadow: 0 8px 22px #3d5fc00e; }
.chapter-summary { display: flex; width: 100%; align-items: center; gap: 13px; padding: 20px; text-align: left; border: 0; background: transparent; }
.chapter-number { display: grid; width: 39px; height: 39px; flex: 0 0 39px; place-items: center; border-radius: 12px; color: #4268ef; background: #eef2ff; font: 800 14px "Segoe UI",Arial,sans-serif; }.chapter-card:nth-child(3n) .chapter-number { color: #159e93; background: #e9f8f5; }
.chapter-main { min-width: 0; flex: 1; }
.chapter-main strong { display: block; color: #273550; font-size: 13px; line-height: 1.45; overflow-wrap: anywhere; }
.chapter-meta { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 6px; color: var(--muted); font-size: 13px; }
.chapter-meta span + span::before { content: "–"; margin-right: 9px; color: var(--muted); }
.chapter-arrow { color: var(--muted); font-size: 17px; transition: transform .2s ease; }
.chapter-card.expanded .chapter-arrow { color: #6075de; transform: rotate(90deg); }
.chapter-detail { display: none; padding: 0 20px 20px; border-top: 1px solid #f0f2f7; }
.chapter-card.expanded .chapter-detail { display: block; }
.detail-block { margin-top: 13px; }
.detail-label { display: block; margin-bottom: 6px; color: var(--muted); font-size: 13px; font-weight: 700; letter-spacing: .45px; text-transform: uppercase; }
.detail-block p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.65; }
.topic-list { display: flex; flex-wrap: wrap; gap: 6px; }
.topic-chip { padding: 5px 8px; color: #58667f; border: 1px solid #edf0f6; border-radius: 7px; background: #fafbfe; font-size: 13px; line-height: 1.4; }
.objective-list { display: grid; gap: 7px; }
.objective-row { display: grid; grid-template-columns: 67px 1fr; gap: 8px; padding: 8px 9px; border-radius: 8px; background: #f8f9fd; }
.objective-code { align-self: start; width: fit-content; padding: 3px 6px; color: #536cd1; border-radius: 5px; background: #eaf0ff; font-size: 13px; font-weight: 700; }
.objective-code.starred { color: #a46b10; background: #fff2d6; }
.objective-row p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.criteria-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.criterion-pill { padding: 5px 8px; color: #4a9b89; border-radius: 7px; background: #eaf8f4; font-size: 13px; font-weight: 700; }
.lesson-list { display: flex; flex-wrap: wrap; gap: 6px; }
.lesson-chip { padding: 5px 8px; color: var(--muted); border-radius: 7px; background: #f2f4f8; font-size: 13px; }
.chapter-progress-button { margin-top: 13px; padding: 8px 10px; color: #5e6db9; border: 1px solid #dfe4f8; border-radius: 8px; background: #fff; font-size: 13px; font-weight: 600; }
.chapter-progress-button.done { color: #188771; border-color: #c9eee2; background: #f0fbf7; }
.empty-state { padding: 35px; text-align: center; color: var(--muted); border: 1px dashed #dce2ed; border-radius: 12px; background: #fff; font-size: 13px; }
.hidden { display: none !important; }

.table-count, .progress-label { padding: 8px 11px; color: var(--muted); border-radius: 8px; background: #fff; font-size: 13px; }
.table-wrap { overflow: auto; border: 1px solid #e9edf4; border-radius: 13px; background: #fff; }
table { width: 100%; border-collapse: collapse; min-width: 740px; }
th { padding: 12px 14px; text-align: left; color: var(--muted); background: #fafbfe; font-size: 13px; font-weight: 700; letter-spacing: .35px; }
td { padding: 13px 14px; vertical-align: top; color: var(--muted); border-top: 1px solid #f0f2f6; font-size: 13px; line-height: 1.55; }
td:first-child { min-width: 136px; color: #33415d; font-weight: 600; }
td:nth-child(2) { min-width: 65px; color: #5c6fd2; font-weight: 700; }
td:nth-child(4) { min-width: 140px; color: var(--muted); }
.assessment-note { display: flex; gap: 8px; align-items: flex-start; margin: 11px 1px 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.assessment-note span { display: grid; width: 15px; height: 15px; flex: 0 0 15px; place-items: center; border-radius: 50%; color: #6170c8; background: #e9edff; font-size: 13px; font-weight: 700; }

.progress-panel { padding: 20px; border: 1px solid #e9edf4; border-radius: 14px; background: #fff; }
.progress-top { display: flex; align-items: center; justify-content: space-between; }
.progress-top strong { display: block; color: #34415d; font-size: 13px; }
.progress-top span { display: block; margin-top: 5px; color: var(--muted); font-size: 13px; }
.progress-percent { color: #516de1 !important; font: 800 21px "Segoe UI",Arial,sans-serif !important; }
.progress-track { height: 8px; overflow: hidden; margin: 17px 0 15px; border-radius: 20px; background: #eef1f7; }
.progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: #4970f0; transition: width .3s ease; }
.progress-chapters { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); gap: 7px; }
.progress-dot { min-height: 52px; padding: 7px 4px; text-align: center; color: var(--muted); border: 1px solid #edf0f5; border-radius: 9px; background: #fbfcfe; font-size: 13px; }
.progress-dot strong { display: block; margin-bottom: 4px; color: var(--muted); font-size: 13px; }
.progress-dot.done { color: #218c77; border-color: #d4eee5; background: #f1fbf7; }
.progress-dot.done strong { color: #218c77; }
.footer { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 19px 0 25px; border-top: 1px solid #e9edf4; }
.footer-brand { color: #475fce; font: 800 13px "Segoe UI",Arial,sans-serif; }
.footer-brand span { margin-right: 5px; font-size: 17px; }
.footer p, .footer-status { color: var(--muted); font-size: 13px; }
.footer-status i { width: 6px; height: 6px; }
.toast { position: fixed; z-index: 60; right: 24px; bottom: 24px; padding: 11px 15px; color: #fff; border-radius: 10px; background: #253453; box-shadow: 0 8px 24px #1926442b; font-size: 13px; opacity: 0; transform: translateY(8px); transition: .22s ease; pointer-events: none; }
.toast.show { opacity: 1; transform: translateY(0); }

.profile-dialog { width: min(420px,calc(100% - 32px)); padding: 0; border: 0; border-radius: 17px; background: transparent; box-shadow: 0 20px 70px #17233c35; }
.profile-dialog::backdrop { background: #16213a70; backdrop-filter: blur(3px); }
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.profile-preview { width: 112px; height: 112px; margin: 4px auto; border: 1px solid #e8ebf2; border-radius: 50%; background: #f5f7fb; object-fit: cover; }
.dialog-card { position: relative; display: grid; gap: 9px; padding: 27px; border-radius: 17px; background: #fff; }
.dialog-close { position: absolute; top: 13px; right: 15px; border: 0; color: var(--muted); background: transparent; font-size: 24px; }
.dialog-card h2 { margin: 0; color: #25324e; font: 800 21px "Segoe UI",Arial,sans-serif; }
.dialog-card p { margin: 0 0 7px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.dialog-card label { margin-top: 3px; color: var(--muted); font-size: 13px; font-weight: 700; }
.dialog-card input, .dialog-card select { height: 39px; padding: 0 10px; color: #36435d; border: 1px solid #e5e9f0; border-radius: 8px; outline-color: #9caef8; background: #fff; font-size: 13px; }
.dialog-save { justify-self: start; margin-top: 8px; color: #fff; background: #526ee7; }
.dialog-footnote { margin-top: 2px; color: var(--muted); font-size: 13px; }
.form-stack { display: grid; gap: 9px; }
.form-stack input, .form-stack select, .level-picker select, .test-controls select, .game-controls select {
  min-height: 39px; width: 100%; padding: 0 10px; color: #36435d; border: 1px solid #e5e9f0;
  border-radius: 8px; outline-color: #9caef8; background: #fff; font-size: 13px;
}
.auth-links { display: flex; justify-content: space-between; gap: 10px; }
.auth-links button, .inline-button { padding: 0; color: #5268d6; border: 0; background: transparent; font-size: 13px; }
.learning-section { scroll-margin-top: 84px; }
.level-picker { display: grid; min-width: 150px; gap: 5px; color: var(--muted); font-size: 13px; font-weight: 700; }
.test-controls, .game-controls { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; }
.test-controls select, .game-controls select { min-width: 190px; width: auto; }
.exercise-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 13px; }
.exercise-card, .platform-card, .assessment-work { min-width: 0; padding: 17px; border: 1px solid #edf0f5; border-radius: 13px; background: #fff; }
.exercise-card h3, .platform-card h3, .test-heading h3 { margin: 11px 0; color: #263451; font-size: 14px; line-height: 1.65; }
.exercise-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; color: var(--muted); font-size: 13px; }
.level-badge { padding: 4px 7px; border-radius: 99px; background: #edf2ff; color: #5269d2; }
.level-badge.standard { background: #f3edff; color: #7657c7; }
.level-badge.advanced { background: #fff3e3; color: #bb761d; }
.answer-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; }
.answer-form label, .test-question { display: grid; flex: 1 1 180px; gap: 5px; color: var(--muted); font-size: 13px; font-weight: 700; }
.answer-form input, .test-question input { min-height: 37px; width: 100%; padding: 0 10px; border: 1px solid #e2e7ef; border-radius: 8px; outline-color: #9caef8; }
.answer-feedback { margin-top: 9px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.answer-feedback p { margin: 6px 0; }
.correct { color: #17856e; }.incorrect { color: #c04f52; }.hint { color: #7d6a35; }
.assessment-work { min-height: 70px; }
.test-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.test-heading strong { color: #c25f32; font-variant-numeric: tabular-nums; }
.test-question { padding: 12px 0; border-bottom: 1px solid #edf0f5; }
.test-question strong { color: #33415e; font-size: 13px; line-height: 1.6; }
.assessment-question-progress { margin: 10px 0 2px; color: #526ee7; font-size: 13px; font-weight: 750; }
.assessment-navigation { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 14px; }
.assessment-navigation .action-button { margin-top: 0; margin-left: auto; }
.action-button { margin-top: 12px; color: #fff; background: #526ee7; }
.action-button:disabled, button:disabled { cursor: not-allowed; opacity: .55; }
.answer-review { padding: 10px 0; border-top: 1px solid #edf0f5; color: var(--muted); font-size: 13px; }
.answer-review p { line-height: 1.6; }
.classroom-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 13px; margin-bottom: 13px; }
.platform-card { margin-bottom: 13px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.platform-card p { margin: 7px 0; }
.eesh-material-list { display: grid; grid-template-columns: repeat(auto-fit,minmax(210px,1fr)); gap: 10px; margin-top: 12px; }
.eesh-material-card { display: flex; min-width: 0; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 13px; border: 1px solid #edf0f5; border-radius: 10px; background: #fafbff; }
.eesh-material-card strong { color: #33415e; font-size: 13px; line-height: 1.6; }
.eesh-viewer { margin-top: 13px; }
.eesh-slide-navigation, .eesh-response-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0; }
.eesh-slide-stage { display: grid; place-items: center; min-height: 260px; padding: 8px; border-radius: 12px; background: #f7f8fb; }
.eesh-slide-image { display: block; width: 100%; max-height: 72vh; margin: 10px auto; border: 1px solid #e6eaf1; border-radius: 9px; background: #fff; object-fit: contain; animation: eesh-slide-in .42s ease both; }
.eesh-presentation-mode { padding: clamp(14px, 3vw, 34px); background: #f8faff; }
.eesh-presentation-mode .eesh-slide-stage { min-height: min(68vh, 760px); background: #17213d; box-shadow: 0 16px 40px rgba(29, 44, 88, .16); }
.eesh-presentation-mode .eesh-slide-image { max-height: min(68vh, 760px); border: 0; box-shadow: 0 8px 28px rgba(0, 0, 0, .25); }
.eesh-step-hint { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.eesh-step-hint span { padding: 4px 9px; border-radius: 999px; color: #fff; background: #526ee7; font-weight: 800; }
@keyframes eesh-slide-in { from { opacity: 0; transform: translateX(22px) scale(.985); } to { opacity: 1; transform: translateX(0) scale(1); } }
.eesh-response-form { display: grid; gap: 8px; margin-top: 12px; color: var(--muted); font-size: 13px; font-weight: 700; }
.eesh-response-form textarea { width: 100%; min-height: 100px; padding: 10px; border: 1px solid #e2e7ef; border-radius: 8px; outline-color: #9caef8; resize: vertical; font: inherit; }
.eesh-response-actions { margin: 0; }
.eesh-save-status { color: #17856e; font-size: 13px; font-weight: 500; }
.class-row, .leader-row { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-top: 1px solid #edf0f5; }
.leader-row strong { color: #4b63d2; }
.join-code-notice { display: grid; gap: 4px; margin-bottom: 13px; padding: 13px 15px; border: 1px solid #cceee4; border-radius: 11px; color: #237b69; background: #f0fbf7; font-size: 13px; }
.join-code-notice span { color: var(--muted); font-size: 13px; }
.empty-state { color: var(--muted); font-size: 13px; line-height: 1.6; }
.student-dashboard { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 10px; margin-top: 16px; }
.student-metric { padding: 11px; border: 1px solid #edf0f5; border-radius: 10px; background: #fff; }
.student-metric span, .student-metric strong { display: block; }
.student-metric span { color: var(--muted); font-size: 13px; }
.student-metric strong { margin-top: 4px; color: #34466d; font-size: 15px; }
.badge-list { display: flex; flex-wrap: wrap; gap: 7px; grid-column: 1/-1; }
.badge-pill { padding: 6px 9px; border-radius: 99px; color: #94661d; background: #fff5dc; font-size: 13px; }
.error-review, .assessment-history { margin-top: 16px; }
.error-item { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 7px 12px; padding: 11px 0; border-top: 1px solid #e8ecf4; color: var(--muted); font-size: 13px; }
.error-item strong { color: #384967; font-size: 13px; }
.error-item p { grid-column: 1/-1; margin: 0; line-height: 1.5; }
.error-item .filter-button { justify-self: end; }
.teacher-tools { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.review-form { display: flex; gap: 5px; align-items: center; }
.review-form input { width: 58px; min-height: 29px; padding: 3px 6px; border: 1px solid #e2e7ef; border-radius: 6px; }
.review-form button { padding: 5px 8px; }
.student-answer-summary td { padding: 10px 12px; background: #f7f8ff; }
.student-answer-toggle { padding: 0; border: 0; color: #526ee7; background: transparent; font-weight: 750; cursor: pointer; }
.student-answer-toggle:hover { text-decoration: underline; }
.student-answer-hint { margin-left: 10px; color: var(--muted); font-size: 13px; }
body.dark-mode .student-answer-summary td { background: #252b43; }
body.dark-mode .student-answer-toggle { color: #aab5ff; }
.print-report { padding: 24px; color: #111; background: #fff; font: 13px Arial,sans-serif; }
.print-report h1 { font-size: 20px; }.print-report h2 { margin-top: 20px; font-size: 16px; }
.print-report table { width: 100%; margin: 8px 0 16px; border-collapse: collapse; }
.print-report th, .print-report td { padding: 6px; border: 1px solid #aaa; text-align: left; }
.learning-source-note { display: grid; gap: 5px; margin-bottom: 14px; padding: 13px 15px; border: 1px solid #dfe7ff; border-radius: 12px; color: #5368bc; background: #f5f7ff; font-size: 13px; }
.learning-source-note span { color: var(--muted); line-height: 1.5; }
.medle-resource { display: grid; justify-items: start; gap: 7px; margin-bottom: 14px; }
.medle-resource p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.learning-chapters { display: grid; grid-template-columns: repeat(auto-fit,minmax(170px,1fr)); gap: 9px; margin-bottom: 14px; }
.learning-chapter { display: grid; min-width: 0; gap: 6px; padding: 12px; text-align: left; border: 1px solid #e8ecf4; border-radius: 11px; color: #53627d; background: #fff; font-size: 13px; }
.learning-chapter.selected { border-color: #9faff7; color: #435ed0; background: #f5f7ff; }
.learning-chapter strong { line-height: 1.45; }
.learning-chapter span { color: var(--muted); font-size: 13px; }
.learning-chapter.unavailable { background: #f8f9fc; }
.learning-layout { display: grid; grid-template-columns: minmax(180px,.32fr) minmax(0,1fr); gap: 13px; align-items: start; }
.lesson-list-nav { display: grid; gap: 7px; }
.lesson-tab { display: grid; grid-template-columns: 19px minmax(0,1fr); gap: 4px 7px; padding: 12px; text-align: left; border: 1px solid #e8ecf4; border-radius: 10px; background: #fff; color: var(--muted); }
.lesson-tab.selected { border-color: #adbbfa; background: #f5f7ff; }
.lesson-tab span { grid-row: 1/3; color: #2aa88d; font-weight: 800; }
.lesson-tab strong { color: #354461; font-size: 13px; line-height: 1.45; }
.lesson-tab small { color: var(--muted); font-size: 13px; }
.lesson-detail, .reference-bank, .learning-feature-card { min-width: 0; padding: 17px; border: 1px solid #e9edf5; border-radius: 13px; background: #fff; }
.lesson-article h3, .reference-bank h3, .learning-feature-card h3 { margin: 5px 0 10px; color: #273653; font-size: 15px; }
.lesson-title-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.lesson-progress-pill { flex: 0 0 auto; padding: 5px 8px; border-radius: 99px; color: #428b7b; background: #edf9f5; font-size: 13px; }
.feature-kicker { color: #6275d6; font-size: 13px; font-weight: 800; letter-spacing: .7px; }
.lesson-intro { color: #596781; font-size: 13px; line-height: 1.6; }
.lesson-source { padding: 9px 10px; border-radius: 8px; color: var(--muted); background: #f7f8fb; font-size: 13px; line-height: 1.5; }
.lesson-block { margin-top: 15px; padding-top: 13px; border-top: 1px solid #edf0f5; }
.lesson-block h4 { margin: 0 0 9px; color: #36445f; font-size: 13px; }
.lesson-block > p { color: var(--muted); font-size: 13px; line-height: 1.6; }
.lesson-theory, .lesson-recap { display: grid; gap: 8px; padding-left: 20px; color: var(--muted); font-size: 13px; line-height: 1.65; }
.worked-example { margin: 7px 0; padding: 10px 12px; border: 1px solid #edf0f5; border-radius: 9px; color: #56647d; background: #fbfcff; font-size: 13px; line-height: 1.6; }
.worked-example summary { color: #4b61c8; cursor: pointer; font-weight: 700; }
.worked-example ol { display: grid; gap: 5px; padding-left: 20px; }
.answer-key { color: #168570 !important; font-weight: 700; }
.formula-grid, .glossary-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(190px,1fr)); gap: 8px; }
.formula-card, .glossary-card { display: grid; align-content: start; gap: 6px; min-width: 0; padding: 11px; border: 1px solid #edf0f5; border-radius: 9px; background: #fbfcff; }
.formula-card span, .glossary-card strong { color: var(--muted); font-size: 13px; }
.formula-card strong { overflow-wrap: anywhere; color: #4b5cb4; font-size: 13px; line-height: 1.6; }
.formula-card p, .glossary-card span { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.reference-bank { margin-top: 13px; }
.reference-bank > p { color: var(--muted); font-size: 13px; line-height: 1.6; }
.reference-search { display: grid; gap: 6px; margin: 9px 0; color: var(--muted); font-size: 13px; font-weight: 700; }
.reference-search input, .reference-search select { min-height: 37px; width: 100%; padding: 0 10px; border: 1px solid #e2e7ef; border-radius: 8px; background: #fff; }
.application-block { padding: 13px; border: 1px solid #f2e7d2; border-radius: 10px; background: #fffcf6; }
.application-block > strong { color: #5d6576; font-size: 13px; line-height: 1.6; }
.learning-error { display: grid; gap: 5px; margin: 7px 0; padding: 10px; border-left: 3px solid #eda8a8; border-radius: 7px; background: #fff8f8; font-size: 13px; }
.learning-error strong { color: #48566f; }
.learning-error span, .learning-error p { margin: 0; color: var(--muted); line-height: 1.5; }
.connection-list { display: flex; flex-wrap: wrap; gap: 7px; }
.connection-link { padding: 8px 10px; border: 1px solid #e2e8ff; border-radius: 8px; color: #5368c3; background: #f8f9ff; font-size: 13px; text-align: left; }
.learning-quiz-form, .daily-quiz-form { display: grid; gap: 7px; }
.learning-quiz-form .test-question { flex: auto; }
.quiz-feedback { margin-top: 9px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.daily-card { margin: 14px 0; border-color: #f3e5be; background: #fffdf7; }
.daily-quiz-form > strong { color: #3d4d69; font-size: 13px; line-height: 1.6; }
.daily-quiz-form label { display: grid; gap: 5px; color: var(--muted); font-size: 13px; }
.daily-quiz-form input { min-height: 38px; padding: 0 10px; border: 1px solid #e4e8f0; border-radius: 8px; }
.graph-controls { display: flex; flex-wrap: wrap; gap: 14px; }
.graph-controls label { display: grid; grid-template-columns: auto minmax(100px,160px) 25px; gap: 7px; align-items: center; color: var(--muted); font-size: 13px; }
.graph-controls output { color: #5266c5; font-weight: 700; }
.graph-canvas { max-width: 100%; overflow: hidden; margin-top: 10px; border: 1px solid #e9edf5; border-radius: 10px; background: #fff; }
.graph-canvas svg { display: block; width: 100%; height: auto; }
.graph-grid-line { stroke: #edf0f6; stroke-width: 1; }
.graph-axis { stroke: #73809a; stroke-width: 1.5; }
.graph-curve { fill: none; stroke: #5d69df; stroke-width: 3; }
.graph-limit { stroke: #eea64e; stroke-width: 2; stroke-dasharray: 6 5; }
.graph-point { fill: #24a99e; stroke: #fff; stroke-width: 2; }
.graph-label { fill: #78849a; font: 13px "Segoe UI",sans-serif; }
.graph-interpretation { padding: 9px; border-radius: 8px; color: #4b5db1 !important; background: #f5f7ff; font-weight: 700; }
.learning-tool-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.learning-tool-grid .learning-feature-card { margin-top: 13px; }
.learning-feature-card > p { color: var(--muted); font-size: 13px; line-height: 1.65; }
.independent-panel { margin-top: 13px; }
.independent-exercise { margin-top: 10px; }
.independent-exercise h4 { color: #3c4b67; font-size: 13px; line-height: 1.6; }
@media print {
  body.print-report { background: #fff; }
  body.print-report .app-shell, body.print-report .toast, body.print-report dialog { display: none !important; }
  body.print-report .print-report { display: block !important; }
}

@media (min-width: 1500px) { .main-content { margin-right: auto; } }
@media (max-width: 1120px) {
  .main-content { padding: 0 28px; }
  .topbar { margin: 0 -28px; padding: 0 28px; }
  .stats-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 760px) {
  .sidebar { width: 246px; transform: translateX(-101%); transition: transform .22s ease; box-shadow: 8px 0 25px #1c2a4610; }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; padding: 0 17px; }
  .topbar { height: 62px; margin: 0 -17px; padding: 0 17px; }
  .mobile-menu { display: block; padding: 6px 8px; color: #56637b; border: 0; background: transparent; font-size: 19px; }
  .breadcrumb { margin-right: auto; margin-left: 9px; font-size: 13px; }
  .role-switch { padding: 8px 9px; font-size: 13px; }
  .welcome-section { min-height: 235px; padding: 26px 23px; }
  .cover-image-change { top: 10px; right: 10px; }
  .welcome-section h1 { max-width: 260px; font-size: 26px; }
  .welcome-section p { max-width: 245px; font-size: 13px; line-height: 1.5; }
  .welcome-art { right: -17%; width: 55%; opacity: .65; }
  .art-card-main { width: 115px; height: 94px; }
  .art-symbol { font-size: 45px; }
  .stats-grid { gap: 9px; margin: 14px 0 31px; }
  .stat-card { min-height: 100px; gap: 8px; padding: 13px 10px; }
  .stat-icon { width: 30px; height: 30px; flex-basis: 30px; border-radius: 9px; }
  .stat-copy span { font-size: 13px; }
  .stat-copy strong { font-size: 21px; }
  .stat-copy small { font-size: 8px; }
  .section-heading { align-items: flex-start; }
  .section-heading h2 { font-size: 20px; }
  .section-heading p { max-width: 260px; line-height: 1.5; }
  .heading-actions { flex-direction: column; align-items: stretch; }
  .filter-button { padding: 8px; font-size: 13px; white-space: nowrap; }
  .chapter-grid { grid-template-columns: 1fr; }
  .exercise-list, .classroom-grid { grid-template-columns: 1fr; }
  .learning-layout, .learning-tool-grid { grid-template-columns: 1fr; }
  .lesson-list-nav { grid-template-columns: repeat(auto-fit,minmax(145px,1fr)); }
  .learning-chapters { grid-template-columns: repeat(auto-fit,minmax(140px,1fr)); }
  .student-dashboard { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .level-picker { min-width: 115px; }
  .search-row { flex-wrap: wrap; }
  .search-box { max-width: none; flex-basis: 100%; }
  .assessment-section .section-heading { align-items: flex-end; }
  .table-count, .progress-label { white-space: nowrap; font-size: 13px; }
  .progress-panel { padding: 15px 12px; }
  .progress-chapters { grid-template-columns: repeat(4,minmax(0,1fr)); }
  .footer { flex-wrap: wrap; }
  .footer p { order: 3; flex-basis: 100%; margin: 0; }
}
@media (max-width: 390px) {
  .main-content { padding: 0 12px; }
  .topbar { margin: 0 -12px; padding: 0 12px; }
  .role-switch { padding: 7px; }
  .role-switch span { margin: 0; }
  .role-switch { font-size: 0; }
  .role-switch span { font-size: 14px; }
  .welcome-section { padding: 24px 18px; }
  .welcome-art { right: -24%; opacity: .5; }
  .stat-card { flex-direction: column; }
  .stat-copy strong { margin-top: 4px; }
  .heading-actions { gap: 5px; }
}

h1, h2, h3, h4 { font-family: "Segoe UI", Arial, sans-serif; }
.chapter-card, .stat-card { border-radius: 16px; }
.exercise-card, .platform-card, .assessment-work { padding: 20px; }

body.dark-mode { color: #e6e9f2; background: #111522; }
body.dark-mode .sidebar,
body.dark-mode .stat-card,
body.dark-mode .chapter-card,
body.dark-mode .search-box,
body.dark-mode .table-wrap,
body.dark-mode .progress-panel,
body.dark-mode .exercise-card,
body.dark-mode .platform-card,
body.dark-mode .assessment-work,
body.dark-mode .dialog-card,
body.dark-mode .profile-preview,
body.dark-mode .empty-state,
body.dark-mode .table-count,
body.dark-mode .progress-label { color: #e6e9f2; background-color: #1b2131; border-color: #2c3448; }
body.dark-mode .topbar { background: rgb(17 21 34 / 92%); }
body.dark-mode .sidebar { border-right-color: #2c3448; }
body.dark-mode .brand-name strong,
body.dark-mode .section-heading h2,
body.dark-mode .stat-copy strong,
body.dark-mode .chapter-main strong,
body.dark-mode .profile-button strong,
body.dark-mode .progress-top strong,
body.dark-mode .progress-dot strong,
body.dark-mode .exercise-card h3,
body.dark-mode .platform-card h3,
body.dark-mode .test-heading h3,
body.dark-mode .test-question strong,
body.dark-mode .dialog-card h2 { color: #eef0f8; }
body.dark-mode .breadcrumb strong,
body.dark-mode .nav-link { color: #aeb8cc; }
body.dark-mode .nav-link:hover,
body.dark-mode .nav-link.active { color: #a9b5ff; background: #292f4a; }
body.dark-mode .sidebar-note { color: #e4e3f7; border-color: #343252; background: #22203b; }
body.dark-mode .profile-button { border-top-color: #2c3448; }
body.dark-mode .theme-toggle,
body.dark-mode .role-switch,
body.dark-mode .filter-button,
body.dark-mode .chapter-progress-button,
body.dark-mode .search-box input,
body.dark-mode .form-stack input,
body.dark-mode .form-stack select,
body.dark-mode .level-picker select,
body.dark-mode .test-controls select,
body.dark-mode .game-controls select,
body.dark-mode .dialog-card input,
body.dark-mode .dialog-card select,
body.dark-mode .answer-form input,
body.dark-mode .test-question input { color: #e6e9f2; border-color: #39435a; background-color: #202738; }
body.dark-mode .theme-toggle:hover,
body.dark-mode .role-switch:hover,
body.dark-mode .filter-button:hover { color: #c1c9ff; border-color: #6977cb; background: #292f49; }
body.dark-mode .search-box:focus-within { border-color: #8794ff; box-shadow: 0 0 0 3px #7786ff35, 0 4px 12px #080a151c; }
body.dark-mode .search-box input::placeholder { color: #8e98ad; }
body.dark-mode .chapter-detail { border-top-color: #2c3448; }
body.dark-mode .topic-chip,
body.dark-mode .lesson-chip,
body.dark-mode .progress-dot,
body.dark-mode th,
body.dark-mode .objective-row { color: #c2c9d8; border-color: #30394e; background: #202738; }
body.dark-mode .progress-dot.done { color: #83d9bb; border-color: #30594f; background: #1d3834; }
body.dark-mode .progress-dot.done strong { color: #83d9bb; }
body.dark-mode td,
body.dark-mode .test-question,
body.dark-mode .answer-review,
body.dark-mode .footer { border-color: #2c3448; }
body.dark-mode td,
body.dark-mode .detail-block p,
body.dark-mode .objective-row p,
body.dark-mode .answer-feedback,
body.dark-mode .dialog-card p { color: #b2bbcd; }
body.dark-mode .footer { border-top-color: #2c3448; }
body.dark-mode .chapter-card:hover,
body.dark-mode .stat-card:hover { border-color: #475375; box-shadow: 0 13px 26px #07091466; }
body.dark-mode .empty-state { border-style: dashed; }

@media (max-width: 760px) {
  .top-actions { gap: 9px; }
  .welcome-section { background-position: 72% center; background-size: auto 100%; }
  .welcome-section h1 { max-width: 100%; font-size: clamp(22px,6vw,26px); letter-spacing: -.7px; }
  .stats-grid { gap: 12px; margin: 24px 0; }
  .stat-card { padding: 16px; }
  .content-section { margin-bottom: 24px; }
}
@media (max-width: 390px) {
  .theme-toggle { width: 32px; height: 32px; }
  .welcome-section { background-position: 68% center; }
  .stat-card { min-height: 114px; padding: 12px; }
}

:root {
  color-scheme: light;
  --ink: #202747;
  --muted: #55607a;
  --line: #e8eaf5;
  --blue: #5b65e8;
  --purple: #9561dc;
  --teal: #29a995;
  --orange: #eaa04e;
}

body {
  color: var(--ink);
  background: #eaf5ff;
}

.sidebar {
  background: rgb(255 255 255 / 94%);
  border-right-color: #e9eaf4;
  box-shadow: 8px 0 34px #34396b08;
}

.brand-mark {
  background: #5c76f3;
  box-shadow: 0 8px 19px #775be43d;
}

.nav-link {
  border: 1px solid transparent;
  transition: color .2s ease, background .2s ease, border-color .2s ease, transform .2s ease;
}

.nav-link:hover {
  border-color: #e8eaff;
  background: #f3f5ff;
  transform: translateX(2px);
}

.nav-link.active {
  color: #5360dc;
  border-color: #e2e4ff;
  background: #edf0ff;
  box-shadow: inset 3px 0 #7371ec;
}

.nav-icon {
  color: #8188c7;
  border-radius: 6px;
  font: 600 16px/1 "Segoe UI Symbol", "Segoe UI", sans-serif;
}

.nav-link.active .nav-icon { color: #705ed8; }
.nav-link:nth-child(3n+2) .nav-icon { color: #9468cc; }
.nav-link:nth-child(3n) .nav-icon { color: #409d91; }

.nav-icon[data-lucide="house"]::before { content: "⌂"; }
.nav-icon[data-lucide="map"]::before { content: "◇"; }
.nav-icon[data-lucide="pencil"]::before { content: "✎"; }
.nav-icon[data-lucide="monitor"]::before { content: "▣"; }
.nav-icon[data-lucide="search"]::before { content: "⌕"; }
.nav-icon[data-lucide="clock-3"]::before { content: "◷"; }
.nav-icon[data-lucide="users"]::before { content: "♟"; }
.nav-icon[data-lucide="circle-check"]::before { content: "✓"; }
.nav-icon[data-lucide="trending-up"]::before { content: "↗"; }

.theme-toggle i[data-lucide] {
  font: 600 19px/1 "Segoe UI Symbol", "Segoe UI", sans-serif;
}

.theme-toggle i[data-lucide="moon"]::before { content: "☾"; }
.theme-toggle i[data-lucide="sun"]::before { content: "☼"; }

.sidebar-note {
  border-color: #e8e3ff;
  background: #f4f0ff;
}

.note-icon {
  color: #694ed0;
  background: #e4ddff;
}

.main-content {
  padding-bottom: 12px;
}

.topbar {
  background: rgb(246 247 252 / 88%);
  border-bottom: 1px solid #e8eaf466;
}

.theme-toggle,
.role-switch,
.filter-button {
  border-color: #e3e5f1;
  box-shadow: 0 2px 6px #30385c08;
}

.theme-toggle:focus-visible,
.role-switch:focus-visible,
.filter-button:focus-visible,
.nav-link:focus-visible,
.primary-button:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 3px solid #8e8bf466;
  outline-offset: 2px;
}

.welcome-section {
  min-height: 266px;
  border: 1px solid #ffffff50;
  border-radius: 24px;
  background-image: #202a62;
  box-shadow: 0 18px 38px #34356b24, inset 0 1px #ffffff40;
}

.welcome-section::after {
  position: absolute;
  inset: auto -55px -145px auto;
  width: 310px;
  height: 310px;
  border: 1px solid #ffffff2a;
  border-radius: 50%;
  box-shadow: 0 0 0 22px #ffffff0b, 0 0 0 46px #ffffff08;
  content: "";
  pointer-events: none;
}

.welcome-section h1 {
  text-wrap: balance;
  text-shadow: 0 3px 22px #15143242;
}

.eyebrow:not(.muted-eyebrow) {
  display: inline-flex;
  align-items: center;
  padding: 7px 10px;
  border: 1px solid #ffffff30;
  border-radius: 99px;
  background: #ffffff12;
  backdrop-filter: blur(8px);
}

.primary-button {
  color: #fff;
  background: #7780f5;
  box-shadow: 0 7px 19px #30297645, inset 0 1px #ffffff50;
}

.primary-button:hover {
  box-shadow: 0 10px 24px #3029765c, inset 0 1px #ffffff50;
}

.stats-grid {
  gap: 14px;
}

.stat-card {
  min-height: 118px;
  border-color: #e9eaf4;
  border-radius: 18px;
  box-shadow: 0 5px 16px #30385c08;
}

.stat-card:nth-child(1) { background: #fff; }
.stat-card:nth-child(2) { background: #fff; }
.stat-card:nth-child(3) { background: #fff; }
.stat-card:nth-child(4) { background: #fff; }

.stat-icon {
  width: 39px;
  height: 39px;
  flex-basis: 39px;
  border-radius: 13px;
}

.icon-blue { color: #5367dc; background: #e6ebff; }
.icon-purple { color: #8753cb; background: #eee4ff; }
.icon-teal { color: #168a78; background: #dcf5ed; }
.icon-orange { color: #d3852e; background: #ffedcf; }

.content-section {
  margin-bottom: 27px;
  padding: 25px;
  border: 1px solid #e9eaf4;
  border-radius: 22px;
  background: #ffffff;
  box-shadow: 0 8px 26px #30385c08;
  scroll-margin-top: 92px;
}

.section-heading {
  margin-bottom: 20px;
}

.muted-eyebrow {
  color: #6f6ecb;
}

.section-heading h2 {
  color: #202747;
  letter-spacing: -.75px;
}

.section-heading p {
  color: var(--muted);
  line-height: 1.65;
}

.filter-button.selected {
  color: #604bc2;
  border-color: #d9d2fa;
  background: #f1edff;
}

.search-box {
  border-color: #e3e6f2;
  box-shadow: 0 3px 10px #30385c06;
}

.search-box:focus-within {
  border-color: #8c8aef;
  box-shadow: 0 0 0 4px #817dec1c, 0 5px 16px #30385c0c;
}

.source-pill {
  border-color: #d7eee7;
  background: #f0faf6;
}

.chapter-card {
  border-radius: 15px;
  box-shadow: 0 4px 13px #30385c08;
}


.chapter-card:hover {
  border-color: #dfe3f3;
  box-shadow: 0 10px 24px #34385f13;
}


.chapter-card.expanded {
  border-right-color: #dfe3f3;
  border-bottom-color: #dfe3f3;
  border-left-color: #dfe3f3;
  box-shadow: 0 8px 22px #4c4a8d10;
}

.chapter-summary {
  min-height: 76px;
}

.chapter-number {
  border-radius: 12px;
  color: #5367dc;
  background: #e8edff;
}



.topic-chip,
.lesson-chip {
  border-color: #e6e8f3;
  background: #f7f8ff;
}

.chapter-progress-button {
  color: #5861d0;
  border-color: #e3e2fb;
  background: #f5f4ff;
}

.exercise-card,
.platform-card,
.assessment-work,
.lesson-detail,
.reference-bank,
.learning-feature-card,
.progress-panel,
.table-wrap {
  border-color: #e8eaf4;
  border-radius: 16px;
  box-shadow: 0 4px 16px #30385c08;
}

.exercise-card,
.platform-card {
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.exercise-card:hover,
.platform-card:hover {
  transform: translateY(-2px);
  border-color: #d9dcf1;
  box-shadow: 0 9px 22px #30385c10;
}

.learning-chapter,
.lesson-tab {
  border-color: #e6e8f3;
  border-radius: 12px;
  transition: border-color .2s ease, background .2s ease, transform .2s ease;
}

.learning-chapter:hover,
.lesson-tab:hover {
  border-color: #cfd3f5;
  transform: translateY(-1px);
}

.learning-chapter.selected,
.lesson-tab.selected {
  border-color: #aaa9f1;
  background: #f1f1ff;
}

.progress-track {
  overflow: hidden;
  border-radius: 99px;
  background: #eceefa;
}

.progress-track span {
  border-radius: inherit;
  background: #50c2a4;
  box-shadow: 0 2px 8px #6c70df46;
}

.footer {
  border-top-color: #e4e6f1;
}

button,
.chapter-card,
.stat-card {
  -webkit-tap-highlight-color: transparent;
}

@media (max-width: 760px) {
  .welcome-section {
    min-height: 235px;
  }

  .content-section {
    padding: 17px;
    border-radius: 18px;
  }
}

@media (max-width: 390px) {
  .content-section {
    padding: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

body.dark-mode {
  color-scheme: dark;
  background: #1b3852;
}

body.dark-mode .sidebar {
  background: rgb(27 33 49 / 96%);
  box-shadow: 8px 0 34px #05071025;
}

body.dark-mode .topbar {
  border-bottom-color: #2c344866;
}

body.dark-mode .nav-link.active {
  color: #c0c5ff;
  border-color: #44416d;
  background: #292f4a;
  box-shadow: inset 3px 0 #9990ff;
}

body.dark-mode .nav-link:hover {
  border-color: #39405b;
  background: #242c41;
}

body.dark-mode .sidebar-note {
  border-color: #393453;
  background: #292640;
}

body.dark-mode .content-section {
  border-color: #2c3448;
  background: #1b2131;
  box-shadow: 0 8px 26px #07091425;
}

body.dark-mode .section-heading h2 {
  color: #eef0f8;
}

body.dark-mode .stat-card:nth-child(1) { background: #1d273d; }
body.dark-mode .stat-card:nth-child(2) { background: #25223c; }
body.dark-mode .stat-card:nth-child(3) { background: #1b302f; }
body.dark-mode .stat-card:nth-child(4) { background: #322b30; }

body.dark-mode .chapter-card {
  border-top-color: #7785ef;
  box-shadow: 0 4px 13px #07091424;
}


body.dark-mode .chapter-number {
  color: #bdc5ff;
  background: #30395d;
}



body.dark-mode .topic-chip,
body.dark-mode .lesson-chip {
  background: #222b40;
}

body.dark-mode .chapter-progress-button,
body.dark-mode .filter-button.selected {
  color: #c3c4ff;
  border-color: #47446e;
  background: #2a2b48;
}

body.dark-mode .learning-chapter.selected,
body.dark-mode .lesson-tab.selected {
  border-color: #6666a4;
  background: #292e4a;
}

body.dark-mode .progress-track {
  background: #2b3146;
}

.sidebar-label {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  margin: 37px 10px 12px;
  padding: 7px 10px;
  color: #fff;
  border-radius: 999px;
  background: #5d69eb;
  box-shadow: 0 6px 15px #8a63dc2e;
  font-size: 13px;
  letter-spacing: 1.4px;
}

.nav-link {
  border: 1px solid transparent;
}

.nav-link.active {
  color: #5c55ca;
  border-color: #e5ddff;
  background: #eeefff;
  box-shadow: inset 3px 0 #7962e9;
}

.nav-link.active .nav-icon {
  color: #7658df;
}

.welcome-section {
  min-height: 300px;
  padding: 36px 40px;
  color: #1d2850;
  border: 1px solid #fff;
  border-radius: 26px;
  background: #f0f3ff;
  box-shadow: 0 18px 42px #6869c41a, inset 0 1px #fff;
}

.welcome-section::before {
  position: absolute;
  inset: 0 0 0 auto;
  width: 48%;
  border-radius: inherit;
  background: var(--welcome-cover-image, #aebeff);
  background-position: center;
  background-size: cover;
  content: "";
  filter: blur(22px);
  opacity: .04;
  pointer-events: none;
  transform: scale(1.08);
}

.welcome-section::after {
  inset: auto -65px -155px auto;
  border-color: #7765d31f;
  box-shadow: 0 0 0 22px #7765d30a, 0 0 0 46px #7765d307;
}

.welcome-copy {
  width: min(60%, 620px);
}

.welcome-section .eyebrow:not(.muted-eyebrow) {
  color: #5f5ec2;
  border-color: #fff;
  background: #ffffffb8;
  box-shadow: 0 5px 16px #7770c817;
}

.welcome-section .eyebrow-dot {
  background: #22b78a;
  box-shadow: 0 0 0 4px #22b78a1c;
}

.welcome-section h1 {
  max-width: 610px;
  color: #20264d;
  font-size: clamp(26px, 3vw, 36px);
  text-shadow: none;
}

.welcome-section h1 span:first-child {
  color: #6259d8;
}

.welcome-section p {
  color: var(--muted);
  font-size: 13px;
}

.wave {
  color: #f0a441;
}

.primary-button {
  color: #fff;
  background: #586eea;
  box-shadow: 0 9px 22px #7260d23b, inset 0 1px #ffffff50;
}

.primary-button:hover {
  box-shadow: 0 12px 26px #7260d252, inset 0 1px #ffffff50;
}

.welcome-visual {
  position: absolute;
  inset: 0 3% 0 auto;
  display: grid;
  width: 38%;
  place-items: center;
}

.welcome-visual::before,
.welcome-visual::after {
  position: absolute;
  width: 238px;
  height: 238px;
  border: 1px solid #7d72df24;
  border-radius: 50%;
  content: "";
}

.welcome-visual::after {
  width: 190px;
  height: 190px;
  border: 0;
  background: #a8c3ff;
  filter: blur(1px);
}

.welcome-photo-frame {
  position: relative;
  z-index: 1;
  width: 184px;
  height: 224px;
  overflow: hidden;
  border: 5px solid #ffffffd9;
  border-radius: 46% 46% 27px 27px;
  background: #dce5ff;
  box-shadow: 0 18px 35px #48519a35, 0 0 0 9px #ffffff4d;
  transform: rotate(3deg);
}

.welcome-photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 35%;
}

.welcome-photo-frame.photo-missing img {
  display: none;
}

.welcome-photo-badge {
  position: absolute;
  z-index: 2;
  right: 3%;
  bottom: 38px;
  padding: 10px 13px;
  color: #6257b7;
  border: 1px solid #fff;
  border-radius: 12px;
  background: #ffffffed;
  box-shadow: 0 9px 22px #51468b1a;
  font-size: 13px;
  font-weight: 700;
}

.welcome-photo-badge span {
  margin-right: 5px;
  color: #eea34d;
}

.welcome-formula {
  position: absolute;
  z-index: 1;
  display: grid;
  place-items: center;
  color: #fff;
  border: 1px solid #fff;
  border-radius: 13px;
  background: #6d79e9;
  box-shadow: 0 9px 20px #6555bd33;
  font-family: Georgia, serif;
  font-weight: 700;
}

.formula-sigma {
  top: 44px;
  left: 8%;
  width: 43px;
  height: 43px;
  font-size: 23px;
  transform: rotate(-10deg);
}

.formula-pi {
  top: 62px;
  right: 11%;
  width: 38px;
  height: 38px;
  color: #b5681f;
  background: #ffd178;
  font-size: 20px;
  transform: rotate(10deg);
}

.formula-root {
  bottom: 43px;
  left: 9%;
  width: 52px;
  height: 42px;
  color: #fff;
  background: #29b99b;
  font-size: 16px;
  transform: rotate(-7deg);
}

.curriculum-section {
  position: relative;
  overflow: hidden;
  border-color: #e5e3fb;
  background: #fff;
  box-shadow: 0 12px 32px #5c54bf10;
}

.curriculum-section::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: #6479ee;
  content: "";
}

.curriculum-section .muted-eyebrow {
  color: #765dd5;
}

.curriculum-section .section-heading h2 {
  color: #292c55;
}

body.dark-mode .welcome-section {
  color: #f3f2ff;
  background: #242b48;
}

body.dark-mode .welcome-section h1,
body.dark-mode .welcome-section p {
  color: #f1efff;
}

body.dark-mode .welcome-section h1 span:first-child,
body.dark-mode .welcome-section .eyebrow:not(.muted-eyebrow) {
  color: #d3cbff;
}

body.dark-mode .welcome-section .eyebrow:not(.muted-eyebrow) {
  border-color: #ffffff20;
  background: #ffffff12;
}

body.dark-mode .welcome-photo-badge {
  border-color: #ffffff24;
  color: #e3dcff;
  background: #29263ded;
}

body.dark-mode .curriculum-section {
  border-color: #36314f;
  background: #1d2235;
}

body.dark-mode .curriculum-section .section-heading h2 {
  color: #eef0fa;
}

@media (max-width: 900px) {
  .welcome-section {
    min-height: 282px;
    padding: 32px;
  }

  .welcome-visual {
    right: 0;
    width: 42%;
  }

  .welcome-photo-frame {
    width: 154px;
    height: 196px;
  }

  .welcome-photo-badge {
    right: 2%;
    bottom: 27px;
    padding: 9px 10px;
    font-size: 13px;
  }
}

@media (max-width: 600px) {
  .welcome-section {
    min-height: 294px;
    align-items: flex-start;
    padding: 26px 21px;
  }

  .welcome-copy {
    width: 72%;
  }

  .welcome-section h1 {
    max-width: 100%;
    font-size: clamp(21px, 6vw, 27px);
  }

  .welcome-section p {
    max-width: 100%;
    font-size: 13px;
  }

  .welcome-visual {
    inset: auto 0 0 auto;
    width: 42%;
    height: 48%;
  }

  .welcome-visual::before {
    width: 155px;
    height: 155px;
  }

  .welcome-visual::after {
    width: 124px;
    height: 124px;
  }

  .welcome-photo-frame {
    width: 106px;
    height: 140px;
    border-width: 4px;
    border-radius: 46% 46% 19px 19px;
  }

  .welcome-photo-badge {
    right: 5px;
    bottom: 14px;
    padding: 7px 8px;
    font-size: 8px;
  }

  .welcome-formula {
    width: 31px;
    height: 31px;
    border-radius: 10px;
    font-size: 16px;
  }

  .formula-sigma {
    top: 4px;
    left: 4%;
  }

  .formula-pi {
    top: 10px;
    right: 6%;
  }

  .formula-root {
    bottom: 15px;
    left: 3%;
    width: 39px;
    height: 31px;
    font-size: 13px;
  }
}

.lesson-media-section {
  display: grid;
  gap: 10px;
  margin: 15px 0 18px;
  padding: 14px;
  border: 1px solid #e5e3fb;
  border-radius: 12px;
  background: #fbfaff;
}

.lesson-media-heading {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lesson-media-heading h4 {
  margin: 0;
  color: #514e9f;
  font-size: 13px;
}

.lesson-media-heading > span {
  display: grid;
  min-width: 21px;
  height: 21px;
  place-items: center;
  border-radius: 50%;
  color: #7658ce;
  background: #eee9ff;
  font-size: 13px;
  font-weight: 700;
}

.lesson-media-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid #eceaf5;
  border-radius: 9px;
  background: #fff;
}

.lesson-media-meta {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.lesson-media-meta strong {
  overflow-wrap: anywhere;
  color: #394663;
  font-size: 13px;
}

.lesson-media-meta span {
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 13px;
}

.lesson-media-item video {
  grid-column: 1 / -1;
  width: 100%;
  max-height: 420px;
  border-radius: 8px;
  background: #171923;
}

.lesson-media-link {
  justify-self: start;
  padding: 8px 11px;
  color: #5d58c4;
  border: 1px solid #e1ddfa;
  border-radius: 8px;
  background: #f7f5ff;
  font-size: 13px;
  font-weight: 700;
}

.lesson-media-delete {
  grid-column: 2;
  grid-row: 1;
  padding: 7px 9px;
  color: #a64c63;
  border-color: #f1dce3;
  font-size: 13px;
}

.lesson-media-upload {
  display: grid;
  gap: 9px;
  padding-top: 11px;
  border-top: 1px solid #ebe8f4;
}

.lesson-media-upload label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.lesson-media-upload input {
  min-height: 38px;
  width: 100%;
  padding: 8px 10px;
  color: #55617a;
  border: 1px solid #e3e5ef;
  border-radius: 8px;
  background: #fff;
  font-size: 13px;
}

.lesson-media-upload input[type="file"] {
  min-height: auto;
}

.lesson-media-upload small {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.lesson-media-upload .primary-button {
  justify-self: start;
}

body.dark-mode .lesson-media-section {
  border-color: #3a3454;
  background: #23243a;
}

body.dark-mode .lesson-media-heading h4 {
  color: #d3cbff;
}

body.dark-mode .lesson-media-item {
  border-color: #39374f;
  background: #202538;
}

body.dark-mode .lesson-media-meta strong {
  color: #e4e6f4;
}

body.dark-mode .lesson-media-link {
  color: #d2caff;
  border-color: #494168;
  background: #302b47;
}

body.dark-mode .lesson-media-upload {
  border-top-color: #3c374f;
}

body.dark-mode .lesson-media-upload input {
  color: #e3e5f2;
  border-color: #41475d;
  background: #1b2233;
}

.chapter-game-card {
  display: grid;
  gap: 13px;
  padding: 16px;
  border: 1px solid #e3e4fb;
  border-radius: 14px;
  background: #f8f6ff;
}

.chapter-game-intro {
  display: flex;
  align-items: center;
  gap: 11px;
}

.chapter-game-icon {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  place-items: center;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 3px 10px #41498112;
  font-size: 20px;
}

.chapter-game-intro strong,
.chapter-game-intro span {
  display: block;
}

.chapter-game-intro strong {
  color: #37456b;
  font-size: 13px;
}

.chapter-game-intro div > span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.chapter-game-start,
.chapter-game-next {
  width: fit-content;
  min-height: 36px;
  color: #594eb7;
  border-color: #dedafa;
  background: #fff;
}

.chapter-game-start:hover,
.chapter-game-next:hover {
  border-color: #c9c2f3;
  background: #faf9ff;
}

.chapter-game-progress {
  height: 6px;
  overflow: hidden;
  border-radius: 8px;
  background: #e6e9f4;
}

.chapter-game-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #6977e9;
  transition: width .25s ease;
}

.chapter-game-question {
  margin: 0;
  color: #34415f;
  font-size: 13px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.chapter-game-form {
  display: flex;
  align-items: end;
  gap: 9px;
}

.chapter-game-form label {
  display: grid;
  flex: 1;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.chapter-game-form input {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  color: #34415f;
  border: 1px solid #dfe3ef;
  border-radius: 9px;
  outline: 0;
  background: #fff;
}

.chapter-game-form input:focus {
  border-color: #8584e8;
  box-shadow: 0 0 0 3px #8584e821;
}

.chapter-game-form .action-button {
  min-height: 40px;
  margin: 0;
}

.chapter-game-feedback {
  padding: 10px 12px;
  border: 1px solid;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.5;
}

.chapter-game-feedback.correct {
  color: #16785f;
  border-color: #c8ecdf;
  background: #effaf5;
}

.chapter-game-feedback.incorrect {
  color: #9c5e22;
  border-color: #f0dfc7;
  background: #fff8ee;
}

body.dark-mode .chapter-game-card {
  border-color: #41405d;
  background: #28243e;
}

body.dark-mode .chapter-game-icon,
body.dark-mode .chapter-game-start,
body.dark-mode .chapter-game-next {
  color: #e1dcff;
  border-color: #494567;
  background: #302d46;
}

body.dark-mode .chapter-game-intro strong,
body.dark-mode .chapter-game-question {
  color: #e5e7f4;
}

body.dark-mode .chapter-game-intro div > span,
body.dark-mode .chapter-game-form label {
  color: #a7aec4;
}

body.dark-mode .chapter-game-progress {
  background: #3a4055;
}

body.dark-mode .chapter-game-form input {
  color: #e5e7f4;
  border-color: #41475d;
  background: #1b2233;
}

body.dark-mode .chapter-game-feedback.correct {
  color: #9ce0c7;
  border-color: #34594f;
  background: #20372f;
}

body.dark-mode .chapter-game-feedback.incorrect {
  color: #f0c48f;
  border-color: #5a4833;
  background: #3a3025;
}

@media (max-width: 520px) {
  .chapter-game-card { padding: 13px; }
  .chapter-game-form { align-items: stretch; flex-direction: column; }
  .chapter-game-form .action-button { width: 100%; }
}

/* Симуляци */
.simulation-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 13px; margin-bottom: 18px; }
.simulation-card { display: flex; flex-direction: column; gap: 8px; min-width: 0; padding: 17px; border: 1px solid #edf0f5; border-radius: 13px; background: #fff; }
.simulation-card h3 { margin: 0; color: #263451; font-size: 14px; line-height: 1.5; }
.simulation-card p { flex: 1; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.simulation-topic { align-self: flex-start; padding: 3px 9px; color: #6146c8; border-radius: 99px; background: #f6f3ff; font-size: 13px; font-weight: 700; }
.simulation-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filter-button.danger { color: #c0392b; }
.filter-button.danger:hover { color: #c0392b; border-color: #f0b6ae; }
.simulation-player { margin-bottom: 18px; overflow: hidden; border: 1px solid #e5e9f1; border-radius: 13px; background: #fff; }
.simulation-player-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; color: #263451; font-size: 13px; border-bottom: 1px solid #edf0f5; }
.simulation-player iframe { display: block; width: 100%; height: min(78vh, 720px); min-height: 460px; border: 0; background: #fff; }
.simulation-form { display: grid; gap: 11px; max-width: 640px; }
.simulation-form label { display: grid; gap: 5px; color: #59667d; font-size: 13px; font-weight: 600; }
.simulation-form input:not([type="radio"]), .simulation-form select, .simulation-form textarea { padding: 9px 11px; border: 1px solid #e5e9f1; border-radius: 9px; font: inherit; font-weight: 400; }
.simulation-form small { color: var(--muted); font-weight: 400; }
.simulation-source { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0; padding: 8px 12px; border: 1px solid #e5e9f1; border-radius: 9px; }
.simulation-source label { display: flex; align-items: center; gap: 6px; }

/* ---- Багштай чат ба AI туслах ---- */
.nav-badge { margin-left: auto; min-width: 18px; padding: 1px 6px; border-radius: 999px; background: #e5484d; color: #fff; font-size: 13px; font-weight: 700; text-align: center; }
.nav-badge.hidden { display: none; }
.chat-layout { display: grid; grid-template-columns: 240px 1fr; gap: 14px; min-height: 420px; }
.chat-contacts, .chat-thread-box, .ai-box { border: 1px solid #e8ecf4; border-radius: 12px; background: #fff; }
.chat-contacts { display: flex; flex-direction: column; overflow: auto; max-height: 560px; }
.chat-contact { display: flex; justify-content: space-between; gap: 8px; align-items: center; width: 100%; padding: 11px 13px; border: 0; border-bottom: 1px solid #e8ecf4; background: transparent; text-align: left; cursor: pointer; font: inherit; font-size: 13px; color: inherit; }
.chat-contact small { display: block; color: var(--muted); font-size: 13px; }
.chat-contact.active { background: #eef1ff; }
.chat-unread { min-width: 18px; padding: 1px 6px; border-radius: 999px; background: #e5484d; color: #fff; font-size: 13px; font-weight: 700; text-align: center; }
.chat-thread-box, .ai-box { display: flex; flex-direction: column; min-height: 420px; }
.chat-messages { flex: 1; display: flex; flex-direction: column; gap: 8px; max-height: 460px; min-height: 300px; overflow: auto; padding: 14px; }
.chat-bubble { max-width: 78%; padding: 9px 12px; border-radius: 12px; background: #f1f3f9; font-size: 13px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-bubble.mine { align-self: flex-end; background: #5b65e8; color: #fff; }
.chat-bubble time { display: block; margin-top: 3px; font-size: 13px; opacity: .65; }
.chat-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid #e8ecf4; }
.chat-form[hidden] { display: none; }
.chat-form textarea { flex: 1; min-height: 40px; max-height: 120px; resize: vertical; padding: 9px 11px; border: 1px solid #dce2ed; border-radius: 9px; font: inherit; font-size: 13px; }
.chat-form button { padding: 0 16px; border: 0; border-radius: 9px; background: #5b65e8; color: #fff; font-weight: 700; cursor: pointer; }
.chat-form button:disabled { opacity: .5; cursor: wait; }
.ai-note { padding: 9px 13px; border-bottom: 1px solid #e8ecf4; background: #fff8e8; color: #7a5b13; font-size: 13px; }
.ai-suggestions { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 14px 0; }
.ai-suggestions button { padding: 5px 10px; border: 1px solid #dce2ed; border-radius: 999px; background: #fafbff; font-size: 13px; cursor: pointer; }
@media (max-width: 720px) { .chat-layout { grid-template-columns: 1fr; } .chat-contacts { max-height: 180px; } .chat-bubble { max-width: 92%; } }

/* ---- Хичээлийн файлыг дотроо харуулах ---- */
.lesson-media-frame { display: block; width: 100%; height: min(75vh, 640px); min-height: 360px; border: 1px solid #e8ecf4; border-radius: 10px; background: #f6f7fb; margin: 10px 0 6px; }
.lesson-media-actions { display: flex; flex-wrap: wrap; gap: 14px; }
.grade-pill { display: inline-block; min-width: 28px; padding: 2px 9px; border-radius: 999px; background: #eef1ff; color: #3d46c8; font-weight: 800; text-align: center; }
.grade-pill.g-A { background: #e3f7ea; color: #1b7a3d; } .grade-pill.g-B { background: #e8f3ff; color: #1b5fa8; }
.grade-pill.g-C { background: #fff6dc; color: #8a6400; } .grade-pill.g-D { background: #ffeede; color: #a24a00; } .grade-pill.g-F { background: #fde8e8; color: #b42318; }
.test-choices { display: grid; gap: 8px; margin-top: 10px; }
.test-choice { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid #dce2ed; border-radius: 10px; background: #fff; cursor: pointer; font-size: 13px; }
.test-choice:has(input:checked) { border-color: #5b65e8; background: #eef1ff; }
.test-choice input { width: auto; margin: 0; }
.result-grade { display: flex; align-items: center; gap: 14px; margin: 6px 0 12px; }
.result-grade .grade-pill { font-size: 22px; padding: 6px 16px; }

/* ---- Багшийн анги: сонголт ба таб ---- */
.class-step { margin: 18px 0 10px; font-size: 14px; }
.class-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.class-card { display: flex; flex-direction: column; gap: 4px; padding: 13px 14px; border: 1px solid #dce2ed; border-radius: 12px; background: #fff; text-align: left; cursor: pointer; font: inherit; color: inherit; }
.class-card strong { font-size: 15px; } .class-card span { font-size: 13px; color: var(--muted); } .class-card em { font-style: normal; font-size: 13px; color: #b42318; font-weight: 700; }
.class-card:hover { border-color: #5b65e8; }
.class-card.active { border-color: #5b65e8; background: #eef1ff; box-shadow: 0 0 0 2px #5b65e833; }
.create-class-box { margin-top: 12px; } .create-class-box summary { cursor: pointer; font-weight: 700; }
.class-empty-hint { margin-top: 16px; padding: 18px; border: 1px dashed #c4cbe0; border-radius: 12px; color: var(--muted); text-align: center; font-size: 13px; }
.class-detail { margin-top: 8px; }
.class-detail-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.class-meta { font-size: 13px; color: var(--muted); }
.class-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; padding-bottom: 8px; border-bottom: 1px solid #e8ecf4; }
.class-tab { padding: 8px 14px; border: 1px solid #dce2ed; border-radius: 999px; background: #fff; font: inherit; font-size: 13px; cursor: pointer; }
.class-tab b { margin-left: 4px; padding: 1px 7px; border-radius: 999px; background: #eef1ff; color: #3d46c8; font-size: 13px; }
.class-tab.active { background: #5b65e8; border-color: #5b65e8; color: #fff; } .class-tab.active b { background: #ffffff33; color: #fff; }
.class-panel[hidden] { display: none; }

.lesson-media-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.lesson-media-columns .lesson-media-item video { width: 100%; max-height: 420px; border-radius: 10px; background: #000; }
@media (max-width: 900px) { .lesson-media-columns { grid-template-columns: 1fr; } }

/* ---- ЭЕШ-ын сорил (PDF) ---- */
.eesh-pdf-card { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 0; border-top: 1px solid #e8ecf4; }
.eesh-pdf-card strong { display: block; font-size: 15px; } .eesh-pdf-card span { font-size: 13px; color: var(--muted); }
.eesh-pdf-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.eesh-done { color: #1b7a3d; font-weight: 700; font-size: 13px; } .eesh-expired { color: #b42318; font-size: 13px; }
.eesh-exam { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 14px; align-items: start; }
.eesh-exam-frame { width: 100%; height: 78vh; min-height: 480px; border: 1px solid #e8ecf4; border-radius: 10px; background: #f6f7fb; }
.eesh-sheet { position: sticky; top: 70px; max-height: 80vh; display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1px solid #e8ecf4; border-radius: 12px; background: #fff; }
.eesh-sheet h4 { margin: 0; } .eesh-sheet-rows { overflow: auto; display: grid; gap: 4px; padding-right: 4px; }
.eesh-row { display: grid; grid-template-columns: 34px 1fr 24px; align-items: center; gap: 6px; font-size: 13px; }
.eesh-row small { color: var(--muted); font-size: 13px; }
.eesh-options { display: flex; gap: 4px; }
.eesh-options label { cursor: pointer; } .eesh-options input { position: absolute; opacity: 0; width: 0; height: 0; }
.eesh-options span { display: inline-block; min-width: 28px; padding: 4px 0; border: 1px solid #dce2ed; border-radius: 7px; text-align: center; font-weight: 700; }
.eesh-options input:checked + span { background: #5b65e8; border-color: #5b65e8; color: #fff; }
.eesh-options input:focus-visible + span { outline: 2px solid #5b65e8; outline-offset: 1px; }
.eesh-fill { width: 100%; padding: 4px 8px; border: 1px solid #dce2ed; border-radius: 7px; font: inherit; font-size: 13px; }
tr.eesh-ok td { background: #f1fbf4; } tr.eesh-bad td { background: #fff3f2; }
@media (max-width: 900px) { .eesh-exam { grid-template-columns: 1fr; } .eesh-sheet { position: static; max-height: none; } }

.eesh-year { margin-top: 14px; } .eesh-year h4 { margin: 0 0 4px; font-size: 14px; }
.eesh-year-count { margin-left: 8px; padding: 2px 9px; border-radius: 999px; background: #eef1ff; color: #3d46c8; font-size: 13px; font-weight: 700; }

/* ---- Бичлэгийн холбоос (шууд тоглуулагч) ---- */
.lesson-embed { position: relative; width: 100%; aspect-ratio: 16 / 9; margin: 10px 0 6px; border-radius: 10px; overflow: hidden; background: #000; }
.lesson-embed.vertical { aspect-ratio: 9 / 16; max-width: 320px; margin-left: auto; margin-right: auto; }
.lesson-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

#addStudentForm { margin-bottom: 13px; }

.class-report { margin-bottom: 13px; } .class-report h4 { margin: 0 0 8px; }
.class-report-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.class-report-row label { display: grid; gap: 4px; font-size: 13px; font-weight: 700; flex: 1 1 200px; min-width: 0; }
.class-report-row select { width: 100%; padding: 7px; border: 1px solid #dce2ed; border-radius: 8px; font: inherit; }
.eesh-paper { display: grid; gap: 8px; min-width: 0; } .eesh-paper-tools { display: flex; flex-wrap: wrap; gap: 8px; }
.eesh-pages { display: grid; gap: 10px; max-height: 78vh; overflow: auto; -webkit-overflow-scrolling: touch; }
.eesh-page { display: block; width: 100%; height: auto; min-height: 200px; border: 1px solid #e8ecf4; border-radius: 8px; background: #fff; }
.eesh-scaled { font-size: 16px; } .eesh-scaled strong { font-size: 24px; color: #3d46c8; } .eesh-scaled small { display: block; font-size: 13px; color: var(--muted); }
.eesh-scale { flex-basis: 100%; font-size: 13px; } .eesh-scale textarea { width: 100%; font: inherit; }
@media (max-width: 900px) { .eesh-pages { max-height: 65vh; } }


/* =====================================================================
   НЭГДСЭН ХЭВ МАЯГ (2026-12): цэс, гарчиг, карт, товч, зай, утасны цэс.
   Өмнөх дүрмүүдийг дарж бичнэ. Хэв маягийг өөрчлөх бол эндээс эхэл.
   ===================================================================== */

/* --- Зүүн цэс --- */
.sidebar { padding: 14px 12px 10px; }
.brand { position: relative; flex: 0 0 auto; padding: 0 4px; }
.brand-link { gap: 10px; }
.brand-mark { width: 36px; height: 36px; flex: 0 0 36px; border-radius: 11px; font-size: 20px; }
.brand-name strong { font-size: 15px; line-height: 1.25; letter-spacing: -.4px; white-space: nowrap; }
.brand-name small { margin-top: 1px; font-size: 13px; line-height: 1.3; white-space: nowrap; }
.brand-logo-change { position: absolute; right: 0; top: 7px; width: 22px; height: 22px; border-radius: 7px; font-size: 13px; }
.sidebar .sidebar-label { display: block; flex: 0 0 auto; width: auto; margin: 11px 11px 3px; padding: 0; color: var(--muted); border-radius: 0; background: none; box-shadow: none; font-size: 9.5px; line-height: 14px; letter-spacing: 1.2px; }
.side-nav { flex: 0 0 auto; gap: 1px; }
.brand + .side-nav { margin-top: 12px; }
.nav-link { gap: 10px; padding: 6px 10px; border-radius: 9px; font-size: 13px; line-height: 18px; }
.nav-icon { width: 18px; height: 18px; flex-basis: 18px; }
.nav-icon[data-lucide="gamepad-2"]::before { content: "◈"; }
.nav-icon[data-lucide="bot"]::before { content: "✦"; }
.nav-icon[data-lucide="message-circle"]::before { content: "✉"; }
.nav-icon[data-lucide="sigma"]::before { content: "∑"; }
.nav-icon[data-lucide="book"]::before { content: "▤"; }
.nav-icon[data-lucide="phone"]::before { content: "☎"; }
.nav-icon[data-lucide="book-open-text"]::before { content: "☰"; }
.sidebar-bottom { flex: 0 0 auto; padding-top: 8px; }
.profile-button { margin-top: 6px; padding: 8px 5px 0; }
@media (max-height: 900px) { .sidebar-note { display: none; } }
@media (max-height: 760px) and (min-width: 761px) {
  .sidebar { padding-top: 9px; padding-bottom: 6px; }
  .brand + .side-nav { margin-top: 7px; }
  .sidebar .sidebar-label { margin: 6px 11px 1px; line-height: 13px; }
  .side-nav { gap: 0; }
  .nav-link { padding-top: 2px; padding-bottom: 2px; font-size: 13px; }
  .sidebar-bottom { padding-top: 4px; }
  .profile-button { margin-top: 0; padding-top: 5px; }
  .avatar { width: 28px; height: 28px; }
}

/* --- Breadcrumb --- */
.breadcrumb a:hover { color: #4268ef; }

/* --- Бүх хуудас ижил: хэсэг, гарчиг --- */
.main-content > .content-section { margin-bottom: 20px; padding: 24px; border-radius: 18px; }
.content-section .section-heading { align-items: flex-end; margin-bottom: 18px; }
.content-section .section-heading .eyebrow { color: #6f6ecb; font-size: 13px; letter-spacing: 1.25px; }
.content-section .section-heading h2 { margin: 6px 0 4px; font-size: 22px; line-height: 1.3; letter-spacing: -.6px; }
.content-section .section-heading p { font-size: 13px; line-height: 1.6; }
.main-content > .curriculum-section { border-color: #e9eaf4; }
.curriculum-section::before { display: none; }
body:not(.dark-mode) .curriculum-section { background: #ffffff; }
body:not(.dark-mode) .curriculum-section .section-heading h2 { color: #202747; }
body.dark-mode .main-content > .curriculum-section { border-color: #2c3448; background: #1b2131; }

/* --- Карт --- */
.exercise-card, .platform-card, .assessment-work, .lesson-detail, .reference-bank, .learning-feature-card,
.progress-panel, .table-wrap, .chapter-card, .stat-card, .simulation-card, .eesh-material-card { border-radius: 14px; }

/* --- Товч --- */
.filter-button, .role-switch { min-height: 36px; padding: 8px 14px; border-radius: 10px; font-size: 13px; line-height: 1.35; }
.primary-button { border-radius: 10px; }
.primary-button.action-button { min-height: 36px; font-size: 13px; }
a.filter-button, a.primary-button.action-button { display: inline-flex; align-items: center; justify-content: center; }
a.filter-button.hidden { display: none; }

/* --- Гар утас: цэс нуугдаж ☰ товчоор нээгдэнэ --- */
.sidebar-backdrop { display: none; }
@media (max-width: 760px) {
  .sidebar { width: min(270px, 84vw); visibility: hidden; transition: transform .22s ease, visibility 0s linear .22s; }
  .sidebar.open { visibility: visible; transition: transform .22s ease; }
  .sidebar, body.dark-mode .sidebar { backdrop-filter: none; }
  body:not(.dark-mode) .sidebar { background: #fff; }
  body.dark-mode .sidebar { background: #1b2131; }
  .nav-link { padding-top: 8px; padding-bottom: 8px; font-size: 13px; }
  .sidebar-backdrop { position: fixed; inset: 0; z-index: 15; display: block; background: #10162a66; opacity: 0; pointer-events: none; transition: opacity .22s ease; }
  body.menu-open .sidebar-backdrop { opacity: 1; pointer-events: auto; }
  body.menu-open { overflow: hidden; }
  .mobile-menu { min-width: 40px; min-height: 40px; }
  .main-content > .content-section { margin-bottom: 16px; padding: 16px; }
  .content-section .section-heading { align-items: flex-start; }
  .content-section .section-heading h2 { font-size: 19px; }
  .content-section .section-heading p { max-width: none; }
  .filter-button { font-size: 13px; white-space: normal; }
}
@media (max-width: 390px) { .main-content > .content-section { padding: 13px; } .role-switch { font-size: 0; } .role-switch span { font-size: 14px; } }


/* --- Уншихад томорсон хэмжээ, ЭЕШ-ын дүнгийн самбар (2026-12) --- */
.content-section .platform-card > p, .content-section .platform-card .form-stack p { font-size: 13px; line-height: 1.6; }
.content-section table th { font-size: 13px; }
.content-section table td { font-size: 13px; }
.content-section .student-metric span { font-size: 13px; }
.content-section .student-metric strong { font-size: 21px; }
.content-section .class-meta { font-size: 13px; }
.content-section .filter-button, .content-section .primary-button.action-button { font-size: 13px; }
.eesh-pdf-card strong { font-size: 16px; } .eesh-pdf-card span { font-size: 13px; }
.eesh-results h4 { margin: 22px 0 8px; font-size: 15px; }
.eesh-filter { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; padding: 12px; border: 1px solid #e3e5f5; border-radius: 12px; background: #f6f7ff; }
.eesh-filter label { display: grid; flex: 1 1 200px; gap: 5px; min-width: 0; font-size: 13px; font-weight: 700; }
.eesh-filter select { width: 100%; padding: 9px; border: 1px solid #dce2ed; border-radius: 9px; background: #fff; font: inherit; font-size: 13px; }
.eesh-table table { min-width: 560px; } .eesh-table td { vertical-align: middle; padding-top: 9px; padding-bottom: 9px; }
.eesh-bar { display: inline-block; width: 120px; height: 7px; margin-right: 9px; overflow: hidden; border-radius: 99px; background: #eceefa; vertical-align: middle; }
.eesh-bar i { display: block; height: 100%; background: #50c2a4; }
.eesh-topic-editor { margin-bottom: 10px; font-size: 13px; } .eesh-topic-editor summary { cursor: pointer; font-weight: 700; }
.eesh-topic-editor textarea { width: 100%; padding: 10px; border: 1px solid #dce2ed; border-radius: 9px; font: inherit; }
.eesh-warning { color: #9a3412; border-color: #fdba74; background: #fff7ed; }
body.dark-mode .eesh-filter { border-color: #39435a; background: #202738; }
body.dark-mode .eesh-filter select, body.dark-mode .eesh-topic-editor textarea { color: #e6e9f2; border-color: #39435a; background: #1b2131; }

/* --- Зүүн цэс: дэлгэцийн өндрөөр томорно (намхан дэлгэцэнд нягт хэвээр) --- */
.sidebar .sidebar-label { color: #5f66a8; font-weight: 800; }
@media (min-width: 761px) and (min-height: 761px) {
  .sidebar .sidebar-label { margin: 9px 4px 3px; padding: 7px 7px 0; border-top: 1px solid #e9eaf4; font-size: 13px; }
  .nav-link { padding-top: 5px; padding-bottom: 5px; color: #4f5a75; font-size: 13.5px; }
}
@media (min-width: 761px) and (min-height: 880px) {
  .nav-link { padding-top: 7px; padding-bottom: 7px; font-size: 14.5px; line-height: 20px; }
  .nav-icon { width: 20px; height: 20px; flex-basis: 20px; font-size: 18px; }
  .sidebar .sidebar-label { margin-top: 10px; font-size: 13px; }
  .brand-name strong { font-size: 16.5px; } .brand-name small { font-size: 13px; }
  .profile-button strong { font-size: 13px; } .profile-button small { font-size: 13px; }
}
@media (max-height: 1060px) { .sidebar-note { display: none; } }
@media (min-width: 1280px) {
  .sidebar { width: 272px; }
  .main-content { margin-left: 272px; }
}
@media (min-width: 1500px) { .main-content { margin-right: auto; } }
body.dark-mode .sidebar .sidebar-label { color: #a9b0e8; border-color: #2c3448; }
body.dark-mode .nav-link { color: #c3cbde; }

.content-section .eesh-table td:nth-child(2), .content-section .eesh-table td:nth-child(4) { min-width: 0; color: inherit; font-weight: 500; }
.content-section .platform-card h3 { font-size: 17px; }

.eesh-warning-text { margin: 0; padding: 10px 12px; color: #9a3412; border: 1px solid #fdba74; border-radius: 9px; background: #fff7ed; font-size: 13px; }

/* --- Зүүн цэс томруулсан: мөр, үсгийн хэмжээ дэлгэцийн өндөрт дүйцэнэ (гүйлгэлгүй багтана) --- */
@media (min-width: 761px) {
  .nav-link { height: clamp(25px, calc(5.9vh - 8.8px), 43px); padding-top: 0; padding-bottom: 0; gap: 12px; color: #46506b; font-size: clamp(13px, 2.1vh, 17px); line-height: 1.2; }
  .nav-icon { width: 22px; height: 22px; flex-basis: 22px; font-size: clamp(15px, 2.4vh, 20px); }
  .side-nav { gap: 0; }
  .brand + .side-nav { margin-top: clamp(4px, 1vh, 12px); }
  .sidebar .sidebar-label { margin: clamp(2px, .6vh, 8px) 4px 0; padding: clamp(3px, .8vh, 8px) 7px 1px; border-top: 1px solid #e6e8f4; font-size: clamp(10.5px, 1.6vh, 13px); line-height: 1.3; }
  .brand-name strong { font-size: clamp(16px, 2.4vh, 19px); }
  .brand-name small { font-size: clamp(10.5px, 1.5vh, 12px); }
  .brand-mark { width: 40px; height: 40px; flex-basis: 40px; }
}
@media (min-width: 1280px) {
  .sidebar { width: 290px; }
  .main-content { margin-left: 290px; }
}
@media (min-width: 1500px) { .main-content { margin-right: auto; } }

/* ===== Өнөөдрийн самбар (нүүр хуудас) ===== */
:root { --state-new: #a7afbf; --state-practicing: #eeb020; --state-mastered: #1f9d6b; }
ul { list-style-type: "– "; }

.study-picker-mini { display: flex; gap: 8px; }
.study-picker-mini select { height: 36px; max-width: 150px; padding: 0 8px; color: #33415d; border: 1px solid #e1e7f1; border-radius: 10px; background: #fff; font-size: 13px; font-weight: 700; }

#homeBoard { padding-top: 4px; }
#homeContent { display: grid; gap: 16px; grid-template-columns: minmax(0,1fr); }
.home-card { min-width: 0; padding: 20px 22px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.home-card-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 12px; }
.home-card h2 { margin: 0; font-size: 20px; }
.home-card-head p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.home-card h3 { margin: 0 0 8px; font-size: 15px; }
.home-sub { margin-top: 18px !important; }
.home-empty { margin: 4px 0 10px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.home-button { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; padding: 0 18px; font-size: 14px; }

.home-ring { display: grid; flex: 0 0 auto; width: 70px; height: 70px; place-items: center; border-radius: 50%; background: conic-gradient(var(--state-mastered) calc(var(--done) * 1%), #e6e9f2 0); }
.home-ring span { display: grid; width: 54px; height: 54px; place-items: center; border-radius: 50%; background: #fff; font-size: 16px; font-weight: 800; }
.home-tasks { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.home-task { display: grid; width: 100%; min-height: 58px; grid-template-columns: 32px minmax(0,1fr) auto; align-items: center; gap: 12px; padding: 9px 14px; text-align: left; color: var(--ink); border: 1px solid var(--line); border-radius: 12px; background: #fbfcfe; }
.home-task.next { border-color: #adbbfa; background: #f5f7ff; }
.home-task strong { display: block; font-size: 15px; }
.home-task small { display: block; margin-top: 2px; color: var(--muted); font-size: 13px; }
.home-task em { color: var(--muted); font-size: 13px; font-style: normal; }
.home-check { display: grid; width: 32px; height: 32px; place-items: center; border-radius: 10px; background: #e9ecf5; font-size: 14px; font-weight: 800; }
.home-task.done .home-check { color: #fff; background: var(--state-mastered); }
.home-task.done em { color: var(--state-mastered); font-weight: 800; }
.home-start { margin-top: 14px; }
.home-primary { display: inline-flex; min-width: 220px; min-height: 52px; align-items: center; justify-content: center; font-size: 17px; }

.state-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 10px; color: var(--muted); font-size: 13px; }
.state-key::before { content: ""; display: inline-block; width: 14px; height: 14px; margin-right: 6px; vertical-align: -2px; border-radius: 4px; background: var(--state); }
.state-new { --state: var(--state-new); }
.state-practicing { --state: var(--state-practicing); }
.state-mastered { --state: var(--state-mastered); }
.journey-road { display: flex; gap: 22px; overflow-x: auto; padding: 4px 2px 12px; overscroll-behavior-x: contain; scrollbar-width: thin; }
.journey-chapter { flex: 0 0 auto; }
.journey-label { display: block; margin-bottom: 10px; color: var(--muted); font-size: 13px; font-weight: 800; white-space: nowrap; }
.journey-chapter ol { display: flex; margin: 0; padding: 0; list-style: none; }
.journey-chapter li { position: relative; width: 108px; }
.journey-chapter li:not(:last-child)::after { content: ""; position: absolute; top: 25px; left: calc(50% + 27px); width: calc(100% - 54px); height: 5px; border-radius: 3px; background: var(--state); opacity: .55; }
.journey-stop { display: grid; width: 100%; justify-items: center; align-content: start; gap: 7px; padding: 4px; color: var(--ink); border: 0; border-radius: 12px; background: transparent; }
.journey-stop:hover { background: #8892b51a; }
.journey-mark { display: grid; width: 46px; height: 46px; place-items: center; border: 3px solid var(--state); border-radius: 15px; background: color-mix(in srgb, var(--state) 22%, #fff); color: #202747; font-size: 15px; font-weight: 800; }
.state-mastered .journey-mark { color: #fff; background: var(--state); }
.journey-title { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 3; text-align: center; font-size: 13px; line-height: 1.35; overflow-wrap: anywhere; }

.home-columns { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.home-event { display: grid; grid-template-columns: 62px minmax(0,1fr) auto; align-items: center; gap: 12px; padding: 10px 0; }
.home-event + .home-event { border-top: 1px solid var(--line); }
.home-event strong { display: block; font-size: 15px; }
.home-event span { display: block; margin-top: 2px; color: var(--muted); font-size: 13px; }
.home-event.empty { grid-template-columns: minmax(0,1fr) auto; }
.home-count { display: grid; height: 56px; place-content: center; text-align: center; border-radius: 13px; background: #eef1ff; }
.home-count strong { color: var(--blue); font-size: 21px; }
.home-count small { color: var(--muted); font-size: 13px; }
.home-class + .home-class { margin-top: 16px; }
.home-class h3 small { color: var(--muted); font-size: 13px; font-weight: 600; }
.home-class-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(290px,1fr)); gap: 14px; }
.teacher-class { display: flex; flex-direction: column; gap: 12px; min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: #fbfcfe; }
.teacher-class header { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.teacher-class h3 { margin: 0 auto 0 0; color: var(--ink); font-size: 20px; }
.teacher-class header span { padding: 4px 10px; color: #3f4a66; border-radius: 99px; background: #e9ecf6; font-size: 13px; font-weight: 700; }
.class-stats { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; margin: 0; }
.class-stats > div { display: flex; flex-direction: column; justify-content: space-between; gap: 6px; min-width: 0; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.class-stats dt { color: #4d576e; font-size: 13px; line-height: 1.35; }
.class-stats dd { margin: 0; color: var(--ink); font-size: 22px; font-weight: 800; }
.class-stats > .alert { border-color: #eeb020; background: #fff8e8; }
.class-goal p { margin: 0; color: #4d576e; font-size: 14px; line-height: 1.7; }
.class-none { display: grid; flex: 1; min-height: 76px; place-items: center; margin: 0; color: #4d576e; border: 1px dashed #cfd6e6; border-radius: 10px; font-size: 14px; }
.class-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }
.class-actions .home-button { flex: 1 1 130px; padding: 0 10px; }
.goal-line { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; }
.goal-track { height: 12px; margin: 7px 0 5px; overflow: hidden; border-radius: 99px; background: #e6e9f2; }
.goal-track span { display: block; height: 100%; background: var(--blue); }
.goal-track.reached span { background: var(--state-mastered); }
.goal-note { color: var(--muted); font-size: 13px; }
.home-stats { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; }
.home-stat { display: grid; gap: 4px; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.home-stat span { color: var(--muted); font-size: 13px; font-weight: 700; }
.home-stat strong { font-size: 26px; }
.home-stat small { color: var(--muted); font-size: 13px; }

/* Өнгө сайт даяар ижил утгатай: саарал эхлээгүй, шар дадлага, ногоон эзэмшсэн */
.lesson-tab span.state-mark { display: grid; width: 17px; height: 17px; align-self: center; place-items: center; border: 2px solid var(--state); border-radius: 5px; background: color-mix(in srgb, var(--state) 28%, transparent); color: #fff; font-size: 13px; }
.lesson-tab span.state-mark.state-mastered { background: var(--state); }
.lesson-progress-pill.state-new, .lesson-progress-pill.state-practicing, .lesson-progress-pill.state-mastered { color: var(--ink); border: 2px solid var(--state); background: color-mix(in srgb, var(--state) 18%, transparent); font-weight: 700; }
.progress-dot.state-new, .progress-dot.state-practicing, .progress-dot.state-mastered { border: 2px solid var(--state); background: color-mix(in srgb, var(--state) 14%, #fff); }
.level-badge.advanced, body.dark-mode .level-badge.advanced { color: #a8397c; background: #fdeaf5; }

body.dark-mode .home-card, body.dark-mode .home-stat { border-color: #30384f; background: #191f31; }
body.dark-mode .home-task { border-color: #30384f; background: #1e2538; }
body.dark-mode .home-task.next { border-color: #5967b8; background: #252c4a; }
body.dark-mode .home-check, body.dark-mode .home-count { background: #2b334b; }
body.dark-mode .home-task.done .home-check { background: var(--state-mastered); }
body.dark-mode .home-count strong { color: #aab8ff; }
body.dark-mode .home-ring { background: conic-gradient(var(--state-mastered) calc(var(--done) * 1%), #333c55 0); }
body.dark-mode .home-ring span { background: #191f31; }
body.dark-mode .goal-track { background: #333c55; }
body.dark-mode .teacher-class { border-color: #30384f; background: #1e2538; }
body.dark-mode .class-stats > div { border-color: #353f59; background: #191f31; }
body.dark-mode .class-stats > .alert { border-color: #b98b24; background: #352f22; }
body.dark-mode :is(.teacher-class h3, .class-stats dd) { color: #e6e9f2; }
body.dark-mode :is(.class-stats dt, .class-goal p, .class-none) { color: #c2c9d8; }
body.dark-mode .teacher-class header span { color: #e0e5f3; background: #2d3652; }
body.dark-mode .class-none { border-color: #414b68; }
body.dark-mode .journey-mark { color: #fff; background: color-mix(in srgb, var(--state) 30%, #191f31); }
body.dark-mode .state-mastered .journey-mark { background: var(--state); }
body.dark-mode .progress-dot.state-new, body.dark-mode .progress-dot.state-practicing, body.dark-mode .progress-dot.state-mastered { border-color: var(--state); background: color-mix(in srgb, var(--state) 14%, #191f31); }
body.dark-mode .study-picker-mini select { color: #dbe1f3; border-color: #30384f; background: #1e2538; }

@media (max-width: 1050px) {
  .home-columns { grid-template-columns: minmax(0,1fr); }
  .home-stats { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 760px) {
  .topbar { flex-wrap: wrap; height: auto; min-height: 62px; padding-top: 8px; padding-bottom: 8px; row-gap: 8px; }
  .topbar .breadcrumb { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; }
  .topbar .top-actions { gap: 7px; margin-left: auto; }
  .study-picker-mini select { height: 40px; max-width: 108px; }
  .study-picker-mini #subjectSelect { display: none; }
  .home-card { padding: 16px 14px; }
  .home-button { min-height: 48px; }
  .home-task { min-height: 62px; }
  .home-event { grid-template-columns: 56px minmax(0,1fr); }
  .home-event.empty { grid-template-columns: minmax(0,1fr); }
  .home-event .home-button { grid-column: 1 / -1; width: 100%; }
  .home-card > .home-button, .home-class .home-button { width: 100%; }
  /* Гол товч эрхий хуруунд ойр: дэлгэцийн доод ирмэгт тогтоно */
  .home-start { position: fixed; right: 0; bottom: 0; left: 0; z-index: 12; margin: 0; padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: #fffffff2; }
  .home-primary { width: 100%; min-height: 54px; }
  body.on-home .main-content { padding-bottom: 88px; }
  body.on-home .toast { bottom: 96px; }
  body.dark-mode .home-start { border-color: #30384f; background: #141a2bf2; }
}
@media (max-width: 420px) {
  .topbar .breadcrumb a, .topbar .breadcrumb span { display: none; }
  .role-switch { padding-inline: 10px; }
}
body.dark-mode .home-task, body.dark-mode .journey-stop, body.dark-mode .home-card, body.dark-mode .home-stat { color: #e8ecfa; }
body.dark-mode .home-task strong, body.dark-mode .journey-title { color: #e8ecfa; }
.student-metric strong small { display: block; margin-top: 2px; color: var(--muted); font-size: 13px; font-weight: 600; }
body.dark-mode .student-metric { border-color: #30384f; background: #191f31; }
body.dark-mode .student-metric strong { color: #e8ecfa; }

/* ===== 1-р үе шат: нийтлэг дүрэм ===== */
/* Багшийн хэрэгсэл, тайлбар */
body:not(.is-teacher) .teacher-note, body:not(.is-teacher) .view-only { display: none !important; }
section[data-manage]:not(.managing) .manage-only { display: none !important; }
section.managing .view-only { display: none !important; }
.page-tabs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: -4px 0 18px; border-bottom: 1px solid var(--line); }
.page-tabs button { min-height: 42px; padding: 0 18px; color: var(--muted); border: 0; border-bottom: 3px solid transparent; background: transparent; font-size: 14px; font-weight: 700; }
.page-tabs button.active { color: #3d46c8; border-bottom-color: #5b65e8; }
.manage-hint { flex: 1 1 220px; margin: 0; color: var(--muted); font-size: 13px; text-align: right; }
.preview-banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 14px; padding: 10px 14px; color: #5c4300; border: 1px solid #eeb020; border-radius: 12px; background: #fff6dc; font-size: 14px; font-weight: 700; }
#simulationFormHost { margin-bottom: 16px; }

/* Ижил толгой хэсэг */
.content-section .section-heading { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 20px; margin-bottom: 18px; }
.content-section .section-heading > div:first-child { flex: 1 1 320px; min-width: 0; }
.content-section .section-heading .eyebrow { color: #4f4db4; font-size: 13px; letter-spacing: 1px; }
.content-section .section-heading h2 { margin: 6px 0 4px; font-size: 24px; line-height: 1.3; }
.content-section .section-heading p { max-width: none; margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }

/* Товч: гол / туслах / аюултай — ижил өндөр, булан */
.main-content .filter-button, .main-content .primary-button, .main-content .role-switch, .dialog-card .filter-button, .dialog-card .primary-button { min-height: 42px; padding: 0 16px; border-radius: 10px; font-size: 14px; font-weight: 700; line-height: 1.3; }
.main-content .primary-button, .main-content .primary-button.action-button, .dialog-card .primary-button { color: #fff; border: 0; background: #4f63d8; }
.main-content .filter-button, .main-content .role-switch, .dialog-card .filter-button { color: #36415c; border: 1px solid #cfd6e6; background: #fff; box-shadow: none; }
.main-content .filter-button:hover, .main-content .role-switch:hover { color: #3d46c8; border-color: #5b65e8; }
.main-content .filter-button.selected { color: #3d46c8; border-color: #5b65e8; background: #eef1ff; }
.main-content .filter-button.danger, .main-content .filter-button.lesson-media-delete { color: #b42318; border-color: #f0b6ae; }
.main-content .home-primary { min-height: 52px; font-size: 17px; }
body.dark-mode .main-content .filter-button, body.dark-mode .main-content .role-switch, body.dark-mode .dialog-card .filter-button { color: #e1e6f5; border-color: #414b68; background: #1e2538; }
body.dark-mode .main-content .filter-button.selected { color: #fff; border-color: #7f89f0; background: #2c3460; }
body.dark-mode .main-content .filter-button.danger, body.dark-mode .main-content .filter-button.lesson-media-delete { color: #ffaaa0; border-color: #7a3c38; }
body.dark-mode .page-tabs button.active { color: #c4ccff; border-bottom-color: #8f9af5; }
body.dark-mode .preview-banner { color: #ffe3a3; background: #3a2f12; }
body.dark-mode { --muted: #aab3cb; --line: #30384f; }

/* Нэг хэв маягийн хүрээ; өнгө зөвхөн утгатай газар */
.chapter-card .chapter-number, .chapter-card:nth-child(n) .chapter-number { color: #3d46c8; background: #eef1ff; }
body.dark-mode .chapter-card:nth-child(n) .chapter-number { color: #c4ccff; background: #2b334f; }
.progress-track span { background: var(--state-practicing); box-shadow: none; }

@media (max-width: 760px) {
  .main-content .filter-button, .main-content .primary-button { min-height: 46px; }
  .preview-toggle { max-width: 130px; padding-inline: 8px !important; font-size: 13px !important; }
  .manage-hint { text-align: left; }
}
.objective-code, .level-badge.basic, .feature-kicker, .leader-row strong { color: #3446b0; }
.objective-code.starred { color: #7d4f00; }
.answer-key { color: #0f6b58; }
.test-heading strong { color: #9a4315; }
body.dark-mode .objective-code, body.dark-mode .level-badge.basic, body.dark-mode .feature-kicker, body.dark-mode .leader-row strong { color: #bac6ff; }
body.dark-mode .level-badge.basic { background: #29315a; }
body.dark-mode .objective-code.starred { color: #ffd38a; background: #3d2f14; }
body.dark-mode .answer-key { color: #8fe0c4; }
body.dark-mode .test-heading strong { color: #ffbe94; }
body.dark-mode .test-question, body.dark-mode .ai-suggestions button, body.dark-mode .chat-bubble:not(.mine):not(.user), body.dark-mode .class-card, body.dark-mode .class-tab { color: #e6e9f2; border-color: #36405c; background: #1e2538; }
body.dark-mode .class-card.active { border-color: #7f89f0; background: #2c3460; }
body.dark-mode .class-tab.active { color: #fff; border-color: #5b65e8; background: #4b55cf; }

/* Цэс: 13px бичигтэй ч нэг дэлгэцэнд багтана */
.sidebar .sidebar-label { margin-top: clamp(1px, .4vh, 8px); padding-top: clamp(2px, .5vh, 8px); font-size: 13px; line-height: 1.15; }
.sidebar .brand-name small { font-size: 13px; }
@media (min-width: 761px) { .sidebar .nav-link { height: clamp(24px, calc(5.9vh - 10.5px), 43px); } }

/* Харанхуй горимд цагаан хэвээр үлддэг байсан картууд */
body.dark-mode :is(.learning-feature-card, .learning-chapter, .lesson-tab, .lesson-detail, .reference-bank, .formula-card, .glossary-card, .simulation-card, .learning-source-note, .study-picker-message, .lesson-block, .lesson-media-section, .lesson-media-item, .worked-example) { color: #e6e9f2; border-color: #30384f; background: #1b2133; }
body.dark-mode :is(.learning-feature-card, .learning-chapter, .lesson-tab, .lesson-detail, .reference-bank, .formula-card, .glossary-card, .simulation-card, .lesson-block) :is(h3, h4, strong, summary) { color: #e6e9f2; }
body.dark-mode :is(.learning-chapter.selected, .lesson-tab.selected) { border-color: #7f89f0; background: #2c3460; }
body.dark-mode .formula-card strong { color: #bac6ff; }
body.dark-mode .objective-code { background: #29315a; }
body.dark-mode .objective-code.starred { background: #3d2f14; }
.main-content .answer-key { color: #0f6b58; }
body.dark-mode .main-content .answer-key { color: #8fe0c4; }
body.dark-mode .main-content :is(.correct) { color: #8fe0c4; }
body.dark-mode .main-content :is(.incorrect) { color: #ffaaa0; }
.main-content .answer-key { color: #0f6b58 !important; }
body.dark-mode .main-content .answer-key { color: #8fe0c4 !important; }
body.dark-mode .main-content :is(.lesson-intro, .lesson-source) { color: #c3cbde; }
body.dark-mode .main-content .study-picker-message strong { color: #bac6ff; }
body.dark-mode .main-content .lesson-progress-pill { color: #e6e9f2; }
body.dark-mode .main-content .lesson-source { border-color: #30384f; background: #1e2538; }
body.dark-mode .content-section .section-heading .eyebrow { color: #bac6ff; }

/* ===== 2-р үе шат: хуудас бүр ===== */
:root { --chart-series: #2a78d6; --chart-grid: #e4e7f0; }
body.dark-mode { --chart-series: #3987e5; --chart-grid: #30384f; }

.card-kicker { color: var(--muted); font-size: 13px; font-weight: 700; }
.here-badge { display: inline-block; padding: 3px 10px; color: #fff; border-radius: 99px; background: #4549bf; font-size: 13px; font-weight: 700; white-space: nowrap; }
.status-pill { display: inline-block; padding: 4px 11px; color: var(--ink); border: 2px solid var(--state); border-radius: 99px; background: color-mix(in srgb, var(--state) 18%, transparent); font-size: 13px; font-weight: 700; }
.state-open { --state: var(--primary); }
.current-chapter, .chapter-card.current-chapter, .test-card.current-chapter { border-color: #5b65e8; box-shadow: 0 0 0 1px #5b65e8; }
.mastery-track { display: flex; gap: 2px; height: 8px; overflow: hidden; border-radius: 99px; background: color-mix(in srgb, var(--state-new) 35%, transparent); }
.mastery-fill { display: block; height: 100%; background: var(--state); }
.mastery-value { color: var(--muted); font-size: 13px; font-weight: 600; }
.state-legend { display: flex !important; flex-wrap: wrap; gap: 4px 14px; }
.progress-top .state-legend .state-key { display: inline-block; margin: 0; }

/* Агуулгын зураглал */
.chapter-mastery { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 6px 10px; margin-top: 9px; }
.chapter-mastery:empty { display: none; }
.chapter-mastery .mastery-track { grid-column: 1 / -1; max-width: 420px; }

/* Цахим хичээл: бүлэг, сэдвийн жагсаалт зүүн талд */
.learning-layout { grid-template-columns: minmax(230px,.34fr) minmax(0,1fr); }
.learning-tree { min-width: 0; }
.tree-body { display: grid; gap: 8px; }
.tree-chapter { display: grid; gap: 6px; }
.tree-chapter .learning-chapter { width: 100%; }
.tree-lessons { display: grid; gap: 6px; margin-left: 10px; padding-left: 10px; border-left: 3px solid var(--line); }
.tree-lessons .lesson-tab { width: 100%; }
.main-content .tree-toggle { display: none; }
@media (max-width: 760px) {
  .learning-layout { grid-template-columns: minmax(0,1fr); }
  .main-content .tree-toggle { display: block; width: 100%; }
  .learning-tree .tree-body { display: none; margin-top: 8px; }
  .learning-tree.open .tree-body { display: grid; }
  .lesson-detail { scroll-margin-top: 130px; }
}

/* Дасгал ажил */
.exercise-toolbar { display: flex; grid-column: 1 / -1; flex-wrap: wrap; align-items: center; gap: 12px 24px; }
.mode-switch { display: inline-flex; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; }
.mode-switch button { min-height: 36px; padding: 0 14px; color: var(--muted); border: 0; border-radius: 9px; background: transparent; font-size: 14px; font-weight: 700; }
.mode-switch button.active { color: #fff; background: #4549bf; }
.exercise-position { display: grid; flex: 1 1 240px; grid-template-columns: auto 1fr; align-items: baseline; gap: 4px 14px; }
.exercise-position strong { font-size: 20px; }
.exercise-position > span { color: var(--muted); font-size: 13px; font-weight: 600; }
.exercise-position .progress-track { grid-column: 1 / -1; margin: 2px 0 0; }
.progress-track span { display: block; height: 100%; }
.exercise-position .progress-track span { background: #5b65e8; }
.exercise-list.one-by-one { grid-template-columns: minmax(0,1fr); max-width: 860px; }
.exercise-list.one-by-one .exercise-card h3 { font-size: 19px; }
.exercise-list .exercise-card .answer-form > label { flex-basis: 100%; }
.exercise-state:empty { display: none; }
.confidence-picker { display: flex; flex: 1 1 100%; flex-wrap: wrap; gap: 8px; margin: 2px 0; padding: 0; border: 0; }
.confidence-picker legend { margin-bottom: 6px; padding: 0; color: var(--muted); font-size: 13px; font-weight: 700; }
.confidence-picker label { position: relative; }
.confidence-picker input { position: absolute; opacity: 0; }
.confidence-picker span { display: inline-block; padding: 9px 13px; color: var(--ink); border: 1px solid #cfd6e6; border-radius: 10px; font-size: 13px; font-weight: 600; cursor: pointer; }
.confidence-picker input:checked + span { color: #fff; border-color: #4549bf; background: #4549bf; }
.confidence-picker input:focus-visible + span { outline: 3px solid #9caef8; }
.hint-box { grid-column: 1 / -1; margin: 10px 0 0; padding: 11px 13px; color: var(--ink); border: 1px dashed #5b65e8; border-radius: 10px; font-size: 14px; line-height: 1.55; }
.exercise-nav { display: flex; grid-column: 1 / -1; justify-content: space-between; gap: 10px; }
.main-content .filter-button:disabled { opacity: .55; cursor: default; }
.confidence-tag { display: block; margin-top: 3px; color: var(--muted); font-size: 13px; }

/* Симуляци: ижил бүтэцтэй карт */
.simulation-grid { grid-auto-rows: 1fr; }
.simulation-card .simulation-topic { align-self: stretch; padding: 0; color: var(--muted); border-radius: 0; background: none; font-weight: 600; }
body.dark-mode .simulation-card .simulation-topic { color: var(--muted); background: none; }
.simulation-card h3 { font-size: 16px; }
.simulation-card p { font-size: 14px; }
.simulation-actions { margin-top: auto; }

/* Нэгжийн шалгалт */
.assessment-work:empty { display: none; }
.assessment-work { margin-bottom: 16px; scroll-margin-top: 110px; }
.test-list { display: grid; gap: 10px; }
.test-card { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; padding: 15px 18px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.test-card-main { display: grid; flex: 1 1 280px; gap: 3px; min-width: 0; }
.test-card-main > strong { font-size: 16px; }
.test-card-main > span:last-child { color: var(--muted); font-size: 13px; }
.test-card .filter-button, .test-card .primary-button { min-width: 168px; }
body.dark-mode .test-card { border-color: #30384f; background: #191f31; }

/* ЭЕШ-ын табууд */
#eesh[data-tab="take"] #eeshQuizContent, #eesh[data-tab="manage"] #eeshQuizContent,
#eesh[data-tab="game"] #eeshPdfContent, #eesh[data-tab="materials"] #eeshPdfContent,
#eesh[data-tab="game"] [data-pane="materials"], #eesh[data-tab="materials"] [data-pane="game"] { display: none; }

/* Миний ахиц */
.student-picker { display: grid; gap: 6px; max-width: 420px; margin-bottom: 16px; color: var(--muted); font-size: 13px; font-weight: 700; }
.student-picker select { min-height: 42px; padding: 0 12px; color: var(--ink); border: 1px solid #cfd6e6; border-radius: 10px; background: #fff; font-size: 14px; }
body.dark-mode .student-picker select { border-color: #414b68; background: #1e2538; }
#progressBody .student-dashboard { margin: 0 0 20px; }
.progress-note { grid-column: 1 / -1; margin: 0; }
.mastery-list { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; }
.mastery-row { display: grid; gap: 6px; }
.mastery-row strong { font-size: 14px; }
.progress-block { margin-top: 24px; }
.progress-block h3, #errorList h3, #assessmentHistory h3 { margin: 0 0 12px; font-size: 16px; }
.chart-pair { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.week-chart { min-width: 0; margin: 0; padding: 14px; border: 1px solid var(--line); border-radius: 12px; }
.week-chart figcaption { margin-bottom: 20px; font-size: 14px; font-weight: 700; }
.chart-area { display: grid; grid-template-columns: auto minmax(0,1fr); gap: 8px; }
.chart-scale { display: flex; flex-direction: column; justify-content: space-between; height: 130px; text-align: right; }
.chart-scale span { height: 0; color: var(--muted); font-size: 13px; line-height: 0; }
.chart-cols { position: relative; display: grid; grid-template-columns: repeat(8,minmax(0,1fr)); gap: 2px; }
.chart-cols::before { content: ""; position: absolute; inset: 0 0 auto; height: 130px; border-top: 1px solid var(--chart-grid); background: linear-gradient(var(--chart-grid),var(--chart-grid)) center / 100% 1px no-repeat; }
.chart-col { position: relative; display: grid; gap: 6px; min-width: 0; }
.chart-plot { position: relative; display: flex; align-items: flex-end; justify-content: center; height: 130px; border-bottom: 1px solid var(--muted); }
.chart-bar { position: relative; display: block; width: min(24px,70%); min-height: 3px; border-radius: 4px 4px 0 0; background: var(--chart-series); }
.chart-bar b { position: absolute; bottom: calc(100% + 2px); left: 50%; color: var(--ink); font-size: 13px; white-space: nowrap; transform: translateX(-50%); }
.chart-col small { overflow: hidden; color: var(--muted); font-size: 13px; text-align: center; white-space: nowrap; }
.chart-col:hover .chart-plot, .chart-col:focus-visible .chart-plot { background: color-mix(in srgb, var(--chart-series) 12%, transparent); }
.chart-col:hover::after, .chart-col:focus-visible::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 4px); left: 50%; z-index: 5; width: max-content; max-width: 210px; padding: 7px 10px; color: #fff; border-radius: 8px; background: #202747; font-size: 13px; line-height: 1.4; transform: translateX(-50%); pointer-events: none; }
.chart-col:nth-child(-n+2):hover::after, .chart-col:nth-child(-n+2):focus-visible::after { left: 0; transform: none; }
.chart-col:nth-last-child(-n+2):hover::after, .chart-col:nth-last-child(-n+2):focus-visible::after { right: 0; left: auto; transform: none; }
.chart-table { margin-top: 10px; font-size: 14px; }
.chart-table summary { cursor: pointer; font-weight: 700; }
.badge-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(210px,1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
.badge-card { display: grid; gap: 4px; padding: 13px; border: 2px dashed var(--state-new); border-radius: 12px; }
.badge-card strong { font-size: 14px; }
.badge-card span { color: var(--muted); font-size: 13px; }
.badge-card.earned { border: 2px solid var(--state-mastered); background: color-mix(in srgb, var(--state-mastered) 12%, transparent); }
#errorList, #assessmentHistory { margin-top: 24px; }
.error-item > span { grid-column: 1 / -1; }

/* Томьёоны лавлах, тайлбар толь */
.content-section .reference-bank { margin: 0; }
.reference-toolbar { display: grid; grid-template-columns: minmax(0,2fr) minmax(0,1fr); gap: 12px; }
.reference-toolbar .reference-search { margin: 0; font-size: 14px; }
.reference-toolbar :is(input, select) { min-height: 46px; color: var(--ink); font-size: 16px; }
.reference-count { margin: 12px 0; color: var(--muted); font-size: 14px; }
.reference-bank .formula-grid { grid-template-columns: repeat(auto-fill,minmax(250px,1fr)); gap: 12px; }
.reference-bank .glossary-grid { grid-template-columns: repeat(auto-fill,minmax(290px,1fr)); gap: 12px; }
.reference-bank .formula-card, .reference-bank .glossary-card { gap: 8px; padding: 16px; }
.reference-bank .formula-card span { font-size: 14px; }
.reference-bank .formula-card strong { font-size: 19px; }
.reference-bank .formula-card p { font-size: 15px; }
.reference-bank .glossary-card strong { color: var(--ink); font-size: 17px; }
.reference-bank .glossary-card span { color: var(--ink); font-size: 15px; line-height: 1.65; }
.reference-bank .glossary-card small { color: var(--muted); font-size: 13px; }
body.dark-mode .reference-toolbar :is(input, select) { color: #e6e9f2; border-color: #414b68; background: #1e2538; }

@media (max-width: 900px) { .chart-pair { grid-template-columns: minmax(0,1fr); } }
@media (max-width: 760px) {
  .reference-toolbar { grid-template-columns: minmax(0,1fr); }
  .reference-bank .formula-grid, .reference-bank .glossary-grid { grid-template-columns: minmax(0,1fr); }
  .test-card .filter-button, .test-card .primary-button { width: 100%; }
  .chart-col small { font-size: 13px; letter-spacing: -.6px; }
  .chart-col:nth-child(even) small { visibility: hidden; }
}

body.dark-mode .main-content :is(.status-pill, .confidence-picker span, .hint-box, .chart-bar b, .badge-card, .test-card-main > strong, .week-chart figcaption, .progress-block h3, .progress-block summary, #errorList h3, #assessmentHistory h3, .mastery-row strong, .exercise-position strong) { color: #e6e9f2; }
body.dark-mode .main-content .confidence-picker span { border-color: #414b68; }
body.dark-mode .main-content .confidence-picker input:checked + span { color: #fff; border-color: #7f89f0; background: #4b55cf; }
body.dark-mode .main-content :is(.student-picker select, .reference-toolbar input, .reference-toolbar select) { color: #e6e9f2; }
body.dark-mode .main-content .reference-bank .glossary-card :is(strong, span) { color: #e6e9f2; }
body.dark-mode .main-content .reference-bank .glossary-card small { color: var(--muted); }
body.dark-mode .main-content .week-chart { border-color: #30384f; }

body.dark-mode .main-content .error-item strong { color: #e6e9f2; }
body.dark-mode .main-content .class-card.active em { color: #ffbab2; }

.progress-picker { display: flex; flex-wrap: wrap; gap: 0 14px; }
.progress-picker .student-picker { flex: 1 1 220px; max-width: 340px; }

/* Багшийн "Үнэлгээний төв" */
:root { --level-good: #12805b; --level-good-ink: #fff; --level-ok: #c7ebd9; --level-developing: #fbe0a0; --level-attention: #f6c0b4; --level-none: #f0f1f6; --level-ink: #18213a; }
.classroom-views { margin-bottom: 18px; }
.center-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.center-head h3 { margin: 4px 0; color: var(--ink); font-size: 24px; line-height: 1.3; }
.center-head p { margin: 0; color: var(--muted); font-size: 14px; }
.center-filters { display: grid; grid-template-columns: repeat(auto-fit,minmax(190px,1fr)); gap: 12px; padding: 14px; }
.center-filters label, .center-report > label, .quarter-grid label { display: grid; gap: 6px; min-width: 0; color: var(--muted); font-size: 13px; font-weight: 700; }
.center-filters select, .center-report select, .quarter-grid input { width: 100%; min-width: 0; min-height: 42px; padding: 0 10px; color: var(--ink); border: 1px solid #cfd6e6; border-radius: 10px; background: #fff; font-size: 14px; }
.center-details { padding: 12px 14px; }
.center-details summary { color: var(--ink); cursor: pointer; font-size: 14px; font-weight: 700; }
.center-details > :not(summary) { margin-top: 12px; }
.center-details ul { display: grid; gap: 6px; padding-left: 18px; font-size: 14px; }
.quarter-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(180px,1fr)); gap: 10px; }
.quarter-grid fieldset { display: grid; gap: 8px; min-width: 0; margin: 0; padding: 10px; border: 1px solid var(--line); border-radius: 10px; }
.quarter-grid legend { padding: 0 4px; color: var(--ink); font-size: 13px; font-weight: 700; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.center-kpis { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; margin-bottom: 13px; }
.center-kpi { display: grid; align-content: start; gap: 6px; min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.center-kpi > span { color: var(--muted); font-size: 13px; font-weight: 700; }
.center-kpi strong { color: var(--ink); font-size: 30px; line-height: 1.2; }
.center-kpi strong em { color: var(--muted); font-size: 14px; font-style: normal; font-weight: 600; }
.center-kpi small { color: var(--muted); font-size: 13px; line-height: 1.5; }
.center-kpi.alert { border-color: #e9998a; }
.change { color: var(--muted); font-weight: 700; white-space: nowrap; }
.change.up { color: #0e6b4b; }
.change.down { color: #b03021; }
.center-table-card, .center-risk, .center-report { padding: 16px; }
.center-table-card h3, .center-risk h3, .center-report h3 { margin: 0 0 6px; color: var(--ink); font-size: 17px; }
.center-table-card p { margin: 0 0 8px; font-size: 14px; }
.main-content .center-legend { display: flex; flex-wrap: wrap; gap: 8px; }
.level-key, .level-cell { color: var(--level-ink); border: 0; border-radius: 7px; font-size: 13px; font-weight: 700; }
.level-key { padding: 3px 10px; }
.level-cell { display: inline-block; box-sizing: border-box; min-width: 54px; padding: 7px 6px; font-family: inherit; text-align: center; }
button.level-cell { cursor: pointer; }
button.level-cell:hover, button.level-cell:focus-visible { outline: 2px solid #4b55cf; outline-offset: 1px; }
.level-good { color: var(--level-good-ink); background: var(--level-good); }
.level-ok { background: var(--level-ok); }
.level-developing { background: var(--level-developing); }
.level-attention { background: var(--level-attention); }
.level-none { color: #4d576e; background: var(--level-none); }
.center-scroll { max-width: 100%; }
.center-table { width: 100%; min-width: 0; border-collapse: collapse; font-size: 14px; }
.center-table td:nth-child(n) { min-width: 0; color: var(--ink); font-weight: 500; vertical-align: middle; }
.center-table tr > :first-child { width: 1%; }
body.dark-mode .center-table td:nth-child(n) { color: #e6e9f2; }
.center-table :is(th, td) { padding: 7px 6px; text-align: center; }
.center-table .student-col { min-width: 130px; text-align: left; }
.center-table tbody th { color: var(--ink); background: #fff; font-size: 14px; }
.center-table tbody .student-col { position: sticky; left: 0; z-index: 1; }
.center-table tfoot :is(th, td) { color: var(--ink); border-top: 2px solid var(--line); font-weight: 800; }
.center-table-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; font-size: 13px; }
.center-bottom { display: grid; grid-template-columns: minmax(0,1.15fr) minmax(0,1fr); gap: 13px; align-items: start; }
.risk-item { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; padding: 12px; border-left: 4px solid #d9604c; border-radius: 9px; background: #fff3f1; }
.risk-item.falling { border-left-color: #eeb020; background: #fff8e8; }
.risk-item > div { display: grid; flex: 1 1 200px; gap: 3px; }
.risk-item strong { color: var(--level-ink); font-size: 15px; }
.risk-item span { color: #4d576e; font-size: 13px; }
.center-report fieldset { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; padding: 0; border: 0; }
.center-report legend { margin-bottom: 6px; color: var(--muted); font-size: 13px; font-weight: 700; }
.scope-choice span { display: inline-block; padding: 9px 14px; color: var(--ink); border: 1px solid #cfd6e6; border-radius: 10px; cursor: pointer; font-size: 14px; }
.scope-choice { position: relative; }
.scope-choice input { position: absolute; opacity: 0; }
.scope-choice input:checked + span { color: #fff; border-color: #4b55cf; background: #4b55cf; }
.scope-choice input:focus-visible + span { outline: 2px solid #4b55cf; outline-offset: 2px; }
.scope-choice input:disabled + span { opacity: .5; cursor: default; }
.center-report .report-parts { display: grid; grid-template-columns: repeat(auto-fit,minmax(190px,1fr)); }
.report-parts label { display: flex; align-items: center; gap: 8px; color: var(--ink); font-size: 14px; }
.report-buttons { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0 8px; }
.center-report > small { display: block; font-size: 13px; }
.main-content .center-dialog, .center-dialog { width: min(560px,calc(100% - 32px)); max-height: calc(100vh - 40px); }
.center-dialog .dialog-card { max-height: calc(100vh - 40px); overflow: auto; }
.objective-results { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.objective-results li { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 4px 10px; align-items: center; padding-bottom: 10px; border-bottom: 1px solid var(--line); font-size: 14px; }
.objective-results li > div { display: grid; gap: 2px; }
.objective-results small { grid-column: 1 / -1; color: var(--muted); font-size: 13px; }
body.dark-mode { --level-none: #2a3249; }
body.dark-mode .level-none { color: #c9d0e0; }
body.dark-mode :is(.center-kpi, .center-table tbody th) { border-color: #30384f; background: #1b2131; }
body.dark-mode :is(.center-head h3, .center-kpi strong, .center-details summary, .quarter-grid legend, .center-table-card h3, .center-risk h3, .center-report h3, .center-table tbody th, .center-table tfoot th, .center-table tfoot td, .scope-choice span, .report-parts label) { color: #e6e9f2; }
body.dark-mode :is(.center-filters select, .center-report select, .quarter-grid input) { color: #e6e9f2; border-color: #414b68; background: #1e2538; }
body.dark-mode .scope-choice span { border-color: #414b68; }
body.dark-mode .scope-choice input:checked + span { color: #fff; }
body.dark-mode .risk-item { background: #36262c; }
body.dark-mode .risk-item.falling { background: #352f22; }
body.dark-mode .risk-item strong { color: #f1f3f9; }
body.dark-mode .risk-item span { color: #d3d8e6; }
body.dark-mode .change.up { color: #7fdcb4; }
body.dark-mode .change.down { color: #ffab9e; }
@media (max-width: 1100px) { .center-kpis { grid-template-columns: repeat(2,minmax(0,1fr)); } .center-bottom { grid-template-columns: minmax(0,1fr); } }
@media (max-width: 760px) {
  .center-head .primary-button, .report-buttons > * { width: 100%; }
  .center-kpi { padding: 12px; }
  .center-kpi strong { font-size: 24px; }
  .center-table .student-col { min-width: 108px; }
}
.center-dialog .eyebrow.muted-eyebrow { color: #4b46a8; }
body.dark-mode .center-dialog .eyebrow.muted-eyebrow { color: #c1c9ff; }
body.dark-mode .center-kpi .inline-button { color: #aab5ff; }
.main-content .class-tab.active b { color: #fff; background: #2f37a8; }

/* Үнэлгээний төвийн PDF */
.center-print .print-head { display: flex; flex-wrap: wrap; gap: 6px 24px; padding-bottom: 8px; border-bottom: 2px solid #333; }
.center-print h3 { margin: 16px 0 4px; font-size: 14px; } .center-print h2, .center-print h3 { break-after: avoid; }
.center-print table { min-width: 0; }
.center-print th, .center-print td:nth-child(n) { min-width: 0; padding: 4px 6px; color: #000; font-size: 12px; font-weight: 400; vertical-align: middle; }
.center-print th { background: #eef0f6; font-weight: 700; letter-spacing: 0; }
.center-print tr > :first-child { width: 1%; white-space: nowrap; }
.center-print thead { display: table-header-group; }
.center-print tr { break-inside: avoid; }
.center-print :is(.level-good, .level-ok, .level-developing, .level-attention) { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.center-print td.level-good:nth-child(n) { color: #fff; background: #12805b; }
.center-print :is(.level-ok, .level-developing, .level-attention) { color: #000; }
.center-print .level-ok { background: #c7ebd9; }
.center-print .level-developing { background: #fbe0a0; }
.center-print .level-attention { background: #f6c0b4; }
.print-note { font-size: 12px; line-height: 1.5; }
.print-approve { margin-top: 36px; font-size: 14px; font-weight: 700; break-inside: avoid; }

/* Зөвшөөрөл хүлээж буй бүртгэл */
.registration-box { margin-bottom: 16px; }
.registration-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.registration-box ul { list-style: none; margin: 0; padding: 0; }
.registration-box li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; padding: 10px 0; border-top: 1px solid #8886; }
.registration-box li small { display: block; font-size: 13.5px; }
.registration-actions { display: flex; gap: 8px; }

/* Сурах бичиг */
#textbookForm { margin-bottom: 16px; }
.textbook-list { display: grid; gap: 12px; }
.textbook-card { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding: 16px 18px; border: 1px solid #8884; border-radius: 14px; }
.textbook-card h3 { margin: 0; overflow-wrap: anywhere; }
.textbook-card small { font-size: 13.5px; overflow-wrap: anywhere; }
.textbook-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* Холбоо барих */
#contactForm { margin-bottom: 16px; }
.contact-list { display: grid; gap: 14px; margin: 0; }
.contact-list div { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 12px; }
.contact-list dt { font-weight: 700; }
.contact-list dd { margin: 0; white-space: pre-line; overflow-wrap: anywhere; }
.contact-list a { text-decoration: underline; }
@media (max-width: 560px) { .contact-list div { grid-template-columns: 1fr; gap: 2px; } }

/* Ангийн баннер */
.grade-banner { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); align-items: center; gap: 16px 24px; padding: 18px; margin-bottom: 0; border: 2px solid var(--il-pink); border-radius: 18px; background: var(--il-pink-light); }
.grade-banner[hidden] { display: none; }
.grade-banner-text h2 { margin: 0 0 8px; color: var(--il-olive-dark); font-size: clamp(22px, 2.6vw, 32px); line-height: 1.2; overflow-wrap: anywhere; }
.grade-banner-text p { margin: 0; color: var(--il-olive-dark); font-size: clamp(15px, 1.4vw, 18px); }
.grade-banner-art { width: 100%; max-width: 440px; justify-self: end; aspect-ratio: 16 / 9; transition: opacity .18s ease; }
.grade-banner-art.fading { opacity: 0; }
.grade-banner-art svg { display: block; width: 100%; height: 100%; font-family: inherit; }
@media (max-width: 760px) { .grade-banner { grid-template-columns: minmax(0, 1fr); padding: 12px; } .grade-banner-art { justify-self: center; } }
@media (prefers-reduced-motion: reduce) { .grade-banner-art { transition: none; } }

/* Ангийн картууд: баннерын доорх анги сонгох товчнууд */
.grade-cards { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)) minmax(0, 2fr); gap: 8px; }
.main-content .grade-card, .grade-card { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 4px; min-width: 0; padding: 10px 6px; border: 2px solid transparent; border-radius: 14px; background: #fff; color: var(--il-olive-dark); font: inherit; text-align: center; cursor: pointer; }
.grade-card:hover { border-color: var(--il-pink); }
.main-content .grade-card[aria-pressed="true"], .grade-card[aria-pressed="true"] { border-color: var(--il-olive-dark); background: var(--il-olive); color: #fff; }
.grade-card:focus-visible { outline: 3px solid var(--il-olive-dark); outline-offset: 2px; }
.grade-card strong { font-size: 15px; }
.grade-card small { font-size: 13px; line-height: 1.25; overflow-wrap: anywhere; }
.grade-card-icons { display: flex; justify-content: center; gap: 6px; width: 100%; height: 56px; }
.grade-card-icons > span { width: 56px; max-width: 100%; height: 56px; }
.grade-card-icons svg, .class-icon svg { display: block; width: 100%; height: 100%; font-family: inherit; }
.class-icon, .teacher-class header span.class-icon { flex: 0 0 44px; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 0; background: none; }
@media (max-width: 1100px) { .grade-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); } .grade-card.wide { grid-column: span 2; } }
@media (max-width: 480px) { .grade-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; } .grade-card.wide { grid-column: span 3; } .main-content .grade-card, .grade-card { padding: 8px 2px; } .grade-card strong { white-space: nowrap; font-size: 14px; } .grade-card small { font-size: 12.5px; } .grade-card-icons { height: 48px; gap: 4px; } .grade-card-icons > span { width: 48px; height: 48px; } }

/* Симуляцийн тоглоомын дүрсүүд */
.sim-icon { display: block; flex: 0 0 auto; width: 72px; height: 72px; }
.sim-icon svg { display: block; width: 100%; height: 100%; font-family: inherit; }
.main-content .joystick-button, .joystick-button { display: inline-flex; align-items: center; gap: 8px; min-height: 52px; padding: 4px 18px 4px 8px; border: 2px solid var(--il-olive-dark); border-radius: 16px; background: var(--il-olive); color: #fff; font: inherit; font-size: 16px; font-weight: 700; cursor: pointer; }
.joystick-button .sim-icon { width: 40px; height: 40px; }
.joystick-button:focus-visible { outline: 3px solid var(--il-olive-dark); outline-offset: 2px; }
.sim-themes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.sim-theme { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; padding: 14px 10px; border: 2px solid var(--il-pink); border-radius: 14px; background: var(--il-pink-light); color: var(--il-olive-dark); text-align: center; }
.sim-theme .sim-icon { width: 96px; height: 96px; }
.sim-theme h3 { margin: 0; color: var(--il-olive-dark); font-size: 16px; line-height: 1.3; }
body.dark-mode .sim-theme h3 { color: var(--il-olive-dark); }
.sim-theme p { margin: 0; font-size: 14px; }
.sim-theme-action { display: flex; flex: 1; align-items: flex-end; justify-content: center; min-height: 44px; }
.sim-theme small { font-size: 13px; line-height: 1.35; }
@media (max-width: 900px) { .sim-themes { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ЭЕШ-ын чимэглэл, шагнал, урамшуулал */
.sim-theme-action { flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; }
.section-art { display: flex; gap: 10px; }
.section-art .sim-icon { width: 64px; height: 64px; }
.award-icon { display: inline-block; width: 28px; height: 28px; margin-right: 6px; vertical-align: middle; }
.award-icon svg { display: block; width: 100%; height: 100%; }
.leader-title .award-icon { width: 36px; height: 36px; }
.badge-pill .award-icon { width: 22px; height: 22px; }
.cheer { display: flex; align-items: center; gap: 12px; margin: 10px 0; padding: 10px 14px; border: 2px solid var(--il-olive); border-radius: 14px; background: var(--il-cream); color: var(--il-olive-dark); }
.cheer strong { color: var(--il-olive-dark); font-size: 18px; }
.cheer-try { border-color: var(--il-pink); background: var(--il-pink-light); }
body.dark-mode .cheer strong { color: var(--il-olive-dark); }
.cheer .sim-icon { width: 104px; height: 104px; }
.cheer .confetti { transform-origin: 100px 100px; }
.cheer .cheer-star { transform-box: fill-box; transform-origin: center; }
.empty-mascot { display: flex; flex-direction: column; align-items: center; gap: 10px; grid-column: 1 / -1; text-align: center; }
.empty-mascot .sim-icon { width: 128px; height: 128px; }
.empty-mascot p { margin: 0; }
.empty-mascot.hidden { display: none; }
@media (prefers-reduced-motion: no-preference) {
  .cheer-ok .cheer-star { animation: cheer-pop .6s ease-out both; }
  .cheer-ok .confetti { animation: cheer-burst .9s ease-out both; }
  .cheer-try .sim-icon { animation: cheer-nod .5s ease-in-out 2; }
}
@keyframes cheer-pop { 0% { transform: scale(.2) rotate(-40deg); } 70% { transform: scale(1.15) rotate(8deg); } 100% { transform: none; } }
@keyframes cheer-burst { 0% { transform: scale(.3); opacity: 0; } 100% { transform: none; opacity: 1; } }
@keyframes cheer-nod { 50% { transform: translateY(-6px); } }

/* ---- Тод хавтгай өнгө ---- */
body { --base: var(--surface); --shade: #000000; }
body.dark-mode { --shade: #ffffff; }
body, body:not(.dark-mode), body.dark-mode { background: var(--page); }

/* Хажуугийн цэс: тод хавтгай дэвсгэр, цэс бүр өөрийн өнгийн дүрстэй, идэвхтэй мөр цагаан */
body:not(.dark-mode) .sidebar, body.dark-mode .sidebar { color: var(--side-ink); border-color: transparent; background: var(--side-bg); scrollbar-width: thin; scrollbar-color: #ffffff59 transparent; }
body .sidebar .brand-name strong, body .sidebar .profile-button strong { color: var(--side-ink); }
body .sidebar .brand-name small, body .sidebar .profile-button small, body .sidebar .more-icon { color: #e9ddff; }
body .sidebar .brand-mark { color: #2e1065; background: var(--sun); box-shadow: none; }
body .sidebar .side-nav, body .sidebar .profile-button { border-color: var(--side-line); }
body .sidebar .sidebar-label, body.dark-mode .sidebar .sidebar-label { color: var(--side-muted); border-color: var(--side-line); font-weight: 400; letter-spacing: 0; text-transform: none; }
body .sidebar .nav-link, body.dark-mode .sidebar .nav-link { color: var(--side-ink); background: transparent; box-shadow: none; padding-top: 5px; padding-bottom: 5px; }
body .sidebar .nav-link:hover, body.dark-mode .sidebar .nav-link:hover { background: var(--side-hover); }
body .sidebar .nav-link .nav-icon, body.dark-mode .sidebar .nav-link .nav-icon { width: 22px; height: 22px; flex-basis: 22px; border-radius: 7px; color: #1e1147; background: var(--chip, #ffd60a); font-size: 14px; line-height: 1; }
body .sidebar .nav-link.active, body.dark-mode .sidebar .nav-link.active { color: #2e1065; background: #fff; font-weight: 800; }
body .sidebar .nav-link:focus-visible { outline: 3px solid var(--sun); outline-offset: -1px; }
.nav-link[href="#home"] { --chip: #ffd60a; } .nav-link[href="#curriculum"] { --chip: #6ee7f9; } .nav-link[href="#learning"] { --chip: #86efac; }
.nav-link[href="#textbooks"] { --chip: #93c5fd; } .nav-link[href="#exercises"] { --chip: #fdba74; } .nav-link[href="#simulations"] { --chip: #f9a8d4; }
.nav-link[href="#tests"] { --chip: #fda4af; } .nav-link[href="#eesh"] { --chip: #fcd34d; } .nav-link[href="#ai"] { --chip: #c4b5fd; }
.nav-link[href="#chat"] { --chip: #7dd3fc; } .nav-link[href="#contact"] { --chip: #5eead4; } .nav-link[href="#classroom"] { --chip: #bef264; }
.nav-link[href="#progress"] { --chip: #f0abfc; } .nav-link[href="#formulaReference"] { --chip: #d8b4fe; } .nav-link[href="#glossaryReference"] { --chip: #6ee7b7; }
.nav-link[href="#assessment"] { --chip: #fb923c; }
@media (min-width: 761px) and (max-height: 980px) {
  body .sidebar .nav-link, body.dark-mode .sidebar .nav-link { padding-top: 2px; padding-bottom: 2px; font-size: 14px; line-height: 19px; }
  body .sidebar .sidebar-label { margin-top: 2px; padding-top: 2px; }
}

/* Нэг баннер: анги бүр өөрийн тод хавтгай өнгөтэй */
#gradeBanner { --banner: #0e7490; --il-cream: #fff6d1; border: 0; background: var(--banner); box-shadow: none; }
#gradeBanner[data-banner="6"] { --banner: #d1450c; --il-cream: #ffebdd; }
#gradeBanner[data-banner="7"] { --banner: #1d64d8; --il-cream: #e0f5ff; }
#gradeBanner[data-banner="8"] { --banner: #7c3aed; --il-cream: #f5e8ff; }
#gradeBanner[data-banner="9"] { --banner: #047857; --il-cream: #defbec; }
#gradeBanner[data-banner="10"] { --banner: #c2410c; --il-cream: #fff2cc; }
#gradeBanner[data-banner="11"] { --banner: #d0246f; --il-cream: #ffe6f3; }
#gradeBanner[data-banner="12"] { --banner: #4f46e5; --il-cream: #ebeaff; }
#gradeBanner .grade-banner-text h2, #gradeBanner .grade-banner-text p { color: #fff; }
#gradeBanner .grade-banner-art svg { border-radius: 14px; }
#gradeCards .grade-card { --il-cream: #fff9e6; color: #1f2433; background: color-mix(in srgb, var(--hue) 13%, #fff); border: 2px solid transparent; border-bottom: 5px solid var(--hue); }
#gradeCards .grade-card:hover { border-color: var(--hue); transform: translateY(-2px); }
#gradeCards .grade-card[aria-pressed="true"] { color: #fff; background: var(--hue); border-color: var(--hue); }
#gradeCards .grade-card:focus-visible { outline: 3px solid var(--hue); outline-offset: 2px; }
[data-grade-card="6"] { --hue: #d1450c; }
[data-grade-card="7"] { --hue: #1d64d8; }
[data-grade-card="8"] { --hue: #7c3aed; }
[data-grade-card="9"] { --hue: #047857; }
[data-grade-card="10"] { --hue: #c2410c; }
[data-grade-card="11"] { --hue: #d0246f; }
[data-grade-card="12"] { --hue: #4f46e5; }
@media (prefers-reduced-motion: reduce) { #gradeCards .grade-card:hover { transform: none; } }

/* Хуудас бүрийн гарчиг өөрийн өнгөтэй */
#curriculum { --accent: var(--violet); } #exercises { --accent: var(--orange-deep); } #simulations { --accent: var(--pink); }
#contact { --accent: var(--teal-deep); } #textbooks { --accent: var(--primary); } #learning { --accent: var(--teal-deep); }
#formulaReference { --accent: var(--violet); } #glossaryReference { --accent: var(--green); } #ai { --accent: var(--primary); }
#chat { --accent: var(--sky); } #eesh { --accent: var(--amber); } #tests { --accent: var(--pink); }
#classroom { --accent: var(--green); } #assessment { --accent: var(--pink); } #progress { --accent: var(--violet); }
.main-content > .content-section, body.dark-mode .main-content > .content-section { border: 1px solid var(--border); border-top: 6px solid var(--accent, var(--primary)); background: var(--surface); box-shadow: none; }
.main-content .content-section .section-heading { padding: 16px 18px; border: 0; border-left: 8px solid var(--accent, var(--primary)); border-radius: 14px; background: color-mix(in srgb, var(--accent, var(--primary)) 13%, var(--surface)); }
body.dark-mode .main-content .content-section .section-heading { background: color-mix(in srgb, var(--accent, var(--primary)) 26%, var(--surface)); }
.main-content .content-section .section-heading .eyebrow { color: color-mix(in srgb, var(--accent, var(--primary)) 68%, #000); }
body.dark-mode .main-content .content-section .section-heading .eyebrow { color: color-mix(in srgb, var(--accent, var(--primary)) 40%, #fff); }

/* Картууд ээлжлэн өнгөтэй */
.chapter-card:nth-child(6n+1), .exercise-card:nth-child(6n+1), .simulation-card:nth-child(6n+1), .home-stat:nth-child(6n+1), .teacher-class:nth-child(6n+1) { --hue: var(--violet); }
.chapter-card:nth-child(6n+2), .exercise-card:nth-child(6n+2), .simulation-card:nth-child(6n+2), .home-stat:nth-child(6n+2), .teacher-class:nth-child(6n+2) { --hue: var(--pink); }
.chapter-card:nth-child(6n+3), .exercise-card:nth-child(6n+3), .simulation-card:nth-child(6n+3), .home-stat:nth-child(6n+3), .teacher-class:nth-child(6n+3) { --hue: var(--orange-deep); }
.chapter-card:nth-child(6n+4), .exercise-card:nth-child(6n+4), .simulation-card:nth-child(6n+4), .home-stat:nth-child(6n+4), .teacher-class:nth-child(6n+4) { --hue: var(--green); }
.chapter-card:nth-child(6n+5), .exercise-card:nth-child(6n+5), .simulation-card:nth-child(6n+5), .home-stat:nth-child(6n+5), .teacher-class:nth-child(6n+5) { --hue: var(--sky); }
.chapter-card:nth-child(6n), .exercise-card:nth-child(6n), .simulation-card:nth-child(6n), .home-stat:nth-child(6n), .teacher-class:nth-child(6n) { --hue: var(--amber); }
.main-content .chapter-card { border-left: 6px solid var(--hue); }
.main-content .chapter-card .chapter-number { color: #fff; background: color-mix(in srgb, var(--hue) 80%, #000); }
.main-content .exercise-card, .main-content .simulation-card, .main-content .teacher-class { border-top: 5px solid var(--hue); }
.main-content .simulation-card { background: color-mix(in srgb, var(--hue) 8%, var(--surface)); }
.main-content .home-stat { border: 0; border-bottom: 5px solid var(--hue); background: color-mix(in srgb, var(--hue) 13%, var(--surface)); }
.main-content .home-stat strong { color: color-mix(in srgb, var(--hue) 75%, #000); }
body.dark-mode .main-content .home-stat strong { color: color-mix(in srgb, var(--hue) 35%, #fff); }
.main-content .home-card { border-top: 5px solid var(--primary); }
.main-content .home-card.home-today { border-top-color: var(--orange-deep); }
.main-content .home-card.home-journey { border-top-color: var(--green); }
.main-content .home-columns .home-card:last-child { border-top-color: var(--pink); }

/* Симуляцийн сэдэв бүр өөр өнгөтэй */
[data-sim-theme="rocket"] { --hue: var(--primary); } [data-sim-theme="basketball"] { --hue: var(--orange-deep); }
[data-sim-theme="bank"] { --hue: var(--green); } [data-sim-theme="speed"] { --hue: var(--pink); }
.main-content .sim-theme { border-color: var(--hue); color: #1f2433; background: color-mix(in srgb, var(--hue) 16%, #fff); }
.main-content .sim-theme h3, body.dark-mode .main-content .sim-theme h3 { color: color-mix(in srgb, var(--hue) 70%, #000); }

/* Гол товч */
.main-content .primary-button, .main-content .primary-button.action-button, .dialog-card .primary-button { color: var(--on-primary); background: var(--primary); }
.main-content .primary-button:hover, .dialog-card .primary-button:hover { background: var(--violet); }

/* Хуудсуудын дотор тал: тухайн хуудасны өнгө */
.main-content .content-section .page-tabs { border-bottom-color: color-mix(in srgb, var(--accent, var(--primary)) 30%, transparent); }
.main-content .content-section .page-tabs button.active { color: color-mix(in srgb, var(--accent, var(--primary)) 62%, var(--shade)); border-bottom-color: var(--accent, var(--primary)); border-radius: 10px 10px 0 0; background: color-mix(in srgb, var(--accent, var(--primary)) 15%, var(--surface)); }
.main-content .content-section .filter-button { color: color-mix(in srgb, var(--accent, var(--primary)) 58%, var(--shade)); border-color: color-mix(in srgb, var(--accent, var(--primary)) 45%, transparent); background: color-mix(in srgb, var(--accent, var(--primary)) 9%, var(--surface)); }
.main-content .content-section .filter-button:hover { background: color-mix(in srgb, var(--accent, var(--primary)) 20%, var(--surface)); }
.main-content .content-section :is(.platform-card, .assessment-work, .learning-feature-card, .lesson-detail, .reference-bank) { border: 1px solid color-mix(in srgb, var(--accent, var(--primary)) 25%, transparent); border-top: 5px solid var(--accent, var(--primary)); background: color-mix(in srgb, var(--accent, var(--primary)) 4%, var(--surface)); }
.main-content .content-section :is(.platform-card, .test-heading, .learning-feature-card) h3 { color: color-mix(in srgb, var(--accent, var(--primary)) 52%, var(--shade)); }
.main-content .content-section table th { color: color-mix(in srgb, var(--accent, var(--primary)) 48%, var(--shade)); background: color-mix(in srgb, var(--accent, var(--primary)) 16%, var(--surface)); }
.main-content .content-section :is(input, select, textarea):focus { border-color: var(--accent, var(--primary)); }
.main-content .criterion-pill { color: color-mix(in srgb, var(--accent, var(--primary)) 55%, var(--shade)); background: color-mix(in srgb, var(--accent, var(--primary)) 12%, var(--surface)); }
body.dark-mode .footer-brand, body.dark-mode .main-content .inline-button, body.dark-mode .main-content .source-pill.teacher-note { color: #c7d2fe; }
body.dark-mode .main-content .source-pill.teacher-note { background: var(--soft); }

/* Жагсаалтын картууд ээлжлэн өнгөтэй */
:is(.formula-card, .glossary-card, .textbook-card, .test-card, .lesson-media-item, .student-metric, .lesson-block, .class-row, .leader-row):nth-of-type(6n+1) { --hue: var(--violet); }
:is(.formula-card, .glossary-card, .textbook-card, .test-card, .lesson-media-item, .student-metric, .lesson-block, .class-row, .leader-row):nth-of-type(6n+2) { --hue: var(--pink); }
:is(.formula-card, .glossary-card, .textbook-card, .test-card, .lesson-media-item, .student-metric, .lesson-block, .class-row, .leader-row):nth-of-type(6n+3) { --hue: var(--orange-deep); }
:is(.formula-card, .glossary-card, .textbook-card, .test-card, .lesson-media-item, .student-metric, .lesson-block, .class-row, .leader-row):nth-of-type(6n+4) { --hue: var(--green); }
:is(.formula-card, .glossary-card, .textbook-card, .test-card, .lesson-media-item, .student-metric, .lesson-block, .class-row, .leader-row):nth-of-type(6n+5) { --hue: var(--sky); }
:is(.formula-card, .glossary-card, .textbook-card, .test-card, .lesson-media-item, .student-metric, .lesson-block, .class-row, .leader-row):nth-of-type(6n) { --hue: var(--amber); }
.main-content :is(.formula-card, .glossary-card, .textbook-card, .test-card, .lesson-media-item, .student-metric) { border: 1px solid color-mix(in srgb, var(--hue) 30%, transparent); border-left: 6px solid var(--hue); background: color-mix(in srgb, var(--hue) 8%, var(--base)); }
.main-content .lesson-block { border-left: 5px solid var(--hue); padding-left: 14px; border-radius: 10px; background: color-mix(in srgb, var(--hue) 7%, var(--base)); }
.main-content :is(.class-row, .leader-row) { padding-left: 10px; padding-right: 10px; border-left: 4px solid var(--hue); background: color-mix(in srgb, var(--hue) 7%, var(--base)); }
.learning-chapters > .learning-chapter:nth-of-type(6n+1), .tree-chapter:nth-of-type(6n+1) { --hue: var(--violet); }
.learning-chapters > .learning-chapter:nth-of-type(6n+2), .tree-chapter:nth-of-type(6n+2) { --hue: var(--pink); }
.learning-chapters > .learning-chapter:nth-of-type(6n+3), .tree-chapter:nth-of-type(6n+3) { --hue: var(--orange-deep); }
.learning-chapters > .learning-chapter:nth-of-type(6n+4), .tree-chapter:nth-of-type(6n+4) { --hue: var(--green); }
.learning-chapters > .learning-chapter:nth-of-type(6n+5), .tree-chapter:nth-of-type(6n+5) { --hue: var(--sky); }
.learning-chapters > .learning-chapter:nth-of-type(6n), .tree-chapter:nth-of-type(6n) { --hue: var(--amber); }
.main-content .learning-chapter { border: 1px solid color-mix(in srgb, var(--hue, var(--primary)) 32%, transparent); border-left: 6px solid var(--hue, var(--primary)); color: color-mix(in srgb, var(--hue, var(--primary)) 45%, var(--shade)); background: color-mix(in srgb, var(--hue, var(--primary)) 8%, var(--base)); }
.main-content .learning-chapter.selected { border-color: var(--hue, var(--primary)); background: color-mix(in srgb, var(--hue, var(--primary)) 22%, var(--base)); box-shadow: 0 6px 16px color-mix(in srgb, var(--hue, var(--primary)) 25%, transparent); }
.main-content .learning-chapter strong { color: inherit; }

/* ---- Нэг баннер: зүүнд мэндчилгээ ба сэдэв, баруунд хөдөлгөөнт зураг ---- */
#homeBoard { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
#gradeBanner { position: relative; grid-template-columns: minmax(0, 1fr) minmax(0, 444px); min-height: 270px; margin: 0; padding: 18px 22px; }
#gradeBanner .grade-banner-text { display: grid; align-content: center; gap: 8px; min-width: 0; }
#gradeBanner .grade-banner-text h2 { margin: 0; font-size: clamp(21px, 2.3vw, 29px); }
#gradeBanner .grade-banner-text p { margin: 0; font-size: 15px; line-height: 1.45; }
.hero-greet { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.hero-portrait { display: grid; flex: 0 0 auto; width: 60px; height: 60px; place-items: center; object-fit: cover; object-position: center 35%; border: 3px solid #fff; border-radius: 50%; color: #fff; background: #ffffff33; font-size: 22px; font-weight: 800; }
#gradeBanner .grade-banner-text .hero-hello { margin: 0 0 5px; font-size: 18px; font-weight: 800; overflow-wrap: anywhere; }
.home-facts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.home-school-logo { width: 28px; height: 28px; padding: 2px; object-fit: contain; border-radius: 8px; background: #fff; }
.home-fact { padding: 4px 10px; border-radius: 999px; color: #fff; background: #00000038; font-size: 13px; font-weight: 700; }
#gradeBanner .grade-banner-art { max-width: 100%; transition: opacity .35s ease; }
.hero-pause[hidden] { display: none; }
.grade-banner-art svg text { font-variant-numeric: tabular-nums; }
#gradeCards .grade-card { gap: 2px; padding: 7px 4px; }
#gradeCards .grade-card-icons { height: 36px; }
#gradeCards .grade-card-icons > span { width: 36px; height: 36px; }
@media (max-width: 860px) { #gradeBanner { grid-template-columns: minmax(0, 1fr); min-height: 0; padding: 14px 14px 46px; } #gradeBanner .grade-banner-frame { justify-self: center; } }
@media (prefers-reduced-motion: reduce) { #gradeBanner .grade-banner-art { transition: none; } }
@media (max-width: 480px) {
  #gradeCards { display: flex; gap: 6px; overflow-x: auto; scroll-snap-type: x proximity; padding-bottom: 4px; }
  #gradeCards .grade-card { flex: 0 0 96px; scroll-snap-align: start; }
  #gradeCards .grade-card.wide { flex-basis: 150px; }
  .hero-portrait { width: 48px; height: 48px; }
}

/* "Зогсоох" товч зургийн хүрээний дотор, баруун доод буланд */
.grade-banner-frame { position: relative; width: 100%; max-width: 444px; justify-self: end; align-self: center; }
.grade-banner-frame .grade-banner-art { display: block; }
.hero-pause { position: absolute; right: 6px; bottom: 5px; min-height: 26px; padding: 1px 9px; color: #fff; border: 1px solid #ffffffb3; border-radius: 999px; background: #000000b3; font-size: 13px; font-weight: 700; line-height: 1.4; cursor: pointer; }
.hero-pause:focus-visible { outline: 3px solid var(--primary); outline-offset: 1px; }

/* Нэг "Засах" товч ба цэс (баннерын баруун дээд булан) */
.hero-edit { position: absolute; top: 8px; right: 8px; z-index: 5; }
.hero-edit-toggle { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 3px 13px; color: #1f2433; border: 0; border-radius: 999px; background: #fff; box-shadow: 0 3px 10px #0000004d; font-size: 14px; font-weight: 700; cursor: pointer; }
.hero-edit-toggle:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; }
.hero-edit-menu { position: absolute; top: calc(100% + 6px); right: 0; display: grid; width: 252px; max-width: calc(100vw - 48px); padding: 6px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); box-shadow: 0 14px 34px #0000004d; }
.hero-edit-menu[hidden] { display: none; }
.hero-edit-menu button { display: grid; gap: 2px; min-height: 44px; padding: 8px 12px; text-align: left; color: #1f2433; border: 0; border-radius: 9px; background: transparent; cursor: pointer; }
.hero-edit-menu small { color: #55607a; font-size: 13px; }
.hero-edit-menu button:hover, .hero-edit-menu button:focus-visible { background: var(--soft); }
body.dark-mode .hero-edit-menu button { color: #eef0fb; }
body.dark-mode .hero-edit-menu small { color: #b4bbdc; }
@media (max-width: 860px) { #gradeBanner { padding-bottom: 14px; } #gradeBanner .hero-greet { padding-right: 92px; } }

/* Серверийн холболтын цэг */
.server-state { position: relative; display: inline-grid; width: 32px; height: 32px; flex: 0 0 32px; place-items: center; padding: 0; border: 0; border-radius: 50%; background: transparent; cursor: help; }
.server-state.hidden { display: none; }
.server-dot { width: 12px; height: 12px; border-radius: 50%; background: #9aa1b5; box-shadow: 0 0 0 4px #9aa1b533; }
.server-state[data-state="ok"] .server-dot { background: #12a150; box-shadow: 0 0 0 4px #12a15033; }
.server-state[data-state="down"] .server-dot { background: #e5342b; box-shadow: 0 0 0 4px #e5342b33; }
.server-tip { position: absolute; top: calc(100% + 6px); right: -6px; z-index: 30; display: none; width: max-content; max-width: 240px; padding: 6px 10px; color: #fff; border-radius: 8px; background: #1f2433; font-size: 13px; font-weight: 600; }
.server-state:hover .server-tip, .server-state:focus-visible .server-tip { display: block; }
.server-state:focus-visible { outline: 3px solid var(--primary); }

/* Цэс урт үед профайл доод талдаа үргэлж харагдана */
@media (min-width: 761px) { body .sidebar .sidebar-bottom { position: sticky; bottom: -10px; z-index: 2; flex: 0 0 auto; padding-bottom: 8px; background: var(--side-bg); } }
/* Утасны дээд мөр: товчны бичиг нэг мөрөнд */
@media (max-width: 480px) {
  .topbar .top-actions { gap: 4px; }
  .main-content .topbar #previewToggle, .main-content .topbar .role-switch { padding: 0 7px; font-size: 13px; white-space: nowrap; }
  .server-state { width: 18px; flex-basis: 18px; }
}

/* ===== Өнөөдрийн картууд: баннерын доорх сүлжээ ===== */
.today-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr)); gap: 14px; }
.main-content .day-card { display: flex; flex-direction: column; align-items: stretch; gap: 10px; margin: 0; padding: 16px; border-top-width: 5px; }
.main-content .day-card .home-card-head { margin: 0; }
.main-content .day-card h2 { margin: 0; font-size: 17px; }
.main-content .day-card .home-empty { margin: 0; }
.main-content .day-lesson { border-top-color: var(--primary); }
.main-content .day-tasks { border-top-color: var(--orange-deep); }
.main-content .day-eesh { border-top-color: var(--pink); }
.main-content .day-growth { border-top-color: var(--green); }
.main-content .day-links { border-top-color: var(--violet); }
.main-content .day-card > .day-links { border: 0; }
.main-content .day-card > .home-button { align-self: flex-start; margin-top: auto; }
.day-note { padding: 3px 9px; border-radius: 999px; color: #05603a; background: #d1fadf; font-size: 13px; font-weight: 700; }
.day-topic { margin: 0; font-size: 16px; font-weight: 700; line-height: 1.45; }
.day-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.day-row { display: grid; width: 100%; gap: 2px; min-height: 44px; padding: 9px 12px; text-align: left; color: inherit; border: 1px solid var(--border); border-radius: 12px; background: var(--soft); font-size: 14px; cursor: pointer; }
.day-row:hover { border-color: var(--primary); }
.day-row:focus-visible, .day-link:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
.day-row small { color: var(--muted); font-size: 13px; }
.day-row .day-due { font-weight: 700; }
.day-row .day-due.late { color: #b42318; }
.day-row em { padding: 1px 7px; border-radius: 999px; color: #fff; background: #be185d; font-size: 13px; font-style: normal; }
.day-body { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.day-pair { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
.day-more { align-self: flex-start; margin-top: auto; color: var(--primary); font-size: 14px; font-weight: 700; }
.day-top { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; color: #4a3200; background: #fff1bf; }
.day-top .award-icon { flex: 0 0 40px; width: 40px; height: 40px; margin: 0; }
.day-top small { display: block; font-size: 13px; }
.day-top strong { font-size: 16px; overflow-wrap: anywhere; }
.day-figure { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; margin: 0; }
.day-figure strong { font-size: 32px; line-height: 1.1; }
.day-figure span, .day-hint { margin: 0; color: var(--muted); font-size: 13px; }
.spark { display: block; width: 100%; height: auto; }
.spark-grid { fill: none; stroke: var(--chart-grid); stroke-width: 1; }
.spark-line { fill: none; stroke: var(--chart-series); stroke-width: 2.5; stroke-linecap: round; }
.spark-points circle { fill: var(--chart-series); stroke: var(--surface); stroke-width: 2; }
.spark-axis { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 13px; }
.day-links { display: grid; gap: 8px; }
.day-link { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 6px 12px; border-radius: 12px; background: var(--soft); font-size: 15px; font-weight: 700; }
.day-link span { display: grid; width: 32px; height: 32px; place-items: center; border-radius: 9px; color: #1e1147; background: #c4b5fd; }
.day-link:nth-child(1) span { background: #f9a8d4; }
.day-link:nth-child(3) span { background: #6ee7f9; }
.day-average { display: grid; grid-template-columns: minmax(44px, auto) minmax(0, 1fr) 46px; align-items: center; gap: 10px; font-size: 14px; }
.day-average strong { text-align: right; }
.day-bar { height: 10px; overflow: hidden; border-radius: 999px; background: var(--soft); }
.day-bar i { display: block; height: 100%; border-radius: 999px; background: var(--chart-series); }
.day-averages { max-height: 230px; overflow-y: auto; }
body.dark-mode .day-row .day-due.late { color: #ffaaa0; }
body.dark-mode .day-more { color: #b9c2ff; }
body.dark-mode .day-top { color: #ffe9a8; background: #4a3a10; }
/* 12-р ангийн урт цэс нэг дэлгэцэнд багтана */
@media (min-width: 761px) { body .sidebar .nav-link, body.dark-mode .sidebar .nav-link { height: clamp(24px, calc(5.9vh - 13.5px), 43px); } }
/* Утсан дээр байршлын нэр сонголтын цэстэй давхцахгүй */
@media (max-width: 480px) { .topbar .breadcrumb { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; } }

/* Сонгох хариулт */
.choice-answer { min-width: 0; flex: 1 1 100%; margin: 0; padding: 0; border: 0; }
.choice-answer > legend { margin-bottom: 6px; padding: 0; color: var(--muted); font-size: 13px; font-weight: 700; }
.choice-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); margin-top: 0; }
.choice-grid label.test-choice { display: flex; flex-direction: row; flex: initial; min-height: 46px; margin: 0; font-size: 15px; font-weight: 600; color: #232b45; overflow-wrap: anywhere; }
.choice-grid .test-choice input { min-height: 0; width: 18px; height: 18px; flex: 0 0 18px; padding: 0; accent-color: var(--primary); }
.choice-grid .test-choice:has(input:checked) { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary); }
fieldset.test-question { display: block; }
body.dark-mode .test-choice { color: #eef0fb; border-color: #39435a; background: #202738; }
body.dark-mode .test-choice:has(input:checked) { border-color: #8794ff; background: #2d3358; }

/* Математик тэмдгийн товчнууд */
.math-keys { display: flex; flex-wrap: wrap; flex: 1 1 100%; gap: 6px; margin: 2px 0; order: 0; }
.math-keys button { min-width: 42px; min-height: 40px; padding: 0 9px; color: #2b2f6b; border: 1px solid #c9ceff; border-radius: 9px; background: #eef0ff; font-size: 17px; font-weight: 700; cursor: pointer; }
.math-keys button:hover, .math-keys button:focus-visible { background: #dfe2ff; border-color: var(--primary); }
body.dark-mode .math-keys button { color: #e8eaff; border-color: #454f86; background: #262d52; }

/* PowerPoint хичээлийн слайд */
.deck { margin: 10px 0 6px; padding: 8px; border-radius: 14px; background: #1f2433; }
.deck:focus-visible { outline: 3px solid var(--primary); }
.deck-status { margin: 0; padding: 60px 14px; color: #fff; text-align: center; font-size: 15px; }
.deck-stage { display: grid; place-items: center; }
.deck-slide { display: block; width: 100%; height: auto; border-radius: 8px; background: #fff; cursor: pointer; }
.deck-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-top: 8px; }
.deck-bar button:disabled { opacity: .5; cursor: default; }
.deck-count { color: #fff; font-size: 14px; font-weight: 700; }
.deck-jump-label { display: flex; align-items: center; gap: 6px; margin-left: auto; color: #fff; font-size: 13px; }
.deck-jump { min-height: 34px; padding: 0 8px; color: #1f2433; border: 0; border-radius: 8px; background: #fff; }
.deck .filter-button { color: #1f2433; border-color: #fff; background: #fff; }
.deck:fullscreen { display: flex; flex-direction: column; margin: 0; border-radius: 0; background: #000; }
.deck:fullscreen .deck-stage { flex: 1; min-height: 0; }
.deck:fullscreen .deck-slide { width: 100%; height: 100%; max-height: calc(100vh - 70px); object-fit: contain; border-radius: 0; background: transparent; }
.lesson-media-columns:has(.deck) { grid-template-columns: minmax(0, 1fr); }
.lesson-media-item:has(.deck) { display: block; min-width: 0; }
.lesson-media-item:has(.deck) .lesson-media-meta { margin-bottom: 4px; }
