/* ==========================================================================
   Acadlix Portal — public design system (frontend + student dashboard)
   Light palette on :root, dark palette on [data-theme="dark"].
   EVERY colour on the page comes from these variables — no hardcoded
   light backgrounds, so dark mode has no unreadable text anywhere.
   Exam screen colours live in assets/css/exam.css (exam builder owns it).
   Pass 35 — ExamPortal 5.0.0 theme tokens (read from
   examportal/assets/css/main.min.css + functions.php before writing):
   accent pink #FF2E63, ink #0B0B0F, border #E6E6E6, surface #FFFFFF,
   alt #F3F3F3, muted #6B6B6B; dark bg #0E0E12, surface #141418,
   border #2A2A31, muted #A0A0A8; headings "Outfit", body "DM Sans"
   (font stacks only — the webfonts are NOT bundled, same as the
   portal's existing header stacks); radii xs 6 / sm 10 / md 14 /
   lg 20 / pill 999px. Design Studio still wins where it stores a
   value: header.php overrides --primary/--accent/--font inline from
   design_primary_color()/design_accent_color()/design_font(), whose
   defaults are now the theme pink / DM Sans (includes/design.php).
   ========================================================================== */
:root{
  color-scheme:light;
  --bg:#F4F6FA; --surface:#ffffff; --surface-2:#F3F3F3; --surface-3:#EDEFF3;
  --text:#0B0B0F; --muted:#6B6B6B; --faint:#A0A0A8;
  --border:#E6E6E6; --border-strong:#D5D5DB;
  --primary:#FF2E63; --primary-hover:#E02457; --primary-active:#BE1E4E;
  --primary-soft:#FFF0F4; --primary-soft-text:#C2183F; --on-primary:#ffffff;
  --brand-2:#FF5C8A; --brand-3:#E11D48;
  --grad-brand:linear-gradient(135deg,#FF2E63 0%,#F43F5E 55%,#E11D48 100%);
  --grad-brand-soft:linear-gradient(135deg,#FFF0F4,#FFE4EC);
  /* Button backgrounds stay deep in BOTH themes so white text stays readable */
  --btn-primary-bg:#FF2E63; --btn-primary-hover:#E02457;
  --btn-success-bg:#16a34a; --btn-danger-bg:#dc2626;
  --success:#16a34a; --success-soft:#dcfce7; --success-text:#166534;
  --danger:#dc2626;  --danger-soft:#fee2e2;  --danger-text:#991b1b;
  --warning:#d97706; --warning-soft:#fef3c7; --warning-text:#92400e;
  --info:#0284c7;    --info-soft:#e0f2fe;    --info-text:#075985;
  --purple:#7c3aed;  --purple-soft:#f3e8ff;  --purple-text:#6b21a8;
  --accent:#FF2E63;
  --shadow-sm:0 1px 2px rgba(16,24,64,.06);
  --shadow:0 1px 2px rgba(16,24,64,.06),0 6px 20px rgba(16,24,64,.07);
  --shadow-lg:0 2px 6px rgba(16,24,64,.06),0 16px 40px rgba(16,24,64,.12);
  --shadow-brand:0 8px 20px rgba(255,46,99,.32);
  --radius:14px; --radius-sm:10px; --radius-lg:20px;
  --header-h:64px;
  --font:"DM Sans",system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif;
  --font-heading:"Outfit","DM Sans",system-ui,-apple-system,"Segoe UI",sans-serif;
}
[data-theme="dark"]{
  color-scheme:dark;
  --bg:#0E0E12; --surface:#141418; --surface-2:#1C1C22; --surface-3:#26262E;
  --text:#FFFFFF; --muted:#A0A0A8; --faint:#6B6B6B;
  --border:#2A2A31; --border-strong:#3D3D47;
  --primary:#FF5C8A; --primary-hover:#FF7A9C; --primary-active:#FF2E63;
  --primary-soft:#3A1220; --primary-soft-text:#FFB3C6; --on-primary:#FFFFFF;
  --brand-2:#FF5C8A; --brand-3:#FF2E63;
  --grad-brand:linear-gradient(135deg,#FF2E63 0%,#F43F5E 55%,#E11D48 100%);
  --grad-brand-soft:linear-gradient(135deg,#3A1220,#2A0A14);
  --btn-primary-bg:#FF2E63; --btn-primary-hover:#E02457;
  --btn-success-bg:#15803d; --btn-danger-bg:#b91c1c;
  --success:#4ade80; --success-soft:#14532d; --success-text:#bbf7d0;
  --danger:#f87171;  --danger-soft:#450a0a;  --danger-text:#fecaca;
  --warning:#fbbf24; --warning-soft:#451a03; --warning-text:#fde68a;
  --info:#38bdf8;    --info-soft:#0c4a6e;    --info-text:#bae6fd;
  --purple:#c084fc;  --purple-soft:#3b0764;  --purple-text:#e9d5ff;
  --accent:#FF5C8A;
  --shadow-sm:0 1px 2px rgba(0,0,0,.4);
  --shadow:0 1px 2px rgba(0,0,0,.4),0 6px 20px rgba(0,0,0,.35);
  --shadow-lg:0 2px 6px rgba(0,0,0,.4),0 16px 40px rgba(0,0,0,.5);
  --shadow-brand:0 8px 20px rgba(255,46,99,.45);
}
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%;scroll-behavior:smooth}
body{margin:0;font-family:var(--font);background:var(--bg);color:var(--text);line-height:1.55;font-size:1rem;transition:background-color .2s ease,color .2s ease}
/* Base font size (header font-size dropdown): the root font size scales
   every rem-based size site-wide. body is 1rem so it scales too. */
html[data-font-size="90"]{font-size:90%}
html[data-font-size="100"]{font-size:100%}
html[data-font-size="110"]{font-size:110%}
html[data-font-size="125"]{font-size:125%}
a{color:var(--primary);text-decoration:none}
a:hover{text-decoration:underline}
img{max-width:100%;height:auto;display:block}
h1,h2,h3,h4{font-family:var(--font-heading);line-height:1.22;margin:.2em 0 .5em;font-weight:800;letter-spacing:-.02em}
h1{font-size:2rem} h2{font-size:1.5rem} h3{font-size:1.18rem}
p{margin:.4em 0 .8em}
::selection{background:var(--primary);color:#fff}
:focus-visible{outline:3px solid var(--primary);outline-offset:2px;border-radius:4px}
.container{max-width:1180px;margin:0 auto;padding:0 16px}
.page-main{padding:28px 16px 56px;min-height:60vh}
.muted{color:var(--muted)} .small{font-size:.875rem} .mt{margin-top:16px} .mb{margin-bottom:16px}
.text-center{text-align:center}
code{background:var(--surface-2);border:1px solid var(--border);border-radius:6px;padding:1px 6px;font-size:.9em}
pre{background:var(--surface-2);border:1px solid var(--border);border-radius:var(--radius-sm);padding:14px;overflow-x:auto}

/* ---------- Header / nav — ONE LINE at desktop ---------- */
.site-header{background:var(--surface);border-bottom:1px solid var(--border);position:sticky;top:0;z-index:50;box-shadow:var(--shadow-sm);font-family:"DM Sans",system-ui,-apple-system,"Segoe UI",sans-serif}
.site-header .logo,.drawer-login-title,.drawer-account-title{font-family:"Outfit","DM Sans",system-ui,-apple-system,"Segoe UI",sans-serif}
.site-header .container{max-width:1360px}
.header-inner{display:flex;align-items:center;gap:10px;padding:0 16px;height:var(--header-h);flex-wrap:nowrap}
.logo{display:flex;align-items:center;gap:9px;font-weight:800;font-size:1.22rem;color:var(--text);flex:none;white-space:nowrap}
.logo:hover{text-decoration:none}
.logo-mark{display:inline-flex;align-items:center;justify-content:center;width:36px;height:36px;border-radius:10px;background:var(--grad-brand);color:#fff;font-size:1.15rem;flex:none;box-shadow:var(--shadow-brand)}
.logo-text{background:linear-gradient(120deg,#FF2E63,#E11D48);-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent;color:transparent}
[data-theme="dark"] .logo-text{background:linear-gradient(120deg,#FF7A9C,#FF5C8A);-webkit-background-clip:text;background-clip:text}
.logo-img{height:34px;width:auto;max-width:170px;object-fit:contain;flex:none}
/* ---------- Site header — mobile-UI pattern at EVERY width (pass 21 M,
   new direction 2026-11-24). The header holds ONLY hamburger + logo +
   profile icon; navigation lives in the left slide-in drawer (360px /
   88vw, dim overlay — ExamPortal .ep-drawer). No header search /
   font-size / theme / bell / cart: those live in the drawer. Pass 43
   adds ONE exception: at >=1024px the main menu items also show inline
   in the header (.header-nav below), in drawer order; at <=1023px the
   drawer is still the only menu. ExamPortal tokens: accent #FF2E63,
   ink #0B0B0F, border #E6E6E6; headings "Outfit", body "DM Sans"
   (system-ui fallbacks — the webfonts are NOT bundled). */
.header-inner .nav-toggle{order:1}
.header-inner .logo{order:2}
.header-actions{display:flex;align-items:center;gap:8px;flex:none;order:3;margin-left:auto}
/* Pass 43 — header nav: the main menu items inline in the site header
   at >=1024px (desktop + tablet landscape), between the logo and the
   header actions; hidden at <=1023px, where the hamburger drawer is
   the only menu. One row, no wrap: the row itself scrolls horizontally
   (scrollbar hidden) only as a safety net for extra admin-configured
   menu links or a long site name, so the header can never overflow.
   At 1024–1279px the links tighten (smaller font/padding, no gap) so
   the nine default items still fit visibly in one row. The active item
   uses the SAME gradient pill as the drawer / left sidebar links. */
.header-nav{display:none}
@media (min-width:1024px){
  .header-nav{display:flex;align-items:center;gap:2px;flex:1 1 auto;min-width:0;order:3;flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none;-ms-overflow-style:none}
  .header-nav::-webkit-scrollbar{display:none}
  .header-actions{order:4}
  .header-nav-link{display:inline-flex;align-items:center;flex:none;white-space:nowrap;color:var(--text);font-weight:600;font-size:.92rem;padding:8px 10px;border-radius:999px;text-decoration:none}
  .header-nav-link:hover{background:var(--primary-soft);color:var(--primary);text-decoration:none}
  .header-nav-link.active{background:var(--grad-brand);color:#fff;box-shadow:var(--shadow-brand)}
  .header-nav-link.active:hover{background:var(--grad-brand);color:#fff}
}
@media (min-width:1024px) and (max-width:1279px){
  .header-inner{gap:6px}
  .header-nav{gap:0}
  .header-nav-link{font-size:.78rem;padding:7px 4px}
  .header-actions{gap:6px}
}
/* Hamburger + profile icon: white circular ~44px buttons with a thin
   light-grey ring. Dark mode: black circles (as observed). */
.nav-toggle{display:inline-flex;align-items:center;justify-content:center;width:44px;height:44px;min-width:44px;min-height:44px;padding:0;background:#fff;border:1px solid #E6E6E6;border-radius:50%;font-size:1.3rem;cursor:pointer;color:#0B0B0F;flex:none}
.nav-toggle:hover{box-shadow:var(--shadow-sm)}
.header-user-btn{display:inline-flex;align-items:center;justify-content:center;width:44px;height:44px;min-width:44px;min-height:44px;padding:0;background:#fff;border:1px solid #E6E6E6;border-radius:50%;cursor:pointer;color:#0B0B0F;flex:none}
.header-user-btn:hover{border-color:#FF2E63;box-shadow:var(--shadow-sm)}
[data-theme="dark"] .nav-toggle,[data-theme="dark"] .user-menu-btn,[data-theme="dark"] .header-user-btn{background:#000;border-color:#333;color:#fff}
/* Drawer — left slide-in, 360px / 88vw on desktop, 70vw at ≤1023px
   (pass 33 media query just below). .3s ease (ExamPortal .ep-drawer). */
.main-nav{position:fixed;top:0;left:0;bottom:0;width:360px;max-width:88vw;z-index:9999;background:var(--surface);box-shadow:var(--shadow-lg);display:flex;flex-direction:column;align-items:stretch;gap:4px;padding:16px;overflow-y:auto;transform:translateX(-100%);transition:transform .3s ease,visibility .3s ease;visibility:hidden;font-family:"DM Sans",system-ui,-apple-system,"Segoe UI",sans-serif}
.main-nav.open{transform:translateX(0);visibility:visible}
/* Pass 33: on phones and tablets (≤1023px) the site drawer is 70% of
   the viewport wide (was 360px / max 88vw). Desktop is untouched —
   the drawer is a mobile/tablet element. The same CSS covers the
   app's web view. */
@media (max-width:1023px){
  .main-nav{width:70vw;max-width:70vw}
}
/* Pass 30 — drawer links: flex rows with a 3D icon tile; the current
   page is a purple gradient pill with white text (reference look). */
.main-nav>a.drawer-link{display:flex;align-items:center;gap:12px;color:var(--text);font-weight:600;padding:10px 12px;border-radius:12px;font-size:1rem;text-decoration:none;min-height:52px}
.main-nav>a.drawer-link:hover{background:var(--primary-soft);color:var(--primary);text-decoration:none}
.main-nav>a.drawer-link.active{background:var(--grad-brand);color:#fff;box-shadow:var(--shadow-brand)}
.main-nav>a.drawer-link.active:hover{background:var(--grad-brand);color:#fff}
/* Pass 30 — 3D icon tiles, shared by the site drawer and the student
   dashboard sidebar (student/_layout.php reuses .ic-tile from this
   sheet): small rounded tile, light gradient, soft drop shadow + top
   highlight, so the self-coloured ew_icon() glyph reads as 3D. On the
   gradient active pill the tile turns translucent white so the icon
   stays visible; hover lifts the tile slightly. */
.ic-tile{flex:0 0 36px;width:36px;height:36px;display:inline-flex;align-items:center;justify-content:center;border-radius:11px;background:linear-gradient(145deg,#ffffff 0%,#FFF0F4 55%,#FFE4EC 100%);border:1px solid rgba(255,46,99,.14);box-shadow:0 3px 8px rgba(255,46,99,.18),inset 0 1px 0 rgba(255,255,255,.9);transition:transform .15s ease,box-shadow .15s ease}
.ic-tile .ew-ic{display:block}
.main-nav a:hover .ic-tile,.dash-menu a:hover .ic-tile{transform:translateY(-1px);box-shadow:0 5px 12px rgba(255,46,99,.25),inset 0 1px 0 rgba(255,255,255,.9)}
.main-nav a.active .ic-tile,.dash-menu a.active .ic-tile{background:rgba(255,255,255,.24);border-color:rgba(255,255,255,.4);box-shadow:0 3px 8px rgba(0,0,0,.28),inset 0 1px 0 rgba(255,255,255,.4)}
.drawer-link-label{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
@media (prefers-reduced-motion:reduce){.ic-tile,.main-nav a:hover .ic-tile,.dash-menu a:hover .ic-tile{transition:none;transform:none}.main-nav{transition:none}}
/* Pass 30 — gradient header strip at the top of the drawer: logo mark
   + site name in white on the brand gradient, round white close X. */
.drawer-head{display:flex;align-items:center;justify-content:space-between;gap:10px;background:var(--grad-brand);margin:-16px -16px 14px;padding:14px 16px}
.drawer-head .logo{color:#fff}
/* Pass 30 fix — .header-inner .logo{order:2} also matches the drawer logo
   (the drawer sits inside .header-inner), pushing it right of the close X;
   reset it here so the drawer shows logo left, close right. */
.drawer-head .logo{order:0}
.drawer-head .logo-mark{background:#fff;color:#FF2E63;box-shadow:0 2px 6px rgba(0,0,0,.25)}
.drawer-head .logo-text{background:none;-webkit-background-clip:initial;background-clip:initial;-webkit-text-fill-color:#fff;color:#fff}
.drawer-head .nav-close{margin:0;background:#fff;border-color:#fff;color:#FF2E63;box-shadow:0 2px 6px rgba(0,0,0,.25)}
.nav-close{display:inline-flex;align-items:center;justify-content:center;align-self:flex-end;width:38px;height:38px;border:1px solid var(--border);border-radius:50%;background:var(--surface);color:var(--text);font-size:1.3rem;cursor:pointer;margin-bottom:8px;flex:none}
.nav-overlay{position:fixed;inset:0;background:rgb(0 0 0/.55);z-index:9998;opacity:0;visibility:hidden;pointer-events:none;transition:opacity .3s ease,visibility .3s ease}
.nav-overlay.open{opacity:1;visibility:visible;pointer-events:auto}
.header-search-mobile{display:flex}
.header-search-mobile input{flex:1;border:1px solid var(--border);border-right:0;border-radius:10px 0 0 10px;padding:10px 12px;font-size:.95rem;min-width:0;background:var(--surface-2);color:var(--text)}
.header-search-mobile button{border:1px solid var(--border);background:var(--primary-soft);color:var(--primary);border-radius:0 10px 10px 0;padding:10px 12px;cursor:pointer;display:flex;align-items:center;justify-content:center}
.nav-mobile-actions{display:flex;gap:8px;align-items:center;margin-top:12px;flex-wrap:wrap}
body.nav-open{overflow:hidden}
/* Drawer login panel (logged out): rounded card, gradient title —
   the ExamPortal side-menu login panel, in portal design tokens. */
.drawer-login{background:var(--surface-2);border:1px solid var(--border);border-radius:16px;padding:14px;display:flex;flex-direction:column;gap:10px;margin-bottom:14px}
.drawer-login-title{margin:0;font-weight:800;font-size:1.05rem;background:var(--grad-brand);-webkit-background-clip:text;background-clip:text;color:transparent}
.drawer-login input{width:100%;padding:11px 12px;border:1px solid var(--border);border-radius:10px;font:inherit;font-size:.95rem;background:var(--surface);color:var(--text)}
.drawer-login .btn{width:100%;justify-content:center}
.drawer-login-links{margin:0;font-size:.88rem;text-align:center}
/* Pass 30 — drawer user block (logged in): CENTRED big circular
   avatar with the name underneath and the email small below it. */
.drawer-user{display:flex;flex-direction:column;align-items:center;text-align:center;gap:2px;padding:6px 2px 16px;border-bottom:1px solid var(--border);margin-bottom:12px}
.drawer-user .avatar-circle,.drawer-user .avatar-img{width:72px;height:72px;font-size:1.6rem}
.drawer-user .nm{font-weight:800;font-size:1.05rem;line-height:1.3;word-break:break-word}
.drawer-user .em{font-size:.82rem;color:var(--muted);word-break:break-all}
/* Drawer account menu: the same K-list as the profile dropdown,
   Logout last. */
.drawer-account{border-top:1px solid var(--border);padding-top:12px;margin-top:12px}
.drawer-account-title{margin:0 0 6px;font-size:.8rem;font-weight:800;letter-spacing:.04em;text-transform:uppercase;color:var(--muted)}
.drawer-account a{display:flex;align-items:center;gap:12px;padding:10px 12px;border-radius:12px;color:var(--text);font-weight:600;min-height:52px}
.drawer-account a:hover{background:var(--primary-soft);color:var(--primary);text-decoration:none}
.drawer-account a.active{background:var(--grad-brand);color:#fff;box-shadow:var(--shadow-brand)}
.drawer-account a.active:hover{background:var(--grad-brand);color:#fff}
.drawer-account a.drawer-logout{color:#dc2626}
.drawer-account a.drawer-logout:hover{background:#fef2f2;color:#dc2626}
[data-theme="dark"] .drawer-account a.drawer-logout:hover{background:#450a0a;color:#fca5a5}
.user-menu{position:relative}
.user-menu-btn{display:inline-flex;align-items:center;justify-content:center;width:44px;height:44px;min-width:44px;min-height:44px;padding:0;background:#fff;border:1px solid #E6E6E6;border-radius:50%;cursor:pointer;color:#0B0B0F;flex:none;transition:border-color .15s ease,box-shadow .15s ease}
.user-menu-btn:hover{border-color:#FF2E63;box-shadow:var(--shadow-sm)}
.user-menu-btn .user-name,.user-menu-btn .caret{display:none}
.user-menu-btn .avatar-circle,.user-menu-btn .avatar-img{width:36px;height:36px}
.avatar-circle{width:30px;height:30px;border-radius:50%;background:var(--grad-brand);color:#fff;display:inline-flex;align-items:center;justify-content:center;font-weight:700}
.avatar-img{width:30px;height:30px;border-radius:50%;object-fit:cover;flex:none;display:block}
.user-name{max-width:110px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.caret{color:var(--muted);font-size:.7rem}
.user-menu-dropdown{display:none;position:absolute;right:0;top:calc(100% + 8px);background:var(--surface);border:1px solid var(--border);border-radius:16px;box-shadow:var(--shadow-lg);min-width:210px;padding:6px;z-index:60}
.user-menu-dropdown.open{display:block}
.user-menu-dropdown a{display:block;padding:9px 12px;border-radius:8px;color:var(--text);font-weight:600}
.user-menu-dropdown a:hover{background:#FFF0F4;text-decoration:none;color:#FF2E63}

/* ---------- Theme toggle ---------- */
.theme-toggle{display:inline-flex;align-items:center;justify-content:center;width:38px;height:38px;border-radius:50%;border:1px solid var(--border);background:var(--surface);color:var(--text);cursor:pointer;font-size:1.15rem;line-height:1;flex:none;transition:background-color .15s ease,border-color .15s ease}
.theme-toggle:hover{background:var(--surface-2);border-color:var(--border-strong)}
.theme-toggle .theme-icon{display:none}
.theme-toggle .theme-icon .ew-ic{display:block}
html[data-theme="light"] .theme-toggle .theme-icon-moon{display:inline}
html[data-theme="dark"] .theme-toggle .theme-icon-sun{display:inline}

/* ---------- Font-size dropdown (header) ----------
   Same menu look as the header's other dropdowns (.user-menu-dropdown /
   .nav-more-dropdown): surface background, border, 12px radius,
   shadow-lg, items that highlight primary-soft on hover — so it is
   dark-mode aware with no extra work. */
.font-size-menu{position:relative;flex:none}
.font-size-btn{display:inline-flex;align-items:center;gap:6px;background:var(--surface);border:1px solid var(--border);border-radius:999px;padding:7px 11px;cursor:pointer;font-size:.9rem;font-weight:700;color:var(--text);font-family:inherit;line-height:1;transition:background-color .15s ease,border-color .15s ease;white-space:nowrap}
.font-size-btn:hover{background:var(--surface-2);border-color:var(--border-strong)}
.font-size-btn .fs-btn-a{font-size:1.05rem}
.font-size-btn .caret{color:var(--muted);font-size:.7rem}
.font-size-dropdown{display:none;position:absolute;right:0;top:calc(100% + 8px);background:var(--surface);border:1px solid var(--border);border-radius:12px;box-shadow:var(--shadow-lg);min-width:190px;padding:6px;z-index:60}
.font-size-menu.open .font-size-dropdown{display:block}
.font-size-dropdown button{display:flex;align-items:center;justify-content:space-between;gap:10px;width:100%;background:none;border:0;padding:9px 12px;border-radius:8px;color:var(--text);font-weight:600;font-size:.95rem;font-family:inherit;cursor:pointer;text-align:left}
.font-size-dropdown button:hover{background:var(--primary-soft);text-decoration:none;color:var(--primary)}
.font-size-dropdown button.selected{background:var(--primary-soft);color:var(--primary)}
.font-size-dropdown .fs-opt-tick{visibility:hidden;color:var(--primary);font-weight:800}
.font-size-dropdown button.selected .fs-opt-tick{visibility:visible}

/* ---------- 3D icons (includes/icons.php: ew_icon) ----------
   Gradient-filled inline SVGs — self-coloured, so they read in both
   light and dark mode. Sizing/alignment only; never recolour them. */
.ew-ic{display:inline-block;vertical-align:-3px;flex:none}
.ic{display:inline-flex;align-items:center;justify-content:center;flex:none}
.ic .ew-ic{display:block}
.header-search button .ew-ic,.header-search-mobile button .ew-ic,.cart-link .ew-ic{display:block}
.nav-toggle .ew-ic,.nav-close .ew-ic{display:block}
.dash-hamburger,.dash-gear{display:inline-flex;align-items:center;justify-content:center}
.dash-hamburger .ew-ic,.dash-gear .ew-ic,.dash-side-close .ew-ic{display:block}
.dash-bottomnav a .ic .ew-ic{display:block}
.dash-wish{display:inline-flex;align-items:center;justify-content:center}
.dash-wish .ew-ic{display:block}
.stat-ic{display:block;margin-bottom:4px}
.stat-ic .ew-ic{display:block}
.section-head h2 .ew-ic{vertical-align:-4px;margin-right:6px}
.card-body h3 .ew-ic{vertical-align:-3px;margin-right:5px}
.card h2 .ew-ic{vertical-align:-4px;margin-right:6px}
.bn-preview .ew-ic{display:block}

/* ---------- Buttons, forms ---------- */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;border:1px solid transparent;border-radius:10px;padding:10px 18px;font-weight:700;font-size:.95rem;cursor:pointer;text-align:center;line-height:1.3;font-family:inherit;transition:background-color .15s ease,border-color .15s ease,box-shadow .15s ease,transform .15s ease}
.btn:hover{text-decoration:none;transform:translateY(-1px)}
.btn:active{transform:translateY(0)}
.btn-primary{background:var(--grad-brand);background-color:var(--btn-primary-bg);color:#fff;box-shadow:var(--shadow-brand)}
.btn-primary:hover{background:var(--btn-primary-hover);box-shadow:0 10px 24px rgba(255,46,99,.4)}
.btn-outline{background:var(--surface);border-color:var(--primary);color:var(--primary)}
.btn-outline:hover{background:var(--primary-soft);box-shadow:var(--shadow-sm)}
.btn-success{background:var(--btn-success-bg);color:#fff;box-shadow:0 6px 16px rgba(22,163,74,.3)}
.btn-success:hover{filter:brightness(.94)}
.btn-danger{background:var(--btn-danger-bg);color:#fff;box-shadow:0 6px 16px rgba(220,38,38,.3)}
.btn-danger:hover{filter:brightness(.94)}
.btn-light{background:var(--surface);border-color:var(--border-strong);color:var(--text)}
.btn-light:hover{background:var(--surface-2);box-shadow:var(--shadow-sm)}
.btn-sm{padding:7px 12px;font-size:.875rem}
.btn-block{display:flex;width:100%}
.btn:disabled{opacity:.55;cursor:not-allowed;transform:none;box-shadow:none}
form.inline{display:inline}
label{display:block;font-weight:600;margin:12px 0 4px}
input[type=text],input[type=email],input[type=password],input[type=number],input[type=date],input[type=datetime-local],input[type=url],input[type=tel],input[type=search],select,textarea{width:100%;border:1px solid var(--border-strong);border-radius:10px;padding:10px 12px;font-size:1rem;font-family:inherit;background:var(--surface);color:var(--text);transition:border-color .15s ease,box-shadow .15s ease}
input::placeholder,textarea::placeholder{color:var(--faint)}
textarea{min-height:110px;resize:vertical}
input:focus,select:focus,textarea:focus{outline:none;border-color:var(--primary);box-shadow:0 0 0 4px var(--primary-soft)}
input[type=checkbox],input[type=radio]{width:auto;accent-color:var(--primary)}
.form-row{display:flex;gap:12px;flex-wrap:wrap}
.form-row>*{flex:1;min-width:180px}
.form-error{color:var(--danger);font-size:.9rem;margin-top:4px}
.field{margin-bottom:14px}
.field label{margin-top:0}
.hint{color:var(--muted);font-size:.85rem;margin-top:4px}
.flash{border-radius:12px;padding:13px 16px;margin:0 0 16px;font-weight:500;border:1px solid transparent;box-shadow:var(--shadow-sm)}
.flash-success{background:var(--success-soft);color:var(--success-text);border-color:var(--success)}
.flash-error{background:var(--danger-soft);color:var(--danger-text);border-color:var(--danger)}
.flash-info{background:var(--info-soft);color:var(--info-text);border-color:var(--info)}
.alert{border-radius:12px;padding:13px 16px;margin:0 0 16px;font-weight:500;border:1px solid transparent;box-shadow:var(--shadow-sm)}
.alert-success{background:var(--success-soft);color:var(--success-text);border-color:var(--success)}
.alert-error{background:var(--danger-soft);color:var(--danger-text);border-color:var(--danger)}
.alert-warning{background:var(--warning-soft);color:var(--warning-text);border-color:var(--warning)}
.alert-info{background:var(--info-soft);color:var(--info-text);border-color:var(--info)}
.alert-ok{background:var(--success-soft);color:var(--success-text);border-color:var(--success)}

/* ---------- Cards & grids ---------- */
.card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow);padding:22px;margin-bottom:20px}
.card h2:first-child,.card h3:first-child{margin-top:0}
.grid{display:grid;gap:18px}
.grid-2{grid-template-columns:repeat(2,1fr)}
.grid-3{grid-template-columns:repeat(3,1fr)}
.grid-4{grid-template-columns:repeat(4,1fr)}
.course-card,.quiz-card,.subject-card,.series-card,.bundle-card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow);overflow:hidden;display:flex;flex-direction:column;transition:transform .18s ease,box-shadow .18s ease,border-color .18s ease}
.course-card:hover,.quiz-card:hover,.subject-card:hover,.series-card:hover,.bundle-card:hover{box-shadow:var(--shadow-lg);transform:translateY(-3px);border-color:var(--primary)}
.card-thumb{height:150px;background:var(--grad-brand);display:flex;align-items:center;justify-content:center;color:#fff;font-size:2.4rem;font-weight:800;overflow:hidden;flex:none;position:relative}
.card-thumb::after{content:"";position:absolute;inset:0;background:radial-gradient(circle at 85% 15%,rgba(255,255,255,.28),transparent 45%),radial-gradient(circle at 10% 90%,rgba(255,255,255,.14),transparent 40%)}
.card-thumb img{width:100%;height:100%;object-fit:cover;position:relative;z-index:1}
.card-body{padding:16px;display:flex;flex-direction:column;gap:8px;flex:1}
.card-body h3{margin:0;font-size:1.05rem}
.card-body h3 a{color:var(--text)}
.card-body p{margin:0;color:var(--muted);font-size:.92rem}
.card-meta{display:flex;gap:12px;flex-wrap:wrap;font-size:.85rem;color:var(--muted)}
.card-footer{margin-top:auto;display:flex;align-items:center;justify-content:space-between;gap:8px;padding-top:10px;border-top:1px solid var(--border)}
.price{font-weight:800;font-size:1.15rem;color:var(--primary)}
.price .old{font-weight:400;font-size:.85rem;color:var(--muted);text-decoration:line-through;margin-left:6px}

/* ---------- Beautiful course cards (pass 13) ----------
   Scoped to .course-card only: quiz/subject/series cards keep the
   plain shared card look. All colours are theme variables, so dark
   mode stays readable. No fixed widths anywhere — the grid collapses
   3 -> 2 -> 1 column and the footer wraps, so 360px stays clean. */
.course-card{min-width:0;border-radius:18px}
.course-card .card-thumb{height:172px}
.course-card .card-thumb img{transition:transform .35s ease}
.course-card:hover .card-thumb img{transform:scale(1.06)}
.course-card-thumb{display:block;flex:none}
.course-card-thumb:hover{text-decoration:none}
.course-cat-chip{position:absolute;left:12px;bottom:12px;z-index:2;display:inline-flex;align-items:center;max-width:calc(100% - 24px);background:rgba(255,255,255,.94);color:#C2183F;border-radius:999px;padding:4px 12px;font-size:.78rem;font-weight:800;letter-spacing:.01em;box-shadow:0 2px 10px rgba(16,24,64,.25);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.course-card .card-body{padding:18px 18px 16px;gap:10px}
.course-card .card-body h3{font-size:1.08rem;line-height:1.32;overflow-wrap:break-word;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.course-card-desc{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.course-counts{display:flex;gap:8px;flex-wrap:wrap}
.course-count-chip{display:inline-flex;align-items:center;gap:5px;background:var(--primary-soft);color:var(--primary-soft-text);border-radius:999px;padding:4px 11px;font-size:.8rem;font-weight:700;white-space:nowrap}
.course-count-chip.lessons{background:var(--purple-soft);color:var(--purple-text)}
.course-count-chip .ew-ic{flex:none}
.course-card .card-meta{font-size:.83rem}
.course-card .card-footer{flex-wrap:wrap;gap:10px}
.course-card .price{font-size:1.22rem}
.course-card .price .old{font-size:.88rem}

/* ---------- Quiz tree (pass 13): Subject -> Topic -> quizzes ----------
   Native <details>/<summary>: keyboard-accessible expand/collapse with
   no JavaScript (the browser owns aria-expanded). All colours are theme
   variables, so dark mode stays readable. No fixed widths anywhere —
   summaries wrap, meta wraps, quiz footers wrap, so 360px stays clean. */
.quiz-tree{display:flex;flex-direction:column;gap:12px;margin-bottom:20px}
.qt-subject,.qt-topic{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow-sm)}
.qt-topic{box-shadow:none;border-radius:var(--radius-sm)}
.qt-subject>summary,.qt-topic>summary{display:flex;align-items:center;gap:10px;padding:14px 16px;cursor:pointer;list-style:none;border-radius:var(--radius)}
.qt-topic>summary{padding:11px 14px;border-radius:var(--radius-sm)}
.qt-subject>summary::-webkit-details-marker,.qt-topic>summary::-webkit-details-marker{display:none}
.qt-subject>summary:hover,.qt-topic>summary:hover{background:var(--surface-2)}
.qt-chevron{flex:none;width:22px;height:22px;display:inline-flex;align-items:center;justify-content:center;border-radius:6px;background:var(--primary-soft);color:var(--primary-soft-text);font-size:1.05rem;line-height:1;transition:transform .18s ease}
.qt-subject[open]>summary .qt-chevron,.qt-topic[open]>summary .qt-chevron{transform:rotate(90deg)}
.qt-node-name{font-weight:800;font-size:1.05rem;line-height:1.3;min-width:0;overflow-wrap:break-word}
.qt-topic .qt-node-name{font-size:.98rem;font-weight:700}
.qt-count{margin-left:auto;flex:none;text-align:right}
.qt-subject[open]>summary{border-bottom:1px solid var(--border);border-radius:var(--radius) var(--radius) 0 0}
.qt-children{padding:12px 14px 14px;display:flex;flex-direction:column;gap:10px}
.qt-topic .qt-quizzes{padding:0 12px 12px}
.qt-quizzes{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:10px}
.qt-quiz{background:var(--surface-2);border:1px solid var(--border);border-radius:var(--radius-sm);padding:12px 14px;display:flex;flex-direction:column;gap:6px;min-width:0}
.qt-quiz h3{margin:0;font-size:1rem;line-height:1.35;overflow-wrap:break-word}
.qt-quiz h3 a{color:var(--text)}
.qt-quiz p{margin:0;color:var(--muted);font-size:.92rem;overflow-wrap:break-word}
.qt-quiz .card-meta{font-size:.85rem}
.qt-type{color:var(--primary);font-weight:700}
.qt-quiz-foot{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap;padding-top:8px;border-top:1px solid var(--border)}
.badge{display:inline-flex;align-items:center;gap:4px;padding:4px 10px;border-radius:999px;font-size:.78rem;font-weight:700;white-space:nowrap}
.badge-free,.badge-success,.badge-green{background:var(--success-soft);color:var(--success-text)}
.badge-paid,.badge-blue{background:var(--info-soft);color:var(--info-text)}
.badge-featured,.badge-premium,.badge-amber{background:var(--warning-soft);color:var(--warning-text)}
.badge-draft,.badge-grey{background:var(--surface-2);color:var(--muted);border:1px solid var(--border)}
.badge-danger,.badge-red{background:var(--danger-soft);color:var(--danger-text)}
.badge-purple{background:var(--purple-soft);color:var(--purple-text)}
/* Pass 38 — membership badge: same green pill as .badge-green; wraps
   instead of overflowing narrow menus (360px drawer / 240px sidebar),
   and the dropdown head gives it breathing room above My Profile. */
.membership-badge{max-width:100%;white-space:normal;text-align:center;overflow-wrap:break-word}
.user-menu-dropdown-head{padding:8px 12px 2px}
.lock-screen{text-align:center;border:2px dashed var(--warning);background:var(--warning-soft)}
.lock-screen h2{margin-top:0}
.lock-screen .btn{margin:4px}
.lock-screen .lock-icon{font-size:2.6rem}
.star{color:var(--faint);font-size:1rem}
.star.on{color:#f59e0b}
.star.half{color:#f59e0b;opacity:.6}

/* ---------- Hero & stats ---------- */
.hero{position:relative;overflow:hidden;background:linear-gradient(120deg,#FF2E63 0%,#E11D48 60%,#9D174D 100%);color:#fff;border-radius:var(--radius-lg);padding:52px 32px;margin-bottom:28px;text-align:center;box-shadow:var(--shadow-lg)}
.hero::before{content:"";position:absolute;inset:0;background-image:radial-gradient(rgba(255,255,255,.16) 1px,transparent 1px);background-size:22px 22px;opacity:.55;pointer-events:none}
.hero::after{content:"";position:absolute;width:340px;height:340px;border-radius:50%;background:rgba(255,255,255,.14);filter:blur(70px);top:-140px;right:-60px;pointer-events:none}
.hero>*{position:relative;z-index:1}
.hero h1{font-size:2.4rem;margin:0 0 10px;color:#fff;letter-spacing:-.03em}
.hero p{opacity:.94;max-width:640px;margin:0 auto 22px;color:#e0e7ff;font-size:1.06rem}
.hero-eyebrow{display:inline-block;background:rgba(255,255,255,.16);border:1px solid rgba(255,255,255,.35);color:#fff;border-radius:999px;padding:5px 14px;font-size:.82rem;font-weight:700;letter-spacing:.04em;text-transform:uppercase;margin-bottom:14px}
.hero .btn-primary{background:#fff;color:#BE1E4E;box-shadow:0 10px 26px rgba(0,0,0,.28)}
.hero .btn-primary:hover{background:#FFF0F4}
.hero .btn-outline{border-color:rgba(255,255,255,.85);color:#fff;background:rgba(255,255,255,.08)}
.hero .btn-outline:hover{background:rgba(255,255,255,.18);box-shadow:none}
.stats-row{display:grid;grid-template-columns:repeat(4,1fr);gap:16px;margin-bottom:24px}
.stat{position:relative;overflow:hidden;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow);padding:20px 18px;text-align:center}
.stat::before{content:"";position:absolute;top:0;left:0;right:0;height:4px;background:var(--grad-brand)}
.stat .num{font-size:1.8rem;font-weight:800;background:linear-gradient(120deg,#FF2E63,#E11D48);-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent;color:transparent}
[data-theme="dark"] .stat .num{background:linear-gradient(120deg,#FF7A9C,#FF5C8A);-webkit-background-clip:text;background-clip:text}
.stat .label{color:var(--muted);font-size:.9rem}
.section-head{display:flex;align-items:baseline;justify-content:space-between;gap:12px;margin:30px 0 16px}
.section-head h2{margin:0;font-size:1.35rem}
.section-head .section-eyebrow{display:block;font-size:.75rem;font-weight:800;letter-spacing:.08em;text-transform:uppercase;color:var(--primary);margin-bottom:2px}

/* ---------- Tables ---------- */
table{width:100%;border-collapse:collapse;background:var(--surface);color:var(--text)}
.table-wrap{overflow-x:auto;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow);margin-bottom:20px}
.table-wrap table{box-shadow:none;border:0}
th,td{padding:11px 14px;text-align:left;border-bottom:1px solid var(--border);vertical-align:top}
th{background:var(--surface-3);font-weight:700;font-size:.8rem;text-transform:uppercase;letter-spacing:.05em;color:var(--muted)}
tr:last-child td{border-bottom:0}
tbody tr:hover td{background:var(--surface-2)}

/* ---------- Detail pages ---------- */
.detail-layout{display:grid;grid-template-columns:1fr 320px;gap:20px;align-items:start}
.detail-thumb{height:260px;border-radius:var(--radius);background:var(--grad-brand);display:flex;align-items:center;justify-content:center;color:#fff;font-size:3rem;font-weight:800;overflow:hidden;margin-bottom:16px;position:relative}
.detail-thumb::after{content:"";position:absolute;inset:0;background:radial-gradient(circle at 85% 15%,rgba(255,255,255,.28),transparent 45%)}
.detail-thumb img{width:100%;height:100%;object-fit:cover;position:relative;z-index:1}
.sidebar-card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow);padding:22px;position:sticky;top:calc(var(--header-h) + 12px)}
.sidebar-card .price{font-size:1.6rem}
.lesson-list{list-style:none;margin:0;padding:0}
.lesson-list li{display:flex;gap:10px;align-items:center;padding:10px 4px;border-bottom:1px solid var(--border)}
.lesson-list li:last-child{border-bottom:0}
.lesson-list li a{color:var(--text)}
.lesson-num{width:28px;height:28px;border-radius:50%;background:var(--primary-soft);color:var(--primary);display:inline-flex;align-items:center;justify-content:center;font-size:.8rem;font-weight:700;flex:none}
.lock{color:var(--muted)}
.review{border-bottom:1px solid var(--border);padding:12px 0}
.review:last-child{border-bottom:0}

/* ---------- Pagination, filters, misc ---------- */
.pagination{display:flex;gap:6px;justify-content:center;margin:24px 0;flex-wrap:wrap}
.pagination a,.pagination span{padding:9px 14px;border:1px solid var(--border);border-radius:10px;background:var(--surface);color:var(--text);font-weight:600}
.pagination span.current{background:var(--grad-brand);background-color:var(--btn-primary-bg);color:#fff;border-color:var(--btn-primary-bg)}
.pagination a:hover{text-decoration:none;border-color:var(--primary)}
.filters{display:flex;gap:10px;flex-wrap:wrap;margin-bottom:20px;align-items:end}
.filters .field{flex:1;min-width:160px}
.filters label{margin-top:0}
.announcement{border-left:4px solid var(--primary);padding:14px 16px;background:var(--surface);border:1px solid var(--border);border-left:4px solid var(--primary);border-radius:0 12px 12px 0;margin-bottom:12px;box-shadow:var(--shadow)}
.empty{padding:44px 24px;text-align:center;color:var(--muted);background:var(--surface);border:1px dashed var(--border-strong);border-radius:var(--radius);font-size:1rem}
.empty::before{content:"\1F4C2";display:block;font-size:2rem;margin-bottom:8px}
.auth-card{max-width:460px;margin:32px auto}
.leaderboard-rank{font-weight:800;color:var(--primary)}

/* ---------- Student dashboard ---------- */
.student-dashboard .student-nav{display:flex;gap:6px;flex-wrap:wrap;margin-bottom:20px;border-bottom:1px solid var(--border);padding-bottom:0}
.student-nav a{padding:10px 14px;font-weight:600;color:var(--muted);border-bottom:3px solid transparent;margin-bottom:-1px}
.student-nav a:hover{color:var(--primary);text-decoration:none}
.student-nav a.active{color:var(--primary);border-bottom-color:var(--primary)}
.dashboard-welcome{padding:26px;background:var(--grad-brand-soft);border:1px solid var(--border)}
.dashboard-welcome h1{background:linear-gradient(120deg,#FF2E63,#E11D48);-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent;color:transparent}
[data-theme="dark"] .dashboard-welcome h1{background:linear-gradient(120deg,#FF7A9C,#FF5C8A);-webkit-background-clip:text;background-clip:text}
.stats-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:16px;margin-bottom:20px}
.stat-card{position:relative;overflow:hidden;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow);padding:20px;transition:transform .18s ease,box-shadow .18s ease}
.stat-card:hover{transform:translateY(-2px);box-shadow:var(--shadow-lg)}
.stat-card::before{content:"";position:absolute;top:0;left:0;right:0;height:4px;background:var(--grad-brand)}
.stat-card .stat-number,.stat-card .stat-value{font-size:1.8rem;font-weight:800;color:var(--primary)}
.stat-card .stat-label{color:var(--muted);font-size:.9rem;margin-top:2px}
.stat-card .stat-sub{color:var(--muted);font-size:.85rem}
.membership-card{border-left:4px solid var(--primary)}
.plan-card{border:2px solid var(--border);border-radius:var(--radius);padding:22px;text-align:center;transition:transform .18s ease,box-shadow .18s ease,border-color .18s ease}
.plan-card:hover{transform:translateY(-2px);box-shadow:var(--shadow-lg)}
.plan-card.featured,.plan-card.current{border-color:var(--primary);box-shadow:var(--shadow-brand)}
.plan-card .plan-price{font-size:1.9rem;font-weight:800;color:var(--primary)}
.dashboard-columns{display:grid;grid-template-columns:1fr 1fr;gap:20px}
.dashboard-columns .card{margin-bottom:0}
.course-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:16px}
.course-thumb{height:140px;border-radius:var(--radius) var(--radius) 0 0;background:var(--grad-brand);display:flex;align-items:center;justify-content:center;color:#fff;font-size:2rem;font-weight:800;overflow:hidden;position:relative}
.course-thumb::after{content:"";position:absolute;inset:0;background:radial-gradient(circle at 85% 15%,rgba(255,255,255,.28),transparent 45%)}
.course-thumb img{width:100%;height:100%;object-fit:cover;position:relative;z-index:1}
.course-title{font-weight:700;font-size:1.05rem}
.continue-item{display:flex;gap:14px;align-items:center;padding:12px 0;border-bottom:1px solid var(--border)}
.continue-item:last-child{border-bottom:0}
.continue-thumb{width:72px;height:52px;flex:none;border-radius:10px;background:var(--grad-brand);display:flex;align-items:center;justify-content:center;color:#fff;font-weight:800;overflow:hidden}
.continue-body{flex:1;min-width:0}
.progress{height:8px;background:var(--surface-2);border:1px solid var(--border);border-radius:999px;overflow:hidden}
.progress-bar{height:100%;background:linear-gradient(90deg,#FF2E63,#F43F5E,#E11D48);border-radius:999px;transition:width .3s ease}
.content-list{list-style:none;margin:0;padding:0}
.content-list li{display:flex;gap:10px;align-items:center;padding:10px 4px;border-bottom:1px solid var(--border)}
.content-list li:last-child{border-bottom:0}
.content-list li.current{background:var(--primary-soft);border-radius:8px;padding:10px 8px}
.content-list li.current a{color:var(--primary);font-weight:700}
.course-player{display:grid;grid-template-columns:280px 1fr;gap:20px;align-items:start}
.course-player .player-sidebar{position:sticky;top:76px}
.avatar-large{width:84px;height:84px;border-radius:50%;background:var(--grad-brand);color:#fff;display:inline-flex;align-items:center;justify-content:center;font-size:2rem;font-weight:800;box-shadow:var(--shadow-brand)}
.certificate-card,.certificate{max-width:640px;margin:24px auto;text-align:center;border:2px solid var(--warning);padding:36px 24px}
.cert-heading{font-size:1.6rem;font-weight:800;margin-bottom:4px}
.cert-sub{color:var(--muted)}
.receipt{max-width:640px;margin:0 auto}
.receipt .row{display:flex;justify-content:space-between;gap:12px;padding:8px 0;border-bottom:1px solid var(--border)}
.receipt .row:last-child{border-bottom:0}
.assignment-card,.live-class{margin-bottom:16px}

/* ---------- Dashboard-only pages: single header ----------
   Student pages run in head-only mode (no .site-header). The dash shell
   owns the only header, so its sticky offsets drop from 60px to 0. */
body.dash-only{background:var(--bg)}
body.dash-only .dash-shell{min-height:100vh}
body.dash-only .dash-sidebar{top:0;height:100vh}
body.dash-only .dash-topbar{top:0;box-shadow:var(--shadow-sm)}
body.dash-only .dash-topbar .dash-logo .logo-mark{background:var(--grad-brand);box-shadow:var(--shadow-brand)}

/* ---------- Exam result/review shared bits (exam.css owns the exam screen) ---------- */
.exam-badge{display:inline-block;padding:4px 12px;border-radius:999px;font-size:.85rem;font-weight:700}
.exam-badge.pass{background:var(--success-soft);color:var(--success-text)}
.exam-badge.fail{background:var(--danger-soft);color:var(--danger-text)}
.exam-badge.pending{background:var(--warning-soft);color:var(--warning-text)}
.exam-result-ring{width:140px;height:140px;border-radius:50%;display:flex;flex-direction:column;align-items:center;justify-content:center;margin:0 auto;font-weight:800;border:10px solid var(--primary-soft)}
.exam-count-picker{display:flex;gap:8px;flex-wrap:wrap;margin:12px 0}
.exam-count-opt{border:2px solid var(--border);border-radius:12px;padding:10px 16px;cursor:pointer;font-weight:700;background:var(--surface);color:var(--text);font-family:inherit}
.exam-count-opt:hover{border-color:var(--primary)}
.exam-count-opt.selected{border-color:var(--primary);background:var(--primary-soft);color:var(--primary)}
.exam-start-facts{display:flex;gap:16px;flex-wrap:wrap;color:var(--muted);font-size:.95rem}

/* Dark theme: coloured text on a tinted surface must use the soft-text tone.
   (Pass 30: .main-nav a.active is NOT here — the gradient active pill
   keeps white text on the purple gradient in both themes.) */
[data-theme="dark"] .main-nav a:hover,
[data-theme="dark"] .lesson-num,[data-theme="dark"] .exam-count-opt.selected,
[data-theme="dark"] .content-list li.current a{color:var(--primary-soft-text)}

/* ---------- Footer ---------- */
.site-footer{background:#0f172a;color:#d1d5db;margin-top:32px;border-top:3px solid #FF2E63}
[data-theme="dark"] .site-footer{background:#080d18;border-top:3px solid #FF2E63}
.footer-inner{display:grid;grid-template-columns:2fr 1fr 1fr;gap:24px;padding:40px 16px}
.footer-col h4{color:#fff;margin-top:0}
.footer-col a{display:block;color:#d1d5db;padding:4px 0}
.footer-col a:hover{color:#fff}
.footer-col .logo{color:#fff}
/* The footer link rule above (0,1,1) beats .logo (0,1,0) and strips the
   flex + gap, so the badge overlapped the wordmark. Restore flex here. */
.site-footer .footer-col a.logo{display:flex;align-items:center;gap:9px}
.footer-col p{color:#9ca3af}
.footer-bottom{border-top:1px solid #374151;text-align:center;padding:14px;font-size:.875rem;color:#9ca3af}

/* ---------- Site-wide fixed bottom navigation (pass 16 item 11) ----------
   Pass 37: built in on every non-quiz page outside the dashboard shell
   (includes/footer.php decides) — no longer tied to the Design Studio
   footer style. Same shape as the dashboard bottom nav.
   Pass 42: shown at ALL widths, desktop included (≥1024px) — the
   ≤1023px media query that used to gate it is gone. Colours come from
   --sbn-bg / --sbn-color / --sbn-active, set inline on the <nav> from
   the Design Studio colour settings. Body padding keeps the bar from
   covering page content: the inline script in footer.php adds
   .has-site-bottomnav, and the :has() rule covers it when JS is off.
   The padding rule is unconditional now (same 64px as before) because
   the bar is visible at every width. NOTE: the ew_icon() SVGs are
   self-coloured gradients, so --sbn-color / --sbn-active colour the
   text labels (as on the dashboard bar); the icons keep their own
   gradient colours. */
.site-bottomnav{position:fixed;left:0;right:0;bottom:0;z-index:55;display:flex;background:var(--sbn-bg,#ffffff);border-top:1px solid var(--border);box-shadow:0 -2px 10px rgba(15,23,42,.08);padding-bottom:env(safe-area-inset-bottom)}
.site-bottomnav a{flex:1;display:flex;flex-direction:column;align-items:center;gap:2px;padding:8px 2px 10px;color:var(--sbn-color,#667085);font-size:.72rem;font-weight:600}
.site-bottomnav a .ic{font-size:1.2rem;line-height:1}
.site-bottomnav a .ic .ew-ic{display:block}
.site-bottomnav a.active{color:var(--sbn-active,#FF2E63)}
.site-bottomnav a:hover{text-decoration:none}
body.has-site-bottomnav,body:has(> nav.site-bottomnav){padding-bottom:64px}

/* ---------- Responsive ---------- */
@media (max-width:1024px){
  .detail-layout{grid-template-columns:1fr}
  .sidebar-card{position:static}
  .grid-4{grid-template-columns:repeat(3,1fr)}
  .course-player{grid-template-columns:1fr}
  .course-player .player-sidebar{position:static}
  .dashboard-columns{grid-template-columns:1fr}
}
@media (max-width:768px){
  .grid-3,.grid-4{grid-template-columns:repeat(2,1fr)}
  .stats-row{grid-template-columns:repeat(2,1fr)}
  .footer-inner{grid-template-columns:1fr}
  .hero{padding:36px 18px}
  /* Pass 22 B: .hero h1 1.8rem removed — now in the Pass 22 B block below. */
  .student-nav{overflow-x:auto;flex-wrap:nowrap}
  .student-nav a{white-space:nowrap}
}
@media (max-width:480px){
  .grid-2,.grid-3,.grid-4{grid-template-columns:1fr}
  /* Pass 22 B: h1 1.55rem, .btn padding, .hero h1 1.6rem removed —
     now in the Pass 22 B block below. */
  .card{padding:16px}
  .stats-grid{grid-template-columns:repeat(2,1fr)}
  .course-card .card-thumb{height:150px}
  .course-card .card-body{padding:14px}
}
@media (max-width:360px){
  body{font-size:15px}
  .container,.page-main{padding-left:10px;padding-right:10px}
  .header-inner{padding:0 10px}
  .card{padding:14px}
  .hero{padding:26px 12px}
  .hero h1{font-size:1.45rem}
  .stats-row{grid-template-columns:repeat(2,1fr);gap:10px}
  .stat{padding:14px 10px}
  .stats-grid{grid-template-columns:repeat(2,1fr);gap:10px}
  .qt-subject>summary,.qt-topic>summary{padding:12px 10px;gap:8px}
  .qt-children{padding:10px 10px 12px}
  .qt-topic .qt-quizzes{padding:0 10px 10px}
  .qt-quiz{padding:10px 12px}
}
@media (prefers-reduced-motion:reduce){
  *{transition:none!important;scroll-behavior:auto!important}
}

/* Public practice questions (SEO pages): question detail + browse list. */
.q-option{padding:10px 12px;border-radius:10px;border:1px solid var(--border)}
.q-option-correct{background:var(--success-soft);border-color:var(--success);font-weight:600}
.q-hint{background:var(--warning-soft);color:var(--warning-text);border:1px solid var(--warning);border-radius:8px;padding:10px 12px}
.q-expl{background:var(--surface-2);border-radius:10px;padding:12px 14px}
.q-pair{display:flex;justify-content:space-between;gap:12px;padding:10px 12px;border:1px solid var(--border);border-radius:10px}
.q-card-link{display:block;text-decoration:none;color:inherit}

/* ---------- Pass 19 dashboard beautify (Worker L) ----------
   Student dashboard + course-access polish. Visual only: same layout,
   same order, same text. EVERY rule below is scoped so quiz screens
   are untouched:
   - dash chrome/pages live under body.dash-only / .dash-content /
     .dash-shell (quiz start, instruction, question, result and review
     never render the dash shell);
   - .lesson-list / .detail-thumb are used only by pages/course.php
     (course detail) and pages/subject.php — never by a quiz screen
     (pages/quiz.php uses .detail-layout + .sidebar-card, NOT these);
   - .empty is used by empty states only — no exam/*.php file uses it;
   - the generic .btn / .card / table / input rules are NOT changed here.
   All colours are theme variables, so light and dark stay readable.
   (Worker M may append one expiry-badge rule to this file — left alone.) */
body.dash-only .dash-topbar .dash-title{background:linear-gradient(120deg,#FF2E63,#E11D48);-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent;color:transparent;letter-spacing:-.01em}
[data-theme="dark"] body.dash-only .dash-topbar .dash-title{background:linear-gradient(120deg,#FF7A9C,#FF5C8A);-webkit-background-clip:text;background-clip:text}
body.dash-only .dash-sidebar .dash-side-user{background:var(--surface-2);border:1px solid var(--border);border-radius:12px;padding:10px 12px}
body.dash-only .dash-menu a{transition:background-color .15s ease,color .15s ease,box-shadow .15s ease}
body.dash-only .dash-menu a.active{background:var(--grad-brand);background-color:var(--btn-primary-bg);box-shadow:var(--shadow-brand)}
body.dash-only .dash-menu a.active:hover{background:var(--btn-primary-hover)}
body.dash-only .dash-menu a .ic-tile{transition:transform .15s ease}
body.dash-only .dash-menu a:hover .ic-tile{transform:translateY(-1px)}
.dashboard-welcome{position:relative;overflow:hidden;box-shadow:var(--shadow)}
.dashboard-welcome::before{content:"";position:absolute;top:0;left:0;right:0;height:4px;background:var(--grad-brand)}
body.dash-only .dash-stat-grid .stat-card .stat-ic{display:inline-flex;align-items:center;justify-content:center;width:42px;height:42px;border-radius:12px;background:var(--primary-soft);margin-bottom:10px}
body.dash-only .dash-stat-grid .stat-card .stat-ic .ew-ic{display:block}
body.dash-only .dash-stat-grid .stat-card .stat-number,body.dash-only .dash-stat-grid .stat-card .stat-value{background:linear-gradient(120deg,#FF2E63,#E11D48);-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent;color:transparent}
[data-theme="dark"] body.dash-only .dash-stat-grid .stat-card .stat-number,[data-theme="dark"] body.dash-only .dash-stat-grid .stat-card .stat-value{background:linear-gradient(120deg,#FF7A9C,#FF5C8A);-webkit-background-clip:text;background-clip:text}
body.dash-only .dash-course-card{transition:transform .18s ease,box-shadow .18s ease,border-color .18s ease}
body.dash-only .dash-course-card:hover{transform:translateY(-3px);box-shadow:var(--shadow-lg);border-color:var(--primary)}
body.dash-only .dash-course-cover img{transition:transform .35s ease}
body.dash-only .dash-course-card:hover .dash-course-cover img{transform:scale(1.05)}
body.dash-only .dash-chip{transition:background-color .15s ease,box-shadow .15s ease,border-color .15s ease,transform .15s ease}
body.dash-only .dash-chip:hover{transform:translateY(-1px);box-shadow:var(--shadow-lg);border-color:var(--primary)}
body.dash-only .dash-order{border-radius:10px;padding:14px 12px;transition:background-color .15s ease}
body.dash-only .dash-order:hover{background:var(--surface-2)}
/* Continue-learning / course-card progress: the track (.progress-bar)
   wraps the fill (.progress-fill), but .progress-fill had NO rule at
   all and the base .progress-bar rule styles a fill, so the bar was
   invisible. Scoped to .dash-content: the player uses
   .progress > .progress-bar (different structure, outside the dash
   shell) and keeps its own styling. */
body.dash-only .dash-content .progress-bar{height:8px;background:var(--surface-2);border:1px solid var(--border);border-radius:999px;overflow:hidden}
body.dash-only .dash-content .progress-fill{display:block;height:100%;background:linear-gradient(90deg,#FF2E63,#F43F5E,#E11D48);border-radius:999px;transition:width .3s ease}
body.dash-only .avatar-large{box-shadow:0 0 0 4px var(--primary-soft),var(--shadow-brand)}
/* Finished empty states: a card that holds only an empty-state
   paragraph gets the .dash-empty class (added to the card div only —
   no text changed). Mirrors the .empty treatment, as a card. */
body.dash-only .dash-content .card.dash-empty{text-align:center;padding:38px 24px;border:1px dashed var(--border-strong);background:var(--surface-2);box-shadow:none}
body.dash-only .dash-content .card.dash-empty::before{content:"\1F4C2";display:block;font-size:2rem;margin-bottom:8px}
body.dash-only .dash-content .card.dash-empty p{margin:0;color:var(--muted)}
.empty{box-shadow:var(--shadow-sm);background:var(--surface-2)}
/* Course detail (pages/course.php only): lesson rows + thumb. */
.lesson-list li{border-radius:8px;padding:10px 8px;transition:background-color .15s ease}
.lesson-list li:hover{background:var(--surface-2)}
.lesson-list li a{font-weight:600}
.detail-thumb{box-shadow:var(--shadow-lg)}
@media (max-width:360px){
  body.dash-only .dash-topbar{padding:8px 10px}
  body.dash-only .dash-topbar .dash-title{font-size:1rem}
  body.dash-only .dash-stat-grid{gap:10px}
  body.dash-only .dash-content .card.dash-empty{padding:28px 16px}
}

/* ---------- Pass 21 N: course/bundle grids become lists on mobile/tablet ----------
   ≤1023px: every shared course/bundle card grid renders as a vertical list —
   thumbnail on the LEFT, title/details/action on the RIGHT. Desktop keeps
   the grid exactly as today. One implementation: the shared cards
   (course_card_html(), dash_course_card(), the bundle card) + this block;
   no per-page restyle. The :has() scope keeps non-card grids (subjects,
   quizzes, papers, blog…) in their tablet 2-column layout; older browsers
   without :has() keep the grid (graceful). Row language: white, 16px
   radius, soft shadow, #FF2E63 accent, Outfit/DM Sans. Thumbnails keep
   aspect via object-fit:cover (no distortion). */
@media (max-width:1023px){
  .grid:has(> .course-card),.grid:has(> .bundle-card){grid-template-columns:1fr}
  .course-card,.bundle-card{flex-direction:row;align-items:stretch;border-radius:16px;font-family:"DM Sans",system-ui,-apple-system,"Segoe UI",sans-serif}
  .course-card h3,.bundle-card h3{font-family:"Outfit","DM Sans",system-ui,-apple-system,"Segoe UI",sans-serif}
  .course-card:hover,.bundle-card:hover{transform:none;border-color:#FF2E63}
  .course-card h3 a:hover,.bundle-card h3 a:hover{color:#FF2E63}
  .course-card .course-card-thumb{flex:0 0 120px;width:120px;display:flex}
  .course-card .card-thumb{flex:1;min-height:120px;height:auto}
  .course-card .card-body,.bundle-card .card-body{flex:1;min-width:0;padding:14px}
  .bundle-card .bundle-card-thumb{flex:0 0 120px;width:120px;display:flex}
  .bundle-card .bundle-card-thumb img{flex:1;min-width:0;min-height:120px;width:100%;height:100%;object-fit:cover;display:block}
  .bundle-card .card-body{display:flex;flex-direction:column;justify-content:center}
}

/* ---------- Pass 22 B: responsive type + button sizes ----------
   SINGLE SOURCE OF TRUTH for responsive typography (the old
   768px/480px blocks above had their type-size lines removed:
   .hero h1 1.8rem, h1 1.55rem, .btn padding, .hero h1 1.6rem).
   Desktop (≥1024px) keeps today's sizes — no rules here. Tablet
   768–1023px steps down slightly; mobile ≤767px is clearly smaller,
   and buttons stay comfortably tappable (min-height 44px on mobile).
   Sizes ONLY: no colours, spacing systems or layouts changed.
   Every font-size is rem, so the header font-size control
   (html[data-font-size="90/100/110/125"] setting the root %)
   keeps scaling these on top of the responsive scale.
   EXAM FREEZE: bare h1/h2/h3/h4/p/label/input/select/textarea/.btn
   rules are scoped under body:not(:has(.exam-shell,
   .exam-start-main, .result-wrap, .review-shell, .exam-card)).
   Exam screens load style.css via header.php and exam.css uses em
   units, so an unscoped rule would shift exam text; every exam
   screen carries one of those markers, so none of these rules apply
   there. Component rules (.hero, .section-head, .dash-*, .card-*,
   .stat*, .site-header, .main-nav, .drawer-*, ...) carry the same
   body:not(:has(...)) prefix so they beat the bare rules on
   specificity — those classes never appear on exam screens.
   NEVER set body{font-size} in a media query here: the ≤360px
   body{font-size:15px} line in the old responsive block stays
   exactly as is. Mobile values are ≤ the old ones where the old
   ones existed (h1 1.5rem ≤ 1.55rem, hero h1 1.6rem ≤ 1.6rem,
   hero h1 1.45rem kept at ≤360px). */
@media (min-width:768px) and (max-width:1023px){
  body:not(:has(.exam-shell, .exam-start-main, .result-wrap, .review-shell, .exam-card)) h1{font-size:1.75rem}
  body:not(:has(.exam-shell, .exam-start-main, .result-wrap, .review-shell, .exam-card)) h2{font-size:1.35rem}
  body:not(:has(.exam-shell, .exam-start-main, .result-wrap, .review-shell, .exam-card)) h3{font-size:1.1rem}
  body:not(:has(.exam-shell, .exam-start-main, .result-wrap, .review-shell, .exam-card)) h4{font-size:1rem}
  body:not(:has(.exam-shell, .exam-start-main, .result-wrap, .review-shell, .exam-card)) .btn{font-size:.9rem;padding:10px 16px;min-height:44px}
  body:not(:has(.exam-shell, .exam-start-main, .result-wrap, .review-shell, .exam-card)) .btn-sm{font-size:.85rem;padding:8px 14px;min-height:40px}
  body:not(:has(.exam-shell, .exam-start-main, .result-wrap, .review-shell, .exam-card)) label{font-size:.95rem}
  body:not(:has(.exam-shell, .exam-start-main, .result-wrap, .review-shell, .exam-card)) :is(input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=datetime-local], input[type=url], input[type=tel], input[type=search], select, textarea){font-size:.95rem}
  body:not(:has(.exam-shell, .exam-start-main, .result-wrap, .review-shell, .exam-card)) .hero h1{font-size:2rem}
  body:not(:has(.exam-shell, .exam-start-main, .result-wrap, .review-shell, .exam-card)) .hero p{font-size:1rem}
  body:not(:has(.exam-shell, .exam-start-main, .result-wrap, .review-shell, .exam-card)) .hero-eyebrow{font-size:.8rem}
  body:not(:has(.exam-shell, .exam-start-main, .result-wrap, .review-shell, .exam-card)) .card-body h3{font-size:1rem}
  body:not(:has(.exam-shell, .exam-start-main, .result-wrap, .review-shell, .exam-card)) .dash-course-body h3{font-size:1rem}
  body:not(:has(.exam-shell, .exam-start-main, .result-wrap, .review-shell, .exam-card)) .course-card .card-body h3{font-size:1rem}
  body:not(:has(.exam-shell, .exam-start-main, .result-wrap, .review-shell, .exam-card)) .card-body p{font-size:.9rem}
  body:not(:has(.exam-shell, .exam-start-main, .result-wrap, .review-shell, .exam-card)) .card-meta{font-size:.82rem}
  body:not(:has(.exam-shell, .exam-start-main, .result-wrap, .review-shell, .exam-card)) .price{font-size:1.05rem}
  body:not(:has(.exam-shell, .exam-start-main, .result-wrap, .review-shell, .exam-card)) .course-card .price{font-size:1.1rem}
  body:not(:has(.exam-shell, .exam-start-main, .result-wrap, .review-shell, .exam-card)) .course-count-chip{font-size:.78rem}
  body:not(:has(.exam-shell, .exam-start-main, .result-wrap, .review-shell, .exam-card)) .section-head h2{font-size:1.2rem}
  body:not(:has(.exam-shell, .exam-start-main, .result-wrap, .review-shell, .exam-card)) .dashboard-welcome h1{font-size:1.6rem}
  body:not(:has(.exam-shell, .exam-start-main, .result-wrap, .review-shell, .exam-card)) .dash-content h1{font-size:1.6rem}
  body:not(:has(.exam-shell, .exam-start-main, .result-wrap, .review-shell, .exam-card)) .dash-topbar .dash-title{font-size:1rem}
  body:not(:has(.exam-shell, .exam-start-main, .result-wrap, .review-shell, .exam-card)) .stat .num{font-size:1.5rem}
  body:not(:has(.exam-shell, .exam-start-main, .result-wrap, .review-shell, .exam-card)) .stat .label{font-size:.85rem}
  body:not(:has(.exam-shell, .exam-start-main, .result-wrap, .review-shell, .exam-card)) .stat-card .stat-number, body:not(:has(.exam-shell, .exam-start-main, .result-wrap, .review-shell, .exam-card)) .stat-card .stat-value{font-size:1.5rem}
  body:not(:has(.exam-shell, .exam-start-main, .result-wrap, .review-shell, .exam-card)) .stat-card .stat-label{font-size:.85rem}
  body:not(:has(.exam-shell, .exam-start-main, .result-wrap, .review-shell, .exam-card)) .stat-card .stat-sub{font-size:.82rem}
  body:not(:has(.exam-shell, .exam-start-main, .result-wrap, .review-shell, .exam-card)) .logo{font-size:1.15rem}
  body:not(:has(.exam-shell, .exam-start-main, .result-wrap, .review-shell, .exam-card)) .main-nav>a{font-size:.95rem}
  body:not(:has(.exam-shell, .exam-start-main, .result-wrap, .review-shell, .exam-card)) .drawer-login-title{font-size:1rem}
  body:not(:has(.exam-shell, .exam-start-main, .result-wrap, .review-shell, .exam-card)) .drawer-user .nm{font-size:.95rem}
  body:not(:has(.exam-shell, .exam-start-main, .result-wrap, .review-shell, .exam-card)) .drawer-user .em{font-size:.82rem}
  body:not(:has(.exam-shell, .exam-start-main, .result-wrap, .review-shell, .exam-card)) .user-menu-dropdown a{font-size:.95rem}
  body:not(:has(.exam-shell, .exam-start-main, .result-wrap, .review-shell, .exam-card)) .drawer-account a{font-size:.95rem}
  body:not(:has(.exam-shell, .exam-start-main, .result-wrap, .review-shell, .exam-card)) .drawer-account-title{font-size:.78rem}
  body:not(:has(.exam-shell, .exam-start-main, .result-wrap, .review-shell, .exam-card)) .font-size-btn{font-size:.88rem}
  body:not(:has(.exam-shell, .exam-start-main, .result-wrap, .review-shell, .exam-card)) .font-size-dropdown button{font-size:.92rem}
  body:not(:has(.exam-shell, .exam-start-main, .result-wrap, .review-shell, .exam-card)) .plan-card .plan-price{font-size:1.7rem}
  body:not(:has(.exam-shell, .exam-start-main, .result-wrap, .review-shell, .exam-card)) .sidebar-card .price{font-size:1.45rem}
  body:not(:has(.exam-shell, .exam-start-main, .result-wrap, .review-shell, .exam-card)) .course-title{font-size:1rem}
  body:not(:has(.exam-shell, .exam-start-main, .result-wrap, .review-shell, .exam-card)) .qt-node-name{font-size:1rem}
  body:not(:has(.exam-shell, .exam-start-main, .result-wrap, .review-shell, .exam-card)) .qt-topic .qt-node-name{font-size:.95rem}
  body:not(:has(.exam-shell, .exam-start-main, .result-wrap, .review-shell, .exam-card)) .qt-quiz h3{font-size:.95rem}
  body:not(:has(.exam-shell, .exam-start-main, .result-wrap, .review-shell, .exam-card)) .qt-quiz p{font-size:.9rem}
  body:not(:has(.exam-shell, .exam-start-main, .result-wrap, .review-shell, .exam-card)) .cert-heading{font-size:1.45rem}
  body:not(:has(.exam-shell, .exam-start-main, .result-wrap, .review-shell, .exam-card)) .empty{font-size:.95rem}
  body:not(:has(.exam-shell, .exam-start-main, .result-wrap, .review-shell, .exam-card)) .site-bottomnav a{font-size:.7rem}
  body:not(:has(.exam-shell, .exam-start-main, .result-wrap, .review-shell, .exam-card)) .footer-bottom{font-size:.85rem}
}
@media (max-width:767px){
  body:not(:has(.exam-shell, .exam-start-main, .result-wrap, .review-shell, .exam-card)) h1{font-size:1.5rem}
  body:not(:has(.exam-shell, .exam-start-main, .result-wrap, .review-shell, .exam-card)) h2{font-size:1.25rem}
  body:not(:has(.exam-shell, .exam-start-main, .result-wrap, .review-shell, .exam-card)) h3{font-size:1.05rem}
  body:not(:has(.exam-shell, .exam-start-main, .result-wrap, .review-shell, .exam-card)) h4{font-size:.98rem}
  body:not(:has(.exam-shell, .exam-start-main, .result-wrap, .review-shell, .exam-card)) p{font-size:.95rem}
  body:not(:has(.exam-shell, .exam-start-main, .result-wrap, .review-shell, .exam-card)) .btn{font-size:.9rem;padding:10px 14px;min-height:44px}
  body:not(:has(.exam-shell, .exam-start-main, .result-wrap, .review-shell, .exam-card)) .btn-sm{font-size:.82rem;padding:8px 12px;min-height:44px}
  body:not(:has(.exam-shell, .exam-start-main, .result-wrap, .review-shell, .exam-card)) label{font-size:.95rem}
  body:not(:has(.exam-shell, .exam-start-main, .result-wrap, .review-shell, .exam-card)) :is(input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=datetime-local], input[type=url], input[type=tel], input[type=search], select, textarea){font-size:.95rem}
  body:not(:has(.exam-shell, .exam-start-main, .result-wrap, .review-shell, .exam-card)) .form-error{font-size:.85rem}
  body:not(:has(.exam-shell, .exam-start-main, .result-wrap, .review-shell, .exam-card)) .hint{font-size:.82rem}
  body:not(:has(.exam-shell, .exam-start-main, .result-wrap, .review-shell, .exam-card)) .hero h1{font-size:1.6rem}
  body:not(:has(.exam-shell, .exam-start-main, .result-wrap, .review-shell, .exam-card)) .hero p{font-size:.98rem}
  body:not(:has(.exam-shell, .exam-start-main, .result-wrap, .review-shell, .exam-card)) .hero-eyebrow{font-size:.78rem}
  body:not(:has(.exam-shell, .exam-start-main, .result-wrap, .review-shell, .exam-card)) .card-body h3{font-size:.98rem}
  body:not(:has(.exam-shell, .exam-start-main, .result-wrap, .review-shell, .exam-card)) .dash-course-body h3{font-size:.98rem}
  body:not(:has(.exam-shell, .exam-start-main, .result-wrap, .review-shell, .exam-card)) .course-card .card-body h3{font-size:.98rem}
  body:not(:has(.exam-shell, .exam-start-main, .result-wrap, .review-shell, .exam-card)) .card-body p{font-size:.88rem}
  body:not(:has(.exam-shell, .exam-start-main, .result-wrap, .review-shell, .exam-card)) .card-meta{font-size:.8rem}
  body:not(:has(.exam-shell, .exam-start-main, .result-wrap, .review-shell, .exam-card)) .course-card .card-meta{font-size:.8rem}
  body:not(:has(.exam-shell, .exam-start-main, .result-wrap, .review-shell, .exam-card)) .price{font-size:1.05rem}
  body:not(:has(.exam-shell, .exam-start-main, .result-wrap, .review-shell, .exam-card)) .course-card .price{font-size:1.1rem}
  body:not(:has(.exam-shell, .exam-start-main, .result-wrap, .review-shell, .exam-card)) .course-count-chip{font-size:.75rem}
  body:not(:has(.exam-shell, .exam-start-main, .result-wrap, .review-shell, .exam-card)) .course-cat-chip{font-size:.75rem}
  body:not(:has(.exam-shell, .exam-start-main, .result-wrap, .review-shell, .exam-card)) .section-head h2{font-size:1.15rem}
  body:not(:has(.exam-shell, .exam-start-main, .result-wrap, .review-shell, .exam-card)) .dashboard-welcome h1{font-size:1.4rem}
  body:not(:has(.exam-shell, .exam-start-main, .result-wrap, .review-shell, .exam-card)) .dash-content h1{font-size:1.4rem}
  body:not(:has(.exam-shell, .exam-start-main, .result-wrap, .review-shell, .exam-card)) .dash-topbar .dash-title{font-size:.95rem}
  body:not(:has(.exam-shell, .exam-start-main, .result-wrap, .review-shell, .exam-card)) .stat .num{font-size:1.3rem}
  body:not(:has(.exam-shell, .exam-start-main, .result-wrap, .review-shell, .exam-card)) .stat .label{font-size:.8rem}
  body:not(:has(.exam-shell, .exam-start-main, .result-wrap, .review-shell, .exam-card)) .stat-card .stat-number, body:not(:has(.exam-shell, .exam-start-main, .result-wrap, .review-shell, .exam-card)) .stat-card .stat-value{font-size:1.3rem}
  body:not(:has(.exam-shell, .exam-start-main, .result-wrap, .review-shell, .exam-card)) .stat-card .stat-label{font-size:.8rem}
  body:not(:has(.exam-shell, .exam-start-main, .result-wrap, .review-shell, .exam-card)) .stat-card .stat-sub{font-size:.8rem}
  body:not(:has(.exam-shell, .exam-start-main, .result-wrap, .review-shell, .exam-card)) .logo{font-size:1.1rem}
  body:not(:has(.exam-shell, .exam-start-main, .result-wrap, .review-shell, .exam-card)) .main-nav>a{font-size:.95rem}
  body:not(:has(.exam-shell, .exam-start-main, .result-wrap, .review-shell, .exam-card)) .drawer-login-title{font-size:.98rem}
  body:not(:has(.exam-shell, .exam-start-main, .result-wrap, .review-shell, .exam-card)) .drawer-user .nm{font-size:.92rem}
  body:not(:has(.exam-shell, .exam-start-main, .result-wrap, .review-shell, .exam-card)) .drawer-user .em{font-size:.82rem}
  body:not(:has(.exam-shell, .exam-start-main, .result-wrap, .review-shell, .exam-card)) .user-menu-dropdown a{font-size:.92rem}
  body:not(:has(.exam-shell, .exam-start-main, .result-wrap, .review-shell, .exam-card)) .drawer-account a{font-size:.92rem}
  body:not(:has(.exam-shell, .exam-start-main, .result-wrap, .review-shell, .exam-card)) .drawer-account-title{font-size:.78rem}
  body:not(:has(.exam-shell, .exam-start-main, .result-wrap, .review-shell, .exam-card)) .font-size-btn{font-size:.85rem}
  body:not(:has(.exam-shell, .exam-start-main, .result-wrap, .review-shell, .exam-card)) .font-size-dropdown button{font-size:.9rem}
  body:not(:has(.exam-shell, .exam-start-main, .result-wrap, .review-shell, .exam-card)) .plan-card .plan-price{font-size:1.6rem}
  body:not(:has(.exam-shell, .exam-start-main, .result-wrap, .review-shell, .exam-card)) .sidebar-card .price{font-size:1.4rem}
  body:not(:has(.exam-shell, .exam-start-main, .result-wrap, .review-shell, .exam-card)) .course-title{font-size:.98rem}
  body:not(:has(.exam-shell, .exam-start-main, .result-wrap, .review-shell, .exam-card)) .qt-node-name{font-size:.98rem}
  body:not(:has(.exam-shell, .exam-start-main, .result-wrap, .review-shell, .exam-card)) .qt-topic .qt-node-name{font-size:.92rem}
  body:not(:has(.exam-shell, .exam-start-main, .result-wrap, .review-shell, .exam-card)) .qt-quiz h3{font-size:.95rem}
  body:not(:has(.exam-shell, .exam-start-main, .result-wrap, .review-shell, .exam-card)) .qt-quiz p{font-size:.88rem}
  body:not(:has(.exam-shell, .exam-start-main, .result-wrap, .review-shell, .exam-card)) .cert-heading{font-size:1.35rem}
  body:not(:has(.exam-shell, .exam-start-main, .result-wrap, .review-shell, .exam-card)) .empty{font-size:.92rem}
  body:not(:has(.exam-shell, .exam-start-main, .result-wrap, .review-shell, .exam-card)) .site-bottomnav a{font-size:.7rem}
  body:not(:has(.exam-shell, .exam-start-main, .result-wrap, .review-shell, .exam-card)) .footer-bottom{font-size:.82rem}
  body:not(:has(.exam-shell, .exam-start-main, .result-wrap, .review-shell, .exam-card)) .pagination a, body:not(:has(.exam-shell, .exam-start-main, .result-wrap, .review-shell, .exam-card)) .pagination span{font-size:.9rem}
}
/* ≤360px: keep the old hero size (1.45rem) — the ≤767px 1.6rem above
   would otherwise override the old ≤360px rule, which sits earlier
   in this file. */
@media (max-width:360px){
  body:not(:has(.exam-shell, .exam-start-main, .result-wrap, .review-shell, .exam-card)) .hero h1{font-size:1.45rem}
}

/* ---------- Pass 28: multiple homepage layouts ----------
   pages/home.php wraps the homepage in .home-layout.home-layout-<name>
   (default | hero | exam | compact). Section HTML is identical in every
   layout — only order (PHP) and presentation (here) vary. All colours
   are theme variables; no per-layout colour/font settings. */
.home-layout{min-width:0}

/* Hero layout: bigger hero, search bar overlapping its bottom edge,
   courses given prominence below it. */
.home-layout-hero .hero{padding:76px 32px 88px}
.home-layout-hero .hero h1{font-size:3rem}
.home-layout-hero .hero p{font-size:1.15rem}
.home-hero-search{display:flex;max-width:640px;margin:0 auto 28px;position:relative;z-index:2}
.home-hero-search--over-hero{margin-top:-40px}
.home-hero-search input[type=search]{flex:1;min-width:0;border:1px solid var(--border-strong);border-right:0;border-radius:12px 0 0 12px;padding:13px 16px;font-size:1rem;background:var(--surface);color:var(--text);box-shadow:var(--shadow)}
.home-hero-search button{border:1px solid var(--border-strong);border-left:0;border-radius:0 12px 12px 0;padding:13px 18px;background:var(--primary-soft);color:var(--primary);cursor:pointer;display:flex;align-items:center;justify-content:center;box-shadow:var(--shadow)}
.home-hero-search button:hover{background:var(--primary);color:#fff}
.home-hero-search input[type=search]:focus{box-shadow:0 0 0 4px var(--primary-soft)}
.home-layout-hero .home-hero-courses .section-head h2{font-size:1.6rem}
.home-layout-hero .home-hero-courses{margin-bottom:8px}

/* Exam layout: the practice strip (PHP wraps the Practice section in
   .home-exam-practice) reads as one prominent panel; stats get larger
   numbers. The reordering itself is done in PHP, not here. */
.home-layout-exam .home-exam-practice{background:var(--surface-2);border:1px solid var(--border);border-radius:var(--radius);padding:18px 18px 6px;margin-bottom:8px}
.home-layout-exam .home-exam-practice .section-head{margin-top:0}
.home-layout-exam .stat .num{font-size:2.1rem}

/* Compact layout: denser cards, tighter spacing. 2-column grids on
   desktop only (min-width:1024px) so the ≤1023px pass-21 course-list
   layout and the ≤768px/≤480px stacking rules below still win on
   smaller screens. */
.home-layout-compact .card{padding:14px;margin-bottom:12px}
.home-layout-compact .grid{gap:12px}
.home-layout-compact .card-thumb{height:110px}
.home-layout-compact .course-card .card-thumb{height:120px}
.home-layout-compact .card-body{padding:12px;gap:6px}
.home-layout-compact .card-body h3{font-size:.98rem}
.home-layout-compact .card-body p{font-size:.86rem}
.home-layout-compact .hero{padding:28px 20px;margin-bottom:18px}
.home-layout-compact .hero h1{font-size:1.8rem}
.home-layout-compact .hero p{font-size:.95rem;margin-bottom:14px}
.home-layout-compact .section-head{margin:18px 0 10px}
.home-layout-compact .section-head h2{font-size:1.2rem}
.home-layout-compact .stats-row{gap:10px;margin-bottom:16px}
.home-layout-compact .stat{padding:12px 10px}
.home-layout-compact .stat .num{font-size:1.4rem}
.home-layout-compact .announcement{padding:10px 12px;margin-bottom:8px}
.home-layout-compact .empty{padding:24px 16px}
@media (min-width:1024px){
  .home-layout-compact .grid-3,.home-layout-compact .grid-4{grid-template-columns:repeat(2,1fr)}
}

/* ---------- Pass 28: 360px rules for ALL homepage layouts ----------
   No horizontal overflow, hero text scales down, grids stack to
   1 column (stats stay 2), search input full width. These sit after
   the older ≤360px rules so they win where they overlap. */
@media (max-width:360px){
  .home-layout{min-width:0;overflow-x:clip}
  .home-layout-hero .hero,.home-layout-exam .hero,.home-layout-compact .hero,.home-layout-default .hero{padding:26px 12px 44px}
  .home-layout-hero .hero h1,.home-layout-exam .hero h1,.home-layout-compact .hero h1,.home-layout-default .hero h1{font-size:1.5rem}
  .home-layout-hero .hero p,.home-layout-exam .hero p,.home-layout-compact .hero p,.home-layout-default .hero p{font-size:.95rem}
  .home-layout-hero .hero .btn,.home-layout-exam .hero .btn,.home-layout-compact .hero .btn,.home-layout-default .hero .btn{padding:9px 14px;font-size:.9rem}
  .home-hero-search{max-width:100%;width:100%;margin-left:0;margin-right:0}
  .home-hero-search--over-hero{margin-top:-30px}
  .home-hero-search input[type=search]{padding:11px 12px;font-size:.95rem}
  .home-hero-search button{padding:11px 14px}
  .home-layout-hero .grid,.home-layout-exam .grid,.home-layout-compact .grid,.home-layout-default .grid{grid-template-columns:1fr}
  .home-layout-hero .stats-row,.home-layout-exam .stats-row,.home-layout-compact .stats-row,.home-layout-default .stats-row{grid-template-columns:repeat(2,1fr);gap:10px}
  .home-layout-hero .home-hero-courses .section-head h2{font-size:1.35rem}
  .home-layout-exam .home-exam-practice{padding:12px 12px 2px}
  .home-layout-exam .stat .num{font-size:1.6rem}
  .home-layout-compact .card-thumb,.home-layout-compact .course-card .card-thumb{height:120px}
}

/* ==========================================================================
   Pass 35 — ExamPortal theme mirror: public 3-column layout, theme
   banner, carousels, exams tabs, bundles, CTA. All colours are theme
   variables, so light and dark stay readable. The exam screen is
   untouched (assets/css/exam.css owns it).
   ========================================================================== */

/* ---------- Public 3-column layout (desktop) ---------- */
.public-layout{max-width:1360px}
.public-cols{display:grid;grid-template-columns:236px minmax(0,1fr) 300px;gap:20px;align-items:start}
.public-content{min-width:0}
.public-left{position:sticky;top:calc(var(--header-h) + 12px);background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow);padding:14px;max-height:calc(100vh - var(--header-h) - 24px);overflow-y:auto}
.public-left-nav{display:flex;flex-direction:column;gap:4px}
.public-left a.drawer-link{display:flex;align-items:center;gap:12px;color:var(--text);font-weight:600;padding:10px 12px;border-radius:12px;font-size:1rem;text-decoration:none;min-height:52px}
.public-left a.drawer-link:hover{background:var(--primary-soft);color:var(--primary);text-decoration:none}
.public-left a.drawer-link.active{background:var(--grad-brand);color:#fff;box-shadow:var(--shadow-brand)}
.public-left a.drawer-link.active:hover{background:var(--grad-brand);color:#fff}
.public-left .drawer-account{border-top:1px solid var(--border);padding-top:12px;margin-top:12px}
/* The sidebar column (236px) is narrower than the drawer (360px), so
   long labels wrap to two lines here instead of truncating — the
   drawer keeps its single-line ellipsis. */
.public-left .drawer-link-label{white-space:normal;line-height:1.3}
.public-left .public-subject-name{white-space:normal;line-height:1.3}
.public-left-subjects{border-top:0;padding-top:0;margin-top:0}
.public-left-subjects .drawer-account-title{margin:0 0 6px;padding:0 12px}
.public-subject-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:2px}
.public-subject-list a{display:flex;align-items:center;gap:8px;padding:8px 12px;border-radius:10px;color:var(--text);font-weight:600;font-size:.95rem}
.public-subject-list a:hover{background:var(--primary-soft);color:var(--primary);text-decoration:none}
.public-subject-list a.active{background:var(--primary-soft);color:var(--primary)}
.public-subject-name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.public-subject-count{flex:none;background:var(--surface-2);border:1px solid var(--border);border-radius:999px;padding:1px 8px;font-size:.78rem;font-weight:800;color:var(--muted)}
.public-subject-all{margin:8px 0 0;padding:0 12px;font-size:.9rem}
.public-right{position:sticky;top:calc(var(--header-h) + 12px);display:flex;flex-direction:column;gap:18px;min-width:0}
.public-right .widget{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow);padding:18px}
.public-right .widget-title{font-family:var(--font-heading);font-size:1.02rem;font-weight:800;margin:0 0 12px}
.public-right .widget-links{margin:10px 0 0;text-align:center;font-size:.9rem}
.widget-link-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:2px}
.widget-link-list li{border-bottom:1px solid var(--border);padding:7px 0}
.widget-link-list li:last-child{border-bottom:0}
.widget-link-list a{color:var(--text);font-weight:600}
.widget-link-list a:hover{color:var(--primary)}
.widget-quiz-meta{display:block;font-size:.82rem;color:var(--muted);margin-top:2px}
.widget-post-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:12px}
.widget-post{display:flex;gap:10px;align-items:flex-start;color:var(--text)}
.widget-post:hover{text-decoration:none}
.widget-post:hover .widget-post-title{color:var(--primary)}
.widget-post-thumb{flex:none;width:64px;height:48px;border-radius:8px;overflow:hidden;background:var(--grad-brand)}
.widget-post-thumb img{width:100%;height:100%;object-fit:cover}
.widget-post-body{display:flex;flex-direction:column;gap:2px;min-width:0}
.widget-post-title{font-weight:700;font-size:.92rem;line-height:1.3;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.widget-post-meta{font-size:.82rem;color:var(--muted)}
/* Course detail inside the narrower content column: stack the
   buy box below the content instead of squeezing it beside it. */
.public-layout .detail-layout{grid-template-columns:1fr}
.public-layout .sidebar-card{position:static}

/* ---------- Theme banner (Default homepage layout only) ---------- */
.theme-banner{position:relative;overflow:hidden;border-radius:var(--radius-lg);padding:52px 32px 44px;margin-bottom:28px;text-align:center;color:#fff;box-shadow:var(--shadow-lg);background:linear-gradient(120deg,#FF2E63 0%,#E11D48 60%,#9D174D 100%)}
.theme-banner.has-image{background-size:cover;background-position:center}
.theme-banner::before{content:"";position:absolute;inset:0;background-image:radial-gradient(rgba(255,255,255,.16) 1px,transparent 1px);background-size:22px 22px;opacity:.55;pointer-events:none}
.theme-banner.has-image::before{background:linear-gradient(180deg,rgba(11,11,15,.55),rgba(11,11,15,.72));background-size:auto;opacity:1}
.theme-banner>*{position:relative;z-index:1}
.theme-banner-eyebrow{display:inline-block;background:rgba(255,255,255,.16);border:1px solid rgba(255,255,255,.35);color:#fff;border-radius:999px;padding:5px 14px;font-size:.82rem;font-weight:700;letter-spacing:.04em;text-transform:uppercase;margin-bottom:14px}
.theme-banner h1{font-size:2.4rem;margin:0 0 10px;color:#fff;letter-spacing:-.03em}
.theme-banner p.theme-banner-sub{opacity:.94;max-width:640px;margin:0 auto 22px;color:#FFE4EC;font-size:1.06rem}
.theme-banner-search{display:flex;max-width:560px;margin:0 auto 18px;background:#fff;border-radius:999px;padding:5px;box-shadow:0 10px 26px rgba(0,0,0,.28)}
.theme-banner-search input{flex:1;border:0;border-radius:999px;padding:10px 16px;font-size:.98rem;min-width:0;background:transparent;color:#0B0B0F}
.theme-banner-search input:focus{box-shadow:none}
.theme-banner-search button{border:0;background:var(--grad-brand);background-color:#FF2E63;color:#fff;border-radius:999px;padding:10px 20px;font-weight:700;font-size:.95rem;cursor:pointer;font-family:inherit}
.theme-banner-search button:hover{filter:brightness(.94)}
.theme-banner-ctas{display:flex;gap:10px;justify-content:center;flex-wrap:wrap}
.theme-banner-ctas .btn-primary{background:#fff;color:#BE1E4E;box-shadow:0 10px 26px rgba(0,0,0,.28)}
.theme-banner-ctas .btn-primary:hover{background:#FFF0F4}
.theme-banner-ctas .btn-outline{border-color:rgba(255,255,255,.85);color:#fff;background:rgba(255,255,255,.08)}
.theme-banner-ctas .btn-outline:hover{background:rgba(255,255,255,.18);box-shadow:none}
.theme-banner-stats{display:flex;gap:22px;justify-content:center;flex-wrap:wrap;margin:22px 0 0;font-size:.92rem}
.theme-banner-stats strong{font-size:1.15rem}
.theme-banner-stats span{opacity:.92}

/* ---------- Carousels (subjects / latest courses / latest quizzes) ---------- */
.ep-carousel-wrap{margin-bottom:8px}
.ep-carousel-head{display:flex;align-items:baseline;justify-content:space-between;gap:12px;margin:30px 0 16px}
.ep-carousel-head h2{margin:0;font-size:1.35rem}
.ep-carousel-head .ep-carousel-tools{display:flex;align-items:center;gap:10px;flex:none}
.ep-carousel-nav{display:flex;gap:8px}
.ep-car-btn{width:38px;height:38px;border-radius:50%;border:1px solid var(--border);background:var(--surface);color:var(--text);font-size:1.25rem;line-height:1;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;box-shadow:var(--shadow-sm)}
.ep-car-btn:hover{border-color:var(--primary);color:var(--primary)}
.ep-car-btn:disabled{opacity:.4;cursor:default}
.ep-carousel{display:flex;gap:16px;overflow-x:auto;scroll-snap-type:x mandatory;padding:4px 2px 14px;-webkit-overflow-scrolling:touch;scrollbar-width:thin}
.ep-carousel>*{flex:0 0 272px;scroll-snap-align:start;min-width:0}
.ep-carousel .subject-card{flex-basis:212px}
.ep-carousel .course-card,.ep-carousel .quiz-card{margin-bottom:0}
.ep-carousel .subject-card .card-thumb{height:120px}
.ep-carousel .subject-card .card-body{padding:14px}
.ep-carousel .subject-card h3{font-size:1rem}
/* Quiz card inside a carousel keeps the grid card look. */
.ep-carousel .quiz-card .card-body h3{font-size:1.02rem;line-height:1.32;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
/* Pass 21 N turns course/bundle cards into horizontal list rows at
   ≤1023px — right for grids, wrong inside a horizontal carousel
   (a 120px thumb stretched to the full card height, ~128px of body).
   Carousel cards keep the vertical card layout at every width. */
.ep-carousel .course-card{flex-direction:column}
.ep-carousel .course-card .course-card-thumb{flex:none;width:auto;display:block}
.ep-carousel .course-card .card-thumb{flex:none;height:150px;min-height:0}
.ep-carousel .bundle-card{flex-direction:column}
.ep-carousel .bundle-card .bundle-card-thumb{flex:none;width:auto;display:block}
.ep-carousel .bundle-card .bundle-card-thumb img{min-height:0}

/* ---------- Exams tab (homepage) ---------- */
.ep-tabs{display:flex;gap:8px;flex-wrap:wrap;margin:0 0 18px}
.ep-tab{border:1px solid var(--border);background:var(--surface);color:var(--text);border-radius:999px;padding:9px 16px;font-weight:700;font-size:.92rem;cursor:pointer;font-family:inherit}
.ep-tab:hover{border-color:var(--primary);color:var(--primary)}
.ep-tab.active{background:var(--grad-brand);background-color:var(--btn-primary-bg);color:#fff;border-color:transparent;box-shadow:var(--shadow-brand)}
.ep-tab-count{display:inline-block;background:rgba(0,0,0,.08);border-radius:999px;padding:1px 8px;font-size:.8rem;margin-left:4px}
.ep-tab.active .ep-tab-count{background:rgba(255,255,255,.25)}
.ep-tab-panel{display:none}
.ep-tab-panel.active{display:block}
.ep-tab-panel .grid{margin-bottom:0}

/* ---------- Course bundles (homepage) ---------- */
.bundle-card .card-thumb{height:150px}
.bundle-card-thumb{display:block;flex:none}
.bundle-card-thumb img{width:100%;height:100%;object-fit:cover}
.bundle-card .card-body h3{font-size:1.08rem;line-height:1.32}
.bundle-includes{font-size:.85rem;color:var(--muted)}

/* ---------- Continue learning + CTA (homepage extras) ---------- */
.ep-continue-list{display:flex;flex-direction:column;gap:0;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow);padding:6px 18px;margin-bottom:20px}
.ep-continue-list .continue-item:last-child{border-bottom:0}
.ep-cta{position:relative;overflow:hidden;background:linear-gradient(120deg,#FF2E63 0%,#E11D48 60%,#9D174D 100%);color:#fff;border-radius:var(--radius-lg);padding:40px 28px;margin:8px 0 28px;text-align:center;box-shadow:var(--shadow-lg)}
.ep-cta h2{color:#fff;margin:0 0 8px}
.ep-cta p{opacity:.94;max-width:560px;margin:0 auto 20px;color:#FFE4EC}
.ep-cta .btn-primary{background:#fff;color:#BE1E4E;box-shadow:0 10px 26px rgba(0,0,0,.28)}
.ep-cta .btn-primary:hover{background:#FFF0F4}
.ep-cta .btn-outline{border-color:rgba(255,255,255,.85);color:#fff;background:rgba(255,255,255,.08)}
.ep-cta .btn-outline:hover{background:rgba(255,255,255,.18);box-shadow:none}

/* ---------- Public layout responsive ---------- */
@media (max-width:1180px){
  .public-cols{grid-template-columns:220px minmax(0,1fr) 272px}
}
@media (max-width:1023px){
  /* Mobile/tablet: the drawer is the ONLY menu (left sidebar hidden);
     the right sidebar stacks BELOW the content, never hidden. */
  .public-cols{display:block}
  .public-left{display:none}
  .public-content{margin-bottom:24px}
  .public-right{position:static}
  .ep-carousel-nav{display:none}
  .theme-banner{padding:36px 18px}
  .theme-banner h1{font-size:1.8rem}
}
@media (max-width:480px){
  .theme-banner{padding:28px 14px}
  .theme-banner h1{font-size:1.6rem}
  .ep-carousel>*{flex-basis:248px}
  .ep-carousel .subject-card{flex-basis:188px}
  .ep-tab{padding:8px 12px;font-size:.88rem}
}

/* ---------- Pass 41 — mobile homepage keeps the theme layout ----------
   ≤1023px ONLY; desktop (≥1024px) is untouched. The "stacked view"
   complaint was two separate stretch behaviours:
   (a) a flex row stretches its children to the tallest by default, so
       every carousel card in a row measured exactly the same height;
       align-items:flex-start + a non-growing card body lets each card
       size to its own content (dynamic heights, no clipped titles,
       thumbs keep their fixed heights);
   (b) the right sidebar's widgets stacked as full-width blocks below
       the content — Popular Courses / Recent Quizzes become horizontal
       scrolling strips (same vertical-card shape as the carousel
       cards), Quick Links become wrapping chips, and the search /
       login widgets stay compact. The sidebar still sits below the
       content; it just no longer reads as one long stacked column.
   Homepage section grids (bundles, exams tabs) also stop stretching
   their cards to the tallest in the row (align-items:start). */
@media (max-width:1023px){
  /* 1. Carousels: dynamic heights, never vertically stacked. */
  .ep-carousel{align-items:flex-start}
  .ep-carousel>*{align-self:flex-start;height:auto}
  .ep-carousel .card-body{flex:none}
  /* 3. Sections: compact spacing, content-sized cards. */
  .theme-banner{margin-bottom:20px}
  .ep-carousel-head{margin:22px 0 12px}
  .ep-carousel-wrap{margin-bottom:4px}
  .public-content .grid{align-items:start}
  /* 2. Right sidebar: compact widgets, horizontal strips. */
  .public-right{gap:14px}
  .public-right .widget{padding:16px}
  .widget-quicklinks .widget-link-list{flex-direction:row;flex-wrap:wrap;gap:8px}
  .widget-quicklinks .widget-link-list li{border-bottom:0;padding:0}
  .widget-quicklinks .widget-link-list a{display:inline-block;padding:7px 14px;border:1px solid var(--border);border-radius:999px;background:var(--surface-2);font-size:.88rem;white-space:nowrap}
  .widget-popular .widget-post-list{display:flex;flex-direction:row;gap:12px;overflow-x:auto;scroll-snap-type:x mandatory;padding:4px 2px 10px;-webkit-overflow-scrolling:touch;align-items:flex-start}
  .widget-popular .widget-post-list li{flex:0 0 232px;scroll-snap-align:start;align-self:flex-start}
  .widget-popular .widget-post{flex-direction:column;align-items:stretch;border:1px solid var(--border);border-radius:12px;overflow:hidden;background:var(--surface-2);height:auto}
  .widget-popular .widget-post-thumb{width:100%;height:110px;flex:none;border-radius:0}
  .widget-popular .widget-post-body{padding:10px 12px 12px}
  .widget-recent .widget-link-list{display:flex;flex-direction:row;gap:12px;overflow-x:auto;scroll-snap-type:x mandatory;padding:4px 2px 10px;-webkit-overflow-scrolling:touch;align-items:flex-start}
  .widget-recent .widget-link-list li{flex:0 0 232px;scroll-snap-align:start;align-self:flex-start;border:1px solid var(--border);border-radius:12px;padding:12px 14px;background:var(--surface-2)}
  .widget-recent .widget-link-list li a{display:block;font-weight:700;line-height:1.3}
  .widget-recent .widget-quiz-meta{margin-top:6px}
}
/* ---------- Pass 44 — side panels (show/hide on icon tap), not static sidebars ----------
   At >=1024px (desktop + tablet landscape) the public layout is a
   single full-width column: .public-cols is a plain block, so the
   content spans the whole container with both panels closed. The two
   asides become fixed overlays sliding in from their edge — the left
   panel (subjects only) from the left, the right panel (search, quick
   links, Popular Courses, Recent Quizzes) from the right — OVER the
   content, never pushing it aside and never reserving a column. They
   sit below the fixed header (top:var(--header-h)) so the header
   toggles stay clickable, and stop above the fixed bottom nav
   (bottom:64px). A dimmed backdrop (#panelBackdrop, in header.php)
   covers the page behind an open panel; tapping it closes the panel.
   The header toggles (.panel-toggle) are hidden by default and shown
   only at >=1024px on pages that actually have panels
   (body.has-side-panels, set by assets/js/app.js) — so they never
   appear at <=1023px (drawer country) or on non-layout pages.
   At <=1023px NOTHING below changes anything: the left panel stays
   display:none and the right panel stacks below the content (pass 41
   strips), exactly as before — the panel heads stay hidden there too. */
.panel-toggle{display:none}
.panel-backdrop{display:none}
.public-panel-head{display:none}
@media (min-width:1024px){
  /* Full-width content: no static sidebar columns. */
  .public-cols{display:block}
  /* Header toggles: the same 44px circular buttons as the hamburger / Aa. */
  body.has-side-panels .panel-toggle{display:inline-flex;align-items:center;justify-content:center;width:44px;height:44px;min-width:44px;min-height:44px;padding:0;background:#fff;border:1px solid #E6E6E6;border-radius:50%;cursor:pointer;color:#0B0B0F;flex:none}
  body.has-side-panels .panel-toggle:hover{border-color:#FF2E63;box-shadow:var(--shadow-sm)}
  body.has-side-panels .panel-toggle[aria-expanded="true"]{background:var(--primary-soft);border-color:var(--primary);color:var(--primary)}
  body.has-side-panels .panel-toggle svg{display:block}
  .panel-toggle-left{order:1}
  /* The panels: fixed overlays, off-canvas until .open. */
  .public-panel{position:fixed;top:var(--header-h,64px);bottom:64px;width:320px;max-width:88vw;z-index:9990;margin:0;border-radius:0;background:var(--surface);overflow-y:auto;transition:transform .3s ease,visibility .3s ease;visibility:hidden}
  .public-left-panel{left:0;right:auto;transform:translateX(-105%);border-right:1px solid var(--border);box-shadow:8px 0 24px rgba(15,23,42,.18)}
  .public-right-panel{left:auto;right:0;transform:translateX(105%);border-left:1px solid var(--border);box-shadow:-8px 0 24px rgba(15,23,42,.18);padding:16px}
  .public-panel.open{transform:translateX(0);visibility:visible}
  /* Panel head: title + close button (hidden at <=1023px by the base rule above). */
  .public-panel-head{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:2px 4px 12px;border-bottom:1px solid var(--border);margin-bottom:12px}
  .public-panel-title{font-family:var(--font-heading);font-size:1.05rem;font-weight:800}
  .public-panel-close{display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;border:1px solid var(--border);border-radius:50%;background:var(--surface-2);color:var(--muted);font-size:1.25rem;line-height:1;cursor:pointer;flex:none}
  .public-panel-close:hover{color:var(--primary);border-color:var(--primary)}
  /* Subjects are the panel's only section: no top divider. */
  .public-left-panel .public-left-subjects{border-top:0;padding-top:0;margin-top:0}
  /* Backdrop: below the header, above the page. */
  .panel-backdrop{display:block;position:fixed;top:var(--header-h,64px);left:0;right:0;bottom:0;background:rgba(11,11,15,.45);z-index:9989;opacity:0;visibility:hidden;transition:opacity .3s ease,visibility .3s ease}
  .panel-backdrop.open{opacity:1;visibility:visible}
}
[data-theme="dark"] body.has-side-panels .panel-toggle{background:#000;border-color:#333;color:#fff}
/* ---------- Pass 43 fix — header nav fit at 1024–1279px ----------
   Verifier-measured on the current tree: pass 44's two 44px panel
   toggles squeezed the nav to 561px while the 9 links needed 640px,
   clipping ExamBook/Blog at 1024px (and Blog's last 2px at 1280px —
   fixed by the 8px 10px base padding above). This block MUST sit after
   the pass-44 rules, which set the toggles to 44px at >=1024px: at
   1024–1279px only, both panel toggles become 36px circles (the 20px
   glyph still fits; hamburger / Aa / user button stay 44px), gaining
   16px for the nav. Pass 44 panel behaviour is untouched, and the
   horizontal scroll stays only as a fallback for extra-long custom
   links — the 9 seed items fit visibly without it. */
@media (min-width:1024px) and (max-width:1279px){
  body.has-side-panels .panel-toggle{width:36px;height:36px;min-width:36px;min-height:36px}
}
/* Tablet arrows fit: show the carousel arrows at 768–1023px. The
   pass-35 .ep-carousel-nav{display:none} inside the ≤1023px block
   above still hides them on phones (≤767px), where swipe is the way. */
@media (min-width:768px) and (max-width:1023px){
  .ep-carousel-nav{display:flex}
}
@media (max-width:480px){
  .widget-popular .widget-post-list li,.widget-recent .widget-link-list li{flex-basis:200px}
}

/* ---------- Pass 39 — app shell (fixed header, shell navigation) + Aa dropdown ----------
   No restyle: only positioning for the fixed header and the new
   controls. The site header was position:sticky; it is now fixed so it
   stays put while <main> swaps underneath it (the drawer, bottom nav
   and dash chrome are already fixed/sticky and untouched). Body
   padding compensates only when the site header is actually rendered
   (body:has(> header.site-header)) — dash-only / exam / player pages
   have no site header and get no padding. The desktop site footer
   stays a normal footer (homepage-only, tall): the fixed bottom
   element is the bottom nav (.site-bottomnav at all widths since
   pass 42, .dash-bottomnav in the dashboard), which already had its
   own body padding. */
body:has(> header.site-header){padding-top:var(--header-h,64px)}
.site-header{position:fixed;top:0;left:0;right:0}
/* Shell loading indicator: thin bar under the fixed header while a
   content swap is fetching. */
#shell-progress{position:fixed;top:0;left:0;height:3px;width:0;background:var(--primary,#FF2E63);z-index:10001;transition:width .25s ease,opacity .3s ease;opacity:0;pointer-events:none}
#shell-progress.on{width:70%;opacity:1}
#shell-progress.done{width:100%;opacity:0}
/* Aa menu — ONE button in the header actions. The panel is fixed (the
   header is fixed, so this tracks it) and right-aligned so it never
   overflows on a 360px screen. Surface/border/text vars keep it
   dark-mode aware without new colours. */
.aa-menu{position:relative;flex:none}
.aa-btn{display:inline-flex;align-items:center;justify-content:center;width:44px;height:44px;min-width:44px;min-height:44px;padding:0;background:#fff;border:1px solid #E6E6E6;border-radius:50%;cursor:pointer;color:#0B0B0F;font-size:1.05rem;font-weight:800;font-family:inherit;flex:none}
.aa-btn:hover{border-color:#FF2E63;box-shadow:var(--shadow-sm)}
[data-theme="dark"] .aa-btn{background:#000;border-color:#333;color:#fff}
.aa-dropdown{display:none;position:fixed;top:calc(var(--header-h,64px) + 8px);right:12px;width:min(320px,calc(100vw - 24px));background:var(--surface);border:1px solid var(--border);border-radius:16px;box-shadow:var(--shadow-lg);padding:10px;z-index:10000}
.aa-menu.open .aa-dropdown{display:block}
.aa-search{display:flex}
.aa-search input{flex:1;border:1px solid var(--border);border-right:0;border-radius:10px 0 0 10px;padding:10px 12px;font-size:.95rem;min-width:0;background:var(--surface-2);color:var(--text)}
.aa-search button{border:1px solid var(--border);background:var(--primary-soft);color:var(--primary);border-radius:0 10px 10px 0;padding:10px 12px;cursor:pointer;display:flex;align-items:center;justify-content:center}
.aa-row{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 6px;border-top:1px solid var(--border);color:var(--text);font-weight:600}
a.aa-row:hover{text-decoration:none;background:var(--primary-soft);border-radius:8px}
.aa-row-label{font-size:.95rem}
.aa-notif-badge{display:inline-flex;align-items:center;justify-content:center;min-width:22px;height:22px;padding:0 6px;border-radius:999px;background:#dc2626;color:#fff;font-size:.75rem;font-weight:800}
.aa-font-row{flex-direction:column;align-items:stretch;gap:8px}
.aa-font-head{display:flex;align-items:center;justify-content:space-between;font-weight:800}
.aa-font-head .aa-font-current{font-weight:600;font-size:.9rem;color:var(--muted)}
.aa-font-row input[type="range"]{width:100%;accent-color:var(--primary,#FF2E63);cursor:pointer}
.aa-font-scale{display:flex;justify-content:space-between;font-size:.78rem;color:var(--muted);font-weight:600}
