/* NNP Academy — Coaching Center Digital Ecosystem */

:root {
  /* Palette: Trust Blue (default) */
  --bg: #F7F9FF;
  --bg-2: #EEF2F8;
  --surface: #FFFFFF;
  /* Alias — 14 rules (and the teacher-profile avatar ring) reference
     --surface-1, which was never defined, so those colours silently fell back
     to currentColor/transparent. */
  --surface-1: #FFFFFF;
  --surface-2: #F4F6FB;
  --border: #E4E9F2;
  --text: #0F172A;
  --text-2: #475569;
  --text-3: #94A3B8;
  --primary: #3B82F6;
  --primary-2: #2563EB;
  --primary-soft: #EFF6FF;
  --success: #22C55E;
  --success-soft: #ECFDF5;
  --warning: #F59E0B;
  --warning-soft: #FEF3C7;
  --danger: #EF4444;
  --danger-soft: #FEE2E2;
  --accent: #8B5CF6;
  --accent-soft: #F5F3FF;
  --info: #06B6D4;

  /* Effects */
  --shadow-sm: 0 1px 2px rgba(15,23,42,0.04), 0 1px 3px rgba(15,23,42,0.04);
  --shadow: 0 4px 12px rgba(15,23,42,0.06), 0 2px 4px rgba(15,23,42,0.04);
  --shadow-lg: 0 12px 32px rgba(15,23,42,0.08), 0 4px 8px rgba(15,23,42,0.04);
  --shadow-xl: 0 24px 64px rgba(15,23,42,0.12), 0 8px 16px rgba(15,23,42,0.06);

  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 20px;
  --radius-pill: 999px;

  --font-display: 'Plus Jakarta Sans', 'Hind Siliguri', system-ui, sans-serif;
  --font-body: 'Plus Jakarta Sans', 'Hind Siliguri', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  --motion: 1;
  --tx: cubic-bezier(0.22, 1, 0.36, 1);
}

[data-theme="dark"] {
  --bg: #0B1020;
  --bg-2: #0E1428;
  --surface: #141A30;
  --surface-1: #141A30;
  --surface-2: #1A2140;
  --border: #232B47;
  --text: #F1F5F9;
  --text-2: #B4BCD0;
  --text-3: #6B7390;
  --primary: #60A5FA;
  --primary-2: #3B82F6;
  --primary-soft: #1A2440;
  --success: #4ADE80;
  --success-soft: #142B22;
  --warning: #FBBF24;
  --warning-soft: #2A2210;
  --danger: #F87171;
  --danger-soft: #2A1414;
  --accent: #A78BFA;
  --accent-soft: #1E1A36;
  --info: #22D3EE;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.4);
  --shadow: 0 4px 12px rgba(0,0,0,0.4), 0 2px 4px rgba(0,0,0,0.2);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.5);
  --shadow-xl: 0 24px 64px rgba(0,0,0,0.6);
}

/* Palette variants */
[data-palette="indigo"] { --primary: #6366F1; --primary-2: #4F46E5; --primary-soft: #EEF2FF; --accent: #EC4899; --accent-soft: #FDF2F8; }
[data-palette="indigo"][data-theme="dark"] { --primary: #818CF8; --primary-2: #6366F1; --primary-soft: #1E1B4B; --accent: #F472B6; --accent-soft: #2A1322; }
[data-palette="teal"] { --primary: #14B8A6; --primary-2: #0D9488; --primary-soft: #ECFDF5; --accent: #FBBF24; --accent-soft: #FEF3C7; }
[data-palette="teal"][data-theme="dark"] { --primary: #2DD4BF; --primary-2: #14B8A6; --primary-soft: #042F2E; --accent: #FBBF24; --accent-soft: #2A2210; }
[data-palette="sunset"] { --primary: #F97316; --primary-2: #EA580C; --primary-soft: #FFF7ED; --accent: #DC2626; --accent-soft: #FEE2E2; }
[data-palette="sunset"][data-theme="dark"] { --primary: #FB923C; --primary-2: #F97316; --primary-soft: #2A1810; --accent: #F87171; --accent-soft: #2A1414; }

/* Font variants */
[data-font="rounded"] { --font-display: 'Quicksand', 'Hind Siliguri', system-ui, sans-serif; --font-body: 'Quicksand', system-ui, sans-serif; }
[data-font="serif"] { --font-display: 'Fraunces', 'Hind Siliguri', serif; --font-body: 'Plus Jakarta Sans', system-ui, sans-serif; }

/* Reset */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'cv11', 'ss01';
  transition: background 0.4s var(--tx), color 0.3s var(--tx);
}
button, input, select, textarea { font-family: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: transparent; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-3); }

/* Layout */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 264px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column;
  z-index: 50;
  transition: transform 0.3s var(--tx), width 0.3s var(--tx);
  /* Scrolls on overflow, but the scrollbar itself stays hidden — the nav
     still scrolls with wheel/touch/keyboard, it just doesn't show a track. */
  scrollbar-width: none;      /* Firefox */
  -ms-overflow-style: none;   /* legacy Edge/IE */
}
.sidebar::-webkit-scrollbar { display: none; }   /* Chrome/Safari/new Edge */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 68px;
  background: color-mix(in oklab, var(--surface) 80%, transparent);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 16px;
  padding: 0 24px;
  position: sticky; top: 0; z-index: 40;
}
.content { padding: 24px 32px 64px; max-width: 1480px; margin: 0 auto; width: 100%; }

/* Logo */
.logo {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}
.logo-mark {
  width: 38px; height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: grid; place-items: center;
  color: #fff; font-weight: 800; font-size: 18px;
  box-shadow: 0 6px 16px color-mix(in oklab, var(--primary) 40%, transparent);
}
.logo-text { font-family: var(--font-display); font-weight: 800; font-size: 19px; letter-spacing: -0.02em; }
.logo-text span { color: var(--primary); }

/* Portal pill */
.portal-pill {
  margin: 14px 16px 8px;
  padding: 12px 14px;
  background: linear-gradient(135deg, var(--primary-soft), var(--accent-soft));
  border-radius: 14px;
  border: 1px solid color-mix(in oklab, var(--primary) 20%, transparent);
  display: flex; align-items: center; gap: 10px;
  cursor: pointer;
  transition: transform 0.2s var(--tx);
}
.portal-pill:hover { transform: translateY(-1px); }
.portal-pill .who { font-size: 11px; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; }
.portal-pill .name { font-size: 14px; font-weight: 700; color: var(--text); }
.portal-pill .swap { margin-left: auto; color: var(--primary); }

/* Nav */
.nav { padding: 8px 12px 12px; flex: 1; }
.nav-section { font-size: 10px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.1em; padding: 14px 12px 6px; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--text-2);
  font-size: 14px; font-weight: 500;
  cursor: pointer;
  position: relative;
  transition: background 0.2s var(--tx), color 0.2s var(--tx), transform 0.2s var(--tx);
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active {
  background: linear-gradient(90deg, color-mix(in oklab, var(--primary) 12%, transparent), transparent);
  color: var(--primary);
  font-weight: 600;
}
.nav-item.active::before {
  content: ''; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px;
  background: var(--primary); border-radius: 0 3px 3px 0;
}
.nav-item .ic { width: 20px; height: 20px; flex-shrink: 0; }
.nav-item .badge { margin-left: auto; background: var(--primary); color: #fff; font-size: 10px; padding: 2px 7px; border-radius: 999px; font-weight: 700; }

/* Topbar parts */
.search {
  flex: 1; max-width: 420px;
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-2);
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 0 14px; height: 40px;
  transition: border-color 0.2s var(--tx);
}
.search:focus-within { border-color: var(--primary); background: var(--surface); }
.search input { flex: 1; border: 0; outline: 0; background: transparent; font-size: 14px; }

.icon-btn {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 10px;
  color: var(--text-2);
  position: relative;
  transition: background 0.15s var(--tx);
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn .dot { position: absolute; top: 8px; right: 8px; width: 8px; height: 8px; background: var(--danger); border-radius: 50%; border: 2px solid var(--surface); }

.topbar-avatar { display: flex; align-items: center; gap: 10px; padding: 4px 12px 4px 4px; border-radius: 999px; cursor: pointer; transition: background 0.15s var(--tx); }
.topbar-avatar:hover { background: var(--surface-2); }
.topbar-avatar .av { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, var(--primary), var(--accent)); display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 13px; }
.topbar-avatar .nm { font-size: 13px; font-weight: 600; }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm); }
.card-pad-0 { padding: 0; overflow: hidden; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 18px;
  border-radius: 10px;
  font-weight: 600; font-size: 14px;
  transition: transform 0.15s var(--tx), background 0.15s var(--tx), box-shadow 0.15s var(--tx);
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 4px 12px color-mix(in oklab, var(--primary) 40%, transparent); }
.btn-primary:hover { background: var(--primary-2); box-shadow: 0 8px 18px color-mix(in oklab, var(--primary) 50%, transparent); }
.btn-ghost { background: var(--surface-2); color: var(--text); }
.btn-ghost:hover { background: var(--bg-2); }
.btn-soft { background: var(--primary-soft); color: var(--primary); }
.btn-outline { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn-lg { height: 48px; padding: 0 24px; font-size: 15px; border-radius: 12px; }

/* Pills/chips */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--text-2); }
.chip-primary { background: var(--primary-soft); color: var(--primary); }
.chip-success { background: var(--success-soft); color: var(--success); }
.chip-warning { background: var(--warning-soft); color: var(--warning); }
.chip-danger { background: var(--danger-soft); color: var(--danger); }
.chip-accent { background: var(--accent-soft); color: var(--accent); }

/* Inputs */
.input { width: 100%; height: 44px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: 14px; outline: 0; transition: border-color 0.15s var(--tx), box-shadow 0.15s var(--tx); }
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px color-mix(in oklab, var(--primary) 18%, transparent); }
.label { font-size: 13px; font-weight: 600; margin-bottom: 6px; display: block; color: var(--text-2); }

/* Page intro */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-title { font-family: var(--font-display); font-size: 28px; font-weight: 800; letter-spacing: -0.025em; margin: 0 0 4px; }
.page-sub { color: var(--text-2); font-size: 14px; margin: 0; }

/* Grid helpers */
.grid { display: grid; gap: 20px; }
.row { display: flex; gap: 16px; }
.col { display: flex; flex-direction: column; gap: 16px; }

/* KPI */
.kpi { padding: 18px 20px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); position: relative; overflow: hidden; }
.kpi .lbl { color: var(--text-2); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.kpi .val { font-family: var(--font-display); font-size: 28px; font-weight: 800; letter-spacing: -0.02em; margin-top: 4px; }
.kpi .delta { font-size: 12px; font-weight: 600; margin-top: 6px; }
.kpi .ic { position: absolute; right: 14px; top: 14px; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; }

/* Animations */
@keyframes pop { from { transform: scale(0.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes slide-up { from { transform: translateY(8px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes shimmer { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes pulse-ring { 0% { transform: scale(.8); opacity: 1; } 100% { transform: scale(2); opacity: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes draw-stroke { to { stroke-dashoffset: 0; } }
@keyframes rise-in { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes zoom-in { from { opacity: 0; transform: scale(0.7); } to { opacity: 1; transform: scale(1); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes bar-grow { from { width: 0; } }

/* ── Portal Login / Register (teacher & admin auth screens) ──── */
.portal-login {
  min-height: 100vh; width: 100%;
  display: grid; place-items: center;
  padding: 24px;
  position: relative;
  background: var(--bg);
}
.portal-login-bg {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(60% 50% at 80% 20%, color-mix(in oklab, var(--primary) 18%, transparent), transparent 60%),
    radial-gradient(50% 40% at 10% 80%, color-mix(in oklab, var(--accent) 14%, transparent), transparent 60%);
}
.portal-login-card {
  position: relative; z-index: 1;
  width: 100%; max-width: 460px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 30px 32px;
  box-shadow: 0 24px 60px rgba(15,23,42,0.18);
  animation: rise-in 0.35s var(--tx) backwards;
}
.portal-login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.portal-login-logo {
  width: 44px; height: 44px; border-radius: 12px;
  display: grid; place-items: center; color: #fff;
  font-weight: 800; font-size: 22px;
  box-shadow: 0 8px 18px color-mix(in oklab, var(--primary) 30%, transparent);
}
.portal-login-portal { font-weight: 800; font-size: 16px; line-height: 1.2; }
.portal-login-sub    { font-size: 12px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }

.portal-login-title { font-family: var(--font-display); font-size: 22px; font-weight: 800; margin: 0 0 4px; letter-spacing: -0.01em; }
.portal-login-titlesub { color: var(--text-2); font-size: 13.5px; margin: 0 0 18px; line-height: 1.5; }

.portal-login-form { display: flex; flex-direction: column; gap: 14px; }
.portal-fields { display: flex; flex-direction: column; gap: 14px; }
.portal-fields-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.portal-actions { display: flex; gap: 10px; align-items: stretch; margin-top: 4px; }

.portal-otp-cell { width: 48px !important; height: 56px !important; text-align: center; font-size: 20px; font-weight: 800; padding: 0 !important; }
.portal-otp-hint {
  display: flex; align-items: center; gap: 6px; justify-content: center;
  font-size: 12px; color: var(--text-3); padding: 8px 12px;
  background: var(--surface-2); border-radius: 10px;
}

.portal-error {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px; border-radius: 10px;
  background: color-mix(in oklab, var(--danger) 12%, transparent);
  color: var(--danger); font-size: 12.5px; font-weight: 600;
}

.portal-tabs { display: flex; gap: 4px; padding: 4px; background: var(--surface-2); border-radius: 12px; margin-bottom: 18px; }
.portal-tabs button {
  flex: 1; padding: 9px 12px; border-radius: 9px;
  font-size: 13px; font-weight: 700; color: var(--text-2);
  background: transparent; border: none; cursor: pointer;
  transition: all 0.15s var(--tx);
}
.portal-tabs button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

.portal-footer { text-align: center; font-size: 13px; color: var(--text-2); margin-top: 4px; }
.portal-footer a { color: var(--primary); cursor: pointer; font-weight: 700; }

.portal-step-bar { display: flex; gap: 6px; justify-content: center; margin-bottom: 18px; }
.portal-step { flex: 1; max-width: 72px; height: 4px; border-radius: 2px; background: var(--surface-2); transition: background 0.3s var(--tx); }
.portal-step.on { background: var(--primary); }

.portal-photo {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 18px;
  background: var(--surface-2); border-radius: 14px;
  border: 1px dashed var(--border);
}
.portal-photo img { width: 110px; height: 110px; border-radius: 50%; object-fit: cover; border: 3px solid var(--surface); box-shadow: var(--shadow); }
.portal-photo-empty {
  width: 110px; height: 110px; border-radius: 50%;
  background: var(--surface); color: var(--text-3);
  display: grid; place-items: center;
  border: 3px dashed var(--border);
}
.portal-login-tick {
  width: 80px; height: 80px; border-radius: 50%;
  display: grid; place-items: center; margin: 0 auto 16px;
  animation: pop 0.4s var(--tx);
}

@media (max-width: 480px) {
  .portal-login { padding: 12px; }
  .portal-login-card { padding: 22px 20px; border-radius: 14px; }
  .portal-login-title { font-size: 19px; }
  .portal-fields-row { grid-template-columns: 1fr; gap: 12px; }
  .portal-otp-cell { width: 42px !important; height: 50px !important; font-size: 18px; }
  .portal-photo img, .portal-photo-empty { width: 90px; height: 90px; }
  .portal-actions { flex-direction: column-reverse; }
  .portal-actions .btn { width: 100%; justify-content: center; }
}

/* ── Contact FAB (bottom-right in student & guest portals) ── */
.contact-fab { position: fixed; right: 18px; bottom: 18px; z-index: 80; display: flex; flex-direction: column; align-items: flex-end; gap: 12px; pointer-events: none; }
.contact-fab > * { pointer-events: auto; }
.contact-fab-scrim { position: fixed; inset: 0; background: rgba(15,23,42,0.05); z-index: -1; pointer-events: auto; }
.contact-fab-btn { width: 56px; height: 56px; border-radius: 50%; background: linear-gradient(135deg, var(--primary), color-mix(in oklab, var(--primary) 70%, #8B5CF6)); color: #fff; border: none; box-shadow: 0 12px 28px rgba(59,130,246,0.45); cursor: pointer; display: grid; place-items: center; position: relative; transition: transform 0.2s ease, box-shadow 0.2s ease; }
.contact-fab-btn:hover { transform: scale(1.06); box-shadow: 0 16px 36px rgba(59,130,246,0.55); }
.contact-fab.open .contact-fab-btn { background: #0F172A; box-shadow: 0 12px 28px rgba(0,0,0,0.35); }
.contact-fab-badge { position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 800; display: grid; place-items: center; border: 2px solid var(--bg); }
.contact-fab-stack { display: flex; flex-direction: column-reverse; gap: 12px; }
.contact-fab-item { display: flex; align-items: center; gap: 10px; background: none; border: none; padding: 0; cursor: pointer; text-decoration: none; transform: translateY(12px) scale(0.9); opacity: 0; pointer-events: none; transition: transform 0.25s cubic-bezier(.34,1.56,.64,1), opacity 0.2s ease; }
.contact-fab.open .contact-fab-item { transform: translateY(0) scale(1); opacity: 1; pointer-events: auto; }
.contact-fab-label { background: var(--surface); color: var(--text); font-size: 12.5px; font-weight: 700; padding: 7px 11px; border-radius: 8px; box-shadow: var(--shadow); white-space: nowrap; }
.contact-fab-circle { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: #fff; box-shadow: 0 6px 16px rgba(0,0,0,0.2); }
@media (max-width: 640px) {
  .contact-fab { right: 12px; bottom: 12px; gap: 10px; }
  .contact-fab-btn { width: 48px; height: 48px; }
  .contact-fab-circle { width: 38px; height: 38px; }
  .contact-fab-label { font-size: 11.5px; padding: 6px 9px; }
}

/* ── Live Chat popup widget (floats on any page) ── */
.livechat-pop { position: fixed; inset: 0; z-index: 90; pointer-events: none; }
.livechat-scrim { position: absolute; inset: 0; background: rgba(15,23,42,0.30); opacity: 0; animation: livechat-fadein 0.2s ease forwards; pointer-events: auto; }
@keyframes livechat-fadein { to { opacity: 1; } }
.livechat-card {
  position: absolute; right: 18px; bottom: 90px;
  width: 380px; max-width: calc(100vw - 36px);
  height: 600px; max-height: calc(100vh - 110px);
  background: var(--surface); border-radius: 20px; overflow: hidden;
  box-shadow: 0 30px 80px rgba(15,23,42,0.40), 0 0 0 1px var(--border);
  display: flex; flex-direction: column;
  pointer-events: auto;
  animation: livechat-popin 0.28s cubic-bezier(.34,1.56,.64,1) backwards;
  transform-origin: bottom right;
}
@keyframes livechat-popin {
  from { opacity: 0; transform: scale(0.85) translateY(20px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.livechat-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  background: linear-gradient(135deg, var(--primary), color-mix(in oklab, var(--primary) 60%, #8B5CF6));
  color: #fff; flex-shrink: 0; }
.livechat-head-icon { width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,0.22); display: grid; place-items: center; flex-shrink: 0; }
.livechat-head-name { font-weight: 800; font-size: 14.5px; line-height: 1.15; }
.livechat-head-status { font-size: 11.5px; opacity: 0.92; display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.livechat-head-status .dot { width: 8px; height: 8px; border-radius: 50%; background: #4ADE80; box-shadow: 0 0 0 3px rgba(74,222,128,0.30); animation: pulse 1.8s infinite; }

/* ── GREETING (glitter) ── */
.livechat-greet {
  flex: 1; padding: 24px 22px 22px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  position: relative; overflow: hidden;
  background:
    radial-gradient(60% 50% at 50% 10%, color-mix(in oklab, var(--primary-soft) 80%, transparent), transparent 70%),
    radial-gradient(50% 40% at 80% 90%, color-mix(in oklab, #EC4899 12%, transparent), transparent 70%),
    var(--surface);
}
.livechat-sparkles { position: absolute; inset: 0; pointer-events: none; }
.livechat-sparkles .sparkle { position: absolute; font-size: 14px; opacity: 0; animation: sparkle-twinkle 3s infinite; }
.livechat-sparkles .sparkle.s-0 { top: 10%;  left: 12%; color: #FBBF24; animation-delay: 0.0s; font-size: 12px; }
.livechat-sparkles .sparkle.s-1 { top: 18%;  left: 78%; color: #EC4899; animation-delay: 0.4s; font-size: 18px; }
.livechat-sparkles .sparkle.s-2 { top: 38%;  left: 88%; color: #8B5CF6; animation-delay: 0.8s; font-size: 11px; }
.livechat-sparkles .sparkle.s-3 { top: 60%;  left: 6%;  color: #3B82F6; animation-delay: 1.2s; font-size: 16px; }
.livechat-sparkles .sparkle.s-4 { top: 26%;  left: 36%; color: #22D3EE; animation-delay: 1.6s; font-size: 10px; }
.livechat-sparkles .sparkle.s-5 { top: 50%;  left: 64%; color: #FBBF24; animation-delay: 2.0s; font-size: 14px; }
.livechat-sparkles .sparkle.s-6 { top: 76%;  left: 88%; color: #EC4899; animation-delay: 2.4s; font-size: 11px; }
.livechat-sparkles .sparkle.s-7 { top: 6%;   left: 54%; color: #22D3EE; animation-delay: 2.8s; font-size: 9px; }
@keyframes sparkle-twinkle {
  0%, 100% { opacity: 0; transform: scale(0.5) rotate(0deg); }
  50%      { opacity: 1; transform: scale(1.2) rotate(180deg); }
}

.livechat-greet-emoji { font-size: 48px; margin-bottom: 8px; animation: wave 1.6s ease-in-out infinite; transform-origin: 70% 70%; }
@keyframes wave { 0%,100%{transform:rotate(0deg);} 25%{transform:rotate(14deg);} 75%{transform:rotate(-10deg);} }

.livechat-greet-title { font-family: var(--font-display); font-size: 24px; font-weight: 800; margin: 0 0 10px; line-height: 1.15; }
.glitter-text {
  background: linear-gradient(90deg, var(--primary) 0%, #8B5CF6 25%, #EC4899 50%, #FBBF24 75%, var(--primary) 100%);
  background-size: 200% auto;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  animation: shimmer-text 3s linear infinite;
}
@keyframes shimmer-text { to { background-position: 200% center; } }

.livechat-greet-sub { font-size: 13.5px; color: var(--text-2); line-height: 1.55; margin: 0 0 20px; max-width: 300px; }

.livechat-start-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 26px; border-radius: 14px; border: none; cursor: pointer;
  background: linear-gradient(135deg, var(--primary) 0%, #8B5CF6 100%);
  color: #fff; font-weight: 800; font-size: 14px;
  box-shadow: 0 10px 26px color-mix(in oklab, var(--primary) 45%, transparent);
  transition: transform 0.15s, box-shadow 0.15s;
  position: relative; overflow: hidden;
}
.livechat-start-btn::after {
  content: ''; position: absolute; top: 0; left: -100%; width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.45), transparent);
  animation: shimmer-sweep 2.6s infinite;
}
@keyframes shimmer-sweep { to { left: 100%; } }
.livechat-start-btn:hover { transform: translateY(-2px) scale(1.02); box-shadow: 0 16px 36px color-mix(in oklab, var(--primary) 55%, transparent); }
.livechat-start-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.livechat-namegate { width: 100%; max-width: 280px; text-align: left; }
.livechat-namegate .livechat-start-btn { width: 100%; justify-content: center; margin-top: 12px; }

.livechat-quicks { margin-top: 18px; display: flex; flex-direction: column; gap: 6px; width: 100%; max-width: 320px; }
.livechat-quicks-lbl { font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 700; margin-bottom: 4px; }
.livechat-quick-chip { padding: 9px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text); text-align: left; font-size: 12.5px; cursor: pointer; transition: border-color 0.15s, background 0.15s; font-family: inherit; }
.livechat-quick-chip:hover { border-color: var(--primary); background: color-mix(in oklab, var(--primary-soft) 60%, var(--surface-2)); }

.livechat-wa { margin-top: 18px; display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-3); text-decoration: none; padding: 7px 10px; border-radius: 999px; transition: color 0.15s; }
.livechat-wa:hover { color: #25D366; }

/* ── ACTIVE CHAT body & foot ── */
.livechat-body {
  flex: 1; overflow-y: auto; padding: 16px;
  background:
    radial-gradient(at 20% 0%, color-mix(in oklab, var(--primary-soft) 50%, transparent), transparent 50%),
    radial-gradient(at 80% 100%, color-mix(in oklab, #8B5CF6 12%, transparent), transparent 50%),
    var(--surface-2);
  display: flex; flex-direction: column; gap: 10px;
}
.livechat-foot { padding: 10px 12px; background: var(--surface); border-top: 1px solid var(--border); display: flex; gap: 8px; align-items: flex-end; flex-shrink: 0; }
.livechat-foot .chat-input { background: var(--surface-2); }

/* ── Responsive ── */
@media (max-width: 640px) {
  .livechat-card {
    right: 0; bottom: 0; left: 0; top: 0;
    width: 100%; height: 100%; max-width: none; max-height: none;
    border-radius: 0;
    animation: livechat-popin-mobile 0.28s cubic-bezier(.34,1.56,.64,1) backwards;
    transform-origin: bottom center;
  }
  @keyframes livechat-popin-mobile {
    from { opacity: 0; transform: translateY(100%); }
    to   { opacity: 1; transform: translateY(0); }
  }
  .livechat-scrim { display: none; }
  .livechat-greet-title { font-size: 22px; }
  .livechat-greet-emoji { font-size: 42px; }
}
@media (min-width: 641px) and (max-width: 1024px) {
  .livechat-card { width: 380px; height: 580px; }
}

/* ── Live Chat ── */
.chat-wrap { display: flex; flex-direction: column; height: calc(100vh - 130px); min-height: 480px; max-height: 720px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; overflow: hidden; box-shadow: var(--shadow); }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; background: linear-gradient(135deg, var(--primary), color-mix(in oklab, var(--primary) 70%, #8B5CF6)); color: #fff; flex-shrink: 0; }
.chat-head-name { font-weight: 800; font-size: 15px; line-height: 1.15; }
.chat-head-status { font-size: 11.5px; opacity: 0.85; display: flex; align-items: center; gap: 6px; }
.chat-head-status .dot { width: 8px; height: 8px; border-radius: 50%; background: #22C55E; box-shadow: 0 0 0 3px rgba(34,197,94,0.25); animation: pulse 1.8s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(34,197,94,0.4); } 100% { box-shadow: 0 0 0 8px rgba(34,197,94,0); } }
.chat-body { flex: 1; overflow-y: auto; padding: 18px; background:
  radial-gradient(at 20% 0%, color-mix(in oklab, var(--primary-soft) 50%, transparent), transparent 50%),
  radial-gradient(at 80% 100%, color-mix(in oklab, #8B5CF6 12%, transparent), transparent 50%),
  var(--surface-2);
  display: flex; flex-direction: column; gap: 10px;
}
.chat-day { align-self: center; font-size: 11px; font-weight: 700; color: var(--text-3); background: var(--surface); padding: 3px 12px; border-radius: 999px; margin: 4px 0 6px; }
.chat-row { display: flex; gap: 8px; max-width: 80%; }
.chat-row.user { align-self: flex-end; flex-direction: row-reverse; }
.chat-bubble { padding: 9px 13px; border-radius: 16px; font-size: 13.5px; line-height: 1.5; word-break: break-word; box-shadow: 0 1px 2px rgba(15,23,42,0.06); position: relative; }
.chat-row.admin .chat-bubble { background: var(--surface); color: var(--text); border-bottom-left-radius: 5px; }
.chat-row.user  .chat-bubble { background: var(--primary); color: #fff;       border-bottom-right-radius: 5px; }
.chat-time  { font-size: 10.5px; color: var(--text-3); margin-top: 3px; text-align: right; }
.chat-row.user .chat-time { color: rgba(255,255,255,0.75); }
.chat-img { max-width: 240px; max-height: 240px; border-radius: 10px; display: block; margin-top: 4px; cursor: zoom-in; }
.chat-foot { padding: 12px; background: var(--surface); border-top: 1px solid var(--border); display: flex; gap: 8px; align-items: flex-end; flex-shrink: 0; }
.chat-input { flex: 1; border: 1px solid var(--border); border-radius: 18px; padding: 10px 14px; font-size: 14px; font-family: inherit; outline: none; resize: none; min-height: 40px; max-height: 120px; line-height: 1.4; background: var(--surface-2); }
.chat-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in oklab, var(--primary) 18%, transparent); }
.chat-send { width: 40px; height: 40px; border-radius: 50%; background: var(--primary); color: #fff; border: none; cursor: pointer; display: grid; place-items: center; transition: transform 0.15s; flex-shrink: 0; }
.chat-send:hover { transform: scale(1.05); }
.chat-send:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.chat-attach { width: 40px; height: 40px; border-radius: 50%; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); cursor: pointer; display: grid; place-items: center; flex-shrink: 0; }
.chat-typing { display: flex; align-items: center; gap: 4px; padding: 8px 12px; }
.chat-typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--text-3); animation: typing-dot 1.4s infinite; }
.chat-typing span:nth-child(2) { animation-delay: 0.2s; }
.chat-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing-dot { 0%, 60%, 100% { opacity: 0.3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-4px); } }
@media (max-width: 640px) {
  .chat-wrap { height: calc(100vh - 100px); border-radius: 12px; }
  .chat-row { max-width: 92%; }
  .chat-img { max-width: 200px; }
}

/* Admin chat inbox layout — left list + right thread */
.chat-inbox { display: grid; grid-template-columns: 320px 1fr; gap: 0; height: calc(100vh - 130px); min-height: 520px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; overflow: hidden; box-shadow: var(--shadow); }
.chat-inbox-list { border-right: 1px solid var(--border); overflow-y: auto; background: var(--surface-2); }
.chat-inbox-row { display: flex; gap: 10px; padding: 12px 14px; cursor: pointer; border-bottom: 1px solid var(--border); position: relative; transition: background 0.15s; }
.chat-inbox-row:hover { background: color-mix(in oklab, var(--primary-soft) 40%, var(--surface-2)); }
.chat-inbox-row.active { background: var(--surface); }
.chat-inbox-row.active::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--primary); }
.chat-inbox-meta { flex: 1; min-width: 0; }
.chat-inbox-name { font-weight: 700; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-inbox-preview { font-size: 11.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-inbox-time { font-size: 10.5px; color: var(--text-3); flex-shrink: 0; }
.chat-inbox-unread { background: var(--primary); color: #fff; border-radius: 999px; min-width: 18px; height: 18px; padding: 0 6px; font-size: 10px; font-weight: 800; display: grid; place-items: center; align-self: center; }
.chat-inbox-empty { padding: 40px 20px; text-align: center; color: var(--text-3); }
.chat-inbox-thread { display: flex; flex-direction: column; overflow: hidden; min-width: 0; }
.chat-inbox-thread .chat-wrap { height: 100%; border-radius: 0; border: none; box-shadow: none; max-height: none; }
@media (max-width: 880px) {
  .chat-inbox { grid-template-columns: 1fr; }
  .chat-inbox-list { display: none; max-height: 220px; border-right: none; border-bottom: 1px solid var(--border); }
  .chat-inbox.mobile-list .chat-inbox-list { display: block; }
  .chat-inbox.mobile-list .chat-inbox-thread { display: none; }
}

/* ── Redesigned Help & Support page ── */
.support-hero { display: grid; grid-template-columns: 1.4fr 1fr; gap: 22px; padding: 28px; border-radius: 22px; color: #fff;
  background: linear-gradient(135deg, var(--primary) 0%, #8B5CF6 55%, #EC4899 100%);
  position: relative; overflow: hidden; box-shadow: 0 24px 60px rgba(99,102,241,0.30); margin-bottom: 24px; }
.support-hero::before { content: ''; position: absolute; inset: 0; background: radial-gradient(60% 80% at 80% -10%, rgba(255,255,255,0.25), transparent 60%); pointer-events: none; }
.support-hero h1 { font-family: var(--font-display); font-size: 34px; font-weight: 800; letter-spacing: -0.02em; margin: 0 0 10px; }
.support-hero p { font-size: 14.5px; opacity: 0.94; line-height: 1.6; margin: 0 0 20px; max-width: 540px; }
.support-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.support-pill { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 12px; font-weight: 700; font-size: 13.5px; border: none; cursor: pointer; transition: transform 0.15s, box-shadow 0.15s; text-decoration: none; }
.support-pill.primary { background: #fff; color: var(--primary); box-shadow: 0 10px 22px rgba(0,0,0,0.18); }
.support-pill.outline { background: rgba(255,255,255,0.15); color: #fff; border: 1px solid rgba(255,255,255,0.4); }
.support-pill:hover { transform: translateY(-2px); }
.support-hero-side { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.support-stat { background: rgba(255,255,255,0.14); border-radius: 14px; padding: 14px 14px; backdrop-filter: blur(6px); }
.support-stat .v { font-family: var(--font-display); font-size: 22px; font-weight: 800; line-height: 1.1; margin-bottom: 4px; }
.support-stat .l { font-size: 11.5px; opacity: 0.85; }
.support-section-title { font-family: var(--font-display); font-size: 18px; font-weight: 800; margin: 0 0 12px; letter-spacing: -0.01em; }
.support-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.support-channels { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.support-channel { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); cursor: pointer; text-decoration: none; color: var(--text); transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s; }
.support-channel:hover { transform: translateY(-2px); border-color: color-mix(in oklab, var(--primary) 36%, var(--border)); box-shadow: var(--shadow); }
.support-channel-body { flex: 1; min-width: 0; }
.support-channel-name { font-weight: 700; font-size: 13.5px; line-height: 1.25; }
.support-channel-hint { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }
.support-faq-item { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; margin-bottom: 10px; overflow: hidden; transition: border-color 0.15s; }
.support-faq-item.open { border-color: color-mix(in oklab, var(--primary) 40%, var(--border)); }
.support-faq-q { padding: 14px 16px; cursor: pointer; display: flex; align-items: flex-start; gap: 12px; font-weight: 700; font-size: 14px; line-height: 1.4; user-select: none; }
.support-faq-q .chev { transition: transform 0.2s ease; flex-shrink: 0; color: var(--text-3); margin-top: 2px; }
.support-faq-item.open .support-faq-q .chev { transform: rotate(180deg); }
.support-faq-a { padding: 0 16px 16px 44px; font-size: 13px; color: var(--text-2); line-height: 1.65; }
@media (max-width: 760px) {
  .support-hero { grid-template-columns: 1fr; padding: 22px; }
  .support-hero h1 { font-size: 26px; }
  .support-grid { grid-template-columns: 1fr; }
  .support-channels { grid-template-columns: 1fr; }
}

/* ══════════════════════════════════════════════════════════════════════
   Guardian Portal — shared layout primitives (hero, child switcher,
   stat tiles, calendar, fees, messages, reports). All fully responsive.
   ══════════════════════════════════════════════════════════════════════ */
.guardian-page { max-width: 1200px; margin: 0 auto; }

/* ── Hero greeting ── */
.guardian-hero {
  --accent: #8B5CF6;
  position: relative; overflow: hidden;
  background: linear-gradient(135deg, var(--accent), color-mix(in oklab, var(--accent) 60%, #EC4899));
  color: #fff; border-radius: 16px;
  padding: 22px 24px; border: 0;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}
.guardian-hero-shape { position: absolute; border-radius: 50%; pointer-events: none; }
.guardian-hero-shape.s1 { top: -30px; right: -30px; width: 170px; height: 170px; background: rgba(255,255,255,0.12); }
.guardian-hero-shape.s2 { bottom: -50px; right: 80px; width: 120px; height: 120px; background: rgba(255,255,255,0.08); }
.guardian-hero-body { position: relative; z-index: 1; }
.guardian-hero-date { font-size: 12.5px; opacity: 0.85; font-weight: 600; }
.guardian-hero-title {
  font-family: var(--font-display); font-weight: 800; letter-spacing: -0.02em;
  margin: 6px 0 4px; font-size: 26px; line-height: 1.2;
}
.guardian-hero-msg { opacity: 0.92; margin: 0; font-size: 13.5px; line-height: 1.55; max-width: 520px; }

/* ── Child switcher pills ── */
.guardian-children {
  display: flex; gap: 10px; margin-bottom: 18px;
  flex-wrap: wrap;
}
.guardian-child-pill {
  --accent: var(--primary);
  display: flex; align-items: center; gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 14px;
  cursor: pointer; flex: 1; min-width: 0;
  max-width: 320px;
  font-family: inherit; color: var(--text);
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
  -webkit-tap-highlight-color: transparent;
  text-align: left;
}
.guardian-child-pill:hover { transform: translateY(-1px); border-color: color-mix(in oklab, var(--accent) 30%, var(--border)); }
.guardian-child-pill.active {
  border: 2px solid var(--accent);
  background: color-mix(in oklab, var(--accent) 8%, var(--surface));
  padding: 9px 13px;
}
.guardian-child-pill .info { flex: 1; min-width: 0; }
.guardian-child-pill .name { font-weight: 700; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.guardian-child-pill .meta { font-size: 11.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.guardian-child-pill .tick { color: var(--accent); flex-shrink: 0; }
.guardian-child-add {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  background: transparent;
  border: 2px dashed var(--border);
  border-radius: 12px; padding: 10px 14px;
  color: var(--text-3); font-weight: 600; font-size: 13px;
  cursor: pointer; min-width: 130px;
  font-family: inherit;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.guardian-child-add:hover { border-color: var(--primary); color: var(--primary); }

/* ── Stat tiles (overview, attendance) ── */
.guardian-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px; margin-bottom: 18px;
}
.guardian-stat {
  display: flex; justify-content: space-between; gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px; min-width: 0;
}
.guardian-stat .l { font-size: 10.5px; color: var(--text-3); font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; }
.guardian-stat .v { font-family: var(--font-display); font-size: 24px; font-weight: 800; margin-top: 4px; line-height: 1.1; }
.guardian-stat .d { font-size: 11.5px; font-weight: 700; margin-top: 2px; }
.guardian-stat .ic { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; }

/* ── Two-column row (charts + activity) ── */
.guardian-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; }

/* ── Action banners ── */
.guardian-banners { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 16px; }
.guardian-banner.warn { background: var(--warning-soft); border-color: color-mix(in oklab, var(--warning) 30%, transparent); }
.guardian-banner.good { background: var(--success-soft); border-color: color-mix(in oklab, var(--success) 30%, transparent); }
.guardian-banner .msg { font-size: 13px; color: var(--text-2); line-height: 1.5; margin-bottom: 12px; }

/* ── Attendance ── */
.guardian-attend-stats {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px; margin-bottom: 18px;
}
.guardian-attend-stat {
  --accent: var(--primary);
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
}
.guardian-attend-stat .ic {
  width: 40px; height: 40px; border-radius: 11px;
  background: color-mix(in oklab, var(--accent) 15%, transparent);
  color: var(--accent);
  display: grid; place-items: center; flex-shrink: 0;
}
.guardian-attend-stat .v { font-family: var(--font-display); font-weight: 800; font-size: 22px; color: var(--accent); line-height: 1.1; }
.guardian-attend-stat .l { font-size: 11.5px; color: var(--text-3); font-weight: 700; }

.guardian-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.guardian-cal-head { text-align: center; font-size: 11px; font-weight: 700; color: var(--text-3); padding: 6px 0; }
.guardian-cal-cell {
  aspect-ratio: 1; border-radius: 9px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  font-weight: 700; cursor: pointer;
  transition: transform 0.12s ease;
}
.guardian-cal-cell:hover { transform: scale(1.06); }
.guardian-cal-cell .n { font-size: 13.5px; }
.guardian-cal-cell .s { font-size: 9px; font-weight: 700; opacity: 0.7; margin-top: 1px; }
.guardian-cal-cell.present { background: var(--success-soft); color: var(--success); }
.guardian-cal-cell.late    { background: var(--warning-soft); color: var(--warning); }
.guardian-cal-cell.absent  { background: color-mix(in oklab, var(--danger) 14%, transparent); color: var(--danger); }
.guardian-cal-legend { display: flex; gap: 16px; margin-top: 14px; flex-wrap: wrap; font-size: 12px; color: var(--text-3); }
.g-legend { display: inline-flex; align-items: center; gap: 6px; }
.g-legend > span { width: 12px; height: 12px; border-radius: 4px; display: inline-block; }

/* ── Results summary card ── */
.guardian-summary { text-align: center; padding: 22px; }
.guardian-summary-title { font-family: var(--font-display); font-weight: 800; font-size: 20px; margin-top: 14px; }
.guardian-summary-total {
  display: inline-flex; align-items: baseline; gap: 6px;
  margin-top: 10px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--primary-soft);
  flex-wrap: wrap; justify-content: center;
}
.guardian-summary-total .num { font-family: var(--font-display); font-weight: 800; font-size: 22px; color: var(--primary); line-height: 1; }
.guardian-summary-total .den { font-size: 13px; color: var(--text-3); font-weight: 700; }
.guardian-summary-total .lbl {
  font-size: 10.5px; font-weight: 800; color: var(--primary);
  text-transform: uppercase; letter-spacing: 0.06em;
  margin-left: 4px;
}
.guardian-summary-sub   { font-size: 13px; color: var(--text-2); margin-top: 8px; }
.guardian-summary-trend { font-size: 12px; color: var(--success); font-weight: 700; margin-top: 6px; }

/* ── Tables wrapper (always horizontally scrollable on phone) ── */
.guardian-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.guardian-table-wrap .table { min-width: 540px; }

/* ── Monthly Report ── */
.guardian-report { padding: 30px; max-width: 880px; margin: 0 auto; }
.guardian-report-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  border-bottom: 2px solid var(--primary); padding-bottom: 16px; margin-bottom: 22px;
  gap: 16px; flex-wrap: wrap;
}
.guardian-report-head .brand { font-family: var(--font-display); font-weight: 800; font-size: 26px; color: var(--primary); letter-spacing: -0.02em; }
.guardian-report-head .sub   { font-size: 12px; color: var(--text-3); }
.guardian-report-period { text-align: right; }
.guardian-report-period .label { font-size: 11px; color: var(--text-3); font-weight: 700; text-transform: uppercase; }
.guardian-report-period .value { font-weight: 700; font-size: 14px; }
.guardian-report-period .meta  { font-size: 11px; color: var(--text-3); }
.guardian-report-people { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 22px; }
.guardian-report-people .label { font-size: 11px; font-weight: 800; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.05em; }
.guardian-report-people .name  { font-size: 17px; font-weight: 800; margin-top: 4px; }
.guardian-report-people .meta  { font-size: 12.5px; color: var(--text-2); margin-top: 2px; }
.guardian-report-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 22px; }
.guardian-report-kpi {
  padding: 14px 10px; border-radius: 12px;
  background: var(--surface-2); text-align: center;
}
.guardian-report-kpi .v { font-family: var(--font-display); font-weight: 800; font-size: 24px; }
.guardian-report-kpi .l { font-size: 10.5px; color: var(--text-3); font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; margin-top: 2px; }
.guardian-report-note { color: var(--text-2); line-height: 1.7; font-size: 13.5px; margin: 0; }
.guardian-report-sign { margin-top: 18px; font-size: 12.5px; color: var(--text-3); font-style: italic; }

/* ── Fees ── */
.guardian-fees-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin-bottom: 18px; }
.guardian-fee-card {
  --accent: var(--primary);
  color: #fff; border: 0;
  background: linear-gradient(135deg, var(--warning), var(--danger));
}
.guardian-fee-card.paid { background: linear-gradient(135deg, var(--success), color-mix(in oklab, var(--success) 60%, var(--accent))); }
.guardian-fee-head { display: flex; justify-content: space-between; align-items: center; }
.guardian-fee-meta   { font-size: 13px; opacity: 0.9; margin-top: 14px; font-weight: 700; }
.guardian-fee-amount { font-family: var(--font-display); font-size: 30px; font-weight: 800; margin-top: 4px; line-height: 1.1; }
.guardian-fee-btn {
  width: 100%; margin-top: 14px;
  background: #fff; color: var(--danger);
  justify-content: center; font-weight: 800;
}
.guardian-fee-card.paid .guardian-fee-btn { color: var(--success); }
.guardian-fee-btn.outline { background: rgba(255,255,255,0.22); color: #fff; border: 0; }

/* ── Messages ── */
.guardian-msg-shell {
  display: grid; grid-template-columns: 320px minmax(0, 1fr);
  height: calc(100vh - 200px); min-height: 480px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.guardian-msg-list { border-right: 1px solid var(--border); overflow-y: auto; }
.guardian-msg-search { padding: 12px; border-bottom: 1px solid var(--border); }
.guardian-msg-search .input,
.guardian-msg-search input {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface-2); border: 1px solid var(--border);
  padding: 8px 12px; border-radius: 10px; width: 100%;
}
.guardian-msg-search input { background: transparent; border: 0; outline: none; padding: 0; font-size: 13px; }
.guardian-msg-row {
  display: flex; gap: 10px;
  padding: 12px 14px; cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s ease;
}
.guardian-msg-row:hover { background: var(--surface-2); }
.guardian-msg-row.active { background: var(--primary-soft); }
.guardian-msg-row .info { flex: 1; min-width: 0; }
.guardian-msg-row .head { display: flex; justify-content: space-between; gap: 8px; }
.guardian-msg-row .name { font-weight: 700; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.guardian-msg-row .time { font-size: 11px; color: var(--text-3); flex-shrink: 0; }
.guardian-msg-row .role { font-size: 11px; color: var(--text-3); margin: 2px 0 3px; }
.guardian-msg-row .preview { font-size: 12px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.guardian-msg-row .badge {
  align-self: center; flex-shrink: 0;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px; background: var(--primary); color: #fff;
  font-size: 10px; font-weight: 800;
  display: grid; place-items: center;
}

.guardian-msg-thread { display: flex; flex-direction: column; min-width: 0; }
.guardian-msg-thread-head {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.guardian-msg-thread-head .back { display: none; }
.guardian-msg-thread-head .name { font-weight: 800; font-size: 14px; }
.guardian-msg-thread-head .role { font-size: 11.5px; color: var(--text-3); }
.guardian-msg-thread-head .online { color: var(--success); font-weight: 700; }
.guardian-msg-body {
  flex: 1; overflow-y: auto;
  padding: 18px;
  display: flex; flex-direction: column; gap: 8px;
  background: linear-gradient(180deg, color-mix(in oklab, var(--primary-soft) 30%, var(--surface-2)), var(--surface-2));
}
.guardian-msg-bubble-row { display: flex; }
.guardian-msg-bubble-row.me { justify-content: flex-end; }
.guardian-msg-bubble-row.them { justify-content: flex-start; }
.guardian-msg-bubble {
  max-width: 70%; padding: 9px 13px; border-radius: 14px;
  font-size: 13.5px; line-height: 1.55;
  background: var(--surface); color: var(--text);
  box-shadow: 0 1px 2px rgba(15,23,42,0.05);
}
.guardian-msg-bubble-row.me .guardian-msg-bubble { background: var(--primary); color: #fff; border-bottom-right-radius: 5px; }
.guardian-msg-bubble-row.them .guardian-msg-bubble { border-bottom-left-radius: 5px; }
.guardian-msg-bubble .time { font-size: 10px; opacity: 0.7; margin-top: 4px; }
.guardian-msg-foot {
  display: flex; gap: 8px; align-items: center;
  padding: 12px; border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.guardian-msg-foot input { flex: 1; }

/* ══════════════════════════════════════════════════════════════════════
   Guardian — Responsive
   ══════════════════════════════════════════════════════════════════════ */
@media (max-width: 980px) {
  .guardian-row { grid-template-columns: 1fr; }
  .guardian-banners { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .guardian-hero { padding: 18px 18px; border-radius: 14px; }
  .guardian-hero-title { font-size: 22px; }
  .guardian-hero-msg   { font-size: 13px; }
  .guardian-hero-shape.s1 { width: 130px; height: 130px; top: -20px; right: -20px; }
  .guardian-hero-shape.s2 { width: 90px;  height: 90px;  bottom: -30px; right: 40px; }

  .guardian-stats { grid-template-columns: 1fr 1fr; }
  .guardian-stat { padding: 12px 14px; }
  .guardian-stat .v { font-size: 20px; }

  .guardian-child-pill { padding: 9px 12px; gap: 8px; max-width: none; }
  .guardian-child-pill.active { padding: 8px 11px; }
  .guardian-child-add { min-width: 120px; padding: 9px 12px; font-size: 12.5px; }

  .guardian-attend-stats { grid-template-columns: 1fr 1fr; }

  /* Calendar cell labels shrink */
  .guardian-cal-cell .n { font-size: 12.5px; }
  .guardian-cal-cell .s { font-size: 8.5px; }

  /* Report — tighter padding */
  .guardian-report { padding: 20px 18px; }
  .guardian-report-head .brand { font-size: 22px; }
  .guardian-report-period { text-align: left; }
  .guardian-report-people { grid-template-columns: 1fr; gap: 12px; }
  .guardian-report-kpis   { grid-template-columns: 1fr 1fr; }

  /* Fees */
  .guardian-fees-cards { grid-template-columns: 1fr; }

  /* Messages: list/thread navigation */
  .guardian-msg-shell {
    grid-template-columns: 1fr;
    height: calc(100vh - 170px);
    position: relative;
  }
  .guardian-msg-list { border-right: none; }
  .guardian-msg-thread {
    position: absolute; inset: 0;
    background: var(--surface);
    transform: translateX(100%);
    transition: transform 0.25s ease;
    visibility: hidden;
  }
  .guardian-msg-shell.show-thread .guardian-msg-thread {
    transform: translateX(0);
    visibility: visible;
  }
  .guardian-msg-thread-head .back { display: grid; }
}
@media (max-width: 480px) {
  .guardian-stats, .guardian-attend-stats { grid-template-columns: 1fr 1fr; }
  .guardian-hero-title { font-size: 19px; }
  .guardian-report-kpis { grid-template-columns: 1fr 1fr; }
  .guardian-report-head { flex-direction: column; align-items: flex-start; }
  .guardian-cal-grid { gap: 4px; }
  .guardian-cal-cell .s { display: none; }
  .guardian-fee-amount { font-size: 24px; }
  .guardian-msg-bubble { max-width: 86%; font-size: 13px; }
}

/* ══════════════════════════════════════════════════════════════════════
   OTP input + Forgot Password modal
   ══════════════════════════════════════════════════════════════════════ */
.otp-input { display: flex; gap: 8px; justify-content: center; margin: 14px 0 8px; }
.otp-input input {
  width: 44px; height: 52px;
  text-align: center;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 22px; font-weight: 700;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 10px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}
.otp-input input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--primary) 18%, transparent);
  transform: translateY(-1px);
}

/* Forgot password modal */
.fpw-backdrop {
  position: fixed; inset: 0; z-index: 9000;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  display: grid; place-items: center;
  padding: 20px;
  animation: fpw-fade 0.18s ease;
}
@keyframes fpw-fade { from { opacity: 0; } to { opacity: 1; } }
.fpw-card {
  --accent: #22C55E;
  position: relative;
  background: var(--surface, #fff);
  border-radius: 18px;
  box-shadow: 0 24px 48px rgba(0,0,0,0.22);
  max-width: 440px; width: 100%;
  padding: 22px;
  animation: fpw-pop 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes fpw-pop { from { transform: translateY(8px) scale(0.97); opacity: 0; } to { transform: none; opacity: 1; } }
.fpw-close {
  position: absolute; top: 12px; right: 14px;
  background: var(--surface-2, #F1F5F9); border: 0;
  width: 30px; height: 30px; border-radius: 50%;
  font-size: 19px; cursor: pointer;
  color: var(--text-3, #64748B);
  display: grid; place-items: center;
  line-height: 1;
}
.fpw-close:hover { background: color-mix(in oklab, var(--accent) 18%, var(--surface-2)); color: var(--accent); }

.fpw-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 14px; }
.fpw-icon {
  width: 46px; height: 46px; border-radius: 14px;
  display: grid; place-items: center; flex-shrink: 0;
  color: #fff;
  box-shadow: 0 6px 14px color-mix(in oklab, var(--accent) 40%, transparent);
}
.fpw-title { font-family: var(--font-display); font-weight: 800; font-size: 19px; letter-spacing: -0.01em; }
.fpw-sub   { font-size: 13px; color: var(--text-3); margin-top: 4px; line-height: 1.5; }

.fpw-err {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px;
  background: var(--danger-soft, #FEE2E2);
  color: var(--danger, #DC2626);
  border-radius: 10px; font-size: 12.5px; font-weight: 600;
  margin-bottom: 14px;
}

.fpw-body { display: flex; flex-direction: column; gap: 6px; }
.fpw-body .label { font-size: 11.5px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 4px; }

.fpw-meta {
  text-align: center;
  font-size: 12px;
  color: var(--text-3);
  margin-top: 4px;
}
.fpw-meta b { font-family: var(--font-mono, monospace); color: var(--text); }
.fpw-link { background: none; border: 0; font-weight: 700; cursor: pointer; padding: 4px 8px; border-radius: 6px; font-size: 12.5px; }
.fpw-link:hover { background: var(--surface-2); }

.fpw-actions {
  display: flex; gap: 8px;
  margin-top: 18px;
}
.fpw-actions .btn { flex: 1; justify-content: center; }
.fpw-cta {
  color: #fff !important; font-weight: 700;
  border: 0;
}
.fpw-cta:disabled { opacity: 0.55; cursor: not-allowed; }

.fpw-pass-wrap { position: relative; }
.fpw-pass-toggle {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  background: none; border: 0; cursor: pointer;
  color: var(--text-3); padding: 4px;
}
.fpw-pass-toggle:hover { color: var(--accent); }

.fpw-success-icon {
  width: 70px; height: 70px; border-radius: 50%;
  display: grid; place-items: center; margin: 0 auto;
  animation: fpw-pop 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Forgot password link inline in login forms */
.forgot-pw-link {
  background: none; border: 0; cursor: pointer;
  padding: 0; margin-left: auto;
  font-size: 12px; font-weight: 700;
  color: var(--text-3);
  transition: color 0.15s ease;
}
.forgot-pw-link:hover { color: var(--primary); text-decoration: underline; }

@media (max-width: 480px) {
  .otp-input input { width: 38px; height: 46px; font-size: 18px; }
  .fpw-card { padding: 18px; }
  .fpw-icon { width: 42px; height: 42px; }
  .fpw-title { font-size: 17px; }
}

/* ══════════════════════════════════════════════════════════════════════
   Admin Portal — Schedule / Materials / Q&A / Notifications /
                  Leaderboard / Monthly Reports
   ══════════════════════════════════════════════════════════════════════ */

/* ── Schedule weekly grid ── */
.adm-sch-page { max-width: 1200px; margin: 0 auto; }
.adm-sch-grid { overflow: hidden; }
.adm-sch-head {
  display: grid; grid-template-columns: 70px repeat(7, minmax(0, 1fr));
  border-bottom: 1px solid var(--border); background: var(--surface-2);
}
.adm-sch-head > div { padding: 12px 8px; text-align: center; font-weight: 700; font-size: 12.5px; color: var(--text-2); border-right: 1px solid var(--border); }
.adm-sch-head > div:last-child { border-right: 0; }
.adm-sch-body { display: grid; grid-template-columns: 70px repeat(7, minmax(0, 1fr)); position: relative; min-height: 480px; }
.adm-sch-times { display: flex; flex-direction: column; border-right: 1px solid var(--border); }
.adm-sch-time { height: 80px; border-bottom: 1px solid var(--border); padding: 6px 8px; font-size: 11px; color: var(--text-3); font-weight: 700; }
.adm-sch-col { position: relative; border-right: 1px solid var(--border); background-image: linear-gradient(to bottom, transparent 39px, var(--border) 39px, var(--border) 40px, transparent 40px); background-size: 100% 80px; }
.adm-sch-col:last-child { border-right: 0; }
.adm-sch-slot {
  position: absolute; left: 4px; right: 4px;
  padding: 6px 8px; border-radius: 8px;
  border: 1px solid var(--border); border-left-width: 3px;
  background: transparent; cursor: pointer; text-align: left;
  font-family: inherit; color: inherit; overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.adm-sch-slot:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.adm-sch-slot .t     { font-weight: 800; font-size: 11px; line-height: 1.2; }
.adm-sch-slot .sub   { font-size: 10.5px; color: var(--text-3); margin-top: 2px; }
.adm-sch-slot .topic { font-weight: 700; font-size: 12px; margin-top: 2px; line-height: 1.3; }
.adm-sch-slot .meta  { font-size: 10.5px; color: var(--text-3); margin-top: 2px; }

/* Schedule form grid */
.adm-sch-form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }

/* ── Materials list ── */
.adm-mat-page { max-width: 1200px; margin: 0 auto; }
.adm-mat-list { display: flex; flex-direction: column; gap: 10px; }
.adm-mat-row { display: flex; align-items: center; gap: 14px; padding: 12px 14px; }
.adm-mat-row .ic {
  width: 42px; height: 42px; border-radius: 11px;
  background: var(--primary-soft); color: var(--primary);
  display: grid; place-items: center; flex-shrink: 0;
}
.adm-mat-row .info { flex: 1; min-width: 0; }
.adm-mat-row .info .title { font-weight: 700; font-size: 14px; }
.adm-mat-row .info .meta  { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }
.adm-mat-row .actions { display: flex; gap: 4px; flex-shrink: 0; }

/* ── Q&A moderation row ── */
.adm-qa-page { max-width: 1200px; margin: 0 auto; }
.adm-qa-row { display: flex; gap: 12px; padding: 14px 16px; }

/* ── Notifications compose + preview ── */
.adm-ntf-page { max-width: 1200px; margin: 0 auto; }
.adm-ntf-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.adm-ntf-preview {
  display: flex; gap: 14px; padding: 16px;
  background: var(--surface-2); border-radius: 12px;
}
.adm-ntf-preview .ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0; }
.adm-ntf-preview .info { flex: 1; min-width: 0; }
.adm-ntf-preview .title { font-weight: 800; font-size: 14.5px; line-height: 1.3; }
.adm-ntf-preview .body  { font-size: 12.5px; color: var(--text-2); margin-top: 4px; line-height: 1.5; }
.adm-ntf-preview .meta  { font-size: 11px; color: var(--text-3); margin-top: 6px; }

/* ── Leaderboard podium ── */
.adm-ldb-page { max-width: 1200px; margin: 0 auto; }
.adm-ldb-podium {
  display: flex; justify-content: center; align-items: flex-end; gap: 14px;
  margin-bottom: 22px; padding: 22px 14px 0;
  background: linear-gradient(180deg, transparent, var(--surface-2));
  border-radius: 16px;
}
.adm-ldb-pod { display: flex; flex-direction: column; align-items: center; gap: 6px; flex: 1; max-width: 180px; }
.adm-ldb-pod-name { font-weight: 800; font-size: 13px; text-align: center; margin-top: 6px; }
.adm-ldb-pod-pts  { font-family: var(--font-display); font-weight: 800; font-size: 18px; color: var(--primary); }
.adm-ldb-pod-bar {
  width: 100%; max-width: 110px; border-radius: 10px 10px 0 0;
  display: grid; place-items: center; margin-top: 8px;
  color: #fff; font-family: var(--font-display); font-weight: 800; font-size: 20px;
}

.adm-ldb-rule { display: flex; gap: 10px; align-items: center; }
.adm-ldb-rule .input { flex: 1; }

.adm-ldb-badges { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.adm-ldb-badge { text-align: center; padding: 18px 14px; }
.adm-ldb-badge-ic { width: 60px; height: 60px; border-radius: 16px; margin: 0 auto; display: grid; place-items: center; }

/* ── Monthly report editor + preview ── */
.adm-mr-page { max-width: 1200px; margin: 0 auto; }
.adm-mr-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 16px; align-items: start; }
.adm-mr-preview {
  border: 2px solid var(--border); border-radius: 14px;
  overflow: hidden; background: var(--surface);
}
.adm-mr-letterhead {
  padding: 16px 20px; color: #fff;
  font-family: var(--font-display); font-weight: 800; font-size: 17px; letter-spacing: -0.01em;
}
.adm-mr-body { padding: 20px; }
.adm-mr-grid-kpi { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.adm-mr-grid-kpi > div { padding: 10px 12px; background: var(--surface-2); border-radius: 10px; font-size: 12px; }
.adm-mr-grid-kpi b { font-family: var(--font-display); font-size: 14px; }
.adm-mr-grid-kpi span { color: var(--text-3); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.adm-mr-section { padding-top: 12px; margin-top: 12px; border-top: 1px solid var(--border); }
.adm-mr-section h4 { margin: 0 0 6px; font-size: 13px; font-family: var(--font-display); font-weight: 800; }
.adm-mr-section p  { margin: 0; font-size: 13px; color: var(--text-2); line-height: 1.55; }
.adm-mr-signoff { margin-top: 20px; padding-top: 14px; border-top: 1px dashed var(--border); font-size: 12px; color: var(--text-3); font-style: italic; }

/* ── Responsive ── */
@media (max-width: 980px) {
  .adm-ntf-grid, .adm-mr-grid { grid-template-columns: 1fr; }
  .adm-sch-head, .adm-sch-body { grid-template-columns: 60px repeat(7, minmax(70px, 1fr)); }
  .adm-sch-head, .adm-sch-body { overflow-x: auto; }
}
@media (max-width: 760px) {
  .adm-sch-grid { overflow-x: auto; }
  .adm-sch-head, .adm-sch-body { min-width: 700px; }
  .adm-mr-grid-kpi { grid-template-columns: 1fr; }
  .adm-ldb-pod-bar { max-width: 80px; }
  .adm-ldb-pod-name { font-size: 12px; }
  .adm-ldb-pod-pts { font-size: 15px; }
}
@media (max-width: 480px) {
  .adm-ldb-podium { padding: 16px 6px 0; gap: 6px; }
  .adm-mat-row .info .title { font-size: 13px; }
  .adm-mat-row .info .meta  { font-size: 11px; }
  .adm-ldb-badges { grid-template-columns: 1fr 1fr; }
}

/* ══════════════════════════════════════════════════════════════════════
   Teacher Portal — shared primitives, all fully responsive
   ══════════════════════════════════════════════════════════════════════ */
.tch-page { max-width: 1200px; margin: 0 auto; }

/* Hero */
.tch-hero {
  position: relative; overflow: hidden;
  background: linear-gradient(135deg, #22C55E, #14B8A6 60%, #06B6D4);
  color: #fff; border-radius: 18px;
  padding: 24px 26px; border: 0;
  box-shadow: 0 14px 28px rgba(20,184,166,0.25);
  margin-bottom: 18px;
}
.tch-hero-shape { position: absolute; border-radius: 50%; pointer-events: none; }
.tch-hero-shape.s1 { top: -30px; right: -30px; width: 170px; height: 170px; background: rgba(255,255,255,0.12); }
.tch-hero-shape.s2 { bottom: -50px; right: 80px; width: 120px; height: 120px; background: rgba(255,255,255,0.08); }
.tch-hero-body { position: relative; z-index: 1; }
.tch-hero-date { font-size: 12.5px; opacity: 0.88; font-weight: 600; }
.tch-hero-title { font-family: var(--font-display); font-weight: 800; letter-spacing: -0.02em; margin: 6px 0 4px; font-size: 26px; line-height: 1.2; }
.tch-hero-msg { opacity: 0.92; margin: 0 0 16px; font-size: 13.5px; line-height: 1.55; max-width: 520px; }
.tch-hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.tch-hero-btn { font-weight: 800; font-size: 13px; padding: 8px 16px; border-radius: 10px; cursor: pointer; }
.tch-hero-btn.primary { background: #fff; color: #14B8A6; border: 0; box-shadow: 0 6px 14px rgba(0,0,0,0.15); }
.tch-hero-btn.outline { background: rgba(255,255,255,0.18); color: #fff; border: 1px solid rgba(255,255,255,0.4); }
.tch-hero-btn:hover { transform: translateY(-1px); }

/* KPI stat strip */
.tch-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 18px; }
.tch-stat { display: flex; justify-content: space-between; align-items: flex-start; padding: 14px 16px; }
.tch-stat .l { font-size: 10.5px; color: var(--text-3); font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; }
.tch-stat .v { font-family: var(--font-display); font-size: 26px; font-weight: 800; line-height: 1.1; margin-top: 4px; letter-spacing: -0.02em; }
.tch-stat .d { font-size: 11.5px; font-weight: 700; margin-top: 2px; }
.tch-stat .ic { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; flex-shrink: 0; }

/* Card head row */
.tch-card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.tch-card-head h3 { margin: 0; font-size: 16px; }

/* Row: today's + engagement */
.tch-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; }

/* Today's classes rows */
.tch-today {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 11px;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.tch-today:hover { background: var(--surface-2); }
.tch-today.live { border-left: 3px solid var(--danger); }
.tch-today .time { min-width: 56px; text-align: center; flex-shrink: 0; }
.tch-today .time .hh { font-family: var(--font-display); font-weight: 800; font-size: 15px; color: var(--primary); line-height: 1.1; }
.tch-today .time .ap { font-size: 10px; color: var(--text-3); font-weight: 700; }
.tch-today .info { flex: 1; min-width: 0; }
.tch-today .info .title { font-weight: 700; font-size: 14px; line-height: 1.3; }
.tch-today .info .meta  { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }

/* Engagement card */
.tch-engage-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border);
}
.tch-engage-grid .lbl { font-size: 11px; color: var(--text-3); font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.tch-engage-grid .val { font-family: var(--font-display); font-weight: 800; font-size: 18px; margin-top: 2px; }

/* "This week at a glance" real-data tiles */
.tch-week-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tch-week-tile {
  text-align: left; border: 1px solid var(--border); background: var(--surface-2);
  border-radius: 14px; padding: 14px; cursor: pointer; transition: border-color .15s, transform .15s;
  display: flex; flex-direction: column; gap: 6px;
}
.tch-week-tile:hover { border-color: var(--primary); transform: translateY(-2px); }
.tch-week-tile .ic { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; }
.tch-week-tile .v { font-family: var(--font-display); font-weight: 800; font-size: 22px; line-height: 1; }
.tch-week-tile .l { font-size: 12px; color: var(--text-3); font-weight: 600; }

/* Dashboard wallet summary */
.tch-wallet-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.tch-wallet-tile { border: 1px solid var(--border); background: var(--surface-2); border-radius: 14px; padding: 14px; }
.tch-wallet-tile .ic { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; margin-bottom: 8px; }
.tch-wallet-tile .v { font-family: var(--font-display); font-weight: 800; font-size: 20px; line-height: 1; }
.tch-wallet-tile .l { font-size: 12px; color: var(--text-3); font-weight: 600; margin-top: 4px; }
@media (max-width: 720px) { .tch-wallet-grid { grid-template-columns: 1fr 1fr; } }

/* Shared public teacher profile */
/* `1fr` is `minmax(auto, 1fr)`, so the track floors at the content's
   min-content width and the card overflowed the phone viewport. minmax(0,1fr)
   + min-width:0 lets it actually shrink; overflow-wrap breaks long tokens. */
@media (max-width: 820px) {
  .tpp-grid { grid-template-columns: minmax(0, 1fr) !important; }
  .tpp-grid > * { min-width: 0; }
  .tpp-grid p, .tpp-grid li, .tpp-grid span, .tpp-grid div { overflow-wrap: anywhere; }
}

/* ══════════════════════════════════════════════════════════════════
   Phone fixes — assignments, submit, leaderboard, saved/bookmarks,
   Q&A forum, and the public teacher profile.
   ══════════════════════════════════════════════════════════════════ */

/* Teacher profile: centre the identity block so the avatar stops colliding
   with the banner and the name no longer forces a 220px overflow. */
@media (max-width: 560px) {
  .tpp-head { padding: 0 16px 18px !important; }
  .tpp-idrow { flex-direction: column; align-items: center !important; text-align: center; gap: 10px !important; margin-top: -46px !important; }
  .tpp-av { width: 88px !important; height: 88px !important; }
  .tpp-id { min-width: 0 !important; width: 100%; padding-bottom: 0 !important; }
  .tpp-name { font-size: 20px !important; }
  .tpp-id .chip { font-size: 10.5px; }
  .tpp-idrow > div:last-child { width: 100%; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
  .tpp-kpis { grid-template-columns: repeat(2, 1fr) !important; }
}

@media (max-width: 760px) {
  /* Tab strips scroll instead of squashing (bookmarks, saved questions, Q&A) */
  .tabs {
    display: flex; flex-wrap: nowrap; overflow-x: auto;
    -webkit-overflow-scrolling: touch; scrollbar-width: none;
    gap: 6px; padding-bottom: 2px;
  }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs > * { flex: 0 0 auto; white-space: nowrap; }

  /* Page headers stack, action buttons go full width */
  .page-head { flex-direction: column; align-items: stretch; gap: 10px; }
  .page-head > div:last-child:not(:only-child) { display: flex; flex-wrap: wrap; gap: 8px; }

  /* ── Data tables → stacked rows (assignments, leaderboard, results) ──
     Horizontal scrolling a 6-column table on a phone is unusable; each row
     becomes a card with the column name as an inline label. */
  .table-stack thead { display: none; }
  .table-stack, .table-stack tbody, .table-stack tr, .table-stack td { display: block; width: 100%; }
  .table-stack tr {
    border: 1px solid var(--border); border-radius: 14px;
    padding: 12px 14px; margin-bottom: 10px; background: var(--surface);
  }
  .table-stack td {
    border: none !important; padding: 5px 0 !important;
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    text-align: right;
  }
  .table-stack td::before {
    content: attr(data-label); flex: 0 0 auto;
    font-size: 11px; font-weight: 700; color: var(--text-3);
    text-transform: uppercase; letter-spacing: 0.04em; text-align: left;
  }
  .table-stack td:empty { display: none; }
  .table-stack td .btn { width: auto; }
  /* Cards that wrap a stacked table shouldn't clip or scroll it */
  .card:has(> .table-stack) { padding: 0; overflow: visible; background: transparent; border: 0; box-shadow: none; }
  .card:has(> .table-stack) .table-stack { min-width: 0; }

  /* ── Leaderboard ── */
  .lb-split { grid-template-columns: 1fr !important; gap: 14px !important; }
  .lb-hero { padding: 20px 16px !important; text-align: center; }
  .lb-hero-title { font-size: 22px !important; }
  .lb-hero-sub { font-size: 12.5px !important; }
  /* The generic `[style*="grid-template-columns: 1fr 1fr"]` collapse below also
     matches "1fr 1fr 1fr" and would stack the podium — out-specify it so the
     three winners stay side by side. */
  div.lb-podium[style] { grid-template-columns: repeat(3, 1fr) !important; gap: 6px !important; }
  .lb-podium-name { font-size: 11.5px !important; }
  .lb-podium-score { font-size: 12px !important; }

  /* ── Q&A forum ──
     The card is a [stats | body] row on desktop; on a phone that leaves the
     question ~50% width and it wraps to a sliver. Stack it: the vote/answer
     counts become a compact meta line above the full-width question. */
  .qa-card { flex-direction: column; gap: 10px; }
  .qa-stat { flex-direction: row; align-items: center; justify-content: flex-start; gap: 16px; min-width: 0 !important; width: 100%; padding: 0; }
  .qa-stat-row { flex-direction: row; align-items: baseline; gap: 5px; }
  .qa-stat-num { font-size: 15px !important; }
  .qa-stat-lbl { font-size: 10px !important; }
  .qa-body { width: 100%; }
  .qa-ask-grid { grid-template-columns: 1fr !important; }
  .qa-ask-actions { flex-wrap: wrap; gap: 8px; }
  .qa-ask-actions .btn { flex: 1 1 auto; justify-content: center; }
  .qa-thread { flex-direction: column; gap: 10px; }
  .qa-thread-vote { flex-direction: row; align-items: center; gap: 10px; }
  .qa-meta, .qa-meta-chips { flex-wrap: wrap; gap: 6px; font-size: 11.5px; }
  .qa-title { font-size: 15px; }
  .qa-image-grid, .qa-img-grid { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }

  /* ── Assignment submit: the picker + preview stack ── */
  .asg-submit-grid { grid-template-columns: 1fr !important; }
  .asg-actions { flex-direction: column-reverse; gap: 8px; }
  .asg-actions .btn { width: 100%; justify-content: center; }

  /* Any inline 2-up grid inside a modal collapses on phones */
  .modal .col > div[style*="grid-template-columns"] { grid-template-columns: 1fr !important; }
}

/* Sidebar drawer open → hide the bottom tab bar (it would sit on top of the
   drawer and the scrim, and both compete for the same thumb zone). */
@media (max-width: 760px) {
  .app:has(.sidebar.open) .bottom-nav {
    transform: translateY(130%);
    pointer-events: none;
  }
  .bottom-nav { transition: transform 0.28s var(--tx); }
}

/* To-do queue */
.tch-todos { display: flex; flex-direction: column; gap: 8px; }
.tch-todo {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; border-radius: 11px; background: var(--surface-2);
  transition: background 0.15s ease;
}
.tch-todo:hover { background: color-mix(in oklab, var(--primary-soft) 60%, var(--surface-2)); }
.tch-todo .ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; }
.tch-todo .info { flex: 1; min-width: 0; }
.tch-todo .info .title { font-weight: 700; font-size: 13.5px; line-height: 1.3; }
.tch-todo .info .meta  { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }

/* ── Classes grid ── */
.tch-classes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.tch-class-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.tch-class-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: color-mix(in oklab, var(--primary) 28%, var(--border)); }
.tch-class-thumb {
  position: relative; aspect-ratio: 16 / 9;
  display: grid; place-items: center; overflow: hidden;
}
.tch-class-status { position: absolute; top: 10px; left: 10px; }
.tch-class-duration {
  position: absolute; top: 10px; right: 10px;
  background: rgba(0,0,0,0.45); color: #fff;
  padding: 3px 9px; border-radius: 999px;
  font-size: 10.5px; font-weight: 800;
  display: inline-flex; align-items: center; gap: 4px;
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.tch-class-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.tch-class-title { font-weight: 800; font-size: 14.5px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tch-class-meta { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--text-3); }
.tch-class-actions { display: flex; gap: 6px; align-items: center; margin-top: auto; padding-top: 8px; flex-wrap: wrap; }
.tch-class-actions .btn { flex: 1; justify-content: center; min-width: 0; }

/* ── Upload page ── */
.tch-upload-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.tch-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tch-drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 32px 20px; gap: 8px;
  background: var(--surface-2);
  border: 2px dashed var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
  color: var(--text-2);
}
.tch-drop:hover { border-color: var(--primary); background: color-mix(in oklab, var(--primary-soft) 50%, var(--surface-2)); color: var(--primary); }
.tch-drop-title { font-weight: 700; font-size: 14px; margin-top: 4px; }
.tch-drop-sub   { font-size: 11.5px; color: var(--text-3); }

/* ── Materials list ── */
.tch-mat-list { display: flex; flex-direction: column; gap: 10px; }
.tch-mat { display: flex; align-items: center; gap: 14px; padding: 12px 14px; }
.tch-mat .ic {
  width: 42px; height: 42px; border-radius: 11px;
  background: var(--primary-soft); color: var(--primary);
  display: grid; place-items: center; flex-shrink: 0;
}
.tch-mat .info { flex: 1; min-width: 0; }
.tch-mat .info .title { font-weight: 700; font-size: 14px; }
.tch-mat .info .meta  { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }
.tch-mat .actions { display: flex; gap: 4px; flex-shrink: 0; }

/* ── Attendance ── */
.tch-attend-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.tch-attend-stat { --accent: var(--primary); display: flex; align-items: center; gap: 12px; padding: 14px 16px; }
.tch-attend-stat .ic { width: 38px; height: 38px; border-radius: 11px; background: color-mix(in oklab, var(--accent) 15%, transparent); color: var(--accent); display: grid; place-items: center; flex-shrink: 0; }
.tch-attend-stat .v { font-family: var(--font-display); font-weight: 800; font-size: 22px; color: var(--accent); line-height: 1.1; }
.tch-attend-stat .l { font-size: 11px; color: var(--text-3); font-weight: 700; }
.tch-attend-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--border); flex-wrap: wrap; gap: 8px; }
.tch-attend-list { display: flex; flex-direction: column; }
.tch-attend-row {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.tch-attend-row:last-child { border-bottom: none; }
.tch-attend-row .info { flex: 1; min-width: 0; }
.tch-attend-row .name { font-weight: 700; font-size: 13.5px; }
.tch-attend-row .roll { font-size: 11.5px; color: var(--text-3); font-family: var(--font-mono); }
.tch-attend-row .actions { display: flex; gap: 6px; }
.tch-attend-btn {
  background: var(--surface); border: 1px solid var(--border);
  padding: 6px 12px; border-radius: 8px;
  font-size: 11.5px; font-weight: 700; cursor: pointer;
  color: var(--text-2);
  transition: all 0.15s ease;
}
.tch-attend-btn:hover { border-color: color-mix(in oklab, var(--primary) 36%, var(--border)); }

/* ── Exam grid ── */
.tch-exam-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.tch-exam { display: flex; flex-direction: column; gap: 8px; }
.tch-exam .head { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.tch-exam .title { font-weight: 800; font-size: 14.5px; line-height: 1.3; flex: 1; }
.tch-exam .meta  { font-size: 12px; color: var(--text-3); }
.tch-exam .actions { display: flex; gap: 6px; margin-top: auto; }

/* ── Grading shell ── */
.tch-grading-shell { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 16px; align-items: start; }
.tch-grading-list { max-height: 600px; overflow-y: auto; }
.tch-grading-row {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 14px; border-bottom: 1px solid var(--border);
  background: transparent; border-left: none; border-right: none; border-top: none;
  width: 100%; text-align: left; cursor: pointer;
  font-family: inherit; color: inherit;
}
.tch-grading-row:hover { background: var(--surface-2); }
.tch-grading-row.active { background: var(--primary-soft); }
.tch-grading-row .info { flex: 1; min-width: 0; }
.tch-grading-row .name { font-weight: 700; font-size: 13.5px; }
.tch-grading-row .meta { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }
.tch-grading-row .time { display: inline-flex; align-items: center; gap: 4px; margin-top: 2px; }

/* ── Students toolbar ── */
.tch-students-toolbar { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }

/* ── Q&A shell ── */
.tch-qa-shell { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 16px; align-items: start; }
.tch-qa-list { max-height: 600px; overflow-y: auto; }
.tch-qa-row {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 14px; border-bottom: 1px solid var(--border);
  background: transparent; border-left: none; border-right: none; border-top: none;
  width: 100%; text-align: left; cursor: pointer;
  font-family: inherit; color: inherit;
  position: relative;
}
.tch-qa-row:hover { background: var(--surface-2); }
.tch-qa-row.active { background: var(--primary-soft); }
.tch-qa-row .info { flex: 1; min-width: 0; }
.tch-qa-row .head { display: flex; justify-content: space-between; gap: 8px; }
.tch-qa-row .name { font-weight: 700; font-size: 13px; }
.tch-qa-row .time { font-size: 11px; color: var(--text-3); flex-shrink: 0; }
.tch-qa-row .subject { font-size: 11px; color: var(--text-3); margin: 2px 0 3px; }
.tch-qa-row .preview { font-size: 12.5px; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tch-qa-row .dot { position: absolute; top: 18px; right: 14px; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); }

/* ── Notifications ── */
.tch-notif {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px;
  position: relative;
}
.tch-notif.unread { background: var(--primary-soft); border-color: color-mix(in oklab, var(--primary) 26%, var(--border)); }
.tch-notif .ic { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; flex-shrink: 0; }
.tch-notif .info { flex: 1; min-width: 0; }
.tch-notif .info .t { font-weight: 700; font-size: 14px; line-height: 1.35; }
.tch-notif .info .s { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.tch-notif .meta { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex-shrink: 0; }
.tch-notif .meta .time { font-size: 11px; color: var(--text-3); }
.tch-notif .dot { position: absolute; top: 14px; right: 14px; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); }

/* ── Earnings hero ── */
.tch-earn-hero {
  background: linear-gradient(135deg, #22C55E, #14B8A6);
  color: #fff; border: 0;
  display: flex; justify-content: space-between; align-items: center; gap: 14px;
  padding: 22px 26px; margin-bottom: 16px;
}
.tch-earn-hero .lbl  { font-size: 11.5px; opacity: 0.85; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; }
.tch-earn-hero .amt  { font-family: var(--font-display); font-size: 38px; font-weight: 800; line-height: 1; letter-spacing: -0.02em; margin-top: 4px; }
.tch-earn-hero .sub  { font-size: 12.5px; opacity: 0.88; margin-top: 6px; }
.tch-earn-hero .ic   { width: 64px; height: 64px; border-radius: 18px; background: rgba(255,255,255,0.18); display: grid; place-items: center; flex-shrink: 0; }

/* ══════════════════════════════════════════════════════════════════════
   Admin Portal — Assignments management
   ══════════════════════════════════════════════════════════════════════ */
.adm-asg-page { max-width: 1200px; margin: 0 auto; }
.adm-asg-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 18px; }
.adm-asg-stat { display: flex; align-items: center; gap: 12px; padding: 14px 16px; }
.adm-asg-stat .ic { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex-shrink: 0; }
.adm-asg-stat .v  { font-family: var(--font-display); font-weight: 800; font-size: 24px; line-height: 1.1; }
.adm-asg-stat .l  { font-size: 11.5px; color: var(--text-3); font-weight: 700; }

.adm-asg-toolbar { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }

.adm-asg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.adm-asg-card { display: flex; flex-direction: column; gap: 10px; }
.adm-asg-card-head { display: flex; gap: 12px; align-items: flex-start; }
.adm-asg-card-icon { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; flex-shrink: 0; }
.adm-asg-card-title { font-weight: 800; font-size: 14.5px; line-height: 1.3; }
.adm-asg-card-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 5px; }
.adm-asg-card-meta .chip { font-size: 10.5px; padding: 2px 9px; }
.adm-asg-card-desc {
  font-size: 12.5px; color: var(--text-2); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.adm-asg-card-stats {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  background: var(--surface-2); border-radius: 10px; padding: 10px 12px;
  font-size: 11.5px;
}
.adm-asg-card-stats > div { display: flex; justify-content: space-between; align-items: center; }
.adm-asg-card-stats span { color: var(--text-3); font-weight: 700; }
.adm-asg-card-stats b   { font-family: var(--font-display); font-size: 13px; }
.adm-asg-card-actions { display: flex; gap: 6px; margin-top: auto; flex-wrap: wrap; }
.adm-asg-card-actions .btn { flex: 1; justify-content: center; min-width: 0; }

.adm-asg-form-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.adm-asg-form-row  { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.adm-asg-preview {
  background: var(--surface-2); border-radius: 12px; padding: 16px;
}
.adm-asg-preview .title { font-weight: 800; font-size: 16px; margin-bottom: 8px; }
.adm-asg-preview .meta  { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.adm-asg-preview .desc  { font-size: 13px; color: var(--text-2); line-height: 1.6; }
.adm-asg-preview .bullets { margin: 10px 0 0; padding-left: 18px; color: var(--text-2); font-size: 12.5px; line-height: 1.6; }
.adm-asg-preview .meta-foot { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--text-3); }

@media (max-width: 980px) {
  .adm-asg-form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .adm-asg-form-row  { grid-template-columns: 1fr; }
  .adm-asg-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .adm-asg-card-stats { font-size: 11px; padding: 9px 10px; }
  .adm-asg-card-actions { gap: 4px; }
  .adm-asg-card-actions .btn { font-size: 11.5px; padding: 6px 8px; }
}
@media (max-width: 480px) {
  .adm-asg-stats { grid-template-columns: 1fr 1fr; }
  .adm-asg-stat .v { font-size: 20px; }
}

/* ══════════════════════════════════════════════════════════════════════
   Teacher Portal — Responsive
   ══════════════════════════════════════════════════════════════════════ */
@media (max-width: 980px) {
  .tch-row { grid-template-columns: 1fr; }
  .tch-upload-grid { grid-template-columns: 1fr; }
  .tch-grading-shell, .tch-qa-shell { grid-template-columns: 1fr; }
  .tch-grading-list, .tch-qa-list { max-height: 320px; }
  .tch-attend-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .tch-hero { padding: 18px 18px; border-radius: 14px; }
  .tch-hero-title { font-size: 22px; }
  .tch-hero-msg { font-size: 12.5px; }
  .tch-hero-shape.s1 { width: 130px; height: 130px; top: -20px; right: -20px; }
  .tch-hero-shape.s2 { width: 90px; height: 90px; bottom: -30px; right: 40px; }
  .tch-stats { grid-template-columns: 1fr 1fr; }
  .tch-stat { padding: 12px 14px; }
  .tch-stat .v { font-size: 22px; }

  .tch-today { padding: 11px 12px; gap: 10px; flex-wrap: wrap; }
  .tch-today .info .title { font-size: 13px; }

  .tch-classes-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .tch-exam-grid    { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .adm-asg-grid     { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .tch-class-body { padding: 11px 12px; gap: 4px; }
  .tch-class-title { font-size: 13px; }
  .tch-class-meta { font-size: 11px; }
  .tch-class-actions .btn { font-size: 11.5px; padding: 6px 10px; }

  .tch-form-grid { grid-template-columns: 1fr; }
  .tch-mat-list .tch-mat { padding: 10px 12px; gap: 10px; }
  .tch-mat .ic { width: 36px; height: 36px; }
  .tch-mat .info .title { font-size: 13.5px; }
  .tch-mat .actions { gap: 2px; }

  .tch-attend-row { padding: 11px 12px; gap: 10px; flex-wrap: wrap; }
  .tch-attend-row .actions { width: 100%; }
  .tch-attend-row .actions .tch-attend-btn { flex: 1; }
  .tch-attend-btn { padding: 7px 10px; font-size: 11px; }

  .tch-earn-hero { padding: 18px 20px; }
  .tch-earn-hero .amt { font-size: 30px; }
  .tch-earn-hero .ic { width: 52px; height: 52px; }

  .tch-notif { padding: 12px 14px; gap: 10px; }
  .tch-notif .info .t { font-size: 13px; }
  .tch-notif .meta .btn { padding: 5px 9px; font-size: 11px; }
}
@media (max-width: 480px) {
  .tch-hero-title { font-size: 19px; }
  .tch-hero-actions { flex-direction: column; align-items: stretch; }
  .tch-hero-btn { width: 100%; justify-content: center; }
  .tch-stats { grid-template-columns: 1fr 1fr; }
  .tch-classes-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tch-attend-stats { grid-template-columns: 1fr 1fr; }
  .tch-attend-stat { padding: 11px 12px; }
  .tch-attend-stat .v { font-size: 18px; }
  .tch-engage-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .tch-engage-grid .val { font-size: 16px; }
  .tch-todo { padding: 10px 12px; gap: 10px; }
  .tch-todo .info .title { font-size: 12.5px; }
  .tch-earn-hero .amt { font-size: 26px; }
}

/* ── Guardian exam-report stat grid (View → exam detail) ──────────── */
.guardian-exam-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
}
@media (max-width: 760px) {
  /* On phone the exam-report tabs drop to their own row, full-width */
  .guardian-exam-report .page-head { flex-wrap: wrap; }
  .guardian-exam-report .page-head > :first-child { flex: 1 1 100%; min-width: 0; }
  .guardian-exam-report .page-head > .tabs { width: 100%; align-self: stretch; }
  .guardian-exam-report .page-head .tab  { flex: 1; text-align: center; padding: 8px 10px; }
}
@media (max-width: 480px) {
  .guardian-exam-stats { grid-template-columns: 1fr 1fr; }
}

/* ── Guardian portal — final mobile polish ────────────────────────── */
@media (max-width: 760px) {
  /* Header buttons in Attendance / Results / Monthly should wrap below the title nicely */
  .guardian-page .page-head .row { flex-wrap: wrap; }
  .guardian-page .page-head .row .btn { flex: 1; justify-content: center; min-width: 0; }

  /* Child switcher: each pill takes a full row on tiny screens so long names fit */
  .guardian-children { gap: 8px; margin-bottom: 14px; }
  .guardian-child-pill { flex: 1 1 calc(50% - 4px); min-width: 0; }

  /* Summary card: shrink padding so the donut + total pill fit cleanly */
  .guardian-summary { padding: 18px 14px; }
  .guardian-summary-title { font-size: 18px; margin-top: 12px; }
  .guardian-summary-total { padding: 6px 12px; margin-top: 8px; }
  .guardian-summary-total .num { font-size: 19px; }

  /* Fee cards — compact on phone but keep gradient drama */
  .guardian-fee-card    { padding: 16px; }
  .guardian-fee-meta    { font-size: 12.5px; margin-top: 10px; }
  .guardian-fee-amount  { font-size: 26px; }

  /* Banners on overview stack vertically with compact padding */
  .guardian-banner { padding: 16px; }
  .guardian-banner .msg { font-size: 12.5px; }

  /* Calendar legend wraps tightly */
  .guardian-cal-legend { gap: 12px; }
}
@media (max-width: 480px) {
  /* Child switcher pills go full-width single column on tiny phones */
  .guardian-child-pill { flex: 1 1 100%; }
  .guardian-child-add  { flex: 1 1 100%; min-width: 0; }

  /* Header back/next pair buttons sit side-by-side at half each */
  .guardian-page .page-head .row .btn { font-size: 11.5px; padding: 6px 10px; }

  /* Stat blocks — tighter padding so 2 cards per row fit on a 320px screen */
  .guardian-stat   { padding: 11px 12px; gap: 10px; }
  .guardian-stat .v { font-size: 18px; }
  .guardian-stat .ic { width: 34px; height: 34px; border-radius: 9px; }

  .guardian-attend-stat { padding: 11px 12px; gap: 10px; }
  .guardian-attend-stat .v { font-size: 18px; }
  .guardian-attend-stat .ic { width: 34px; height: 34px; }

  /* Hero msg can wrap on two lines maximum */
  .guardian-hero-msg { font-size: 12.5px; }
  .guardian-hero-title { font-size: 18px; }

  /* Report letterhead even tighter on tiny phones */
  .guardian-report { padding: 18px 14px; }
  .guardian-report-head .brand { font-size: 19px; }
  .guardian-report-kpi .v { font-size: 20px; }

  /* Fee gradient cards tighter */
  .guardian-fee-amount { font-size: 22px; }
  .guardian-fee-btn { padding: 10px 14px; font-size: 12.5px; }

  /* Messages bubble takes most of the width */
  .guardian-msg-thread-head .name { font-size: 13.5px; }
}

/* ── Schedule page (weekly grid + mobile day-list) ────────────────── */
.schedule { max-width: 1280px; margin: 0 auto; }

/* Stat tiles */
.schedule-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.schedule-stat {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  min-width: 0;
}
.schedule-stat-icon {
  width: 42px; height: 42px; border-radius: 12px;
  display: grid; place-items: center; flex-shrink: 0;
}
.schedule-stat-v {
  font-family: var(--font-display);
  font-size: 22px; font-weight: 800; line-height: 1.1;
}
.schedule-stat-l { font-size: 12px; color: var(--text-3); margin-top: 2px; font-weight: 600; }

/* ── Desktop weekly grid ── */
.schedule-grid { overflow: hidden; display: block; }
.schedule-grid-head {
  display: grid; grid-template-columns: 60px repeat(7, minmax(0, 1fr));
  border-bottom: 1px solid var(--border);
}
.schedule-grid-day {
  padding: 14px 8px; text-align: center; font-weight: 700; font-size: 12.5px;
  color: var(--text-2);
  border-right: 1px solid var(--border);
}
.schedule-grid-day:last-child { border-right: none; }
.schedule-grid-day .d-short { font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; }
.schedule-grid-day .d-num   { font-size: 19px; font-weight: 800; font-family: var(--font-display); margin-top: 2px; }
.schedule-grid-day.today    { background: var(--primary-soft); color: var(--primary); }
.schedule-grid-body {
  display: grid; grid-template-columns: 60px repeat(7, minmax(0, 1fr));
  min-height: 480px;
}
.schedule-grid-times {
  border-right: 1px solid var(--border);
  padding-top: 8px;
}
.schedule-grid-time { height: 80px; font-size: 11px; color: var(--text-3); font-weight: 600; padding-left: 8px; }
.schedule-grid-col {
  position: relative;
  border-right: 1px solid var(--border);
  padding: 6px;
  min-width: 0;
}
.schedule-grid-col:last-child { border-right: none; }
.schedule-grid-col.today { background: color-mix(in oklab, var(--primary) 4%, transparent); }

.schedule-slot {
  position: absolute; left: 6px; right: 6px;
  padding: 8px 10px;
  border: none;
  border-left: 3px solid currentColor;
  border-radius: 8px;
  text-align: left;
  cursor: pointer;
  display: flex; flex-direction: column; gap: 1px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  overflow: hidden;
  font-family: inherit;
}
.schedule-slot:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.schedule-slot-time  { font-size: 11.5px; font-weight: 800; }
.schedule-slot-subj  { font-size: 12px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.schedule-slot-topic { font-size: 10.5px; color: var(--text-2); line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ── Mobile day list (hidden on desktop, shown on phone) ── */
.schedule-list { display: none; flex-direction: column; gap: 16px; }
.schedule-day {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}
.schedule-day.today { border-color: color-mix(in oklab, var(--primary) 36%, var(--border)); box-shadow: 0 8px 22px color-mix(in oklab, var(--primary) 12%, transparent); }
.schedule-day-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 14px; gap: 10px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.schedule-day.today .schedule-day-head { background: var(--primary-soft); }
.schedule-day-date { display: flex; align-items: center; gap: 10px; }
.schedule-day-date .d-num  { font-family: var(--font-display); font-size: 22px; font-weight: 800; color: var(--text); line-height: 1; }
.schedule-day.today .schedule-day-date .d-num { color: var(--primary); }
.schedule-day-date .d-name { font-size: 13px; font-weight: 700; color: var(--text-2); }
.schedule-day.today .schedule-day-date .d-name { color: var(--primary); }
.schedule-day-count {
  font-size: 11px; font-weight: 800;
  padding: 4px 9px; border-radius: 999px;
  background: var(--surface); color: var(--text-3);
}
.schedule-day.today .schedule-day-count { background: var(--surface); color: var(--primary); }
.schedule-day-empty { padding: 18px; text-align: center; color: var(--text-3); font-size: 13px; }
.schedule-day-slots { display: flex; flex-direction: column; }

.schedule-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; width: 100%;
  background: transparent; border: none; border-bottom: 1px solid var(--border);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s ease;
}
.schedule-row:last-child { border-bottom: none; }
.schedule-row:hover, .schedule-row:active { background: var(--surface-2); }
.schedule-row-time {
  width: 54px; flex-shrink: 0;
  display: flex; flex-direction: column;
  text-align: center;
}
.schedule-row-time .t { font-family: var(--font-display); font-size: 15px; font-weight: 800; line-height: 1.1; color: var(--primary); }
.schedule-row-time .d { font-size: 10px; color: var(--text-3); font-weight: 700; margin-top: 2px; }
.schedule-row-stripe { width: 3px; align-self: stretch; border-radius: 2px; flex-shrink: 0; }
.schedule-row-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.schedule-row-chip {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  font-size: 10px; font-weight: 800; letter-spacing: 0.04em;
  align-self: flex-start;
  text-transform: uppercase;
}
.schedule-row-topic { font-size: 13.5px; font-weight: 700; line-height: 1.3; word-break: break-word; }
.schedule-row-teacher {
  display: flex; align-items: center; gap: 4px;
  font-size: 11.5px; color: var(--text-3);
}
.schedule-row-teacher svg { flex-shrink: 0; }
.schedule-row-play {
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  flex-shrink: 0;
  box-shadow: 0 6px 14px rgba(0,0,0,0.15);
  transition: transform 0.15s ease;
}
.schedule-row:hover .schedule-row-play, .schedule-row:active .schedule-row-play { transform: scale(1.1); }

/* Breakpoint swap: weekly grid → mobile day list */
@media (max-width: 880px) {
  .schedule-grid { display: none; }
  .schedule-list { display: flex; }
  .schedule-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
  .schedule-stat { padding: 12px 14px; gap: 10px; }
  .schedule-stat-icon { width: 36px; height: 36px; border-radius: 10px; }
  .schedule-stat-v { font-size: 18px; }
  .schedule-stat-l { font-size: 11px; }
}
@media (max-width: 480px) {
  .schedule-stats { grid-template-columns: 1fr 1fr; }
  .schedule-day-head { padding: 10px 12px; }
  .schedule-day-date .d-num { font-size: 19px; }
  .schedule-day-date .d-name { font-size: 12px; }
  .schedule-row { padding: 10px 12px; gap: 10px; }
  .schedule-row-time { width: 46px; }
  .schedule-row-time .t { font-size: 13px; }
  .schedule-row-topic { font-size: 12.5px; }
  .schedule-row-teacher { font-size: 11px; }
  .schedule-row-play { width: 30px; height: 30px; }
}

/* ── Course Catalog (StudentAddCourse) — fully responsive cards ───── */
.catalog-grid {
  display: grid;
  /* Cards size to their content (no vertical stretch → no dead gap at the
     bottom of shorter cards). */
  align-items: start;
  /* Exactly 3 columns on desktop/laptop (was auto-fill → 4+). Drops to 2 on
     tablet and 1 on phones via the media queries below. */
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.catalog-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.18s cubic-bezier(.34,1.2,.64,1), box-shadow 0.18s ease, border-color 0.18s ease;
  -webkit-tap-highlight-color: transparent;
}
.catalog-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 36px color-mix(in oklab, var(--primary) 18%, transparent);
  border-color: color-mix(in oklab, var(--primary) 28%, var(--border));
}
.catalog-thumb {
  position: relative; aspect-ratio: 16 / 9;
  overflow: hidden; cursor: pointer;
}
.catalog-thumb img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.45s ease;
}
.catalog-card:hover .catalog-thumb img { transform: scale(1.06); }
.catalog-thumb-fade {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.08), rgba(0,0,0,0.02) 40%, rgba(0,0,0,0.22));
}
.catalog-badges {
  position: absolute; top: 10px; right: 10px;
  display: flex; flex-direction: column; gap: 6px; align-items: flex-end;
}
.catalog-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 999px;
  font-size: 10px; font-weight: 800; letter-spacing: 0.04em;
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.catalog-badge-tag { background: #FCD34D; color: #92400E; }
.catalog-badge-class {
  background: rgba(255,255,255,0.92); color: var(--primary);
}

.catalog-body {
  flex: 1; min-width: 0;
  padding: 14px 16px 16px;
  display: flex; flex-direction: column;
  gap: 5px;
}
.catalog-subject {
  font-size: 11px; font-weight: 800; color: var(--primary);
  text-transform: uppercase; letter-spacing: 0.05em;
}
.catalog-title {
  font-weight: 800; font-size: 15.5px; line-height: 1.3;
  cursor: pointer;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  word-break: break-word;
  margin: 1px 0 1px;
  transition: color 0.15s ease;
}
.catalog-card:hover .catalog-title { color: var(--primary); }
.catalog-teacher {
  display: flex; align-items: center; gap: 5px;
  font-size: 12px; color: var(--text-3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.catalog-teacher svg { flex-shrink: 0; color: var(--text-2); }
.catalog-desc {
  font-size: 12px; color: var(--text-2); line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  margin-top: 4px;
}

.catalog-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-top: auto; padding-top: 12px;
  flex-wrap: wrap;
}
.catalog-price { flex: 1; min-width: 0; }
.catalog-price-row {
  display: flex; align-items: baseline; gap: 6px; flex-wrap: nowrap;
  min-width: 0;
}
.catalog-price-current {
  font-family: var(--font-display);
  font-size: 20px; font-weight: 800; color: var(--primary);
  line-height: 1; white-space: nowrap;
}
.catalog-price-per { font-size: 11px; font-weight: 600; color: var(--text-3); margin-left: 2px; }
.catalog-price-original {
  font-size: 12.5px; color: var(--text-3); text-decoration: line-through; font-weight: 600;
  white-space: nowrap;
}
.catalog-price-pct {
  background: var(--success-soft); color: var(--success);
  padding: 2px 6px; border-radius: 5px;
  font-size: 9.5px; font-weight: 800; letter-spacing: 0.03em;
  white-space: nowrap;
}
.catalog-actions { display: flex; gap: 6px; flex-shrink: 0; }
.catalog-actions .btn { font-size: 11.5px; padding: 6px 10px; }

/* ── Responsive ── */
@media (max-width: 980px) {
  .catalog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
}
@media (max-width: 640px) {
  .catalog-grid { grid-template-columns: 1fr; gap: 12px; }
  .catalog-card { border-radius: 12px; }
  .catalog-body { padding: 10px 12px 12px; gap: 4px; }
  .catalog-subject { font-size: 10px; }
  .catalog-title { font-size: 13px; -webkit-line-clamp: 2; }
  .catalog-teacher { font-size: 11px; }
  .catalog-desc { display: none; }
  .catalog-price-current { font-size: 16px; }
  .catalog-price-original { font-size: 11px; }
  .catalog-price-pct { font-size: 9px; padding: 2px 5px; }
  .catalog-foot { gap: 6px; padding-top: 8px; flex-direction: column; align-items: stretch; }
  .catalog-actions { width: 100%; }
  .catalog-actions .btn { flex: 1; justify-content: center; font-size: 11px; padding: 6px 8px; }
  .catalog-badge { font-size: 9px; padding: 2px 7px; }
}
@media (max-width: 380px) {
  .catalog-body { padding: 9px 10px 10px; }
  .catalog-title { font-size: 12.5px; }
  .catalog-actions .btn { font-size: 10.5px; padding: 5px 6px; }
}

/* ── My Courses page (fully responsive) ────────────────────────────── */
/* KPI strip — hidden on phones (≤ 760 px) per design */
.my-courses-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}
.my-courses-kpi {
  padding: 20px 24px;
  display: flex; align-items: center; gap: 16px;
}
.my-courses-kpi-icon {
  width: 44px; height: 44px; border-radius: 12px;
  display: grid; place-items: center; flex-shrink: 0;
}
.my-courses-kpi-val { font-size: 22px; font-weight: 800; line-height: 1.1; color: var(--text); }
.my-courses-kpi-lbl { font-size: 13px; color: var(--text-3); margin-top: 2px; font-weight: 500; }
@media (max-width: 760px) {
  .my-courses-kpis { display: none; }
}


.my-courses-grid {
  display: grid;
  /* 3 across on desktop (was auto-fill → 4+); 2 on tablet, 1 on phone below. */
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 4px;
}
.my-course-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.18s cubic-bezier(.34,1.2,.64,1), box-shadow 0.18s ease, border-color 0.18s ease;
  -webkit-tap-highlight-color: transparent;
}
.my-course-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 36px color-mix(in oklab, var(--primary) 18%, transparent);
  border-color: color-mix(in oklab, var(--primary) 30%, var(--border));
}
.my-course-thumb { position: relative; aspect-ratio: 16 / 9; overflow: hidden; }
.my-course-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 0.45s ease; }
.my-course-card:hover .my-course-thumb img { transform: scale(1.06); }
.my-course-thumb-fade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0.10), rgba(0,0,0,0.05) 40%, rgba(0,0,0,0.45)); }
.my-course-subject {
  position: absolute; top: 10px; left: 10px;
  background: rgba(255,255,255,0.92); color: var(--primary);
  padding: 3px 10px; border-radius: 999px;
  font-size: 10.5px; font-weight: 800; letter-spacing: 0.04em;
  text-transform: uppercase;
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.my-course-progress-pill {
  position: absolute; bottom: 10px; left: 10px;
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: 999px;
  background: rgba(15,23,42,0.65); color: #fff;
  font-size: 11px; font-weight: 800;
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.my-course-body {
  padding: 14px 16px 16px;
  display: flex; flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.my-course-title {
  font-weight: 800; font-size: 15px; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  word-break: break-word;
}
.my-course-teacher {
  font-size: 12px; color: var(--text-3);
  display: flex; align-items: center; gap: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.my-course-teacher svg { flex-shrink: 0; }
.my-course-progress { margin-top: 4px; }
.my-course-progress-head {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 11.5px; color: var(--text-3); font-weight: 600;
  margin-bottom: 6px;
}
.my-course-progress-head strong { color: var(--primary); font-weight: 800; font-size: 12.5px; }
.my-course-progress-bar {
  height: 6px; background: var(--surface-2); border-radius: 999px; overflow: hidden;
}
.my-course-progress-fill {
  height: 100%; background: linear-gradient(90deg, var(--primary), #8B5CF6);
  border-radius: 999px; transition: width 0.6s var(--tx);
}
.my-course-actions {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 8px; margin-top: 6px;
}
.my-course-actions .btn { justify-content: center; }

/* "Enrol in another course" placeholder card */
.my-course-add {
  border: 2px dashed var(--border);
  border-radius: 14px;
  background: transparent;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; color: var(--text-3);
  cursor: pointer;
  padding: 18px;
  min-height: 220px;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.my-course-add:hover {
  border-color: var(--primary);
  background: color-mix(in oklab, var(--primary-soft) 60%, transparent);
  color: var(--primary);
}
.my-course-add-icon {
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--surface-2); color: inherit;
  display: grid; place-items: center;
  transition: background 0.15s ease;
}
.my-course-add:hover .my-course-add-icon { background: var(--primary-soft); }
.my-course-add-label { font-weight: 600; font-size: 13.5px; }

/* Responsive — keep card shape identical, only column count changes */
@media (max-width: 980px) {
  .my-courses-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
}
@media (max-width: 560px) {
  .my-courses-grid { grid-template-columns: 1fr; gap: 12px; }
  .my-course-card { border-radius: 12px; }
  .my-course-body { padding: 11px 12px 13px; gap: 7px; }
  .my-course-title { font-size: 13.5px; }
  .my-course-teacher { font-size: 11.5px; }
  .my-course-subject { font-size: 9.5px; padding: 2px 8px; top: 8px; left: 8px; }
  .my-course-progress-pill { font-size: 10px; padding: 3px 8px; bottom: 8px; left: 8px; }
  .my-course-progress-head { font-size: 10.5px; margin-bottom: 4px; }
  .my-course-progress-head strong { font-size: 11.5px; }
  .my-course-progress-bar { height: 5px; }
  .my-course-actions { gap: 6px; margin-top: 4px; }
  .my-course-actions .btn { font-size: 11.5px; padding: 7px 8px; }
  .my-course-add { min-height: 180px; padding: 16px; }
  .my-course-add-icon { width: 40px; height: 40px; }
  .my-course-add-label { font-size: 12.5px; }
}
@media (max-width: 380px) {
  .my-courses-grid { gap: 10px; }
  .my-course-body { padding: 10px 11px 12px; gap: 6px; }
  .my-course-title { font-size: 13px; -webkit-line-clamp: 2; }
  .my-course-actions { grid-template-columns: 1fr; gap: 5px; }
  .my-course-actions .btn { font-size: 11.5px; padding: 7px 8px; }
}

/* ══════════════════════════════════════════════════════════════════════
   Student Dashboard — premium soft-glassmorphism design system
   ══════════════════════════════════════════════════════════════════════ */
.dash-flow {
  --dsh-radius: 24px;
  --dsh-radius-sm: 18px;
  --dsh-border: rgba(120, 120, 255, 0.10);
  --dsh-shadow: 0 10px 35px rgba(90, 90, 180, 0.08);
  --dsh-shadow-lg: 0 18px 46px rgba(90, 90, 180, 0.16);
  display: flex; flex-direction: column; gap: 28px;
}
:root[data-theme="dark"] .dash-flow {
  --dsh-border: rgba(150, 150, 255, 0.14);
  --dsh-shadow: 0 10px 35px rgba(0, 0, 0, 0.34);
  --dsh-shadow-lg: 0 18px 46px rgba(0, 0, 0, 0.5);
}
/* Every panel on the dashboard inherits the soft-glass card treatment */
.dash-flow .card,
.dash-flow .dash-quick-row,
.dash-flow .dash-hl,
.dash-flow .dash-reco-card {
  border-radius: var(--dsh-radius);
  border: 1px solid var(--dsh-border);
  box-shadow: var(--dsh-shadow);
}
.dash-flow .card { background: linear-gradient(180deg, #FFFFFF 0%, #FDFDFF 100%); }
:root[data-theme="dark"] .dash-flow .card { background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%); }

/* Section entrance — one gentle fade-up, staggered */
.dash-flow > * { animation: dsh-rise 0.5s var(--tx) both; }
.dash-flow > *:nth-child(1) { animation-delay: 0.02s; }
.dash-flow > *:nth-child(2) { animation-delay: 0.06s; }
.dash-flow > *:nth-child(3) { animation-delay: 0.10s; }
.dash-flow > *:nth-child(4) { animation-delay: 0.14s; }
.dash-flow > *:nth-child(5) { animation-delay: 0.18s; }
.dash-flow > *:nth-child(6) { animation-delay: 0.22s; }
@keyframes dsh-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ── Hero banner ─────────────────────────────────────────────────── */
.dash-cl-card {
  position: relative; overflow: hidden; border-radius: var(--dsh-radius);
  background: linear-gradient(118deg, #EAF1FF 0%, #E3EBFF 55%, #EDEBFF 100%);
  color: #17233F; padding: 34px 32px; border: 1px solid var(--dsh-border);
  box-shadow: var(--dsh-shadow); display: block; min-height: 216px;
}
:root[data-theme="dark"] .dash-cl-card {
  background: linear-gradient(118deg, #1B2542 0%, #202A52 55%, #262A57 100%);
  color: #EAEEFF;
}
.dash-cl-shape { position: absolute; border-radius: 50%; pointer-events: none; }
.dash-cl-shape.s1 { top: -70px; right: -50px; width: 250px; height: 250px; background: rgba(255,255,255,0.55); }
.dash-cl-shape.s2 { bottom: -90px; left: 42%; width: 190px; height: 190px; background: rgba(255,255,255,0.34); }
:root[data-theme="dark"] .dash-cl-shape.s1 { background: rgba(255,255,255,0.05); }
:root[data-theme="dark"] .dash-cl-shape.s2 { background: rgba(255,255,255,0.035); }
.dash-cl-body { position: relative; z-index: 1; min-width: 0; max-width: 66%; }
.dash-cl-pill {
  display: inline-flex; align-items: center; gap: 7px;
  background: #fff; color: var(--primary-2); box-shadow: 0 3px 10px rgba(37,99,235,0.16);
  padding: 8px 15px; border-radius: 999px; font-size: 12.5px; font-weight: 700;
}
:root[data-theme="dark"] .dash-cl-pill { background: rgba(255,255,255,0.12); color: #BFDBFE; }
.dash-cl-title { font-family: var(--font-display); font-weight: 800; font-size: 27px; line-height: 1.26; margin: 18px 0 6px; letter-spacing: -0.02em; }
.dash-cl-sub { font-size: 14.5px; color: #5A6688; margin: 0 0 22px; line-height: 1.5; }
:root[data-theme="dark"] .dash-cl-sub { color: #A6B4DE; }
.dash-cl-progress { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; }
.dash-cl-progress-bar { flex: 1; min-width: 0; height: 10px; border-radius: 999px; background: rgba(37,99,235,0.13); overflow: hidden; }
:root[data-theme="dark"] .dash-cl-progress-bar { background: rgba(255,255,255,0.14); }
.dash-cl-progress-fill {
  height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), var(--primary-2));
  transition: width 1s cubic-bezier(0.22, 1, 0.36, 1);
  animation: dsh-grow 1s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes dsh-grow { from { transform: scaleX(0); transform-origin: left; } to { transform: none; } }
.dash-cl-progress-pct { font-size: 13px; font-weight: 700; white-space: nowrap; color: #5A6688; }
:root[data-theme="dark"] .dash-cl-progress-pct { color: #A6B4DE; }
.dash-cl-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.dash-cl-actions .btn { border-radius: 14px; padding: 12px 20px; }
.dash-cl-actions .btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff;
  border-color: transparent; font-weight: 700;
  box-shadow: 0 8px 20px rgba(37,99,235,0.34);
}
.dash-cl-actions .btn-primary:hover { filter: brightness(1.07); box-shadow: 0 10px 26px rgba(37,99,235,0.42); }
.dash-cl-actions .btn-outline {
  background: #fff; border-color: rgba(59,130,246,0.18); color: #17233F;
  font-weight: 700; box-shadow: 0 4px 14px rgba(37,99,235,0.10);
}
.dash-cl-actions .btn-outline:hover { background: #FAFAFF; }
:root[data-theme="dark"] .dash-cl-actions .btn-outline { background: rgba(255,255,255,0.08); border-color: rgba(150,150,255,0.2); color: #EDEBFF; }
/* Illustration — large, sits above the wash but behind the copy */
.dash-cl-art {
  position: absolute; right: 10px; bottom: 6px; z-index: 0;
  width: 44%; max-width: 340px; min-width: 150px; pointer-events: none;
  opacity: 0.62; filter: drop-shadow(0 12px 26px rgba(90,90,180,0.18));
}
:root[data-theme="dark"] .dash-cl-art { opacity: 0.5; }
.dash-cl-art svg { width: 100%; height: auto; display: block; }
.dash-cl-empty { text-align: center; padding: 52px 24px; }

/* ── Statistics ──────────────────────────────────────────────────── */
.dash-stat-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 12px 4px; }
.dash-stat-cell { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 16px 12px; text-align: center; position: relative; }
.dash-stat-cell + .dash-stat-cell::before { content: ''; position: absolute; left: 0; top: 16%; bottom: 16%; width: 1px; background: var(--dsh-border); }
.dash-stat-ic { width: 50px; height: 50px; border-radius: 16px; display: grid; place-items: center; flex-shrink: 0; transition: transform 0.25s var(--tx); }
.dash-stat-cell:hover .dash-stat-ic { transform: translateY(-2px) scale(1.05); }
.dash-stat-v { font-family: var(--font-display); font-weight: 800; font-size: 24px; line-height: 1.05; letter-spacing: -0.02em; }
.dash-stat-l { font-size: 11.5px; color: var(--text-2); font-weight: 600; line-height: 1.35; }

/* ── Quick actions ───────────────────────────────────────────────── */
.dash-quick-row {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  background: linear-gradient(180deg, #F6F5FF 0%, #F1F3FF 100%);
  padding: 14px 10px;
}
:root[data-theme="dark"] .dash-quick-row { background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%); }
.dash-quick-cell {
  display: flex; flex-direction: column; align-items: center; gap: 11px;
  padding: 14px 8px; border: 0; background: transparent; cursor: pointer;
  border-radius: var(--dsh-radius-sm); text-align: center;
  transition: background 0.2s var(--tx), transform 0.15s var(--tx);
}
.dash-quick-cell:hover { background: rgba(255,255,255,0.8); }
:root[data-theme="dark"] .dash-quick-cell:hover { background: rgba(255,255,255,0.06); }
.dash-quick-cell:active { transform: scale(0.96); }
.dash-quick-ic { width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center; transition: transform 0.25s var(--tx), box-shadow 0.25s var(--tx); }
.dash-quick-cell:hover .dash-quick-ic { transform: translateY(-3px); box-shadow: 0 8px 18px rgba(90,90,180,0.16); }
.dash-quick-label { font-size: 13px; font-weight: 700; color: var(--text); }

/* ── Live class / Pending assignment ─────────────────────────────── */
.dash-highlight-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.dash-hl { padding: 22px; display: flex; flex-direction: column; transition: transform 0.2s var(--tx), box-shadow 0.2s var(--tx); }
.dash-hl:hover { transform: translateY(-3px); box-shadow: var(--dsh-shadow-lg); }
.dash-hl-live { background: linear-gradient(150deg, #FFF0F8 0%, #FBEEFF 55%, #F4EEFF 100%); }
.dash-hl-due  { background: linear-gradient(150deg, #FFF9E8 0%, #FFF6DC 100%); border-color: rgba(245,158,11,0.24) !important; }
:root[data-theme="dark"] .dash-hl-live { background: linear-gradient(150deg, #3A1F3C 0%, #331E43 55%, #2A2150 100%); }
:root[data-theme="dark"] .dash-hl-due  { background: linear-gradient(150deg, #35290F 0%, #2E2410 100%); }
.dash-hl-head { display: flex; align-items: center; gap: 8px; font-size: 14.5px; font-weight: 800; color: #DB2777; }
:root[data-theme="dark"] .dash-hl-head { color: #F9A8D4; }
.dash-hl-head-due { color: #9A6207; }
:root[data-theme="dark"] .dash-hl-head-due { color: #FCD34D; }
.dash-hl-dot { width: 10px; height: 10px; border-radius: 50%; background: #EC4899; box-shadow: 0 0 0 5px rgba(236,72,153,0.18); animation: dash-hl-pulse 1.8s ease-out infinite; }
@keyframes dash-hl-pulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.5; transform: scale(0.88); } }
.dash-hl-title { font-weight: 700; font-size: 16px; margin: 16px 0 3px; line-height: 1.35; }
.dash-hl-sub { font-size: 13px; color: var(--text-2); }
.dash-hl-meta { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--text-2); margin-top: 11px; }
.dash-hl-meta svg { color: #DB2777; flex-shrink: 0; }
.dash-hl-meta-due svg { color: #C2740A; }
.dash-hl-meta-due strong { color: var(--text); font-weight: 700; }
.dash-hl-by { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-2); margin-top: 14px; }
.dash-hl-by .av { width: 34px; height: 34px; font-size: 12px; border-radius: 12px; box-shadow: 0 3px 10px rgba(90,90,180,0.16); }
.dash-hl-btn { margin-top: 18px; width: 100%; justify-content: center; border-radius: 14px; padding: 12px 14px; font-weight: 700; transition: transform 0.12s var(--tx), box-shadow 0.2s var(--tx), filter 0.2s var(--tx); }
.dash-hl-btn:active { transform: scale(0.97); }
.dash-hl-live .dash-hl-btn {
  background: linear-gradient(135deg, #6366F1, #8B5CF6); border-color: transparent; color: #fff;
  box-shadow: 0 8px 20px rgba(99,102,241,0.32);
}
.dash-hl-live .dash-hl-btn:hover { filter: brightness(1.07); }
.dash-hl-btn-due {
  background: linear-gradient(135deg, #FDE9AE, #FCDF8A); color: #8A5A06;
  border: 1px solid rgba(245,158,11,0.30); box-shadow: 0 6px 16px rgba(245,158,11,0.20);
}
.dash-hl-btn-due:hover { filter: brightness(1.04); }
:root[data-theme="dark"] .dash-hl-btn-due { background: linear-gradient(135deg, #4A390F, #3E3010); color: #FCD34D; }

/* ── Learning progress ───────────────────────────────────────────── */
.dash-prog { display: flex; flex-direction: column; gap: 22px; padding: 26px; }
.dash-prog-head, .dash-reco-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dash-viewall {
  display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0;
  background: transparent; border: 0; cursor: pointer; padding: 6px 4px;
  color: var(--primary); font-size: 13.5px; font-weight: 700; font-family: inherit;
  transition: gap 0.2s var(--tx);
}
.dash-viewall:hover { gap: 10px; text-decoration: underline; }
.dash-prog-title { margin: 0; font-size: 17.5px; font-weight: 800; display: flex; align-items: center; gap: 11px; letter-spacing: -0.01em; }
.dash-prog-title-ic, .dash-reco-star { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; background: rgba(99,102,241,0.12); color: #6366F1; }
.dash-reco-star { background: rgba(245,158,11,0.14); color: #F59E0B; }
.dash-prog-band {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 26px; align-items: center;
  background: linear-gradient(135deg, #F7F6FF 0%, #F2F4FF 100%);
  border: 1px solid var(--dsh-border); border-radius: var(--dsh-radius-sm); padding: 26px;
}
:root[data-theme="dark"] .dash-prog-band { background: linear-gradient(135deg, rgba(99,102,241,0.10), rgba(139,92,246,0.07)); }
.dash-prog-band-t { font-weight: 800; font-size: 17px; letter-spacing: -0.01em; }
.dash-prog-band-s { font-size: 13.5px; color: var(--text-2); margin: 5px 0 16px; line-height: 1.55; }
.dash-prog-bar { height: 12px; border-radius: 999px; background: rgba(99,102,241,0.13); overflow: hidden; }
:root[data-theme="dark"] .dash-prog-bar { background: rgba(255,255,255,0.10); }
.dash-prog-bar-fill {
  height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, #6366F1, #8B5CF6);
  transition: width 1s cubic-bezier(0.22, 1, 0.36, 1);
  animation: dsh-grow 1s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.dash-prog-mini-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.dash-prog-mini {
  display: flex; align-items: center; gap: 12px; padding: 18px 16px;
  border: 1px solid var(--dsh-border); border-radius: var(--dsh-radius-sm);
  background: linear-gradient(180deg, #FFFFFF, #FCFCFF); min-width: 0;
  transition: transform 0.2s var(--tx), box-shadow 0.2s var(--tx);
}
:root[data-theme="dark"] .dash-prog-mini { background: var(--surface-2); }
.dash-prog-mini:hover { transform: translateY(-3px); box-shadow: var(--dsh-shadow); }
.dash-prog-mini-ic { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; flex-shrink: 0; }
.dash-prog-mini-v { font-family: var(--font-display); font-weight: 800; font-size: 20px; line-height: 1.05; }
.dash-prog-mini-l { font-size: 11.5px; color: var(--text-2); font-weight: 600; margin-top: 3px; line-height: 1.35; }

/* ── Recommended courses — 2-up grid (never 3 on phones) ─────────── */
.dash-reco-head { margin-bottom: 18px; }
.dash-reco-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.dash-reco-card {
  overflow: hidden; cursor: pointer; display: flex; flex-direction: column; padding: 10px;
  background: linear-gradient(180deg, #FFFFFF 0%, #FDFDFF 100%);
  transition: transform 0.22s var(--tx), box-shadow 0.22s var(--tx);
}
:root[data-theme="dark"] .dash-reco-card { background: linear-gradient(180deg, var(--surface), var(--surface-2)); }
.dash-reco-card:hover { transform: translateY(-5px); box-shadow: var(--dsh-shadow-lg); }
.dash-reco-thumb { position: relative; aspect-ratio: 16 / 9; overflow: hidden; flex-shrink: 0; border-radius: var(--dsh-radius-sm); }
.dash-reco-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s var(--tx); }
.dash-reco-card:hover .dash-reco-thumb img { transform: scale(1.06); }
.dash-reco-thumb-fade { position: absolute; inset: 0; background: linear-gradient(180deg, transparent 42%, rgba(0,0,0,0.68)); }
.dash-reco-thumb-cap {
  position: absolute; left: 13px; bottom: 11px; color: #fff;
  font-family: var(--font-display); font-weight: 800; font-size: 15px;
  letter-spacing: 0.02em; text-shadow: 0 2px 8px rgba(0,0,0,0.5);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: calc(100% - 26px);
}
.dash-reco-new {
  position: absolute; top: 10px; right: 10px;
  background: linear-gradient(135deg, #4ADE80, #22C55E); color: #fff;
  padding: 4px 11px; border-radius: 999px;
  font-size: 10.5px; font-weight: 800; letter-spacing: 0.04em;
  box-shadow: 0 4px 12px rgba(34,197,94,0.34);
}
.dash-reco-body { padding: 14px 8px 6px; display: flex; flex-direction: column; gap: 5px; flex: 1; min-width: 0; }
.dash-reco-title { font-weight: 700; font-size: 14.5px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dash-reco-sub { font-size: 12px; color: var(--text-3); }
.dash-reco-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--text-2); margin-top: 8px; }
.dash-reco-meta span { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.dash-reco-meta span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-reco-av { width: 22px !important; height: 22px !important; font-size: 9px !important; flex-shrink: 0; border-radius: 8px; }
.dash-reco-rating { color: #F59E0B; font-weight: 800; flex-shrink: 0; }
.dash-reco-btn {
  margin-top: 14px; width: 100%; justify-content: center; border-radius: 14px; padding: 11px 12px;
  background: linear-gradient(135deg, #EEF0FF, #E9ECFF); color: #4F46E5;
  border: 1px solid rgba(120,120,255,0.20); font-weight: 700;
  transition: transform 0.12s var(--tx), box-shadow 0.2s var(--tx), filter 0.2s var(--tx);
}
.dash-reco-btn:hover { filter: brightness(0.99); box-shadow: 0 6px 16px rgba(99,102,241,0.20); }
.dash-reco-btn:active { transform: scale(0.97); }
:root[data-theme="dark"] .dash-reco-btn { background: rgba(99,102,241,0.16); color: #C7D2FE; border-color: rgba(150,150,255,0.22); }

/* ─── Responsive ─── */
@media (max-width: 980px) {
  .dash-reco-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .dash-flow { gap: 22px; }
  .dash-cl-card { padding: 22px 20px; min-height: 0; }
  .dash-cl-art { right: 2px; bottom: 2px; width: 40%; min-width: 124px; }
  .dash-cl-title { font-size: 19px; margin-top: 14px; }
  .dash-cl-sub { font-size: 13px; margin-bottom: 16px; }
  .dash-cl-pill { font-size: 11.5px; padding: 6px 13px; }
  .dash-cl-progress { flex-wrap: wrap; gap: 7px 10px; margin-bottom: 18px; }
  .dash-cl-progress-bar { height: 9px; }
  .dash-cl-progress-pct { font-size: 12px; }
  .dash-cl-actions { gap: 8px; flex-wrap: nowrap; }
  .dash-cl-actions .btn { justify-content: center; padding: 10px 11px; font-size: 12px; flex: 0 1 auto; white-space: nowrap; border-radius: 13px; }
  .dash-cl-actions .btn svg { width: 13px; height: 13px; }

  .dash-stat-row { padding: 6px 0; }
  .dash-stat-cell { padding: 14px 4px; gap: 8px; }
  .dash-stat-ic { width: 42px; height: 42px; border-radius: 14px; }
  .dash-stat-ic svg { width: 19px; height: 19px; }
  .dash-stat-v { font-size: 19px; }
  .dash-stat-l { font-size: 10px; }

  .dash-quick-row { padding: 10px 6px; }
  .dash-quick-cell { padding: 12px 3px; gap: 8px; }
  .dash-quick-ic { width: 48px; height: 48px; border-radius: 16px; }
  .dash-quick-ic svg { width: 22px; height: 22px; }
  .dash-quick-label { font-size: 11.5px; }

  .dash-highlight-grid { gap: 12px; }
  .dash-hl { padding: 16px; }
  .dash-hl-head { font-size: 12.5px; gap: 6px; }
  .dash-hl-title { font-size: 14px; margin-top: 12px; }
  .dash-hl-sub, .dash-hl-meta, .dash-hl-by { font-size: 11.5px; }
  .dash-hl-by .av { width: 28px; height: 28px; font-size: 10px; }
  .dash-hl-btn { font-size: 12px; padding: 10px 6px; margin-top: 14px; }

  .dash-prog { padding: 20px 16px; gap: 18px; }
  .dash-prog-band { gap: 18px; padding: 18px; }
  .dash-prog-band-t { font-size: 15px; }
  .dash-prog-band-s { font-size: 12.5px; margin-bottom: 13px; }
  .dash-prog-bar { height: 10px; }
  .dash-prog-title { font-size: 15.5px; gap: 9px; }
  .dash-prog-title-ic, .dash-reco-star { width: 31px; height: 31px; border-radius: 10px; }

  .dash-prog-mini-grid { gap: 9px; }
  .dash-prog-mini { flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 14px 6px; }
  .dash-prog-mini-ic { width: 34px; height: 34px; border-radius: 11px; }
  .dash-prog-mini-ic svg { width: 16px; height: 16px; }
  .dash-prog-mini-v { font-size: 17px; }
  .dash-prog-mini-l { font-size: 10px; }

  .dash-reco-grid { gap: 13px; }
  .dash-reco-card { padding: 8px; }
  .dash-reco-body { padding: 11px 6px 4px; }
  .dash-reco-title { font-size: 13px; }
  .dash-reco-sub { font-size: 11px; }
  .dash-reco-meta { font-size: 11px; }
  .dash-reco-btn { font-size: 12px; padding: 10px 8px; margin-top: 11px; }
}
@media (max-width: 420px) {
  .dash-cl-card { padding: 18px 16px; border-radius: 20px; }
  .dash-cl-art { right: 0; width: 38%; min-width: 108px; }
  .dash-cl-title { font-size: 17px; }
  .dash-cl-body { max-width: 64%; }
  .dash-cl-actions .btn { padding: 9px 9px; font-size: 11.5px; }
  .dash-stat-l { font-size: 9.5px; }
  .dash-quick-ic { width: 44px; height: 44px; }
  .dash-quick-label { font-size: 10.5px; }
  .dash-prog-mini { padding: 12px 4px; }
  .dash-prog-mini-v { font-size: 16px; }
  .dash-prog-mini-l { font-size: 9.5px; }
  .dash-reco-thumb-cap { font-size: 13px; left: 10px; bottom: 9px; }
}
/* Only the narrowest phones stack the two highlight cards */
@media (max-width: 359px) {
  .dash-highlight-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .dash-hl-dot { animation: none; }
  .dash-flow > * { animation: none; }
  .dash-cl-progress-fill, .dash-prog-bar-fill { animation: none; }
}

/* ── Free Preview video player (free lesson player in course detail) ── */
.free-preview { max-width: 1200px; margin: 0 auto; }
.free-preview-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 22px;
  align-items: start;
}
.free-preview-video {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 16px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 24px 48px rgba(15,23,42,0.25);
}
.free-preview-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.free-preview-info { padding: 16px 4px 4px; }
.free-preview-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.free-preview-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 800; letter-spacing: 0.04em;
}
.free-preview-chip.free { background: var(--success-soft); color: var(--success); }
.free-preview-title {
  font-family: var(--font-display); font-size: 22px; font-weight: 800;
  letter-spacing: -0.01em; line-height: 1.25;
  margin: 0 0 6px;
}
.free-preview-sub { font-size: 13px; color: var(--text-3); margin: 0 0 12px; }
.free-preview-desc { font-size: 13.5px; line-height: 1.6; color: var(--text-2); margin: 0; }

.free-preview-side { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 80px; }
.free-preview-cta { padding: 20px; text-align: center; }
.free-preview-cta-icon {
  width: 56px; height: 56px; border-radius: 16px;
  display: grid; place-items: center; margin: 0 auto 12px;
}
.free-preview-cta-title { font-family: var(--font-display); font-weight: 800; font-size: 17px; margin-bottom: 4px; }
.free-preview-cta-sub { font-size: 12.5px; color: var(--text-2); line-height: 1.55; margin: 0 0 14px; }

@media (max-width: 980px) {
  .free-preview-layout { grid-template-columns: 1fr; gap: 16px; }
  .free-preview-side { position: static; }
}
@media (max-width: 640px) {
  .free-preview-video { border-radius: 12px; }
  .free-preview-title { font-size: 18px; }
  .free-preview-info { padding: 14px 2px 2px; }
}

/* ── Certificates page (locked / unlocked card grid) ───────────────── */
.cert-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
}
.cert-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.18s cubic-bezier(.34,1.2,.64,1), box-shadow 0.18s ease, border-color 0.18s ease;
}
.cert-card.unlocked:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 32px rgba(79,70,229,0.18);
  border-color: color-mix(in oklab, #6366F1 36%, var(--border));
}
.cert-banner {
  position: relative;
  height: 160px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  color: #fff; padding: 18px;
  text-align: center; overflow: hidden;
}
.cert-card.unlocked .cert-banner::before {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(60% 80% at 80% 20%, rgba(255,255,255,0.16), transparent 60%),
    radial-gradient(50% 60% at 20% 80%, rgba(255,255,255,0.10), transparent 60%);
  pointer-events: none;
}
.cert-card.locked .cert-banner::before {
  content: ''; position: absolute; inset: 0;
  background: repeating-linear-gradient(45deg, rgba(255,255,255,0.03), rgba(255,255,255,0.03) 12px, transparent 12px, transparent 24px);
  pointer-events: none;
}
.cert-banner-icon { position: relative; z-index: 1; opacity: 0.95; margin-bottom: 10px; }
.cert-banner-title { position: relative; z-index: 1; margin: 0; font-family: var(--font-display); letter-spacing: 1.5px; font-size: 14px; font-weight: 800; }
.cert-banner-sub   { position: relative; z-index: 1; margin-top: 6px; font-size: 11.5px; opacity: 0.85; }

.cert-body { padding: 18px 20px 20px; }
.cert-meta-top { font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 700; margin-bottom: 6px; }
.cert-title { font-weight: 800; font-size: 17px; line-height: 1.3; word-break: break-word; margin-bottom: 14px; }
.cert-card.locked .cert-title { color: var(--text-2); }

.cert-progress { margin-bottom: 12px; }
.cert-progress-bar { height: 6px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.cert-progress-fill {
  height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, #4F46E5, #EC4899);
  transition: width 0.6s var(--tx);
}
.cert-card.locked .cert-progress-fill { background: linear-gradient(90deg, var(--text-3), var(--text-2)); }
.cert-progress-meta {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 11.5px; color: var(--text-3); font-weight: 600;
  margin-top: 6px;
}
.cert-grade {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 999px;
  background: var(--success-soft); color: var(--success);
  font-weight: 800; font-size: 11px;
}
.cert-cause {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; color: var(--primary); font-weight: 700;
  background: var(--primary-soft);
  padding: 6px 10px; border-radius: 8px;
  margin-top: 4px;
}

@media (max-width: 640px) {
  .cert-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .cert-banner { height: 130px; }
  .cert-banner-icon { width: 36px !important; height: 36px !important; }
  .cert-banner-title { font-size: 13px; letter-spacing: 1px; }
  .cert-body { padding: 14px 16px 16px; }
  .cert-title { font-size: 15px; }
}

/* ── Group Access & Credentials (admin-managed private group links) ── */
.group-access { padding: 20px; }
.group-access-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 14px; padding-bottom: 14px; border-bottom: 1px dashed var(--border); flex-wrap: wrap; }
.group-access-icon {
  width: 38px; height: 38px; border-radius: 10px;
  background: var(--primary-soft); color: var(--primary);
  display: grid; place-items: center; flex-shrink: 0;
}
.group-access-title { font-weight: 800; font-size: 16px; }
.group-access-sub   { font-size: 12.5px; color: var(--text-3); margin-top: 2px; line-height: 1.45; }

.group-access-list { display: flex; flex-direction: column; gap: 12px; }
.group-access-row {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  background: var(--surface-2);
  transition: border-color 0.15s ease, background 0.15s ease;
}
.group-access-row.unlocked { background: color-mix(in oklab, var(--success-soft) 50%, var(--surface-2)); border-color: color-mix(in oklab, var(--success) 22%, var(--border)); }
.group-access-row.locked   { background: var(--surface-2); }

.group-access-row-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.group-access-platform-icon { flex-shrink: 0; display: grid; place-items: center; }
.group-access-platform { font-weight: 800; font-size: 14px; line-height: 1.2; }
.group-access-note     { font-size: 12px; color: var(--text-3); line-height: 1.5; margin-top: 3px; font-style: italic; }

.group-access-cred {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
}
.group-access-cred-label {
  font-size: 10.5px; font-weight: 800; color: var(--text-3);
  text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 6px;
}
.group-access-cred-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.group-access-cred-value {
  flex: 1; min-width: 0;
  background: var(--surface-2); border: 1px solid var(--border);
  padding: 7px 11px; border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 12.5px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.group-access-row.locked .group-access-cred-value {
  letter-spacing: 0.05em; color: var(--text-3);
}
.group-access-actions { display: flex; gap: 6px; flex-shrink: 0; }
.group-access-actions .btn { font-size: 11.5px; padding: 6px 10px; }

@media (max-width: 640px) {
  .group-access { padding: 16px; }
  .group-access-platform { font-size: 13px; }
  .group-access-row { padding: 12px; }
  .group-access-cred-row { flex-direction: column; align-items: stretch; }
  .group-access-actions { width: 100%; }
  .group-access-actions .btn { flex: 1; justify-content: center; }
}

/* ── Course Detail KPI strip (admin-controlled marketing cards) ── */
.course-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}
.course-kpi {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  min-width: 0;
  /* `backwards`, not `both` — see .page-enter: a retained transform turns the
     element into a containing block for any fixed-position child. */
  animation: kpi-pop 0.55s cubic-bezier(.34,1.4,.64,1) backwards;
}
@keyframes kpi-pop {
  from { opacity: 0; transform: translateY(14px) scale(0.92); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.course-kpi-icon {
  /* pulse the icon once on mount to draw the eye */
  animation: kpi-icon-pulse 1.1s ease-out 0.5s 1 both;
}
@keyframes kpi-icon-pulse {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.18); }
  100% { transform: scale(1); }
}
/* Don't re-animate when admin live-preview re-renders (would feel jittery) */
.course-kpis-preview .course-kpi { animation: none; }
.course-kpis-preview .course-kpi-icon { animation: none; }
.course-kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: color-mix(in oklab, var(--primary) 25%, var(--border)); }
.course-kpi-icon {
  width: 44px; height: 44px; border-radius: 12px;
  background: linear-gradient(135deg, color-mix(in oklab, var(--primary) 14%, transparent), color-mix(in oklab, #8B5CF6 14%, transparent));
  color: var(--primary);
  display: grid; place-items: center; flex-shrink: 0;
}
.course-kpi-text { flex: 1; min-width: 0; }
.course-kpi-value {
  font-family: var(--font-display);
  font-weight: 800; font-size: 20px; letter-spacing: -0.01em;
  line-height: 1.1; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.course-kpi-label {
  font-size: 12px; color: var(--text-3);
  margin-top: 3px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* Live preview in admin editor — slightly smaller */
.course-kpis-preview { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.course-kpis-preview .course-kpi { padding: 12px 14px; }
.course-kpis-preview .course-kpi-icon { width: 38px; height: 38px; border-radius: 10px; }
.course-kpis-preview .course-kpi-value { font-size: 17px; }

@media (max-width: 760px) {
  .course-kpis { grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }
  .course-kpi { padding: 12px; gap: 10px; }
  .course-kpi-icon { width: 38px; height: 38px; }
  .course-kpi-icon svg { width: 16px; height: 16px; }
  .course-kpi-value { font-size: 17px; }
  .course-kpi-label { font-size: 11px; }
}
@media (max-width: 420px) {
  .course-kpis { gap: 8px; }
  .course-kpi { padding: 10px; gap: 8px; }
  .course-kpi-icon { width: 32px; height: 32px; border-radius: 9px; }
  .course-kpi-icon svg { width: 14px; height: 14px; }
  .course-kpi-value { font-size: 15px; }
  .course-kpi-label { font-size: 10.5px; }
}

/* ── Course Detail page (student / guest / admin) ───────────────── */
/* Wide-and-short cover banner with image background + dark overlay.
   Aspect ratio is 8 : 1 on desktop, with sensible min-height for narrow screens. */
.course-detail { max-width: 1200px; margin: 0 auto; }
.course-hero {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 22px;
  background: linear-gradient(135deg, #3B82F6, #8B5CF6);
  aspect-ratio: 8 / 1;
  min-height: 110px;
}
.course-hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.course-hero-overlay { position: absolute; inset: 0; background: rgba(15,23,42,0.55); }
.course-hero-body {
  position: relative; z-index: 1; height: 100%;
  padding: 16px 24px;
  display: flex; align-items: center;
  color: #fff;
}
.course-hero-inner { flex: 1; min-width: 0; }
.course-hero-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.course-hero-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 999px;
  font-size: 10.5px; font-weight: 800; letter-spacing: 0.04em;
  background: rgba(255,255,255,0.20); color: #fff;
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.course-hero-chip.tag { background: #FCD34D; color: #92400E; }
.course-hero-chip.lifetime { background: rgba(34,197,94,0.85); }
.course-hero-chip.multi { background: rgba(139,92,246,0.85); }
.course-hero-title {
  font-family: var(--font-display);
  font-size: clamp(16px, 2.2vw, 26px);
  font-weight: 800; letter-spacing: -0.02em; line-height: 1.15;
  margin: 0; word-break: break-word;
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
}
.course-hero-sub { font-size: 12px; opacity: 0.86; margin-top: 4px; }

/* Two-column body: ENROLL card on LEFT, content on RIGHT */
.course-detail-body {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}
@media (max-width: 980px) {
  .course-detail-body { grid-template-columns: 1fr; }
}

/* Sticky enroll panel */
.course-enroll-wrap { position: sticky; top: 80px; }
@media (max-width: 980px) {
  .course-enroll-wrap { position: static; }
}
.course-enroll {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
/* YouTube-ratio thumbnail above the enroll content */
.course-enroll-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, #3B82F6, #8B5CF6);
  overflow: hidden;
}
.course-enroll-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.course-enroll-thumb-fade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0.05), rgba(0,0,0,0.32)); }
.course-enroll-thumb-play {
  position: absolute; inset: 0; display: grid; place-items: center;
}
.course-enroll-thumb-play > div {
  width: 56px; height: 56px; border-radius: 50%;
  background: rgba(255,255,255,0.25);
  display: grid; place-items: center; color: #fff;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  transition: transform 0.18s ease, background 0.18s ease;
}
.course-enroll-thumb:hover .course-enroll-thumb-play > div { background: rgba(255,255,255,0.40); transform: scale(1.08); }
/* Static thumbnail variant — used in the course-detail enroll card (no play button) */
.course-enroll-thumb-static .course-enroll-thumb-fade { display: none; }
.course-enroll-thumb-static .course-enroll-thumb-play { display: none; }

/* Price block */
.course-enroll-price {
  padding: 18px 20px 14px;
  display: flex; flex-direction: column; gap: 6px;
  border-bottom: 1px solid var(--border);
}
/* Price row — single line: current price + struck-through original + discount % */
.course-enroll-price-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: nowrap;
  min-width: 0;
}
.course-enroll-price-current {
  font-family: var(--font-display);
  font-size: 26px; font-weight: 800; letter-spacing: -0.02em;
  color: var(--primary); line-height: 1;
  white-space: nowrap;
  flex-shrink: 0;
}
.course-enroll-price-current .per { font-size: 13px; font-weight: 600; color: var(--text-3); margin-left: 4px; }
.course-enroll-price-original {
  font-size: 14px; color: var(--text-3); text-decoration: line-through; font-weight: 600;
  white-space: nowrap;
  flex-shrink: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.course-enroll-price-pct {
  background: var(--success-soft); color: var(--success);
  padding: 3px 7px; border-radius: 6px;
  font-size: 10.5px; font-weight: 800; letter-spacing: 0.04em;
  white-space: nowrap;
  flex-shrink: 0;
  margin-left: auto;
}
.course-enroll-price-note { font-size: 11.5px; color: var(--text-3); }

/* Actions + features */
.course-enroll-actions { padding: 16px 20px 6px; display: flex; flex-direction: column; gap: 10px; }
.course-enroll-actions .btn { width: 100%; justify-content: center; }
.course-enroll-actions .btn-primary { height: 46px; font-size: 15px; font-weight: 800; }
.course-enroll-features { padding: 4px 20px 18px; }
.course-enroll-features-title { font-weight: 700; font-size: 13px; margin: 14px 0 10px; }
.course-enroll-feature { display: flex; align-items: center; gap: 10px; font-size: 13px; margin-bottom: 9px; color: var(--text-2); }
.course-enroll-feature .ic { width: 26px; height: 26px; border-radius: 8px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; flex-shrink: 0; }

/* Mobile tweaks */
@media (max-width: 640px) {
  /* The wide 8:1 hero banner is hidden on phone — too narrow to read */
  .course-hero { display: none; }
  .course-enroll-thumb-play > div { width: 48px; height: 48px; }
  .course-enroll-price { padding: 16px 16px 12px; }
  .course-enroll-actions { padding: 14px 16px 4px; }
  .course-enroll-features { padding: 4px 16px 16px; }
}
@media (min-width: 641px) and (max-width: 980px) {
  .course-hero { aspect-ratio: 6 / 1; min-height: 130px; }
}

/* ── Course Curriculum page (View Class) ── */
.course-curr { max-width: 1100px; margin: 0 auto; }
.curr-head { display: flex; align-items: center; gap: 16px; padding: 18px 20px; margin-bottom: 18px; }
.curr-head-icon { width: 56px; height: 56px; border-radius: 14px; flex-shrink: 0; display: grid; place-items: center; overflow: hidden; }
.curr-head-icon img { width: 100%; height: 100%; object-fit: cover; }
.curr-head-meta { flex: 1; min-width: 0; }
.curr-head-title { font-size: 18px; font-weight: 800; line-height: 1.3; margin: 0 0 4px; word-break: break-word; }
.curr-head-sub { font-size: 13px; color: var(--text-3); }
.curr-head-btn { flex-shrink: 0; }

.curr-card { padding: 22px 24px; margin-bottom: 18px; }
.curr-card-head { margin-bottom: 18px; }
.curr-card-title { font-size: 18px; font-weight: 800; margin: 0 0 4px; }
.curr-card-sub { font-size: 13px; color: var(--text-3); }

.curr-groups { display: flex; flex-direction: column; gap: 16px; }
.curr-group { display: flex; flex-direction: column; gap: 8px; }
.curr-subject-row { display: flex; align-items: center; gap: 8px; margin-bottom: 2px; }
.curr-subject-pill {
  display: inline-block; padding: 5px 14px; border-radius: 999px;
  color: #fff; font-weight: 800; font-size: 12.5px; letter-spacing: 0.02em;
}

.curr-chapter {
  background: var(--surface-2);
  border: 1px solid transparent;
  border-radius: 8px;
  transition: background 0.15s ease, border-color 0.15s ease;
  overflow: hidden;
}
.curr-chapter.open { background: color-mix(in oklab, var(--primary-soft) 80%, var(--surface-2)); border-color: color-mix(in oklab, var(--primary) 22%, var(--border)); }
.curr-chapter-head {
  width: 100%; display: flex; align-items: center; gap: 10px;
  padding: 14px 16px; background: transparent; border: none; cursor: pointer;
  text-align: left; font-family: inherit; font-size: inherit; color: inherit;
}
.curr-chevron { flex-shrink: 0; transition: transform 0.18s ease; }
.curr-chapter.open .curr-chevron { transform: rotate(0deg); }
.curr-chapter-title { flex: 1; min-width: 0; font-weight: 700; font-size: 14px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.curr-chapter-meta  { font-size: 12px; color: var(--text-3); flex-shrink: 0; font-weight: 600; }
.curr-free-badge {
  font-size: 10.5px; font-weight: 800; padding: 2px 9px; border-radius: 999px;
  background: var(--success-soft); color: var(--success);
  flex-shrink: 0;
}

.curr-lessons { padding: 4px 8px 12px 38px; display: flex; flex-direction: column; gap: 2px; }
.curr-lesson {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 6px;
  transition: background 0.12s ease;
}
.curr-lesson:hover { background: var(--surface); }
.curr-lesson-icon { flex-shrink: 0; color: var(--text-3); }
.curr-lesson-title { flex: 1; min-width: 0; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.curr-lesson.locked .curr-lesson-title { color: var(--text-2); }
.curr-lesson-meta { display: inline-flex; align-items: center; gap: 10px; font-size: 11.5px; color: var(--text-3); flex-shrink: 0; }
.curr-lesson-duration { font-weight: 600; }
.curr-lesson-watch {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 11px; border-radius: 999px;
  border: 1px solid currentColor;
  background: transparent;
  font-family: inherit;
  font-weight: 800; font-size: 11.5px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, transform 0.12s ease;
}
.curr-lesson-watch:hover { background: currentColor; color: #fff !important; }
.curr-lesson-watch:hover svg { color: #fff !important; }
.curr-lesson-watch:active { transform: scale(0.96); }
.curr-empty { padding: 18px; text-align: center; color: var(--text-3); font-size: 13px; background: var(--surface-2); border-radius: 8px; }

.curr-materials { display: flex; flex-direction: column; gap: 10px; }
.curr-material {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 14px; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 10px;
  transition: border-color 0.15s ease;
}
.curr-material:hover { border-color: color-mix(in oklab, var(--primary) 30%, var(--border)); }
.curr-material-icon {
  width: 40px; height: 40px; border-radius: 10px;
  background: var(--primary-soft); color: var(--primary);
  display: grid; place-items: center; flex-shrink: 0;
}
.curr-material-info { flex: 1; min-width: 0; }
.curr-material-title { font-weight: 700; font-size: 13.5px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.curr-material-meta  { font-size: 11px; color: var(--text-3); margin-top: 2px; font-weight: 600; letter-spacing: 0.04em; }

/* Responsive */
@media (max-width: 760px) {
  .curr-head { padding: 14px; gap: 12px; flex-wrap: wrap; }
  .curr-head-icon { width: 44px; height: 44px; border-radius: 11px; }
  .curr-head-title { font-size: 16px; }
  .curr-head-sub { font-size: 12px; }
  .curr-head-btn { width: 100%; justify-content: center; order: 99; margin-top: 4px; }
  .curr-card { padding: 16px; }
  .curr-card-title { font-size: 16px; }
  .curr-chapter-head { padding: 12px 14px; }
  .curr-chapter-title { font-size: 13px; }
  .curr-chapter-meta { font-size: 11px; }
  .curr-lessons { padding-left: 30px; }
  .curr-lesson { padding: 8px 10px; }
  .curr-lesson-title { font-size: 12.5px; }
  .curr-material { padding: 10px 12px; gap: 12px; }
  .curr-material-icon { width: 36px; height: 36px; }
}
@media (max-width: 480px) {
  .curr-card { padding: 14px; }
  .curr-chapter-head { gap: 8px; padding: 11px 12px; }
  .curr-free-badge { font-size: 9.5px; padding: 1px 7px; }
  .curr-lessons { padding: 4px 6px 10px 22px; }
  .curr-lesson-meta { gap: 8px; font-size: 11px; }
  .curr-lesson-watch { font-size: 11px; }
}

/* ── My Classes — grid of video lesson cards (responsive) ── */
/* Default: phone — 2 columns, tight gap, smaller radius */
.class-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.class-card {
  --subj: #64748B;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: transform 0.2s cubic-bezier(.34,1.2,.64,1), box-shadow 0.2s ease, border-color 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}
/* Thin colored accent strip across the top of every card */
.class-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--subj); opacity: 0.85; z-index: 2;
  transition: height 0.2s ease, opacity 0.2s ease;
}
.class-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 30px color-mix(in oklab, var(--subj) 28%, transparent);
  border-color: var(--subj);
}
.class-card:hover::before { height: 5px; opacity: 1; }
.class-card:active { transform: scale(0.985); }

.class-card-thumb { aspect-ratio: 16 / 9; position: relative; overflow: hidden; }
.class-card-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 0.45s ease; }
.class-card:hover .class-card-thumb img { transform: scale(1.06); }
.class-card-thumb-fade { position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.25), rgba(0,0,0,0.15) 40%, rgba(0,0,0,0.35));
  transition: background 0.25s ease;
}
.class-card:hover .class-card-thumb-fade {
  background:
    linear-gradient(180deg, color-mix(in oklab, var(--subj) 0%, rgba(0,0,0,0.35)), rgba(0,0,0,0.15) 40%, color-mix(in oklab, var(--subj) 28%, rgba(0,0,0,0.45)));
}

.class-card-badge { position: absolute; top: 8px; left: 8px; padding: 3px 8px; border-radius: 999px; font-size: 10px; font-weight: 800; color: #fff; letter-spacing: 0.04em; display: inline-flex; align-items: center; gap: 5px; z-index: 3; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.class-card-badge-live { background: #EF4444; box-shadow: 0 0 0 0 rgba(239,68,68,0.5); animation: live-glow 1.8s infinite; }
@keyframes live-glow { 0%,100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.55); } 60% { box-shadow: 0 0 0 8px rgba(239,68,68,0); } }
.class-card-badge-rec  { background: rgba(15,23,42,0.65); }
.class-card-pulse { width: 6px; height: 6px; border-radius: 50%; background: #fff; animation: pulse-ring 1.5s infinite; }
.class-card-subject {
  position: absolute; top: 8px; right: 8px;
  background: var(--subj); color: #fff;
  padding: 3px 9px; border-radius: 999px;
  font-size: 10px; font-weight: 800;
  letter-spacing: 0.03em;
  max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  box-shadow: 0 4px 10px color-mix(in oklab, var(--subj) 50%, transparent);
  z-index: 3;
}
.class-card-play { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; z-index: 2; }
.class-card-play > * {
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255,255,255,0.22);
  display: grid; place-items: center;
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.class-card:hover .class-card-play > * {
  background: var(--subj);
  transform: scale(1.12);
  box-shadow: 0 8px 24px color-mix(in oklab, var(--subj) 55%, transparent);
}

.class-card-info { padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 3px; min-width: 0; overflow: hidden; }
.class-card-title  { font-weight: 700; font-size: 13px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; max-width: 100%; }
.class-card-course { font-size: 11px; color: var(--text-2); display: flex; align-items: center; gap: 5px; min-width: 0; max-width: 100%; }
.class-card-course > svg { flex-shrink: 0; color: var(--subj); }
.class-card-course > span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.class-card-title { transition: color 0.18s ease; }
.class-card:hover .class-card-title { color: var(--subj); }

/* Very small phones (< 360px) — keep 2 cols but shrink chrome */
@media (max-width: 359px) {
  .class-grid { gap: 8px; }
  .class-card { border-radius: 6px; }
  .class-card-badge, .class-card-subject { font-size: 9px; padding: 2px 6px; }
  .class-card-title { font-size: 12px; }
  .class-card-course { font-size: 10.5px; }
  .class-card-course svg { width: 10px; height: 10px; }
  .class-card-play > * { width: 32px; height: 32px; }
  .class-card-play svg { width: 16px; height: 16px; }
  .class-card-info { padding: 7px 8px 9px; }
}

/* Larger phones to small tablets (480–768) — still 2 cols but a bit roomier */
@media (min-width: 480px) and (max-width: 767px) {
  .class-grid { gap: 12px; }
  .class-card { border-radius: 9px; }
  .class-card-title { font-size: 13.5px; }
}

/* Tablets / small desktops — 3 columns */
@media (min-width: 768px) and (max-width: 1199px) {
  .class-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
  .class-card { border-radius: 9px; }
  .class-card-title { font-size: 14px; }
  .class-card-course { font-size: 12px; }
  .class-card-badge, .class-card-subject { font-size: 11px; padding: 3px 9px; }
  .class-card-play > * { width: 46px; height: 46px; }
  .class-card-info { padding: 10px 12px 12px; }
}

/* Laptops — 4 columns */
@media (min-width: 1200px) and (max-width: 1599px) {
  .class-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
  .class-card { border-radius: 10px; }
  .class-card-title { font-size: 14px; }
  .class-card-course { font-size: 12px; }
  .class-card-badge, .class-card-subject { font-size: 11px; padding: 3px 10px; }
  .class-card-play > * { width: 48px; height: 48px; }
  .class-card-info { padding: 10px 12px 12px; }
}

/* Wide desktops & TVs — 5 columns */
@media (min-width: 1600px) and (max-width: 1999px) {
  .class-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 18px; }
  .class-card { border-radius: 11px; }
  .class-card-title { font-size: 15px; }
  .class-card-course { font-size: 12.5px; }
  .class-card-play > * { width: 52px; height: 52px; }
  .class-card-info { padding: 11px 14px 13px; }
}

/* Ultra-wide — 6 columns */
@media (min-width: 2000px) {
  .class-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 20px; }
  .class-card { border-radius: 12px; }
  .class-card-title { font-size: 15px; }
  .class-card-course { font-size: 12.5px; }
  .class-card-play > * { width: 56px; height: 56px; }
  .class-card-info { padding: 12px 14px 14px; }
}

/* ── Profile page ── */
.profile-page { max-width: 1200px; margin: 0 auto; }
.profile-hero {
  background: var(--surface);
  border-radius: 22px; overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  margin-bottom: 22px; position: relative;
}
.profile-hero-cover {
  height: 140px;
  background:
    radial-gradient(circle at 20% 30%, color-mix(in oklab, var(--primary) 70%, transparent), transparent 60%),
    radial-gradient(circle at 80% 70%, color-mix(in oklab, #8B5CF6 70%, transparent), transparent 60%),
    linear-gradient(135deg, var(--primary), #8B5CF6 60%, #EC4899);
  position: relative;
}
.profile-hero-cover::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(50% 100% at 50% 100%, rgba(0,0,0,0.18), transparent 70%);
}
.profile-hero-body {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 20px;
  align-items: center;
  padding: 0 28px 22px;
  margin-top: -60px;
  position: relative;
}
.profile-avatar-wrap { position: relative; width: 120px; height: 120px; flex-shrink: 0; }
.profile-avatar {
  width: 120px; height: 120px; border-radius: 50%; object-fit: cover;
  border: 4px solid var(--surface);
  background: var(--surface-2);
  box-shadow: 0 14px 32px rgba(15,23,42,0.18);
  display: block;
}
.profile-avatar-fallback { display: grid; place-items: center; }
.profile-avatar-edit {
  position: absolute; bottom: 6px; right: 6px;
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: grid; place-items: center; cursor: pointer;
  border: 3px solid var(--surface);
  box-shadow: 0 4px 12px rgba(0,0,0,0.18);
  transition: transform 0.15s;
}
.profile-avatar-edit:hover { transform: scale(1.08); }

.profile-id { min-width: 0; padding-top: 60px; }
.profile-name { font-family: var(--font-display); font-size: 28px; font-weight: 800; line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 8px; word-break: break-word; }
.profile-id-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.profile-id-chips .chip { font-size: 11px; padding: 3px 9px; }
.profile-bio { font-size: 13.5px; color: var(--text-2); line-height: 1.55; max-width: 560px; }

.profile-hero-actions { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 60px; }

.profile-stats {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px; background: var(--border);
  border-top: 1px solid var(--border);
}
.profile-stat { background: var(--surface); padding: 16px; text-align: center; }
.profile-stat-v { font-family: var(--font-display); font-size: 24px; font-weight: 800; line-height: 1.1; }
.profile-stat-l { font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 700; margin-top: 3px; }

.profile-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.profile-section { padding: 22px; }
.profile-section-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.profile-section-icon {
  width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0;
  background: var(--primary-soft); color: var(--primary);
  display: grid; place-items: center;
}
.profile-section-title { font-weight: 800; font-size: 15px; line-height: 1.2; }
.profile-section-sub   { font-size: 12px; color: var(--text-3); margin-top: 3px; }

.profile-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.profile-field.full { grid-column: 1 / -1; }
.profile-field .label { font-size: 11px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 5px; display: flex; align-items: center; }
.profile-field .input:disabled {
  background: var(--surface-2); color: var(--text); cursor: default;
  border-color: var(--border); opacity: 1;
}

.profile-guardian { display: flex; align-items: center; gap: 14px; padding: 12px; background: var(--surface-2); border-radius: 12px; flex-wrap: wrap; }

@media (max-width: 1024px) {
  .profile-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .profile-hero-body {
    grid-template-columns: 1fr;
    text-align: center;
    padding: 0 18px 18px;
    margin-top: -50px;
  }
  .profile-avatar-wrap { margin: 0 auto; width: 100px; height: 100px; }
  .profile-avatar      { width: 100px; height: 100px; border-width: 3px; }
  .profile-avatar-edit { width: 30px; height: 30px; }
  .profile-id         { padding-top: 0; }
  .profile-id-chips   { justify-content: center; }
  .profile-bio        { margin: 0 auto; }
  .profile-hero-actions { padding-top: 0; justify-content: center; }
  .profile-hero-cover { height: 100px; }
  .profile-stats { grid-template-columns: 1fr 1fr; }
  .profile-stat-v { font-size: 20px; }
  .profile-fields { grid-template-columns: 1fr; }
  .profile-section { padding: 18px; }
  .profile-name { font-size: 22px; }
  .profile-guardian { text-align: left; }
}
@media (max-width: 480px) {
  .profile-hero-cover { height: 80px; }
}

/* ── Payments page (StudentFees) ── */
.pay-hero {
  display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 22px; padding: 30px; border-radius: 22px; margin-bottom: 22px;
  background: linear-gradient(135deg, #0F172A 0%, #1E293B 50%, #312E81 100%);
  color: #fff; position: relative; overflow: hidden;
  box-shadow: 0 24px 60px rgba(15,23,42,0.30);
}
.pay-hero::before { content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(60% 70% at 85% -10%, rgba(99,102,241,0.45), transparent 60%),
    radial-gradient(40% 60% at 0% 100%, rgba(236,72,153,0.25), transparent 60%);
  pointer-events: none; }
.pay-hero > * { position: relative; z-index: 1; }
.pay-hero-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; opacity: 0.78; margin-bottom: 8px; }
.pay-hero-amount { font-family: var(--font-display); font-size: 56px; font-weight: 800; line-height: 1; letter-spacing: -0.03em; }
.pay-hero-sub { margin-top: 12px; font-size: 14px; line-height: 1.55; opacity: 0.86; max-width: 460px; }
.pay-hero-cta { margin-top: 20px; display: inline-flex; align-items: center; gap: 8px; padding: 12px 22px; border-radius: 12px; font-weight: 800; font-size: 14px; border: none; cursor: pointer; background: #fff; color: #0F172A; box-shadow: 0 10px 30px rgba(0,0,0,0.25); transition: transform 0.15s ease, box-shadow 0.15s ease; }
.pay-hero-cta:hover { transform: translateY(-2px); box-shadow: 0 16px 36px rgba(0,0,0,0.35); }
.pay-hero-stats { display: grid; grid-template-columns: 1fr; gap: 10px; align-content: center; }
.pay-hero-stat { background: rgba(255,255,255,0.10); border: 1px solid rgba(255,255,255,0.14); backdrop-filter: blur(6px); padding: 14px 16px; border-radius: 14px; }
.pay-hero-stat .v { font-family: var(--font-display); font-size: 22px; font-weight: 800; line-height: 1.1; }
.pay-hero-stat .l { font-size: 11.5px; opacity: 0.78; text-transform: uppercase; letter-spacing: 0.06em; margin-top: 3px; font-weight: 700; }

.pay-list { display: flex; flex-direction: column; gap: 14px; }
.pay-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 18px; transition: border-color 0.15s, box-shadow 0.15s; }
.pay-card:hover { box-shadow: var(--shadow-lg); border-color: color-mix(in oklab, var(--primary) 22%, var(--border)); }
.pay-card.cleared { background: linear-gradient(180deg, color-mix(in oklab, var(--success-soft) 50%, var(--surface)), var(--surface)); border-color: color-mix(in oklab, var(--success) 30%, var(--border)); }
.pay-card-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 16px; }
.pay-card-thumb {
  position: relative; width: 88px; height: 88px; border-radius: 14px; overflow: hidden;
  flex-shrink: 0; display: grid; place-items: center;
  box-shadow: 0 10px 22px rgba(15,23,42,0.16);
}
.pay-card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.pay-card-thumb-pill { position: absolute; bottom: 6px; left: 6px; display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 999px; font-size: 9.5px; font-weight: 800; color: #fff; text-transform: uppercase; letter-spacing: 0.05em; }
.pay-card-meta { flex: 1; min-width: 0; }
.pay-card-title { font-weight: 800; font-size: 17px; line-height: 1.3; margin-bottom: 6px; }
.pay-card-sub { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--text-3); }
.pay-card-sub span { display: inline-flex; align-items: center; gap: 4px; }
.pay-card-batch { background: var(--surface-2); padding: 2px 8px; border-radius: 999px; color: var(--text-2); font-weight: 600; }

.pay-card-viz {
  background: var(--surface-2); border-radius: 12px; padding: 14px 16px;
  margin-bottom: 14px;
}
.pay-viz-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.pay-viz-row > div:not(.pay-viz-divider) { flex: 1; min-width: 90px; }
.pay-viz-divider { width: 1px; align-self: stretch; background: var(--border); flex: 0 0 1px; }
.pay-viz-num { font-family: var(--font-display); font-size: 20px; font-weight: 800; line-height: 1.1; }
.pay-viz-lbl { font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 700; margin-top: 3px; }

.pay-progress { position: relative; height: 12px; border-radius: 999px; background: var(--surface); margin-top: 14px; overflow: hidden; }
.pay-progress-bar { height: 100%; border-radius: 999px; transition: width 0.5s ease; }
.pay-progress-pct { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); font-size: 10px; font-weight: 800; color: var(--text-2); }

.pay-month-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(48px, 1fr)); gap: 8px; margin-top: 14px; }
.pay-month { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.pay-month-dot { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 12px; border: 2px solid var(--border); background: var(--surface); color: var(--text-3); transition: all 0.15s; }
.pay-month-lbl { font-size: 10px; font-weight: 700; color: var(--text-3); text-transform: uppercase; }
.pay-month.paid .pay-month-dot { background: var(--success); color: #fff; border-color: var(--success); box-shadow: 0 4px 10px rgba(34,197,94,0.30); }
.pay-month.due  .pay-month-dot { background: var(--warning); color: #fff; border-color: var(--warning); animation: pulse-warn 1.5s infinite; }
.pay-month.future .pay-month-dot { opacity: 0.45; }
@keyframes pulse-warn { 0%,100% { box-shadow: 0 0 0 0 rgba(245,158,11,0.5); } 50% { box-shadow: 0 0 0 6px rgba(245,158,11,0); } }

.pay-card-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.pay-card-actions .btn { font-size: 13px; }
.pay-form { margin-top: 14px; padding: 16px; background: var(--surface-2); border-radius: 12px; border: 1px solid var(--border); animation: rise-in 0.2s ease; }
.pay-form-title { font-weight: 800; font-size: 14px; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.pay-form-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 12px; }
.pay-quickamt { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.pay-form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 14px; }

.pay-history { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--border); display: flex; flex-direction: column; gap: 8px; }
.pay-history-title { font-size: 11px; font-weight: 800; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 4px; }
.pay-history-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: var(--surface-2); border-radius: 10px; }
.pay-history-dot { width: 28px; height: 28px; border-radius: 50%; background: var(--success); color: #fff; display: grid; place-items: center; flex-shrink: 0; }
.pay-history-amt { font-family: var(--font-display); font-weight: 800; font-size: 16px; min-width: 90px; }
.pay-history-mid { flex: 1; min-width: 0; }
.pay-history-note { font-size: 13px; font-weight: 700; }
.pay-history-meta { font-size: 11.5px; color: var(--text-3); margin-top: 1px; }

@media (max-width: 760px) {
  .pay-hero { grid-template-columns: 1fr; padding: 22px; }
  .pay-hero-amount { font-size: 42px; }
  .pay-hero-stats { grid-template-columns: 1fr 1fr 1fr; }
  .pay-card-head { flex-direction: column; align-items: stretch; }
  .pay-card-thumb { width: 100%; height: 120px; }
  .pay-form-grid { grid-template-columns: 1fr; }
  .pay-card-actions .btn { flex: 1; justify-content: center; }
}
@media (max-width: 480px) {
  .pay-hero-stats { grid-template-columns: 1fr; }
  .pay-viz-row { gap: 8px; }
  .pay-viz-divider { display: none; }
  .pay-viz-row > div:not(.pay-viz-divider) { flex: 1 1 45%; }
}

/* ── Q&A Forum ── */
.qa-list { display: flex; flex-direction: column; gap: 12px; }
.qa-card { display: flex; gap: 18px; align-items: flex-start; cursor: pointer; transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease; }
.qa-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: color-mix(in oklab, var(--primary) 30%, var(--border)); }
.qa-stat { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 68px; padding: 4px 0; }
.qa-stat-row { display: flex; flex-direction: column; align-items: center; gap: 1px; }
.qa-stat-row.done { color: var(--success); }
.qa-stat-num { font-family: var(--font-display); font-weight: 800; font-size: 20px; line-height: 1; }
.qa-stat-lbl { font-size: 10px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 700; }
.qa-body { flex: 1; min-width: 0; }
.qa-meta-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.qa-meta-chips .chip { font-size: 10.5px; padding: 3px 8px; }
.qa-title { font-weight: 700; font-size: 16px; line-height: 1.35; margin-bottom: 4px; word-break: break-word; }
.qa-snippet { font-size: 12.5px; color: var(--text-2); line-height: 1.55; margin-bottom: 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.qa-meta { display: flex; gap: 14px; font-size: 11.5px; color: var(--text-3); flex-wrap: wrap; }
.qa-meta span { display: inline-flex; align-items: center; gap: 4px; }

.qa-thread { display: flex; gap: 18px; align-items: flex-start; }
.qa-thread-vote { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 44px; padding-top: 2px; }
.qa-thread-votes { font-family: var(--font-display); font-weight: 800; font-size: 18px; }
.qa-thread-body { font-size: 14.5px; line-height: 1.7; white-space: pre-wrap; word-break: break-word; }
.qa-image-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-top: 14px; }
.qa-image-thumb { aspect-ratio: 4/3; overflow: hidden; border-radius: 10px; cursor: zoom-in; background: var(--surface-2); border: 1px solid var(--border); }
.qa-image-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.2s; }
.qa-image-thumb:hover img { transform: scale(1.04); }

.qa-answer { position: relative; padding-left: 18px; }
.qa-answer.accepted { border-color: color-mix(in oklab, var(--success) 36%, var(--border)); background: linear-gradient(180deg, color-mix(in oklab, var(--success-soft) 60%, var(--surface)), var(--surface)); }
.qa-answer-accepted { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 800; color: var(--success); margin-bottom: 8px; padding: 4px 10px; background: var(--success-soft); border-radius: 999px; }
.qa-answer-meta { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--border); flex-wrap: wrap; }

.qa-lightbox { position: fixed; inset: 0; background: rgba(0,0,0,0.85); z-index: 999; display: grid; place-items: center; padding: 30px; animation: fadeIn 0.18s ease; }
.qa-lightbox img { max-width: 100%; max-height: 100%; border-radius: 8px; box-shadow: 0 20px 60px rgba(0,0,0,0.6); cursor: zoom-out; }
.qa-lightbox-close { position: absolute; top: 18px; right: 18px; background: rgba(255,255,255,0.12); color: #fff; }
.qa-lightbox-close:hover { background: rgba(255,255,255,0.22); }

.qa-ask-form { display: flex; flex-direction: column; gap: 18px; }
.qa-ask-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.qa-hint { font-size: 11px; color: var(--text-3); margin-top: 4px; }
.qa-img-upload { display: flex; flex-direction: column; gap: 12px; }
.qa-img-drop { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 26px 20px; border: 2px dashed var(--border); border-radius: 14px; background: var(--surface-2); text-align: center; cursor: pointer; transition: border-color 0.15s, background 0.15s; color: var(--text-2); }
.qa-img-drop:hover { border-color: var(--primary); background: color-mix(in oklab, var(--primary-soft) 60%, var(--surface-2)); }
.qa-img-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.qa-img-thumb-edit { position: relative; aspect-ratio: 4/3; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); background: var(--surface-2); }
.qa-img-thumb-edit img { width: 100%; height: 100%; object-fit: cover; display: block; }
.qa-img-remove { position: absolute; top: 5px; right: 5px; width: 26px; height: 26px; border-radius: 8px; border: none; background: rgba(15,23,42,0.7); color: #fff; display: grid; place-items: center; cursor: pointer; }
.qa-img-remove:hover { background: var(--danger); }
.qa-ask-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }

@media (max-width: 640px) {
  .qa-card { gap: 12px; padding: 14px; }
  .qa-stat { min-width: 52px; flex-direction: row; gap: 12px; }
  .qa-stat-row { flex-direction: row; gap: 4px; align-items: baseline; }
  .qa-stat-num { font-size: 15px; }
  .qa-stat-lbl { font-size: 10px; }
  .qa-title { font-size: 14.5px; }
  .qa-thread { gap: 12px; }
  .qa-thread-vote { min-width: 36px; }
  .qa-ask-grid { grid-template-columns: 1fr; }
  .qa-ask-actions { flex-direction: column-reverse; }
  .qa-ask-actions .btn { width: 100%; justify-content: center; }
}
/* (Subtitle on filter-pages is kept visible on mobile too — see filterbar block below) */

/* ── Page filter bar (dropdown filters · responsive) ── */
.filterbar { position: relative; display: flex; align-items: flex-end; gap: 8px; }
.filterbar-inline { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.filter-field { display: flex; flex-direction: column; gap: 3px; }
.filter-field > span { font-size: 10px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.05em; }
.filter-select { height: 36px; font-size: 13px; padding: 0 26px 0 10px; min-width: 132px; cursor: pointer; }
.filterbar-toggle { display: none; position: relative; }
.filterbar-badge { position: absolute; top: 3px; right: 3px; min-width: 15px; height: 15px; padding: 0 3px; border-radius: 999px; background: var(--primary); color: #fff; font-size: 9px; font-weight: 800; display: grid; place-items: center; }
.filterbar-scrim { position: fixed; inset: 0; z-index: 60; }
.filterbar-panel { position: absolute; top: calc(100% + 8px); right: 0; z-index: 61; width: 244px; max-width: 80vw; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 14px; display: flex; flex-direction: column; gap: 12px; animation: pop 0.18s var(--tx); }
.filterbar-panel .filter-field { gap: 5px; }
.filterbar-panel .filter-select { width: 100%; height: 40px; }
.filterbar-phead { display: flex; justify-content: space-between; align-items: center; font-weight: 800; font-size: 13px; }
@media (max-width: 760px) {
  .filterbar-inline { display: none; }
  .filterbar-toggle { display: grid; }
  .page-head:has(.filterbar) { align-items: center; }
}

/* fill-mode is `backwards`, NOT `both`. Both of these animations END at the
   element's natural state (translateY(0)/scale(1)), so the `forwards` half of
   `both` added nothing — except that retaining a transform makes the element a
   containing block for `position: fixed` descendants. That trapped every modal
   / lightbox rendered inside a page: the overlay sized itself to the content
   column instead of the viewport. `backwards` keeps the no-flash start and
   leaves no transform behind. */
.anim-on .page-enter { animation: slide-up 0.45s var(--tx) backwards; }
.anim-on .pop { animation: pop 0.3s var(--tx) backwards; }
.anim-on .float { animation: float 4s ease-in-out infinite; }

/* Mobile */
.mobile-toggle { display: none; }
.scrim { display: none; }
@media (max-width: 980px) {
  .sidebar { position: fixed; transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-xl); }
  .scrim.show { display: block; position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 45; }
  .mobile-toggle { display: grid; }
  .content { padding: 16px 16px 64px; }
  .topbar { padding: 0 16px; }
  .search { display: none; }
  .topbar-avatar .nm { display: none; }
  .page-title { font-size: 22px; }
}

/* Reduced motion */
[data-motion="off"] *, [data-motion="off"] *::before, [data-motion="off"] *::after {
  animation-duration: 0.001ms !important;
  transition-duration: 0.001ms !important;
}

/* Skeletons */
.skeleton { position: relative; overflow: hidden; background: var(--surface-2); border-radius: 8px; }
.skeleton::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, color-mix(in oklab, var(--text) 6%, transparent), transparent); animation: shimmer 1.5s infinite; }

/* Avatars */
.av {
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  color: #fff; font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  flex-shrink: 0;
}
.av-sm { width: 28px; height: 28px; font-size: 11px; }
.av-lg { width: 56px; height: 56px; font-size: 18px; }
.av-xl { width: 80px; height: 80px; font-size: 24px; }

/* Utility colors for varied avatars */
.av-1 { background: linear-gradient(135deg, #F97316, #DC2626); }
.av-2 { background: linear-gradient(135deg, #14B8A6, #0EA5E9); }
.av-3 { background: linear-gradient(135deg, #8B5CF6, #EC4899); }
.av-4 { background: linear-gradient(135deg, #22C55E, #14B8A6); }
.av-5 { background: linear-gradient(135deg, #F59E0B, #F97316); }
.av-6 { background: linear-gradient(135deg, #6366F1, #8B5CF6); }
.av-7 { background: linear-gradient(135deg, #EC4899, #F43F5E); }

/* Progress */
.progress { height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), var(--accent)); border-radius: 999px; transition: width 0.6s var(--tx); }

/* Section */
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.section-title { font-family: var(--font-display); font-size: 18px; font-weight: 700; letter-spacing: -0.01em; margin: 0; }

/* Tabs */
.tabs { display: flex; gap: 4px; padding: 4px; background: var(--surface-2); border-radius: 12px; width: fit-content; }
.tab { padding: 8px 16px; border-radius: 9px; font-size: 13px; font-weight: 600; color: var(--text-2); transition: all 0.15s var(--tx); }
.tab.active { background: var(--surface); color: var(--primary); box-shadow: var(--shadow-sm); }

/* ── Table ──────────────────────────────────────────────────── */
.tbl, .table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  line-height: 1.5;
}

/* Header */
.tbl th, .table th {
  padding: 11px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-3);
  background: var(--surface-2);
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
  user-select: none;
}

/* Body cells */
.tbl td, .table td {
  padding: 13px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--text);
}

/* Last row — remove bottom divider */
.tbl tbody tr:last-child td, .table tbody tr:last-child td { border-bottom: none; }

/* Row hover */
.tbl tbody tr, .table tbody tr { transition: background 0.12s; }
.tbl tbody tr:hover td, .table tbody tr:hover td {
  background: color-mix(in oklab, var(--primary) 6%, transparent);
}

/* Alternating row tint (opt-in via .table-stripe) */
.table-stripe tbody tr:nth-child(even) td { background: var(--surface-2); }
.table-stripe tbody tr:nth-child(even):hover td { background: color-mix(in oklab, var(--primary) 6%, transparent); }

/* Scrollable standalone wrapper */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.table-wrap .table, .table-wrap .tbl { border-radius: 0; }
.table-wrap .table thead th, .table-wrap .tbl thead th { border-top: none; }
.table-wrap .table tbody tr:last-child td, .table-wrap .tbl tbody tr:last-child td { border-bottom: none; }

/* Print-friendly ID card etc */
.dotgrid {
  background-image: radial-gradient(circle at 1px 1px, color-mix(in oklab, var(--text) 10%, transparent) 1px, transparent 0);
  background-size: 18px 18px;
}

/* ═══════════════════════════════════════════════════════════════════
   Global responsive baseline — applies to every page in the student
   portal (and the shared common bits the guest/admin portals use).
   ═══════════════════════════════════════════════════════════════════ */

/* Laptops & small desktops (≤ 1200px) — tighten content padding so cards breathe */
@media (max-width: 1200px) {
  .content { padding: 22px 24px 60px; }
}

/* Tablets (≤ 980px) — sidebar collapses (already handled), reduce page paddings */
@media (max-width: 980px) {
  .content { padding: 18px 18px 60px; }
  .page-head { gap: 14px; margin-bottom: 18px; }
  .page-title { font-size: 22px; }
  .card { padding: 18px; }
  /* Collapse fixed-sidebar grids written inline so the right rail stacks below */
  [style*="grid-template-columns: minmax(0, 1fr) 240px"],
  [style*="grid-template-columns: minmax(0, 1fr) 272px"],
  [style*="grid-template-columns: minmax(0, 1fr) 310px"],
  [style*="grid-template-columns: minmax(0, 1fr) 320px"],
  [style*="grid-template-columns: minmax(0, 1fr) 330px"],
  [style*="grid-template-columns: minmax(0, 1fr) 340px"],
  [style*="grid-template-columns: minmax(0, 1fr) 360px"],
  [style*="grid-template-columns: minmax(0,1fr) 240px"],
  [style*="grid-template-columns: minmax(0,1fr) 272px"],
  [style*="grid-template-columns: minmax(0,1fr) 310px"],
  [style*="grid-template-columns: minmax(0,1fr) 320px"],
  [style*="grid-template-columns: minmax(0,1fr) 330px"],
  [style*="grid-template-columns: minmax(0,1fr) 340px"],
  [style*="grid-template-columns: minmax(0,1fr) 360px"],
  [style*="grid-template-columns: minmax(0, 1fr) 1.4fr"],
  [style*="grid-template-columns: minmax(0,1fr) 1.4fr"],
  [style*="grid-template-columns: 240px minmax"],
  [style*="grid-template-columns: 272px minmax"],
  [style*="grid-template-columns: 280px minmax"],
  [style*="grid-template-columns: 310px minmax"],
  [style*="grid-template-columns: 320px minmax"],
  [style*="grid-template-columns: 340px minmax"],
  [style*="grid-template-columns: 350px 1fr"] {
    grid-template-columns: 1fr !important;
    align-items: stretch !important;
  }
  /* Stop big inline gaps from creating excessive whitespace */
  [style*="gap: 24px"] { gap: 16px !important; }
  [style*="gap: 28px"] { gap: 18px !important; }
  [style*="gap: 32px"] { gap: 20px !important; }
}

/* Phones (≤ 760px) */
@media (max-width: 760px) {
  .content { padding: 14px 14px 56px; }
  /* Mobile + tablet: keep the heading on one row — title + subtitle on the
     LEFT, filter button on the RIGHT, space-between. */
  .page-head {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
  }
  .page-head > :first-child { flex: 1; min-width: 0; }
  .page-head > :not(:first-child) { flex-shrink: 0; }
  .page-head .page-title { font-size: 19px; line-height: 1.25; margin: 0 0 2px; word-break: break-word; }
  .page-head .page-sub   { font-size: 12.5px; line-height: 1.4; }
  .card { padding: 14px; border-radius: 12px; }
  .row { flex-wrap: wrap; gap: 12px; }
  .col { gap: 12px; }

  /* Tabs scroll horizontally instead of wrapping/overflowing */
  .tabs {
    width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { white-space: nowrap; flex-shrink: 0; padding: 7px 12px; font-size: 12.5px; }

  /* Tables become horizontally scrollable so columns don't get crushed */
  .card .table, .card .tbl { min-width: 540px; }
  .card:has(> .table), .card:has(> .tbl) { padding: 0; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table-wrap { border-radius: 12px; }

  /* Buttons inside the typical "row" of action buttons stretch 50/50 */
  .row > .btn { flex: 1; min-width: 0; justify-content: center; }

  /* Big inline padding shrinks too (React renders inline padding WITHOUT quotes) */
  [style*="padding: 24px"], [style*="padding: 28px"], [style*="padding: 32px"], [style*="padding: 36px"] { padding: 16px !important; }
  [style*="padding: 36px 40px"], [style*="padding: 36px 36px"], [style*="padding: 28px 32px"] { padding: 18px 16px !important; }

  /* Display-font hero numbers shouldn't dwarf small phones */
  [style*="font-size: 36px"], [style*="font-size: 38px"], [style*="font-size: 40px"], [style*="font-size: 42px"] { font-size: 28px !important; }
  [style*="font-size: 32px"], [style*="font-size: 34px"] { font-size: 24px !important; }

  /* Generic two-column inline grids collapse */
  [style*="grid-template-columns: repeat(2, 1fr)"] { grid-template-columns: 1fr !important; }
  [style*="grid-template-columns: 1fr 1fr"]:not([style*="repeat"]) { grid-template-columns: 1fr !important; }
}

/* Small phones (≤ 480px) */
@media (max-width: 480px) {
  .content { padding: 12px 10px 56px; }
  /* On very small phones, keep the 2-column row but shrink everything */
  .page-head { gap: 10px; }
  .page-head .page-title { font-size: 17px; }
  .page-head .page-sub   { font-size: 11.5px; }
  .card { padding: 12px; border-radius: 10px; }
  .topbar { padding: 0 12px; gap: 10px; height: 60px; }
  .tab { padding: 6px 10px; font-size: 12px; }

  /* Stat grids — collapse to single column on very narrow */
  [style*="repeat(auto-fit, minmax(220px"],
  [style*="repeat(auto-fit, minmax(240px"],
  [style*="repeat(auto-fit, minmax(260px"],
  [style*="repeat(auto-fit, minmax(280px"],
  [style*="repeat(auto-fit, minmax(300px"],
  [style*="repeat(auto-fill, minmax(220px"],
  [style*="repeat(auto-fill, minmax(240px"],
  [style*="repeat(auto-fill, minmax(260px"],
  [style*="repeat(auto-fill, minmax(280px"],
  [style*="repeat(auto-fill, minmax(300px"] {
    grid-template-columns: 1fr !important;
  }

  /* 3-stat rows usually collapse on a tiny phone */
  [style*="grid-template-columns: repeat(3, 1fr)"] { grid-template-columns: 1fr 1fr !important; }
  [style*="grid-template-columns: repeat(4, 1fr)"] { grid-template-columns: 1fr 1fr !important; }
  [style*="grid-template-columns: repeat(5, 1fr)"] { grid-template-columns: 1fr 1fr !important; }
  [style*="grid-template-columns: repeat(6, 1fr)"] { grid-template-columns: 1fr 1fr !important; }

  /* Display-font numbers shrink more aggressively */
  [style*="font-size: 48px"], [style*="font-size: 52px"], [style*="font-size: 56px"], [style*="font-size: 60px"] { font-size: 32px !important; }
}

/* Wide laptops & desktops (≥ 1400px) — extra breathing room for long lines */
@media (min-width: 1400px) {
  .content { padding: 28px 36px 72px; }
}
@media (min-width: 1800px) {
  .content { padding: 32px 40px 80px; max-width: 1600px; }
}

/* ════════════════════════════════════════════════════════════════════
   EXAM RUNNER — fullscreen-friendly, fully responsive layout.
   The runner renders ALL questions in a single scroll list so
   students answer by scrolling instead of tapping Next/Prev. The
   sticky header keeps the timer + submit always reachable. The
   floating exit-fullscreen warning lives on top.
   ════════════════════════════════════════════════════════════════════ */
/* When the exam runner is mounted, body.nnp-exam-active strips the portal
   chrome so the exam takes the full viewport — no sidebar, no topbar, no
   floating widgets. This pairs with requestFullscreen for a real exam-mode
   feel and prevents the question card from rendering inside a cramped
   secondary column. */
body.nnp-exam-active .sidebar,
body.nnp-exam-active .topbar,
body.nnp-exam-active .scrim,
body.nnp-exam-active .contact-fab,
body.nnp-exam-active .live-chat-widget,
body.nnp-exam-active .live-chat-fab,
body.nnp-exam-active [data-portal-chrome] { display: none !important; }
body.nnp-exam-active .main { margin-left: 0 !important; }
body.nnp-exam-active .content {
  padding: 18px 18px 80px !important;
  max-width: 1100px;
  margin: 0 auto;
}
body.nnp-exam-active { overflow-y: auto; }

.exam-runner {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 4px 80px;
  position: relative;
}
.exam-runner-head {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.06);
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.exam-runner-title {
  flex: 1;
  min-width: 0;
}
.exam-runner-name {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 800;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.exam-runner-sub {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 2px;
  font-weight: 600;
}
.exam-runner-timer {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 17px;
  color: var(--text);
  flex-shrink: 0;
}
.exam-runner-timer.danger {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: var(--danger);
  animation: examTimerPulse 1s ease-in-out infinite;
}
@keyframes examTimerPulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.05); }
}
.exam-runner-submit {
  flex-shrink: 0;
}
.exam-runner-progress {
  height: 6px;
  background: var(--surface-2);
  border-radius: 4px;
  margin-bottom: 16px;
  overflow: hidden;
}
.exam-runner-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 4px;
  transition: width 0.25s ease;
}
.exam-runner-questions {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
/* Subject section header — shown only when a multi-subject exam groups
   its questions into per-subject sections. */
.exam-runner-section {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 14px 18px;
  margin-top: 14px;
  background: linear-gradient(90deg, var(--primary), color-mix(in oklab, var(--accent) 75%, var(--primary)));
  color: #fff;
  border-radius: 12px;
  flex-wrap: wrap;
  box-shadow: 0 6px 18px color-mix(in oklab, var(--primary) 22%, transparent);
}
.exam-runner-section:first-child { margin-top: 0; }
.exam-runner-section-num {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  opacity: 0.8;
  text-transform: uppercase;
}
.exam-runner-section-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  flex: 1;
  min-width: 0;
}
.exam-runner-section-meta {
  font-size: 11.5px;
  font-weight: 600;
  opacity: 0.85;
  background: rgba(255, 255, 255, 0.16);
  padding: 3px 10px;
  border-radius: 999px;
}
@media (max-width: 640px) {
  .exam-runner-section { padding: 12px 14px; }
  .exam-runner-section-title { font-size: 17px; }
}
.exam-runner-q-card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px 22px 18px;
  scroll-margin-top: 96px;       /* offset for sticky header when scrolled into view */
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.exam-runner-q-card:hover {
  border-color: color-mix(in oklab, var(--primary) 30%, var(--border));
  box-shadow: 0 6px 22px rgba(15, 23, 42, 0.06);
}
.exam-runner-q-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.exam-runner-q-num {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.04em;
  color: var(--primary);
}
.exam-runner-q-num::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
}
.exam-runner-q-marks {
  font-size: 11px;
  color: var(--text-3);
  font-weight: 700;
  letter-spacing: 0.06em;
  background: var(--surface-2);
  padding: 4px 10px;
  border-radius: 999px;
  text-transform: uppercase;
}
.exam-runner-q-text {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.55;
  margin-bottom: 16px;
  color: var(--text);
}
.exam-runner-q-opts {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.exam-runner-q-opt {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 12px;
  cursor: pointer;
  background: var(--surface);
  border: 2px solid var(--border);
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.12s ease;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.exam-runner-q-opt:hover {
  background: color-mix(in oklab, var(--primary) 5%, var(--surface));
  border-color: color-mix(in oklab, var(--primary) 35%, var(--border));
}
.exam-runner-q-opt:active { transform: scale(0.995); }
.exam-runner-q-opt.selected {
  background: var(--primary-soft);
  border-color: var(--primary);
  box-shadow: 0 4px 14px color-mix(in oklab, var(--primary) 20%, transparent);
}
.exam-runner-q-opt input[type='radio'] {
  margin: 0;
  accent-color: var(--primary);
  flex-shrink: 0;
  width: 16px;
  height: 16px;
}
.exam-runner-q-letter {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--text-2);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 13px;
  flex-shrink: 0;
  font-family: var(--font-display);
  transition: background 0.18s ease, color 0.18s ease;
}
.exam-runner-q-opt.selected .exam-runner-q-letter {
  background: var(--primary);
  color: #fff;
}
.exam-runner-q-opt-text {
  flex: 1;
  font-size: 14.5px;
  font-weight: 500;
  line-height: 1.5;
  min-width: 0;
  word-break: break-word;
  color: var(--text);
}
.exam-runner-q-opt.selected .exam-runner-q-opt-text {
  font-weight: 600;
  color: var(--text);
}
.exam-runner-bottom-submit {
  margin-top: 12px;
  padding: 18px;
  background: var(--surface-1);
  border: 2px dashed var(--border);
  border-radius: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.exam-runner-bottom-summary {
  font-size: 14px;
  color: var(--text-2);
}

/* ── Mobile (≤ 640px) ── */
@media (max-width: 640px) {
  .exam-runner { padding: 0 0 100px; }
  .exam-runner-head {
    padding: 10px 12px;
    border-radius: 10px;
    gap: 8px;
  }
  .exam-runner-name { font-size: 14.5px; }
  .exam-runner-sub  { font-size: 11.5px; }
  .exam-runner-timer { font-size: 15px; padding: 6px 10px; }
  .exam-runner-submit { padding: 8px 12px; font-size: 12.5px; }
  .exam-runner-q-card { padding: 14px 13px; border-radius: 12px; }
  .exam-runner-q-text { font-size: 14.5px; }
  .exam-runner-q-opt { padding: 11px 12px; }
  .exam-runner-q-opt-text { font-size: 13.5px; }
  .exam-runner-q-letter { width: 26px; height: 26px; font-size: 11.5px; }
  .exam-runner-bottom-submit { padding: 14px; flex-direction: column; }
  .exam-runner-bottom-submit .btn-lg { width: 100%; justify-content: center; }
}
/* ── Very small (≤ 380px) ── */
@media (max-width: 380px) {
  .exam-runner-name { white-space: normal; }
  .exam-runner-head { flex-direction: column; align-items: stretch; }
  .exam-runner-title { width: 100%; }
  .exam-runner-timer, .exam-runner-submit { width: 100%; justify-content: center; }
}

/* ════════════════════════════════════════════════════════════════════
   Exam Prep / Result / Hub — keep them readable on mobile.
   ════════════════════════════════════════════════════════════════════ */
.exam-prep-grid, .exam-result-grid {
  display: grid;
  gap: 18px;
}
.exam-prep-grid  { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }
.exam-result-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); }
@media (max-width: 900px) {
  .exam-prep-grid, .exam-result-grid {
    grid-template-columns: 1fr;
  }
}

/* ════════════════════════════════════════════════════════════════════
   Auto-submit overlay — appears when time runs out OR student exits
   fullscreen during a live exam. Replaces the browser's native alert().
   Renders ABOVE everything (z-index 9999) including fullscreen video.
   ════════════════════════════════════════════════════════════════════ */
.exam-autosubmit-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  padding: 20px;
  animation: examOverlayFade 0.2s ease-out;
}
@keyframes examOverlayFade {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.exam-autosubmit-card {
  background: var(--surface-1);
  border-radius: 20px;
  padding: 36px 32px 32px;
  max-width: 460px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  animation: examCardPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes examCardPop {
  from { transform: scale(0.85); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}
.exam-autosubmit-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--danger), #F97316);
  color: #fff;
  display: grid;
  place-items: center;
  margin: 0 auto 18px;
  box-shadow: 0 8px 24px color-mix(in oklab, var(--danger) 40%, transparent);
  animation: examIconShake 0.5s ease-in-out;
}
@keyframes examIconShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-4px) rotate(-5deg); }
  40% { transform: translateX(4px) rotate(5deg); }
  60% { transform: translateX(-3px) rotate(-3deg); }
  80% { transform: translateX(3px) rotate(3deg); }
}
.exam-autosubmit-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 8px;
  line-height: 1.3;
}
.exam-autosubmit-msg {
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.6;
  margin-bottom: 22px;
}
.exam-autosubmit-spinner {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  background: var(--primary-soft);
  color: var(--primary);
  border-radius: 999px;
  font-weight: 700;
  font-size: 13px;
}
.exam-spinner-ring {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid color-mix(in oklab, var(--primary) 30%, transparent);
  border-top-color: var(--primary);
  animation: examSpin 0.8s linear infinite;
}
@keyframes examSpin {
  to { transform: rotate(360deg); }
}
@media (max-width: 480px) {
  .exam-autosubmit-card { padding: 28px 22px 24px; border-radius: 16px; }
  .exam-autosubmit-icon { width: 64px; height: 64px; }
  .exam-autosubmit-title { font-size: 18px; }
  .exam-autosubmit-msg { font-size: 13px; }
}

/* ════════════════════════════════════════════════════════════════════
   Exam Analysis (result detail) page — polished dashboard
   ════════════════════════════════════════════════════════════════════ */
.exam-analysis { max-width: 1100px; margin: 0 auto; }

/* Hero — gauge + verdict */
.exam-analysis-hero {
  display: grid;
  grid-template-columns: minmax(0, 240px) 1fr;
  gap: 28px;
  background: linear-gradient(135deg, #0F172A 0%, #1E1A3A 70%);
  color: #fff;
  border-radius: 22px;
  padding: 30px;
  margin-bottom: 18px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(15, 23, 42, 0.18);
}
.exam-analysis-hero::before {
  content: '';
  position: absolute;
  top: -40%;
  right: -10%;
  width: 380px;
  height: 380px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.4) 0%, transparent 70%);
  pointer-events: none;
}
.exam-analysis-gauge {
  position: relative;
  width: 180px;
  height: 180px;
  display: grid;
  place-items: center;
  justify-self: center;
}
.exam-analysis-gauge.pass circle:last-child { filter: drop-shadow(0 0 12px rgba(34, 197, 94, 0.6)); }
.exam-analysis-gauge.fail circle:last-child { filter: drop-shadow(0 0 12px rgba(239, 68, 68, 0.55)); }
.exam-analysis-gauge svg {
  position: absolute;
  inset: 0;
}
.exam-analysis-gauge-inner {
  position: relative;
  z-index: 1;
  text-align: center;
}
.exam-analysis-gauge-num {
  font-family: var(--font-display);
  font-size: 48px;
  font-weight: 900;
  line-height: 1;
  color: #fff;
}
.exam-analysis-gauge-num span {
  font-size: 22px;
  margin-left: 2px;
  opacity: 0.7;
}
.exam-analysis-gauge-sub {
  margin-top: 6px;
  font-size: 13px;
  font-weight: 700;
  opacity: 0.75;
  letter-spacing: 0.04em;
}
.exam-analysis-verdict {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  position: relative;
  z-index: 1;
  min-width: 0;
}
.exam-analysis-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.08em;
  width: fit-content;
}
.exam-analysis-badge.pass { background: rgba(34, 197, 94, 0.25); color: #4ADE80; }
.exam-analysis-badge.fail { background: rgba(239, 68, 68, 0.25); color: #FCA5A5; }
.exam-analysis-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 800;
  line-height: 1.25;
}
.exam-analysis-msg {
  font-size: 14px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.78);
  max-width: 560px;
}
.exam-analysis-meta {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 8px;
}
.exam-analysis-meta > div {
  background: rgba(255, 255, 255, 0.08);
  padding: 10px 12px;
  border-radius: 12px;
  backdrop-filter: blur(6px);
}
.exam-analysis-meta .lbl {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.7;
}
.exam-analysis-meta .val {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 18px;
  margin-top: 3px;
}

/* Breakdown stat cards */
.exam-analysis-breakdown {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}
.exam-analysis-bd-stat {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 14px;
}
.exam-analysis-bd-ic {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.exam-analysis-bd-stat.correct .exam-analysis-bd-ic { background: var(--success-soft); color: var(--success); }
.exam-analysis-bd-stat.wrong   .exam-analysis-bd-ic { background: var(--danger-soft); color: var(--danger); }
.exam-analysis-bd-stat.skipped .exam-analysis-bd-ic { background: var(--surface-2);   color: var(--text-3); }
.exam-analysis-bd-stat.marks   .exam-analysis-bd-ic { background: var(--primary-soft); color: var(--primary); }
.exam-analysis-bd-num {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 22px;
  line-height: 1;
}
.exam-analysis-bd-lbl {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-3);
  font-weight: 600;
}

/* Stacked accuracy bar */
.exam-analysis-bar-wrap {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 18px;
}
.exam-analysis-bar {
  display: flex;
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--surface-2);
}
.exam-analysis-bar span {
  display: block;
  transition: flex 0.6s ease;
}
.exam-analysis-bar-legend {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
}
.exam-analysis-bar-legend .dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}

/* View Questions CTA */
.exam-analysis-cta { margin-bottom: 16px; }
.exam-analysis-cta-card {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 20px 22px;
  background: linear-gradient(135deg, var(--primary-soft), color-mix(in oklab, var(--accent) 18%, transparent));
  border: 1px solid color-mix(in oklab, var(--primary) 25%, transparent);
  border-radius: 16px;
}
.exam-analysis-cta-card .cta-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: #fff;
  color: var(--primary);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.18);
}
.exam-analysis-cta-card .cta-body {
  flex: 1;
  min-width: 0;
}
.exam-analysis-cta-card .cta-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 17px;
  margin-bottom: 4px;
}
.exam-analysis-cta-card .cta-msg {
  font-size: 13.5px;
  color: var(--text-2);
  line-height: 1.5;
}
.exam-analysis-cta-card .btn { flex-shrink: 0; }
.exam-analysis-cta-lock {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 22px;
  background: var(--warning-soft);
  border: 1px dashed var(--warning);
  border-radius: 14px;
  color: var(--warning);
}
.exam-analysis-cta-lock .cta-title { font-weight: 800; font-size: 14px; }
.exam-analysis-cta-lock .cta-msg { font-size: 12.5px; color: var(--text-2); margin-top: 2px; }

/* Per-question review */
.exam-analysis-review {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
/* Subject section header inside review */
.exam-review-section {
  margin-top: 18px;
}
.exam-review-section:first-child { margin-top: 0; }
.exam-review-section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 16px 20px;
  background: linear-gradient(90deg, var(--primary), color-mix(in oklab, var(--accent) 70%, var(--primary)));
  color: #fff;
  border-radius: 14px;
  box-shadow: 0 6px 18px color-mix(in oklab, var(--primary) 22%, transparent);
}
.exam-review-section-num {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  opacity: 0.8;
  text-transform: uppercase;
}
.exam-review-section-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  margin-top: 2px;
}
.exam-review-section-stats {
  display: flex;
  gap: 14px;
  font-size: 13px;
}
.exam-review-section-stats > div {
  background: rgba(255, 255, 255, 0.16);
  padding: 6px 12px;
  border-radius: 999px;
  font-weight: 600;
}
.exam-review-section-stats b {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 15px;
}
.exam-review-section-stats span { opacity: 0.85; }
@media (max-width: 640px) {
  .exam-review-section-title { font-size: 17px; }
  .exam-review-section-stats { width: 100%; }
}

/* ════════════════════════════════════════════════════════════════════
   Practice Hub + Practice History — styled cards
   ════════════════════════════════════════════════════════════════════ */
.practice-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}
.practice-stat {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
}
.practice-stat-ic {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.practice-stat-v {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 22px;
  line-height: 1;
}
.practice-stat-l {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-3);
  font-weight: 600;
}
.practice-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.practice-subject-filter { max-width: 200px; }
.practice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 14px;
}
.practice-card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: box-shadow 0.2s ease, transform 0.15s ease, border-color 0.2s ease;
  position: relative;
  overflow: hidden;
}
.practice-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), var(--primary));
  opacity: 0;
  transition: opacity 0.2s ease;
}
.practice-card:hover {
  border-color: color-mix(in oklab, var(--primary) 30%, var(--border));
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  transform: translateY(-2px);
}
.practice-card:hover::before { opacity: 1; }
.practice-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.practice-card-tag {
  font-size: 10px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  letter-spacing: 0.06em;
}
.practice-card-tag.tag-free   { background: var(--accent-soft); color: var(--accent); }
.practice-card-tag.tag-mixed  { background: color-mix(in oklab, var(--primary) 14%, transparent); color: var(--primary); }
.practice-card-tag.tag-course { background: var(--success-soft); color: var(--success); }
.practice-card-best {
  font-size: 11px;
  font-weight: 800;
  color: var(--warning);
  background: var(--warning-soft);
  padding: 4px 10px;
  border-radius: 999px;
}
.practice-card-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 16px;
  line-height: 1.35;
  color: var(--text);
}
.practice-card-subjects {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.practice-card-subj-chip {
  font-size: 10.5px;
  font-weight: 700;
  background: var(--surface-2);
  color: var(--text-2);
  padding: 3px 9px;
  border-radius: 999px;
}
.practice-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  color: var(--text-2);
  font-weight: 600;
}
.practice-card-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.practice-card-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
}
.practice-card-actions .btn { flex: 1; justify-content: center; }

/* Practice History */
.practice-history-best {
  margin-bottom: 16px;
  padding: 16px 20px;
}
.practice-history-best-head {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 10px;
}
.practice-history-best-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
}
.practice-history-best-row {
  display: grid;
  grid-template-columns: 100px 1fr 44px;
  gap: 10px;
  align-items: center;
}
.practice-history-best-row .subj {
  font-weight: 700;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.practice-history-best-row .bar {
  display: block;
  height: 8px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}
.practice-history-best-row .bar > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 999px;
}
.practice-history-best-row .pct {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 14px;
  text-align: right;
  color: var(--primary);
}
.practice-history-row {
  display: grid;
  grid-template-columns: 56px 1fr auto auto auto;
  gap: 14px;
  align-items: center;
}
.practice-history-pct {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 15px;
  flex-shrink: 0;
}
.practice-history-info { min-width: 0; }
.practice-history-info .title {
  font-weight: 800;
  font-size: 14.5px;
  line-height: 1.3;
}
.practice-history-info .meta {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 3px;
}
.practice-history-chips {
  display: flex;
  gap: 12px;
  font-size: 12px;
  font-weight: 700;
}
.practice-history-score {
  font-family: var(--font-display);
  text-align: right;
}
.practice-history-score b { font-size: 18px; font-weight: 900; }
.practice-history-score span { font-size: 12px; color: var(--text-3); }
@media (max-width: 900px) {
  .practice-stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 700px) {
  .practice-history-row {
    grid-template-columns: 48px 1fr;
    grid-template-rows: auto auto;
    row-gap: 8px;
  }
  .practice-history-pct { grid-row: span 2; }
  .practice-history-chips,
  .practice-history-score,
  .practice-history-row > .btn {
    grid-column: 2;
  }
  .practice-history-best-row { grid-template-columns: 80px 1fr 40px; }
}
.exam-review-card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  border-left: 5px solid var(--text-3);
  scroll-margin-top: 80px;
}
.exam-review-card.v-correct { border-left-color: var(--success); }
.exam-review-card.v-wrong   { border-left-color: var(--danger); }
.exam-review-card.v-skipped { border-left-color: var(--text-3); }
.exam-review-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}
.exam-review-q { display: flex; align-items: baseline; gap: 8px; }
.exam-review-q-num {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 15px;
  color: var(--primary);
}
.exam-review-q-marks {
  font-size: 11px;
  color: var(--text-3);
  font-weight: 700;
  background: var(--surface-2);
  padding: 3px 9px;
  border-radius: 999px;
}
.exam-review-verdict {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
}
.exam-review-card.v-correct .exam-review-verdict { background: var(--success-soft); color: var(--success); }
.exam-review-card.v-wrong   .exam-review-verdict { background: var(--danger-soft);  color: var(--danger); }
.exam-review-card.v-skipped .exam-review-verdict { background: var(--surface-2);    color: var(--text-3); }
.exam-review-head .btn { margin-left: auto; }
.exam-review-q-text {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.5;
  margin-bottom: 12px;
  color: var(--text);
}
.exam-review-opts {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.exam-review-opt {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  font-size: 14px;
  font-weight: 500;
  position: relative;
}
.exam-review-opt.correct {
  background: var(--success-soft);
  border-color: var(--success);
  color: var(--success);
}
.exam-review-opt.wrong {
  background: var(--danger-soft);
  border-color: var(--danger);
  color: var(--danger);
}
.exam-review-opt .letter {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 12px;
  background: rgba(0, 0, 0, 0.06);
  flex-shrink: 0;
}
.exam-review-opt.correct .letter { background: var(--success); color: #fff; }
.exam-review-opt.wrong   .letter { background: var(--danger);  color: #fff; }
.exam-review-opt .text { flex: 1; word-break: break-word; line-height: 1.4; }
.exam-review-opt .ic { flex-shrink: 0; }
.exam-review-opt .tag {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.6);
  text-transform: uppercase;
  margin-left: 4px;
}
.exam-review-opt.correct .tag { background: rgba(255, 255, 255, 0.4); }
.exam-review-opt.wrong   .tag { background: rgba(255, 255, 255, 0.4); }
.exam-review-explain {
  margin-top: 14px;
  padding: 14px 16px;
  background: color-mix(in oklab, var(--primary) 6%, transparent);
  border-radius: 12px;
  border-left: 3px solid var(--primary);
}
.exam-review-explain-head {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 800;
  font-size: 11.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 6px;
}
.exam-review-explain-body {
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--text-2);
}

/* Responsive */
@media (max-width: 900px) {
  .exam-analysis-hero { grid-template-columns: 1fr; text-align: center; gap: 18px; padding: 24px 22px; }
  .exam-analysis-verdict { align-items: center; }
  .exam-analysis-msg { margin: 0 auto; }
  .exam-analysis-meta { grid-template-columns: repeat(2, 1fr); }
  .exam-analysis-breakdown { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 580px) {
  .exam-analysis-cta-card { flex-direction: column; align-items: stretch; text-align: center; padding: 18px; }
  .exam-analysis-cta-card .cta-icon { margin: 0 auto; }
  .exam-analysis-cta-card .btn { width: 100%; justify-content: center; }
  .exam-review-card { padding: 16px; }
  .exam-review-head .btn { margin-left: 0; flex: 1; min-width: 0; justify-content: center; }
  .exam-analysis-meta .val { font-size: 16px; }
  .exam-analysis-gauge-num { font-size: 42px; }
}

/* ── In-app confirm/alert/prompt dialogs (window.uiConfirm/uiAlert/uiPrompt) ── */
.nnp-dialog-overlay {
  position: fixed; inset: 0; z-index: 99999;
  background: rgba(15, 23, 42, 0.55); backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  opacity: 0; transition: opacity 0.14s ease;
  overflow-y: auto;                 /* a long message must stay scrollable */
}
.nnp-dialog-overlay.open { opacity: 1; }
.nnp-dialog-card {
  width: 100%; max-width: 400px; box-sizing: border-box;
  background: var(--card, #fff); color: var(--text-1, #0f172a);
  border: 1px solid var(--border, #e2e8f0); border-radius: 16px;
  padding: 26px 24px 20px; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
  text-align: center; font-family: inherit;
  transform: translateY(8px) scale(0.98); transition: transform 0.14s ease;
}
.nnp-dialog-overlay.open .nnp-dialog-card { transform: none; }
.nnp-dialog-icon {
  width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center;
  margin: 0 auto 14px; font-size: 24px; font-weight: 800;
}
.nnp-dialog-title { font-size: 17px; font-weight: 800; margin-bottom: 6px; }
.nnp-dialog-msg { font-size: 13.5px; line-height: 1.6; color: var(--text-2, #475569); margin-bottom: 18px; white-space: pre-wrap; }
.nnp-dialog-input {
  width: 100%; box-sizing: border-box; padding: 10px 12px; margin-bottom: 16px;
  border: 1.5px solid var(--border, #e2e8f0); border-radius: 10px;
  background: var(--surface, #fff); color: var(--text-1, #0f172a); font-size: 14px; outline: none;
}
.nnp-dialog-input:focus { border-color: var(--primary, #6366f1); }
.nnp-dialog-actions { display: flex; gap: 10px; }
.nnp-dialog-btn {
  flex: 1; padding: 11px 16px; border-radius: 11px; font-size: 14px; font-weight: 700;
  cursor: pointer; border: 1.5px solid var(--border, #e2e8f0);
  background: var(--surface, #fff); color: var(--text-1, #0f172a); transition: filter 0.12s;
}
.nnp-dialog-btn:hover { filter: brightness(0.97); }
.nnp-dialog-btn.nnp-dialog-yes { background: var(--primary, #6366f1); border-color: var(--primary, #6366f1); color: #fff; }
.nnp-dialog-btn.nnp-dialog-yes.danger { background: var(--danger, #ef4444); border-color: var(--danger, #ef4444); }

/* ══ Mobile app-like bottom navigation (student portal) + safe-area + touch ══ */
.bottom-nav { display: none; }
@media (max-width: 760px) {
  .bottom-nav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 70;
    background: var(--card); border-top: 1px solid var(--border);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    box-shadow: 0 -3px 14px rgba(0, 0, 0, 0.07);
  }
  .bottom-nav-item {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 3px; padding: 8px 4px; min-height: 54px; border: none; background: none;
    color: var(--text-3); font-size: 10.5px; font-weight: 700; cursor: pointer;
    -webkit-tap-highlight-color: transparent; transition: color 0.15s ease, transform 0.1s ease;
  }
  .bottom-nav-item span { line-height: 1; }
  .bottom-nav-item.active { color: var(--primary); }
  .bottom-nav-item:active { transform: scale(0.9); }
  /* Reserve space for the bar + lift the FAB above it — only in portals that have one. */
  .app:has(.bottom-nav) .content { padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)) !important; }
  .app:has(.bottom-nav) .contact-fab { bottom: calc(82px + env(safe-area-inset-bottom, 0px)); }

  /* Student portal: premium floating bar (matches the mock) */
  .bottom-nav-float {
    left: 14px; right: 14px; bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    background: var(--surface); border: 1px solid rgba(120, 120, 255, 0.10);
    border-radius: 26px 26px 22px 22px; padding: 6px 4px;
    box-shadow: 0 12px 34px rgba(90, 90, 180, 0.18);
  }
  :root[data-theme="dark"] .bottom-nav-float { box-shadow: 0 12px 34px rgba(0, 0, 0, 0.55); border-color: rgba(150,150,255,0.14); }
  .bottom-nav-float .bottom-nav-item {
    padding: 10px 4px 12px; min-height: 60px; border-radius: 18px; position: relative;
    gap: 5px; font-size: 11px; transition: color 0.2s var(--tx), transform 0.12s var(--tx);
  }
  .bottom-nav-float .bottom-nav-item:active { transform: scale(0.92); }
  .bottom-nav-float .bottom-nav-item.active::after {
    content: ''; position: absolute; bottom: 5px; left: 50%; transform: translateX(-50%);
    width: 22px; height: 3.5px; border-radius: 3px;
    background: linear-gradient(90deg, #6366F1, #8B5CF6);
  }
  .app:has(.bottom-nav-float) .content { padding-bottom: calc(98px + env(safe-area-inset-bottom, 0px)) !important; }
  .app:has(.bottom-nav-float) .contact-fab { bottom: calc(104px + env(safe-area-inset-bottom, 0px)); }
  /* Bigger tap targets + press feedback for an app-like feel */
  .nav-item { min-height: 44px; }
  .nav-item:active, .btn:active { transform: scale(0.98); }
  /* Notch: let the sticky topbar clear the status bar area */
  .topbar { padding-top: env(safe-area-inset-top, 0px); }
}

/* ══ Extra responsive grid catches (student panel edge cases) ══ */
@media (max-width: 991px) { .student-exam-split { grid-template-columns: 1fr !important; } }
@media (max-width: 760px) { .student-code-split { grid-template-columns: 1fr !important; } }
@media (max-width: 980px) {
  /* two-pane layouts where the LARGER fraction is written first (not caught by
     the main fallback block) */
  [style*="grid-template-columns: minmax(0,1.4fr) minmax(0,1fr)"],
  [style*="grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr)"],
  [style*="grid-template-columns: minmax(0,2fr) minmax(0,1fr)"],
  [style*="grid-template-columns: minmax(0, 2fr) minmax(0, 1fr)"],
  [style*="grid-template-columns: minmax(0,1fr) minmax(0,1fr)"],
  [style*="grid-template-columns: minmax(0, 1fr) minmax(0, 1fr)"] { grid-template-columns: 1fr !important; }
}
@media (max-width: 480px) {
  /* MCQ answer grids written with minmax → 2-up on phones */
  [style*="grid-template-columns: repeat(4, minmax(0, 1fr))"],
  [style*="grid-template-columns: repeat(4, minmax(0,1fr))"] { grid-template-columns: 1fr 1fr !important; }
  /* literal 3-up rows (e.g. podium) → 3 stays, but leaderboard stat rows shrink */
}



/* ════════════ Messaging (shared MessagingApp) ════════════ */
.msg-wrap { display:grid; grid-template-columns:340px 1fr; height:calc(100vh - 170px); min-height:460px; border:1px solid var(--border); border-radius:16px; overflow:hidden; background:var(--card); }
.msg-list { border-right:1px solid var(--border); display:flex; flex-direction:column; min-height:0; }
.msg-chat { display:flex; flex-direction:column; min-height:0; }
.msg-scroll { overflow-y:auto; flex:1; min-height:0; }
.msg-row { display:flex; gap:10px; align-items:center; padding:11px 14px; cursor:pointer; border-bottom:1px solid var(--border); transition:background .15s; }
.msg-row:hover { background:var(--surface-2); }
.msg-row.active { background:var(--primary-soft); }
.msg-bubbles { display:flex; flex-direction:column; gap:14px; padding:20px 16px; overflow-y:auto; flex:1; min-height:0; background:var(--surface); }
/* Each message = a bubble (text INSIDE) + the timestamp OUTSIDE, below it. */
.msg-line { display:flex; flex-direction:column; max-width:78%; }
.msg-line.me   { align-self:flex-end;   align-items:flex-end; }
.msg-line.them { align-self:flex-start; align-items:flex-start; }
.msg-b { padding:10px 14px; border-radius:16px; font-size:13.5px; line-height:1.55; word-break:break-word; box-shadow:0 1px 2px rgba(15,23,42,0.06); }
.msg-line.me   .msg-b { background:linear-gradient(135deg, var(--primary), var(--primary-2, var(--primary))); color:#fff; border-bottom-right-radius:5px; }
.msg-line.them .msg-b { background:var(--card); border:1px solid var(--border); color:var(--text-1); border-bottom-left-radius:5px; }
.msg-time { font-size:10.5px; color:var(--text-3); margin-top:5px; padding:0 6px; letter-spacing:.02em; }

/* Input bar */
.msg-input-bar { padding:12px 14px; border-top:1px solid var(--border); display:flex; gap:10px; align-items:flex-end; background:var(--card); }
.msg-input { flex:1; resize:none; max-height:120px; min-height:44px; padding:11px 16px; border-radius:22px; border:1px solid var(--border); background:var(--surface-2); color:var(--text-1); font-size:13.5px; line-height:1.5; font-family:inherit; transition:border-color .15s, background .15s; }
.msg-input::placeholder { color:var(--text-3); }
.msg-input:focus { outline:none; border-color:var(--primary); background:var(--card); box-shadow:0 0 0 3px color-mix(in oklab, var(--primary) 14%, transparent); }
.msg-send { border:0; border-radius:50%; width:44px; height:44px; flex-shrink:0; background:var(--primary); color:#fff; display:grid; place-items:center; cursor:pointer; box-shadow:0 4px 12px color-mix(in oklab, var(--primary) 40%, transparent); transition:transform .12s ease, opacity .12s ease, box-shadow .12s ease; }
.msg-send:hover:not(:disabled) { transform:scale(1.07); }
.msg-send:active:not(:disabled) { transform:scale(.95); }
.msg-send:disabled { opacity:.4; cursor:default; box-shadow:none; }
.msg-back { display:none !important; }
@media (max-width:760px){
  .msg-wrap { grid-template-columns:1fr; height:calc(100vh - 150px); border-radius:12px; }
  .msg-wrap[data-view="chat"] .msg-list { display:none; }
  .msg-wrap[data-view="list"] .msg-chat { display:none; }
  .msg-back { display:grid !important; }
}

/* ════════════════════════════════════════════════════════════════════
   MODALS / POPUPS — one shared system for every portal.

   Replaces the ad-hoc `position:fixed; inset:0` overlays that each page
   used to hand-roll. Those broke in three ways:
     • fixed pixel widths (e.g. width:460) overflowed small screens
     • no max-height, so tall dialogs ran off-screen with no way to scroll
     • six different z-index values, some under the sidebar/bottom-nav
   The overlay scrolls and the card is margin:auto centred, so a dialog
   taller than the viewport stays fully reachable at any screen size.
   ════════════════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 24px 20px; overflow-y: auto; overscroll-behavior: contain;
  animation: modalFade 0.16s ease;
}
@keyframes modalFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalPop  { from { opacity: 0; transform: translateY(8px) scale(0.98); } to { opacity: 1; transform: none; } }

.modal-card {
  margin: auto;                 /* centres when it fits, scrolls when it doesn't */
  width: 100%; max-width: 520px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow-xl, 0 24px 60px rgba(2, 6, 23, 0.28));
  padding: 24px;
  animation: modalPop 0.18s var(--tx, ease);
}
.modal-card.xs { max-width: 380px; }
.modal-card.sm { max-width: 460px; }
.modal-card.md { max-width: 640px; }
.modal-card.lg { max-width: 820px; }
.modal-card.xl { max-width: 1040px; }
/* Edge-to-edge variant for dialogs that manage their own sticky header /
   scrolling body / footer rows — keeps that 3-row layout working by making
   the card a bounded flex column. */
.modal-card.flush {
  padding: 0; overflow: hidden;
  display: flex; flex-direction: column;
  max-height: calc(100vh - 48px);
}

/* Right-hand drawer variant (detail panels) */
.modal-overlay.drawer { align-items: stretch; justify-content: flex-end; padding: 0; }
.modal-overlay.drawer .modal-card {
  margin: 0; height: 100%; max-width: 440px; border-radius: 0;
  border-right: 0; border-top: 0; border-bottom: 0;
  overflow-y: auto; animation: modalSlide 0.22s var(--tx, ease);
}
@keyframes modalSlide { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }

/* Header row used by most dialogs */
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 18px;
}
.modal-title { margin: 0; font-size: 18px; font-weight: 800; font-family: var(--font-display); }

/* Freeze the page behind the dialog so the background can't scroll away */
body.modal-open { overflow: hidden; }

@media (max-width: 640px) {
  .modal-overlay { padding: 12px; }
  .modal-card { padding: 18px; border-radius: 16px; }
  .modal-overlay.drawer { padding: 0; }
  .modal-overlay.drawer .modal-card { max-width: 100%; }
}

/* Admin Messages — two-pane layout, stacks on small screens */
.adm-msg-grid { display: grid; grid-template-columns: minmax(0, 320px) minmax(0, 1fr); }
@media (max-width: 820px) {
  .adm-msg-grid { grid-template-columns: 1fr; }
  .adm-msg-grid > div:first-child { border-right: 0; border-bottom: 1px solid var(--border); max-height: 260px; }
}

/* ════════════════════════════════════════════════════════════════════
   CHECKOUT — shared by the student and guest portals.
   The layout was a hardcoded `minmax(0,1fr) 360px` grid with a sticky
   summary, so on a phone the 360px column forced horizontal overflow and
   the summary stuck to a viewport it no longer fitted.
   ════════════════════════════════════════════════════════════════════ */
.checkout-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 22px;
  align-items: start;
}
.checkout-summary { position: sticky; top: 78px; }

/* Two-up rows inside the form (plan tabs, card fields, name/expiry…) */
.checkout-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

@media (max-width: 980px) {
  /* Summary drops under the form and stops sticking */
  .checkout-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .checkout-summary { position: static; top: auto; }
}
@media (max-width: 560px) {
  .checkout-row2 { grid-template-columns: 1fr; }
}

/* ════════════════════════════════════════════════════════════════════
   ENROLMENT CELEBRATION — full-screen success after a paid checkout.
   Pure CSS/SVG: the tick draws itself via stroke-dashoffset and the
   confetti are absolutely-positioned pieces with staggered falls, so
   there's no animation library to load.
   ════════════════════════════════════════════════════════════════════ */
.celebrate-overlay {
  position: fixed; inset: 0; z-index: 3000;
  display: grid; place-items: center; padding: 24px;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  animation: modalFade 0.25s ease; overflow: hidden;
}
.celebrate-card {
  position: relative; z-index: 2; text-align: center;
  width: min(460px, 92vw); padding: 38px 30px 30px;
  background: var(--surface); border-radius: 22px;
  box-shadow: 0 30px 80px rgba(2, 6, 23, 0.45);
  animation: celebratePop 0.5s cubic-bezier(.34, 1.56, .64, 1) backwards;
}
@keyframes celebratePop {
  from { opacity: 0; transform: translateY(24px) scale(0.9); }
  to   { opacity: 1; transform: none; }
}

/* Animated tick */
.celebrate-ring { width: 96px; height: 96px; margin: 0 auto 18px; display: block; }
.celebrate-ring circle {
  fill: none; stroke: #22C55E; stroke-width: 5;
  stroke-dasharray: 276; stroke-dashoffset: 276;
  animation: drawRing 0.6s ease-out forwards;
}
.celebrate-ring path {
  fill: none; stroke: #22C55E; stroke-width: 7;
  stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 60; stroke-dashoffset: 60;
  animation: drawTick 0.35s 0.5s ease-out forwards;
}
@keyframes drawRing { to { stroke-dashoffset: 0; } }
@keyframes drawTick { to { stroke-dashoffset: 0; } }

.celebrate-title { font-family: var(--font-display); font-size: 24px; font-weight: 800; margin: 0 0 8px; }
.celebrate-sub   { color: var(--text-2); font-size: 14px; line-height: 1.6; margin: 0 0 8px; }
.celebrate-meta  {
  margin: 16px 0 20px; padding: 12px 14px; border-radius: 12px;
  background: var(--surface-2); font-size: 12.5px; color: var(--text-2);
  display: flex; flex-direction: column; gap: 5px;
}
.celebrate-meta b { color: var(--text-1); }
.celebrate-actions { display: flex; gap: 10px; }
.celebrate-actions .btn { flex: 1; justify-content: center; }

/* Confetti */
.celebrate-confetti { position: absolute; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; }
.celebrate-confetti i {
  position: absolute; top: -12vh; width: 10px; height: 16px; opacity: 0;
  animation: confettiFall linear forwards;
}
@keyframes confettiFall {
  0%   { opacity: 1; transform: translateY(0) rotate(0deg); }
  100% { opacity: 0; transform: translateY(115vh) rotate(720deg); }
}

@media (prefers-reduced-motion: reduce) {
  .celebrate-confetti { display: none; }
  .celebrate-card, .celebrate-ring circle, .celebrate-ring path { animation-duration: 0.01ms; }
  .celebrate-ring circle, .celebrate-ring path { stroke-dashoffset: 0; }
}
@media (max-width: 560px) {
  .celebrate-card { padding: 30px 20px 22px; }
  .celebrate-actions { flex-direction: column; }
}

/* ══════════════════════════════════════════════════════════════
   LEADERBOARD — theme-aware podium hero.
   Light mode: clean light card with dark text (was a hard-coded dark
   gradient in both themes). Dark mode: the original night-sky gradient.
   ══════════════════════════════════════════════════════════════ */
.lb-hero {
  background: linear-gradient(140deg,#F1F5FE 0%,#E8EEF9 45%,#EEF3FC 100%);
  border: 1px solid var(--border);
  color: var(--text-1);
}
[data-theme="dark"] .lb-hero {
  background: linear-gradient(140deg,#0F172A 0%,#1E1A3A 45%,#0A1628 100%);
  border: 0;
}
.lb-hero-title { color: var(--text-1); }
.lb-hero-sub   { color: var(--text-3); }
.lb-podium-name  { color: var(--text-1); }
.lb-podium-score { color: var(--text-3); }
[data-theme="dark"] .lb-hero-title,
[data-theme="dark"] .lb-podium-name  { color: #fff; }
[data-theme="dark"] .lb-hero-sub     { color: rgba(255,255,255,0.5); }
[data-theme="dark"] .lb-podium-score { color: rgba(255,255,255,0.45); }
/* The decorative star field only reads on a dark backdrop — hide in light mode. */
.lb-star { display: none; }
[data-theme="dark"] .lb-star { display: block; }

/* ══════════════════════════════════════════════════════════════════════
   GUEST HOME — redesigned landing (animated hero + stats + featured +
   categories + popular courses + CTA). Mobile-first, scales to tablet/PC.
   ══════════════════════════════════════════════════════════════════════ */
.gh { display: flex; flex-direction: column; gap: 26px; width: 100%; }
/* Inner wrapper keeps the non-hero sections centred & readable while the hero
   itself runs full-bleed edge to edge. */
.gh-wrap { display: flex; flex-direction: column; gap: 26px; max-width: 1120px; margin: 0 auto; width: 100%; padding: 0 20px; }
/* Home/dashboard render flush (no content padding, no max-width) so the hero
   runs edge to edge; the .gh-wrap re-centres the sections below it. */
.content-flush { padding-left: 0 !important; padding-right: 0 !important; padding-top: 0 !important; max-width: none !important; }
.content-flush .gh { margin-top: -68px; }                 /* run hero up behind the header */
.content-flush .gh-hero { border-radius: 0; border-left: 0; border-right: 0; }
@media (min-width: 640px) { .gh-wrap { padding: 0 24px; } }

/* Hero with moving colour animation */
.gh-hero {
  position: relative; overflow: hidden; border-radius: 22px;
  padding: 92px 26px 44px; text-align: center;
  background: linear-gradient(180deg, var(--surface-1, #fff), var(--surface-2, #f1f5f9));
  border: 1px solid var(--border);
}
:root[data-theme="dark"] .gh-hero { background: linear-gradient(180deg, #0f1a35, #0a1020); border-color: rgba(255,255,255,0.06); }
.gh-hero-bg { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.gh-blob { position: absolute; border-radius: 50%; filter: blur(46px); opacity: 0.32; will-change: transform; }
:root[data-theme="dark"] .gh-blob { opacity: 0.5; }
.gh-blob.b1 { width: 300px; height: 300px; background: #3B82F6; top: -90px; left: -50px; animation: gh-drift1 16s ease-in-out infinite alternate; }
.gh-blob.b2 { width: 280px; height: 280px; background: #8B5CF6; top: -50px; right: -70px; animation: gh-drift2 19s ease-in-out infinite alternate; }
.gh-blob.b3 { width: 260px; height: 260px; background: #EC4899; bottom: -120px; left: 38%; animation: gh-drift3 22s ease-in-out infinite alternate; }
@keyframes gh-drift1 { from { transform: translate(0,0) scale(1); } to { transform: translate(44px,34px) scale(1.18); } }
@keyframes gh-drift2 { from { transform: translate(0,0) scale(1); } to { transform: translate(-34px,44px) scale(1.12); } }
@keyframes gh-drift3 { from { transform: translate(0,0) scale(1); } to { transform: translate(24px,-34px) scale(1.22); } }
@media (prefers-reduced-motion: reduce) { .gh-blob { animation: none !important; } }

.gh-hero-inner { position: relative; z-index: 1; }
.gh-pill {
  display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 700;
  padding: 6px 14px; border-radius: 999px; margin-bottom: 18px;
  background: color-mix(in oklab, var(--primary) 12%, transparent); color: var(--primary);
  border: 1px solid color-mix(in oklab, var(--primary) 30%, transparent);
}
.gh-pill-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--primary); animation: gh-ping 1.8s ease-out infinite; }
@keyframes gh-ping { 0% { box-shadow: 0 0 0 0 color-mix(in oklab, var(--primary) 55%, transparent); } 100% { box-shadow: 0 0 0 8px transparent; } }
.gh-hero-title { font-family: var(--font-display); font-weight: 800; letter-spacing: -0.03em; line-height: 1.06; margin: 0 0 14px; font-size: clamp(30px, 7vw, 52px); }
.gh-grad { background: linear-gradient(120deg, var(--primary), var(--accent, #8B5CF6)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.gh-hero-sub { font-size: 14.5px; color: var(--text-2); max-width: 560px; margin: 0 auto 24px; line-height: 1.6; }
.gh-hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.gh-btn-glass { background: color-mix(in oklab, var(--surface-1) 70%, transparent); backdrop-filter: blur(6px); }

/* Stat cards */
.gh-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.gh-stat { position: relative; border: 1px solid var(--border); background: var(--surface-1); border-radius: 16px; padding: 14px 12px 12px; text-align: center; }
.gh-stat .v { font-family: var(--font-display); font-weight: 900; font-size: clamp(17px, 4.6vw, 24px); letter-spacing: -0.02em; color: var(--primary); line-height: 1; }
.gh-stat .l { font-size: 11px; color: var(--text-3); font-weight: 600; margin-top: 5px; }
.gh-stat .ic { margin: 8px auto 0; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: color-mix(in oklab, var(--primary) 12%, transparent); color: var(--primary); }

/* Featured carousel */
.gh-featured { display: flex; flex-direction: column; gap: 10px; }
.gh-feat-card { position: relative; border-radius: 18px; overflow: hidden; cursor: pointer; aspect-ratio: 16 / 10; border: 1px solid var(--border); background: #0b1120; }
.gh-feat-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.gh-feat-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(2,6,23,0) 40%, rgba(2,6,23,0.86) 100%); }
.gh-feat-badge { position: absolute; top: 12px; left: 12px; z-index: 2; background: rgba(255,255,255,0.95); color: #0F172A; font-size: 11px; font-weight: 800; padding: 4px 10px; border-radius: 999px; }
.gh-feat-price { position: absolute; top: 12px; right: 12px; z-index: 2; background: #F59E0B; color: #1a1200; font-size: 12px; font-weight: 900; padding: 4px 10px; border-radius: 999px; }
.gh-feat-body { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; padding: 14px 16px; color: #fff; }
.gh-feat-title { font-weight: 800; font-size: clamp(14px, 3.6vw, 18px); line-height: 1.25; text-shadow: 0 1px 4px rgba(0,0,0,0.5); }
.gh-feat-meta { display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.gh-feat-old { text-decoration: line-through; opacity: 0.7; font-size: 12px; }
.gh-feat-now { font-weight: 900; font-size: 16px; color: #FFD200; }
.gh-feat-chips { display: flex; gap: 5px; flex-wrap: wrap; margin-left: 2px; }
.gh-feat-chip { font-size: 9.5px; font-weight: 700; padding: 3px 7px; border-radius: 6px; background: rgba(255,255,255,0.16); backdrop-filter: blur(4px); }
.gh-dots { display: flex; gap: 6px; justify-content: center; }
.gh-dot { width: 7px; height: 7px; border-radius: 999px; border: none; background: var(--border); cursor: pointer; padding: 0; transition: width .2s, background .2s; }
.gh-dot.on { width: 20px; background: var(--primary); }

/* Category grid */
.gh-cats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.gh-cat { display: flex; align-items: center; gap: 12px; text-align: left; padding: 13px 14px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface-1); cursor: pointer; transition: transform .15s, border-color .15s; }
.gh-cat:hover { transform: translateY(-2px); border-color: var(--primary); }
.gh-cat .ic { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; flex-shrink: 0; }
.gh-cat .t { font-weight: 800; font-size: 14px; }
.gh-cat .d { font-size: 11.5px; color: var(--text-3); margin-top: 1px; }

/* Section head */
.gh-sec-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.gh-sec-title { font-family: var(--font-display); font-weight: 800; font-size: 20px; margin: 0; }
.gh-viewall { display: inline-flex; align-items: center; gap: 4px; background: none; border: none; color: var(--primary); font-weight: 700; font-size: 13px; cursor: pointer; }

/* Popular course cards */
.gh-course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.gh-course { border: 1px solid var(--border); border-radius: 16px; overflow: hidden; background: var(--surface-1); cursor: pointer; display: flex; flex-direction: column; transition: transform .15s, box-shadow .15s; }
.gh-course:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg, 0 12px 28px rgba(15,23,42,0.12)); }
.gh-course-thumb { position: relative; aspect-ratio: 16 / 9; overflow: hidden; }
.gh-course-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.gh-course-tag { position: absolute; top: 8px; left: 8px; background: rgba(255,255,255,0.95); color: #0F172A; font-size: 10px; font-weight: 800; padding: 3px 8px; border-radius: 999px; }
.gh-course-body { padding: 12px 13px 13px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.gh-course-title { font-weight: 800; font-size: 13.5px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.6em; }
.gh-course-by { display: flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--text-3); }
.gh-course-price { display: flex; align-items: baseline; gap: 8px; margin-top: 2px; }
.gh-course-price .old { text-decoration: line-through; color: var(--text-3); font-size: 12.5px; }
.gh-course-price .now { font-family: var(--font-display); font-weight: 900; font-size: 17px; color: var(--primary); }
.gh-course-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: auto; padding-top: 6px; }
.gh-course-actions .btn { justify-content: center; }

/* CTA */
.gh-cta { position: relative; overflow: hidden; border-radius: 22px; text-align: center; color: #fff; border: 0; background: linear-gradient(120deg, var(--primary), var(--accent, #8B5CF6)); }
.gh-cta-bg { position: absolute; inset: 0; overflow: hidden; opacity: 0.6; }
.gh-cta-bg .gh-blob.b1 { background: #fff; opacity: 0.14; }
.gh-cta-bg .gh-blob.b2 { background: #FFD200; opacity: 0.14; }
.gh-cta-inner { position: relative; z-index: 1; padding: 38px 24px; }
.gh-cta-inner h2 { font-family: var(--font-display); font-weight: 800; font-size: 24px; letter-spacing: -0.02em; margin: 10px 0 8px; }
.gh-cta-inner p { opacity: 0.94; margin: 0 0 20px; font-size: 14px; line-height: 1.6; }
.gh-cta-btn { background: #fff; color: var(--primary); font-weight: 800; }

/* Tablet / PC */
@media (min-width: 640px) {
  .gh { gap: 30px; }
  .gh-cats { grid-template-columns: repeat(3, 1fr); }
  .gh-sec-title { font-size: 22px; }
}
@media (min-width: 900px) {
  .gh-hero { padding: 118px 40px 58px; }
  .gh-hero-sub { font-size: 16.5px; }
  .gh-stats { gap: 14px; }
  .gh-cats { grid-template-columns: repeat(5, 1fr); }
  .gh-feat-card { aspect-ratio: 21 / 9; }
  .gh-course-grid { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
}

/* ── Home header MERGE: transparent over the hero, solid once scrolled ── */
.topbar { transition: background .3s var(--tx), backdrop-filter .3s var(--tx), border-color .3s var(--tx); }
.topbar-merged { background: transparent !important; backdrop-filter: none !important; border-bottom-color: transparent !important; }
.topbar-merged.scrolled {
  background: color-mix(in oklab, var(--surface) 82%, transparent) !important;
  backdrop-filter: blur(16px) !important; border-bottom-color: var(--border) !important;
}
/* Centred platform wordmark */
.topbar-brand {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center;
  font-family: var(--font-display); line-height: 1; pointer-events: none; user-select: none; z-index: 1;
}
.topbar-brand .tb-nnp { font-size: 20px; font-weight: 800; letter-spacing: 0.05em; color: var(--text); }
.topbar-brand .tb-acad { font-size: 11px; font-weight: 700; letter-spacing: 0.32em; color: var(--primary); margin: 3px 0 0 0.32em; }

/* Student dashboard greeting header — replaces the search topbar on that page only.
   The header carries a soft lavender wash that fades into the page background so
   header + hero read as ONE continuous section (no divider line). */
.topbar-greeting {
  height: 92px; padding: 12px 24px 0;
  background: linear-gradient(180deg, color-mix(in oklab, #6366F1 9%, var(--bg)) 0%, var(--bg) 100%);
  backdrop-filter: none; -webkit-backdrop-filter: none;
  border-bottom: 0;
}
:root[data-theme="dark"] .topbar-greeting {
  background: linear-gradient(180deg, color-mix(in oklab, #6366F1 16%, var(--bg)) 0%, var(--bg) 100%);
}
.topbar-greet { display: flex; align-items: center; gap: 13px; cursor: pointer; border-radius: 18px; padding: 6px 12px 6px 6px; transition: background 0.2s var(--tx); }
.topbar-greet:hover { background: rgba(255,255,255,0.7); }
:root[data-theme="dark"] .topbar-greet:hover { background: rgba(255,255,255,0.06); }
.topbar-greet .av { width: 50px; height: 50px; border-radius: 16px; font-size: 16px; box-shadow: 0 6px 16px rgba(90,90,180,0.18); }
.tg-text { line-height: 1.35; min-width: 0; }
.tg-hi { font-size: 13px; color: var(--text-2); font-weight: 600; }
.tg-name { font-size: 20px; font-weight: 800; display: flex; align-items: center; gap: 4px; letter-spacing: -0.02em; }
.tg-name svg { color: var(--text-3); }
.topbar-greet-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; z-index: 1; }
.topbar-greet-actions .icon-btn { width: 44px; height: 44px; border-radius: 14px; }
.topbar-greeting .topbar-brand .tb-nnp { font-size: 24px; }
.topbar-greeting .topbar-brand .tb-acad { font-size: 11.5px; }
/* Narrow phones: shrink the chrome so greeting + wordmark + actions all fit */
@media (max-width: 520px) {
  .topbar-greeting { height: 80px; padding: 10px 14px 0; gap: 8px; }
  .topbar-greet { gap: 10px; padding: 5px 8px 5px 5px; border-radius: 15px; }
  .topbar-greet .av { width: 42px; height: 42px; border-radius: 13px; font-size: 13px; }
  .tg-hi { font-size: 11px; white-space: nowrap; }
  .tg-name { font-size: 16px; }
  .topbar-greeting .topbar-brand .tb-nnp { font-size: 18px; }
  .topbar-greeting .topbar-brand .tb-acad { font-size: 9px; letter-spacing: 0.24em; margin-top: 2px; }
  .topbar-greet-actions { gap: 2px; }
  .topbar-greet-actions .icon-btn { width: 38px; height: 38px; border-radius: 12px; }
}
/* Very tight — the wordmark would collide with the greeting, so drop it */
@media (max-width: 400px) {
  .topbar-greeting .topbar-brand { display: none; }
}

/* (hero pull-up is handled by .content-flush .gh above) */

/* Colour-cycling glow so the hero background truly "moves colour" (like the ref). */
.gh-hero-bg { animation: gh-hue 15s linear infinite; }
@keyframes gh-hue { from { filter: hue-rotate(0deg); } to { filter: hue-rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .gh-hero-bg { animation: none; } }

/* Left-aligned hero variant (student dashboard) + KPI strip */
.gh-hero.left { text-align: left; }
.gh-hero.left .gh-hero-inner { margin: 0; max-width: 640px; }
.gh-hero.left .gh-hero-sub { margin-left: 0; margin-right: 0; }
.gh-hero.left .gh-hero-cta { justify-content: flex-start; }
.gh-hero-kpis { display: flex; gap: 20px; margin-top: 24px; flex-wrap: wrap; }
.gh-kpi { display: flex; align-items: center; gap: 8px; }
.gh-kpi svg { color: var(--primary); flex-shrink: 0; }
.gh-kpi .v { font-family: var(--font-display); font-weight: 800; font-size: 18px; line-height: 1; letter-spacing: -0.02em; }
.gh-kpi .l { font-size: 11px; color: var(--text-3); font-weight: 600; margin-top: 2px; }
.gh-wrap-wide { max-width: 1360px; }

/* ── Two-column hero (guest home): text + inline stats · course slider ── */
.gh-hero-grid { position: relative; z-index: 1; max-width: 1240px; margin: 0 auto; display: grid; grid-template-columns: 1fr; gap: 26px; align-items: center; }
.gh-hero-text { text-align: center; }
.gh-hero-text .gh-hero-title, .gh-hero-text .gh-hero-sub { margin-left: auto; margin-right: auto; }
.gh-hero-stats { display: flex; gap: 22px 26px; margin-top: 24px; flex-wrap: wrap; justify-content: center; }
.gh-hstat .v { font-family: var(--font-display); font-weight: 800; font-size: 24px; color: var(--primary); letter-spacing: -0.02em; line-height: 1; }
.gh-hstat .l { font-size: 12px; color: var(--text-2); font-weight: 500; margin-top: 3px; }

/* Hero course slider (right column) */
.gh-hslider { width: 100%; }
.gh-hslider-frame { border-radius: 18px; overflow: hidden; border: 1px solid var(--border); box-shadow: var(--shadow-lg, 0 18px 44px rgba(2,6,23,0.28)); background: var(--surface-1); }
.gh-hslider-track { display: flex; transition: transform 0.6s var(--tx, ease); }
.gh-hslide { flex: 0 0 100%; min-width: 0; border: 0; padding: 0; background: transparent; cursor: pointer; display: block; }
.gh-hslide-img { position: relative; aspect-ratio: 16 / 10; overflow: hidden; }
.gh-hslide-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.gh-hslide-tag { position: absolute; top: 12px; left: 12px; background: rgba(255,255,255,0.95); color: #0F172A; font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 999px; }
.gh-hslide-price { position: absolute; top: 12px; right: 12px; background: rgba(0,0,0,0.42); color: #fff; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; backdrop-filter: blur(4px); }
.gh-hslide-cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 14px 11px; background: linear-gradient(to top, rgba(0,0,0,0.82), transparent); text-align: left; }
.gh-hslide-cap .t { color: #fff; font-weight: 700; font-size: 14px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gh-hslide-cap .by { color: rgba(255,255,255,0.82); font-size: 12px; margin-top: 2px; }

@media (min-width: 900px) {
  .gh-hero-grid { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 40px; }
  .gh-hero-text { text-align: left; }
  .gh-hero-text .gh-hero-title, .gh-hero-text .gh-hero-sub { margin-left: 0; margin-right: 0; }
  .gh-hero-stats { justify-content: flex-start; gap: 26px 30px; }
  .gh-hstat .v { font-size: 26px; }
}

/* ══════════════════════════════════════════════════════════════════════
   Phone responsiveness pass — tab strips, leaderboard, Q&A forum,
   bookmarks filter, assignments and the profile pages.
   ══════════════════════════════════════════════════════════════════════ */

/* Tab strips (Bookmarks filter, Q&A filters, exam tabs…). These were
   `width: fit-content` on a flex row, so four or more tabs pushed the page
   into a horizontal scroll. Now the STRIP scrolls, not the page. */
@media (max-width: 760px) {
  .tabs {
    width: 100%; max-width: 100%;
    overflow-x: auto; flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch; scrollbar-width: none;
  }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs > * { flex: 0 0 auto; white-space: nowrap; }
}

/* Profile pages (teacher portal profile + student profile). The body grid
   stayed two columns on phones, squeezing both halves. */
@media (max-width: 980px) {
  .profile-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .profile-section { padding: 16px; }
  .profile-section-head { gap: 10px; margin-bottom: 14px; padding-bottom: 11px; }
  .profile-section-title { font-size: 14px; }
  .profile-grid { gap: 14px; }
  /* Long emails / URLs must wrap instead of widening the card */
  .profile-section p, .profile-section li, .profile-section span, .profile-section div { overflow-wrap: anywhere; }
}

/* Leaderboard — the split had an INLINE two-column grid, so it needs
   !important to collapse; the podium tightens rather than stacking. */
@media (max-width: 900px) {
  .lb-split { grid-template-columns: minmax(0, 1fr) !important; }
}
@media (max-width: 760px) {
  .lb-hero { padding: 18px 14px !important; }
  .lb-hero-title { font-size: 20px !important; }
  .lb-hero-sub { font-size: 12px !important; }
  .lb-podium { gap: 4px !important; }
  .lb-podium-name { font-size: 11.5px !important; overflow-wrap: anywhere; }
  .lb-podium-score { font-size: 10.5px !important; }
  .lb-star { width: 15px; height: 15px; }
}

/* Q&A forum — ask form drops to one column; list rows and stat pills tighten */
@media (max-width: 760px) {
  .qa-ask-grid { grid-template-columns: 1fr; gap: 10px; }
  .qa-ask-actions { flex-wrap: wrap; gap: 8px; }
  .qa-ask-actions .btn { flex: 1 1 auto; justify-content: center; }
  .qa-meta, .qa-meta-chips { flex-wrap: wrap; gap: 6px; font-size: 11.5px; }
  .qa-snippet { font-size: 12.5px; }
  .qa-stat-num { font-size: 14px; }
  .qa-stat-lbl { font-size: 9.5px; }
  .qa-body, .qa-thread-body { overflow-wrap: anywhere; }
  .qa-image-grid, .qa-img-grid { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)) !important; }
}

/* Assignments + submit-assignment: keep action rows and long titles sane */
@media (max-width: 760px) {
  .assign-actions, .assign-head { flex-wrap: wrap; gap: 8px; }
  .assign-actions .btn { flex: 1 1 auto; justify-content: center; }
}

/* Any page-level head with a right-hand action stacks instead of squashing */
@media (max-width: 520px) {
  .page-head { flex-wrap: wrap; gap: 10px; }
  .page-title { font-size: 20px; }
}
