:root {
  --blue-900: #0c1f3f;
  --blue-800: #122f59;
  --blue-700: #16386b;
  --blue-600: #1e477e;
  --blue-500: #23528f;
  --blue-400: #2f75bd;
  --blue-300: #5b9bd8;
  --blue-100: #dbe9fb;
  --blue-50: #eef4fc;
  --ink: #131c2b;
  --ink-soft: #46566e;
  --muted: #748196;
  --line: #e3ebf6;
  --surface: #ffffff;
  --surface-2: #f7faff;
  --bg: #eef3fb;
  --ok: #137a43;
  --ok-soft: #e7f7ee;
  --danger: #c12f2f;
  --danger-soft: #fdeeee;
  --warn: #8a5a00;
  --warn-soft: #fff6e2;
  --radius-xs: 12px;
  --radius-sm: 16px;
  --radius: 22px;
  --radius-lg: 30px;
  --shadow-sm: 0 4px 16px rgba(18, 36, 66, 0.06);
  --shadow: 0 18px 48px rgba(18, 36, 66, 0.12);
  --shadow-lg: 0 30px 80px rgba(13, 31, 63, 0.22);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", system-ui, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* {
  box-sizing: border-box;
}

html {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  line-height: 1.55;
  background:
    radial-gradient(1100px 620px at 12% -8%, rgba(47, 117, 189, 0.16), transparent 60%),
    radial-gradient(900px 520px at 100% 0%, rgba(35, 82, 143, 0.12), transparent 55%),
    linear-gradient(180deg, #f9fbff 0%, var(--bg) 100%);
  background-attachment: fixed;
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

h1, h2, h3, h4 {
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0;
}

.container {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

/* ---------- Top navigation ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: saturate(180%) blur(18px);
  background: rgba(248, 251, 255, 0.78);
  border-bottom: 1px solid rgba(227, 235, 246, 0.9);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  gap: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -0.01em;
}

.brand-logo {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  object-fit: cover;
  object-position: left center;
  display: block;
  flex: 0 0 auto;
}

.brand small {
  display: block;
  font-weight: 600;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-link {
  padding: 9px 14px;
  border-radius: 999px;
  font-weight: 650;
  font-size: 14.5px;
  color: var(--ink-soft);
  transition: background 0.18s var(--ease), color 0.18s var(--ease);
}

.nav-link:hover {
  background: var(--blue-50);
  color: var(--blue-600);
}

.nav-link.active {
  background: var(--blue-500);
  color: #fff;
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  color: var(--blue-700);
  background: var(--blue-100);
}

/* ---------- Buttons ---------- */
.btn {
  appearance: none;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  font-weight: 700;
  font-size: 15px;
  border-radius: 14px;
  padding: 12px 20px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  transition: transform 0.08s var(--ease), box-shadow 0.18s var(--ease), background 0.18s var(--ease);
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(135deg, var(--blue-600), var(--blue-400));
  color: #fff;
  box-shadow: 0 12px 26px rgba(35, 82, 143, 0.3);
}

.btn-primary:hover:not(:disabled) {
  box-shadow: 0 16px 34px rgba(35, 82, 143, 0.4);
}

.btn-secondary {
  background: var(--blue-50);
  color: var(--blue-700);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--blue-100);
}

.btn-ghost {
  background: transparent;
  color: var(--ink-soft);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--blue-50);
  color: var(--blue-600);
}

.btn-block {
  width: 100%;
  justify-content: center;
}

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.section-title {
  font-size: 23px;
  font-weight: 800;
}

.section-sub {
  color: var(--muted);
  font-size: 15px;
  margin-top: 4px;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  padding: 40px 44px;
  color: #fff;
  background: linear-gradient(135deg, #0c1f3f 0%, #16386b 45%, #2f75bd 100%);
  box-shadow: var(--shadow);
}

.hero::after {
  content: "";
  position: absolute;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  right: -150px;
  top: -190px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.18), transparent 70%);
}

.hero::before {
  content: "";
  position: absolute;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  left: -120px;
  bottom: -180px;
  background: radial-gradient(circle, rgba(91, 155, 216, 0.35), transparent 70%);
}

.hero h1 {
  position: relative;
  z-index: 1;
  font-size: clamp(28px, 4vw, 44px);
  max-width: 760px;
}

.hero p {
  position: relative;
  z-index: 1;
  margin: 14px 0 0;
  max-width: 640px;
  font-size: 17px;
  color: rgba(255, 255, 255, 0.86);
}

.hero-meta {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

.hero-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 15px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-weight: 650;
  font-size: 14px;
}

/* ---------- Progress ---------- */
.progress-track {
  height: 10px;
  border-radius: 999px;
  background: var(--blue-50);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--blue-500), var(--blue-400));
  transition: width 0.5s var(--ease);
}

.hero .progress-track {
  background: rgba(255, 255, 255, 0.2);
}

.hero .progress-fill {
  background: linear-gradient(90deg, #9ec5ef, #ffffff);
}

/* ---------- Module grid ---------- */
.grid {
  display: grid;
  gap: 20px;
}

.grid-modules {
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
}

.module-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 24px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), border-color 0.25s var(--ease);
}

.module-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow);
  border-color: var(--blue-100);
}

.module-index {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 18px;
  color: var(--blue-700);
  background: var(--blue-50);
  margin-bottom: 16px;
}

.module-card.done .module-index {
  background: var(--ok-soft);
  color: var(--ok);
}

.module-card h3 {
  font-size: 19px;
}

.module-card p {
  color: var(--ink-soft);
  font-size: 14.5px;
  margin: 8px 0 18px;
  flex: 1;
}

.module-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13.5px;
  color: var(--muted);
  font-weight: 650;
}

.module-foot .progress-track {
  flex: 1;
}

/* ---------- Lesson list ---------- */
.lesson-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.lesson-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s var(--ease), border-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}

.lesson-row:hover {
  transform: translateY(-2px);
  border-color: var(--blue-100);
  box-shadow: var(--shadow);
}

.lesson-icon {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  background: var(--blue-50);
  color: var(--blue-600);
}

.lesson-icon.article {
  background: #eef0fb;
  color: #5159c9;
}

.lesson-main {
  flex: 1;
  min-width: 0;
}

.lesson-main h4 {
  font-size: 16px;
}

.lesson-main span {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
}

.check {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 2px solid var(--line);
  color: transparent;
  font-size: 14px;
}

.check.done {
  background: var(--ok);
  border-color: var(--ok);
  color: #fff;
}

/* ---------- Forms ---------- */
.auth-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 16px;
}

.auth-card {
  width: min(440px, 100%);
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--line);
  padding: 40px;
}

.auth-card .brand {
  margin-bottom: 26px;
}

.field {
  margin-bottom: 18px;
}

.field label {
  display: block;
  font-weight: 650;
  font-size: 13.5px;
  color: var(--ink-soft);
  margin-bottom: 8px;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  font-family: inherit;
  font-size: 15px;
  color: var(--ink);
  background: var(--surface-2);
  border: 1.5px solid var(--line);
  border-radius: 14px;
  padding: 13px 15px;
  transition: border-color 0.18s var(--ease), background 0.18s var(--ease), box-shadow 0.18s var(--ease);
}

.field textarea {
  resize: vertical;
  min-height: 96px;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--blue-400);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(47, 117, 189, 0.14);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 18px;
}

.form-grid .full {
  grid-column: 1 / -1;
}

.alert {
  display: none;
  padding: 12px 15px;
  border-radius: 13px;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 18px;
}

.alert.show {
  display: block;
}

.alert-error {
  background: var(--danger-soft);
  color: var(--danger);
}

.alert-ok {
  background: var(--ok-soft);
  color: var(--ok);
}

/* ---------- Page scaffolding ---------- */
.page {
  padding: 30px 0 70px;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 26px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 18px;
}

.breadcrumb a:hover {
  color: var(--blue-600);
}

/* ---------- Lesson view ---------- */
.lesson-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
}

.player {
  width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  background: #04101f;
  box-shadow: var(--shadow);
}

.player video {
  width: 100%;
  display: block;
  max-height: 70vh;
  background: #04101f;
}

.prose {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 34px 38px;
  max-width: 860px;
}

.prose h2 {
  font-size: 26px;
  margin-bottom: 18px;
}

.prose h3 {
  font-size: 20px;
  margin: 28px 0 10px;
  color: var(--blue-700);
}

.prose h4 {
  font-size: 16.5px;
  margin: 20px 0 8px;
  color: var(--ink-soft);
}

.prose p {
  margin: 0 0 12px;
  color: var(--ink-soft);
}

.prose p.list-lead {
  margin: 16px 0 8px;
  font-weight: 600;
  font-size: 15px;
  color: var(--ink);
}

.prose p.list-lead + ul,
.prose p.list-lead + ol {
  margin-top: 0;
}

.prose ul,
.prose ol {
  margin: 0 0 14px;
  padding-left: 22px;
  color: var(--ink-soft);
}

.prose li {
  margin-bottom: 6px;
}

.prose ul li::marker {
  color: var(--blue-400);
}

.prose .guide-figure {
  margin: 20px 0 28px;
}

.prose .guide-figure + .guide-figure {
  margin-top: 16px;
}

.prose .guide-image {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

.lesson-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 4px;
}

/* ---------- Documents ---------- */
.doc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.doc-card {
  display: flex;
  gap: 14px;
  padding: 20px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease);
}

.doc-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.doc-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  font-weight: 800;
  font-size: 12px;
  color: #fff;
  background: linear-gradient(135deg, var(--blue-600), var(--blue-400));
}

.doc-card h4 {
  font-size: 15.5px;
}

.doc-card p {
  font-size: 13px;
  color: var(--muted);
  margin: 4px 0 0;
}

/* ---------- Pills / badges ---------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 13px;
  background: var(--blue-50);
  color: var(--blue-700);
}

.badge-ok {
  background: var(--ok-soft);
  color: var(--ok);
}

.badge-bad {
  background: var(--danger-soft);
  color: var(--danger);
}

.option.correct {
  border-color: var(--ok);
  background: var(--ok-soft);
}

.option.incorrect {
  border-color: var(--danger);
  background: var(--danger-soft);
}

.option.missed {
  border-color: var(--warn);
  background: #fff8eb;
}

.explanation {
  margin-top: 10px;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--blue-50);
  border: 1px solid var(--blue-100);
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
  white-space: pre-wrap;
}

/* ---------- Stats ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.stat {
  padding: 22px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

.stat .value {
  font-size: 34px;
  font-weight: 850;
  color: var(--blue-600);
  letter-spacing: -0.03em;
}

.stat .label {
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 600;
  margin-top: 4px;
}

/* ---------- Loader & skeleton ---------- */
.loader {
  display: grid;
  place-items: center;
  padding: 80px 0;
  color: var(--muted);
  font-weight: 600;
}

.spinner {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid var(--blue-100);
  border-top-color: var(--blue-500);
  animation: spin 0.8s linear infinite;
  margin-bottom: 14px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.fade-in {
  animation: fadeIn 0.45s var(--ease) both;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Footer ---------- */
.foot {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  padding: 30px 0 10px;
}

.card-row {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
}

/* ---------- PDF embed ---------- */
.pdf-embed {
  width: 100%;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface-2);
  margin: 6px 0 16px;
}

.pdf-embed iframe {
  width: 100%;
  height: 78vh;
  border: 0;
  display: block;
}

/* ---------- Theme toggle ---------- */
.theme-toggle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 17px;
  padding: 0;
  transition: background 0.18s var(--ease), color 0.18s var(--ease), transform 0.08s var(--ease);
}

.theme-toggle:hover {
  background: var(--blue-50);
  color: var(--blue-600);
}

.theme-toggle:active {
  transform: scale(0.94);
}

.theme-toggle-floating {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 60;
  box-shadow: var(--shadow-sm);
}

/* ---------- Dark theme ---------- */
html[data-theme="dark"] {
  --ink: #e9eef7;
  --ink-soft: #b3c1d6;
  --muted: #8493aa;
  --line: #233248;
  --surface: #141d2c;
  --surface-2: #0f1827;
  --bg: #090f18;
  --blue-50: #18283f;
  --blue-100: #21385a;
  --blue-700: #8fb6e6;
  --ok-soft: #123524;
  --danger-soft: #3a1717;
  --warn-soft: #3a2c0c;
  --shadow-sm: 0 4px 16px rgba(0, 0, 0, 0.3);
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 30px 80px rgba(0, 0, 0, 0.55);
}

html[data-theme="dark"] body {
  background:
    radial-gradient(1100px 620px at 12% -8%, rgba(47, 117, 189, 0.22), transparent 60%),
    radial-gradient(900px 520px at 100% 0%, rgba(35, 82, 143, 0.18), transparent 55%),
    linear-gradient(180deg, #0b1320 0%, var(--bg) 100%);
}

html[data-theme="dark"] .topbar {
  background: rgba(15, 24, 39, 0.82);
  border-bottom-color: rgba(35, 50, 72, 0.9);
}

html[data-theme="dark"] .nav-link.active {
  background: var(--blue-400);
  color: #07111f;
}

html[data-theme="dark"] .lesson-icon.article {
  background: #1c2440;
  color: #98a2ef;
}

html[data-theme="dark"] .option,
html[data-theme="dark"] .field input,
html[data-theme="dark"] .field select,
html[data-theme="dark"] .field textarea {
  background: var(--surface-2);
}

/* ---------- Mobile bottom navigation ---------- */
.mobile-nav {
  display: none;
}

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  .container {
    width: min(1180px, calc(100% - 24px));
  }

  body.has-mobile-nav {
    padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  }

  body.has-mobile-nav .page {
    padding-bottom: 24px;
  }

  body.has-mobile-nav .foot {
    padding-bottom: calc(82px + env(safe-area-inset-bottom, 0px));
  }

  .mobile-nav {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px));
    background: rgba(248, 251, 255, 0.92);
    backdrop-filter: saturate(180%) blur(18px);
    border-top: 1px solid rgba(227, 235, 246, 0.95);
    box-shadow: 0 -8px 32px rgba(18, 36, 66, 0.08);
    gap: 6px;
  }

  html[data-theme="dark"] .mobile-nav {
    background: rgba(15, 24, 39, 0.94);
    border-top-color: rgba(35, 50, 72, 0.95);
  }

  .mobile-nav-link {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    border-radius: 14px;
    font-weight: 700;
    font-size: 13px;
    color: var(--muted);
    transition: background 0.18s var(--ease), color 0.18s var(--ease);
  }

  .mobile-nav-link.active {
    background: var(--blue-500);
    color: #fff;
  }

  html[data-theme="dark"] .mobile-nav-link.active {
    color: #07111f;
  }

  .topbar-inner {
    height: 56px;
    gap: 10px;
  }

  .nav-links {
    display: none;
  }

  .brand {
    font-size: 15px;
    gap: 10px;
    min-width: 0;
  }

  .brand > span {
    min-width: 0;
  }

  .brand small {
    display: none;
  }

  .brand-logo {
    width: 36px;
    height: 36px;
  }

  .nav-user {
    gap: 8px;
    flex-shrink: 0;
  }

  .btn-logout {
    padding: 10px 12px;
    font-size: 13px;
  }

  .theme-toggle {
    width: 36px;
    height: 36px;
    font-size: 15px;
  }

  .avatar {
    width: 34px;
    height: 34px;
    font-size: 13px;
  }

  .page {
    padding-top: 20px;
  }

  .stack {
    gap: 20px;
  }

  .section-title {
    font-size: 22px;
  }

  .hero {
    padding: 24px 20px;
    border-radius: var(--radius);
  }

  .hero h1 {
    font-size: clamp(22px, 6vw, 30px);
  }

  .hero p {
    font-size: 15px;
  }

  .hero-meta {
    gap: 8px;
    margin-top: 18px;
  }

  .hero-chip {
    padding: 8px 12px;
    font-size: 12.5px;
  }

  .grid-modules {
    grid-template-columns: 1fr;
  }

  .module-card {
    padding: 20px;
  }

  .module-foot {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .module-foot .progress-track {
    width: 100%;
  }

  .lesson-row {
    padding: 14px 16px;
    gap: 12px;
    flex-wrap: wrap;
  }

  .lesson-row .pill {
    margin-left: auto;
  }

  .lesson-icon {
    width: 40px;
    height: 40px;
    font-size: 14px;
  }

  .lesson-main h4 {
    font-size: 15px;
  }

  .lesson-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .lesson-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .lesson-actions span[style*="flex:1"] {
    display: none !important;
  }

  .breadcrumb {
    flex-wrap: wrap;
    font-size: 13px;
    margin-bottom: 14px;
  }

  .player video {
    max-height: 52vh;
  }

  .prose {
    padding: 22px 18px;
    max-width: none;
  }

  .prose h2 {
    font-size: 22px;
  }

  .prose h3 {
    font-size: 18px;
  }

  .pdf-embed iframe {
    height: 58vh;
  }

  .card {
    padding: 20px !important;
  }

  .card-row {
    flex-direction: column;
    align-items: stretch;
  }

  .card-row .btn {
    width: 100%;
    justify-content: center;
  }

  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .stat {
    padding: 16px;
  }

  .stat .value {
    font-size: 26px;
  }

  .doc-grid {
    grid-template-columns: 1fr;
  }

  .auth-wrap {
    padding: 20px 12px;
    align-items: flex-start;
    padding-top: 56px;
  }

  .auth-card {
    padding: 28px 20px;
    border-radius: var(--radius);
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .theme-toggle-floating {
    top: 12px;
    right: 12px;
  }

  .btn {
    min-height: 44px;
  }

  .foot {
    font-size: 12px;
    padding-top: 16px;
  }
}

@media (max-width: 420px) {
  .container {
    width: min(1180px, calc(100% - 16px));
  }

  .hero-meta {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-chip {
    justify-content: center;
  }

  .stat-grid {
    grid-template-columns: 1fr;
  }

  .btn-logout {
    font-size: 0;
    width: 36px;
    height: 36px;
    padding: 0;
    position: relative;
  }

  .btn-logout::before {
    content: "⎋";
    font-size: 16px;
    line-height: 1;
  }

  .brand > span > :not(small) {
    font-size: 14px;
  }
}
