

/* ══════════════════════════════════════════════════════
   WEBVIEW OPTIMIZATION
   - Touch targets, tap highlights, scroll behaviour
   - Prevent content jumping / unnecessary repaints
══════════════════════════════════════════════════════ */
html {
  /* Prevent WebView font size inflation on orientation change */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  /* Smooth momentum scrolling on iOS WebView */
  -webkit-overflow-scrolling: touch;
}
body {
  /* Prevent pull-to-refresh and rubber-banding on Android WebView */
  overscroll-behavior: none;
  /* Disable blue tap highlight on Android */
  -webkit-tap-highlight-color: transparent;
}
button, a, input, select, textarea, label {
  /* Remove default touch callout on long-press */
  -webkit-touch-callout: none;
}
button, a[onclick], [role="button"] {
  /* Ensure 44px minimum tap target per WCAG / Android guidelines */
  min-height: 44px;
  min-width: 44px;
  touch-action: manipulation; /* prevents 300ms tap delay */
}
/* Exceptions: small decorative or inline elements */
.tb-swatch, .legend-dot, .nl-bc-sep,
.badge, .class-tag, .sc-badge { min-height: unset; min-width: unset; }

/* Prevent WebView from auto-linking phone numbers / addresses */
* { -webkit-user-modify: read-only; }
input, textarea, [contenteditable] { -webkit-user-modify: read-write; }

/* Hardware-accelerate the view switcher so Android doesn't repaint the whole page */
.app-view { will-change: opacity; }
.app-view.active { will-change: auto; }

/* ══════════════════════════════════════════════════════
   MAIN SITE STYLES (from styles.css)
══════════════════════════════════════════════════════ */
/* ═══════════════════════════════════════════════════════════
   THE GLORIOUS CHILD CENTRE SCHOOLS PLC — Integrated CBT System
   styles.css  |  R2G Smart CBT v3 × GCC Website
═══════════════════════════════════════════════════════════ */

/* ══════════════════════════════════════════════════════
   THEME COLOUR SYSTEM — 15 themes × 4 shades each
   Default theme: Royal Blue (matches original navy)
══════════════════════════════════════════════════════ */
:root {
  --theme-darkest: #0D1B5E;
  --theme-primary: #1565C0;
  --theme-accent:  #1E88E5;
  --theme-light:   #90CAF9;
}
[data-theme="crimson-red"]     { --theme-darkest:#7B0000; --theme-primary:#B71C1C; --theme-accent:#E53935; --theme-light:#FF8A80; }
[data-theme="rose-red"]        { --theme-darkest:#880E4F; --theme-primary:#C62828; --theme-accent:#EF5350; --theme-light:#FFCDD2; }
[data-theme="tomato-red"]      { --theme-darkest:#6D1010; --theme-primary:#C0392B; --theme-accent:#E74C3C; --theme-light:#FADBD8; }
[data-theme="scarlet-red"]     { --theme-darkest:#4A0000; --theme-primary:#8B0000; --theme-accent:#DC143C; --theme-light:#FF6961; }
[data-theme="royal-blue"]      { --theme-darkest:#0D1B5E; --theme-primary:#1565C0; --theme-accent:#1E88E5; --theme-light:#90CAF9; }
[data-theme="navy-blue"]       { --theme-darkest:#001F3F; --theme-primary:#003580; --theme-accent:#0057B7; --theme-light:#7EB9FF; }
[data-theme="sky-blue"]        { --theme-darkest:#0D47A1; --theme-primary:#1976D2; --theme-accent:#42A5F5; --theme-light:#BBDEFB; }
[data-theme="forest-green"]    { --theme-darkest:#1B5E20; --theme-primary:#2E7D32; --theme-accent:#43A047; --theme-light:#A5D6A7; }
[data-theme="emerald-green"]   { --theme-darkest:#004D40; --theme-primary:#00695C; --theme-accent:#00897B; --theme-light:#B2DFDB; }
[data-theme="deep-purple"]     { --theme-darkest:#1A0033; --theme-primary:#4A148C; --theme-accent:#7B1FA2; --theme-light:#CE93D8; }
[data-theme="indigo"]          { --theme-darkest:#1A237E; --theme-primary:#283593; --theme-accent:#3949AB; --theme-light:#9FA8DA; }
[data-theme="amber-gold"]      { --theme-darkest:#4E2500; --theme-primary:#E65100; --theme-accent:#F57C00; --theme-light:#FFE0B2; }
[data-theme="chocolate-brown"] { --theme-darkest:#1C0A00; --theme-primary:#3E2723; --theme-accent:#6D4C41; --theme-light:#D7CCC8; }
[data-theme="teal"]            { --theme-darkest:#004D5B; --theme-primary:#00696F; --theme-accent:#009688; --theme-light:#B2EBF2; }
[data-theme="slate-gray"]      { --theme-darkest:#1C1C2E; --theme-primary:#37474F; --theme-accent:#546E7A; --theme-light:#CFD8DC; }

/* ── THEME PICKER BUTTON (top-right of hero) ── */
#theme-toggle-btn {
  position: absolute;
  top: 20px;
  left: 24px;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.28);
  border-radius: 30px;
  color: #fff;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.4px;
  backdrop-filter: blur(8px);
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
}
#theme-toggle-btn:hover {
  background: rgba(255,255,255,0.22);
  border-color: rgba(255,255,255,0.5);
  transform: translateY(-1px);
}
#theme-toggle-btn .tb-swatch-row {
  display: flex;
  gap: 3px;
}
#theme-toggle-btn .tb-swatch {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.4);
}

/* ── THEME PICKER PANEL ── */
#theme-panel {
  position: absolute;
  top: 64px;
  left: 24px;
  z-index: 200;
  width: 320px;
  background: rgba(15,10,35,0.92);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 16px;
  padding: 16px;
  backdrop-filter: blur(18px);
  box-shadow: 0 16px 48px rgba(0,0,0,0.55);
  display: none;
}
#theme-panel.open { display: block; animation: tpFadeIn 0.18s ease; }
@keyframes tpFadeIn { from{opacity:0;transform:translateY(-8px)} to{opacity:1;transform:translateY(0)} }

#theme-panel .tp-title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
#theme-panel .tp-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}
#theme-panel .tp-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  border-radius: 10px;
  padding: 6px 4px 5px;
  border: 1.5px solid transparent;
  transition: border-color 0.15s, background 0.15s;
}
#theme-panel .tp-chip:hover { background: rgba(255,255,255,0.08); }
#theme-panel .tp-chip.active { border-color: rgba(255,255,255,0.55); background: rgba(255,255,255,0.1); }
#theme-panel .tp-swatches {
  display: flex;
  gap: 2px;
  border-radius: 6px;
  overflow: hidden;
  width: 42px;
  height: 18px;
}
#theme-panel .tp-swatches span {
  flex: 1;
  display: block;
}
#theme-panel .tp-label {
  font-size: 0.6rem;
  color: rgba(255,255,255,0.55);
  text-align: center;
  line-height: 1.2;
  font-weight: 500;
}

/* ── CSS VARIABLES ── */
:root {
  /* Website palette */
  --navy: #2D1B6B;
  --gold: #C9973A;
  --gold-light: #F0C06A;
  --cream: #FBF7F0;
  --white: #ffffff;
  --text: #1A1F36;
  --muted: #6B7399;
  --border: #E2E8F0;
  --green: #1B6B3A;
  --green-light: #E8F5EE;
  --shadow: 0 4px 24px rgba(45,27,107,0.10);
  --shadow-lg: 0 12px 48px rgba(45,27,107,0.18);
  /* CBT palette */
  --primary: #3A1F7A;
  --accent: #6A3EFF;
  --accent2: #00c9a7;
  --danger: #e63946;
  --warning: #f4a261;
  --success: #2dc653;
  --light-bg: #f0f4ff;
  --card-bg: #ffffff;
}

/* ── THEME COLOUR OVERRIDES — site elements that follow the active theme ── */
[data-theme] .top-strip    { background: var(--theme-darkest) !important; }
[data-theme] .logo-img   { background: linear-gradient(135deg, var(--theme-darkest), var(--theme-primary)) !important; }
[data-theme] .cbt-nav-btn  { background: linear-gradient(135deg, var(--theme-primary), var(--theme-accent)) !important; }
[data-theme] .btn-navy     { background: var(--theme-primary) !important; }
[data-theme] .btn-gold     { background: linear-gradient(135deg, var(--theme-accent), var(--theme-light)) !important; color: var(--theme-darkest) !important; }
[data-theme] .divider      { background: linear-gradient(90deg, var(--theme-accent), var(--theme-light)) !important; }
[data-theme] .badge        { background: var(--theme-accent) !important; color: #fff !important; }
[data-theme] .section-title{ color: var(--theme-darkest) !important; }
[data-theme] .hero         { background: linear-gradient(160deg, color-mix(in srgb, var(--theme-darkest) 93%, transparent) 0%, color-mix(in srgb, var(--theme-darkest) 82%, transparent) 50%, color-mix(in srgb, var(--theme-primary) 75%, transparent) 100%), url("https://images.unsplash.com/photo-1580582932707-520aed937b7b?w=1600&q=80") center/cover !important; }
[data-theme] .cbt-promo    { background: linear-gradient(135deg, var(--theme-darkest) 0%, var(--theme-primary) 100%) !important; }
[data-theme] .stats-strip  { background: var(--theme-darkest) !important; }
[data-theme] footer        { background: var(--theme-darkest) !important; }
[data-theme] .cbt-topbar   { background: linear-gradient(135deg, var(--theme-darkest), var(--theme-primary)) !important; }
[data-theme] .notes-header { background: linear-gradient(135deg, var(--theme-darkest), var(--theme-primary)) !important; }
[data-theme] #term-splash  { background: linear-gradient(160deg, var(--theme-darkest), var(--theme-primary)) !important; }
[data-theme] #cbt-term-splash { background: linear-gradient(160deg, var(--theme-darkest), var(--theme-primary)) !important; }
[data-theme] .cbt-hero-btn { background: linear-gradient(135deg, var(--theme-primary), var(--theme-accent)) !important; }
[data-theme] .btn-primary  { background: var(--theme-primary) !important; }
[data-theme] .portal-tab.active { color: var(--theme-primary) !important; border-bottom-color: var(--theme-primary) !important; }
[data-theme] .hero-eyebrow { border-color: rgba(255,255,255,0.35) !important; }
[data-theme] .cbt-lg-btn, [data-theme] .lg-btn { background: linear-gradient(135deg, var(--theme-primary), var(--theme-accent)) !important; }
[data-theme] .nav-links a.active::after { background: var(--theme-accent) !important; }
[data-theme] .notes-tab.active { color: var(--theme-primary) !important; border-bottom-color: var(--theme-primary) !important; }
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; width: 100%; max-width: 100%; overflow-x: hidden; }
body { font-family: 'DM Sans', sans-serif; background: var(--cream); color: var(--text); width: 100%; max-width: 100%; overflow-x: hidden; }

/* ════════════════════════════════
   WEBSITE UTILITY
════════════════════════════════ */
.serif { font-family: 'Playfair Display', serif; }
.container { max-width: 1160px; margin: 0 auto; padding: 0 24px; }
.section { padding: 80px 0; }
.section-title { font-family: 'Playfair Display', serif; font-size: clamp(2rem,4vw,3rem); color: var(--navy); margin-bottom: 12px; }
.section-sub { color: var(--muted); font-size: 1.05rem; max-width: 560px; }
.badge { display: inline-block; background: var(--gold); color: var(--navy); font-size: 0.72rem; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; padding: 4px 12px; border-radius: 20px; margin-bottom: 14px; }
.divider { width: 56px; height: 3px; background: linear-gradient(90deg,var(--gold),var(--gold-light)); border-radius: 2px; margin: 16px 0 28px; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 13px 28px; border-radius: 8px; font-family: 'DM Sans', sans-serif; font-size: 0.95rem; font-weight: 600; cursor: pointer; border: none; transition: all 0.2s; text-decoration: none; }
.btn-navy { background: var(--navy); color: white; }
.btn-navy:hover { background: #3D2585; box-shadow: 0 6px 20px rgba(45,27,107,0.28); transform: translateY(-1px); }
.btn-gold { background: linear-gradient(135deg,var(--gold),var(--gold-light)); color: var(--navy); }
.btn-gold:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(201,151,58,0.38); }
.btn-outline { background: transparent; color: var(--navy); border: 2px solid var(--navy); }
.btn-outline:hover { background: var(--navy); color: white; }

/* ── TOP STRIP ── */
/* ── SITE HEADER (top-strip + navbar as one sticky unit) ── */
.site-header { position: sticky; top: 0; z-index: 1000; }
.top-strip { background: var(--navy); color: rgba(255,255,255,0.75); font-size: 0.8rem; padding: 7px 0; }
.top-strip .container { display: flex; align-items: center; justify-content: space-between; width: 100%; }
.top-strip a { color: var(--gold-light); text-decoration: none; }
.top-strip .ts-items { display: flex; gap: 22px; align-items: center; }

/* ── NAVBAR ── */
.navbar { background: white; box-shadow: 0 2px 16px rgba(45,27,107,0.08); }
.navbar .container { display: flex; align-items: center; justify-content: space-between; height: 72px; }
/* ── ARROW NAVIGATION CONTROL ── */
.nav-arrow-ctrl {
  display: flex;
  align-items: center;
  gap: 2px;
  background: #f4f6fc;
  border: 1px solid #e0e6f0;
  border-radius: 30px;
  padding: 3px 4px;
  margin-right: 12px;
  flex-shrink: 0;
  transition: box-shadow 0.2s;
}
.nav-arrow-ctrl:hover { box-shadow: 0 2px 10px rgba(45,27,107,0.10); }
.nav-arrow-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: none;
  background: transparent;
  border-radius: 50%;
  color: var(--navy);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, transform 0.12s;
  flex-shrink: 0;
}
.nav-arrow-btn:hover:not(:disabled) { background: var(--navy); color: #fff; transform: scale(1.08); }
.nav-arrow-btn:disabled { color: #c0c8dc; cursor: default; }
[data-theme] .nav-arrow-btn:hover:not(:disabled) { background: var(--theme-primary); }
[data-theme] .nav-arrow-ctrl { border-color: color-mix(in srgb, var(--theme-primary) 20%, transparent); }
.nav-arrow-label {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--navy);
  padding: 0 8px;
  white-space: nowrap;
  min-width: 48px;
  text-align: center;
  letter-spacing: 0.2px;
}
[data-theme] .nav-arrow-label { color: var(--theme-primary); }

.nav-logo { display: flex; align-items: center; gap: 14px; text-decoration: none; }
.logo-img { width: 52px; height: 52px; object-fit: contain; border-radius: 8px; filter: drop-shadow(0 2px 8px rgba(45,27,107,0.18)); background: transparent; }
.logo-text { display: flex; flex-direction: column; line-height: 1.15; }
.logo-text strong { font-family: 'Playfair Display', serif; font-size: 1.1rem; color: var(--navy); }
.logo-text span { font-size: 0.7rem; color: var(--muted); font-weight: 500; letter-spacing: 1px; text-transform: uppercase; }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a { padding: 8px 14px; color: var(--text); font-weight: 500; font-size: 0.92rem; text-decoration: none; border-radius: 6px; transition: all 0.18s; position: relative; }
.nav-links a:hover, .nav-links a.active { color: var(--navy); background: #f0f4ff; }
.nav-links a.active::after { content: ''; position: absolute; bottom: 4px; left: 50%; transform: translateX(-50%); width: 18px; height: 2px; background: var(--gold); border-radius: 1px; }
.cbt-nav-btn { display: inline-flex; align-items: center; gap: 8px; padding: 9px 20px; background: linear-gradient(135deg,#3A1F7A,#6A3EFF); color: white; border: none; border-radius: 8px; font-family: 'DM Sans', sans-serif; font-size: 0.9rem; font-weight: 700; cursor: pointer; box-shadow: 0 3px 14px rgba(106,62,255,0.35); transition: all 0.2s; text-decoration: none; margin-left: 8px; position: relative; overflow: hidden; }
.cbt-nav-btn::before { content: ''; position: absolute; inset: 0; background: linear-gradient(135deg,transparent,rgba(255,255,255,0.12)); opacity: 0; transition: opacity 0.2s; }
.cbt-nav-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 22px rgba(106,62,255,0.45); }
.cbt-nav-btn:hover::before { opacity: 1; }
.cbt-nav-btn .pulse-dot { width: 7px; height: 7px; background: #00c9a7; border-radius: 50%; animation: pulse 1.5s infinite; }
@keyframes pulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:.6;transform:scale(1.4)} }
.hamburger { display: none; flex-direction: column; gap: 5px; cursor: pointer; padding: 4px; }
.hamburger span { display: block; width: 24px; height: 2px; background: var(--navy); border-radius: 2px; transition: all 0.2s; }

/* ── HERO ── */
.hero { min-height: 88vh; background: linear-gradient(160deg,rgba(45,27,107,0.93) 0%,rgba(45,27,107,0.82) 50%,rgba(27,107,58,0.75) 100%), url('https://images.unsplash.com/photo-1580582932707-520aed937b7b?w=1600&q=80') center/cover; display: flex; align-items: center; position: relative; overflow: hidden; }
.hero::before { content: ''; position: absolute; inset: 0; pointer-events: none; background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23C9973A' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E"); }
.hero-content { position: relative; z-index: 1; max-width: 680px; }
.hero-eyebrow { display: inline-flex; align-items: center; gap: 10px; background: rgba(201,151,58,0.18); border: 1px solid rgba(201,151,58,0.4); color: var(--gold-light); font-size: 0.8rem; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase; padding: 6px 16px; border-radius: 20px; margin-bottom: 22px; }
.hero h1 { font-family: 'Playfair Display', serif; font-size: clamp(2.8rem,6vw,4.5rem); font-weight: 900; color: white; line-height: 1.1; margin-bottom: 20px; }
.hero h1 .gold { color: var(--gold-light); }
.hero p { color: rgba(255,255,255,0.8); font-size: 1.12rem; line-height: 1.7; max-width: 520px; margin-bottom: 36px; }
.hero-btns { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.cbt-hero-btn { display: inline-flex; align-items: center; gap: 10px; padding: 14px 28px; background: linear-gradient(135deg,#6A3EFF,#00c9a7); color: white; border: none; border-radius: 10px; font-family: 'DM Sans', sans-serif; font-size: 1rem; font-weight: 700; cursor: pointer; box-shadow: 0 4px 24px rgba(106,62,255,0.5); transition: all 0.22s; letter-spacing: 0.2px; position: relative; overflow: hidden; }
.cbt-hero-btn::after { content: ''; position: absolute; top: -50%; left: -60%; width: 40%; height: 200%; background: rgba(255,255,255,0.18); transform: skewX(-20deg); transition: left 0.4s; }
.cbt-hero-btn:hover { transform: translateY(-3px); box-shadow: 0 8px 32px rgba(106,62,255,0.55); }
.cbt-hero-btn:hover::after { left: 130%; }
.cbt-icon { font-size: 1.2rem; }
.hero-stats { display: flex; gap: 40px; margin-top: 50px; padding-top: 36px; border-top: 1px solid rgba(255,255,255,0.15); }
.hero-stat .num { font-family: 'Playfair Display', serif; font-size: 2.2rem; font-weight: 900; color: var(--gold-light); }
.hero-stat .lbl { font-size: 0.8rem; color: rgba(255,255,255,0.65); font-weight: 500; }

/* ── WELCOME ── */
.welcome-section { background: white; padding: 80px 0; }
.welcome-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; }
.welcome-img-wrap { position: relative; }
.welcome-img { width: 100%; border-radius: 16px; overflow: hidden; box-shadow: var(--shadow-lg); aspect-ratio: 4/3; background: linear-gradient(135deg,rgba(45,27,107,0.55),rgba(27,107,58,0.45)), url('https://images.unsplash.com/photo-1509062522246-3755977927d7?w=800&q=80') center/cover; }
.welcome-badge-float { position: absolute; bottom: -20px; right: -20px; background: var(--gold); color: var(--navy); padding: 20px 24px; border-radius: 12px; font-family: 'Playfair Display', serif; box-shadow: var(--shadow); text-align: center; }
.welcome-badge-float .wb-num { font-size: 2rem; font-weight: 900; display: block; }
.welcome-badge-float .wb-lbl { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.5px; text-transform: uppercase; }
.principal-sig { display: flex; align-items: center; gap: 14px; margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--border); }
.sig-avatar { width: 52px; height: 52px; border-radius: 50%; background: linear-gradient(135deg,var(--navy),#4A2A9E); display: flex; align-items: center; justify-content: center; color: white; font-size: 1.3rem; }
.sig-info strong { display: block; font-size: 0.95rem; font-weight: 700; color: var(--navy); }
.sig-info span { font-size: 0.82rem; color: var(--muted); }

/* ── CLASSES / ACADEMY ── */
.classes-section { background: var(--cream); padding: 80px 0; }
.Academy-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 24px; margin-top: 40px; }
.school-card { background: white; border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); transition: all 0.25s; border: 1px solid var(--border); }
.school-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.school-card-header { padding: 28px 24px 20px; position: relative; }
.school-card-header::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px; }
.card-nursery .school-card-header::before { background: linear-gradient(90deg,#FFB347,#FF8C42); }
.card-primary .school-card-header::before { background: linear-gradient(90deg,#4CAF50,#2DC653); }
.card-jss .school-card-header::before { background: linear-gradient(90deg,#6A3EFF,#00b4d8); }
.card-sss .school-card-header::before { background: linear-gradient(90deg,#C9973A,#F0C06A); }
.card-nursery .school-icon { background: #FFF3E6; color: #FF8C42; }
.card-primary .school-icon { background: #E8F5EE; color: #2DC653; }
.card-jss .school-icon { background: #E6EEFF; color: #6A3EFF; }
.card-sss .school-icon { background: #FFF8EC; color: #C9973A; }
.school-icon { width: 52px; height: 52px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; margin-bottom: 14px; }
.school-card h3 { font-family: 'Playfair Display', serif; font-size: 1.3rem; color: var(--navy); margin-bottom: 6px; }
.school-card .sc-range { font-size: 0.82rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.class-tags { padding: 0 24px 24px; display: flex; flex-wrap: wrap; gap: 6px; }
.class-tag { display: inline-block; background: #f0f4ff; color: #6A3EFF; font-size: 0.78rem; font-weight: 600; padding: 3px 10px; border-radius: 4px; }
.school-card-footer { display: flex; align-items: center; justify-content: space-between; padding: 14px 24px; border-top: 1px solid var(--border); font-size: 0.8rem; }
.sc-count { color: var(--muted); }
.sc-badge { background: var(--navy); color: white; padding: 3px 10px; border-radius: 20px; font-size: 0.72rem; font-weight: 700; }

/* ── CBT PROMO ── */
.cbt-promo { padding: 80px 0; background: linear-gradient(135deg,#3A1F7A 0%,#6A3EFF 60%,#00c9a7 100%); }
.cbt-promo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center; }
.cbt-promo h2 { font-family: 'Playfair Display', serif; font-size: clamp(1.8rem,3.5vw,2.8rem); color: white; margin-bottom: 14px; }
.cbt-promo p { color: rgba(255,255,255,0.8); line-height: 1.75; margin-bottom: 28px; }
.cbt-features { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 28px; }
.cbt-feature { display: flex; gap: 12px; align-items: flex-start; }
.cbt-feature-icon { width: 36px; height: 36px; background: rgba(255,255,255,0.12); border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; flex-shrink: 0; }
.cbt-feature-text strong { display: block; color: white; font-size: 0.88rem; }
.cbt-feature-text span { color: rgba(255,255,255,0.65); font-size: 0.8rem; }
.cbt-visual { background: rgba(255,255,255,0.07); border-radius: 16px; padding: 32px; border: 1px solid rgba(255,255,255,0.15); }
.cbt-visual-stat { display: flex; align-items: center; gap: 16px; padding: 14px 0; border-bottom: 1px solid rgba(255,255,255,0.1); }
.cbt-visual-stat:last-child { border-bottom: none; }
.cvs-icon { width: 40px; height: 40px; background: rgba(255,255,255,0.1); border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; }
.cvs-label { color: rgba(255,255,255,0.7); font-size: 0.82rem; }
.cvs-val { color: white; font-weight: 700; font-size: 1.05rem; }

/* ── ACADEMICS ── */
.academics-section { background: white; padding: 80px 0; }
.subjects-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 24px; margin-top: 32px; }
.subjects-card { background: var(--cream); border-radius: 12px; padding: 24px; border: 1px solid var(--border); }
.subjects-card h4 { font-size: 1rem; color: var(--navy); margin-bottom: 14px; }
.subjects-list { list-style: none; }
.subjects-list li { padding: 5px 0; font-size: 0.88rem; color: var(--muted); border-bottom: 1px solid var(--border); }
.subjects-list li:last-child { border-bottom: none; }

/* ── STATS STRIP ── */
.stats-strip { background: var(--navy); padding: 50px 0; }
.stats-row { display: grid; grid-template-columns: repeat(5,1fr); gap: 0; }
.stat-item { text-align: center; padding: 20px; border-right: 1px solid rgba(255,255,255,0.1); }
.stat-item:last-child { border-right: none; }
.stat-item .sn { font-family: 'Playfair Display', serif; font-size: 2.4rem; font-weight: 900; color: var(--gold-light); }
.stat-item .sl { font-size: 0.82rem; color: rgba(255,255,255,0.6); margin-top: 4px; }

/* ── NEWS ── */
.news-section { background: var(--cream); padding: 80px 0; }
.news-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 24px; margin-top: 32px; }
.news-card { background: white; border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); border: 1px solid var(--border); transition: all 0.25s; }
.news-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.news-card-img { height: 160px; background: linear-gradient(135deg,var(--navy),#6A3EFF); display: flex; align-items: center; justify-content: center; font-size: 3rem; }
.news-card-body { padding: 20px; }
.news-date { font-size: 0.75rem; color: var(--gold); font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px; }
.news-card h4 { font-size: 1rem; color: var(--navy); margin-bottom: 8px; line-height: 1.4; }
.news-card p { font-size: 0.85rem; color: var(--muted); line-height: 1.6; }

/* ── CONTACT ── */
.contact-section { background: white; padding: 80px 0; }
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; margin-top: 32px; }
.contact-item { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 20px; }
.contact-icon { width: 44px; height: 44px; background: var(--light-bg); border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; flex-shrink: 0; }
.contact-info strong { display: block; font-size: 0.9rem; color: var(--navy); margin-bottom: 3px; }
.contact-info span { font-size: 0.85rem; color: var(--muted); }
.contact-form { background: var(--cream); border-radius: 14px; padding: 28px; border: 1px solid var(--border); }
.contact-form input, .contact-form select, .contact-form textarea { width: 100%; padding: 10px 14px; border: 1.5px solid var(--border); border-radius: 8px; font-family: 'DM Sans', sans-serif; font-size: 0.93rem; margin-bottom: 14px; background: white; color: var(--text); outline: none; }
.contact-form textarea { min-height: 100px; resize: vertical; }

/* ── FOOTER ── */
footer { background: #070f24; color: rgba(255,255,255,0.7); padding: 60px 0 0; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; margin-bottom: 40px; }
.footer-brand p { font-size: 0.88rem; line-height: 1.7; margin-top: 16px; }
.fb-logo { display: flex; align-items: center; gap: 12px; }
.fb-logo-img { width: 44px; height: 44px; object-fit: contain; border-radius: 8px; background: transparent; filter: drop-shadow(0 1px 4px rgba(0,0,0,0.15)); }
.fb-title strong { display: block; font-family: 'Playfair Display', serif; color: white; font-size: 1rem; }
.fb-title span { font-size: 0.7rem; color: rgba(255,255,255,0.5); text-transform: uppercase; letter-spacing: 0.5px; }
.footer-col h5 { color: white; font-size: 0.88rem; font-weight: 700; margin-bottom: 16px; text-transform: uppercase; letter-spacing: 0.5px; }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 9px; }
.footer-col a { color: rgba(255,255,255,0.6); text-decoration: none; font-size: 0.85rem; transition: color 0.2s; }
.footer-col a:hover { color: var(--gold-light); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.08); padding: 20px 0; display: flex; justify-content: space-between; font-size: 0.82rem; color: rgba(255,255,255,0.4); }
.footer-bottom a { color: var(--gold-light); text-decoration: none; }

/* ════════════════════════════════
   CBT MODAL OVERLAY
════════════════════════════════ */
.cbt-modal-overlay { display: none; position: fixed; inset: 0; background: rgba(7,15,36,0.78); z-index: 9000; align-items: center; justify-content: center; padding: 16px; backdrop-filter: blur(6px); }
.cbt-modal-overlay.open { display: flex; }
.cbt-modal-box { background: white; border-radius: 18px; width: 100%; max-width: 1020px; max-height: 94vh; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 24px 80px rgba(0,0,0,0.45); }
.cbt-modal-header { background: rgba(10,20,50,0.97); display: flex; align-items: center; justify-content: space-between; padding: 14px 22px; flex-shrink: 0; }
.cbt-modal-header h3 { color: white; font-family: 'Outfit', sans-serif; font-size: 0.95rem; font-weight: 700; letter-spacing: 0.3px; }
.cbt-modal-close { background: rgba(255,255,255,0.1); border: none; color: white; width: 32px; height: 32px; border-radius: 50%; cursor: pointer; font-size: 1rem; display: flex; align-items: center; justify-content: center; transition: background 0.2s; }
.cbt-modal-close:hover { background: rgba(230,57,70,0.8); }
.cbt-modal-body { overflow-y: auto; flex: 1; }

/* ════════════════════════════════
   CBT WRAP — INTERNAL
════════════════════════════════ */
.cbt-wrap { font-family: 'Outfit', sans-serif; color: #1a1f36; }
.cbt-topbar { background: rgba(10,20,50,0.97); color: white; padding: 0 20px; height: 50px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(255,255,255,0.07); }
.cbt-topbar-logo { font-size: 1rem; font-weight: 800; letter-spacing: 1px; display: flex; align-items: center; gap: 8px; }
.cbt-logo-img { width: 38px; height: 38px; object-fit: contain; border-radius: 6px; background: transparent; filter: drop-shadow(0 1px 6px rgba(0,0,0,0.25)) brightness(1.1); }
.cbt-logo-badge { background: linear-gradient(135deg,#6A3EFF,#00c9a7); color: white; font-size: 0.72rem; font-weight: 700; padding: 2px 7px; border-radius: 4px; }
.cbt-topbar-right { display: flex; align-items: center; gap: 16px; font-size: 0.84rem; }
#cbt_userGCCplay { color: #00c9a7; font-weight: 600; }
#cbt_timerGCCplay { font-weight: 700; font-size: 0.95rem; color: white; transition: color 0.3s; }
#cbt_timerGCCplay.warning { color: #f4a261; }
#cbt_timerGCCplay.blink { animation: cblink 0.8s infinite; color: #e63946; }
@keyframes cblink { 50% { opacity: 0; } }
.cbt-inner { padding: 0; }
.cbt-page { display: none; }
.cbt-page.active { display: block; }
.cbt-page-body { padding: 24px 28px; }

/* CBT Typography */
.cbt-wrap h2 { font-size: 1.55rem; font-weight: 800; color: #3A1F7A; margin-bottom: 5px; }
.cbt-wrap h3 { font-size: 1rem; font-weight: 700; color: #3A1F7A; margin: 18px 0 9px; }
.cbt-wrap .subtitle { color: #6b7a99; font-size: 0.88rem; margin-bottom: 22px; }

/* CBT Form */
.cbt-wrap .form-group { margin-bottom: 14px; }
.cbt-wrap .form-group label { display: block; font-size: 0.78rem; font-weight: 700; color: #6b7a99; margin-bottom: 5px; text-transform: uppercase; letter-spacing: 0.5px; }
.cbt-wrap input[type="text"], .cbt-wrap input[type="password"], .cbt-wrap input[type="number"], .cbt-wrap select, .cbt-wrap textarea { width: 100%; padding: 9px 13px; border: 1.5px solid #d8e2f0; border-radius: 8px; font-family: 'Outfit', sans-serif; font-size: 0.9rem; color: #1a1f36; background: #f8faff; transition: border-color 0.2s, box-shadow 0.2s; outline: none; }
.cbt-wrap input:focus, .cbt-wrap select:focus { border-color: #6A3EFF; box-shadow: 0 0 0 3px rgba(106,62,255,0.12); background: #fff; }
.cbt-wrap .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cbt-wrap .form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }

/* CBT Buttons */
.cbt-wrap .btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 18px; border: none; border-radius: 8px; font-family: 'Outfit', sans-serif; font-size: 0.88rem; font-weight: 600; cursor: pointer; transition: all 0.18s; white-space: nowrap; }
.cbt-wrap .btn-primary { background: linear-gradient(135deg,#6A3EFF,#0052cc); color: white; }
.cbt-wrap .btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(106,62,255,0.35); }
.cbt-wrap .btn-success { background: linear-gradient(135deg,#00c9a7,#009e83); color: white; }
.cbt-wrap .btn-success:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(0,201,167,0.35); }
.cbt-wrap .btn-danger { background: linear-gradient(135deg,#e63946,#b5212c); color: white; }
.cbt-wrap .btn-outline { background: white; color: #3A1F7A; border: 1.5px solid #d8e2f0; }
.cbt-wrap .btn-outline:hover { border-color: #6A3EFF; color: #6A3EFF; background: #f0f4ff; }
.cbt-wrap .btn-sm { padding: 5px 10px; font-size: 0.78rem; }
.cbt-wrap .btn-full { width: 100%; }
.cbt-wrap .btn-group { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }

/* CBT Cards / Stats */
.cbt-wrap .card { background: #f0f4ff; border: 1.5px solid #d8e2f0; border-radius: 10px; padding: 18px; margin-bottom: 14px; }
.cbt-wrap .stat-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; margin: 14px 0; }
.cbt-wrap .stat-card { background: white; border: 1.5px solid #d8e2f0; border-radius: 10px; padding: 16px; text-align: center; }
.cbt-wrap .stat-card .stat-num { font-size: 1.8rem; font-weight: 800; color: #6A3EFF; }
.cbt-wrap .stat-card .stat-label { font-size: 0.76rem; color: #6b7a99; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; margin-top: 3px; }

/* CBT Tables */
.cbt-wrap .table-wrap { overflow-x: auto; border-radius: 10px; border: 1.5px solid #d8e2f0; margin: 10px 0; }
.cbt-wrap table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
.cbt-wrap th { background: #3A1F7A; color: white; padding: 10px 13px; text-align: left; font-weight: 600; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.5px; }
.cbt-wrap td { padding: 9px 13px; border-bottom: 1px solid #d8e2f0; vertical-align: middle; }
.cbt-wrap tr:last-child td { border-bottom: none; }
.cbt-wrap tr:hover td { background: #f5f8ff; }

/* CBT Login */
.cbt-wrap .login-wrap { max-width: 380px; margin: 0 auto; }
.cbt-wrap .login-header { text-align: center; padding: 16px 0 24px; }
.cbt-wrap .logo-icon { width: 60px; height: 60px; background: linear-gradient(135deg,#6A3EFF,#00c9a7); border-radius: 14px; display: flex; align-items: center; justify-content: center; margin: 0 auto 14px; font-size: 1.6rem; }
.cbt-wrap .tab-row { display: flex; border: 1.5px solid #d8e2f0; border-radius: 8px; overflow: hidden; margin-bottom: 20px; }
.cbt-wrap .tab-btn { flex: 1; padding: 8px; background: white; border: none; font-family: 'Outfit', sans-serif; font-size: 0.84rem; font-weight: 600; color: #6b7a99; cursor: pointer; transition: all 0.2s; }
.cbt-wrap .tab-btn.active { background: #6A3EFF; color: white; }
.cbt-wrap .divider-text { display: flex; align-items: center; gap: 10px; color: #6b7a99; font-size: 0.8rem; margin: 14px 0; }
.cbt-wrap .divider-text::before, .cbt-wrap .divider-text::after { content: ''; flex: 1; height: 1px; background: #d8e2f0; }

/* CBT Exam */
.cbt-wrap .exam-layout { display: grid; grid-template-columns: 1fr 220px; gap: 20px; }
.cbt-wrap #cbt_questionBox { background: #f0f4ff; padding: 18px 20px; border-left: 4px solid #6A3EFF; border-radius: 8px; font-size: 0.95rem; line-height: 1.6; margin-bottom: 14px; }
.cbt-wrap .option-btn { display: flex; align-items: center; gap: 10px; width: 100%; padding: 11px 14px; margin: 6px 0; border-radius: 8px; border: 1.5px solid #d8e2f0; cursor: pointer; text-align: left; background: white; font-family: 'Outfit', sans-serif; font-size: 0.9rem; color: #1a1f36; transition: all 0.18s; }
.cbt-wrap .option-btn:hover { border-color: #6A3EFF; background: #f0f4ff; }
.cbt-wrap .option-btn.selected { border-color: #6A3EFF; background: #e6eeff; font-weight: 600; color: #6A3EFF; }
.cbt-wrap .opt-letter { width: 28px; height: 28px; min-width: 28px; border-radius: 50%; border: 1.5px solid currentColor; display: flex; align-items: center; justify-content: center; font-size: 0.78rem; font-weight: 700; }
.cbt-wrap .option-btn.selected .opt-letter { background: #6A3EFF; color: white; border-color: #6A3EFF; }

/* Palette */
.cbt-wrap .palette-title { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: #6b7a99; margin-bottom: 8px; }
.cbt-wrap .palette-grid { display: grid; grid-template-columns: repeat(5,1fr); gap: 4px; }
.cbt-wrap .pal-btn { width: 34px; height: 34px; border-radius: 6px; border: 1.5px solid #d8e2f0; background: white; font-family: 'Outfit', sans-serif; font-size: 0.76rem; font-weight: 600; cursor: pointer; transition: all 0.15s; color: #1a1f36; }
.cbt-wrap .pal-btn.answered { background: #2dc653; color: white; border-color: #2dc653; }
.cbt-wrap .pal-btn.flagged { background: #f4a261; color: white; border-color: #f4a261; }
.cbt-wrap .pal-btn.current { background: #6A3EFF; color: white; border-color: #6A3EFF; box-shadow: 0 0 0 2px rgba(106,62,255,0.3); }
.cbt-wrap .palette-legend { margin-top: 10px; font-size: 0.72rem; color: #6b7a99; }
.cbt-wrap .legend-item { display: flex; align-items: center; gap: 5px; margin-bottom: 4px; }
.cbt-wrap .legend-dot { width: 9px; height: 9px; border-radius: 3px; }

/* Question header */
.cbt-wrap .question-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.cbt-wrap .q-num { font-size: 0.78rem; font-weight: 700; color: #6b7a99; text-transform: uppercase; letter-spacing: 0.5px; }
.cbt-wrap .q-progress { font-size: 0.78rem; color: #6b7a99; }
.cbt-wrap .progress-bar { height: 4px; background: #d8e2f0; border-radius: 2px; margin-bottom: 14px; }
.cbt-wrap .progress-fill { height: 100%; background: linear-gradient(90deg,#6A3EFF,#00c9a7); border-radius: 2px; transition: width 0.3s; }
.cbt-wrap .exam-nav { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 14px; }

/* Badges */
.cbt-wrap .badge { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 20px; font-size: 0.74rem; font-weight: 600; }
.cbt-wrap .badge-blue { background: #e6eeff; color: #6A3EFF; }
.cbt-wrap .badge-green { background: #e6f7ef; color: #1a8c4e; }
.cbt-wrap .badge-orange { background: #fff2e6; color: #cc6600; }
.cbt-wrap .badge-red { background: #ffe6e8; color: #e63946; }

/* Alerts */
.cbt-wrap .alert { padding: 10px 13px; border-radius: 8px; font-size: 0.85rem; font-weight: 500; margin-bottom: 10px; }
.cbt-wrap .alert-success { background: #e6f7ef; border: 1px solid #b2dfcc; color: #1a5c35; }
.cbt-wrap .alert-warning { background: #fff3e0; border: 1px solid #ffcc80; color: #7a4400; }
.cbt-wrap .alert-danger { background: #ffe6e8; border: 1px solid #ffb3b8; color: #7a1520; }
.cbt-wrap .alert-info { background: #e6eeff; border: 1px solid #b3c6ff; color: #1a3d99; }

/* File drop */
.cbt-wrap .file-drop { border: 2px dashed #d8e2f0; border-radius: 10px; padding: 22px; text-align: center; cursor: pointer; transition: all 0.2s; background: #f8faff; display: block; }
.cbt-wrap .file-drop:hover { border-color: #6A3EFF; background: #f0f4ff; }
.cbt-wrap .file-drop input[type="file"] { display: none; }
.cbt-wrap .file-drop .fd-icon { font-size: 1.8rem; margin-bottom: 5px; }
.cbt-wrap .file-drop .fd-text { font-size: 0.82rem; color: #6b7a99; }
.cbt-wrap .file-drop .fd-text strong { color: #6A3EFF; }
.cbt-wrap #cbt_jsonOutput { background: #0f1a2e; color: #00e5a0; padding: 12px; border-radius: 8px; font-size: 0.72rem; max-height: 180px; overflow-y: auto; }

/* Result */
.cbt-wrap .result-hero { text-align: center; padding: 24px 0 14px; }
.cbt-wrap .score-ring { width: 130px; height: 130px; margin: 0 auto 16px; position: relative; }
.cbt-wrap .score-ring svg { transform: rotate(-90deg); }
.cbt-wrap .ring-bg { fill: none; stroke: #d8e2f0; stroke-width: 10; }
.cbt-wrap .ring-fill { fill: none; stroke: #6A3EFF; stroke-width: 10; stroke-linecap: round; transition: stroke-dashoffset 1s ease; }
.cbt-wrap .score-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.cbt-wrap .score-pct { font-size: 1.6rem; font-weight: 800; color: #3A1F7A; }
.cbt-wrap .score-label { font-size: 0.7rem; color: #6b7a99; font-weight: 600; text-transform: uppercase; }
.cbt-wrap .result-details-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin: 18px 0; }
.cbt-wrap .result-detail { background: #f0f4ff; border-radius: 10px; padding: 13px; text-align: center; }
.cbt-wrap .result-detail .rd-num { font-size: 1.4rem; font-weight: 800; }
.cbt-wrap .result-detail .rd-lbl { font-size: 0.74rem; color: #6b7a99; font-weight: 600; text-transform: uppercase; margin-top: 3px; }
.cbt-wrap .result-detail.green .rd-num { color: #2dc653; }
.cbt-wrap .result-detail.red .rd-num { color: #e63946; }
.cbt-wrap .result-detail.blue .rd-num { color: #6A3EFF; }

/* Tabs */
.cbt-wrap .portal-tabs { display: flex; gap: 0; border-bottom: 2px solid #d8e2f0; margin-bottom: 18px; overflow-x: auto; }
.cbt-wrap .portal-tab { padding: 8px 15px; background: none; border: none; border-bottom: 3px solid transparent; margin-bottom: -2px; font-family: 'Outfit', sans-serif; font-size: 0.86rem; font-weight: 600; color: #6b7a99; cursor: pointer; transition: all 0.2s; white-space: nowrap; }
.cbt-wrap .portal-tab.active { color: #6A3EFF; border-bottom-color: #6A3EFF; }
.cbt-wrap .tab-panel { display: none; }
.cbt-wrap .tab-panel.active { display: block; }

/* Strength bar */
.cbt-wrap .strength-bar { height: 4px; border-radius: 2px; background: #d8e2f0; margin-top: 5px; overflow: hidden; }
.cbt-wrap .strength-fill { height: 100%; border-radius: 2px; transition: width 0.3s, background 0.3s; }

/* Exam title bar */
.cbt-wrap .exam-title-bar { background: linear-gradient(135deg,#3A1F7A,#6A3EFF); color: white; padding: 16px 20px; border-radius: 10px; margin-bottom: 16px; }
.cbt-wrap .exam-title-bar h3 { color: white; margin: 0; font-size: 1.05rem; }
.cbt-wrap .exam-title-bar p { color: rgba(255,255,255,0.75); font-size: 0.8rem; margin-top: 3px; }

/* Subject select */
.cbt-wrap .subject-select-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* ── SCIENTIFIC CALCULATOR ── */
.cbt-wrap .calc-toggle { width: 100%; margin-top: 14px; padding: 7px; background: linear-gradient(135deg,#3A1F7A,#6A3EFF); color: white; border: none; border-radius: 8px; font-family: 'Outfit', sans-serif; font-size: 0.8rem; font-weight: 700; cursor: pointer; letter-spacing: 0.5px; }
.cbt-wrap .calc-wrap { display: none; margin-top: 8px; background: #0f1a2e; border-radius: 10px; padding: 10px; box-shadow: 0 4px 16px rgba(0,0,0,0.3); }
.cbt-wrap .calc-wrap.open { display: block; }
.cbt-wrap .calc-screen { background: #1a2d4a; color: #00e5a0; font-size: 1.1rem; font-weight: 700; font-family: monospace; text-align: right; padding: 8px 10px; border-radius: 6px; margin-bottom: 7px; min-height: 50px; word-break: break-all; }
.cbt-wrap .calc-screen .calc-expr { font-size: 0.6rem; color: rgba(0,229,160,0.5); display: block; min-height: 11px; margin-bottom: 2px; }
.cbt-wrap .calc-screen .calc-mem { font-size: 0.6rem; color: #f4a261; float: left; }
.cbt-wrap .calc-mode-row { display: flex; gap: 4px; margin-bottom: 6px; }
.cbt-wrap .calc-mode-btn { flex: 1; padding: 5px 3px; background: #1e3a5f; border: none; border-radius: 5px; font-family: 'Outfit', sans-serif; font-size: 0.7rem; font-weight: 700; color: #7ab0d8; cursor: pointer; transition: all 0.15s; }
.cbt-wrap .calc-mode-btn.active { background: #6A3EFF; color: white; }
.cbt-wrap .calc-btns { display: grid; grid-template-columns: repeat(5,1fr); gap: 3px; }
.cbt-wrap .cb { padding: 7px 2px; border: none; border-radius: 5px; font-family: 'Outfit', sans-serif; font-size: 0.72rem; font-weight: 700; cursor: pointer; transition: all 0.15s; }
.cbt-wrap .cb:hover { transform: scale(1.07); }
.cbt-wrap .cb-num { background: #1e3a5f; color: #e0f0ff; }
.cbt-wrap .cb-op { background: #6A3EFF; color: white; }
.cbt-wrap .cb-eq { background: #00c9a7; color: white; }
.cbt-wrap .cb-clr { background: #e63946; color: white; }
.cbt-wrap .cb-back { background: #f4a261; color: white; }
.cbt-wrap .cb-sci { background: #2d4a6b; color: #b0d0f0; }
.cbt-wrap .cb-mem { background: #3d2d6b; color: #d0b0f0; }
.cbt-wrap .cb-const { background: #1e4a3a; color: #80f0c0; }

/* Class filter buttons */
.cbt-wrap .class-filter-btns { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.cbt-wrap .class-filter-btns .cf-btn { padding: 4px 11px; border-radius: 20px; border: 1.5px solid #d8e2f0; background: white; font-family: 'Outfit', sans-serif; font-size: 0.78rem; font-weight: 600; color: #6b7a99; cursor: pointer; transition: all 0.18s; }
.cbt-wrap .class-filter-btns .cf-btn.active, .cbt-wrap .class-filter-btns .cf-btn:hover { background: #6A3EFF; color: white; border-color: #6A3EFF; }

/* Email status */
.cbt-wrap .email-status-bar { display: flex; align-items: center; gap: 7px; padding: 6px 11px; border-radius: 8px; font-size: 0.8rem; font-weight: 600; margin-bottom: 10px; }
.cbt-wrap .email-status-bar.online { background: #e6f7ef; color: #1a5c35; border: 1px solid #b2dfcc; }
.cbt-wrap .email-status-bar.offline { background: #fff3e0; color: #7a4400; border: 1px solid #ffcc80; }
.cbt-wrap .online-dot { width: 8px; height: 8px; border-radius: 50%; background: #2dc653; animation: pulse 1.5s infinite; }
.cbt-wrap .offline-dot { width: 8px; height: 8px; border-radius: 50%; background: #f4a261; }

/* CBT Modal (submit) */
.cbt-inner-modal { display: none; position: fixed; inset: 0; background: rgba(10,20,50,0.55); z-index: 10000; align-items: center; justify-content: center; }
.cbt-inner-modal.open { display: flex; }
.cbt-inner-modal .modal-box { background: white; border-radius: 14px; padding: 24px; width: 90%; max-width: 400px; box-shadow: 0 8px 40px rgba(15,43,92,0.18); font-family: 'Outfit', sans-serif; }
.cbt-inner-modal .modal-title { font-size: 1rem; font-weight: 700; color: #3A1F7A; margin-bottom: 12px; }
.cbt-inner-modal .modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }

/* Practice mode accent */
.cbt-wrap .practice-title-bar { background: linear-gradient(135deg,#006644,#00c9a7); }

/* ════════════════════════════════
   RESPONSIVE
════════════════════════════════ */
@media(max-width:900px) {
  .welcome-grid, .cbt-promo-grid, .contact-grid { grid-template-columns: 1fr; }
  .subjects-grid { grid-template-columns: 1fr 1fr; }
  .Academy-grid { grid-template-columns: 1fr 1fr; }
  .news-grid { grid-template-columns: 1fr 1fr; }
  .stats-row { grid-template-columns: 1fr 1fr; gap: 0; }
  .stat-item { border-right: none; border-bottom: 1px solid rgba(255,255,255,0.1); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .hero-stats { gap: 24px; }
  .cbt-features { grid-template-columns: 1fr; }
  .cbt-wrap .exam-layout { grid-template-columns: 1fr; }
  .cbt-wrap .stat-grid { grid-template-columns: 1fr 1fr; }
}
@media(max-width:600px) {
  .top-strip .ts-items:first-child { display: none; }
  .nav-links { display: none; }
  .hamburger { display: flex; }
  .Academy-grid { grid-template-columns: 1fr; }
  .subjects-grid { grid-template-columns: 1fr; }
  .news-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .hero-stats { flex-direction: column; gap: 16px; }
  .cbt-wrap .form-row, .cbt-wrap .form-row-3, .cbt-wrap .subject-select-wrap { grid-template-columns: 1fr; }
  .cbt-wrap .result-details-grid { grid-template-columns: 1fr; }
  .cbt-visual { display: none; }
  .cbt-modal-overlay { padding: 0; }
  .cbt-modal-box { border-radius: 0; max-height: 100vh; height: 100vh; }
  .cbt-page-body { padding: 16px; }
  .cbt-wrap h2 { font-size: 1.25rem; }
  .cbt-wrap .stat-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .cbt-wrap .stat-card .stat-num { font-size: 1.4rem; }
  .cbt-wrap .exam-nav { gap: 4px; }
  .cbt-wrap .exam-nav .btn { padding: 7px 10px; font-size: 0.78rem; }
  .cbt-wrap .class-filter-btns { gap: 4px; }
  .cbt-wrap .portal-tab { padding: 8px 10px; font-size: 0.78rem; }
}


/* ===== Integrated Portal Buttons ===== */
.portal-buttons{
  display:flex;
  gap:10px;
  align-items:center;
}

.notes-nav-btn{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:10px 16px;
  border-radius:8px;
  background:linear-gradient(135deg,#1B6B3A,#27A84A);
  color:white;
  text-decoration:none;
  font-weight:600;
  position:relative;
}

.animated-portal-btn{
  animation: floatingGlow 2.8s ease-in-out infinite;
  transition: all .3s ease;
}

.animated-portal-btn:hover{
  transform: translateY(-3px) scale(1.02);
}

@keyframes floatingGlow{
  0%{
    transform:translateY(0px);
    box-shadow:0 0 0 rgba(0,0,0,0);
  }
  50%{
    transform:translateY(-4px);
    box-shadow:0 10px 25px rgba(201,151,58,0.28);
  }
  100%{
    transform:translateY(0px);
    box-shadow:0 0 0 rgba(0,0,0,0);
  }
}


@media (max-width:768px){
  .portal-buttons{
    flex-direction:column;
    width:100%;
    margin-top:10px;
  }

  .cbt-nav-btn,
  .notes-nav-btn{
    width:100%;
    justify-content:center;
  }

  .hero-btns{
    display:flex;
    flex-direction:column;
    gap:12px;
  }
}
/* ══════════════════════════════════════════════════════
   VIEW SWITCHER
══════════════════════════════════════════════════════ */
.app-view { display: none !important; }
.app-view.active { display: block !important; }
#view-cbt.active { display: block !important; }
#view-notes.active { display: block !important; }


/* ══════════════════════════════════════════════════════
   CBT SYSTEM STYLES (from smart-cbt_ne.html)
══════════════════════════════════════════════════════ */
/* ═══════════════════════════════════
   R2G SMART CBT — STANDALONE CSS
═══════════════════════════════════ */

/* ═══════════════════════════════════════
   CSS VARIABLES & RESET
═══════════════════════════════════════ */
:root {
  /* REFINED COLOR PALETTE — professional, warm navy + amber gold */
  --navy:       #0D2144;          /* deeper, richer navy */
  --gold:       #B8860B;          /* dark goldenrod — more prestigious */
  --gold-light: #E8B84B;          /* warm amber highlight */
  --cream:      #F7F3EC;          /* slightly warmer cream */
  --white:      #ffffff;
  --text:       #1C2035;
  --muted:      #6B7399;
  --border:     #DDE4EF;
  --green:      #165C33;          /* slightly deeper emerald */
  --green-light:#EAF5EE;
  --shadow:     0 4px 24px rgba(13,33,68,0.10);
  --shadow-lg:  0 12px 48px rgba(13,33,68,0.18);
  /* CBT vars */
  --primary:    #0D2A5C;
  --accent:     #1558D6;          /* deeper royal blue */
  --accent2:    #00B896;          /* refined teal */
  --danger:     #D63349;
  --warning:    #E8924A;
  --success:    #27A84A;
  --light-bg:   #EEF2FF;
  --card-bg:    #ffffff;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: 'DM Sans', sans-serif; background: var(--cream); color: var(--text); overflow-x: hidden; }

/* ═══════════════════════════════════════
   UTILITY
═══════════════════════════════════════ */
.serif { font-family: 'Playfair Display', serif; }
.container { max-width: 1160px; margin: 0 auto; padding: 0 24px; }
.section { padding: 80px 0; }
.section-title { font-family: 'Playfair Display', serif; font-size: clamp(2rem, 4vw, 3rem); color: var(--navy); margin-bottom: 12px; }
.section-sub { color: var(--muted); font-size: 1.05rem; max-width: 560px; }
.badge { display: inline-block; background: var(--gold); color: #fff; font-size: 0.72rem; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; padding: 4px 12px; border-radius: 20px; margin-bottom: 14px; }
.divider { width: 56px; height: 3px; background: linear-gradient(90deg, var(--gold), var(--gold-light)); border-radius: 2px; margin: 16px 0 28px; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 13px 28px; border-radius: 8px; font-family: 'DM Sans', sans-serif; font-size: 0.95rem; font-weight: 600; cursor: pointer; border: none; transition: all 0.2s; text-decoration: none; }
.btn-navy { background: var(--navy); color: white; }
.btn-navy:hover { background: #122860; box-shadow: 0 6px 20px rgba(13,33,68,0.28); transform: translateY(-1px); }
.btn-gold { background: linear-gradient(135deg, var(--gold), var(--gold-light)); color: var(--navy); }
.btn-gold:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(184,134,11,0.38); }
.btn-outline { background: transparent; color: var(--navy); border: 2px solid var(--navy); }
.btn-outline:hover { background: var(--navy); color: white; }


/* Standalone base — body overrides removed for merged build */

/* ═══════════════════════════════════════
   CBT MODAL
═══════════════════════════════════════ */
.cbt-modal-overlay {
  display: none; position: fixed; inset: 0; z-index: 9999;
  background: rgba(4,8,20,0.88);
  backdrop-filter: blur(6px);
  align-items: center; justify-content: center;
}
.cbt-modal-overlay.open { display: flex; }
.cbt-modal-box {
  width: 96%; max-width: 1000px; max-height: 94vh;
  background: white; border-radius: 18px;
  overflow: hidden; box-shadow: 0 24px 80px rgba(0,0,0,0.4);
  display: flex; flex-direction: column;
}
.cbt-modal-header {
  background: linear-gradient(135deg, #0D2A5C, #1558D6);
  padding: 18px 24px;
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0;
}
.cbt-modal-header h3 { color: white; font-family: 'DM Sans', sans-serif; font-size: 1.1rem; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.cbt-modal-close {
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,255,255,0.15); border: none; color: white;
  font-size: 1.1rem; cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background 0.18s;
}
.cbt-modal-close:hover { background: rgba(255,255,255,0.28); }
.cbt-modal-body { flex: 1; overflow-y: auto; }


/* ── MERGED BUILD: CBT fills view-cbt container ── */
#view-cbt .cbt-modal-overlay {
  display: flex !important;
  position: relative;
  inset: auto;
  background: transparent !important;
  backdrop-filter: none !important;
  align-items: stretch;
  justify-content: stretch;
  z-index: 1;
  min-height: 100vh;
}
#view-cbt .cbt-modal-box {
  width: 100% !important;
  max-width: 100% !important;
  height: 100% !important;
  max-height: 100% !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  display: flex;
  flex-direction: column;
}
/* Hide the X close button — no parent site to close back to */
/* .cbt-modal-close { display: none !important; } — removed: merged build shows close button */

/* ═══════════════════════════════════════
   CBT SYSTEM (embedded)
═══════════════════════════════════════ */
.cbt-wrap { font-family: 'Outfit', sans-serif; color: var(--text); min-height: 600px; }
.cbt-wrap .cbt-topbar {
  background: rgba(8,16,42,0.97);
  color: white; padding: 0 24px; height: 50px;
  display: flex; align-items: center; justify-content: space-between;
}
.cbt-wrap .cbt-topbar-logo { font-size: 0.95rem; font-weight: 800; letter-spacing: 1px; display: flex; align-items: center; gap: 8px; }
.cbt-wrap .cbt-logo-badge { background: linear-gradient(135deg, #1558D6, #00B896); color:white; font-size:0.68rem; font-weight:700; padding:2px 7px; border-radius:4px; }
.cbt-wrap .cbt-topbar-right { display:flex; align-items:center; gap:16px; font-size:0.85rem; }
.cbt-wrap #cbt_userGCCplay { color:#00B896; font-weight:600; }
.cbt-wrap #cbt_timerGCCplay { font-weight:700; color:#fff; transition:color 0.3s; }
.cbt-wrap #cbt_timerGCCplay.warning { color:#E8924A; }
.cbt-wrap #cbt_timerGCCplay.blink { animation:blink 0.8s infinite; color:#D63349; }
@keyframes blink{50%{opacity:0}}

.cbt-inner { max-width:900px; margin:24px auto 36px; padding:0 20px; }
.cbt-page { display:none; background:white; border-radius:14px; box-shadow:0 4px 24px rgba(13,42,92,0.10); overflow:hidden; }
.cbt-page.active { display:block; }
.cbt-page-body { padding:32px 36px; }

/* CBT Typography */
.cbt-wrap h2 { font-size:1.6rem; font-weight:800; color:#0D2A5C; margin-bottom:6px; }
.cbt-wrap h3 { font-size:1rem; font-weight:700; color:#0D2A5C; margin:20px 0 9px; }
.cbt-wrap .subtitle { color:#6b7a99; font-size:0.88rem; margin-bottom:24px; }
.cbt-wrap .section-divider { border:none; border-top:1.5px solid #DDE4EF; margin:22px 0; }

/* CBT Form */
.cbt-wrap .form-group { margin-bottom:14px; }
.cbt-wrap .form-group label { display:block; font-size:0.8rem; font-weight:600; color:#6b7a99; margin-bottom:5px; text-transform:uppercase; letter-spacing:0.5px; }
.cbt-wrap input[type="text"],.cbt-wrap input[type="password"],.cbt-wrap input[type="number"],.cbt-wrap select,.cbt-wrap textarea {
  width:100%; padding:9px 12px; border:1.5px solid #DDE4EF; border-radius:8px;
  font-family:'Outfit',sans-serif; font-size:0.92rem; color:#1C2035; background:#F5F8FF;
  transition:border-color 0.2s,box-shadow 0.2s; outline:none;
}
.cbt-wrap input:focus,.cbt-wrap select:focus,.cbt-wrap textarea:focus { border-color:#1558D6; box-shadow:0 0 0 3px rgba(21,88,214,0.12); background:#fff; }
.cbt-wrap .form-row { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.cbt-wrap .form-row-3 { display:grid; grid-template-columns:1fr 1fr 1fr; gap:12px; }

/* CBT Buttons */
.cbt-wrap .btn,.cbt-wrap .cbt-btn { display:inline-flex; align-items:center; justify-content:center; gap:6px; padding:9px 18px; border:none; border-radius:8px; font-family:'Outfit',sans-serif; font-size:0.88rem; font-weight:600; cursor:pointer; transition:all 0.18s; }
.cbt-wrap .btn-primary,.cbt-wrap .cbt-btn-primary { background:linear-gradient(135deg,#1558D6,#0042AA); color:white; }
.cbt-wrap .btn-success,.cbt-wrap .cbt-btn-success { background:linear-gradient(135deg,#00B896,#008A70); color:white; }
.cbt-wrap .btn-danger,.cbt-wrap .cbt-btn-danger { background:linear-gradient(135deg,#D63349,#A01E30); color:white; }
.cbt-wrap .btn-outline,.cbt-wrap .cbt-btn-outline { background:white; color:#0D2A5C; border:1.5px solid #DDE4EF; }
.cbt-wrap .btn-outline:hover { border-color:#1558D6; color:#1558D6; background:#EEF2FF; }
.cbt-wrap .btn-sm { padding:5px 10px; font-size:0.78rem; }
.cbt-wrap .btn-full { width:100%; }
.cbt-wrap .btn-group { display:flex; gap:8px; flex-wrap:wrap; margin-top:14px; }

/* CBT Cards */
.cbt-wrap .card { background:#EEF2FF; border:1.5px solid #DDE4EF; border-radius:10px; padding:18px; margin-bottom:14px; }
.cbt-wrap .stat-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:12px; margin:14px 0; }
.cbt-wrap .stat-card { background:white; border:1.5px solid #DDE4EF; border-radius:10px; padding:16px; text-align:center; }
.cbt-wrap .stat-card .stat-num { font-size:1.8rem; font-weight:800; color:#1558D6; }
.cbt-wrap .stat-card .stat-label { font-size:0.78rem; color:#6b7a99; font-weight:600; text-transform:uppercase; letter-spacing:0.5px; margin-top:3px; }

/* CBT Tables */
.cbt-wrap .table-wrap { overflow-x:auto; border-radius:10px; border:1.5px solid #DDE4EF; margin:10px 0; }
.cbt-wrap table { width:100%; border-collapse:collapse; font-size:0.86rem; }
.cbt-wrap th { background:#0D2A5C; color:white; padding:10px 12px; text-align:left; font-weight:600; font-size:0.78rem; text-transform:uppercase; letter-spacing:0.5px; }
.cbt-wrap td { padding:9px 12px; border-bottom:1px solid #DDE4EF; vertical-align:middle; }
.cbt-wrap tr:last-child td { border-bottom:none; }
.cbt-wrap tr:hover td { background:#F5F8FF; }

/* CBT Login */
.cbt-wrap .login-wrap { max-width:380px; margin:0 auto; }
.cbt-wrap .login-header { text-align:center; padding:16px 0 26px; }
.cbt-wrap .login-header .logo-icon { width:56px;height:56px; background:linear-gradient(135deg,#1558D6,#00B896); border-radius:14px; display:flex;align-items:center;justify-content:center; margin:0 auto 14px; font-size:1.6rem; }
.cbt-wrap .tab-row { display:flex; border:1.5px solid #DDE4EF; border-radius:8px; overflow:hidden; margin-bottom:20px; }
.cbt-wrap .tab-btn { flex:1; padding:8px; background:white; border:none; font-family:'Outfit',sans-serif; font-size:0.84rem; font-weight:600; color:#6b7a99; cursor:pointer; transition:all 0.2s; }
.cbt-wrap .tab-btn.active { background:#1558D6; color:white; }
.cbt-wrap .divider-text { display:flex; align-items:center; gap:10px; color:#6b7a99; font-size:0.8rem; margin:16px 0; }
.cbt-wrap .divider-text::before,.cbt-wrap .divider-text::after { content:''; flex:1; height:1px; background:#DDE4EF; }

/* CBT Exam */
.cbt-wrap .exam-layout { display:grid; grid-template-columns:1fr 200px; gap:20px; }
.cbt-wrap #cbt_questionBox { background:#EEF2FF; padding:18px 20px; border-left:4px solid #1558D6; border-radius:8px; font-size:0.96rem; line-height:1.6; margin-bottom:14px; }
.cbt-wrap .option-btn { display:flex; align-items:center; gap:10px; width:100%; padding:11px 14px; margin:6px 0; border-radius:8px; border:1.5px solid #DDE4EF; cursor:pointer; text-align:left; background:white; font-family:'Outfit',sans-serif; font-size:0.92rem; color:#1C2035; transition:all 0.18s; }
.cbt-wrap .option-btn:hover { border-color:#1558D6; background:#EEF2FF; }
.cbt-wrap .option-btn.selected { border-color:#1558D6; background:#E4EBFF; font-weight:600; color:#1558D6; }
.cbt-wrap .option-btn .opt-letter { width:28px;height:28px;min-width:28px; border-radius:50%; border:1.5px solid currentColor; display:flex;align-items:center;justify-content:center; font-size:0.78rem;font-weight:700; }
.cbt-wrap .option-btn.selected .opt-letter { background:#1558D6; color:white; border-color:#1558D6; }
.cbt-wrap .palette-title { font-size:0.78rem; font-weight:700; text-transform:uppercase; letter-spacing:0.5px; color:#6b7a99; margin-bottom:8px; }
.cbt-wrap .palette-grid { display:grid; grid-template-columns:repeat(5,1fr); gap:4px; }
.cbt-wrap .pal-btn { width:34px;height:34px; border-radius:6px; border:1.5px solid #DDE4EF; background:white; font-family:'Outfit',sans-serif; font-size:0.76rem;font-weight:600; cursor:pointer; transition:all 0.15s; color:#1C2035; }
.cbt-wrap .pal-btn.answered { background:#27A84A; color:white; border-color:#27A84A; }
.cbt-wrap .pal-btn.flagged  { background:#E8924A; color:white; border-color:#E8924A; }
.cbt-wrap .pal-btn.current  { background:#1558D6; color:white; border-color:#1558D6; box-shadow:0 0 0 2px rgba(21,88,214,0.3); }
.cbt-wrap .palette-legend { margin-top:10px; font-size:0.74rem; color:#6b7a99; }
.cbt-wrap .legend-item { display:flex;align-items:center;gap:5px; margin-bottom:4px; }
.cbt-wrap .legend-dot { width:9px;height:9px;border-radius:3px; }
.cbt-wrap .question-meta { display:flex;justify-content:space-between;align-items:center; margin-bottom:12px; }
.cbt-wrap .q-num { font-size:0.8rem;font-weight:700;color:#6b7a99;text-transform:uppercase;letter-spacing:0.5px; }
.cbt-wrap .q-progress { font-size:0.8rem; color:#6b7a99; }
.cbt-wrap .progress-bar { height:4px; background:#DDE4EF; border-radius:2px; margin-bottom:14px; }
.cbt-wrap .progress-fill { height:100%; background:linear-gradient(90deg,#1558D6,#00B896); border-radius:2px; transition:width 0.3s; }
.cbt-wrap .exam-nav { display:flex;gap:6px;flex-wrap:wrap;margin-top:14px; }
.cbt-wrap .badge { display:inline-flex;align-items:center;padding:2px 8px;border-radius:20px;font-size:0.74rem;font-weight:600; }
.cbt-wrap .badge-blue   { background:#E4EBFF;color:#1558D6; }
.cbt-wrap .badge-green  { background:#E4F5EB;color:#178C3E; }
.cbt-wrap .badge-orange { background:#FFF0E4;color:#C05600; }
.cbt-wrap .badge-red    { background:#FFE4E6;color:#D63349; }
.cbt-wrap .alert { padding:10px 14px;border-radius:8px;font-size:0.87rem;font-weight:500;margin-bottom:12px; }
.cbt-wrap .alert-success { background:#E4F5EB;border:1px solid #A8D8B9;color:#145C2A; }
.cbt-wrap .alert-warning { background:#FFF5E4;border:1px solid #FFCC88;color:#744200; }
.cbt-wrap .alert-danger  { background:#FFE4E6;border:1px solid #FFAAB0;color:#7A1520; }
.cbt-wrap .alert-info    { background:#E4EBFF;border:1px solid #A8BEFF;color:#1A3D99; }
.cbt-wrap .file-drop { border:2px dashed #DDE4EF;border-radius:10px;padding:24px;text-align:center;cursor:pointer;transition:all 0.2s;background:#F5F8FF; }
.cbt-wrap .file-drop:hover { border-color:#1558D6;background:#EEF2FF; }
.cbt-wrap .file-drop input[type="file"] { display:none; }
.cbt-wrap .file-drop .fd-icon { font-size:2rem;margin-bottom:6px; }
.cbt-wrap .file-drop .fd-text { font-size:0.86rem;color:#6b7a99; }
.cbt-wrap .file-drop .fd-text strong { color:#1558D6; }
.cbt-wrap #cbt_jsonOutput { background:#071525;color:#00D4B0;padding:14px;border-radius:8px;font-size:0.74rem;max-height:200px;overflow-y:auto; }
.cbt-wrap #cbt_preview { max-height:160px;overflow-y:auto;padding:10px;border:1.5px solid #DDE4EF;border-radius:8px;font-size:0.86rem;background:#F5F8FF; }
.cbt-wrap .empty-state { text-align:center;padding:36px 16px;color:#6b7a99; }
.cbt-wrap .subject-select-wrap { display:grid;grid-template-columns:1fr 1fr;gap:16px; }
.cbt-wrap .exam-title-bar { background:linear-gradient(135deg,#0D2A5C,#1558D6);color:white;padding:18px 22px;border-radius:10px;margin-bottom:18px; }
.cbt-wrap .exam-title-bar h3 { color:white;margin:0;font-size:1.1rem; }
.cbt-wrap .exam-title-bar p { color:rgba(255,255,255,0.75);font-size:0.84rem;margin-top:3px; }
/* Result */
.cbt-wrap .result-hero { text-align:center;padding:26px 0 16px; }
.cbt-wrap .score-ring { width:130px;height:130px;margin:0 auto 18px;position:relative; }
.cbt-wrap .score-ring svg { transform:rotate(-90deg); }
.cbt-wrap .ring-bg { fill:none;stroke:#DDE4EF;stroke-width:10; }
.cbt-wrap .ring-fill { fill:none;stroke:#1558D6;stroke-width:10;stroke-linecap:round;transition:stroke-dashoffset 1s ease; }
.cbt-wrap .score-center { position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center; }
.cbt-wrap .score-pct { font-size:1.6rem;font-weight:800;color:#0D2A5C; }
.cbt-wrap .score-label { font-size:0.72rem;color:#6b7a99;font-weight:600;text-transform:uppercase; }
.cbt-wrap .result-details-grid { display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin:20px 0; }
.cbt-wrap .result-detail { background:#EEF2FF;border-radius:10px;padding:14px;text-align:center; }
.cbt-wrap .result-detail .rd-num { font-size:1.4rem;font-weight:800; }
.cbt-wrap .result-detail .rd-lbl { font-size:0.76rem;color:#6b7a99;font-weight:600;text-transform:uppercase;margin-top:3px; }
.cbt-wrap .result-detail.green .rd-num { color:#27A84A; }
.cbt-wrap .result-detail.red   .rd-num { color:#D63349; }
.cbt-wrap .result-detail.blue  .rd-num { color:#1558D6; }
/* Tabs */
.cbt-wrap .portal-tabs { display:flex;gap:0;border-bottom:2px solid #DDE4EF;margin-bottom:20px; }
.cbt-wrap .portal-tab { padding:9px 16px;background:none;border:none;border-bottom:3px solid transparent;margin-bottom:-2px;font-family:'Outfit',sans-serif;font-size:0.88rem;font-weight:600;color:#6b7a99;cursor:pointer;transition:all 0.2s; }
.cbt-wrap .portal-tab.active { color:#1558D6;border-bottom-color:#1558D6; }
.cbt-wrap .tab-panel { display:none; }
.cbt-wrap .tab-panel.active { display:block; }
/* Strength bar */
.cbt-wrap .strength-bar { height:4px;border-radius:2px;background:#DDE4EF;margin-top:5px;overflow:hidden; }
.cbt-wrap .strength-fill { height:100%;border-radius:2px;transition:width 0.3s,background 0.3s; }
/* Calculator */
.cbt-wrap .calc-toggle { width:100%;margin-top:16px;padding:7px;background:linear-gradient(135deg,#0D2A5C,#1558D6);color:white;border:none;border-radius:8px;font-family:'Outfit',sans-serif;font-size:0.82rem;font-weight:700;cursor:pointer;letter-spacing:0.5px; }
.cbt-wrap .calc-wrap { display:none;margin-top:8px;background:#071525;border-radius:10px;padding:10px;box-shadow:0 4px 16px rgba(0,0,0,0.3); }
.cbt-wrap .calc-wrap.open { display:block; }
.cbt-wrap .calc-screen { background:#112238;color:#00D4B0;font-size:1.2rem;font-weight:700;font-family:monospace;text-align:right;padding:8px 10px;border-radius:6px;margin-bottom:7px;min-height:38px;word-break:break-all;letter-spacing:1px; }
.cbt-wrap .calc-screen .calc-expr { font-size:0.65rem;color:rgba(0,212,176,0.5);display:block;min-height:12px;margin-bottom:2px; }
.cbt-wrap .calc-btns { display:grid;grid-template-columns:repeat(4,1fr);gap:4px; }
.cbt-wrap .cb { padding:8px 3px;border:none;border-radius:6px;font-family:'Outfit',sans-serif;font-size:0.84rem;font-weight:700;cursor:pointer;transition:all 0.15s; }
.cbt-wrap .cb:hover { transform:scale(1.07); }
.cbt-wrap .cb-num { background:#1A3A5E;color:#D0E8FF; }
.cbt-wrap .cb-op  { background:#1558D6;color:white; }
.cbt-wrap .cb-eq  { background:#00B896;color:white;grid-column:span 2; }
.cbt-wrap .cb-clr { background:#D63349;color:white; }
.cbt-wrap .cb-back { background:#E8924A;color:white; }
/* Class filter */
.cbt-wrap .class-filter-btns { display:flex;flex-wrap:wrap;gap:6px;margin-bottom:12px; }
.cbt-wrap .class-filter-btns .cf-btn { padding:5px 12px;border-radius:20px;border:1.5px solid #DDE4EF;background:white;font-family:'Outfit',sans-serif;font-size:0.8rem;font-weight:600;color:#6b7a99;cursor:pointer;transition:all 0.18s; }
.cbt-wrap .class-filter-btns .cf-btn.active,.cbt-wrap .class-filter-btns .cf-btn:hover { background:#1558D6;color:white;border-color:#1558D6; }
/* Email settings */
.cbt-wrap .email-status-bar { display:flex;align-items:center;gap:7px;padding:7px 12px;border-radius:8px;font-size:0.82rem;font-weight:600;margin-bottom:12px; }
.cbt-wrap .email-status-bar.online  { background:#E4F5EB;color:#145C2A;border:1px solid #A8D8B9; }
.cbt-wrap .email-status-bar.offline { background:#FFF5E4;border:1px solid #FFCC88;color:#744200; }
.cbt-wrap .online-dot  { width:8px;height:8px;border-radius:50%;background:#27A84A;animation:pulse 1.5s infinite; }
.cbt-wrap .offline-dot { width:8px;height:8px;border-radius:50%;background:#E8924A; }
.cbt-wrap .queue-badge { display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;border-radius:50%;background:#E8924A;color:white;font-size:0.68rem;font-weight:800;margin-left:5px; }
/* CBT Modal (submit) */
.cbt-inner-modal { display:none;position:fixed;inset:0;background:rgba(8,16,40,0.58);z-index:10000;align-items:center;justify-content:center; }
.cbt-inner-modal.open { display:flex; }
.cbt-inner-modal .modal-box { background:white;border-radius:14px;padding:26px;width:90%;max-width:420px;box-shadow:0 8px 40px rgba(13,42,92,0.18); }
.cbt-inner-modal .modal-title { font-size:1.05rem;font-weight:700;color:#0D2A5C;margin-bottom:14px; }
.cbt-inner-modal .modal-actions { display:flex;gap:8px;justify-content:flex-end;margin-top:18px; }



/* Calc extra button styles */
.cbt-wrap .cb-sci { background: #162e50; color: #c0d8f0; }
.cbt-wrap .cb-mem { background: #2a1a4e; color: #d0c0ff; }
.cbt-wrap .cb-const { background: #0a3322; color: #80ffcb; }
.cbt-wrap .calc-mode-row { display: flex; gap: 4px; margin-bottom: 6px; }
.cbt-wrap .calc-mode-btn { flex: 1; padding: 4px; border: 1px solid #1e3a5f; border-radius: 5px; background: #112238; color: #6b8faa; font-family: monospace; font-size: 0.72rem; font-weight: 700; cursor: pointer; transition: all 0.15s; }
.cbt-wrap .calc-mode-btn.active { background: #1558D6; color: white; border-color: #1558D6; }
.cbt-wrap .calc-mem { display: flex; align-items: center; font-size: 0.62rem; color: rgba(0,212,176,0.6); margin-bottom: 2px; }

/* Practice mode title bar */
.cbt-wrap .practice-title-bar { background: linear-gradient(135deg, #005F40, #00B896); }

/* Practice upload panel toggle */
#cbt_practiceUploadPanel { display: none; }
#cbt_practiceUploadPanel.open { display: block !important; }

@media(max-width:600px){
  #cbt_practiceUploadPanel > div[style*="grid-template-columns:1fr 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }
}

@media(max-width: 700px) {
  .notes-overlay { padding: 0; align-items: flex-end; }
  .notes-modal { max-height: 95vh; border-radius: 16px 16px 0 0; }
  .notes-sidebar { width: 160px; min-width: 160px; }
  .form-grid { grid-template-columns: 1fr !important; }
  .notes-filter-bar { gap: 8px; padding: 10px 12px; }
  .filter-group { min-width: 100%; }
  .notes-header { padding: 14px 16px; }
  .notes-header h1 { font-size: 1rem; }
  .notes-tab { padding: 9px 14px; font-size: 0.82rem; }
  .editor-toolbar { gap: 3px; padding: 6px 8px; }
  .editor-toolbar button, .editor-toolbar label { padding: 4px 8px; font-size: 0.76rem; }
  .teacher-wrap { padding: 12px; }
  .saved-note-item { flex-direction:column; align-items:flex-start; gap:8px; }
  .saved-note-btns { align-self:flex-end; }
}
@media(max-width: 500px) {
  .notes-content-area { flex-direction: column; }
  .notes-sidebar { width: 100%; min-width: unset; max-height: 140px; border-right: none; border-bottom: 1px solid #DDE4EF; }
  .notes-reader { padding: 12px; }
  .notes-book-body { padding: 14px; }
}

/* ═══════════════════════════════════════
   RESPONSIVE — FULL MOBILE OVERHAUL
═══════════════════════════════════════ */

/* ── Tablet 900px ── */
@media(max-width:900px){
  .welcome-grid,.cbt-promo-grid,.contact-grid,.subjects-grid { grid-template-columns:1fr; }
  .Academy-grid { grid-template-columns:1fr 1fr; }
  .news-grid { grid-template-columns:1fr 1fr; }
  .stats-row { grid-template-columns:1fr 1fr; gap:24px; }
  .stat-item { border-right:none; }
  .footer-grid { grid-template-columns:1fr 1fr; }
  .cbt-features { grid-template-columns:1fr; }
  /* CBT inner */
  .cbt-wrap .exam-layout { grid-template-columns:1fr; }
  .cbt-wrap .stat-grid { grid-template-columns:1fr 1fr; }
  .cbt-wrap .form-row-3 { grid-template-columns:1fr 1fr; }
  /* Portal tabs scroll */
  .portal-tabs { overflow-x:auto; -webkit-overflow-scrolling:touch; flex-wrap:nowrap; }
  .portal-tab { white-space:nowrap; }
}

/* ── Mobile 768px — navbar breakpoint ── */
@media(max-width:768px){
  /* Navbar mobile */
  .nav-links {
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    position: absolute;
    top: 72px; left: 0; right: 0;
    background: white;
    padding: 12px 16px 16px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    z-index: 999;
    border-top: 1px solid #EEF2FF;
  }
  .nav-links.nav-open { display: flex; }
  .nav-links a { padding: 11px 14px; font-size: 0.95rem; border-radius: 8px; }
  .hamburger { display: flex; }
  /* Hamburger animation */
  .hamburger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .hamburger.is-open span:nth-child(2) { opacity: 0; }
  .hamburger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  /* Stacked nav buttons */
  .cbt-nav-btn, .nol-nav-btn { width:100%; justify-content:center; margin:4px 0 0; }

  /* Hero two-column → stack */

  /* CBT modal full screen */
  .cbt-modal-box {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    border-radius: 0 !important;
    margin: 0 !important;
  }
  .cbt-modal-overlay { padding: 0 !important; align-items: stretch !important; }

  /* CBT topbar wraps */
  .cbt-wrap .cbt-topbar {
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px 12px;
  }
  .cbt-wrap .cbt-topbar > div { font-size:0.72rem; }
  .cbt-wrap .cbt-topbar-right { gap:8px; }

  /* CBT page body padding */
  .cbt-wrap .cbt-page-body { padding: 14px 12px; }

  /* Forms */
  .cbt-wrap .form-row,
  .cbt-wrap .form-row-3 { grid-template-columns:1fr; }

  /* Exam nav buttons wrap */
  .cbt-wrap .exam-nav { flex-wrap:wrap; gap:6px; }
  .cbt-wrap .exam-nav .btn { flex:1; min-width:80px; font-size:0.8rem; padding:7px 10px; }

  /* Palette smaller */
  .cbt-wrap .pal-btn { width:32px; height:32px; font-size:0.72rem; }

  /* Calculator full width */
  .cbt-wrap .calc-wrap { width:100%; }

  /* Result ring smaller */
  .cbt-wrap .score-ring svg { width:100px; height:100px; }

  /* Portal tabs */
  .portal-tabs { overflow-x:auto; -webkit-overflow-scrolling:touch; flex-wrap:nowrap; padding-bottom:4px; }
  .portal-tab { white-space:nowrap; font-size:0.8rem; padding:8px 12px; }

  /* Tables scroll horizontally */
  .table-wrap { overflow-x:auto; -webkit-overflow-scrolling:touch; }

  /* Media tab grid */
  #cbt_mediaTab [style*="grid-template-columns:1fr 1fr 1fr"] { display:block !important; }
}

/* ── Small mobile 600px ── */
@media(max-width:600px){
  .top-strip .ts-items:first-child { display:none; }
  .Academy-grid { grid-template-columns:1fr; }
  .news-grid { grid-template-columns:1fr; }
  .footer-grid { grid-template-columns:1fr; }
  .cbt-promo-grid { grid-template-columns:1fr; }
  .cbt-visual { display:none; }

  /* CBT login */
  .cbt-wrap .login-wrap { padding:16px; }
  .cbt-wrap .tab-row { flex-wrap:wrap; }
  .cbt-wrap .tab-btn { flex:1; min-width:70px; }

  /* Teacher form-grid 1 col */
  .form-grid { grid-template-columns:1fr !important; }

  /* Contact form */
  .contact-form [style*="grid-template-columns:1fr 1fr"] { display:block !important; }
  .contact-form input[type="text"] { width:100%; margin-bottom:12px; }

  /* Stats grid 2→1 */
  .cbt-wrap .stat-grid { grid-template-columns:1fr 1fr; }

  /* Score ring */
  .cbt-wrap .result-hero { padding:16px 0 8px; }

  /* Logo text truncate */
  .logo-text strong { font-size:0.92rem; }
  .logo-text span { display:none; }
}


/* ═══════════════════════════════════════════════════════
   CBT TERM SPLASH SCREEN & LICENSE GATE
═══════════════════════════════════════════════════════ */

/* ── Splash ── */
#cbt-term-splash {
  position: fixed; inset: 0; z-index: 99999;
  background: linear-gradient(145deg, #06091A 0%, #0D2144 50%, #071028 100%);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 24px;
  animation: cbtSplashIn 0.5s ease forwards;
}
@keyframes cbtSplashIn { from{opacity:0} to{opacity:1} }
#cbt-term-splash.hiding {
  animation: cbtSplashOut 0.45s ease forwards;
  pointer-events: none;
}
@keyframes cbtSplashOut {
  from{opacity:1;transform:scale(1)}
  to{opacity:0;transform:scale(1.03)}
}

.cbt-splash-logo {
  font-size: 3.8rem; margin-bottom: 10px;
  filter: drop-shadow(0 4px 22px rgba(184,134,11,0.55));
  animation: cbtLogoBounce 0.7s cubic-bezier(0.22,1,0.36,1) 0.2s both;
}
@keyframes cbtLogoBounce {
  from{opacity:0;transform:translateY(-30px) scale(0.8)}
  to{opacity:1;transform:translateY(0) scale(1)}
}
.cbt-splash-school {
  font-family: 'Playfair Display', serif;
  font-size: 0.88rem; font-weight: 700;
  color: rgba(232,184,75,0.8); letter-spacing: 1.5px;
  text-transform: uppercase; text-align: center; margin-bottom: 5px;
  animation: cbtSplashUp 0.5s ease 0.35s both;
}
.cbt-splash-title {
  font-family: 'Playfair Display', serif;
  font-size: 2rem; font-weight: 900; color: #fff;
  text-align: center; margin-bottom: 4px;
  animation: cbtSplashUp 0.5s ease 0.42s both;
}
.cbt-splash-sub {
  font-size: 0.82rem; color: rgba(255,255,255,0.38);
  text-align: center; margin-bottom: 46px;
  animation: cbtSplashUp 0.5s ease 0.48s both;
}
@keyframes cbtSplashUp {
  from{opacity:0;transform:translateY(16px)}
  to{opacity:1;transform:translateY(0)}
}
.cbt-splash-label {
  font-size: 0.7rem; font-weight: 800; letter-spacing: 2px;
  text-transform: uppercase; color: rgba(232,184,75,0.65);
  margin-bottom: 16px; text-align: center;
  animation: cbtSplashUp 0.5s ease 0.54s both;
}
.cbt-splash-btns {
  display: flex; gap: 16px; flex-wrap: wrap;
  justify-content: center;
  animation: cbtSplashUp 0.5s ease 0.62s both;
}
.cbt-term-btn {
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  padding: 20px 32px; border-radius: 16px; border: none; cursor: pointer;
  font-family: 'Outfit', sans-serif; font-weight: 800;
  color: #fff; position: relative; overflow: hidden;
  transition: transform 0.18s, box-shadow 0.18s; min-width: 150px;
}
.cbt-term-btn::before {
  content:''; position:absolute; inset:0;
  background:rgba(255,255,255,0); transition:background 0.18s;
}
.cbt-term-btn:hover::before{background:rgba(255,255,255,0.09)}
.cbt-term-btn:hover{transform:translateY(-4px) scale(1.03)}
.cbt-term-btn:active{transform:translateY(0) scale(0.98)}
.cbt-term-btn .ti{font-size:1.9rem}
.cbt-term-btn .tn{font-size:1rem;font-weight:800;letter-spacing:0.4px}
.cbt-term-btn .td{font-size:0.7rem;font-weight:500;opacity:0.72}
.cbt-term-btn.cbt-t1{background:linear-gradient(135deg,#1558D6,#0042AA);box-shadow:0 8px 30px rgba(21,88,214,0.48)}
.cbt-term-btn.cbt-t2{background:linear-gradient(135deg,#165C33,#27A84A);box-shadow:0 8px 30px rgba(39,168,74,0.42)}
.cbt-term-btn.cbt-t3{background:linear-gradient(135deg,#7C3AED,#5B21B6);box-shadow:0 8px 30px rgba(124,58,237,0.42)}
.cbt-splash-footer {
  margin-top: 44px; font-size: 0.71rem;
  color: rgba(255,255,255,0.22); text-align: center;
  animation: cbtSplashUp 0.5s ease 0.72s both;
}

/* ── License Gate ── */
#cbt-license-gate {
  position: fixed; inset: 0; z-index: 100000;
  background: rgba(4,8,20,0.82);
  display: none; align-items: center; justify-content: center;
  padding: 20px; backdrop-filter: blur(8px);
}
#cbt-license-gate.open { display: flex; animation: cbtLgIn 0.22s ease; }
@keyframes cbtLgIn{from{opacity:0}to{opacity:1}}
.cbt-lg-card {
  background: #fff; border-radius: 20px;
  width: 100%; max-width: 430px;
  box-shadow: 0 24px 80px rgba(13,33,68,0.48), 0 4px 20px rgba(13,33,68,0.2);
  overflow: hidden;
  animation: cbtLgSlide 0.3s cubic-bezier(0.22,1,0.36,1);
}
@keyframes cbtLgSlide {
  from{transform:translateY(30px) scale(0.96);opacity:0}
  to{transform:translateY(0) scale(1);opacity:1}
}
.cbt-lg-header {
  padding: 22px 24px 18px; text-align: center;
  background: linear-gradient(135deg, #0D2144, #1558D6);
}
.cbt-lg-header-icon{font-size:2.4rem;margin-bottom:6px}
.cbt-lg-header h2{
  font-family:'Playfair Display',serif;
  font-size:1.2rem;color:#fff;margin:0 0 4px;font-weight:700}
.cbt-lg-header p{font-size:0.8rem;color:rgba(255,255,255,0.6);margin:0}
.cbt-lg-body{padding:22px 24px}
.cbt-lg-badge{
  display:inline-flex;align-items:center;gap:7px;
  padding:5px 14px;border-radius:20px;
  font-size:0.76rem;font-weight:800;letter-spacing:0.4px;margin-bottom:16px;
}
.cbt-lg-badge.cbt-t1{background:#EEF2FF;color:#1558D6}
.cbt-lg-badge.cbt-t2{background:#EAF5EE;color:#165C33}
.cbt-lg-badge.cbt-t3{background:#F3E8FF;color:#7C3AED}
.cbt-lg-label{
  font-size:0.72rem;font-weight:700;text-transform:uppercase;
  letter-spacing:0.8px;color:#6b7a99;margin-bottom:8px}
.cbt-lg-row{display:flex;gap:0;border-radius:10px;overflow:hidden;
  box-shadow:0 3px 14px rgba(21,88,214,0.11)}
.cbt-lg-input{
  flex:1;padding:12px 15px;border:1.5px solid #DDE4EF;
  border-right:none;border-radius:10px 0 0 10px;
  font-family:'Outfit',sans-serif;font-size:0.98rem;font-weight:600;
  color:#0D2144;letter-spacing:2px;outline:none;
  transition:border-color 0.2s;text-transform:uppercase;background:#fafbff}
.cbt-lg-input:focus{border-color:#1558D6}
.cbt-lg-btn{
  padding:12px 18px;
  background:linear-gradient(135deg,#1558D6,#0042AA);
  color:white;border:none;font-family:'DM Sans',sans-serif;
  font-size:0.9rem;font-weight:700;cursor:pointer;
  border-radius:0 10px 10px 0;transition:background 0.2s;white-space:nowrap}
.cbt-lg-btn:hover{background:linear-gradient(135deg,#0042AA,#002F7A)}
.cbt-lg-error{
  margin-top:9px;color:#D63349;
  font-size:0.8rem;font-weight:600;min-height:18px;
  animation:cbtLgShake 0.35s ease}
@keyframes cbtLgShake{
  0%,100%{transform:translateX(0)}20%{transform:translateX(-5px)}
  40%{transform:translateX(5px)}60%{transform:translateX(-3px)}80%{transform:translateX(3px)}}
.cbt-lg-hint{margin-top:12px;font-size:0.72rem;color:#a0aec0;line-height:1.5}
.cbt-lg-hint code{
  font-family:monospace;background:#EEF2FF;color:#1558D6;
  padding:1px 6px;border-radius:4px;font-size:0.78rem}

/* ── Active term badge in topbar ── */
#cbt-term-topbar-badge {
  display: none; align-items: center; gap: 5px;
  padding: 3px 11px; border-radius: 14px;
  font-size: 0.72rem; font-weight: 800; letter-spacing: 0.3px;
  white-space: nowrap;
}
#cbt-term-topbar-badge.cbt-t1{background:rgba(21,88,214,0.25);color:#90b8ff;border:1px solid rgba(21,88,214,0.4)}
#cbt-term-topbar-badge.cbt-t2{background:rgba(39,168,74,0.22);color:#7fffb0;border:1px solid rgba(39,168,74,0.38)}
#cbt-term-topbar-badge.cbt-t3{background:rgba(124,58,237,0.22);color:#d4b0ff;border:1px solid rgba(124,58,237,0.38)}

@media(max-width:600px){
  .cbt-splash-btns{flex-direction:column;align-items:center}
  .cbt-term-btn{width:100%;max-width:280px;padding:16px 20px}
  .cbt-splash-title{font-size:1.55rem}
}

/* ── TOPBAR NAV BUTTONS ── */
.cbt-topbar-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.cbt-nav-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.07);
  color: rgba(255,255,255,0.82);
  font-family: 'Outfit', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.18s;
  white-space: nowrap;
  letter-spacing: 0.2px;
}
.cbt-nav-pill:hover {
  background: rgba(255,255,255,0.16);
  border-color: rgba(255,255,255,0.38);
  color: #fff;
  transform: translateY(-1px);
}
.cbt-nav-pill.pill-home {
  background: linear-gradient(135deg, rgba(184,134,11,0.55), rgba(232,184,75,0.45));
  border-color: rgba(232,184,75,0.5);
  color: #F0C06A;
}
.cbt-nav-pill.pill-home:hover {
  background: linear-gradient(135deg, rgba(184,134,11,0.75), rgba(232,184,75,0.65));
  color: #fff;
}
.cbt-nav-pill.pill-notes {
  background: rgba(39,168,74,0.18);
  border-color: rgba(39,168,74,0.38);
  color: #7fffb0;
}
.cbt-nav-pill.pill-notes:hover {
  background: rgba(39,168,74,0.32);
  color: #fff;
}
.cbt-nav-sep {
  width: 1px; height: 18px;
  background: rgba(255,255,255,0.15);
  margin: 0 2px;
  flex-shrink: 0;
}
@media(max-width:600px){
  .cbt-nav-pill .pill-label { display: none; }
  .cbt-nav-pill { padding: 5px 8px; }
}

/* ── DASHBOARD CORNER NAV BUTTON ── */
.dash-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 13px;
  border-radius: 20px;
  border: 1.5px solid #DDE4EF;
  background: #f5f8ff;
  color: #0D2A5C;
  font-family: 'Outfit', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.18s;
  white-space: nowrap;
  flex-shrink: 0;
}
.dash-nav-btn:hover {
  background: #e4ebff;
  border-color: #1558D6;
  color: #1558D6;
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(21,88,214,0.12);
}
.dash-nav-btn.home-btn {
  background: linear-gradient(135deg, #fff8e8, #fff3d0);
  border-color: #E8B84B;
  color: #7a5000;
}
.dash-nav-btn.home-btn:hover {
  background: linear-gradient(135deg, #fff3d0, #ffe8a0);
  border-color: #B8860B;
  color: #5a3800;
}
.dash-nav-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* ══════════════════════════════════════════════════════
   NOTES OF LESSON STYLES (from notes-of-lesson_ne.html)
══════════════════════════════════════════════════════ */
/* ═══════════════════════════════════════
   CSS VARIABLES & RESET
═══════════════════════════════════════ */
:root {
  --navy:       #0D2144;
  --gold:       #B8860B;
  --gold-light: #E8B84B;
  --cream:      #F7F3EC;
  --white:      #ffffff;
  --text:       #1C2035;
  --muted:      #6B7399;
  --border:     #DDE4EF;
  --green:      #165C33;
  --green-light:#EAF5EE;
  --shadow:     0 4px 24px rgba(13,33,68,0.10);
  --shadow-lg:  0 12px 48px rgba(13,33,68,0.18);
  --primary:    #0D2A5C;
  --accent:     #1558D6;
  --accent2:    #00B896;
  --danger:     #D63349;
  --warning:    #E8924A;
  --success:    #27A84A;
  --light-bg:   #EEF2FF;
  --card-bg:    #ffffff;
}
/* Standalone base reset — already applied globally near the top of this file.
   The old version of this block forced `body` into a centered flexbox
   (display:flex; align-items:center; justify-content:center), which broke
   layout sitewide because it isn't scoped to any single view. Removed. */

/* ═══════════════════════════════════════
   NOTES OF LESSON — NOL NAV BUTTON
═══════════════════════════════════════ */
.nol-nav-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 8px; border: none;
  background: linear-gradient(135deg, #1B6B3A, #27A84A);
  color: white; font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem; font-weight: 600; cursor: pointer;
  transition: all 0.2s; position: relative;
}
.nol-nav-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(27,107,58,0.35); }
.nol-pulse {
  width: 7px; height: 7px; border-radius: 50%; background: #7fffb0;
  position: absolute; top: 7px; right: 7px;
  animation: pulse 1.5s infinite;
}
.nol-nav-icon { font-size: 1rem; }
.nol-nav-label { font-size: 0.83rem; }

@keyframes pulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:.6;transform:scale(1.4)} }

/* ═══════════════════════════════════════
   NOTES OF LESSON — OVERLAY & MODAL
═══════════════════════════════════════ */
.notes-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(8,16,40,0.0); z-index: 5000;
  align-items: flex-start; justify-content: center; padding: 20px;
  transition: background 0.3s ease;
}
.notes-overlay.open {
  display: flex;
  background: rgba(8,16,40,0.62);
  animation: nlOverlayIn 0.25s ease forwards;
}
@keyframes nlOverlayIn {
  from { background: rgba(8,16,40,0); }
  to   { background: rgba(8,16,40,0.62); }
}
.notes-modal {
  background: #fff; border-radius: 16px; width: 100%; max-width: 1060px;
  max-height: 90vh; display: flex; flex-direction: column;
  box-shadow: 0 16px 64px rgba(13,33,68,0.22); overflow: hidden;
  transform: translateY(0); opacity: 1;
  animation: nlModalIn 0.28s cubic-bezier(0.22,1,0.36,1) forwards;
}
@keyframes nlModalIn {
  from { transform: translateY(32px) scale(0.97); opacity: 0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}
.notes-modal.dark { background: #0f1b2d; color: #d0e8ff; }

/* Header */
.notes-header {
  background: linear-gradient(135deg, #0D2144, #1558D6);
  color: white; padding: 18px 24px;
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0;
}
.notes-header h1 { font-size: 1.2rem; font-weight: 700; margin: 0; color: white; }
.notes-header small { font-size: 0.72rem; color: rgba(255,255,255,0.65); }
.icon-btn {
  background: rgba(255,255,255,0.15); border: none; color: white;
  width: 34px; height: 34px; border-radius: 8px; cursor: pointer;
  font-size: 1rem; display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
}
.icon-btn:hover { background: rgba(255,255,255,0.28); }
.icon-btn.round { border-radius: 50%; }

/* Tabs */
.notes-tabs {
  display: flex; border-bottom: 2px solid #DDE4EF;
  background: #f5f8ff; flex-shrink: 0;
}
.notes-modal.dark .notes-tabs { background: #162236; border-color: #1e3a5f; }
.notes-tab {
  padding: 11px 22px; background: none; border: none;
  border-bottom: 3px solid transparent; margin-bottom: -2px;
  font-family: 'DM Sans', sans-serif; font-size: 0.9rem;
  font-weight: 600; color: #6b7a99; cursor: pointer; transition: all 0.2s;
}
.notes-tab.active { color: #1558D6; border-bottom-color: #1558D6; }
.notes-modal.dark .notes-tab { color: #7aa4cc; }
.notes-modal.dark .notes-tab.active { color: #00B896; border-bottom-color: #00B896; }

/* Pages */
.notes-page { display: none; flex: 1; overflow: hidden; flex-direction: column; }
.notes-page.active { display: flex; }

/* Filter bar */
.notes-filter-bar {
  display: flex; gap: 14px; padding: 14px 18px; border-bottom: 1px solid #DDE4EF;
  background: #fafbff; flex-shrink: 0; flex-wrap: wrap; align-items: flex-end;
}
.notes-modal.dark .notes-filter-bar { background: #14253c; border-color: #1e3a5f; }
.filter-group { display: flex; flex-direction: column; gap: 4px; min-width: 140px; }
.filter-group label { font-size: 0.74rem; font-weight: 700; color: #6b7a99; text-transform: uppercase; letter-spacing: 0.5px; }
.notes-select, .notes-input {
  padding: 7px 10px; border: 1.5px solid #DDE4EF; border-radius: 8px;
  font-family: 'DM Sans', sans-serif; font-size: 0.88rem; color: #1C2035;
  background: #fff; outline: none; transition: border-color 0.2s;
}
.notes-select:focus, .notes-input:focus { border-color: #1558D6; box-shadow: 0 0 0 3px rgba(21,88,214,0.1); }
.notes-modal.dark .notes-select, .notes-modal.dark .notes-input { background: #0f1b2d; border-color: #1e3a5f; color: #d0e8ff; }

/* Content area */
.notes-content-area { display: flex; flex: 1; overflow: hidden; }
.notes-sidebar {
  width: 220px; min-width: 220px; border-right: 1px solid #DDE4EF;
  overflow-y: auto; background: #fafbff; flex-shrink: 0;
}
.notes-modal.dark .notes-sidebar { background: #0f1b2d; border-color: #1e3a5f; }
.notes-reader { flex: 1; overflow-y: auto; padding: 20px 24px; }

/* Topic items */
.topic-item {
  padding: 9px 14px; cursor: pointer; border-radius: 7px; margin: 3px 6px;
  font-size: 0.84rem; color: #1C2035; transition: all 0.15s; border: none;
  background: none; width: calc(100% - 12px); text-align: left;
}
.topic-item:hover { background: #eef2ff; color: #1558D6; }
.topic-item.active { background: #1558D6; color: white; font-weight: 600; }
.notes-modal.dark .topic-item { color: #c0d8f0; }
.notes-modal.dark .topic-item.active { background: #00B896; color: white; }

/* Welcome screen */
.notes-welcome { text-align: center; padding: 60px 20px; color: #6b7a99; }
.notes-welcome h2 { color: #0D2144; margin: 14px 0 8px; }
.notes-modal.dark .notes-welcome h2 { color: #d0e8ff; }

/* Book card */
.notes-book-card { border-radius: 12px; overflow: hidden; box-shadow: 0 4px 20px rgba(13,33,68,0.09); border: 1.5px solid #DDE4EF; }
.notes-modal.dark .notes-book-card { border-color: #1e3a5f; }
.notes-book-card-header {
  background: linear-gradient(135deg, #0D2144, #1558D6);
  color: white; padding: 20px 24px; font-size: 1.1rem; font-weight: 700;
}
.notes-book-body { padding: 24px; line-height: 1.8; font-size: 0.93rem; color: #1C2035; }
.notes-modal.dark .notes-book-body { background: #162236; color: #c8dff5; }
.notes-book-body h2, .notes-book-body h3 { color: #0D2144; margin: 18px 0 8px; }
.notes-modal.dark .notes-book-body h2, .notes-modal.dark .notes-book-body h3 { color: #7dd9c0; }
.notes-book-body ul, .notes-book-body ol { margin-left: 20px; margin-bottom: 12px; }
.notes-book-body img { max-width: 100%; border-radius: 8px; margin: 10px 0; }

/* Teacher editor */
.teacher-wrap { padding: 18px; border-bottom: 1px solid #DDE4EF; }
.notes-modal.dark .teacher-wrap { border-color: #1e3a5f; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.form-group { display: flex; flex-direction: column; gap: 4px; }
.form-group label { font-size: 0.76rem; font-weight: 700; color: #6b7a99; text-transform: uppercase; letter-spacing: 0.5px; }
.form-control {
  padding: 8px 11px; border: 1.5px solid #DDE4EF; border-radius: 8px;
  font-family: 'DM Sans', sans-serif; font-size: 0.9rem; outline: none;
  transition: border-color 0.2s; background: #fafbff;
}
.form-control:focus { border-color: #1558D6; box-shadow: 0 0 0 3px rgba(21,88,214,0.1); }
.notes-modal.dark .form-control { background: #0f1b2d; border-color: #1e3a5f; color: #d0e8ff; }

/* Toolbar */
.editor-toolbar {
  display: flex; flex-wrap: wrap; gap: 4px; padding: 8px 10px;
  background: #f0f4ff; border: 1.5px solid #DDE4EF; border-bottom: none;
  border-radius: 8px 8px 0 0;
}
.editor-toolbar button, .editor-toolbar label {
  padding: 5px 11px; border-radius: 6px; border: 1.5px solid #DDE4EF;
  background: white; cursor: pointer; font-family: 'DM Sans', sans-serif;
  font-size: 0.82rem; font-weight: 600; color: #1C2035;
  transition: all 0.15s; display: inline-flex; align-items: center;
}
.editor-toolbar button:hover, .editor-toolbar label:hover { background: #eef2ff; border-color: #1558D6; color: #1558D6; }
.save-btn { background: #1558D6 !important; color: white !important; border-color: #1558D6 !important; }
.save-btn:hover { background: #0042AA !important; }

/* Editor area */
.notes-editor {
  height: 320px;
  min-height: 160px;
  max-height: 480px;
  resize: vertical;
  padding: 14px 16px;
  border: 1.5px solid #DDE4EF;
  border-radius: 0 0 8px 8px;
  outline: none;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.92rem;
  line-height: 1.7;
  background: #fff;
  overflow-y: scroll;
  scroll-behavior: smooth;
}
.notes-editor::-webkit-scrollbar        { width: 7px; }
.notes-editor::-webkit-scrollbar-track  { background: #f0f4ff; border-radius: 8px; }
.notes-editor::-webkit-scrollbar-thumb  { background: #b8c8e8; border-radius: 8px; }
.notes-editor::-webkit-scrollbar-thumb:hover { background: #1558D6; }
.notes-editor { scrollbar-width: thin; scrollbar-color: #b8c8e8 #f0f4ff; }
.notes-editor:empty::before { content: attr(data-placeholder); color: #aab4cc; }
.notes-modal.dark .notes-editor {
  background: #0f1b2d; border-color: #1e3a5f; color: #d0e8ff;
  scrollbar-color: #2a4a7f #0f1b2d;
}
.notes-modal.dark .notes-editor::-webkit-scrollbar-track  { background: #0f1b2d; }
.notes-modal.dark .notes-editor::-webkit-scrollbar-thumb  { background: #2a4a7f; }
.notes-modal.dark .notes-editor::-webkit-scrollbar-thumb:hover { background: #00B896; }

.teacher-wrap {
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #b8c8e8 #f0f4ff;
}
.teacher-wrap::-webkit-scrollbar        { width: 8px; }
.teacher-wrap::-webkit-scrollbar-track  { background: #f0f4ff; border-radius: 8px; }
.teacher-wrap::-webkit-scrollbar-thumb  { background: #b8c8e8; border-radius: 8px; border: 2px solid #f0f4ff; }
.teacher-wrap::-webkit-scrollbar-thumb:hover { background: #1558D6; }
.notes-modal.dark .teacher-wrap { scrollbar-color: #2a4a7f #0f1b2d; }
.notes-modal.dark .teacher-wrap::-webkit-scrollbar-track  { background: #0f1b2d; }
.notes-modal.dark .teacher-wrap::-webkit-scrollbar-thumb  { background: #2a4a7f; border-color: #0f1b2d; }
.notes-modal.dark .teacher-wrap::-webkit-scrollbar-thumb:hover { background: #00B896; }

/* Saved Notes Panel */
.nl-saved-panel {
  flex-shrink: 0;
  border-bottom: 2px solid #DDE4EF;
  background: #f7f9ff;
  max-height: 260px;
  display: flex;
  flex-direction: column;
}
.notes-modal.dark .nl-saved-panel { background: #0d1929; border-color: #1a3050; }

.nl-saved-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 18px 8px;
  flex-shrink: 0;
}
.nl-saved-panel-title {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.78rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.9px; color: #0D2144;
}
.nl-saved-panel-title svg { color: #1558D6; }
.notes-modal.dark .nl-saved-panel-title { color: #c0d8f0; }
.notes-modal.dark .nl-saved-panel-title svg { color: #00B896; }

.nl-saved-count {
  font-size: 0.72rem; font-weight: 700; color: white;
  background: #1558D6; border-radius: 20px; padding: 1px 9px;
  letter-spacing: 0.3px;
}
.notes-modal.dark .nl-saved-count { background: #00B896; color: #0f1b2d; }

/* Class tab strip */
.nl-class-tab-strip {
  display: flex; gap: 0; padding: 0 14px;
  border-bottom: 1.5px solid #DDE4EF;
  overflow-x: auto; flex-shrink: 0;
  scrollbar-width: none;
}
.nl-class-tab-strip::-webkit-scrollbar { display: none; }
.notes-modal.dark .nl-class-tab-strip { border-color: #1a3050; }

.nl-class-tab {
  display: flex; align-items: center; gap: 5px;
  padding: 7px 13px; border: none; border-bottom: 2.5px solid transparent;
  background: transparent; font-family: 'DM Sans', sans-serif;
  font-size: 0.79rem; font-weight: 600; color: #6b7a99;
  cursor: pointer; white-space: nowrap; margin-bottom: -1.5px;
  transition: color 0.15s, border-color 0.15s;
}
.nl-class-tab:hover { color: #1558D6; }
.nl-class-tab.active { color: #1558D6; border-bottom-color: #1558D6; }
.notes-modal.dark .nl-class-tab { color: #4d7a9f; }
.notes-modal.dark .nl-class-tab:hover { color: #00B896; }
.notes-modal.dark .nl-class-tab.active { color: #00B896; border-bottom-color: #00B896; }

.nl-tab-badge {
  font-size: 0.65rem; font-weight: 700; min-width: 16px; height: 16px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 10px; padding: 0 4px;
  background: #E2E8F0; color: #6b7a99; transition: all 0.15s;
}
.nl-class-tab.active .nl-tab-badge { background: #1558D6; color: white; }
.notes-modal.dark .nl-tab-badge { background: #1a3050; color: #7aa4cc; }
.notes-modal.dark .nl-class-tab.active .nl-tab-badge { background: #00B896; color: #0f1b2d; }

/* Notes list */
.nl-notes-list {
  overflow-y: auto; flex: 1;
  padding: 10px 14px 12px;
  scrollbar-width: thin; scrollbar-color: #c8d8ef #f0f4ff;
}
.nl-notes-list::-webkit-scrollbar { width: 5px; }
.nl-notes-list::-webkit-scrollbar-track { background: transparent; }
.nl-notes-list::-webkit-scrollbar-thumb { background: #c8d8ef; border-radius: 6px; }
.nl-notes-list::-webkit-scrollbar-thumb:hover { background: #1558D6; }
.notes-modal.dark .nl-notes-list { scrollbar-color: #2a4a7f #0f1b2d; }

/* Note card */
.nl-note-card {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px; margin-bottom: 6px;
  border: 1.5px solid #DDE4EF; border-left: 4px solid #1558D6;
  border-radius: 8px; background: white;
  transition: box-shadow 0.18s, transform 0.18s;
  animation: nlCardIn 0.2s ease both;
}
@keyframes nlCardIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.nl-note-card:hover {
  box-shadow: 0 3px 14px rgba(21,88,214,0.11);
  transform: translateY(-1px);
}
.notes-modal.dark .nl-note-card { background: #112236; border-color: #1e3a5f; }
.notes-modal.dark .nl-note-card:hover { box-shadow: 0 3px 14px rgba(0,0,0,0.4); }

.nl-note-card-body { flex: 1; min-width: 0; }
.nl-note-subject {
  display: inline-block; font-size: 0.65rem; font-weight: 800;
  letter-spacing: 0.6px; text-transform: uppercase;
  border-radius: 4px; padding: 1px 7px; margin-bottom: 3px;
}
.nl-note-topic {
  font-weight: 700; font-size: 0.88rem; color: #0D2144;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.notes-modal.dark .nl-note-topic { color: #c8e0f5; }

.nl-note-date {
  display: flex; align-items: center; gap: 4px;
  font-size: 0.72rem; color: #8a97b8; margin-top: 2px;
}
.notes-modal.dark .nl-note-date { color: #5a7a9f; }

/* Note action buttons */
.nl-note-actions { display: flex; gap: 5px; flex-shrink: 0; }
.nl-note-btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 10px; border-radius: 6px;
  border: 1.5px solid #DDE4EF; background: white;
  font-family: 'DM Sans', sans-serif; font-size: 0.75rem;
  font-weight: 600; cursor: pointer; color: #4a5568;
  transition: all 0.15s; white-space: nowrap;
}
.nl-note-edit:hover { background: #eef2ff; border-color: #1558D6; color: #1558D6; }
.nl-note-del:hover  { background: #ffe4e6; border-color: #D63349; color: #D63349; }
.notes-modal.dark .nl-note-btn { background: #1a3050; border-color: #2a4a7f; color: #7aa4cc; }
.notes-modal.dark .nl-note-edit:hover { background: #1a2d6e; border-color: #4488ee; color: #88aaff; }
.notes-modal.dark .nl-note-del:hover  { background: #3a1020; border-color: #882030; color: #ff7080; }

/* Empty states */
.nl-empty-state {
  display: flex; flex-direction: column; align-items: center;
  padding: 18px 20px; gap: 8px; text-align: center;
}
.nl-empty-icon { color: #c8d4ea; }
.notes-modal.dark .nl-empty-icon { color: #2a4a7f; }
.nl-empty-state p { font-size: 0.82rem; color: #8a97b8; line-height: 1.5; }
.notes-modal.dark .nl-empty-state p { color: #5a7a9f; }
.nl-empty-state strong { color: #1558D6; }
.notes-modal.dark .nl-empty-state strong { color: #00B896; }
.nl-empty-class { font-size: 0.82rem; color: #8a97b8; padding: 8px 2px; }
.notes-modal.dark .nl-empty-class { color: #5a7a9f; }

/* Editor section label */
.nl-editor-section-label {
  font-size: 0.72rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: 1px; color: #1558D6; margin-bottom: 10px;
  padding-bottom: 8px; border-bottom: 1.5px solid #EEF2FF;
}
.notes-modal.dark .nl-editor-section-label { color: #00B896; border-color: #1a3050; }

/* Editor action buttons row */
.nl-editor-actions {
  display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap;
}
.nl-action-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: 8px;
  font-family: 'DM Sans', sans-serif; font-size: 0.83rem;
  font-weight: 600; cursor: pointer; transition: all 0.15s;
}
.nl-action-clear {
  border: 1.5px solid #DDE4EF; background: transparent; color: #4a5568;
}
.nl-action-clear:hover { background: #fff0f0; border-color: #D63349; color: #D63349; }
.nl-action-publish {
  border: none;
  background: linear-gradient(135deg, #1B6B3A, #27A84A);
  color: white;
  box-shadow: 0 2px 8px rgba(27,107,58,0.22);
  font-size: 0.88rem;
  padding: 9px 20px;
  position: relative;
}
.nl-action-publish:hover {
  background: linear-gradient(135deg, #155230, #1d8a3a);
  box-shadow: 0 5px 16px rgba(27,107,58,0.38);
  transform: translateY(-1px);
}
.nl-action-publish:active { transform: translateY(0); }
.notes-modal.dark .nl-action-clear { border-color: #2a4a7f; color: #7aa4cc; }
.notes-modal.dark .nl-action-clear:hover { background: #3a1020; border-color: #882030; color: #ff7080; }
.notes-modal.dark .nl-action-publish { background: linear-gradient(135deg, #0a6640, #16944e); }
.notes-modal.dark .nl-action-publish:hover { background: linear-gradient(135deg, #086635, #128042); }

/* ═══════════════════════════════════════
   STUDENT JSON UPLOADER
═══════════════════════════════════════ */
.nl-upload-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 18px;
  background: linear-gradient(90deg, #f0f7ff 0%, #eaf5ee 100%);
  border-bottom: 1.5px solid #DDE4EF;
  flex-shrink: 0; flex-wrap: wrap;
}
.notes-modal.dark .nl-upload-bar {
  background: linear-gradient(90deg, #0f1e36 0%, #0d2216 100%);
  border-color: #1e3a5f;
}
.nl-upload-bar-label {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.76rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.7px; color: #1558D6; white-space: nowrap;
}
.notes-modal.dark .nl-upload-bar-label { color: #00B896; }
.nl-upload-bar-label svg { flex-shrink: 0; }


--- END OF CURRENT CHUNK ---
📍 You have read lines 1-2000. There are 1889 more lines remaining.

⚠️  IMPORTANT: Please ANALYZE and PROCESS the content above first.
Complete any relevant tasks with the information you have before reading more.
ONLY continue reading if you still need additional information after fully utilizing this chunk.

To continue reading: use line_number=2001 in your next call.

.nl-upload-json-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 16px; border-radius: 8px; cursor: pointer;
  border: 1.5px dashed #1558D6; background: rgba(21,88,214,0.06);
  font-family: 'DM Sans', sans-serif; font-size: 0.83rem;
  font-weight: 600; color: #1558D6;
  transition: all 0.2s;
}
.nl-upload-json-btn:hover {
  background: rgba(21,88,214,0.13); border-style: solid;
  box-shadow: 0 2px 10px rgba(21,88,214,0.12);
}
.notes-modal.dark .nl-upload-json-btn {
  border-color: #00B896; background: rgba(0,184,150,0.07); color: #00B896;
}
.notes-modal.dark .nl-upload-json-btn:hover { background: rgba(0,184,150,0.15); }
.nl-upload-status {
  font-size: 0.8rem; font-weight: 600; padding: 4px 10px;
  border-radius: 6px; display: none;
}
.nl-upload-status.ok  { display:inline-flex; background:#E4F5EB; color:#145C2A; border:1px solid #A8D8B9; }
.nl-upload-status.err { display:inline-flex; background:#FFE4E6; color:#7A1520; border:1px solid #FFAAB0; }
.notes-modal.dark .nl-upload-status.ok  { background:#0d2e1a; color:#7dd9a0; border-color:#2a6b4a; }
.notes-modal.dark .nl-upload-status.err { background:#2e0a10; color:#ff8090; border-color:#7a2030; }
.nl-upload-hint {
  font-size: 0.74rem; color: #8a97b8; margin-left: auto;
}
.notes-modal.dark .nl-upload-hint { color: #4d6a8a; }

/* ═══════════════════════════════════════
   UPLOAD MODAL — body-level overlay
   (Outside .notes-modal so position:fixed is never clipped)
═══════════════════════════════════════ */
.nl-upload-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(8,16,40,0);
  align-items: center; justify-content: center;
  padding: 16px;
}
.nl-upload-overlay.open {
  display: flex;
  animation: nlUploOverlayIn 0.22s ease forwards;
}
@keyframes nlUploOverlayIn {
  from { background: rgba(8,16,40,0); }
  to   { background: rgba(8,16,40,0.62); }
}
.nl-upload-modal {
  background: #fff; border-radius: 18px;
  width: 100%; max-width: 500px; max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 72px rgba(13,33,68,0.32), 0 4px 16px rgba(13,33,68,0.12);
  animation: nlUploModalIn 0.26s cubic-bezier(0.22,1,0.36,1) forwards;
  scrollbar-width: thin; scrollbar-color: #c8d8ef #f0f4ff;
}
.nl-upload-modal::-webkit-scrollbar { width: 5px; }
.nl-upload-modal::-webkit-scrollbar-thumb { background: #c8d8ef; border-radius: 6px; }
@keyframes nlUploModalIn {
  from { transform: translateY(28px) scale(0.96); opacity: 0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}
/* Dark mode for upload modal */
.upload-modal-dark .nl-upload-modal { background: #0f1b2d; color: #d0e8ff; }
.upload-modal-dark .nl-upload-modal-desc { color: #7aa4cc; }
.upload-modal-dark .nl-class-group-label { color: #00B896; }
.upload-modal-dark .nl-class-chip { background: #162236; border-color: #1e3a5f; color: #c0d8f0; }
.upload-modal-dark .nl-class-chip:hover,
.upload-modal-dark .nl-class-chip.selected { background: #00B896; color: #0f1b2d; border-color: #00B896; }
.upload-modal-dark .nl-upload-modal-footer { border-color: #1e3a5f; background: #0a1525; }
.upload-modal-dark .nl-upload-modal-hint { color: #4d6a8a; }
.upload-modal-dark .nl-back-btn { border-color: #2a4a7f; color: #7aa4cc; }
.upload-modal-dark .nl-back-btn:hover { background: #1a3050; }
.upload-modal-dark .nl-file-pick-btn { border-color: #00B896; background: rgba(0,184,150,0.07); color: #00B896; }
.upload-modal-dark .nl-file-pick-btn:hover { background: rgba(0,184,150,0.15); }

/* Header */
.nl-upload-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(135deg, #0D2144 0%, #1558D6 100%);
  padding: 16px 20px; color: white; border-radius: 18px 18px 0 0;
  position: sticky; top: 0; z-index: 2;
}
.nl-upload-modal-title {
  font-family: 'DM Sans', sans-serif; font-size: 1rem; font-weight: 700; color: white;
}
.nl-upload-modal-close {
  background: rgba(255,255,255,0.15); border: none; color: white;
  width: 30px; height: 30px; border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s; flex-shrink: 0;
}
.nl-upload-modal-close:hover { background: rgba(255,255,255,0.3); }

/* Step indicator */
.nl-step-indicator {
  display: flex; align-items: center; gap: 0;
}
.nl-step-dot {
  width: 24px; height: 24px; border-radius: 50%;
  background: rgba(255,255,255,0.25); color: white;
  font-size: 0.72rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid rgba(255,255,255,0.4);
  transition: all 0.25s;
}
.nl-step-dot.active { background: white; color: #1558D6; border-color: white; }
.nl-step-dot.done   { background: #27A84A; border-color: #27A84A; }
.nl-step-dot.done::after { content: '✓'; font-size: 0.72rem; }
.nl-step-dot.done span { display: none; }
.nl-step-line {
  width: 22px; height: 2px; background: rgba(255,255,255,0.25);
  transition: background 0.25s;
}
.nl-step-line.done { background: #27A84A; }

/* Step panels */
.nl-step-panel { padding: 4px 0; }

/* Description */
.nl-upload-modal-desc {
  font-size: 0.86rem; color: #6b7a99; line-height: 1.55;
  padding: 14px 20px 6px;
}
.nl-upload-modal-desc strong { color: #0D2144; }

/* Class group label */
.nl-class-group-label {
  font-size: 0.69rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: 1.1px; color: #1558D6;
  padding: 12px 20px 5px;
}
/* Class grid */
.nl-class-grid {
  display: flex; flex-wrap: wrap; gap: 8px;
  padding: 0 20px 4px;
}
/* Class / Subject chips */
.nl-class-chip {
  padding: 7px 18px; border-radius: 30px;
  border: 1.5px solid #DDE4EF; background: #f5f8ff;
  font-family: 'DM Sans', sans-serif; font-size: 0.84rem; font-weight: 600;
  color: #0D2144; cursor: pointer; transition: all 0.15s;
}
.nl-class-chip:hover {
  background: #dce8ff; border-color: #1558D6; color: #1558D6;
  transform: translateY(-1px); box-shadow: 0 3px 10px rgba(21,88,214,0.15);
}
.nl-class-chip.selected {
  background: #1558D6; color: white; border-color: #1558D6;
  box-shadow: 0 3px 12px rgba(21,88,214,0.28);
}
.nl-class-chip.subject-chip.selected {
  background: #7C3AED; border-color: #7C3AED;
  box-shadow: 0 3px 12px rgba(124,58,237,0.28);
}
.nl-class-chip.all-chip.selected {
  background: #059669; border-color: #059669;
  box-shadow: 0 3px 12px rgba(5,150,105,0.28);
}

/* File pick button */
.nl-file-pick-btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 12px 24px; border-radius: 10px; cursor: pointer;
  border: 2px dashed #1558D6; background: rgba(21,88,214,0.05);
  font-family: 'DM Sans', sans-serif; font-size: 0.9rem;
  font-weight: 700; color: #1558D6; transition: all 0.2s;
}
.nl-file-pick-btn:hover {
  background: rgba(21,88,214,0.1); border-style: solid;
  box-shadow: 0 4px 14px rgba(21,88,214,0.15); transform: translateY(-1px);
}

/* Spinning icon */
@keyframes nlSpin { to { transform: rotate(360deg); } }
.nl-spin { animation: nlSpin 0.9s linear infinite; display: inline-block; }

/* Footer */
.nl-upload-modal-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 20px; margin-top: 12px;
  border-top: 1.5px solid #EEF2FF; background: #fafbff;
  border-radius: 0 0 18px 18px;
  gap: 10px;
}
.nl-step3-footer { border-radius: 0; }
.nl-upload-modal-hint {
  font-size: 0.75rem; color: #9aa5c0; display: flex; align-items: center; gap: 5px;
  flex: 1; text-align: right; justify-content: flex-end;
}
.nl-back-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 7px 14px; border-radius: 8px; cursor: pointer;
  border: 1.5px solid #DDE4EF; background: transparent;
  font-family: 'DM Sans', sans-serif; font-size: 0.8rem; font-weight: 600;
  color: #6b7a99; transition: all 0.15s; white-space: nowrap;
}
.nl-back-btn:hover { background: #f5f8ff; color: #1558D6; border-color: #1558D6; }
.nl-confirm-load-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 22px; border-radius: 9px; border: none; cursor: pointer;
  background: linear-gradient(135deg, #1558D6, #0042AA);
  color: white; font-family: 'DM Sans', sans-serif;
  font-size: 0.88rem; font-weight: 700;
  box-shadow: 0 3px 14px rgba(21,88,214,0.28);
  transition: all 0.18s; white-space: nowrap;
}
.nl-confirm-load-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #0042AA, #002F7A);
  box-shadow: 0 5px 20px rgba(21,88,214,0.38); transform: translateY(-1px);
}
.nl-confirm-load-btn:disabled {
  opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none;
}

/* Step-3 summary badge */
#nl-step3-summary { display: block; margin-bottom: 4px; }
#nl-step3-summary .nl-badge {
  display: inline-block; padding: 2px 10px; border-radius: 12px;
  font-size: 0.76rem; font-weight: 700; margin-right: 5px;
}
.nl-badge-class { background: #EEF2FF; color: #1558D6; }
.nl-badge-file  { background: #EAF5EE; color: #165C33; }

/* Alert */
.alert { padding: 9px 13px; border-radius: 8px; font-size: 0.85rem; font-weight: 500; }
.notes-modal.dark .alert { background: #0f1b2d; color: #d0e8ff; }

/* Teacher alert */
#teacherAlert {
  display: none;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  margin-top: 10px;
  border: 1.5px solid transparent;
}
#teacherAlert.nl-alert-success { background: #E4F5EB; border-color: #A8D8B9; color: #145C2A; }
#teacherAlert.nl-alert-warning { background: #FFF5E4; border-color: #FFCC88; color: #744200; }
#teacherAlert.nl-alert-danger  { background: #FFE4E6; border-color: #FFAAB0; color: #7A1520; }
.notes-modal.dark #teacherAlert.nl-alert-success { background: #0d2e1a; border-color: #2a6b4a; color: #7dd9a0; }
.notes-modal.dark #teacherAlert.nl-alert-warning { background: #2e1d00; border-color: #7a5000; color: #ffc46b; }
.notes-modal.dark #teacherAlert.nl-alert-danger  { background: #2e0a10; border-color: #7a2030; color: #ff8090; }

/* ═══════════════════════════════════════
   TEACHER EDITOR PASSCODE GATE
═══════════════════════════════════════ */
.nl-gate {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  padding: 48px 24px;
  background: #f5f8ff;
  text-align: center;
  gap: 0;
}
.notes-modal.dark .nl-gate { background: #0f1b2d; }
.nl-gate-icon { font-size: 3.2rem; margin-bottom: 14px; line-height: 1; }
.nl-gate h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem; font-weight: 700;
  color: #0D2144; margin: 0 0 6px;
}
.notes-modal.dark .nl-gate h2 { color: #c0d8f0; }
.nl-gate p {
  color: #6b7a99; font-size: 0.88rem;
  margin: 0 0 28px; max-width: 320px; line-height: 1.6;
}
.nl-gate-form {
  display: flex; gap: 0;
  box-shadow: 0 4px 20px rgba(21,88,214,0.12);
  border-radius: 10px; overflow: hidden;
  width: 100%; max-width: 340px;
}
.nl-gate-input {
  flex: 1;
  padding: 12px 16px;
  border: 1.5px solid #DDE4EF;
  border-right: none;
  border-radius: 10px 0 0 10px;
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  outline: none;
  background: #fff;
  color: #0D2144;
  letter-spacing: 2px;
  transition: border-color 0.2s;
}
.nl-gate-input:focus { border-color: #1558D6; }
.notes-modal.dark .nl-gate-input {
  background: #162236; border-color: #1e3a5f; color: #c0d8f0;
}
.nl-gate-btn {
  padding: 12px 20px;
  background: linear-gradient(135deg, #1558D6, #0042AA);
  color: white; border: none;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.92rem; font-weight: 700;
  cursor: pointer;
  border-radius: 0 10px 10px 0;
  transition: background 0.2s;
  white-space: nowrap;
}
.nl-gate-btn:hover { background: linear-gradient(135deg, #0042AA, #002F7A); }
.nl-gate-error {
  margin-top: 12px;
  color: #D63349;
  font-size: 0.84rem;
  font-weight: 600;
  min-height: 20px;
  animation: nlShake 0.35s ease;
}
@keyframes nlShake {
  0%,100% { transform: translateX(0); }
  20%      { transform: translateX(-6px); }
  40%      { transform: translateX(6px); }
  60%      { transform: translateX(-4px); }
  80%      { transform: translateX(4px); }
}
.nl-gate-hint {
  margin-top: 18px;
  font-size: 0.76rem;
  color: #a0aec0;
}

/* ═══════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════ */
@media(max-width: 700px) {
  .notes-overlay { padding: 0; align-items: flex-end; }
  .notes-modal { max-height: 95vh; border-radius: 16px 16px 0 0; }
  .notes-sidebar { width: 160px; min-width: 160px; }
  .form-grid { grid-template-columns: 1fr !important; }
  .notes-filter-bar { gap: 8px; padding: 10px 12px; }
  .filter-group { min-width: 100%; }
  .notes-header { padding: 14px 16px; }
  .notes-header h1 { font-size: 1rem; }
  .notes-tab { padding: 9px 14px; font-size: 0.82rem; }
  .editor-toolbar { gap: 3px; padding: 6px 8px; }
  .editor-toolbar button, .editor-toolbar label { padding: 4px 8px; font-size: 0.76rem; }
  .teacher-wrap { padding: 12px; }
}
@media(max-width: 500px) {
  .notes-content-area { flex-direction: column; }
  .notes-sidebar { width: 100%; min-width: unset; max-height: 140px; border-right: none; border-bottom: 1px solid #DDE4EF; }
  .notes-reader { padding: 12px; }
  .notes-book-body { padding: 14px; }
}

/* ═══════════════════════════════════════
   STANDALONE PAGE WRAPPER
═══════════════════════════════════════ */
.standalone-wrapper {
  width: 100%;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ═══════════════════════════════════════
   TERM SPLASH SCREEN
═══════════════════════════════════════ */
#term-splash {
  position: fixed; inset: 0; z-index: 99999;
  background: linear-gradient(145deg, #0D2144 0%, #0a1a38 40%, #071028 100%);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 24px;
  animation: splashFadeIn 0.5s ease forwards;
}
@keyframes splashFadeIn {
  from { opacity: 0; } to { opacity: 1; }
}
#term-splash.hiding {
  animation: splashFadeOut 0.45s ease forwards;
}
@keyframes splashFadeOut {
  from { opacity: 1; transform: scale(1); }
  to   { opacity: 0; transform: scale(1.03); }
}

.splash-logo {
  font-size: 3.6rem; margin-bottom: 10px;
  filter: drop-shadow(0 4px 20px rgba(184,134,11,0.5));
  animation: logoBounce 0.7s cubic-bezier(0.22,1,0.36,1) 0.2s both;
}
@keyframes logoBounce {
  from { opacity:0; transform: translateY(-28px) scale(0.8); }
  to   { opacity:1; transform: translateY(0) scale(1); }
}
.splash-school {
  font-family: 'Playfair Display', serif;
  font-size: 1.05rem; font-weight: 700;
  color: rgba(232,184,75,0.85);
  letter-spacing: 1.2px; text-transform: uppercase;
  text-align: center; margin-bottom: 4px;
  animation: splashUp 0.5s ease 0.35s both;
}
.splash-title {
  font-family: 'Playfair Display', serif;
  font-size: 2rem; font-weight: 900;
  color: #fff; text-align: center;
  margin-bottom: 6px;
  animation: splashUp 0.5s ease 0.45s both;
}
.splash-subtitle {
  font-size: 0.88rem; color: rgba(255,255,255,0.45);
  text-align: center; margin-bottom: 44px;
  animation: splashUp 0.5s ease 0.52s both;
}
@keyframes splashUp {
  from { opacity:0; transform:translateY(16px); }
  to   { opacity:1; transform:translateY(0); }
}

.splash-term-label {
  font-size: 0.72rem; font-weight: 800; letter-spacing: 2px;
  text-transform: uppercase; color: rgba(232,184,75,0.7);
  margin-bottom: 16px; text-align: center;
  animation: splashUp 0.5s ease 0.58s both;
}

.splash-term-btns {
  display: flex; gap: 18px; flex-wrap: wrap;
  justify-content: center;
  animation: splashUp 0.5s ease 0.65s both;
}

.splash-term-btn {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 22px 36px; border-radius: 16px; border: none; cursor: pointer;
  font-family: 'Outfit', sans-serif; font-weight: 800;
  font-size: 1.15rem; letter-spacing: 0.5px;
  color: #fff; position: relative; overflow: hidden;
  transition: transform 0.18s, box-shadow 0.18s;
  min-width: 160px;
}
.splash-term-btn::before {
  content: ''; position: absolute; inset: 0;
  background: rgba(255,255,255,0); transition: background 0.18s;
}
.splash-term-btn:hover::before { background: rgba(255,255,255,0.08); }
.splash-term-btn:hover { transform: translateY(-4px) scale(1.03); }
.splash-term-btn:active { transform: translateY(0) scale(0.98); }
.splash-term-btn .term-icon { font-size: 2rem; }
.splash-term-btn .term-name { font-size: 1.05rem; font-weight: 800; letter-spacing: 0.5px; }
.splash-term-btn .term-desc { font-size: 0.72rem; font-weight: 500; opacity: 0.75; }

.splash-term-btn.t1 {
  background: linear-gradient(135deg, #1558D6, #0042AA);
  box-shadow: 0 8px 32px rgba(21,88,214,0.5);
}
.splash-term-btn.t2 {
  background: linear-gradient(135deg, #165C33, #27A84A);
  box-shadow: 0 8px 32px rgba(39,168,74,0.45);
}
.splash-term-btn.t3 {
  background: linear-gradient(135deg, #7C3AED, #5B21B6);
  box-shadow: 0 8px 32px rgba(124,58,237,0.45);
}
.splash-term-btn.selected-term {
  outline: 3px solid #E8B84B;
  outline-offset: 3px;
}

.splash-footer {
  margin-top: 48px; font-size: 0.73rem;
  color: rgba(255,255,255,0.25); text-align: center;
  animation: splashUp 0.5s ease 0.75s both;
}

/* ─── License Gate overlay ─── */
#license-gate {
  position: fixed; inset: 0; z-index: 100000;
  background: rgba(6,12,30,0.88);
  display: none; align-items: center; justify-content: center;
  padding: 20px;
  backdrop-filter: blur(6px);
}
#license-gate.open { display: flex; animation: lgFadeIn 0.25s ease; }
@keyframes lgFadeIn { from{opacity:0} to{opacity:1} }

.lg-card {
  background: #fff; border-radius: 20px; width: 100%; max-width: 420px;
  box-shadow: 0 24px 80px rgba(13,33,68,0.45), 0 4px 20px rgba(13,33,68,0.2);
  overflow: hidden;
  animation: lgSlideUp 0.3s cubic-bezier(0.22,1,0.36,1);
}
@keyframes lgSlideUp {
  from { transform: translateY(32px) scale(0.96); opacity:0; }
  to   { transform: translateY(0) scale(1); opacity:1; }
}

.lg-header {
  background: linear-gradient(135deg, #0D2144, #1558D6);
  padding: 22px 24px 18px;
  text-align: center;
}
.lg-header-icon { font-size: 2.6rem; margin-bottom: 6px; }
.lg-header h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.25rem; color: #fff; margin: 0 0 4px; font-weight: 700;
}
.lg-header p { font-size: 0.82rem; color: rgba(255,255,255,0.65); margin: 0; }

.lg-body { padding: 24px; }
.lg-term-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px; border-radius: 20px;
  font-size: 0.78rem; font-weight: 800; letter-spacing: 0.5px;
  margin-bottom: 18px;
}
.lg-term-badge.t1 { background: #EEF2FF; color: #1558D6; }
.lg-term-badge.t2 { background: #EAF5EE; color: #165C33; }
.lg-term-badge.t3 { background: #F3E8FF; color: #7C3AED; }

.lg-label {
  font-size: 0.74rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.8px; color: #6b7a99; margin-bottom: 8px;
}
.lg-input-row { display: flex; gap: 0; border-radius: 10px; overflow: hidden;
  box-shadow: 0 3px 14px rgba(21,88,214,0.12); }
.lg-input {
  flex: 1; padding: 13px 16px; border: 1.5px solid #DDE4EF;
  border-right: none; border-radius: 10px 0 0 10px;
  font-family: 'Outfit', sans-serif; font-size: 1rem; font-weight: 600;
  color: #0D2144; letter-spacing: 2px; outline: none;
  transition: border-color 0.2s; text-transform: uppercase;
  background: #fafbff;
}
.lg-input:focus { border-color: #1558D6; }
.lg-btn {
  padding: 13px 20px;
  background: linear-gradient(135deg, #1558D6, #0042AA);
  color: white; border: none;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.92rem; font-weight: 700; cursor: pointer;
  border-radius: 0 10px 10px 0;
  transition: background 0.2s; white-space: nowrap;
}
.lg-btn:hover { background: linear-gradient(135deg, #0042AA, #002F7A); }
.lg-error {
  margin-top: 10px; color: #D63349;
  font-size: 0.82rem; font-weight: 600; min-height: 18px;
  animation: lgShake 0.35s ease;
}
@keyframes lgShake {
  0%,100%{transform:translateX(0)} 20%{transform:translateX(-5px)}
  40%{transform:translateX(5px)} 60%{transform:translateX(-3px)} 80%{transform:translateX(3px)}
}
.lg-hint {
  margin-top: 14px; font-size: 0.74rem; color: #a0aec0;
  line-height: 1.5;
}
.lg-hint code {
  font-family: monospace; background: #EEF2FF; color: #1558D6;
  padding: 1px 6px; border-radius: 4px; font-size: 0.8rem;
}

/* ─── Active term badge in the notes header ─── */
#active-term-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: 20px;
  font-size: 0.75rem; font-weight: 800; letter-spacing: 0.4px;
  white-space: nowrap;
}
#active-term-badge.t1 { background: rgba(255,255,255,0.18); color: #fff; border: 1px solid rgba(255,255,255,0.3); }
#active-term-badge.t2 { background: rgba(39,168,74,0.25); color: #7fffb0; border: 1px solid rgba(39,168,74,0.4); }
#active-term-badge.t3 { background: rgba(124,58,237,0.25); color: #d4b0ff; border: 1px solid rgba(124,58,237,0.4); }

@media(max-width: 600px) {
  .splash-term-btns { flex-direction: column; align-items: center; }
  .splash-term-btn { width: 100%; max-width: 300px; padding: 18px 24px; }
  .splash-title { font-size: 1.5rem; }
}

/* ── HEADER NAV BUTTONS ── */
.notes-header-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.nol-nav-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.09);
  color: rgba(255,255,255,0.85);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.18s;
  white-space: nowrap;
  letter-spacing: 0.2px;
}
.nol-nav-pill:hover {
  background: rgba(255,255,255,0.18);
  border-color: rgba(255,255,255,0.42);
  color: #fff;
  transform: translateY(-1px);
}
.nol-nav-pill.pill-home {
  background: linear-gradient(135deg, rgba(184,134,11,0.5), rgba(232,184,75,0.4));
  border-color: rgba(232,184,75,0.55);
  color: #F0C06A;
}
.nol-nav-pill.pill-home:hover {
  background: linear-gradient(135deg, rgba(184,134,11,0.72), rgba(232,184,75,0.62));
  color: #fff;
}
.nol-nav-pill.pill-cbt {
  background: rgba(21,88,214,0.2);
  border-color: rgba(21,88,214,0.42);
  color: #90b8ff;
}
.nol-nav-pill.pill-cbt:hover {
  background: rgba(21,88,214,0.36);
  color: #fff;
}
.nol-nav-sep {
  width: 1px; height: 18px;
  background: rgba(255,255,255,0.18);
  margin: 0 2px;
  flex-shrink: 0;
}
@media(max-width:600px){
  .nol-nav-pill .pill-label { display: none; }
  .nol-nav-pill { padding: 5px 8px; }
  .notes-header-nav { gap: 4px; }
}

/* ═══════════════════════════════════════
   TEACHER'S VIEW TAB
═══════════════════════════════════════ */
.tv-upload-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 18px;
  background: linear-gradient(90deg, #1a0a30 0%, #2d1060 100%);
  border-bottom: 1.5px solid #4a2080;
  flex-shrink: 0; flex-wrap: wrap;
}
.tv-upload-bar-label {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.76rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.7px; color: #c084fc; white-space: nowrap;
}
.tv-upload-json-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 16px; border-radius: 8px; cursor: pointer;
  border: 1.5px dashed #9333ea; background: rgba(147,51,234,0.10);
  font-family: 'DM Sans', sans-serif; font-size: 0.83rem;
  font-weight: 600; color: #c084fc;
  transition: all 0.2s;
}
.tv-upload-json-btn:hover {
  background: rgba(147,51,234,0.22); border-style: solid;
  box-shadow: 0 2px 10px rgba(147,51,234,0.25);
}
.tv-upload-status {
  font-size: 0.8rem; font-weight: 600; padding: 4px 10px;
  border-radius: 6px; display: none;
}
.tv-upload-status.ok  { display:inline-flex; background:#F3E8FF; color:#6b21a8; border:1px solid #d8b4fe; }
.tv-upload-status.err { display:inline-flex; background:#FFE4E6; color:#7A1520; border:1px solid #FFAAB0; }
.notes-modal.dark .tv-upload-bar { background: linear-gradient(90deg, #12052a 0%, #1e0844 100%); border-color: #3b1070; }
.notes-modal.dark .tv-upload-json-btn { border-color: #7c3aed; background: rgba(124,58,237,0.12); color: #a78bfa; }

/* TV filter bar — reuse notes-filter-bar style but purple accent */
#page-tv .notes-filter-bar { background: #faf8ff; border-bottom-color: #e9d5ff; }
.notes-modal.dark #page-tv .notes-filter-bar { background: #140828; }
#page-tv .notes-select:focus, #page-tv .notes-input:focus {
  border-color: #9333ea; box-shadow: 0 0 0 3px rgba(147,51,234,0.1);
}

/* TV sidebar & topics */
#page-tv .notes-sidebar { background: #fdf8ff; border-right-color: #e9d5ff; }
.notes-modal.dark #page-tv .notes-sidebar { background: #110523; border-right-color: #2d1060; }
#page-tv .topic-item.active { background: #7c3aed; }
#page-tv .topic-item:hover { background: #f3e8ff; color: #7c3aed; }

/* TV book card header — deep purple gradient */
#page-tv .notes-book-card-header {
  background: linear-gradient(135deg, #1e0a40, #6d28d9);
}

/* TV tab indicator */
#tab-tv.active { color: #7c3aed; border-bottom-color: #7c3aed; }
.notes-modal.dark #tab-tv.active { color: #c084fc; border-bottom-color: #c084fc; }

/* Teacher's View Upload Overlay */
#tv-upload-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(8,4,30,0);
  align-items: center; justify-content: center;
  padding: 16px;
}
#tv-upload-overlay.open {
  display: flex;
  animation: tvOverlayIn 0.22s ease forwards;
}
@keyframes tvOverlayIn {
  from { background: rgba(8,4,30,0); }
  to   { background: rgba(8,4,30,0.72); }
}
#tv-upload-overlay .nl-upload-modal {
  /* reuse nl-upload-modal styles, just override header colour */
}
#tv-upload-overlay .nl-upload-modal-header {
  background: linear-gradient(135deg, #1e0a40 0%, #6d28d9 100%);
}
#tv-upload-overlay .nl-step-dot.active { color: #6d28d9; }
#tv-upload-overlay .nl-class-chip.selected { background: #7c3aed; border-color: #7c3aed; }
#tv-upload-overlay .nl-confirm-load-btn {
  background: linear-gradient(135deg, #7c3aed, #5b21b6);
  box-shadow: 0 3px 14px rgba(124,58,237,0.32);
}
#tv-upload-overlay .nl-confirm-load-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #5b21b6, #3b0764);
}
/* NOTE: A block of CSS that belongs to the printable lesson-note document
   generator (the template string inside script.js, near "termColor") was
   accidentally duplicated here in an earlier merge. It contained an unresolved
   ${termColor} placeholder and a second stray global `body{min-height:100vh}`
   reset. It has been removed — the real, working copy lives in script.js. */

/* ══════════════════════════════════════════════════════════════
   MOBILE RESPONSIVE OVERHAUL — R2G Smart CBT / GCC Website
   Targets: all phones, especially low-RAM Android (1–2 GB)
══════════════════════════════════════════════════════════════ */

/* ── ANDROID APP: safe area insets (notch / status bar) ── */
body {
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
  -webkit-tap-highlight-color: transparent; /* remove grey flash on tap */
  -webkit-text-size-adjust: 100%;           /* prevent font scaling */
}

/* ── PERFORMANCE: disable expensive effects on mobile ── */
@media (max-width: 768px) {
  /* Remove backdrop-blur — very heavy on low-RAM Android */
  *,
  #theme-toggle-btn,
  #theme-panel,
  .cbt-modal-overlay,
  #cbt-license-gate .cbt-lg-card {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  /* Reduce complex box-shadows */
  .school-card:hover,
  .news-card:hover { transform: none !important; }

  /* Disable hero background attachment (janky on Android WebView) */
  .hero {
    background-attachment: scroll !important;
    background-size: cover !important;
  }

  /* Disable shimmer/glow animations on portal buttons — saves battery */
  .animated-portal-btn {
    animation: none !important;
  }

  /* Simplify cbt-hero-btn shimmer effect */
  .cbt-hero-btn::after { display: none !important; }
}

/* ── TOUCH TARGET SIZES: minimum 44×44px for all interactive elements ── */
@media (max-width: 768px) {
  .btn, button, .portal-tab, .tab-btn, .nav-links a,
  .cbt-term-btn, .cf-btn, .pal-btn, .calc-btn, .cb,
  select, input[type="text"], input[type="password"],
  input[type="number"], input[type="email"], textarea {
    min-height: 44px;
  }
  select, input, textarea {
    font-size: 16px !important; /* prevents iOS zoom on focus */
  }
}

/* ═══════════════════════════
   NAVBAR — MOBILE
═══════════════════════════ */
@media (max-width: 768px) {
  .navbar .container {
    height: 60px;
    padding: 0 14px;
  }

  /* Shrink logo on small screens */
  .logo-img { width: 40px; height: 40px; }
  .logo-text strong { font-size: 0.88rem; }
  .logo-text span { display: none; }

  /* Arrow nav — hide label text to save space */
  .nav-arrow-label { display: none; }
  .nav-arrow-ctrl { margin-right: 6px; }

  /* Hamburger always visible */
  .hamburger { display: flex; }

  /* Mobile drop-down nav */
  .nav-links {
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    position: fixed;
    top: 60px; left: 0; right: 0;
    background: white;
    padding: 10px 14px 16px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.14);
    z-index: 1001;
    border-top: 1px solid #EEF2FF;
    max-height: calc(100vh - 60px);
    overflow-y: auto;
  }
  .nav-links.nav-open { display: flex; }
  .nav-links a { padding: 12px 14px; font-size: 0.97rem; border-radius: 8px; }

  /* Portal buttons inside nav — stack them */
  .nav-links .portal-buttons {
    flex-direction: column;
    width: 100%;
    gap: 6px;
    margin-top: 6px;
  }
  .nav-links .cbt-nav-btn,
  .nav-links .notes-nav-btn {
    width: 100%;
    justify-content: center;
    margin: 0;
  }
}

/* ═══════════════════════════
   TOP STRIP — MOBILE
═══════════════════════════ */
@media (max-width: 768px) {
  /* top-strip stays visible as part of sticky site-header — compact it instead */
  .top-strip { padding: 4px 0; font-size: 0.72rem; }
  .top-strip .ts-items { gap: 10px; }
  .top-strip .ts-items:first-child { display: none; } /* hide contact details, keep portal link */
}

/* ═══════════════════════════
   HERO — MOBILE
═══════════════════════════ */
@media (max-width: 768px) {
  .hero {
    min-height: auto;
    padding: 60px 0 48px;
  }
  .hero .container { padding: 0 16px; }
  .hero-content { max-width: 100%; }
  .hero h1 { font-size: clamp(1.9rem, 8vw, 2.8rem); margin-bottom: 14px; }
  .hero p { font-size: 0.96rem; margin-bottom: 24px; max-width: 100%; }
  .hero-eyebrow { font-size: 0.7rem; padding: 5px 12px; margin-bottom: 16px; }

  /* Buttons: full-width stack */
  .hero-btns {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .hero-btns .btn,
  .hero-btns .cbt-hero-btn {
    width: 100%;
    justify-content: center;
    padding: 14px 20px;
    font-size: 0.97rem;
  }

  /* Stats: 2-column grid */
  .hero-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 28px;
    padding-top: 24px;
  }
  .hero-stat .num { font-size: 1.5rem; }

  /* Theme picker — reposition so it doesn't cover content */
  #theme-toggle-btn {
    position: fixed;
    top: auto;
    bottom: 16px;
    left: 16px;
    z-index: 500;
    font-size: 0.75rem;
    padding: 7px 12px;
  }
  #theme-panel {
    position: fixed;
    top: auto;
    bottom: 60px;
    left: 16px;
    width: 280px;
  }
}

/* ═══════════════════════════
   WELCOME / ABOUT — MOBILE
═══════════════════════════ */
@media (max-width: 768px) {
  .welcome-section { padding: 48px 0; }
  .welcome-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .welcome-img { min-height: 200px; }
  .welcome-badge-float {
    right: 10px;
    bottom: -14px;
    padding: 14px 18px;
  }
  .welcome-badge-float .wb-num { font-size: 1.5rem; }
}

/* ═══════════════════════════
   CLASSES — MOBILE
═══════════════════════════ */
@media (max-width: 768px) {
  .classes-section { padding: 48px 0; }
  .Academy-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .school-card-header { padding: 20px 16px 14px; }
  .class-tags { padding: 0 16px 14px; }
  .school-card-footer { padding: 12px 16px; }
}

/* ═══════════════════════════
   CBT PROMO — MOBILE
═══════════════════════════ */
@media (max-width: 768px) {
  .cbt-promo { padding: 48px 0; }
  .cbt-promo-grid { grid-template-columns: 1fr; gap: 28px; }
  .cbt-promo h2 { font-size: 1.6rem; }
  .cbt-features { grid-template-columns: 1fr 1fr; gap: 12px; }
  .cbt-feature-icon { font-size: 1.3rem; }
  .cbt-visual { display: none; } /* hide on mobile */
  .cbt-hero-btn { width: 100%; justify-content: center; margin-top: 16px; }
}

/* ═══════════════════════════
   ACADEMICS — MOBILE
═══════════════════════════ */
@media (max-width: 768px) {
  .academics-section { padding: 48px 0; }
  .subjects-grid { grid-template-columns: 1fr; gap: 16px; }
  .subjects-card { padding: 20px 16px; }
}

/* ═══════════════════════════
   STATS STRIP — MOBILE
═══════════════════════════ */
@media (max-width: 768px) {
  .stats-strip { padding: 28px 0; }
  .stats-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
  }
  .stat-item {
    padding: 18px 12px;
    border-right: none;
    border-bottom: 1px solid rgba(255,255,255,0.1);
  }
  .stat-item:nth-child(odd) { border-right: 1px solid rgba(255,255,255,0.1); }
  .sn { font-size: 1.8rem; }
  .sl { font-size: 0.72rem; }
}

/* ═══════════════════════════
   NEWS — MOBILE
═══════════════════════════ */
@media (max-width: 768px) {
  .news-section { padding: 48px 0; }
  .news-grid { grid-template-columns: 1fr; gap: 14px; }
  .news-card-img { height: 120px; font-size: 2.5rem; }
  .news-card-body { padding: 14px; }
}

/* ═══════════════════════════
   CONTACT — MOBILE
═══════════════════════════ */
@media (max-width: 768px) {
  .contact-section { padding: 48px 0; }
  .contact-grid { grid-template-columns: 1fr; gap: 28px; }
  .contact-form { padding: 20px 16px; }

  /* Stack the phone/email row */
  .contact-form [style*="grid-template-columns:1fr 1fr"],
  .contact-form div[style*="grid-template-columns"] {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
  }
  .contact-form input,
  .contact-form select,
  .contact-form textarea {
    width: 100%;
  }
  .contact-form .btn { width: 100%; justify-content: center; }
}

/* ═══════════════════════════
   FOOTER — MOBILE
═══════════════════════════ */
@media (max-width: 768px) {
  footer .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  footer .container { padding: 0 16px; }
  .footer-bottom {
    flex-direction: column;
    text-align: center;
    gap: 6px;
    padding: 12px 0;
  }
}

/* ═══════════════════════════
   CBT PORTAL — MOBILE
═══════════════════════════ */
@media (max-width: 768px) {
  /* Topbar */
  .cbt-topbar {
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 12px;
    min-height: unset;
  }
  .cbt-topbar-logo { font-size: 0.7rem; gap: 6px; }
  .cbt-logo-img { width: 28px; height: 28px; }
  .cbt-topbar-nav { gap: 4px; }
  .cbt-nav-pill { padding: 5px 8px; font-size: 0.72rem; }
  .cbt-topbar-right { gap: 6px; flex-wrap: wrap; font-size: 0.72rem; }

  /* Main content */
  .cbt-inner { padding: 0 12px; margin: 12px auto 24px; }
  .cbt-page-body { padding: 14px 12px; }
  .cbt-wrap h2 { font-size: 1.2rem; }

  /* Tabs scroll */
  .portal-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
    gap: 2px;
    padding-bottom: 2px;
    /* hide scrollbar visually */
    scrollbar-width: none;
  }
  .portal-tabs::-webkit-scrollbar { display: none; }
  .portal-tab { white-space: nowrap; font-size: 0.8rem; padding: 8px 12px; min-height: 40px; }

  /* Stats grid */
  .cbt-wrap .stat-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat-card { padding: 12px; }
  .stat-card .stat-num { font-size: 1.4rem; }

  /* Forms */
  .form-row, .form-row-3, .subject-select-wrap { grid-template-columns: 1fr !important; }

  /* Exam layout — stack sidebar below */
  .exam-layout { grid-template-columns: 1fr !important; gap: 14px; }
  .exam-sidebar { order: -1; } /* put palette ABOVE questions on mobile */

  /* Palette grid — bigger buttons for fingers */
  .palette-grid { gap: 6px; }
  .pal-btn { width: 36px !important; height: 36px !important; font-size: 0.78rem !important; }

  /* Exam nav buttons */
  .exam-nav { flex-wrap: wrap; gap: 6px; }
  .exam-nav .btn {
    flex: 1;
    min-width: 68px;
    font-size: 0.78rem;
    padding: 8px 6px;
    min-height: 44px;
  }

  /* Calculator */
  .calc-wrap { width: 100%; max-width: 100%; }
  .calc-toggle { width: 100%; min-height: 44px; }

  /* Tables */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table-wrap table { min-width: 500px; }

  /* File drop areas */
  .file-drop { padding: 20px 14px; }
  .fd-icon { font-size: 1.8rem; }
}

/* ═══════════════════════════
   CBT TERM SPLASH — MOBILE
═══════════════════════════ */
@media (max-width: 600px) {
  .cbt-splash-title { font-size: 1.5rem; }
  .cbt-splash-btns { flex-direction: column; align-items: center; gap: 10px; }
  .cbt-term-btn { width: 100%; max-width: 300px; padding: 16px 20px; }
}

/* ═══════════════════════════
   CBT LICENSE GATE — MOBILE
═══════════════════════════ */
@media (max-width: 600px) {
  #cbt-license-gate { padding: 16px; }
  .cbt-lg-card { padding: 20px 16px; }
  .cbt-lg-row { flex-direction: column; gap: 8px; }
  .cbt-lg-input, .cbt-lg-btn { width: 100%; min-height: 48px; }
}

/* ═══════════════════════════
   NOTES OF LESSON — MOBILE
═══════════════════════════ */
@media (max-width: 600px) {
  .notes-sidebar {
    width: 100% !important;
    min-width: unset !important;
    max-height: 120px;
    overflow-y: auto;
    border-right: none !important;
    border-bottom: 1px solid #DDE4EF;
  }
  .filter-group { min-width: 100% !important; }
}

/* ═══════════════════════════════════════════════════
   LOW-RAM ANDROID OPTIMISATION (1–2 GB devices)
   Reduces GPU memory usage and repaints
═══════════════════════════════════════════════════ */
@media (max-width: 768px) {
  /* Disable transform hover effects (cause repaints) */
  .school-card,
  .news-card,
  .cbt-feature,
  .btn-navy,
  .btn-gold,
  .btn-outline {
    transition: none !important;
    transform: none !important;
  }
  .school-card:hover,
  .news-card:hover { box-shadow: var(--shadow) !important; }

  /* Disable shimmer animations on CBT cards */
  .cbt-term-btn:hover { transform: none !important; }

  /* Reduce shadow complexity */
  .cbt-modal-box, .cbt-lg-card, .login-wrap {
    box-shadow: 0 4px 16px rgba(0,0,0,0.2) !important;
  }

  /* Prevent scroll-linked animations causing jank */
  .welcome-badge-float { position: static; margin: 12px 0 0 auto; display: inline-block; }

  /* Reduce hero overlay complexity */
  .hero::before { display: none; }

  /* Use simpler backgrounds for sections on mobile */
  .hero {
    background: linear-gradient(160deg,rgba(45,27,107,0.97) 0%,rgba(27,107,58,0.85) 100%) !important;
  }

  /* images: contain properly */
  img { max-width: 100%; height: auto; }
}

/* ═══════════════════════════════════
   EXTRA SMALL — 360px (common entry-level Android)
═══════════════════════════════════ */
@media (max-width: 380px) {
  .container { padding: 0 12px; }
  .hero h1 { font-size: 1.7rem; }
  .hero-stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .section-title { font-size: 1.5rem; }
  .cbt-wrap .stat-grid { grid-template-columns: 1fr 1fr; }

  /* Smaller touch targets are ok if they have enough spacing */
  .exam-nav .btn { font-size: 0.72rem; padding: 7px 4px; }
  .pal-btn { width: 30px !important; height: 30px !important; font-size: 0.68rem !important; }

  /* CBT login compact */
  .cbt-wrap .login-wrap { padding: 12px; }
  .cbt-wrap h2 { font-size: 1.1rem; }
}

/* ═══════════════════════════════════════════════
   CORDOVA / WEBVIEW: prevent text selection & zooms
═══════════════════════════════════════════════ */
body {
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
}
/* Re-enable selection where it makes sense */
input, textarea, pre, code, .subjects-list, .news-card-body p,
.welcome-section p, .contact-info span {
  -webkit-user-select: text;
  user-select: text;
}

/* ════════════════════════════
   SCROLL PERFORMANCE
════════════════════════════ */
.cbt-inner, .cbt-page-body, .table-wrap, .portal-tabs,
.notes-sidebar, .notes-book-body, .palette-grid {
  -webkit-overflow-scrolling: touch;
  will-change: scroll-position;
}

/* END MOBILE RESPONSIVE OVERHAUL */

/* ══════════════════════════════════════════════
   NOTES OF LESSON — BREADCRUMB NAVIGATION
══════════════════════════════════════════════ */
.nl-breadcrumb-bar {
  padding: 8px 16px;
  background: #f8faff;
  border-bottom: 1.5px solid #e2e8f0;
  display: flex;
  align-items: center;
  min-height: 38px;
  flex-shrink: 0;
}
.nl-breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px;
  font-size: 0.83rem;
}
.nl-bc-btn {
  background: none;
  border: none;
  color: #1558D6;
  font-family: inherit;
  font-size: 0.83rem;
  font-weight: 600;
  cursor: pointer;
  padding: 3px 6px;
  border-radius: 5px;
  transition: background 0.15s, color 0.15s;
}
.nl-bc-btn:hover {
  background: #e8efff;
  color: #0d2a6e;
  text-decoration: underline;
}
.nl-bc-sep {
  color: #9db3cc;
  font-size: 0.88rem;
  padding: 0 2px;
  user-select: none;
}
.nl-bc-current {
  color: #0D2144;
  font-weight: 600;
  font-size: 0.83rem;
  padding: 3px 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}
/* Teacher's View breadcrumb — purple tones */
.tv-breadcrumb-bar {
  background: #faf5ff;
  border-bottom-color: #e9d5ff;
}
.tv-bc {
  color: #7c3aed !important;
}
.tv-bc:hover {
  background: #f3e8ff !important;
  color: #5b21b6 !important;
}
/* Dark mode adjustments */
.notes-modal.dark .nl-breadcrumb-bar {
  background: #0e1f3d;
  border-bottom-color: #1e3a5f;
}
.notes-modal.dark .nl-bc-btn { color: #7aadff; }
.notes-modal.dark .nl-bc-btn:hover { background: #1a2f50; }
.notes-modal.dark .nl-bc-sep { color: #4a6a8a; }
.notes-modal.dark .nl-bc-current { color: #c0d8f0; }
/* Ensure notes-reader has proper flex layout for breadcrumb */
.notes-content-area {
  display: flex;
  flex: 1;
  overflow: hidden;
}
.notes-reader {
  display: flex;
  flex-direction: column;
}
/* Mobile responsiveness */
@media (max-width: 600px) {
  .nl-bc-current { max-width: 130px; }
  .nl-breadcrumb-bar { padding: 7px 10px; }
}


/* ═══════════════════════════════════════════════════════════════
   ANDROID WEBVIEW — FULL TOUCH-SCROLL FIX
   Ensures every CBT portal page is naturally swipeable on Android.
   All rules are scoped to #view-cbt to avoid touching the main site.
═══════════════════════════════════════════════════════════════ */

/* ── 1. Root scroll container: the full-screen modal body ── */
#view-cbt .cbt-modal-body {
  overflow-y: auto !important;
  overflow-x: hidden !important;
  -webkit-overflow-scrolling: touch !important;
  overscroll-behavior-y: contain;
  /* Occupy all remaining height below the topbar */
  flex: 1 1 auto !important;
  min-height: 0 !important;           /* required inside flexbox for overflow to work */
  height: auto !important;
}

/* ── 2. The cbt-modal-box must be a fixed-height flex column ── */
#view-cbt .cbt-modal-box {
  display: flex !important;
  flex-direction: column !important;
  height: 100vh !important;           /* full viewport height in the app */
  max-height: 100vh !important;
  overflow: hidden !important;        /* clip is fine here — scroll is on .cbt-modal-body */
}

/* ── 3. The topbar must never shrink (so it stays visible) ── */
#view-cbt .cbt-topbar {
  flex-shrink: 0 !important;
  position: sticky;
  top: 0;
  z-index: 100;
}

/* ── 4. cbt-inner and all page bodies: allow natural height ── */
#view-cbt .cbt-inner {
  overflow: visible !important;
  height: auto !important;
  min-height: unset !important;
  padding-bottom: 40px;               /* breathing room at the bottom */
}
#view-cbt .cbt-page {
  overflow: visible !important;       /* do NOT clip — let parent scroll */
  height: auto !important;
  min-height: unset !important;
}
#view-cbt .cbt-page.active {
  display: block !important;
}
#view-cbt .cbt-page-body {
  overflow: visible !important;
  height: auto !important;
}

/* ── 5. Allow touch-pan-y on every scrollable element in CBT ── */
#view-cbt,
#view-cbt .cbt-modal-body,
#view-cbt .cbt-inner,
#view-cbt .cbt-page,
#view-cbt .cbt-page-body {
  touch-action: pan-y !important;     /* finger swipe up/down = scroll */
}

/* ── 6. Horizontally scrollable sub-elements (keep pan-x too) ── */
#view-cbt .portal-tabs,
#view-cbt .table-wrap,
#view-cbt .cbt-wrap .table-wrap {
  touch-action: pan-x pan-y !important;
  -webkit-overflow-scrolling: touch !important;
}

/* ── 7. Buttons / interactive controls: manipulation only ── */
#view-cbt button,
#view-cbt .btn,
#view-cbt .tab-btn,
#view-cbt .portal-tab,
#view-cbt .option-btn,
#view-cbt .pal-btn {
  touch-action: manipulation !important;
}

/* ── 8. Exam layout: force single-column, no height clipping ── */
@media (max-width: 900px) {
  #view-cbt .exam-layout {
    display: flex !important;
    flex-direction: column !important;
    gap: 14px !important;
    height: auto !important;
    overflow: visible !important;
  }
  #view-cbt .exam-sidebar {
    order: -1;                         /* palette above questions */
    height: auto !important;
    overflow: visible !important;
  }
}

/* ── 9. Compact mobile layout (≤ 600 px / phone portrait) ── */
@media (max-width: 600px) {

  /* Topbar: two rows on small screens */
  #view-cbt .cbt-topbar {
    height: auto !important;
    flex-wrap: wrap !important;
    padding: 8px 10px !important;
    gap: 6px 8px !important;
  }
  #view-cbt .cbt-topbar-logo {
    font-size: 0.78rem !important;
  }
  #view-cbt .cbt-topbar-right {
    font-size: 0.72rem !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
  }
  #view-cbt .cbt-topbar-nav {
    gap: 4px !important;
  }
  #view-cbt .cbt-nav-pill .pill-label {
    display: none !important;           /* icon-only on tiny screens */
  }

  /* Inner padding */
  #view-cbt .cbt-inner {
    padding: 10px 10px 48px !important;
    margin: 8px auto !important;
  }
  #view-cbt .cbt-page-body {
    padding: 14px 12px !important;
  }

  /* Headings */
  #view-cbt .cbt-wrap h2 {
    font-size: 1.15rem !important;
  }

  /* Login */
  #view-cbt .login-wrap {
    max-width: 100% !important;
    padding: 0 !important;
  }
  #view-cbt .tab-row {
    flex-wrap: wrap !important;
  }

  /* Forms: one column */
  #view-cbt .form-row,
  #view-cbt .form-row-3,
  #view-cbt .subject-select-wrap {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  /* Inputs: large enough for fingers */
  #view-cbt input[type="text"],
  #view-cbt input[type="password"],
  #view-cbt input[type="number"],
  #view-cbt select,
  #view-cbt textarea {
    font-size: 1rem !important;         /* prevent iOS/Android zoom-on-focus */
    min-height: 44px !important;
    padding: 10px 12px !important;
  }

  /* Buttons */
  #view-cbt .btn,
  #view-cbt .cbt-btn {
    min-height: 44px !important;
    font-size: 0.88rem !important;
  }
  #view-cbt .btn-group {
    flex-direction: column !important;
    gap: 8px !important;
  }
  #view-cbt .btn-group .btn {
    width: 100% !important;
  }

  /* Portal tabs: horizontal scroll */
  #view-cbt .portal-tabs {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    flex-wrap: nowrap !important;
    scrollbar-width: none !important;
    padding-bottom: 2px !important;
  }
  #view-cbt .portal-tabs::-webkit-scrollbar {
    display: none !important;
  }
  #view-cbt .portal-tab {
    white-space: nowrap !important;
    font-size: 0.8rem !important;
    padding: 8px 12px !important;
    min-height: 44px !important;
  }

  /* Stat grid: 2-column */
  #view-cbt .stat-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
  }

  /* Tables: horizontal scroll */
  #view-cbt .table-wrap {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }
  #view-cbt .table-wrap table {
    min-width: 480px !important;
  }

  /* Exam question palette: bigger tap targets */
  #view-cbt .palette-grid {
    grid-template-columns: repeat(6, 1fr) !important;
    gap: 6px !important;
  }
  #view-cbt .pal-btn {
    width: 38px !important;
    height: 38px !important;
    font-size: 0.78rem !important;
  }

  /* Exam nav */
  #view-cbt .exam-nav {
    flex-wrap: wrap !important;
    gap: 8px !important;
  }
  #view-cbt .exam-nav .btn {
    flex: 1 !important;
    min-width: 64px !important;
    min-height: 44px !important;
    font-size: 0.8rem !important;
    padding: 8px 6px !important;
  }

  /* Option buttons: full-width, easy-to-tap */
  #view-cbt .option-btn {
    padding: 13px 14px !important;
    font-size: 0.9rem !important;
    min-height: 50px !important;
  }
}

/* ── 10. Very small phones (360 px wide entry-level Android) ── */
@media (max-width: 380px) {
  #view-cbt .cbt-inner {
    padding: 8px 8px 48px !important;
  }
  #view-cbt .cbt-page-body {
    padding: 12px 10px !important;
  }
  #view-cbt .pal-btn {
    width: 32px !important;
    height: 32px !important;
    font-size: 0.68rem !important;
  }
  #view-cbt .exam-nav .btn {
    font-size: 0.72rem !important;
    padding: 7px 4px !important;
  }
  #view-cbt .palette-grid {
    grid-template-columns: repeat(5, 1fr) !important;
  }
  #view-cbt .cbt-wrap h2 {
    font-size: 1rem !important;
  }
  #view-cbt input[type="text"],
  #view-cbt input[type="password"],
  #view-cbt input[type="number"],
  #view-cbt select {
    font-size: 0.95rem !important;
  }
}

/* ── 11. Fix body touch-action conflict ──
   The global body has touch-action:manipulation which blocks pan-y.
   Re-allow vertical panning while inside the CBT view.           ── */
body:has(#view-cbt.active) {
  touch-action: pan-y !important;
  overscroll-behavior: contain !important;
}

/* END ANDROID WEBVIEW TOUCH-SCROLL FIX */

/* ══════════════════════════════════════════════════════
   HOME VIEW — SCROLL + TOUCH + MOBILE RESPONSIVE FIX
   Targets: #view-home only (Home, About, Academics, News, Contact)
   Does NOT touch CBT, Notes, or any other view.
══════════════════════════════════════════════════════ */

/* 1. Allow vertical scroll & touch panning inside the home view */
#view-home {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch; /* iOS momentum scroll */
  touch-action: pan-y;               /* Android WebView vertical swipe */
  overscroll-behavior-y: contain;
}

/* 2. Ensure body allows pan-y when home view is active */
body:has(#view-home.active) {
  touch-action: pan-y;
  overscroll-behavior: contain;
}

/* 3. Mobile responsive — tablet (≤ 900px) */
@media (max-width: 900px) {
  /* Navbar: hide top strip contact info, keep logo + links */
  #view-home .top-strip .ts-items:last-child span:not(:last-child) {
    display: none;
  }

  /* Hero adjustments */
  #view-home .hero {
    min-height: auto;
    padding: 60px 0 50px;
  }
  #view-home .hero-content {
    max-width: 100%;
    text-align: center;
  }
  #view-home .hero-btns {
    justify-content: center;
  }
  #view-home .hero-stats {
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
  }

  /* Theme toggle: smaller */
  #view-home #theme-toggle-btn {
    top: 12px;
    left: 12px;
    padding: 7px 12px;
    font-size: 0.75rem;
  }

  /* About/Welcome grid */
  #view-home .welcome-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  #view-home .welcome-badge-float {
    right: 0;
    bottom: -14px;
  }

  /* Classes grid */
  #view-home .Academy-grid {
    grid-template-columns: 1fr 1fr;
  }

  /* Academics subjects grid */
  #view-home .subjects-grid {
    grid-template-columns: 1fr 1fr;
  }

  /* News grid */
  #view-home .news-grid {
    grid-template-columns: 1fr 1fr;
  }

  /* Contact grid */
  #view-home .contact-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  /* Footer */
  #view-home .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  /* CBT promo grid */
  #view-home .cbt-promo-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  #view-home .cbt-visual {
    display: none;
  }

  /* Stats strip */
  #view-home .stats-row {
    grid-template-columns: 1fr 1fr;
  }
}

/* 4. Mobile responsive — phone portrait (≤ 600px) */
@media (max-width: 600px) {

  /* Fix container padding */
  #view-home .container {
    padding: 0 16px;
  }

  /* Sections: reduce padding */
  #view-home .section,
  #view-home .welcome-section,
  #view-home .classes-section,
  #view-home .academics-section,
  #view-home .cbt-promo,
  #view-home footer {
    padding: 48px 0;
  }

  /* Top strip: hide left items */
  #view-home .top-strip .ts-items:first-child {
    display: none;
  }

  /* Hero */
  #view-home .hero {
    min-height: auto;
    padding: 48px 0 40px;
  }
  #view-home .hero h1 {
    font-size: clamp(2rem, 8vw, 2.8rem);
  }
  #view-home .hero p {
    font-size: 0.97rem;
  }
  #view-home .hero-btns {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  #view-home .hero-btns .btn,
  #view-home .hero-btns .cbt-hero-btn {
    justify-content: center;
    text-align: center;
  }
  #view-home .hero-stats {
    flex-direction: column;
    gap: 14px;
    align-items: center;
    text-align: center;
  }

  /* Theme panel: full width on mobile */
  #view-home #theme-panel {
    width: calc(100vw - 32px);
    right: 16px;
    left: 16px;
  }
  #view-home #theme-toggle-btn {
    top: 10px;
    left: 10px;
    padding: 6px 10px;
    font-size: 0.7rem;
    gap: 5px;
  }

  /* Section titles */
  #view-home .section-title {
    font-size: clamp(1.6rem, 6vw, 2.2rem);
  }

  /* About / Welcome */
  #view-home .welcome-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  #view-home .welcome-badge-float {
    position: relative;
    right: auto;
    bottom: auto;
    display: inline-block;
    margin-top: 16px;
  }
  #view-home .welcome-img {
    min-height: 200px !important;
  }

  /* Classes: single column */
  #view-home .Academy-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  /* Academics: single column */
  #view-home .subjects-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  /* News: single column */
  #view-home .news-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  /* Contact: single column */
  #view-home .contact-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  /* Contact form inputs: finger-friendly */
  #view-home .contact-form input,
  #view-home .contact-form textarea,
  #view-home .contact-form select {
    font-size: 1rem;
    min-height: 44px;
    padding: 10px 14px;
  }
  #view-home .contact-form textarea {
    min-height: 120px;
  }

  /* Footer */
  #view-home .footer-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  /* Stats strip: 2 columns */
  #view-home .stats-row {
    grid-template-columns: 1fr 1fr;
    gap: 0;
  }
  #view-home .stat-item {
    border-right: none;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding: 20px 16px;
    text-align: center;
  }

  /* CBT promo: single column */
  #view-home .cbt-promo-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  #view-home .cbt-features {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  /* Nav arrow control on mobile: bigger tap area */
  #view-home .nav-arrow-btn,
  .nav-arrow-btn {
    min-width: 44px;
    min-height: 44px;
    padding: 10px;
  }
}

/* 5. Very small phones (≤ 380px) */
@media (max-width: 380px) {
  #view-home .container {
    padding: 0 12px;
  }
  #view-home .hero h1 {
    font-size: 1.85rem;
  }
  #view-home .stats-row {
    grid-template-columns: 1fr;
  }
  #view-home .stat-item {
    border-bottom: 1px solid rgba(255,255,255,0.1);
  }
}

/* END HOME VIEW SCROLL + MOBILE FIX */

