/* Public site — Stage 8.1-C: sidebar overflow / scrolling polish. Independent of Filament. */
:root {
  color-scheme:light;
  --brand:#039d8f;--brand-deep:#006e65;--primary:#00796f;--on-primary:#fff;
  --accent:#c79a53;--accent-soft:#fff0d9;
  --tint:#e6f7f4;--tint-strong:#d4eee9;--accent-contrast:#005f57;
  --background:#f7f9f8;--surface:#fff;--surface-soft:#f3f8f7;
  --text:#142e2c;--muted:#516763;--border:#dce7e4;
  --shadow:0 8px 27px rgb(18 50 44 / 7%);--shadow-strong:0 10px 26px rgb(23 49 45 / 12%);
  --focus:#00796f;--header-tint:#f7fbfa;--stripe-text:#fff;
  --hero-top:#f7fbfa;--hero-bottom:#ecf8f4;--panel-gradient-a:#018e80;--panel-gradient-b:#005b54;
  --illustration-sky:#d4efec;
}
:root[data-palette='ocean'] {
  --brand:#2563eb;--brand-deep:#1e40af;--primary:#1d4ed8;--tint:#eff6ff;--tint-strong:#dbeafe;
  --accent-contrast:#1e40af;--focus:#1d4ed8;--header-tint:#f7faff;--hero-top:#f7faff;--hero-bottom:#ebf5ff;
  --panel-gradient-a:#2563eb;--panel-gradient-b:#173d9c;--illustration-sky:#dbeafe;
}
:root[data-palette='violet'] {
  --brand:#7c3aed;--brand-deep:#5b21b6;--primary:#6d28d9;--tint:#f5f3ff;--tint-strong:#e9d5ff;
  --accent-contrast:#5b21b6;--focus:#6d28d9;--header-tint:#faf8ff;--hero-top:#fbf9ff;--hero-bottom:#f3edff;
  --panel-gradient-a:#8351d3;--panel-gradient-b:#4b258a;--illustration-sky:#e9d5ff;
}
:root[data-palette='copper'] {
  --brand:#c26123;--brand-deep:#843b18;--primary:#9a491b;--tint:#fff5ed;--tint-strong:#ffdfc5;
  --accent-contrast:#843b18;--focus:#9a491b;--header-tint:#fffaf6;--hero-top:#fffaf6;--hero-bottom:#fff1e5;
  --panel-gradient-a:#bd6931;--panel-gradient-b:#813916;--illustration-sky:#ffe4ca;
}
:root[data-appearance='dark'] {
  color-scheme:dark;
  --background:#111b1a;--surface:#1c2b29;--surface-soft:#263735;--text:#eff6f4;--muted:#baccc9;--border:#354946;
  --shadow:0 9px 26px rgb(0 0 0 / 22%);--shadow-strong:0 15px 32px rgb(0 0 0 / 28%);
  --primary:#64d8ca;--on-primary:#102b27;--tint:#244942;--tint-strong:#315f56;--accent-contrast:#9ce7d9;
  --focus:#64d8ca;--header-tint:#202e2c;--hero-top:#203733;--hero-bottom:#1a2826;
  --panel-gradient-a:#0a766c;--panel-gradient-b:#074943;--stripe-text:#fff;--illustration-sky:#305650;
  --accent:#edc37e;--accent-soft:#4a3a27;
}
:root[data-appearance='dark'][data-palette='ocean'] {
  --primary:#93c5fd;--on-primary:#102234;--tint:#243d5b;--tint-strong:#305176;--accent-contrast:#b8d9ff;
  --focus:#93c5fd;--hero-top:#1d334b;--hero-bottom:#182b3a;--panel-gradient-a:#254c96;--panel-gradient-b:#172c60;--illustration-sky:#345376;
}
:root[data-appearance='dark'][data-palette='violet'] {
  --primary:#c4b5fd;--on-primary:#24163c;--tint:#41345c;--tint-strong:#51426d;--accent-contrast:#dfd5ff;
  --focus:#c4b5fd;--hero-top:#352b47;--hero-bottom:#28253a;--panel-gradient-a:#6644a4;--panel-gradient-b:#362460;--illustration-sky:#54416f;
}
:root[data-appearance='dark'][data-palette='copper'] {
  --primary:#f2af84;--on-primary:#342012;--tint:#543728;--tint-strong:#66432f;--accent-contrast:#ffccab;
  --focus:#f2af84;--hero-top:#423127;--hero-bottom:#2e2621;--panel-gradient-a:#a2542c;--panel-gradient-b:#5b301e;--illustration-sky:#60412d;
}
* { box-sizing:border-box; }
html { scroll-behavior:smooth;scroll-padding-top:105px; }
body { margin:0;min-height:100vh;min-height:100dvh;display:flex;flex-direction:column;background:var(--background);color:var(--text);font-family:'IBM Plex Sans Arabic','Noto Sans Arabic','Segoe UI',Tahoma,Arial,sans-serif;font-size:16px;line-height:1.65;-webkit-font-smoothing:antialiased; }
a { color:inherit;text-decoration:none; }
a:hover { color:var(--primary); }
button,input { font:inherit; }
button { cursor:pointer; }
svg { width:22px;height:22px;flex-shrink:0; }
[hidden] { display:none !important; }
:where(a,button,input,summary):focus-visible {outline:3px solid var(--focus);outline-offset:3px;}
.visually-hidden {position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0;}
.skip-link { position:fixed;z-index:250;top:8px;right:12px;transform:translateY(-150%);background:var(--primary);color:var(--on-primary);padding:10px 16px;border-radius:10px; }
.skip-link:focus {transform:translateY(0);color:var(--on-primary);}

/* Fixed identity and navigation */
.site-header {height:76px;position:sticky;top:0;z-index:60;border-bottom:1px solid var(--border);background:var(--surface);box-shadow:0 4px 18px rgb(20 40 37 / 4%);}
.site-header::after {content:'';position:absolute;bottom:0;right:0;left:0;height:1px;background:linear-gradient(90deg,transparent,var(--accent),transparent);opacity:.38;pointer-events:none;}
.header-inner {max-width:1540px;margin:auto;height:100%;padding:0 36px;display:flex;align-items:center;justify-content:space-between;gap:28px;}
.header-leading,.brand,.header-nav,.header-link {display:flex;align-items:center;}
.header-leading {gap:12px;flex-shrink:0;}
.brand {gap:11px;}
.brand:hover {color:var(--text);}
.brand-mark {width:47px;height:47px;display:grid;place-items:center;border-radius:12px;background:linear-gradient(145deg,var(--tint),var(--surface));color:var(--brand-deep);border:1px solid var(--border);box-shadow:0 2px 0 var(--accent);}
.brand-mark svg {width:32px;height:32px;}
.brand-copy strong {font-size:22px;font-weight:850;letter-spacing:-.6px;white-space:nowrap;}
.header-nav {gap:13px;margin-inline:auto;min-width:0;overflow-x:auto;scrollbar-width:none;}
.header-nav::-webkit-scrollbar {display:none;}
.header-link {gap:9px;border-radius:12px;padding:11px 15px;min-height:45px;font-size:14px;font-weight:750;color:var(--text);white-space:nowrap;transition:background .18s,color .18s,box-shadow .18s;}
.header-link svg {width:19px;height:19px;}
.header-link:hover {background:var(--surface-soft);}
.header-link.is-current {background:var(--primary);color:var(--on-primary);box-shadow:0 4px 0 rgb(23 60 52 / 9%);}
.header-link.is-current:hover {color:var(--on-primary);}
.header-search {border:1px solid var(--border);background:var(--surface-soft);border-radius:13px;display:flex;align-items:center;width:290px;height:44px;min-width:170px;flex-shrink:1;transition:border-color .18s;}
.header-search:focus-within {border-color:var(--brand);}
.header-search input {min-width:0;flex:1;width:100%;border:0;outline:0;background:transparent;color:var(--text);font-size:12px;padding:0 13px;}
.header-search input::placeholder {color:var(--muted);opacity:.9;}
.header-search button {width:44px;height:100%;display:grid;place-items:center;background:transparent;color:var(--text);border:0;border-radius:12px;}
.header-search button svg {width:19px;height:19px;}
.student-header-links {display:flex;align-items:center;gap:7px;flex-shrink:0;}
.student-header-link {display:inline-flex;align-items:center;justify-content:center;white-space:nowrap;min-height:40px;padding:7px 12px;border:1px solid var(--border);border-radius:10px;color:var(--text);font-size:13px;font-weight:700;}
.student-header-link:hover {border-color:var(--primary);background:var(--tint);}
.student-header-signup {background:var(--primary);border-color:var(--primary);color:var(--on-primary);}
.student-header-signup:hover {background:var(--brand-deep);color:#fff;}
.icon-button {border:1px solid var(--border);background:var(--surface);color:var(--text);border-radius:10px;min-width:44px;min-height:44px;display:grid;place-items:center;}
.menu-button,.sidebar-close {display:none;}

/* Desktop page shell */
.site-grid {max-width:1540px;width:100%;flex:1 0 auto;margin:0 auto;padding:0 34px;display:grid;grid-template-columns:270px minmax(0,1fr);gap:27px;align-items:start;}
.site-sidebar {position:sticky;top:89px;width:100%;min-width:0;max-height:calc(100dvh - 104px);overflow:hidden;min-height:0;margin:13px 0 28px;border:1px solid var(--border);border-radius:18px;background:var(--surface);box-shadow:var(--shadow);display:flex;flex-direction:column;}
.sidebar-head {height:69px;min-height:69px;background:linear-gradient(115deg,var(--panel-gradient-a),var(--panel-gradient-b));color:#fff;display:flex;align-items:center;justify-content:space-between;padding:0 21px;position:relative;overflow:hidden;}
.sidebar-head::before,.stage-heading::before {content:'';position:absolute;inset:0;pointer-events:none;opacity:.15;background-image:repeating-radial-gradient(circle at 0% 100%,transparent 0 14px,rgba(255,255,255,.3) 15px 16px,transparent 17px 29px);background-size:200px 180px;}
.sidebar-heading {display:flex;gap:10px;align-items:center;font-weight:850;font-size:18px;position:relative;}
.sidebar-heading svg {width:21px;height:21px;}
.sidebar-navigation {padding:17px 12px 19px;min-width:0;min-height:0;max-width:100%;flex:0 1 auto;overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;}
.side-home-link {display:flex;align-items:center;gap:10px;padding:11px 13px;min-height:45px;border-radius:10px;font-weight:750;font-size:13px;}
.side-home-link svg {width:19px;height:19px;}
.side-home-link.is-current,.nav-grade.is-current {background:var(--tint);color:var(--accent-contrast);}
.sidebar-section-label {margin:20px 13px 11px;padding-top:14px;border-top:1px solid var(--border);font-weight:800;font-size:13px;color:var(--text);}
.nav-curriculum {margin:0 2px 6px;border-bottom:1px solid var(--border);padding-bottom:6px;}
.nav-curriculum summary {list-style:none;cursor:pointer;display:flex;align-items:center;justify-content:space-between;gap:9px;border-radius:8px;padding:9px 11px;font-size:13px;font-weight:750;min-height:42px;min-width:0;overflow-wrap:anywhere;}
.nav-curriculum summary::-webkit-details-marker {display:none;}
.nav-expand-icon {font-size:20px;color:var(--muted);transition:transform .2s;}
.nav-curriculum[open] .nav-expand-icon {transform:rotate(180deg);}
.nav-stage {padding:5px 10px 9px 0;display:flex;flex-direction:column;}
.nav-stage-name {font-size:12px;font-weight:800;color:var(--text);padding:10px 11px 8px;}
.nav-grade {display:flex;align-items:center;gap:9px;padding:8px 12px;border-radius:8px;font-size:12px;line-height:1.5;min-height:39px;min-width:0;overflow-wrap:anywhere;}
.nav-grade-dot {width:8px;height:8px;border-radius:100%;background:var(--border);flex-shrink:0;}
.nav-grade.is-current .nav-grade-dot {background:var(--primary);}
.sidebar-empty {font-size:12px;color:var(--muted);padding:5px 14px;}
.appearance-panel {background:var(--surface);margin:0 13px;padding:16px 12px 8px;border-top:1px solid var(--border);flex-shrink:0;min-width:0;}
.appearance-title {display:flex;align-items:center;gap:9px;font-size:14px;margin-bottom:12px;}
.appearance-title svg {width:19px;height:19px;color:var(--primary);}
.palette-options {display:flex;justify-content:space-around;align-items:center;gap:6px;}
.palette-choice {border:2px solid transparent;background:transparent;border-radius:50%;width:42px;height:42px;padding:5px;display:grid;place-items:center;}
.palette-choice span {display:block;width:25px;height:25px;border-radius:50%;background:var(--swatch);box-shadow:inset 0 -4px 4px rgb(0 0 0 / 9%);}
.palette-choice[aria-pressed='true'] {border-color:var(--primary);}
.mode-options {display:flex;border:1px solid var(--border);border-radius:10px;overflow:hidden;margin-top:12px;}
.mode-options button {border:0;background:var(--surface);color:var(--muted);flex:1;min-height:39px;padding:5px 2px;font-size:11px;}
.mode-options button + button {border-inline-start:1px solid var(--border);}
.mode-options button[aria-pressed='true'] {background:var(--tint);color:var(--accent-contrast);font-weight:800;}
.theme-reset {border:0;background:transparent;color:var(--muted);font-size:10px;text-decoration:underline;margin:8px 0 0;min-height:27px;width:100%;}
.sidebar-bottom-art {height:58px;overflow:hidden;color:var(--brand);margin:3px 0 0;opacity:.8;flex-shrink:0;min-width:0;}
.sidebar-bottom-art svg {width:100%;height:100%;display:block;}
.site-main {min-width:0;padding:25px 0 28px;}

/* Educational decoration: quiet enough for reading, lively enough for primary grades */
.home-title-area,.grade-title-area {height:155px;border-radius:18px;display:flex;justify-content:space-between;align-items:center;position:relative;overflow:hidden;border:1px solid var(--border);background:linear-gradient(115deg,var(--hero-top),var(--hero-bottom));padding:12px 25px;box-shadow:0 3px 14px rgb(24 62 51 / 3%);}
.home-title-area::before,.grade-title-area::before {content:'';position:absolute;inset:auto -8% -72px -8%;height:135px;border-radius:50% 50% 0 0;background:var(--tint-strong);opacity:.3;pointer-events:none;}
.home-title-copy,.grade-title-copy {position:relative;z-index:1;display:flex;align-items:center;gap:15px;min-width:0;}
.home-title-area h1,.grade-title-area h1 {font-size:clamp(26px,2.7vw,37px);font-weight:850;letter-spacing:-.8px;margin:0;line-height:1.45;}
.title-rule {width:5px;height:41px;border-radius:5px;background:var(--brand);box-shadow:0 0 0 5px var(--tint);}
.home-title-art,.grade-title-art {width:370px;max-width:49%;height:150px;align-self:end;position:relative;z-index:1;pointer-events:none;}
.school-art {width:100%;height:100%;filter:drop-shadow(0 6px 5px rgb(0 0 0 / 7%));}
.art-hill-far {fill:var(--illustration-sky);}
.art-hill-near {fill:var(--tint-strong);}
.art-star,.art-gold-fill {fill:var(--accent);}
.art-cloud {fill:var(--surface);stroke:var(--border);stroke-width:1.5;}
.art-cover,.art-cup {fill:var(--brand-deep);stroke:var(--brand-deep);stroke-width:2;}
.art-cover-alt,.art-pencil-teal,.art-stem {stroke:var(--brand);fill:var(--brand);stroke-width:2;}
.art-pencil-gold {fill:var(--accent);stroke:var(--accent);stroke-width:3;}
.art-pencil-rose {fill:#dd7c6d;stroke:#dd7c6d;stroke-width:2;}
.art-paper,.art-book-page {fill:var(--surface);stroke:var(--brand-deep);stroke-width:2;}
.art-outline,.art-bookmark {stroke:var(--brand-deep);stroke-width:2.3;stroke-linecap:round;}
.art-bookmark {fill:var(--accent);}
.art-gold-line {stroke:var(--accent);stroke-width:2.5;stroke-linecap:round;}
.art-ink {stroke:var(--muted);fill:none;stroke-width:1.8;}
.art-leaf {fill:var(--brand);opacity:.7;}
.art-sparkles {fill:var(--accent);stroke:var(--accent);stroke-width:2;stroke-linecap:round;}
.grades-content {padding-top:26px;}
.curriculum-group + .curriculum-group {margin-top:34px;}
.curriculum-title {font-size:18px;font-weight:800;margin:0 0 15px;padding:0 4px;color:var(--text);}
.stage-section {margin:0 0 28px;}
.stage-section + .stage-section {margin-top:26px;}
.stage-heading {position:relative;min-height:53px;display:flex;align-items:center;justify-content:space-between;background:linear-gradient(112deg,var(--panel-gradient-a),var(--panel-gradient-b));color:var(--stripe-text);border-radius:13px;border:1px solid rgb(255 255 255 / 17%);box-shadow:0 4px 11px rgb(0 0 0 / 9%);margin:0 0 15px;padding:0 15px 0 22px;overflow:hidden;}
.stage-heading::after {content:'';position:absolute;top:0;right:0;bottom:0;width:4px;background:var(--accent);}
.stage-heading-title {display:flex;align-items:center;gap:12px;position:relative;z-index:1;}
.stage-heading h2,.stage-heading h3 {font-size:20px;font-weight:850;line-height:1.5;margin:0;}
.stage-symbol {width:40px;height:40px;display:grid;place-items:center;border-radius:11px;border:1px solid rgb(255 255 255 / 23%);color:#fff;box-shadow:inset 0 0 0 1px rgb(199 154 83 / 45%);}
.stage-symbol svg {width:25px;height:25px;}
.stage-ornament {height:2px;width:85px;max-width:16%;background:linear-gradient(90deg,transparent,var(--accent));opacity:.8;border-radius:2px;}
.grade-grid,.subject-grid {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;}
.grade-card {display:flex;align-items:center;gap:12px;min-height:86px;border-radius:15px;border:1px solid var(--border);background:linear-gradient(180deg,var(--surface),var(--surface-soft));padding:13px 13px;box-shadow:0 2px 2px rgb(0 0 0 / 4%),var(--shadow);position:relative;overflow:hidden;transition:transform .18s,border-color .18s,box-shadow .18s;}
.grade-card::after {content:'';position:absolute;bottom:0;left:0;right:0;height:2px;background:linear-gradient(90deg,transparent,var(--brand),transparent);opacity:.26;}
.grade-card:hover {color:var(--text);transform:translateY(-2px);border-color:var(--brand);box-shadow:var(--shadow-strong);}
.grade-symbol {width:53px;height:53px;display:grid;place-items:center;flex-shrink:0;border-radius:16px;background:var(--tint);}
.grade-symbol svg {width:44px;height:44px;filter:drop-shadow(0 3px 2px rgb(0 0 0 / 10%));}
.book-cover {fill:var(--brand-deep);stroke:var(--brand-deep);stroke-width:1.8;}
.book-accent,.book-bookmark {fill:var(--accent);}
.book-page {fill:var(--surface);stroke:var(--brand-deep);stroke-width:1.7;}
.book-stroke {stroke:var(--brand-deep);stroke-width:1.7;stroke-linejoin:round;stroke-linecap:round;}
.book-page-line {stroke:var(--border);stroke-width:2.3;}
.grade-name {font-size:15px;font-weight:800;min-width:0;line-height:1.55;}
.grade-chevron {margin-inline-start:auto;width:31px;height:31px;display:grid;place-items:center;flex-shrink:0;border-radius:10px;background:var(--surface);color:var(--brand-deep);border:1px solid var(--border);}
.grade-chevron svg {width:17px;height:17px;}
.grade-card:hover .grade-chevron {background:var(--tint);color:var(--primary);}

/* Grade and subject pages */
.breadcrumbs {display:flex;align-items:center;flex-wrap:wrap;gap:11px;font-size:12px;color:var(--muted);margin:0 0 18px;}
.breadcrumbs [aria-current='page'] {color:var(--text);font-weight:800;}
.grade-title-area {height:143px;}
.grade-title-copy {display:block;}
.grade-caption {color:var(--accent-contrast);display:block;font-size:12px;font-weight:800;margin-bottom:4px;}
.grade-title-area h1 {font-size:clamp(23px,2.8vw,32px);}
.grade-title-art {width:320px;height:137px;}
.subject-heading {margin:0 0 17px;}
.subject-card {border:1px solid var(--border);background:var(--surface);border-radius:15px;padding:19px;box-shadow:var(--shadow);min-height:150px;}
.subject-symbol {background:var(--tint);color:var(--primary);width:46px;height:46px;border-radius:12px;display:grid;place-items:center;}
.subject-symbol svg {width:24px;height:24px;}
.subject-card h3 {font-size:16px;margin:12px 0 5px;}
.subject-pending {color:var(--muted);font-size:11px;}
.empty-state {border:1px dashed var(--border);background:var(--surface);border-radius:16px;padding:33px 20px;text-align:center;}
.empty-state h2 {font-size:16px;margin:0 0 8px;}
.empty-state-icon {background:var(--tint);color:var(--primary);border-radius:13px;width:52px;height:52px;display:grid;place-items:center;margin:0 auto 15px;}
.empty-state-icon svg {width:27px;height:27px;}
.text-link {display:inline-flex;color:var(--accent-contrast);font-weight:800;font-size:12px;text-decoration:underline;text-underline-offset:3px;}
.search-empty {margin-top:15px;}

/* V2.19: responsive, configurable footer groups (up to four columns per row). */
.site-footer {border-top:1px solid var(--border);background:var(--surface);margin-top:auto;flex-shrink:0;}
.footer-inner {max-width:1540px;margin:0 auto;padding:30px 35px 15px;}
.footer-columns {display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:28px 32px;align-items:start;}
.footer-columns > * {min-width:0;}
.footer-info h2,.footer-group h2 {font-size:15px;line-height:1.5;font-weight:800;margin:0 0 13px;color:var(--text);}
.footer-info h2 a {color:inherit;text-decoration:none;}
.footer-description {font-size:13px;line-height:1.9;color:var(--muted);margin:0 0 10px;overflow-wrap:anywhere;}
.footer-contact-list,.footer-group-links {display:flex;flex-direction:column;align-items:flex-start;gap:9px;}
.footer-contact-list a,.footer-group-links a {font-size:13px;line-height:1.7;color:var(--muted);text-decoration:none;overflow-wrap:anywhere;}
.footer-contact-list a:hover,.footer-group-links a:hover {color:var(--primary);text-decoration:underline;}
.footer-group-links a[aria-current="page"] {font-weight:700;color:var(--primary);}
.footer-bottom {margin-top:27px;padding-top:14px;border-top:1px solid var(--border);font-size:12px;color:var(--muted);text-align:center;line-height:1.8;}
@media (max-width:950px) {.footer-columns {grid-template-columns:repeat(2,minmax(0,1fr));gap:24px;}}
@media (max-width:580px) {.footer-inner {padding:22px 17px 14px;}.footer-columns {grid-template-columns:minmax(0,1fr);gap:23px;}.footer-info h2,.footer-group h2 {margin-bottom:8px;}.footer-bottom {margin-top:20px;}}
.mobile-backdrop {display:none;}

@media (max-width:1260px) {
  .header-inner,.site-grid,.footer-inner {padding-left:20px;padding-right:20px;}
  .header-inner {gap:12px;}
  .header-search {width:210px;}
  .brand-copy strong {font-size:19px;}
  .site-grid {grid-template-columns:246px minmax(0,1fr);gap:20px;}
  .grade-name {font-size:13px;}
  .grade-symbol {width:45px;height:45px;}
  .grade-symbol svg {width:40px;height:40px;}
  .grade-grid {gap:10px;}
}
@media (max-width:1000px) {
  .header-nav {gap:1px;}
  .header-link {font-size:12px;padding:10px 9px;}
  .header-search {width:175px;}
  .grade-grid,.subject-grid {grid-template-columns:repeat(2,minmax(0,1fr));}
}
@media (max-width:1080px) {
  .site-header {height:68px;}
  .header-inner {padding:0 17px;gap:12px;}
  .menu-button,.sidebar-close {display:grid;}
  .header-nav {display:none;}
  .site-grid {display:block;padding:0 16px;}
  .site-sidebar {position:fixed;z-index:110;top:0;right:0;bottom:auto;width:min(335px,calc(100vw - 32px));max-height:100dvh;height:auto;min-height:0;margin:0;border-radius:0 0 0 18px;transform:translateX(110%);transition:transform .22s ease;box-shadow:var(--shadow-strong);overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;}
  body.sidebar-open .site-sidebar {transform:translateX(0);}
  body.sidebar-open {overflow:hidden;}
  .mobile-backdrop {position:fixed;inset:0;z-index:100;background:rgb(0 0 0 / 55%);}
  body.sidebar-open .mobile-backdrop {display:block;}
  .sidebar-close {position:relative;z-index:1;background:transparent;border-color:rgb(255 255 255 / 35%);color:white;}
  .site-main {padding:14px 0 22px;}
  /* Tablet and mobile use dense educational cards rather than desktop-height tiles. */
  .home-title-area,.grade-title-area {height:110px;padding:11px 16px;}
  .home-title-area h1 {font-size:clamp(22px,4vw,28px);}
  .home-title-art,.grade-title-art {height:90px;max-width:43%;}
  .grades-content {padding-top:16px;}
  .stage-heading {min-height:45px;margin-bottom:10px;}
  .stage-heading h2,.stage-heading h3 {font-size:16px;}
  .stage-symbol {width:33px;height:33px;}
  .grade-card {min-height:48px;padding:6px 10px;gap:9px;border-radius:12px;}
  .grade-symbol {width:32px;height:32px;border-radius:10px;}
  .grade-symbol svg {width:29px;height:29px;}
  .grade-name {font-size:13px;line-height:1.4;}
  .grade-chevron {width:29px;height:29px;border-radius:8px;}
  .grade-chevron svg {width:15px;height:15px;}
  .stage-section {margin-bottom:16px;}
  .stage-section + .stage-section {margin-top:18px;}
  /* Mobile drawer follows its content: no large empty space above appearance controls. */
  .sidebar-head {height:56px;min-height:56px;padding:0 15px;position:sticky;top:0;z-index:2;}
  .sidebar-heading {font-size:16px;}
  .sidebar-navigation {padding:9px 11px 8px;flex:0 0 auto;overflow:visible;}
  .side-home-link {min-height:42px;padding:7px 11px;}
  .sidebar-section-label {margin:10px 11px 5px;padding-top:10px;}
  .nav-curriculum {margin-bottom:3px;padding-bottom:5px;}
  .nav-curriculum summary {min-height:39px;padding:6px 10px;}
  .nav-stage {padding:0 6px 3px 0;}
  .nav-stage-name {padding:5px 10px 3px;font-size:12px;}
  .nav-grade {min-height:38px;padding:7px 11px;}
  .appearance-panel {margin:0 12px;padding:11px 6px 7px;flex:0 0 auto;}
  .appearance-title {margin-bottom:5px;font-size:13px;}
  .palette-options {justify-content:space-evenly;gap:3px;}
  .mode-options {margin-top:5px;}
  .mode-options button {min-height:36px;}
  .theme-reset {min-height:26px;margin-top:3px;}
  .sidebar-bottom-art {height:40px;min-height:40px;margin:4px 0 0;}
}
@media (max-width:580px) {
  .brand-copy strong {font-size:15px;}
  .brand-mark {width:36px;height:36px;}
  .brand-mark svg {width:25px;height:25px;}
  .header-inner {padding:0 11px;}
  .student-header-signup {display:none;}
  .student-header-link {font-size:12px;padding:6px 10px;min-height:38px;}
  .header-search {min-width:0;width:44px;height:42px;}
  .header-search:not(:focus-within) input {width:0;flex:0;padding:0;opacity:0;}
  .header-search:focus-within {position:absolute;left:11px;right:64px;width:auto;z-index:2;background:var(--surface);box-shadow:var(--shadow-strong);}
  .header-search:focus-within input {width:100%;flex:1;padding:0 11px;opacity:1;}
  .site-grid {padding:0 12px;}
  .home-title-area,.grade-title-area {height:98px;padding:10px 13px;border-radius:14px;}
  .home-title-area h1 {font-size:clamp(19px,5.2vw,24px);}
  .title-rule {height:29px;width:4px;}
  .home-title-art {max-width:40%;height:80px;}
  .grade-title-art {max-width:40%;height:78px;}
  .grades-content {padding-top:14px;}
  .stage-heading {min-height:43px;border-radius:11px;margin-bottom:9px;padding:0 11px 0 13px;}
  .stage-heading h2,.stage-heading h3 {font-size:15px;}
  .stage-symbol {width:30px;height:30px;border-radius:8px;}
  .stage-symbol svg {width:21px;height:21px;}
  .grade-grid,.subject-grid {grid-template-columns:1fr;gap:7px;}
  .grade-card {min-height:46px;padding:5px 10px;gap:9px;border-radius:11px;}
  .grade-name {font-size:13px;line-height:1.35;}
  .grade-symbol {width:30px;height:30px;border-radius:9px;}
  .grade-symbol svg {width:27px;height:27px;}
  .grade-chevron {width:29px;height:29px;border-radius:8px;}
  .grade-chevron svg {width:15px;height:15px;}
  .stage-section {margin-bottom:14px;}
  .stage-section + .stage-section {margin-top:16px;}
  .curriculum-group + .curriculum-group {margin-top:20px;}
  .grade-title-area h1 {font-size:clamp(20px,5vw,24px);}
}
@media (max-width:375px) {
  .home-title-art,.grade-title-art {max-width:36%;}
  .home-title-area h1 {font-size:19px;}
}
@media (prefers-reduced-motion:reduce) {
  *,*::before,*::after {scroll-behavior:auto!important;transition:none!important;animation:none!important;}
}

/* Stage 8.2-A/B — real subject links and published subject landing pages. */
.subject-card {display:flex;align-items:center;gap:13px;min-height:86px;padding:15px 17px;min-width:0;}
.subject-card h3 {flex:1;min-width:0;margin:0;line-height:1.5;font-size:15px;}
.subject-card-link {transition:border-color .16s,transform .16s,box-shadow .16s;}
.subject-card-link:hover {border-color:var(--primary);transform:translateY(-2px);box-shadow:var(--shadow-strong);color:var(--text);}
.subject-card-inactive {box-shadow:none;background:var(--surface-soft);}
.subject-card-inactive .subject-symbol {opacity:.62;}
.subject-card-arrow {width:30px;height:30px;flex:none;display:grid;place-items:center;border-radius:9px;border:1px solid var(--border);color:var(--primary);}
.subject-card-arrow svg {width:17px;height:17px;}
.subject-sections {padding-top:24px;}
.subject-books-area {padding-top:15px;}
.subject-books-section {margin:0 0 17px;min-width:0;padding:15px 17px;border:1px solid var(--border);border-radius:16px;background:var(--surface);box-shadow:var(--shadow);}
.subject-books-grid {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-top:12px;min-width:0;}
.subject-books-grid--list,.subject-books-grid--sided {grid-template-columns:minmax(0,1fr);}
.subject-books-grid--cover,.subject-books-grid--vcover {grid-template-columns:repeat(3,minmax(0,1fr));}
.subject-books-grid--broadcast .subject-book-card:first-child {grid-column:1/-1;}
.subject-books-grid > .subject-book-card:only-child {grid-column:1/-1;}
.subject-book-card {display:grid;grid-template-columns:82px minmax(0,1fr);align-items:start;gap:12px;min-width:0;padding:11px;border:1px solid var(--border);border-radius:13px;background:var(--surface-soft);}
.subject-books-grid > .subject-book-card:only-child .subject-book-copy {display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;column-gap:clamp(14px,2vw,26px);}
.subject-books-grid > .subject-book-card:only-child .subject-book-edition {grid-column:1;grid-row:1;}
.subject-books-grid > .subject-book-card:only-child .subject-book-copy h3 {grid-column:1;grid-row:2;}
.subject-books-grid > .subject-book-card:only-child .subject-book-term {grid-column:1;grid-row:3;}
.subject-books-grid > .subject-book-card:only-child .subject-book-actions {grid-column:2;grid-row:1/5;flex-direction:column;min-width:112px;margin-top:0;}
.subject-books-grid > .subject-book-card:only-child .subject-book-index-link {grid-column:1;grid-row:4;}
.subject-book-cover {width:82px;aspect-ratio:3/4;overflow:hidden;border:1px solid var(--border);border-radius:8px;background:var(--surface);}
.subject-book-cover img {display:block;width:100%;height:100%;object-fit:contain;}
.subject-book-cover-placeholder {display:flex;width:100%;height:100%;flex-direction:column;align-items:center;justify-content:center;gap:4px;padding:4px;color:var(--muted);font-size:9px;text-align:center;}
.subject-book-cover-placeholder svg {width:35px;height:35px;color:var(--primary);}
.subject-book-copy {min-width:0;}
.subject-book-edition {display:block;margin-bottom:3px;color:var(--primary);font-size:11px;font-weight:700;line-height:1.5;overflow-wrap:anywhere;}
.subject-book-copy h3 {margin:0;color:var(--text);font-size:14px;line-height:1.55;overflow-wrap:anywhere;}
.subject-book-term {margin:4px 0 0;color:var(--muted);font-size:11px;line-height:1.5;overflow-wrap:anywhere;}
.subject-book-actions {display:flex;flex-wrap:wrap;gap:6px;margin-top:9px;}
.subject-book-action {display:inline-flex;min-height:32px;align-items:center;justify-content:center;padding:6px 9px;border:1px solid var(--primary);border-radius:8px;font-size:11px;font-weight:700;line-height:1.35;text-align:center;text-decoration:none;}
.subject-book-action-primary {background:var(--primary);color:#fff;}
.subject-book-action-primary:hover {background:var(--primary-strong,var(--primary));color:#fff;}
.subject-book-action-secondary {background:var(--surface);color:var(--primary);}
.subject-book-action-secondary:hover {background:var(--surface-soft);color:var(--primary);}
.subject-book-action:focus-visible,.subject-book-index-link:focus-visible {outline:3px solid color-mix(in srgb,var(--primary) 35%,transparent);outline-offset:2px;}
.subject-book-index-link {display:inline-block;margin-top:7px;color:var(--primary);font-size:11px;font-weight:700;line-height:1.5;text-decoration:underline;text-underline-offset:3px;overflow-wrap:anywhere;}
.subject-section-title {margin-bottom:20px;}
.subject-section-description {font-size:14px;color:var(--muted);margin:9px 5px 0;}
.subject-content-grid {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:13px;margin-top:15px;min-width:0;}
.subject-content-grid--list {grid-template-columns:minmax(0,1fr);}
.subject-content-card {display:flex;align-items:flex-start;gap:14px;min-width:0;padding:16px;border:1px solid var(--border);border-radius:14px;background:var(--surface);box-shadow:var(--shadow);}
.subject-content-image {flex:none;width:104px;aspect-ratio:4/3;overflow:hidden;border-radius:10px;background:var(--surface-soft);}
.subject-content-image img {display:block;width:100%;height:100%;object-fit:cover;}
.subject-content-copy {min-width:0;overflow-wrap:anywhere;}
.subject-content-copy h3 {margin:0;color:var(--text);font-size:16px;line-height:1.55;}
.subject-content-copy p {margin:7px 0 0;color:var(--muted);font-size:13px;line-height:1.7;}
.subject-content-meta {display:block;margin-bottom:5px;color:var(--primary);font-size:12px;font-weight:700;line-height:1.4;overflow-wrap:anywhere;}
.subject-content-grid--list {gap:8px;}
.subject-content-grid--list .subject-content-card {box-shadow:none;border-inline-start:3px solid var(--primary);padding:11px 14px;}
.subject-content-grid--cover {grid-template-columns:repeat(3,minmax(0,1fr));}
.subject-content-grid--cover .subject-content-card {flex-direction:column;gap:10px;padding:10px;}
.subject-content-grid--cover .subject-content-image {width:100%;aspect-ratio:16/9;}
.subject-content-grid--cover .subject-content-copy {padding:0 4px 5px;}
.subject-content-grid--vcover {grid-template-columns:repeat(4,minmax(0,1fr));}
.subject-content-grid--vcover .subject-content-card {flex-direction:column;gap:9px;padding:10px;}
.subject-content-grid--vcover .subject-content-image {width:100%;aspect-ratio:3/4;}
.subject-content-grid--vcover .subject-content-copy {padding:0 3px 4px;}
.subject-content-grid--broadcast .subject-content-card:first-child {grid-column:1/-1;padding:18px;border-inline-start:4px solid var(--primary);background:var(--surface-soft);}
.subject-content-grid--broadcast .subject-content-card:first-child .subject-content-image {width:min(32%,210px);aspect-ratio:16/9;}
.subject-content-grid--broadcast .subject-content-card:first-child h3 {font-size:19px;}
.subject-content-grid--sided {grid-template-columns:minmax(0,1fr);}
.subject-content-grid--sided .subject-content-card {align-items:center;min-height:112px;}
.subject-content-grid--sided .subject-content-card:nth-child(even) {flex-direction:row-reverse;}
.subject-content-card-link {text-decoration:none;color:inherit;}
.subject-content-card-link:hover {border-color:var(--primary);color:var(--text);}
.article-page {max-width:none;width:100%;margin:22px 0 40px;padding:clamp(18px,4vw,38px);background:var(--surface);border:1px solid var(--border);border-radius:18px;box-shadow:var(--shadow);min-width:0;}
.article-header {margin-bottom:26px;}
.article-header h1 {margin:5px 0 12px;color:var(--text);font-size:clamp(25px,4vw,36px);line-height:1.5;overflow-wrap:anywhere;}
.article-context,.article-excerpt {color:var(--muted);line-height:1.8;}
.article-categories {display:flex;flex-wrap:wrap;gap:7px;margin-top:13px;}
.article-categories span {padding:4px 10px;border-radius:999px;background:var(--surface-soft);color:var(--primary);font-size:12px;}
.article-body {font-size:17px;line-height:2;overflow-wrap:anywhere;}
.article-rich-text h2,.article-rich-text h3 {line-height:1.6;margin:1.5em 0 .6em;color:var(--text);}
.article-rich-text p,.article-rich-text ul,.article-rich-text ol {margin:.8em 0;}
.article-rich-text img,.article-media img,.article-featured-image {max-width:100%;height:auto;border-radius:12px;}
.article-media {margin:24px 0;text-align:center;}
.article-media iframe {display:block;width:100%;height:clamp(240px,56vw,520px);border:0;border-radius:12px;background:#000;}
.article-pdf iframe {height:clamp(360px,75vw,760px);}
.article-media figcaption {margin:8px 0;color:var(--muted);font-size:13px;}
@media(max-width:600px){.article-page{margin:12px auto 24px;padding:17px;border-radius:14px}.article-body{font-size:16px}.article-media iframe{height:240px}.article-pdf iframe{height:65vh}}
.subject-content-grid--sided .subject-content-image {width:150px;aspect-ratio:4/3;}
@media (max-width:800px) {
  .subject-content-grid--cover {grid-template-columns:repeat(2,minmax(0,1fr));}
  .subject-content-grid--vcover {grid-template-columns:repeat(3,minmax(0,1fr));}
}
@media (max-width:600px) {
  .subject-card {min-height:48px;padding:7px 11px;gap:10px;border-radius:11px;}
  .subject-card h3 {font-size:13px;}
  .subject-card .subject-symbol {width:30px;height:30px;border-radius:9px;}
  .subject-card .subject-symbol svg {width:18px;height:18px;}
  .subject-card-arrow {width:29px;height:29px;border-radius:8px;}
  .subject-sections {padding-top:14px;}
  .subject-books-area {padding-top:9px;}
  .subject-books-section {margin-bottom:12px;padding:11px;border-radius:13px;}
  .subject-books-grid,.subject-books-grid--cover,.subject-books-grid--vcover {grid-template-columns:minmax(0,1fr);gap:8px;margin-top:9px;}
  .subject-books-grid--broadcast .subject-book-card:first-child {grid-column:auto;}
  .subject-book-card {grid-template-columns:66px minmax(0,1fr);gap:10px;padding:9px;}
  .subject-book-cover {width:66px;}
  .subject-book-cover-placeholder svg {width:29px;height:29px;}
  .subject-book-actions {gap:5px;margin-top:7px;}
  .subject-book-action {min-height:31px;padding:6px 8px;font-size:10px;}
  .subject-book-copy h3 {font-size:13px;}
  .subject-books-grid > .subject-book-card:only-child .subject-book-copy {display:block;}
  .subject-books-grid > .subject-book-card:only-child .subject-book-edition,
  .subject-books-grid > .subject-book-card:only-child .subject-book-copy h3,
  .subject-books-grid > .subject-book-card:only-child .subject-book-term,
  .subject-books-grid > .subject-book-card:only-child .subject-book-actions,
  .subject-books-grid > .subject-book-card:only-child .subject-book-index-link {grid-column:auto;grid-row:auto;}
  .subject-books-grid > .subject-book-card:only-child .subject-book-actions {flex-direction:row;min-width:0;margin-top:7px;}
  .subject-content-grid {grid-template-columns:minmax(0,1fr);gap:9px;margin-top:11px;}
  .subject-content-card {padding:12px;gap:11px;}
  .subject-content-image {width:76px;}
  .subject-content-copy h3 {font-size:14px;}
  .subject-content-copy p {font-size:12px;}
  .subject-content-grid--cover,.subject-content-grid--vcover {grid-template-columns:minmax(0,1fr);}
  .subject-content-grid--cover .subject-content-card,.subject-content-grid--vcover .subject-content-card {flex-direction:row;padding:12px;}
  .subject-content-grid--cover .subject-content-image,.subject-content-grid--vcover .subject-content-image {width:76px;aspect-ratio:4/3;}
  .subject-content-grid--broadcast .subject-content-card:first-child {padding:13px;}
  .subject-content-grid--broadcast .subject-content-card:first-child .subject-content-image {width:76px;aspect-ratio:4/3;}
  .subject-content-grid--broadcast .subject-content-card:first-child h3 {font-size:15px;}
  .subject-content-grid--sided .subject-content-card,.subject-content-grid--sided .subject-content-card:nth-child(even) {flex-direction:row;min-height:0;}
  .subject-content-grid--sided .subject-content-image {width:76px;aspect-ratio:4/3;}
}

/* Stage 8.4-B — published book details and protected edition files. */
.book-page {width:min(100%,1080px);min-width:0;margin:22px auto 40px;}
.book-overview,.book-information,.book-index {min-width:0;padding:clamp(17px,3.2vw,30px);background:var(--surface);border:1px solid var(--border);border-radius:18px;box-shadow:var(--shadow);}
.book-overview {display:grid;grid-template-columns:minmax(200px,280px) minmax(0,1fr);align-items:center;gap:clamp(22px,4vw,46px);}
.book-cover-frame {width:100%;max-width:280px;aspect-ratio:3/4;justify-self:center;overflow:hidden;border:1px solid var(--border);border-radius:13px;background:var(--surface-soft);box-shadow:var(--shadow);}
.book-cover {display:block;width:100%;height:100%;object-fit:contain;}
.book-cover-placeholder {display:flex;width:100%;height:100%;flex-direction:column;align-items:center;justify-content:center;gap:12px;color:var(--muted);font-size:13px;}
.book-cover-placeholder svg {width:60px;height:60px;color:var(--primary);}
.book-overview-copy {min-width:0;}
.book-context {margin:0 0 9px;color:var(--muted);font-size:14px;line-height:1.7;overflow-wrap:anywhere;}
.book-overview-copy h1 {margin:0;color:var(--text);font-size:clamp(25px,4vw,38px);line-height:1.5;overflow-wrap:anywhere;}
.book-edition-label {margin:9px 0 0;color:var(--primary);font-weight:700;line-height:1.7;overflow-wrap:anywhere;}
.book-actions {display:flex;flex-wrap:wrap;gap:10px;margin-top:25px;}
.book-action {display:inline-flex;min-height:46px;align-items:center;justify-content:center;gap:9px;padding:10px 17px;border:1px solid var(--primary);border-radius:11px;font-size:14px;font-weight:700;text-decoration:none;transition:background-color .16s,color .16s,border-color .16s;}
.book-action svg {width:19px;height:19px;flex:none;}
.book-action-primary {background:var(--primary);color:#fff;}
.book-action-primary:hover {background:var(--primary-strong,var(--primary));color:#fff;}
.book-action-secondary {background:var(--surface);color:var(--primary);}
.book-action-secondary:hover {background:var(--surface-soft);color:var(--primary);}
.book-action:focus-visible {outline:3px solid color-mix(in srgb,var(--primary) 35%,transparent);outline-offset:3px;}
.book-file-note {margin:13px 0 0;color:var(--muted);font-size:12px;line-height:1.7;overflow-wrap:anywhere;}
.book-information,.book-index {margin-top:18px;}
.book-information h2,.book-index h2 {margin:0 0 16px;color:var(--text);font-size:19px;line-height:1.5;}
.book-information-grid {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px;margin:0;}
.book-information-grid > div {min-width:0;padding:12px 14px;border:1px solid var(--border);border-radius:11px;background:var(--surface-soft);}
.book-information-grid dt {margin-bottom:4px;color:var(--muted);font-size:12px;line-height:1.5;}
.book-information-grid dd {margin:0;color:var(--text);font-size:14px;font-weight:700;line-height:1.65;overflow-wrap:anywhere;}
.book-index {min-height:84px;}
.book-index h2 {margin-bottom:15px;}
.book-index-list {display:grid;gap:9px;min-width:0;}
.book-index-unit {min-width:0;overflow:hidden;border:1px solid var(--border);border-radius:12px;background:var(--surface-soft);}
.book-index-summary {display:flex;min-width:0;min-height:52px;align-items:center;gap:10px;padding:12px 14px;color:var(--text);cursor:pointer;list-style:none;}
.book-index-summary::-webkit-details-marker {display:none;}
.book-index-summary:focus-visible {outline:3px solid color-mix(in srgb,var(--primary) 35%,transparent);outline-offset:-3px;}
.book-index-unit-title {min-width:0;flex:1;font-size:14px;font-weight:700;line-height:1.6;overflow-wrap:anywhere;}
.book-index-key {max-width:40%;flex:none;padding:3px 8px;border-radius:999px;background:color-mix(in srgb,var(--primary) 12%,var(--surface));color:var(--primary);font-size:11px;font-weight:700;line-height:1.55;overflow-wrap:anywhere;white-space:normal;}
.book-index-chevron {width:18px;height:18px;flex:none;color:var(--primary);transition:transform .16s ease;}
.book-index-unit[open] > .book-index-summary .book-index-chevron {transform:rotate(180deg);}
.book-index-body {display:grid;gap:10px;min-width:0;padding:0 14px 13px;}
.book-index-lessons {display:grid;gap:7px;margin:0;padding:0 17px 0 0;list-style:none;}
.book-index-lesson {display:flex;min-width:0;align-items:flex-start;gap:8px;color:var(--text);font-size:13px;line-height:1.7;overflow-wrap:anywhere;}
.book-index-lesson > span:last-child {min-width:0;flex:1;overflow-wrap:anywhere;}
.book-index-lesson > a {min-width:0;flex:1;color:var(--primary);font-weight:700;text-decoration:none;overflow-wrap:anywhere;}
.book-index-lesson > a:hover {text-decoration:underline;}
.book-index-lesson > a:focus-visible {outline:3px solid color-mix(in srgb,var(--primary) 35%,transparent);outline-offset:3px;}
.book-index-no-lessons,.book-index-empty {margin:0;color:var(--muted);font-size:13px;line-height:1.7;}
.book-index-body > .book-index-unit {margin-inline-start:14px;}
@media(max-width:700px) {
  .book-overview {grid-template-columns:minmax(0,1fr);gap:18px}
  .book-cover-frame {justify-self:center;width:min(80%,290px)}
  .book-overview .book-information-grid {grid-template-columns:minmax(0,1fr) minmax(0,1fr)}

}
@media (max-width:440px) {
  .book-overview,.book-information,.book-index {padding:15px;border-radius:14px;}
  .book-actions {display:grid;grid-template-columns:minmax(0,1fr);margin-top:19px;}
  .book-action {width:100%;}
  .book-information-grid {grid-template-columns:minmax(0,1fr);}
}

/* Stage 8.4-D — compact lesson reading pages. */
.lesson-page {width:min(100%,920px);min-width:0;margin:22px auto 40px;}
.lesson-header,.lesson-resources,.lesson-empty,.lesson-navigation {min-width:0;background:var(--surface);border:1px solid var(--border);border-radius:16px;box-shadow:var(--shadow);}
.lesson-header {padding:clamp(18px,3vw,28px);}
.lesson-context {margin:0 0 8px;color:var(--muted);font-size:13px;line-height:1.7;overflow-wrap:anywhere;}
.lesson-header h1 {margin:0;color:var(--text);font-size:clamp(24px,3.5vw,34px);line-height:1.5;overflow-wrap:anywhere;}
.lesson-key {margin:8px 0 0;color:var(--primary);font-size:13px;font-weight:700;}
.lesson-resources {margin-top:16px;padding:clamp(16px,2.6vw,24px);}
.lesson-resources h2 {margin:0 0 13px;color:var(--text);font-size:19px;}
.lesson-resource-list {display:grid;gap:10px;}
.lesson-resource-card {min-width:0;padding:15px 17px;border:1px solid var(--border);border-radius:11px;background:var(--surface-soft);}
.lesson-resource-card h3 {margin:0;color:var(--text);font-size:16px;line-height:1.6;overflow-wrap:anywhere;}
.lesson-resource-card h3 a {color:var(--primary);text-decoration:none;}
.lesson-resource-card h3 a:hover {text-decoration:underline;}
.lesson-resource-card h3 a:focus-visible,.lesson-navigation a:focus-visible {outline:3px solid color-mix(in srgb,var(--primary) 35%,transparent);outline-offset:3px;}
.lesson-resource-card p {margin:7px 0 0;color:var(--muted);font-size:13px;line-height:1.8;overflow-wrap:anywhere;}
.lesson-resource-meta {display:flex;flex-wrap:wrap;gap:6px;margin-top:10px;}
.lesson-resource-meta span {padding:3px 9px;border-radius:999px;background:var(--surface);color:var(--muted);font-size:11px;}
.lesson-empty {margin:16px 0 0;padding:20px;color:var(--muted);line-height:1.8;}
.lesson-navigation {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-top:16px;padding:12px;}
.lesson-navigation a {display:grid;min-width:0;gap:3px;padding:11px;border-radius:10px;color:var(--text);text-decoration:none;overflow-wrap:anywhere;}
.lesson-navigation a:hover {background:var(--surface-soft);}
.lesson-navigation a span {color:var(--muted);font-size:12px;}
.lesson-navigation a strong {color:var(--primary);font-size:14px;line-height:1.6;}
@media (max-width:580px) {
  .lesson-page {margin:13px auto 26px;}
  .lesson-navigation {grid-template-columns:minmax(0,1fr);}
}

/* v2: single, unified book information container */
.book-overview {display:grid;grid-template-columns:minmax(230px,340px) minmax(0,1fr);gap:clamp(18px,3vw,40px);align-items:start;direction:rtl}
.book-cover-frame {width:100%;max-width:340px;justify-self:stretch}
.book-overview-copy {align-self:stretch;display:flex;flex-direction:column;gap:16px;min-width:0}
.book-overview-copy h1 {margin:0}
.book-overview .book-information-grid {grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.book-overview .book-actions {margin-top:auto}
.book-content-card {display:flex;align-items:center;gap:12px;padding:14px;border:1px solid var(--border);border-radius:10px;text-decoration:none;color:var(--text);background:var(--surface)}
.book-content-card:hover {border-color:var(--primary);color:var(--primary)}
.book-content-card strong {overflow-wrap:anywhere}
.book-card-kind {font-size:12px;color:var(--muted);white-space:nowrap}
/* Term book covers: independent responsive layout, not the 190px content-card grid. */
.book-card-grid {display:grid;gap:12px;grid-template-columns:repeat(auto-fill,minmax(190px,1fr))}
.simple-book-grid {display:grid;min-width:0;gap:clamp(6px,1vw,12px);grid-template-columns:repeat(2,minmax(0,1fr))}
.simple-book-grid > .book-index-empty {grid-column:1/-1}
.simple-book-card {display:flex;min-width:0;box-sizing:border-box;flex-direction:column;align-items:center;gap:8px;border:1px solid var(--border);border-radius:14px;padding:12px;color:var(--text);text-align:center;text-decoration:none;overflow-wrap:anywhere}
.simple-book-card img {display:block;width:min(125px,100%);max-width:100%;height:auto;aspect-ratio:3/4;object-fit:contain}
.simple-book-card strong,.simple-book-card small {max-width:100%;overflow-wrap:anywhere}
.simple-book-card strong {font-size:clamp(12px,1.4vw,17px);line-height:1.55}
.simple-book-card small {font-size:clamp(11px,1.1vw,13px);line-height:1.45}
@media (max-width:719px) {
  .simple-book-card {padding:8px;gap:6px;border-radius:11px}
  .simple-book-card img {width:min(96px,100%)}
}
@media (min-width:360px) { .simple-book-grid {grid-template-columns:repeat(3,minmax(0,1fr))} }
@media (min-width:720px) { .simple-book-grid {grid-template-columns:repeat(4,minmax(0,1fr))} }
@media (min-width:1100px) { .simple-book-grid {grid-template-columns:repeat(5,minmax(0,1fr))} }
@media (min-width:1450px) { .simple-book-grid {grid-template-columns:repeat(6,minmax(0,1fr))} }
.book-pdf-reader {width:100%;height:min(80vh,850px);border:1px solid var(--border);border-radius:10px}
.book-description {overflow-wrap:anywhere}
@media(max-width:700px) {
 .book-overview {grid-template-columns:minmax(0,1fr);gap:18px}
 .book-cover-frame {justify-self:center;width:min(80%,290px)}
 .book-overview .book-information-grid {grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
}
@media(max-width:430px) { .book-overview .book-information-grid {grid-template-columns:minmax(0,1fr)} }

/* V2.15: keep real editor tables readable in published book pages. */
.book-description {overflow-x:auto;}
.book-description table {width:100%;border-collapse:collapse;border-spacing:0;margin:16px 0;color:var(--text);direction:rtl;}
.book-description th,.book-description td {border:1px solid var(--border);padding:10px 13px;text-align:start;vertical-align:top;overflow-wrap:anywhere;line-height:1.8;}
.book-description th {font-weight:700;background:var(--surface-soft);}
.book-description caption {padding:8px;text-align:start;font-weight:700;}
@media(max-width:600px) {
  .book-description table {font-size:14px;}
  .book-description th,.book-description td {padding:8px;}
}


/* V2.16: independently published static information pages. */
.static-page {width:min(100%,1000px);min-width:0;margin:20px auto 40px;padding:clamp(19px,3.5vw,36px);border:1px solid var(--border);border-radius:16px;background:var(--surface);box-shadow:var(--shadow);}
.static-page-header {margin:0 0 20px;padding-bottom:14px;border-bottom:1px solid var(--border);}
.static-page-header h1 {margin:0;color:var(--text);font-size:clamp(23px,3.4vw,34px);line-height:1.5;overflow-wrap:anywhere;}
.static-page-content {color:var(--text);font-size:16px;line-height:2;overflow-wrap:anywhere;min-width:0;overflow-x:auto;}
.static-page-content p {margin:0 0 16px;}
.static-page-content h2,.static-page-content h3 {margin:22px 0 12px;line-height:1.6;}
.static-page-content a {color:var(--primary);text-decoration:underline;text-underline-offset:3px;}
.static-page-content img {height:auto;max-width:100%;border-radius:8px;}
.static-page-content ul,.static-page-content ol {padding-inline-start:24px;}
.static-page-content table {width:100%;border-collapse:collapse;border-spacing:0;margin:16px 0;direction:rtl;}
.static-page-content th,.static-page-content td {border:1px solid var(--border);padding:10px 13px;text-align:start;vertical-align:top;overflow-wrap:anywhere;}
.static-page-content th {background:var(--surface-soft);font-weight:700;}
.static-page-content caption {padding:8px;text-align:start;font-weight:700;}
@media(max-width:600px) { .static-page {margin:13px auto 26px;padding:16px;} .static-page-content {font-size:15px;} .static-page-content th,.static-page-content td {padding:8px;} }

/* V2.18: Uploaded site identity with SVG fallback and optional contact details. */
.brand-uploaded-logo {max-width:100%;max-height:100%;width:100%;height:100%;object-fit:contain;border-radius:inherit;display:block;}
.brand-mark:has(.brand-uploaded-logo) {overflow:hidden;padding:3px;}
.footer-contact {color:var(--muted);text-decoration:none;unicode-bidi:plaintext;overflow-wrap:anywhere;}
.footer-contact:hover {color:var(--primary);text-decoration:underline;}

/* V2.20 — advertising slots (disabled by default). */
.site-ad { box-sizing:border-box; max-width:100%; min-width:0; margin:16px auto; text-align:center; overflow-wrap:anywhere; }
.site-ad img { display:block; width:auto; height:auto; max-width:100%; margin-inline:auto; border-radius:8px; }
.site-ad--sized-width img { width:100%; object-fit:contain; }
.site-ad--sized-height img { max-height:100%; object-fit:contain; }
.site-ad--sized-width.site-ad--sized-height img { height:100%; }
.site-ad iframe { max-width:100%; }
.site-ad--mobile { display:none; }
@media (max-width: 767px) { .site-ad--desktop { display:none; } .site-ad--mobile { display:block; } }
@media (min-width: 768px) { .site-ad--mobile { display:none; } }
.site-sidebar .site-ad { margin:10px 8px; }


/* V2.20.4: grade icon grid, public social accounts, compact appearance drawer.
   The footer and advertising styles are deliberately unchanged. */
.sidebar-grade-grid {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;}
.sidebar-curriculum-group + .sidebar-curriculum-group {margin-top:15px;}
.sidebar-curriculum-title {margin:0 3px 8px;font-size:11px;color:var(--muted);font-weight:800;overflow-wrap:anywhere;}
.sidebar-grade-card {display:flex;align-items:center;justify-content:center;min-height:53px;padding:9px 7px;border:1px solid var(--border);border-radius:11px;background:var(--surface-soft);font-size:12px;font-weight:750;line-height:1.5;text-align:center;overflow-wrap:anywhere;transition:border-color .15s,background .15s;}

.sidebar-grade-card span {min-width:0;max-width:100%;}
.sidebar-grade-card:hover {border-color:var(--primary);background:var(--tint);color:var(--text);}
.sidebar-grade-card.is-current {border-color:var(--primary);background:var(--tint);color:var(--accent-contrast);box-shadow:inset 0 0 0 1px var(--primary);}
.sidebar-social-section {padding:0 0 9px;}
.sidebar-social-section .sidebar-section-label {margin-top:17px;}
.sidebar-social-links {display:flex;flex-wrap:wrap;gap:8px;padding:0 7px;}
.sidebar-social-link {width:37px;height:37px;display:grid;place-items:center;border-radius:10px;background:var(--tint);color:var(--primary);border:1px solid var(--border);transition:transform .15s,border-color .15s;}
.sidebar-social-link:hover {transform:translateY(-2px);border-color:var(--primary);color:var(--primary);}
.sidebar-social-link svg {width:21px;height:21px;}
.sidebar-social-link--facebook {--social-brand:#1877f2;}
.sidebar-social-link--youtube {--social-brand:#f03;}
.sidebar-social-link--instagram {--social-brand:#c13584;}
.sidebar-social-link--telegram {--social-brand:#229ed9;}
.sidebar-social-link--whatsapp {--social-brand:#25a65a;}
.sidebar-social-link--x {--social-brand:#232323;}
.sidebar-social-link--tiktok {--social-brand:#1f2937;}
.sidebar-social-link--linkedin {--social-brand:#0a66c2;}
.sidebar-social-link--snapchat {--social-brand:#d3ab00;}
.sidebar-social-link--pinterest {--social-brand:#bd081c;}
.sidebar-social-link {color:var(--social-brand,var(--primary));}
:root[data-appearance='dark'] .sidebar-social-link {color:var(--primary);}
.appearance-open-button {margin:10px 12px 0;padding:10px 11px;min-height:44px;display:flex;align-items:center;gap:9px;flex-shrink:0;border:1px solid var(--border);border-radius:11px;background:var(--surface-soft);color:var(--text);font-size:13px;font-weight:750;text-align:start;}
.appearance-open-button:hover {border-color:var(--primary);background:var(--tint);}
.appearance-open-button svg {width:19px;height:19px;color:var(--primary);}
.appearance-open-chevron {margin-inline-start:auto;}
/* Pages live only in the sidebar, in the same themed frame on desktop and mobile. */
.sidebar-page-links {margin:12px 2px 14px;padding:10px 9px 8px;border:1px solid var(--primary);border-radius:13px;background:var(--surface);}
.sidebar-page-heading {margin:0 3px 6px;color:var(--text);font-size:13px;font-weight:800;}
.sidebar-page-list {display:flex;flex-direction:column;gap:2px;}
.sidebar-page-list .nav-grade {min-height:34px;padding:7px 10px;}
.sidebar-page-list .nav-grade:hover {background:var(--surface-soft);}
.sidebar-page-list .nav-grade.is-current {background:var(--tint);}
/* Small inline appearance tray: opens under its own button; no second drawer or backdrop. */
.appearance-open-chevron {transition:transform .18s ease;}
.site-sidebar.appearance-expanded .appearance-open-chevron {transform:rotate(-90deg);}
.appearance-tray {max-height:0;min-height:0;flex-shrink:0;overflow:hidden;opacity:0;visibility:hidden;transform:translateY(-8px);transition:max-height .22s ease,opacity .2s ease,transform .22s ease,visibility .22s;}
.site-sidebar.appearance-expanded .appearance-tray {max-height:244px;opacity:1;visibility:visible;transform:translateY(0);}
.appearance-tray .appearance-panel {margin:5px 12px 0;padding:12px 13px 9px;border:1px solid var(--border);border-radius:12px;background:var(--surface-soft);}
.appearance-tray .appearance-title {margin-bottom:8px;font-size:12px;}
.appearance-tray .palette-options {justify-content:space-between;gap:2px;}
.appearance-tray .palette-choice {width:37px;height:37px;padding:4px;}
.appearance-tray .palette-choice span {width:24px;height:24px;}
.appearance-tray .appearance-mode-label {margin-top:10px;margin-bottom:6px;}
.appearance-tray .mode-options {margin-top:0;}
.appearance-tray .mode-options button {min-height:34px;}
.appearance-tray .theme-reset {margin:7px 0 0;min-height:22px;font-size:11px;}
@media (max-width:850px) {
  .appearance-open-button {margin:8px 12px;}
  .appearance-tray .appearance-panel {margin:0 12px 7px;padding:10px 12px 8px;}
}
/* Account for the sidebar's actual width, not the browser viewport. */
.sidebar-curriculum-group {container-type:inline-size;}
@media (max-width:350px) {
  .sidebar-grade-grid {grid-template-columns:minmax(0,1fr);}
}
@media (prefers-reduced-motion:reduce) {
  .appearance-tray,.appearance-open-chevron,.sidebar-grade-card,.sidebar-social-link {transition:none;}
}

/* V2.20.4.3: compact sidebar and independent themed page links. */
.sidebar-head {height:56px;min-height:56px;padding-inline:15px;}
.sidebar-heading-home {color:#fff;position:relative;font-size:16px;line-height:1.5;text-decoration:none;}
.sidebar-heading-home:hover,.sidebar-heading-home:focus-visible {color:#fff;text-decoration:underline;text-underline-offset:4px;}
.sidebar-navigation {padding-top:10px;padding-bottom:12px;}
.sidebar-social-section {padding:1px 0 7px;}
.sidebar-social-section .sidebar-section-label {margin:0 4px 8px;padding:0;border:0;font-size:13px;}
.sidebar-social-links {gap:7px;padding-inline:4px;}
.sidebar-page-links {margin:8px 1px 12px;padding:0;border:0;border-radius:0;background:transparent;}
.sidebar-page-heading {margin:0 4px 8px;padding:0;color:var(--text);font-size:13px;font-weight:800;}
.sidebar-page-list {display:flex;flex-direction:column;gap:6px;}
.sidebar-page-list .nav-grade {min-height:35px;padding:7px 10px;border:1px solid var(--primary);border-radius:10px;background:var(--tint);color:var(--text);font-size:12px;transition:border-color .15s,background .15s;}
.sidebar-page-list .nav-grade:hover {border-color:var(--brand-deep);background:var(--surface-soft);color:var(--text);}
.sidebar-page-list .nav-grade.is-current {border-color:var(--primary);background:var(--tint);color:var(--accent-contrast);font-weight:800;box-shadow:inset 0 0 0 1px var(--primary);}
#sidebar-grades-label {margin:9px 3px 7px;padding:9px 2px 0;border-top:1px solid var(--border);}
.sidebar-curriculum-group + .sidebar-curriculum-group {margin-top:8px;}
.sidebar-curriculum-title {margin:0 2px 5px;}
.sidebar-grade-grid {gap:5px;}
.sidebar-grade-card {min-height:38px;padding:5px 5px;border-radius:9px;font-size:11px;font-weight:750;line-height:1.35;}
/* Keep the requested two columns until the actual sidebar becomes narrow. */
@container (max-width:220px) {
  .sidebar-grade-grid {grid-template-columns:minmax(0,1fr);}
}
@media (max-width:850px) {
  .sidebar-head {height:50px;min-height:50px;padding-inline:12px;}
  .sidebar-navigation {padding-top:8px;padding-bottom:8px;}
  .sidebar-page-links {margin-top:7px;margin-bottom:10px;}
}


/* V2.23: student registration, authentication and progress — isolated from article styles. */
.student-panel {width:min(100%,800px);margin:18px auto 28px;padding:clamp(18px,3.5vw,32px);border:1px solid var(--border);border-radius:16px;background:var(--surface);box-shadow:var(--shadow);}
.student-panel-narrow {max-width:540px;}
.student-panel h1 {margin:0 0 6px;font-size:clamp(23px,3vw,30px);line-height:1.5;}
.student-intro {margin:0 0 22px;color:var(--muted);font-size:14px;line-height:1.85;}
.student-form {display:grid;gap:17px;}
.student-form-row {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;}
.student-form-field {display:grid;gap:6px;min-width:0;}
.student-form-field label {font-size:14px;font-weight:750;}
.student-optional {color:var(--muted);font-weight:400;font-size:12px;}
.student-form-field input,.student-form-field select {width:100%;min-width:0;min-height:45px;border:1px solid var(--border);border-radius:10px;padding:9px 12px;background:var(--surface);color:var(--text);font:inherit;font-size:14px;}
.student-form-field input:focus,.student-form-field select:focus {outline:2px solid var(--focus);outline-offset:1px;}
.student-form-field [aria-invalid='true'] {border-color:#b91c1c;}
.student-form-field small {color:var(--muted);font-size:12px;}
.student-form-field .student-error {color:#b91c1c;}
.student-form-alert {padding:12px;border:1px solid #e68d8d;border-radius:10px;color:var(--text);background:var(--surface-soft);margin-bottom:17px;}
.student-primary-button,.student-secondary-button {display:inline-flex;justify-content:center;align-items:center;min-height:45px;border-radius:10px;padding:10px 19px;font:inherit;font-weight:750;}
.student-primary-button {background:var(--primary);border:1px solid var(--primary);color:var(--on-primary);}
.student-secondary-button {background:var(--surface-soft);border:1px solid var(--border);color:var(--text);}
.student-primary-button:hover {filter:brightness(.92);}
.student-secondary-button:hover {border-color:var(--primary);}
.student-form-footer {margin:19px 0 0;font-size:14px;color:var(--muted);}
.student-form-footer a,.student-profile-info a {color:var(--primary);font-weight:750;text-decoration:underline;text-underline-offset:3px;}
.student-remember {display:flex;align-items:center;gap:8px;font-size:13px;}
.student-recovery-note {font-size:12px;color:var(--muted);margin:12px 0 0;}
.student-dashboard {max-width:950px;}
.student-dashboard-heading {display:flex;justify-content:space-between;gap:16px;align-items:start;}
.student-dashboard-heading .student-intro {margin-bottom:10px;}
.student-profile-info {border:1px solid var(--border);padding:12px;border-radius:10px;background:var(--surface-soft);font-size:14px;}
.student-stat-grid {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:18px 0 24px;}
.student-stat {border:1px solid var(--border);border-radius:12px;background:var(--surface-soft);padding:17px 12px;text-align:center;display:grid;gap:5px;}
.student-stat strong {font-size:clamp(20px,3vw,28px);color:var(--primary);}
.student-stat span {color:var(--muted);font-size:12px;}
.student-section-heading {font-size:19px;margin:20px 0 10px;}
.student-attempt {display:flex;justify-content:space-between;gap:12px;align-items:center;padding:12px 0;border-top:1px solid var(--border);}
.student-attempt div {display:grid;gap:4px;min-width:0;}
.student-attempt strong {font-size:14px;overflow-wrap:anywhere;}
.student-attempt small {color:var(--muted);font-size:12px;}
.student-attempt-score {font-weight:800;color:var(--primary);}
.student-attempt-status {color:var(--muted);font-size:12px;}
@media (max-width:600px) {
  .student-panel {padding:16px;margin-top:12px;}
  .student-form-row {grid-template-columns:minmax(0,1fr);gap:15px;}
  .student-dashboard-heading {flex-direction:column;}
  .student-stat {padding:11px 6px;}
  .student-stat span {font-size:11px;}
}

/* V2.22: moderated guest comments — scoped to article pages. */
.article-comments {margin:25px 0 12px;padding:19px;border:1px solid var(--border);background:var(--surface);border-radius:14px;min-width:0;}
.article-comments h2 {margin:0 0 14px;font-size:21px;color:var(--text);}
.comment-item {border-top:1px solid var(--border);padding:13px 2px;}
.comment-meta {display:flex;flex-wrap:wrap;gap:10px;align-items:center;margin-bottom:8px;color:var(--text);}
.comment-meta time {font-size:12px;color:var(--muted);}
.comment-text {font-size:14px;line-height:1.9;color:var(--text);overflow-wrap:anywhere;white-space:normal;}
.comment-reply {margin:11px 17px 0 0;padding:10px 12px;border-right:3px solid var(--primary);border-radius:6px;background:var(--surface-soft);}
.comment-empty,.comment-explain {color:var(--muted);font-size:13px;line-height:1.8;}
.comment-form {display:grid;gap:8px;margin-top:16px;padding-top:16px;border-top:1px solid var(--border);}
.comment-form h3 {margin:0;font-size:17px;color:var(--text);}
.comment-form label {font-size:13px;font-weight:700;color:var(--text);}
.comment-form input,.comment-form textarea {box-sizing:border-box;width:100%;max-width:100%;border:1px solid var(--border);border-radius:9px;background:var(--surface);color:var(--text);padding:10px 12px;font:inherit;font-size:14px;}
.comment-form textarea {resize:vertical;min-height:100px;}
.comment-form input:focus-visible,.comment-form textarea:focus-visible {outline:2px solid var(--primary);outline-offset:1px;}
.comment-form button {justify-self:start;border:0;border-radius:9px;background:var(--primary);color:#fff;padding:11px 17px;font:inherit;font-weight:700;cursor:pointer;}
.comment-form button:hover {filter:brightness(.92);}
.comment-feedback {padding:11px 13px;border:1px solid var(--primary);border-radius:9px;background:var(--tint);color:var(--text);}
.comment-error {color:#b91c1c;font-size:12px;margin:0;}
.comment-honeypot {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}
.comments-pagination {margin:12px 0;max-width:100%;overflow-wrap:anywhere;}
@media (max-width:600px) {.article-comments {padding:12px;margin-top:16px;}.comment-reply {margin-right:8px;}}

/* V2.23 / 2B-3: public, accessible static review pages. */
.review-page{max-width:920px;margin:1.3rem auto 3rem;padding:0 1rem}
.review-page-header,.review-toc,.review-question,.review-practice-notice{background:var(--surface);border:1px solid var(--border);border-radius:16px;padding:1.35rem;margin-bottom:1.2rem}
.review-page-header h1{margin:.35rem 0 1rem;line-height:1.55;font-size:clamp(1.5rem,3vw,2.15rem)}
.review-eyebrow{font-weight:700;color:var(--primary);margin:0}
.review-intro{line-height:2;white-space:normal;overflow-wrap:anywhere}
.review-count{color:var(--muted);font-size:.95rem;margin:1rem 0 0}
.review-toc{display:flex;align-items:center;flex-wrap:wrap;gap:.65rem}
.review-toc a{display:inline-flex;align-items:center;justify-content:center;min-width:2.4rem;min-height:2.4rem;padding:.35rem;border:1px solid currentColor;border-radius:.55rem;text-decoration:none}
.review-question{scroll-margin-top:3rem}
.review-question h2{font-size:1.1rem;line-height:1.9;margin:0 0 1.2rem;overflow-wrap:anywhere}
.review-question-number{display:inline-block;background:var(--tint);color:var(--accent-contrast);padding:.15rem .7rem;border-radius:8px;margin-inline-end:.3rem}
.review-options{line-height:2.1;padding-inline-start:2rem}
.review-options li{padding-inline-start:.35rem}
.review-options-inline{font-weight:600}
.review-solution{border:1px solid var(--border);border-radius:10px;margin-block:1.3rem .8rem;overflow:hidden}
.review-solution summary{cursor:pointer;padding:.8rem 1rem;font-weight:700;min-height:2.7rem}
.review-solution summary:focus-visible,.review-question-footer a:focus-visible,.review-toc a:focus-visible{outline:3px solid var(--focus);outline-offset:3px}
.review-solution-content{padding:.3rem 1rem 1rem;border-top:1px solid var(--border);line-height:1.9;overflow-wrap:anywhere}
.review-question-footer{display:flex;justify-content:flex-end;padding-block:.5rem}
.review-question-footer a{font-weight:600;text-decoration:underline}
.review-practice-notice{border-style:dashed;line-height:1.8}
.review-practice-notice h2{margin-top:0;font-size:1.2rem}

/* V2.23 / 2B-4: responsive, server-rendered practice on the review page. */
.practice-page {max-width:800px;margin:0 auto 2.5rem;padding:0 1rem;}
.practice-progress {display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:.6rem;margin:1rem 0;}
.practice-progress-bar {height:8px;background:var(--surface-secondary,#e5e7eb);border-radius:999px;overflow:hidden;margin-bottom:1rem;}
.practice-progress-bar span {display:block;height:100%;background:var(--primary,#176e63);}
.practice-question,.practice-result-row,.practice-score {border:1px solid var(--border,#e5e7eb);border-radius:14px;padding:1.15rem;background:var(--surface,#fff);margin-block:1rem;}
.practice-question h2 {font-size:1.18rem;line-height:1.8;margin:0 0 1rem;}
.practice-choices {border:0;padding:0;margin:0;display:grid;gap:.55rem;}
.practice-choices legend {margin-bottom:.6rem;}
.practice-choice {display:flex;align-items:center;gap:.75rem;border:1px solid var(--border,#d1d5db);border-radius:9px;padding:.65rem .85rem;cursor:pointer;line-height:1.6;}
.practice-choice:has(input:checked) {border-color:var(--primary,#176e63);background:rgba(23,110,99,.06);}
.practice-choice input {inline-size:19px;block-size:19px;flex:0 0 auto;accent-color:var(--primary,#176e63);}
.practice-number-input {display:block;max-width:350px;width:100%;padding:.7rem .8rem;border:1px solid #aeb7bf;border-radius:9px;}
.practice-number-label {display:block;margin-bottom:.5rem;}
.practice-buttons {display:flex;flex-wrap:wrap;gap:.5rem;margin-top:1rem;}
.practice-button {padding:.7rem 1rem;border:0;border-radius:9px;background:#176e63;color:white;font-weight:700;cursor:pointer;text-decoration:none;}
.practice-button--muted {background:#e5e7eb;color:#111827;}
.practice-button:disabled {cursor:not-allowed;opacity:.4;}
.practice-finish-form {margin:1rem 0;}
.practice-score {text-align:center;}
.practice-score strong {font-size:2rem;}
.practice-result-row h2 {font-size:1.05rem;margin:0 0 .65rem;}
.practice-result-row p {margin:.5rem 0;}
.practice-error {color:#b91c1c;}
.practice-back {display:inline-block;margin-block:1rem;}
@media(max-width:520px) {.practice-page{padding:0 .4rem}.practice-question{padding:.8rem}.practice-buttons .practice-button{flex:1 1 auto}.practice-choice{padding:.55rem .65rem}}

/* V2.23 / 2B-4.2: visible assessment entry points on desktop and mobile. */
.related-lesson-reviews{background:var(--surface);border:1px solid var(--border);border-radius:16px;padding:1.25rem;margin:1.25rem auto;max-width:920px}
.related-lesson-reviews h2{margin:0 0 .4rem;font-size:clamp(1.15rem,2.6vw,1.45rem)}
.related-reviews-description{color:var(--muted);line-height:1.7;margin:.25rem 0 1rem}
.related-review-links{list-style:none;margin:0;padding:0;display:grid;gap:.7rem}
.related-review-cta{display:flex;align-items:center;justify-content:space-between;gap:.9rem;flex-wrap:wrap;min-height:3.4rem;padding:.8rem 1rem;background:var(--tint);border:1px solid var(--primary);border-radius:12px;color:var(--text);text-decoration:none;font-weight:700;transition:background-color .15s ease,border-color .15s ease}
.related-review-cta:hover{background:var(--tint-strong)}
.related-review-cta:focus-visible,.review-start-button:focus-visible{outline:3px solid var(--focus);outline-offset:3px}
.related-review-title{flex:1 1 190px;overflow-wrap:anywhere}
.related-review-action{display:inline-flex;align-items:center;justify-content:center;border-radius:8px;padding:.5rem .75rem;color:var(--on-primary);background:var(--primary);font-size:.88rem;white-space:nowrap}
.review-start-panel{background:var(--tint);border:2px solid var(--primary);border-radius:16px;padding:1.25rem;margin:0 0 1.2rem}
.review-start-panel h2{font-size:clamp(1.15rem,2.5vw,1.45rem);margin:0 0 .55rem}
.review-start-panel p{margin:0 0 1rem;line-height:1.8}
.review-start-panel form{margin:0}
.review-start-button{display:inline-flex;justify-content:center;align-items:center;width:100%;max-width:390px;min-height:3.3rem;font-size:1.05rem;background:var(--primary);color:var(--on-primary)}
.review-reading-heading{padding:.25rem .2rem .5rem;margin:0 0 .5rem}
.review-reading-heading h2{font-size:1.2rem;margin:0 0 .4rem}
.review-reading-heading p{color:var(--muted);line-height:1.7;margin:0}
@media(max-width:520px){.related-lesson-reviews{padding:1rem}.related-review-cta{align-items:stretch;flex-direction:column}.related-review-title{flex:0 1 auto}.related-review-action{width:100%;min-height:2.7rem}.review-start-panel{padding:1rem}.review-start-button{max-width:none}}

/* V2.23 — 2B-5: printable public review PDF actions. */
.review-pdf-panel {margin:18px 0 24px;padding:20px;border:1px solid var(--border);border-radius:16px;background:var(--surface-soft)}
.review-pdf-panel h2 {font-size:20px;margin:0 0 6px;color:var(--text)}
.review-pdf-panel p {margin:0 0 14px;color:var(--muted);font-size:14px}
.review-pdf-actions {display:flex;gap:12px;flex-wrap:wrap}
.review-pdf-button {display:inline-flex;align-items:center;justify-content:center;min-height:44px;padding:10px 17px;border-radius:10px;font-weight:750;font-size:14px;text-align:center;border:1px solid var(--primary);background:var(--primary);color:var(--on-primary);text-decoration:none}
.review-pdf-button:hover,.review-pdf-button:focus-visible {background:var(--brand-deep);color:#fff}
.review-pdf-button-alt {background:var(--surface);color:var(--primary)}
.review-pdf-button-alt:hover,.review-pdf-button-alt:focus-visible {color:var(--on-primary)}
@media (max-width:580px) {.review-pdf-panel {padding:14px}.review-pdf-actions {flex-direction:column;gap:8px}.review-pdf-button {width:100%}}

/* V2.24 / 2C-4 — two compact book information cards per row on phones.
   Scoped to book overview only; desktop and other site cards remain unchanged. */
@media (max-width: 700px) {
  .book-page .book-overview {
    padding: 12px;
    gap: 12px;
  }
  .book-page .book-overview-copy {
    gap: 9px;
  }
  .book-page .book-overview .book-information-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }
  .book-page .book-overview .book-information-grid > div {
    min-width: 0;
    padding: 7px 8px;
    border-radius: 8px;
  }
  .book-page .book-overview .book-information-grid dt {
    margin-bottom: 2px;
    font-size: 11px;
    line-height: 1.25;
  }
  .book-page .book-overview .book-information-grid dd {
    margin: 0;
    font-size: 12px;
    line-height: 1.4;
    overflow-wrap: anywhere;
  }
  .book-page .book-overview .book-actions {
    margin-top: 9px;
  }
}


/* Mobile PDF.js reader: the native iframe remains the desktop reader. */
.pdf-mobile-reader {display:none;margin:12px 0 18px;min-width:0}
.pdf-mobile-toolbar {position:sticky;top:0;z-index:2;display:grid;gap:9px;padding:10px;border:1px solid var(--border);border-radius:12px;background:var(--surface);box-shadow:var(--shadow)}
.pdf-mobile-status {margin:0;color:var(--muted);font-size:13px;line-height:1.6}
.pdf-mobile-controls {display:flex;align-items:center;justify-content:center;gap:7px;flex-wrap:wrap}
.pdf-mobile-controls button {min-width:38px;min-height:36px;padding:5px 9px;border:1px solid var(--border);border-radius:8px;background:var(--surface-soft);color:var(--text);font:inherit;font-size:13px}
.pdf-mobile-controls button:disabled {opacity:.45;cursor:not-allowed}
.pdf-mobile-controls button:not(:disabled) {cursor:pointer}
.pdf-mobile-page-label,.pdf-mobile-zoom-label {min-width:48px;text-align:center;color:var(--text);font-size:12px;font-variant-numeric:tabular-nums}
/* Bound the mobile reader to its own viewport. Long PDFs scroll INSIDE this area. */
.pdf-mobile-pages {display:grid;grid-template-columns:minmax(0,1fr);align-content:start;gap:12px;width:100%;max-width:100%;min-width:0;box-sizing:border-box;margin-top:10px;padding:10px;height:min(58vh,620px);height:var(--pdf-reader-height,min(58dvh,620px));min-height:280px;overflow-x:hidden;overflow-y:auto;overscroll-behavior-y:contain;-webkit-overflow-scrolling:touch;border:1px solid var(--border);border-radius:12px;background:var(--surface-soft);scroll-padding-top:12px}
.pdf-mobile-pages:focus-visible {outline:2px solid var(--primary);outline-offset:2px}
/* Reading at 100% or less always fits the phone width. Only intentional enlargement
   permits panning inside the reader, never across the entire site. */
.pdf-mobile-reader.is-zoomed .pdf-mobile-pages {overflow-x:auto;overscroll-behavior-x:contain}
.pdf-mobile-sheet {display:flex;align-items:flex-start;justify-content:center;width:100%;min-height:180px;margin-inline:auto;overflow:hidden;background:#fff;box-shadow:0 1px 5px rgba(0,0,0,.14)}
.pdf-mobile-sheet canvas {display:block;max-width:none;background:#fff}
.pdf-mobile-sheet.is-error {align-items:center;padding:20px;color:#9b1c1c;text-align:center;box-shadow:none}
.pdf-mobile-fallback {display:inline-flex;margin-top:10px;padding:8px 12px;border:1px solid var(--border);border-radius:8px;color:var(--primary);font-size:13px;text-decoration:none}
.pdf-mobile-reader.is-ready .pdf-mobile-fallback {opacity:.8}
.pdf-mobile-reader.is-error .pdf-mobile-status {color:#9b1c1c}
@media (max-width:760px) {
    .book-pdf-desktop,.article-pdf-desktop {display:none!important}
    .pdf-mobile-reader {display:block}
    .article-pdf-open {display:none}
}
@media (min-width:761px) {
    .pdf-mobile-reader {display:none!important}
}


/* 7B-8: Selectable text overlay for PDF.js 4.9.x. Canvas stays visual;
   transparent spans are independently selectable, including RTL text. */
.pdf-mobile-sheet {position:relative;isolation:isolate}
.pdf-mobile-text-layer {
    position:absolute;inset:0;z-index:1;
    overflow:hidden;line-height:1;text-align:initial;
    transform-origin:0 0;direction:ltr;
    -webkit-text-size-adjust:none;text-size-adjust:none;
    forced-color-adjust:none;
    user-select:text;-webkit-user-select:text;
}
.pdf-mobile-text-layer :is(span,br) {
    position:absolute;color:transparent;white-space:pre;
    cursor:text;transform-origin:0% 0%;
    user-select:text;-webkit-user-select:text;
}
.pdf-mobile-text-layer span.markedContent {top:0;height:0}
.pdf-mobile-text-layer ::selection {color:transparent;background:rgba(25,118,210,.35)}
.pdf-mobile-text-layer ::-moz-selection {color:transparent;background:rgba(25,118,210,.35)}
.hiddenCanvasElement {position:absolute!important;left:0!important;top:0!important;width:0!important;height:0!important;visibility:hidden!important}
/* Let a single finger scroll the reader; reserve two-finger gestures for
   PDF zoom instead of browser page zoom. Zoomed pages may pan inside only. */
.pdf-mobile-pages {touch-action:pan-y}
.pdf-mobile-reader.is-zoomed .pdf-mobile-pages {touch-action:pan-x pan-y}


/* Homepage responsive fix (2026-11): layout containment at laptop/tablet widths.
   Shrink flexible header contents; never hide page-wide overflow. */
@media (max-width:1080px) {
  .header-inner { min-width:0; }
  .header-leading { min-width:0; flex:1 1 auto; }
  .header-leading .brand, .brand-copy { min-width:0; }
  .brand-copy { flex:1 1 auto; }
  .brand-copy strong { display:block; max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .header-search { min-width:0; flex:0 1 175px; }
  .student-header-links { flex:0 0 auto; }
  .site-grid, .site-main { min-width:0; max-width:100%; }
}
@media (min-width:581px) and (max-width:850px) {
  .student-header-signup { display:none; }
  .header-search { width:44px; height:42px; min-width:0; flex:0 0 44px; }
  .header-search:not(:focus-within) input { width:0; flex:0; padding:0; opacity:0; }
  .header-search:focus-within { position:absolute; left:12px; right:72px; width:auto; z-index:2; background:var(--surface); box-shadow:var(--shadow-strong); }
  .header-search:focus-within input { width:100%; flex:1; padding:0 11px; opacity:1; }
}
@media (max-width:580px) {
  .header-search { flex:0 0 44px; }
}


/* SEOPLUS-inspired navigation, tailored to School Portal — v1.0.
   The persistent desktop sidebar AND the mobile slide-out are always RIGHT-aligned. */
.site-header {height:auto;}
.seop-topbar {height:32px;background:var(--panel-gradient-b);color:#fff;}
.seop-topbar-inner {max-width:1540px;height:100%;margin:auto;padding-inline:34px;display:flex;flex-direction:row;align-items:center;justify-content:space-between;gap:20px;min-width:0;}
.seop-top-pages,.seop-top-social {display:flex;align-items:center;gap:14px;min-width:0;}
.seop-top-pages {overflow:hidden;white-space:nowrap;}
.seop-top-pages a {font-size:12px;color:#fff;opacity:.94;}
.seop-top-pages a:hover,.seop-top-pages a[aria-current] {text-decoration:underline;text-underline-offset:4px;opacity:1;}
.seop-top-social {flex:0 0 auto;gap:10px;}
.seop-top-social a {display:grid;place-items:center;color:#fff;width:22px;height:24px;opacity:.95;}
.seop-top-social a:hover {opacity:.7;color:#fff;}
.seop-top-social svg {width:17px;height:17px;}
.site-header .header-inner {height:64px;}
.seop-desktop-nav {height:44px;border-top:1px solid var(--border);background:var(--surface);}
.seop-main-nav {max-width:1540px;height:100%;padding-inline:34px;margin:auto;display:flex;align-items:stretch;gap:6px;position:relative;}
.seop-main-nav .seop-nav-link,.seop-stage-dropdown > summary {min-height:43px;display:flex;align-items:center;gap:6px;padding:6px 17px;font-size:14px;font-weight:750;white-space:nowrap;color:var(--text);border-radius:6px 6px 0 0;cursor:pointer;}
.seop-main-nav a:hover,.seop-stage-dropdown > summary:hover,.seop-main-nav a[aria-current] {background:var(--tint);color:var(--accent-contrast);}
.seop-stage-dropdown {position:static;}
.seop-stage-dropdown > summary {list-style:none;}
.seop-stage-dropdown > summary::-webkit-details-marker {display:none;}
.seop-stage-dropdown > summary svg {width:14px;height:14px;transition:transform .15s;}
.seop-stage-dropdown[open] > summary {background:var(--tint);}
.seop-stage-dropdown[open] > summary svg {transform:rotate(180deg);}
.seop-stage-mega {position:absolute;top:100%;right:34px;left:34px;z-index:95;max-height:min(65dvh,520px);overflow:auto;padding:18px 22px;border:1px solid var(--border);border-radius:0 0 16px 16px;background:var(--surface);box-shadow:var(--shadow-strong);}
.seop-curriculum-heading {font-size:13px;font-weight:800;color:var(--muted);margin:4px 0 11px;}
.seop-stage-grid {display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:14px;}
.seop-stage-column {min-width:0;display:flex;flex-direction:column;gap:4px;padding:12px;border:1px solid var(--border);border-radius:12px;background:var(--surface-soft);}
.seop-stage-column h2 {font-size:14px;margin:0 0 5px;color:var(--text);font-weight:800;}
.seop-stage-column a {border-radius:7px;padding:6px 8px;font-size:13px;line-height:1.65;}
.seop-stage-column a:hover {background:var(--tint);}
.seop-empty-navigation {font-size:13px;color:var(--muted);margin:0;}
.drawer-brand,.drawer-site-navigation {display:none;}
.home-section-target {display:block;height:0;position:relative;scroll-margin-top:160px;}
@media (min-width:1081px) {
  html {scroll-padding-top:160px;}
  .site-grid {direction:rtl;grid-template-columns:270px minmax(0,1fr);}
  .site-sidebar {grid-column:1;grid-row:1;top:152px;max-height:calc(100dvh - 164px);}
  .site-main {grid-column:2;grid-row:1;}
}
@media (max-width:1260px) and (min-width:1081px) {
  .seop-topbar-inner,.seop-main-nav {padding-inline:20px;}
  .seop-stage-mega {right:20px;left:20px;}
  .seop-main-nav .seop-nav-link,.seop-stage-dropdown > summary {padding-inline:12px;font-size:13px;}
}
@media (max-width:1080px) {
  html {scroll-padding-top:82px;}
  .seop-topbar,.seop-desktop-nav {display:none;}
  .site-header {height:68px;}
  .site-header .header-inner {height:68px;}
  .site-grid {direction:rtl;}
  .site-sidebar {right:0;left:auto;transform:translateX(110%);width:min(350px,calc(100vw - 24px));border-radius:0 0 0 18px;}
  body.sidebar-open .site-sidebar {transform:translateX(0);}
  .drawer-brand {display:inline-flex;align-items:center;gap:7px;max-width:58%;min-width:0;color:#fff;}
  .drawer-brand img {height:27px;width:27px;object-fit:contain;border-radius:6px;background:#fff;}
  .drawer-brand span {font-size:12px;line-height:1.4;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
  .drawer-site-navigation {display:block;margin:6px 1px 9px;padding:8px 9px;border:1px solid var(--border);border-radius:12px;background:var(--surface);}
  .drawer-site-navigation > .sidebar-section-label {border:0;margin:1px 0 6px;padding:4px 3px;font-size:13px;font-weight:850;}
  .drawer-site-navigation > .sidebar-section-label:not(:first-child) {margin-top:12px;border-top:1px solid var(--border);padding-top:10px;}
  .drawer-quick-links {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;}
  .drawer-quick-links a {min-width:0;display:flex;justify-content:center;align-items:center;padding:7px 4px;border:1px solid var(--border);border-radius:8px;background:var(--surface-soft);font-size:12px;font-weight:750;text-align:center;}
  .drawer-quick-links a:hover {background:var(--tint);color:var(--accent-contrast);}
  .drawer-curriculum-heading {font-size:12px;color:var(--muted);font-weight:700;margin:6px 3px;}
  .drawer-stage {border-bottom:1px solid var(--border);}
  .drawer-stage > summary {list-style:none;display:flex;align-items:center;justify-content:space-between;padding:10px 5px;font-size:13px;font-weight:750;cursor:pointer;}
  .drawer-stage > summary::-webkit-details-marker {display:none;}
  .drawer-stage > summary svg {width:14px;height:14px;transform:rotate(0);transition:transform .16s;}
  .drawer-stage[open] > summary svg {transform:rotate(180deg);}
  .drawer-grade-links {display:flex;flex-direction:column;gap:2px;padding:0 8px 10px;}
  .drawer-grade-links a {padding:6px 9px;border-radius:7px;font-size:12px;background:var(--surface-soft);}
  .drawer-grade-links a:hover {background:var(--tint);}
  .site-sidebar #sidebar-grades-label,.site-sidebar .sidebar-curriculum-group {display:none;}
  .site-sidebar .sidebar-page-links {margin-top:6px;}
  .site-sidebar .sidebar-social-links {display:flex;flex-wrap:wrap;justify-content:flex-start;}
  .site-sidebar .sidebar-heading-home {font-size:13px;}
  .home-section-target {scroll-margin-top:82px;}
}
@media (max-width:580px) {
  .drawer-brand {max-width:54%;}
  .site-header .brand-copy strong {max-width:100%;}
}
@media (max-width:1080px) {
  /* Drawer title uses the actual brand at the right; no duplicate Home label. */
  .site-sidebar .sidebar-heading-home {display:none;}
}

/* Stage-only navigation and reliable, nonintrusive homepage category destinations. */
.seop-stage-grid {grid-template-columns:repeat(auto-fit,minmax(170px,1fr));}
.seop-stage-link {display:flex;align-items:center;justify-content:center;min-height:48px;padding:10px 14px;border:1px solid var(--border);border-radius:10px;background:var(--surface-soft);color:var(--text);font-size:14px;font-weight:800;text-decoration:none;}
.seop-stage-link:hover,.seop-stage-link:focus-visible {background:var(--tint);color:var(--accent-contrast);}
.drawer-stage-only-list {display:grid;gap:6px;}
.drawer-stage-only-list a {display:block;padding:10px 12px;border-radius:9px;border:1px solid var(--border);color:var(--text);background:var(--surface-soft);font-size:13px;font-weight:750;text-decoration:none;}
.drawer-stage-only-list a:hover,.drawer-stage-only-list a:focus-visible {background:var(--tint);}
.stage-empty-grades {border:1px dashed var(--border);border-radius:10px;padding:14px;margin:0;color:var(--muted);font-size:14px;}
/* Never add empty category blocks to the default homepage; reveal only if the user selects a missing anchor. */
.home-nav-fallback {display:none;scroll-margin-top:160px;margin:20px 0;padding:22px;border:1px solid var(--border);border-radius:14px;background:var(--surface);}
.home-nav-fallback:target {display:block;}
.home-nav-fallback h2 {font-size:22px;font-weight:850;margin:0 0 9px;color:var(--text);}
.home-nav-fallback p {color:var(--muted);margin:0;font-size:15px;line-height:1.8;}
@media (max-width:1080px) {.home-nav-fallback {scroll-margin-top:82px;padding:16px;} .home-nav-fallback h2 {font-size:18px;}}
.stage-section {scroll-margin-top:160px;}
@media (max-width:1080px) {.stage-section {scroll-margin-top:82px;}}

/* School Platform 34: compact Seoplus-style navigation, no desktop sidebar.
   The mobile drawer stays anchored on the RIGHT; stage rows reveal their grades. */
@media (min-width:1081px) {
  .site-grid {display:block;direction:rtl;max-width:1540px;min-width:0;}
  .site-grid > .site-sidebar {display:none!important;}
  .site-grid > .site-main {display:block;width:100%;max-width:100%;min-width:0;margin:0;}
}
.seop-topbar {height:auto;min-height:43px;}
.seop-topbar-inner {min-height:43px;gap:15px;}
.seop-top-pages {min-width:0;gap:5px;overflow-x:auto;scrollbar-width:none;}
.seop-top-pages::-webkit-scrollbar {display:none;}
.seop-top-pages a {display:inline-flex;flex:0 0 auto;align-items:center;min-height:35px;padding:4px 11px;border:1px solid rgb(255 255 255 / 30%);border-radius:8px;font-size:13px;font-weight:700;}
.seop-top-pages a:hover,.seop-top-pages a[aria-current] {background:rgb(255 255 255 / 14%);color:#fff;text-decoration:none;}
.seop-top-social {gap:7px;}
.seop-top-social a {width:32px;height:32px;border:1px solid rgb(255 255 255 / 40%);border-radius:9px;opacity:1;transition:background .15s;}
.seop-top-social a:hover {background:rgb(255 255 255 / 15%);opacity:1;}
.seop-top-social svg {width:18px;height:18px;}
.seop-desktop-nav {height:52px;display:flex;align-items:stretch;gap:12px;padding-inline:max(20px,calc((100% - 1540px)/2 + 34px));}
.seop-main-nav {margin:0;max-width:none;height:100%;padding:0;flex:1 1 auto;min-width:0;gap:4px;}
.seop-main-nav .seop-nav-link,.seop-stage-dropdown > summary {min-height:51px;padding:7px 13px;}
.seop-nav-tools {display:flex;align-items:center;justify-content:flex-end;flex:0 0 auto;min-width:0;margin-inline-start:auto;position:relative;}
.seop-stage-dropdown {position:relative;}
.seop-stage-dropdown > summary svg {width:14px;height:14px;}
.seop-stage-mega {position:absolute;top:100%;right:0;left:auto;width:280px;max-width:calc(100vw - 32px);padding:9px;border:1px solid var(--border);border-radius:0 0 12px 12px;max-height:min(65dvh,460px);overflow:auto;box-shadow:var(--shadow-strong);}
.seop-curriculum-heading {margin:8px 7px;font-size:12px;}
.seop-stage-item {border-bottom:1px solid var(--border);}
.seop-stage-item:last-child {border-bottom:0;}
.seop-stage-item > summary {display:flex;justify-content:space-between;align-items:center;gap:10px;min-height:43px;padding:8px 10px;font-size:13px;font-weight:750;cursor:pointer;list-style:none;border-radius:7px;color:var(--text);}
.seop-stage-item > summary::-webkit-details-marker {display:none;}
.seop-stage-item > summary:hover,.seop-stage-item[open] > summary {background:var(--tint);color:var(--accent-contrast);}
.stage-expand-chevron {display:inline-block;flex:0 0 auto;color:var(--muted);font-size:17px;line-height:1;transition:transform .17s;}
.seop-stage-item[open] .stage-expand-chevron,.drawer-stage[open] .stage-expand-chevron {transform:rotate(180deg);}
.seop-stage-grades {display:flex;flex-direction:column;gap:2px;padding:3px 9px 11px;}
.seop-stage-grades a {padding:7px 10px;border-radius:7px;font-size:12px;color:var(--text);background:var(--surface-soft);}
.seop-stage-grades a:hover {background:var(--tint);color:var(--accent-contrast);}
.seop-no-grades,.drawer-no-grades {display:block;padding:8px;color:var(--muted);font-size:12px;}
/* One appearance widget is moved between desktop header and mobile drawer by site.js. */
.site-appearance-widget:not([data-positioned]) {display:none;}
.site-appearance-widget {position:relative;min-width:0;}
.site-appearance-widget > .appearance-open-button {margin:0;padding:6px 11px;min-height:37px;gap:7px;display:flex;white-space:nowrap;border:1px solid var(--border);border-radius:9px;background:var(--surface-soft);font-size:13px;}
.site-appearance-widget > .appearance-open-button svg {width:18px;height:18px;}
.site-appearance-widget > .appearance-tray {max-height:0;opacity:0;visibility:hidden;overflow:hidden;}
.site-appearance-widget.appearance-expanded > .appearance-tray {max-height:290px;opacity:1;visibility:visible;transform:none;}
.site-appearance-widget.appearance-expanded > .appearance-open-button .appearance-open-chevron {transform:rotate(-90deg);}
.site-appearance-widget > .appearance-tray .appearance-panel {margin:0;padding:12px;border:1px solid var(--border);border-radius:12px;background:var(--surface);box-shadow:var(--shadow-strong);}
@media (min-width:1081px) {
  .site-appearance-widget > .appearance-tray {position:absolute;top:calc(100% + 8px);left:0;right:auto;width:286px;max-width:calc(100vw - 26px);z-index:120;}
}
@media (min-width:1081px) and (max-width:1250px) {
  .seop-desktop-nav {padding-inline:20px;gap:7px;}
  .seop-main-nav .seop-nav-link,.seop-stage-dropdown > summary {font-size:12px;padding-inline:9px;}
  .site-appearance-widget > .appearance-open-button {font-size:12px;}
}
@media (max-width:1080px) {
  .site-grid > .site-sidebar {display:flex!important;right:0;left:auto;width:min(350px,calc(100vw - 24px));transform:translateX(110%);}
  body.sidebar-open .site-sidebar {transform:translateX(0);}
  .drawer-navigation {padding:10px 12px 12px;}
  .drawer-site-navigation {border:0;margin:0;padding:0;background:transparent;}
  .drawer-site-navigation > .sidebar-section-label {margin:11px 0 6px;padding:8px 0 0;border:0;border-top:1px solid var(--border);font-size:13px;}
  .drawer-quick-links {gap:7px;}
  .drawer-stage-list {display:flex;flex-direction:column;gap:3px;}
  .drawer-stage {border:1px solid var(--border);border-radius:9px;overflow:hidden;background:var(--surface);}
  .drawer-stage > summary {display:flex;justify-content:space-between;align-items:center;min-height:40px;padding:8px 11px;gap:8px;font-size:13px;}
  .drawer-stage[open] > summary {background:var(--tint);color:var(--accent-contrast);}
  .drawer-grade-links {padding:5px 9px 9px;gap:5px;}
  .drawer-grade-links a {border:1px solid var(--border);padding:8px 10px;font-size:12px;}
  .drawer-pages {margin-top:11px;}
  .drawer-page-links {display:flex;flex-direction:column;gap:6px;}
  .drawer-page-links a {display:block;min-height:38px;padding:8px 10px;border:1px solid var(--border);border-radius:9px;background:var(--surface-soft);font-size:13px;font-weight:700;}
  .drawer-page-links a[aria-current='page'],.drawer-page-links a:hover {background:var(--tint);color:var(--accent-contrast);border-color:var(--primary);}
  .site-sidebar .sidebar-social-links {gap:9px;}
  .site-sidebar .sidebar-social-link {width:40px;height:40px;}
  .drawer-appearance-slot {padding:0 12px 9px;}
  .drawer-appearance-slot .site-appearance-widget {width:100%;}
  .drawer-appearance-slot .appearance-open-button {width:100%;justify-content:flex-start;}
  .drawer-appearance-slot .appearance-open-chevron {margin-inline-start:auto;}
  .drawer-appearance-slot .appearance-tray {position:relative;margin-top:6px;}
  .drawer-appearance-slot .appearance-panel {box-shadow:none;}
  .site-sidebar .sidebar-head {flex-shrink:0;}
  .site-sidebar .drawer-navigation {flex:0 0 auto;overflow:visible;}
}
@media (max-width:580px) {
  .site-sidebar .drawer-navigation {padding:7px 10px;}
}
@media (max-width:1080px) {
  /* The closed right-side drawer is intentionally outside the viewport. */
  html,body {overflow-x:clip;}
}


/* School Portal: responsive header repair — 2026-11-19.
   Prevent a late desktop rule from restoring desktop navigation on phones.
   Keep mobile navigation exclusively inside the RIGHT drawer. */
@media (min-width:1081px) {
  .seop-topbar,
  .seop-topbar-inner {height:34px;min-height:34px;}
  .site-header .header-inner {height:60px;min-height:60px;}
  .seop-desktop-nav {display:flex;height:46px;min-height:46px;}
  .seop-main-nav .seop-nav-link,
  .seop-stage-dropdown > summary {min-height:45px;}
}
@media (max-width:1080px) {
  /* Exactly one visible header row. Older .seop-desktop-nav declarations were overriding this. */
  .site-header {height:68px;min-height:68px;}
  .site-header .header-inner {height:68px;min-height:68px;}
  .site-header .seop-topbar,
  .site-header .seop-desktop-nav {display:none!important;height:0!important;min-height:0!important;}
  /* Keep the drawer inside the viewport with an internally scrollable body. */
  .site-grid > .site-sidebar {
    position:fixed;inset-block-start:0;top:0;right:0;left:auto;
    height:100vh;height:100dvh;max-height:100vh;max-height:100dvh;
    overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;
    border-radius:0 0 0 16px;
  }
  .site-sidebar .sidebar-head {position:sticky;top:0;z-index:3;}
}

/* Compact, single-line footer: wrap links instead of fixed grid columns. */
.site-footer.site-footer--inline {border-top:1px solid var(--border);background:var(--surface)}
.site-footer--inline .footer-inner {max-width:1540px;margin-inline:auto;padding:12px clamp(14px,2.4vw,36px)}
.site-footer--inline .footer-line {display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:10px 22px;min-width:0}
.site-footer--inline .footer-copyright {display:flex;align-items:center;flex-wrap:wrap;gap:6px 12px;min-width:0;font-size:13px;line-height:1.8;color:var(--muted)}
.site-footer--inline .footer-copyright span {unicode-bidi:plaintext}
.site-footer--inline .footer-site-name {color:var(--text);font-weight:700;text-decoration:none}
.site-footer--inline .footer-inline-links {display:flex;align-items:center;justify-content:flex-start;flex-wrap:wrap;gap:6px;min-width:0;max-width:100%}
.site-footer--inline .footer-inline-links a {display:inline-flex;align-items:center;max-width:100%;width:auto;min-height:31px;padding:4px 9px;border:1px solid var(--border);border-radius:6px;background:var(--surface-soft);color:var(--text);font-size:13px;line-height:1.45;text-decoration:none;overflow-wrap:anywhere;white-space:normal}
.site-footer--inline .footer-inline-links a:hover,.site-footer--inline .footer-inline-links a:focus-visible {border-color:var(--primary);color:var(--primary)}
.site-footer--inline .footer-inline-links a[aria-current="page"] {border-color:var(--primary);font-weight:700}
.site-footer--inline .footer-inline-links .footer-contact {direction:ltr;unicode-bidi:plaintext}
@media (max-width:700px) {
  .site-footer--inline .footer-inner {padding:12px 14px}
  .site-footer--inline .footer-line {flex-direction:column;align-items:stretch;gap:10px}
  .site-footer--inline .footer-copyright {justify-content:center;text-align:center}
  .site-footer--inline .footer-inline-links {justify-content:center}
  .site-footer--inline .footer-inline-links a {font-size:12px;min-height:30px;padding:5px 9px}
}
