@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700;800&family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
  font-family: 'DM Sans', system-ui, sans-serif;
  color: #172b44;
  background: #f3f5f9;
  font-synthesis: none;
  --ink: #172b44;
  --navy: #192d4b;
  --navy-deep: #142640;
  --blue: #254c86;
  --muted: #51647a;
  --border: #d9e0eb;
  --surface: #fff;
  --gold: #f1ca84;
  --radius: 15px;
  --heading: 'Manrope', 'DM Sans', system-ui, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { min-width: 300px; margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .55; }
button:focus-visible, a:focus-visible, select:focus-visible, input:focus-visible, summary:focus-visible {
  outline: 3px solid #4074bd;
  outline-offset: 3px;
}
h1, h2, h3 { font-family: var(--heading); }
h2 { margin: 0 0 10px; font-size: 19px; font-weight: 800; line-height: 1.35; letter-spacing: -.025em; }
h3 { font-size: 15px; }
p { line-height: 1.6; }
.muted { color: var(--muted); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 42px;
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
  transition: background-color .15s, border-color .15s;
}
.btn.full { width: 100%; }
.btn-primary { background: var(--blue); color: white; }
.btn-primary:not(:disabled):hover { background: #193867; }
.btn-outline, .btn-light { border-color: #cbd6e5; background: #fff; color: var(--blue); }
.btn-outline:not(:disabled):hover, .btn-light:not(:disabled):hover { border-color: #7390b9; background: #f0f5fc; }
.text-action {
  display: inline-block;
  margin: 0;
  padding: 3px 0;
  border: 0;
  background: none;
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
  text-align: left;
}
.text-action:hover:not(:disabled) { text-decoration: underline; text-underline-offset: 3px; }

.brand { display: flex; align-items: center; gap: 11px; font: 700 19px/1.2 var(--heading); }
.brand strong { font-weight: 800; }
.logo-mark {
  position: relative;
  display: inline-grid;
  width: 37px;
  height: 37px;
  flex: none;
  place-items: center;
  border-radius: 10px;
  background: var(--gold);
}
.logo-mark::before, .logo-mark::after {
  position: absolute;
  width: 8px;
  height: 12px;
  border: 2px solid var(--navy-deep);
  content: '';
}
.logo-mark::before { left: 9px; border-radius: 2px 4px 2px 2px; transform: skewY(12deg); }
.logo-mark::after { right: 9px; border-radius: 4px 2px 2px 2px; transform: skewY(-12deg); }

.auth-page { min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); }
.auth-visual {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: clamp(28px, 5vw, 74px);
  overflow: hidden;
  background: radial-gradient(ellipse at 85% 88%, #345786 0, transparent 54%), var(--navy-deep);
  color: #fff;
}
.auth-visual .brand { position: relative; z-index: 1; }
.auth-intro { position: relative; z-index: 1; margin: auto 0; padding: 70px 0 38px; max-width: 530px; }
.auth-intro h1 { margin: 0; font-size: clamp(48px, 6.2vw, 94px); font-weight: 800; line-height: .99; letter-spacing: -.075em; }
.auth-intro p { max-width: 360px; margin: 23px 0 36px; color: #cbd7e6; font-size: 17px; }
.auth-features { display: grid; gap: 13px; padding: 0; margin: 0; list-style: none; }
.auth-features li { display: flex; align-items: center; gap: 11px; color: #f0f3f8; font-size: 14px; font-weight: 600; }
.auth-features span { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 7px; background: #ffffff14; color: var(--gold); }
.auth-decoration {
  position: absolute;
  right: -100px;
  bottom: -160px;
  width: 390px;
  height: 460px;
  border: 1px solid #99afd147;
  border-radius: 22px;
  transform: rotate(-22deg);
  box-shadow: -30px 21px 0 -1px #213c61, -30px 21px 0 #99afd13a, -62px 41px 0 -1px #20395b, -62px 41px 0 #99afd12e;
}
.auth-main { display: grid; grid-template-columns: minmax(0, 420px); justify-content: center; align-content: center; padding: 38px min(8vw, 90px); background: #fbfcff; }
.auth-card h2 { margin: 0; font-size: clamp(27px, 3.2vw, 43px); letter-spacing: -.055em; }
.auth-card > p { margin: 10px 0 29px; }
.mobile-brand { display: none; }
.auth-card .btn { height: 47px; margin-top: 4px; }

.field { display: grid; gap: 7px; margin: 14px 0; color: var(--ink); font-size: 13px; font-weight: 800; }
.field input, .field select, .search input {
  width: 100%;
  min-width: 0;
  min-height: 43px;
  padding: 9px 12px;
  border: 1px solid #c9d5e4;
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
}
.field input::placeholder, .search input::placeholder { color: #576a83; }
.field-hint { margin: -8px 0 14px; color: var(--muted); font-size: 12px; }
.form-feedback { margin: 11px 0 0; color: #9a2c42; font-size: 13px; font-weight: 700; }
.form-feedback:empty { display: none; }
.form-feedback.success { color: #17654f; }

.app-shell { min-height: 100dvh; }
.sidebar {
  position: fixed;
  z-index: 5;
  inset: 0 auto 0 0;
  display: flex;
  width: 230px;
  flex-direction: column;
  padding: 25px 16px 16px;
  background: var(--navy-deep);
  color: #fff;
}
.sidebar-logo { margin: 0 0 39px 6px; }
.sidebar-nav { display: grid; gap: 5px; }
.nav-link, .sidebar-user {
  display: flex;
  min-height: 45px;
  align-items: center;
  gap: 11px;
  padding: 9px 11px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #d0d9e8;
  font-size: 14px;
  font-weight: 700;
  text-align: left;
}
.nav-link > span { width: 21px; flex: none; color: #adbfda; text-align: center; font-size: 19px; line-height: 1; }
.nav-link:hover, .sidebar-user:hover { background: #223b5d; color: #fff; }
.nav-link.active { border-color: #415a7d; background: #263f64; color: #fff; }
.nav-link.active > span { color: var(--gold); }
.sidebar-bottom { margin-top: auto; padding-top: 14px; border-top: 1px solid #39506d; }
.sidebar-user { width: 100%; min-width: 0; padding: 7px 4px; }
.side-user-info { display: grid; flex: 1; min-width: 0; }
.side-user-info strong { overflow: hidden; color: #fff; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.side-user-info small { color: #bdcbe0; font-size: 11px; }
.avatar { display: inline-grid; width: 40px; height: 40px; flex: none; place-items: center; border: 1px solid #c9d8ea; border-radius: 50%; background: #e7eef9; color: #233f66; font-size: 13px; font-weight: 800; }
.avatar.sm:hover, .avatar.active { border-color: #5378ab; background: #dce8f9; }
.main-layout { margin-left: 230px; }
.topbar {
  display: flex;
  min-height: 69px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px clamp(20px, 4vw, 58px);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 13px; }
.topbar-left { min-width: 0; }
.topbar-left > strong { line-height: 1.25; }
.breadcrumb { color: var(--muted); font-size: 13px; }
.breadcrumb::after { padding-left: 13px; color: #8f9fb4; content: '/'; }
.exam-picker { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; font-weight: 800; }
.exam-picker select { min-height: 40px; min-width: 81px; padding: 0 8px; border: 1px solid #c7d6ea; border-radius: 9px; background: #ebf1fb; color: #223f67; font-weight: 800; }
.exam-feedback { max-width: 1210px; margin: 14px clamp(16px, 4vw, 58px) 0; padding: 10px 14px; border: 1px solid #edbac4; border-radius: 9px; background: #fff1f4; color: #85263a; font-size: 13px; }
.mobile-nav { display: none; }
.screen { width: 100%; max-width: 1340px; min-width: 0; margin: auto; padding: 32px clamp(20px, 4vw, 58px) 50px; }
.view-header { margin-bottom: 24px; }
.view-header h1 { margin: 0; color: var(--ink); font-size: clamp(29px, 3.4vw, 47px); font-weight: 800; line-height: 1.1; letter-spacing: -.06em; }
.view-header p { margin: 9px 0 0; color: var(--muted); font-size: 15px; }
.context-label { margin-bottom: 9px; color: #465f7e; font-size: 12px; font-weight: 800; letter-spacing: .055em; text-transform: uppercase; }
.panel { min-width: 0; padding: clamp(16px, 2.3vw, 26px); border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.panel p { margin: 7px 0 12px; color: var(--muted); font-size: 14px; }
.panel .form-feedback { margin: 12px 0 0; color: #9a2c42; font-size: 13px; }
.panel .form-feedback.success { color: #17654f; }
.section-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.section-row h2, .section-row h3 { margin: 0; }
.section-row > span { color: var(--muted); font-size: 13px; }
.stack { display: grid; align-content: start; gap: 18px; min-width: 0; }
.notice, .empty-state { padding: 12px 14px; border: 1px solid #dce4ef; border-radius: 9px; background: #f4f7fb; color: var(--muted); font-size: 13px; line-height: 1.55; }
.empty-state strong { display: block; margin-bottom: 3px; color: var(--ink); }

.study-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(210px, 30%);
  align-items: center;
  gap: clamp(18px, 4vw, 53px);
  padding: clamp(24px, 4.1vw, 47px);
  border-radius: 19px;
  background: linear-gradient(123deg, #172b49, #254977);
  color: #fff;
}
.hero-copy { min-width: 0; }
.study-hero .context-label { color: #f1cc91; }
.study-hero h2 { max-width: 640px; margin-bottom: 11px; font-size: clamp(24px, 3.6vw, 46px); line-height: 1.12; overflow-wrap: anywhere; letter-spacing: -.05em; }
.study-hero p { margin: 0 0 19px; color: #d7e1f0; font-size: 14px; }
.study-hero .btn-primary { min-width: 132px; border-color: var(--gold); background: var(--gold); color: #1b2f4d; }
.study-hero .btn-primary:hover { background: #ffdc9e; }
.hero-progress { display: grid; min-width: 0; gap: 7px; padding: 19px; border: 1px solid #b1c7e253; border-radius: 13px; background: #13294769; }
.hero-progress > span, .hero-progress > small { color: #dce5f1; font-size: 12px; font-weight: 700; }
.hero-progress > strong { font: 800 clamp(35px, 4vw, 52px)/1 var(--heading); letter-spacing: -.045em; }
.progress-bar { display: block; width: 100%; height: 7px; overflow: hidden; border: 0; border-radius: 99px; background: #e4ebf5; color: #456faa; }
.progress-bar::-webkit-progress-bar { border-radius: 99px; background: #e4ebf5; }
.progress-bar::-webkit-progress-value { border-radius: 99px; background: #456faa; }
.progress-bar::-moz-progress-bar { border-radius: 99px; background: #456faa; }
.hero-progress .progress-bar { margin: 4px 0; background: #6b84a8; }
.hero-progress .progress-bar::-webkit-progress-bar { background: #6b84a8; }
.hero-progress .progress-bar::-webkit-progress-value { background: var(--gold); }
.hero-progress .progress-bar::-moz-progress-bar { background: var(--gold); }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(146px, 1fr)); gap: 13px; margin: 16px 0 23px; }
.stat-card { display: flex; align-items: center; gap: 12px; min-width: 0; min-height: 82px; padding: 14px; border: 1px solid var(--border); border-radius: 12px; background: #fff; }
.stat-icon, .subject-icon { display: grid; width: 39px; height: 39px; flex: none; place-items: center; border-radius: 9px; background: #eaf0fa; color: #345c95; font-size: 18px; font-weight: 800; }
.stat-icon.teal, .subject-icon[data-color="emerald"] { background: #e4f3ec; color: #276851; }
.stat-icon.violet, .subject-icon[data-color="violet"] { background: #eeeafa; color: #554587; }
.stat-icon.amber, .subject-icon[data-color="amber"] { background: #fbf0dc; color: #775618; }
.stat-text { min-width: 0; }
.stat-text small { display: block; color: var(--muted); font-size: 12px; font-weight: 700; line-height: 1.2; }
.stat-text strong { display: block; margin-top: 3px; font: 800 23px/1.1 var(--heading); }
.two-col, .admin-grid, .account-grid, .progress-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 18px; }
.study-columns { grid-template-columns: minmax(0, 1.25fr) minmax(230px, .75fr); }
.admin-grid { grid-template-columns: minmax(0, 1.14fr) minmax(0, .86fr); }
.two-col + .two-col, .progress-grid + .two-col { margin-top: 18px; }
.practice-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; }
.practice-banner p { margin: 0; }
.recent-item, .progress-subject { display: flex; align-items: center; gap: 11px; padding: 11px 0; border-top: 1px solid #e5ebf3; }
.recent-item-icon, .lesson-symbol { display: grid; width: 32px; height: 32px; flex: none; place-items: center; border-radius: 8px; background: #eaf0fa; color: #345c95; font-size: 14px; }
.recent-item-copy, .lesson-info, .progress-subject-info { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.recent-item-copy strong, .lesson-info strong, .progress-subject-info strong { display: block; font-size: 14px; line-height: 1.35; }
.recent-item-copy small, .lesson-info small, .progress-subject-info small { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }
.recent-item .btn, .lesson-actions .btn { min-height: 36px; padding: 5px 9px; font-size: 12px; }
.bar-chart { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; align-items: end; min-height: 138px; }
.bar-col { display: grid; gap: 6px; justify-items: center; align-content: end; }
.bar { width: min(57%, 26px); max-height: 110px; min-height: 4px; border-radius: 5px 5px 2px 2px; background: #e2e9f2; }
.bar.filled { background: #527cb7; }
.bar-col small { color: var(--muted); font-size: 11px; }
.subject-progress-title { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 4px; }
.subject-progress-title small { flex: none; margin: 0; }
.rate { flex: none; color: var(--blue); font-size: 13px; }

.catalog-layout { display: grid; grid-template-columns: 202px minmax(0, 1fr); gap: 16px; align-items: start; }
.catalog-side { display: grid; gap: 2px; padding: 10px; border: 1px solid var(--border); border-radius: 12px; background: #fff; }
.catalog-side button { display: flex; align-items: center; gap: 5px; min-height: 38px; padding: 7px 9px; border: 1px solid transparent; border-radius: 7px; background: transparent; color: var(--ink); font-size: 13px; font-weight: 700; text-align: left; }
.catalog-side button:hover, .catalog-side button.active, .catalog-side button[aria-pressed="true"] { border-color: #cbdaf0; background: #eaf1fa; color: #244b80; }
.catalog-group { padding: 10px 9px 2px; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .03em; }
.catalog-main { min-width: 0; }
.catalog-banner { display: flex; align-items: center; gap: 12px; margin-bottom: 13px; padding: 14px; border: 1px solid var(--border); border-radius: 11px; background: #fff; }
.catalog-banner h2, .catalog-banner p { margin: 0; }
.catalog-banner p { color: var(--muted); font-size: 13px; }
.archive-note { margin: 0 0 11px; }
.material-filters { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 11px; }
.material-filters .btn { min-height: 36px; padding: 5px 10px; }
.material-filters [aria-pressed="true"] { border-color: #b7c9e2; background: #e8effb; color: #264c83; }
.search { position: relative; display: block; margin-bottom: 13px; }
.search > span { position: absolute; top: 10px; left: 12px; color: var(--muted); }
.search > input { padding-left: 33px; }
.module-card { margin-bottom: 10px; overflow: hidden; border: 1px solid var(--border); border-radius: 11px; background: #fff; }
.module-header { display: flex; width: 100%; min-height: 61px; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 15px; border: 0; background: #fff; color: var(--ink); text-align: left; }
.module-header[aria-expanded="true"] { background: #f5f8fc; }
.module-header[aria-disabled="true"] { cursor: default; }
.module-heading { flex: 1; }
.module-heading strong { display: block; font-size: 14px; }
.module-heading small { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }
.module-arrow { color: #3d5c83; font-size: 24px; line-height: 1; transition: transform .2s; }
.module-card.open .module-arrow { transform: rotate(90deg); }
.module-body { padding: 0 15px 13px; }
.module-body > .text-action { margin-top: 10px; }
.module-empty { padding-top: 11px; color: var(--muted); font-size: 13px; }
.lesson-group h3 { margin: 11px 0 6px; color: #4c617c; font-size: 12px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; }
.lesson-row { display: flex; min-height: 53px; align-items: center; gap: 9px; padding: 7px 0; border-top: 1px solid #e8edf5; }
.lesson-symbol.pdf { background: #faeee1; color: #785421; }
.lesson-actions { display: flex; flex: none; gap: 6px; }
.complete-check { display: grid; width: 37px; height: 36px; place-items: center; border: 1px solid #cbd6e5; border-radius: 8px; background: #fff; color: var(--muted); font-size: 17px; }
.complete-check.done, .complete-check[aria-pressed="true"] { border-color: #b2d4c5; background: #e8f5ee; color: #22624a; }

.quiz-setup, .quiz-run { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .83fr); gap: 18px; align-items: start; }
.exam-setup { border-top: 4px solid #4d72aa; }
.setup-icon { display: grid; width: 34px; height: 34px; flex: none; place-items: center; border-radius: 9px; background: #edf2fb; color: #2d5186 !important; font-size: 19px !important; }
.mock-blocks { margin: 10px 0 16px; padding: 0; list-style: none; }
.mock-blocks li { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid #e3eaf4; color: var(--muted); font-size: 13px; }
.mock-blocks strong { color: var(--ink); white-space: nowrap; }
.quiz-reference { margin: 10px 0 17px; color: var(--muted); font-size: 13px; }
.quiz-reference a { margin-left: 3px; }
.exercise-group { padding: 11px 0; border-bottom: 1px solid #e3eaf4; }
.exercise-group summary { cursor: pointer; font-size: 14px; font-weight: 800; }
.exercise-group summary small { margin-left: 5px; color: var(--muted); font-size: 12px; }
.exercise-group ul { margin-bottom: 0; padding-left: 22px; }
.quiz-run { grid-template-columns: minmax(0, 1fr) minmax(255px, .47fr); }
.question-panel h2 { margin: 10px 0 18px; font-size: clamp(17px, 2.15vw, 23px); font-weight: 800; line-height: 1.48; }
.question-context { display: grid; gap: 2px; margin: 19px 0 0; color: var(--blue); font-size: 13px; }
.question-context > span { color: var(--muted); }
.timer { min-width: 69px; padding: 6px 10px; border-radius: 7px; background: #edf2fb; color: #254c86 !important; font-variant-numeric: tabular-nums; font-weight: 800; text-align: center; }
.timer.urgent { background: #fee8ec; color: #8c253c !important; }
.quiz-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.option { display: flex; align-items: center; gap: 9px; min-height: 45px; padding: 7px 9px; border: 1px solid #ccd8e8; border-radius: 9px; background: #fff; color: var(--ink); font-weight: 800; }
.option > span { display: grid; width: 27px; height: 27px; flex: none; place-items: center; border-radius: 6px; background: #eaf0fa; color: #274c80; font-size: 13px; }
.option[aria-pressed="true"] { border-color: #5178ad; background: #e7eefb; }
.option[aria-pressed="true"] > span { background: var(--blue); color: #fff; }
.question-tools, .quiz-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-top: 11px; }
.quiz-controls { margin-top: 17px; }
.answer-sheet { position: sticky; top: 12px; }
.answer-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 5px; margin-bottom: 13px; }
.answer-grid button { position: relative; min-width: 0; min-height: 31px; padding: 2px; border: 1px solid #ced9e8; border-radius: 7px; background: #fff; color: var(--ink); font-size: 12px; font-weight: 800; }
.answer-grid button.answered { border-color: #94b2d9; background: #dce9fa; color: #224d82; }
.answer-grid button[aria-current="step"] { border-color: #254c86; box-shadow: inset 0 0 0 1px #254c86; }
.answer-grid button.flagged::after { position: absolute; top: 3px; right: 3px; width: 6px; height: 6px; border-radius: 50%; background: #a6681b; content: ''; }
.finish-box .text-action { margin-top: 7px; }
.result-summary { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; }
.result-summary > div:first-child span { display: block; font-weight: 800; }
.result-summary > div > strong { color: var(--blue); font: 800 clamp(36px, 5vw, 58px)/1.1 var(--heading); letter-spacing: -.05em; }
.result-summary > div > strong small { color: var(--muted); font-size: .54em; }
.result-summary dl { display: flex; gap: 15px; margin: 0; }
.result-summary dt { color: var(--muted); font-size: 12px; font-weight: 700; }
.result-summary dd { margin: 3px 0 0; font-size: 19px; font-weight: 800; }
.result-blocks, .result-review { margin-top: 16px; }
.review-item { margin-top: 8px; border-left: 4px solid #8396b0; }
.review-item.correct { border-left-color: #2d8666; }
.review-item.incorrect { border-left-color: #bb4963; }
.review-item h3 { margin: 7px 0; line-height: 1.5; }
.review-item small { color: var(--muted); font-weight: 700; }

.profile-header { display: flex; align-items: center; gap: 11px; }
.profile-header .avatar { width: 49px; height: 49px; font-size: 16px; }
.profile-header h2, .profile-header p { margin: 0; }
.profile-card dl { padding: 14px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.profile-card dt { margin-bottom: 4px; color: var(--muted); font-size: 12px; font-weight: 800; }
.profile-card dd { margin: 0; overflow-wrap: anywhere; font-weight: 700; }
.profile-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.table-scroll { overflow: auto; }
.admin-list { width: 100%; border-collapse: collapse; }
.admin-list th, .admin-list td { padding: 8px; border-bottom: 1px solid #e1e9f4; font-size: 13px; text-align: left; }
.admin-list th { color: var(--muted); }
.admin-list td small { display: block; color: var(--muted); overflow-wrap: anywhere; }
.admin-list td:last-child { width: 1%; white-space: nowrap; }
.admin-badge { display: inline-block; padding: 3px 7px; border-radius: 99px; background: #e6f4eb; color: #27644f; font-size: 11px; font-weight: 800; }
.admin-badge.off { background: #fcebf0; color: #972b43; }

.player-overlay { position: fixed; z-index: 20; inset: 0; display: grid; place-items: center; padding: 12px; background: #101d30e6; }
.player-dialog { width: min(100%, 940px); max-height: calc(100dvh - 24px); overflow: auto; border-radius: 14px; background: #fff; box-shadow: 0 20px 70px #07102077; }
.player-heading { display: flex; align-items: start; justify-content: space-between; gap: 10px; padding: 13px 17px; }
.player-heading h2 { margin: 5px 0 0; overflow-wrap: anywhere; }
.player-kicker { color: var(--muted); font-size: 12px; font-weight: 800; }
.close-btn { display: grid; width: 39px; height: 39px; flex: none; place-items: center; border: 1px solid var(--border); border-radius: 8px; background: #edf2f9; color: var(--ink); font-size: 23px; }
.player-frame-wrap { display: grid; place-items: center; aspect-ratio: 16/9; background: #111c2e; }
.player-frame-wrap.document-preview { height: min(67dvh, 670px); aspect-ratio: auto; }
.player-frame-wrap iframe { width: 100%; height: 100%; border: 0; }
.player-frame-wrap > p { padding: 14px; color: #fff; }
.player-actions { display: flex; flex-wrap: wrap; justify-content: end; gap: 8px; padding: 13px 17px; }
.toast { position: fixed; z-index: 30; right: 18px; bottom: 18px; max-width: min(90vw, 410px); padding: 11px 14px; border-radius: 9px; background: var(--navy-deep); color: #fff; font-size: 13px; font-weight: 700; opacity: 0; pointer-events: none; transform: translateY(8px); transition: opacity .16s, transform .16s; }
.toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 1100px) {
  .sidebar { width: 195px; padding-inline: 11px; }
  .sidebar-logo { gap: 7px; font-size: 16px; }
  .main-layout { margin-left: 195px; }
  .catalog-layout { grid-template-columns: 166px minmax(0, 1fr); }
  .catalog-side button { font-size: 12px; }
}
@media (max-width: 830px) {
  .sidebar { display: none; }
  .main-layout { margin-left: 0; }
  .mobile-nav { position: fixed; z-index: 8; right: 0; bottom: 0; left: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); min-height: 58px; gap: 3px; padding: 5px 9px max(5px, env(safe-area-inset-bottom)); border-top: 1px solid var(--border); background: #fff; }
  .mobile-nav button { display: grid; place-content: center; gap: 1px; min-width: 0; padding: 4px; border: 0; border-radius: 8px; background: #fff; color: var(--muted); font-size: 11px; font-weight: 800; text-align: center; }
  .mobile-nav button.active { background: #eaf0fa; color: #264b81; }
  .mobile-nav button > span { font-size: 19px; line-height: 1; }
  .screen { padding: 24px 16px 82px; }
  .toast { bottom: 70px; }
}
@media (max-width: 640px) {
  .auth-page { grid-template-columns: 1fr; }
  .auth-visual { display: none; }
  .auth-main { min-height: 100dvh; padding: 24px; }
  .mobile-brand { display: flex; margin-bottom: 27px; }
  .topbar { min-height: 58px; padding: 7px 13px; }
  .topbar-right { gap: 7px; }
  .breadcrumb { display: none; }
  .exam-picker { gap: 4px; }
  .exam-picker select { min-width: 66px; }
  .topbar .avatar { width: 36px; height: 36px; }
  .study-hero, .two-col, .admin-grid, .account-grid, .progress-grid, .quiz-setup, .quiz-run, .catalog-layout { grid-template-columns: 1fr; gap: 12px; }
  .study-hero { padding: 17px; }
  .hero-progress { grid-template-columns: auto 1fr; align-items: center; gap: 6px 9px; padding: 12px; }
  .hero-progress > strong { grid-row: 1 / span 2; grid-column: 1; font-size: 29px; }
  .hero-progress .progress-bar { grid-column: 2; }
  .hero-progress > small { grid-column: 2; }
  .catalog-side { display: flex; overflow-x: auto; scroll-snap-type: x proximity; padding: 6px; }
  .catalog-side button { flex: none; white-space: nowrap; scroll-snap-align: start; }
  .catalog-group { flex: none; align-self: center; padding: 4px; white-space: nowrap; }
  .answer-sheet { position: static; }
  .answer-grid { grid-template-columns: repeat(8, minmax(0, 1fr)); }
}
@media (max-width: 389px) {
  .exam-picker { flex-direction: column; align-items: flex-start; gap: 1px; }
  .exam-picker select { min-height: 30px; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  .stat-card { min-height: 69px; padding: 8px; }
  .stat-icon { width: 30px; height: 30px; }
  .practice-banner { align-items: start; flex-direction: column; }
  .lesson-row { flex-wrap: wrap; }
  .lesson-info { flex-basis: calc(100% - 42px); }
  .lesson-actions { width: 100%; justify-content: end; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
