:root {
  --primary: #006241;
  --primary-2: #004b34;
  --secondary: #087a50;
  --accent: #ffc400;
  --danger: #d64545;
  --success: #218b50;
  --background: #f5f8f4;
  --surface: #ffffff;
  --ink: #173126;
  --muted: #63766d;
  --line: #dce9e2;
}

* { box-sizing: border-box; }
html { font-size: 16px; }
body { margin: 0; min-height: 100vh; color: var(--ink); font-family: Inter, sans-serif; background: var(--background); letter-spacing: 0; }
a { color: var(--primary); }
h1, h2, h3, p { margin-top: 0; }
.app-body { --sidebar-width: 74px; }
.app-main { min-height: 100vh; margin-left: var(--sidebar-width); }
.container-xl { max-width: 1180px; }
.eyebrow { margin-bottom: 8px; color: var(--secondary); font-size: .75rem; font-weight: 800; letter-spacing: .08em; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; border-radius: 8px; font-weight: 700; line-height: 1.15; white-space: nowrap; transition: transform .2s, box-shadow .2s, border-color .2s, background .2s, color .2s; }
.btn-sm { min-height: 34px; padding-right: 12px; padding-left: 12px; font-size: .78rem; }
.btn:hover { transform: translateY(-2px); }
.btn-primary { border-color: var(--secondary); background: var(--secondary); }
.btn-primary:hover, .btn-primary:focus { border-color: #005f3f; background: #005f3f; }
.btn-outline-primary { border-color: var(--primary); color: var(--primary); }
.btn-outline-primary:hover { border-color: var(--primary); background: var(--primary); }
.btn-danger { border-color: var(--danger); background: var(--danger); }
.btn-danger:hover, .btn-danger:focus { border-color: #b93434; background: #b93434; }
.btn-outline-danger { border-color: var(--danger); color: var(--danger); }
.btn-outline-danger:hover, .btn-outline-danger:focus { border-color: var(--danger); color: #fff; background: var(--danger); }

.app-sidebar {
  position: fixed;
  z-index: 60;
  inset: 0 auto 0 0;
  display: flex !important;
  width: var(--sidebar-width);
  flex-direction: column;
  align-items: center;
  padding: 18px 10px;
  color: #fff;
  background: #006241;
  box-shadow: 6px 0 18px rgba(0,46,32,.12);
}
.sidebar-brand { display: grid; width: 46px; min-height: 28px; place-items: center; margin: 0 0 22px; color: #fff; text-decoration: none; }
.sidebar-brand:hover { color: #fff; }
.brand-logo { width: 42px; height: 42px; flex: 0 0 auto; object-fit: contain; border-radius: 8px; background: #fff; box-shadow: 0 8px 18px rgba(0,39,27,.18); }
.sidebar-brand-dot { display: block; width: 18px; height: 4px; border-radius: 999px; background: rgba(255,255,255,.72); }
.brand-mark { display: inline-grid; width: 38px; height: 38px; place-items: center; border-radius: 8px; color: #fff; background: var(--secondary); font-weight: 800; }
.sidebar-brand .brand-mark { flex: 0 0 auto; color: var(--primary-2); background: #fff; box-shadow: inset 0 -4px 0 var(--accent); }
.brand-mark.large { width: 54px; height: 54px; font-size: 1.5rem; }
.sidebar-brand strong, .sidebar-brand small { display: block; line-height: 1.15; }
.sidebar-brand small { margin-top: 3px; color: rgba(255,255,255,.68); font-size: .67rem; }
.sidebar-nav { display: grid; width: 100%; gap: 16px; }
.sidebar-link {
  display: flex;
  width: 100%;
  min-height: 56px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 6px 4px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: transparent;
  font: inherit;
  font-size: .58rem;
  font-weight: 600;
  line-height: 1.15;
  text-align: center;
  text-decoration: none;
  transition: color .2s, background .2s, transform .2s;
}
.sidebar-link svg { width: 24px; height: 24px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; }
.sidebar-link svg path { fill: none; stroke: currentColor; stroke-linejoin: round; }
.sidebar-link:hover, .sidebar-link:focus-visible { color: #fff; background: rgba(255,255,255,.12); transform: translateY(-1px); }
.sidebar-link.active { color: #fff; background: rgba(255,255,255,.13); box-shadow: inset 3px 0 0 var(--accent); }
.sidebar-link.active::after { display: none; }
.sidebar-logout { width: 100%; margin-top: auto; padding-top: 22px; border-top: 1px solid rgba(255,255,255,.28); }
.sidebar-toggle {
  position: fixed;
  z-index: 70;
  top: 14px;
  left: 14px;
  display: none;
  width: 44px;
  height: 44px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 8px;
  color: #fff;
  background: var(--primary);
  box-shadow: 0 8px 20px rgba(0,46,32,.22);
}
.sidebar-toggle:hover { background: var(--primary-2); }
.sidebar-toggle:focus { box-shadow: 0 0 0 .2rem rgba(255,196,0,.28); }
.menu-icon, .menu-icon::before, .menu-icon::after {
  display: block;
  width: 21px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform .2s ease, opacity .2s ease;
}
.menu-icon { position: relative; }
.menu-icon::before, .menu-icon::after { position: absolute; left: 0; content: ""; }
.menu-icon::before { top: -7px; }
.menu-icon::after { top: 7px; }
.sidebar-toggle[aria-expanded="true"] .menu-icon { background: transparent; }
.sidebar-toggle[aria-expanded="true"] .menu-icon::before { top: 0; transform: rotate(45deg); }
.sidebar-toggle[aria-expanded="true"] .menu-icon::after { top: 0; transform: rotate(-45deg); }
.mobile-brand { display: none; }
.sidebar-backdrop { display: none; }

.course-home { min-height: 100vh; padding: 26px clamp(28px, 4vw, 58px) 42px; background: #fff; }
.course-topbar { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 30px; padding-bottom: 18px; border-bottom: 1px solid #edf1ef; }
.course-logo { width: 150px; height: 54px; object-fit: contain; object-position: left center; }
.course-mark { display: grid; grid-template-columns: repeat(3, 7px); gap: 3px; width: 38px; justify-content: end; }
.course-mark span { width: 7px; height: 7px; border-radius: 1px; background: #1f8a4c; }
.course-mark span:nth-child(2), .course-mark span:nth-child(5) { background: #d33f2f; }
.course-section { margin-bottom: 46px; }
.course-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 14px; }
.course-heading h1 { margin-bottom: 4px; color: #3b3f3d; font-size: 1.32rem; font-weight: 800; }
.course-heading h2 { margin-bottom: 4px; color: #3b3f3d; font-size: 1.12rem; font-weight: 800; }
.course-heading p { margin: 0; color: #3f4542; font-size: .98rem; }
.course-heading > span { color: #71817a; font-size: .82rem; }
.course-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.course-card { position: relative; display: grid; min-height: 132px; align-content: center; width: 100%; padding: 22px 24px 20px; overflow: hidden; border: 1px solid #e1ebe6; border-radius: 6px; color: #222; background: #fbfcfb; font: inherit; text-align: left; text-decoration: none; cursor: pointer; box-shadow: 0 12px 24px rgba(0,0,0,.08); transition: border-color .2s, box-shadow .2s, transform .2s; }
.course-card:hover { color: #222; transform: translateY(-2px); }
.course-card:focus-visible { outline: 3px solid rgba(8,122,80,.22); outline-offset: 3px; }
.course-card[aria-selected="true"] { border-color: var(--primary); background: #fff; box-shadow: 0 16px 30px rgba(0,98,65,.14); }
.course-card[aria-selected="true"]::before { position: absolute; top: 0; right: 0; left: 0; height: 4px; background: var(--accent); content: ""; }
.course-card span { margin-bottom: 8px; color: var(--primary); font-size: .78rem; font-weight: 800; text-transform: uppercase; }
.course-card strong { display: -webkit-box; overflow: hidden; color: #2d3430; font-size: 1.05rem; font-weight: 800; line-height: 1.25; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.course-card small { margin-top: 8px; color: #6c7772; font-size: .75rem; font-weight: 700; }
.course-card i { position: absolute; right: 0; bottom: 0; left: 0; display: block; height: 4px; background: #eef2f0; }
.course-card i b { display: block; height: 100%; background: var(--primary); }
.course-selection-empty { display: grid; min-height: 170px; align-content: center; margin-bottom: 38px; padding: 28px; border: 1px dashed #cbd8d1; border-radius: 8px; background: #fbfcfb; text-align: center; }
.course-selection-empty strong { display: block; margin-bottom: 8px; color: var(--primary); font-size: 1.18rem; }
.course-selection-empty p { max-width: 460px; margin: 0 auto; color: var(--muted); line-height: 1.6; }
.course-module-section { scroll-margin-top: 24px; }
.course-modules { display: grid; grid-auto-columns: minmax(210px, 1fr); grid-auto-flow: column; gap: 16px; overflow-x: auto; padding: 6px 4px 16px; scroll-snap-type: x mandatory; }
.course-module-card { position: relative; display: grid; min-height: 104px; align-content: center; scroll-snap-align: start; padding: 22px 24px 18px; overflow: hidden; border: 1px solid #eef2f0; border-radius: 3px; color: #222; background: #fff; text-decoration: none; box-shadow: 0 12px 22px rgba(0,0,0,.09); }
.course-module-card:hover { color: #222; transform: translateY(-2px); }
.course-module-card span { margin-bottom: 4px; color: var(--primary); font-size: .94rem; font-weight: 700; }
.course-module-card strong { display: -webkit-box; overflow: hidden; color: #2d3430; font-size: .86rem; font-weight: 800; line-height: 1.25; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.course-module-card small { margin-top: 7px; color: #6c7772; font-size: .68rem; font-weight: 700; }
.course-module-card i { position: absolute; right: 0; bottom: 0; left: 0; display: block; height: 3px; background: #eef2f0; }
.course-module-card i b { display: block; height: 100%; background: var(--accent); }
.course-focus { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(310px, .7fr); gap: 24px; align-items: end; margin-bottom: 26px; }
.course-copy h2 { max-width: 440px; margin-bottom: 18px; color: var(--primary); font-size: 1.45rem; font-weight: 800; line-height: 1.2; }
.course-copy article { min-height: 236px; padding: 24px 30px; border: 1px solid #006241; border-radius: 8px; color: #26302c; background: #fff; font-size: .88rem; line-height: 1.55; }
.course-copy p:last-child { margin-bottom: 0; }
.course-video-card { position: relative; min-height: 236px; overflow: hidden; border: 1px solid #8bb8a9; border-radius: 8px; background: linear-gradient(180deg, #fff 0%, #fff 58%, #ffc400 58.3%, #ffc400 64%, #fff 64.3%); }
.video-people { position: absolute; right: 46px; bottom: 22px; display: flex; align-items: flex-end; gap: 18px; }
.person { position: relative; display: block; width: 88px; height: 142px; border-radius: 44px 44px 10px 10px; background: #f3c100; box-shadow: inset 0 -55px 0 #f4cf66; }
.person::before { position: absolute; top: -32px; left: 25px; width: 40px; height: 40px; border-radius: 50%; background: #b87959; content: ""; }
.person::after { position: absolute; top: 10px; left: -10px; width: 108px; height: 56px; border-radius: 999px 999px 12px 12px; background: rgba(0,98,65,.12); content: ""; }
.person-b { width: 94px; height: 152px; background: #006241; box-shadow: inset 0 -55px 0 #f7f7f7; }
.person-b::before { background: #7d4f3f; }
.play-button { position: absolute; right: 72px; top: 88px; display: grid; width: 58px; height: 58px; place-items: center; border-radius: 50%; background: var(--accent); box-shadow: 0 10px 22px rgba(0,0,0,.12); }
.play-button::before { width: 0; height: 0; margin-left: 4px; border-top: 11px solid transparent; border-bottom: 11px solid transparent; border-left: 16px solid #fff; content: ""; }
.video-progress { position: absolute; right: 64px; bottom: 12px; left: 64px; height: 5px; border-radius: 999px; background: #c8a20a; }
.video-progress span { display: block; width: 70%; height: 100%; border-radius: inherit; background: #705b05; }
.course-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; gap: 12px; align-items: center; max-width: 780px; }
.course-stats article { padding: 16px 18px; border: 1px solid #e5ece8; border-radius: 6px; background: #fbfcfb; }
.course-stats span { display: block; color: #71817a; font-size: .72rem; font-weight: 800; text-transform: uppercase; }
.course-stats strong { display: block; margin-top: 3px; color: var(--primary); font-size: 1.25rem; }
.dashboard-hero { padding: 54px 20px 58px; color: #fff; background: var(--primary); }
.dashboard-hero h1 { max-width: 800px; margin-bottom: 14px; font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 800; }
.dashboard-hero h1 span { color: #5de09b; }
.dashboard-hero > div > p:last-child { max-width: 650px; margin: 0; color: #d6e1e9; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 28px; padding: 38px 20px 70px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.section-heading h2 { margin: 0; font-size: 1.55rem; }
.section-heading > span { color: var(--muted); font-size: .85rem; }
.module-card { display: grid; grid-template-columns: 62px minmax(0, 1fr) auto; align-items: center; gap: 20px; margin-bottom: 14px; padding: 22px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: 0 2px 12px rgba(0,0,0,.05); }
.module-number { display: grid; width: 58px; height: 58px; place-items: center; border-radius: 8px; color: var(--primary); background: #e8f0f5; font-size: 1.2rem; font-weight: 800; }
.module-info h3 { margin-bottom: 8px; font-size: 1.08rem; }
.module-info p { margin-bottom: 14px; color: var(--muted); font-size: .86rem; line-height: 1.55; }
.module-meta { display: flex; gap: 14px; margin-bottom: 7px; color: var(--secondary); font-size: .7rem; font-weight: 800; text-transform: uppercase; }
.progress-track { overflow: hidden; height: 6px; border-radius: 3px; background: #e6ebef; }
.progress-track span { display: block; height: 100%; background: linear-gradient(90deg, var(--secondary), var(--accent)); }
.stats-panel { align-self: start; position: sticky; top: 28px; padding: 26px; border-radius: 8px; color: #fff; background: var(--primary-2); box-shadow: 0 6px 20px rgba(15,43,70,.2); }
.score-value { margin-top: 24px; font-size: 3.3rem; font-weight: 800; line-height: 1; }
.stats-panel > span { color: #aebdca; font-size: .8rem; }
.stat-row { display: flex; justify-content: space-between; margin: 24px 0; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.15); }
.stats-panel .btn { border-color: #fff; color: #fff; }

.auth-body { color: #fff; background: var(--primary-2); }
.auth-shell { display: grid; min-height: 100vh; grid-template-columns: minmax(300px, 480px); align-content: center; justify-content: center; padding: 80px 24px; background: radial-gradient(circle at 78% 12%, rgba(255,196,0,.18), transparent 28%), linear-gradient(rgba(0,75,52,.94), rgba(0,75,52,.97)); }
.auth-login { grid-template-columns: minmax(0, 1.15fr) minmax(340px, 440px); align-items: center; gap: clamp(28px, 5vw, 70px); padding: clamp(28px, 5vw, 68px); background: radial-gradient(circle at 78% 12%, rgba(255,196,0,.18), transparent 28%), linear-gradient(135deg, #005b3d 0%, #00462f 52%, #f7fbf7 52.2%, #f7fbf7 100%); }
.auth-brand { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 24px; font-size: 1.25rem; }
.auth-brand small { display: block; color: rgba(255,255,255,.78); font-size: .76rem; font-weight: 600; }
.auth-panel { padding: 34px; border-radius: 8px; color: var(--ink); background: #fff; box-shadow: 0 20px 50px rgba(0,0,0,.18); }
.auth-panel-wide { width: min(680px, calc(100vw - 48px)); margin-left: 50%; transform: translateX(-50%); }
.auth-panel h1, .auth-panel h2 { margin-bottom: 8px; font-size: 1.8rem; font-weight: 800; }
.auth-panel .form-control { min-height: 52px; border-color: #c9d8d0; border-radius: 8px; }
.auth-panel .form-control:focus { border-color: var(--secondary); box-shadow: 0 0 0 .2rem rgba(8,122,80,.14); }
.field-validation { display: block; min-height: 20px; margin-top: 5px; color: var(--danger); font-size: .78rem; }
.input-validation-error { border-color: var(--danger) !important; box-shadow: 0 0 0 .2rem rgba(214,69,69,.12); }
.validation-summary-valid { display: none; }
.validation-summary ul { margin-bottom: 0; padding-left: 18px; }
.auth-footer { margin: 24px 0 0; text-align: center; font-size: .88rem; }
.auth-ethos { position: fixed; right: 28px; bottom: 24px; display: flex; align-items: center; gap: 12px; max-width: 280px; }
.auth-ethos span, .ethos span { display: grid; width: 58px; height: 58px; flex: 0 0 auto; place-items: center; border: 3px solid var(--accent); border-radius: 50%; color: var(--primary-2); background: #fff; font-weight: 800; }
.auth-ethos p { margin: 0; color: #cdd8e0; font-size: .78rem; }
.login-story { position: relative; max-width: 760px; color: #fff; }
.login-story::before { position: absolute; z-index: 0; top: -70px; left: -82px; width: 190px; height: 100%; min-height: 620px; background: rgba(0,65,43,.72); transform: skewX(-21deg); content: ""; }
.login-story > * { position: relative; z-index: 1; }
.login-story .auth-brand { justify-content: flex-start; margin-bottom: clamp(28px, 6vw, 58px); }
.login-story .brand-mark { color: var(--primary-2); background: #fff; box-shadow: inset 0 -5px 0 var(--accent); }
.login-story .eyebrow { color: var(--accent); }
.login-story h1 { max-width: 680px; margin-bottom: 18px; font-size: clamp(2rem, 4.8vw, 4rem); font-weight: 800; line-height: 1.02; }
.login-copy { max-width: 620px; margin-bottom: 26px; color: rgba(255,255,255,.9); font-size: clamp(1rem, 1.6vw, 1.22rem); line-height: 1.7; }
.login-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 34px; }
.login-actions span { padding: 10px 14px; border: 1px solid rgba(255,255,255,.22); border-radius: 8px; color: #fbfff9; background: rgba(255,255,255,.1); font-size: .82rem; font-weight: 800; }
.course-preview { display: grid; grid-template-columns: 54px minmax(0, 1fr); width: min(650px, 100%); min-height: 250px; overflow: hidden; border: 1px solid rgba(255,255,255,.3); border-radius: 8px; background: #fff; box-shadow: 0 24px 70px rgba(0,0,0,.28); }
.preview-sidebar { display: grid; align-content: center; gap: 20px; padding: 18px 14px; background: var(--primary); }
.preview-sidebar span { display: block; width: 22px; height: 22px; border-radius: 6px; background: rgba(255,255,255,.86); }
.preview-screen { display: grid; grid-template-columns: minmax(0, 1fr) 160px; gap: 18px; align-items: center; padding: 28px; background: linear-gradient(135deg, #ffffff 0%, #ffffff 58%, #fff5c2 58.2%, #fff5c2 100%); }
.preview-video { display: grid; min-height: 164px; place-items: center; border-radius: 8px; background: linear-gradient(135deg, #eaf5ef, #ffffff); box-shadow: inset 0 0 0 1px #dce9e2; }
.play-mark { position: relative; display: grid; width: 62px; height: 62px; place-items: center; border-radius: 50%; color: #fff; background: var(--secondary); font-size: 1.3rem; box-shadow: 0 8px 20px rgba(8,122,80,.25); }
.play-mark::before { display: block; width: 0; height: 0; margin-left: 4px; border-top: 11px solid transparent; border-bottom: 11px solid transparent; border-left: 16px solid #fff; content: ""; }
.preview-modules { display: grid; gap: 12px; }
.preview-modules span { padding: 13px 12px; border-left: 6px solid var(--accent); border-radius: 8px; color: var(--primary); background: #fff; font-size: .75rem; font-weight: 800; box-shadow: 0 8px 18px rgba(0,0,0,.08); }
.auth-login .auth-panel { align-self: center; border-top: 6px solid var(--accent); transform: translateY(-54px); }
.auth-login .auth-panel .eyebrow { color: var(--secondary); }
.auth-login .auth-panel .btn-primary { box-shadow: 0 12px 20px rgba(8,122,80,.18); }

.reader-shell { min-height: 100vh; padding: 24px 30px 34px; background: #dfe7eb; }
.reader-topbar { display: grid; grid-template-columns: 42px minmax(0, 1fr) minmax(220px, 420px); align-items: center; gap: 16px; max-width: 1100px; margin: 0 auto 15px; }
.reader-topbar strong, .reader-topbar span { display: block; }
.reader-topbar div span, .reader-topbar > span { color: var(--muted); font-size: .75rem; }
.icon-link { display: grid; width: 40px; height: 40px; place-items: center; border: 1px solid #bac8d1; border-radius: 50%; text-decoration: none; background: #fff; }
.reader-progress { overflow: hidden; max-width: 1100px; height: 5px; margin: 0 auto 22px; border-radius: 3px; background: #c8d3d9; }
.reader-progress span { display: block; width: 0; height: 100%; background: var(--secondary); transition: width .4s; }
.book {
  position: relative;
  width: min(960px, 88vw);
  min-height: 560px;
  margin: 0 auto;
  filter: drop-shadow(0 12px 22px rgba(23,59,95,.14));
}
.book:has(.book-page.active .page-media-frame) { min-height: 760px; }
.book-page {
  position: absolute;
  inset: 0;
  overflow: hidden;
  visibility: hidden;
  padding: 70px 76px;
  border-radius: 6px;
  opacity: 0;
  background: #fffef8;
  box-shadow: 0 14px 36px rgba(23,59,95,.18);
  transform: translateX(18px);
  transition: opacity .35s ease, transform .35s ease, visibility .35s;
}
.book-page.active { z-index: 2; visibility: visible; opacity: 1; transform: translateX(0); }
.book-page.leaving-next { z-index: 3; visibility: visible; opacity: 0; transform: translateX(-18px); }
.book-page.leaving-prev { z-index: 3; visibility: visible; opacity: 0; transform: translateX(18px); }
.book-page.entering-next { z-index: 2; visibility: visible; opacity: 1; transform: translateX(0); }
.book-page.entering-prev { z-index: 2; visibility: visible; opacity: 1; transform: translateX(0); }
.book-page::after { display: none; }
.book-spine { display: none; }
.page-type { margin-bottom: 28px; color: var(--secondary); font-size: .72rem; font-weight: 800; }
.book-page h1 { max-width: 650px; margin-bottom: 30px; color: var(--primary); font-size: 2.4rem; font-weight: 800; }
.page-media-frame { position: relative; width: min(680px, 100%); margin: -8px 0 24px; overflow: hidden; border-radius: 8px; background: #06110d; box-shadow: 0 12px 28px rgba(0,0,0,.16); }
.page-media { display: block; width: 100%; border: 0; }
.page-video { aspect-ratio: 16 / 9; background: #000; }
.page-image-frame { background: #eef3ef; }
.page-image { max-height: 410px; object-fit: contain; }
.page-copy { max-width: 730px; font-size: 1.16rem; line-height: 1.8; }
.book-page[data-index] .page-copy::first-letter { color: var(--secondary); font-size: 2.3rem; font-weight: 800; }
.page-number { position: absolute; right: 36px; bottom: 28px; color: #8b969f; font-size: .75rem; }
.reader-controls { display: flex; justify-content: space-between; max-width: 960px; margin: 22px auto 0; }

.quiz-shell { width: min(900px, calc(100% - 40px)); margin: 0 auto; padding: 42px 0 70px; }
.quiz-header { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.quiz-header h1 { margin: 0; font-size: 1.55rem; }
.quiz-step { color: var(--muted); font-size: .85rem; }
.quiz-intro, .question-panel { padding: 42px; border: 1px solid var(--line); border-radius: 8px; background: #fff; box-shadow: 0 2px 12px rgba(0,0,0,.07); }
.quiz-intro { text-align: center; }
.intro-icon { display: grid; width: 70px; height: 70px; margin: 0 auto 24px; place-items: center; border-radius: 50%; color: #fff; background: var(--primary); font-size: 2rem; font-weight: 800; }
.quiz-intro > p { max-width: 580px; margin: 0 auto 28px; color: var(--muted); }
.intro-stats { display: flex; justify-content: center; gap: 38px; margin-bottom: 30px; }
.intro-stats span, .intro-stats strong { display: block; }
.intro-stats span { color: var(--muted); font-size: .78rem; }
.intro-stats strong { color: var(--primary); font-size: 1.25rem; }
.timer-row { display: grid; grid-template-columns: 1fr 52px; align-items: center; gap: 20px; margin-bottom: 30px; }
.question-progress { overflow: hidden; height: 8px; border-radius: 4px; background: #e6ebef; }
.question-progress span { display: block; width: 0; height: 100%; background: var(--secondary); transition: width .3s; }
.timer { display: grid; width: 52px; height: 52px; place-items: center; border: 5px solid var(--secondary); border-radius: 50%; color: var(--primary); font-weight: 800; }
.timer.warning { border-color: var(--accent); }
.timer.danger { border-color: var(--danger); color: var(--danger); }
.question-kind { display: inline-block; margin-bottom: 14px; color: var(--secondary); font-size: .72rem; font-weight: 800; text-transform: uppercase; }
.question-panel h2 { margin-bottom: 28px; font-size: 1.55rem; line-height: 1.4; }
.answers { display: grid; gap: 12px; margin-bottom: 24px; }
.answer-option { width: 100%; padding: 17px 20px; border: 1px solid #cbd5dc; border-radius: 8px; color: var(--ink); background: #fff; text-align: left; transition: border .2s, background .2s, transform .2s; }
.answer-option:hover { border-color: var(--secondary); transform: translateY(-1px); }
.answer-option.selected { border: 2px solid var(--secondary); background: #eaf8f1; }
.answer-option.correct { border-color: var(--success); background: #e7f6ed; }
.answer-option.wrong { border-color: var(--danger); background: #fdecec; }
.feedback { margin-top: 20px; padding: 18px; border-left: 4px solid var(--success); border-radius: 4px; background: #e7f6ed; }
.feedback.error { border-color: var(--danger); background: #fdecec; }

.result-hero { padding: 60px 20px; color: #fff; text-align: center; background: var(--success); }
.result-hero.retry { background: var(--primary); }
.result-hero h1 { font-weight: 800; }
.result-score { margin: 22px 0 8px; font-size: 5rem; font-weight: 800; line-height: 1; }
.result-score small { font-size: 2rem; }
.result-actions { display: flex; justify-content: center; gap: 12px; margin-top: 28px; }
.result-details { padding: 42px 20px 70px; }
.answer-review { margin-bottom: 12px; padding: 22px; border: 1px solid var(--line); border-left: 5px solid var(--success); border-radius: 8px; background: #fff; }
.answer-review.wrong { border-left-color: var(--danger); }
.review-status { float: right; color: var(--success); font-size: .75rem; font-weight: 800; text-transform: uppercase; }
.wrong .review-status { color: var(--danger); }
.answer-review h3 { padding-right: 80px; font-size: 1rem; }
.review-grid { display: grid; grid-template-columns: 1fr 1fr 160px; gap: 18px; }
.review-grid small { color: var(--muted); }
.review-grid p { margin: 5px 0 0; font-size: .86rem; }

.page-band { padding: 42px 20px; color: #fff; background: var(--primary); }
.page-band h1 { margin: 0; font-size: 2.15rem; font-weight: 800; }
.ranking-filter { width: min(420px, 100%); }
.ranking-filter .form-select { min-height: 48px; border: 1px solid rgba(220,233,226,.18); border-radius: 8px; color: #fff; background-color: rgba(3,55,39,.82); box-shadow: 0 12px 34px rgba(0,0,0,.18); }
.ranking-wrap, .admin-content { padding: 34px 20px 70px; }
.ranking-page { min-height: 100vh; padding: 42px 20px 80px; color: #f2fbf6; background: radial-gradient(circle at 50% 0%, rgba(255,196,0,.12), transparent 25%), radial-gradient(circle at 88% 32%, rgba(8,122,80,.28), transparent 26%), linear-gradient(180deg, #003b2a 0%, #004b34 45%, #022f23 100%); }
.ranking-hero { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 26px; text-align: left; }
.ranking-hero h1 { margin-bottom: 10px; color: #fff; font-size: clamp(2rem, 4vw, 3.45rem); font-weight: 800; line-height: 1.04; }
.ranking-hero p { max-width: 620px; margin: 0; color: #c5d9cf; line-height: 1.7; }
.ranking-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; max-width: 860px; margin: 0 auto 28px; }
.ranking-summary article, .ranking-board, .podium-card { border: 1px solid rgba(220,233,226,.16); border-radius: 8px; background: rgba(3,55,39,.82); box-shadow: 0 18px 50px rgba(0,0,0,.22); backdrop-filter: blur(14px); }
.ranking-summary article { padding: 22px; text-align: center; }
.ranking-summary span { display: block; color: #95b0a4; font-size: .74rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.ranking-summary strong { display: block; margin-top: 8px; color: var(--accent); font-size: 2rem; font-weight: 800; line-height: 1; }
.ranking-podium { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; gap: 18px; max-width: 900px; margin: 0 auto 24px; }
.podium-card { position: relative; overflow: hidden; min-height: 250px; padding: 30px 24px 26px; text-align: center; }
.podium-card::before { position: absolute; top: 0; right: 0; left: 0; height: 4px; background: var(--accent); content: ""; }
.podium-card.first { min-height: 284px; background: linear-gradient(180deg, rgba(255,196,0,.12), rgba(3,55,39,.84)); }
.podium-card.second::before { background: #cbd2d8; }
.podium-card.third::before { background: #d99a61; }
.podium-medal { display: grid; width: 42px; height: 42px; place-items: center; margin: 0 auto 16px; border-radius: 50%; color: #173126; background: var(--accent); font-weight: 800; }
.podium-card.second .podium-medal { background: #cbd2d8; }
.podium-card.third .podium-medal { background: #d99a61; }
.podium-avatar { display: grid; width: 74px; height: 74px; place-items: center; margin: 0 auto 16px; border-radius: 50%; color: #173126; background: linear-gradient(135deg, var(--accent), #20d879); font-size: 2rem; font-weight: 800; }
.podium-card h2 { margin-bottom: 6px; color: #fff; font-size: 1.15rem; font-weight: 800; }
.podium-card p { margin-bottom: 18px; color: #95b0a4; font-size: .84rem; }
.podium-card strong { color: var(--accent); font-size: 2rem; font-weight: 800; line-height: 1; }
.ranking-board { padding: 24px 24px 10px; }
.ranking-board .eyebrow { color: #5fe09b; }
.ranking-board .admin-card-heading h2 { color: #fff; }
.ranking-table { margin: 0; color: #f2fbf6; }
.ranking-table th { padding: 0 16px 14px; border: 0; color: #95b0a4; background: transparent; font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; }
.ranking-table td { padding: 16px; border-color: rgba(220,233,226,.1); color: #f2fbf6; background: transparent; vertical-align: middle; }
.ranking-table tbody tr:hover { background: rgba(255,255,255,.035); }
.ranking-table td:nth-child(2) { display: grid; grid-template-columns: 42px 1fr; align-items: center; column-gap: 12px; }
.ranking-table td:nth-child(2) .avatar { grid-row: 1 / 3; }
.ranking-table td small { color: #95b0a4; }
.avatar { display: grid; width: 40px; height: 40px; place-items: center; margin-right: 0; border-radius: 8px; color: #173126; background: linear-gradient(135deg, var(--accent), #20d879); font-weight: 800; }
.rank { display: inline-grid; width: 36px; height: 36px; place-items: center; border-radius: 50%; color: #173126; background: #dce9e2; font-weight: 800; }
.rank-1 { background: var(--accent); }.rank-2 { background: #cbd2d8; }.rank-3 { background: #d99a61; }
.current-user { background: rgba(255,196,0,.1); }
.ranking-student-page { color: var(--ink); }
.ranking-student-heading { align-items: center; }
.ranking-student-page .ranking-filter .form-select { min-height: 48px; border-color: #c9d8d0; color: var(--ink); background-color: #fff; box-shadow: 0 10px 22px rgba(0,0,0,.07); }
.ranking-student-page .ranking-summary { max-width: none; margin: 0; }
.ranking-student-page .ranking-summary article, .ranking-student-page .ranking-board, .ranking-student-page .podium-card { border-color: #e1ebe6; background: #fbfcfb; box-shadow: 0 12px 24px rgba(0,0,0,.08); backdrop-filter: none; }
.ranking-student-page .ranking-summary span { color: #71817a; }
.ranking-student-page .ranking-summary strong { color: var(--primary); }
.ranking-student-page .ranking-podium { max-width: none; margin: 0 0 24px; }
.ranking-student-page .podium-card { min-height: 218px; }
.ranking-student-page .podium-card.first { min-height: 244px; background: linear-gradient(180deg, #fff8d8, #fbfcfb); }
.ranking-student-page .podium-card h2, .ranking-student-page .podium-card strong, .ranking-student-page .ranking-board .admin-card-heading h2 { color: #2d3430; }
.ranking-student-page .podium-card p { color: #71817a; }
.ranking-student-page .podium-card strong { font-size: 1.8rem; }
.ranking-student-page .ranking-board { padding: 24px 24px 10px; }
.ranking-student-page .ranking-board .eyebrow { color: var(--secondary); }
.ranking-student-page .admin-card-heading > span { color: #71817a; }
.ranking-student-page .ranking-table { color: var(--ink); }
.ranking-student-page .ranking-table th { color: #71817a; }
.ranking-student-page .ranking-table td { border-color: #edf1ef; color: var(--ink); }
.ranking-student-page .ranking-table tbody tr:hover { background: #f5f8f4; }
.ranking-student-page .ranking-table td small { color: #71817a; }
.ranking-student-page .current-user { background: #fff8d8; }
.admin-dashboard { min-height: calc(100vh - 72px); padding: 42px 20px 80px; color: var(--ink); background: #fff; }
.admin-hero { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.admin-hero-actions { display: flex; flex: 0 0 auto; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.admin-hero h1 { max-width: 780px; margin-bottom: 10px; color: #3b3f3d; font-size: clamp(2rem, 4vw, 3.2rem); font-weight: 800; line-height: 1.04; }
.admin-hero p { max-width: 670px; margin: 0; color: #3f4542; font-size: 1rem; line-height: 1.7; }
.admin-kicker { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 18px; padding: 9px 14px; border: 1px solid #dce9e2; border-radius: 8px; color: var(--secondary); background: #f5f8f4; font-size: .76rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.admin-kicker span, .signal-row span { width: 8px; height: 8px; border-radius: 50%; background: #38d878; box-shadow: 0 0 0 5px rgba(56,216,120,.1); }
.admin-dashboard .btn-light { flex: 0 0 auto; border: 1px solid #e1ebe6; color: var(--primary); background: #fbfcfb; box-shadow: 0 10px 22px rgba(0,0,0,.07); }
.admin-dashboard .btn-light:hover { border-color: var(--primary); color: #fff; background: var(--primary); }
.admin-dashboard .btn-outline-light { border-color: var(--primary); color: var(--primary); background: #fff; }
.admin-dashboard .btn-outline-light:hover { color: #fff; background: var(--primary); }
.admin-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 22px; }
.admin-stats article, .admin-card { border: 1px solid #e1ebe6; border-radius: 8px; background: #fbfcfb; box-shadow: 0 12px 24px rgba(0,0,0,.08); backdrop-filter: none; }
.admin-stats article { position: relative; overflow: hidden; min-height: 142px; padding: 24px; }
.admin-stats article::before { position: absolute; top: 0; right: 0; left: 0; height: 3px; background: linear-gradient(90deg, var(--secondary), #20d879, var(--accent)); content: ""; opacity: .86; }
.admin-stats span, .admin-stats strong, .admin-stats small { position: relative; z-index: 1; display: block; }
.admin-stats span { color: #71817a; font-size: .78rem; font-weight: 800; text-transform: uppercase; }
.admin-stats strong { margin-top: 14px; color: var(--primary); font-size: 2.55rem; font-weight: 800; line-height: 1; }
.admin-stats small { margin-top: 12px; color: #71817a; font-size: .82rem; }
.admin-insights { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(280px, .55fr); gap: 18px; margin-bottom: 20px; }
.admin-card { padding: 24px; }
.admin-card .eyebrow { color: var(--secondary); }
.admin-card-heading { display: flex; align-items: start; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.admin-card-heading h2, .admin-signal-card h2 { margin: 0; color: #2d3430; font-size: 1.35rem; font-weight: 800; }
.admin-card-heading > span { color: #71817a; font-size: .86rem; font-weight: 700; }
.admin-progress-card .admin-card-heading > span { color: var(--primary); font-size: 2.35rem; font-weight: 800; line-height: 1; }
.admin-progress-track { overflow: hidden; height: 12px; border-radius: 8px; background: #eef2f0; box-shadow: inset 0 0 0 1px #e1ebe6; }
.admin-progress-track span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--primary), #20d879); }
.admin-progress-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 22px; }
.admin-progress-grid div { padding: 16px; border: 1px solid #e1ebe6; border-radius: 8px; background: #fff; }
.admin-progress-grid span { display: block; color: #71817a; font-size: .76rem; font-weight: 800; text-transform: uppercase; }
.admin-progress-grid strong { display: block; margin-top: 8px; color: var(--primary); font-size: 1.45rem; }
.admin-signal-list { display: grid; gap: 8px; margin-top: 12px; }
.admin-signal-list p { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0; padding: 8px 0; border-bottom: 1px solid #edf1ef; color: #3f4542; line-height: 1.2; }
.admin-signal-list p:last-child { border-bottom: 0; }
.admin-signal-list strong { color: var(--primary); font-size: 1.1rem; font-weight: 800; line-height: 1; }
.admin-signal-list span { color: #71817a; font-size: .82rem; font-weight: 700; text-align: right; }
.admin-kpi-panel { margin-bottom: 20px; }
.kpi-stats strong { font-size: 2.25rem; }
.course-kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.course-kpi-card { display: grid; gap: 18px; padding: 18px; border: 1px solid #e1ebe6; border-radius: 8px; background: #fff; }
.course-kpi-card > div:first-child strong { display: block; color: #2d3430; font-size: 1rem; font-weight: 800; line-height: 1.3; }
.course-kpi-card > div:first-child span { display: block; margin-top: 6px; color: #71817a; font-size: .8rem; font-weight: 700; }
.mini-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.mini-kpis span { display: grid; min-height: 72px; align-content: center; padding: 12px; border: 1px solid #edf1ef; border-radius: 8px; color: #71817a; background: #fbfcfb; font-size: .7rem; font-weight: 800; text-transform: uppercase; }
.mini-kpis b { display: block; margin-bottom: 4px; color: var(--primary); font-size: 1.15rem; line-height: 1; }
.admin-module-name strong, .admin-module-name span { display: block; }
.admin-module-name strong { max-width: 420px; color: #2d3430; font-size: .92rem; line-height: 1.35; }
.admin-module-name span { margin-top: 4px; color: #71817a; font-size: .76rem; font-weight: 700; }
.signal-row { display: flex; align-items: center; gap: 10px; margin-top: 14px; padding-top: 14px; border-top: 1px solid #e1ebe6; color: #2d3430; }
.admin-table-card { padding-bottom: 10px; }
.admin-table { margin: 0; color: var(--ink); }
.admin-table thead th { padding: 0 16px 14px; border: 0; color: #71817a; background: transparent; font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; }
.admin-table tbody td { padding: 16px; border-color: #edf1ef; color: var(--ink); background: transparent; vertical-align: middle; }
.admin-table tbody tr:hover, .admin-table tbody tr.selected-row { background: #f5f8f4; }
.admin-table-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; min-width: 220px; }
.admin-table-actions form { display: contents; }
.admin-table-actions .btn { box-shadow: none; }
.admin-title-link { color: #2d3430; font-weight: 800; text-decoration: none; }
.admin-title-link:hover { color: var(--primary); text-decoration: underline; }
.admin-user { display: flex; align-items: center; gap: 12px; min-width: 190px; }
.admin-user span { display: grid; width: 40px; height: 40px; flex: 0 0 auto; place-items: center; border-radius: 8px; color: #173126; background: linear-gradient(135deg, var(--accent), #20d879); font-weight: 800; }
.admin-user strong { color: #2d3430; font-size: .95rem; }
.admin-status { display: inline-flex; align-items: center; min-width: 104px; justify-content: center; padding: 7px 10px; border-radius: 8px; font-size: .74rem; font-weight: 800; }
.admin-status.completed { color: var(--success); background: rgba(56,216,120,.12); }
.admin-status.running { color: #8a6a00; background: rgba(255,196,0,.18); }
.admin-status.expired { color: var(--danger); background: rgba(214,69,69,.12); }
.admin-score strong { display: block; color: #2d3430; font-size: .86rem; }
.admin-score span { display: block; overflow: hidden; width: 120px; height: 6px; margin-top: 8px; border-radius: 8px; background: #eef2f0; }
.admin-score i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--primary), #20d879); }
.admin-empty-row { padding: 36px 16px !important; color: #71817a !important; text-align: center; }
.content-order { display: inline-grid; width: 36px; height: 36px; place-items: center; border-radius: 50%; color: #173126; background: var(--accent); font-weight: 800; }
.content-description { display: block; max-width: 620px; margin-top: 5px; color: #71817a; }
.admin-form-card { max-width: 760px; }
.admin-form { display: grid; gap: 18px; }
.admin-form .alert { margin-bottom: 0; }
.admin-check { display: flex; align-items: center; gap: 12px; margin: 0; padding: 16px 18px; border: 1px solid #e1ebe6; border-radius: 8px; background: #fff; color: #2d3430; font-size: .9rem; font-weight: 700; cursor: pointer; }
.admin-check .form-check-input { flex: 0 0 auto; margin: 0; }
.course-classes-card { margin-top: 20px; }
.course-selected-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.course-selected-actions form:not(.class-course-filter) { display: contents; }
.class-course-filter { min-width: min(320px, 100%); }
.admin-empty-panel { display: grid; gap: 6px; padding: 24px; border: 1px dashed #c9d8d0; border-radius: 8px; color: #71817a; background: #fff; }
.admin-empty-panel strong { color: #2d3430; }
.class-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.class-card { display: grid; gap: 16px; min-width: 0; padding: 18px; border: 1px solid #e1ebe6; border-radius: 8px; background: #fff; }
.class-card-compact { gap: 12px; min-height: 150px; color: var(--ink); text-decoration: none; transition: border-color .2s, box-shadow .2s, transform .2s; }
.class-card-compact:hover { border-color: var(--primary); color: var(--ink); box-shadow: 0 16px 28px rgba(0,98,65,.12); transform: translateY(-2px); }
.class-card-compact:focus-visible { outline: 3px solid rgba(8,122,80,.22); outline-offset: 3px; }
.class-card-compact .class-card-heading { padding-bottom: 10px; }
.class-card-heading { display: flex; align-items: start; justify-content: space-between; gap: 14px; padding-bottom: 14px; border-bottom: 1px solid #edf1ef; }
.class-card-heading span, .class-card-heading small { display: block; color: #71817a; font-size: .74rem; font-weight: 800; text-transform: uppercase; }
.class-card-heading strong { display: block; margin-top: 3px; color: var(--primary); font-size: 1.35rem; }
.class-compact-body { display: grid; gap: 12px; align-content: space-between; min-height: 64px; }
.class-compact-body span { display: -webkit-box; overflow: hidden; color: #71817a; font-size: .82rem; line-height: 1.35; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.class-compact-body strong { color: var(--primary); font-size: .82rem; font-weight: 800; }
.class-empty { margin: 0; color: #71817a; font-size: .88rem; }
.class-students { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.class-student { display: grid; grid-template-columns: 40px minmax(0, 1fr); align-items: center; gap: 10px; }
.class-student > span { display: grid; width: 40px; height: 40px; place-items: center; border-radius: 8px; color: #173126; background: linear-gradient(135deg, var(--accent), #20d879); font-weight: 800; }
.class-student strong, .class-student small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.class-student strong { color: #2d3430; font-size: .92rem; }
.class-student small { color: #71817a; font-size: .76rem; }
.class-actions { display: grid; grid-template-columns: minmax(280px, .9fr) minmax(340px, 1.1fr); gap: 14px; align-items: start; padding-top: 16px; border-top: 1px solid #edf1ef; }
.class-action-block { display: grid; gap: 10px; }
.class-action-block-muted { padding: 14px; border: 1px solid #e1ebe6; border-radius: 8px; background: #fbfcfb; }
.class-action-heading { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 10px; }
.class-action-heading strong { color: #2d3430; font-size: .92rem; }
.class-action-heading span { color: #71817a; font-size: .75rem; font-weight: 700; }
.class-add-student { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
.class-create-student { display: grid; grid-template-columns: repeat(2, minmax(150px, 1fr)); gap: 12px; align-items: end; }
.class-create-student .btn { grid-column: 1 / -1; }
.class-detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 440px); gap: 18px; align-items: start; }
.class-detail-students, .class-detail-actions { min-width: 0; }
.class-detail-actions { display: grid; gap: 16px; }
.class-students-detail { grid-template-columns: 1fr; }
.content-editor { min-height: calc(100vh - 72px); padding: 42px 20px 80px; }
.content-editor-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 26px; }
.content-editor-heading h1 { margin-bottom: 8px; color: var(--primary); font-size: clamp(2rem, 4vw, 3.2rem); font-weight: 800; }
.content-editor-heading p:last-child { margin: 0; color: var(--muted); }
.content-editor-form { display: grid; gap: 20px; }
.editor-card { padding: 28px; border: 1px solid var(--line); border-radius: 8px; background: #fff; box-shadow: 0 8px 28px rgba(0,0,0,.07); }
.editor-card-heading, .page-editor-heading, .editor-actions { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.editor-card-heading { margin-bottom: 22px; }
.editor-card-heading h2 { margin: 0; font-size: 1.35rem; font-weight: 800; }
.editor-module-grid { display: grid; grid-template-columns: minmax(0, 1fr) 150px 190px; gap: 18px; }
.editor-field-wide { grid-column: 1 / -1; }
.form-group label { display: block; margin-bottom: 7px; font-size: .82rem; font-weight: 800; }
.form-group small { display: block; margin-top: 6px; color: var(--muted); font-size: .75rem; }
.page-editor { margin-top: 18px; padding: 22px; border: 1px solid var(--line); border-left: 5px solid var(--secondary); border-radius: 8px; background: #f9fbf9; }
.page-editor:first-child { margin-top: 0; }
.page-editor-heading { margin-bottom: 18px; }
.page-editor-heading strong { color: var(--primary); font-size: 1.05rem; }
.page-editor-grid { display: grid; grid-template-columns: 120px minmax(240px, 1fr) 210px; gap: 16px; }
.editor-field-title { min-width: 0; }
.code-field { min-height: 150px; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: .84rem; }
.editor-actions { justify-content: flex-end; padding-top: 4px; }
.verification, .empty-state { display: grid; min-height: 70vh; place-items: center; align-content: center; padding: 30px; text-align: center; }
.verification-mark { display: grid; width: 72px; height: 72px; place-items: center; margin-bottom: 20px; border-radius: 50%; color: #fff; background: var(--success); font-size: 2.4rem; }
.verification-mark.invalid { background: var(--danger); }
.empty-state > span { color: var(--danger); font-size: 3rem; font-weight: 800; }
.ethos { position: fixed; z-index: 40; right: 18px; bottom: 18px; filter: drop-shadow(0 5px 10px rgba(0,0,0,.18)); }

@media (max-width: 1100px) {
  .app-body::before { position: fixed; z-index: 55; inset: 0 0 auto; height: 72px; background: var(--primary-2); box-shadow: 0 3px 14px rgba(0,0,0,.16); content: ""; }
  .app-main { min-height: calc(100vh - 72px); margin-left: 0; padding-top: 72px; }
  .sidebar-toggle { display: grid; place-items: center; }
  .mobile-brand { position: fixed; z-index: 56; top: 13px; left: 72px; display: flex; align-items: center; gap: 9px; color: #fff; font-size: .92rem; font-weight: 800; line-height: 1.05; text-decoration: none; }
  .mobile-brand:hover { color: #fff; }
  .mobile-brand img { width: 40px; height: 40px; object-fit: contain; border-radius: 8px; background: #fff; }
  .mobile-brand small { display: block; margin-top: 4px; color: rgba(255,255,255,.65); font-size: .62rem; font-weight: 600; }
  .app-sidebar { display: none !important; width: min(280px, calc(100vw - 54px)); padding-top: 84px; }
  .app-sidebar.show { display: flex !important; }
  .sidebar-brand { margin-bottom: 28px; }
  .app-body:has(.app-sidebar.show) { overflow: hidden; }
  .app-body:has(.app-sidebar.show) .sidebar-backdrop { position: fixed; z-index: 58; inset: 0; display: block; border: 0; background: rgba(0,28,19,.58); }
  .app-body:has(.app-sidebar.show) .sidebar-toggle { left: 14px; }
  .reader-shell, .ranking-page { min-height: calc(100vh - 72px); }
}

@media (max-width: 900px) {
  .course-home { padding: 24px 18px 46px; }
  .course-focus { grid-template-columns: 1fr; }
  .course-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .course-stats .btn { grid-column: 1 / -1; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .stats-panel { position: static; }
  .ranking-hero { align-items: start; flex-direction: column; }
  .ranking-filter { width: 100%; }
  .ranking-podium { grid-template-columns: 1fr; }
  .podium-card, .podium-card.first { min-height: auto; }
  .admin-dashboard { padding-top: 30px; }
  .admin-hero { align-items: start; flex-direction: column; }
  .editor-module-grid { grid-template-columns: 1fr 1fr; }
  .editor-module-grid .editor-field-wide { grid-column: 1 / -1; }
  .page-editor-grid { grid-template-columns: 110px 1fr; }
  .page-editor-grid .editor-field-wide { grid-column: 1 / -1; }
  .admin-insights { grid-template-columns: 1fr; }
  .class-detail-grid { grid-template-columns: 1fr; }
  .class-actions { grid-template-columns: 1fr; }
  .auth-login { grid-template-columns: minmax(0, 680px); align-content: start; padding: 34px 22px 50px; background: linear-gradient(180deg, #005b3d 0%, #00462f 55%, #f7fbf7 55.2%, #f7fbf7 100%); }
  .login-story { max-width: none; }
  .login-story::before { display: none; }
  .login-story h1 { max-width: 640px; }
  .course-preview { min-height: 210px; }
  .auth-login .auth-panel { width: 100%; transform: translateY(0); }
  .reader-topbar { grid-template-columns: 42px 1fr; }
  .reader-topbar > span { display: none; }
  .book { width: min(700px, 92vw); min-height: 520px; }
  .book:has(.book-page.active .page-media-frame) { min-height: 700px; }
  .book-page { padding: 55px 48px; }
  .review-grid { grid-template-columns: 1fr 1fr; }
  .admin-stats { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 620px) {
  .course-topbar { align-items: start; margin-bottom: 22px; }
  .course-logo { width: 118px; height: 46px; }
  .course-heading { align-items: start; flex-direction: column; gap: 8px; }
  .course-modules { grid-auto-columns: minmax(180px, 78vw); }
  .course-copy article { padding: 20px 18px; }
  .course-video-card { min-height: 220px; }
  .video-people { right: 22px; transform: scale(.82); transform-origin: right bottom; }
  .play-button { right: 44px; top: 82px; }
  .course-stats { grid-template-columns: 1fr; }
  .dashboard-hero { padding: 38px 18px; }
  .dashboard-grid { padding: 28px 16px 60px; }
  .ranking-page { padding: 24px 12px 54px; }
  .ranking-hero h1 { font-size: 2rem; }
  .ranking-summary { grid-template-columns: 1fr; }
  .ranking-summary article, .ranking-board, .podium-card { padding: 18px; }
  .ranking-table th, .ranking-table td { padding-right: 12px; padding-left: 12px; }
  .ranking-table td:nth-child(2) { min-width: 190px; }
  .admin-dashboard { padding: 24px 12px 54px; }
  .admin-hero h1 { font-size: 2rem; }
  .admin-hero-actions { width: 100%; flex-direction: column; }
  .admin-hero-actions .btn { width: 100%; }
  .content-editor { padding: 28px 12px 54px; }
  .content-editor-heading { align-items: start; flex-direction: column; }
  .editor-card { padding: 20px 16px; }
  .editor-card-heading { align-items: start; flex-direction: column; }
  .editor-actions { align-items: stretch; flex-direction: column-reverse; }
  .editor-actions .btn { width: 100%; }
  .editor-module-grid, .page-editor-grid { grid-template-columns: 1fr; }
  .editor-module-grid .editor-field-wide, .page-editor-grid .editor-field-wide { grid-column: auto; }
  .page-editor { padding: 18px 14px; }
  .admin-stats article, .admin-card { padding: 18px; }
  .admin-stats strong { font-size: 2rem; }
  .admin-progress-grid { grid-template-columns: 1fr; }
  .course-kpi-grid { grid-template-columns: 1fr; }
  .mini-kpis { grid-template-columns: 1fr; }
  .admin-table thead th, .admin-table tbody td { padding-right: 12px; padding-left: 12px; }
  .admin-table-actions { min-width: 190px; justify-content: flex-start; }
  .admin-table-actions .btn { width: 100%; }
  .course-selected-actions { width: 100%; flex-direction: column; }
  .course-selected-actions .btn, .class-course-filter { width: 100%; }
  .class-list { grid-template-columns: 1fr; }
  .class-students { grid-template-columns: 1fr; }
  .class-add-student, .class-create-student { grid-template-columns: 1fr; }
  .class-create-student .btn { width: 100%; }
  .admin-user { min-width: 170px; }
  .admin-score span { width: 96px; }
  .module-card { grid-template-columns: 46px 1fr; gap: 14px; padding: 17px; }
  .module-number { width: 44px; height: 44px; }
  .module-card .btn { grid-column: 1 / -1; }
  .auth-shell { padding: 38px 18px; }
  .auth-login { gap: 24px; padding: 24px 16px 38px; }
  .auth-login .auth-brand { justify-content: flex-start; }
  .auth-panel { padding: 25px 20px; }
  .login-story .auth-brand { margin-bottom: 26px; }
  .login-story h1 { font-size: 1.95rem; line-height: 1.08; }
  .login-copy { font-size: .98rem; }
  .login-actions { margin-bottom: 22px; }
  .login-actions span { flex: 1 1 150px; text-align: center; }
  .course-preview { grid-template-columns: 42px minmax(0, 1fr); min-height: 180px; }
  .preview-sidebar { gap: 14px; padding: 14px 10px; }
  .preview-sidebar span { width: 18px; height: 18px; }
  .preview-screen { grid-template-columns: 1fr; padding: 18px; }
  .preview-video { min-height: 116px; }
  .preview-modules { display: none; }
  .play-mark { width: 52px; height: 52px; }
  .auth-ethos { display: none; }
  .reader-shell { padding: 18px 12px 28px; }
  .book { width: 100%; min-height: 540px; }
  .book:has(.book-page.active .page-media-frame) { min-height: 650px; }
  .book-page { padding: 45px 28px; }
  .book-page h1 { font-size: 1.8rem; }
  .page-media-frame { margin-top: -4px; }
  .page-copy { font-size: 1rem; }
  .quiz-shell { width: calc(100% - 24px); padding-top: 25px; }
  .quiz-header { align-items: start; flex-direction: column; }
  .quiz-intro, .question-panel { padding: 25px 20px; }
  .intro-stats { gap: 15px; }
  .result-actions { align-items: stretch; flex-direction: column; }
  .review-grid { grid-template-columns: 1fr; }
  .admin-stats { grid-template-columns: 1fr; }
  .ethos { display: none; }
}
