/* ============================================================
   1. DESIGN TOKENS — "Daylight + Dim + Midnight Launch"
   ============================================================ */
:root {
  /* Brand */
  --brand-50:  #eef2ff; --brand-100: #e0e7ff; --brand-200: #c7d2fe;
  --brand-300: #a5b4fc; --brand-400: #818cf8; --brand-500: #6366f1;
  --brand-600: #4f46e5; --brand-700: #4338ca; --brand-800: #3730a3; --brand-900: #312e81;

  /* Accent */
  --accent-300: #67e8f9; --accent-400: #22d3ee; --accent-500: #06b6d4; --accent-600: #0891b2;

  /* Gold / Emerald / Rose */
  --gold-300: #fde68a; --gold-400: #fbbf24; --gold-500: #f59e0b; --gold-600: #d97706;
  --emerald-400: #34d399; --emerald-500: #10b981; --emerald-600: #059669;
  --rose-400: #fb7185; --rose-500: #ef4444; --rose-600: #dc2626; --rose-700: #b91c1c;

  --space-950: #070b1a; --space-900: #0b1226; --space-800: #131a3a;
  --space-700: #1e2547; --space-600: #2a3560;

  --radius-sm: 8px; --radius-md: 12px; --radius-lg: 16px;
  --radius-xl: 20px; --radius-2xl: 24px; --radius-pill: 999px;

  --ease: cubic-bezier(.4,0,.2,1);
  --ease-out: cubic-bezier(0,0,.2,1);
  --ease-spring: cubic-bezier(.34,1.56,.64,1);

  --gap-grid: 20px;
  --gap-card: 22px;
  --card-min-course: 300px;
  --card-min-professor: 240px;
  --card-min-testimonial: 260px;
  --card-min-student: 280px;

  /* ─── LIGHT THEME — "Daylight Aerospace" (warm, layered) ─── */
  --bg-page: #f6f4f1;
  --bg-page-accent-1: rgba(99,102,241,.10);
  --bg-page-accent-2: rgba(6,182,212,.07);
  --bg-surface: #ffffff;
  --bg-surface-2: #fafaf8;
  --bg-surface-3: #f1efeb;
  --bg-elevated: #ffffff;

  --border-subtle: #ebe7e0;
  --border-default: #ded9cf;
  --border-strong: #c4bdb0;

  --text-primary: #14161c;
  --text-secondary: #4a4d5a;
  --text-tertiary: #8b8d98;
  --text-inverse: #ffffff;

  --shadow-xs: 0 1px 2px rgba(20,22,28,.05);
  --shadow-sm: 0 1px 3px rgba(20,22,28,.08), 0 1px 2px rgba(20,22,28,.04);
  --shadow-md: 0 8px 20px rgba(20,22,28,.09), 0 2px 6px rgba(20,22,28,.05);
  --shadow-lg: 0 20px 48px rgba(20,22,28,.12), 0 8px 16px rgba(20,22,28,.06);
  --shadow-xl: 0 32px 72px rgba(20,22,28,.16);

  --header-bg: linear-gradient(135deg, #0a0e1f 0%, #131b3d 55%, #1f1a4d 100%);
  --header-border: rgba(129,140,248,.25);

  --font-sans: 'Inter', 'Segoe UI', system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
}

/* ─── DIM THEME — warm dark, easy on eyes at night ─── */
[data-theme="dim"] {
  --bg-page: #18181f;
  --bg-page-accent-1: rgba(99,102,241,.12);
  --bg-page-accent-2: rgba(6,182,212,.06);
  --bg-surface: #1f1f29;
  --bg-surface-2: #262632;
  --bg-surface-3: #2e2e3c;
  --bg-elevated: #262632;

  --border-subtle: #2a2a36;
  --border-default: #363644;
  --border-strong: #4a4a5a;

  --text-primary: #e4e5ec;
  --text-secondary: #a8aab8;
  --text-tertiary: #74768a;
  --text-inverse: #18181f;

  --shadow-xs: 0 1px 2px rgba(0,0,0,.35);
  --shadow-sm: 0 1px 3px rgba(0,0,0,.45);
  --shadow-md: 0 8px 20px rgba(0,0,0,.4);
  --shadow-lg: 0 20px 48px rgba(0,0,0,.45);
  --shadow-xl: 0 32px 72px rgba(0,0,0,.55);

  --header-bg: linear-gradient(135deg, #0d0d15 0%, #14142b 55%, #1c1240 100%);
  --header-border: rgba(129,140,248,.28);
}

/* ─── NIGHT THEME ("dark") — neutral dark grey · off-white text ·
       softer accents. Kept under the data-theme="dark" id so every
       existing [data-theme="dark"] component override keeps working. ─── */
[data-theme="dark"] {
  --bg-page: #101216;          /* page = darkest layer */
  --bg-page-accent-1: rgba(99,102,241,.10);   /* softened glows */
  --bg-page-accent-2: rgba(6,182,212,.06);
  --bg-surface: #181b20;       /* cards / app shell */
  --bg-surface-2: #1f2329;
  --bg-surface-3: #272c33;
  --bg-elevated: #1f2329;

  --border-subtle: #262b32;
  --border-default: #333a43;
  --border-strong: #47505c;

  --text-primary: #eceef1;     /* off-white, ~13:1 on --bg-surface */
  --text-secondary: #b6bac1;
  --text-tertiary: #868c96;
  --text-inverse: #101216;

  --shadow-xs: 0 1px 2px rgba(0,0,0,.50);
  --shadow-sm: 0 1px 3px rgba(0,0,0,.60);
  --shadow-md: 0 8px 20px rgba(0,0,0,.55);
  --shadow-lg: 0 20px 48px rgba(0,0,0,.60);
  --shadow-xl: 0 32px 72px rgba(0,0,0,.70);

  --header-bg: linear-gradient(135deg, #0c0e12 0%, #15181e 55%, #1d2129 100%);
  --header-border: rgba(255,255,255,.10);
}

/* ============================================================
   2. RESET & BASE
   ============================================================ */
*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  background:
    radial-gradient(1200px 700px at 15% -10%, var(--bg-page-accent-1), transparent 55%),
    radial-gradient(900px 550px at 100% 110%, var(--bg-page-accent-2), transparent 55%),
    var(--bg-page);
  background-attachment: fixed;
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  transition: background .35s var(--ease), color .35s var(--ease);
}
img { max-width: 100%; display: block; }
button { font-family: inherit; }
a { color: inherit; }
input, textarea, select { font-family: inherit; }
:focus-visible { outline: 2px solid var(--brand-500); outline-offset: 2px; border-radius: 4px; }

#app {
  width: 100%; max-width: 1280px; min-height: 100vh;
  margin: 0 auto; background: var(--bg-surface);
  display: flex; flex-direction: column;
  box-shadow: 0 0 0 1px var(--border-subtle);
  transition: background .35s var(--ease);
}

/* ============================================================
   3. HEADER — glass in dark, gradient in light/dim
   ============================================================ */
#appHeader {
  background: var(--header-bg);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  color: #fff; padding: 12px 28px;
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 12px;
  border-bottom: 1px solid var(--header-border);
  position: sticky; top: 0; z-index: 200;
}
[data-theme="dark"] #appHeader {
  background: rgba(16,18,22,.72);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-bottom: 1px solid rgba(129,140,248,.18);
}
[data-theme="dim"] #appHeader {
  background: rgba(24,24,31,.78);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
}
.brand { display:flex; align-items:center; gap:12px; min-width:0; }
.brand-icon {
  width: 42px; height: 42px;
  background: linear-gradient(135deg, var(--brand-600), var(--accent-500));
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 19px; color: #fff;
  box-shadow: 0 6px 18px rgba(99,102,241,.45);
  flex-shrink: 0;
}
.brand-text h1 { font-size: 16px; font-weight: 700; letter-spacing: -.2px; color: #fff; white-space: nowrap; line-height: 1.2; }
.brand-text span { font-weight: 500; font-size: 11.5px; color: rgba(255,255,255,.6); display: block; letter-spacing: .2px; }
.nav-toggle {
  display: none;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.15);
  color: #fff; border-radius: var(--radius-sm);
  font-size: 17px; cursor: pointer;
  width: 40px; height: 40px;
  align-items: center; justify-content: center;
  transition: .2s var(--ease);
}
.nav-toggle:hover { background: rgba(255,255,255,.18); }
.main-nav { display:flex; gap:4px; flex-wrap:wrap; }
.main-nav a {
  color: rgba(255,255,255,.78); text-decoration: none;
  padding: 8px 16px; border-radius: var(--radius-pill);
  font-size: 13.5px; font-weight: 500;
  transition: .2s var(--ease);
  display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
}
.main-nav a:hover { background: rgba(255,255,255,.1); color: #fff; }
.main-nav a.active {
  background: linear-gradient(135deg, var(--brand-500), var(--brand-600));
  color: #fff; font-weight: 600;
  box-shadow: 0 4px 14px rgba(99,102,241,.4);
}
.nav-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 999px; background: var(--gold-400); color: #422006;
  font-size: 11px; font-weight: 700; margin-left: 4px;
}
.user-info { display:flex; align-items:center; gap:10px; font-size: 14px; }
.icon-btn {
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14);
  color: #fff; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 14px; transition: .25s var(--ease-spring);
}
.icon-btn:hover { background: rgba(255,255,255,.18); }
.theme-toggle { position: relative; overflow: hidden; }
.theme-toggle i { transition: transform .5s var(--ease-spring); display: block; }
.theme-toggle:hover { transform: rotate(15deg) scale(1.05); }
.user-name { color: rgba(255,255,255,.92); font-weight: 500; font-size: 13.5px; }
.role-badge {
  padding: 4px 12px; border-radius: var(--radius-pill);
  font-size: 10.5px; text-transform: uppercase;
  letter-spacing: .7px; font-weight: 700;
  background: rgba(255,255,255,.12); color: #fff;
  border: 1px solid rgba(255,255,255,.14);
}
.role-badge.admin { background: linear-gradient(135deg, var(--gold-400), var(--gold-500)); color: #422006; border-color: transparent; box-shadow: 0 3px 10px rgba(245,158,11,.35); }
.role-badge.student { background: linear-gradient(135deg, var(--accent-400), var(--accent-500)); color: #083344; border-color: transparent; box-shadow: 0 3px 10px rgba(6,182,212,.35); }
.btn-logout {
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16);
  color: #fff; padding: 8px 14px; border-radius: var(--radius-sm);
  cursor: pointer; font-size: 13px; font-weight: 500;
  transition: .2s var(--ease);
  display: inline-flex; align-items: center; gap: 7px;
}
.btn-logout:hover { background: rgba(239,68,68,.25); border-color: rgba(239,68,68,.4); }

/* ============================================================
   4. MAIN
   ============================================================ */
.main-content { flex: 1; padding: 28px 32px 56px; background: transparent; }
.view { display: none; }
.view.active { display: block; animation: fadeIn .35s var(--ease); }
@keyframes fadeIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

/* ============================================================
   5. LOGIN
   ============================================================ */
.login-card {
  position: relative; max-width: 440px; margin: 6vh auto;
  background: var(--bg-surface); border-radius: var(--radius-2xl);
  padding: 42px 36px 34px;
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
}
.login-card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, var(--brand-500), var(--accent-500), var(--gold-500));
}
.login-icon {
  width: 72px; height: 72px; margin: 0 auto 18px;
  background: linear-gradient(135deg, var(--brand-600), var(--brand-500));
  border-radius: 20px;
  display: flex; align-items: center; justify-content: center;
  font-size: 30px; color: #fff;
  box-shadow: 0 12px 28px rgba(99,102,241,.38);
}
.login-card h2 { font-size: 22px; font-weight: 700; color: var(--text-primary); text-align: center; letter-spacing: -.3px; }
.login-card .sub { text-align: center; color: var(--text-tertiary); font-size: 13.5px; margin-bottom: 26px; margin-top: 6px; }
.login-role-toggle { display: flex; gap: 4px; margin-bottom: 22px; border-radius: var(--radius-md); background: var(--bg-surface-3); padding: 4px; }
.login-role-toggle button {
  flex: 1; padding: 10px 0; border: none; background: transparent;
  border-radius: var(--radius-sm); font-size: 13.5px; font-weight: 500;
  cursor: pointer; transition: .2s var(--ease); color: var(--text-tertiary);
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
}
.login-role-toggle button.active { background: var(--bg-surface); color: var(--brand-600); box-shadow: var(--shadow-sm); font-weight: 600; }
.login-footer { text-align: center; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--border-subtle); }
.link-inline {
  color: var(--brand-600); font-weight: 600; font-size: 13.5px;
  text-decoration: none; display: inline-flex; align-items: center; gap: 6px;
  transition: .2s var(--ease);
}
.link-inline:hover { color: var(--brand-700); }

/* ============================================================
   6. FORMS
   ============================================================ */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block; font-size: 12.5px; font-weight: 600;
  color: var(--text-secondary); margin-bottom: 7px; letter-spacing: .1px;
}
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 11px 14px;
  border: 1.5px solid var(--border-default);
  border-radius: var(--radius-sm); font-size: 14px;
  transition: .2s var(--ease); background: var(--bg-surface); color: var(--text-primary);
}
.form-group input::placeholder, .form-group textarea::placeholder { color: var(--text-tertiary); }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none; border-color: var(--brand-500);
  box-shadow: 0 0 0 4px rgba(99,102,241,.14);
}
.form-group textarea { resize: vertical; min-height: 84px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.input-wrap { position: relative; }
.input-wrap i {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--text-tertiary); font-size: 13px; pointer-events: none;
}
.input-wrap input { padding-left: 40px; }
.hint { font-size: 11.5px; color: var(--text-tertiary); display: block; margin-top: 4px; }
.password-field-row { display: flex; gap: 8px; align-items: stretch; }
.password-field-row input { flex: 1; }
.password-field-row .btn { white-space: nowrap; }

/* ============================================================
   7. BUTTONS
   ============================================================ */
.btn {
  padding: 10px 20px; border: none; border-radius: var(--radius-sm);
  font-size: 13.5px; font-weight: 600; cursor: pointer;
  transition: .2s var(--ease);
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; white-space: nowrap; line-height: 1.2; letter-spacing: .1px;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn-primary { background: linear-gradient(135deg, var(--brand-600), var(--brand-500)); color: #fff; box-shadow: 0 2px 8px rgba(99,102,241,.3); }
.btn-primary:hover { background: linear-gradient(135deg, var(--brand-700), var(--brand-600)); box-shadow: 0 8px 22px rgba(99,102,241,.4); transform: translateY(-1px); }
.btn-accent { background: linear-gradient(135deg, var(--accent-500), var(--accent-400)); color: #042f3a; font-weight: 700; box-shadow: 0 4px 14px rgba(6,182,212,.4); }
.btn-accent:hover { box-shadow: 0 10px 24px rgba(6,182,212,.5); transform: translateY(-2px); }
.btn-success { background: linear-gradient(135deg, var(--emerald-600), var(--emerald-500)); color: #fff; box-shadow: 0 2px 8px rgba(16,185,129,.25); }
.btn-success:hover { box-shadow: 0 8px 20px rgba(16,185,129,.35); transform: translateY(-1px); }
.btn-danger { background: linear-gradient(135deg, var(--rose-600), var(--rose-500)); color: #fff; }
.btn-danger:hover { background: linear-gradient(135deg, var(--rose-700), var(--rose-600)); }
.btn-warning { background: linear-gradient(135deg, var(--gold-500), var(--gold-400)); color: #422006; }
.btn-warning:hover { background: linear-gradient(135deg, var(--gold-600), var(--gold-500)); color: #fff; }
.btn-outline { background: transparent; border: 1.5px solid var(--border-default); color: var(--text-secondary); }
.btn-outline:hover { background: var(--bg-surface-3); border-color: var(--border-strong); color: var(--text-primary); }
.btn:disabled { opacity: .6; cursor: not-allowed; transform: none !important; }
.btn-lg { padding: 13px 28px; font-size: 14.5px; }
.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: 6px; }
.btn-block { width: 100%; }

/* Dark-mode neon glow on primaries */
[data-theme="dark"] .btn-primary {
  box-shadow: 0 0 0 1px rgba(129,140,248,.25), 0 8px 24px rgba(99,102,241,.35);
}
[data-theme="dark"] .btn-accent {
  box-shadow: 0 0 0 1px rgba(34,211,238,.3), 0 8px 24px rgba(6,182,212,.35);
}

/* ============================================================
   8. BADGES & CHIPS
   ============================================================ */
.premium-badge {
  display: inline-flex; align-items: center; gap: 4px;
  background: linear-gradient(135deg, var(--gold-400), var(--gold-500));
  color: #422006; font-size: 10.5px; font-weight: 800;
  padding: 3px 10px; border-radius: var(--radius-pill);
  text-transform: uppercase; letter-spacing: .5px;
  box-shadow: 0 3px 10px rgba(245,158,11,.3);
}
.premium-badge.premium-locked {
  background: linear-gradient(135deg, #94a3b8, #64748b);
  color: #fff; box-shadow: 0 3px 10px rgba(100,116,139,.3);
}
.status-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10px; font-weight: 800; padding: 3px 9px;
  border-radius: var(--radius-pill); letter-spacing: .5px; text-transform: uppercase;
}
.status-badge.draft { background: rgba(148,163,184,.2); color: #475569; }
[data-theme="dark"] .status-badge.draft, [data-theme="dim"] .status-badge.draft { color: #cbd5e1; }
.status-badge.published { background: rgba(16,185,129,.15); color: #059669; }
[data-theme="dark"] .status-badge.published, [data-theme="dim"] .status-badge.published { color: var(--emerald-400); }
.status-badge.archived { background: rgba(107,114,128,.15); color: #6b7280; }
[data-theme="dark"] .status-badge.archived, [data-theme="dim"] .status-badge.archived { color: #cbd5e1; }
.status-badge.featured { background: linear-gradient(135deg, var(--gold-400), var(--gold-500)); color: #422006; }

.chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: var(--radius-pill);
  font-size: 11px; font-weight: 600;
  background: var(--bg-surface-3); color: var(--text-secondary);
  letter-spacing: .2px;
}
.chip.gold { background: rgba(245,158,11,.15); color: var(--gold-600); }
[data-theme="dark"] .chip.gold, [data-theme="dim"] .chip.gold { background: rgba(245,158,11,.2); color: var(--gold-400); }
.chip.green { background: rgba(16,185,129,.15); color: var(--emerald-600); }
[data-theme="dark"] .chip.green, [data-theme="dim"] .chip.green { background: rgba(16,185,129,.2); color: var(--emerald-400); }

/* ============================================================
   9. DASHBOARD HEADERS
   ============================================================ */
.dash-header {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 12px; margin-bottom: 22px;
}
.dash-header h2 {
  font-size: 22px; font-weight: 700; color: var(--text-primary);
  display: flex; align-items: center; gap: 12px; letter-spacing: -.3px;
}
.dash-header h2 i {
  color: var(--brand-500); font-size: 20px;
  background: var(--brand-50);
  padding: 8px; border-radius: var(--radius-md);
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
}
[data-theme="dark"] .dash-header h2 i,
[data-theme="dim"] .dash-header h2 i { background: rgba(99,102,241,.15); }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }

.search-bar { position: relative; margin-bottom: 20px; max-width: 440px; }
.search-bar i {
  position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  color: var(--text-tertiary); font-size: 13px; pointer-events: none;
}
.search-bar input {
  width: 100%; padding: 11px 16px 11px 42px;
  border: 1.5px solid var(--border-default);
  border-radius: var(--radius-md); font-size: 14px;
  background: var(--bg-surface); color: var(--text-primary);
  transition: .2s var(--ease);
}
.search-bar input:focus {
  outline: none; border-color: var(--brand-500);
  box-shadow: 0 0 0 4px rgba(99,102,241,.12);
}

/* ============================================================
   10. FILTER BAR
   ============================================================ */
.filter-bar {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
  margin-bottom: 22px; padding: 14px 16px;
  background: var(--bg-surface); border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}
.filter-bar select {
  padding: 8px 12px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-default);
  background: var(--bg-surface); color: var(--text-primary);
  font-size: 13px; cursor: pointer; transition: .2s var(--ease);
}
.filter-bar select:focus { outline: none; border-color: var(--brand-500); }

/* ============================================================
   11. STAT CARDS
   ============================================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--gap-grid); margin-bottom: 26px;
  align-items: stretch;
}
.stat-card {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  border: 1px solid var(--border-subtle);
  display: flex; align-items: center; gap: 16px;
  transition: .3s var(--ease);
  position: relative; overflow: hidden;
  min-height: 100px;
}
.stat-card::before {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(circle at 100% 0%, rgba(99,102,241,.05), transparent 60%);
  opacity: 0; transition: opacity .3s var(--ease);
  pointer-events: none;
}
.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-default);
}
.stat-card:hover::before { opacity: 1; }

.stat-icon {
  width: 58px; height: 58px;
  border-radius: 16px;
  position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; flex-shrink: 0;
  transition: .35s var(--ease-spring);
}
.stat-icon::before {
  content: ""; position: absolute;
  top: -30%; left: -30%;
  width: 160%; height: 160%;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.35), transparent 55%);
  pointer-events: none;
}
.stat-icon::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(0,0,0,0) 55%, rgba(0,0,0,.12));
  pointer-events: none;
}
.stat-card:hover .stat-icon { transform: scale(1.1) rotate(-6deg); }
[data-theme="dark"] .stat-card:hover .stat-icon { filter: drop-shadow(0 0 16px currentColor); }

.stat-icon.tone-brand { background: linear-gradient(135deg, #818cf8, #4f46e5); color: #fff; box-shadow: 0 8px 20px rgba(99,102,241,.4), inset 0 1px 0 rgba(255,255,255,.3); }
.stat-icon.tone-cyan { background: linear-gradient(135deg, #22d3ee, #0891b2); color: #fff; box-shadow: 0 8px 20px rgba(6,182,212,.4), inset 0 1px 0 rgba(255,255,255,.3); }
.stat-icon.tone-gold { background: linear-gradient(135deg, #fbbf24, #d97706); color: #422006; box-shadow: 0 8px 20px rgba(245,158,11,.4), inset 0 1px 0 rgba(255,255,255,.35); }
.stat-icon.tone-emerald { background: linear-gradient(135deg, #34d399, #059669); color: #fff; box-shadow: 0 8px 20px rgba(16,185,129,.4), inset 0 1px 0 rgba(255,255,255,.3); }
.stat-icon.tone-rose { background: linear-gradient(135deg, #fb7185, #dc2626); color: #fff; box-shadow: 0 8px 20px rgba(239,68,68,.4), inset 0 1px 0 rgba(255,255,255,.3); }
.stat-info { flex: 1; min-width: 0; }
.stat-card .num { font-size: 28px; font-weight: 800; color: var(--text-primary); line-height: 1.05; letter-spacing: -.6px; }
.stat-card .label { font-size: 11.5px; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: .6px; font-weight: 600; margin-top: 3px; }

/* ============================================================
   12. QUICK ACTIONS
   ============================================================ */
.quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--gap-grid);
}
.quick-action-card {
  display: flex; align-items: center; gap: 14px;
  padding: 18px 20px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  cursor: pointer; text-align: left;
  font-family: inherit;
  transition: .25s var(--ease);
  color: var(--text-primary);
}
.quick-action-card:hover {
  transform: translateY(-3px);
  border-color: var(--brand-300);
  box-shadow: var(--shadow-md);
}
.qa-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
  position: relative; overflow: hidden;
}
.qa-icon::before {
  content: ""; position: absolute;
  top: -30%; left: -30%;
  width: 160%; height: 160%;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.3), transparent 55%);
}
.qa-icon.tone-brand { background: linear-gradient(135deg, #818cf8, #4f46e5); color: #fff; box-shadow: 0 6px 16px rgba(99,102,241,.35); }
.qa-icon.tone-gold { background: linear-gradient(135deg, #fbbf24, #d97706); color: #422006; box-shadow: 0 6px 16px rgba(245,158,11,.35); }
.qa-icon.tone-emerald { background: linear-gradient(135deg, #34d399, #059669); color: #fff; box-shadow: 0 6px 16px rgba(16,185,129,.35); }
.qa-info { flex: 1; min-width: 0; }
.qa-info strong { display: block; font-size: 14.5px; font-weight: 700; color: var(--text-primary); margin-bottom: 3px; }
.qa-info span { font-size: 12.5px; color: var(--text-tertiary); line-height: 1.4; }

/* ============================================================
   13. ADMIN TABS
   ============================================================ */
.admin-tabs {
  display: flex; gap: 6px;
  background: var(--bg-surface-3);
  border-radius: var(--radius-md);
  padding: 5px; margin-bottom: 22px;
  overflow-x: auto; scrollbar-width: none;
  border: 1px solid var(--border-subtle);
}
.admin-tabs::-webkit-scrollbar { display: none; }
.admin-tab {
  padding: 11px 20px;
  border: none; background: transparent;
  border-radius: var(--radius-sm);
  font-size: 13.5px; font-weight: 600;
  color: var(--text-tertiary);
  cursor: pointer;
  transition: .25s var(--ease-spring);
  display: inline-flex; align-items: center; gap: 8px;
  white-space: nowrap; flex-shrink: 0;
  position: relative;
}
.admin-tab i { font-size: 15px; transition: transform .25s var(--ease-spring); }
.admin-tab.active {
  background: var(--bg-surface);
  color: var(--brand-600);
  box-shadow: var(--shadow-sm);
}
.admin-tab.active i { transform: scale(1.12); }
.admin-tab:hover:not(.active) { color: var(--text-primary); }
.admin-tab:hover:not(.active) i { transform: scale(1.1) rotate(-5deg); }
.admin-tab-content { display: none; animation: fadeIn .3s var(--ease); }
.admin-tab-content.active { display: block; }

.tab-toolbar {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; margin-bottom: 20px; flex-wrap: wrap;
}
.tab-toolbar-text h3 {
  font-size: 17px; font-weight: 700; color: var(--text-primary);
  display: flex; align-items: center; gap: 10px; margin-bottom: 2px;
}
.tab-toolbar-text h3 i { color: var(--brand-500); }
.tab-toolbar-sub { font-size: 12.5px; color: var(--text-tertiary); font-weight: 500; }

/* ============================================================
   14. CARD GRIDS
   ============================================================ */
.course-grid, .professors-grid, .testimonials-slider,
.admin-professor-grid, .student-grid {
  display: grid; gap: var(--gap-grid); align-items: stretch;
}
.course-grid { grid-template-columns: repeat(auto-fill, minmax(var(--card-min-course), 1fr)); }
.professors-grid { grid-template-columns: repeat(auto-fill, minmax(var(--card-min-professor), 1fr)); }
.testimonials-slider { grid-template-columns: repeat(auto-fill, minmax(var(--card-min-testimonial), 1fr)); }
.admin-professor-grid { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.student-grid { grid-template-columns: repeat(auto-fill, minmax(var(--card-min-student), 1fr)); }

/* ============================================================
   15. COURSE CARDS
   ============================================================ */
.course-card {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  padding: var(--gap-card);
  transition: .25s var(--ease);
  cursor: pointer; position: relative;
  box-shadow: var(--shadow-xs);
  display: flex; flex-direction: column;
  overflow: hidden; min-height: 260px;
}
.course-card.has-thumb { padding-top: 0; min-height: 320px; }
.course-card::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--accent-1, var(--brand-500)), var(--accent-2, var(--accent-500)));
  transform: translateY(-100%);
  transition: transform .3s var(--ease);
  z-index: 3;
}
.course-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 14px 34px var(--accent-glow, rgba(99,102,241,.25)), 0 4px 10px rgba(15,23,42,.05);
  border-color: color-mix(in srgb, var(--accent-solid, #6366f1) 40%, transparent);
}
.course-card:hover::before { transform: translateY(0); }
[data-theme="dark"] .course-card:hover {
  box-shadow: 0 20px 48px rgba(0,0,0,.6),
              0 0 0 1px var(--accent-solid, #6366f1),
              0 0 32px -8px var(--accent-glow, rgba(99,102,241,.5));
}
.course-thumb {
  margin: -1px calc(var(--gap-card) * -1) 16px;
  height: 140px; overflow: hidden;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  position: relative;
}
.course-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s var(--ease); }
.course-card:hover .course-thumb img { transform: scale(1.04); }
.course-card .course-code {
  font-size: 11px; font-weight: 700;
  color: var(--accent-solid, var(--brand-600));
  text-transform: uppercase; letter-spacing: .8px;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: 6px;
}
.course-card h3 {
  font-size: 16.5px; font-weight: 700;
  color: var(--text-primary); margin: 0 0 10px;
  line-height: 1.3; letter-spacing: -.2px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.course-card .course-meta {
  font-size: 12.5px; color: var(--text-tertiary);
  display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 10px;
}
.course-card .course-meta span { display: inline-flex; align-items: center; gap: 5px; }
.course-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.course-card .course-desc {
  font-size: 13px; color: var(--text-tertiary);
  margin: 4px 0 12px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.5;
}
.material-count {
  font-size: 11.5px;
  color: var(--accent-solid, var(--brand-700));
  background: var(--accent-soft, var(--brand-50));
  padding: 4px 12px; border-radius: var(--radius-pill);
  display: inline-block; font-weight: 600; align-self: flex-start;
}
[data-theme="dark"] .material-count,
[data-theme="dim"] .material-count {
  background: var(--accent-soft, rgba(99,102,241,.15));
  color: var(--accent-solid, var(--brand-300));
}
.course-progress { margin-top: auto; padding-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.course-progress-bar {
  width: 100%; height: 6px;
  background: var(--bg-surface-3); border-radius: 999px;
  overflow: hidden; position: relative;
}
.course-progress-bar > div {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-1, var(--brand-500)), var(--accent-2, var(--accent-500)));
  border-radius: 999px; transition: width .4s var(--ease);
}
.course-progress-text { font-size: 11.5px; color: var(--text-tertiary); font-weight: 600; letter-spacing: .2px; }
.card-actions {
  margin-top: auto; display: flex; gap: 8px; flex-wrap: wrap;
  padding-top: 14px; border-top: 1px solid var(--border-subtle);
}
.delete-course-btn {
  position: absolute; top: 14px; right: 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-tertiary);
  cursor: pointer; font-size: 12px;
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: .2s var(--ease); z-index: 4;
}
.delete-course-btn:hover { color: #fff; background: var(--rose-500); border-color: var(--rose-500); }
.admin-alert {
  background: rgba(239,68,68,.08);
  border: 1px solid rgba(239,68,68,.25);
  color: var(--rose-600);
  padding: 8px 12px; border-radius: var(--radius-sm);
  margin-bottom: 12px;
  display: flex; justify-content: space-between; align-items: center;
  gap: 8px; font-size: 12.5px;
}
.admin-alert span { font-weight: 600; }
.admin-alert button {
  background: var(--rose-500); color: #fff; border: none;
  padding: 5px 10px; border-radius: 6px;
  font-size: 11.5px; cursor: pointer; font-weight: 700;
  display: inline-flex; align-items: center; gap: 4px;
}
.bookmark-btn {
  position: absolute; top: 14px; left: 14px;
  width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface); color: var(--text-tertiary);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  transition: .25s var(--ease-spring); z-index: 4; opacity: 0.85;
}
.bookmark-btn:hover { opacity: 1; background: var(--gold-300); color: #422006; border-color: var(--gold-400); transform: scale(1.1); }
.bookmark-btn.saved {
  opacity: 1;
  background: linear-gradient(135deg, var(--gold-400), var(--gold-500));
  color: #422006; border-color: transparent;
  box-shadow: 0 3px 10px rgba(245,158,11,.35);
}

/* ============================================================
   16. CONTINUE CARD
   ============================================================ */
.continue-card {
  display: flex; align-items: center; gap: 20px;
  background: var(--bg-surface); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl); padding: 20px 24px;
  margin-bottom: 24px; position: relative; overflow: hidden;
  box-shadow: var(--shadow-sm); transition: .25s var(--ease);
}
.continue-card::before {
  content: ""; position: absolute; top: 0; left: 0; bottom: 0; width: 4px;
  background: linear-gradient(180deg, var(--accent-1, var(--brand-500)), var(--accent-2, var(--accent-500)));
}
.continue-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.continue-icon {
  width: 56px; height: 56px; border-radius: var(--radius-md);
  background: var(--accent-soft, rgba(99,102,241,.12));
  color: var(--accent-solid, var(--brand-600));
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; flex-shrink: 0;
}
.continue-info { flex: 1; min-width: 0; }
.continue-label {
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .8px;
  color: var(--accent-solid, var(--brand-600));
  display: inline-flex; align-items: center; gap: 6px;
}
.continue-info h3 {
  font-size: 17px; font-weight: 700; color: var(--text-primary);
  margin: 4px 0; letter-spacing: -.2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.continue-info p { font-size: 13px; color: var(--text-tertiary); }
.continue-btn { flex-shrink: 0; }

/* ============================================================
   17. COURSE EDITOR
   ============================================================ */
.editor-hero {
  position: relative; background: var(--bg-surface);
  border-radius: var(--radius-lg); border: 1px solid var(--border-subtle);
  padding: 24px 28px; margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 20px; flex-wrap: wrap; overflow: hidden;
}
.editor-hero::before {
  content: ""; position: absolute; top: 0; left: 0; bottom: 0; width: 5px;
  background: linear-gradient(180deg, var(--accent-1, var(--brand-500)), var(--accent-2, var(--accent-500)));
}
.editor-hero-left { flex: 1; min-width: 0; }
.editor-hero-right { display: flex; gap: 8px; flex-shrink: 0; }
.editor-breadcrumb { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.editor-breadcrumb .course-code {
  font-size: 11px; font-weight: 700;
  color: var(--accent-solid, var(--brand-600));
  text-transform: uppercase; letter-spacing: .8px;
}
.editor-hero h2 {
  font-size: 24px; font-weight: 800; color: var(--text-primary);
  letter-spacing: -.4px; margin-bottom: 10px; line-height: 1.2;
}
.editor-meta { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--text-tertiary); }
.editor-meta span { display: inline-flex; align-items: center; gap: 6px; }
.editor-tabs {
  display: flex; gap: 4px;
  background: var(--bg-surface-3);
  border-radius: var(--radius-md);
  padding: 4px; margin-bottom: 20px;
  overflow-x: auto; scrollbar-width: none;
  border: 1px solid var(--border-subtle);
}
.editor-tabs::-webkit-scrollbar { display: none; }
.editor-tab {
  padding: 11px 22px; border: none; background: transparent;
  border-radius: var(--radius-sm);
  font-size: 13.5px; font-weight: 600;
  color: var(--text-tertiary); cursor: pointer;
  transition: .2s var(--ease);
  display: inline-flex; align-items: center; gap: 8px;
  white-space: nowrap; flex-shrink: 0;
}
.editor-tab.active { background: var(--bg-surface); color: var(--brand-600); box-shadow: var(--shadow-sm); }
.editor-tab:hover:not(.active) { color: var(--text-primary); }
.editor-body { display: flex; flex-direction: column; gap: 20px; }
.editor-section {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px 26px; box-shadow: var(--shadow-xs);
}
.editor-section-header {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; flex-wrap: wrap; margin-bottom: 12px;
}
.editor-section-title {
  font-size: 15px; font-weight: 700; color: var(--text-primary);
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 16px; letter-spacing: -.1px;
}
.editor-section-title i {
  color: var(--brand-500); font-size: 14px;
  background: var(--brand-50); padding: 7px;
  border-radius: var(--radius-sm);
  width: 30px; height: 30px;
  display: inline-flex; align-items: center; justify-content: center;
}
[data-theme="dark"] .editor-section-title i,
[data-theme="dim"] .editor-section-title i { background: rgba(99,102,241,.15); }
.editor-hint {
  font-size: 12.5px; color: var(--text-tertiary);
  margin-bottom: 10px; display: block; line-height: 1.5;
}
.editor-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.editor-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.editor-footer {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; flex-wrap: wrap;
  padding: 20px 24px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  position: sticky; bottom: 16px;
  box-shadow: var(--shadow-lg); z-index: 10;
}
.editor-footer-left { flex: 1; min-width: 0; }
.editor-footer-left .editor-hint { margin: 0; }
.editor-footer-right { display: flex; gap: 10px; flex-shrink: 0; }
.thumbnail-editor { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.thumbnail-preview {
  width: 200px; height: 120px; object-fit: cover;
  border-radius: var(--radius-md); border: 1px solid var(--border-subtle);
}
.thumbnail-preview-empty {
  width: 200px; height: 120px; border-radius: var(--radius-md);
  border: 2px dashed var(--border-default);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: var(--text-tertiary); font-size: 12px; gap: 6px;
  background: var(--bg-surface-2);
}
.thumbnail-preview-empty i { font-size: 24px; opacity: .5; }
.thumbnail-actions { display: flex; flex-direction: column; gap: 8px; }

.material-editor {
  background: var(--bg-surface); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md); margin-bottom: 12px;
  overflow: hidden; transition: .2s var(--ease);
}
.material-editor[open] { border-color: var(--brand-300); box-shadow: var(--shadow-md); }
[data-theme="dark"] .material-editor[open],
[data-theme="dim"] .material-editor[open] { border-color: var(--brand-500); }
.material-editor summary {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 18px; cursor: pointer; list-style: none;
  background: var(--bg-surface-2); transition: .15s var(--ease);
  user-select: none;
}
.material-editor summary::-webkit-details-marker { display: none; }
.material-editor summary:hover { background: var(--bg-surface-3); }
.material-editor[open] summary { background: var(--bg-surface); border-bottom: 1px solid var(--border-subtle); }
.me-summary-left {
  display: flex; align-items: center; gap: 10px;
  flex-wrap: wrap; flex: 1; min-width: 0;
}
.me-summary-left strong {
  font-size: 14.5px; font-weight: 700; color: var(--text-primary);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0;
}
.me-index {
  font-size: 11px; font-weight: 800;
  color: var(--text-tertiary); background: var(--bg-surface-3);
  padding: 2px 8px; border-radius: var(--radius-pill);
}
.me-summary-right { display: flex; align-items: center; gap: 8px; }
.me-chevron { color: var(--text-tertiary); transition: transform .2s var(--ease); font-size: 13px; }
.material-editor[open] .me-chevron { transform: rotate(180deg); }
.me-body { padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.me-file-section label {
  font-size: 12.5px; font-weight: 600; color: var(--text-secondary);
  display: block; margin-bottom: 6px;
}
.me-file-info {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; background: var(--bg-surface-2);
  border-radius: var(--radius-sm); font-size: 13px;
  color: var(--text-secondary);
}
.me-file-info.empty { color: var(--text-tertiary); font-style: italic; }
.me-file-info i { color: var(--brand-500); }
.me-file-info button { margin-left: auto; }
.me-quiz-section {
  background: rgba(99,102,241,.05);
  border: 1px solid rgba(99,102,241,.2);
  border-radius: var(--radius-md); padding: 14px 16px;
}
[data-theme="dark"] .me-quiz-section,
[data-theme="dim"] .me-quiz-section { background: rgba(99,102,241,.1); }
.me-quiz-header {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; flex-wrap: wrap;
}
.me-quiz-header h4 {
  font-size: 14px; font-weight: 700; color: var(--brand-700);
  display: flex; align-items: center; gap: 8px; margin: 0;
}
[data-theme="dark"] .me-quiz-header h4,
[data-theme="dim"] .me-quiz-header h4 { color: var(--brand-300); }
.me-actions {
  display: flex; gap: 10px; justify-content: flex-end;
  padding-top: 12px; border-top: 1px dashed var(--border-default);
  flex-wrap: wrap;
}
.ann-list { display: flex; flex-direction: column; gap: 12px; }
.ann-card {
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--brand-500);
  border-radius: var(--radius-md);
  padding: 14px 18px;
}
.ann-card.compact { padding: 12px 16px; border-left-width: 3px; }
.ann-card-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 12px; margin-bottom: 8px;
}
.ann-card-head strong { font-size: 14.5px; font-weight: 700; color: var(--text-primary); display: block; }
.ann-meta { font-size: 11.5px; color: var(--text-tertiary); display: block; margin-top: 3px; }
.ann-body { font-size: 13.5px; color: var(--text-secondary); line-height: 1.55; margin: 0; white-space: pre-wrap; }
.ann-delete {
  background: transparent; border: none; color: var(--text-tertiary);
  cursor: pointer; width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: .2s var(--ease); flex-shrink: 0;
}
.ann-delete:hover { background: var(--rose-500); color: #fff; }

/* ============================================================
   18. COURSE DETAIL
   ============================================================ */
.back-link {
  display: inline-flex; align-items: center; gap: 7px;
  color: var(--brand-600); cursor: pointer;
  font-weight: 600; font-size: 13.5px;
  margin-bottom: 18px; transition: .2s var(--ease);
  background: none; border: none;
  padding: 6px 12px 6px 8px; border-radius: var(--radius-sm);
}
.back-link:hover { color: var(--brand-700); background: var(--brand-50); transform: translateX(-3px); }
[data-theme="dark"] .back-link:hover,
[data-theme="dim"] .back-link:hover { background: rgba(99,102,241,.12); }
.course-detail-header {
  background: var(--bg-surface); border-radius: var(--radius-lg);
  padding: 0; margin-bottom: 22px;
  box-shadow: var(--shadow-xs); position: relative; overflow: hidden;
  display: flex; flex-direction: column;
}
.course-detail-header::before {
  content: ""; position: absolute; top: 0; left: 0; bottom: 0; width: 4px;
  background: linear-gradient(180deg, var(--accent-1, var(--brand-500)), var(--accent-2, var(--accent-500)));
}
.cd-thumb { width: 100%; height: 200px; object-fit: cover; }
.cd-content { padding: 24px 28px; }
.course-detail-header h2 {
  font-size: 22px; font-weight: 700; color: var(--text-primary);
  line-height: 1.3; letter-spacing: -.3px; margin-bottom: 12px;
}
.cd-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.course-detail-header .meta {
  color: var(--text-tertiary); font-size: 13px;
  margin-top: 10px; display: flex; gap: 18px; flex-wrap: wrap;
}
.course-detail-header .meta span { display: inline-flex; align-items: center; gap: 6px; }
.course-detail-header .detail-desc { margin-top: 10px; color: var(--text-secondary); font-size: 14px; line-height: 1.6; }
.premium-notice {
  background: linear-gradient(135deg, rgba(245,158,11,.1), rgba(251,191,36,.05));
  color: var(--gold-600); padding: 14px 18px;
  border-radius: var(--radius-md); margin-bottom: 20px;
  border: 1px solid rgba(245,158,11,.25);
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; flex-wrap: wrap; font-size: 13.5px; font-weight: 500;
}
.premium-notice > div { display: flex; align-items: center; gap: 8px; }
.learning-outcomes {
  background: linear-gradient(135deg, rgba(16,185,129,.06), rgba(52,211,153,.02));
  border: 1px solid rgba(16,185,129,.25);
  border-radius: var(--radius-lg); padding: 20px 24px; margin-bottom: 20px;
}
.learning-outcomes h3 {
  font-size: 15px; font-weight: 700; color: var(--emerald-700);
  display: flex; align-items: center; gap: 10px; margin-bottom: 14px;
}
[data-theme="dark"] .learning-outcomes h3,
[data-theme="dim"] .learning-outcomes h3 { color: var(--emerald-400); }
.learning-outcomes ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.learning-outcomes li {
  font-size: 13.5px; color: var(--text-secondary);
  display: flex; align-items: flex-start; gap: 10px; line-height: 1.5;
}
.learning-outcomes li i { color: var(--emerald-500); flex-shrink: 0; margin-top: 3px; }
.course-announcements {
  background: var(--bg-surface); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg); padding: 20px 22px; margin-bottom: 20px;
}
.course-announcements h3 {
  font-size: 15px; font-weight: 700; color: var(--text-primary);
  display: flex; align-items: center; gap: 10px; margin-bottom: 14px;
}
.material-tabs {
  display: flex; gap: 6px; flex-wrap: nowrap;
  margin-bottom: 20px; overflow-x: auto;
  scrollbar-width: none; padding-bottom: 4px;
}
.material-tabs::-webkit-scrollbar { display: none; }
.material-tabs button {
  padding: 8px 16px; border: 1.5px solid var(--border-subtle);
  background: var(--bg-surface); border-radius: var(--radius-pill);
  font-size: 13px; font-weight: 600; color: var(--text-tertiary);
  cursor: pointer; transition: .2s var(--ease);
  white-space: nowrap; flex-shrink: 0;
  display: inline-flex; align-items: center; gap: 6px;
}
.material-tabs button.active {
  background: linear-gradient(135deg, var(--brand-600), var(--brand-500));
  color: #fff; border-color: transparent;
  box-shadow: 0 4px 12px rgba(99,102,241,.3);
}
.material-tabs button:hover:not(.active) { color: var(--text-primary); border-color: var(--border-strong); }

/* ============================================================
   19. MATERIAL LIST
   ============================================================ */
.material-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--gap-grid); align-items: stretch;
}
.material-item {
  background: var(--bg-surface); border-radius: var(--radius-md);
  padding: 16px 18px; border: 1px solid var(--border-subtle);
  transition: .2s var(--ease); position: relative;
  display: flex; flex-direction: column; min-height: 180px;
}
.material-item:hover { border-color: var(--brand-200); box-shadow: var(--shadow-md); transform: translateY(-2px); }
[data-theme="dark"] .material-item:hover,
[data-theme="dim"] .material-item:hover { border-color: var(--brand-500); }
.material-item.locked-mat { background: var(--bg-surface-2); border-style: dashed; }
.mat-head { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; flex-wrap: wrap; }
.mat-type {
  font-size: 10px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .7px;
  color: #fff; padding: 3px 10px;
  border-radius: var(--radius-pill); display: inline-block;
  /* fallback for user-defined custom types */
  background: linear-gradient(135deg, #6b7280, #9ca3af);
}
/* ---- Material type badges — one colour per type ---- */
.mat-type.video           { background: linear-gradient(135deg, #2563eb, #3b82f6); }
.mat-type.notes           { background: linear-gradient(135deg, #059669, #10b981); }
.mat-type.slides          { background: linear-gradient(135deg, #d97706, #f59e0b); }
.mat-type.mid-pyq         { background: linear-gradient(135deg, #7c3aed, #a855f7); }
.mat-type.end-pyq         { background: linear-gradient(135deg, #6d28d9, #c084fc); }
.mat-type.class-test      { background: linear-gradient(135deg, #be185d, #ec4899); }
.mat-type.mid-sol         { background: linear-gradient(135deg, #0891b2, #22d3ee); }
.mat-type.end-sol         { background: linear-gradient(135deg, #0e7490, #06b6d4); }
.mat-type.class-test-sol  { background: linear-gradient(135deg, #be185d, #f472b6); }
.mat-type.lab-manual      { background: linear-gradient(135deg, #4338ca, #6366f1); }
.mat-type.lab-report      { background: linear-gradient(135deg, #0369a1, #0ea5e9); }
.mat-type.book            { background: linear-gradient(135deg, #92400e, #f59e0b); }
/* Legacy — kept for backward compatibility */
.mat-type.tutorial        { background: linear-gradient(135deg, var(--emerald-600), var(--emerald-500)); }
.mat-type.pyq             { background: linear-gradient(135deg, #7c3aed, #a855f7); }
.mat-type.qa              { background: linear-gradient(135deg, #0e7490, #06b6d4); }
.mat-type.other           { background: linear-gradient(135deg, #6b7280, #9ca3af); }
.mat-badge { font-size: 10px; font-weight: 700; padding: 3px 8px; border-radius: var(--radius-pill); letter-spacing: .3px; }
.mat-badge.premium { background: var(--gold-500); color: #422006; }
/* ⭐ NEW: Unlocked badge — shown to students who already paid/subscribed */
.mat-badge.unlocked {
  background: linear-gradient(135deg, var(--emerald-500), var(--emerald-400));
  color: #062a1e;
  box-shadow: 0 2px 8px rgba(16,185,129,.35);
}
[data-theme="dark"] .mat-badge.unlocked,
[data-theme="dim"]   .mat-badge.unlocked {
  color: #042019;
}
/* ⭐ NEW: Course-locked badge (course premium, material itself not premium) */
.mat-badge.course-locked {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  box-shadow: 0 2px 8px rgba(99,102,241,.35);
}

/* ⭐ NEW: Unlocked badge (student already owns access) */
.mat-badge.unlocked {
  background: linear-gradient(135deg, #10b981, #34d399);
  color: #062a1e;
  box-shadow: 0 2px 8px rgba(16,185,129,.35);
}
[data-theme="dark"] .mat-badge.unlocked,
[data-theme="dim"]   .mat-badge.unlocked {
  color: #042019;
}
.mat-badge.free { background: rgba(16,185,129,.15); color: var(--emerald-600); }
[data-theme="dark"] .mat-badge.free,
[data-theme="dim"] .mat-badge.free { background: rgba(16,185,129,.2); color: var(--emerald-400); }
.mat-quiz-badge {
  font-size: 10px; font-weight: 700;
  padding: 3px 9px; border-radius: var(--radius-pill);
  background: rgba(99,102,241,.12); color: var(--brand-600);
  display: inline-flex; align-items: center; gap: 4px;
}
[data-theme="dark"] .mat-quiz-badge,
[data-theme="dim"] .mat-quiz-badge { background: rgba(99,102,241,.22); color: var(--brand-300); }
.material-item h4 { font-size: 14.5px; font-weight: 700; color: var(--text-primary); margin: 8px 0 6px; line-height: 1.35; }
.mat-desc {
  font-size: 12.5px; color: var(--text-tertiary);
  margin-bottom: 10px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; line-height: 1.5;
}
.mat-actions { margin-top: auto; display: flex; gap: 8px; flex-wrap: wrap; padding-top: 10px; }

/* ============================================================
   20. Q&A
   ============================================================ */
.qa-section { padding: 22px 24px; background: var(--bg-surface); border-radius: var(--radius-lg); border: 1px solid var(--border-subtle); }
.qa-section > h3 {
  margin-bottom: 18px; color: var(--text-primary);
  font-size: 16px; font-weight: 700;
  display: flex; align-items: center; gap: 10px;
}
.qa-section > h3 i { color: var(--brand-500); }
.qa-ask-box { margin-bottom: 24px; background: var(--bg-surface-2); padding: 16px; border-radius: var(--radius-md); border: 1px solid var(--border-subtle); }
.qa-ask-box label { font-weight: 600; color: var(--text-primary); display: block; margin-bottom: 8px; font-size: 13.5px; }
.qa-ask-box textarea {
  width: 100%; padding: 12px;
  border: 1.5px solid var(--border-default);
  border-radius: var(--radius-sm); min-height: 84px;
  margin-bottom: 10px; font-size: 14px;
  background: var(--bg-surface); color: var(--text-primary);
  resize: vertical;
}
.qa-ask-box textarea:focus { outline: none; border-color: var(--brand-500); box-shadow: 0 0 0 4px rgba(99,102,241,.14); }
.qa-item {
  background: var(--bg-surface); padding: 16px;
  margin-bottom: 14px; border-left: 4px solid var(--gold-500);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-xs);
  border: 1px solid var(--border-subtle);
}
.qa-item.solved { border-left-color: var(--emerald-500); }
.qa-item.pending { border-left-color: var(--gold-500); }
.qa-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; flex-wrap: wrap; gap: 10px; }
.qa-head strong { color: var(--text-primary); font-size: 14.5px; display: inline-flex; align-items: center; gap: 6px; }
.qa-username { color: var(--text-tertiary); font-size: 12.5px; font-weight: 400; margin-left: 4px; }
.qa-email { font-size: 12px; color: var(--text-tertiary); margin-top: 3px; }
.qa-status { font-size: 10px; padding: 3px 8px; border-radius: var(--radius-pill); font-weight: 800; letter-spacing: .5px; }
.qa-status.solved { background: var(--emerald-500); color: #fff; }
.qa-status.pending { background: var(--gold-500); color: #422006; }
.qa-date { font-size: 11px; color: var(--text-tertiary); margin-left: 8px; }
.qa-question {
  margin: 8px 0; color: var(--text-secondary);
  font-size: 13.5px; background: var(--bg-surface-2);
  padding: 10px 12px; border-radius: var(--radius-sm); line-height: 1.55;
}
.qa-answer {
  background: rgba(99,102,241,.08); padding: 12px;
  border-radius: var(--radius-sm); color: var(--brand-700);
  margin-top: 10px; font-size: 13.5px;
  border-left: 3px solid var(--brand-500); line-height: 1.55;
}
[data-theme="dark"] .qa-answer,
[data-theme="dim"] .qa-answer { background: rgba(99,102,241,.14); color: var(--brand-300); }
.qa-replies {
  margin-top: 12px; padding-left: 8px;
  border-left: 2px solid var(--border-subtle);
  display: flex; flex-direction: column; gap: 10px;
}
.qa-reply {
  padding: 10px 12px; background: var(--bg-surface-2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  position: relative;
}
.qa-reply.admin-reply { background: rgba(99,102,241,.06); border-color: rgba(99,102,241,.25); border-left: 3px solid var(--brand-500); }
[data-theme="dark"] .qa-reply.admin-reply,
[data-theme="dim"] .qa-reply.admin-reply { background: rgba(99,102,241,.12); }
.qa-reply.accepted { background: rgba(16,185,129,.06); border-color: rgba(16,185,129,.3); }
[data-theme="dark"] .qa-reply.accepted,
[data-theme="dim"] .qa-reply.accepted { background: rgba(16,185,129,.12); }
.qa-reply-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 5px; font-size: 12.5px; }
.qa-reply-head strong { color: var(--text-primary); display: inline-flex; align-items: center; gap: 5px; font-weight: 700; }
.qa-reply-tag {
  font-size: 10px; font-weight: 800;
  padding: 2px 8px; border-radius: var(--radius-pill);
  background: var(--brand-500); color: #fff;
  letter-spacing: .4px; text-transform: uppercase;
}
.qa-reply-tag.accepted-tag { background: var(--emerald-500); }
.qa-reply-date { font-size: 11px; color: var(--text-tertiary); margin-left: auto; }
.qa-reply-text { font-size: 13.5px; color: var(--text-secondary); line-height: 1.55; white-space: pre-wrap; word-break: break-word; }
.qa-accept-btn {
  margin-top: 8px; background: transparent;
  border: 1.5px solid var(--emerald-500);
  color: var(--emerald-600);
  padding: 5px 12px; border-radius: var(--radius-sm);
  font-size: 11.5px; font-weight: 700; cursor: pointer;
  display: inline-flex; align-items: center; gap: 5px;
  transition: .2s var(--ease);
}
.qa-accept-btn:hover { background: var(--emerald-500); color: #fff; }
.qa-reply-form {
  margin-top: 12px; padding-top: 12px;
  border-top: 1px dashed var(--border-default);
  display: flex; flex-direction: column; gap: 8px;
}
.qa-reply-form textarea {
  width: 100%; padding: 10px 12px;
  border: 1.5px solid var(--border-default);
  border-radius: var(--radius-sm); min-height: 60px;
  font-size: 13.5px; background: var(--bg-surface);
  color: var(--text-primary); resize: vertical;
}
.qa-reply-form textarea:focus { outline: none; border-color: var(--brand-500); box-shadow: 0 0 0 4px rgba(99,102,241,.14); }
.qa-reply-form .btn { align-self: flex-start; }

/* ============================================================
   21. EMPTY STATE
   ============================================================ */
.empty-state {
  text-align: center; padding: 52px 20px;
  color: var(--text-tertiary);
  background: var(--bg-surface-2);
  border-radius: var(--radius-lg);
  border: 1.5px dashed var(--border-default);
}
.empty-state i { font-size: 40px; margin-bottom: 12px; opacity: .35; display: block; color: var(--brand-400); }
.empty-state p { font-size: 13.5px; font-weight: 500; }

/* ============================================================
   22. HERO
   ============================================================ */
.hero-section {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px;
  background: linear-gradient(135deg, #0a0e1f 0%, #1a2149 50%, #2a1f5c 100%);
  color: #fff; border-radius: var(--radius-2xl);
  padding: 48px 52px; margin-bottom: 32px;
  box-shadow: var(--shadow-xl);
  position: relative; overflow: hidden; isolation: isolate;
}
[data-theme="dark"] .hero-section {
  background: linear-gradient(135deg, #14171c 0%, #1b1f26 50%, #242a3a 100%);
  box-shadow: var(--shadow-xl), 0 0 0 1px rgba(129,140,248,.15);
}
.hero-orb { position: absolute; border-radius: 50%; filter: blur(60px); pointer-events: none; z-index: -1; }
.hero-orb-1 { width: 380px; height: 380px; background: radial-gradient(circle, rgba(99,102,241,.55), transparent 70%); top: -120px; right: -80px; animation: orbFloat 8s ease-in-out infinite; }
.hero-orb-2 { width: 320px; height: 320px; background: radial-gradient(circle, rgba(6,182,212,.4), transparent 70%); bottom: -140px; left: -60px; animation: orbFloat 10s ease-in-out infinite reverse; }
@keyframes orbFloat {
  0%,100% { transform: translate(0,0); }
  50% { transform: translate(20px, -20px); }
}
.hero-content { position: relative; z-index: 1; max-width: 560px; }
.hero-tag {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 11.5px; font-weight: 600;
  padding: 5px 14px; border-radius: var(--radius-pill);
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.15);
  color: rgba(255,255,255,.9);
  letter-spacing: .3px; margin-bottom: 16px;
}
.hero-content h1 {
  font-size: clamp(26px, 4vw, 36px); font-weight: 800;
  margin-bottom: 12px; line-height: 1.15; letter-spacing: -.8px;
}
.hero-content p { font-size: 15.5px; color: rgba(255,255,255,.78); margin-bottom: 24px; line-height: 1.55; max-width: 480px; }
.hero-image {
  position: relative; z-index: 1;
  width: 150px; height: 150px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 68px; color: var(--gold-400);
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.14), rgba(255,255,255,.02) 60%), radial-gradient(circle, rgba(240,180,41,.12), transparent 70%);
  border: 1px solid rgba(255,255,255,.1);
  animation: float 4s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes float {
  0%,100% { transform: translateY(0); }
  50% { transform: translateY(-14px); }
}

/* ============================================================
   23. SECTION CARDS
   ============================================================ */
.section-card {
  background: var(--bg-surface); border-radius: var(--radius-lg);
  padding: 30px 32px; margin-bottom: 24px;
  box-shadow: var(--shadow-xs); border: 1px solid var(--border-subtle);
}
.section-card h2 {
  font-size: 19px; font-weight: 700; color: var(--text-primary);
  margin-bottom: 22px; display: flex; align-items: center; gap: 12px;
  letter-spacing: -.2px;
}
.section-card h2 i {
  color: var(--brand-500); background: var(--brand-50);
  padding: 8px; border-radius: var(--radius-sm);
  font-size: 15px; width: 34px; height: 34px;
  display: inline-flex; align-items: center; justify-content: center;
}
[data-theme="dark"] .section-card h2 i,
[data-theme="dim"] .section-card h2 i { background: rgba(99,102,241,.15); }

/* Row with title on the left, action button on the right (Alumni / Friends) */
.section-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.section-header-row h2 { margin-bottom: 0; }

/* ============================================================
   24. OWNER / PROFESSORS / TESTIMONIALS
   ============================================================ */
.owner-container { display: flex; gap: 28px; align-items: center; flex-wrap: wrap; }
.owner-image img {
  width: 160px; height: 160px; border-radius: 50%;
  object-fit: cover; border: 4px solid var(--brand-500);
  box-shadow: 0 12px 32px rgba(99,102,241,.25);
}
.owner-details h3 { font-size: 20px; color: var(--text-primary); margin-bottom: 8px; font-weight: 700; letter-spacing: -.3px; }
.owner-details p { font-size: 14px; color: var(--text-secondary); line-height: 1.7; max-width: 640px; }
.professor-card {
  background: var(--bg-surface-2);
  border-radius: var(--radius-lg); padding: 24px 20px;
  text-align: center; transition: .25s var(--ease);
  border: 1px solid var(--border-subtle);
  display: flex; flex-direction: column; align-items: center;
  min-height: 260px;
}
.professor-card:hover {
  transform: translateY(-5px); box-shadow: var(--shadow-md);
  background: var(--bg-surface);
  border-color: var(--brand-200);
}
[data-theme="dark"] .professor-card:hover,
[data-theme="dim"] .professor-card:hover { border-color: var(--brand-500); }
.professor-card .professor-avatar {
  width: 88px; height: 88px; border-radius: 50%;
  object-fit: cover; margin: 0 auto 12px;
  border: 3px solid var(--brand-500);
  box-shadow: 0 6px 18px rgba(99,102,241,.2);
  flex-shrink: 0;
}
.avatar-placeholder-lg {
  width: 88px !important; height: 88px !important;
  background: linear-gradient(135deg, var(--bg-surface-3), var(--bg-surface-2)) !important;
  display: flex; align-items: center; justify-content: center;
  font-size: 34px !important; color: var(--brand-500) !important;
  border-radius: 50% !important;
  border: 3px solid var(--brand-500) !important;
  margin: 0 auto 12px !important;
}
.professor-card h3 { font-size: 15.5px; font-weight: 700; color: var(--text-primary); }
.professor-card .prof-title { font-size: 12.5px; color: var(--brand-600); font-weight: 600; margin: 4px 0 8px; }
.professor-card p { font-size: 13px; color: var(--text-secondary); line-height: 1.5; flex: 1; }

.avatar-placeholder {
  width: 56px; height: 56px; border-radius: 50%;
  background: linear-gradient(135deg, var(--bg-surface-3), var(--bg-surface-2));
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; color: var(--brand-500); flex-shrink: 0;
  border: 2px solid var(--border-subtle);
}
.admin-professor-item {
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  border: 1px solid var(--border-subtle);
  display: flex; align-items: flex-start; gap: 16px;
  transition: .25s var(--ease);
  min-height: 120px;
}
.admin-professor-item:hover {
  border-color: var(--brand-300);
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}
[data-theme="dark"] .admin-professor-item:hover,
[data-theme="dim"] .admin-professor-item:hover { border-color: var(--brand-500); }
.admin-professor-item img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; border: 2px solid var(--border-subtle); flex-shrink: 0; }
.admin-professor-item .info { flex: 1; min-width: 0; }
.admin-professor-item .info h4 { font-size: 14.5px; font-weight: 700; color: var(--text-primary); margin-bottom: 3px; }
.admin-professor-item .info .title { font-size: 12.5px; color: var(--brand-600); font-weight: 600; }
.admin-professor-item .info .desc { font-size: 12.5px; color: var(--text-tertiary); margin-top: 4px; line-height: 1.5; }
.admin-professor-item .actions { display: flex; gap: 6px; flex-shrink: 0; align-self: flex-start; }

.testimonial-card {
  background: var(--bg-surface-2);
  border-radius: var(--radius-lg); padding: 22px;
  border: 1px solid var(--border-subtle);
  position: relative; transition: .25s var(--ease);
  display: flex; flex-direction: column; min-height: 180px;
}
.testimonial-card:hover {
  transform: translateY(-3px); box-shadow: var(--shadow-md);
  background: var(--bg-surface);
}
.testimonial-card i.fa-quote-left {
  font-size: 22px; color: var(--brand-400);
  opacity: .7; margin-bottom: 10px; display: block;
}
.testimonial-card p { font-size: 13.5px; color: var(--text-secondary); line-height: 1.65; margin-bottom: 12px; flex: 1; }
.testimonial-card h4 { font-size: 12.5px; color: var(--text-primary); font-weight: 700; letter-spacing: .1px; margin-top: auto; }

/* ============================================================
   25. STUDENT CARDS (Admin)
   ============================================================ */
.student-card {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  padding: 20px;
  display: flex; flex-direction: column; gap: 14px;
  transition: .25s var(--ease);
  min-height: 220px;
}
.student-card:hover {
  transform: translateY(-3px);
  border-color: var(--brand-300);
  box-shadow: var(--shadow-md);
}
[data-theme="dark"] .student-card:hover,
[data-theme="dim"] .student-card:hover { border-color: var(--brand-500); }
.student-card-header { display: flex; align-items: center; gap: 14px; }
.student-avatar {
  width: 52px; height: 52px; border-radius: 50%;
  background: linear-gradient(135deg, #22d3ee, #0891b2);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 800; letter-spacing: -.5px;
  flex-shrink: 0;
  box-shadow: 0 6px 16px rgba(6,182,212,.35), inset 0 1px 0 rgba(255,255,255,.3);
}
.student-card-info { flex: 1; min-width: 0; }
.student-card-info h4 {
  font-size: 15px; font-weight: 700; color: var(--text-primary);
  margin-bottom: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.student-username { font-size: 12.5px; color: var(--text-tertiary); font-weight: 500; }
.student-card-body {
  display: flex; flex-direction: column; gap: 8px;
  padding: 12px 0;
  border-top: 1px dashed var(--border-subtle);
  border-bottom: 1px dashed var(--border-subtle);
}
.student-meta-row { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--text-secondary); }
.student-meta-row i { color: var(--brand-500); font-size: 13px; width: 16px; text-align: center; flex-shrink: 0; }
.student-meta-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.student-card-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: auto; }
.student-card-actions .btn { font-size: 11.5px; padding: 6px 10px; }

/* ============================================================
   26. MODALS
   ============================================================ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(7,11,26,.55);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  display: none; justify-content: center; align-items: center;
  z-index: 1000; padding: 20px;
  animation: overlayIn .2s var(--ease);
}
.modal-overlay.active { display: flex; }
@keyframes overlayIn { from { opacity: 0; } to { opacity: 1; } }
.modal-box {
  background: var(--bg-surface);
  border-radius: var(--radius-xl);
  padding: 32px 34px;
  max-width: 580px; width: 100%;
  max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border-subtle);
  animation: modalIn .3s var(--ease);
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(.95) translateY(24px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-box h3 {
  font-size: 19px; font-weight: 700; color: var(--text-primary);
  margin-bottom: 6px; display: flex; align-items: center; gap: 10px;
  letter-spacing: -.2px;
}
.modal-box h3 i { color: var(--brand-500); }
.modal-sub { font-size: 13px; color: var(--text-tertiary); margin-bottom: 22px; }
.modal-actions {
  display: flex; gap: 10px; margin-top: 24px;
  justify-content: flex-end; flex-wrap: wrap;
  padding-top: 20px; border-top: 1px solid var(--border-subtle);
}
.modal-icon-header { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 20px; }
.modal-icon-tile {
  width: 52px; height: 52px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; flex-shrink: 0;
  position: relative; overflow: hidden;
}
.modal-icon-tile::before {
  content: ""; position: absolute; top: -30%; left: -30%;
  width: 160%; height: 160%;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.3), transparent 55%);
}
.modal-icon-tile.tone-emerald {
  background: linear-gradient(135deg, #34d399, #059669);
  color: #fff;
  box-shadow: 0 8px 20px rgba(16,185,129,.4);
}

.credentials-success-icon {
  width: 72px; height: 72px; margin: 0 auto 14px;
  border-radius: 50%;
  background: linear-gradient(135deg, #34d399, #059669);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 34px;
  box-shadow: 0 12px 32px rgba(16,185,129,.4);
  animation: scaleIn .5s var(--ease-spring);
  position: relative; overflow: hidden;
}
.credentials-success-icon::before {
  content: ""; position: absolute; inset: -10%;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.4), transparent 60%);
}
@keyframes scaleIn {
  0% { transform: scale(0); opacity: 0; }
  60% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); }
}
.credentials-card {
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  margin: 20px 0;
  display: flex; flex-direction: column; gap: 12px;
}
.cred-row { display: grid; grid-template-columns: 100px 1fr; gap: 12px; align-items: center; }
.cred-label {
  font-size: 12px; font-weight: 700;
  color: var(--text-tertiary);
  text-transform: uppercase; letter-spacing: .5px;
  display: flex; align-items: center; gap: 6px;
}
.cred-label i { font-size: 12px; }
.cred-value-group {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-surface);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}
.cred-value { flex: 1; min-width: 0; font-size: 13.5px; color: var(--text-primary); font-weight: 500; word-break: break-all; }
.cred-value.cred-code {
  font-family: 'SF Mono', 'Monaco', 'Courier New', monospace;
  font-weight: 700;
  color: var(--brand-600);
  letter-spacing: .5px;
}
[data-theme="dark"] .cred-value.cred-code,
[data-theme="dim"] .cred-value.cred-code { color: var(--brand-300); }
.cred-copy-btn {
  background: transparent; border: none;
  color: var(--brand-500); cursor: pointer;
  width: 28px; height: 28px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  transition: .2s var(--ease); flex-shrink: 0;
}
.cred-copy-btn:hover { background: rgba(99,102,241,.1); color: var(--brand-700); transform: scale(1.1); }
.credentials-warning {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 14px;
  background: rgba(245,158,11,.1);
  border: 1px solid rgba(245,158,11,.3);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  color: var(--gold-600);
  line-height: 1.5;
}
[data-theme="dark"] .credentials-warning,
[data-theme="dim"] .credentials-warning { color: var(--gold-400); }
.credentials-warning i { color: var(--gold-500); flex-shrink: 0; margin-top: 2px; }

.toggle-box {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; background: var(--bg-surface-2);
  border: 1.5px solid var(--border-subtle); border-radius: var(--radius-sm);
  cursor: pointer; width: 100%;
  font-weight: 600; color: var(--text-secondary); font-size: 13px;
  transition: .2s var(--ease);
}
.toggle-box.pro {
  background: linear-gradient(135deg, rgba(245,158,11,.08), rgba(251,191,36,.04));
  border-color: rgba(245,158,11,.3); color: var(--gold-600);
}
.toggle-box input[type="checkbox"] {
  width: 18px; height: 18px; cursor: pointer;
  accent-color: var(--brand-600); flex-shrink: 0;
}
.toggle-box:hover { border-color: var(--brand-400); }

/* ============================================================
   27. QUIZ
   ============================================================ */
.quiz-edit-card {
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 16px; margin-bottom: 12px;
}
.quiz-edit-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.quiz-edit-head strong { font-size: 13px; color: var(--brand-600); text-transform: uppercase; letter-spacing: .6px; }
.quiz-remove {
  background: transparent; border: none;
  color: var(--text-tertiary); cursor: pointer;
  width: 26px; height: 26px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: .2s var(--ease);
}
.quiz-remove:hover { background: var(--rose-500); color: #fff; }
.quiz-options { display: flex; flex-direction: column; gap: 8px; }
.quiz-option-row { display: flex; align-items: center; gap: 10px; }
.quiz-option-row input[type="text"] {
  flex: 1; padding: 8px 12px;
  border: 1.5px solid var(--border-default);
  border-radius: var(--radius-sm); font-size: 13.5px;
  background: var(--bg-surface); color: var(--text-primary);
}
.quiz-radio { position: relative; width: 20px; height: 20px; flex-shrink: 0; cursor: pointer; }
.quiz-radio input { position: absolute; opacity: 0; pointer-events: none; }
.quiz-radio-dot { display: block; width: 20px; height: 20px; border: 2px solid var(--border-strong); border-radius: 50%; transition: .2s var(--ease); }
.quiz-radio input:checked + .quiz-radio-dot {
  border-color: var(--emerald-500);
  background: var(--emerald-500);
  box-shadow: inset 0 0 0 3px var(--bg-surface);
}
.quiz-play-card {
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px 18px; margin-bottom: 12px;
}
.quiz-play-qnum {
  font-size: 11px; font-weight: 700; color: var(--brand-600);
  text-transform: uppercase; letter-spacing: .6px; margin-bottom: 6px;
}
.quiz-play-question { font-size: 15px; font-weight: 700; color: var(--text-primary); margin-bottom: 14px; line-height: 1.4; }
.quiz-play-options { display: flex; flex-direction: column; gap: 8px; }
.quiz-play-option {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px;
  border: 1.5px solid var(--border-default);
  border-radius: var(--radius-sm);
  cursor: pointer; transition: .15s var(--ease);
  background: var(--bg-surface);
}
.quiz-play-option:hover { border-color: var(--brand-400); background: var(--brand-50); }
[data-theme="dark"] .quiz-play-option:hover,
[data-theme="dim"] .quiz-play-option:hover { background: rgba(99,102,241,.08); }
.quiz-play-option.selected {
  border-color: var(--brand-500);
  background: rgba(99,102,241,.08);
  box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}
.quiz-play-letter {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--bg-surface-3); color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800; flex-shrink: 0;
}
.quiz-play-option.selected .quiz-play-letter { background: var(--brand-500); color: #fff; }
.quiz-play-text { font-size: 13.5px; color: var(--text-primary); line-height: 1.4; }
.quiz-result-hero { text-align: center; padding: 26px 20px; border-radius: var(--radius-lg); margin-bottom: 18px; }
.quiz-result-hero.pass {
  background: linear-gradient(135deg, rgba(16,185,129,.15), rgba(52,211,153,.06));
  border: 1.5px solid rgba(16,185,129,.35);
}
.quiz-result-hero.fail {
  background: linear-gradient(135deg, rgba(245,158,11,.15), rgba(251,191,36,.06));
  border: 1.5px solid rgba(245,158,11,.35);
}
.quiz-result-emoji { font-size: 42px; margin-bottom: 6px; }
.quiz-result-score { font-size: 34px; font-weight: 800; color: var(--text-primary); letter-spacing: -1px; line-height: 1; }
.quiz-result-pct { font-size: 13px; font-weight: 700; color: var(--text-tertiary); margin-top: 4px; }
.quiz-result-headline { font-size: 14px; font-weight: 700; margin-top: 10px; color: var(--text-secondary); }
.quiz-result-item {
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px; margin-bottom: 10px;
}
.quiz-result-item.ok { border-left: 4px solid var(--emerald-500); }
.quiz-result-item.bad { border-left: 4px solid var(--rose-500); }
.quiz-result-head {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 13.5px; color: var(--text-primary);
  font-weight: 500; margin-bottom: 10px; line-height: 1.4;
}
.quiz-result-badge {
  width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: #fff; flex-shrink: 0; margin-top: 1px;
}
.quiz-result-badge.ok { background: var(--emerald-500); }
.quiz-result-badge.bad { background: var(--rose-500); }
.quiz-result-body { font-size: 12.5px; padding-left: 32px; display: flex; flex-direction: column; gap: 5px; }
.quiz-answer-row { display: flex; gap: 8px; flex-wrap: wrap; }
.quiz-answer-label { color: var(--text-tertiary); font-weight: 600; }
.ok-text { color: var(--emerald-600); font-weight: 700; }
[data-theme="dark"] .ok-text, [data-theme="dim"] .ok-text { color: var(--emerald-400); }
.bad-text { color: var(--rose-600); font-weight: 700; }
[data-theme="dark"] .bad-text, [data-theme="dim"] .bad-text { color: var(--rose-400); }
.quiz-explain {
  margin-top: 8px; padding: 8px 10px;
  background: rgba(99,102,241,.08);
  border-left: 3px solid var(--brand-500);
  border-radius: 6px; color: var(--brand-700);
  font-size: 12.5px; line-height: 1.5;
}
[data-theme="dark"] .quiz-explain,
[data-theme="dim"] .quiz-explain { background: rgba(99,102,241,.14); color: var(--brand-300); }

/* ============================================================
   28. TOAST
   ============================================================ */
.toast-container {
  position: fixed; bottom: 24px; right: 24px;
  z-index: 9999; display: flex; flex-direction: column; gap: 10px;
  max-width: 380px; width: calc(100% - 48px); pointer-events: none;
}
.toast {
  padding: 13px 18px; border-radius: var(--radius-md);
  color: #fff; font-size: 13.5px; font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: slideUp .35s var(--ease-out);
  display: flex; align-items: center; gap: 10px;
  pointer-events: auto; line-height: 1.45;
  border: 1px solid rgba(255,255,255,.1);
}
.toast.success { background: linear-gradient(135deg, var(--emerald-600), var(--emerald-500)); }
.toast.error   { background: linear-gradient(135deg, var(--rose-600), var(--rose-500)); }
.toast.info    { background: linear-gradient(135deg, var(--brand-700), var(--brand-500)); }
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   29. FOOTER
   ============================================================ */
.app-footer {
  background: var(--space-900);
  color: rgba(255,255,255,.5);
  text-align: center;
  padding: 9px 16px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .3px;
  border-top: 1px solid rgba(99,102,241,.2);
  line-height: 1;
  margin-top: auto;
}
.app-footer p { margin: 2px 0; }
.app-footer i.fa-heart { color: var(--rose-500); }

/* ============================================================
   30. STREAK / CERTIFICATE / NOTIFICATIONS
   ============================================================ */
.streak-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 12px; border-radius: var(--radius-pill);
  background: linear-gradient(135deg, #f97316, #ef4444);
  color: #fff; font-size: 11.5px; font-weight: 700;
  letter-spacing: .3px; box-shadow: 0 3px 10px rgba(239,68,68,.35);
  animation: pulseGlow 2s ease-in-out infinite;
}
.streak-badge i { font-size: 12px; }
@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 3px 10px rgba(239,68,68,.35); }
  50% { box-shadow: 0 3px 16px rgba(239,68,68,.55); }
}
.streak-card {
  display: flex; align-items: center; gap: 18px;
  padding: 18px 22px; margin-bottom: 20px;
  border-radius: var(--radius-lg); border: 1px solid var(--border-subtle);
  background: var(--bg-surface); position: relative; overflow: hidden;
}
.streak-card::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(249,115,22,.08), rgba(239,68,68,.04));
  pointer-events: none;
}
.streak-card.cool::before { background: linear-gradient(135deg, rgba(99,102,241,.08), rgba(6,182,212,.04)); }
.streak-flame {
  width: 54px; height: 54px; border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
  background: linear-gradient(135deg, #f97316, #ef4444);
  color: #fff; box-shadow: 0 6px 18px rgba(239,68,68,.3);
  flex-shrink: 0; position: relative; z-index: 1;
}
.streak-card.cool .streak-flame { background: linear-gradient(135deg, var(--brand-600), var(--accent-500)); }
.streak-info { flex: 1; min-width: 0; position: relative; z-index: 1; }
.streak-label {
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .8px;
  color: #ea580c;
  display: inline-flex; align-items: center; gap: 6px;
}
.streak-card.cool .streak-label { color: var(--brand-600); }
.streak-info h3 { font-size: 20px; font-weight: 800; color: var(--text-primary); margin: 2px 0 4px; letter-spacing: -.4px; }
.streak-info p { font-size: 13px; color: var(--text-tertiary); }
.cert-earned-banner {
  display: flex; align-items: center; gap: 18px;
  padding: 18px 22px; margin-bottom: 20px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(245,158,11,.12), rgba(251,191,36,.06));
  border: 1.5px solid rgba(245,158,11,.35);
  position: relative; overflow: hidden;
}
.cert-earned-icon {
  width: 54px; height: 54px; border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--gold-400), var(--gold-500));
  color: #422006; display: flex; align-items: center; justify-content: center;
  font-size: 26px; box-shadow: 0 6px 18px rgba(245,158,11,.4);
  flex-shrink: 0;
}
.cert-earned-info { flex: 1; min-width: 0; }
.cert-earned-info h4 { font-size: 15px; font-weight: 800; color: #422006; margin-bottom: 3px; }
[data-theme="dark"] .cert-earned-info h4,
[data-theme="dim"] .cert-earned-info h4 { color: var(--gold-300); }
.cert-earned-info p { font-size: 13px; color: var(--gold-600); font-weight: 500; }
[data-theme="dark"] .cert-earned-info p,
[data-theme="dim"] .cert-earned-info p { color: var(--gold-400); }
.notif-wrap { position: relative; display: inline-flex; }
.notif-btn { position: relative; }
.notif-badge {
  position: absolute; top: -4px; right: -4px;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff; font-size: 10.5px; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center;
  border: 2px solid var(--space-900); line-height: 1;
  animation: badgePop .35s var(--ease-out);
}
@keyframes badgePop {
  0% { transform: scale(0); }
  60% { transform: scale(1.15); }
  100% { transform: scale(1); }
}
.notif-dropdown {
  position: absolute; top: calc(100% + 10px); right: 0;
  width: 360px; max-width: calc(100vw - 24px);
  background: var(--bg-surface); border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle); box-shadow: var(--shadow-xl);
  z-index: 500; opacity: 0; visibility: hidden;
  transform: translateY(-8px);
  transition: opacity .2s var(--ease), transform .2s var(--ease), visibility .2s;
  overflow: hidden;
}
.notif-wrap.open .notif-dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
.notif-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 18px; border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-surface-2);
}
.notif-header h4 { font-size: 14px; font-weight: 700; color: var(--text-primary); }
.notif-mark-all {
  background: transparent; border: none; color: var(--brand-600);
  font-size: 12px; font-weight: 600; cursor: pointer;
  padding: 4px 8px; border-radius: 6px;
}
.notif-list { max-height: 420px; overflow-y: auto; scrollbar-width: thin; }
.notif-list::-webkit-scrollbar { width: 6px; }
.notif-list::-webkit-scrollbar-thumb { background: var(--border-default); border-radius: 3px; }
.notif-item {
  position: relative; display: flex; gap: 12px;
  padding: 14px 18px; border-bottom: 1px solid var(--border-subtle);
  cursor: pointer; transition: .15s var(--ease);
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--bg-surface-2); }
.notif-item.unread { background: rgba(99,102,241,.04); }
[data-theme="dark"] .notif-item.unread,
[data-theme="dim"] .notif-item.unread { background: rgba(99,102,241,.08); }
.notif-icon {
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  background: var(--brand-50); color: var(--brand-600);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; flex-shrink: 0;
}
[data-theme="dark"] .notif-icon,
[data-theme="dim"] .notif-icon { background: rgba(99,102,241,.18); color: var(--brand-400); }
.notif-content { flex: 1; min-width: 0; }
.notif-title { font-size: 13.5px; font-weight: 700; color: var(--text-primary); margin-bottom: 2px; line-height: 1.3; }
.notif-body {
  font-size: 12.5px; color: var(--text-tertiary);
  line-height: 1.45; margin-bottom: 4px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.notif-time { font-size: 11px; color: var(--text-tertiary); font-weight: 500; }
.notif-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--brand-500); flex-shrink: 0;
  align-self: center; box-shadow: 0 0 0 3px rgba(99,102,241,.15);
}
.notif-empty { padding: 40px 20px; text-align: center; color: var(--text-tertiary); }
.notif-empty i { font-size: 32px; opacity: .35; margin-bottom: 10px; display: block; color: var(--brand-400); }
.notif-empty p { font-size: 13px; }

/* ============================================================
   31. PWA
   ============================================================ */
.pwa-toast { display: flex; align-items: center; gap: 10px; padding-right: 12px; }
.pwa-install-btn {
  background: rgba(255,255,255,.2); border: 1px solid rgba(255,255,255,.3);
  color: #fff; padding: 5px 12px; border-radius: 6px;
  font-size: 12px; font-weight: 700; cursor: pointer; flex-shrink: 0;
}
.pwa-dismiss-btn {
  background: transparent; border: none; color: rgba(255,255,255,.7);
  font-size: 20px; cursor: pointer; padding: 0 4px; flex-shrink: 0;
}

/* ============================================================
   32. CUSTOM PDF VIEWER
   ============================================================ */
.pdf-viewer-modal {
  position: fixed; inset: 0;
  background: rgba(16,18,22,.96);
  z-index: 2000;
  display: none;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.pdf-viewer-modal.active { display: flex; }
.pdfv-shell { display: flex; flex-direction: column; width: 100%; height: 100%; }
.pdfv-toolbar {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; padding: 10px 16px; flex-wrap: wrap;
  background: rgba(10,14,31,.96);
  border-bottom: 1px solid rgba(255,255,255,.08);
  color: #fff;
  flex-shrink: 0;
}
.pdfv-toolbar-left, .pdfv-toolbar-center, .pdfv-toolbar-right { display: flex; align-items: center; gap: 6px; }
.pdfv-btn {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.14);
  color: #fff; width: 34px; height: 34px;
  border-radius: 8px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; transition: .2s; padding: 0;
}
.pdfv-btn:hover { background: rgba(255,255,255,.2); }
.pdfv-btn:active { transform: scale(.95); }
.pdfv-title {
  font-size: 14px; font-weight: 600; color: #fff;
  max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  margin-left: 8px;
}
.pdfv-hlcount { font-size: 11.5px; color: #a5b4fc; font-weight: 600; margin-left: 8px; }
.pdfv-pageinfo { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: rgba(255,255,255,.85); padding: 0 4px; }
.pdfv-pageinfo input {
  width: 48px; padding: 5px 6px; border-radius: 6px;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.15);
  color: #fff; text-align: center; font-size: 13px;
  font-family: inherit;
}
.pdfv-pageinfo input::-webkit-outer-spin-button,
.pdfv-pageinfo input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.pdfv-pageinfo input[type=number] { -moz-appearance: textfield; }
.pdfv-divider { width: 1px; height: 22px; background: rgba(255,255,255,.15); margin: 0 4px; }
.pdfv-zoomlabel {
  font-size: 12px; color: rgba(255,255,255,.75);
  min-width: 46px; text-align: center;
  font-variant-numeric: tabular-nums;
}
.pdfv-hl-colors { display: flex; gap: 4px; padding: 3px; background: rgba(255,255,255,.06); border-radius: 8px; margin-right: 6px; }
.pdfv-color {
  width: 22px; height: 22px; border-radius: 50%; cursor: pointer;
  border: 2px solid transparent; transition: .2s; padding: 0;
}
.pdfv-color.yellow { background: #fde047; }
.pdfv-color.green  { background: #34d399; }
.pdfv-color.blue   { background: #60a5fa; }
.pdfv-color.pink   { background: #f472b6; }
.pdfv-color.orange { background: #fb923c; }
.pdfv-color:hover { transform: scale(1.1); }
.pdfv-color.active { border-color: #fff; transform: scale(1.15); box-shadow: 0 0 0 2px rgba(255,255,255,.35); }

.pdfv-body {
  flex: 1; overflow: auto; position: relative;
  background: #131727;
  padding: 22px 0;
  scroll-behavior: smooth;
}
.pdfv-pages { display: flex; flex-direction: column; align-items: center; gap: 22px; }
.pdfv-page {
  position: relative;
  background: #fff;
  box-shadow: 0 12px 40px rgba(0,0,0,.5);
  border-radius: 4px;
  overflow: hidden;
  flex-shrink: 0;
}
.pdfv-canvas { display: block; pointer-events: none; user-select: none; -webkit-user-drag: none; }
.pdfv-textlayer {
  position: absolute; top: 0; left: 0;
  overflow: hidden;
  line-height: 1;
  text-align: initial;
  text-size-adjust: none;
  -webkit-text-size-adjust: none;
  -moz-text-size-adjust: none;
  forced-color-adjust: none;
  transform-origin: 0 0;
  z-index: 2;
  opacity: 1;
  pointer-events: auto;
}
.pdfv-textlayer > span,
.pdfv-textlayer > br,
.pdfv-textlayer span[role="presentation"] > span {
  color: transparent;
  position: absolute;
  white-space: pre;
  cursor: text;
  transform-origin: 0% 0%;
  pointer-events: auto;
}
.pdfv-textlayer ::selection { background: rgba(99,102,241,.5); color: transparent; }
.pdfv-textlayer mark.pdf-hl {
  color: transparent !important;
  margin: 0; padding: 0;
  border-radius: 2px;
  cursor: pointer;
  box-shadow: inset 0 -2px 0 rgba(0,0,0,.08);
  transition: filter .15s;
  pointer-events: auto;
}
.pdfv-textlayer mark.pdf-hl:hover { filter: brightness(1.05) saturate(1.25); box-shadow: inset 0 -2px 0 rgba(0,0,0,.15), 0 0 0 1px rgba(0,0,0,.1); }
.pdfv-watermark {
  position: absolute; inset: 0;
  pointer-events: none;
  z-index: 3;
  background-repeat: repeat;
  opacity: .7;
}
.pdfv-loader {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 16px; color: #fff;
  background: rgba(10,14,31,.72);
  z-index: 10;
}
.pdfv-spinner {
  width: 42px; height: 42px;
  border: 3px solid rgba(255,255,255,.15);
  border-top-color: #6366f1;
  border-radius: 50%;
  animation: pdfSpin .8s linear infinite;
}
.analytics-loading .pdfv-spinner {
  border-color: var(--border-subtle);
  border-top-color: var(--brand-500);
}
@keyframes pdfSpin { to { transform: rotate(360deg); } }
.pdfv-error { color: #fff; text-align: center; padding: 20px; }
.pdfv-error i { font-size: 42px; color: #f59e0b; margin-bottom: 12px; display: block; }
.pdfv-error p { margin-bottom: 16px; }
.pdfv-selection-menu {
  position: fixed; display: none; gap: 4px; padding: 6px;
  background: rgba(10,14,31,.97);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 10px;
  z-index: 3000;
  box-shadow: 0 10px 30px rgba(0,0,0,.5);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.pdfv-sel-btn {
  background: transparent; border: none;
  color: #fff; padding: 8px 12px;
  border-radius: 6px; cursor: pointer;
  font-size: 12.5px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 6px;
  font-family: inherit; white-space: nowrap;
  transition: background .15s;
}
.pdfv-sel-btn:hover { background: rgba(255,255,255,.12); }
.pdfv-sel-btn i { font-size: 12px; }
.pdfv-back-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.22);
  color: #fff;
  padding: 8px 15px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: .2s;
  flex-shrink: 0;
  margin-right: 4px;
}
.pdfv-back-btn:hover { background: rgba(99,102,241,.75); border-color: rgba(255,255,255,.45); transform: translateX(-2px); }
.pdfv-back-btn:active { transform: translateX(-2px) scale(.97); }
.pdfv-back-btn i { font-size: 12px; }
.pdfv-back-btn span { line-height: 1; }

/* ============================================================
   33. CUSTOM VIDEO PLAYER
   ============================================================ */
.video-player-modal { position: fixed; inset: 0; background: #000; z-index: 2000; display: none; }
.video-player-modal.active { display: flex; }
.vp-shell {
  position: relative; width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}
.vp-shell video {
  max-width: 100%; max-height: 100%;
  width: 100%; height: 100%;
  object-fit: contain;
  display: block;
  background: #000;
  outline: none;
}
.vp-video-area { position: absolute; inset: 0; background: #000; overflow: hidden; }
.vp-video-area iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; background: #000; }
.vp-click-capture { position: absolute; inset: 0; z-index: 6; cursor: pointer; background: transparent; }
.vp-iframe { width: 100%; height: 100%; max-width: 100%; max-height: 100%; border: 0; background: #000; }
.vp-watermark {
  position: absolute; inset: 0;
  pointer-events: none;
  z-index: 5;
  background-repeat: repeat;
  opacity: .7;
}
.vp-title {
  position: absolute; top: 0; left: 0; right: 0;
  padding: 18px 22px 18px 118px;
  background: linear-gradient(to bottom, rgba(0,0,0,.72), transparent);
  color: #fff; font-size: 15px; font-weight: 600;
  z-index: 10; pointer-events: none;
  transition: opacity .3s;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.vp-title.hidden { opacity: 0; }
.vp-center-play {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 84px; height: 84px; border-radius: 50%;
  background: rgba(0,0,0,.55);
  border: 2px solid rgba(255,255,255,.4);
  color: #fff; font-size: 30px;
  cursor: pointer;
  display: none; align-items: center; justify-content: center;
  z-index: 8;
  transition: .25s;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  padding: 0;
}
.vp-center-play.visible { display: flex; }
.vp-center-play:hover { background: rgba(99,102,241,.7); transform: translate(-50%, -50%) scale(1.08); border-color: rgba(255,255,255,.7); }
.vp-controls {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 60px 18px 14px;
  background: linear-gradient(to top, rgba(0,0,0,.9), rgba(0,0,0,.4) 40%, transparent);
  display: flex; flex-direction: column; gap: 10px;
  opacity: 1; transition: opacity .3s;
  z-index: 10;
}
.vp-controls.hidden { opacity: 0; pointer-events: none; }
.vp-progress-row { position: relative; height: 16px; cursor: pointer; margin: 0 2px; display: flex; align-items: center; }
.vp-progress-bg { position: absolute; left: 0; right: 0; height: 6px; background: rgba(255,255,255,.22); border-radius: 3px; }
.vp-progress-buffered { position: absolute; left: 0; height: 6px; background: rgba(255,255,255,.4); border-radius: 3px; transition: width .2s; }
.vp-progress-filled {
  position: absolute; left: 0; height: 6px;
  background: linear-gradient(90deg, #6366f1, #22d3ee);
  border-radius: 3px;
  pointer-events: none;
  transition: width .08s linear;
}
.vp-progress-row:hover .vp-progress-filled { background: linear-gradient(90deg, #818cf8, #67e8f9); height: 8px; }
.vp-progress-row:hover .vp-progress-bg, .vp-progress-row:hover .vp-progress-buffered { height: 8px; }
.vp-thumb {
  position: absolute;
  width: 14px; height: 14px; border-radius: 50%;
  background: #fff;
  transform: translate(-50%, -50%);
  top: 50%;
  box-shadow: 0 2px 6px rgba(0,0,0,.5);
  pointer-events: none;
  opacity: 0; transition: opacity .15s;
}
.vp-progress-row:hover .vp-thumb { opacity: 1; }
.vp-tooltip {
  position: absolute; bottom: 100%;
  transform: translateX(-50%);
  background: rgba(0,0,0,.9);
  color: #fff; padding: 3px 8px;
  border-radius: 4px; font-size: 11.5px;
  pointer-events: none;
  opacity: 0; transition: opacity .15s;
  white-space: nowrap; margin-bottom: 6px;
  font-variant-numeric: tabular-nums;
}
.vp-progress-row:hover .vp-tooltip { opacity: 1; }
.vp-buttons { display: flex; align-items: center; gap: 6px; color: #fff; }
.vp-btn {
  background: transparent; border: none;
  color: #fff; width: 38px; height: 38px;
  border-radius: 8px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 15px; transition: .15s;
  padding: 0;
}
.vp-btn:hover { background: rgba(255,255,255,.15); }
.vp-btn:active { transform: scale(.94); }
.vp-time { font-size: 13px; font-variant-numeric: tabular-nums; color: rgba(255,255,255,.9); padding: 0 8px; font-weight: 500; letter-spacing: .2px; }
.vp-spacer { flex: 1; }
.vp-volume-wrap { display: flex; align-items: center; gap: 2px; }
.vp-volume { width: 0; overflow: hidden; transition: width .22s ease; display: flex; align-items: center; padding-left: 2px; }
.vp-volume-wrap:hover .vp-volume { width: 90px; }
.vp-volume input {
  width: 84px; height: 4px;
  -webkit-appearance: none; appearance: none;
  background: rgba(255,255,255,.3);
  border-radius: 2px; cursor: pointer;
  outline: none;
}
.vp-volume input::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 12px; height: 12px; border-radius: 50%; background: #fff; cursor: pointer; }
.vp-volume input::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: #fff; border: none; cursor: pointer; }
.vp-speed-wrap { position: relative; }
.vp-speed-btn {
  font-size: 13px; font-weight: 700;
  padding: 7px 11px; border-radius: 8px;
  background: rgba(255,255,255,.1);
  color: #fff; border: none; cursor: pointer;
  font-family: inherit;
  min-width: 46px;
  transition: .15s;
}
.vp-speed-btn:hover { background: rgba(255,255,255,.2); }
.vp-speed-menu {
  position: absolute; bottom: 100%; right: 0;
  background: rgba(10,14,31,.97);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 10px;
  padding: 6px;
  display: none; flex-direction: column;
  min-width: 110px;
  box-shadow: 0 10px 30px rgba(0,0,0,.55);
  margin-bottom: 10px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.vp-speed-menu.open { display: flex; }
.vp-speed-menu button {
  background: transparent; border: none;
  color: #fff; padding: 8px 14px;
  text-align: left; cursor: pointer;
  border-radius: 6px; font-size: 13px;
  font-family: inherit; font-weight: 500;
  transition: .15s;
}
.vp-speed-menu button:hover { background: rgba(255,255,255,.1); }
.vp-speed-menu button.active { background: rgba(99,102,241,.3); color: #a5b4fc; font-weight: 700; }
.vp-toast {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0,0,0,.8);
  color: #fff; padding: 12px 22px;
  border-radius: 10px;
  font-size: 15px; font-weight: 700;
  pointer-events: none;
  opacity: 0; transition: opacity .2s;
  z-index: 15;
  font-variant-numeric: tabular-nums;
  letter-spacing: .3px;
}
.vp-toast.show { opacity: 1; }
.vp-back-btn {
  position: absolute;
  top: 16px; left: 16px;
  z-index: 12;
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(0,0,0,.55);
  border: 1px solid rgba(255,255,255,.22);
  color: #fff;
  padding: 8px 15px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: .2s;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  flex-shrink: 0;
}
.vp-back-btn:hover { background: rgba(99,102,241,.8); border-color: rgba(255,255,255,.45); transform: translateX(-2px); }
.vp-back-btn:active { transform: translateX(-2px) scale(.97); }
.vp-back-btn i { font-size: 12px; }
.vp-back-btn span { line-height: 1; }

/* ============================================================
   34. PLAYLISTS
   ============================================================ */
.playlist-editor-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  margin-bottom: 14px;
  transition: .2s var(--ease);
}
.playlist-editor-card:hover { border-color: var(--brand-300); box-shadow: var(--shadow-sm); }
[data-theme="dark"] .playlist-editor-card:hover,
[data-theme="dim"] .playlist-editor-card:hover { border-color: var(--brand-500); }
.playlist-editor-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.playlist-editor-info h4 { font-size: 15px; font-weight: 700; color: var(--text-primary); display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.playlist-editor-info h4 i { color: var(--brand-500); }
.playlist-editor-desc { font-size: 12.5px; color: var(--text-tertiary); margin-bottom: 4px; line-height: 1.4; }
.playlist-editor-meta { font-size: 11px; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: .5px; font-weight: 600; }
.playlist-editor-actions { display: flex; gap: 6px; }
.playlist-items-list {
  display: flex; flex-direction: column; gap: 6px;
  margin-bottom: 12px; padding: 10px;
  background: var(--bg-surface-2);
  border-radius: var(--radius-sm);
  max-height: 220px;
  overflow-y: auto;
}
.playlist-item-row {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px;
  background: var(--bg-surface);
  border-radius: 6px;
  font-size: 13px;
  transition: .15s;
}
.playlist-item-row:hover { background: var(--brand-50); }
[data-theme="dark"] .playlist-item-row:hover,
[data-theme="dim"] .playlist-item-row:hover { background: rgba(99,102,241,.1); }
.playlist-item-index {
  font-size: 11px; font-weight: 700;
  color: var(--brand-600); background: var(--brand-50);
  width: 22px; height: 22px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
[data-theme="dark"] .playlist-item-index,
[data-theme="dim"] .playlist-item-index { background: rgba(99,102,241,.2); color: var(--brand-300); }
.playlist-item-title { flex: 1; min-width: 0; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.playlist-item-remove {
  background: transparent; border: none;
  color: var(--text-tertiary); cursor: pointer;
  width: 24px; height: 24px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: .15s; flex-shrink: 0; font-size: 11px;
}
.playlist-item-remove:hover { background: var(--rose-500); color: #fff; }
.playlist-empty-note { font-size: 12.5px; color: var(--text-tertiary); font-style: italic; padding: 6px 0; }
.playlist-add-row { display: flex; gap: 8px; align-items: stretch; }
.playlist-add-select {
  flex: 1;
  padding: 8px 12px;
  border: 1.5px solid var(--border-default);
  border-radius: var(--radius-sm);
  background: var(--bg-surface); color: var(--text-primary);
  font-size: 13px; cursor: pointer;
  font-family: inherit;
  min-width: 0;
}
.playlist-add-select:focus { outline: none; border-color: var(--brand-500); }
.playlist-checklist {
  max-height: 220px; overflow-y: auto;
  border: 1.5px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 8px;
  background: var(--bg-surface-2);
}
.playlist-checkbox-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  transition: .15s;
}
.playlist-checkbox-row:hover { background: var(--bg-surface); }
.playlist-checkbox-row input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--brand-600); cursor: pointer; flex-shrink: 0; }
.playlist-checkbox-row span { color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.playlist-banner {
  display: flex; align-items: center; gap: 18px;
  padding: 18px 22px;
  margin-bottom: 20px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(99,102,241,.12), rgba(6,182,212,.06));
  border: 1.5px solid rgba(99,102,241,.3);
  position: relative; overflow: hidden;
}
.playlist-banner-icon {
  width: 54px; height: 54px; border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--brand-600), var(--accent-500));
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; flex-shrink: 0;
  box-shadow: 0 6px 18px rgba(99,102,241,.35);
}
.playlist-banner-info { flex: 1; min-width: 0; }
.playlist-banner-info h4 { font-size: 15px; font-weight: 800; color: var(--text-primary); margin-bottom: 3px; }
.playlist-banner-info p { font-size: 13px; color: var(--text-secondary); }
.playlist-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--gap-grid); }
.playlist-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: .25s var(--ease);
}
.playlist-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--brand-300); }
[data-theme="dark"] .playlist-card:hover,
[data-theme="dim"] .playlist-card:hover { border-color: var(--brand-500); }
.playlist-card-cover {
  height: 100px;
  background: linear-gradient(135deg, #6366f1, #22d3ee);
  display: flex; align-items: center; justify-content: center;
  font-size: 42px; color: #fff;
  position: relative;
}
.playlist-card-cover::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.18), transparent 60%);
  pointer-events: none;
}
.playlist-card-cover i { position: relative; z-index: 1; }
.playlist-card-count {
  position: absolute; bottom: 10px; right: 14px;
  background: rgba(0,0,0,.55);
  color: #fff; font-size: 11px; font-weight: 700;
  padding: 4px 10px; border-radius: 999px;
  backdrop-filter: blur(6px);
}
.playlist-card-body { padding: 18px 20px; flex: 1; display: flex; flex-direction: column; }
.playlist-card-body h3 { font-size: 15px; font-weight: 700; color: var(--text-primary); margin-bottom: 6px; line-height: 1.3; }
.playlist-card-desc { font-size: 12.5px; color: var(--text-tertiary); margin-bottom: 12px; line-height: 1.5; }
.playlist-card-preview {
  list-style: none; margin: 0 0 14px; padding: 0;
  font-size: 12.5px; color: var(--text-secondary);
  display: flex; flex-direction: column; gap: 4px;
  flex: 1;
}
.playlist-card-preview li { padding-left: 16px; position: relative; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.playlist-card-preview li::before { content: "▶"; position: absolute; left: 0; top: 0; color: var(--brand-500); font-size: 9px; }
.playlist-card-preview li.playlist-more { color: var(--text-tertiary); font-style: italic; }
.playlist-card-preview li.playlist-more::before { content: ""; }
.playlist-card-body .btn { margin-top: auto; }
.vp-playlist-toggle {
  position: absolute;
  top: 16px; right: 16px;
  z-index: 12;
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(0,0,0,.55);
  border: 1px solid rgba(255,255,255,.22);
  color: #fff;
  padding: 8px 15px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: .2s;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.vp-playlist-toggle:hover { background: rgba(99,102,241,.8); border-color: rgba(255,255,255,.45); }
.vp-playlist-toggle i { font-size: 12px; }
.vp-playlist-panel {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 340px; max-width: 90vw;
  background: rgba(10,15,30,.96);
  border-left: 1px solid rgba(255,255,255,.12);
  z-index: 11;
  transform: translateX(100%);
  transition: transform .3s var(--ease);
  display: flex; flex-direction: column;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.vp-playlist-panel.open { transform: translateX(0); }
.vp-playlist-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(255,255,255,.1);
  flex-shrink: 0;
}
.vp-playlist-header h4 {
  color: #fff; font-size: 14px; font-weight: 700;
  display: flex; align-items: center; gap: 8px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  min-width: 0;
}
.vp-playlist-header h4 i { color: var(--brand-400); }
.vp-playlist-close {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.15);
  color: #fff; width: 30px; height: 30px;
  border-radius: 8px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  transition: .15s;
  flex-shrink: 0;
}
.vp-playlist-close:hover { background: rgba(239,68,68,.7); }
.vp-playlist-items {
  flex: 1; overflow-y: auto;
  padding: 8px;
  scrollbar-width: thin;
}
.vp-playlist-items::-webkit-scrollbar { width: 6px; }
.vp-playlist-items::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 3px; }
.vp-playlist-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  color: rgba(255,255,255,.8);
  font-size: 13px;
  transition: .15s;
  margin-bottom: 2px;
}
.vp-playlist-item:hover { background: rgba(255,255,255,.08); color: #fff; }
.vp-playlist-item.current {
  background: linear-gradient(135deg, rgba(99,102,241,.28), rgba(6,182,212,.18));
  color: #fff;
  font-weight: 600;
  border: 1px solid rgba(99,102,241,.4);
}
.vp-playlist-item-num {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: rgba(255,255,255,.1);
  color: rgba(255,255,255,.85);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800;
  flex-shrink: 0;
}
.vp-playlist-item.current .vp-playlist-item-num { background: var(--brand-500); color: #fff; }
.vp-playlist-item-title {
  flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  line-height: 1.3;
}
.vp-playlist-item-playing { color: #22d3ee; font-size: 12px; flex-shrink: 0; animation: vpPulse 1.2s ease-in-out infinite; }
@keyframes vpPulse { 0%, 100% { opacity: .6; } 50% { opacity: 1; } }
.vp-shell.playlist-open .vp-controls { padding-right: 356px; }
.vp-shell.playlist-open .vp-title { padding-right: 356px; }

/* ============================================================
   35. GLOBAL SEARCH (Cmd/Ctrl+K)
   ============================================================ */
.global-search-overlay {
  position: fixed; inset: 0;
  background: rgba(16,18,22,.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 2500;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 12vh 20px 20px;
}
.global-search-overlay.active { display: flex; animation: overlayIn .2s var(--ease); }
.global-search-box {
  width: 100%; max-width: 640px;
  background: var(--bg-surface);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  animation: modalIn .25s var(--ease);
}
.global-search-input-wrap {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
}
.global-search-input-wrap i { color: var(--text-tertiary); font-size: 16px; }
.global-search-input {
  flex: 1;
  border: none; outline: none;
  background: transparent;
  font-size: 16px; color: var(--text-primary);
  font-family: inherit;
}
.global-search-input::placeholder { color: var(--text-tertiary); }
.global-search-kbd {
  font-size: 10.5px; font-weight: 700;
  padding: 3px 7px; border-radius: 5px;
  background: var(--bg-surface-3);
  color: var(--text-tertiary);
  border: 1px solid var(--border-default);
  letter-spacing: .5px;
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
}
.global-search-results {
  max-height: 60vh; overflow-y: auto;
  padding: 8px;
}
.global-search-section-label {
  font-size: 10.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .8px;
  color: var(--text-tertiary);
  padding: 12px 14px 6px;
}
.global-search-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: .12s;
  color: var(--text-primary);
}
.global-search-item:hover,
.global-search-item.focused {
  background: var(--bg-surface-3);
}
.global-search-item-icon {
  width: 34px; height: 34px;
  border-radius: 8px;
  background: var(--brand-50);
  color: var(--brand-600);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; flex-shrink: 0;
}
[data-theme="dark"] .global-search-item-icon,
[data-theme="dim"] .global-search-item-icon { background: rgba(99,102,241,.18); color: var(--brand-400); }
.global-search-item-body { flex: 1; min-width: 0; }
.global-search-item-title {
  font-size: 13.5px; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.global-search-item-meta {
  font-size: 11.5px; color: var(--text-tertiary);
  margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.global-search-item mark {
  background: rgba(245,158,11,.35);
  color: inherit; padding: 0 2px; border-radius: 3px;
}
.global-search-empty {
  padding: 40px 20px; text-align: center;
  color: var(--text-tertiary); font-size: 13.5px;
}
.global-search-empty i { font-size: 32px; opacity: .35; display: block; margin-bottom: 10px; color: var(--brand-400); }
.global-search-hint {
  padding: 10px 18px;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-surface-2);
  font-size: 11.5px;
  color: var(--text-tertiary);
  display: flex; gap: 14px; flex-wrap: wrap;
}
.global-search-hint kbd {
  font-size: 10px; font-weight: 700;
  padding: 2px 6px; border-radius: 4px;
  background: var(--bg-surface-3);
  color: var(--text-secondary);
  border: 1px solid var(--border-default);
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  margin: 0 2px;
}

/* ============================================================
   36. RESPONSIVE
   ============================================================ */
@media (max-width: 1200px) {
  :root {
    --card-min-course: 280px;
    --card-min-professor: 220px;
    --card-min-testimonial: 240px;
    --card-min-student: 260px;
    --gap-grid: 18px;
  }
}
@media (max-width: 1024px) {
  .main-content { padding: 24px 22px 44px; }
  .hero-section { padding: 40px 36px; }
  .section-card { padding: 26px 24px; }
  .editor-grid-3 { grid-template-columns: 1fr 1fr; }
  .admin-professor-grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  :root {
    --card-min-course: 250px;
    --card-min-professor: 200px;
    --card-min-testimonial: 220px;
    --card-min-student: 240px;
  }
  #appHeader { padding: 12px 16px; }
  .brand-text h1 { font-size: 15px; }
  .brand-icon { width: 38px; height: 38px; font-size: 17px; }
  .nav-toggle { display: inline-flex; order: 2; }
  .main-nav {
    order: 3; flex-basis: 100%;
    flex-direction: column; gap: 4px;
    padding: 0; max-height: 0; overflow: hidden;
    transition: max-height .3s var(--ease), padding .3s var(--ease);
  }
  .main-nav.open { max-height: 320px; padding: 10px 0 4px; }
  .main-nav a { padding: 11px 16px; border-radius: var(--radius-sm); background: rgba(255,255,255,.06); width: 100%; }
  .user-info {
    order: 4; flex-basis: 100%; justify-content: space-between;
    padding-top: 10px; border-top: 1px solid rgba(255,255,255,.1);
  }
  .editor-grid-2, .editor-grid-3 { grid-template-columns: 1fr; }
  .filter-bar { padding: 12px; }
  .filter-bar select { flex: 1; min-width: 0; }
}
@media (max-width: 640px) {
  :root { --gap-grid: 16px; --gap-card: 18px; }
  .main-content { padding: 18px 14px 36px; }
  .hero-section { flex-direction: column; text-align: center; padding: 32px 22px; border-radius: var(--radius-lg); }
  .hero-image { width: 110px; height: 110px; font-size: 52px; }
  .continue-card, .streak-card { flex-direction: column; align-items: flex-start; }
  .continue-btn { width: 100%; justify-content: center; }
  .section-card { padding: 22px 18px; }
  .course-grid, .professors-grid, .testimonials-slider,
  .admin-professor-grid, .student-grid { grid-template-columns: 1fr; }
  .material-list { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .stat-icon { width: 48px; height: 48px; font-size: 20px; border-radius: 12px; }
  .stat-card .num { font-size: 22px; }
  .course-detail-header { padding: 0; }
  .cd-content { padding: 18px 20px; }
  .cd-thumb { height: 140px; }
  .editor-hero { padding: 20px 22px; }
  .editor-hero h2 { font-size: 19px; }
  .editor-section { padding: 20px 18px; }
  .editor-tab { padding: 10px 16px; font-size: 12.5px; }
  .editor-footer { padding: 14px 16px; bottom: 8px; flex-direction: column; }
  .editor-footer-right { width: 100%; }
  .editor-footer-right .btn { flex: 1; }
  .modal-box { padding: 24px 20px; max-height: 92vh; }
  .modal-actions { flex-direction: column-reverse; }
  .modal-actions .btn { width: 100%; }
  .cred-row { grid-template-columns: 1fr; gap: 6px; }
  .cred-label { font-size: 11px; }
  .me-body { padding: 14px; }
  .me-actions { justify-content: stretch; }
  .me-actions .btn { flex: 1; }
  .admin-tabs { padding: 4px; }
  .admin-tab { padding: 10px 14px; font-size: 12.5px; }
  .tab-toolbar { flex-direction: column; align-items: stretch; }
  .tab-toolbar button { width: 100%; }
  .toast-container { bottom: 14px; right: 14px; left: 14px; width: auto; max-width: none; }
  .logout-text { display: none; }
  .btn-logout { padding: 8px 10px; }
  .user-name { max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
  .notif-dropdown { top: 72px; right: 8px; left: 8px; }
  .notif-list { max-height: 60vh; }

  /* PDF toolbar mobile */
  .pdfv-toolbar { padding: 8px 10px; gap: 6px; }
  .pdfv-title { max-width: 110px; font-size: 12px; }
  .pdfv-hlcount { display: none; }
  .pdfv-toolbar-center { order: 3; width: 100%; justify-content: center; margin-top: 4px; }
  .pdfv-hl-colors { padding: 2px; }
  .pdfv-color { width: 20px; height: 20px; }
  .pdfv-body { padding: 14px 0; }
  .pdfv-page { border-radius: 0; }
  .pdfv-zoomlabel { min-width: 40px; font-size: 11px; }
  .pdfv-back-btn { padding: 7px 11px; font-size: 12px; }

  /* Video player mobile */
  .vp-controls { padding: 40px 10px 10px; }
  .vp-btn { width: 34px; height: 34px; font-size: 14px; }
  .vp-time { font-size: 11.5px; padding: 0 4px; }
  .vp-speed-btn { padding: 6px 8px; font-size: 12px; min-width: 40px; }
  .vp-volume-wrap:hover .vp-volume { width: 70px; }
  .vp-volume input { width: 64px; }
  .vp-center-play { width: 68px; height: 68px; font-size: 24px; }
  .vp-title { font-size: 13px; padding: 12px 14px 12px 100px; }
  .vp-back-btn { top: 12px; left: 12px; padding: 7px 11px; font-size: 12px; }

  /* Playlists mobile */
  .playlist-editor-card { padding: 14px 16px; }
  .playlist-items-list { max-height: 180px; }
  .playlist-add-row { flex-direction: column; }
  .playlist-add-row .btn { width: 100%; }
  .playlist-banner { flex-direction: column; text-align: center; padding: 20px 18px; }
  .playlist-banner-icon { margin: 0 auto; }
  .vp-playlist-toggle span { display: none; }
  .vp-playlist-toggle { padding: 8px 11px; top: 12px; right: 12px; }
  .vp-playlist-panel { width: 100%; max-width: 100vw; }
  .vp-shell.playlist-open .vp-controls { padding-right: 18px; }
  .vp-shell.playlist-open .vp-title { padding-right: 22px; }
}
@media (max-width: 420px) {
  .pdfv-back-btn span,
  .vp-back-btn span { display: none; }
  .pdfv-back-btn { padding: 8px 11px; }
  .vp-back-btn { padding: 8px 11px; }
  .vp-title { padding-left: 60px; }
}
@media (max-width: 380px) {
  .stats-grid { grid-template-columns: 1fr; }
  .brand-text h1 { font-size: 14px; }
  .role-badge { font-size: 9.5px; padding: 2px 8px; }
  .theme-toggle { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}
@media print {
  #appHeader, .app-footer, .toast-container, .modal-overlay { display: none !important; }
  body { background: #fff; }
}
/* ============================================================
   37. STUDENT ANALYTICS DASHBOARD
   ============================================================ */

.analytics-loading {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 16px; padding: 80px 20px;
  color: var(--text-tertiary); font-size: 13.5px;
}

/* ---- Summary stat row ---- */
.analytics-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--gap-grid);
  margin-bottom: 24px;
}
.analytics-stat {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  display: flex; align-items: center; gap: 14px;
  transition: .25s var(--ease);
}
.analytics-stat:hover {
  transform: translateY(-3px);
  border-color: var(--brand-300);
  box-shadow: var(--shadow-md);
}
[data-theme="dark"] .analytics-stat:hover,
[data-theme="dim"] .analytics-stat:hover { border-color: var(--brand-500); }

.analytics-stat-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
  position: relative; overflow: hidden;
}
.analytics-stat-icon::before {
  content: ""; position: absolute; top: -30%; left: -30%;
  width: 160%; height: 160%;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.3), transparent 55%);
}
.analytics-stat-icon.tone-brand { background: linear-gradient(135deg, #818cf8, #4f46e5); color: #fff; box-shadow: 0 6px 16px rgba(99,102,241,.35); }
.analytics-stat-icon.tone-emerald { background: linear-gradient(135deg, #34d399, #059669); color: #fff; box-shadow: 0 6px 16px rgba(16,185,129,.35); }
.analytics-stat-icon.tone-gold { background: linear-gradient(135deg, #fbbf24, #d97706); color: #422006; box-shadow: 0 6px 16px rgba(245,158,11,.35); }
.analytics-stat-icon.tone-cyan { background: linear-gradient(135deg, #22d3ee, #0891b2); color: #fff; box-shadow: 0 6px 16px rgba(6,182,212,.35); }
.analytics-stat-icon.tone-rose { background: linear-gradient(135deg, #fb7185, #dc2626); color: #fff; box-shadow: 0 6px 16px rgba(239,68,68,.35); }

.analytics-stat-body { flex: 1; min-width: 0; }
.analytics-stat-num {
  font-size: 24px; font-weight: 800;
  color: var(--text-primary);
  line-height: 1.05; letter-spacing: -.5px;
}
.analytics-stat-label {
  font-size: 11.5px; font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase; letter-spacing: .5px;
  margin-top: 3px;
}

/* ---- Heatmap card ---- */
.analytics-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  margin-bottom: 24px;
}
.analytics-card-header {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; flex-wrap: wrap; margin-bottom: 18px;
}
.analytics-card-title {
  font-size: 15px; font-weight: 700;
  color: var(--text-primary);
  display: flex; align-items: center; gap: 10px;
}
.analytics-card-title i { color: var(--brand-500); }
.analytics-card-sub {
  font-size: 12.5px; color: var(--text-tertiary);
  margin-top: 3px;
}

/* ---- Heatmap grid ---- */
.heatmap-scroll {
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: thin;
}
.heatmap-scroll::-webkit-scrollbar { height: 6px; }
.heatmap-scroll::-webkit-scrollbar-thumb {
  background: var(--border-default); border-radius: 3px;
}
.heatmap-grid {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(7, 12px);
  grid-auto-columns: 12px;
  gap: 3px;
  width: max-content;
  padding: 2px;
}
.heatmap-cell {
  width: 12px; height: 12px;
  border-radius: 2px;
  background: var(--bg-surface-3);
  transition: transform .12s var(--ease);
  cursor: pointer;
}
.heatmap-cell:hover {
  transform: scale(1.35);
  outline: 1px solid var(--brand-500);
  z-index: 2;
}
.heatmap-cell[data-level="0"] { background: var(--bg-surface-3); }
.heatmap-cell[data-level="1"] { background: #a7f3d0; }
.heatmap-cell[data-level="2"] { background: #6ee7b7; }
.heatmap-cell[data-level="3"] { background: #34d399; }
.heatmap-cell[data-level="4"] { background: #059669; }
[data-theme="dark"] .heatmap-cell[data-level="0"],
[data-theme="dim"] .heatmap-cell[data-level="0"] { background: #1e2748; }
[data-theme="dark"] .heatmap-cell[data-level="1"],
[data-theme="dim"] .heatmap-cell[data-level="1"] { background: #064e3b; }
[data-theme="dark"] .heatmap-cell[data-level="2"],
[data-theme="dim"] .heatmap-cell[data-level="2"] { background: #047857; }
[data-theme="dark"] .heatmap-cell[data-level="3"],
[data-theme="dim"] .heatmap-cell[data-level="3"] { background: #10b981; }
[data-theme="dark"] .heatmap-cell[data-level="4"],
[data-theme="dim"] .heatmap-cell[data-level="4"] { background: #34d399; }

.heatmap-footer {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; flex-wrap: wrap;
  margin-top: 14px;
  font-size: 11.5px; color: var(--text-tertiary);
}
.heatmap-legend {
  display: flex; align-items: center; gap: 6px;
}
.heatmap-legend-swatches {
  display: flex; gap: 3px;
}
.heatmap-legend-swatches span {
  width: 11px; height: 11px;
  border-radius: 2px;
}

/* ---- Charts row ---- */
.analytics-charts-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap-grid);
  margin-bottom: 24px;
}
@media (max-width: 900px) {
  .analytics-charts-row { grid-template-columns: 1fr; }
}
.chart-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  min-height: 320px;
  display: flex; flex-direction: column;
}
.chart-card-title {
  font-size: 14px; font-weight: 700;
  color: var(--text-primary);
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 14px;
}
.chart-card-title i { color: var(--brand-500); font-size: 13px; }
.chart-wrap {
  position: relative;
  flex: 1;
  min-height: 240px;
}
.chart-wrap canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

/* ---- Empty state ---- */
.analytics-empty {
  text-align: center; padding: 60px 20px;
  color: var(--text-tertiary);
  background: var(--bg-surface-2);
  border-radius: var(--radius-lg);
  border: 1.5px dashed var(--border-default);
}
.analytics-empty i {
  font-size: 42px; opacity: .4;
  margin-bottom: 12px; display: block;
  color: var(--brand-400);
}
.analytics-empty h3 {
  font-size: 16px; font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.analytics-empty p {
  font-size: 13.5px;
  max-width: 400px; margin: 0 auto;
  line-height: 1.55;
}

/* ---- Course progress list ---- */
.course-progress-list {
  display: flex; flex-direction: column; gap: 12px;
}
.course-progress-row {
  display: flex; flex-direction: column; gap: 6px;
}
.course-progress-top {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 10px;
}
.course-progress-name {
  font-size: 13px; font-weight: 600;
  color: var(--text-primary);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  min-width: 0;
}
.course-progress-pct {
  font-size: 12px; font-weight: 700;
  color: var(--brand-600);
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}
[data-theme="dark"] .course-progress-pct,
[data-theme="dim"] .course-progress-pct { color: var(--brand-400); }
.course-progress-track {
  height: 8px;
  background: var(--bg-surface-3);
  border-radius: 999px;
  overflow: hidden;
}
.course-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--brand-500), var(--accent-500));
  border-radius: 999px;
  transition: width .6s var(--ease);
}
.course-progress-meta {
  font-size: 11.5px;
  color: var(--text-tertiary);
}

/* ---- Responsive ---- */
@media (max-width: 640px) {
  .analytics-card { padding: 18px 16px; }
  .analytics-stat { padding: 14px 16px; }
  .analytics-stat-icon { width: 40px; height: 40px; font-size: 17px; border-radius: 10px; }
  .analytics-stat-num { font-size: 20px; }
  .chart-card { padding: 16px 14px; min-height: 280px; }
  .heatmap-cell { width: 10px; height: 10px; }
  .heatmap-grid { grid-template-rows: repeat(7, 10px); grid-auto-columns: 10px; gap: 2px; }
}
/* ============================================================
   38. ANALYTICS — LAYOUT ISOLATION (v2)
   ============================================================ */

/* Force every analytics section to be its own block. No overlap. */
#analyticsContent {
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: 100%;
}

#analyticsContent > * {
  display: block;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  flex-shrink: 0;
}

/* Remove the individual margin-bottoms now that we use gap */
#analyticsContent > .analytics-summary,
#analyticsContent > .analytics-card,
#analyticsContent > .analytics-charts-row {
  margin-bottom: 0;
}

/* ---- Course progress — each row is its own visible card ---- */
.course-progress-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.course-progress-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 16px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: .2s var(--ease);
}

.course-progress-row:hover {
  border-color: var(--brand-300);
  background: var(--bg-surface);
}

[data-theme="dark"] .course-progress-row:hover,
[data-theme="dim"] .course-progress-row:hover {
  border-color: var(--brand-500);
}

.course-progress-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

.course-progress-name {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.course-progress-pct {
  font-size: 13px;
  font-weight: 800;
  color: var(--brand-600);
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

[data-theme="dark"] .course-progress-pct,
[data-theme="dim"] .course-progress-pct {
  color: var(--brand-400);
}

.course-progress-track {
  height: 8px;
  background: var(--bg-surface-3);
  border-radius: 999px;
  overflow: hidden;
}

.course-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--brand-500), var(--accent-500));
  border-radius: 999px;
  transition: width .6s var(--ease);
}

.course-progress-meta {
  font-size: 11.5px;
  color: var(--text-tertiary);
  font-weight: 500;
}

/* ---- Section headers get an icon chip for extra separation ---- */
.analytics-card-header {
  padding-bottom: 14px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
}

/* ---- Two column charts row must not collapse ---- */
.analytics-charts-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap-grid);
  align-items: stretch;
}

.analytics-charts-row > .chart-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 340px;
}

.analytics-charts-row .chart-wrap {
  position: relative;
  flex: 1;
  min-height: 240px;
  width: 100%;
}

.analytics-charts-row .chart-wrap canvas {
  position: absolute !important;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  display: block;
}

@media (max-width: 900px) {
  .analytics-charts-row { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  #analyticsContent { gap: 18px; }
  .course-progress-row { padding: 12px 14px; gap: 6px; }
  .course-progress-name { font-size: 12.5px; }
  .analytics-charts-row > .chart-card { min-height: 280px; }
  .analytics-charts-row .chart-wrap { min-height: 200px; }
}
/* ============================================================
   39. BULK EMAIL TO STUDENTS
   ============================================================ */

/* ---- Selection toolbar above student grid ---- */
.student-selection-bar {
  display: flex; align-items: center; gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px;
  margin-bottom: 18px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}
.student-selection-bar:empty { display: none; }

.selection-master-checkbox {
  display: inline-flex; align-items: center; gap: 8px;
  cursor: pointer; user-select: none;
  font-size: 13px; font-weight: 600;
  color: var(--text-primary);
}
.selection-master-checkbox input[type="checkbox"] {
  width: 16px; height: 16px;
  accent-color: var(--brand-600);
  cursor: pointer;
  flex-shrink: 0;
}
.selection-master-label { line-height: 1; }

.selection-bar-spacer { flex: 1; }

.selection-count {
  font-size: 12.5px;
  color: var(--text-tertiary);
  font-weight: 500;
}
.selection-count strong {
  color: var(--brand-600);
  font-weight: 800;
  font-size: 13.5px;
}
[data-theme="dark"] .selection-count strong,
[data-theme="dim"] .selection-count strong { color: var(--brand-400); }

/* ---- Student card selection ---- */
.student-card { position: relative; }
.student-card.selected {
  border-color: var(--brand-500) !important;
  background: linear-gradient(135deg, rgba(99,102,241,.06), rgba(6,182,212,.03));
  box-shadow: 0 0 0 2px rgba(99,102,241,.2), var(--shadow-md);
}
[data-theme="dark"] .student-card.selected,
[data-theme="dim"] .student-card.selected {
  background: linear-gradient(135deg, rgba(99,102,241,.14), rgba(6,182,212,.06));
}
.student-card.no-email {
  opacity: .72;
}

.student-select-checkbox {
  position: absolute;
  top: 12px; left: 12px;
  z-index: 3;
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px;
  cursor: pointer;
}
.student-select-checkbox input[type="checkbox"] {
  position: absolute; opacity: 0; pointer-events: none;
}
.student-select-box {
  display: block;
  width: 20px; height: 20px;
  border-radius: 6px;
  background: var(--bg-surface);
  border: 2px solid var(--border-strong);
  transition: .2s var(--ease);
  position: relative;
  flex-shrink: 0;
}
.student-select-box::after {
  content: "";
  position: absolute;
  left: 5px; top: 1.5px;
  width: 5px; height: 10px;
  border: solid #fff;
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg) scale(0);
  transition: transform .18s var(--ease-spring);
}
.student-select-checkbox input:checked ~ .student-select-box {
  background: var(--brand-600);
  border-color: var(--brand-600);
}
.student-select-checkbox input:checked ~ .student-select-box::after {
  transform: rotate(45deg) scale(1);
}
.student-select-checkbox input:disabled ~ .student-select-box {
  opacity: .4;
  cursor: not-allowed;
  background: var(--bg-surface-3);
}
.student-select-checkbox:hover .student-select-box {
  border-color: var(--brand-500);
}
.student-select-checkbox input:focus-visible ~ .student-select-box {
  outline: 2px solid var(--brand-500);
  outline-offset: 2px;
}

/* Push header content right so checkbox doesn't overlap */
.student-card-header { padding-left: 30px; }

/* ---- Email Modal ---- */
.email-modal {
  max-width: 620px !important;
  padding: 0 !important;
  overflow: hidden !important;
}
.email-modal-header {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 22px 26px 18px;
  border-bottom: 1px solid var(--border-subtle);
  background: linear-gradient(135deg, rgba(99,102,241,.08), rgba(6,182,212,.03));
  position: relative;
}
[data-theme="dark"] .email-modal-header,
[data-theme="dim"] .email-modal-header {
  background: linear-gradient(135deg, rgba(99,102,241,.14), rgba(6,182,212,.06));
}
.email-modal-icon {
  width: 46px; height: 46px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--brand-600), var(--accent-500));
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
  box-shadow: 0 6px 18px rgba(99,102,241,.35);
  position: relative; overflow: hidden;
}
.email-modal-icon::before {
  content: ""; position: absolute; top: -30%; left: -30%;
  width: 160%; height: 160%;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.35), transparent 55%);
  pointer-events: none;
}
.email-modal-heading { flex: 1; min-width: 0; }
.email-modal-heading h3 {
  font-size: 17px; font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 4px !important;
  letter-spacing: -.2px;
}
.email-modal-heading .modal-sub {
  margin-bottom: 0 !important;
  font-size: 12.5px !important;
  line-height: 1.5;
}
.email-modal-close {
  background: transparent; border: none;
  color: var(--text-tertiary); cursor: pointer;
  width: 32px; height: 32px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  transition: .15s;
  flex-shrink: 0;
}
.email-modal-close:hover { background: var(--bg-surface-3); color: var(--text-primary); }

#emailStudentsForm {
  padding: 22px 26px 24px;
}

/* ---- Recipient chip preview ---- */
.email-recipient-preview {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 12px 26px;
  background: var(--bg-surface-2);
  border-bottom: 1px solid var(--border-subtle);
  max-height: 120px;
  overflow-y: auto;
}
.email-recipient-preview:empty { display: none; }
.email-recipient-chip {
  display: inline-flex; align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}
.email-recipient-chip.more {
  background: var(--brand-50);
  border-color: var(--brand-200);
  color: var(--brand-700);
  font-weight: 700;
}
[data-theme="dark"] .email-recipient-chip.more,
[data-theme="dim"] .email-recipient-chip.more {
  background: rgba(99,102,241,.18);
  border-color: rgba(99,102,241,.35);
  color: var(--brand-300);
}

/* ---- Info banner ---- */
.email-modal-info {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 11px 14px;
  background: rgba(16,185,129,.08);
  border: 1px solid rgba(16,185,129,.25);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  color: var(--emerald-700);
  line-height: 1.5;
  margin-top: 8px;
}
[data-theme="dark"] .email-modal-info,
[data-theme="dim"] .email-modal-info { color: var(--emerald-400); }
.email-modal-info i {
  color: var(--emerald-500);
  flex-shrink: 0;
  margin-top: 2px;
  font-size: 13px;
}

#emailBody {
  font-family: inherit;
  min-height: 160px;
  resize: vertical;
  line-height: 1.55;
}

/* ---- Mobile ---- */
@media (max-width: 640px) {
  .student-selection-bar {
    padding: 10px 12px;
    gap: 8px;
  }
  .student-selection-bar .btn {
    flex: 1;
    justify-content: center;
  }
  .selection-count { font-size: 11.5px; }
  .email-modal-header { padding: 18px 18px 14px; }
  #emailStudentsForm { padding: 18px 18px 20px; }
  .email-recipient-preview { padding: 10px 18px; }
  .email-modal-heading h3 { font-size: 15.5px; }
  .email-modal-icon { width: 40px; height: 40px; font-size: 17px; }
}
/* ============================================================
   40. EMAIL REPORT MODAL
   ============================================================ */
.email-report-modal {
  max-width: 600px !important;
}
.email-report-header {
  display: flex; align-items: flex-start; gap: 14px;
  margin-bottom: 20px;
}
.email-report-icon {
  width: 48px; height: 48px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; flex-shrink: 0;
  position: relative; overflow: hidden;
}
.email-report-icon::before {
  content: ""; position: absolute; top: -30%; left: -30%;
  width: 160%; height: 160%;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.35), transparent 55%);
}
.email-report-icon.ok {
  background: linear-gradient(135deg, #34d399, #059669);
  color: #fff;
  box-shadow: 0 8px 20px rgba(16,185,129,.4);
}
.email-report-icon.warn {
  background: linear-gradient(135deg, #fbbf24, #d97706);
  color: #422006;
  box-shadow: 0 8px 20px rgba(245,158,11,.4);
}
.email-report-header h3 {
  font-size: 18px; font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.email-report-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  padding: 14px 16px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: 18px;
}
.email-report-stat { text-align: center; }
.email-report-stat .num {
  font-size: 22px; font-weight: 800;
  color: var(--text-primary);
  line-height: 1.1; letter-spacing: -.4px;
}
.email-report-stat .num.ok  { color: var(--emerald-600); }
[data-theme="dark"] .email-report-stat .num.ok,
[data-theme="dim"] .email-report-stat .num.ok { color: var(--emerald-400); }
.email-report-stat .num.bad { color: var(--rose-600); }
[data-theme="dark"] .email-report-stat .num.bad,
[data-theme="dim"] .email-report-stat .num.bad { color: var(--rose-400); }
.email-report-stat .num.skip { color: var(--gold-600); }
[data-theme="dark"] .email-report-stat .num.skip,
[data-theme="dim"] .email-report-stat .num.skip { color: var(--gold-400); }
.email-report-stat .label {
  font-size: 10.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .6px;
  color: var(--text-tertiary);
  margin-top: 2px;
}

.email-report-section {
  margin-bottom: 16px;
}
.email-report-section-title {
  font-size: 12px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .7px;
  color: var(--text-tertiary);
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 8px;
}
.email-report-section-title i { color: var(--rose-500); }

.email-report-list {
  display: flex; flex-direction: column; gap: 8px;
  max-height: 300px; overflow-y: auto;
  padding: 8px;
  background: var(--bg-surface-2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}
.email-report-row {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 12px;
  background: var(--bg-surface);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}
.email-report-row.error { border-left: 3px solid var(--rose-500); }
.email-report-row-icon {
  width: 22px; height: 22px; border-radius: 50%;
  background: rgba(239,68,68,.12);
  color: var(--rose-600);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; flex-shrink: 0; margin-top: 1px;
}
.email-report-row-body { flex: 1; min-width: 0; }
.email-report-row-title {
  font-size: 13px; font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1px;
}
.email-report-row-meta {
  font-size: 11.5px;
  color: var(--text-tertiary);
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  margin-bottom: 4px;
  word-break: break-all;
}
.email-report-row-error {
  font-size: 12px;
  color: var(--rose-600);
  line-height: 1.45;
  padding: 6px 8px;
  background: rgba(239,68,68,.06);
  border-radius: 4px;
  word-break: break-word;
}
[data-theme="dark"] .email-report-row-error,
[data-theme="dim"] .email-report-row-error { color: var(--rose-400); }

.email-report-hint {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 14px;
  background: rgba(245,158,11,.08);
  border: 1px solid rgba(245,158,11,.28);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  color: var(--gold-700, var(--gold-600));
  line-height: 1.55;
  margin-bottom: 16px;
}
[data-theme="dark"] .email-report-hint,
[data-theme="dim"] .email-report-hint { color: var(--gold-400); }
.email-report-hint i {
  color: var(--gold-500);
  flex-shrink: 0; margin-top: 2px;
}
.email-report-hint ul { list-style: none; }
.email-report-hint li { margin-bottom: 2px; }

.email-report-hint-text {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.5;
  padding: 10px 12px;
  background: var(--bg-surface-2);
  border-radius: var(--radius-sm);
}

@media (max-width: 640px) {
  .email-report-stats { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .email-report-stat .num { font-size: 20px; }
}

/* ============================================================
   42. FULL PAGE FORMS & EXPANDED PROFESSOR CARDS
   ============================================================ */

/* Ensure full-page views have proper padding */
.view .editor-body {
  max-width: 1000px;
  margin: 0 auto;
}

/* Contact block inside Professor Cards */
.prof-contact-block {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.prof-contact-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-secondary);
}

.prof-contact-item i {
  color: var(--brand-500);
  width: 14px;
  text-align: center;
  font-size: 12px;
}

/* Better spacing for the new full-page form sections */
#addCourseFormContent .editor-section,
#addProfessorFormContent .editor-section,
#addMaterialFormContent .editor-section {
  margin-bottom: 24px;
}

#addCourseFormContent .editor-section:last-child,
#addProfessorFormContent .editor-section:last-child,
#addMaterialFormContent .editor-section:last-child {
  margin-bottom: 0;
}

/* Make the thumbnail editor stack nicely on mobile for the new professor form */
@media (max-width: 640px) {
  .thumbnail-editor {
    flex-direction: column;
    align-items: stretch;
  }
  .thumbnail-actions {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .thumbnail-actions .btn {
    flex: 1;
  }
}
/* ============================================================
   43. INLINE "NEW MATERIAL" CARD — lives inside course editor
   ============================================================ */
.material-editor-new {
  border: 2px dashed var(--emerald-500) !important;
  background: linear-gradient(135deg, rgba(16,185,129,.04), rgba(52,211,153,.02));
}
[data-theme="dark"] .material-editor-new,
[data-theme="dim"] .material-editor-new {
  background: linear-gradient(135deg, rgba(16,185,129,.10), rgba(52,211,153,.04));
}
.material-editor-new[open] {
  border-color: var(--emerald-500) !important;
  box-shadow: 0 0 0 3px rgba(16,185,129,.15), var(--shadow-md);
}
.material-editor-new > summary {
  background: linear-gradient(135deg, rgba(16,185,129,.10), rgba(52,211,153,.04)) !important;
}
.material-editor-new > summary:hover {
  background: linear-gradient(135deg, rgba(16,185,129,.18), rgba(52,211,153,.08)) !important;
}
.material-editor-new[open] > summary {
  background: var(--bg-surface) !important;
}
.material-editor-new .me-index {
  background: var(--emerald-500);
  color: #fff;
  font-size: 15px;
  font-weight: 900;
  width: 22px;
  height: 22px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.material-editor-new .mat-type {
  background: linear-gradient(135deg, var(--emerald-600), var(--emerald-500)) !important;
}

/* Optional: highlight the new card slightly when scrolled to */
@keyframes newMatPulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(16,185,129,.15), var(--shadow-md); }
  50%      { box-shadow: 0 0 0 6px rgba(16,185,129,.28), var(--shadow-md); }
}
.material-editor-new.flash {
  animation: newMatPulse 1s ease-in-out 2;
}
/* ============================================================
   43. FIX: Bookmark button overlapping course-code (no-thumb cards)
   ============================================================ */
.course-card:not(.has-thumb) .course-code {
  padding-left: 44px;    /* reserve space for the left bookmark btn */
  padding-right: 44px;   /* reserve space for the admin delete btn */
  min-height: 34px;
  align-items: center;
}
/* Admin cards render only the delete button (no bookmark) — drop
   the left gutter so the code chip hugs the edge. */
.course-card:not(.has-thumb):not(:has(.bookmark-btn)) .course-code {
  padding-left: 0;
}
/* ============================================================
   44. SUBSCRIPTION / AUTO-PAY
   ============================================================ */

/* ---- Student home: subscribe banner ---- */
.subscribe-banner {
  display: flex; align-items: center; gap: 18px;
  padding: 20px 24px; margin-bottom: 22px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(99,102,241,.14), rgba(6,182,212,.06));
  border: 1.5px solid rgba(99,102,241,.35);
  position: relative; overflow: hidden;
}
[data-theme="dark"] .subscribe-banner,
[data-theme="dim"] .subscribe-banner {
  background: linear-gradient(135deg, rgba(99,102,241,.20), rgba(6,182,212,.10));
}
.subscribe-banner-icon {
  width: 56px; height: 56px; border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--brand-600), var(--accent-500));
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; flex-shrink: 0;
  box-shadow: 0 6px 18px rgba(99,102,241,.35);
}
.subscribe-banner-info { flex: 1; min-width: 0; }
.subscribe-banner-info h4 {
  font-size: 16px; font-weight: 800; color: var(--text-primary);
  margin-bottom: 4px;
}
.subscribe-banner-info p {
  font-size: 13px; color: var(--text-secondary); line-height: 1.5;
}
.subscribe-banner .btn { flex-shrink: 0; }

/* ---- Active subscription status pill ---- */
.subscribe-active-banner {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 20px; margin-bottom: 20px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(16,185,129,.12), rgba(52,211,153,.05));
  border: 1.5px solid rgba(16,185,129,.35);
}
.subscribe-active-icon {
  width: 44px; height: 44px; border-radius: 12px;
  background: linear-gradient(135deg, var(--emerald-600), var(--emerald-500));
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
}
.subscribe-active-info { flex: 1; min-width: 0; }
.subscribe-active-info h4 {
  font-size: 14.5px; font-weight: 800; color: var(--emerald-700);
  margin-bottom: 2px;
}
[data-theme="dark"] .subscribe-active-info h4,
[data-theme="dim"] .subscribe-active-info h4 { color: var(--emerald-400); }
.subscribe-active-info p {
  font-size: 12.5px; color: var(--text-tertiary); font-weight: 500;
}

/* ---- Course detail: subscribe CTA for premium course ---- */
.subscribe-cta {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; flex-wrap: wrap;
  padding: 14px 18px; margin-bottom: 16px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(99,102,241,.10), rgba(6,182,212,.04));
  border: 1px solid rgba(99,102,241,.28);
  font-size: 13.5px;
}
.subscribe-cta .subscribe-cta-text {
  display: flex; align-items: center; gap: 10px;
  color: var(--brand-700); font-weight: 600;
}
[data-theme="dark"] .subscribe-cta .subscribe-cta-text,
[data-theme="dim"] .subscribe-cta .subscribe-cta-text { color: var(--brand-300); }

/* ---- Admin: subscription dashboard ---- */
.sub-settings-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 22px 24px; margin-bottom: 20px;
}
.sub-settings-card h3 {
  font-size: 15px; font-weight: 700; color: var(--text-primary);
  display: flex; align-items: center; gap: 10px; margin-bottom: 16px;
}
.sub-settings-card h3 i { color: var(--brand-500); }

.sub-settings-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
  margin-bottom: 14px;
}
@media (max-width: 640px) { .sub-settings-grid { grid-template-columns: 1fr; } }

.sub-toggle-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 12px 14px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  margin-top: 6px;
}
.sub-toggle-row label {
  font-size: 13.5px; font-weight: 600; color: var(--text-primary);
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
}

.subscriber-list {
  display: flex; flex-direction: column; gap: 10px;
}
.subscriber-row {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 18px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: .2s var(--ease);
}
.subscriber-row:hover {
  border-color: var(--brand-300);
  box-shadow: var(--shadow-sm);
}
.subscriber-row.active { border-left: 4px solid var(--emerald-500); }
.subscriber-row.expired { border-left: 4px solid var(--gold-500); }
.subscriber-row.cancelled { border-left: 4px solid var(--rose-500); }

.subscriber-avatar {
  width: 42px; height: 42px; border-radius: 50%;
  background: linear-gradient(135deg, #22d3ee, #0891b2);
  color: #fff; font-weight: 800; font-size: 15px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.subscriber-info { flex: 1; min-width: 0; }
.subscriber-info h4 {
  font-size: 14px; font-weight: 700; color: var(--text-primary);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.subscriber-info p {
  font-size: 12px; color: var(--text-tertiary);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  margin-top: 2px;
}
.subscriber-status {
  font-size: 11px; font-weight: 800;
  padding: 4px 10px; border-radius: 999px;
  text-transform: uppercase; letter-spacing: .4px;
  flex-shrink: 0;
}
.subscriber-status.active { background: rgba(16,185,129,.15); color: var(--emerald-600); }
.subscriber-status.expired { background: rgba(245,158,11,.15); color: var(--gold-600); }
.subscriber-status.cancelled { background: rgba(239,68,68,.15); color: var(--rose-600); }
.subscriber-status.pending { background: rgba(99,102,241,.15); color: var(--brand-600); }
.subscriber-status.admin {
  background: linear-gradient(135deg, var(--gold-400), var(--gold-500));
  color: #422006;
  box-shadow: 0 2px 8px rgba(245,158,11,.35);
}
[data-theme="dark"] .subscriber-status.admin,
[data-theme="dim"]   .subscriber-status.admin {
  color: #422006;
}
[data-theme="dark"] .subscriber-status.active,
[data-theme="dim"] .subscriber-status.active { color: var(--emerald-400); }
[data-theme="dark"] .subscriber-status.expired,
[data-theme="dim"] .subscriber-status.expired { color: var(--gold-400); }
[data-theme="dark"] .subscriber-status.cancelled,
[data-theme="dim"] .subscriber-status.cancelled { color: var(--rose-400); }
[data-theme="dark"] .subscriber-status.pending,
[data-theme="dim"] .subscriber-status.pending { color: var(--brand-300); }

.subscriber-meta { font-size: 11.5px; color: var(--text-tertiary); flex-shrink: 0; }
.subscriber-actions { display: flex; gap: 6px; flex-shrink: 0; }
.subscriber-actions .btn { font-size: 11.5px; padding: 5px 9px; }

@media (max-width: 640px) {
  .subscriber-row { flex-wrap: wrap; }
  .subscriber-actions { width: 100%; justify-content: flex-end; margin-top: 6px; }
}
/* ============================================================
   45. PREMIUM BADGE — UNLOCKED (for subscribers)
   ============================================================ */
.premium-badge.premium-unlocked {
  background: linear-gradient(135deg, var(--emerald-500), var(--emerald-400));
  color: #062a1e;
  box-shadow: 0 3px 10px rgba(16,185,129,.35);
}
[data-theme="dark"] .premium-badge.premium-unlocked,
[data-theme="dim"] .premium-badge.premium-unlocked {
  color: #042019;
}
/* ============================================================
   46. QUIZ EDITOR — full-page upgrades
   ============================================================ */
.quiz-edit-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-xs);
}
.quiz-options-block { margin-top: 6px; }
.quiz-option-row { align-items: center; }

.matrix-match-block .quiz-play-letter { width: 26px; height: 26px; font-size: 12px; }
.matrix-match-student { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.matrix-match-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  background: var(--bg-surface-2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}
.matrix-match-item { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; font-size: 13.5px; }
.matrix-arrow { color: var(--text-tertiary); font-size: 16px; }
.matrix-match-row select {
  min-width: 180px; padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-default);
  background: var(--bg-surface); color: var(--text-primary);
  font-family: inherit; font-size: 13px;
}

.quiz-paper-header {
  display: flex; gap: 14px; flex-wrap: wrap;
  padding: 10px 14px;
  background: var(--bg-surface-2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  font-size: 12.5px; font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.quiz-paper-header i { color: var(--brand-500); margin-right: 4px; }

.matrix-result-table {
  width: 100%; border-collapse: collapse; margin-top: 6px;
  font-size: 12.5px;
}
.matrix-result-table th, .matrix-result-table td {
  padding: 6px 8px; text-align: left;
  border-bottom: 1px solid var(--border-subtle);
}
.matrix-result-table th { font-weight: 700; color: var(--text-tertiary); }
.matrix-result-table tr.ok-row  td:first-child { border-left: 3px solid var(--emerald-500); }
.matrix-result-table tr.bad-row td:first-child { border-left: 3px solid var(--rose-500); }

/* LaTeX display adjustment */
.latex-content .katex { font-size: 1em; }
.latex-content .katex-display { margin: 8px 0; }
/* ============================================================
   47. QUIZ OVERVIEW — Quizzes tab in course editor
   ============================================================ */
.quiz-overview-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  margin-bottom: 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  transition: .2s var(--ease);
}
.quiz-overview-card:hover {
  border-color: var(--brand-300);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
[data-theme="dark"] .quiz-overview-card:hover,
[data-theme="dim"] .quiz-overview-card:hover {
  border-color: var(--brand-500);
}
.quiz-overview-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 0;
}
.quiz-overview-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}
.quiz-overview-icon::before {
  content: "";
  position: absolute;
  top: -30%; left: -30%;
  width: 160%; height: 160%;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.3), transparent 55%);
}
.quiz-overview-icon.has-quiz {
  background: linear-gradient(135deg, #34d399, #059669);
  color: #fff;
  box-shadow: 0 6px 16px rgba(16,185,129,.35);
}
.quiz-overview-icon.no-quiz {
  background: linear-gradient(135deg, #94a3b8, #64748b);
  color: #fff;
  box-shadow: 0 6px 16px rgba(100,116,139,.3);
}
.quiz-overview-info { flex: 1; min-width: 0; }
.quiz-overview-title {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}
.quiz-overview-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.quiz-overview-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.quiz-summary-tiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.quiz-summary-tile {
  text-align: center;
  padding: 18px 12px;
  background: var(--bg-surface-2);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}
.quiz-summary-num {
  font-size: 28px;
  font-weight: 800;
  color: var(--brand-600);
  line-height: 1;
  letter-spacing: -.5px;
}
[data-theme="dark"] .quiz-summary-num,
[data-theme="dim"] .quiz-summary-num { color: var(--brand-400); }
.quiz-summary-lbl {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: .6px;
  margin-top: 6px;
}

.mat-quiz-badge.empty {
  background: rgba(148,163,184,.15);
  color: #64748b;
}
[data-theme="dark"] .mat-quiz-badge.empty,
[data-theme="dim"] .mat-quiz-badge.empty {
  background: rgba(148,163,184,.2);
  color: #cbd5e1;
}

/* Keep the quiz button always clickable inside the summary */
.me-summary-right button {
  cursor: pointer;
  pointer-events: auto;
}

@media (max-width: 640px) {
  .quiz-overview-card {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .quiz-overview-actions {
    width: 100%;
    justify-content: flex-end;
  }
  .quiz-overview-actions .btn { flex: 1; justify-content: center; }
  .quiz-summary-tiles { grid-template-columns: 1fr; }
  .me-summary-right button span { display: none; }
  .me-summary-right button { padding: 6px 10px; }
}
/* ============================================================
   48. Real-time LaTeX preview
   ============================================================ */
.quiz-option-input-wrap { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }

.latex-preview {
  position: relative;
  min-height: 34px;
  padding: 8px 12px;
  background: linear-gradient(135deg, rgba(99,102,241,.05), rgba(6,182,212,.02));
  border: 1px dashed rgba(99,102,241,.35);
  border-left: 3px solid var(--brand-500);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text-primary);
  line-height: 1.5;
  word-break: break-word;
  overflow-x: auto;
  transition: .2s var(--ease);
}
[data-theme="dark"] .latex-preview,
[data-theme="dim"] .latex-preview {
  background: linear-gradient(135deg, rgba(99,102,241,.12), rgba(6,182,212,.04));
  border-color: rgba(99,102,241,.45);
}
.latex-preview::before {
  content: "PREVIEW";
  position: absolute;
  top: 4px; right: 8px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.2px;
  color: var(--brand-500);
  opacity: .55;
}
.latex-preview.is-empty {
  display: flex;
  align-items: center;
  color: var(--text-tertiary);
  font-style: italic;
  font-size: 12.5px;
}
.latex-preview.is-empty::after {
  content: "Live preview appears here as you type…";
}
.latex-preview.is-empty::before { content: ""; }

body.hide-latex-previews .latex-preview { display: none; }

/* ============================================================
   49. Editor header chips + reorder buttons
   ============================================================ */
.quiz-question-marks-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px;
  font-size: 11px; font-weight: 700;
  background: rgba(16,185,129,.12);
  color: var(--emerald-600);
  border-radius: var(--radius-pill);
  letter-spacing: .3px;
}
[data-theme="dark"] .quiz-question-marks-badge,
[data-theme="dim"] .quiz-question-marks-badge {
  background: rgba(16,185,129,.2);
  color: var(--emerald-400);
}
.quiz-question-controls { display: flex; gap: 4px; align-items: center; }
.quiz-icon-btn {
  width: 30px; height: 30px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-tertiary);
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px;
  transition: .15s var(--ease);
  padding: 0;
}
.quiz-icon-btn:hover:not(:disabled) {
  background: var(--brand-50);
  color: var(--brand-600);
  border-color: var(--brand-300);
  transform: translateY(-1px);
}
[data-theme="dark"] .quiz-icon-btn:hover:not(:disabled),
[data-theme="dim"] .quiz-icon-btn:hover:not(:disabled) {
  background: rgba(99,102,241,.15);
  border-color: var(--brand-500);
  color: var(--brand-300);
}
.quiz-icon-btn.danger:hover {
  background: var(--rose-500);
  color: #fff;
  border-color: var(--rose-500);
}
.quiz-icon-btn:disabled { opacity: .35; cursor: not-allowed; }

/* ============================================================
   50. FULL-SCREEN STUDENT TEST INTERFACE
   ============================================================ */
#quizPlayerModal { padding: 0 !important; align-items: stretch !important; }

#quizPlayerModal .modal-box {
  display: flex !important;
  flex-direction: column !important;
  width: 100vw !important;
  max-width: 100vw !important;
  height: 100vh !important;
  max-height: 100vh !important;
  margin: 0 !important;
  border-radius: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  animation: none !important;
}

#quizPlayerModal .modal-box > h3 {
  margin: 0 !important;
  padding: 18px 26px 6px !important;
  background: linear-gradient(135deg, rgba(99,102,241,.06), rgba(6,182,212,.02));
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
  font-size: 20px;
  letter-spacing: -.2px;
}
[data-theme="dark"] #quizPlayerModal .modal-box > h3,
[data-theme="dim"] #quizPlayerModal .modal-box > h3 {
  background: linear-gradient(135deg, rgba(99,102,241,.14), rgba(6,182,212,.05));
}

#quizPlayerModal .modal-box > .modal-sub {
  margin: 0 !important;
  padding: 0 26px 14px !important;
  background: linear-gradient(135deg, rgba(99,102,241,.06), rgba(6,182,212,.02));
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}
[data-theme="dark"] #quizPlayerModal .modal-box > .modal-sub,
[data-theme="dim"] #quizPlayerModal .modal-box > .modal-sub {
  background: linear-gradient(135deg, rgba(99,102,241,.14), rgba(6,182,212,.05));
}

#quizPlayerModal .modal-box > #quizPlayerBody {
  flex: 1;
  overflow-y: auto;
  padding: 24px 26px 30px;
  background: var(--bg-page);
  scroll-behavior: smooth;
}

#quizPlayerModal .modal-box > .modal-actions {
  margin: 0 !important;
  padding: 14px 26px !important;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  flex-shrink: 0;
  align-items: center;
  gap: 12px;
}
#quizPlayerModal .modal-actions .quiz-progress-indicator {
  margin-right: auto;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  background: var(--bg-surface-2);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle);
  letter-spacing: .2px;
}

#quizPlayerModal .quiz-play-card {
  max-width: 880px;
  margin-left: auto;
  margin-right: auto;
  border-left: 3px solid transparent;
  transition: .2s var(--ease);
}
#quizPlayerModal .quiz-play-card.answered {
  border-left-color: var(--emerald-500);
  background: linear-gradient(135deg, rgba(16,185,129,.04), transparent 40%);
}
#quizPlayerModal .quiz-play-qnum {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.quiz-qtype-tag {
  font-size: 10px; font-weight: 800; letter-spacing: .8px;
  padding: 3px 9px;
  background: rgba(99,102,241,.15);
  color: var(--brand-600);
  border-radius: var(--radius-pill);
}
[data-theme="dark"] .quiz-qtype-tag,
[data-theme="dim"] .quiz-qtype-tag {
  background: rgba(99,102,241,.22);
  color: var(--brand-300);
}
.quiz-qmark-tag {
  font-size: 10px; font-weight: 800; letter-spacing: .4px;
  padding: 3px 9px;
  background: rgba(245,158,11,.15);
  color: var(--gold-600);
  border-radius: var(--radius-pill);
}
[data-theme="dark"] .quiz-qmark-tag,
[data-theme="dim"] .quiz-qmark-tag {
  background: rgba(245,158,11,.22);
  color: var(--gold-400);
}
.quiz-answered-tag {
  margin-left: auto;
  font-size: 10px; font-weight: 800; letter-spacing: .5px;
  color: var(--emerald-600);
  display: inline-flex; align-items: center; gap: 4px;
}
[data-theme="dark"] .quiz-answered-tag,
[data-theme="dim"] .quiz-answered-tag { color: var(--emerald-400); }

#quizTimerDisplay {
  display: inline-block;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  font-size: 13px;
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  background: rgba(99,102,241,.1);
  color: var(--brand-700);
  margin-left: 6px;
}
[data-theme="dark"] #quizTimerDisplay,
[data-theme="dim"] #quizTimerDisplay {
  background: rgba(99,102,241,.2);
  color: var(--brand-300);
}
#quizTimerDisplay.warning {
  background: rgba(245,158,11,.2);
  color: var(--gold-600);
  animation: pulseGlow 1.2s ease-in-out infinite;
}
#quizTimerDisplay.expired {
  background: rgba(239,68,68,.2);
  color: var(--rose-600);
}

@media (max-width: 640px) {
  #quizPlayerModal .modal-box > h3 { padding: 14px 16px 4px !important; font-size: 16px; }
  #quizPlayerModal .modal-box > .modal-sub { padding: 0 16px 10px !important; }
  #quizPlayerModal .modal-box > #quizPlayerBody { padding: 14px 12px 20px; }
  #quizPlayerModal .modal-box > .modal-actions { padding: 10px 12px !important; flex-wrap: wrap; }
  #quizPlayerModal .modal-actions .quiz-progress-indicator { width: 100%; text-align: center; margin-right: 0; margin-bottom: 6px; }
  .quiz-question-controls { width: 100%; justify-content: flex-end; margin-top: 4px; }
}
/* ============================================================
   51. PROCTORED FULL-PAGE EXAM SHELL
   ============================================================ */
.quiz-exam-shell {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: none;
  flex-direction: column;
  background:
    radial-gradient(1000px 600px at 15% -10%, rgba(99,102,241,.06), transparent 55%),
    radial-gradient(800px 500px at 100% 110%, rgba(6,182,212,.05), transparent 55%),
    var(--bg-page);
  overflow: hidden;
}
.quiz-exam-shell[aria-hidden="false"] { display: flex; }

/* ---- Header ---- */
.quiz-exam-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 22px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  box-shadow: 0 1px 2px rgba(20,22,28,.04);
  flex-wrap: wrap;
  z-index: 3;
}
.quiz-exam-title-group { flex: 1; min-width: 0; }
.quiz-exam-title {
  font-size: 16px; font-weight: 800; color: var(--text-primary);
  display: flex; align-items: center; gap: 8px;
  letter-spacing: -.2px; line-height: 1.2;
}
.quiz-exam-title i { color: var(--brand-500); }
.quiz-exam-sub {
  font-size: 12px; color: var(--text-tertiary);
  margin-top: 3px; display: flex; flex-wrap: wrap; gap: 12px;
}
.quiz-exam-sub span { display: inline-flex; align-items: center; gap: 4px; }

.quiz-exam-timer-wrap { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

/* Override the old section-50 #quizTimerDisplay rule */
.quiz-exam-header #quizTimerDisplay,
.quiz-exam-timer {
  display: inline-block;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: .5px;
  padding: 8px 16px;
  border-radius: 10px;
  background: rgba(99,102,241,.08);
  color: var(--brand-700);
  margin-left: 0;
  border: 1px solid rgba(99,102,241,.2);
  min-width: 90px;
  text-align: center;
  font-family: 'Courier New', monospace;
}
[data-theme="dark"] .quiz-exam-header #quizTimerDisplay,
[data-theme="dim"] .quiz-exam-header #quizTimerDisplay,
[data-theme="dark"] .quiz-exam-timer,
[data-theme="dim"] .quiz-exam-timer {
  color: var(--brand-300);
  background: rgba(99,102,241,.16);
  border-color: rgba(99,102,241,.3);
}
.quiz-exam-header #quizTimerDisplay.warning,
.quiz-exam-timer.warning {
  color: var(--gold-600);
  background: rgba(245,158,11,.14);
  border-color: rgba(245,158,11,.35);
  animation: pulseGlow 1.2s ease-in-out infinite;
}
.quiz-exam-header #quizTimerDisplay.expired,
.quiz-exam-timer.expired {
  color: var(--rose-600);
  background: rgba(239,68,68,.14);
  border-color: rgba(239,68,68,.35);
}
[data-theme="dark"] .quiz-exam-header #quizTimerDisplay.warning,
[data-theme="dim"] .quiz-exam-header #quizTimerDisplay.warning,
[data-theme="dark"] .quiz-exam-timer.warning,
[data-theme="dim"] .quiz-exam-timer.warning { color: var(--gold-400); }
[data-theme="dark"] .quiz-exam-header #quizTimerDisplay.expired,
[data-theme="dim"] .quiz-exam-header #quizTimerDisplay.expired,
[data-theme="dark"] .quiz-exam-timer.expired,
[data-theme="dim"] .quiz-exam-timer.expired { color: var(--rose-400); }

.quiz-proctor-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 999px;
  background: rgba(239,68,68,.12); color: var(--rose-600);
  font-size: 11px; font-weight: 800; letter-spacing: .4px;
  text-transform: uppercase;
  border: 1px solid rgba(239,68,68,.2);
}
[data-theme="dark"] .quiz-proctor-pill,
[data-theme="dim"] .quiz-proctor-pill {
  background: rgba(239,68,68,.2); color: var(--rose-400);
}
.quiz-proctor-pill i { font-size: 11px; }

/* ⭐ autosave state next to the timer */
.quiz-save-state {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 700; white-space: nowrap;
  color: var(--text-secondary);
  background: rgba(100,116,139,.1); border: 1px solid rgba(100,116,139,.18);
  transition: color .2s, background .2s;
}
.quiz-save-state:empty { display: none; }
.quiz-save-state i { font-size: 11px; }
.quiz-save-state.ok   { color: #059669; background: rgba(16,185,129,.1); border-color: rgba(16,185,129,.25); }
.quiz-save-state.warn { color: #b45309; background: rgba(245,158,11,.12); border-color: rgba(245,158,11,.3); }
[data-theme="dark"] .quiz-save-state.ok, [data-theme="dim"] .quiz-save-state.ok { color: #34d399; }
[data-theme="dark"] .quiz-save-state.warn, [data-theme="dim"] .quiz-save-state.warn { color: #fbbf24; }
@media (max-width: 640px) { .quiz-save-state span { display: none; } .quiz-save-state { padding: 5px 8px; } }

/* ⭐ back to full screen after the file picker — not a warning */
.exam-fs-prompt {
  position: fixed; inset: 0; z-index: 100000;
  display: flex; align-items: center; justify-content: center; padding: 16px;
  background: rgba(15,23,42,.72); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  animation: examFsIn .18s ease-out;
}
.exam-fs-prompt-card {
  width: 100%; max-width: 380px; text-align: center;
  background: var(--bg-surface); color: var(--text-primary);
  border-radius: 18px; padding: 26px 22px 20px;
  box-shadow: 0 24px 60px rgba(0,0,0,.35);
}
.exam-fs-prompt-icon {
  width: 56px; height: 56px; margin: 0 auto 12px; border-radius: 16px;
  display: flex; align-items: center; justify-content: center; font-size: 22px;
  color: #fff; background: linear-gradient(135deg, #6366f1, #8b5cf6);
}
.exam-fs-prompt-card h3 { margin: 0 0 6px; font-size: 18px; }
.exam-fs-prompt-card p { margin: 0 0 16px; font-size: 14px; color: var(--text-secondary); line-height: 1.5; }
@keyframes examFsIn { from { opacity: 0; } to { opacity: 1; } }

.quiz-exam-progress {
  flex-shrink: 0; min-width: 180px;
  display: flex; flex-direction: column; gap: 5px;
}
.quiz-exam-progress-text {
  font-size: 11.5px; color: var(--text-tertiary);
  font-weight: 600; letter-spacing: .2px; text-align: right;
}
.quiz-exam-progress-text strong {
  color: var(--brand-600); font-weight: 800; font-size: 13px;
}
[data-theme="dark"] .quiz-exam-progress-text strong,
[data-theme="dim"] .quiz-exam-progress-text strong { color: var(--brand-400); }
.quiz-exam-progress-bar {
  height: 6px; background: var(--bg-surface-3);
  border-radius: 999px; overflow: hidden;
}
.quiz-exam-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--brand-500), var(--accent-500));
  border-radius: 999px; transition: width .35s var(--ease);
}

/* ---- Body ---- */
.quiz-exam-body {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  padding: 28px 22px 32px; scroll-behavior: smooth;
}
.quiz-exam-body-inner { max-width: 880px; margin: 0 auto; }
.quiz-exam-body-inner .quiz-play-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px 24px; margin-bottom: 16px;
  border-left: 3px solid transparent;
  transition: .2s var(--ease);
  min-height: auto;
}
.quiz-exam-body-inner .quiz-play-card.answered {
  border-left-color: var(--emerald-500);
  background: linear-gradient(135deg, rgba(16,185,129,.04), transparent 40%);
}

/* ---- Footer ---- */
.quiz-exam-footer {
  flex-shrink: 0; padding: 14px 22px;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  box-shadow: 0 -1px 2px rgba(20,22,28,.04);
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; z-index: 3;
}
.quiz-exam-footer-left {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.quiz-exam-warning-note {
  font-size: 12px; color: var(--gold-600);
  display: inline-flex; align-items: center; gap: 6px;
  font-weight: 600;
  background: rgba(245,158,11,.1);
  padding: 5px 12px; border-radius: 999px;
  border: 1px solid rgba(245,158,11,.25);
}
[data-theme="dark"] .quiz-exam-warning-note,
[data-theme="dim"] .quiz-exam-warning-note { color: var(--gold-400); }

/* ---- Pre-exam rules ---- */
.pre-exam-rules { display: flex; flex-direction: column; gap: 10px; margin: 20px 0; }
.pre-exam-rule {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  line-height: 1.5;
}
.pre-exam-rule > i {
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 8px;
  background: rgba(99,102,241,.12);
  color: var(--brand-600);
  font-size: 14px; flex-shrink: 0;
}
[data-theme="dark"] .pre-exam-rule > i,
[data-theme="dim"] .pre-exam-rule > i {
  background: rgba(99,102,241,.2); color: var(--brand-400);
}
.pre-exam-rule.danger > i {
  background: rgba(239,68,68,.12); color: var(--rose-600);
}
[data-theme="dark"] .pre-exam-rule.danger > i,
[data-theme="dim"] .pre-exam-rule.danger > i {
  background: rgba(239,68,68,.22); color: var(--rose-400);
}
.pre-exam-rule > div { flex: 1; min-width: 0; }
.pre-exam-rule strong {
  display: block; font-size: 13.5px; font-weight: 700;
  color: var(--text-primary); margin-bottom: 2px;
}
.pre-exam-rule span { font-size: 12.5px; color: var(--text-secondary); }

.pre-exam-consent {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 16px; border-radius: var(--radius-sm);
  background: rgba(99,102,241,.06);
  border: 1.5px solid rgba(99,102,241,.25);
  cursor: pointer; margin-bottom: 8px;
  transition: .2s var(--ease);
  font-size: 13px; line-height: 1.5;
  color: var(--text-secondary);
}
.pre-exam-consent:hover {
  border-color: var(--brand-400); background: rgba(99,102,241,.1);
}
.pre-exam-consent input[type="checkbox"] {
  width: 18px; height: 18px; accent-color: var(--brand-600);
  flex-shrink: 0; cursor: pointer; margin-top: 1px;
}

/* ---- Violation modal ---- */
.violation-warning-box {
  background: rgba(245,158,11,.08);
  border: 1px solid rgba(245,158,11,.3);
  border-radius: var(--radius-sm);
  padding: 14px 16px; margin-bottom: 18px;
  display: flex; flex-direction: column; gap: 8px;
}
.violation-warning-row {
  display: flex; justify-content: space-between;
  align-items: baseline; gap: 12px; font-size: 13px;
}
.violation-warning-label {
  font-weight: 700; color: var(--gold-600);
  text-transform: uppercase; font-size: 10.5px; letter-spacing: .8px;
}
[data-theme="dark"] .violation-warning-label,
[data-theme="dim"] .violation-warning-label { color: var(--gold-400); }
.violation-warning-value {
  color: var(--text-primary); font-weight: 600; text-align: right;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .quiz-exam-header { padding: 10px 14px; gap: 10px; }
  .quiz-exam-title { font-size: 14px; }
  .quiz-exam-sub { font-size: 11px; gap: 8px; }
  .quiz-exam-timer { font-size: 15px; padding: 6px 12px; min-width: 78px; }
  .quiz-proctor-pill { font-size: 10px; padding: 4px 9px; }
  .quiz-exam-progress { min-width: 120px; }
  .quiz-exam-body { padding: 18px 12px 24px; }
  .quiz-exam-footer { padding: 10px 14px; }
  .quiz-exam-warning-note { font-size: 10.5px; padding: 4px 10px; }
  .quiz-exam-body-inner .quiz-play-card { padding: 16px 16px; }
}
@media (max-width: 480px) {
  .quiz-exam-header { flex-direction: column; align-items: stretch; }
  .quiz-exam-timer-wrap { justify-content: space-between; }
  .quiz-exam-progress { min-width: 100%; }
  .quiz-exam-progress-text { text-align: left; }
  .quiz-exam-footer { flex-direction: column-reverse; align-items: stretch; }
  .quiz-exam-footer .btn { width: 100%; justify-content: center; }
  .quiz-exam-warning-note { justify-content: center; }
}
/* ============================================================
   AI DOUBT SOLVER — Styles
   ============================================================ */

.ai-doubt-box {
  margin-bottom: 24px;
  padding: 18px 20px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(99,102,241,.06), rgba(6,182,212,.03));
  border: 1.5px solid rgba(99,102,241,.28);
}

[data-theme="dark"] .ai-doubt-box,
[data-theme="dim"] .ai-doubt-box {
  background: linear-gradient(135deg, rgba(99,102,241,.14), rgba(6,182,212,.05));
}

.ai-doubt-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.ai-doubt-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, #6366f1, #06b6d4);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  box-shadow: 0 6px 16px rgba(99,102,241,.35);
}

.ai-doubt-header h4 {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.ai-doubt-header p {
  font-size: 12px;
  color: var(--text-tertiary);
  margin: 0;
}

.ai-doubt-box textarea {
  width: 100%;
  padding: 12px;
  border: 1.5px solid var(--border-default);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  min-height: 76px;
  margin-bottom: 10px;
}

.ai-doubt-box textarea:focus {
  outline: none;
  border-color: var(--brand-500);
  box-shadow: 0 0 0 4px rgba(99,102,241,.14);
}

.ai-doubt-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.ai-doubt-answer {
  margin-top: 16px;
  padding: 16px 18px;
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--brand-500);
}

.ai-answer-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--brand-600);
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-subtle);
}

[data-theme="dark"] .ai-answer-header,
[data-theme="dim"] .ai-answer-header {
  color: var(--brand-400);
}

.ai-badge {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 1px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--gold-400);
  color: #422006;
  margin-left: auto;
}

.ai-answer-body {
  font-size: 14px;
  line-height: 1.65;
  color: var(--text-primary);
  word-break: break-word;
}

.ai-answer-body h3,
.ai-answer-body h4 {
  font-size: 15px;
  font-weight: 700;
  margin: 14px 0 6px;
  color: var(--text-primary);
}

.ai-answer-body ul {
  margin: 8px 0 8px 20px;
}

.ai-answer-body li {
  margin-bottom: 4px;
}

.ai-answer-body code {
  background: var(--bg-surface-3);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 12.5px;
}

.ai-answer-body pre {
  background: var(--bg-surface-3);
  padding: 12px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 10px 0;
}

.ai-answer-body pre code {
  background: transparent;
  padding: 0;
}

.ai-answer-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--border-subtle);
}

.ai-answer-footer .hint {
  margin: 0;
  font-size: 11.5px;
}

.ai-loading {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-tertiary);
  font-size: 13.5px;
  padding: 8px 4px;
}

.ai-spinner {
  width: 22px;
  height: 22px;
  border: 2.5px solid var(--border-subtle);
  border-top-color: var(--brand-500);
  border-radius: 50%;
  animation: aiSpin .8s linear infinite;
}

@keyframes aiSpin {
  to { transform: rotate(360deg); }
}

.ai-error {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: rgba(239,68,68,.08);
  border: 1px solid rgba(239,68,68,.3);
  border-radius: var(--radius-sm);
  color: var(--rose-600);
  font-size: 13px;
}

[data-theme="dark"] .ai-error,
[data-theme="dim"] .ai-error {
  color: var(--rose-400);
}
/* ============================================================
   53. NAV — AI SOLVER BUTTON
   ============================================================ */
[data-theme="dark"] .ai-home-hero {
  background: linear-gradient(135deg, #14171c 0%, #1b1f26 55%, #242a3a 100%);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .6), 0 0 0 1px rgba(129, 140, 248, .25);
}

.ai-home-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  pointer-events: none;
  z-index: -1;
}
.ai-home-orb-1 {
  width: 380px; height: 380px;
  background: radial-gradient(circle, rgba(99,102,241,.65), transparent 70%);
  top: -140px; right: -90px;
  animation: aiOrbFloat 8s ease-in-out infinite;
}
.ai-home-orb-2 {
  width: 320px; height: 320px;
  background: radial-gradient(circle, rgba(6,182,212,.55), transparent 70%);
  bottom: -140px; left: -60px;
  animation: aiOrbFloat 10s ease-in-out infinite reverse;
}
.ai-home-orb-3 {
  width: 240px; height: 240px;
  background: radial-gradient(circle, rgba(236,72,153,.45), transparent 70%);
  top: 40%; left: 45%;
  animation: aiOrbFloat 12s ease-in-out infinite;
}

@keyframes aiOrbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%      { transform: translate(24px, -22px) scale(1.06); }
}

.ai-home-brand {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 26px;
  flex-wrap: wrap;
}

.ai-home-icon {
  position: relative;
  width: 92px;
  height: 92px;
  border-radius: 24px;
  background: linear-gradient(135deg, #6366f1, #06b6d4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 42px;
  color: #fff;
  box-shadow: 0 16px 40px rgba(99, 102, 241, .55), inset 0 1px 0 rgba(255,255,255,.35);
  flex-shrink: 0;
}
.ai-home-icon::before {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 28px;
  background: linear-gradient(135deg, rgba(99,102,241,.5), rgba(6,182,212,.5));
  filter: blur(18px);
  z-index: -1;
  opacity: .7;
}

.ai-home-pulse {
  position: absolute;
  top: 10px; right: 10px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 0 0 rgba(52, 211, 153, .7);
  animation: aiPulse 2s ease-in-out infinite;
}

@keyframes aiPulse {
  0%   { box-shadow: 0 0 0 0 rgba(52, 211, 153, .6); }
  70%  { box-shadow: 0 0 0 12px rgba(52, 211, 153, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

.ai-home-title-block { flex: 1; min-width: 240px; }

.ai-home-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .16);
  color: rgba(255, 255, 255, .9);
  margin-bottom: 12px;
}
.ai-home-badge i { color: #fbbf24; }

.ai-home-title-block h1 {
  font-size: clamp(28px, 4.5vw, 40px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -1px;
  margin-bottom: 10px;
  background: linear-gradient(135deg, #ffffff 0%, #c7d2fe 60%, #67e8f9 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.ai-home-title-block p {
  font-size: 15px;
  line-height: 1.55;
  color: rgba(255, 255, 255, .78);
  max-width: 620px;
}

/* ---------- Chat Shell ---------- */
.ai-chat-shell {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 520px;
  max-height: calc(100vh - 260px);
}

.ai-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 28px 26px 20px;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--border-default) transparent;
  background:
    radial-gradient(700px 400px at 90% -10%, rgba(99, 102, 241, .04), transparent 60%),
    radial-gradient(600px 380px at 0% 110%, rgba(6, 182, 212, .04), transparent 60%),
    var(--bg-surface);
}
.ai-chat-messages::-webkit-scrollbar { width: 8px; }
.ai-chat-messages::-webkit-scrollbar-thumb {
  background: var(--border-default);
  border-radius: 4px;
}

/* ---------- Welcome state ---------- */
.ai-welcome {
  text-align: center;
  padding: 40px 20px 20px;
  max-width: 820px;
  margin: 0 auto;
}

.ai-welcome-icon {
  width: 72px; height: 72px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #06b6d4);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  box-shadow: 0 12px 32px rgba(99, 102, 241, .4);
}

.ai-welcome h2 {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -.4px;
  margin-bottom: 8px;
}

.ai-welcome p {
  font-size: 14px;
  color: var(--text-tertiary);
  margin-bottom: 26px;
}

.ai-suggestions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
  margin-bottom: 26px;
  text-align: left;
}

.ai-suggestion-chip {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface-2);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  color: var(--text-primary);
  font-size: 13.5px;
  line-height: 1.45;
  font-weight: 500;
  transition: .2s var(--ease);
}
.ai-suggestion-chip i {
  color: var(--brand-500);
  font-size: 15px;
  margin-top: 2px;
  flex-shrink: 0;
}
.ai-suggestion-chip:hover {
  background: var(--bg-surface);
  border-color: var(--brand-300);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.ai-suggestion-chip:hover i { transform: scale(1.15); }
[data-theme="dark"] .ai-suggestion-chip:hover,
[data-theme="dim"] .ai-suggestion-chip:hover {
  border-color: var(--brand-500);
}

.ai-welcome-tips {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 520px;
  margin: 0 auto;
  text-align: left;
}

.ai-tip {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 12.5px;
  color: var(--text-tertiary);
  line-height: 1.5;
}
.ai-tip i {
  color: var(--brand-500);
  flex-shrink: 0;
  margin-top: 2px;
}
.ai-tip code {
  background: var(--bg-surface-3);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11.5px;
  color: var(--brand-600);
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
}
[data-theme="dark"] .ai-tip code,
[data-theme="dim"] .ai-tip code { color: var(--brand-300); }

/* ---------- Chat messages ---------- */
.ai-msg {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  animation: aiMsgIn .3s var(--ease);
  align-items: flex-start;
}

@keyframes aiMsgIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.ai-msg-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}
.ai-msg-user .ai-msg-avatar {
  background: linear-gradient(135deg, #22d3ee, #0891b2);
  color: #fff;
  box-shadow: 0 6px 16px rgba(6, 182, 212, .35);
}
.ai-msg-assistant .ai-msg-avatar {
  background: linear-gradient(135deg, #6366f1, #06b6d4);
  color: #fff;
  box-shadow: 0 6px 16px rgba(99, 102, 241, .35);
}
.ai-avatar-error {
  background: linear-gradient(135deg, #f59e0b, #ef4444) !important;
  box-shadow: 0 6px 16px rgba(239, 68, 68, .35) !important;
}

.ai-msg-bubble {
  flex: 1;
  min-width: 0;
  padding: 14px 18px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.65;
  word-break: break-word;
}

.ai-msg-user .ai-msg-bubble {
  background: linear-gradient(135deg, rgba(34, 211, 238, .12), rgba(6, 182, 212, .06));
  border: 1px solid rgba(6, 182, 212, .25);
  color: var(--text-primary);
  border-top-right-radius: 4px;
  font-weight: 500;
}

.ai-msg-assistant .ai-msg-bubble {
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  border-top-left-radius: 4px;
}

.ai-msg-error .ai-msg-bubble {
  background: rgba(239, 68, 68, .06);
  border-color: rgba(239, 68, 68, .25);
}

.ai-msg-error-title {
  font-weight: 700;
  font-size: 13.5px;
  color: var(--rose-600);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}
[data-theme="dark"] .ai-msg-error-title,
[data-theme="dim"] .ai-msg-error-title { color: var(--rose-400); }

.ai-msg-error-body {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 10px;
}

.ai-retry-btn {
  background: transparent;
  border: 1.5px solid var(--rose-500);
  color: var(--rose-600);
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
  transition: .2s var(--ease);
}
.ai-retry-btn:hover {
  background: var(--rose-500);
  color: #fff;
}
[data-theme="dark"] .ai-retry-btn,
[data-theme="dim"] .ai-retry-btn { color: var(--rose-400); }

/* ---------- AI answer markdown ---------- */
.ai-answer-body {
  font-size: 14px;
  line-height: 1.7;
}
.ai-answer-body strong { color: var(--text-primary); font-weight: 700; }
.ai-answer-body em { font-style: italic; }
.ai-answer-body h3,
.ai-answer-body h4 {
  font-size: 15px;
  font-weight: 700;
  margin: 16px 0 8px;
  color: var(--text-primary);
  letter-spacing: -.2px;
}
.ai-answer-body h3:first-child,
.ai-answer-body h4:first-child { margin-top: 0; }
.ai-answer-body p { margin: 8px 0; }
.ai-answer-body ul,
.ai-answer-body ol { margin: 8px 0 8px 22px; }
.ai-answer-body li { margin-bottom: 4px; }
.ai-answer-body code {
  background: var(--bg-surface-3);
  padding: 2px 7px;
  border-radius: 5px;
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 12.5px;
  color: var(--brand-600);
}
[data-theme="dark"] .ai-answer-body code,
[data-theme="dim"] .ai-answer-body code { color: var(--brand-300); }
.ai-answer-body pre {
  background: var(--bg-surface-3);
  padding: 12px 14px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 10px 0;
  font-size: 12.5px;
}
.ai-answer-body pre code {
  background: transparent;
  padding: 0;
  color: var(--text-primary);
}
.ai-answer-body blockquote {
  border-left: 3px solid var(--brand-500);
  padding: 6px 12px;
  margin: 10px 0;
  background: var(--bg-surface-3);
  border-radius: 6px;
  color: var(--text-secondary);
  font-size: 13.5px;
}

.ai-msg-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--border-subtle);
}
.ai-msg-action {
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  font-size: 12px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  font-family: inherit;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: .15s var(--ease);
}
.ai-msg-action:hover {
  background: var(--bg-surface-3);
  color: var(--brand-600);
}
.ai-msg-model {
  margin-left: auto;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: var(--text-tertiary);
  background: var(--bg-surface-3);
  padding: 3px 8px;
  border-radius: 999px;
}

/* ---------- Typing indicator ---------- */
.ai-typing-bubble {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 16px 20px !important;
  min-height: 52px;
}
.ai-typing-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--brand-500);
  animation: aiTyping 1.2s ease-in-out infinite;
}
.ai-typing-dot:nth-child(2) { animation-delay: .15s; }
.ai-typing-dot:nth-child(3) { animation-delay: .3s; }
@keyframes aiTyping {
  0%, 60%, 100% { transform: translateY(0); opacity: .5; }
  30%           { transform: translateY(-6px); opacity: 1; }
}
.ai-typing-label {
  margin-left: 8px;
  font-size: 12.5px;
  color: var(--text-tertiary);
  font-weight: 500;
}

/* ---------- Composer ---------- */
.ai-chat-composer {
  border-top: 1px solid var(--border-subtle);
  padding: 16px 20px 18px;
  background: var(--bg-surface);
  flex-shrink: 0;
}

.ai-composer-input {
  width: 100%;
  border: 1.5px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-family: inherit;
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--bg-surface);
  resize: none;
  min-height: 48px;
  max-height: 220px;
  overflow-y: auto;
  transition: .2s var(--ease);
  scrollbar-width: thin;
}
.ai-composer-input:focus {
  outline: none;
  border-color: var(--brand-500);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, .14);
}
.ai-composer-input::placeholder { color: var(--text-tertiary); }

.ai-composer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.ai-composer-hint {
  font-size: 11.5px;
  color: var(--text-tertiary);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
}
.ai-composer-hint strong {
  color: var(--text-secondary);
  font-weight: 700;
}
.ai-composer-hint i { font-size: 11px; }

.ai-composer-btns {
  display: flex;
  gap: 8px;
  align-items: center;
}

.ai-clear-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-default);
  background: var(--bg-surface);
  color: var(--text-tertiary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  transition: .2s var(--ease);
}
.ai-clear-btn:hover {
  border-color: var(--rose-400);
  color: var(--rose-500);
  background: rgba(239, 68, 68, .06);
}

.ai-send-btn {
  padding: 11px 22px;
  border-radius: var(--radius-sm);
  border: none;
  background: linear-gradient(135deg, #4f46e5, #6366f1);
  color: #fff;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: .1px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 6px 18px rgba(99, 102, 241, .35);
  transition: .2s var(--ease);
}
.ai-send-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #4338ca, #4f46e5);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(99, 102, 241, .45);
}
.ai-send-btn:active:not(:disabled) { transform: translateY(0) scale(.98); }
.ai-send-btn:disabled { opacity: .6; cursor: not-allowed; }

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .ai-home-hero { padding: 28px 22px; }
  .ai-home-brand { gap: 16px; }
  .ai-home-icon { width: 68px; height: 68px; font-size: 30px; border-radius: 18px; }
  .ai-home-title-block h1 { font-size: 26px; }
  .ai-home-title-block p { font-size: 13.5px; }

  .ai-chat-shell { min-height: 440px; max-height: calc(100vh - 200px); border-radius: var(--radius-lg); }
  .ai-chat-messages { padding: 20px 14px 16px; }
  .ai-chat-composer { padding: 12px 14px 14px; }

  .ai-suggestions { grid-template-columns: 1fr; }
  .ai-welcome { padding: 26px 12px 12px; }
  .ai-welcome h2 { font-size: 18px; }
  .ai-welcome p { font-size: 13px; }

  .ai-msg-avatar { width: 32px; height: 32px; font-size: 13px; }
  .ai-msg-bubble { padding: 12px 14px; font-size: 13.5px; }
  .ai-msg { gap: 10px; margin-bottom: 16px; }

  .ai-composer-hint { font-size: 10.5px; }
  .ai-send-btn { padding: 10px 16px; font-size: 13px; }
  .ai-clear-btn { width: 36px; height: 36px; }
}

@media (max-width: 420px) {
  .ai-composer-hint strong { display: none; }
  .ai-composer-hint { font-size: 10px; }
}
/* ============================================================
   53. NAV — AI SOLVER BUTTON
   ============================================================ */
.main-nav a.nav-ai-btn {
  background: linear-gradient(135deg, #6366f1, #06b6d4) !important;
  color: #fff !important;
  font-weight: 700;
  margin-left: 6px;
  box-shadow: 0 4px 14px rgba(99,102,241,.4);
  border: 1px solid rgba(255,255,255,.15);
}
.main-nav a.nav-ai-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(99,102,241,.55);
}
.main-nav a.nav-ai-btn.active {
  background: linear-gradient(135deg, #4f46e5, #0891b2) !important;
  box-shadow: 0 0 0 2px rgba(255,255,255,.4), 0 8px 22px rgba(99,102,241,.6);
}

/* ============================================================
   54. AI HOME PAGE — Chat-style Doubt Solver
   ============================================================ */
.ai-home-hero {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-2xl);
  padding: 44px 44px;
  margin-bottom: 26px;
  background: linear-gradient(135deg, #0a0e1f 0%, #1a1749 55%, #2d1b69 100%);
  color: #fff;
  box-shadow: 0 24px 60px rgba(20,22,28,.18), 0 0 0 1px rgba(129,140,248,.18);
  isolation: isolate;
  z-index: 0;
}
[data-theme="dark"] .ai-home-hero {
  background: linear-gradient(135deg, #14171c 0%, #1b1f26 55%, #242a3a 100%);
  box-shadow: 0 24px 60px rgba(0,0,0,.6), 0 0 0 1px rgba(129,140,248,.25);
}

.ai-home-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  pointer-events: none;
  z-index: 0;
  opacity: .85;
}
.ai-home-orb-1 {
  width: 380px; height: 380px;
  background: radial-gradient(circle, rgba(99,102,241,.75), transparent 70%);
  top: -140px; right: -90px;
  animation: aiOrbFloat 8s ease-in-out infinite;
}
.ai-home-orb-2 {
  width: 320px; height: 320px;
  background: radial-gradient(circle, rgba(6,182,212,.65), transparent 70%);
  bottom: -140px; left: -60px;
  animation: aiOrbFloat 10s ease-in-out infinite reverse;
}
.ai-home-orb-3 {
  width: 240px; height: 240px;
  background: radial-gradient(circle, rgba(236,72,153,.55), transparent 70%);
  top: 40%; left: 45%;
  animation: aiOrbFloat 12s ease-in-out infinite;
}
@keyframes aiOrbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%      { transform: translate(24px, -22px) scale(1.06); }
}

.ai-home-brand {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 26px;
  flex-wrap: wrap;
}

.ai-home-icon {
  position: relative;
  width: 92px; height: 92px;
  border-radius: 24px;
  background: linear-gradient(135deg, #6366f1, #06b6d4);
  display: flex; align-items: center; justify-content: center;
  font-size: 42px; color: #fff;
  box-shadow: 0 16px 40px rgba(99,102,241,.55), inset 0 1px 0 rgba(255,255,255,.35);
  flex-shrink: 0;
}
.ai-home-icon::before {
  content: "";
  position: absolute; inset: -4px;
  border-radius: 28px;
  background: linear-gradient(135deg, rgba(99,102,241,.5), rgba(6,182,212,.5));
  filter: blur(18px);
  z-index: -1;
  opacity: .7;
}
.ai-home-pulse {
  position: absolute; top: 10px; right: 10px;
  width: 12px; height: 12px; border-radius: 50%;
  background: #34d399;
  animation: aiPulse 2s ease-in-out infinite;
}
@keyframes aiPulse {
  0%   { box-shadow: 0 0 0 0 rgba(52,211,153,.6); }
  70%  { box-shadow: 0 0 0 12px rgba(52,211,153,0); }
  100% { box-shadow: 0 0 0 0 rgba(52,211,153,0); }
}

.ai-home-title-block { flex: 1; min-width: 240px; }

.ai-home-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px; font-weight: 700;
  letter-spacing: .5px; text-transform: uppercase;
  padding: 5px 12px; border-radius: 999px;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.16);
  color: rgba(255,255,255,.9);
  margin-bottom: 12px;
}
.ai-home-badge i { color: #fbbf24; }

.ai-home-title-block h1 {
  font-size: clamp(28px, 4.5vw, 40px);
  font-weight: 800; line-height: 1.05;
  letter-spacing: -1px; margin-bottom: 10px;
  background: linear-gradient(135deg, #ffffff 0%, #c7d2fe 60%, #67e8f9 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: #ffffff;
}
.ai-home-title-block p {
  font-size: 15px; line-height: 1.55;
  color: rgba(255,255,255,.78);
  max-width: 620px;
}

.ai-chat-shell {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 480px;
  max-height: min(720px, calc(100vh - 200px));
}
.ai-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 28px 26px 20px;
  background:
    radial-gradient(700px 400px at 90% -10%, rgba(99,102,241,.04), transparent 60%),
    radial-gradient(600px 380px at 0% 110%, rgba(6,182,212,.04), transparent 60%),
    var(--bg-surface);
  scroll-behavior: smooth;
}
.ai-chat-messages::-webkit-scrollbar { width: 8px; }
.ai-chat-messages::-webkit-scrollbar-thumb {
  background: var(--border-default); border-radius: 4px;
}

.ai-welcome {
  text-align: center;
  padding: 40px 20px 20px;
  max-width: 820px;
  margin: 0 auto;
}
.ai-welcome-icon {
  width: 72px; height: 72px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #06b6d4);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 30px;
  box-shadow: 0 12px 32px rgba(99,102,241,.4);
}
.ai-welcome h2 {
  font-size: 22px; font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -.4px;
  margin-bottom: 8px;
}
.ai-welcome p {
  font-size: 14px;
  color: var(--text-tertiary);
  margin-bottom: 26px;
}
.ai-suggestions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
  margin-bottom: 26px;
  text-align: left;
}
.ai-suggestion-chip {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface-2);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  color: var(--text-primary);
  font-size: 13.5px;
  line-height: 1.45;
  font-weight: 500;
  transition: .2s var(--ease);
}
.ai-suggestion-chip i {
  color: var(--brand-500);
  font-size: 15px;
  margin-top: 2px;
  flex-shrink: 0;
}
.ai-suggestion-chip:hover {
  background: var(--bg-surface);
  border-color: var(--brand-300);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
[data-theme="dark"] .ai-suggestion-chip:hover,
[data-theme="dim"] .ai-suggestion-chip:hover {
  border-color: var(--brand-500);
}
.ai-welcome-tips {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 520px;
  margin: 0 auto;
  text-align: left;
}
.ai-tip {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 12.5px;
  color: var(--text-tertiary);
  line-height: 1.5;
}
.ai-tip i { color: var(--brand-500); flex-shrink: 0; margin-top: 2px; }
.ai-tip code {
  background: var(--bg-surface-3);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11.5px;
  color: var(--brand-600);
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
}
[data-theme="dark"] .ai-tip code,
[data-theme="dim"] .ai-tip code { color: var(--brand-300); }

.ai-msg {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  align-items: flex-start;
  animation: aiMsgIn .3s var(--ease);
}
@keyframes aiMsgIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.ai-msg-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; flex-shrink: 0;
}
.ai-msg-user .ai-msg-avatar {
  background: linear-gradient(135deg, #22d3ee, #0891b2);
  color: #fff;
  box-shadow: 0 6px 16px rgba(6,182,212,.35);
}
.ai-msg-assistant .ai-msg-avatar {
  background: linear-gradient(135deg, #6366f1, #06b6d4);
  color: #fff;
  box-shadow: 0 6px 16px rgba(99,102,241,.35);
}
.ai-avatar-error { background: linear-gradient(135deg, #f59e0b, #ef4444) !important; }
.ai-msg-bubble {
  flex: 1; min-width: 0;
  padding: 14px 18px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.65;
  word-break: break-word;
}
.ai-msg-user .ai-msg-bubble {
  background: linear-gradient(135deg, rgba(34,211,238,.12), rgba(6,182,212,.06));
  border: 1px solid rgba(6,182,212,.25);
  color: var(--text-primary);
  border-top-right-radius: 4px;
  font-weight: 500;
}
.ai-msg-assistant .ai-msg-bubble {
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  border-top-left-radius: 4px;
}
.ai-msg-error .ai-msg-bubble {
  background: rgba(239,68,68,.06);
  border-color: rgba(239,68,68,.25);
}
.ai-msg-error-title {
  font-weight: 700;
  font-size: 13.5px;
  color: var(--rose-600);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}
[data-theme="dark"] .ai-msg-error-title,
[data-theme="dim"] .ai-msg-error-title { color: var(--rose-400); }
.ai-msg-error-body {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 10px;
}
.ai-retry-btn {
  background: transparent;
  border: 1.5px solid var(--rose-500);
  color: var(--rose-600);
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  font-family: inherit;
  transition: .2s var(--ease);
}
.ai-retry-btn:hover { background: var(--rose-500); color: #fff; }
[data-theme="dark"] .ai-retry-btn,
[data-theme="dim"] .ai-retry-btn { color: var(--rose-400); }

.ai-answer-body { font-size: 14px; line-height: 1.7; }
.ai-answer-body h3, .ai-answer-body h4 {
  font-size: 15px; font-weight: 700;
  margin: 16px 0 8px;
  color: var(--text-primary);
}
.ai-answer-body h3:first-child,
.ai-answer-body h4:first-child { margin-top: 0; }
.ai-answer-body p { margin: 8px 0; }
.ai-answer-body ul, .ai-answer-body ol { margin: 8px 0 8px 22px; }
.ai-answer-body li { margin-bottom: 4px; }
.ai-answer-body code {
  background: var(--bg-surface-3);
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 12.5px;
  color: var(--brand-600);
}
[data-theme="dark"] .ai-answer-body code,
[data-theme="dim"] .ai-answer-body code { color: var(--brand-300); }
.ai-answer-body pre {
  background: var(--bg-surface-3);
  padding: 12px 14px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 10px 0;
  font-size: 12.5px;
}
.ai-answer-body pre code { background: transparent; padding: 0; }
.ai-answer-body blockquote {
  border-left: 3px solid var(--brand-500);
  padding: 6px 12px;
  margin: 10px 0;
  background: var(--bg-surface-3);
  border-radius: 6px;
  color: var(--text-secondary);
  font-size: 13.5px;
}

.ai-msg-actions {
  display: flex; align-items: center; gap: 10px;
  margin-top: 12px; padding-top: 10px;
  border-top: 1px dashed var(--border-subtle);
}
.ai-msg-action {
  background: transparent; border: none;
  color: var(--text-tertiary);
  font-size: 12px;
  cursor: pointer; padding: 4px 8px; border-radius: 6px;
  font-family: inherit; font-weight: 600;
  display: inline-flex; align-items: center; gap: 5px;
  transition: .15s var(--ease);
}
.ai-msg-action:hover { background: var(--bg-surface-3); color: var(--brand-600); }
.ai-msg-model {
  margin-left: auto;
  font-size: 10.5px; font-weight: 700;
  letter-spacing: .5px; text-transform: uppercase;
  color: var(--text-tertiary);
  background: var(--bg-surface-3);
  padding: 3px 8px; border-radius: 999px;
}

.ai-typing-bubble {
  display: flex; align-items: center; gap: 6px;
  padding: 16px 20px !important;
  min-height: 52px;
}
.ai-typing-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--brand-500);
  animation: aiTyping 1.2s ease-in-out infinite;
}
.ai-typing-dot:nth-child(2) { animation-delay: .15s; }
.ai-typing-dot:nth-child(3) { animation-delay: .3s; }
@keyframes aiTyping {
  0%, 60%, 100% { transform: translateY(0); opacity: .5; }
  30%           { transform: translateY(-6px); opacity: 1; }
}
.ai-typing-label {
  margin-left: 8px;
  font-size: 12.5px;
  color: var(--text-tertiary);
  font-weight: 500;
}

.ai-chat-composer {
  border-top: 1px solid var(--border-subtle);
  padding: 16px 20px 18px;
  background: var(--bg-surface);
  flex-shrink: 0;
}
.ai-composer-input {
  width: 100%;
  border: 1.5px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-family: inherit;
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--bg-surface);
  resize: none;
  min-height: 48px;
  max-height: 220px;
  overflow-y: auto;
  transition: .2s var(--ease);
}
.ai-composer-input:focus {
  outline: none;
  border-color: var(--brand-500);
  box-shadow: 0 0 0 4px rgba(99,102,241,.14);
}
.ai-composer-input::placeholder { color: var(--text-tertiary); }
.ai-composer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.ai-composer-hint {
  font-size: 11.5px;
  color: var(--text-tertiary);
  display: inline-flex; align-items: center; gap: 6px;
  font-weight: 500;
}
.ai-composer-hint strong { color: var(--text-secondary); font-weight: 700; }
.ai-composer-hint i { font-size: 11px; }
.ai-composer-btns { display: flex; gap: 8px; align-items: center; }
.ai-clear-btn {
  width: 40px; height: 40px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-default);
  background: var(--bg-surface);
  color: var(--text-tertiary);
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px;
  transition: .2s var(--ease);
}
.ai-clear-btn:hover {
  border-color: var(--rose-400);
  color: var(--rose-500);
  background: rgba(239,68,68,.06);
}
.ai-send-btn {
  padding: 11px 22px;
  border-radius: var(--radius-sm);
  border: none;
  background: linear-gradient(135deg, #4f46e5, #6366f1);
  color: #fff;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: .1px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 6px 18px rgba(99,102,241,.35);
  transition: .2s var(--ease);
}
.ai-send-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #4338ca, #4f46e5);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(99,102,241,.45);
}
.ai-send-btn:active:not(:disabled) { transform: translateY(0) scale(.98); }
.ai-send-btn:disabled { opacity: .6; cursor: not-allowed; }

@media (max-width: 720px) {
  .ai-home-hero { padding: 28px 22px; }
  .ai-home-brand { gap: 16px; }
  .ai-home-icon { width: 68px; height: 68px; font-size: 30px; border-radius: 18px; }
  .ai-home-title-block h1 { font-size: 26px; }
  .ai-home-title-block p { font-size: 13.5px; }
  .ai-chat-shell {
    min-height: 420px;
    max-height: calc(100vh - 160px);
    border-radius: var(--radius-lg);
  }
  .ai-chat-messages { padding: 20px 14px 16px; }
  .ai-chat-composer { padding: 12px 14px 14px; }
  .ai-suggestions { grid-template-columns: 1fr; }
  .ai-welcome { padding: 26px 12px 12px; }
  .ai-welcome h2 { font-size: 18px; }
  .ai-welcome p { font-size: 13px; }
  .ai-msg-avatar { width: 32px; height: 32px; font-size: 13px; }
  .ai-msg-bubble { padding: 12px 14px; font-size: 13.5px; }
  .ai-msg { gap: 10px; margin-bottom: 16px; }
  .ai-composer-hint { font-size: 10.5px; }
  .ai-send-btn { padding: 10px 16px; font-size: 13px; }
  .ai-clear-btn { width: 36px; height: 36px; }
  .main-nav a.nav-ai-btn { margin-left: 0; }
}
@media (max-width: 420px) {
  .ai-composer-hint strong { display: none; }
  .ai-composer-hint { font-size: 10px; }
}

/* ============================================================
   55. COURSE LOADING SKELETON
   ============================================================ */
.courses-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 60px 20px 30px;
  color: var(--text-tertiary);
  font-size: 13.5px;
  font-weight: 500;
  text-align: center;
}
.courses-loading .pdfv-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--border-subtle);
  border-top-color: var(--brand-500);
  border-radius: 50%;
  animation: pdfSpin .8s linear infinite;
}
.courses-loading p { margin: 0; letter-spacing: .2px; }

.courses-skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--card-min-course), 1fr));
  gap: var(--gap-grid);
  padding: 4px;
}
.course-skeleton-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--gap-card);
  min-height: 260px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
  position: relative;
}
.course-skeleton-card::before {
  content: "";
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(99,102,241,.06) 50%,
    transparent 100%
  );
  animation: skeletonShimmer 1.6s ease-in-out infinite;
  pointer-events: none;
}
@keyframes skeletonShimmer {
  0%   { left: -100%; }
  100% { left: 200%; }
}
.skel-line {
  height: 12px;
  border-radius: 6px;
  background: var(--bg-surface-3);
}
.skel-line.w-40 { width: 40%; }
.skel-line.w-60 { width: 60%; }
.skel-line.w-80 { width: 80%; }
.skel-line.w-100 { width: 100%; }
.skel-line.tall { height: 18px; }
.skel-line.chip { height: 22px; width: 70px; border-radius: 999px; }
.skel-row { display: flex; gap: 8px; margin-top: auto; }
.skel-btn {
  flex: 1;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface-3);
}


/* ============================================================
   AI ANSWER — rich content rendering (tables, math, code)
   ------------------------------------------------------------
   Placed at end of file so these rules override any earlier
   .ai-answer-body declarations (there are two of them above).
   ============================================================ */

/* ---- Paragraphs & rhythm ---- */
.ai-answer-body p { margin: 10px 0; }
.ai-answer-body p:first-child { margin-top: 0; }
.ai-answer-body p:last-child  { margin-bottom: 0; }

/* ---- Headings ---- */
.ai-answer-body h3 {
  font-size: 16px; font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -.2px;
  margin: 18px 0 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-subtle);
}
.ai-answer-body h4 {
  font-size: 14.5px; font-weight: 700;
  color: var(--text-primary);
  margin: 16px 0 6px;
  letter-spacing: -.1px;
}
.ai-answer-body h5 {
  font-size: 13.5px; font-weight: 700;
  color: var(--text-secondary);
  margin: 12px 0 6px;
  text-transform: uppercase;
  letter-spacing: .4px;
}

/* ---- Horizontal rule ---- */
.ai-answer-body hr {
  border: 0;
  border-top: 1px solid var(--border-subtle);
  margin: 16px 0;
}

/* ---- Links ---- */
.ai-answer-body a {
  color: var(--brand-600);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
}
.ai-answer-body a:hover { color: var(--brand-700); }
[data-theme="dark"] .ai-answer-body a,
[data-theme="dim"]   .ai-answer-body a { color: var(--brand-300); }

/* ---- Lists ---- */
.ai-answer-body ul,
.ai-answer-body ol {
  margin: 8px 0 10px 22px;
  padding: 0;
}
.ai-answer-body li { margin-bottom: 4px; line-height: 1.65; }
.ai-answer-body li > ul,
.ai-answer-body li > ol { margin-top: 4px; margin-bottom: 4px; }

/* ---- Blockquote ---- */
.ai-answer-body blockquote {
  border-left: 3px solid var(--brand-500);
  padding: 8px 14px;
  margin: 12px 0;
  background: var(--bg-surface-3);
  border-radius: 0 8px 8px 0;
  color: var(--text-secondary);
  font-size: 13.5px;
  line-height: 1.65;
}
[data-theme="dark"] .ai-answer-body blockquote,
[data-theme="dim"]   .ai-answer-body blockquote {
  background: rgba(99,102,241,.12);
  color: var(--text-secondary);
}

/* ---- Inline code ---- */
.ai-answer-body code {
  background: var(--bg-surface-3);
  padding: 2px 7px;
  border-radius: 5px;
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 12.5px;
  color: var(--brand-600);
  word-break: break-word;
}
[data-theme="dark"] .ai-answer-body code,
[data-theme="dim"]   .ai-answer-body code { color: var(--brand-300); }

/* ---- Code blocks ---- */
.ai-answer-body pre {
  background: var(--bg-surface-3);
  border: 1px solid var(--border-subtle);
  padding: 12px 14px;
  border-radius: 10px;
  overflow-x: auto;
  margin: 12px 0;
  font-size: 12.5px;
  line-height: 1.55;
}
.ai-answer-body pre code {
  background: transparent;
  padding: 0;
  color: var(--text-primary);
  font-size: inherit;
}

/* ---- Tables (from AI markdown) ---- */
.ai-table-wrap {
  overflow-x: auto;
  margin: 14px 0;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
}
.ai-answer-body table.ai-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 420px;
}
.ai-answer-body table.ai-table th,
.ai-answer-body table.ai-table td {
  padding: 9px 12px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border-subtle);
  border-right: 1px solid var(--border-subtle);
  line-height: 1.55;
}
.ai-answer-body table.ai-table th:last-child,
.ai-answer-body table.ai-table td:last-child { border-right: none; }
.ai-answer-body table.ai-table tr:last-child td { border-bottom: none; }

.ai-answer-body table.ai-table thead th {
  background: var(--bg-surface-2);
  font-weight: 800;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-secondary);
  white-space: nowrap;
}
.ai-answer-body table.ai-table tbody tr:nth-child(even) {
  background: var(--bg-surface-2);
}
.ai-answer-body table.ai-table tbody tr:hover {
  background: var(--bg-surface-3);
}
[data-theme="dark"] .ai-answer-body table.ai-table tbody tr:hover,
[data-theme="dim"]   .ai-answer-body table.ai-table tbody tr:hover {
  background: rgba(99,102,241,.08);
}

/* ---- MathJax block spacing ---- */
.ai-answer-body mjx-container[display="true"] {
  margin: 12px 0 !important;
  overflow-x: auto;
  overflow-y: hidden;
  max-width: 100%;
}
.ai-answer-body mjx-container:not([display="true"]) {
  vertical-align: -0.15em;
}

/* ---- Strong emphasis ---- */
.ai-answer-body strong { color: var(--text-primary); font-weight: 700; }
.ai-answer-body em     { font-style: italic; color: var(--text-secondary); }
/* ============================================================
   56. HARDENED CONTENT PROTECTION
   ============================================================ */

/* Disable iOS long-press "Save Image" menu on protected surfaces */
.pdfv-pages,
.pdfv-page,
.pdfv-canvas,
.vp-video-area,
.vp-watermark {
  -webkit-touch-callout: none !important;
  -webkit-user-select: none !important;
  -moz-user-select: none !important;
  user-select: none !important;
  -webkit-user-drag: none !important;
}

/* Text layer still needs select-for-highlight on desktop */
.pdfv-textlayer,
.pdfv-textlayer * {
  -webkit-user-select: text !important;
  user-select: text !important;
}

/* Prevent drag-and-drop image extraction */
.pdfv-canvas,
.vp-video-area img,
.vp-video-area video,
.course-thumb img {
  pointer-events: none;
}
.pdfv-canvas { pointer-events: auto; }  /* keep canvas interactive for scrolling */

/* Fallback blur — only applied when JS explicitly sets body-content-hidden.
   We no longer add this class on tab-switch, so normal reading is unaffected. */
body.body-content-hidden .pdfv-shell,
body.body-content-hidden .vp-shell {
  filter: blur(18px);
}

/* Give the "Back" button and controls a slightly higher stacking context */
.pdfv-back-btn,
.vp-back-btn { z-index: 15 !important; }

/* Make the watermark layer sit above the canvas but below controls */
.pdfv-watermark { z-index: 2; }
.pdfv-textlayer  { z-index: 3; }
.pdfv-toolbar    { z-index: 20; }
.vp-watermark    { z-index: 4; }
.vp-controls     { z-index: 10; }
.vp-title        { z-index: 10; }

/* ============================================================
   55. STUDENT FEEDBACK — public wall + stars
   ============================================================ */
.feedback-wall {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--gap-grid);
  align-items: stretch;
}
.feedback-card {
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  transition: .22s var(--ease);
  display: flex;
  flex-direction: column;
  min-height: 180px;
  position: relative;
}
.feedback-card::before {
  content: "";
  position: absolute; inset: 0;
  border-radius: var(--radius-lg);
  background: radial-gradient(circle at 100% 0%, rgba(99,102,241,.05), transparent 60%);
  pointer-events: none;
}
.feedback-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  background: var(--bg-surface);
  border-color: var(--brand-200);
}
[data-theme="dark"] .feedback-card:hover,
[data-theme="dim"] .feedback-card:hover { border-color: var(--brand-500); }
.feedback-card-head {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 12px;
}
.feedback-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-600), var(--accent-500));
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 800; letter-spacing: -.3px;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(99,102,241,.3);
}
.feedback-card-meta { flex: 1; min-width: 0; }
.feedback-card-meta strong {
  font-size: 14px; font-weight: 700; color: var(--text-primary);
  display: block;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.feedback-card-date {
  font-size: 11px; color: var(--text-tertiary);
  flex-shrink: 0;
}
.feedback-stars-display {
  color: var(--gold-500);
  font-size: 13px;
  letter-spacing: 1px;
  display: inline-block;
  margin-top: 2px;
}
.feedback-card-title {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
  line-height: 1.35;
}
.feedback-card-body {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0 0 10px;
  flex: 1;
  white-space: pre-wrap;
  word-break: break-word;
}
.feedback-card-course {
  font-size: 11.5px;
  color: var(--text-tertiary);
  font-weight: 600;
  padding-top: 8px;
  border-top: 1px dashed var(--border-subtle);
  display: inline-flex; align-items: center; gap: 6px;
}
.feedback-card-course i { color: var(--brand-500); }

/* Star selector */
.feedback-stars {
  display: flex; gap: 6px;
  margin-top: 6px;
}
.feedback-stars button {
  background: transparent; border: none;
  color: var(--border-strong);
  font-size: 26px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: .15s var(--ease);
}
.feedback-stars button:hover { transform: scale(1.15); }
.feedback-stars button.active { color: var(--gold-400); }
.feedback-stars button:hover ~ button { color: var(--border-strong); }
[data-theme="dark"] .feedback-stars button { color: var(--border-strong); }
[data-theme="dark"] .feedback-stars button.active { color: var(--gold-400); }

/* ============================================================
   56. STUDENT CONTRIBUTIONS — student list + admin list
   ============================================================ */
.contribution-list {
  display: flex; flex-direction: column; gap: 12px;
}
.contribution-row {
  display: flex; gap: 14px;
  padding: 16px 18px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: .2s var(--ease);
}
.contribution-row:hover {
  border-color: var(--brand-300);
  background: var(--bg-surface);
}
[data-theme="dark"] .contribution-row:hover,
[data-theme="dim"] .contribution-row:hover { border-color: var(--brand-500); }
.contribution-icon {
  width: 46px; height: 46px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--brand-600), var(--accent-500));
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  box-shadow: 0 6px 14px rgba(99,102,241,.3);
}
.contribution-info { flex: 1; min-width: 0; }
.contribution-info h4 {
  font-size: 14.5px; font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
  line-height: 1.35;
}
.contribution-subject {
  font-size: 12.5px; font-weight: 600;
  color: var(--brand-600);
  margin-bottom: 4px;
}
[data-theme="dark"] .contribution-subject,
[data-theme="dim"] .contribution-subject { color: var(--brand-400); }
.contribution-desc {
  font-size: 13px;
  color: var(--text-tertiary);
  line-height: 1.5;
  margin: 4px 0 8px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.contribution-meta {
  display: flex; gap: 14px; flex-wrap: wrap;
  font-size: 11.5px;
  color: var(--text-tertiary);
  font-weight: 500;
}
.contribution-meta span { display: inline-flex; align-items: center; gap: 5px; }
.contribution-meta i { color: var(--brand-500); }

.contribution-status {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 10.5px;
  letter-spacing: .3px;
  text-transform: uppercase;
}
.contribution-status i { font-size: 8px; }
.contribution-status.pending {
  background: rgba(245,158,11,.15);
  color: var(--gold-600);
}
.contribution-status.ok {
  background: rgba(16,185,129,.15);
  color: var(--emerald-600);
}
.contribution-status.bad {
  background: rgba(239,68,68,.15);
  color: var(--rose-600);
}
[data-theme="dark"] .contribution-status.pending,
[data-theme="dim"] .contribution-status.pending { color: var(--gold-400); }
[data-theme="dark"] .contribution-status.ok,
[data-theme="dim"] .contribution-status.ok { color: var(--emerald-400); }
[data-theme="dark"] .contribution-status.bad,
[data-theme="dim"] .contribution-status.bad { color: var(--rose-400); }

/* ============================================================
   57. ADMIN — Backup & Restore tab
   ============================================================ */
.backup-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap-grid);
  margin-bottom: 20px;
}
@media (max-width: 720px) {
  .backup-grid { grid-template-columns: 1fr; }
}
.backup-card {
  background: var(--bg-surface-2);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px 22px;
  display: flex;
  flex-direction: column;
  transition: .22s var(--ease);
}
.backup-card:hover {
  border-color: var(--brand-300);
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}
[data-theme="dark"] .backup-card:hover,
[data-theme="dim"] .backup-card:hover { border-color: var(--brand-500); }

.backup-card-icon {
  width: 52px; height: 52px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  margin-bottom: 14px;
  position: relative; overflow: hidden;
  color: #fff;
}
.backup-card-icon::before {
  content: "";
  position: absolute; top: -30%; left: -30%;
  width: 160%; height: 160%;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.3), transparent 55%);
}
.backup-card-icon.tone-brand {
  background: linear-gradient(135deg, #818cf8, #4f46e5);
  box-shadow: 0 8px 20px rgba(99,102,241,.4);
}
.backup-card-icon.tone-emerald {
  background: linear-gradient(135deg, #34d399, #059669);
  box-shadow: 0 8px 20px rgba(16,185,129,.4);
}
.backup-card h3 {
  font-size: 16px; font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.backup-card p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 16px;
  flex: 1;
}
.backup-card p strong { color: var(--text-primary); font-weight: 700; }
/* ============================================================
   58. SUBSCRIPTION PLANS — pricing cards (student)
   ============================================================ */
.plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  align-items: stretch;
}

.plan-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 26px 22px 22px;
  background: var(--bg-surface);
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  transition: .25s var(--ease);
  overflow: hidden;
}
.plan-card:hover {
  transform: translateY(-4px);
  border-color: var(--brand-300);
  box-shadow: var(--shadow-lg);
}
[data-theme="dark"] .plan-card:hover,
[data-theme="dim"]   .plan-card:hover { border-color: var(--brand-500); }

.plan-card-featured {
  border-color: var(--brand-500);
  background: linear-gradient(180deg, rgba(99,102,241,.06), var(--bg-surface) 30%);
  box-shadow: 0 12px 36px rgba(99,102,241,.20);
}
[data-theme="dark"] .plan-card-featured,
[data-theme="dim"]   .plan-card-featured {
  background: linear-gradient(180deg, rgba(99,102,241,.14), var(--bg-surface) 30%);
  box-shadow: 0 12px 36px rgba(99,102,241,.35);
}

.plan-badge {
  position: absolute;
  top: 14px; right: 14px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .6px;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--gold-400), var(--gold-500));
  color: #422006;
  box-shadow: 0 3px 10px rgba(245,158,11,.35);
}

.plan-card-head { margin-bottom: 14px; }
.plan-duration {
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--brand-600);
}
[data-theme="dark"] .plan-duration,
[data-theme="dim"]   .plan-duration { color: var(--brand-400); }

.plan-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.25;
  margin-top: 4px;
  letter-spacing: -.3px;
}

.plan-price {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-bottom: 4px;
}
.plan-currency {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-tertiary);
}
.plan-amount {
  font-size: 42px;
  font-weight: 900;
  color: var(--text-primary);
  letter-spacing: -2px;
  line-height: 1;
}

.plan-savings {
  font-size: 12px;
  font-weight: 700;
  color: var(--emerald-600);
  margin-bottom: 14px;
}
[data-theme="dark"] .plan-savings,
[data-theme="dim"]   .plan-savings { color: var(--emerald-400); }

.plan-desc {
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-tertiary);
  margin: 10px 0 16px;
  min-height: 40px;
}

.plan-features {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.plan-features li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}
.plan-features i {
  color: var(--emerald-500);
  font-size: 12px;
  flex-shrink: 0;
}

.plan-card .plan-select-btn { margin-top: auto; }

/* ---- Checkout modal ---- */
.checkout-plan-summary {
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  margin-bottom: 16px;
}
.checkout-plan-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}
.checkout-plan-meta {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 3px;
}
.checkout-plan-price {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -.5px;
}
.checkout-plan-desc {
  font-size: 12.5px;
  color: var(--text-tertiary);
  margin: 0;
  line-height: 1.5;
}

.coupon-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.coupon-row input {
  flex: 1;
  text-transform: uppercase;
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-weight: 700;
  letter-spacing: 1px;
}

.coupon-status {
  margin-top: 8px;
  font-size: 12.5px;
  font-weight: 600;
  min-height: 18px;
}
.coupon-status-loading { color: var(--text-tertiary); }
.coupon-status-ok { color: var(--emerald-600); }
.coupon-status-err { color: var(--rose-600); }
[data-theme="dark"] .coupon-status-ok,
[data-theme="dim"]   .coupon-status-ok { color: var(--emerald-400); }
[data-theme="dark"] .coupon-status-err,
[data-theme="dim"]   .coupon-status-err { color: var(--rose-400); }

.checkout-totals {
  background: var(--bg-surface-2);
  border: 1px dashed var(--border-default);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
}
.totals-row {
  display: flex;
  justify-content: space-between;
  font-size: 13.5px;
  color: var(--text-secondary);
}
.totals-row.discount { color: var(--emerald-600); font-weight: 700; }
[data-theme="dark"] .totals-row.discount,
[data-theme="dim"]   .totals-row.discount { color: var(--emerald-400); }
.totals-row.grand {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-primary);
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
  margin-top: 2px;
}

/* ============================================================
   59. REFERRAL CARD (student home)
   ============================================================ */
.referral-card {
  display: flex;
  gap: 18px;
  padding: 20px 22px;
  margin-bottom: 20px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(245,158,11,.10), rgba(251,191,36,.03));
  border: 1.5px solid rgba(245,158,11,.35);
  position: relative;
  overflow: hidden;
}
[data-theme="dark"] .referral-card,
[data-theme="dim"]   .referral-card {
  background: linear-gradient(135deg, rgba(245,158,11,.16), rgba(251,191,36,.06));
  border-color: rgba(245,158,11,.45);
}
.referral-card-icon {
  width: 52px; height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--gold-400), var(--gold-500));
  color: #422006;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; flex-shrink: 0;
  box-shadow: 0 6px 18px rgba(245,158,11,.35);
}
.referral-card-body { flex: 1; min-width: 0; }
.referral-card-head {
  display: flex; justify-content: space-between;
  align-items: flex-start; gap: 12px; flex-wrap: wrap;
  margin-bottom: 12px;
}
.referral-card-head h4 {
  font-size: 15px; font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 3px;
}
.referral-card-head p {
  font-size: 12.5px; color: var(--text-tertiary);
  margin: 0; line-height: 1.5;
}

.referral-code-row {
  display: flex; gap: 10px; align-items: stretch;
  margin-bottom: 14px; flex-wrap: wrap;
}
.referral-code-box {
  flex: 1;
  min-width: 180px;
  display: flex; flex-direction: column;
  gap: 3px;
  padding: 10px 14px;
  background: var(--bg-surface);
  border: 1.5px dashed var(--gold-400);
  border-radius: var(--radius-sm);
}
.referral-code-label {
  font-size: 10.5px; font-weight: 700;
  letter-spacing: .8px; text-transform: uppercase;
  color: var(--gold-600);
}
[data-theme="dark"] .referral-code-label,
[data-theme="dim"]   .referral-code-label { color: var(--gold-400); }
.referral-code-value {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 1.5px;
  color: var(--text-primary);
}

.referral-progress-row { margin-bottom: 12px; }
.referral-progress-bar {
  height: 8px;
  background: var(--bg-surface-3);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 6px;
}
.referral-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-400), var(--gold-500));
  border-radius: 999px;
  transition: width .4s var(--ease);
}
.referral-progress-text {
  font-size: 12px;
  color: var(--text-tertiary);
  font-weight: 500;
}
.referral-progress-text strong {
  color: var(--text-primary);
  font-weight: 800;
}

.referral-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--border-subtle);
}
.referral-stat { text-align: center; }
.referral-stat .num {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -.4px;
}
.referral-stat .lbl {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--text-tertiary);
  font-weight: 700;
  margin-top: 2px;
}

/* ---- Referral details modal ---- */
.referral-info-banner {
  display: flex;
  gap: 14px;
  padding: 16px 18px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(245,158,11,.12), rgba(251,191,36,.04));
  border: 1.5px solid rgba(245,158,11,.35);
  margin-bottom: 18px;
  align-items: center;
}
.referral-info-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--gold-400), var(--gold-500));
  color: #422006;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; flex-shrink: 0;
}
.referral-info-banner strong {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-primary);
}
.referral-info-banner p {
  font-size: 12.5px;
  color: var(--text-secondary);
  margin: 3px 0 0;
  line-height: 1.5;
}

.referral-share-block { margin-bottom: 18px; }
.referral-share-block label {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.referral-share-row {
  display: flex;
  gap: 8px;
}
.referral-share-row input {
  flex: 1;
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-weight: 700;
  letter-spacing: 1px;
  background: var(--bg-surface-2);
  border: 1.5px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  color: var(--text-primary);
}

.referral-progress-large { margin-bottom: 18px; }

.referral-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 260px;
  overflow-y: auto;
  padding: 8px;
  background: var(--bg-surface-2);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}
.referral-list-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--bg-surface);
  border-radius: var(--radius-sm);
}
.referral-list-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-600), var(--accent-500));
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800;
  flex-shrink: 0;
}
.referral-list-info { flex: 1; min-width: 0; }
.referral-list-info strong {
  display: block;
  font-size: 13.5px;
  color: var(--text-primary);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.referral-list-info span {
  font-size: 11.5px;
  color: var(--text-tertiary);
}
.referral-tag {
  font-size: 10.5px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--bg-surface-3);
  color: var(--text-tertiary);
  letter-spacing: .3px;
  text-transform: uppercase;
}
.referral-tag.ok {
  background: linear-gradient(135deg, var(--gold-400), var(--gold-500));
  color: #422006;
}

/* ============================================================
   60. ADMIN — Plans, Coupons, Referrals
   ============================================================ */
.admin-plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.admin-plan-card {
  background: var(--bg-surface);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
  transition: .2s var(--ease);
}
.admin-plan-card:hover {
  transform: translateY(-3px);
  border-color: var(--brand-300);
  box-shadow: var(--shadow-md);
}
[data-theme="dark"] .admin-plan-card:hover,
[data-theme="dim"]   .admin-plan-card:hover { border-color: var(--brand-500); }
.admin-plan-card.featured {
  border-color: var(--brand-500);
  background: linear-gradient(180deg, rgba(99,102,241,.05), var(--bg-surface) 40%);
}
.admin-plan-card.disabled { opacity: .65; }
.admin-plan-card-head .plan-duration {
  font-size: 10.5px;
  margin-bottom: 2px;
}
.admin-plan-card-head .plan-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.25;
}
.admin-plan-card .plan-desc {
  min-height: 32px;
  font-size: 12.5px;
  margin: 6px 0 10px;
}

.plan-status-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.plan-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px dashed var(--border-subtle);
}
.plan-actions .btn { flex: 1; min-width: 0; }

/* ---- Data tables (coupons / referrals) ---- */
.coupons-table {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.data-table thead th {
  background: var(--bg-surface-2);
  text-align: left;
  padding: 12px 16px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .6px;
  text-transform: uppercase;
  color: var(--text-tertiary);
  border-bottom: 1px solid var(--border-subtle);
}
.data-table tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: var(--bg-surface-2); }

.coupon-code {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-weight: 800;
  letter-spacing: .6px;
  padding: 3px 9px;
  border-radius: 6px;
  background: var(--bg-surface-3);
  color: var(--brand-600);
  font-size: 12.5px;
}
[data-theme="dark"] .coupon-code,
[data-theme="dim"]   .coupon-code { color: var(--brand-300); }

.actions-cell {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

@media (max-width: 720px) {
  .data-table thead { display: none; }
  .data-table, .data-table tbody, .data-table tr, .data-table td {
    display: block;
    width: 100%;
  }
  .data-table tr {
    border-bottom: 1px solid var(--border-subtle);
    padding: 8px 12px;
  }
  .data-table td {
    border: none;
    padding: 6px 0;
    display: flex;
    justify-content: space-between;
    gap: 10px;
  }
  /* ⚠️ FIX: The generic `td` rule (0,1,1) was overriding `.actions-cell`
     (0,1,0). Bump specificity with `td.actions-cell` so buttons stay
     horizontal and wrap nicely instead of stacking vertically. */
  .data-table td.actions-cell {
    display: flex;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 6px;
  }
}

/* ============================================================
   61. RESPONSIVE tweaks
   ============================================================ */
@media (max-width: 720px) {
  .plans-grid { grid-template-columns: 1fr; }
  .plan-amount { font-size: 36px; }
  .referral-stats-row { grid-template-columns: 1fr 1fr; }
  .referral-card { flex-direction: column; align-items: stretch; }
  .referral-card-icon { align-self: flex-start; }
  .admin-plans-grid { grid-template-columns: 1fr; }
  .checkout-plan-row { flex-direction: column; align-items: flex-start; }
}
/* ============================================================
   62. CONSOLIDATED LAYOUT FIX
   ------------------------------------------------------------
   Resolves duplicate rules across §24 / §52 that were causing
   cards, avatars, and the owner block to overlap / collapse.
   Loaded LAST so it wins without !important spaghetti.
   ============================================================ */

/* ---------- 1. Owner block — clean flex, no auto-margins ---------- */
.owner-container {
  display: flex !important;
  gap: 28px !important;
  align-items: flex-start !important;
  flex-wrap: wrap !important;
}
.owner-container .owner-avatar,
.owner-container .owner-image {
  margin: 0 !important;
  width: 160px !important;
  height: 160px !important;
  flex-shrink: 0 !important;
  border-radius: 50% !important;
  overflow: hidden !important;
  border: 4px solid var(--brand-500) !important;
  box-shadow: 0 12px 32px rgba(99,102,241,.25) !important;
  background: var(--bg-surface-3) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  aspect-ratio: 1 / 1 !important;
}
.owner-avatar img,
.owner-avatar-img,
.owner-preview-img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center 25% !important;
  border-radius: 50% !important;
  display: block !important;
}
.owner-avatar-fallback {
  font-size: 42px !important;
  font-weight: 900 !important;
  color: var(--brand-500) !important;
}
.owner-details {
  flex: 1 1 320px !important;
  min-width: 0 !important;
}
.owner-details h3 {
  font-size: 20px !important;
  font-weight: 700 !important;
  letter-spacing: -.3px !important;
  color: var(--text-primary) !important;
  margin: 8px 0 4px !important;
}
.owner-role-badge {
  display: inline-block !important;
  padding: 3px 10px !important;
  border-radius: 999px !important;
  font-size: 10.5px !important;
  font-weight: 800 !important;
  letter-spacing: .6px !important;
  text-transform: uppercase !important;
  background: linear-gradient(135deg, var(--gold-400), var(--gold-500)) !important;
  color: #422006 !important;
}
.owner-title {
  font-size: 13.5px !important;
  font-weight: 600 !important;
  color: var(--brand-600) !important;
  margin-bottom: 10px !important;
}
.owner-details p {
  font-size: 13.5px !important;
  color: var(--text-secondary) !important;
  line-height: 1.65 !important;
  max-width: 640px !important;
  margin: 0 !important;
}
.owner-contact-row {
  display: flex !important;
  gap: 8px !important;
  flex-wrap: wrap !important;
  margin-top: 14px !important;
}

/* ---------- 2. Avatar system — ONE canonical size per context ---------- */
.professor-card .professor-avatar,
.professor-card .team-avatar,
.alumni-card  .alumni-avatar,
.friend-card  .team-avatar,
.friend-card  .professor-avatar {
  width: 100px !important;
  height: 100px !important;
  min-width: 100px !important;
  min-height: 100px !important;
  max-width: 100px !important;
  max-height: 100px !important;
  aspect-ratio: 1 / 1 !important;
  border-radius: 50% !important;
  overflow: hidden !important;
  margin: 0 auto 14px auto !important;
  border: 3px solid var(--brand-500) !important;
  box-shadow: 0 6px 18px rgba(99,102,241,.22) !important;
  background: var(--bg-surface-3) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
}
.professor-card .professor-avatar img,
.professor-card .team-avatar img,
.alumni-card  .alumni-avatar img,
.alumni-card  .alumni-avatar-img,
.friend-card  .team-avatar img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center 25% !important;
  border-radius: 50% !important;
  display: block !important;
}
.team-avatar-fallback,
.alumni-avatar-fallback,
.community-avatar-fallback {
  font-size: 32px !important;
  font-weight: 900 !important;
  color: var(--brand-500) !important;
  letter-spacing: -.5px !important;
}

/* ---------- 3. Card shells — consistent padding, no overlap ---------- */
.professor-card,
.alumni-card,
.friend-card {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  text-align: center !important;
  height: 100% !important;
  padding: 22px 20px 20px !important;
  background: var(--bg-surface) !important;
  border: 1px solid var(--border-subtle) !important;
  border-radius: var(--radius-lg) !important;
  overflow: hidden !important;
  gap: 0 !important;
  box-shadow: var(--shadow-xs) !important;
  transition: transform .25s var(--ease),
              box-shadow .25s var(--ease),
              border-color .25s var(--ease) !important;
}
.professor-card:hover,
.alumni-card:hover,
.friend-card:hover {
  transform: translateY(-4px) !important;
  box-shadow: var(--shadow-md) !important;
  border-color: var(--brand-300) !important;
}
.professor-card h3,
.alumni-card h3,
.friend-card h3 {
  font-size: 15px !important;
  font-weight: 700 !important;
  color: var(--text-primary) !important;
  margin: 0 0 4px !important;
  line-height: 1.3 !important;
}
.prof-title,
.alumni-work {
  font-size: 12.5px !important;
  font-weight: 600 !important;
  color: var(--brand-600) !important;
  margin: 2px 0 8px !important;
}

/* ---------- 4. Bio truncation — kills overlap from long text ---------- */
.professor-card p,
.alumni-bio,
.friend-card p {
  font-size: 12.5px !important;
  color: var(--text-secondary) !important;
  line-height: 1.55 !important;
  margin: 6px 0 12px !important;
  flex: 1 1 auto !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 4 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  word-break: break-word !important;
}

/* ---------- 5. Meta rows (alumni batch / degree / location) ---------- */
.alumni-meta,
.alumni-contact,
.team-contact-row,
.professor-card .team-contact-row,
.friend-card .team-contact-row {
  display: flex !important;
  justify-content: center !important;
  flex-wrap: wrap !important;
  gap: 6px 12px !important;
  margin-top: auto !important;
  padding-top: 10px !important;
  width: 100% !important;
  font-size: 11.5px !important;
  color: var(--text-tertiary) !important;
}
.alumni-meta i { color: var(--brand-500) !important; margin-right: 3px !important; }

/* ---------- 6. Contact chips — full standalone styling ---------- */
.contact-chip {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  padding: 6px 12px !important;
  border-radius: 999px !important;
  font-size: 11.5px !important;
  font-weight: 700 !important;
  font-family: inherit !important;
  cursor: pointer !important;
  text-decoration: none !important;
  border: 1px solid transparent !important;
  transition: .2s var(--ease) !important;
  white-space: nowrap !important;
}
.contact-chip-email {
  background: rgba(99,102,241,.1) !important;
  color: var(--brand-600) !important;
  border-color: rgba(99,102,241,.28) !important;
}
.contact-chip-email:hover {
  background: var(--brand-500) !important;
  color: #fff !important;
  border-color: var(--brand-500) !important;
}
.contact-chip-phone {
  background: rgba(16,185,129,.1) !important;
  color: var(--emerald-600) !important;
  border-color: rgba(16,185,129,.28) !important;
}
.contact-chip-phone:hover {
  background: var(--emerald-500) !important;
  color: #fff !important;
  border-color: var(--emerald-500) !important;
}

/* ---------- 7. Grids — single source of truth ---------- */
.professors-grid,
.alumni-grid,
.friends-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)) !important;
  gap: 20px !important;
  width: 100% !important;
  margin-bottom: 20px !important;
  align-items: stretch !important;
}
.feedback-wall {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
  gap: 20px !important;
  align-items: stretch !important;
}

/* ---------- 8. Section spacing — stops sections from touching ---------- */
.section-card { margin-bottom: 24px !important; }
.section-card + .section-card { margin-top: 4px !important; }

/* ---------- 9. Mobile stack — no overlap on phones ---------- */
@media (max-width: 768px) {
  .owner-container {
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    gap: 18px !important;
  }
  .owner-container .owner-avatar {
    width: 130px !important;
    height: 130px !important;
    margin: 0 auto !important;
  }
  .owner-contact-row { justify-content: center !important; }
  .owner-details p { margin: 0 auto !important; }

  .professors-grid,
  .alumni-grid,
  .friends-grid,
  .feedback-wall {
    grid-template-columns: 1fr !important;
  }
}
/* ============================================================
   63. SUBJECTIVE + NUMERICAL RANGE QUESTION TYPES
   ============================================================ */

/* ---- Numerical range preview (editor) ---- */
.numerical-range-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  margin-top: 10px;
  background: linear-gradient(135deg, rgba(99,102,241,.08), rgba(6,182,212,.03));
  border: 1px solid rgba(99,102,241,.25);
  border-left: 3px solid var(--brand-500);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.5;
}
.numerical-range-preview i {
  color: var(--brand-500);
  font-size: 14px;
  flex-shrink: 0;
}
.numerical-range-preview strong {
  color: var(--text-primary);
  font-weight: 800;
  padding: 1px 6px;
  background: var(--bg-surface-3);
  border-radius: 5px;
  font-variant-numeric: tabular-nums;
}

/* ---- Subjective editor info box ---- */
.subjective-info-box {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  margin-top: 10px;
  background: linear-gradient(135deg, rgba(245,158,11,.08), rgba(251,191,36,.03));
  border: 1px solid rgba(245,158,11,.30);
  border-left: 3px solid var(--gold-500);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.6;
}
.subjective-info-box > i {
  color: var(--gold-500);
  font-size: 16px;
  flex-shrink: 0;
  margin-top: 1px;
}
.subjective-info-box strong {
  color: var(--text-primary);
  font-weight: 700;
  display: block;
  margin-bottom: 4px;
}
.subjective-info-box ul {
  margin: 4px 0 0 18px;
  padding: 0;
  list-style: disc;
}
.subjective-info-box li {
  margin-bottom: 3px;
}

/* ---- Student subjective answer block ---- */
.subjective-answer-block {
  margin-top: 10px;
}
.subjective-instructions {
  padding: 10px 14px;
  margin-bottom: 12px;
  background: rgba(99,102,241,.06);
  border: 1px solid rgba(99,102,241,.20);
  border-left: 3px solid var(--brand-500);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.55;
}
.subjective-instructions i {
  color: var(--brand-500);
  margin-right: 6px;
}
.subjective-meta-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.subjective-max-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(245,158,11,.15);
  color: var(--gold-600);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .3px;
}
[data-theme="dark"] .subjective-max-badge,
[data-theme="dim"]   .subjective-max-badge { color: var(--gold-400); }

.subjective-upload-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 22px;
  border: 2px dashed var(--brand-500);
  border-radius: var(--radius-md);
  background: rgba(99,102,241,.06);
  color: var(--brand-600);
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: .2s var(--ease);
  width: 100%;
  max-width: 420px;
}
.subjective-upload-btn:hover {
  background: rgba(99,102,241,.14);
  border-color: var(--brand-600);
  transform: translateY(-1px);
}
[data-theme="dark"] .subjective-upload-btn,
[data-theme="dim"]   .subjective-upload-btn { color: var(--brand-300); }
.subjective-upload-btn i { font-size: 16px; }

.subjective-uploads {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.subjective-upload-tile {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface-2);
  display: flex;
  flex-direction: column;
  aspect-ratio: 1 / 1;
  box-shadow: var(--shadow-xs);
}
.subjective-upload-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.subjective-upload-tile.uploading {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
}
.subjective-upload-spinner {
  font-size: 24px;
  color: var(--brand-500);
}
.subjective-upload-progress {
  width: 100%;
  height: 6px;
  background: var(--bg-surface-3);
  border-radius: 999px;
  overflow: hidden;
}
.subjective-upload-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--brand-500), var(--accent-500));
  border-radius: 999px;
  transition: width .2s var(--ease);
}
.subjective-upload-name {
  font-size: 10.5px;
  color: var(--text-tertiary);
  font-weight: 600;
  padding: 4px 8px;
  background: var(--bg-surface);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
  text-align: center;
}
.subjective-upload-tile.uploading .subjective-upload-name {
  background: transparent;
}
.subjective-upload-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  background: rgba(239,68,68,.92);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  opacity: .85;
  transition: .2s var(--ease);
}
.subjective-upload-remove:hover {
  opacity: 1;
  transform: scale(1.1);
  background: var(--rose-500);
}

/* ---- Subjective result thumbs (student result view) ---- */
.subjective-result-thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 8px;
  margin: 8px 0;
}
.subjective-result-thumbs a {
  display: block;
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  transition: .2s var(--ease);
}
.subjective-result-thumbs a:hover {
  transform: scale(1.04);
  box-shadow: var(--shadow-md);
}
.subjective-result-thumbs img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.subjective-pending-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 8px 12px;
  background: rgba(245,158,11,.08);
  border: 1px solid rgba(245,158,11,.28);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  color: var(--gold-600);
  font-weight: 600;
}
[data-theme="dark"] .subjective-pending-note,
[data-theme="dim"]   .subjective-pending-note { color: var(--gold-400); }
.subjective-pending-note i { color: var(--gold-500); }

/* ---- Mobile tweaks ---- */
@media (max-width: 640px) {
  .subjective-uploads { grid-template-columns: repeat(2, 1fr); }
  .subjective-upload-btn { font-size: 13px; padding: 11px 16px; }
  .subjective-result-thumbs { grid-template-columns: repeat(3, 1fr); }
}
/* ============================================================
   64. OWNER PROFILE — loading skeleton
   ------------------------------------------------------------
   Shown between first paint and fetchOwnerProfile() completing,
   so the founder bio never flashes hard-coded fallback text.
   ============================================================ */
.owner-skeleton .owner-details {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1 1 320px;
  min-width: 0;
}
.owner-skeleton .skel-line {
  height: 12px;
  border-radius: 6px;
  background: var(--bg-surface-3);
  width: 100%;
  position: relative;
  overflow: hidden;
}
.owner-skeleton .skel-line::after {
  content: "";
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(99,102,241,.08) 50%,
    transparent 100%
  );
  animation: skeletonShimmer 1.6s ease-in-out infinite;
}
.owner-skeleton .skel-line.chip { height: 22px; border-radius: 999px; width: 90px; }
.owner-skeleton .skel-line.tall { height: 20px; }
.owner-skeleton .skel-line.w-40  { width: 40%; }
.owner-skeleton .skel-line.w-60  { width: 60%; }
.owner-skeleton .skel-line.w-80  { width: 80%; }
.owner-skeleton .skel-line.w-100 { width: 100%; }

.owner-skeleton .avatar-skeleton {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 42px;
  color: var(--brand-300);
  background: var(--bg-surface-3);
}
/* ============================================================
   65. LIVE ACTIVITY — Admin tab
   ============================================================ */
.live-activity-wrap {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ---- Stat row ---- */
.live-stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--gap-grid);
}

.live-stat-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}
.live-stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.live-stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}
.live-stat-icon::before {
  content: "";
  position: absolute;
  top: -30%; left: -30%;
  width: 160%; height: 160%;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.3), transparent 55%);
  pointer-events: none;
}
.live-stat-icon.tone-emerald {
  background: linear-gradient(135deg, #34d399, #059669);
  color: #fff;
  box-shadow: 0 6px 16px rgba(16,185,129,.35);
  animation: liveSignalPulse 2s ease-in-out infinite;
}
.live-stat-icon.tone-brand {
  background: linear-gradient(135deg, #818cf8, #4f46e5);
  color: #fff;
  box-shadow: 0 6px 16px rgba(99,102,241,.35);
}
.live-stat-icon.tone-gold {
  background: linear-gradient(135deg, #fbbf24, #d97706);
  color: #422006;
  box-shadow: 0 6px 16px rgba(245,158,11,.35);
}
.live-stat-icon.tone-cyan {
  background: linear-gradient(135deg, #22d3ee, #0891b2);
  color: #fff;
  box-shadow: 0 6px 16px rgba(6,182,212,.35);
}
@keyframes liveSignalPulse {
  0%, 100% { box-shadow: 0 6px 16px rgba(16,185,129,.35), 0 0 0 0 rgba(16,185,129,.4); }
  50%      { box-shadow: 0 6px 16px rgba(16,185,129,.35), 0 0 0 10px rgba(16,185,129,0); }
}

.live-stat-body { flex: 1; min-width: 0; }
.live-stat-num {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.05;
  letter-spacing: -.5px;
}
.live-stat-lbl {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: .6px;
  margin-top: 3px;
}

/* ---- User list ---- */
.live-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.live-user-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: transform .18s var(--ease), border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.live-user-row:hover {
  transform: translateY(-2px);
  border-color: var(--brand-300);
  box-shadow: var(--shadow-sm);
}
[data-theme="dark"] .live-user-row:hover,
[data-theme="dim"]   .live-user-row:hover { border-color: var(--brand-500); }

.live-user-row.studying {
  border-left: 4px solid var(--emerald-500);
  background: linear-gradient(90deg, rgba(16,185,129,.05), var(--bg-surface) 30%);
}
[data-theme="dark"] .live-user-row.studying,
[data-theme="dim"]   .live-user-row.studying {
  background: linear-gradient(90deg, rgba(16,185,129,.12), var(--bg-surface) 30%);
}

.live-user-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #22d3ee, #0891b2);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -.5px;
  flex-shrink: 0;
  box-shadow: 0 6px 14px rgba(6,182,212,.3), inset 0 1px 0 rgba(255,255,255,.25);
}
.live-user-row.studying .live-user-avatar {
  background: linear-gradient(135deg, #34d399, #059669);
  box-shadow: 0 6px 14px rgba(16,185,129,.35), inset 0 1px 0 rgba(255,255,255,.25);
}

.live-user-info { flex: 1; min-width: 0; }

.live-user-name {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  line-height: 1.3;
}

.live-user-handle {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-tertiary);
}

.live-user-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(16,185,129,.14);
  color: var(--emerald-600);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .4px;
  text-transform: uppercase;
}
[data-theme="dark"] .live-user-badge,
[data-theme="dim"]   .live-user-badge {
  background: rgba(16,185,129,.22);
  color: var(--emerald-400);
}
.live-user-badge i { font-size: 9px; }

.live-user-activity {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
  line-height: 1.5;
  word-break: break-word;
}
.live-user-activity strong {
  color: var(--text-primary);
  font-weight: 700;
}
.live-activity-label {
  color: var(--text-tertiary);
  font-style: italic;
}
.live-activity-code {
  color: var(--text-tertiary);
  font-weight: 500;
  font-size: 12px;
}
.live-activity-material {
  display: block;
  font-size: 11.5px;
  color: var(--text-tertiary);
  margin-top: 3px;
  padding-left: 2px;
}
.live-activity-material i {
  font-size: 10px;
  margin-right: 5px;
  color: var(--brand-500);
}

.live-user-seen {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-tertiary);
  flex-shrink: 0;
  padding: 5px 11px;
  background: var(--bg-surface-2);
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ---- Empty / error state ---- */
.live-empty {
  text-align: center;
  padding: 48px 20px;
  border-radius: var(--radius-lg);
  border: 1.5px dashed var(--border-default);
  background: var(--bg-surface-2);
  color: var(--text-tertiary);
}
.live-empty i {
  font-size: 36px;
  color: var(--brand-400);
  opacity: .45;
  display: block;
  margin-bottom: 12px;
}
.live-empty p {
  font-size: 13.5px;
  margin: 0;
  line-height: 1.55;
}

/* ---- Mobile ---- */
@media (max-width: 640px) {
  .live-stats-row { grid-template-columns: 1fr 1fr; }
  .live-stat-icon { width: 42px; height: 42px; font-size: 17px; border-radius: 10px; }
  .live-stat-num { font-size: 20px; }
  .live-user-row { padding: 12px 14px; gap: 10px; flex-wrap: wrap; }
  .live-user-avatar { width: 38px; height: 38px; font-size: 13px; }
  .live-user-name { font-size: 13.5px; }
  .live-user-seen { font-size: 10.5px; padding: 4px 9px; }
  .live-user-info { flex-basis: calc(100% - 90px); }
}
@media (max-width: 420px) {
  .live-stats-row { grid-template-columns: 1fr; }
}
/* ============================================================
   66. LIVE ACTIVITY — SSE status pill
   ============================================================ */
.live-activity-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .3px;
  color: var(--text-tertiary);
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  transition: color .2s var(--ease), background .2s var(--ease), border-color .2s var(--ease);
  white-space: nowrap;
}
.live-activity-pill.is-live {
  color: #059669;
  background: rgba(16,185,129,.10);
  border-color: rgba(16,185,129,.35);
}
[data-theme="dark"] .live-activity-pill.is-live,
[data-theme="dim"]   .live-activity-pill.is-live {
  color: #34d399;
  background: rgba(16,185,129,.18);
  border-color: rgba(16,185,129,.45);
}
.live-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-tertiary);
  flex-shrink: 0;
  transition: background .2s var(--ease);
}
.live-activity-pill.is-live .live-pulse-dot {
  background: #10b981;
  box-shadow: 0 0 0 0 rgba(16,185,129,.6);
  animation: livePulse 1.6s ease-in-out infinite;
}
@keyframes livePulse {
  0%   { box-shadow: 0 0 0 0 rgba(16,185,129,.6); }
  70%  { box-shadow: 0 0 0 8px rgba(16,185,129,0); }
  100% { box-shadow: 0 0 0 0 rgba(16,185,129,0); }
}
/* ============================================================
   67. PROFESSOR VISIBILITY TOGGLE (admin)
   ============================================================ */
.visibility-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .5px;
  text-transform: uppercase;
  vertical-align: middle;
  line-height: 1.4;
}
.visibility-pill.visibility-visible {
  background: rgba(16,185,129,.15);
  color: var(--emerald-600);
}
.visibility-pill.visibility-hidden {
  background: rgba(148,163,184,.22);
  color: #64748b;
}
[data-theme="dark"] .visibility-pill.visibility-visible,
[data-theme="dim"]   .visibility-pill.visibility-visible { color: var(--emerald-400); }
[data-theme="dark"] .visibility-pill.visibility-hidden,
[data-theme="dim"]   .visibility-pill.visibility-hidden { color: #cbd5e1; }

/* Hidden professor card — visually de-emphasized but still fully interactive */
.admin-professor-item.professor-hidden {
  opacity: .62;
  border-style: dashed;
}
.admin-professor-item.professor-hidden:hover {
  opacity: 1;
}

/* Keep the actions column tidy with two buttons */
.admin-professor-item .actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: stretch;
  flex-shrink: 0;
  align-self: flex-start;
}
.admin-professor-item .actions .btn {
  justify-content: center;
  white-space: nowrap;
}
/* ============================================================
   DYNAMIC TESTIMONIALS — real student reviews
   ============================================================ */
.testimonial-real {
  padding: 22px 22px 20px;
  background: var(--bg-surface-2);
  display: flex;
  flex-direction: column;
  min-height: 200px;
  position: relative;
  overflow: hidden;
}
.testimonial-real::before {
  content: "\201C";
  position: absolute;
  top: 12px; right: 18px;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 68px;
  font-weight: 900;
  color: var(--brand-400);
  opacity: 0.14;
  line-height: 1;
  pointer-events: none;
}
.testimonial-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.testimonial-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-600), var(--accent-500));
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 800;
  flex-shrink: 0;
  box-shadow: 0 6px 14px rgba(99,102,241,.28);
  letter-spacing: -0.3px;
}
.testimonial-meta { flex: 1; min-width: 0; }
.testimonial-meta h4 {
  font-size: 14.5px; font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 2px;
  letter-spacing: -0.2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.testimonial-stars {
  color: var(--gold-500);
  font-size: 13px;
  letter-spacing: 1.5px;
  display: inline-block;
}
.testimonial-date {
  font-size: 11px;
  color: var(--text-tertiary);
  font-weight: 500;
  flex-shrink: 0;
}
.testimonial-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
  line-height: 1.35;
}
.testimonial-body {
  font-size: 13.5px;
  line-height: 1.62;
  color: var(--text-secondary);
  margin: 0 0 12px;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.testimonial-course {
  font-size: 11.5px;
  color: var(--text-tertiary);
  font-weight: 600;
  padding-top: 10px;
  border-top: 1px dashed var(--border-subtle);
  display: inline-flex; align-items: center; gap: 6px;
}
.testimonial-course i { color: var(--brand-500); }
/* ============================================================
   XP + LEVEL WIDGET
   ============================================================ */
.xp-widget {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  margin-bottom: 14px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(99,102,241,.08), rgba(6,182,212,.04));
  border: 1.5px solid rgba(99,102,241,.28);
  position: relative;
  overflow: hidden;
}
[data-theme="dark"] .xp-widget,
[data-theme="dim"]   .xp-widget {
  background: linear-gradient(135deg, rgba(99,102,241,.16), rgba(6,182,212,.06));
  border-color: rgba(99,102,241,.4);
}
.xp-widget::before {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(circle at 100% 0%, rgba(251,191,36,.10), transparent 55%);
  pointer-events: none;
}
.xp-badge {
  position: relative;
  width: 58px; height: 58px;
  border-radius: 16px;
  background: linear-gradient(135deg, #6366f1, #06b6d4);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  box-shadow: 0 8px 22px rgba(99,102,241,.4),
              inset 0 1px 0 rgba(255,255,255,.35);
}
.xp-badge-lvl {
  position: absolute;
  bottom: -4px; right: -4px;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #422006;
  width: 24px; height: 24px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 900;
  border: 2.5px solid var(--bg-surface);
  box-shadow: 0 3px 10px rgba(245,158,11,.4);
}
.xp-body { flex: 1; min-width: 0; position: relative; z-index: 1; }
.xp-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.xp-rank {
  font-size: 14px; font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -.2px;
}
.xp-amount {
  font-size: 12px;
  color: var(--text-tertiary);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.xp-amount strong {
  color: var(--brand-600);
  font-weight: 800;
  font-size: 13px;
}
[data-theme="dark"] .xp-amount strong,
[data-theme="dim"]   .xp-amount strong { color: var(--brand-300); }
.xp-bar {
  height: 8px;
  border-radius: 999px;
  background: var(--bg-surface-3);
  overflow: hidden;
  margin-bottom: 6px;
  position: relative;
}
.xp-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #6366f1, #06b6d4, #fbbf24);
  background-size: 200% 100%;
  animation: xpShimmer 3s linear infinite;
  transition: width .6s cubic-bezier(.4,0,.2,1);
}
@keyframes xpShimmer {
  0%   { background-position:   0% 50%; }
  100% { background-position: 200% 50%; }
}
.xp-hint {
  font-size: 11px;
  color: var(--text-tertiary);
  font-weight: 500;
}
.xp-hint strong {
  color: var(--text-secondary);
  font-weight: 700;
}
/* ============================================================
   MATERIAL CARD THUMBNAILS
   ============================================================ */
.material-item {
  padding: 0 !important;
  overflow: hidden;
}
.material-thumb {
  width: 100%;
  aspect-ratio: 3 / 2;
  max-height: 190px;
  overflow: hidden;
  position: relative;
  background: var(--bg-surface-3);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
}
.material-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
  transition: transform .4s cubic-bezier(.4,0,.2,1);
}
.material-item:hover .material-thumb img {
  transform: scale(1.04);
}
.material-thumb-cover {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #fff;
  font-weight: 700;
  letter-spacing: 1px;
  text-shadow: 0 2px 8px rgba(0,0,0,.25);
  width: 100%;
  height: 100%;
  background:
    radial-gradient(circle at 70% 20%, rgba(255,255,255,.18), transparent 55%),
    linear-gradient(135deg, rgba(0,0,0,.05), rgba(0,0,0,.18));
}
.material-thumb-cover i {
  font-size: 42px;
  opacity: .9;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,.3));
}
.material-thumb-cover span {
  font-size: 10.5px;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.22);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.25);
}
.material-thumb-lock {
  position: absolute;
  top: 10px; right: 10px;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  border: 1px solid rgba(255,255,255,.2);
}
.material-item:has(.material-thumb) .mat-head,
.material-item:has(.material-thumb) h4,
.material-item:has(.material-thumb) .mat-desc,
.material-item:has(.material-thumb) .mat-actions {
  padding-left: 18px;
  padding-right: 18px;
}
.material-item:has(.material-thumb) .mat-head { padding-top: 16px; }
.material-item:has(.material-thumb) .mat-actions { padding-bottom: 16px; }
.material-item:not(:has(.material-thumb)) {
  padding: 16px 18px !important;
}
/* ============================================================
   CONTINUE CARD — progress ring
   ============================================================ */
.continue-ring {
  position: relative;
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.continue-ring svg {
  position: absolute;
  inset: 0;
  overflow: visible;
  filter: drop-shadow(0 4px 12px rgba(99,102,241,.28));
}
.continue-ring-track {
  stroke: var(--bg-surface-3);
  opacity: .9;
}
[data-theme="dark"] .continue-ring-track,
[data-theme="dim"]   .continue-ring-track {
  stroke: rgba(255,255,255,.08);
}
.continue-ring-fill {
  transition: stroke-dasharray 1.2s cubic-bezier(.4,0,.2,1);
  filter: drop-shadow(0 0 6px rgba(99,102,241,.5));
}
.continue-ring-pct {
  position: relative;
  z-index: 1;
  font-size: 15px;
  font-weight: 900;
  color: var(--text-primary);
  letter-spacing: -.5px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.continue-ring-pct-sym {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-tertiary);
  margin-left: 1px;
}

@media (max-width: 640px) {
  .continue-ring { width: 56px; height: 56px; }
  .continue-ring-pct { font-size: 13px; }
}
/* ============================================================
   MOBILE BOTTOM NAVIGATION
   ============================================================ */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 940;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  box-shadow: 0 -8px 24px rgba(20,22,28,.06);
  padding: 6px env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  padding-bottom: calc(6px + env(safe-area-inset-bottom));
  justify-content: space-around;
  align-items: stretch;
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  transition: transform .3s cubic-bezier(.4,0,.2,1);
}
[data-theme="dark"] .mobile-bottom-nav {
  background: rgba(12,16,32,.92);
  border-top-color: rgba(129,140,248,.18);
  box-shadow: 0 -8px 24px rgba(0,0,0,.4);
}
[data-theme="dim"] .mobile-bottom-nav {
  background: rgba(31,31,41,.92);
  border-top-color: rgba(129,140,248,.16);
}

.mbn-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 6px 4px;
  text-decoration: none;
  color: var(--text-tertiary);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .2px;
  border-radius: 12px;
  transition: color .2s, transform .2s;
  -webkit-tap-highlight-color: transparent;
  position: relative;
}
.mbn-item .mbn-icon {
  position: relative;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  transition: background .25s, transform .25s;
}
.mbn-item .mbn-icon i {
  font-size: 16px;
  transition: transform .25s cubic-bezier(.34,1.56,.64,1);
}
.mbn-item .mbn-label {
  font-size: 10px;
  line-height: 1;
  margin-top: 1px;
}

.mbn-item.active { color: var(--brand-600); }
[data-theme="dark"] .mbn-item.active,
[data-theme="dim"]   .mbn-item.active { color: var(--brand-300); }

.mbn-item.active .mbn-icon {
  background: rgba(99,102,241,.14);
  transform: translateY(-2px);
}
[data-theme="dark"] .mbn-item.active .mbn-icon,
[data-theme="dim"]   .mbn-item.active .mbn-icon {
  background: rgba(99,102,241,.22);
}
.mbn-item.active .mbn-icon i { transform: scale(1.08); }
.mbn-item:active .mbn-icon { transform: scale(.92); }

.mbn-item-ai .mbn-icon {
  background: linear-gradient(135deg, #6366f1, #06b6d4);
  color: #fff;
  box-shadow: 0 6px 16px rgba(99,102,241,.45);
  transform: translateY(-6px);
  border: 2px solid var(--bg-surface);
  width: 44px;
  height: 44px;
  border-radius: 14px;
}
.mbn-item-ai .mbn-icon i { font-size: 17px; }
.mbn-item-ai .mbn-label { margin-top: -2px; }
.mbn-item-ai.active .mbn-icon {
  transform: translateY(-6px) scale(1.06);
  box-shadow: 0 10px 22px rgba(99,102,241,.6);
}

.mbn-badge {
  position: absolute;
  top: -4px; right: -6px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--bg-surface);
  line-height: 1;
}

@media (max-width: 640px) {
  .mobile-bottom-nav[style*="display: none"] { display: none !important; }
  .mobile-bottom-nav { display: flex; }

  .main-content { padding-bottom: calc(88px + env(safe-area-inset-bottom)) !important; }
  .app-footer   { padding-bottom: calc(74px + env(safe-area-inset-bottom)) !important; }

  #appHeader { padding: 10px 14px; }
  .brand-text h1 { font-size: 14.5px; }
}

/* Hide during full-screen experiences */
body:has(.quiz-exam-shell[aria-hidden="false"]) .mobile-bottom-nav,
body:has(.video-player-modal.active) .mobile-bottom-nav,
body:has(.pdf-viewer-modal.active) .mobile-bottom-nav,
body:has(.modal-overlay.active) .mobile-bottom-nav {
  transform: translateY(120%);
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .mbn-item .mbn-icon,
  .mbn-item .mbn-icon i { transition: none !important; }
}
/* ============================================================
   PDF VIEWER v6 — Progressive loading + UX polish + extra colors
   ============================================================ */

/* Anchor the progress bar inside the shell */
.pdfv-shell { position: relative; }

/* ---- Reading progress bar (thin line at very top) ---- */
.pdfv-progress {
  position: absolute;
  top: 0; left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, #6366f1, #06b6d4);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.55);
  z-index: 25;
  transition: width .12s linear;
  pointer-events: none;
  border-radius: 0 3px 3px 0;
}

/* ---- Page placeholder skeleton (shown until a page renders) ---- */
.pdfv-page-skeleton {
  position: absolute;
  inset: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: #ffffff;
  z-index: 1;
  pointer-events: none;
}
.pdfv-page-skeleton::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(99, 102, 241, 0.07) 50%,
    transparent 100%
  );
  transform: translateX(-100%);
  animation: pdfvSkelShimmer 1.8s ease-in-out infinite;
  pointer-events: none;
}
@keyframes pdfvSkelShimmer {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}
.pdfv-skeleton-spinner {
  width: 30px; height: 30px;
  border: 3px solid rgba(99, 102, 241, 0.15);
  border-top-color: #6366f1;
  border-radius: 50%;
  animation: pdfSpin .8s linear infinite;
  position: relative;
  z-index: 1;
}
.pdfv-skeleton-text {
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: .4px;
  color: #94a3b8;
  position: relative;
  z-index: 1;
  font-family: 'Inter', system-ui, sans-serif;
}

/* ---- Extra highlighter swatches (purple / aqua / coral) ---- */
.pdfv-color.purple { background: #a78bfa; }
.pdfv-color.cyan   { background: #22d3ee; }
.pdfv-color.red    { background: #f87171; }

/* Tighter swatches when 8 are present on narrow screens */
@media (max-width: 720px) {
  .pdfv-hl-colors { gap: 3px; padding: 2px; }
  .pdfv-color { width: 18px; height: 18px; }
}
@media (max-width: 420px) {
  .pdfv-hl-colors { gap: 2px; }
  .pdfv-color { width: 16px; height: 16px; }
}
/* ============================================================
   HEADER + PROFILE — v2 Fix (no-wrap desktop, clean avatar,
   floating dropdown). Replaces all earlier header rules.
   ============================================================ */

/* ---------- 1. Header: NEVER wrap on desktop ---------- */
#appHeader {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 10px !important;
  padding: 10px 20px !important;
  flex-wrap: nowrap !important;
  min-height: 62px !important;
}

/* ---------- 2. Brand ---------- */
.brand { flex-shrink: 0 !important; gap: 10px !important; }
.brand-icon {
  width: 38px !important;
  height: 38px !important;
  font-size: 16px !important;
  border-radius: 10px !important;
  flex-shrink: 0 !important;
}
.brand-text h1 {
  font-size: 15px !important;
  line-height: 1.15 !important;
  letter-spacing: -.2px !important;
}
.brand-text span { font-size: 10.5px !important; }

/* ---------- 3. Nav — shrinks, never wraps ---------- */
.main-nav {
  flex: 1 1 auto !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  gap: 2px !important;
  min-width: 0 !important;
  flex-wrap: nowrap !important;
}
.main-nav a {
  padding: 7px 13px !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  gap: 6px !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
}

/* ---------- 4. User-info cluster ---------- */
.user-info {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  flex-shrink: 0 !important;
}
.user-info .icon-btn {
  width: 34px !important;
  height: 34px !important;
  font-size: 13px !important;
  flex-shrink: 0 !important;
}

/* ---------- 5. Streak badge ---------- */
.streak-badge {
  padding: 4px 10px !important;
  font-size: 11.5px !important;
  gap: 4px !important;
  flex-shrink: 0 !important;
  height: 30px !important;
  align-items: center !important;
}
.streak-badge i { font-size: 11px !important; }

/* ---------- 6. Profile wrapper + button ---------- */
.user-profile-wrap {
  position: relative !important;
  display: inline-flex !important;
  flex-shrink: 0 !important;
}
.user-profile-btn {
  display: flex !important;
  align-items: center !important;
  gap: 7px !important;
  padding: 4px 10px 4px 4px !important;
  border-radius: 999px !important;
  background: rgba(255,255,255,.08) !important;
  border: 1px solid rgba(255,255,255,.18) !important;
  color: #fff !important;
  cursor: pointer !important;
  font-family: inherit !important;
  height: 38px !important;
  max-width: 180px !important;
  transition: background .2s, border-color .2s !important;
}
.user-profile-btn:hover {
  background: rgba(255,255,255,.16) !important;
  border-color: rgba(255,255,255,.3) !important;
}

/* ⭐ THE AVATAR — locked size, gradient, no bleed-through */
.user-avatar-sm {
  width: 28px !important;
  height: 28px !important;
  min-width: 28px !important;
  min-height: 28px !important;
  border-radius: 50% !important;
  background: linear-gradient(135deg, #6366f1 0%, #06b6d4 100%) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 11px !important;
  font-weight: 800 !important;
  color: #ffffff !important;
  flex-shrink: 0 !important;
  line-height: 1 !important;
  overflow: hidden !important;
  letter-spacing: 0 !important;
  box-shadow: 0 2px 6px rgba(99,102,241,.5) !important;
  text-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* ⭐ Username — clean ellipsis, hidden on narrow screens */
.user-profile-btn .user-name {
  display: inline-block !important;
  font-size: 12.5px !important;
  font-weight: 600 !important;
  color: rgba(255,255,255,.92) !important;
  max-width: 90px !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  line-height: 1 !important;
  padding: 0 !important;
  margin: 0 !important;
}

.profile-chevron {
  font-size: 9px !important;
  color: rgba(255,255,255,.55) !important;
  transition: transform .25s !important;
  flex-shrink: 0 !important;
}
.user-profile-wrap.open .profile-chevron {
  transform: rotate(180deg) !important;
}

/* ---------- 7. Dropdown — floats, never pushes ---------- */
.user-dropdown {
  position: absolute !important;
  top: calc(100% + 10px) !important;
  right: 0 !important;
  width: 240px !important;
  background: var(--bg-surface) !important;
  border: 1px solid var(--border-subtle) !important;
  border-radius: 14px !important;
  box-shadow: 0 20px 48px rgba(0,0,0,.25),
              0 8px 16px rgba(0,0,0,.08) !important;
  z-index: 500 !important;
  opacity: 0 !important;
  visibility: hidden !important;
  transform: translateY(-8px) !important;
  transition: opacity .2s ease, transform .2s ease, visibility .2s !important;
  overflow: hidden !important;
}
.user-profile-wrap.open .user-dropdown {
  opacity: 1 !important;
  visibility: visible !important;
  transform: translateY(0) !important;
}

.user-dropdown-header {
  padding: 16px !important;
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  background: var(--bg-surface-2) !important;
}
.user-avatar-lg {
  width: 44px !important;
  height: 44px !important;
  min-width: 44px !important;
  border-radius: 50% !important;
  background: linear-gradient(135deg, #6366f1 0%, #06b6d4 100%) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 15px !important;
  font-weight: 800 !important;
  color: #fff !important;
  flex-shrink: 0 !important;
  box-shadow: 0 4px 12px rgba(99,102,241,.35) !important;
}
.user-dropdown-info {
  display: flex !important;
  flex-direction: column !important;
  gap: 5px !important;
  min-width: 0 !important;
}
.user-dropdown-info strong {
  font-size: 14px !important;
  color: var(--text-primary) !important;
  line-height: 1.2 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}
.user-dropdown-divider {
  height: 1px !important;
  background: var(--border-subtle) !important;
}
.user-dropdown-item {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  width: 100% !important;
  padding: 14px 16px !important;
  background: transparent !important;
  border: none !important;
  color: var(--text-secondary) !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  font-family: inherit !important;
  cursor: pointer !important;
  text-align: left !important;
  transition: background .15s, color .15s !important;
}
.user-dropdown-item:hover {
  background: var(--bg-surface-3) !important;
  color: var(--text-primary) !important;
}
.user-dropdown-item.logout { color: var(--rose-500) !important; }
.user-dropdown-item.logout:hover {
  background: rgba(239,68,68,.08) !important;
  color: var(--rose-600) !important;
}
.user-dropdown-item i {
  width: 18px !important;
  text-align: center !important;
  font-size: 15px !important;
}

/* ---------- 8. Responsive compaction ---------- */

/* Hide username + chevron at medium widths */
@media (max-width: 1150px) {
  .user-profile-btn .user-name { display: none !important; }
  .user-profile-btn { padding: 4px !important; gap: 0 !important; }
  .user-profile-btn .profile-chevron { display: none !important; }
}

/* Shrink nav links a touch */
@media (max-width: 1080px) {
  .main-nav a { padding: 6px 11px !important; font-size: 12.5px !important; }
  .brand-text h1 { font-size: 14px !important; }
  .brand-text span { font-size: 10px !important; }
}

/* At mobile, hand control back to the original responsive rules */
@media (max-width: 860px) {
  #appHeader { flex-wrap: wrap !important; }
}

/* Extra tight on small phones */
@media (max-width: 640px) {
  #appHeader { padding: 10px 14px !important; gap: 8px !important; }
  .user-info { gap: 4px !important; }
  .user-info .icon-btn { width: 32px !important; height: 32px !important; font-size: 12px !important; }
}
/* ============================================================
   PDF PAYWALL — lock screen + preview badge
   ============================================================ */

/* ---- "PREVIEW" chip in the toolbar title ---- */
.pdfv-preview-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: 10px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #422006;
  box-shadow: 0 3px 10px rgba(245, 158, 11, 0.4);
  vertical-align: middle;
}
.pdfv-preview-chip i { font-size: 10px; }

/* ---- Paywall card — appears after the last free page ---- */
.pdfv-paywall {
  width: 100%;
  max-width: 720px;
  margin: 8px auto 60px;
  padding: 0 16px;
  box-sizing: border-box;
}

.pdfv-paywall-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
  padding: 44px 32px 36px;
  border-radius: 20px;
  background:
    radial-gradient(500px 260px at 50% 0%, rgba(99, 102, 241, 0.10), transparent 70%),
    var(--bg-surface, #ffffff);
  border: 2px dashed rgba(99, 102, 241, 0.35);
  box-shadow:
    0 24px 60px rgba(20, 22, 28, 0.14),
    0 0 0 1px rgba(99, 102, 241, 0.08) inset;
}
[data-theme="dark"] .pdfv-paywall-inner {
  background:
    radial-gradient(500px 260px at 50% 0%, rgba(99, 102, 241, 0.22), transparent 70%),
    var(--bg-surface, #181b20);
  border-color: rgba(99, 102, 241, 0.5);
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(99, 102, 241, 0.15) inset;
}

/* Decorative lock ring at the top */
.pdfv-paywall-icon {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  color: #fff;
  background: linear-gradient(135deg, #6366f1, #06b6d4);
  box-shadow:
    0 14px 34px rgba(99, 102, 241, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
  position: relative;
  margin-bottom: 4px;
}
.pdfv-paywall-icon::after {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.4), rgba(6, 182, 212, 0.4));
  filter: blur(18px);
  z-index: -1;
  opacity: 0.7;
}

.pdfv-paywall-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.4px;
  line-height: 1.2;
  color: var(--text-primary, #14161c);
  margin: 4px 0 0;
  max-width: 480px;
}

.pdfv-paywall-sub {
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--text-secondary, #4a4d5a);
  max-width: 480px;
  margin: 0;
}
.pdfv-paywall-sub strong {
  color: var(--text-primary, #14161c);
  font-weight: 800;
}
.pdfv-paywall-locked {
  display: inline-block;
  margin-top: 4px;
  color: var(--gold-600, #d97706);
  font-weight: 700;
  font-size: 13.5px;
}

.pdfv-paywall-btn {
  margin-top: 6px;
  padding: 15px 34px !important;
  font-size: 15.5px !important;
  font-weight: 800 !important;
  border-radius: 999px !important;
  background: linear-gradient(135deg, #10b981, #059669) !important;
  color: #fff !important;
  box-shadow: 0 14px 34px rgba(16, 185, 129, 0.45) !important;
  border: none !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 10px !important;
  position: relative !important;
  overflow: hidden !important;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
}
.pdfv-paywall-btn::before {
  content: "";
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  transition: left 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}
.pdfv-paywall-btn:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 20px 44px rgba(16, 185, 129, 0.55) !important;
}
.pdfv-paywall-btn:hover::before { left: 100%; }
.pdfv-paywall-btn:active { transform: translateY(0) scale(0.98) !important; }
.pdfv-paywall-btn i { font-size: 15px; }

.pdfv-paywall-note {
  font-size: 12px;
  color: var(--text-tertiary, #8b8d98);
  margin: 6px 0 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
}
.pdfv-paywall-note i { color: #10b981; font-size: 12px; }

/* ---- "No preview available" card (renderLimit === 0) ---- */
.pdfv-paywall--blank .pdfv-paywall-icon {
  background: linear-gradient(135deg, #94a3b8, #64748b);
  box-shadow: 0 14px 34px rgba(100, 116, 139, 0.4);
}
.pdfv-paywall--blank .pdfv-paywall-icon::after {
  background: linear-gradient(135deg, rgba(148, 163, 184, 0.4), rgba(100, 116, 139, 0.4));
}

/* ---- Scroll-triggered blur — applied to the last free page
       when the paywall card scrolls into view ---- */
.pdfv-page--fading {
  filter: blur(2.5px) brightness(0.97);
  transition: filter 0.45s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}
[data-theme="dark"] .pdfv-page--fading {
  filter: blur(2.5px) brightness(0.85);
}

/* ---- Pulsing attention state on the paywall when it's on screen ---- */
.pdfv-paywall--attention .pdfv-paywall-inner {
  animation: pdfvPaywallPulse 2.2s ease-in-out infinite;
}
@keyframes pdfvPaywallPulse {
  0%, 100% {
    box-shadow:
      0 24px 60px rgba(20, 22, 28, 0.14),
      0 0 0 0 rgba(16, 185, 129, 0.5);
  }
  50% {
    box-shadow:
      0 24px 60px rgba(20, 22, 28, 0.14),
      0 0 0 14px rgba(16, 185, 129, 0);
  }
}

/* ---- Mobile ---- */
@media (max-width: 640px) {
  .pdfv-paywall { padding: 0 12px; margin-bottom: 40px; }
  .pdfv-paywall-inner { padding: 32px 20px 28px; border-radius: 16px; }
  .pdfv-paywall-icon { width: 64px; height: 64px; font-size: 26px; }
  .pdfv-paywall-title { font-size: 18px; }
  .pdfv-paywall-sub { font-size: 13.5px; }
  .pdfv-paywall-btn { padding: 13px 26px !important; font-size: 14px !important; }
}
/* ============================================================
   68. LIVE ACTIVITY v2 — report card + session timers
   ============================================================ */

/* Session time chip inside each live-user row */
.live-user-time {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(99,102,241,.14), rgba(6,182,212,.06));
  color: var(--brand-600);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .3px;
  font-variant-numeric: tabular-nums;
  margin-left: 6px;
}
[data-theme="dark"] .live-user-time,
[data-theme="dim"]   .live-user-time {
  background: linear-gradient(135deg, rgba(99,102,241,.25), rgba(6,182,212,.10));
  color: var(--brand-300);
}
.live-user-row { transition: transform .18s var(--ease), box-shadow .18s var(--ease); }

/* ---- Report section ---- */
.live-report-section {
  margin-top: 12px;
  padding: 22px 24px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
}
.live-report-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
}
.live-report-title {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
}
.live-report-title > i {
  width: 40px; height: 40px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #6366f1, #06b6d4);
  color: #fff;
  font-size: 18px;
  flex-shrink: 0;
  box-shadow: 0 6px 16px rgba(99,102,241,.35);
}
.live-report-title strong {
  display: block;
  font-size: 15px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -.2px;
  line-height: 1.2;
}
.live-report-title span {
  display: block;
  font-size: 12.5px;
  color: var(--text-tertiary);
  margin-top: 3px;
  line-height: 1.45;
}
.live-report-controls {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.live-report-date {
  padding: 8px 12px;
  border: 1.5px solid var(--border-default);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
}
.live-report-date:focus {
  outline: none;
  border-color: var(--brand-500);
  box-shadow: 0 0 0 4px rgba(99,102,241,.14);
}

/* ---- Report summary tiles ---- */
.report-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.report-stat {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.report-stat:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}
.report-stat-icon {
  width: 42px; height: 42px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  color: #fff;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}
.report-stat-icon::before {
  content: "";
  position: absolute;
  top: -30%; left: -30%;
  width: 160%; height: 160%;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.3), transparent 55%);
}
.report-stat-icon.tone-brand   { background: linear-gradient(135deg, #818cf8, #4f46e5); }
.report-stat-icon.tone-emerald { background: linear-gradient(135deg, #34d399, #059669); }
.report-stat-icon.tone-cyan    { background: linear-gradient(135deg, #22d3ee, #0891b2); }
.report-stat-icon.tone-gold    { background: linear-gradient(135deg, #fbbf24, #d97706); color: #422006; }
.report-stat-body { flex: 1; min-width: 0; }
.report-stat-num {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -.4px;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.report-stat-lbl {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-tertiary);
  margin-top: 3px;
}

/* ---- Report blocks (top courses + students) ---- */
.report-block { margin-top: 20px; }
.report-block-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--text-tertiary);
  margin-bottom: 12px;
}
.report-block-title i { color: var(--brand-500); }

/* Top courses */
.report-course-list { display: flex; flex-direction: column; gap: 10px; }
.report-course-row {
  display: grid;
  grid-template-columns: 1fr 140px 70px;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  background: var(--bg-surface-2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}
.report-course-info { min-width: 0; }
.report-course-info strong {
  display: block;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.report-course-info span {
  font-size: 11px;
  color: var(--text-tertiary);
  font-weight: 600;
}
.report-course-bar {
  height: 8px;
  background: var(--bg-surface-3);
  border-radius: 999px;
  overflow: hidden;
}
.report-course-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--brand-500), var(--accent-500));
  border-radius: 999px;
  transition: width .6s var(--ease);
}
.report-course-time {
  font-size: 12.5px;
  font-weight: 800;
  color: var(--text-primary);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Student rows */
.report-student-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 420px;
  overflow-y: auto;
  padding: 4px;
}
.report-student-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: .18s var(--ease);
}
.report-student-row:hover {
  border-color: var(--brand-300);
  background: var(--bg-surface);
  transform: translateX(2px);
}
[data-theme="dark"] .report-student-row:hover,
[data-theme="dim"]   .report-student-row:hover {
  border-color: var(--brand-500);
}
.report-student-name { min-width: 0; flex: 1; }
.report-student-name strong {
  display: block;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.report-student-name span {
  font-size: 11.5px;
  color: var(--text-tertiary);
}
.report-student-metrics {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.metric-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--bg-surface-3);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.metric-pill i { font-size: 10px; color: var(--brand-500); }

/* ---- Individual student usage modal ---- */
.student-usage-totals {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}
.usage-total-item {
  text-align: center;
  padding: 14px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}
.usage-total-num {
  font-size: 22px;
  font-weight: 800;
  color: var(--brand-600);
  letter-spacing: -.4px;
  font-variant-numeric: tabular-nums;
}
[data-theme="dark"] .usage-total-num,
[data-theme="dim"]   .usage-total-num { color: var(--brand-300); }
.usage-total-lbl {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-tertiary);
  margin-top: 3px;
}
.usage-day-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 460px;
  overflow-y: auto;
  padding: 4px;
}
.usage-day-card {
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.usage-day-card > summary {
  list-style: none;
  cursor: pointer;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  user-select: none;
}
.usage-day-card > summary::-webkit-details-marker { display: none; }
.usage-day-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  width: 100%;
}
.usage-day-head strong {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}
.usage-day-time {
  font-size: 12.5px;
  font-weight: 800;
  color: var(--brand-600);
  font-variant-numeric: tabular-nums;
}
[data-theme="dark"] .usage-day-time,
[data-theme="dim"]   .usage-day-time { color: var(--brand-300); }
.usage-day-body {
  padding: 12px 14px 14px;
  border-top: 1px dashed var(--border-subtle);
  background: var(--bg-surface);
}
.usage-day-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.usage-section-label {
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--text-tertiary);
  margin: 10px 0 6px;
}
.usage-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.usage-chip {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 11.5px;
  font-weight: 600;
}
.usage-chip.small { font-size: 11px; }
.usage-chip.more {
  background: var(--brand-50);
  border-color: var(--brand-200);
  color: var(--brand-700);
}
[data-theme="dark"] .usage-chip.more,
[data-theme="dim"]   .usage-chip.more {
  background: rgba(99,102,241,.18);
  border-color: rgba(99,102,241,.35);
  color: var(--brand-300);
}

@media (max-width: 640px) {
  .live-report-section { padding: 16px; }
  .live-report-header { flex-direction: column; align-items: stretch; }
  .live-report-controls { width: 100%; }
  .live-report-date { flex: 1; }
  .report-course-row { grid-template-columns: 1fr; gap: 6px; }
  .report-course-time { text-align: left; }
  .report-student-row { flex-direction: column; align-items: stretch; }
  .report-student-metrics { justify-content: flex-start; }
  .student-usage-totals { grid-template-columns: 1fr; }
}
/* ============================================================
   68. LIVE ACTIVITY PRO — enriched UI
   ============================================================ */

/* ---- Insights grid (alerts + heatmap + sparkline) ---- */
.live-insights-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 18px;
}
.live-insights-wide {
  grid-column: 1 / -1;
}
@media (max-width: 900px) {
  .live-insights-grid { grid-template-columns: 1fr; }
}

.live-insights-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  box-shadow: var(--shadow-xs);
  transition: border-color .2s var(--ease);
}
.live-insights-panel:hover {
  border-color: var(--brand-300);
}

/* ---- Alerts panel ---- */
.live-alerts-head,
.live-heatmap-head,
.live-spark-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-subtle);
}
.live-alerts-head i,
.live-heatmap-head i,
.live-spark-head i { color: var(--brand-500); }
.live-alerts-sub,
.live-heatmap-sub,
.live-spark-sub {
  margin-left: auto;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-tertiary);
  letter-spacing: .2px;
}

.live-alerts-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 260px;
  overflow-y: auto;
}
.live-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease);
  border-left: 3px solid transparent;
}
.live-alert:hover {
  transform: translateX(3px);
  box-shadow: var(--shadow-sm);
}
.live-alert-icon {
  width: 30px; height: 30px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; color: #fff;
  flex-shrink: 0;
}
.live-alert-body {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: 2px;
}
.live-alert-body strong {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-primary);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.live-alert-body span {
  font-size: 11.5px;
  color: var(--text-tertiary);
  line-height: 1.45;
}
.live-alert-warn {
  background: rgba(245,158,11,.06);
  border-left-color: var(--gold-500);
}
.live-alert-warn .live-alert-icon { background: linear-gradient(135deg, #fbbf24, #d97706); }
.live-alert-info {
  background: rgba(99,102,241,.06);
  border-left-color: var(--brand-500);
}
.live-alert-info .live-alert-icon { background: linear-gradient(135deg, #818cf8, #4f46e5); }
.live-alert-success {
  background: rgba(16,185,129,.06);
  border-left-color: var(--emerald-500);
}
.live-alert-success .live-alert-icon { background: linear-gradient(135deg, #34d399, #059669); }

.live-empty-small {
  text-align: center;
  padding: 20px 12px;
  color: var(--text-tertiary);
  font-size: 12.5px;
}

/* ---- Heatmap ---- */
.live-heatmap-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.live-heatmap-row {
  display: grid;
  grid-template-columns: 1fr 100px;
  gap: 12px;
  align-items: center;
}
.live-heatmap-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.live-heatmap-meta strong {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-primary);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.live-heatmap-meta span {
  font-size: 11px;
  color: var(--text-tertiary);
}
.live-heatmap-bar {
  height: 8px;
  background: var(--bg-surface-3);
  border-radius: 999px;
  overflow: hidden;
}
.live-heatmap-fill {
  height: 100%;
  border-radius: 999px;
  transition: width .5s var(--ease);
}
.live-heatmap-fill.heat-hot  { background: linear-gradient(90deg, #ef4444, #f97316); }
.live-heatmap-fill.heat-warm { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.live-heatmap-fill.heat-cool { background: linear-gradient(90deg, #06b6d4, #22d3ee); }

/* ---- Sparkline ---- */
.live-spark {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 60px;
  padding: 4px 2px;
  background: linear-gradient(180deg, rgba(99,102,241,.04), transparent);
  border-radius: var(--radius-sm);
}
.live-spark-bar {
  flex: 1;
  min-height: 2px;
  border-radius: 2px 2px 0 0;
  background: linear-gradient(180deg, #6366f1, #06b6d4);
  transition: background .2s, transform .2s;
  cursor: pointer;
}
.live-spark-bar:hover {
  background: linear-gradient(180deg, #818cf8, #67e8f9);
  transform: scaleY(1.05);
}

/* ---- Sort + filter controls ---- */
.live-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 4px;
  margin-bottom: 4px;
}
.live-controls-count {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
}
.live-controls-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.live-segmented {
  display: inline-flex;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  padding: 3px;
}
.live-seg-btn {
  border: none;
  background: transparent;
  padding: 5px 12px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-tertiary);
  cursor: pointer;
  transition: background .18s var(--ease), color .18s var(--ease);
}
.live-seg-btn:hover { color: var(--text-primary); }
.live-seg-btn.active {
  background: var(--bg-surface);
  color: var(--brand-600);
  box-shadow: var(--shadow-xs);
}
[data-theme="dark"] .live-seg-btn.active,
[data-theme="dim"]   .live-seg-btn.active { color: var(--brand-300); }

.live-sort-select {
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-default);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
}

/* ---- Enriched user row ---- */
.live-user-row-v2 {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: transform .18s var(--ease), border-color .18s var(--ease), box-shadow .18s var(--ease);
  animation: liveRowIn .35s cubic-bezier(.4,0,.2,1);
}
@keyframes liveRowIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.live-user-row-v2:hover {
  transform: translateY(-2px);
  border-color: var(--brand-300);
  box-shadow: var(--shadow-sm);
}
[data-theme="dark"] .live-user-row-v2:hover,
[data-theme="dim"]   .live-user-row-v2:hover { border-color: var(--brand-500); }

.live-user-row-v2.studying {
  border-left: 4px solid var(--emerald-500);
  background: linear-gradient(90deg, rgba(16,185,129,.05), var(--bg-surface) 30%);
}
[data-theme="dark"] .live-user-row-v2.studying,
[data-theme="dim"]   .live-user-row-v2.studying {
  background: linear-gradient(90deg, rgba(16,185,129,.14), var(--bg-surface) 30%);
}
.live-user-row-v2.in-quiz {
  border-left: 4px solid var(--gold-500);
  background: linear-gradient(90deg, rgba(245,158,11,.06), var(--bg-surface) 30%);
}
[data-theme="dark"] .live-user-row-v2.in-quiz,
[data-theme="dim"]   .live-user-row-v2.in-quiz {
  background: linear-gradient(90deg, rgba(245,158,11,.14), var(--bg-surface) 30%);
}

/* Ring around avatar */
.live-user-ring {
  position: relative;
  width: 54px; height: 54px;
  flex-shrink: 0;
}
.live-user-ring svg {
  position: absolute;
  inset: 0;
  filter: drop-shadow(0 3px 8px rgba(99,102,241,.28));
}
.live-user-avatar-inner {
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #06b6d4);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -.3px;
}
.live-user-row-v2.studying .live-user-avatar-inner {
  background: linear-gradient(135deg, #34d399, #059669);
}
.live-user-row-v2.in-quiz .live-user-avatar-inner {
  background: linear-gradient(135deg, #fbbf24, #d97706);
}

.live-user-info { flex: 1; min-width: 0; }
.live-user-name {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}
.live-user-handle {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-tertiary);
}

/* Action chip */
.live-action-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .3px;
  text-transform: uppercase;
}
.live-action-chip i { font-size: 9px; }
.live-action-chip.kind-reading   { background: rgba(16,185,129,.14); color: #059669; }
.live-action-chip.kind-quiz      { background: rgba(245,158,11,.18); color: #d97706; }
.live-action-chip.kind-video     { background: rgba(239,68,68,.14);  color: #dc2626; }
.live-action-chip.kind-ai        { background: rgba(99,102,241,.14); color: #4f46e5; }
.live-action-chip.kind-browse    { background: rgba(6,182,212,.14);  color: #0891b2; }
.live-action-chip.kind-analytics { background: rgba(139,92,246,.14); color: #7c3aed; }
.live-action-chip.kind-author    { background: rgba(236,72,153,.14); color: #db2777; }
.live-action-chip.kind-admin     { background: rgba(107,114,128,.14); color: #4b5563; }
.live-action-chip.kind-idle      { background: rgba(148,163,184,.16); color: #64748b; }

/* Engagement chip */
.live-eng-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .2px;
}
.live-eng-chip.eng-hot  { background: linear-gradient(135deg, #f97316, #ef4444); color: #fff; }
.live-eng-chip.eng-warm { background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #422006; }
.live-eng-chip.eng-cool { background: var(--bg-surface-3); color: var(--text-tertiary); }

/* Device chip */
.live-device-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  color: var(--text-tertiary);
  font-size: 11px;
}

/* Right-side meta */
.live-user-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}
.live-session-time {
  font-size: 12px;
  font-weight: 800;
  color: var(--brand-600);
  padding: 3px 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(99,102,241,.14), rgba(6,182,212,.06));
  font-variant-numeric: tabular-nums;
}
[data-theme="dark"] .live-session-time,
[data-theme="dim"]   .live-session-time {
  background: linear-gradient(135deg, rgba(99,102,241,.25), rgba(6,182,212,.10));
  color: var(--brand-300);
}
.live-user-seen {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-tertiary);
  padding: 3px 9px;
  background: var(--bg-surface-2);
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Mobile tune-ups */
@media (max-width: 640px) {
  .live-insights-panel { padding: 14px 14px; }
  .live-heatmap-row { grid-template-columns: 1fr; gap: 6px; }
  .live-controls { flex-direction: column; align-items: stretch; }
  .live-controls-right { width: 100%; justify-content: space-between; }
  .live-user-row-v2 { flex-wrap: wrap; gap: 10px; padding: 12px; }
  .live-user-ring { width: 46px; height: 46px; }
  .live-user-avatar-inner { font-size: 12px; }
  .live-user-info { flex-basis: calc(100% - 70px); }
  .live-user-meta { flex-direction: row; align-items: center; width: 100%; justify-content: space-between; }
}
/* ============================================================
/* ============================================================
   69. LIVE ACTIVITY — material highlight styling (v2)
   ============================================================ */
.live-activity-material {
  display: inline-flex !important;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: var(--brand-600) !important;
  font-weight: 700;
  margin-top: 6px;
  padding: 4px 10px 4px 8px;
  background: linear-gradient(135deg, rgba(99,102,241,.10), rgba(6,182,212,.04));
  border-left: 3px solid var(--brand-500);
  border-radius: 6px;
  max-width: 100%;
  width: fit-content;
  line-height: 1.35;
  box-shadow: 0 1px 3px rgba(99,102,241,.10);
  transition: transform .15s var(--ease), box-shadow .15s var(--ease);
}
.live-activity-material:hover {
  transform: translateX(2px);
  box-shadow: 0 3px 10px rgba(99,102,241,.18);
}
[data-theme="dark"] .live-activity-material,
[data-theme="dim"]   .live-activity-material {
  background: linear-gradient(135deg, rgba(99,102,241,.22), rgba(6,182,212,.08));
  color: var(--brand-300) !important;
}

/* The icon sits in a small coloured pill so the type is
   instantly recognisable — PDF red, video blue, notes green… */
.live-activity-material i {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 5px;
  font-size: 11px !important;
  flex-shrink: 0;
  background: var(--brand-500);
  color: #ffffff !important;
  margin-right: 0 !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25);
}

/* Type-specific icon tint */
.live-activity-material i.fa-file-pdf       { background: linear-gradient(135deg, #ef4444, #b91c1c); }
.live-activity-material i.fa-video          { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.live-activity-material i.fa-file-lines     { background: linear-gradient(135deg, #10b981, #047857); }
.live-activity-material i.fa-chalkboard     { background: linear-gradient(135deg, #f59e0b, #b45309); }
.live-activity-material i.fa-file-pen       { background: linear-gradient(135deg, #ec4899, #be185d); }
.live-activity-material i.fa-circle-check   { background: linear-gradient(135deg, #06b6d4, #0e7490); }
.live-activity-material i.fa-flask          { background: linear-gradient(135deg, #8b5cf6, #6d28d9); }
.live-activity-material i.fa-clipboard-list { background: linear-gradient(135deg, #0ea5e9, #0369a1); }
.live-activity-material i.fa-book           { background: linear-gradient(135deg, #d97706, #92400e); }
.live-activity-material i.fa-pen-ruler      { background: linear-gradient(135deg, #14b8a6, #0f766e); }
.live-activity-material i.fa-file           { background: linear-gradient(135deg, #64748b, #334155); }
.live-activity-material i.fa-book-open      { background: linear-gradient(135deg, #6366f1, #4338ca); }

.live-activity-material-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ============================================================
   ⭐ PREMIUM ACCESS CONTROL — Students tab search / filter bar,
      premium badge and grant-premium modal.
      Additive only: no existing selector is modified.
   ============================================================ */
.student-filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  padding: 12px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
}

.student-search-wrap {
  position: relative;
  flex: 1 1 320px;
  min-width: 220px;
  display: flex;
  align-items: center;
}

.student-search-wrap > i.fa-search {
  position: absolute;
  left: 13px;
  font-size: 13px;
  color: var(--text-tertiary);
  pointer-events: none;
  transition: color .2s var(--ease);
}
.student-search-wrap:focus-within > i.fa-search { color: var(--brand-500); }

.student-search-input {
  width: 100%;
  padding: 10px 38px 10px 36px;
  font-size: 13.5px;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--bg-surface-2);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  outline: none;
  transition: .2s var(--ease);
}
.student-search-input::placeholder { color: var(--text-tertiary); }
.student-search-input:focus {
  border-color: var(--brand-500);
  background: var(--bg-surface);
  box-shadow: 0 0 0 3px rgba(99,102,241,.15);
}

.student-search-clear {
  position: absolute;
  right: 8px;
  width: 24px; height: 24px;
  display: inline-flex; align-items: center; justify-content: center;
  border: none;
  border-radius: 50%;
  background: var(--bg-surface-3);
  color: var(--text-secondary);
  font-size: 11px;
  cursor: pointer;
  transition: .18s var(--ease);
}
.student-search-clear:hover { background: var(--rose-500); color: #fff; }

.student-filter-select {
  flex: 0 0 auto;
  padding: 10px 12px;
  font-size: 13px;
  font-family: inherit;
  font-weight: 500;
  color: var(--text-primary);
  background: var(--bg-surface-2);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  cursor: pointer;
  outline: none;
  transition: .2s var(--ease);
}
.student-filter-select:focus {
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px rgba(99,102,241,.15);
}

.student-filter-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding: 9px 14px;
  font-size: 12.5px;
  color: var(--text-secondary);
  background: linear-gradient(135deg, rgba(99,102,241,.08), rgba(6,182,212,.05));
  border: 1px solid rgba(99,102,241,.2);
  border-radius: var(--radius-sm);
}
.student-filter-summary i { color: var(--brand-500); }
.student-filter-summary strong { color: var(--brand-600); font-weight: 800; }
[data-theme="dark"] .student-filter-summary strong,
[data-theme="dim"] .student-filter-summary strong { color: var(--brand-300); }

/* ---- Premium / free badge on the student card ---- */
.student-premium-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .2px;
  border-radius: var(--radius-pill);
  color: var(--text-tertiary);
  background: var(--bg-surface-3);
  border: 1px solid var(--border-subtle);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.student-premium-badge.active {
  color: #7c4a03;
  background: linear-gradient(135deg, rgba(251,191,36,.22), rgba(245,158,11,.14));
  border-color: rgba(245,158,11,.45);
}
[data-theme="dark"] .student-premium-badge.active,
[data-theme="dim"] .student-premium-badge.active { color: var(--gold-300); }

/* ---- Grant-premium modal summary line ---- */
.grant-premium-summary {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 4px 0 14px;
  padding: 10px 13px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-secondary);
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--brand-500);
  border-radius: var(--radius-sm);
}
.grant-premium-summary i { color: var(--brand-500); margin-top: 2px; flex-shrink: 0; }
.grant-premium-summary strong { color: var(--text-primary); font-weight: 700; }
.grant-premium-summary.warn {
  border-left-color: var(--gold-500);
  color: var(--gold-600);
}
.grant-premium-summary.warn i { color: var(--gold-500); }

@media (max-width: 640px) {
  .student-search-wrap { flex: 1 1 100%; }
  .student-filter-select { flex: 1 1 auto; }
}

/* ============================================================
   ⭐ 10-MINUTE INACTIVITY WARNING OVERLAY
   Sits above every modal (max modal z-index is 3000) but below
   the toast stack (9999), so the "signed out" toast is visible.
   ============================================================ */
.inactivity-overlay {
  position: fixed;
  inset: 0;
  z-index: 9500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(7,11,26,.62);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  animation: inactivityFadeIn .22s var(--ease-out) both;
}
@keyframes inactivityFadeIn { from { opacity: 0 } to { opacity: 1 } }

.inactivity-card {
  width: 100%;
  max-width: 400px;
  padding: 30px 26px 26px;
  text-align: center;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  animation: inactivityPop .3s var(--ease-spring) both;
}
@keyframes inactivityPop {
  from { opacity: 0; transform: translateY(14px) scale(.96) }
  to   { opacity: 1; transform: translateY(0)    scale(1)   }
}

.inactivity-icon {
  width: 62px; height: 62px;
  margin: 0 auto 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 25px;
  color: #fff;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-400), var(--gold-600));
  box-shadow: 0 10px 26px rgba(245,158,11,.38);
  animation: inactivityPulse 1.9s var(--ease) infinite;
}
@keyframes inactivityPulse {
  0%, 100% { transform: scale(1);    box-shadow: 0 10px 26px rgba(245,158,11,.38) }
  50%      { transform: scale(1.07); box-shadow: 0 14px 34px rgba(245,158,11,.55) }
}

.inactivity-card h3 {
  font-size: 18.5px;
  font-weight: 800;
  letter-spacing: -.3px;
  color: var(--text-primary);
  margin-bottom: 8px;
}
.inactivity-card p {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text-secondary);
}

.inactivity-count {
  margin: 14px auto;
  font-size: 46px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -2px;
  font-variant-numeric: tabular-nums;
  color: var(--gold-500);
  text-shadow: 0 2px 18px rgba(245,158,11,.35);
}
[data-theme="dark"] .inactivity-count,
[data-theme="dim"]  .inactivity-count { color: var(--gold-400); }

.inactivity-hint {
  font-size: 12.5px !important;
  color: var(--text-tertiary) !important;
  margin-bottom: 20px;
}
.inactivity-actions { display: flex; justify-content: center; }
.inactivity-actions .btn { min-width: 190px; justify-content: center; }

@media (prefers-reduced-motion: reduce) {
  .inactivity-overlay,
  .inactivity-card,
  .inactivity-icon { animation: none; }
}

/* ------------------------------------------------------------
   ⭐ Premium Access Control — layout corrections
   `[hidden]` must win over the `display` set on these rules,
   and the card action row needs to wrap now that it carries a
   third (full-width) "Grant / Extend Premium" button.
   ------------------------------------------------------------ */
.student-search-clear[hidden],
.student-filter-summary[hidden] { display: none !important; }

.student-grid .student-card-actions { flex-wrap: wrap; row-gap: 6px; }
.student-grid .student-card-actions .student-grant-btn {
  flex: 1 1 100%;
  justify-content: center;
  font-weight: 700;
}

/* ============================================================
   64. UI/UX HARDENING PASS
   ------------------------------------------------------------
   Centralized theme transitions · Night Mode palette polish ·
   community image constraints · bio Read-More/Show-Less ·
   full-screen app shell · 44x44 touch targets · fluid
   responsive spacing.
   Every rule here is ADDITIVE — nothing above is deleted.
   ============================================================ */

/* ------------------------------------------------------------
   64.1  CENTRALIZED THEME TRANSITION CONTRACT
   One place to tune the Light <-> Night colour animation.
   `aero-theme-anim` is applied to <html> for ~320ms around a
   theme change so the colour fade is smooth without
   permanently overriding any component's own transitions.
   ------------------------------------------------------------ */
:root {
  --theme-dur: .3s;
  --theme-ease: ease;
  --theme-transition:
    background-color var(--theme-dur) var(--theme-ease),
    border-color     var(--theme-dur) var(--theme-ease),
    color            var(--theme-dur) var(--theme-ease),
    box-shadow       var(--theme-dur) var(--theme-ease);
}

html.aero-theme-anim,
html.aero-theme-anim *,
html.aero-theme-anim *::before,
html.aero-theme-anim *::after {
  transition:
    background-color var(--theme-dur) var(--theme-ease),
    border-color     var(--theme-dur) var(--theme-ease),
    color            var(--theme-dur) var(--theme-ease),
    fill             var(--theme-dur) var(--theme-ease),
    stroke           var(--theme-dur) var(--theme-ease),
    box-shadow       var(--theme-dur) var(--theme-ease) !important;
  transition-delay: 0s !important;
}

/* The always-on shell surfaces use the same contract */
body { transition: var(--theme-transition); }
#app { transition: var(--theme-transition); }

/* Softer accent glow in Night mode */
[data-theme="dark"] .btn-primary {
  box-shadow: 0 0 0 1px rgba(129,140,248,.18), 0 6px 18px rgba(99,102,241,.22);
}
[data-theme="dark"] .btn-accent {
  box-shadow: 0 0 0 1px rgba(34,211,238,.20), 0 6px 18px rgba(6,182,212,.22);
}
[data-theme="dark"] .premium-badge { box-shadow: 0 3px 10px rgba(245,158,11,.18); }

/* ------------------------------------------------------------
   64.2  FULL-SCREEN POST-LOGIN SHELL
   The dashboard always fills the viewport height, and on
   tablets/phones the desktop "floating card" side gutters are
   removed so the app is genuinely edge-to-edge.
   ------------------------------------------------------------ */
#app {
  min-height: 100vh;
  min-height: 100dvh;          /* correct height with mobile browser chrome */
}
.main-content { flex: 1 1 auto; min-width: 0; }
.app-footer   { margin-top: auto; }
.view         { min-width: 0; }

@media (max-width: 1024px) {
  #app {
    max-width: 100%;
    box-shadow: none;
    border-left: 0;
    border-right: 0;
  }
}

@media (max-width: 860px) {
  /* background-attachment:fixed is janky on iOS — pin it to scroll */
  body { background-attachment: scroll; }
}

/* ------------------------------------------------------------
   64.3  COMMUNITY SECTION — complete styling.
   The .community-* block had NO rules at all, so uploaded
   photos rendered at their natural size and dominated the
   screen (especially on mobile). Images are now locked into a
   square, cover-cropped avatar box.
   ------------------------------------------------------------ */
.community-group-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 22px 0 12px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .4px;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.community-group-head::before {
  content: '';
  flex: 0 0 auto;
  width: 4px;
  height: 18px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--brand-500), var(--accent-500));
}
.community-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 22px;
  padding: 0 8px;
  border-radius: var(--radius-pill);
  background: var(--bg-surface-3);
  color: var(--text-secondary);
  font-size: 11.5px;
  font-weight: 800;
}
.community-empty {
  padding: 14px 16px;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--text-tertiary);
  background: var(--bg-surface-2);
  border: 1px dashed var(--border-default);
  border-radius: var(--radius-md);
}
.community-list {
  display: grid;
  /* min() keeps the track from ever exceeding the viewport */
  grid-template-columns: repeat(auto-fill, minmax(min(420px, 100%), 1fr));
  gap: 12px;
  margin-bottom: 8px;
}
.community-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  min-width: 0;
  padding: 14px 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.community-item:hover {
  border-color: var(--brand-300);
  box-shadow: var(--shadow-sm);
}
[data-theme="dark"] .community-item:hover,
[data-theme="dim"]  .community-item:hover { border-color: var(--brand-500); }

/* ⭐ Community image constraint — square box + cover crop */
.community-avatar {
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
  max-width: 52px;
  max-height: 52px;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 50%;
  background: var(--bg-surface-3);
  border: 2px solid var(--brand-500);
  display: flex;
  align-items: center;
  justify-content: center;
}
.community-avatar-img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: cover;
  object-position: center 25%;
  border-radius: 50%;
}
.community-avatar-fallback {
  font-size: 18px;
  font-weight: 900;
  color: var(--brand-500);
  letter-spacing: -.5px;
}

.community-info { flex: 1 1 auto; min-width: 0; }
.community-info h4 {
  margin: 0 0 2px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  overflow-wrap: anywhere;
}
.community-meta {
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--text-tertiary);
  overflow-wrap: anywhere;
}
.community-bio {
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text-secondary);
  white-space: normal;
  overflow-wrap: anywhere;
}
.community-contact {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-tertiary);
  overflow-wrap: anywhere;
}
.community-contact i { margin-right: 4px; color: var(--brand-500); }
.community-actions {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
}
.community-actions .btn { white-space: nowrap; }

@media (max-width: 640px) {
  .community-list { grid-template-columns: 1fr; }
  .community-item { flex-wrap: wrap; gap: 12px; padding: 13px 14px; }
  .community-avatar { width: 46px; height: 46px; max-width: 46px; max-height: 46px; }
  .community-info { flex: 1 1 calc(100% - 60px); }
  .community-actions {
    flex: 1 1 100%;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  .community-actions .btn { flex: 1 1 auto; min-width: 92px; }
}

/* ------------------------------------------------------------
   64.4  TEAM / ALUMNI BIOS — Read More / Show Less
   The 4-line clamp stays as the COLLAPSED state (clean UI);
   `.is-expanded` lifts it so the full text is readable.
   Long unbroken words can never overflow (white-space: normal
   + overflow-wrap: anywhere).
   ------------------------------------------------------------ */
.professor-card p.bio-text,
.alumni-card  .alumni-bio.bio-text,
.friend-card  p.bio-text {
  display: -webkit-box !important;
  -webkit-box-orient: vertical !important;
  -webkit-line-clamp: 4 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: normal !important;
  overflow-wrap: anywhere !important;
  word-break: break-word !important;
  line-height: 1.55 !important;
  flex: 1 1 auto !important;
}
.professor-card p.bio-text.is-expanded,
.alumni-card  .alumni-bio.bio-text.is-expanded,
.friend-card  p.bio-text.is-expanded {
  display: block !important;
  -webkit-line-clamp: unset !important;
  overflow: visible !important;
  text-overflow: clip !important;
}

.bio-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 44px;          /* ⭐ 44px touch target */
  min-width: 44px;
  margin: 2px auto 10px;
  padding: 8px 14px;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .2px;
  color: var(--brand-600);
  background: transparent;
  border: 1px dashed var(--border-default);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease);
}
.bio-toggle:hover { background: rgba(99,102,241,.10); border-color: var(--brand-400); }
.bio-toggle i { transition: transform .3s var(--ease); }
.bio-toggle.is-open i { transform: rotate(180deg); }
[data-theme="dark"] .bio-toggle,
[data-theme="dim"]  .bio-toggle { color: var(--brand-300); }
.bio-toggle[hidden] { display: none !important; }

/* ------------------------------------------------------------
   64.5  TOUCH TARGETS — 44x44 minimum
   Dense media-player internals (zoom/scrub/crayon controls) are
   deliberately excluded: inflating them breaks the player.
   ------------------------------------------------------------ */
.icon-btn,
.nav-toggle {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
}

/* The header theme button is the primary Night Mode switch —
   it must never disappear on small phones. */
@media (max-width: 380px) {
  .theme-toggle { display: inline-flex !important; }
}

@media (pointer: coarse), (max-width: 640px) {
  .btn,
  .contact-chip,
  .admin-tab,
  .main-nav a,
  .user-dropdown-item,
  .user-profile-btn,
  .link-inline,
  .notif-mark-all,
  .selection-master-checkbox,
  .bio-toggle,
  .theme-choice,
  .settings-row,
  .section-card a.link-inline,
  .app-footer a {
    min-height: 44px;
  }
  .btn-sm { padding: 10px 14px; }
  .admin-tab { display: inline-flex; align-items: center; }
  .user-dropdown-item { display: flex; align-items: center; }
  .main-nav a { display: flex; align-items: center; }
}

/* ------------------------------------------------------------
   64.6  FLUID RESPONSIVE SPACING & TYPE
   Margins/padding scale with the viewport BEFORE the layout
   has to stack, so nothing feels cramped or oversized.
   ------------------------------------------------------------ */
.main-content {
  padding:
    clamp(14px, 2.2vw, 28px)
    clamp(12px, 2.4vw, 32px)
    clamp(28px, 4vw, 56px);
}
.section-card {
  padding:
    clamp(16px, 2vw, 26px)
    clamp(14px, 2vw, 24px);
}
.section-card h2 { font-size: clamp(16px, 2.2vw, 20px); }
.dash-header h2 { font-size: clamp(16px, 2.2vw, 19px); }
.admin-tab { font-size: clamp(11.5px, 1.4vw, 12.5px); }

/* Nothing may create a horizontal scrollbar */
img, video, svg, canvas, iframe, table, pre { max-width: 100%; }
.section-card, .modal-box, .admin-tab-content { min-width: 0; }

/* Long words / URLs wrap instead of overflowing their card */
.community-bio, .community-meta, .community-contact,
.alumni-bio, .alumni-work, .alumni-meta,
.professor-card p, .friend-card p,
.settings-row-text span { overflow-wrap: anywhere; }

@media (max-width: 480px) {
  .community-group-head { font-size: 12px; }
  .section-card h2 { font-size: 16px; }
}

/* ------------------------------------------------------------
   64.7  SETTINGS PANEL (Night Mode control)
   ------------------------------------------------------------ */
.settings-section { margin-bottom: 22px; }
.settings-section:last-of-type { margin-bottom: 6px; }
.settings-section > h4 {
  margin-bottom: 10px;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: .7px;
  text-transform: uppercase;
  color: var(--text-tertiary);
}
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 44px;
  padding: 12px 14px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}
.settings-row + .settings-row,
.settings-row + .theme-choices { margin-top: 8px; }
.settings-row-text { flex: 1 1 auto; min-width: 0; }
.settings-row-text strong {
  display: block;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary);
}
.settings-row-text span {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-tertiary);
}
.settings-row[hidden] { display: none !important; }

/* On/off switch — 60x44 hit area, 30px visual track */
.switch {
  position: relative;
  flex: 0 0 auto;
  width: 60px;
  height: 44px;
  min-width: 60px;
  min-height: 44px;
  padding: 0;
  background: transparent;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.switch-track {
  position: relative;
  width: 54px;
  height: 30px;
  border-radius: 999px;
  background: var(--border-strong);
  transition: background var(--theme-dur) var(--theme-ease);
}
.switch-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.35);
  transition: transform var(--theme-dur) var(--theme-ease);
}
.switch[aria-checked="true"] .switch-track {
  background: linear-gradient(135deg, var(--brand-600), var(--brand-500));
}
.switch[aria-checked="true"] .switch-thumb { transform: translateX(24px); }
.switch:focus-visible .switch-track { outline: 2px solid var(--brand-500); outline-offset: 3px; }

/* 3-way theme picker (Light / Dim / Night) */
.theme-choices { display: flex; gap: 8px; flex-wrap: wrap; }
.theme-choice {
  flex: 1 1 84px;
  min-width: 84px;
  min-height: 44px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 8px 10px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  background: var(--bg-surface);
  border: 2px solid var(--border-default);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color .2s var(--ease), background .2s var(--ease),
              color .2s var(--ease), box-shadow .2s var(--ease);
}
.theme-choice i { font-size: 14px; }
.theme-choice:hover { border-color: var(--brand-400); color: var(--text-primary); }
.theme-choice[aria-checked="true"] {
  border-color: var(--brand-500);
  background: rgba(99,102,241,.12);
  color: var(--brand-600);
  box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}
[data-theme="dark"] .theme-choice[aria-checked="true"],
[data-theme="dim"]  .theme-choice[aria-checked="true"] { color: var(--brand-200); }
.theme-choice[hidden] { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  html.aero-theme-anim,
  html.aero-theme-anim *,
  html.aero-theme-anim *::before,
  html.aero-theme-anim *::after { transition: none !important; }
  .switch-track, .switch-thumb { transition: none !important; }
}

/* ------------------------------------------------------------
   64.8  BIO / ALUMNI BODY LAYOUT DETERMINISM
   .alumni-body had no rules, so it shrink-wrapped its content
   instead of filling the card. Making it an explicit flex
   column keeps the bio + toggle full width and lets the
   existing `margin-top:auto` on .alumni-contact actually pin
   the contact row to the bottom of the card.
   ------------------------------------------------------------ */
.alumni-body {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

/* Bios always fill their card so line-clamp wrapping is predictable */
.professor-card .bio-text,
.friend-card    .bio-text,
.alumni-card    .bio-text { width: 100%; }

/* The toggle sits centred under the bio */
.professor-card .bio-toggle,
.friend-card    .bio-toggle,
.alumni-card    .bio-toggle { align-self: center; }

/* Community cards must never be squashed by a wide neighbour */
.community-info, .community-bio { min-width: 0; }

/* ------------------------------------------------------------
   64.9  COMMUNITY ROW BIOS — clamp + Read More
   The admin community list used to hard-slice bios at 200
   characters. It now renders the full text, clamped to 3 lines,
   with the same Read More / Show Less control as team cards.
   ------------------------------------------------------------ */
.community-bio.bio-text {
  display: -webkit-box !important;
  -webkit-box-orient: vertical !important;
  -webkit-line-clamp: 3 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: normal !important;
  overflow-wrap: anywhere !important;
  word-break: break-word !important;
}
.community-bio.bio-text.is-expanded {
  display: block !important;
  -webkit-line-clamp: unset !important;
  overflow: visible !important;
  text-overflow: clip !important;
}
.community-info .bio-toggle {
  align-self: flex-start;
  margin: 6px 0 0;
}

/* ------------------------------------------------------------
   64.10  MOBILE HORIZONTAL-OVERFLOW FIX (notifications dropdown)
   ------------------------------------------------------------
   Pre-existing bug: `.notif-wrap` is `position: relative`, so the
   dropdown's containing block was that 44px-wide wrapper. The
   ≤640px rule `left: 8px; right: 8px` then produced a 360px-wide
   box starting at the button (right edge ~463px on a 390px
   screen) — a horizontal overflow of ~73px.
   Dropping the wrapper's positioning context lets the dropdown
   anchor to #appHeader (position: sticky) and span the viewport.
   Safe because the unread badge is positioned by `.notif-btn`
   (`position: relative`), not by `.notif-wrap`.
   ------------------------------------------------------------ */
@media (max-width: 640px) {
  .notif-wrap { position: static; }
  .user-info  { position: static; }
  .notif-dropdown {
    top: calc(100% + 6px);
    left: 8px;
    right: 8px;
    width: auto;
    max-width: none;
  }
}

/* ============================================================
   70. FULL-WIDTH LAYOUT SYSTEM  (v2)
   ------------------------------------------------------------
   WHY THIS EXISTS
   ---------------
   The shell used to be `#app { max-width: 1280px; margin: 0 auto }`,
   so on a 1440 / 1920 / 2560 monitor the app showed 80 / 320 / 640
   pixels of dead gutter on each side. A naive "just make everything
   100% wide" pass fixes the gutters but destroys readability: a lone
   card, a form, or the AI chat panel becomes an unreadable slab.

   So this pass separates three ideas that were previously conflated:

     * THE SHELL is genuinely edge-to-edge. The header, the page
       canvas and the footer always cover the full window, with one
       shared fluid inset so they stay perfectly aligned.

     * STRUCTURE (card grids, tables, dashboards) is fluid and grows
       with the window. Grids add COLUMNS instead of stretching
       individual cards, so a wide screen shows more content rather
       than emptier content.

     * PROSE AND TOOLS (running text, a single panel, the chat
       column) keep a readable cap and are centred on the canvas.

   Every rule below is ADDITIVE. Nothing above line 11204 is deleted,
   no markup contract is changed, and no JavaScript is required for
   any of it. The two optional JS helpers (scroll chrome) are guarded
   and degrade to nothing if they never run.
   ============================================================ */

/* ------------------------------------------------------------
   70.1  ONE PLACE FOR THE WHOLE WIDTH SYSTEM
   ------------------------------------------------------------ */
:root {
  /* Page gutter — grows with the viewport, never smaller than 16px */
  --shell-pad:   clamp(16px, 2.1vw, 64px);

  /* The content column. This is the single number that decides how
     much of the window the app actually uses. 2048px means every
     screen up to ~2170px wide is used edge-to-edge with nothing but
     the gutter, and only a true ultrawide sees margins. The previous
     value was 1280px, which is where the dead side bands came from. */
  --content-max: min(2048px, 100%);

  /* Percentage padding resolves against the PARENT inline size, so
     every direct child of #app computes an IDENTICAL inset and the
     header, the content column and the footer line up pixel-perfect
     at every width. */
  --shell-inset: max(var(--shell-pad), calc((100% - var(--content-max)) / 2));

  /* Running prose measure. */
  --read-max:    82ch;

  /* Systematic vertical rhythm + one separator colour. */
  --section-y:   clamp(22px, 2.4vw, 38px);
  --rule:        1px solid var(--border-subtle);

  /* Systematic elevation scale (cards already use the shadows). */
  --elev-1: var(--shadow-xs);
  --elev-2: var(--shadow-sm);
  --elev-3: var(--shadow-md);
}

/* Anchor jumps must not land under the sticky header. */
html { scroll-padding-top: 88px; }

/* ------------------------------------------------------------
   70.2  EDGE-TO-EDGE SHELL + LAYERED SURFACES
   The shell keeps `--bg-surface` as its base colour (so nothing
   that sits on it loses contrast) and gains the same soft brand
   wash the page already uses, which turns the former dead side
   band into a designed canvas.
   ------------------------------------------------------------ */
#app {
  max-width: 100%;
  margin: 0;
  border-left: 0;
  border-right: 0;
  box-shadow: none;
  background:
    radial-gradient(1400px 620px at 8% -12%, var(--bg-page-accent-1), transparent 62%),
    radial-gradient(1150px 520px at 100% 0%,  var(--bg-page-accent-2), transparent 62%),
    var(--bg-surface);
  background-repeat: no-repeat;
}

/* ------------------------------------------------------------
   70.3  ONE FLUID INSET FOR HEADER / CONTENT / FOOTER

   Below 1025px the app was ALREADY edge-to-edge (see §64.2) and
   its phone/tablet paddings are hand-tuned, so this block is
   scoped to desktop and up: on a phone or a tablet nothing here
   changes a single pixel.

   Above 1024px the header, the content column and the footer are
   given the SAME inset, which is what makes the brand line up
   exactly with the cards instead of drifting 20px to its left.

   Note: the header's own rule is declared `!important` at two
   places further up the file (a previous fix that must keep
   working), so the inline inset has to match that weight to be
   able to align it.
   ------------------------------------------------------------ */
@media (min-width: 1025px) {
  #appHeader,
  .main-content,
  .app-footer {
    padding-inline: var(--shell-inset);
  }
  #appHeader { padding-inline: var(--shell-inset) !important; }

  /* The content column only needs its vertical rhythm now. */
  .main-content {
    padding-block:
      clamp(20px, 2.2vw, 34px)
      clamp(36px, 3.6vw, 66px);
  }
}

/* The footer keeps its own colours and vertical padding. */
.app-footer { width: 100%; }

/* The old "floating card" look is gone at every width. */
@media (max-width: 1024px) {
  #app { max-width: 100%; }
}

/* ------------------------------------------------------------
   70.4  STRUCTURE FILLS THE WINDOW
   The grids all use `auto-fill` with a sensible track minimum, so
   they add COLUMNS as the window grows instead of stretching the
   cards. They need no cap of their own any more: the shared
   `--shell-inset` above already bounds them, and the 1680px
   tuning in §70.11 keeps the column count sane on an ultrawide.
   ------------------------------------------------------------ */
.stats-grid,
.quick-actions-grid,
.live-stats-row { width: 100%; }

/* ------------------------------------------------------------
   70.5  PROSE STAYS READABLE
   Body copy keeps a measure so a wide card does not go left-heavy.
   ------------------------------------------------------------ */
.section-card > p,
.editor-section > p,
.empty-state > p,
.ai-home-title-block > p,
.checkout-note {
  max-width: var(--read-max);
}

/* ------------------------------------------------------------
   70.6  THE AI CONSOLE
   The hero and the chat panel span the whole content column (so on
   a laptop the console uses the entire window). Past 1400px only
   the CONVERSATION is given a measure — the panel stays wide, the
   answer text stays readable. This is the same pattern every chat
   product uses, and it keeps `auto-fill` suggestion chips from
   turning into a comb.
   ------------------------------------------------------------ */
@media (min-width: 1400px) {
  .ai-chat-messages { padding-inline: clamp(26px, 4vw, 64px); }
  .ai-msg,
  .ai-welcome { max-width: 1120px; margin-inline: auto; }
  .ai-welcome { max-width: 1120px; }
}

/* ------------------------------------------------------------
   70.7  SYSTEMATIC SECTION HEADERS
   Every "section title" pattern in the app now shares one hairline
   separator, so long pages scan as a clear outline.
   ------------------------------------------------------------ */
.section-card > h2,
.section-card > .section-header-row,
.tab-toolbar,
.dash-header {
  padding-bottom: 14px;
  border-bottom: var(--rule);
}
.section-card > .section-header-row > h2 {
  padding-bottom: 0;
  border-bottom: 0;
}
.section-card > h2 { margin-bottom: 20px; }
.tab-toolbar,
.dash-header     { margin-bottom: 20px; }

/* ------------------------------------------------------------
   70.8  WIDE-SCREEN HERO LAYOUTS
   The student hero and the AI hero are full-width banners. Below
   1200px they are exactly what they were; from 1200px up they
   become a balanced multi-column banner so the banner fills its
   own width instead of leaving a hole in the middle.
   ------------------------------------------------------------ */

/* The extra column only exists on wide screens. */
.hero-side,
.ai-home-side { display: none; }

@media (min-width: 1200px) {
  /* --- Student home hero: copy | chips | rocket ---
     Explicit placement because the markup order is
     content, image, side (the side block is appended last so
     that below 1200px it is simply `display:none`). */
  .hero-section {
    display: grid;
    grid-template-columns: minmax(320px, 620px) minmax(0, max-content) auto;
    align-items: center;
    justify-content: space-between;
    column-gap: clamp(24px, 3vw, 72px);
  }
  .hero-content { grid-column: 1; grid-row: 1; max-width: 620px; }
  .hero-side    { grid-column: 2; grid-row: 1; display: block; }
  .hero-image   { grid-column: 3; grid-row: 1; width: 180px; height: 180px; font-size: 80px; }

  /* --- AI home hero: brand | example prompts --- */
  .ai-home-hero {
    display: grid;
    grid-template-columns: minmax(320px, 1fr) minmax(320px, 0.9fr);
    align-items: center;
    column-gap: clamp(24px, 3.2vw, 80px);
  }
  .ai-home-side { display: block; }
}

.hero-side-title,
.ai-home-side-title {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 11px; font-weight: 800;
  letter-spacing: 1.1px; text-transform: uppercase;
  color: rgba(255,255,255,.62);
  margin-bottom: 14px;
}

.hero-chips {
  display: flex; flex-wrap: wrap; gap: 10px;
  max-width: 520px;
}
.hero-chip {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12.5px; font-weight: 600;
  padding: 9px 15px; border-radius: 999px;
  color: rgba(255,255,255,.92);
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.16);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  white-space: nowrap;
  transition: background .2s var(--ease), border-color .2s var(--ease), transform .2s var(--ease);
}
.hero-chip i { font-size: 12px; color: var(--gold-300); }
.hero-chip:hover {
  background: rgba(255,255,255,.15);
  border-color: rgba(255,255,255,.3);
  transform: translateY(-2px);
}

/* Example prompts: real buttons that pre-fill the composer. */
.ai-prompt-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
}
.ai-prompt-chip {
  display: flex; align-items: flex-start; gap: 10px;
  text-align: left;
  font: inherit; font-size: 12.75px; font-weight: 500;
  line-height: 1.45;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  color: rgba(255,255,255,.9);
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.14);
  cursor: pointer;
  transition: background .2s var(--ease), border-color .2s var(--ease), transform .2s var(--ease);
}
.ai-prompt-chip i { color: var(--accent-300); margin-top: 2px; flex-shrink: 0; }
.ai-prompt-chip:hover {
  background: rgba(255,255,255,.14);
  border-color: rgba(99,102,241,.55);
  transform: translateY(-2px);
}
.ai-prompt-chip:focus-visible { outline: 2px solid var(--brand-300); outline-offset: 2px; }

/* ------------------------------------------------------------
   70.9  SCROLL CHROME — reading progress + back-to-top
   Both nodes are created by JS and are purely additive.
   ------------------------------------------------------------ */
.aero-scroll-progress {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 3px;
  z-index: 3000;
  pointer-events: none;
  border-radius: 0 999px 999px 0;
  background: linear-gradient(90deg, var(--brand-500), var(--accent-500), var(--emerald-500));
  box-shadow: 0 0 12px rgba(99,102,241,.5);
  /* ⭐ scaled, not resized: moving it costs no layout while you scroll */
  transform: scaleX(0); transform-origin: 0 50%;
  will-change: transform;
  transition: transform .08s linear, opacity .2s;
}

.aero-to-top {
  position: fixed;
  right: clamp(14px, 2vw, 30px);
  bottom: clamp(14px, 2vw, 30px);
  width: 46px;                    /* 44px+ touch target */
  height: 46px;
  min-width: 46px;
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 15px;
  color: var(--text-primary);
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: 50%;
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  z-index: 1400;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px) scale(.92);
  transition: opacity .25s var(--ease),
              transform .3s var(--ease-spring),
              visibility .25s,
              background .2s var(--ease),
              border-color .2s var(--ease),
              color .2s var(--ease);
}
.aero-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}
.aero-to-top:hover {
  color: #fff;
  background: linear-gradient(135deg, var(--brand-600), var(--brand-500));
  border-color: var(--brand-500);
  transform: translateY(-3px) scale(1);
}
.aero-to-top:focus-visible { outline: 2px solid var(--brand-500); outline-offset: 3px; }

/* Keep the button clear of the mobile bottom navigation bar. */
@media (max-width: 640px) {
  .aero-to-top {
    bottom: calc(84px + env(safe-area-inset-bottom, 0px));
  }
}

/* Stand down while a full-screen experience owns the viewport —
   the exact guard the mobile bottom nav already uses. */
body:has(.quiz-exam-shell[aria-hidden="false"]) .aero-to-top,
body:has(.video-player-modal.active) .aero-to-top,
body:has(.pdf-viewer-modal.active) .aero-to-top,
body:has(.modal-overlay.active) .aero-to-top {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
body:has(.quiz-exam-shell[aria-hidden="false"]) .aero-scroll-progress,
body:has(.video-player-modal.active) .aero-scroll-progress,
body:has(.pdf-viewer-modal.active) .aero-scroll-progress {
  opacity: 0;
}

/* ------------------------------------------------------------
   70.10  SURFACE POLISH — selection + scrollbars
   ------------------------------------------------------------ */
::selection {
  background: rgba(99,102,241,.26);
  color: var(--text-primary);
}
[data-theme="dark"] ::selection,
[data-theme="dim"]  ::selection {
  background: rgba(129,140,248,.34);
  color: #fff;
}

html {
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border: 3px solid transparent;
  border-radius: 999px;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--brand-500);
  border: 3px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-corner { background: transparent; }

/* ------------------------------------------------------------
   70.11  ULTRAWIDE TUNING
   Past ~1680px the browser would otherwise keep adding skinny
   columns. Bumping the track minimums produces fewer, better
   proportioned cards that still fill the window.
   ------------------------------------------------------------ */
@media (min-width: 1680px) {
  :root {
    --card-min-course: 340px;
    --card-min-professor: 290px;
    --card-min-testimonial: 300px;
    --card-min-student: 320px;
    --gap-grid: 24px;
  }
  .ai-home-hero { padding: 52px 52px; }
  .hero-section { padding: 56px 60px; }
  .section-card { padding: 34px 40px; }
}

/* ------------------------------------------------------------
   70.12  SAFETY
   ------------------------------------------------------------ */
@media print {
  .aero-scroll-progress,
  .aero-to-top { display: none !important; }
}
@media (prefers-reduced-motion: reduce) {
  .aero-scroll-progress { transition: none; }
  .aero-to-top { transition: opacity .01ms linear, visibility .01ms linear; }
  .aero-to-top:hover { transform: none; }
  .hero-chip:hover,
  .ai-prompt-chip:hover { transform: none; }
}
/* ============================================================
   71. VIDEO PLAYER v6 — Advanced Controls
   ------------------------------------------------------------
   Adds: click-capture overlay, custom control bar, menus,
   bookmark panel, keyboard shortcut help, theater mode.
   Additive only — existing .vp-* rules still apply.
   ============================================================ */

/* ---- Click-capture overlay: kills every YouTube redirect ---- */
.vp-click-capture {
  position: absolute;
  inset: 0;
  z-index: 5;
  background: transparent;
  cursor: pointer;
  outline: none;
}
.vp-click-capture:focus-visible { box-shadow: inset 0 0 0 2px var(--brand-500); }

/* ---- Big play button (visual cue when paused) ---- */
.vp-big-play {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(.8);
  width: 84px; height: 84px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.45);
  background: rgba(0,0,0,.55);
  color: #fff;
  font-size: 30px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  z-index: 6;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .25s ease, visibility .25s, transform .3s cubic-bezier(.34,1.56,.64,1), background .2s;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.vp-big-play.visible {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}

/* ---- Controls bar smooth transitions ---- */
.vp-controls { transition: opacity .25s ease; }
.vp-controls.hidden { opacity: 0; pointer-events: none; }
.vp-title.hidden { opacity: 0; }

/* ---- Progress bar: scubbing state ---- */
.vp-progress-row { user-select: none; }
.vp-progress-row.scrubbing .vp-progress-filled { height: 8px; }
.vp-progress-row.scrubbing .vp-thumb { opacity: 1; transform: translate(-50%, -50%) scale(1.15); }

/* ---- Toolbar button active state ---- */
.vp-btn.active {
  background: rgba(99,102,241,.55) !important;
  color: #fff !important;
  box-shadow: 0 0 0 1px rgba(99,102,241,.7);
}

/* ---- Menu wrapper + dropdown ---- */
.vp-menu-wrap { position: relative; display: inline-flex; }
.vp-menu {
  position: absolute;
  bottom: calc(100% + 10px);
  right: 0;
  min-width: 240px;
  max-width: 320px;
  background: rgba(10,14,31,.97);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0,0,0,.55);
  padding: 10px;
  display: none;
  flex-direction: column;
  gap: 4px;
  z-index: 30;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #fff;
}
.vp-menu.open { display: flex; }
.vp-menu-head {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .8px;
  text-transform: uppercase;
  color: rgba(255,255,255,.55);
  padding: 4px 8px 8px;
  border-bottom: 1px solid rgba(255,255,255,.1);
  display: flex; align-items: center; gap: 6px;
}
.vp-menu-list {
  max-height: 280px;
  overflow-y: auto;
  padding: 4px 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.vp-menu-list::-webkit-scrollbar { width: 6px; }
.vp-menu-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 3px; }
.vp-menu-list button {
  background: transparent;
  border: none;
  color: #fff;
  text-align: left;
  padding: 8px 10px;
  border-radius: 6px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s;
}
.vp-menu-list button:hover { background: rgba(255,255,255,.1); }
.vp-menu-list button.active { background: rgba(99,102,241,.35); color: #c7d2fe; font-weight: 700; }
.vp-menu-empty {
  padding: 14px 10px;
  font-size: 12.5px;
  color: rgba(255,255,255,.45);
  text-align: center;
}
.vp-menu-add {
  margin-top: 6px;
  padding: 9px 12px;
  border-radius: 8px;
  border: 1px dashed rgba(255,255,255,.25);
  background: transparent;
  color: #fff;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
  transition: background .2s;
}
.vp-menu-add:hover { background: rgba(99,102,241,.25); border-color: rgba(129,140,248,.6); }

/* ---- Bookmark items ---- */
.vp-bookmark-item {
  display: flex;
  align-items: stretch;
  gap: 4px;
  border-radius: 6px;
  overflow: hidden;
}
.vp-bookmark-item:hover { background: rgba(255,255,255,.06); }
.vp-bookmark-jump {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  color: #fff;
  padding: 8px 10px;
  font-family: inherit;
  font-size: 12.5px;
  cursor: pointer;
  text-align: left;
  min-width: 0;
}
.vp-bookmark-jump i { color: #a5b4fc; font-size: 10px; }
.vp-bookmark-time {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: #c7d2fe;
  font-size: 12px;
}
.vp-bookmark-label {
  color: rgba(255,255,255,.85);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}
.vp-bookmark-del {
  background: transparent;
  border: none;
  color: rgba(255,255,255,.35);
  padding: 0 10px;
  cursor: pointer;
  transition: color .15s;
}
.vp-bookmark-del:hover { color: #ef4444; }

/* ---- Keyboard shortcuts overlay ---- */
.vp-shortcuts {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 20px;
}
.vp-shortcuts.open { display: flex; animation: vpFadeIn .2s ease-out; }
@keyframes vpFadeIn { from { opacity: 0 } to { opacity: 1 } }

.vp-shortcuts-card {
  background: rgba(10,14,31,.98);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 16px;
  padding: 26px 28px 22px;
  max-width: 520px;
  width: 100%;
  color: #fff;
  box-shadow: 0 26px 60px rgba(0,0,0,.7);
  animation: vpSlideUp .3s cubic-bezier(.22,1,.36,1);
}
@keyframes vpSlideUp {
  from { opacity: 0; transform: translateY(18px) scale(.97) }
  to   { opacity: 1; transform: translateY(0)   scale(1)   }
}
.vp-shortcuts-card h5 {
  margin: 0 0 18px;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -.2px;
  display: flex; align-items: center; gap: 8px;
  color: #fff;
}
.vp-shortcuts-card h5 i { color: #a5b4fc; }
.vp-shortcuts-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 20px;
  font-size: 13px;
  color: rgba(255,255,255,.8);
}
.vp-shortcuts-grid span:nth-child(odd) {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  color: #c7d2fe;
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 12px;
}
.vp-shortcuts-grid kbd {
  display: inline-block;
  padding: 2px 7px;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 5px;
  font-family: inherit;
  font-weight: 700;
  font-size: 11px;
  color: #fff;
  min-width: 22px;
  text-align: center;
}
.vp-shortcuts-hint {
  margin: 20px 0 0;
  padding-top: 14px;
  border-top: 1px solid rgba(255,255,255,.1);
  text-align: center;
  font-size: 11.5px;
  color: rgba(255,255,255,.45);
  font-style: italic;
}

/* ---- Theater mode ---- */
.vp-shell.vp-theater .vp-video-area {
  /* expand video into more of the shell */
  top: -12px; bottom: -12px;
}

/* ---- Quality menu width ---- */
#vpQualityMenu { min-width: 180px; }

/* ---- Mobile tuning ---- */
@media (max-width: 720px) {
  .vp-buttons { gap: 2px; }
  .vp-btn { width: 34px; height: 34px; font-size: 13px; }
  #vpPrevBtn, #vpNextBtn, #vpBack10Btn, #vpFwd10Btn { display: none; }
  #vpTheaterBtn, #vpPipBtn { display: none; }
  #vpQualityBtn { display: none !important; }
  .vp-menu { min-width: 200px; }
  .vp-shortcuts-grid { grid-template-columns: 1fr 1fr; gap: 6px 12px; font-size: 12px; }
  .vp-shortcuts-card { padding: 20px 18px 16px; }
  .vp-big-play { width: 68px; height: 68px; font-size: 24px; }
}
/* ============================================================
   72. CORE EXAMINATION CONTROLS — forward-only, lock, pending
   ============================================================ */

/* ---- Locked question: visually retired ---- */
.quiz-play-card.locked {
  border-left-color: var(--rose-500) !important;
  background: linear-gradient(135deg, rgba(239,68,68,.04), transparent 40%);
  opacity: .92;
}
.quiz-play-option.locked {
  opacity: .62;
  cursor: not-allowed;
}
.quiz-play-option.locked * { pointer-events: none; }

.quiz-locked-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0 0;
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  background: rgba(239,68,68,.08);
  border: 1px solid rgba(239,68,68,.28);
  border-left: 3px solid var(--rose-500);
  color: var(--rose-600);
  font-size: 12.5px;
  font-weight: 600;
}
[data-theme="dark"] .quiz-locked-note,
[data-theme="dim"]   .quiz-locked-note { color: var(--rose-400); }
.quiz-locked-note i { flex-shrink: 0; }

/* ---- Pending review badge on result items ---- */
.quiz-result-item.pending { border-left: 4px solid var(--gold-500); }
.quiz-result-badge.pending {
  background: var(--gold-500);
  color: #422006;
}

/* ---- Forward-only info banner in the pre-exam consent modal ---- */
.pre-exam-rule.danger-forward {
  background: linear-gradient(135deg, rgba(239,68,68,.10), rgba(239,68,68,.03));
  border-color: rgba(239,68,68,.4);
}
.pre-exam-rule.danger-forward > i {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
}
.pre-exam-rule.danger-forward strong { color: var(--rose-600); }
[data-theme="dark"] .pre-exam-rule.danger-forward strong,
[data-theme="dim"]   .pre-exam-rule.danger-forward strong { color: var(--rose-400); }

/* ---- Server-timer "syncing" pulse while heartbeat is in flight ---- */
.quiz-exam-timer.syncing {
  animation: quizTimerSync 1s ease-in-out infinite alternate;
}
@keyframes quizTimerSync {
  from { opacity: .82; }
  to   { opacity: 1; }
}

/* ---- Time-spent table in the result summary (student view) ---- */
.quiz-time-breakdown {
  margin-top: 20px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
}
.quiz-time-breakdown h4 {
  font-size: 13.5px;
  font-weight: 800;
  letter-spacing: .4px;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: 14px;
  display: flex; align-items: center; gap: 8px;
}
.quiz-time-breakdown h4 i { color: var(--brand-500); }
.quiz-time-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
}
.quiz-time-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--bg-surface);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  border: 1px solid var(--border-subtle);
}
.quiz-time-item .label { color: var(--text-secondary); }
.quiz-time-item .value {
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  color: var(--brand-600);
}
[data-theme="dark"] .quiz-time-item .value,
[data-theme="dim"]   .quiz-time-item .value { color: var(--brand-300); }
.quiz-time-item.slow   .value { color: var(--gold-600); }
.quiz-time-item.slowest .value { color: var(--rose-600); }
[data-theme="dark"] .quiz-time-item.slow .value,
[data-theme="dim"]   .quiz-time-item.slow .value { color: var(--gold-400); }
[data-theme="dark"] .quiz-time-item.slowest .value,
[data-theme="dim"]   .quiz-time-item.slowest .value { color: var(--rose-400); }
/* ============================================================
   73. PRE-EXAM MODAL — compact single-column layout
   ------------------------------------------------------------
   Fixes: duplicate rules, checkbox leaking outside the card,
   excessive vertical padding pushing the buttons off-screen.
   ============================================================ */

.pre-exam-modal {
  max-width: 520px !important;
  padding: 26px 26px 22px !important;
  max-height: 92vh;
  overflow-y: auto;
  scrollbar-width: thin;
}

/* ---- Header ---- */
.pre-exam-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding-bottom: 16px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--border-subtle);
}
.pre-exam-head-icon {
  width: 46px; height: 46px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: #fff; font-size: 20px;
  box-shadow: 0 8px 20px rgba(239,68,68,.32);
}
.pre-exam-head-text { flex: 1; min-width: 0; }
.pre-exam-head-text h3 {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -.2px;
  color: var(--text-primary);
  margin: 0 0 3px;
  display: flex; align-items: center; gap: 7px;
}
.pre-exam-head-text h3 i { color: var(--gold-500); font-size: 14px; }
.pre-exam-head-text p {
  font-size: 12.5px;
  color: var(--text-tertiary);
  margin: 0;
  line-height: 1.45;
}

/* ---- Rules — tight two-line rows ---- */
.pre-exam-rules {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 18px;
}
.pre-exam-rule {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  line-height: 1.4;
}
.pre-exam-rule > i {
  flex-shrink: 0;
  width: 26px; height: 26px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 7px;
  background: rgba(99,102,241,.12);
  color: var(--brand-600);
  font-size: 11.5px;
  margin-top: 1px;
}
[data-theme="dark"] .pre-exam-rule > i,
[data-theme="dim"]   .pre-exam-rule > i {
  background: rgba(99,102,241,.22);
  color: var(--brand-300);
}
.pre-exam-rule > div { flex: 1; min-width: 0; }
.pre-exam-rule strong {
  display: block;
  font-size: 12.75px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -.1px;
  margin-bottom: 1px;
}
.pre-exam-rule span {
  display: block;
  font-size: 11.75px;
  color: var(--text-secondary);
  line-height: 1.45;
}
.pre-exam-rule span em { font-style: normal; font-weight: 700; color: var(--text-primary); }

/* Danger variant — red accent + red icon */
.pre-exam-rule.danger {
  background: linear-gradient(135deg, rgba(239,68,68,.06), rgba(239,68,68,.02));
  border-color: rgba(239,68,68,.28);
}
.pre-exam-rule.danger > i {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  box-shadow: 0 3px 8px rgba(239,68,68,.3);
}
.pre-exam-rule.danger strong { color: var(--rose-600); }
[data-theme="dark"] .pre-exam-rule.danger strong,
[data-theme="dim"]   .pre-exam-rule.danger strong { color: var(--rose-400); }

/* Hidden when the exam is not forward-only */
.pre-exam-rule[hidden] { display: none !important; }

/* ---- Consent row ---- */
.pre-exam-consent {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(99,102,241,.06);
  border: 1.5px solid rgba(99,102,241,.3);
  cursor: pointer;
  margin-bottom: 16px;
  font-size: 12.75px;
  line-height: 1.5;
  color: var(--text-secondary);
  transition: border-color .18s var(--ease), background .18s var(--ease);
}
.pre-exam-consent:hover {
  border-color: var(--brand-500);
  background: rgba(99,102,241,.10);
}
.pre-exam-consent input[type="checkbox"] {
  width: 18px; height: 18px;
  accent-color: var(--brand-600);
  flex-shrink: 0;
  cursor: pointer;
  margin-top: 1px;
}
.pre-exam-consent span em {
  font-style: normal;
  font-weight: 700;
  color: var(--text-primary);
}

/* ---- Actions — always side-by-side ---- */
.pre-exam-actions {
  display: flex !important;
  flex-direction: row !important;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 0 !important;
  border-top: 0 !important;
  margin-top: 0 !important;
}
.pre-exam-actions .btn {
  min-height: 44px;
  padding: 11px 22px;
  font-size: 13.5px;
  font-weight: 700;
  flex: 0 0 auto;
}
.pre-exam-actions .btn-danger { min-width: 150px; }

/* ---- Mobile tune ---- */
@media (max-width: 520px) {
  .pre-exam-modal { padding: 20px 18px 18px !important; }
  .pre-exam-head { gap: 12px; padding-bottom: 14px; margin-bottom: 14px; }
  .pre-exam-head-icon { width: 40px; height: 40px; font-size: 17px; }
  .pre-exam-head-text h3 { font-size: 15.5px; }
  .pre-exam-rule { padding: 9px 11px; gap: 10px; }
  .pre-exam-actions { flex-direction: column-reverse !important; }
  .pre-exam-actions .btn { width: 100%; }
}
/* ============================================================
   74. SUBJECTIVE UPLOAD — two-button layout + PDF tiles
   ============================================================ */

.subjective-upload-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.subjective-upload-row .subjective-upload-btn {
  flex: 1 1 140px;
  max-width: none;
  margin: 0;
}


.subjective-upload-btn--pdf {
  border-style: solid;
  border-color: rgba(239,68,68,.5);
  background: rgba(239,68,68,.05);
  color: #dc2626;
}
.subjective-upload-btn--pdf:hover {
  background: rgba(239,68,68,.12);
  border-color: #dc2626;
  transform: translateY(-1px);
}
[data-theme="dark"] .subjective-upload-btn--pdf,
[data-theme="dim"]   .subjective-upload-btn--pdf { color: #fca5a5; }

.subjective-upload-hint {
  margin: 4px 0 12px;
  font-size: 11.5px;
  color: var(--text-tertiary);
  line-height: 1.5;
  display: flex;
  align-items: flex-start;
  gap: 6px;
}
.subjective-upload-hint i { color: var(--brand-500); margin-top: 2px; flex-shrink: 0; }
.subjective-upload-hint strong { color: var(--text-secondary); font-weight: 700; }

/* ---- PDF tile ---- */
.subjective-upload-tile.pdf {
  background: linear-gradient(135deg, rgba(239,68,68,.06), rgba(239,68,68,.02));
  border: 1px solid rgba(239,68,68,.28);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px;
}
.subjective-pdf-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-decoration: none;
  color: #dc2626;
  transition: transform .18s var(--ease);
}
.subjective-pdf-link:hover { transform: scale(1.06); }
.subjective-pdf-link i { font-size: 34px; }
.subjective-pdf-link span {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
}
[data-theme="dark"] .subjective-pdf-link,
[data-theme="dim"]   .subjective-pdf-link { color: #fca5a5; }

/* ---- Image tile fallback (broken / blocked image) ---- */
.subjective-upload-tile.img-error {
  background: var(--bg-surface-3);
  display: flex;
  align-items: center;
  justify-content: center;
}
.subjective-upload-tile.img-error::before {
  content: "\f1c5";
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  font-size: 34px;
  color: var(--text-tertiary);
}

/* ---- Mobile ---- */
@media (max-width: 520px) {
  /* three compact tiles side by side (Camera · Photos · PDF) */
  .subjective-upload-row { flex-wrap: nowrap; gap: 8px; }
  .subjective-upload-row .subjective-upload-btn { flex: 1 1 0; min-width: 0; flex-direction: column; gap: 5px; padding: 12px 6px; font-size: 12.5px; }
}
/* ============================================================
   75. QUESTION PALETTE + NAV POLICY UI
   ============================================================ */

/* ---- Palette strip below the exam header ---- */
.quiz-palette {
  flex-shrink: 0;
  padding: 10px 22px 12px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  box-shadow: 0 1px 2px rgba(20,22,28,.03);
  z-index: 2;
}
[data-theme="dark"] .quiz-palette,
[data-theme="dim"]   .quiz-palette {
  background: var(--bg-surface-2);
  box-shadow: 0 1px 2px rgba(0,0,0,.35);
}

.quiz-palette-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: .6px;
}
.quiz-palette-head > i { color: var(--brand-500); font-size: 12px; }
.quiz-palette-title { color: var(--text-secondary); }

.quiz-palette-mode {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .4px;
  text-transform: uppercase;
  margin-left: auto;
}
.quiz-palette-mode.strict {
  background: rgba(239,68,68,.12);
  color: var(--rose-600);
  border: 1px solid rgba(239,68,68,.28);
}
.quiz-palette-mode.flexible {
  background: rgba(16,185,129,.12);
  color: var(--emerald-600);
  border: 1px solid rgba(16,185,129,.28);
}
[data-theme="dark"] .quiz-palette-mode.strict,
[data-theme="dim"]   .quiz-palette-mode.strict { color: var(--rose-400); }
[data-theme="dark"] .quiz-palette-mode.flexible,
[data-theme="dim"]   .quiz-palette-mode.flexible { color: var(--emerald-400); }

.quiz-palette-count {
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  color: var(--text-primary);
  background: var(--bg-surface-3);
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: .2px;
}

.quiz-palette-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.quiz-palette-cell {
  width: 34px;
  height: 34px;
  min-width: 34px;
  min-height: 34px;
  padding: 0;
  border-radius: 8px;
  border: 1.5px solid var(--border-default);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: transform .14s var(--ease),
              border-color .14s var(--ease),
              background .14s var(--ease),
              box-shadow .14s var(--ease);
}
.quiz-palette-cell:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: var(--brand-400);
  box-shadow: var(--shadow-sm);
}

/* Answered — a soft green dot */
.quiz-palette-cell.answered {
  background: rgba(16,185,129,.12);
  border-color: rgba(16,185,129,.4);
  color: var(--emerald-600);
}
[data-theme="dark"] .quiz-palette-cell.answered,
[data-theme="dim"]   .quiz-palette-cell.answered {
  background: rgba(16,185,129,.22);
  color: var(--emerald-400);
}

/* Current — brand gradient */
.quiz-palette-cell.current {
  background: linear-gradient(135deg, var(--brand-600), var(--brand-500));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 12px rgba(99,102,241,.4);
  transform: translateY(-2px);
}

/* Locked — muted, no cursor */
.quiz-palette-cell.locked {
  opacity: .4;
  cursor: not-allowed;
  background: var(--bg-surface-3);
  border-style: dashed;
}
.quiz-palette-cell:disabled { cursor: not-allowed; }

/* ---- Footer navigation row (flexible mode: Previous) ---- */
.quiz-exam-nav-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ---- Admin: navigation policy picker ---- */
.quiz-nav-policy {
  margin-top: 22px;
  padding: 18px 20px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(99,102,241,.05), rgba(6,182,212,.02));
  border: 1px solid rgba(99,102,241,.22);
}
[data-theme="dark"] .quiz-nav-policy,
[data-theme="dim"]   .quiz-nav-policy {
  background: linear-gradient(135deg, rgba(99,102,241,.12), rgba(6,182,212,.04));
  border-color: rgba(99,102,241,.35);
}
.quiz-nav-policy-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}
.quiz-nav-policy-head > i {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--brand-600), var(--accent-500));
  color: #fff;
  font-size: 14px;
  box-shadow: 0 5px 14px rgba(99,102,241,.32);
}
.quiz-nav-policy-head > div { flex: 1; min-width: 0; }
.quiz-nav-policy-head strong {
  display: block;
  font-size: 14px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -.15px;
}
.quiz-nav-policy-head span {
  display: block;
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 2px;
}

.quiz-nav-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  border: 2px solid var(--border-subtle);
  cursor: pointer;
  transition: border-color .18s var(--ease), background .18s var(--ease), transform .12s var(--ease);
  margin-bottom: 10px;
}
.quiz-nav-option:hover {
  border-color: var(--brand-300);
  transform: translateY(-1px);
}
[data-theme="dark"] .quiz-nav-option:hover,
[data-theme="dim"]   .quiz-nav-option:hover { border-color: var(--brand-500); }
.quiz-nav-option.active {
  border-color: var(--brand-500);
  background: linear-gradient(135deg, rgba(99,102,241,.08), rgba(99,102,241,.02));
  box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}
.quiz-nav-option input[type="radio"] {
  margin-top: 3px;
  width: 18px; height: 18px;
  accent-color: var(--brand-600);
  flex-shrink: 0;
  cursor: pointer;
}
.quiz-nav-option-body { flex: 1; min-width: 0; }
.quiz-nav-option-title {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  letter-spacing: -.1px;
}
.quiz-nav-option-title i { color: var(--brand-500); font-size: 12.5px; }
.quiz-nav-option-desc {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.55;
}
.quiz-nav-option-desc strong { color: var(--text-primary); font-weight: 700; }

.quiz-nav-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  transition: border-color .18s var(--ease);
  margin-top: 4px;
}
.quiz-nav-toggle:hover { border-color: var(--brand-400); }
.quiz-nav-toggle input[type="checkbox"] {
  width: 18px; height: 18px;
  accent-color: var(--brand-600);
  cursor: pointer;
  flex-shrink: 0;
}

/* ---- Mobile ---- */
@media (max-width: 720px) {
  .quiz-palette { padding: 8px 14px 10px; }
  .quiz-palette-cell { width: 30px; height: 30px; font-size: 11.5px; }
  .quiz-palette-title { display: none; }
  .quiz-exam-nav-actions { width: 100%; }
  .quiz-exam-nav-actions .btn { flex: 1; justify-content: center; }
}
/* ============================================================
   BRAND ICON — new AeroGyan "A" mark
   ------------------------------------------------------------
   The Font Awesome rocket glyph inside .brand-icon is replaced
   by an inline SVG of the tricolor A mark. This block keeps the
   same 42x42 footprint so nothing else in the layout needs to
   move — only the appearance changes.
   ============================================================ */
.brand-icon {
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, .06) !important;
  padding: 6px !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .22) !important;
  font-size: 0 !important;   /* collapses any residual <i> tag text */
  color: transparent !important;
}
.brand-icon > svg {
  width: 100%;
  height: 100%;
  display: block;
}
[data-theme="dark"] .brand-icon,
[data-theme="dim"]  .brand-icon {
  border-color: rgba(255, 255, 255, .15) !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .5) !important;
}
/* ============================================================
   76. UNIVERSAL DOCUMENT VIEWER
   ------------------------------------------------------------
   Handles every non-PDF, non-video material:
     • PPTX / PPT / PPSX / PPS   → MS Office Online embed
     • DOCX / DOC / RTF / ODT    → MS Office Online embed
     • XLSX / XLS / CSV / ODS    → MS Office Online embed
     • PNG / JPG / GIF / WebP    → inline <img>
     • TXT / MD / JSON / XML     → styled <pre>

   Class prefix `docv-` guarantees zero collision with the PDF
   (pdfv-) and video (vp-) viewers. Purely additive — the
   existing viewers are untouched.
   ============================================================ */

.doc-viewer-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(16, 18, 22, .96);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: none;
}
.doc-viewer-modal.active { display: flex; }

.docv-shell {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
}

/* ---- Toolbar ---- */
.docv-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 16px;
  background: rgba(10, 14, 31, .96);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  color: #fff;
  flex-shrink: 0;
  z-index: 5;
}
.docv-toolbar-left,
.docv-toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.docv-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 15px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .22);
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: .2s;
  flex-shrink: 0;
}
.docv-back-btn:hover {
  background: rgba(99, 102, 241, .75);
  border-color: rgba(255, 255, 255, .45);
  transform: translateX(-2px);
}
.docv-back-btn:active { transform: translateX(-2px) scale(.97); }
.docv-back-btn i { font-size: 12px; }

.docv-title {
  margin-left: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  max-width: min(60vw, 520px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.docv-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, .14);
  background: rgba(255, 255, 255, .08);
  color: #fff;
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
  transition: .2s;
  flex-shrink: 0;
}
.docv-btn:hover { background: rgba(255, 255, 255, .2); }
.docv-btn:active { transform: scale(.95); }

/* ---- Body ---- */
.docv-body {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: auto;
  background: #131727;
}

.docv-watermark {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  background-repeat: repeat;
  opacity: .3;
}

/* ---- Office iframe ---- */
.docv-office-wrap {
  position: relative;
  flex: 1;
  display: flex;
  width: 100%;
  height: 100%;
  min-height: 0;
}
.docv-frame {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #fff;
}

/* ---- Image ---- */
.docv-image-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: #131727;
}
.docv-image-wrap img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .5);
}

/* ---- Text ---- */
.docv-text-wrap {
  flex: 1;
  display: flex;
  justify-content: center;
  padding: 24px;
  background: #131727;
}
.docv-text {
  max-width: 900px;
  width: 100%;
  margin: 0;
  padding: 22px 26px;
  border-radius: 8px;
  background: #1e2338;
  color: #e2e8f0;
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 13.5px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .4);
}

/* ---- Loader ---- */
.docv-loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 40px 20px;
  color: #fff;
  text-align: center;
}
.docv-loader-overlay {
  position: absolute;
  inset: 0;
  z-index: 4;
  background: rgba(19, 23, 39, .94);
  pointer-events: none;
  transition: opacity .25s ease;
}
.docv-loader p {
  margin: 0;
  font-size: 14px;
  color: rgba(255, 255, 255, .9);
}
.docv-loader-hint {
  max-width: 380px;
  font-size: 12px !important;
  line-height: 1.5;
  color: rgba(255, 255, 255, .55) !important;
}
.docv-loader-hint i { margin: 0 3px; }

.docv-spinner {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, .15);
  border-top-color: #6366f1;
  animation: docvSpin .8s linear infinite;
}
@keyframes docvSpin { to { transform: rotate(360deg); } }

/* ---- Unsupported / error card ---- */
.docv-unsupported {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 40px 24px;
  color: #fff;
  text-align: center;
}
.docv-unsupported i {
  font-size: 54px;
  color: #f59e0b;
  opacity: .9;
}
.docv-unsupported h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}
.docv-unsupported p {
  max-width: 480px;
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: rgba(255, 255, 255, .7);
}
.docv-unsupported a.btn { text-decoration: none; }

/* ---- Mobile ---- */
@media (max-width: 640px) {
  .docv-toolbar { padding: 8px 12px; gap: 8px; }
  .docv-title { max-width: 46vw; font-size: 13px; }
  .docv-back-btn { padding: 7px 12px; font-size: 12px; }
  .docv-btn { width: 34px; height: 34px; }
  .docv-text-wrap,
  .docv-image-wrap { padding: 12px; }
  .docv-text { padding: 16px 18px; font-size: 12.5px; }
}
@media (max-width: 420px) {
  .docv-back-btn span { display: none; }
  .docv-back-btn { padding: 8px 10px; }
  .docv-title { max-width: 42vw; font-size: 12.5px; }
}

/* ---- Stand down the mobile bottom nav + back-to-top while
        the document viewer is open (same pattern used by the
        PDF and video viewers). ---- */
body:has(.doc-viewer-modal.active) .mobile-bottom-nav,
body:has(.doc-viewer-modal.active) .aero-to-top {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .docv-spinner { animation-duration: 1.6s; }
  .docv-back-btn,
  .docv-btn { transition: none; }
}
/* ============================================================
   77. ADMIN — BRANDING PANEL
   ============================================================ */

.branding-intro {
  background: linear-gradient(135deg, rgba(99,102,241,.05), rgba(6,182,212,.02));
  border: 1px solid rgba(99,102,241,.22);
}
[data-theme="dark"] .branding-intro,
[data-theme="dim"]   .branding-intro {
  background: linear-gradient(135deg, rgba(99,102,241,.12), rgba(6,182,212,.04));
  border-color: rgba(99,102,241,.35);
}

.branding-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.branding-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform .2s var(--ease), border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.branding-card:hover {
  transform: translateY(-3px);
  border-color: var(--brand-300);
  box-shadow: var(--shadow-md);
}
[data-theme="dark"] .branding-card:hover,
[data-theme="dim"]   .branding-card:hover { border-color: var(--brand-500); }

.branding-card.is-custom {
  border-color: var(--brand-400);
  box-shadow: 0 0 0 1px rgba(99,102,241,.15);
}
[data-theme="dark"] .branding-card.is-custom,
[data-theme="dim"]   .branding-card.is-custom {
  box-shadow: 0 0 0 1px rgba(99,102,241,.35);
}

.branding-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 130px;
  padding: 16px;
  background:
    radial-gradient(140px 80px at 50% 0%, rgba(99,102,241,.06), transparent 70%),
    repeating-conic-gradient(var(--bg-surface-2) 0 25%, var(--bg-surface-3) 0 50%) 50% / 20px 20px;
  border-bottom: 1px solid var(--border-subtle);
  position: relative;
}
.branding-preview img {
  max-width: 96px;
  max-height: 96px;
  width: auto;
  height: auto;
  display: block;
  object-fit: contain;
  transition: transform .25s var(--ease);
}
.branding-preview--16  img { width: 16px; height: 16px; }
.branding-preview--32  img { width: 32px; height: 32px; }
.branding-preview--48  img { width: 48px; height: 48px; }
.branding-preview--96  img { width: 96px; height: 96px; }
.branding-preview--180 img { width: 96px; height: 96px; }
.branding-preview--192 img { width: 96px; height: 96px; }
.branding-preview--256 img { width: 96px; height: 96px; }
.branding-preview--384 img { width: 96px; height: 96px; }
.branding-preview--512 img { width: 96px; height: 96px; }
.branding-preview--svg img { width: 84px; height: 84px; }

.branding-card:hover .branding-preview img { transform: scale(1.06); }

.branding-card-body {
  padding: 12px 14px 6px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 0;
}
.branding-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.branding-card-head strong {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -.1px;
}
.branding-hint {
  font-size: 11.5px;
  color: var(--text-tertiary);
  line-height: 1.4;
}
.branding-file {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--text-secondary);
  padding: 5px 8px;
  background: var(--bg-surface-2);
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.branding-file i { color: var(--brand-500); flex-shrink: 0; }
.branding-size {
  margin-left: auto;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-tertiary);
  flex-shrink: 0;
}
.branding-meta {
  font-size: 11px;
  color: var(--text-tertiary);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.branding-meta i { font-size: 10px; }

.branding-status {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .4px;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.branding-status.default {
  background: var(--bg-surface-3);
  color: var(--text-tertiary);
}
.branding-status.custom {
  background: rgba(16,185,129,.16);
  color: var(--emerald-600);
}
[data-theme="dark"] .branding-status.custom,
[data-theme="dim"]   .branding-status.custom {
  background: rgba(16,185,129,.24);
  color: var(--emerald-400);
}

.branding-actions {
  display: flex;
  gap: 8px;
  padding: 10px 14px 14px;
  flex-wrap: wrap;
  margin-top: auto;
}
.branding-upload-btn {
  cursor: pointer;
  flex: 1;
  justify-content: center;
  min-width: 90px;
}
.branding-upload-btn input { display: none; }

@media (max-width: 520px) {
  .branding-grid { grid-template-columns: 1fr; }
  .branding-preview { height: 110px; }
  .branding-actions .btn { flex: 1 1 48%; }
}
/* ============================================================
   78. ADMIN — SIMPLIFIED BRANDING PANEL (2 cards + reset)
   ============================================================ */

.branding-simple-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.branding-simple-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform .2s var(--ease), border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.branding-simple-card:hover {
  transform: translateY(-3px);
  border-color: var(--brand-300);
  box-shadow: var(--shadow-md);
}
[data-theme="dark"] .branding-simple-card:hover,
[data-theme="dim"]   .branding-simple-card:hover { border-color: var(--brand-500); }

.branding-simple-card.is-custom {
  border-color: var(--brand-400);
  box-shadow: 0 0 0 1px rgba(99,102,241,.15);
}
[data-theme="dark"] .branding-simple-card.is-custom,
[data-theme="dim"]   .branding-simple-card.is-custom {
  box-shadow: 0 0 0 1px rgba(99,102,241,.35);
}

/* Preview areas */
.branding-simple-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  padding: 22px;
  background:
    radial-gradient(260px 120px at 50% 0%, rgba(99,102,241,.08), transparent 70%),
    repeating-conic-gradient(var(--bg-surface-2) 0 25%, var(--bg-surface-3) 0 50%) 50% / 22px 22px;
  border-bottom: 1px solid var(--border-subtle);
  position: relative;
}
.branding-simple-preview--logo img {
  max-width: 220px;
  max-height: 140px;
  width: auto; height: auto;
  object-fit: contain;
  transition: transform .25s var(--ease);
}
.branding-simple-card:hover .branding-simple-preview--logo img { transform: scale(1.05); }

/* Size stack — visual demonstration of every generated size */
.branding-size-stack {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}
.branding-size-stack img {
  display: block;
  border-radius: 4px;
  transition: transform .25s var(--ease);
}
.branding-size-512 { width: 96px; height: 96px; }
.branding-size-192 { width: 56px; height: 56px; }
.branding-size-96  { width: 40px; height: 40px; }
.branding-size-48  { width: 28px; height: 28px; }
.branding-size-32  { width: 22px; height: 22px; }
.branding-size-16  { width: 14px; height: 14px; }
.branding-simple-card:hover .branding-size-stack img { transform: translateY(-2px); }

/* Body */
.branding-simple-body {
  padding: 16px 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}
.branding-simple-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.branding-simple-head strong {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -.2px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.branding-simple-head strong i {
  color: var(--brand-500);
  font-size: 14px;
}
.branding-simple-desc {
  margin: 0;
  font-size: 12.5px;
  color: var(--text-tertiary);
  line-height: 1.55;
}

/* Actions */
.branding-simple-body .branding-actions {
  display: flex;
  gap: 8px;
  padding: 4px 0 0;
  margin-top: auto;
  flex-wrap: wrap;
}
.branding-simple-body .branding-upload-btn {
  flex: 1;
  justify-content: center;
  min-width: 140px;
  font-weight: 700;
}
.branding-simple-body .branding-upload-btn input { display: none; }

.branding-reset-section {
  margin-top: 24px;
  background: linear-gradient(135deg, rgba(239,68,68,.04), transparent 70%);
  border: 1px solid rgba(239,68,68,.20);
}
[data-theme="dark"] .branding-reset-section,
[data-theme="dim"]   .branding-reset-section {
  background: linear-gradient(135deg, rgba(239,68,68,.10), transparent 70%);
  border-color: rgba(239,68,68,.35);
}

/* Responsive */
@media (max-width: 640px) {
  .branding-simple-grid { grid-template-columns: 1fr; gap: 16px; }
  .branding-simple-preview { min-height: 150px; padding: 18px; }
  .branding-size-512 { width: 72px; height: 72px; }
  .branding-size-192 { width: 46px; height: 46px; }
  .branding-size-96  { width: 34px; height: 34px; }
  .branding-simple-body .branding-upload-btn { flex: 1 1 100%; }
}
/* ------------------------------------------------------------
   ⭐ Course editor — Download ZIP button spacing
   ------------------------------------------------------------ */
.editor-hero-right {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
/* ============================================================
   ⭐ LOGIN PAGE — minimal top bar (theme toggle only)
   When logged out, the header shows only the brand and the
   theme switcher. Search, notifications, settings, streak,
   profile and the main nav stay hidden until the user logs in.
   ============================================================ */
body.aero-logged-out #mainNav,
body.aero-logged-out #navToggle,
body.aero-logged-out #globalSearchTrigger,
body.aero-logged-out #notifWrap,
body.aero-logged-out #settingsBtn,
body.aero-logged-out #streakBadge,
body.aero-logged-out #userProfileWrap {
  display: none !important;
}
body.aero-logged-out .user-info {
  margin-left: auto;
  gap: 0 !important;
}
body.aero-logged-out #appHeader .brand { cursor: default; }
/* ============================================================
   79. CERTIFICATE — student "in progress" banner
   ============================================================ */
.cert-progress-banner {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 18px 22px;
  margin-bottom: 20px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(99,102,241,.10), rgba(6,182,212,.04));
  border: 1.5px solid rgba(99,102,241,.30);
}
[data-theme="dark"] .cert-progress-banner,
[data-theme="dim"]   .cert-progress-banner {
  background: linear-gradient(135deg, rgba(99,102,241,.18), rgba(6,182,212,.06));
  border-color: rgba(99,102,241,.45);
}
.cert-progress-icon {
  width: 54px; height: 54px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--brand-600), var(--accent-500));
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
  box-shadow: 0 6px 18px rgba(99,102,241,.35);
}
.cert-progress-info { flex: 1; min-width: 0; }
.cert-progress-info h4 {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 3px;
}
.cert-progress-info p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
}

/* ============================================================
   80. CERTIFICATE — admin template editor
   ============================================================ */
.cert-tmpl-intro {
  background: linear-gradient(135deg, rgba(99,102,241,.05), rgba(6,182,212,.02));
  border: 1px solid rgba(99,102,241,.22);
}
[data-theme="dark"] .cert-tmpl-intro,
[data-theme="dim"]   .cert-tmpl-intro {
  background: linear-gradient(135deg, rgba(99,102,241,.12), rgba(6,182,212,.04));
  border-color: rgba(99,102,241,.35);
}

.cert-tmpl-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 20px;
  margin-top: 20px;
  align-items: start;
}
@media (max-width: 1100px) {
  .cert-tmpl-grid { grid-template-columns: 1fr; }
}

.cert-tmpl-form { position: sticky; top: 80px; }
@media (max-width: 1100px) { .cert-tmpl-form { position: static; } }

.cert-tmpl-form input[type="color"] {
  width: 100%;
  height: 42px;
  padding: 4px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-default);
  background: var(--bg-surface);
  cursor: pointer;
}

/* ---------- Live preview ---------- */
.cert-tmpl-preview-wrap { position: sticky; top: 80px; }
@media (max-width: 1100px) { .cert-tmpl-preview-wrap { position: static; } }

.cert-preview {
  width: 100%;
  aspect-ratio: 1.414 / 1;
  background: var(--bg-surface-2);
  border-radius: var(--radius-md);
  overflow: hidden;
  padding: 12px;
  box-sizing: border-box;
}
.cert-preview-frame {
  width: 100%;
  height: 100%;
  background: #fff;
  border: 2px solid #0f172a;
  border-radius: 6px;
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  overflow: hidden;
  font-family: 'Inter', system-ui, sans-serif;
  color: #0f172a;
}
.cert-preview-frame::before {
  content: "";
  position: absolute; inset: 4px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  pointer-events: none;
}
.cert-preview-head {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 6px;
}
.cert-preview-logo {
  width: 34px; height: 34px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; color: #fff;
}
.cert-preview-org {
  font-size: 13px; font-weight: 800;
  letter-spacing: -.2px;
  text-align: left;
}
.cert-preview-org-sub {
  font-size: 8.5px; color: #64748b;
  letter-spacing: 1px; text-transform: uppercase;
  text-align: left;
}
.cert-preview-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 26px;
  font-weight: 800;
  line-height: 1;
  margin-top: 8px;
}
.cert-preview-subtitle {
  font-size: 8.5px;
  color: #64748b;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 12px;
}
.cert-preview-presented { font-size: 9px; color: #475569; }
.cert-preview-name {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 22px;
  font-weight: 700;
  margin: 4px 0 10px;
  padding-bottom: 5px;
  border-bottom: 1.5px solid #e2e8f0;
  min-width: 55%;
}
.cert-preview-completed { font-size: 9px; color: #475569; margin-bottom: 4px; }
.cert-preview-course { font-size: 13px; font-weight: 700; }
.cert-preview-code {
  font-size: 8px;
  color: #64748b;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 14px;
}
.cert-preview-foot {
  margin-top: auto;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding-top: 10px;
  border-top: 1px solid #e2e8f0;
  font-size: 8px;
}
.cert-preview-id {
  color: #94a3b8;
  font-family: 'Courier New', monospace;
  font-size: 8.5px;
  letter-spacing: .4px;
}
.cert-preview-sign { text-align: center; min-width: 100px; }
.cert-preview-sign-name {
  font-family: 'Playfair Display', Georgia, serif;
  font-style: italic;
  font-size: 12px;
  border-bottom: 1px solid #cbd5e1;
  padding-bottom: 2px;
  margin-bottom: 2px;
}
.cert-preview-sign-role {
  font-size: 7.5px;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
}
/* ============================================================
   81. LIVE ACTIVITY — STUDENT USAGE MODAL  (v2 — wide, structured)
   ------------------------------------------------------------
   Fully scoped to #studentUsageModal. Every class is prefixed
   .sum- and every selector is anchored on the modal id, so no
   existing component can be affected by this block. Appended
   at the end of styles.css so it wins the cascade safely.
   ============================================================ */

.sum-overlay {
  position: fixed;
  inset: 0;
  z-index: 2400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2vh 2vw;
  background: rgba(7, 11, 26, .62);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  transition: opacity .22s cubic-bezier(.4, 0, .2, 1);
}
.sum-overlay.active { opacity: 1; }

.sum-shell {
  width: min(1440px, 84vw);
  height: min(900px, 84vh);
  min-width: 320px;
  min-height: 420px;
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  box-shadow:
    0 30px 80px rgba(0, 0, 0, .45),
    0 12px 30px rgba(0, 0, 0, .22);
  overflow: hidden;
  transform: translateY(12px) scale(.985);
  transition: transform .3s cubic-bezier(.22, 1, .36, 1);
}
.sum-overlay.active .sum-shell {
  transform: translateY(0) scale(1);
}

/* ------------------------------------------------------------
   HEADER
   ------------------------------------------------------------ */
.sum-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 20px 24px;
  background:
    radial-gradient(500px 220px at 0% 0%, rgba(99, 102, 241, .10), transparent 60%),
    linear-gradient(135deg, rgba(99, 102, 241, .05), rgba(6, 182, 212, .02));
  border-bottom: 1px solid var(--border-subtle);
  position: relative;
}
[data-theme="dark"] .sum-header,
[data-theme="dim"]   .sum-header {
  background:
    radial-gradient(500px 220px at 0% 0%, rgba(99, 102, 241, .20), transparent 60%),
    linear-gradient(135deg, rgba(99, 102, 241, .12), rgba(6, 182, 212, .04));
}

.sum-avatar {
  width: 60px;
  height: 60px;
  min-width: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -.5px;
  color: #fff;
  background: linear-gradient(135deg, #6366f1, #06b6d4);
  box-shadow: 0 10px 22px rgba(99, 102, 241, .35),
              inset 0 1px 0 rgba(255, 255, 255, .35);
  flex-shrink: 0;
}

.sum-title-block {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sum-name {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -.4px;
  color: var(--text-primary);
  line-height: 1.15;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sum-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.sum-meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  white-space: nowrap;
}
.sum-meta-pill i { color: var(--brand-500); font-size: 11px; }
.sum-meta-pill strong { color: var(--text-primary); font-weight: 800; }

.sum-close {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-tertiary);
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .18s var(--ease), color .18s var(--ease), border-color .18s var(--ease);
  flex-shrink: 0;
}
.sum-close:hover {
  background: var(--rose-500);
  border-color: var(--rose-500);
  color: #fff;
}

/* ------------------------------------------------------------
   BODY  —  scrollable canvas
   ------------------------------------------------------------ */
.sum-body {
  flex: 1;
  overflow-y: auto;
  padding: 22px 24px 26px;
  background:
    radial-gradient(900px 400px at 100% 0%, rgba(6, 182, 212, .04), transparent 60%),
    var(--bg-page);
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}
.sum-body::-webkit-scrollbar { width: 10px; }
.sum-body::-webkit-scrollbar-track { background: transparent; }
.sum-body::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border: 3px solid transparent;
  border-radius: 999px;
  background-clip: content-box;
}
.sum-body::-webkit-scrollbar-thumb:hover {
  background: var(--brand-500);
  border: 3px solid transparent;
  background-clip: content-box;
}

/* Loading / error / empty */
.sum-loading,
.sum-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 80px 20px;
  text-align: center;
  color: var(--text-tertiary);
}
.sum-empty i {
  font-size: 44px;
  color: var(--brand-400);
  opacity: .6;
  display: block;
}
.sum-empty h3 {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0;
}
.sum-empty p {
  font-size: 13.5px;
  margin: 0;
  max-width: 420px;
  line-height: 1.55;
}

/* ------------------------------------------------------------
   SUMMARY STATS  (4 tiles)
   ------------------------------------------------------------ */
.sum-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}
.sum-stat {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s var(--ease);
}
.sum-stat:hover {
  transform: translateY(-2px);
  border-color: var(--brand-300);
  box-shadow: var(--shadow-sm);
}
[data-theme="dark"] .sum-stat:hover,
[data-theme="dim"]   .sum-stat:hover { border-color: var(--brand-500); }

.sum-stat-icon {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  color: #fff;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}
.sum-stat-icon::before {
  content: "";
  position: absolute;
  top: -30%; left: -30%;
  width: 160%; height: 160%;
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, .3), transparent 55%);
  pointer-events: none;
}
.sum-stat-icon.tone-brand   { background: linear-gradient(135deg, #818cf8, #4f46e5); box-shadow: 0 6px 14px rgba(99, 102, 241, .35); }
.sum-stat-icon.tone-emerald { background: linear-gradient(135deg, #34d399, #059669); box-shadow: 0 6px 14px rgba(16, 185, 129, .35); }
.sum-stat-icon.tone-cyan    { background: linear-gradient(135deg, #22d3ee, #0891b2); box-shadow: 0 6px 14px rgba(6, 182, 212, .35); }
.sum-stat-icon.tone-gold    { background: linear-gradient(135deg, #fbbf24, #d97706); color: #422006; box-shadow: 0 6px 14px rgba(245, 158, 11, .35); }

.sum-stat-body { flex: 1; min-width: 0; }
.sum-stat-num {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -.5px;
  color: var(--text-primary);
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}
.sum-stat-lbl {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .55px;
  color: var(--text-tertiary);
  margin-top: 3px;
}

/* ------------------------------------------------------------
   TWO-COLUMN GRID
   ------------------------------------------------------------ */
.sum-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 18px;
  align-items: start;
}

.sum-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.sum-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 16px 18px 14px;
  border-bottom: 1px solid var(--border-subtle);
  background: linear-gradient(135deg, rgba(99, 102, 241, .04), rgba(6, 182, 212, .015));
}
[data-theme="dark"] .sum-panel-head,
[data-theme="dim"]   .sum-panel-head {
  background: linear-gradient(135deg, rgba(99, 102, 241, .10), rgba(6, 182, 212, .03));
}
.sum-panel-head h3 {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 14.5px;
  font-weight: 800;
  letter-spacing: -.2px;
  color: var(--text-primary);
  margin: 0;
}
.sum-panel-head h3 i { color: var(--brand-500); font-size: 14px; }
.sum-panel-sub {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-tertiary);
  letter-spacing: .2px;
}
.sum-panel-empty {
  padding: 44px 20px;
  text-align: center;
  color: var(--text-tertiary);
}
.sum-panel-empty i {
  font-size: 32px;
  opacity: .45;
  color: var(--brand-400);
  display: block;
  margin-bottom: 10px;
}
.sum-panel-empty p { font-size: 13px; margin: 0; }

/* ------------------------------------------------------------
   LEFT PANEL — COURSE ENGAGEMENT
   ------------------------------------------------------------ */
.sum-course-list {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sum-course-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  transition: transform .18s var(--ease), border-color .18s var(--ease);
}
.sum-course-row:hover {
  transform: translateX(2px);
  border-color: var(--brand-300);
}
[data-theme="dark"] .sum-course-row:hover,
[data-theme="dim"]   .sum-course-row:hover { border-color: var(--brand-500); }

.sum-course-rank {
  width: 26px;
  height: 26px;
  min-width: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11.5px;
  font-weight: 800;
  color: var(--text-tertiary);
  background: var(--bg-surface-3);
  flex-shrink: 0;
  margin-top: 2px;
}
.sum-course-rank.top1 { background: linear-gradient(135deg, #fbbf24, #d97706); color: #422006; box-shadow: 0 3px 8px rgba(245,158,11,.35); }
.sum-course-rank.top2 { background: linear-gradient(135deg, #cbd5e1, #94a3b8); color: #1e293b; }
.sum-course-rank.top3 { background: linear-gradient(135deg, #fda478, #c2410c); color: #fff; }

.sum-course-info { flex: 1; min-width: 0; }
.sum-course-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 7px;
}
.sum-course-head strong {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
.sum-course-code {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .5px;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--brand-50);
  color: var(--brand-700);
  flex-shrink: 0;
}
[data-theme="dark"] .sum-course-code,
[data-theme="dim"]   .sum-course-code {
  background: rgba(99, 102, 241, .2);
  color: var(--brand-300);
}

.sum-course-bar {
  height: 8px;
  border-radius: 999px;
  background: var(--bg-surface-3);
  overflow: hidden;
  margin-bottom: 7px;
}
.sum-course-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #6366f1, #06b6d4);
  box-shadow: 0 0 10px rgba(99, 102, 241, .35);
  transition: width .6s cubic-bezier(.4, 0, .2, 1);
}

.sum-course-meta {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-tertiary);
}
.sum-course-meta span { display: inline-flex; align-items: center; gap: 5px; }
.sum-course-meta i { color: var(--brand-500); font-size: 10.5px; }

/* ------------------------------------------------------------
   RIGHT PANEL — DAILY TIMELINE
   ------------------------------------------------------------ */
.sum-timeline {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sum-day {
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color .18s var(--ease);
}
.sum-day[open] {
  border-color: var(--brand-300);
  box-shadow: 0 6px 16px rgba(99, 102, 241, .08);
}
[data-theme="dark"] .sum-day[open],
[data-theme="dim"]   .sum-day[open] {
  border-color: var(--brand-500);
  box-shadow: 0 6px 16px rgba(0, 0, 0, .35);
}

.sum-day > summary {
  list-style: none;
  cursor: pointer;
  padding: 12px 14px;
  user-select: none;
  transition: background .15s var(--ease);
}
.sum-day > summary::-webkit-details-marker { display: none; }
.sum-day > summary:hover { background: var(--bg-surface-3); }

.sum-day-summary {
  display: grid;
  grid-template-columns: minmax(140px, max-content) 1fr auto;
  align-items: center;
  gap: 12px;
}
.sum-day-date {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.sum-day-date strong {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sum-day-badge {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: .5px;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--brand-600), var(--brand-500));
  color: #fff;
  box-shadow: 0 3px 8px rgba(99, 102, 241, .3);
  flex-shrink: 0;
}
.sum-day-metrics {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  justify-content: flex-start;
}
.sum-day-metric {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .15px;
  background: var(--bg-surface-3);
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.sum-day-metric i { font-size: 9.5px; }
.sum-day-metric.tone-brand   { background: rgba(99, 102, 241, .12); color: #4f46e5; }
.sum-day-metric.tone-cyan    { background: rgba(6, 182, 212, .12);  color: #0891b2; }
.sum-day-metric.tone-violet  { background: rgba(139, 92, 246, .12); color: #7c3aed; }
.sum-day-metric.tone-emerald { background: rgba(16, 185, 129, .12); color: #059669; }
.sum-day-metric.tone-gold    { background: rgba(245, 158, 11, .14); color: #b45309; }
[data-theme="dark"] .sum-day-metric.tone-brand,
[data-theme="dim"]   .sum-day-metric.tone-brand   { color: #a5b4fc; }
[data-theme="dark"] .sum-day-metric.tone-cyan,
[data-theme="dim"]   .sum-day-metric.tone-cyan    { color: #67e8f9; }
[data-theme="dark"] .sum-day-metric.tone-violet,
[data-theme="dim"]   .sum-day-metric.tone-violet  { color: #c4b5fd; }
[data-theme="dark"] .sum-day-metric.tone-emerald,
[data-theme="dim"]   .sum-day-metric.tone-emerald { color: #34d399; }
[data-theme="dark"] .sum-day-metric.tone-gold,
[data-theme="dim"]   .sum-day-metric.tone-gold    { color: #fbbf24; }

.sum-day-chev {
  color: var(--text-tertiary);
  font-size: 12px;
  transition: transform .22s var(--ease);
  flex-shrink: 0;
}
.sum-day[open] .sum-day-chev { transform: rotate(180deg); color: var(--brand-500); }

.sum-day-body {
  padding: 12px 14px 14px;
  border-top: 1px dashed var(--border-subtle);
  background: var(--bg-surface);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.sum-day-section { min-width: 0; }
.sum-day-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--text-tertiary);
  margin-bottom: 8px;
}
.sum-day-label i { color: var(--brand-500); font-size: 11px; }

.sum-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.sum-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  line-height: 1.4;
  max-width: 100%;
  transition: border-color .15s var(--ease), background .15s var(--ease);
}
.sum-chip:hover { border-color: var(--brand-400); }
.sum-chip i { color: var(--brand-500); font-size: 10px; flex-shrink: 0; }
.sum-chip em {
  font-style: normal;
  font-weight: 800;
  color: var(--brand-600);
  font-variant-numeric: tabular-nums;
  padding-left: 2px;
  flex-shrink: 0;
}
[data-theme="dark"] .sum-chip em,
[data-theme="dim"]   .sum-chip em { color: var(--brand-300); }
.sum-chip.small { font-size: 11px; padding: 4px 9px; }
.sum-chip.muted {
  color: var(--text-tertiary);
  font-style: italic;
  background: transparent;
  border-style: dashed;
}
.sum-chip.muted i { color: var(--text-tertiary); }
.sum-chip.more {
  background: rgba(99, 102, 241, .08);
  color: var(--brand-700);
  border-color: rgba(99, 102, 241, .25);
  font-weight: 700;
}
[data-theme="dark"] .sum-chip.more,
[data-theme="dim"]   .sum-chip.more {
  background: rgba(99, 102, 241, .18);
  color: var(--brand-300);
  border-color: rgba(99, 102, 241, .35);
}

/* ------------------------------------------------------------
   RESPONSIVE
   ------------------------------------------------------------ */
@media (max-width: 1100px) {
  .sum-grid { grid-template-columns: 1fr; }
}
@media (max-width: 800px) {
  .sum-shell {
    width: 94vw;
    height: 92vh;
    border-radius: var(--radius-lg);
  }
  .sum-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sum-header { padding: 16px 16px; gap: 12px; }
  .sum-avatar { width: 48px; height: 48px; min-width: 48px; font-size: 17px; }
  .sum-name { font-size: 16px; }
  .sum-body { padding: 16px 14px 20px; }
  .sum-day-summary { grid-template-columns: 1fr auto; gap: 8px; }
  .sum-day-metrics { grid-column: 1 / -1; justify-content: flex-start; }
}
@media (max-width: 480px) {
  .sum-shell { width: 100vw; height: 100vh; max-width: none; border-radius: 0; }
  .sum-stat { padding: 12px; gap: 10px; }
  .sum-stat-icon { width: 38px; height: 38px; min-width: 38px; font-size: 15px; }
  .sum-stat-num { font-size: 17px; }
  .sum-stat-lbl { font-size: 10px; }
  .sum-panel-head { padding: 12px 14px; }
  .sum-panel-head h3 { font-size: 13px; }
  .sum-course-list,
  .sum-timeline { padding: 8px; }
  .sum-day-metric { font-size: 10px; padding: 2px 7px; }
}

@media (prefers-reduced-motion: reduce) {
  .sum-overlay,
  .sum-shell,
  .sum-course-row,
  .sum-stat,
  .sum-day-chev,
  .sum-course-fill { transition: none !important; }
  .sum-overlay { opacity: 1; }
  .sum-shell { transform: none; }
}
/* ============================================================
   82. ADMIN — VISITOR ANALYTICS / TRAFFIC OVERVIEW
   ------------------------------------------------------------
   Fully self-contained: every class is prefixed .traffic-
   Nothing above this block is touched. Appended last so it
   wins the cascade safely.
   ============================================================ */

.traffic-wrap {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ---- Loading ---- */
.traffic-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 80px 20px;
  color: var(--text-tertiary);
  font-size: 13.5px;
}

/* ---- Live status pill (same visual language as Live Activity) ---- */
.traffic-live-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .3px;
  color: var(--text-tertiary);
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  white-space: nowrap;
  transition: color .2s var(--ease), background .2s var(--ease), border-color .2s var(--ease);
}
.traffic-live-pill.is-live {
  color: #059669;
  background: rgba(16, 185, 129, .10);
  border-color: rgba(16, 185, 129, .35);
}
[data-theme="dark"] .traffic-live-pill.is-live,
[data-theme="dim"]   .traffic-live-pill.is-live {
  color: #34d399;
  background: rgba(16, 185, 129, .18);
  border-color: rgba(16, 185, 129, .45);
}
.traffic-live-pill.is-live .live-pulse-dot {
  background: #10b981;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, .6);
  animation: livePulse 1.6s ease-in-out infinite;
}

/* ---- 4 stat tiles ---- */
.traffic-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}
.traffic-stat {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  transition: transform .22s var(--ease), box-shadow .22s var(--ease), border-color .22s var(--ease);
}
.traffic-stat:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--brand-300);
}
[data-theme="dark"] .traffic-stat:hover,
[data-theme="dim"]   .traffic-stat:hover { border-color: var(--brand-500); }

.traffic-stat-active {
  background: linear-gradient(135deg, rgba(16, 185, 129, .08), rgba(52, 211, 153, .02));
  border-color: rgba(16, 185, 129, .32);
}
[data-theme="dark"] .traffic-stat-active,
[data-theme="dim"]   .traffic-stat-active {
  background: linear-gradient(135deg, rgba(16, 185, 129, .16), rgba(52, 211, 153, .04));
  border-color: rgba(16, 185, 129, .42);
}

.traffic-stat-icon {
  width: 52px;
  height: 52px;
  min-width: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: #fff;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}
.traffic-stat-icon::before {
  content: "";
  position: absolute;
  top: -30%; left: -30%;
  width: 160%; height: 160%;
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, .3), transparent 55%);
  pointer-events: none;
}
.traffic-stat-icon.tone-brand   { background: linear-gradient(135deg, #818cf8, #4f46e5); box-shadow: 0 8px 20px rgba(99, 102, 241, .35); }
.traffic-stat-icon.tone-emerald { background: linear-gradient(135deg, #34d399, #059669); box-shadow: 0 8px 20px rgba(16, 185, 129, .4);  animation: liveSignalPulse 2s ease-in-out infinite; }
.traffic-stat-icon.tone-cyan    { background: linear-gradient(135deg, #22d3ee, #0891b2); box-shadow: 0 8px 20px rgba(6, 182, 212, .35); }
.traffic-stat-icon.tone-gold    { background: linear-gradient(135deg, #fbbf24, #d97706); color: #422006; box-shadow: 0 8px 20px rgba(245, 158, 11, .35); }

.traffic-stat-body { flex: 1; min-width: 0; }
.traffic-stat-num {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -.8px;
  color: var(--text-primary);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.traffic-stat-lbl {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--text-tertiary);
  margin-top: 6px;
}
.traffic-stat-hint {
  font-size: 10.5px;
  color: var(--text-tertiary);
  margin-top: 2px;
  opacity: .85;
}

/* ---- Two-panel grid ---- */
.traffic-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 16px;
}
@media (max-width: 900px) {
  .traffic-grid { grid-template-columns: 1fr; }
}

.traffic-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.traffic-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 18px 12px;
  border-bottom: 1px solid var(--border-subtle);
  background: linear-gradient(135deg, rgba(99, 102, 241, .04), rgba(6, 182, 212, .015));
}
[data-theme="dark"] .traffic-panel-head,
[data-theme="dim"]   .traffic-panel-head {
  background: linear-gradient(135deg, rgba(99, 102, 241, .10), rgba(6, 182, 212, .03));
}
.traffic-panel-head h3 {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 14.5px;
  font-weight: 800;
  letter-spacing: -.2px;
  color: var(--text-primary);
  margin: 0;
}
.traffic-panel-head h3 i { color: var(--brand-500); }
.traffic-panel-sub {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-tertiary);
}

/* ---- Bar chart ---- */
.traffic-chart {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 200px;
  padding: 20px 18px 12px;
  background:
    linear-gradient(180deg, rgba(99, 102, 241, .04), transparent 60%),
    var(--bg-surface);
}
.traffic-bar-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: flex-end;
  height: 100%;
  cursor: pointer;
  transition: transform .15s var(--ease);
}
.traffic-bar-wrap:hover { transform: translateY(-2px); }
.traffic-bar {
  width: 100%;
  border-radius: 4px 4px 0 0;
  background: linear-gradient(180deg, #6366f1, #06b6d4);
  transition: background .2s var(--ease), box-shadow .2s var(--ease);
  box-shadow: 0 0 8px rgba(99, 102, 241, .18);
}
.traffic-bar-wrap:hover .traffic-bar {
  background: linear-gradient(180deg, #818cf8, #67e8f9);
  box-shadow: 0 0 14px rgba(99, 102, 241, .4);
}
.traffic-chart-axis {
  display: flex;
  justify-content: space-between;
  padding: 0 18px 14px;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-tertiary);
  letter-spacing: .3px;
}
.traffic-empty-chart {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12.5px;
  color: var(--text-tertiary);
}

/* ---- Device breakdown ---- */
.traffic-devices {
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.traffic-device-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.traffic-device-icon {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: #fff;
  flex-shrink: 0;
}
.traffic-device-icon.tone-desktop { background: linear-gradient(135deg, #818cf8, #4f46e5); box-shadow: 0 5px 14px rgba(99, 102, 241, .3); }
.traffic-device-icon.tone-mobile  { background: linear-gradient(135deg, #34d399, #059669); box-shadow: 0 5px 14px rgba(16, 185, 129, .3); }
.traffic-device-icon.tone-tablet  { background: linear-gradient(135deg, #fbbf24, #d97706); color: #422006; box-shadow: 0 5px 14px rgba(245, 158, 11, .3); }

.traffic-device-info { flex: 1; min-width: 0; }
.traffic-device-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 6px;
}
.traffic-device-head strong {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}
.traffic-device-pct {
  font-size: 12px;
  font-weight: 800;
  color: var(--brand-600);
  font-variant-numeric: tabular-nums;
}
[data-theme="dark"] .traffic-device-pct,
[data-theme="dim"]   .traffic-device-pct { color: var(--brand-300); }
.traffic-device-bar {
  height: 7px;
  background: var(--bg-surface-3);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 5px;
}
.traffic-device-fill {
  height: 100%;
  border-radius: 999px;
  transition: width .5s cubic-bezier(.4, 0, .2, 1);
}
.traffic-device-fill.fill-desktop { background: linear-gradient(90deg, #818cf8, #4f46e5); }
.traffic-device-fill.fill-mobile  { background: linear-gradient(90deg, #34d399, #059669); }
.traffic-device-fill.fill-tablet  { background: linear-gradient(90deg, #fbbf24, #d97706); }

.traffic-device-count {
  font-size: 11.5px;
  color: var(--text-tertiary);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* ---- Recent days table ---- */
.traffic-table-wrap {
  overflow-x: auto;
  padding: 4px 0 4px;
}
.traffic-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.traffic-table thead th {
  text-align: left;
  padding: 10px 18px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .6px;
  text-transform: uppercase;
  color: var(--text-tertiary);
  background: var(--bg-surface-2);
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}
.traffic-table tbody td {
  padding: 10px 18px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.traffic-table tbody tr:last-child td { border-bottom: none; }
.traffic-table tbody tr:hover { background: var(--bg-surface-2); }
.traffic-table tbody td strong {
  color: var(--text-primary);
  font-weight: 700;
}

/* ---- Mobile tuning ---- */
@media (max-width: 640px) {
  .traffic-stat { padding: 14px 16px; }
  .traffic-stat-icon { width: 42px; height: 42px; min-width: 42px; font-size: 17px; border-radius: 11px; }
  .traffic-stat-num { font-size: 22px; }
  .traffic-chart { height: 150px; padding: 14px 12px 10px; }
  .traffic-table thead th,
  .traffic-table tbody td { padding: 8px 12px; font-size: 12px; }
}
/* ============================================================
   ⭐ THEME SWITCH — single animated sun ⇄ moon toggle (2026-10-04)
   Replaces the old icon cycle button + the header Settings gear.
   • 44×44 touch target, 56×30 visual track
   • Sun rays retract and a "bite" slides in to form the moon
   • Honours prefers-reduced-motion
   ============================================================ */
.theme-switch {
  --ts-w: 56px; --ts-h: 30px; --ts-knob: 24px; --ts-pad: 3px;
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 44px; min-height: 44px; padding: 0 2px;
  background: none; border: 0; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}
.theme-switch .ts-track {
  position: relative; display: block;
  width: var(--ts-w); height: var(--ts-h);
  border-radius: 999px;
  background: linear-gradient(135deg, #7dd3fc 0%, #38bdf8 100%);
  border: 1px solid rgba(255,255,255,.35);
  box-shadow: inset 0 1px 3px rgba(0,0,0,.18);
  transition: background .35s ease, border-color .35s ease;
  overflow: hidden;
}
/* tiny stars, only visible in dark */
.theme-switch .ts-track::before,
.theme-switch .ts-track::after {
  content: ''; position: absolute; border-radius: 50%; background: #fff;
  opacity: 0; transition: opacity .35s ease, transform .45s ease;
  transform: translateY(4px);
}
.theme-switch .ts-track::before { width: 2px; height: 2px; top: 8px;  left: 11px; box-shadow: 7px 9px 0 0 #fff, 14px 2px 0 0 rgba(255,255,255,.7); }
.theme-switch .ts-track::after  { width: 3px; height: 3px; top: 17px; left: 8px; }
.theme-switch .ts-knob {
  position: absolute; top: calc((var(--ts-h) - var(--ts-knob)) / 2 - 1px); left: var(--ts-pad);
  width: var(--ts-knob); height: var(--ts-knob); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: #fffbeb; color: #f59e0b;
  box-shadow: 0 2px 6px rgba(0,0,0,.25);
  transition: transform .45s cubic-bezier(.34,1.56,.64,1), background .35s ease, color .35s ease;
}
.theme-switch .ts-icon { width: 18px; height: 18px; overflow: visible; }
.theme-switch .ts-core {
  transform-box: fill-box; transform-origin: center;
  transform: scale(.55);
  transition: transform .45s cubic-bezier(.34,1.56,.64,1);
}
.theme-switch .ts-bite {
  transform: translate(9px, -9px);           /* parked outside → full sun */
  transition: transform .45s cubic-bezier(.34,1.56,.64,1);
}
.theme-switch .ts-rays {
  transform-box: view-box; transform-origin: 12px 12px;
  transition: transform .45s ease, opacity .3s ease;
}

/* ---- dark state (aria-checked=true) ---- */
.theme-switch[aria-checked="true"] .ts-track {
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
  border-color: rgba(165,180,252,.35);
}
.theme-switch[aria-checked="true"] .ts-track::before,
.theme-switch[aria-checked="true"] .ts-track::after { opacity: .9; transform: none; }
.theme-switch[aria-checked="true"] .ts-knob {
  transform: translateX(calc(var(--ts-w) - var(--ts-knob) - var(--ts-pad) * 2 - 2px));
  background: #334155; color: #e2e8f0;
}
.theme-switch[aria-checked="true"] .ts-core { transform: scale(1); }
.theme-switch[aria-checked="true"] .ts-bite { transform: translate(0, 0); }
.theme-switch[aria-checked="true"] .ts-rays { transform: rotate(90deg) scale(.4); opacity: 0; }

.theme-switch:hover .ts-knob { box-shadow: 0 2px 10px rgba(0,0,0,.3), 0 0 0 4px rgba(255,255,255,.12); }
.theme-switch:focus-visible { outline: none; }
.theme-switch:focus-visible .ts-track { box-shadow: 0 0 0 3px rgba(129,140,248,.75); }
.theme-switch:active .ts-knob { width: calc(var(--ts-knob) + 4px); border-radius: 999px; }

@media (prefers-reduced-motion: reduce) {
  .theme-switch .ts-knob, .theme-switch .ts-core, .theme-switch .ts-bite,
  .theme-switch .ts-rays, .theme-switch .ts-track { transition: none !important; }
}
@media (max-width: 380px) {
  .theme-switch { --ts-w: 48px; --ts-h: 26px; --ts-knob: 20px; }
  .theme-switch .ts-icon { width: 15px; height: 15px; }
}

/* Logged-out top bar: brand + switch must stay on ONE row on phones */
body.aero-logged-out #appHeader { flex-wrap: nowrap !important; }
body.aero-logged-out #appHeader .user-info {
  width: auto !important; flex: 0 0 auto; border-top: 0 !important;
  padding: 0 !important; margin: 0 0 0 auto !important; order: 0 !important;
}
.settings-row--stacked { padding-bottom: 4px; }
/* Dark/Dim: active login role tab had brand-600 on a near-black chip (≈2.9:1) */
[data-theme="dark"] .login-role-toggle button.active,
[data-theme="dim"]  .login-role-toggle button.active { color: var(--brand-200, #c7d2fe); }

/* ============================================================
   ⭐ COURSE NAVIGATION + WATCH PROGRESS (2026-10-04)
   ============================================================ */
.cd-topbar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.cd-topbar .back-link { margin-bottom: 0; }
.breadcrumb { min-width: 0; flex: 1 1 auto; }
.breadcrumb ol { list-style: none; display: flex; align-items: center; flex-wrap: wrap; gap: 4px; margin: 0; padding: 0; font-size: 13px; }
.breadcrumb li { display: inline-flex; align-items: center; min-width: 0; color: var(--text-tertiary); }
.breadcrumb li + li::before { content: '›'; margin: 0 6px 0 2px; color: var(--text-tertiary); opacity: .7; }
.breadcrumb a { color: var(--text-secondary); text-decoration: none; padding: 4px 2px; border-radius: 4px; }
.breadcrumb a:hover { color: var(--brand-600); text-decoration: underline; }
.breadcrumb a:focus-visible { outline: 2px solid var(--brand-400); outline-offset: 2px; }
.breadcrumb [aria-current="page"] span { color: var(--text-primary); font-weight: 600; max-width: 46ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; vertical-align: bottom; }
[data-theme="dark"] .breadcrumb a:hover, [data-theme="dim"] .breadcrumb a:hover { color: var(--brand-200); }

.cd-progress { margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--border-default); }
.cd-progress-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 13px; margin-bottom: 8px; }
.cd-progress-label { color: var(--text-secondary); font-weight: 600; }
.cd-progress-label i { color: var(--brand-500); margin-right: 4px; }
.cd-progress-num { font-variant-numeric: tabular-nums; color: var(--text-primary); font-weight: 700; }
.cd-progress-bar { height: 8px; border-radius: 999px; background: var(--bg-surface-3); overflow: hidden; }
.cd-progress-bar > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--brand-500), #06b6d4); transition: width .6s cubic-bezier(.22,1,.36,1); }
.cd-upnext {
  margin-top: 12px; width: 100%; display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto;
  column-gap: 12px; align-items: center; text-align: left;
  padding: 12px 14px; border-radius: 12px; cursor: pointer;
  background: var(--bg-surface); border: 1px solid var(--brand-200); color: var(--text-primary);
  transition: border-color .2s, box-shadow .2s, transform .2s;
}
.cd-upnext:hover { border-color: var(--brand-400); box-shadow: 0 6px 18px rgba(79,70,229,.14); transform: translateY(-1px); }
.cd-upnext:focus-visible { outline: 3px solid var(--brand-300, #a5b4fc); outline-offset: 2px; }
.cd-upnext-kicker { grid-column: 1; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; color: var(--brand-600); }
.cd-upnext-title { grid-column: 1; font-weight: 600; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cd-upnext > i { grid-column: 2; grid-row: 1 / span 2; color: var(--brand-500); }
[data-theme="dark"] .cd-upnext, [data-theme="dim"] .cd-upnext { border-color: rgba(129,140,248,.35); }
[data-theme="dark"] .cd-upnext-kicker, [data-theme="dim"] .cd-upnext-kicker { color: var(--brand-200); }
.cd-progress-done { margin-top: 10px; font-weight: 600; color: #059669; font-size: 13.5px; }

.vprog { margin: 6px 0 10px; }
.vprog-bar { height: 5px; border-radius: 999px; background: var(--bg-surface-3); overflow: hidden; }
.vprog-bar > span { display: block; height: 100%; border-radius: inherit; background: var(--brand-500); transition: width .5s ease; }
.vprog.done .vprog-bar > span { background: #10b981; }
.vprog-label { margin-top: 5px; font-size: 12px; color: var(--text-tertiary); font-variant-numeric: tabular-nums; }
.vprog.done .vprog-label { color: #059669; font-weight: 600; }
.vprog.playlist { margin: 4px 0 14px; }
.playlist-card-preview li.watched { color: var(--text-tertiary); }
.playlist-card-preview li.watched i { color: #10b981; }

.vp-playlist-item .vp-pl-progress { display: block; height: 3px; margin-top: 6px; border-radius: 999px; background: rgba(255,255,255,.15); overflow: hidden; }
.vp-playlist-item .vp-pl-progress > span { display: block; height: 100%; background: #818cf8; }
.vp-playlist-item.watched .vp-pl-progress > span { background: #34d399; }
.vp-playlist-item.watched .vp-playlist-item-num { color: #34d399; }

@media (max-width: 640px) {
  .cd-topbar { gap: 8px; }
  .breadcrumb [aria-current="page"] span { max-width: 22ch; }
}
[data-theme="dark"] .back-link, [data-theme="dim"] .back-link { color: var(--brand-200); }
[data-theme="dark"] .back-link:hover, [data-theme="dim"] .back-link:hover { color: #fff; background: rgba(129,140,248,.16); }

/* ============================================================
   ⭐ ADMIN — STUDENT MANAGEMENT (2026-10-04)
   ============================================================ */
.student-status-badge { display: inline-flex; align-items: center; gap: 6px; margin-left: 6px; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; }
.student-status-badge.suspended { background: rgba(244,63,94,.12); color: #be123c; }
.student-status-badge.online { background: rgba(16,185,129,.12); color: #047857; }
.student-status-badge .dot { width: 7px; height: 7px; border-radius: 50%; background: #10b981; box-shadow: 0 0 0 3px rgba(16,185,129,.2); }
[data-theme="dark"] .student-status-badge.suspended, [data-theme="dim"] .student-status-badge.suspended { color: #fda4af; }
[data-theme="dark"] .student-status-badge.online, [data-theme="dim"] .student-status-badge.online { color: #6ee7b7; }
.student-card.is-suspended { opacity: .78; }
.student-card.is-suspended .student-avatar { filter: grayscale(.8); }
.student-lastseen { font-size: 12px; color: var(--text-tertiary); }
.bulk-actions { display: inline-flex; flex-wrap: wrap; gap: 6px; }

.manage-student-box { max-width: 560px; width: calc(100% - 32px); max-height: min(88vh, 820px); overflow-y: auto; }
.ms-head { display: flex; align-items: center; gap: 12px; }
.ms-head-text { flex: 1 1 auto; min-width: 0; }
.ms-head h3 { margin: 0; font-size: 18px; }
.ms-sub { color: var(--text-tertiary); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ms-close { color: var(--text-secondary); background: var(--bg-surface-3); border-color: var(--border-default); }
.ms-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 16px 0 6px; }
.ms-stats > div { background: var(--bg-surface-2); border: 1px solid var(--border-subtle); border-radius: 10px; padding: 10px; text-align: center; }
.ms-stats strong { display: block; font-size: 15px; font-variant-numeric: tabular-nums; }
.ms-stats span { font-size: 11px; color: var(--text-tertiary); }
.ms-section { margin-top: 18px; }
.ms-section h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-secondary); margin: 0 0 10px; }
.ms-section h4 i { color: var(--brand-500); margin-right: 6px; }
.ms-muted { color: var(--text-tertiary); font-size: 13px; margin: 4px 0; }
.ms-alert { background: rgba(244,63,94,.1); color: #be123c; border-radius: 10px; padding: 10px 12px; font-size: 13.5px; font-weight: 600; margin-bottom: 8px; }
[data-theme="dark"] .ms-alert, [data-theme="dim"] .ms-alert { color: #fda4af; }
.ms-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.ms-course-list, .ms-progress-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ms-course-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 10px; border: 1px solid var(--border-subtle); border-radius: 10px; }
.ms-course-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.ms-course-name em { font-style: normal; color: var(--text-tertiary); font-size: 12px; margin-left: 4px; }
.ms-progress-top { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; margin-bottom: 6px; }
.ms-progress-top span:last-child { font-variant-numeric: tabular-nums; font-weight: 600; }
@media (max-width: 520px) {
  .ms-stats { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   ⭐ CERTIFICATE DESIGNER v2 (2026-10-04)
   ============================================================ */
.cd-header {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap;
  padding: 20px 22px; border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(99,102,241,.07), rgba(6,182,212,.04));
  border: 1px solid rgba(99,102,241,.22);
}
.cd-header h2 { font-size: 20px; margin: 0 0 4px; display: flex; align-items: center; gap: 10px; }
.cd-header h2 i { color: var(--brand-500); }
.cd-header p { margin: 0; color: var(--text-secondary); font-size: 13.5px; max-width: 62ch; }
.cd-header-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cd-dirty { font-size: 12.5px; font-weight: 600; color: #b45309; display: inline-flex; align-items: center; gap: 6px; }
.cd-dirty i { font-size: 7px; }
[data-theme="dark"] .cd-dirty, [data-theme="dim"] .cd-dirty { color: #fbbf24; }

.cd-layout { display: grid; grid-template-columns: minmax(340px, 0.9fr) minmax(0, 1.25fr); gap: 20px; margin-top: 18px; align-items: start; }
@media (max-width: 1100px) { .cd-layout { grid-template-columns: 1fr; } .cd-preview-col { order: -1; } }
.cd-controls { display: flex; flex-direction: column; gap: 10px; min-width: 0; }

.cd-panel {
  background: var(--bg-surface); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-xs); overflow: hidden;
}
.cd-panel > summary {
  list-style: none; cursor: pointer; padding: 14px 18px; display: flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 14.5px; color: var(--text-primary); flex-wrap: wrap;
}
.cd-panel > summary::-webkit-details-marker { display: none; }
.cd-panel > summary::after { content: '\f078'; font-family: 'Font Awesome 6 Free'; font-weight: 900; font-size: 11px; margin-left: auto; color: var(--text-tertiary); transition: transform .2s; }
.cd-panel[open] > summary::after { transform: rotate(180deg); }
.cd-panel > summary small { font-weight: 500; font-size: 12px; color: var(--text-tertiary); flex-basis: 100%; padding-left: 34px; margin-top: -2px; }
.cd-panel > summary:focus-visible { outline: 2px solid var(--brand-400); outline-offset: -2px; }
.cd-panel[open] > summary { border-bottom: 1px solid var(--border-subtle); }
.cd-panel > :not(summary) { margin-left: 18px; margin-right: 18px; }
.cd-panel > :last-child { margin-bottom: 18px; }
.cd-panel > summary + * { margin-top: 14px; }
.cd-step {
  width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--brand-500), #06b6d4); flex-shrink: 0;
}

.cd-presets { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
.cd-preset {
  background: none; border: 2px solid transparent; border-radius: 12px; padding: 6px; cursor: pointer;
  display: flex; flex-direction: column; gap: 6px; align-items: stretch; transition: border-color .15s, transform .15s;
}
.cd-preset:hover { transform: translateY(-1px); border-color: var(--border-default); }
.cd-preset.on { border-color: var(--brand-500); box-shadow: 0 0 0 3px rgba(99,102,241,.15); }
.cd-preset:focus-visible { outline: 2px solid var(--brand-400); outline-offset: 2px; }
.cd-preset-swatch {
  position: relative; display: block; aspect-ratio: 1.414 / 1; border-radius: 6px; border: 2px solid; overflow: hidden;
}
.cd-preset-swatch span { position: absolute; left: 8px; top: 8px; width: 18px; height: 18px; border-radius: 5px; }
.cd-preset-swatch em { position: absolute; right: 8px; bottom: 4px; font: italic 700 18px 'Playfair Display', Georgia, serif; }
.cd-preset-name { font-size: 12px; font-weight: 600; color: var(--text-secondary); text-align: center; }

.cd-label { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-secondary); margin: 12px 0 6px; }
.cd-seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: var(--bg-surface-3); border-radius: 10px; }
.cd-seg button {
  border: 0; background: transparent; padding: 7px 12px; border-radius: 7px; cursor: pointer;
  font-size: 13px; font-weight: 600; color: var(--text-secondary); min-height: 34px;
}
.cd-seg button:hover { color: var(--text-primary); }
.cd-seg button.on { background: var(--bg-surface); color: var(--brand-600); box-shadow: var(--shadow-sm); }
[data-theme="dark"] .cd-seg button.on, [data-theme="dim"] .cd-seg button.on { color: var(--brand-200); }
.cd-seg button:focus-visible { outline: 2px solid var(--brand-400); outline-offset: 1px; }
.cd-row { display: flex; gap: 18px; flex-wrap: wrap; }

.cd-color-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-top: 12px; }
.cd-color label { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-secondary); margin-bottom: 5px; }
.cd-color-row { display: flex; align-items: center; gap: 6px; border: 1.5px solid var(--border-default); border-radius: 10px; padding: 4px; background: var(--bg-surface); }
.cd-color-row:focus-within { border-color: var(--brand-400); }
.cd-color input[type="color"] { width: 34px; height: 30px; border: 0; padding: 0; background: none; cursor: pointer; border-radius: 6px; flex-shrink: 0; }
.cd-color input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.cd-color input[type="color"]::-webkit-color-swatch { border: 1px solid rgba(0,0,0,.15); border-radius: 6px; }
.cd-hex { border: 0 !important; background: transparent !important; box-shadow: none !important; padding: 4px 2px !important; font: 600 13px 'SFMono-Regular', Menlo, monospace !important; text-transform: uppercase; width: 100%; min-width: 0; color: var(--text-primary); }
.cd-hex.bad { color: #e11d48; }
.cd-hint { display: block; font-size: 11.5px; color: var(--text-tertiary); margin-top: 4px; line-height: 1.45; }
.cd-contrast { margin-top: 12px; font-size: 12.5px; padding: 9px 12px; border-radius: 9px; background: rgba(16,185,129,.08); color: #047857; }
.cd-contrast.warn { background: rgba(245,158,11,.12); color: #92400e; }
[data-theme="dark"] .cd-contrast, [data-theme="dim"] .cd-contrast { color: #6ee7b7; }
[data-theme="dark"] .cd-contrast.warn, [data-theme="dim"] .cd-contrast.warn { color: #fcd34d; }

.cd-upload { display: flex; gap: 14px; align-items: center; margin-top: 12px; padding: 12px; border: 1.5px dashed var(--border-default); border-radius: 12px; background: var(--bg-surface-2); }
.cd-upload.has-file { border-style: solid; }
.cd-upload.busy { opacity: .6; pointer-events: none; }
.cd-upload-thumb {
  width: 64px; height: 64px; border-radius: 10px; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  background: repeating-conic-gradient(#e5e7eb 0% 25%, #fff 0% 50%) 50% / 12px 12px; color: var(--text-tertiary); font-size: 22px; overflow: hidden;
}
.cd-upload-thumb img { width: 100%; height: 100%; object-fit: contain; }
.cd-upload-body { min-width: 0; }
.cd-upload-body strong { font-size: 13.5px; }
.cd-upload-actions { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.cd-upload-actions label.btn { cursor: pointer; margin: 0; }
.cd-emoji-input { font-size: 22px !important; text-align: center; }

.cd-toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border-subtle); cursor: default; }
.cd-toggle:last-of-type { border-bottom: 0; }
.cd-toggle > span { font-size: 13.5px; font-weight: 500; color: var(--text-primary); }
.cd-toggle > span i { width: 22px; color: var(--brand-500); }
.cd-reset { display: flex; justify-content: flex-end; }

.cd-preview-col { position: sticky; top: 84px; min-width: 0; }
@media (max-width: 1100px) { .cd-preview-col { position: static; } }
.cd-preview-card { background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); padding: 14px; box-shadow: var(--shadow-sm); }
.cd-preview-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; font-weight: 700; font-size: 14px; }
.cd-preview-bar small { font-weight: 500; color: var(--text-tertiary); }
.cd-preview-bar i { color: var(--brand-500); margin-right: 4px; }
.cd-preview-box { position: relative; width: 100%; overflow: hidden; border-radius: 8px; background: repeating-conic-gradient(var(--bg-surface-3) 0% 25%, var(--bg-surface-2) 0% 50%) 50% / 18px 18px; box-shadow: inset 0 0 0 1px var(--border-subtle); }
.cd-preview-box iframe { position: absolute; top: 0; left: 0; border: 0; transform-origin: 0 0; background: transparent; pointer-events: none; box-shadow: 0 10px 30px rgba(15,23,42,.18); }
@media (max-width: 640px) {
  .cd-header-actions { width: 100%; }
  .cd-header-actions .btn { flex: 1 1 auto; }
  .cd-panel > :not(summary) { margin-left: 12px; margin-right: 12px; }
}
.cd-dirty[hidden] { display: none !important; }
.cd-preview-box iframe { max-width: none !important; max-height: none !important; }
.cd-panel > summary small { margin-top: -4px; }
.cd-panel > summary::after { order: 1; }
.cd-panel > summary small { order: 2; }

/* ============================================================
   ⭐ PDF VIEWER — PRESENT button + slideshow (2026-10-04)
   ============================================================ */
.pdfv-present-btn { width: auto !important; padding: 0 12px !important; gap: 6px; display: inline-flex !important; align-items: center; font-weight: 600; font-size: 13px; }
.pdfv-present-btn span { font-size: 13px; }
.pdfv-slides-mode .pdfv-present-btn { background: linear-gradient(135deg, #6366f1, #06b6d4) !important; color: #fff !important; border-color: transparent !important; }
@media (max-width: 640px) { .pdfv-present-btn span { display: none; } .pdfv-present-btn { padding: 0 10px !important; } }

.pdfv-present {
  position: fixed; inset: 0; z-index: 2147483000; background: #000;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .2s ease; cursor: none; user-select: none; -webkit-user-select: none;
}
.pdfv-present.active { opacity: 1; }
.pdfv-present.show-ui { cursor: default; }
.pdfv-present-stage { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; }
.pdfv-present-stage canvas { display: block; box-shadow: 0 0 60px rgba(0,0,0,.6); pointer-events: none; }
.pdfv-present-wm { position: absolute; inset: 0; pointer-events: none; background-repeat: repeat; }
.pdfv-present-bar {
  position: absolute; left: 50%; bottom: 22px; transform: translate(-50%, 12px);
  display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 999px;
  background: rgba(17,24,39,.82); backdrop-filter: blur(8px); color: #fff;
  opacity: 0; transition: opacity .2s ease, transform .2s ease; pointer-events: none;
}
.pdfv-present.show-ui .pdfv-present-bar { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.pdfv-present-bar button {
  min-width: 40px; height: 40px; border: 0; border-radius: 999px; background: transparent; color: #fff; cursor: pointer;
  font: 600 13px Inter, sans-serif; padding: 0 12px; display: inline-flex; align-items: center; gap: 6px;
}
.pdfv-present-bar button:hover:not(:disabled) { background: rgba(255,255,255,.14); }
.pdfv-present-bar button:disabled { opacity: .35; cursor: default; }
.pdfv-present-bar button:focus-visible { outline: 2px solid #a5b4fc; }
.pdfv-present-count { min-width: 64px; text-align: center; font: 600 14px Inter, sans-serif; font-variant-numeric: tabular-nums; }
.pdfv-present-sep { width: 1px; height: 22px; background: rgba(255,255,255,.2); margin: 0 4px; }
.pdfv-present-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255,255,255,.08); }
.pdfv-present-progress span { display: block; height: 100%; background: linear-gradient(90deg, #6366f1, #06b6d4); transition: width .25s ease; }

/* ⭐ "Preparing slides…" overlay while the server renders an office file */
.render-overlay { position: fixed; inset: 0; z-index: 9000; display: flex; align-items: center; justify-content: center; background: rgba(10,14,31,.55); backdrop-filter: blur(4px); opacity: 0; transition: opacity .2s; }
.render-overlay.active { opacity: 1; }
.render-card { width: min(360px, calc(100% - 32px)); background: var(--bg-surface); border-radius: 18px; padding: 26px 24px; text-align: center; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; gap: 8px; align-items: center; }
.render-icon { width: 58px; height: 58px; border-radius: 16px; display: flex; align-items: center; justify-content: center; font-size: 24px; color: #fff; background: linear-gradient(135deg, #f97316, #ef4444); margin-bottom: 4px; }
.render-card strong { font-size: 16px; color: var(--text-primary); }
.render-card span { font-size: 13.5px; color: var(--text-secondary); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.render-card small { font-size: 12px; color: var(--text-tertiary); line-height: 1.45; }
.render-card .render-cancel { margin-top: 6px; min-width: 110px; }
.render-bar { width: 100%; height: 5px; border-radius: 999px; background: var(--bg-surface-3); overflow: hidden; margin: 6px 0 2px; }
.render-bar i { display: block; width: 40%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--brand-500), #06b6d4); animation: renderSlide 1.1s ease-in-out infinite; }
@keyframes renderSlide { from { transform: translateX(-110%); } to { transform: translateX(260%); } }
@media (prefers-reduced-motion: reduce) { .render-bar i { animation: none; width: 100%; } }
.student-status-badge.capture { background: rgba(245,158,11,.14); color: #b45309; }
[data-theme="dark"] .student-status-badge.capture, [data-theme="dim"] .student-status-badge.capture { color: #fcd34d; }
.ms-alert--warn { background: rgba(245,158,11,.12) !important; color: #92400e !important; margin-top: 10px; }
[data-theme="dark"] .ms-alert--warn, [data-theme="dim"] .ms-alert--warn { color: #fcd34d !important; }
.ms-capture-log { margin: 6px 0 0 18px; padding: 0; font-weight: 500; font-size: 12.5px; }

/* ============================================================
   2026-10-04 — NO VISIBLE WATERMARKS ANYWHERE (owner's decision).
   Hard override in case any older cached script still injects one.
   ============================================================ */
#aeroShieldWm, .pdfv-watermark, .vp-watermark, .docv-watermark, .pdfv-present-wm {
  display: none !important; background-image: none !important; opacity: 0 !important;
}

/* ⭐ Admin — access log views (2026-10-04) */
.ms-open-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ms-open-list li { display: grid; grid-template-columns: 20px 1fr auto; gap: 8px; align-items: center; font-size: 13px; padding: 6px 8px; border-radius: 8px; background: var(--bg-surface-2); }
.ms-open-list i { color: var(--brand-500); }
.ms-open-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ms-open-title em { color: var(--text-tertiary); font-style: normal; font-size: 12px; }
.ms-open-when { color: var(--text-tertiary); font-size: 12px; white-space: nowrap; }
.ms-viewers { margin-top: 12px; border: 1px solid var(--border-subtle); border-radius: 12px; overflow: hidden; max-height: 60vh; overflow-y: auto; }
.ms-viewers-row { display: grid; grid-template-columns: minmax(0, 2.2fr) 0.6fr 1fr 1fr; gap: 10px; padding: 9px 12px; font-size: 13px; align-items: center; border-top: 1px solid var(--border-subtle); }
.ms-viewers-row:first-child { border-top: 0; }
.ms-viewers-head { background: var(--bg-surface-2); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-tertiary); position: sticky; top: 0; }
.ms-viewers-row em { color: var(--text-tertiary); font-style: normal; font-size: 12px; }
.ms-viewers-row > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ms-ip { font-family: 'SFMono-Regular', Menlo, monospace; font-size: 12px; color: var(--text-secondary); }
.ms-chip { display: inline-block; font-size: 10.5px; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: var(--bg-surface-3); color: var(--text-secondary); }
@media (max-width: 560px) {
  .ms-viewers-row { grid-template-columns: minmax(0, 1fr) auto; }
  .ms-viewers-row > span:nth-child(4), .ms-viewers-head > span:nth-child(4) { display: none; }
  .ms-viewers-row > span:nth-child(2) { display: none; }
}

/* ============================================================
   ⭐ MOBILE / TABLET HEADER + HAMBURGER  (2026-10-04b)
   ------------------------------------------------------------
   ≤ 860px only — desktop is untouched.
   • Row 1: brand on the left, ☰ pinned to the top-RIGHT corner.
   • Row 2: search / bell / theme / streak / avatar (unchanged).
   • The menu is a floating panel under the header: it fades and
     slides in (opacity + transform only — no layout reflow, no
     page jump) and closes on choice / outside tap / Esc.
   • The ☰ is drawn with CSS bars (morphs to ✕), so it is always
     centred and never shows an empty box while icon fonts load.
   ============================================================ */
.nav-toggle-bars { position: relative; display: block; width: 20px; height: 14px; pointer-events: none; }
.nav-toggle-bars > span {
  position: absolute; left: 0; width: 100%; height: 2px; border-radius: 2px;
  background: currentColor;
  transition: transform .25s cubic-bezier(.4,0,.2,1), opacity .2s ease, top .25s cubic-bezier(.4,0,.2,1);
}
.nav-toggle-bars > span:nth-child(1) { top: 0; }
.nav-toggle-bars > span:nth-child(2) { top: 6px; }
.nav-toggle-bars > span:nth-child(3) { top: 12px; }
.nav-toggle.is-open .nav-toggle-bars > span:nth-child(1) { top: 6px; transform: rotate(45deg); }
.nav-toggle.is-open .nav-toggle-bars > span:nth-child(2) { opacity: 0; transform: scaleX(.3); }
.nav-toggle.is-open .nav-toggle-bars > span:nth-child(3) { top: 6px; transform: rotate(-45deg); }

@media (max-width: 860px) {
  /* Row 1 — brand left, toggle hard right */
  #appHeader .brand { flex: 1 1 auto !important; min-width: 0; }   /* order stays 0 → always first */
  #appHeader .brand-text { min-width: 0; }
  #appHeader .brand-text h1,
  #appHeader .brand-text span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #appHeader #navToggle {
    order: 2;
    margin: 0 0 0 auto;
    flex: 0 0 44px;
    width: 44px; height: 44px; min-width: 44px; min-height: 44px;
    padding: 0;
    align-items: center; justify-content: center;
    border-radius: 12px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }
  #appHeader #navToggle:focus-visible { outline: 2px solid var(--accent-400, #22d3ee); outline-offset: 2px; }
  #appHeader #navToggle.is-open { background: rgba(255,255,255,.18); border-color: rgba(255,255,255,.3); }

  /* Row 2 — the icon cluster */
  #appHeader .user-info { order: 3; }

  /* The menu panel */
  #appHeader #mainNav {
    position: absolute !important;
    top: 100%; left: 0; right: 0;
    z-index: 190;
    order: 4;
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    justify-content: flex-start !important;
    align-items: stretch !important;
    gap: 6px !important;
    margin: 0 !important;
    padding: 12px 14px 16px !important;
    max-height: min(72vh, 520px) !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    background: #0d1124;
    border-bottom: 1px solid var(--header-border);
    border-radius: 0 0 18px 18px;
    box-shadow: 0 18px 40px rgba(2,6,23,.45);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    pointer-events: none;
    transition: opacity .22s ease, transform .22s cubic-bezier(.4,0,.2,1), visibility 0s linear .22s;
    will-change: opacity, transform;
  }
  [data-theme="dark"] #appHeader #mainNav { background: #12141a; }
  [data-theme="dim"]  #appHeader #mainNav { background: #191924; }
  #appHeader #mainNav.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
    transition: opacity .22s ease, transform .22s cubic-bezier(.4,0,.2,1), visibility 0s;
  }
  #appHeader #mainNav a {
    width: 100%;
    flex: 0 0 auto !important;
    justify-content: flex-start;
    padding: 12px 16px !important;
    min-height: 46px;
    font-size: 15px !important;
    border-radius: 12px;
    margin: 0 !important;
    background: rgba(255,255,255,.06);
  }
  #appHeader #mainNav a:hover { background: rgba(255,255,255,.12); }
  #appHeader #mainNav a.active {
    background: linear-gradient(135deg, var(--brand-500), var(--brand-600));
  }
  #appHeader #mainNav a i { width: 20px; text-align: center; }
  #appHeader #mainNav a.nav-ai-btn { margin-left: 0 !important; }
}
@media (max-width: 860px) and (prefers-reduced-motion: reduce) {
  #appHeader #mainNav, #appHeader #mainNav.open, .nav-toggle-bars > span { transition: none !important; }
}

/* ============================================================
   ⭐ STUDENT REVIEWS — uniform cards + "Read more" (2026-10-04c)
   ============================================================ */
/* Cards in a row keep equal heights (grid stretch) so the wall looks uniform. */
.feedback-card { min-height: 200px; }
.feedback-card-text { flex: 1; display: flex; flex-direction: column; align-items: flex-start; min-width: 0; width: 100%; margin-bottom: 10px; }
.feedback-card-body.fb-collapsible {
  flex: 0 0 auto;
  width: 100%;
  margin: 0;
  max-height: calc(1.6em * 6);                               /* ≈ 6 lines */
  overflow: hidden;
  overflow-wrap: anywhere;
  transition: max-height .36s cubic-bezier(.4,0,.2,1);
}
.feedback-card-body.fb-collapsible.is-truncated {
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 2.4em), transparent);
          mask-image: linear-gradient(to bottom, #000 calc(100% - 2.4em), transparent);
}
.feedback-readmore {
  display: inline-flex; align-items: center; gap: 6px;
  margin: 4px 0 0; padding: 4px 0;
  background: none; border: 0; cursor: pointer;
  font: inherit; font-size: 13px; font-weight: 700;
  color: var(--brand-600);
  min-height: 32px;
}
.feedback-readmore[hidden] { display: none !important; }
.feedback-readmore:hover span { text-decoration: underline; }
.feedback-readmore:focus-visible { outline: 2px solid var(--brand-500); outline-offset: 2px; border-radius: 4px; }
.feedback-readmore i { font-size: 11px; transition: transform .3s ease; }
.feedback-card.is-expanded .feedback-readmore i { transform: rotate(180deg); }
[data-theme="dark"] .feedback-readmore,
[data-theme="dim"]  .feedback-readmore { color: var(--brand-300, #a5b4fc); }
@media (prefers-reduced-motion: reduce) {
  .feedback-card-body.fb-collapsible, .feedback-readmore i { transition: none !important; }
}

/* ============================================================
   ⭐ AI DOUBT SOLVER v2 — attachments, tools, streaming (2026-10-04)
   ============================================================ */
.ai-chat-shell { position: relative; }
.ai-chat-composer { display: flex; flex-direction: column; gap: 10px; }
.ai-chat-composer .ai-composer-row { margin-top: 0; }
.ai-composer-hint { display: flex; align-items: center; gap: 6px; }

/* attachment tray */
.ai-attach-tray { display: flex; flex-wrap: wrap; gap: 8px; }
.ai-attach-tray[hidden] { display: none; }
.ai-att-chip {
  display: inline-flex; align-items: center; gap: 10px;
  max-width: 260px; padding: 6px 6px 6px 6px;
  border: 1px solid var(--border-default); border-radius: 12px;
  background: var(--bg-surface-2);
  animation: aiChipIn .18s ease;
}
.ai-att-chip.is-error { border-color: var(--rose-400, #fb7185); background: rgba(239,68,68,.06); }
@keyframes aiChipIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.ai-att-thumb, .ai-att-icon {
  width: 42px; height: 42px; border-radius: 9px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center; overflow: hidden;
  border: 0; padding: 0; background: var(--bg-surface-3); cursor: pointer;
}
.ai-att-icon { cursor: default; color: var(--brand-600); font-size: 18px; }
.ai-att-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ai-att-meta { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.ai-att-name { font-size: 12.5px; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
.ai-att-size { font-size: 11px; color: var(--text-tertiary); }
.ai-att-err { color: var(--rose-500, #ef4444); font-weight: 600; }
.ai-att-remove {
  width: 26px; height: 26px; border-radius: 50%; border: 0; flex-shrink: 0;
  background: transparent; color: var(--text-tertiary); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.ai-att-remove:hover { background: var(--bg-surface-3); color: var(--rose-500, #ef4444); }

/* tools row */
.ai-tools { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ai-tool-btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 36px; padding: 0 12px; border-radius: 10px;
  border: 1.5px solid var(--border-default); background: var(--bg-surface);
  color: var(--text-secondary); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer;
  transition: .15s var(--ease);
}
.ai-tool-btn[hidden] { display: none; }
.ai-tool-btn:hover, .ai-tool-btn.is-on { border-color: var(--brand-400); color: var(--brand-600); background: rgba(99,102,241,.06); }
.ai-tool-btn.is-recording { border-color: #ef4444; color: #ef4444; background: rgba(239,68,68,.08); }
.ai-tool-btn.is-recording i { animation: aiPulse 1s ease-in-out infinite; }
@keyframes aiPulse { 50% { opacity: .35; } }
.ai-tool-camera { display: none; }
@media (pointer: coarse) { .ai-tool-camera { display: inline-flex; } }
.ai-char-count { font-size: 11.5px; color: var(--text-tertiary); font-variant-numeric: tabular-nums; }
.ai-char-count.is-near { color: var(--rose-500, #ef4444); font-weight: 700; }
.ai-send-btn.is-stop { background: linear-gradient(135deg, #475569, #334155); box-shadow: none; }
.ai-send-btn.is-stop:hover:not(:disabled) { background: linear-gradient(135deg, #334155, #1e293b); }

/* maths palette + preview */
.ai-math-palette[hidden], .ai-math-preview[hidden] { display: none; }
.ai-math-palette { border: 1px solid var(--border-default); border-radius: 12px; padding: 8px 10px 10px; background: var(--bg-surface-2); }
.ai-math-palette-head { display: flex; align-items: center; justify-content: space-between; font-size: 12px; font-weight: 700; color: var(--text-secondary); margin-bottom: 6px; }
.ai-math-palette-head i { color: var(--brand-500); margin-right: 4px; }
.ai-math-close { border: 0; background: transparent; color: var(--text-tertiary); cursor: pointer; width: 28px; height: 28px; border-radius: 8px; }
.ai-math-close:hover { background: var(--bg-surface-3); }
.ai-math-keys { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 6px; max-height: 84px; overflow-y: auto; }
.ai-math-key {
  height: 36px; border-radius: 8px; border: 1px solid var(--border-subtle);
  background: var(--bg-surface); color: var(--text-primary); cursor: pointer;
  font: 600 14px/1 "Cambria Math", "Times New Roman", serif;
}
.ai-math-key:hover { border-color: var(--brand-400); color: var(--brand-600); }
.ai-math-preview {
  border: 1px dashed var(--border-default); border-radius: 10px; padding: 8px 12px;
  background: var(--bg-surface-2); max-height: 160px; overflow: auto; font-size: 14px; color: var(--text-primary);
}
.ai-math-preview-label { display: block; font-size: 10.5px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--text-tertiary); margin-bottom: 4px; }

/* drop overlay */
.ai-drop-overlay {
  position: absolute; inset: 0; z-index: 5; display: none;
  align-items: center; justify-content: center; text-align: center;
  background: rgba(99,102,241,.10); border: 2.5px dashed var(--brand-500); border-radius: inherit;
  backdrop-filter: blur(2px); pointer-events: none;
}
.ai-drop-overlay div { display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--brand-700, #4338ca); }
[data-theme="dark"] .ai-drop-overlay div, [data-theme="dim"] .ai-drop-overlay div { color: var(--brand-200, #c7d2fe); }
.ai-drop-overlay i { font-size: 34px; }
.ai-drop-overlay strong { font-size: 17px; }
.ai-drop-overlay span { font-size: 12.5px; opacity: .8; }
.ai-chat-shell.ai-dragging .ai-drop-overlay { display: flex; }

/* messages */
.ai-msg-files { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 6px; margin-bottom: 8px; }
.ai-msg-file {
  display: inline-flex; align-items: center; gap: 6px; max-width: 220px;
  padding: 5px 9px; border-radius: 9px; font-size: 12px; font-weight: 600;
  background: var(--bg-surface); border: 1px solid var(--border-subtle); color: var(--text-secondary);
}
.ai-msg-file span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ai-msg-file i { color: var(--brand-500); }
.ai-msg-file.is-image { padding: 0; width: 84px; height: 84px; overflow: hidden; cursor: zoom-in; }
.ai-msg-file.is-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ai-user-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.ai-msg-actions-user { border-top: 0; margin-top: 4px; padding-top: 0; justify-content: flex-end; }
.ai-msg-note { margin-top: 10px; font-size: 12px; color: var(--text-tertiary); display: flex; align-items: center; gap: 6px; }
.ai-stream-body { min-height: 22px; }
.ai-typing-inline { display: inline-flex; align-items: center; gap: 6px; padding: 4px 0; }
.ai-caret {
  display: inline-block; width: 8px; height: 1.05em; margin-left: 2px; vertical-align: text-bottom;
  background: var(--brand-500); border-radius: 2px; animation: aiCaret 1s steps(1) infinite;
}
@keyframes aiCaret { 50% { opacity: 0; } }
.ai-followups { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.ai-followup {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border-default); background: var(--bg-surface);
  color: var(--text-secondary); font: inherit; font-size: 12.5px; font-weight: 600;
}
.ai-followup i { color: var(--brand-500); }
.ai-followup:hover { border-color: var(--brand-400); color: var(--brand-600); }
.ai-msg-bubble.allow-select { -webkit-user-select: text; user-select: text; }

/* image viewer */
.ai-lightbox {
  position: fixed; inset: 0; z-index: 10050; display: flex; align-items: center; justify-content: center;
  background: rgba(2,6,23,.82); padding: 24px; animation: aiChipIn .15s ease;
}
.ai-lightbox figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 10px; max-width: 100%; max-height: 100%; }
.ai-lightbox img { max-width: min(1100px, 100%); max-height: calc(100vh - 110px); border-radius: 10px; background: #fff; object-fit: contain; }
.ai-lightbox figcaption { color: #e2e8f0; font-size: 13px; }
.ai-lightbox-close {
  position: absolute; top: 16px; right: 16px; width: 44px; height: 44px; border-radius: 50%;
  border: 0; background: rgba(255,255,255,.14); color: #fff; font-size: 18px; cursor: pointer;
}

.ai-msg-actions { flex-wrap: wrap; }
.ai-msg-action { white-space: nowrap; }
@media (max-width: 720px) {
  .ai-attach-tray { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
  .ai-att-chip { flex: 0 0 auto; }
  .ai-tool-btn span { display: none; }
  .ai-tool-btn { width: 40px; padding: 0; justify-content: center; }
  .ai-composer-hint { display: none !important; }
  .ai-att-chip { max-width: 220px; }
  .ai-att-name { max-width: 110px; }
  .ai-msg-file.is-image { width: 72px; height: 72px; }
}
@media (pointer: coarse) { .ai-composer-hint { display: none !important; } }
@media (prefers-reduced-motion: reduce) {
  .ai-caret, .ai-tool-btn.is-recording i, .ai-att-chip, .ai-lightbox { animation: none !important; }
}

/* ============================================================
   ⭐ ADMIN — LOGIN POP-UP DESIGNER (2026-10-04)
   ============================================================ */
.lp-admin { display: flex; flex-direction: column; gap: 18px; }
.lp-hero { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.lp-hero h2 { margin: 0 0 6px; }
.lp-hero p { margin: 0; color: var(--text-secondary); max-width: 720px; line-height: 1.55; }
.lp-live-line { margin-top: 10px; font-size: 13.5px; color: var(--text-secondary); display: flex; align-items: center; gap: 8px; }
.lp-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--text-tertiary); display: inline-block; }
.lp-dot-live { background: #10b981; box-shadow: 0 0 0 4px rgba(16,185,129,.18); }
.lp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; }
.lp-card { background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow-sm); }
.lp-card.is-active { border-color: #10b981; box-shadow: 0 0 0 2px rgba(16,185,129,.25); }
.lp-card-thumb { height: 128px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 12px 16px; text-align: center; overflow: hidden; }
.lp-card-thumb img { max-height: 64px; max-width: 70%; border-radius: 8px; object-fit: cover; }
.lp-card-thumb span { font-size: 13px; font-weight: 600; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.lp-card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.lp-card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.lp-card-top strong { font-size: 15px; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lp-card-meta, .lp-card-sched { font-size: 12px; color: var(--text-tertiary); }
.lp-card-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: auto; padding-top: 10px; }
.lp-card-btns { display: inline-flex; gap: 6px; }
.lp-card-btns .lp-del:hover { color: var(--rose-500, #ef4444); border-color: var(--rose-400, #fb7185); }
.lp-badge { font-size: 10.5px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; padding: 3px 9px; border-radius: 999px; flex-shrink: 0; }
.lp-badge-live { background: rgba(16,185,129,.14); color: #047857; }
.lp-badge-sched { background: rgba(14,165,233,.14); color: #0369a1; }
.lp-badge-ended, .lp-badge-off { background: var(--bg-surface-3); color: var(--text-tertiary); }
[data-theme="dark"] .lp-badge-live, [data-theme="dim"] .lp-badge-live { color: #6ee7b7; }
[data-theme="dark"] .lp-badge-sched, [data-theme="dim"] .lp-badge-sched { color: #7dd3fc; }

.lp-switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.lp-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.lp-switch-track { width: 42px; height: 24px; border-radius: 999px; background: var(--border-default); position: relative; transition: background .2s; flex-shrink: 0; }
.lp-switch-knob { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .2s; }
.lp-switch input:checked + .lp-switch-track { background: #10b981; }
.lp-switch input:checked + .lp-switch-track .lp-switch-knob { transform: translateX(18px); }
.lp-switch input:focus-visible + .lp-switch-track { outline: 2px solid var(--brand-500); outline-offset: 2px; }
.lp-switch input:disabled + .lp-switch-track { opacity: .5; }
.lp-switch-label { font-size: 13px; font-weight: 700; color: var(--text-secondary); }

.lp-tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.lp-tpl { border: 1px solid var(--border-subtle); border-radius: 14px; overflow: hidden; background: var(--bg-surface); padding: 0; cursor: pointer; text-align: left; transition: .15s var(--ease); font: inherit; }
.lp-tpl:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--brand-300); }
.lp-tpl-art { display: flex; align-items: center; justify-content: center; height: 92px; background: var(--lp-bg); color: var(--lp-fg); font-size: 36px; }
.lp-tpl-name { display: block; padding: 10px 12px; font-weight: 700; font-size: 13.5px; color: var(--text-primary); }

.lp-editor { display: flex; flex-direction: column; gap: 16px; }
.lp-ed-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 16px !important; }
.lp-name { flex: 1 1 220px; min-width: 0; height: 40px; padding: 0 12px; border: 1.5px solid var(--border-default); border-radius: 10px; font: 600 15px/1 inherit; background: var(--bg-surface); color: var(--text-primary); }
.lp-ed-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.lp-ed-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.lp-ed-main { padding: 14px !important; min-width: 0; }
.lp-ed-side { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 84px; }
.lp-panel { padding: 16px !important; margin: 0 !important; }
.lp-panel h4 { margin: 0 0 12px; font-size: 14px; display: flex; align-items: center; gap: 8px; color: var(--text-primary); }
.lp-panel h4 small { font-weight: 500; color: var(--text-tertiary); }
.lp-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; font-size: 12.5px; font-weight: 600; color: var(--text-secondary); min-width: 0; }
.lp-field input[type="text"], .lp-field input[type="number"], .lp-field input[type="datetime-local"], .lp-field select, .lp-inline input {
  height: 38px; padding: 0 10px; border: 1.5px solid var(--border-default); border-radius: 9px; background: var(--bg-surface); color: var(--text-primary); font: 500 13.5px/1 inherit; min-width: 0; width: 100%; }
.lp-field input[type="color"] { width: 100%; height: 38px; padding: 2px; border: 1.5px solid var(--border-default); border-radius: 9px; background: var(--bg-surface); cursor: pointer; }
.lp-field input[type="color"]:disabled { opacity: .35; cursor: not-allowed; }
.lp-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.lp-field span input[type="checkbox"] { margin-right: 4px; vertical-align: -2px; }
.lp-seg { display: flex; border: 1.5px solid var(--border-default); border-radius: 10px; overflow: hidden; }
.lp-seg button { flex: 1; min-height: 36px; border: 0; background: var(--bg-surface); color: var(--text-secondary); font: 600 12.5px/1.2 inherit; cursor: pointer; padding: 6px 4px; }
.lp-seg button + button { border-left: 1px solid var(--border-subtle); }
.lp-seg button.is-on { background: var(--brand-600); color: #fff; }
.lp-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.lp-chip { min-height: 34px; padding: 0 12px; border-radius: 999px; border: 1.5px solid var(--border-default); background: var(--bg-surface); color: var(--text-secondary); font: 700 12.5px/1 inherit; cursor: pointer; }
.lp-chip.is-on { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }
.lp-inline { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.lp-inline input { width: 90px; }
.lp-hint { font-size: 12px; color: var(--text-tertiary); margin: 8px 0 0; line-height: 1.5; font-weight: 500; }

.lp-toolbar, .lp-imgbar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 6px; border: 1px solid var(--border-subtle); border-radius: 12px; background: var(--bg-surface-2); }
.lp-toolbar button, .lp-imgbar button { min-width: 34px; height: 34px; padding: 0 8px; border: 0; border-radius: 8px; background: transparent; color: var(--text-secondary); cursor: pointer; font: 600 12.5px/1 inherit; }
.lp-toolbar button:hover, .lp-imgbar button:hover { background: var(--bg-surface); color: var(--brand-600); }
.lp-toolbar select { height: 34px; border: 1px solid var(--border-default); border-radius: 8px; background: var(--bg-surface); color: var(--text-primary); font: 500 12.5px/1 inherit; padding: 0 6px; max-width: 130px; }
.lp-tb-sep { width: 1px; height: 22px; background: var(--border-default); margin: 0 4px; }
.lp-color { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 8px; color: var(--text-secondary); cursor: pointer; }
.lp-color:hover { background: var(--bg-surface); }
.lp-color input { position: absolute; left: 4px; right: 4px; bottom: 3px; width: 26px; height: 6px; padding: 0; border: 0; cursor: pointer; }
.lp-imgbar { margin-top: 8px; background: rgba(99,102,241,.08); border-color: rgba(99,102,241,.3); }
.lp-imgbar[hidden], .lp-emoji[hidden] { display: none; }
.lp-imgbar > span:first-child { font-size: 12.5px; font-weight: 700; color: var(--brand-600); margin: 0 6px; }
.lp-imgbar .lp-danger:hover { color: #ef4444; }
.lp-emoji { display: grid; grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); gap: 4px; margin-top: 8px; padding: 8px; border: 1px solid var(--border-subtle); border-radius: 12px; background: var(--bg-surface); }
.lp-emoji button { height: 38px; border: 0; border-radius: 8px; background: transparent; font-size: 20px; cursor: pointer; }
.lp-emoji button:hover { background: var(--bg-surface-3); }

.lp-stage { margin-top: 12px; padding: 28px 16px; border-radius: 14px; display: flex; justify-content: center;
  background: repeating-conic-gradient(rgba(127,127,127,.08) 0% 25%, transparent 0% 50%) 50% / 22px 22px, rgba(2,6,23,.55); }
.lp-canvas-card { width: 100%; border-radius: 20px; overflow: hidden; box-shadow: 0 24px 60px rgba(2,6,23,.4); transition: max-width .2s; }
.lp-w-sm { max-width: 400px; } .lp-w-md { max-width: 540px; } .lp-w-lg { max-width: 760px; }
.lp-canvas { min-height: 200px; padding: 28px 26px 22px; outline: none; font: 400 15px/1.6 Inter, system-ui, -apple-system, 'Segoe UI', sans-serif; overflow-wrap: anywhere; cursor: text;
  -webkit-user-select: text; user-select: text; }
.lp-canvas:focus { box-shadow: inset 0 0 0 2px rgba(99,102,241,.55); }
.lp-canvas > :first-child { margin-top: 0; } .lp-canvas > :last-child { margin-bottom: 0; }
.lp-canvas h1 { font-size: 30px; line-height: 1.2; margin: .3em 0; font-weight: 800; color: inherit; }
.lp-canvas h2 { font-size: 23px; line-height: 1.25; margin: .35em 0; font-weight: 800; color: inherit; }
.lp-canvas h3 { font-size: 18px; margin: .4em 0; font-weight: 700; color: inherit; }
.lp-canvas p { margin: .45em 0; color: inherit; }
.lp-canvas ul, .lp-canvas ol { padding-left: 1.3em; margin: .4em 0; }
.lp-canvas a { color: inherit; text-decoration: underline; }
.lp-canvas img { max-width: 100%; height: auto; border-radius: 12px; cursor: pointer; }
.lp-canvas img.lp-img-selected { outline: 3px solid #6366f1; outline-offset: 2px; }
.lp-canvas hr { border: 0; border-top: 1px solid currentColor; opacity: .25; margin: 1em 0; }
.lp-uploading { font-size: 13px; opacity: .8; }
.lp-canvas-btn { display: flex; justify-content: center; padding: 0 26px 22px; }
.lp-canvas-btn[hidden] { display: none; }
.lp-canvas-btn span { display: inline-flex; align-items: center; min-height: 44px; padding: 0 26px; border-radius: 999px; color: #fff; font: 700 15px/1 Inter, system-ui, sans-serif; }

@media (max-width: 1100px) {
  .lp-ed-grid { grid-template-columns: 1fr; }
  .lp-ed-side { position: static; }
}
@media (max-width: 640px) {
  .lp-ed-actions { width: 100%; }
  .lp-ed-actions .btn { flex: 1; justify-content: center; }
  .lp-stage { padding: 16px 8px; }
  .lp-canvas { padding: 22px 16px 18px; }
  .lp-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   ⭐ ADMIN — MOBILE APP (2026-10-05)
   ============================================================ */
.ma-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; align-items: start; }
.ma-grid .section-card { margin: 0 !important; }
.ma-current { grid-column: 1 / -1; }
.ma-current h2 { margin: 0 0 10px; display: flex; align-items: center; gap: 10px; }
.ma-current h2 i { color: #3ddc84; }
.ma-status { display: flex; align-items: center; gap: 8px; color: var(--text-secondary); font-size: 14px; margin-bottom: 14px; }
.ma-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 14px; }
.ma-facts div { background: var(--bg-surface-2); border: 1px solid var(--border-subtle); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.ma-facts span { font-size: 11.5px; color: var(--text-tertiary); font-weight: 700; text-transform: uppercase; letter-spacing: .4px; }
.ma-facts strong { font-size: 18px; color: var(--text-primary); }
.ma-link { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.ma-link code { background: var(--bg-surface-2); border: 1px solid var(--border-subtle); padding: 8px 12px; border-radius: 9px; font-size: 13px; word-break: break-all; }
.ma-muted { color: var(--text-tertiary); font-size: 12.5px; line-height: 1.55; margin: 6px 0 0; }
.ma-remove { margin-top: 12px; }
.ma-upload h3, .ma-help h3 { margin: 0 0 12px; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.ma-drop { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 22px 14px; margin-bottom: 14px;
  border: 2px dashed var(--border-default); border-radius: 14px; cursor: pointer; text-align: center; color: var(--text-secondary); font-size: 13.5px; }
.ma-drop:hover { border-color: var(--brand-400); background: rgba(99,102,241,.04); }
.ma-drop i { font-size: 28px; color: var(--brand-500); }
.ma-drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.ma-progress { height: 6px; border-radius: 999px; background: var(--bg-surface-3); overflow: hidden; margin-bottom: 12px; }
.ma-progress[hidden] { display: none; }
.ma-progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--brand-500), #06b6d4); transition: width .2s; }
.ma-help ol { margin: 0 0 8px; padding-left: 1.2em; color: var(--text-secondary); font-size: 13.5px; line-height: 1.6; }
.ma-help li { margin-bottom: 6px; }
/* Windows app section (2026-10-10) */
.ma-grid + .ma-grid { margin-top: 22px; }
.ma-win h2 i { color: #0078d4; }
.ma-test { display: block; padding: 10px 12px; border-radius: 10px; font-size: 13px; line-height: 1.5; margin-bottom: 12px; }
.ma-test i { margin-right: 6px; }
.ma-test a { font-weight: 700; margin-left: 4px; }
.ma-test ul { margin: 6px 0 0; padding-left: 1.3em; }
.ma-test-ok { background: rgba(16,185,129,.09); border: 1px solid rgba(16,185,129,.28); color: var(--text-secondary); }
.ma-test-ok i { color: #10b981; }
.ma-test-warn { background: rgba(245,158,11,.09); border: 1px solid rgba(245,158,11,.32); color: var(--text-secondary); }
.ma-test-warn i { color: #f59e0b; }
.ma-alt { margin-top: 16px; border-top: 1px dashed var(--border-subtle); padding-top: 12px; }
.ma-alt summary { cursor: pointer; color: var(--text-secondary); font-size: 13.5px; font-weight: 600; margin-bottom: 10px; }
.ma-alt[open] summary { margin-bottom: 12px; }

/* ============================================================
   ⭐ STUDENT LEARNING PROFILE (2026-10-05)
   Admin → Students → click a name. Built on the Live Activity
   sum-* dialog; only the extras are styled here.
   ============================================================ */
.student-profile-link { cursor: pointer; border-radius: var(--radius-md); outline: none; }
.student-profile-link:hover h4,
.student-profile-link:focus-visible h4 { color: var(--brand-600); text-decoration: underline; text-underline-offset: 3px; }
.student-profile-link:focus-visible { box-shadow: 0 0 0 3px rgba(99, 102, 241, .35); }
.student-profile-hint {
  display: inline-flex; align-items: center; gap: 5px; margin-top: 3px;
  font-size: 11.5px; font-weight: 700; color: var(--brand-500);
}
.student-profile-hint .fa-chevron-right { font-size: 9px; transition: transform .15s var(--ease); }
.student-profile-link:hover .student-profile-hint .fa-chevron-right { transform: translateX(2px); }
[data-theme="dark"] .student-profile-link:hover h4,
[data-theme="dim"] .student-profile-link:hover h4 { color: var(--brand-300); }
[data-theme="dark"] .student-profile-hint,
[data-theme="dim"] .student-profile-hint { color: var(--brand-300); }

.sum-profile-btn {
  flex-shrink: 0; display: inline-flex; align-items: center; gap: 7px;
  height: 38px; padding: 0 14px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border-default); background: var(--bg-surface);
  color: var(--brand-600); font: inherit; font-size: 13px; font-weight: 700;
  transition: background .15s, border-color .15s;
}
.sum-profile-btn:hover { border-color: var(--brand-400); background: var(--bg-surface-2); }
[data-theme="dark"] .sum-profile-btn, [data-theme="dim"] .sum-profile-btn { color: var(--brand-300); }

.sp-shell .sum-header { align-items: flex-start; }
.sp-shell .sum-close { margin-left: auto; }
.sp-sub {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px;
  margin: 2px 0 8px; font-size: 13px; color: var(--text-secondary);
}
.sp-sub > span { display: inline-flex; align-items: center; gap: 6px; min-width: 0; overflow-wrap: anywhere; }
.sp-sub i { font-size: 11px; color: var(--text-tertiary); }
.sp-id {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  border: 1px dashed var(--border-default); background: transparent; cursor: pointer;
  font: inherit; font-size: 12px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--text-secondary);
}
.sp-id:hover { border-color: var(--brand-400); color: var(--brand-600); }

.sp-tabs {
  flex-shrink: 0; display: flex; gap: 4px; padding: 0 20px;
  border-bottom: 1px solid var(--border-subtle); background: var(--bg-surface);
  overflow-x: auto; scrollbar-width: none;
}
.sp-tabs::-webkit-scrollbar { display: none; }
.sp-tab {
  flex-shrink: 0; display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 14px 11px; border: 0; border-bottom: 3px solid transparent; background: none;
  font: inherit; font-size: 13.5px; font-weight: 700; color: var(--text-tertiary); cursor: pointer;
  white-space: nowrap; transition: color .15s, border-color .15s;
}
.sp-tab:hover { color: var(--text-primary); }
.sp-tab.active { color: var(--brand-600); border-bottom-color: var(--brand-500); }
[data-theme="dark"] .sp-tab.active, [data-theme="dim"] .sp-tab.active { color: var(--brand-300); }
.sp-pane[hidden] { display: none !important; }

.sp-rangebar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: 18px; }
.sp-rangebar-lbl { font-size: 13px; font-weight: 700; color: var(--text-secondary); }
.sp-seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 999px; background: var(--bg-surface-3); }
.sp-seg-btn {
  border: 0; background: none; cursor: pointer; padding: 7px 14px; border-radius: 999px;
  font: inherit; font-size: 12.5px; font-weight: 700; color: var(--text-secondary); white-space: nowrap;
}
.sp-seg-btn:hover { color: var(--text-primary); }
.sp-seg-btn.active { background: var(--bg-surface); color: var(--brand-600); box-shadow: 0 1px 4px rgba(15, 23, 42, .12); }
[data-theme="dark"] .sp-seg-btn.active, [data-theme="dim"] .sp-seg-btn.active { color: var(--brand-300); }
.sp-range-note { margin-left: auto; font-size: 12px; color: var(--text-tertiary); display: inline-flex; gap: 6px; align-items: center; }

.sum-stat-num small { font-size: .62em; font-weight: 700; color: var(--text-tertiary); margin-left: 2px; }

.sp-facts { display: flex; flex-wrap: wrap; gap: 8px; margin: -8px 0 18px; }
.sp-facts > span {
  display: inline-block; padding: 6px 12px; border-radius: 999px; line-height: 1.45;
  background: var(--bg-surface-2); border: 1px solid var(--border-subtle);
  font-size: 12.5px; color: var(--text-secondary); max-width: 100%;
}
.sp-facts i { color: var(--brand-500); font-size: 11px; margin-right: 6px; }
.sp-facts strong { color: var(--text-primary); }

/* Study calendar */
.sp-heat-panel { margin-bottom: 18px; }
.sp-heat-wrap { padding: 14px 18px 16px; overflow-x: auto; }
.sp-heat-months, .sp-heat-grid { display: grid; grid-template-columns: 30px repeat(26, 14px); gap: 3px; }
.sp-heat-months { margin-bottom: 4px; font-size: 10.5px; color: var(--text-tertiary); }
.sp-heat-months span:first-child { grid-column: 2; }
.sp-heat-months span { white-space: nowrap; overflow: visible; }
.sp-heat-days { display: grid; grid-template-rows: repeat(7, 14px); gap: 3px; font-size: 9.5px; color: var(--text-tertiary); line-height: 14px; }
.sp-heat-col { display: grid; grid-template-rows: repeat(7, 14px); gap: 3px; }
.sp-cell { display: inline-block; width: 14px; height: 14px; border-radius: 3px; background: var(--bg-surface-3); }
.sp-cell.future { background: transparent; }
.sp-cell.l1 { background: rgba(99, 102, 241, .28); }
.sp-cell.l2 { background: rgba(99, 102, 241, .5); }
.sp-cell.l3 { background: rgba(79, 70, 229, .78); }
.sp-cell.l4 { background: #4338ca; }
.sp-heat-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 10px; font-size: 11px; color: var(--text-tertiary); }
.sp-heat-legend .sp-cell { width: 12px; height: 12px; }
.sp-heat-legend span { margin-left: 6px; }

/* Materials opened log */
.sp-log { padding: 6px 12px 4px; }
.sp-log-day + .sp-log-day { margin-top: 6px; }
.sp-log-date {
  position: sticky; top: -1px; z-index: 1; display: flex; align-items: center; gap: 8px;
  padding: 9px 6px; background: var(--bg-surface);
  font-size: 12px; font-weight: 800; color: var(--text-primary);
}
.sp-log-date i { color: var(--brand-500); font-size: 11px; }
.sp-log-date span { margin-left: auto; font-weight: 600; color: var(--text-tertiary); }
.sp-log-row {
  display: flex; align-items: center; gap: 10px; padding: 8px 6px;
  border-top: 1px solid var(--border-subtle);
}
.sp-log-time { flex-shrink: 0; width: 62px; font-size: 11.5px; font-weight: 700; color: var(--text-tertiary); font-variant-numeric: tabular-nums; }
.sp-log-icon {
  flex-shrink: 0; width: 30px; height: 30px; border-radius: 9px; display: flex; align-items: center; justify-content: center;
  background: rgba(99, 102, 241, .12); color: #4f46e5; font-size: 13px;
}
.sp-log-icon.kind-video { background: rgba(239, 68, 68, .12); color: #dc2626; }
.sp-log-icon.kind-slides { background: rgba(245, 158, 11, .14); color: #b45309; }
.sp-log-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sp-log-info strong { font-size: 13px; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-log-info span { font-size: 11.5px; color: var(--text-tertiary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-more-wrap { padding: 10px 12px 14px; text-align: center; }
.sp-log-end { padding: 10px 12px 14px; text-align: center; font-size: 12px; color: var(--text-tertiary); }

.sp-tag {
  flex-shrink: 0; display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px;
  font-size: 10.5px; font-weight: 800; background: var(--bg-surface-3); color: var(--text-secondary);
}
.sp-tag.ok { background: rgba(16, 185, 129, .12); color: #059669; }
.sp-tag.warn { background: rgba(245, 158, 11, .15); color: #b45309; }

/* Course progress ring */
.sp-ring {
  --p: 0; flex-shrink: 0; width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: conic-gradient(var(--brand-500) calc(var(--p) * 1%), var(--bg-surface-3) 0);
}
.sp-ring span {
  width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: var(--bg-surface); font-size: 10.5px; font-weight: 800; color: var(--text-primary);
}

/* Quiz results */
.sp-quiz-list { padding: 8px 12px; }
.sp-quiz-row { display: flex; align-items: center; gap: 12px; padding: 10px 6px; }
.sp-quiz-row + .sp-quiz-row { border-top: 1px solid var(--border-subtle); }
.sp-quiz-score {
  flex-shrink: 0; width: 52px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 800; background: var(--bg-surface-3); color: var(--text-secondary);
}
.sp-quiz-score.good { background: rgba(16, 185, 129, .14); color: #059669; }
.sp-quiz-score.mid  { background: rgba(245, 158, 11, .15); color: #b45309; }
.sp-quiz-score.low  { background: rgba(239, 68, 68, .12); color: #dc2626; }
.sp-quiz-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.sp-quiz-info strong { font-size: 13px; color: var(--text-primary); overflow-wrap: anywhere; }
.sp-quiz-info span { font-size: 11.5px; color: var(--text-tertiary); }
.sp-quiz-meta i { font-size: 10px; }

@media (max-width: 800px) {
  .sp-tabs { padding: 0 10px; }
  .sp-tab { padding: 12px 10px 10px; font-size: 13px; }
  .sp-range-note { margin-left: 0; width: 100%; }
  .sum-profile-btn span { display: none; }
  .sum-profile-btn { width: 38px; padding: 0; justify-content: center; }
  .sp-shell .sum-header { padding-right: 14px; }
  .sp-shell .sum-meta { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-right: -14px; padding-right: 14px; }
  .sp-shell .sum-meta::-webkit-scrollbar { display: none; }
  .sp-shell .sum-meta-pill { flex-shrink: 0; white-space: nowrap; }
  .sp-sub { margin-bottom: 6px; }
}
@media (max-width: 480px) {
  .sp-seg { width: 100%; }
  .sp-seg-btn { flex: 1; padding: 7px 6px; }
  .sp-log-time { width: 54px; }
  .sp-sub { font-size: 12px; gap: 4px 10px; }
}

/* ============================================================
   ⭐ COURSE ORDER — Admin → Courses (2026-10-05)
   ============================================================ */
.cord-hint {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 0 0 14px; padding: 9px 14px;
  border: 1px dashed var(--border-subtle); border-radius: var(--radius-md);
  background: var(--bg-surface-2); color: var(--text-secondary);
  font-size: 12.5px; line-height: 1.5;
}
.cord-hint > .fas { color: var(--brand-500); }
.cord-hint > span:first-of-type { flex: 1 1 260px; min-width: 0; }
.cord-hint em { display: block; font-style: normal; color: var(--text-tertiary); font-size: 12px; }
.cord-hint .fa-grip-vertical { font-size: 11px; margin: 0 2px; }
.cord-state { font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; }
.cord-state.run, .cord-state.ok, .cord-state.err { padding: 3px 10px; }
.cord-state.run { background: rgba(99, 102, 241, .1); color: var(--brand-600, #4f46e5); }
.cord-state.ok { background: rgba(16, 185, 129, .12); color: #059669; }
.cord-state.err { background: rgba(239, 68, 68, .1); color: var(--rose-600, #e11d48); }
[data-theme="dark"] .cord-state.ok { color: #34d399; }
[data-theme="dark"] .cord-state.run { color: var(--brand-300, #a5b4fc); }

.course-card .cord-bar {
  margin-top: auto; display: flex; align-items: center; gap: 6px;
  padding: 8px 0 0; font-size: 12px; color: var(--text-tertiary); cursor: default;
}
.course-card .cord-bar + .card-actions { margin-top: 10px; }
.cord-grip {
  width: 30px; height: 30px; border: 1px solid var(--border-subtle); border-radius: 8px;
  background: var(--bg-surface); color: var(--text-tertiary);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: grab; touch-action: none; flex-shrink: 0; transition: .15s;
}
.cord-grip:hover { color: var(--text-primary); background: var(--bg-surface-3); }
.cord-grip:active { cursor: grabbing; }
.cord-pos {
  font-weight: 800; color: var(--text-primary); font-variant-numeric: tabular-nums;
  min-width: 28px;
}
.cord-label { flex: 1; text-transform: uppercase; letter-spacing: .6px; font-size: 10.5px; font-weight: 700; }
.cord-btn {
  width: 30px; height: 30px; border: 1px solid var(--border-subtle); border-radius: 8px;
  background: var(--bg-surface); color: var(--text-secondary); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; font-size: 12px; transition: .15s;
}
.cord-btn:hover:not(:disabled) { color: #fff; background: var(--brand-500); border-color: var(--brand-500); }
.cord-btn:disabled { opacity: .35; cursor: not-allowed; }
.cord-grip:focus-visible, .cord-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(99, 102, 241, .45); }

body.cord-drag-on, body.cord-drag-on * { cursor: grabbing !important; user-select: none !important; -webkit-user-select: none !important; }
body.cord-drag-on #adminCourseGrid .course-card { transform: none !important; transition: none; }
#adminCourseGrid .course-card.cord-dragging {
  position: fixed; z-index: 2600; margin: 0; pointer-events: none;
  transform: rotate(-1deg) scale(1.02) !important; opacity: .96;
  box-shadow: 0 24px 54px rgba(15, 23, 42, .3), 0 0 0 2px var(--brand-500);
}
.cord-ph {
  border-radius: var(--radius-lg);
  border: 2px dashed color-mix(in srgb, var(--brand-500) 55%, transparent);
  background: rgba(99, 102, 241, .06);
}
#adminCourseGrid .course-card.cord-dropped { animation: cordDropped .8s ease-out; }
@keyframes cordDropped {
  0% { box-shadow: 0 0 0 3px rgba(16, 185, 129, .6); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}
@media (max-width: 700px) {
  .cord-grip, .cord-btn { width: 38px; height: 38px; font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  #adminCourseGrid .course-card.cord-dragging { transform: none !important; }
  #adminCourseGrid .course-card.cord-dropped { animation: none; }
}

/* ============================================================
   ⭐ MATERIAL ORDER — course editor → Materials (2026-10-06)
   ============================================================ */
.mord-hint {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 18px 0 12px; padding: 9px 14px;
  border: 1px dashed var(--border-subtle); border-radius: var(--radius-md);
  background: var(--bg-surface-2); color: var(--text-secondary);
  font-size: 12.5px; line-height: 1.5;
}
.mord-hint > .fas { color: var(--brand-500); }
.mord-hint > span:first-of-type { flex: 1 1 260px; min-width: 0; }
.mord-hint .fa-grip-vertical { font-size: 11px; margin: 0 2px; }
.mord-state { font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; }
.mord-state.run, .mord-state.ok, .mord-state.err { padding: 3px 10px; }
.mord-state.run { background: rgba(99, 102, 241, .1); color: var(--brand-600); }
.mord-state.ok { background: rgba(16, 185, 129, .12); color: #059669; }
.mord-state.err { background: rgba(239, 68, 68, .1); color: var(--rose-600); }
[data-theme="dark"] .mord-state.ok { color: #34d399; }
[data-theme="dark"] .mord-state.run { color: var(--brand-300); }

.mord-grip {
  width: 28px; height: 32px; margin: -4px -2px -4px -8px; border: 0; border-radius: 8px;
  background: none; color: var(--text-tertiary); cursor: grab; touch-action: none;
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  transition: background .15s, color .15s;
}
.mord-grip:hover { background: var(--bg-surface); color: var(--text-primary); }
.mord-grip:active { cursor: grabbing; }
.mord-arrows { display: inline-flex; gap: 4px; }
.me-summary-right .mord-btn {
  width: 30px; height: 30px; border: 1px solid var(--border-subtle); border-radius: 8px;
  background: var(--bg-surface); color: var(--text-secondary);
  display: inline-flex; align-items: center; justify-content: center; font-size: 12px; transition: .15s;
}
.me-summary-right .mord-btn:hover:not(:disabled) { color: #fff; background: var(--brand-500); border-color: var(--brand-500); }
.me-summary-right .mord-btn:disabled { opacity: .35; cursor: not-allowed; }
.mord-grip:focus-visible, .mord-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(99, 102, 241, .45); }

body.mord-drag-on, body.mord-drag-on * { cursor: grabbing !important; user-select: none !important; -webkit-user-select: none !important; }
.mord-list > .material-editor.mord-dragging {
  position: fixed; z-index: 2600; margin: 0; pointer-events: none;
  box-shadow: 0 22px 50px rgba(15, 23, 42, .28), 0 0 0 2px var(--brand-500);
  transform: rotate(-.5deg) scale(1.01); opacity: .97;
}
.mord-ph {
  margin-bottom: 12px; border-radius: var(--radius-md);
  border: 2px dashed color-mix(in srgb, var(--brand-500) 55%, transparent);
  background: rgba(99, 102, 241, .06);
}
.mord-list > .material-editor.mord-dropped { animation: mordDropped .8s ease-out; }
@keyframes mordDropped {
  0% { box-shadow: 0 0 0 3px rgba(16, 185, 129, .6); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}
@media (max-width: 700px) {
  .mord-grip { width: 34px; height: 38px; }
  .me-summary-right .mord-btn { width: 36px; height: 36px; font-size: 13px; }
  /* phones: title gets the full width, the buttons sit on their own row */
  .mord-list > .material-editor > summary { flex-wrap: wrap; row-gap: 10px; }
  .mord-list > .material-editor > summary .me-summary-left { flex-basis: 100%; }
  .mord-list > .material-editor > summary .me-summary-right { flex-basis: 100%; justify-content: flex-end; }
  .mord-list > .material-editor > summary .me-summary-right .mord-arrows { margin-right: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .mord-list > .material-editor.mord-dragging { transform: none; }
  .mord-list > .material-editor.mord-dropped { animation: none; }
}

/* ============================================================
   ⭐ GUEST CATALOG + SIGN-UP GATE (2026-10-06)
   ============================================================ */
#guestHeaderActions { display: none; }
body.aero-guest #guestHeaderActions { display: inline-flex; align-items: center; gap: 8px; margin-right: 10px; }
body.aero-guest #appHeader .user-info { gap: 0 !important; }
@media (max-width: 560px) {
  body.aero-guest #guestHeaderActions .btn span { display: none; }
  body.aero-guest #guestHeaderActions .btn { padding: 8px 11px; }
}

.guest-banner {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin: 0 0 18px; padding: 14px 18px; border-radius: var(--radius-lg);
  border: 1px solid color-mix(in srgb, var(--brand-500) 30%, var(--border-subtle));
  background: linear-gradient(135deg, rgba(99, 102, 241, .08), rgba(6, 182, 212, .06));
}
.guest-banner-icon {
  width: 40px; height: 40px; flex-shrink: 0; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  background: var(--brand-500); color: #fff; font-size: 16px;
}
.guest-banner-text { flex: 1 1 260px; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: 13.5px; color: var(--text-secondary); }
.guest-banner-text strong { color: var(--text-primary); font-size: 14.5px; }
.guest-banner-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.material-item.guest-locked { cursor: pointer; }
.material-item.guest-locked:hover { border-color: color-mix(in srgb, var(--brand-500) 45%, var(--border-subtle)); }
.guest-open-btn i { margin-right: 2px; }

#guestGateModal .guest-gate { position: relative; max-width: 440px; text-align: center; }
.guest-gate-close {
  position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--border-subtle); background: var(--bg-surface); color: var(--text-secondary); cursor: pointer;
}
.guest-gate-close:hover { color: var(--text-primary); background: var(--bg-surface-3); }
.guest-gate-icon {
  width: 60px; height: 60px; margin: 4px auto 12px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--brand-600), var(--accent-500)); color: #fff; font-size: 24px;
  box-shadow: 0 10px 26px rgba(99, 102, 241, .35);
}
#guestGateModal h3 { justify-content: center; text-align: center; }
#guestGateModal .modal-sub { text-align: center; }
.guest-gate-perks { list-style: none; padding: 0; margin: 4px auto 16px; display: inline-flex; flex-direction: column; gap: 6px; text-align: left; font-size: 13.5px; color: var(--text-secondary); }
.guest-gate-perks i { color: #10b981; margin-right: 8px; }
.guest-gate-register { padding: 12px 16px; font-size: 15px; }
.guest-gate-or { display: flex; align-items: center; gap: 10px; margin: 18px 0 12px; color: var(--text-tertiary); font-size: 12.5px; }
.guest-gate-or::before, .guest-gate-or::after { content: ""; flex: 1; height: 1px; background: var(--border-subtle); }
.guest-gate-signin { text-align: left; }
.guest-gate-signin .form-group { margin-bottom: 10px; }
.guest-gate-forgot { display: block; text-align: center; margin-top: 10px; font-size: 13px; }
#guestHeaderActions .btn-outline { color: #fff; border-color: rgba(255, 255, 255, .45); background: rgba(255, 255, 255, .06); }
#guestHeaderActions .btn-outline:hover { background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .7); color: #fff; }

/* ============================================================
   ⭐ MATERIAL CARDS — whole card opens the material (2026-10-07)
   ============================================================ */
.material-item.mat-clickable { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.material-item.mat-clickable .mat-actions { cursor: default; }
.material-item.mat-clickable:hover {
  border-color: var(--brand-400, #818cf8);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-500) 16%, transparent), var(--shadow-md);
  transform: translateY(-3px);
}
.material-item.mat-clickable:hover h4 { color: var(--brand-600); }
[data-theme="dark"] .material-item.mat-clickable:hover h4,
[data-theme="dim"]  .material-item.mat-clickable:hover h4 { color: var(--brand-300, #a5b4fc); }
.material-item.mat-clickable h4 { transition: color .18s var(--ease, ease); }
/* Press feedback — the card visibly "gives" under the finger / mouse */
.material-item.mat-clickable:active:not(:has(.mat-actions:active)) {
  transform: translateY(0) scale(.985);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-500) 28%, transparent), var(--shadow-sm, none);
  transition-duration: .06s;
}

/* "Open / Watch / Preview" chip that appears on the thumbnail on hover */
.mat-open-hint {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%) scale(.9);
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 16px; border-radius: 999px;
  background: rgba(15, 23, 42, .78); color: #fff;
  font-size: 13px; font-weight: 700; letter-spacing: .2px;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, .22);
  box-shadow: 0 8px 22px rgba(0, 0, 0, .3);
  opacity: 0; pointer-events: none;
  transition: opacity .18s ease, transform .22s cubic-bezier(.34, 1.56, .64, 1);
}
.material-item.mat-clickable:hover .mat-open-hint { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.material-item.mat-clickable .material-thumb::after {
  content: ''; position: absolute; inset: 0; background: rgba(15, 23, 42, 0);
  transition: background .2s ease; pointer-events: none;
}
.material-item.mat-clickable:hover .material-thumb::after { background: rgba(15, 23, 42, .18); }
@media (hover: none) { .mat-open-hint { display: none; } }

/* ---- "Opening…" state (set the instant the card is clicked) ---- */
.material-item.is-opening {
  pointer-events: none;
  border-color: var(--brand-500) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-500) 30%, transparent), var(--shadow-md) !important;
  transform: none !important;
}
.mat-opening-veil {
  position: absolute; inset: 0; z-index: 5;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  background: color-mix(in srgb, var(--bg-surface, #fff) 74%, transparent);
  backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
  border-radius: inherit;
  color: var(--brand-700, #4338ca); font-weight: 700; font-size: 13.5px; letter-spacing: .2px;
  animation: matVeilIn .15s ease-out both;
}
[data-theme="dark"] .mat-opening-veil,
[data-theme="dim"]  .mat-opening-veil { color: var(--brand-200, #c7d2fe); }
.mat-opening-veil::before {             /* thin running bar along the card's top edge */
  content: ''; position: absolute; top: 0; left: 0; height: 3px; width: 40%;
  background: linear-gradient(90deg, var(--brand-500, #6366f1), var(--accent-500, #06b6d4));
  border-radius: 0 3px 3px 0;
  animation: matVeilBar 1s cubic-bezier(.4, 0, .2, 1) infinite;
}
.mat-opening-spinner {
  width: 30px; height: 30px; border-radius: 50%;
  border: 3px solid color-mix(in srgb, var(--brand-500) 22%, transparent);
  border-top-color: var(--brand-500, #6366f1);
  animation: matSpin .7s linear infinite;
}
@keyframes matVeilIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes matVeilBar { 0% { left: -40%; } 100% { left: 100%; } }
@keyframes matSpin    { to { transform: rotate(360deg); } }

/* Thin progress bar across the top of the screen while a material opens */
.aero-open-bar {
  position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 100000;
  background: linear-gradient(90deg, var(--brand-500, #6366f1), var(--accent-500, #06b6d4));
  box-shadow: 0 0 10px color-mix(in srgb, var(--brand-500) 60%, transparent);
  opacity: 0; pointer-events: none;
}
.aero-open-bar.active { opacity: 1; animation: aeroOpenBar 8s cubic-bezier(.08, .82, .17, 1) forwards; }
.aero-open-bar.active.done { animation: none; width: 100%; opacity: 0; transition: width .2s ease, opacity .3s ease .15s; }
@keyframes aeroOpenBar { 0% { width: 0; } 15% { width: 45%; } 100% { width: 92%; } }

@media (prefers-reduced-motion: reduce) {
  .material-item.mat-clickable:hover, .material-item.mat-clickable:active { transform: none; }
  .mat-opening-veil::before { animation-duration: 2.4s; }
  .mat-opening-spinner { animation-duration: 1.4s; }
}

/* ============================================================
   ⭐ DASHBOARD "GET APP" PILL — identical to the landing navbar
   (.landing-install-pill in landing.html), scoped to the app header.
   ============================================================ */
.app-install-pill {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 8px 16px; border-radius: 999px;
  border: 1px solid rgba(255,255,255,.22);
  background: rgba(255,255,255,.08);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  color: #fff; font-family: inherit; font-size: 13px; font-weight: 700; letter-spacing: .1px;
  cursor: pointer; transition: .22s cubic-bezier(.4,0,.2,1);
  flex-shrink: 0; white-space: nowrap;
  min-height: 0; min-width: 0; width: auto; height: auto;
}
.app-install-pill i { font-size: 12.5px; transition: transform .3s cubic-bezier(.34,1.56,.64,1); }
.app-install-pill:hover {
  background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.38);
  transform: translateY(-1px); box-shadow: 0 8px 22px rgba(0,0,0,.28);
}
.app-install-pill:hover i { transform: translateY(1px) scale(1.1); }
.app-install-pill:active { transform: translateY(0) scale(.97); }
.app-install-pill:focus-visible { outline: 2px solid var(--accent-400, #22d3ee); outline-offset: 2px; }
.app-install-pill.is-ready {
  background: linear-gradient(135deg, rgba(16,185,129,.22), rgba(52,211,153,.12));
  border-color: rgba(52,211,153,.55);
  box-shadow: 0 0 0 0 rgba(52,211,153,.5);
  animation: appInstallGlow 2.4s ease-in-out infinite;
}
@keyframes appInstallGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(52,211,153,.55); }
  50%      { box-shadow: 0 0 0 10px rgba(52,211,153,0); }
}
.app-install-pill.is-installed {
  background: rgba(16,185,129,.16); border-color: rgba(16,185,129,.42);
  color: #6ee7b7; cursor: default; animation: none;
}
.app-install-pill.is-installed:hover { transform: none; box-shadow: none; }
.app-install-pill .landing-install-pill-dot {
  position: absolute; top: -3px; right: -3px;
  width: 10px; height: 10px; border-radius: 50%;
  background: #34d399; border: 2px solid rgba(10,14,31,.9);
  box-shadow: 0 0 0 0 rgba(52,211,153,.7);
  animation: appInstallDot 1.6s ease-in-out infinite;
}
@keyframes appInstallDot {
  0%   { box-shadow: 0 0 0 0 rgba(52,211,153,.7); }
  70%  { box-shadow: 0 0 0 8px rgba(52,211,153,0); }
  100% { box-shadow: 0 0 0 0 rgba(52,211,153,0); }
}
.app-install-pill .landing-install-pill-text { display: inline; }
@media (max-width: 860px) {
  .app-install-pill { padding: 8px 10px; gap: 0; min-width: 40px; height: 40px; }
  .app-install-pill .landing-install-pill-text { display: none; }
  .app-install-pill i { font-size: 14px; }
}
@media (max-width: 520px) {
  .app-install-pill { padding: 8px 9px; }
  .app-install-pill i { font-size: 13px; }
}
/* Signed-in only (the login screen keeps its one-row header), and never
   inside the AeroGyan Android app itself. */
body.aero-logged-out .app-install-pill,
html.aero-in-app .app-install-pill { display: none !important; }

/* ---- Install guide overlay (same look as the landing page) ---- */
.aero-install-guide {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(16,18,22,.72);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  display: flex; align-items: center; justify-content: center; padding: 22px;
  animation: aigFadeIn .2s ease-out;
}
.aero-install-guide .aig-card {
  background: var(--bg-surface); border: 1px solid var(--border-subtle);
  border-radius: 22px; max-width: 520px; width: 100%; padding: 32px 30px;
  box-shadow: 0 32px 80px rgba(0,0,0,.4);
  max-height: calc(100vh - 44px); overflow-y: auto;
  animation: aigSlideUp .3s cubic-bezier(.22,1,.36,1);
}
.aero-install-guide .aig-head { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.aero-install-guide .aig-icon {
  width: 48px; height: 48px; border-radius: 14px; flex-shrink: 0;
  background: linear-gradient(135deg,#6366f1,#06b6d4); color: #fff; font-size: 22px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 20px rgba(99,102,241,.35);
}
.aero-install-guide h3 { font-size: 19px; font-weight: 800; color: var(--text-primary); margin: 0; letter-spacing: -.3px; }
.aero-install-guide .aig-head p { font-size: 12.5px; color: var(--text-tertiary); margin: 4px 0 0; }
.aero-install-guide .aig-steps { list-style: none; padding: 0; margin: 0 0 22px; }
.aero-install-guide .aig-steps li { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 14px; }
.aero-install-guide .aig-num {
  flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%; margin-top: 1px;
  background: linear-gradient(135deg,#6366f1,#06b6d4); color: #fff; font-weight: 800; font-size: 12px;
  display: flex; align-items: center; justify-content: center;
}
.aero-install-guide .aig-text { font-size: 14px; line-height: 1.6; color: var(--text-secondary); }
.aero-install-guide .aig-tip {
  padding: 12px 14px; margin-bottom: 18px;
  background: rgba(16,185,129,.08); border: 1px solid rgba(16,185,129,.25); border-radius: 12px;
  display: flex; gap: 10px; align-items: flex-start;
  font-size: 12.5px; color: var(--text-secondary); line-height: 1.55;
}
.aero-install-guide .aig-tip i { color: #10b981; flex-shrink: 0; margin-top: 2px; }
.aero-install-guide .aig-more { font-size: 13px; color: var(--text-secondary); margin: 0 0 18px; line-height: 1.55; }
.aero-install-guide .aig-more a { font-weight: 700; }
.aero-install-guide .aig-actions { display: flex; gap: 10px; justify-content: space-between; align-items: center; flex-wrap: wrap; }
.aero-install-guide .aig-link { font-size: 13px; font-weight: 600; color: var(--brand-600); text-decoration: none; }
.aero-install-guide .aig-link:hover { text-decoration: underline; }
[data-theme="dark"] .aero-install-guide .aig-link,
[data-theme="dim"]  .aero-install-guide .aig-link { color: var(--brand-300, #a5b4fc); }
.aero-install-guide .aig-close {
  margin-left: auto; padding: 11px 22px; border-radius: 10px;
  border: 1.5px solid var(--border-default); background: transparent; color: var(--text-secondary);
  font-family: inherit; font-size: 14px; font-weight: 600; cursor: pointer; transition: .2s;
}
.aero-install-guide .aig-close:hover { border-color: var(--brand-400, #818cf8); color: var(--text-primary); }
@keyframes aigFadeIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes aigSlideUp { from { opacity: 0; transform: translateY(20px) scale(.96); } to { opacity: 1; transform: translateY(0) scale(1); } }
@media (max-width: 520px) { .aero-install-guide .aig-card { padding: 24px 20px; } }

/* ============================================================
   ⚡ PDF READER — progressive background rendering (2026-10-07)
   ============================================================ */
/* Light snapshot shown until the sharp page (canvas + text) is drawn */
.pdfv-snap {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  display: block; background: #fff;
  pointer-events: none;
  -webkit-touch-callout: none !important;
  -webkit-user-select: none !important; user-select: none !important;
  -webkit-user-drag: none !important;
}
/* "⚡ 42 / 310 pages ready" chip in the reader toolbar */
.pdfv-bgstatus {
  margin-left: 10px; padding: 3px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 600; white-space: nowrap;
  color: #c7d2fe; background: rgba(99,102,241,.16); border: 1px solid rgba(129,140,248,.28);
  font-variant-numeric: tabular-nums;
  transition: opacity .3s ease;
}
.pdfv-bgstatus.is-done { color: #6ee7b7; background: rgba(16,185,129,.14); border-color: rgba(16,185,129,.35); }
.pdfv-bgstatus[hidden] { display: none !important; }
@media (max-width: 760px) { .pdfv-bgstatus { display: none !important; } }

/* ⚡ Admin overview — last known student count while the fresh one loads */
#statStudents.is-stale { opacity: .72; transition: opacity .25s ease; }

/* Quiz result — an uploaded PDF answer (was a broken image) */
.subjective-result-thumbs .subjective-result-pdf {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  width: 96px; height: 96px; padding: 8px; border-radius: 10px; text-decoration: none;
  background: var(--bg-surface-2); border: 1px solid var(--border-subtle); color: var(--text-secondary);
  font-size: 11px; text-align: center; overflow: hidden; cursor: pointer;
  transition: border-color .15s ease, transform .15s ease;
}
.subjective-result-thumbs .subjective-result-pdf i { font-size: 26px; color: #ef4444; }
.subjective-result-thumbs .subjective-result-pdf span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.subjective-result-thumbs .subjective-result-pdf:hover { border-color: var(--brand-400, #818cf8); transform: translateY(-1px); }

/* ============================================================
   ⚡ PDF READER — instant open (2026-10-07)
   ============================================================ */
/* Pages wider than the screen used to be centred with their left edge
   unreachable; auto margins centre them and still allow scrolling. */
.pdfv-pages { align-items: flex-start; }
.pdfv-pages > * { margin-left: auto; margin-right: auto; }

/* Opening state: a page-shaped placeholder instead of a spinner */
.pdfv-loader { background: #131727; justify-content: flex-start; padding-top: 22px; gap: 14px; }
.pdfv-loader > p { font-size: 12.5px; color: rgba(255,255,255,.6); margin: 0; }
.pdfv-skel-sheet {
  position: relative; overflow: hidden;
  width: min(calc(100% - 16px), 714px); aspect-ratio: 595 / 842; max-height: calc(100% - 70px);
  background: #fff; border-radius: 4px; box-shadow: 0 12px 40px rgba(0,0,0,.5);
  padding: 9% 8%; display: flex; flex-direction: column; gap: 4.2%;
}
.pdfv-skel-sheet i { display: block; height: 2.2%; min-height: 8px; border-radius: 4px; background: #e9ecf3; }
.pdfv-skel-sheet i:nth-child(1) { width: 55%; height: 3.2%; background: #dfe3ec; }
.pdfv-skel-sheet i:nth-child(3n) { width: 82%; }
.pdfv-skel-sheet i:nth-child(4n) { width: 68%; }
.pdfv-skel-sheet::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 20%, rgba(99,102,241,.08) 50%, transparent 80%);
  transform: translateX(-100%); animation: pdfvSkelShimmer 1.4s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) { .pdfv-skel-sheet::after { animation: none; } }
@media (max-width: 760px) { .pdfv-loader { padding-top: 14px; } }

/* ============================================================
   ⭐ PROFESSOR ROLE (2026-10-07)
   ============================================================ */
/* Professor mode: admin-only fields and every remove / delete control
   are hidden (the server refuses them too). */
/* ⭐ 2026-10-17 — professors now delete / rename content in their own courses too;
   still hidden: admin-only fields, the course ZIP, publishing results, who viewed a file */
body.aero-prof .admin-only,
body.aero-prof [onclick^="downloadCourseZip"],
body.aero-prof [onclick^="publishQuizResultsNow"],
body.aero-prof [onclick*="openMaterialViewers"] { display: none !important; }

/* login: three role buttons fit on small phones */
.login-role-toggle button { min-width: 0; }
@media (max-width: 420px) { .login-role-toggle button { font-size: 12.5px; padding-left: 6px; padding-right: 6px; } }

/* registration modal */
.prof-reg-box { max-width: 720px; width: 100%; max-height: calc(100vh - 32px); overflow-y: auto; }
.prof-reg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.prof-reg-section { margin: 14px 0 8px; font-size: 12px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; color: var(--brand-600); display: flex; gap: 8px; align-items: center; }
[data-theme="dark"] .prof-reg-section, [data-theme="dim"] .prof-reg-section { color: var(--brand-300, #a5b4fc); }
@media (max-width: 640px) { .prof-reg-grid { grid-template-columns: 1fr; } }

/* small dialogs */
.aero-dialog-ov { position: fixed; inset: 0; z-index: 10050; background: rgba(10,14,31,.6); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 16px; animation: aigFadeIn .15s ease-out; }
.aero-dialog { background: var(--bg-surface); color: var(--text-primary); border: 1px solid var(--border-subtle); border-radius: 16px;
  max-width: 440px; width: 100%; padding: 22px; box-shadow: 0 24px 60px rgba(0,0,0,.35); }
.aero-dialog h3 { margin: 0 0 8px; font-size: 18px; }
.aero-dialog p { margin: 0 0 16px; color: var(--text-secondary); line-height: 1.55; font-size: 14px; }
.aero-dialog-icon { width: 46px; height: 46px; border-radius: 14px; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--brand-500), var(--accent-500, #06b6d4)); color: #fff; font-size: 20px; margin-bottom: 12px; }
.aero-dialog-label { display: block; font-size: 13px; color: var(--text-secondary); margin-bottom: 6px; }
.aero-dialog textarea { width: 100%; box-sizing: border-box; margin-bottom: 14px; }
.aero-dialog-actions { display: flex; gap: 10px; justify-content: flex-end; }
.aero-shake { animation: aeroShake .35s; border-color: var(--rose-500, #f43f5e) !important; }
@keyframes aeroShake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }

/* professor dashboard */
#professorContent { max-width: 1180px; margin: 0 auto; padding: 8px 0 40px; }
.prof-hero { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding: 22px; border-radius: 18px; margin-bottom: 18px;
  background: linear-gradient(135deg, rgba(99,102,241,.12), rgba(6,182,212,.08)); border: 1px solid color-mix(in srgb, var(--brand-500) 22%, var(--border-subtle)); }
.prof-hero-avatar { width: 60px; height: 60px; border-radius: 18px; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  background: linear-gradient(135deg, var(--brand-600), var(--accent-500, #06b6d4)); color: #fff; font-weight: 800; font-size: 20px; }
.prof-hero-text { flex: 1 1 260px; min-width: 0; }
.prof-hero-text h2 { margin: 6px 0 4px; font-size: 22px; }
.prof-hero-text p { margin: 0; color: var(--text-secondary); }
.prof-hero-stats { display: flex; gap: 12px; }
.prof-hero-stats > div { background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: 14px; padding: 10px 16px; text-align: center; min-width: 92px; }
.prof-hero-stats strong { display: block; font-size: 22px; }
.prof-hero-stats span { font-size: 12px; color: var(--text-tertiary); }
.prof-chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; }
.prof-chip.ok { background: rgba(16,185,129,.14); color: #059669; }
.prof-chip.wait { background: rgba(245,158,11,.16); color: #b45309; }
.prof-chip.bad { background: rgba(244,63,94,.14); color: #e11d48; }
[data-theme="dark"] .prof-chip.ok, [data-theme="dim"] .prof-chip.ok { color: #6ee7b7; }
[data-theme="dark"] .prof-chip.wait, [data-theme="dim"] .prof-chip.wait { color: #fcd34d; }
[data-theme="dark"] .prof-chip.bad, [data-theme="dim"] .prof-chip.bad { color: #fda4af; }
.prof-tabs, .pa-subtabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.prof-tabs button, .pa-subtabs button { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border-subtle); background: var(--bg-surface); color: var(--text-secondary); font: inherit; font-weight: 600; font-size: 13.5px; }
.prof-tabs button.active, .pa-subtabs button.active { background: linear-gradient(135deg, var(--brand-500), var(--brand-600)); color: #fff; border-color: transparent; }
.prof-course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.prof-course-card { background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; }
.prof-course-top { padding: 18px; color: #fff; background: linear-gradient(135deg, var(--brand-600), var(--accent-500, #06b6d4)); }
.prof-course-top h3 { margin: 6px 0 0; font-size: 17px; color: #fff; }
.prof-course-top .course-code { font-size: 11.5px; font-weight: 700; opacity: .9; }
.prof-course-body { padding: 14px 18px 18px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.prof-course-meta { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-tertiary); }
.prof-course-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }
.prof-empty .btn { margin-top: 10px; }
.prof-rules { display: flex; gap: 12px; align-items: flex-start; margin-top: 20px; padding: 14px 16px; border-radius: 14px; font-size: 13.5px; line-height: 1.55;
  background: rgba(16,185,129,.07); border: 1px solid rgba(16,185,129,.22); color: var(--text-secondary); }
.prof-rules > i { color: #10b981; margin-top: 3px; }
.prof-grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 16px; align-items: start; }
@media (max-width: 860px) { .prof-grid-2 { grid-template-columns: 1fr; } }
.prof-req-list { display: flex; flex-direction: column; gap: 10px; }
.prof-req { padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border-subtle); background: var(--bg-surface-2, transparent); }
.prof-req-top { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.prof-req-top .prof-chip { margin-left: auto; }
.prof-req-meta { font-size: 12px; color: var(--text-tertiary); margin-top: 4px; }
.prof-req-note { font-size: 13px; margin-top: 8px; display: flex; gap: 8px; align-items: baseline; }
.prof-req-note.ok { color: #059669; } .prof-req-note.bad { color: #e11d48; }

/* admin: Professor Access */
.pa-intro { padding: 12px 14px; border-radius: 12px; margin-bottom: 14px; font-size: 13.5px; color: var(--text-secondary);
  background: rgba(99,102,241,.07); border: 1px solid rgba(99,102,241,.2); }
.pa-card { background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: 14px; padding: 16px 18px; margin-bottom: 12px; }
.pa-card-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: flex-start; margin-bottom: 10px; }
.pa-card-head h4 { margin: 0 0 6px; font-size: 16px; }
.pa-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.pa-details { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px 16px; font-size: 13px; }
.pa-details span { display: block; color: var(--text-tertiary); font-size: 11.5px; }
.pa-details strong { font-weight: 600; word-break: break-word; }
.pa-bio { margin: 10px 0 0; font-size: 13.5px; color: var(--text-secondary); line-height: 1.5; }
.pa-sub { font-size: 12.5px; color: var(--text-tertiary); }
.pa-warn { color: #b45309; font-size: 13px; }
.pa-grant { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 12px 0; }
.pa-grant label { font-size: 13px; font-weight: 600; color: var(--text-secondary, #555); }
.pa-grant select { min-width: 260px; max-width: 100%; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--border-default, #d8dbe6); background: var(--bg-surface, #fff); color: var(--text-primary, #1a1a2e); font: inherit; font-size: 13.5px; }
@media (max-width: 600px) { .pa-grant select { min-width: 0; width: 100%; } }
.pa-match { font-size: 12px; color: #059669; } .pa-match.none { color: var(--text-tertiary); }
.pa-courses { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; font-size: 13px; }
.pa-course-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 12px; border-radius: 999px; background: rgba(99,102,241,.1); font-weight: 600; font-size: 12.5px; }
.pa-course-chip button { border: 0; background: transparent; color: inherit; cursor: pointer; width: 22px; height: 22px; border-radius: 50%; }
.pa-course-chip button:hover { background: rgba(244,63,94,.15); color: #e11d48; }
.pa-hist { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 8px 0; border-bottom: 1px solid var(--border-subtle); font-size: 13.5px; }

/* ==========================================================================
   ⭐ 2026-10-08 — LOGIN REDESIGN · OTP CODE BOXES · PROFESSOR WORKSPACE
   (scoped classes: .lg-*, .otp-*, .pw-*, .adm-dev-*)
   ========================================================================== */

/* ---------- login: split card ---------- */
#loginView .login-card.lg-shell {
  max-width: 1020px; width: 100%; margin: 3vh auto 4vh; padding: 0;
  display: grid; grid-template-columns: minmax(0, 1.02fr) minmax(0, 1fr);
  min-height: 600px; border-radius: 26px;
}
#loginView .lg-shell::before { display: none; }

.lg-brand {
  position: relative; overflow: hidden; color: #eef0ff;
  padding: 40px 40px 34px; display: flex; flex-direction: column; gap: 28px;
  background:
    radial-gradient(120% 70% at 100% 0%, rgba(34,211,238,.28) 0%, rgba(34,211,238,0) 55%),
    radial-gradient(90% 60% at 0% 100%, rgba(245,158,11,.20) 0%, rgba(245,158,11,0) 60%),
    linear-gradient(160deg, #1e1b4b 0%, #312e81 48%, #4338ca 100%);
}
.lg-orbit { position: absolute; width: 520px; height: 520px; right: -170px; top: -150px; color: rgba(199,210,254,.32); pointer-events: none; }
.lg-orbit .lg-sat { transform-origin: 200px 200px; animation: lgOrbit 26s linear infinite; color: #67e8f9; }
@keyframes lgOrbit { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .lg-orbit .lg-sat { animation: none; } }
.lg-brand-top { position: relative; display: flex; align-items: center; gap: 14px; }
.lg-brand .login-icon.lg-mark {
  width: 48px; height: 48px; margin: 0; border-radius: 14px; font-size: 20px; flex-shrink: 0;
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.22);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18); backdrop-filter: blur(4px);
}
/* 2026-10-10 — the AeroGyan logo on a white tile (same as the header) */
.lg-brand .login-icon.lg-mark { background: #fff; border-color: rgba(255,255,255,.6); padding: 7px; box-shadow: 0 6px 18px rgba(0,0,0,.25); }
.lg-brand .login-icon.lg-mark svg { width: 100%; height: 100%; display: block; }
.lg-brand-name { display: block; font-size: 17px; font-weight: 700; letter-spacing: -.2px; color: #fff; }
.lg-brand-tag { display: block; font-size: 12.5px; color: rgba(224,231,255,.72); margin-top: 1px; }
.lg-brand-body { position: relative; margin-top: auto; }
.lg-brand-body h3 { font-size: 26px; line-height: 1.25; font-weight: 750; letter-spacing: -.5px; color: #fff; margin: 0 0 22px; max-width: 420px; }
.lg-points { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.lg-points li { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; line-height: 1.5; color: rgba(224,231,255,.82); }
.lg-points li strong { color: #fff; font-weight: 600; }
.lg-points li > i {
  width: 30px; height: 30px; border-radius: 9px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; color: #a5f3fc; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12);
}
.lg-brand-foot {
  position: relative; display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: rgba(224,231,255,.78);
  padding: 11px 14px; border-radius: 12px; background: rgba(15,12,48,.32); border: 1px solid rgba(255,255,255,.10);
}
.lg-brand-foot i { color: #fcd34d; }

.lg-panel { padding: 40px 42px 32px; display: flex; flex-direction: column; min-width: 0; }
.lg-head { margin-bottom: 22px; }
#loginView .lg-head h2 { text-align: left; font-size: 26px; font-weight: 750; letter-spacing: -.5px; margin: 0; }
#loginView .lg-head .sub { text-align: left; margin: 6px 0 0; font-size: 14px; }

/* role switch with a sliding pill */
#loginView .login-role-toggle { position: relative; gap: 0; padding: 4px; margin-bottom: 22px; border-radius: 14px; }
#loginView .lg-role-pill {
  position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc((100% - 8px) / var(--lg-n, 3)); border-radius: 10px;
  background: var(--bg-surface); box-shadow: 0 1px 2px rgba(20,22,28,.08), 0 4px 12px rgba(20,22,28,.08);
  transform: translateX(calc(var(--lg-i, 0) * 100%)); transition: transform .32s cubic-bezier(.3,.7,.2,1);
}
#loginView .login-role-toggle button { position: relative; z-index: 1; padding: 10px 4px; border-radius: 10px; }
#loginView .login-role-toggle button.active { background: transparent; box-shadow: none; }
[data-theme="dark"] #loginView .lg-role-pill, [data-theme="dim"] #loginView .lg-role-pill { background: var(--bg-surface-2); box-shadow: 0 1px 0 rgba(255,255,255,.04), 0 4px 14px rgba(0,0,0,.35); }

#loginView .form-group { margin-bottom: 16px; }
#loginView .form-group label { font-weight: 600; }
#loginView .input-wrap input { height: 48px; border-radius: 12px; font-size: 15px; }
.lg-label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.lg-mini-link { font-size: 12.5px; font-weight: 600; color: var(--brand-600); text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.lg-mini-link:hover { text-decoration: underline; }
[data-theme="dark"] .lg-mini-link, [data-theme="dim"] .lg-mini-link { color: var(--brand-300); }
#loginView .lg-pass-wrap input { padding-right: 48px; }
.input-wrap .lg-eye {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; border-radius: 10px;
  border: 0; background: transparent; color: var(--text-tertiary); cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
}
.input-wrap .lg-eye:hover { background: var(--bg-surface-3); color: var(--text-primary); }
.input-wrap .lg-eye i { position: static; transform: none; left: auto; top: auto; pointer-events: none; font-size: 14px; color: inherit; }
.lg-caps { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 12px; font-weight: 600; color: #b45309; }
.lg-caps[hidden] { display: none; }

.lg-otp-note {
  display: flex; gap: 10px; align-items: flex-start; margin: 2px 0 16px; padding: 11px 13px; border-radius: 12px;
  font-size: 13px; line-height: 1.5; color: var(--text-secondary);
  background: color-mix(in srgb, var(--brand-500) 8%, transparent); border: 1px solid color-mix(in srgb, var(--brand-500) 24%, transparent);
  animation: fadeIn .25s ease;
}
.lg-otp-note[hidden] { display: none; }
.lg-otp-note i { color: var(--brand-600); margin-top: 2px; }
[data-theme="dark"] .lg-otp-note i, [data-theme="dim"] .lg-otp-note i { color: var(--brand-300); }
#loginView .lg-submit { height: 50px; border-radius: 12px; font-size: 15px; font-weight: 650; }
.lg-forgot-row { display: flex; justify-content: center; margin-top: 12px; }

#loginView .login-footer.lg-footer { border-top: 0; padding-top: 0; margin-top: auto; }
.lg-divider { display: flex; align-items: center; gap: 12px; margin: 22px 0 14px; font-size: 12px; color: var(--text-tertiary); font-weight: 600; letter-spacing: .3px; }
.lg-divider::before, .lg-divider::after { content: ""; height: 1px; flex: 1; background: var(--border-subtle); }
.lg-cta-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
#loginView .lg-cta { min-height: 44px; min-width: 0; padding: 6px 10px; border-radius: 12px; font-size: 13.5px; font-weight: 600; justify-content: center; white-space: normal; line-height: 1.25; }
.lg-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 18px; margin-top: 16px; }
#loginView .lg-links .link-inline { font-size: 13px; }
#loginView .lg-links .lg-alumni { color: var(--gold-600); }

@media (max-width: 880px) {
  #loginView .login-card.lg-shell { grid-template-columns: 1fr; max-width: 480px; min-height: 0; margin: 8px auto 24px; border-radius: 22px; }
  .lg-brand { padding: 18px 22px; gap: 0; }
  .lg-brand-top, .lg-points, .lg-brand-foot { display: none; }
  .lg-brand-body { margin: 0; }
  .lg-brand-body h3 { font-size: 16.5px; line-height: 1.4; margin: 0; letter-spacing: -.2px; max-width: 320px; }
  .lg-orbit { width: 300px; height: 300px; right: -90px; top: -110px; }
  .lg-panel { padding: 24px 22px 22px; }
  #loginView .lg-head h2 { font-size: 22px; }
}
@media (max-width: 420px) {
  .lg-cta-row { grid-template-columns: 1fr; }
  #loginView .login-role-toggle button i { display: none; }
}

/* ---------- OTP modal: six code boxes over one real input ---------- */
.otp-box .otp-badge {
  width: 60px; height: 60px; margin: 2px auto 14px; border-radius: 18px; display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 24px; background: linear-gradient(135deg, var(--brand-600), var(--accent-500));
  box-shadow: 0 12px 28px rgba(99,102,241,.32);
}
.otp-box .otp-label { text-align: center; display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .6px; color: var(--text-tertiary); }
.otp-field { position: relative; max-width: 340px; margin: 6px auto 0; }
.otp-field .otp-real-input {
  position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; margin: 0; padding: 0 !important; border: 0 !important;
  opacity: 0; color: transparent; caret-color: transparent; background: transparent !important; font-size: 16px; letter-spacing: 0; box-shadow: none !important;
}
.otp-cells { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.otp-cells span {
  height: 56px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--text-primary);
  background: var(--bg-surface-2); border: 1.5px solid var(--border-default, var(--border-subtle));
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.otp-cells span.filled { background: color-mix(in srgb, var(--brand-500) 7%, var(--bg-surface)); border-color: color-mix(in srgb, var(--brand-500) 45%, transparent); }
.otp-cells span.active { border-color: var(--brand-500); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand-500) 18%, transparent); }
.otp-cells span.active:empty::after { content: ""; width: 2px; height: 24px; background: var(--brand-500); animation: otpBlink 1s steps(1) infinite; }
@keyframes otpBlink { 50% { opacity: 0; } }
.otp-box .otp-expiry { text-align: center; display: block; margin-top: 12px; }
.otp-box .otp-expiry.expired { color: #e11d48; font-weight: 600; }
.otp-resend-row { justify-content: center; align-items: center; gap: 8px; margin-top: 8px; font-size: 13px; color: var(--text-tertiary); }
.otp-resend-row .link-inline { background: none; border: none; cursor: pointer; padding: 0; }
@media (max-width: 380px) { .otp-cells { gap: 6px; } .otp-cells span { height: 48px; font-size: 20px; } }

/* ---------- admin: signed-in devices ---------- */
.adm-dev-list { display: flex; flex-direction: column; gap: 10px; }
.adm-dev-loading, .adm-dev-empty { font-size: 13.5px; color: var(--text-tertiary); padding: 6px 0; }
.adm-dev-meter { height: 6px; border-radius: 99px; background: var(--bg-surface-3); overflow: hidden; }
.adm-dev-meter span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--brand-500), var(--accent-500)); }
.adm-dev-count { font-size: 12.5px; color: var(--text-tertiary); margin: -2px 0 2px; }
.adm-dev { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border-subtle); background: var(--bg-surface); }
.adm-dev.current { border-color: color-mix(in srgb, #10b981 40%, var(--border-subtle)); background: color-mix(in srgb, #10b981 5%, var(--bg-surface)); }
.adm-dev-ic { width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: var(--bg-surface-3); color: var(--brand-600); }
.adm-dev-info { flex: 1; min-width: 0; }
.adm-dev-info strong { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 14px; }
.adm-dev-info span { display: block; font-size: 12.5px; color: var(--text-tertiary); margin-top: 2px; overflow-wrap: anywhere; }
.adm-dev-actions { display: flex; justify-content: flex-end; }

/* ---------- professor workspace ---------- */
/* ⭐ 2026-10-24 — full width, like the admin dashboard (the app shell already keeps the side margins) */
#professorContent { max-width: none; width: 100%; }
.pw-hero {
  position: relative; overflow: hidden; display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap;
  padding: 26px 28px; border-radius: 22px; margin-bottom: 16px; color: #eef0ff;
  background:
    radial-gradient(80% 120% at 100% 0%, rgba(34,211,238,.30) 0%, rgba(34,211,238,0) 60%),
    linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #4f46e5 100%);
  box-shadow: 0 18px 40px rgba(49,46,129,.22);
}
.pw-hero::after {
  content: ""; position: absolute; width: 340px; height: 340px; right: -90px; bottom: -220px; border-radius: 50%;
  border: 1px dashed rgba(199,210,254,.28); pointer-events: none;
}
.pw-hero-main { display: flex; align-items: center; gap: 18px; min-width: 0; flex: 1 1 380px; position: relative; z-index: 1; }
.pw-avatar {
  width: 64px; height: 64px; border-radius: 20px; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 800; color: #1e1b4b; background: linear-gradient(135deg, #e0e7ff, #a5f3fc);
  box-shadow: 0 8px 22px rgba(0,0,0,.18);
}
.pw-hero-text { min-width: 0; }
.pw-hero-text h2 { margin: 8px 0 4px; font-size: 24px; letter-spacing: -.4px; color: #fff; }
.pw-hero-text p { margin: 0; color: rgba(224,231,255,.8); font-size: 14px; }
.pw-hero-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.pw-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; background: rgba(16,185,129,.22); color: #a7f3d0; border: 1px solid rgba(110,231,183,.3); }
.pw-chip.ghost { background: rgba(255,255,255,.08); color: #e0e7ff; border-color: rgba(255,255,255,.16); }
.pw-hero-actions { position: relative; z-index: 1; }
.btn.pw-btn-light { background: #fff; color: #312e81; border: 0; font-weight: 700; box-shadow: 0 6px 16px rgba(0,0,0,.18); }
.btn.pw-btn-light:hover { background: #eef2ff; }

.pw-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.pw-stat { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 16px; background: var(--bg-surface); border: 1px solid var(--border-subtle); }
.pw-stat strong { display: block; font-size: 22px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.pw-stat span:not(.pw-stat-ic) { font-size: 12.5px; color: var(--text-tertiary); }
.pw-stat-ic { width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 16px; }
.pw-stat-ic.c1 { background: rgba(99,102,241,.12); color: #4f46e5; }
.pw-stat-ic.c2 { background: rgba(6,182,212,.12); color: #0891b2; }
.pw-stat-ic.c3 { background: rgba(245,158,11,.14); color: #d97706; }
.pw-stat-ic.c4 { background: rgba(244,63,94,.12); color: #e11d48; }
[data-theme="dark"] .pw-stat-ic.c1, [data-theme="dim"] .pw-stat-ic.c1 { color: #a5b4fc; }
[data-theme="dark"] .pw-stat-ic.c2, [data-theme="dim"] .pw-stat-ic.c2 { color: #67e8f9; }
[data-theme="dark"] .pw-stat-ic.c3, [data-theme="dim"] .pw-stat-ic.c3 { color: #fcd34d; }
[data-theme="dark"] .pw-stat-ic.c4, [data-theme="dim"] .pw-stat-ic.c4 { color: #fda4af; }

.pw-tabs { display: flex; gap: 4px; padding: 4px; margin-bottom: 18px; border-radius: 14px; background: var(--bg-surface-3); width: fit-content; max-width: 100%; overflow-x: auto; }
.pw-tabs button {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 10px; border: 0; cursor: pointer; white-space: nowrap;
  background: transparent; color: var(--text-secondary); font: inherit; font-weight: 600; font-size: 13.5px;
}
.pw-tabs button.active { background: var(--bg-surface); color: var(--brand-600); box-shadow: 0 1px 2px rgba(20,22,28,.08), 0 4px 12px rgba(20,22,28,.06); }
[data-theme="dark"] .pw-tabs button.active, [data-theme="dim"] .pw-tabs button.active { color: var(--brand-300); background: var(--bg-surface-2); }

.pw-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.pw-section-title { margin: 0; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.pw-section-title span { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: var(--bg-surface-3); color: var(--text-secondary); }
.pw-search { position: relative; flex: 0 1 300px; }
.pw-search i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-tertiary); font-size: 13px; }
.pw-search input { width: 100%; padding: 0 12px 0 34px; height: 40px; border-radius: 10px; font: inherit; font-size: 14px;
  border: 1px solid var(--border-default, var(--border-subtle)); background: var(--bg-surface); color: var(--text-primary); outline: none; -webkit-appearance: none; appearance: none; }
.pw-search input:focus { border-color: var(--brand-500); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-500) 18%, transparent); }

.pw-course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.pw-course { background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: 18px; overflow: hidden; display: flex; flex-direction: column; transition: transform .18s, box-shadow .18s; }
.pw-course:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(20,22,28,.10); }
.pw-course[hidden] { display: none; }
.pw-course-top { position: relative; padding: 18px 18px 20px; color: #fff; background: linear-gradient(135deg, var(--accent-1, var(--brand-600)), var(--accent-2, var(--accent-500))); }
.pw-course-code { display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: .6px; padding: 3px 8px; border-radius: 6px; background: rgba(255,255,255,.2); }
.pw-course-top h3 { margin: 10px 0 0; font-size: 17px; line-height: 1.3; color: #fff; }
.pw-course-sem { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 12px; opacity: .9; }
.pw-course-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.pw-course-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.pw-course-stats > div { text-align: center; padding: 8px 4px; border-radius: 10px; background: var(--bg-surface-2); border: 1px solid var(--border-subtle); }
.pw-course-stats strong { display: block; font-size: 16px; font-variant-numeric: tabular-nums; }
.pw-course-stats span { font-size: 11px; color: var(--text-tertiary); }
.pw-course-upd { font-size: 12px; color: var(--text-tertiary); display: flex; gap: 6px; align-items: center; }
.pw-course-actions { display: grid; grid-template-columns: 1.3fr 1fr; gap: 8px; margin-top: auto; }
.pw-course-actions .btn { justify-content: center; }

.pw-empty { text-align: center; padding: 44px 20px; border-radius: 20px; border: 1.5px dashed var(--border-subtle); background: var(--bg-surface); }
.pw-empty-ic { width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 20px; display: flex; align-items: center; justify-content: center; font-size: 26px; color: var(--brand-600); background: rgba(99,102,241,.10); }
.pw-empty h3 { margin: 0 0 6px; font-size: 18px; }
.pw-empty p { margin: 0 auto 16px; max-width: 440px; color: var(--text-secondary); font-size: 14px; }
.pw-empty .pw-empty-note { color: #b45309; font-weight: 600; font-size: 13px; }
.pw-empty-mini { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 26px 10px; color: var(--text-tertiary); font-size: 13.5px; }
.pw-empty-mini[hidden] { display: none; }

.pw-rules { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 18px; }
.pw-rule { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 14px; font-size: 13px; line-height: 1.5; color: var(--text-secondary); }
.pw-rule strong { display: block; color: var(--text-primary); font-size: 13.5px; margin-bottom: 2px; }
.pw-rule > i { margin-top: 3px; }
.pw-rule.ok { background: rgba(16,185,129,.07); border: 1px solid rgba(16,185,129,.22); }
.pw-rule.ok > i { color: #10b981; }
.pw-rule.lock { background: var(--bg-surface-2); border: 1px solid var(--border-subtle); }
.pw-rule.lock > i { color: var(--text-tertiary); }

.pw-grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 16px; align-items: start; }
.pw-card { background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: 18px; padding: 20px; }
.pw-card-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 16px; }
.pw-card-head h3 { margin: 0 0 3px; font-size: 16px; }
.pw-card-head p { margin: 0; font-size: 13px; color: var(--text-secondary); line-height: 1.5; }
.pw-card-ic { width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: rgba(99,102,241,.12); color: #4f46e5; }
.pw-card-ic.alt { background: rgba(6,182,212,.12); color: #0891b2; }
[data-theme="dark"] .pw-card-ic, [data-theme="dim"] .pw-card-ic { color: #a5b4fc; }
[data-theme="dark"] .pw-card-ic.alt, [data-theme="dim"] .pw-card-ic.alt { color: #67e8f9; }
.pw-form-row { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: 12px; }
.pw-optional { font-weight: 500; font-size: 11.5px; color: var(--text-tertiary); margin-left: 4px; }

.pw-req-list { display: flex; flex-direction: column; gap: 10px; }
.pw-req { display: flex; gap: 12px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border-subtle); background: var(--bg-surface-2); }
.pw-req-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 6px; flex-shrink: 0; background: #f59e0b; box-shadow: 0 0 0 4px rgba(245,158,11,.15); }
.pw-req.ok .pw-req-dot { background: #10b981; box-shadow: 0 0 0 4px rgba(16,185,129,.15); }
.pw-req.bad .pw-req-dot { background: #f43f5e; box-shadow: 0 0 0 4px rgba(244,63,94,.15); }
.pw-req-body { flex: 1; min-width: 0; }
.pw-req-top { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pw-req-name { color: var(--text-secondary); min-width: 0; overflow-wrap: anywhere; }
.pw-req-top .prof-chip { margin-left: auto; }
.pw-req-meta { font-size: 12px; color: var(--text-tertiary); margin-top: 3px; }
.pw-req-msg { font-size: 13px; color: var(--text-secondary); margin-top: 6px; font-style: italic; overflow-wrap: anywhere; }

.pw-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; }
.pw-field { min-width: 0; padding: 10px 12px; border-radius: 10px; background: var(--bg-surface-2); border: 1px solid var(--border-subtle); }
.pw-field span { display: flex; gap: 6px; align-items: center; font-size: 11.5px; color: var(--text-tertiary); margin-bottom: 2px; }
.pw-field strong { font-weight: 600; font-size: 13.5px; overflow-wrap: anywhere; }
.pw-bio { margin-top: 14px; }
.pw-bio span { font-size: 11.5px; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: .5px; font-weight: 700; }
.pw-bio p { margin: 4px 0 0; font-size: 14px; line-height: 1.6; color: var(--text-secondary); }
.pw-checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.pw-checks li { display: flex; gap: 12px; align-items: flex-start; font-size: 13.5px; line-height: 1.5; color: var(--text-secondary); }
.pw-checks li strong { color: var(--text-primary); }
.pw-checks li > i { width: 32px; height: 32px; border-radius: 10px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; background: rgba(16,185,129,.12); color: #059669; }

@media (max-width: 960px) { .pw-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .pw-grid-2 { grid-template-columns: 1fr; } }
@media (max-width: 640px) {
  .pw-hero { padding: 20px; border-radius: 18px; }
  .pw-hero-text h2 { font-size: 20px; }
  .pw-avatar { width: 52px; height: 52px; border-radius: 16px; font-size: 18px; }
  .pw-hero-actions, .pw-hero-actions .btn { width: 100%; justify-content: center; }
  .pw-rules, .pw-fields, .pw-form-row { grid-template-columns: 1fr; }
  .pw-tabs { width: 100%; }
  .pw-tabs button { flex: 1 0 auto; justify-content: center; padding: 9px 10px; font-size: 13px; }
  .pw-tabs button > i { display: none; }
  .pw-search { flex: 1 1 100%; }
}

/* ==========================================================================
   ⭐ 2026-10-08 — AI SOLVER MODEL PICKER (.ai-model-btn, .ai-mm-*)
   ========================================================================== */
.ai-tool-btn.ai-model-btn { max-width: 240px; gap: 7px; }
.ai-model-btn .ai-model-btn-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.ai-model-btn > .fa-wand-magic-sparkles { color: var(--brand-500); }
.ai-model-btn .ai-model-chev { font-size: 10px; opacity: .6; transition: transform .2s; }
.ai-model-btn[aria-expanded="true"] .ai-model-chev { transform: rotate(180deg); }
.ai-model-btn.is-custom { border-color: color-mix(in srgb, var(--brand-500) 55%, var(--border-default)); color: var(--brand-600); background: color-mix(in srgb, var(--brand-500) 7%, var(--bg-surface)); }
[data-theme="dark"] .ai-model-btn.is-custom, [data-theme="dim"] .ai-model-btn.is-custom { color: var(--brand-300); }
@media (max-width: 720px) {
  .ai-tool-btn.ai-model-btn { width: auto; padding: 0 10px; max-width: 150px; }
  .ai-tool-btn.ai-model-btn span { display: inline; }
}

.ai-mm-ov { position: fixed; inset: 0; z-index: 10040; background: transparent; }
.ai-mm {
  position: fixed; z-index: 10041; display: flex; flex-direction: column; overflow: hidden;
  background: var(--bg-surface); color: var(--text-primary); border: 1px solid var(--border-subtle); border-radius: 16px;
  box-shadow: 0 24px 60px rgba(15,23,42,.22), 0 2px 8px rgba(15,23,42,.08); animation: aiMmIn .16s ease-out;
}
[data-theme="dark"] .ai-mm, [data-theme="dim"] .ai-mm { box-shadow: 0 24px 60px rgba(0,0,0,.6); }
@keyframes aiMmIn { from { opacity: 0; transform: translateY(6px) scale(.985); } to { opacity: 1; transform: none; } }
.ai-mm.is-sheet { left: 0 !important; right: 0; bottom: 0 !important; top: auto !important; width: auto !important; max-height: 82vh !important;
  border-radius: 20px 20px 0 0; padding-bottom: env(safe-area-inset-bottom); animation: aiMmSheet .2s ease-out; }
@keyframes aiMmSheet { from { transform: translateY(30px); opacity: .4; } to { transform: none; opacity: 1; } }
.ai-mm-ov.is-dim { background: rgba(2,6,23,.45); }
.ai-mm-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 14px 16px 10px; border-bottom: 1px solid var(--border-subtle); }
.ai-mm-head strong { display: block; font-size: 15px; }
.ai-mm-head span { display: block; font-size: 12px; color: var(--text-tertiary); margin-top: 2px; }
.ai-mm-close { width: 32px; height: 32px; border-radius: 9px; border: 0; background: transparent; color: var(--text-tertiary); cursor: pointer; flex-shrink: 0; }
.ai-mm-close:hover { background: var(--bg-surface-3); color: var(--text-primary); }
.ai-mm-body { overflow-y: auto; padding: 6px; flex: 1; min-height: 0; overscroll-behavior: contain; }
.ai-mm-group { font-size: 11px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--text-tertiary); padding: 12px 10px 4px; }
.ai-mm-item {
  width: 100%; display: flex; align-items: flex-start; gap: 12px; text-align: left; padding: 10px 10px; border-radius: 12px;
  border: 1px solid transparent; background: transparent; color: inherit; font: inherit; cursor: pointer;
}
.ai-mm-item:hover, .ai-mm-item:focus-visible { background: var(--bg-surface-2); outline: none; border-color: var(--border-subtle); }
.ai-mm-item.is-on { background: color-mix(in srgb, var(--brand-500) 8%, var(--bg-surface)); border-color: color-mix(in srgb, var(--brand-500) 35%, transparent); }
.ai-mm-item.is-busy .ai-mm-name { opacity: .85; }
.ai-mm-radio { width: 18px; height: 18px; border-radius: 50%; flex-shrink: 0; margin-top: 2px; border: 2px solid var(--border-default, #cbd5e1); position: relative; }
.ai-mm-item.is-on .ai-mm-radio { border-color: var(--brand-500); }
.ai-mm-item.is-on .ai-mm-radio::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--brand-500); }
.ai-mm-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ai-mm-name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 650; font-size: 14px; }
.ai-mm-name > i { color: var(--brand-500); }
.ai-mm-desc { font-size: 12.5px; color: var(--text-secondary); line-height: 1.45; }
.ai-mm-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 2px; }
.ai-mm-tags:empty { display: none; }
.ai-mm-tag { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 999px; background: var(--bg-surface-3); color: var(--text-secondary); }
.ai-mm-tag i { font-size: 9.5px; }
.ai-mm-tag-fast { color: #b45309; background: rgba(245,158,11,.13); }
.ai-mm-tag-reasoning { color: #6d28d9; background: rgba(139,92,246,.13); }
.ai-mm-tag-files, .ai-mm-tag-images { color: #0e7490; background: rgba(6,182,212,.13); }
[data-theme="dark"] .ai-mm-tag-fast, [data-theme="dim"] .ai-mm-tag-fast { color: #fcd34d; }
[data-theme="dark"] .ai-mm-tag-reasoning, [data-theme="dim"] .ai-mm-tag-reasoning { color: #c4b5fd; }
[data-theme="dark"] .ai-mm-tag-files, [data-theme="dim"] .ai-mm-tag-files,
[data-theme="dark"] .ai-mm-tag-images, [data-theme="dim"] .ai-mm-tag-images { color: #67e8f9; }
.ai-mm-rec { font-size: 10.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; color: #fff; background: linear-gradient(135deg, var(--brand-500), var(--accent-500)); }
.ai-mm-busy { font-size: 11px; font-weight: 700; color: #b45309; display: inline-flex; align-items: center; gap: 4px; }
/* ⭐ 2026-10-28 — AI units: what each answer costs, what is left today */
.ai-mm-cost { margin-left: 8px; font-size: 10.5px; font-weight: 700; padding: 1px 7px; border-radius: 99px; background: color-mix(in srgb, var(--brand-500) 13%, transparent); color: var(--brand-600); vertical-align: 1px; }
[data-theme="dark"] .ai-mm-cost, [data-theme="dim"] .ai-mm-cost { color: var(--brand-300); }
.ai-mm-cost.is-dear { background: color-mix(in srgb, #f59e0b 16%, transparent); color: #b45309; }
.ai-mm-item.is-dear .ai-mm-name { opacity: .7; }
.ai-mm-units { display: block; margin-top: 4px; font-size: 12px; color: var(--text-secondary); } .ai-mm-units b { color: var(--text-primary); }
[data-theme="dark"] .ai-mm-busy, [data-theme="dim"] .ai-mm-busy { color: #fcd34d; }
.ai-mm-loading { padding: 18px; text-align: center; color: var(--text-tertiary); font-size: 13px; }
.ai-mm-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 10px 14px 12px; border-top: 1px solid var(--border-subtle); font-size: 11.5px; color: var(--text-tertiary); }
.ai-mm-foot > span { display: flex; gap: 6px; align-items: baseline; flex: 1 1 220px; line-height: 1.45; }
.ai-mm-test { border: 1px solid var(--border-default); background: var(--bg-surface); color: var(--text-secondary); border-radius: 9px; padding: 6px 10px; font: inherit; font-size: 12px; font-weight: 650; cursor: pointer; white-space: nowrap; }
.ai-mm-test:hover:not(:disabled) { border-color: var(--brand-400); color: var(--brand-600); }

/* answer notes + error actions */
.ai-msg-note-model { color: var(--text-secondary); }
.ai-msg-note-model i { color: var(--brand-500); }
.ai-error-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.ai-error-actions .ai-retry-btn { margin-top: 8px; }
.ai-retry-btn.ai-retry-auto, .ai-retry-btn.ai-retry-pick { border-color: var(--border-default); color: var(--text-secondary); }
.ai-retry-btn.ai-retry-auto:hover, .ai-retry-btn.ai-retry-pick:hover { border-color: var(--brand-400); color: var(--brand-600); }

/* admin health check dialog */
.ai-test-keys { display: block; font-size: 13px; margin-bottom: 10px; }
.ai-test-list { display: flex; flex-direction: column; gap: 6px; max-height: 50vh; overflow-y: auto; }
.ai-test-row { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--border-subtle); text-align: left; }
.ai-test-row > i { margin-top: 3px; }
.ai-test-row.ok > i { color: #10b981; } .ai-test-row.bad > i { color: #ef4444; }
.ai-test-row strong { display: block; font-size: 13.5px; color: var(--text-primary); }
.ai-test-row span { display: block; font-size: 12px; color: var(--text-tertiary); overflow-wrap: anywhere; }
.ai-test-note { display: block; margin-top: 10px; font-size: 12px; color: #b45309; }
@media (prefers-reduced-motion: reduce) { .ai-mm, .ai-mm.is-sheet { animation: none; } }

/* ==========================================================================
   ⭐ 2026-10-08 — SPACE THEME
   <html data-theme="dark" data-skin="space">
   Rides on the dark theme (every [data-theme="dark"] rule still applies)
   and swaps in a deep-space palette, nebula light, a starfield that
   twinkles, an occasional shooting star and a ringed-planet switch.
   ========================================================================== */
html[data-skin="space"] {
  color-scheme: dark;
  /* luminous violet-indigo brand on deep navy */
  --brand-50: #f3f0ff; --brand-100: #e9e4ff; --brand-200: #d6ccff; --brand-300: #b9aaff;
  --brand-400: #9d8cff; --brand-500: #8070ff; --brand-600: #6a55f5; --brand-700: #5a3fd9;
  --brand-800: #4630b0; --brand-900: #2e1f7a;
  --accent-300: #7df3ff; --accent-400: #3fe0f5; --accent-500: #19c6e6; --accent-600: #0ea5c6;
  --space-nebula-1: rgba(139, 92, 246, .30);
  --space-nebula-2: rgba(34, 211, 238, .16);
  --space-nebula-3: rgba(236, 72, 153, .13);

  --bg-page: #050816;
  --bg-page-accent-1: rgba(139, 92, 246, .22);
  --bg-page-accent-2: rgba(34, 211, 238, .12);
  --bg-surface: #0d1230;
  --bg-surface-2: #121838;
  --bg-surface-3: #1a2147;
  --bg-elevated: #141b3e;

  --border-subtle: #1e2655;
  --border-default: #2a3369;
  --border-strong: #3d4786;

  --text-primary: #eef0ff;
  --text-secondary: #b7bce8;
  --text-tertiary: #858cc0;
  --text-inverse: #050816;

  --shadow-xs: 0 1px 2px rgba(1, 2, 12, .6);
  --shadow-sm: 0 1px 3px rgba(1, 2, 12, .65), inset 0 1px 0 rgba(255, 255, 255, .03);
  --shadow-md: 0 10px 28px rgba(1, 2, 14, .6), inset 0 1px 0 rgba(255, 255, 255, .04);
  --shadow-lg: 0 22px 54px rgba(1, 2, 14, .65), 0 0 0 1px rgba(157, 140, 255, .06);
  --shadow-xl: 0 34px 80px rgba(1, 2, 14, .75), 0 0 0 1px rgba(157, 140, 255, .08);

  --header-bg: rgba(6, 8, 26, .62);
  --header-border: rgba(157, 140, 255, .22);
}

/* ---------- sky: deep gradient + three nebulae + a planet on the horizon ---------- */
html[data-skin="space"] body {
  background:
    radial-gradient(circle at 104% 112%, #120c3a 0 230px, rgba(167, 139, 250, .55) 232px, rgba(103, 232, 249, .18) 240px, transparent 300px),
    radial-gradient(1000px 640px at 88% -8%, var(--space-nebula-1), transparent 62%),
    radial-gradient(820px 560px at -6% 38%, var(--space-nebula-2), transparent 60%),
    radial-gradient(760px 520px at 55% 118%, var(--space-nebula-3), transparent 62%),
    linear-gradient(180deg, #04060f 0%, #070a20 45%, #0b0a26 100%);
  background-attachment: fixed;
}

/* the app shell is see-through in Space so the sky shows between cards */
html[data-skin="space"] #app { background: transparent; box-shadow: none; }

/* static star dust (3 densities, tiled at different sizes so it never looks like a grid) */
html[data-skin="space"] body::before,
html[data-skin="space"] body::after {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-repeat: repeat;
}
html[data-skin="space"] body::before {
  background-image:
    radial-gradient(1px 1px at 12px 24px, rgba(255,255,255,.75), transparent 60%),
    radial-gradient(1px 1px at 88px 140px, rgba(255,255,255,.55), transparent 60%),
    radial-gradient(1px 1px at 160px 60px, rgba(199,210,254,.7), transparent 60%),
    radial-gradient(1px 1px at 210px 190px, rgba(255,255,255,.5), transparent 60%),
    radial-gradient(1px 1px at 46px 210px, rgba(186,230,253,.6), transparent 60%),
    radial-gradient(1.2px 1.2px at 130px 230px, rgba(255,255,255,.65), transparent 60%),
    radial-gradient(1px 1px at 236px 98px, rgba(233,213,255,.6), transparent 60%),
    radial-gradient(1.5px 1.5px at 60px 90px, rgba(255,255,255,.85), transparent 60%),
    radial-gradient(1px 1px at 180px 12px, rgba(255,255,255,.45), transparent 60%);
  background-size: 250px 250px, 310px 310px, 230px 230px, 270px 270px, 190px 190px, 330px 330px, 210px 210px, 290px 290px, 170px 170px;
  opacity: .95;
}
/* brighter stars that twinkle */
html[data-skin="space"] body::after {
  background-image:
    radial-gradient(1.8px 1.8px at 40px 60px, #fff, transparent 70%),
    radial-gradient(2px 2px at 300px 120px, rgba(253,230,138,.95), transparent 70%),
    radial-gradient(1.6px 1.6px at 190px 330px, rgba(165,243,252,.95), transparent 70%),
    radial-gradient(2.2px 2.2px at 420px 260px, #fff, transparent 70%),
    radial-gradient(1.6px 1.6px at 90px 410px, rgba(221,214,254,.95), transparent 70%),
    radial-gradient(1.8px 1.8px at 360px 440px, #fff, transparent 70%),
    radial-gradient(1.4px 1.4px at 250px 30px, rgba(255,255,255,.9), transparent 70%);
  background-size: 480px 480px;
  will-change: opacity;
  animation: spaceTwinkle 5.5s ease-in-out infinite alternate;
}
@keyframes spaceTwinkle {
  0%   { opacity: .35; }
  45%  { opacity: 1; }
  70%  { opacity: .55; }
  100% { opacity: .95; }
}

/* a shooting star every ~14 s */
html[data-skin="space"]::after {
  content: ""; position: fixed; z-index: -1; pointer-events: none;
  top: 12vh; left: 70vw; width: 160px; height: 1.5px; border-radius: 2px;
  background: linear-gradient(90deg, rgba(255,255,255,0), rgba(255,255,255,.95));
  filter: drop-shadow(0 0 6px rgba(186,230,253,.9));
  transform: rotate(-24deg) translateX(0); opacity: 0;
  animation: spaceShoot 14s linear infinite; animation-delay: 3s;
}
@keyframes spaceShoot {
  0%   { opacity: 0; transform: rotate(-24deg) translateX(0); }
  1%   { opacity: 1; }
  7%   { opacity: 0; transform: rotate(-24deg) translateX(-55vw); }
  100% { opacity: 0; transform: rotate(-24deg) translateX(-55vw); }
}

/* ---------- glass header with a starlight edge ---------- */
html[data-skin="space"] #appHeader {
  background: rgba(5, 7, 24, .6);
  backdrop-filter: blur(22px) saturate(170%);
  -webkit-backdrop-filter: blur(22px) saturate(170%);
  border-bottom: 1px solid transparent;
  border-image: linear-gradient(90deg, rgba(167,139,250,0) 0%, rgba(167,139,250,.65) 30%, rgba(103,232,249,.65) 65%, rgba(253,230,138,0) 100%) 1;
  box-shadow: 0 10px 30px rgba(1, 2, 14, .45);
}
html[data-skin="space"] #appHeader #mainNav { background: transparent; }
html[data-skin="space"] .mobile-bottom-nav {
  background: rgba(6, 8, 26, .9);
  border-top-color: rgba(157, 140, 255, .22);
}

/* ---------- hero banners become nebula windows ---------- */
html[data-skin="space"] .hero-section,
html[data-skin="space"] .ai-home-hero,
html[data-skin="space"] .pw-hero {
  background:
    radial-gradient(520px 260px at 92% -10%, rgba(192, 132, 252, .38), transparent 62%),
    radial-gradient(460px 260px at -4% 110%, rgba(34, 211, 238, .24), transparent 62%),
    radial-gradient(1.2px 1.2px at 18% 30%, #fff, transparent 70%),
    radial-gradient(1px 1px at 42% 70%, rgba(255,255,255,.8), transparent 70%),
    radial-gradient(1.4px 1.4px at 66% 22%, rgba(253,230,138,.9), transparent 70%),
    radial-gradient(1px 1px at 84% 64%, rgba(255,255,255,.7), transparent 70%),
    radial-gradient(1.2px 1.2px at 30% 88%, rgba(165,243,252,.9), transparent 70%),
    linear-gradient(135deg, #0a0d2c 0%, #1a124f 55%, #2c0f66 100%);
  box-shadow: 0 26px 64px rgba(1, 2, 14, .7), 0 0 0 1px rgba(167, 139, 250, .28), inset 0 1px 0 rgba(255,255,255,.06);
}

/* ---------- surfaces & interactions ---------- */
html[data-skin="space"] .course-card:hover,
html[data-skin="space"] .pw-course:hover {
  box-shadow: 0 18px 44px rgba(1, 2, 14, .7), 0 0 0 1px rgba(157, 140, 255, .35), 0 0 32px rgba(128, 112, 255, .18);
}
html[data-skin="space"] .btn-primary {
  background: linear-gradient(135deg, #7c3aed 0%, #5b4cf0 50%, #2f6bf2 100%);
  box-shadow: 0 6px 22px rgba(124, 58, 237, .38), inset 0 1px 0 rgba(255, 255, 255, .18);
  border-color: transparent;
}
html[data-skin="space"] .btn-primary:hover:not(:disabled) {
  box-shadow: 0 10px 30px rgba(124, 58, 237, .5), 0 0 0 1px rgba(196, 181, 253, .35), inset 0 1px 0 rgba(255, 255, 255, .22);
}
html[data-skin="space"] .modal-overlay { background: rgba(2, 3, 14, .72); }
html[data-skin="space"] ::selection { background: rgba(167, 139, 250, .42); color: #fff; }
html[data-skin="space"] { scrollbar-color: #3d3a86 transparent; }
html[data-skin="space"] ::-webkit-scrollbar-thumb { background: linear-gradient(180deg, #4c3fb3, #2b5fb8); border: 3px solid transparent; background-clip: content-box; }
html[data-skin="space"] :focus-visible { outline-color: var(--brand-400); }
html[data-skin="space"] .role-badge.student { box-shadow: 0 3px 12px rgba(34, 211, 238, .35); }

/* ---------- top-bar switch: the moon becomes a ringed planet ---------- */
html[data-skin="space"] .theme-switch[aria-checked="true"] .ts-track {
  background:
    radial-gradient(1px 1px at 30% 35%, #fff, transparent 70%),
    radial-gradient(1px 1px at 18% 70%, rgba(255,255,255,.8), transparent 70%),
    linear-gradient(135deg, #0a0d2c 0%, #3b1a8a 100%);
  border-color: rgba(196, 181, 253, .5);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, .4), 0 0 14px rgba(139, 92, 246, .35);
}
html[data-skin="space"] .theme-switch[aria-checked="true"] .ts-knob {
  background: radial-gradient(circle at 35% 30%, #f5f3ff 0%, #c4b5fd 35%, #7c3aed 100%);
  box-shadow: 0 0 10px rgba(167, 139, 250, .75);
}
html[data-skin="space"] .theme-switch[aria-checked="true"] .ts-icon { opacity: 0; }
html[data-skin="space"] .theme-switch .ts-knob::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 34px; height: 9px; border-radius: 50%;
  border: 2px solid rgba(253, 230, 138, .9); border-top-color: transparent;
  transform: translate(-50%, -50%) rotate(-22deg); pointer-events: none;
}

/* ---------- Settings → Appearance: the Space choice previews itself ---------- */
.theme-choice.theme-choice-space {
  position: relative; overflow: hidden; color: #ede9fe; border-color: rgba(167, 139, 250, .45);
  background:
    radial-gradient(120px 60px at 85% 0%, rgba(192, 132, 252, .55), transparent 70%),
    radial-gradient(100px 60px at 0% 100%, rgba(34, 211, 238, .35), transparent 70%),
    linear-gradient(135deg, #0a0d2c 0%, #24135f 100%);
}
.theme-choice.theme-choice-space i { color: #fde68a; position: relative; }
.theme-choice.theme-choice-space:hover { color: #fff; border-color: #a78bfa; box-shadow: 0 0 18px rgba(139, 92, 246, .35); }
.theme-choice.theme-choice-space[aria-checked="true"] {
  color: #fff; border-color: #a78bfa;
  background:
    radial-gradient(120px 60px at 85% 0%, rgba(192, 132, 252, .7), transparent 70%),
    radial-gradient(100px 60px at 0% 100%, rgba(34, 211, 238, .45), transparent 70%),
    linear-gradient(135deg, #0a0d2c 0%, #2c1672 100%);
  box-shadow: 0 0 0 3px rgba(167, 139, 250, .3), 0 0 22px rgba(139, 92, 246, .45);
}
.theme-choice-space .tc-stars {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    radial-gradient(1px 1px at 14% 30%, #fff, transparent 70%),
    radial-gradient(1px 1px at 32% 78%, rgba(255,255,255,.8), transparent 70%),
    radial-gradient(1.4px 1.4px at 58% 20%, #fde68a, transparent 70%),
    radial-gradient(1px 1px at 76% 70%, #fff, transparent 70%),
    radial-gradient(1px 1px at 90% 40%, rgba(165,243,252,.9), transparent 70%);
  animation: spaceTwinkle 3.5s ease-in-out infinite alternate;
}
.theme-choice-space .tc-new {
  position: absolute; top: 4px; right: 5px; font-size: 8.5px; font-weight: 800; letter-spacing: .4px; text-transform: uppercase;
  padding: 1px 5px; border-radius: 99px; color: #422006; background: linear-gradient(135deg, #fde68a, #f59e0b);
}

@media (prefers-reduced-motion: reduce) {
  html[data-skin="space"] body::after, html[data-skin="space"]::after,
  .theme-choice-space .tc-stars { animation: none !important; }
  html[data-skin="space"]::after { display: none; }
}
@media print {
  html[data-skin="space"] body::before, html[data-skin="space"] body::after, html[data-skin="space"]::after { display: none; }
}

/* ==========================================================================
   ⭐ 2026-10-08 — ADMIN SECTION NAVIGATOR (.adm-nav, .adm-all)
   Main 5 sections first, the rest in named groups → scroll sideways
   or open "All sections".
   ========================================================================== */
.adm-nav {
  position: relative; display: flex; align-items: stretch; gap: 8px; margin-bottom: 22px;
}
.adm-nav-viewport { position: relative; flex: 1 1 auto; min-width: 0; }
/* soft fade on the side that has more sections */
.adm-nav-viewport::before, .adm-nav-viewport::after {
  content: ""; position: absolute; top: 1px; bottom: 1px; width: 56px; z-index: 2; pointer-events: none;
  opacity: 0; transition: opacity .2s;
}
.adm-nav-viewport::before { left: 1px; border-radius: 14px 0 0 14px; background: linear-gradient(90deg, var(--bg-surface-3), transparent); }
.adm-nav-viewport::after  { right: 1px; border-radius: 0 14px 14px 0; background: linear-gradient(270deg, var(--bg-surface-3), transparent); }
.adm-nav.can-left .adm-nav-viewport::before, .adm-nav.can-right .adm-nav-viewport::after { opacity: 1; }

.adm-nav .admin-tabs {
  position: relative; display: flex; align-items: stretch; gap: 6px; margin: 0; padding: 6px;
  border-radius: 16px; overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x proximity; scroll-padding-inline: 8px; scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.adm-nav .admin-tabs::-webkit-scrollbar { display: none; }

.adm-nav .admin-tab {
  flex: 0 0 auto; width: var(--adm-tab-w, 206px); min-height: 58px; padding: 9px 12px; gap: 10px;
  align-items: center; justify-content: flex-start; text-align: left; border-radius: 12px;
  scroll-snap-align: start; color: var(--text-secondary); font-size: 13px;
  border: 1px solid transparent;
}
.adm-nav .admin-tab .adm-ic {
  width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
  background: var(--bg-surface); color: var(--text-tertiary); border: 1px solid var(--border-subtle);
  transition: background .2s, color .2s, border-color .2s;
}
.adm-nav .admin-tab .adm-ic i { font-size: 15px; }
.adm-nav .admin-tab .adm-txt { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.adm-nav .admin-tab .adm-txt b { display: flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 650; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.adm-nav .admin-tab .adm-txt small { font-size: 11.5px; font-weight: 500; color: var(--text-tertiary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.adm-nav .admin-tab:hover:not(.active) { background: color-mix(in srgb, var(--bg-surface) 70%, transparent); border-color: var(--border-subtle); }
.adm-nav .admin-tab:hover:not(.active) .adm-ic { color: var(--brand-600); }
.adm-nav .admin-tab.active { background: var(--bg-surface); border-color: color-mix(in srgb, var(--brand-500) 35%, var(--border-subtle)); box-shadow: var(--shadow-sm); }
.adm-nav .admin-tab.active .adm-ic { background: linear-gradient(135deg, var(--brand-600), var(--brand-500)); color: #fff; border-color: transparent; box-shadow: 0 4px 12px rgba(99,102,241,.35); }
.adm-nav .admin-tab.active .adm-txt b { color: var(--brand-600); }
[data-theme="dark"] .adm-nav .admin-tab.active .adm-txt b, [data-theme="dim"] .adm-nav .admin-tab.active .adm-txt b { color: var(--brand-300); }
.adm-nav .admin-tab.active i, .adm-nav .admin-tab:hover i { transform: none; }
/* the five main sections get a little more presence */
.adm-nav .admin-tab[data-adm-group="main"] .adm-ic { color: var(--brand-500); }

.adm-group-label {
  flex: 0 0 auto; align-self: center; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  min-width: 64px; padding: 0 8px; margin: 0 2px 0 6px; border-left: 1px dashed var(--border-default);
  font-size: 10px; font-weight: 800; letter-spacing: .7px; text-transform: uppercase; color: var(--text-tertiary);
  scroll-snap-align: start;
}
.adm-group-label i { font-size: 13px; color: var(--brand-400); }

.adm-nav-arrow {
  flex: 0 0 auto; width: 38px; border-radius: 12px; border: 1px solid var(--border-subtle); background: var(--bg-surface);
  color: var(--text-secondary); cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  transition: opacity .2s, color .2s, border-color .2s;
}
.adm-nav-arrow:hover { color: var(--brand-600); border-color: var(--brand-400); }
.adm-nav:not(.can-left) .adm-nav-arrow.is-left, .adm-nav:not(.can-right) .adm-nav-arrow.is-right { opacity: .35; pointer-events: none; }
.adm-nav-all {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px; padding: 0 14px; border-radius: 12px; cursor: pointer;
  border: 1px solid var(--border-default); background: var(--bg-surface); color: var(--text-primary); font: inherit; font-size: 13px; font-weight: 650;
}
.adm-nav-all:hover, .adm-nav-all[aria-expanded="true"] { border-color: var(--brand-400); color: var(--brand-600); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-500) 14%, transparent); }
.adm-nav-all i { color: var(--brand-500); }
.adm-nav-all-count { font-size: 11px; font-weight: 800; padding: 1px 7px; border-radius: 99px; background: var(--bg-surface-3); color: var(--text-secondary); }

/* panel */
.adm-all-ov { position: fixed; inset: 0; z-index: 10040; }
.adm-all-ov.is-dim { background: rgba(2,6,23,.45); }
.adm-all {
  position: fixed; z-index: 10041; display: flex; flex-direction: column; overflow: hidden;
  background: var(--bg-surface); color: var(--text-primary); border: 1px solid var(--border-subtle); border-radius: 18px;
  box-shadow: 0 28px 70px rgba(15,23,42,.24), 0 2px 8px rgba(15,23,42,.08); animation: aiMmIn .16s ease-out;
}
[data-theme="dark"] .adm-all, [data-theme="dim"] .adm-all { box-shadow: 0 28px 70px rgba(0,0,0,.6); }
.adm-all.is-sheet { left: 0; right: 0; bottom: 0; max-height: 86vh; border-radius: 20px 20px 0 0; padding-bottom: env(safe-area-inset-bottom); animation: aiMmSheet .2s ease-out; }
.adm-all-head { display: flex; gap: 8px; align-items: center; padding: 12px; border-bottom: 1px solid var(--border-subtle); }
.adm-all-search { position: relative; flex: 1; }
.adm-all-search i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-tertiary); font-size: 13px; }
.adm-all-search input { width: 100%; height: 40px; padding: 0 12px 0 34px; border-radius: 10px; border: 1px solid var(--border-default); background: var(--bg-surface-2); color: var(--text-primary); font: inherit; font-size: 14px; outline: none; }
.adm-all-search input:focus { border-color: var(--brand-500); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-500) 16%, transparent); }
.adm-all-close { width: 38px; height: 38px; border-radius: 10px; border: 0; background: transparent; color: var(--text-tertiary); cursor: pointer; }
.adm-all-close:hover { background: var(--bg-surface-3); color: var(--text-primary); }
.adm-all-body { overflow-y: auto; padding: 6px 14px 16px; overscroll-behavior: contain; }
.adm-all-group[hidden] { display: none; }
.adm-all-group h4 { display: flex; align-items: center; gap: 8px; margin: 12px 2px 8px; font-size: 11px; font-weight: 800; letter-spacing: .7px; text-transform: uppercase; color: var(--text-tertiary); }
.adm-all-group h4 i { color: var(--brand-400); }
.adm-all-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; }
.adm-all-item {
  display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; text-align: left; cursor: pointer;
  border: 1px solid var(--border-subtle); background: var(--bg-surface-2); color: inherit; font: inherit;
}
.adm-all-item[hidden] { display: none; }
.adm-all-item:hover, .adm-all-item:focus-visible { border-color: var(--brand-400); background: var(--bg-surface); outline: none; }
.adm-all-item.is-on { border-color: var(--brand-500); background: color-mix(in srgb, var(--brand-500) 8%, var(--bg-surface)); }
.adm-all-item .adm-ic { width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; background: var(--bg-surface); border: 1px solid var(--border-subtle); color: var(--brand-500); }
.adm-all-item .adm-txt { display: flex; flex-direction: column; min-width: 0; }
.adm-all-item .adm-txt b { display: flex; gap: 6px; align-items: center; font-size: 13.5px; font-weight: 650; }
.adm-all-item .adm-txt small { font-size: 11.5px; color: var(--text-tertiary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.adm-all-empty { padding: 26px; text-align: center; color: var(--text-tertiary); font-size: 13.5px; }
.adm-all-empty[hidden] { display: none; }

@media (max-width: 900px) {
  .adm-nav-all span { display: none; }
}
@media (max-width: 640px) {
  .adm-nav { gap: 6px; }
  .adm-nav-arrow { display: none; }
  .adm-nav .admin-tab { width: 158px !important; min-height: 52px; padding: 8px 10px; }
  .adm-nav .admin-tab .adm-ic { width: 32px; height: 32px; }
  .adm-nav .admin-tab .adm-txt small { display: none; }
  .adm-nav-all { padding: 0 12px; }
  .adm-group-label { min-width: 54px; }
}
@media (prefers-reduced-motion: reduce) { .adm-all, .adm-all.is-sheet { animation: none; } }
@media (max-width: 640px) {
  .adm-all-grid { grid-template-columns: 1fr 1fr; gap: 6px; }
  .adm-all-item { padding: 9px 8px; gap: 8px; }
  .adm-all-item .adm-ic { width: 30px; height: 30px; }
  .adm-all-item .adm-txt small { display: none; }
  .adm-all-item .adm-txt b { font-size: 13px; }
}

/* ==========================================================================
   ⭐ 2026-10-08 — AI SOLVER: FULL-HEIGHT CONSOLE + READABLE ANSWERS
   • the page fits between the header and the screen bottom on every
     device; only the conversation scrolls, the composer never leaves
   • smaller banner, and a slim one-line banner once a chat is open
   • calmer, larger answer typography; tables & code scroll inside
   ========================================================================== */
.main-content:has(> #studentAIHomeView.active) {
  padding-top: 12px !important;
  padding-bottom: 12px !important;
}
#studentAIHomeView.active {
  display: flex; flex-direction: column; gap: 12px;
  height: calc(100vh - var(--aero-header-h, 64px) - var(--aero-bnav-h, 0px) - 24px);
  height: calc(100dvh - var(--aero-header-h, 64px) - var(--aero-bnav-h, 0px) - 24px);
  min-height: 520px;
}
#studentAIHomeView .ai-home-hero { flex: 0 0 auto; margin: 0; padding: 18px 26px; border-radius: 20px; }
#studentAIHomeView .ai-home-brand { gap: 16px; align-items: center; }
#studentAIHomeView .ai-home-icon { width: 54px; height: 54px; font-size: 24px; border-radius: 16px; flex-shrink: 0; }
#studentAIHomeView .ai-home-title-block h1 { font-size: clamp(20px, 2.1vw, 28px); line-height: 1.15; margin: 6px 0 4px; letter-spacing: -.5px; }
#studentAIHomeView .ai-home-title-block p { font-size: 13.5px; line-height: 1.5; margin: 0; }
#studentAIHomeView .ai-home-badge { font-size: 10.5px; padding: 3px 10px; }
#studentAIHomeView .ai-prompt-chip { padding: 9px 12px; font-size: 12.5px; }
#studentAIHomeView .ai-home-side-title { margin-bottom: 8px; }

#studentAIHomeView .ai-chat-shell {
  flex: 1 1 auto; min-height: 0; max-height: none; height: auto; border-radius: 20px;
}
#studentAIHomeView .ai-chat-messages { flex: 1 1 auto; min-height: 0; padding: 22px clamp(14px, 2.6vw, 34px) 18px; }
#studentAIHomeView .ai-chat-composer { flex: 0 0 auto; padding: 12px clamp(12px, 2vw, 20px) 12px; }

/* conversation open → the banner shrinks to one slim line */
#studentAIHomeView.ai-has-chat .ai-home-hero {
  display: flex !important; align-items: center; padding: 10px 18px; min-height: 0; border-radius: 16px;
}
#studentAIHomeView.ai-has-chat .ai-home-side,
#studentAIHomeView.ai-has-chat .ai-home-title-block p,
#studentAIHomeView.ai-has-chat .ai-home-badge,
#studentAIHomeView.ai-has-chat .ai-home-orb-3 { display: none !important; }
#studentAIHomeView.ai-has-chat .ai-home-icon { width: 36px; height: 36px; font-size: 16px; border-radius: 11px; }
#studentAIHomeView.ai-has-chat .ai-home-icon .ai-home-pulse { width: 8px; height: 8px; }
#studentAIHomeView.ai-has-chat .ai-home-brand { gap: 12px; }
#studentAIHomeView.ai-has-chat .ai-home-title-block h1 { font-size: 17px; margin: 0; letter-spacing: -.2px; }

/* answers: more width, calmer type, clear structure */
#studentAIHomeView .ai-msg { gap: 12px; margin-bottom: 18px; }
#studentAIHomeView .ai-msg-assistant .ai-msg-bubble { padding: 16px 20px; }
#studentAIHomeView .ai-answer-body,
#studentAIHomeView .ai-stream-body { font-size: 15px; line-height: 1.75; color: var(--text-primary); overflow-wrap: anywhere; }
#studentAIHomeView .ai-answer-body > :first-child,
#studentAIHomeView .ai-stream-body > :first-child { margin-top: 0; }
#studentAIHomeView .ai-answer-body > :last-child,
#studentAIHomeView .ai-stream-body > :last-child { margin-bottom: 0; }
#studentAIHomeView .ai-answer-body p,
#studentAIHomeView .ai-stream-body p { margin: 10px 0; }
#studentAIHomeView .ai-answer-body h3, #studentAIHomeView .ai-stream-body h3 { font-size: 17px; margin: 20px 0 8px; padding-bottom: 6px; border-bottom: 1px solid var(--border-subtle); }
#studentAIHomeView .ai-answer-body h4, #studentAIHomeView .ai-stream-body h4 { font-size: 15.5px; margin: 16px 0 6px; }
#studentAIHomeView .ai-answer-body h5, #studentAIHomeView .ai-stream-body h5 { font-size: 14.5px; margin: 14px 0 6px; font-weight: 700; }
#studentAIHomeView .ai-answer-body ul, #studentAIHomeView .ai-answer-body ol,
#studentAIHomeView .ai-stream-body ul, #studentAIHomeView .ai-stream-body ol { margin: 8px 0 10px; padding-left: 24px; }
#studentAIHomeView .ai-answer-body li, #studentAIHomeView .ai-stream-body li { margin: 4px 0; padding-left: 2px; }
#studentAIHomeView .ai-answer-body ul.md-sub, #studentAIHomeView .ai-stream-body ul.md-sub { margin: 2px 0 8px 22px; }
#studentAIHomeView .ai-answer-body hr, #studentAIHomeView .ai-stream-body hr { border: 0; border-top: 1px solid var(--border-subtle); margin: 16px 0; }
#studentAIHomeView .ai-answer-body pre, #studentAIHomeView .ai-stream-body pre {
  position: relative; max-width: 100%; overflow-x: auto; padding: 14px 16px; border-radius: 10px; font-size: 13px; line-height: 1.6;
  border: 1px solid var(--border-subtle);
}
#studentAIHomeView .ai-answer-body pre[data-lang]::before, #studentAIHomeView .ai-stream-body pre[data-lang]::before {
  content: attr(data-lang); position: sticky; left: 0; display: block; margin: -4px 0 6px; font-size: 10.5px; font-weight: 700;
  letter-spacing: .6px; text-transform: uppercase; color: var(--text-tertiary); font-family: var(--font-sans);
}
#studentAIHomeView .ai-table-wrap { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 12px 0; }
#studentAIHomeView mjx-container[display="true"] { max-width: 100%; overflow-x: auto; overflow-y: hidden; padding: 4px 0; }

/* ---- tablets ---- */
@media (max-width: 1024px) {
  #studentAIHomeView .ai-home-hero { padding: 16px 20px; }
}
/* ---- phones ---- */
@media (max-width: 640px) {
  #studentAIHomeView.active { gap: 10px; min-height: 420px; }
  .main-content:has(> #studentAIHomeView.active) { padding: 10px 10px !important; }
  #studentAIHomeView .ai-home-hero { padding: 14px 16px; border-radius: 16px; }
  #studentAIHomeView .ai-home-icon { width: 42px; height: 42px; font-size: 19px; border-radius: 13px; }
  #studentAIHomeView .ai-home-title-block h1 { font-size: 19px; }
  #studentAIHomeView .ai-home-title-block p { display: none; }
  #studentAIHomeView .ai-home-badge { display: none; }
  #studentAIHomeView.ai-has-chat .ai-home-hero { padding: 8px 12px; border-radius: 14px; }
  #studentAIHomeView.ai-has-chat .ai-home-title-block h1 { font-size: 15.5px; }
  #studentAIHomeView.ai-has-chat .ai-home-icon { width: 32px; height: 32px; font-size: 14px; border-radius: 10px; }
  #studentAIHomeView .ai-chat-shell { border-radius: 16px; }
  #studentAIHomeView .ai-chat-messages { padding: 14px 10px 10px; }
  #studentAIHomeView .ai-msg { gap: 8px; margin-bottom: 14px; }
  #studentAIHomeView .ai-msg-avatar { width: 28px; height: 28px; font-size: 12px; border-radius: 9px; }
  #studentAIHomeView .ai-msg-assistant .ai-msg-bubble { padding: 12px 13px; }
  #studentAIHomeView .ai-answer-body, #studentAIHomeView .ai-stream-body { font-size: 14.5px; line-height: 1.7; }
  #studentAIHomeView .ai-chat-composer { padding: 10px; gap: 8px; }
  /* tools + send on ONE row */
  #studentAIHomeView .ai-composer-row { flex-wrap: nowrap; gap: 6px; margin-top: 0; }
  #studentAIHomeView .ai-tools { flex-wrap: nowrap; gap: 5px; min-width: 0; overflow: hidden; }
  #studentAIHomeView .ai-tool-btn { width: 38px; height: 38px; flex-shrink: 0; }
  #studentAIHomeView .ai-tool-btn.ai-model-btn { width: auto; max-width: 112px; padding: 0 9px; }
  #studentAIHomeView .ai-model-btn .ai-model-chev { display: none; }
  #studentAIHomeView .ai-composer-btns { gap: 6px; flex-shrink: 0; }
  #studentAIHomeView .ai-clear-btn { width: 38px; height: 38px; }
  #studentAIHomeView .ai-send-btn { height: 40px; padding: 0 14px; border-radius: 12px; }
  #studentAIHomeView .ai-char-count:empty { display: none; }
  #studentAIHomeView .ai-msg-actions { gap: 4px; }
  #studentAIHomeView .ai-followups { gap: 6px; }
  #studentAIHomeView .ai-followup { font-size: 12px; padding: 6px 10px; }
}
@media (max-width: 380px) {
  #studentAIHomeView .ai-send-btn span { display: none; }
  #studentAIHomeView .ai-send-btn { width: 42px; padding: 0; justify-content: center; }
  #studentAIHomeView .ai-tool-btn.ai-model-btn { max-width: 84px; }
}
/* very short screens (landscape phones) — let the page scroll instead of squashing */
@media (max-height: 520px) {
  #studentAIHomeView.active { height: auto; min-height: 0; }
  #studentAIHomeView .ai-chat-shell { height: 78vh; }
}

/* composer: drop the keyboard hint on shorter screens to give answers the room */
@media (max-height: 900px) { #studentAIHomeView .ai-composer-hint { display: none !important; } }
#studentAIHomeView .ai-chat-composer { gap: 8px; }
#studentAIHomeView.ai-has-chat .ai-home-title-block { min-width: 0; }
#studentAIHomeView.ai-has-chat .ai-home-title-block h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ⭐ 2026-10-08 — course filter bar on phones: 2 readable columns + full-width Clear
   (the 4 selects used to squeeze into one row and read "Al Al Al Al") */
@media (max-width: 640px) {
  .filter-bar { display: grid !important; grid-template-columns: 1fr 1fr; gap: 8px; }
  .filter-bar select { width: 100%; min-width: 0; max-width: none; font-size: 13.5px; padding-right: 28px; text-overflow: ellipsis; }
  .filter-bar .btn { grid-column: 1 / -1; width: 100%; justify-content: center; }
}

.ai-answer-body li.md-sub-li, .ai-stream-body li.md-sub-li { margin-left: 20px; list-style-type: circle; }

/* ⭐ 2026-10-09 — strict login tabs: "wrong tab" notice */
.lg-tab-error {
  display: flex; gap: 10px; align-items: flex-start; margin: -8px 0 16px; padding: 11px 13px; border-radius: 12px;
  background: rgba(239, 68, 68, .07); border: 1px solid rgba(239, 68, 68, .28); color: var(--text-secondary); font-size: 13px; line-height: 1.5;
  animation: fadeIn .2s ease;
}
.lg-tab-error[hidden] { display: none; }
.lg-tab-error > i { color: #ef4444; margin-top: 3px; }
.lg-tab-error strong { display: block; color: var(--text-primary); font-size: 13.5px; }
.lg-tab-error span { display: block; }
.lg-tab-error-btn {
  margin-top: 8px; display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 9px; cursor: pointer;
  border: 1px solid rgba(239, 68, 68, .35); background: var(--bg-surface); color: #dc2626; font: inherit; font-size: 12.5px; font-weight: 650;
}
.lg-tab-error-btn:hover { background: rgba(239, 68, 68, .08); }
[data-theme="dark"] .lg-tab-error-btn, [data-theme="dim"] .lg-tab-error-btn { color: #fca5a5; }
#loginView .login-role-toggle button.lg-hint:not(.active) { color: #ef4444; animation: lgHintPulse 1.2s ease-in-out 2; }
@keyframes lgHintPulse { 50% { background: rgba(239, 68, 68, .12); } }

/* ==========================================================================
   ⭐ 2026-10-09 — HEADER FIT FOR TABLETS & SMALL LAPTOPS (see fitHeaderNav)
   The header adds hdr-fit-1…4 only when its items would otherwise overlap.
   ========================================================================== */
.main-nav a .nav-label { white-space: nowrap; }
#appHeader.hdr-fit-1 { gap: 8px !important; padding-left: 16px !important; padding-right: 16px !important; }
#appHeader.hdr-fit-1 .brand-text span { display: none !important; }
#appHeader.hdr-fit-1 .main-nav a { padding: 6px 10px !important; gap: 5px !important; }
#appHeader.hdr-fit-1 .main-nav a.nav-ai-btn { margin-left: 2px !important; }
#appHeader.hdr-fit-1 .app-install-pill { padding: 8px 10px !important; gap: 0 !important; min-width: 38px; }
#appHeader.hdr-fit-1 .app-install-pill .landing-install-pill-text { display: none !important; }
#appHeader.hdr-fit-1 .user-info { gap: 5px !important; }
/* 2 — icon-only links; the current page and AI Solver keep their words */
#appHeader.hdr-fit-2 .main-nav a:not(.active):not(.nav-ai-btn) .nav-label { display: none !important; }
#appHeader.hdr-fit-2 .main-nav a:not(.active):not(.nav-ai-btn) { padding: 6px 11px !important; }
/* 3 — every link icon-only, brand shows just its mark */
#appHeader.hdr-fit-3 .main-nav a .nav-label { display: none !important; }
#appHeader.hdr-fit-3 .main-nav a { padding: 6px 11px !important; }
#appHeader.hdr-fit-3 .brand-text { display: none !important; }
/* 4 — last resort: drop the streak chip and the Get App pill */
#appHeader.hdr-fit-4 .streak-badge, #appHeader.hdr-fit-4 .app-install-pill { display: none !important; }
#appHeader.hdr-fit-4 .main-nav a { padding: 6px 9px !important; }
/* Tablet portrait (641–860px): the header is two rows and the bell sits at the
   LEFT of row 2, so a dropdown anchored to the bell's right edge ran off the
   left side of the screen. Anchor it to the header instead (as on phones). */
@media (min-width: 641px) and (max-width: 860px) {
  #appHeader .notif-wrap, #appHeader .user-info { position: static; }
  #appHeader .notif-dropdown {
    top: calc(100% + 6px); left: auto; right: 12px;
    width: min(420px, calc(100vw - 24px)); max-width: none;
  }
}

/* ==========================================================================
   ⭐ 2026-10-09 — "MADE IN INDIA" BADGE (login, app footer, landing page)
   The tricolour is an inline SVG (#aeroFlagIN) — flag emoji don't show on
   Windows, so it is drawn rather than typed.
   ========================================================================== */
.mii {
  display: inline-flex; align-items: center; gap: 7px; vertical-align: middle;
  font-weight: 600; letter-spacing: .2px; white-space: nowrap; line-height: 1;
}
.mii-flag {
  width: 21px; height: 14px; flex: 0 0 auto; border-radius: 2.5px; display: block;
  box-shadow: 0 0 0 .5px rgba(0,0,0,.18), 0 1px 3px rgba(0,0,0,.18);
}
/* login: a soft pill under the sign-in links */
.lg-made-in { display: flex; justify-content: center; margin-top: 18px; }
.mii-login {
  padding: 7px 13px 7px 14px; border-radius: 999px; font-size: 12.5px; color: var(--text-secondary);
  background: linear-gradient(90deg, rgba(255,153,51,.10), rgba(255,255,255,0) 45%, rgba(255,255,255,0) 55%, rgba(19,136,8,.10));
  border: 1px solid var(--border-subtle);
}
.mii-login .mii-flag { width: 24px; height: 16px; }
/* app footer: sits after the copyright */
.app-footer-sep { opacity: .55; margin: 0 7px; }
.mii-footer { color: rgba(255,255,255,.78); font-size: inherit; gap: 6px; }
.mii-footer .mii-flag { width: 18px; height: 12px; }
/* landing hero: a small pill under the eyebrow */
.lp-made-in { display: flex; justify-content: center; margin: -6px 0 18px; }
.mii-hero {
  padding: 6px 12px 6px 13px; border-radius: 999px; font-size: 12.5px; color: rgba(255,255,255,.9);
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.16);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.lp-foot-made { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 6px; }

/* ==========================================================================
   ⭐ 2026-10-10 — PREMIUM: banner actions, welcome, My Premium hub,
   receipts, Help Desk (student + admin)
   ========================================================================== */
.subscribe-active-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.subscribe-active-banner.is-ending { background: linear-gradient(135deg, rgba(245,158,11,.14), rgba(251,191,36,.05)); border-color: rgba(245,158,11,.45); }
.subscribe-active-banner.is-ending .subscribe-active-icon { background: linear-gradient(135deg, #d97706, #f59e0b); }
.premium-help-btn { position: relative; }
.premium-dot {
  display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 6px;
  border-radius: 99px; background: #e11d48; color: #fff; font-size: 10.5px; font-weight: 800; line-height: 1;
}
@media (max-width: 640px) {
  .subscribe-active-banner { flex-wrap: wrap; }
  .subscribe-active-actions { width: 100%; justify-content: stretch; }
  .subscribe-active-actions .btn { flex: 1; justify-content: center; }
}
.checkout-extend-note {
  margin-top: 10px; padding: 10px 12px; border-radius: var(--radius-md); font-size: 13px; line-height: 1.5;
  background: rgba(16,185,129,.08); border: 1px solid rgba(16,185,129,.3); color: var(--text-secondary);
}
.checkout-extend-note i { color: var(--emerald-600); margin-right: 4px; }

/* ---- welcome ---- */
.premium-welcome { max-width: 520px; text-align: center; }
.premium-welcome-crown {
  width: 76px; height: 76px; margin: 0 auto 12px; border-radius: 22px; display: grid; place-items: center; font-size: 34px;
  background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #422006; box-shadow: 0 14px 30px -10px rgba(245,158,11,.7);
  animation: premiumPop .5s var(--ease, ease) both;
}
@keyframes premiumPop { from { transform: scale(.6) rotate(-12deg); opacity: 0; } to { transform: none; opacity: 1; } }
.premium-welcome h3 { font-size: 22px; margin: 0 0 6px; }
.premium-welcome-sub { color: var(--text-secondary); margin: 0 0 18px; }
.premium-perks { list-style: none; padding: 0; margin: 0 0 6px; text-align: left; display: flex; flex-direction: column; gap: 10px; }
.premium-perks li { display: flex; gap: 12px; align-items: flex-start; }
.premium-perk-ic { flex: 0 0 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: rgba(245,158,11,.14); color: #d97706; }
.premium-perks b { display: block; font-size: 14px; color: var(--text-primary); }
.premium-perks small { display: block; font-size: 12.5px; color: var(--text-tertiary); line-height: 1.45; }

/* ---- My Premium hub ---- */
.premium-hub { max-width: 620px; padding: 26px 28px; }
.premium-hub-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.premium-hub-crown { flex: 0 0 52px; height: 52px; border-radius: 15px; display: grid; place-items: center; font-size: 22px; background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #422006; }
.premium-hub-title { flex: 1; min-width: 0; }
.premium-hub-title h3 { margin: 0 0 4px; font-size: 19px; }
.premium-hub-x { width: 36px; height: 36px; border: 0; border-radius: 10px; background: transparent; color: var(--text-tertiary); cursor: pointer; font-size: 16px; }
.premium-hub-x:hover { background: var(--bg-surface-2); color: var(--text-primary); }
.premium-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; }
.premium-chip.on { background: rgba(16,185,129,.12); color: var(--emerald-700, #047857); }
.premium-chip.ending { background: rgba(245,158,11,.14); color: #b45309; }
.premium-chip.off { background: var(--bg-surface-2); color: var(--text-tertiary); }
.premium-days { padding: 14px 16px; border-radius: var(--radius-lg); background: var(--bg-surface-2); border: 1px solid var(--border-subtle); margin-bottom: 18px; }
.premium-days-row { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 13px; color: var(--text-secondary); margin-bottom: 9px; }
.premium-days-row b { color: var(--text-primary); }
.premium-days-row span:first-child b { font-size: 20px; }
.premium-days-bar { height: 8px; border-radius: 99px; background: var(--bg-surface-3, rgba(0,0,0,.08)); overflow: hidden; }
.premium-days-bar span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.premium-days-warn { margin: 10px 0 0; font-size: 12.5px; color: #b45309; line-height: 1.5; }
.premium-section-title { font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .6px; color: var(--text-tertiary); margin: 18px 0 10px; }
.premium-perk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 10px; }
.premium-perk-card { padding: 12px; border-radius: var(--radius-md); border: 1px solid var(--border-subtle); background: var(--bg-surface); display: flex; flex-direction: column; gap: 4px; }
.premium-perk-card i { color: #d97706; font-size: 16px; margin-bottom: 2px; }
.premium-perk-card b { font-size: 13.5px; color: var(--text-primary); }
.premium-perk-card small { font-size: 12px; color: var(--text-tertiary); line-height: 1.45; }
.premium-help-cta {
  width: 100%; margin-top: 14px; display: flex; align-items: center; gap: 12px; text-align: left; cursor: pointer; font: inherit;
  padding: 14px 16px; border-radius: var(--radius-lg); border: 1.5px solid rgba(99,102,241,.35);
  background: linear-gradient(135deg, rgba(99,102,241,.10), rgba(6,182,212,.05)); color: var(--text-primary);
}
.premium-help-cta:hover { border-color: var(--brand-500, #6366f1); }
.premium-help-cta > span:nth-child(2) { flex: 1; min-width: 0; }
.premium-help-cta b { display: block; font-size: 14.5px; }
.premium-help-cta small { display: block; font-size: 12.5px; color: var(--text-tertiary); }
.premium-help-cta-ic { flex: 0 0 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-600, #4f46e5); color: #fff; font-size: 17px; }
.premium-pay-list { display: flex; flex-direction: column; gap: 8px; }
.premium-pay { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: var(--radius-md); border: 1px solid var(--border-subtle); }
.premium-pay b { display: block; font-size: 14px; }
.premium-pay small { display: block; font-size: 12px; color: var(--text-tertiary); }
.premium-muted { font-size: 13px; color: var(--text-tertiary); margin: 0; }
.premium-hub-actions { margin-top: 20px; }
.btn-danger-text { color: #e11d48 !important; }
.premium-cancel-confirm { margin-top: 14px; padding: 14px 16px; border-radius: var(--radius-md); background: rgba(225,29,72,.06); border: 1px solid rgba(225,29,72,.25); }
.premium-cancel-confirm p { margin: 0; font-size: 13.5px; line-height: 1.55; color: var(--text-secondary); }

/* ---- receipt ---- */
.premium-receipt-box { max-width: 520px; }
.premium-receipt { background: #fff; color: #14161c; border: 1px solid #e5e7eb; border-radius: 12px; padding: 22px; }
.premium-receipt-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; border-bottom: 2px solid #f59e0b; padding-bottom: 12px; margin-bottom: 12px; }
.premium-receipt-head b { display: block; font-size: 18px; }
.premium-receipt-head small { color: #6b7280; font-size: 12px; }
.premium-receipt-tag { font-size: 11px; font-weight: 800; letter-spacing: .8px; color: #b45309; background: #fef3c7; padding: 4px 8px; border-radius: 6px; white-space: nowrap; }
.premium-receipt table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.premium-receipt td { padding: 7px 0; vertical-align: top; border-bottom: 1px dashed #e5e7eb; }
.premium-receipt td:first-child { color: #6b7280; width: 38%; }
.premium-receipt td small { color: #6b7280; }
.premium-receipt code { font-size: 12px; word-break: break-all; }
.premium-receipt-total td { border-bottom: 0; font-weight: 800; font-size: 16px; padding-top: 12px; color: #14161c !important; }
.premium-receipt-foot { margin: 14px 0 0; font-size: 11.5px; color: #6b7280; line-height: 1.5; }
@media print {
  html.aero-print-receipt body * { visibility: hidden !important; }
  html.aero-print-receipt #premiumReceipt, html.aero-print-receipt #premiumReceipt * { visibility: visible !important; }
  html.aero-print-receipt #premiumReceipt { position: fixed; left: 0; top: 0; width: 100%; border: 0; }
}

/* ---- Help Desk (student) ---- */
.help-desk { max-width: 600px; padding: 22px 24px; display: flex; flex-direction: column; }
.hd-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.hd-head-ic { flex: 0 0 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-600, #4f46e5); color: #fff; font-size: 18px; }
.hd-head-t { flex: 1; min-width: 0; }
.hd-head-t h3 { margin: 0; font-size: 17px; overflow-wrap: anywhere; }
.hd-head-t p { margin: 2px 0 0; font-size: 12.5px; color: var(--text-tertiary); line-height: 1.45; }
.hd-icon-btn { flex: 0 0 36px; width: 36px; height: 36px; border: 0; border-radius: 10px; background: transparent; color: var(--text-secondary); cursor: pointer; font-size: 15px; }
.hd-icon-btn:hover { background: var(--bg-surface-2); color: var(--text-primary); }
.hd-new {
  width: 100%; padding: 13px; border-radius: var(--radius-md); border: 1.5px dashed var(--brand-500, #6366f1); background: rgba(99,102,241,.06);
  color: var(--brand-700, #4338ca); font: inherit; font-weight: 700; cursor: pointer; margin-bottom: 14px;
}
.hd-new:hover { background: rgba(99,102,241,.12); }
.hd-list { display: flex; flex-direction: column; gap: 8px; }
.hd-item { text-align: left; font: inherit; cursor: pointer; padding: 12px 14px; border-radius: var(--radius-md); border: 1px solid var(--border-subtle); background: var(--bg-surface); color: var(--text-primary); }
.hd-item:hover { border-color: var(--border-strong); }
.hd-item.unread { border-color: rgba(99,102,241,.5); background: rgba(99,102,241,.05); }
.hd-item-top { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.hd-item-top b { font-size: 14px; overflow-wrap: anywhere; }
.hd-item-meta { margin-top: 4px; font-size: 12px; color: var(--text-tertiary); }
.hd-status { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; }
.hd-status.open { color: #b45309; }
.hd-status.answered { color: var(--brand-600, #4f46e5); }
.hd-status.closed { color: var(--emerald-600, #059669); }
.hd-empty { text-align: center; padding: 28px 10px; color: var(--text-tertiary); }
.hd-empty i { font-size: 26px; margin-bottom: 8px; }
.hd-locked { text-align: center; padding: 22px 16px; border-radius: var(--radius-lg); background: rgba(245,158,11,.08); border: 1px solid rgba(245,158,11,.3); margin-bottom: 14px; }
.hd-locked i { font-size: 22px; color: #d97706; }
.hd-locked b { display: block; margin: 8px 0 4px; }
.hd-locked p { margin: 0 0 14px; font-size: 13px; color: var(--text-secondary); }
.hd-form { display: flex; flex-direction: column; gap: 12px; }
.hd-form label { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; font-weight: 700; color: var(--text-secondary); }
.hd-form input, .hd-form select, .hd-form textarea, .hd-reply textarea {
  font: inherit; font-size: 14px; font-weight: 400; padding: 10px 12px; border-radius: var(--radius-md); border: 1px solid var(--border-default);
  background: var(--bg-surface); color: var(--text-primary); resize: vertical; box-sizing: border-box; width: 100%;
}
.hd-form input:focus, .hd-form select:focus, .hd-form textarea:focus, .hd-reply textarea:focus { outline: none; border-color: var(--brand-500, #6366f1); box-shadow: 0 0 0 3px rgba(99,102,241,.18); }
.hd-thread { display: flex; flex-direction: column; gap: 10px; max-height: 46vh; overflow-y: auto; padding: 4px 2px 10px; }
.hd-msg { max-width: 86%; padding: 10px 13px; border-radius: 14px; font-size: 14px; line-height: 1.55; }
.hd-msg.student { align-self: flex-end; background: var(--brand-600, #4f46e5); color: #fff; border-bottom-right-radius: 4px; }
.hd-msg.admin { align-self: flex-start; background: var(--bg-surface-2); color: var(--text-primary); border: 1px solid var(--border-subtle); border-bottom-left-radius: 4px; }
.hd-msg-meta { font-size: 11px; opacity: .75; margin-bottom: 3px; font-weight: 600; }
.hd-msg-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.hd-waiting { align-self: center; font-size: 12px; color: var(--text-tertiary); padding: 4px 10px; }
.hd-reply { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.hd-reply-actions { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.hd-reply-actions > span { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---- Help Desk (admin) ---- */
.ahd-badge { display: inline-flex; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 4px; align-items: center; justify-content: center; border-radius: 99px; background: #e11d48; color: #fff; font-size: 10.5px; font-weight: 800; }
.ahd-badge[hidden] { display: none; }
.ahd-filters { display: inline-flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--bg-surface-2); border: 1px solid var(--border-subtle); margin-bottom: 14px; flex-wrap: wrap; }
.ahd-filters button { border: 0; background: transparent; padding: 7px 12px; border-radius: 9px; font: inherit; font-size: 13px; font-weight: 600; color: var(--text-secondary); cursor: pointer; }
.ahd-filters button.on { background: var(--bg-surface); color: var(--text-primary); box-shadow: var(--shadow-sm); }
.ahd-filters b { margin-left: 4px; color: var(--text-tertiary); }
.ahd-wrap { display: grid; grid-template-columns: minmax(260px, 360px) 1fr; gap: 14px; align-items: start; }
.ahd-list { display: flex; flex-direction: column; gap: 8px; max-height: 70vh; overflow-y: auto; }
.ahd-item { text-align: left; font: inherit; cursor: pointer; padding: 11px 13px; border-radius: var(--radius-md); border: 1px solid var(--border-subtle); background: var(--bg-surface); color: var(--text-primary); }
.ahd-item.on { border-color: var(--brand-500, #6366f1); box-shadow: 0 0 0 2px rgba(99,102,241,.18); }
.ahd-item-top { display: flex; gap: 6px; align-items: center; }
.ahd-item-top i { color: #d97706; font-size: 12px; }
.ahd-item-top b { font-size: 13.5px; overflow-wrap: anywhere; }
.ahd-item-meta { font-size: 12px; color: var(--text-tertiary); margin-top: 3px; }
.ahd-thread { border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); background: var(--bg-surface); padding: 16px; min-height: 260px; }
.ahd-thread-head { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 12px; }
.ahd-thread-head h4 { margin: 0 0 3px; font-size: 15.5px; overflow-wrap: anywhere; }
.ahd-thread-head small { color: var(--text-tertiary); font-size: 12px; }
.ahd-thread-head small i { color: #d97706; }
.ahd-back { display: none; }
.ahd-msgs { max-height: 50vh; }
@media (max-width: 860px) {
  .ahd-wrap { grid-template-columns: 1fr; }
  .ahd-wrap.has-open .ahd-list { display: none; }
  .ahd-wrap:not(.has-open) .ahd-thread { display: none; }
  .ahd-back { display: inline-block; }
}

/* ==========================================================================
   ⭐ 2026-10-10 — AURORA THEME
   <html data-theme="light" data-skin="aurora">
   Rides on the light theme (every light rule still applies) and adds:
   a pearl page lit by slowly drifting northern-lights colour, twilight
   header & hero skies with shimmering aurora ribbons, frosted cards with
   colour-tinted depth, and violet → teal actions.
   Motion is one transform-only layer (cheap on phones) and switches off
   for reduced-motion users and in print.
   ========================================================================== */
html[data-skin="aurora"] {
  color-scheme: light;
  --brand-50: #f2f0ff; --brand-100: #e6e2ff; --brand-200: #cfc8ff; --brand-300: #ada2ff;
  --brand-400: #8b7dfb; --brand-500: #6d5ef3; --brand-600: #5a48e3; --brand-700: #4936c4;
  --brand-800: #3a2c9c; --brand-900: #2b2170;
  --accent-300: #7fe9dd; --accent-400: #3fd6c6; --accent-500: #14b8a6; --accent-600: #0d9488;

  --au-mint: rgba(45, 212, 191, .34);
  --au-sky: rgba(56, 189, 248, .28);
  --au-violet: rgba(139, 92, 246, .30);
  --au-rose: rgba(244, 114, 182, .20);
  --au-grad: linear-gradient(120deg, #6d5ef3 0%, #4f7cf7 45%, #14b8a6 100%);
  --au-grad-soft: linear-gradient(120deg, rgba(109,94,243,.14), rgba(79,124,247,.10) 45%, rgba(20,184,166,.12));
  --au-sky-band: linear-gradient(115deg, #070b24 0%, #0f1546 42%, #12285a 72%, #0b3a4a 100%);

  --bg-page: #f4f6fb;
  --bg-page-accent-1: transparent;
  --bg-page-accent-2: transparent;
  --bg-surface: #ffffff;
  --bg-surface-2: #f7f8fd;
  --bg-surface-3: #eef0f8;
  --bg-elevated: #ffffff;

  --border-subtle: #e6e9f4;
  --border-default: #d7dcec;
  --border-strong: #b9c0da;

  --text-primary: #10142e;
  --text-secondary: #464e74;
  --text-tertiary: #7d86ab;

  --shadow-xs: 0 1px 2px rgba(40, 44, 110, .05);
  --shadow-sm: 0 2px 8px rgba(40, 44, 110, .06), 0 1px 2px rgba(40, 44, 110, .04);
  --shadow-md: 0 12px 30px rgba(52, 48, 150, .09), 0 2px 6px rgba(40, 44, 110, .05);
  --shadow-lg: 0 24px 56px rgba(52, 48, 150, .13), 0 6px 14px rgba(40, 44, 110, .06);
  --shadow-xl: 0 36px 80px rgba(40, 36, 130, .18);

  --header-bg: var(--au-sky-band);
  --header-border: rgba(127, 233, 221, .28);
}

/* ---------- the sky: pearl base + four aurora lights that drift slowly ---------- */
html[data-skin="aurora"] body {
  background: linear-gradient(180deg, #f7f8fd 0%, #f2f4fb 55%, #f4f2fb 100%);
  background-attachment: fixed;
}
html[data-skin="aurora"] #app { background: transparent; box-shadow: none; }
html[data-skin="aurora"] body::before {
  content: ""; position: fixed; inset: -18vmax; z-index: -1; pointer-events: none;
  background:
    radial-gradient(38vmax 30vmax at 18% 14%, var(--au-mint), transparent 70%),
    radial-gradient(42vmax 32vmax at 84% 8%, var(--au-violet), transparent 70%),
    radial-gradient(40vmax 34vmax at 72% 78%, var(--au-sky), transparent 70%),
    radial-gradient(34vmax 28vmax at 12% 88%, var(--au-rose), transparent 70%);
  will-change: transform;
  animation: auroraDrift 46s ease-in-out infinite alternate;
}
/* a faint ribbon of light sweeping across the top of the page */
html[data-skin="aurora"] body::after {
  content: ""; position: fixed; left: -10vw; right: -10vw; top: -14vh; height: 52vh; z-index: -1; pointer-events: none;
  background:
    linear-gradient(100deg, transparent 8%, rgba(45,212,191,.14) 28%, rgba(109,94,243,.14) 48%, rgba(56,189,248,.10) 66%, transparent 86%);
  transform: skewY(-6deg);
  border-radius: 0 0 50% 50% / 0 0 40% 40%;
  opacity: .9;
  animation: auroraRibbon 22s ease-in-out infinite alternate;
}
@keyframes auroraDrift {
  0%   { transform: translate3d(0, 0, 0) rotate(0deg) scale(1); }
  50%  { transform: translate3d(3vmax, -2vmax, 0) rotate(8deg) scale(1.05); }
  100% { transform: translate3d(-3vmax, 2vmax, 0) rotate(-6deg) scale(1.02); }
}
@keyframes auroraRibbon {
  0%   { transform: skewY(-6deg) translateX(-4vw); opacity: .65; }
  100% { transform: skewY(-3deg) translateX(4vw); opacity: 1; }
}

/* ---------- twilight header with a living aurora ---------- */
html[data-skin="aurora"] #appHeader {
  background: var(--au-sky-band);
  isolation: isolate;          /* no overflow:hidden — the dropdowns hang out of the header */
  border-bottom: 1px solid transparent;
  border-image: linear-gradient(90deg, rgba(20,184,166,0) 0%, rgba(63,214,198,.75) 25%, rgba(139,125,251,.75) 60%, rgba(56,189,248,0) 100%) 1;
  box-shadow: 0 12px 34px rgba(16, 18, 70, .22);
}
html[data-skin="aurora"] #appHeader::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(40% 90% at 20% 20%, rgba(52, 211, 153, .30), transparent 70%),
    radial-gradient(35% 100% at 55% 0%, rgba(139, 92, 246, .34), transparent 70%),
    radial-gradient(30% 90% at 85% 40%, rgba(56, 189, 248, .28), transparent 70%);
  background-size: 130% 100%;
  animation: auroraHeader 18s ease-in-out infinite alternate;
}
@keyframes auroraHeader {
  0%   { background-position: 0% 0; }
  100% { background-position: 100% 0; }
}
html[data-skin="aurora"] #appHeader #mainNav { background: transparent; }
html[data-skin="aurora"] #mainNav a.active,
html[data-skin="aurora"] #mainNav a[aria-current="page"] {
  background: linear-gradient(120deg, rgba(139,125,251,.95), rgba(79,124,247,.95));
  box-shadow: 0 6px 18px rgba(109, 94, 243, .45), inset 0 1px 0 rgba(255,255,255,.25);
}

/* phone header row 2 & bottom bar: frosted pearl */
html[data-skin="aurora"] .mobile-bottom-nav {
  background: rgba(255, 255, 255, .86);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border-top: 1px solid rgba(109, 94, 243, .14);
  box-shadow: 0 -10px 30px rgba(52, 48, 150, .10);
}

/* ---------- hero: a window onto the northern lights ---------- */
html[data-skin="aurora"] .hero-section,
html[data-skin="aurora"] .ai-home-hero,
html[data-skin="aurora"] .pw-hero {
  background:
    radial-gradient(1.2px 1.2px at 14% 22%, rgba(255,255,255,.9), transparent 70%),
    radial-gradient(1px 1px at 38% 12%, rgba(255,255,255,.7), transparent 70%),
    radial-gradient(1.3px 1.3px at 63% 30%, rgba(204,251,241,.9), transparent 70%),
    radial-gradient(1px 1px at 88% 18%, rgba(255,255,255,.7), transparent 70%),
    radial-gradient(70% 55% at 20% 0%, rgba(45, 212, 191, .45), transparent 70%),
    radial-gradient(60% 60% at 70% -10%, rgba(139, 92, 246, .50), transparent 70%),
    radial-gradient(55% 60% at 100% 100%, rgba(56, 189, 248, .30), transparent 70%),
    linear-gradient(160deg, #070b24 0%, #121650 45%, #1b2a6b 75%, #0d3c55 100%);
  box-shadow: 0 30px 70px rgba(30, 28, 110, .30), 0 0 0 1px rgba(127, 233, 221, .22), inset 0 1px 0 rgba(255,255,255,.08);
}
html[data-skin="aurora"] .hero-section::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(105deg, transparent 20%, rgba(52,211,153,.18) 38%, rgba(139,125,251,.20) 52%, transparent 70%);
  background-size: 220% 100%;
  animation: auroraCurtain 16s ease-in-out infinite alternate;
  mix-blend-mode: screen;
}
@keyframes auroraCurtain { from { background-position: 0% 0; } to { background-position: 100% 0; } }

/* ---------- frosted cards with colour-tinted depth ---------- */
html[data-skin="aurora"] .section-card,
html[data-skin="aurora"] .xp-widget,
html[data-skin="aurora"] .course-card,
html[data-skin="aurora"] .stat-card,
html[data-skin="aurora"] .analytics-card,
html[data-skin="aurora"] .material-item {
  background: rgba(255, 255, 255, .80);
  border-color: rgba(214, 220, 240, .9);
  box-shadow: 0 1px 0 rgba(255,255,255,.9) inset, 0 10px 30px rgba(52, 48, 150, .07), 0 1px 3px rgba(40, 44, 110, .05);
}
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  @media (min-width: 900px) and (hover: hover) {
    html[data-skin="aurora"] .section-card,
    html[data-skin="aurora"] .xp-widget {
      background: rgba(255, 255, 255, .66);
      backdrop-filter: blur(14px) saturate(140%);
      -webkit-backdrop-filter: blur(14px) saturate(140%);
    }
  }
}
html[data-skin="aurora"] .course-card { position: relative; }
html[data-skin="aurora"] .course-card::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1.5px; pointer-events: none;
  background: var(--au-grad);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0; transition: opacity .3s var(--ease);
}
html[data-skin="aurora"] .course-card:hover::after,
html[data-skin="aurora"] .course-card:focus-visible::after { opacity: 1; }
html[data-skin="aurora"] .course-card:hover {
  border-color: transparent;
  box-shadow: 0 22px 48px rgba(79, 70, 229, .16), 0 8px 18px rgba(20, 184, 166, .08);
}
html[data-skin="aurora"] .section-card h2 > i:first-child,
html[data-skin="aurora"] .section-title-icon {
  background: var(--au-grad); color: #fff; -webkit-text-fill-color: #fff;
}

/* ---------- actions ---------- */
html[data-skin="aurora"] .btn-primary {
  background: var(--au-grad); background-size: 140% 100%; background-position: 0 0;
  border-color: transparent; color: #fff;
  box-shadow: 0 8px 22px rgba(90, 72, 227, .30), inset 0 1px 0 rgba(255,255,255,.25);
  transition: background-position .5s var(--ease), box-shadow .25s var(--ease), transform .2s var(--ease);
}
html[data-skin="aurora"] .btn-primary:hover:not(:disabled) {
  background: var(--au-grad); background-size: 140% 100%; background-position: 100% 0;
  box-shadow: 0 12px 30px rgba(90, 72, 227, .38), 0 6px 16px rgba(20, 184, 166, .18), inset 0 1px 0 rgba(255,255,255,.3);
}
html[data-skin="aurora"] .btn-accent {
  background: linear-gradient(120deg, #2dd4bf, #38bdf8); color: #06222b;
  box-shadow: 0 8px 22px rgba(20, 184, 166, .32);
}
html[data-skin="aurora"] .btn-outline:hover:not(:disabled) {
  border-color: var(--brand-400); color: var(--brand-700); background: rgba(109, 94, 243, .06);
}

/* ---------- streak, XP & premium banners pick up the aurora ---------- */
html[data-skin="aurora"] .xp-widget { background-image: var(--au-grad-soft); }
html[data-skin="aurora"] .subscribe-active-banner {
  background: linear-gradient(120deg, rgba(20,184,166,.12), rgba(79,124,247,.08) 60%, rgba(109,94,243,.10));
  border-color: rgba(20, 184, 166, .35);
}
html[data-skin="aurora"] .subscribe-active-icon { background: linear-gradient(135deg, #14b8a6, #4f7cf7); }
html[data-skin="aurora"] .subscribe-active-info h4 { color: #0f766e; }

/* ---------- fields, overlays & small details ---------- */
html[data-skin="aurora"] input:focus-visible,
html[data-skin="aurora"] select:focus-visible,
html[data-skin="aurora"] textarea:focus-visible {
  border-color: var(--brand-400);
  box-shadow: 0 0 0 3px rgba(109, 94, 243, .16), 0 0 0 6px rgba(20, 184, 166, .08);
}
html[data-skin="aurora"] .modal-overlay {
  background: rgba(16, 20, 54, .40);
  backdrop-filter: blur(6px) saturate(120%);
  -webkit-backdrop-filter: blur(6px) saturate(120%);
}
html[data-skin="aurora"] .modal-box {
  border-color: rgba(214, 220, 240, .9);
  box-shadow: 0 40px 90px rgba(30, 28, 110, .24), 0 0 0 1px rgba(255,255,255,.6) inset;
}
html[data-skin="aurora"] ::selection { background: rgba(109, 94, 243, .22); color: inherit; }
html[data-skin="aurora"] { scrollbar-color: #b7b0f6 transparent; }
html[data-skin="aurora"] ::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #a79cf8, #6fd8cb); border: 3px solid transparent; background-clip: content-box;
}
html[data-skin="aurora"] :focus-visible { outline-color: var(--brand-500); }
html[data-skin="aurora"] .empty-state > i { background: var(--au-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- top-bar switch: the sun wears an aurora halo ---------- */
html[data-skin="aurora"] .theme-switch[aria-checked="false"] .ts-track {
  background: linear-gradient(120deg, #2dd4bf, #60a5fa 55%, #a78bfa);
  border-color: rgba(255, 255, 255, .55);
  box-shadow: inset 0 1px 3px rgba(0,0,0,.15), 0 0 14px rgba(45, 212, 191, .45);
}
html[data-skin="aurora"] .theme-switch[aria-checked="false"] .ts-knob {
  background: radial-gradient(circle at 35% 30%, #ffffff 0%, #fef9c3 45%, #fde68a 100%);
  box-shadow: 0 0 0 3px rgba(255,255,255,.35), 0 0 12px rgba(253, 230, 138, .9);
}

/* ---------- Settings → Appearance: the Aurora choice previews itself ---------- */
.theme-choice.theme-choice-aurora {
  position: relative; overflow: hidden; color: #10142e; border-color: rgba(109, 94, 243, .35);
  background:
    radial-gradient(90px 50px at 10% 0%, rgba(45, 212, 191, .45), transparent 70%),
    radial-gradient(90px 60px at 95% 10%, rgba(139, 92, 246, .40), transparent 70%),
    radial-gradient(90px 50px at 60% 120%, rgba(56, 189, 248, .35), transparent 70%),
    #f7f8fd;
}
.theme-choice.theme-choice-aurora i { color: #0d9488; }
.theme-choice.theme-choice-aurora:hover { border-color: #8b7dfb; box-shadow: 0 0 18px rgba(109, 94, 243, .25); }
.theme-choice.theme-choice-aurora[aria-checked="true"] {
  border-color: #6d5ef3; color: #10142e;
  box-shadow: 0 0 0 3px rgba(109, 94, 243, .25), 0 0 22px rgba(20, 184, 166, .30);
}
.theme-choice-aurora .tc-new {
  position: absolute; top: 4px; right: 5px; font-size: 8.5px; font-weight: 800; letter-spacing: .4px; text-transform: uppercase;
  padding: 1px 5px; border-radius: 99px; color: #fff; background: linear-gradient(135deg, #6d5ef3, #14b8a6);
}


/* ---------- signature details ---------- */
/* page titles: ink that fades into aurora */
html[data-skin="aurora"] .dash-header h2,
html[data-skin="aurora"] .cd-content h2 {
  background: linear-gradient(100deg, #10142e 0%, #2b2170 45%, #5a48e3 75%, #0d9488 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
html[data-skin="aurora"] .dash-header h2 i,
html[data-skin="aurora"] .cd-content h2 * { -webkit-text-fill-color: initial; }
html[data-skin="aurora"] .dash-header h2 i {
  background: var(--au-grad); color: #fff; box-shadow: 0 6px 16px rgba(90, 72, 227, .30);
}
/* filter pills */
html[data-skin="aurora"] .material-tabs button.active {
  background: var(--au-grad); box-shadow: 0 8px 20px rgba(90, 72, 227, .30), 0 0 0 3px rgba(109, 94, 243, .12);
}
/* each card catches a little aurora light in its corner */
html[data-skin="aurora"] .course-card,
html[data-skin="aurora"] .section-card {
  background-image:
    radial-gradient(240px 140px at 100% 0%, rgba(139, 125, 251, .10), transparent 70%),
    radial-gradient(200px 120px at 0% 100%, rgba(45, 212, 191, .07), transparent 70%);
}
/* footer: the twilight sky again, edged with aurora */
html[data-skin="aurora"] .app-footer {
  background: var(--au-sky-band); color: rgba(226, 232, 255, .65);
  border-top: 1px solid transparent;
  border-image: linear-gradient(90deg, rgba(20,184,166,0), rgba(63,214,198,.6) 30%, rgba(139,125,251,.6) 70%, rgba(56,189,248,0)) 1;
}
/* progress bars glow like the lights */
html[data-skin="aurora"] .xp-fill,
html[data-skin="aurora"] .cd-progress-bar > span,
html[data-skin="aurora"] .course-progress-fill { background: var(--au-grad) !important; box-shadow: 0 0 10px rgba(45, 212, 191, .35); }

/* ---------- small screens: same look, less work for the GPU ---------- */
@media (max-width: 640px) {
  html[data-skin="aurora"] body::before { animation-duration: 70s; inset: -30vmax; }
  html[data-skin="aurora"] body::after { height: 36vh; }
  html[data-skin="aurora"] .hero-section::after { animation: none; }
}
@media (prefers-reduced-motion: reduce) {
  html[data-skin="aurora"] body::before, html[data-skin="aurora"] body::after,
  html[data-skin="aurora"] #appHeader::before, html[data-skin="aurora"] .hero-section::after { animation: none !important; }
}
@media print {
  html[data-skin="aurora"] body::before, html[data-skin="aurora"] body::after,
  html[data-skin="aurora"] #appHeader::before, html[data-skin="aurora"] .hero-section::after { display: none; }
  html[data-skin="aurora"] body { background: #fff; }
}
@media (max-width: 480px) {
  .premium-hub { padding: 20px 16px; }
  .premium-perk-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .premium-perk-card { padding: 10px; }
  .premium-perk-card b { font-size: 12.5px; }
  .premium-perk-card small { font-size: 11.5px; }
}

/* ==========================================================================
   ⭐ 2026-10-10 — SMART BACK button (header). Shown on every page except
   Home; closes the top pop-up first, then goes back a page.
   ========================================================================== */
.aero-back-btn {
  -webkit-tap-highlight-color: transparent; flex: 0 0 auto; cursor: pointer; font: inherit;
  display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 13px 0 10px; margin-right: 10px;
  border-radius: 12px; border: 1px solid rgba(255, 255, 255, .16);
  background: rgba(255, 255, 255, .08); color: #fff; font-size: 13.5px; font-weight: 600;
  transition: background .15s, transform .15s, border-color .15s;
  animation: aeroBackIn .22s var(--ease-out, ease-out) both;
}
.aero-back-btn[hidden] { display: none; }
.aero-back-btn i { font-size: 13px; transition: transform .15s; }
.aero-back-btn:hover { background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .3); }
.aero-back-btn:hover i { transform: translateX(-2px); }
.aero-back-btn:active { transform: scale(.95); }
.aero-back-btn:focus-visible { outline: 2px solid var(--accent-400, #22d3ee); outline-offset: 2px; }
@keyframes aeroBackIn { from { opacity: 0; transform: translateX(-6px); } to { opacity: 1; transform: none; } }
/* phones & tablets: a round chevron next to the logo; the long subtitle gives way */
@media (max-width: 900px) {
  .aero-back-btn { width: 40px; height: 40px; padding: 0; justify-content: center; margin-right: 8px; border-radius: 12px; }
  .aero-back-btn span { display: none; }
  .aero-back-btn i { font-size: 15px; }
  html.aero-has-back #appHeader .brand-text span { display: none; }
}
@media (max-width: 380px) {
  html.aero-has-back #appHeader .brand-text h1 { font-size: 15px; }
}
html[data-skin="aurora"] .aero-back-btn { background: rgba(127, 233, 221, .10); border-color: rgba(127, 233, 221, .28); }
html[data-skin="space"] .aero-back-btn { background: rgba(157, 140, 255, .12); border-color: rgba(157, 140, 255, .3); }
@media (prefers-reduced-motion: reduce) { .aero-back-btn { animation: none; } }
@media print { .aero-back-btn { display: none !important; } }

/* ==========================================================================
   ⭐ 2026-10-10 — LaTeX IN QUIZZES (tex-render.js)
   Text-mode LaTeX laid out like a typeset page; TeX diagrams on paper.
   ========================================================================== */
:root { --tex-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; --tex-serif: "Latin Modern Roman", "CMU Serif", Georgia, "Times New Roman", serif; }
.tex-rendered { overflow-wrap: anywhere; }
.tex-rendered .tex-parbreak { display: block; height: .7em; }
.tex-rendered .tex-h { margin: .7em 0 .35em; line-height: 1.25; color: var(--text-primary); font-weight: 750; letter-spacing: -.2px; }
.tex-rendered h3.tex-h { font-size: 1.25em; } .tex-rendered h4.tex-h { font-size: 1.1em; } .tex-rendered h5.tex-h { font-size: 1em; }
.tex-rendered .tex-title { font-size: 1.35em; font-weight: 800; text-align: center; margin: .3em 0 .6em; }
.tex-rendered .tex-list { margin: .35em 0 .45em; padding-left: 1.6em; }
.tex-rendered .tex-list li { margin: .18em 0; padding-left: .15em; }
.tex-rendered .tex-list li.tex-li-label { list-style: none; position: relative; }
.tex-rendered .tex-li-mark { position: absolute; left: -1.6em; font-weight: 600; }
.tex-rendered .tex-dl dt { font-weight: 700; margin-top: .3em; } .tex-rendered .tex-dl dd { margin: 0 0 .2em 1.4em; }
.tex-rendered .tex-center { text-align: center; margin: .4em 0; }
.tex-rendered .tex-flushright { text-align: right; } .tex-rendered .tex-flushleft { text-align: left; }
.tex-rendered .tex-quote { margin: .5em 0; padding: .2em 0 .2em 1em; border-left: 3px solid var(--border-strong); color: var(--text-secondary); }
.tex-rendered .tex-abstract { margin: .6em 1.5em; font-size: .94em; } .tex-rendered .tex-abstract-h { font-weight: 700; text-align: center; margin-bottom: .25em; }
.tex-rendered .tex-thm { margin: .55em 0; padding: .55em .8em; border-left: 3px solid var(--brand-500); background: color-mix(in srgb, var(--brand-500) 7%, transparent); border-radius: 0 8px 8px 0; }
.tex-rendered .tex-thm > strong:first-child { color: var(--brand-700, #4338ca); }
[data-theme="dark"] .tex-rendered .tex-thm > strong:first-child, [data-theme="dim"] .tex-rendered .tex-thm > strong:first-child { color: var(--brand-300); }
.tex-rendered .tex-thm-definition, .tex-rendered .tex-thm-defn, .tex-rendered .tex-thm-dfn { border-left-color: var(--accent-500, #06b6d4); background: color-mix(in srgb, var(--accent-500, #06b6d4) 8%, transparent); }
.tex-rendered .tex-thm-example, .tex-rendered .tex-thm-remark, .tex-rendered .tex-thm-note, .tex-rendered .tex-thm-hint { border-left-color: var(--gold-500, #f59e0b); background: color-mix(in srgb, var(--gold-500, #f59e0b) 8%, transparent); }
.tex-rendered .tex-proof { margin: .45em 0; } .tex-rendered .tex-qed { float: right; margin-left: .5em; }
.tex-rendered .tex-box { margin: .55em 0; padding: .6em .85em; border: 1px solid var(--border-default); border-radius: 10px; background: var(--bg-surface-2); }
.tex-rendered .tex-box-title { font-weight: 700; margin-bottom: .3em; }
.tex-rendered .tex-minipage { display: inline-block; vertical-align: top; max-width: 100%; }
.tex-rendered .tex-multicols { column-gap: 1.6em; margin: .4em 0; }
.tex-rendered .tex-float { margin: .7em 0; text-align: center; }
.tex-rendered .tex-caption { margin-top: .35em; font-size: .92em; color: var(--text-secondary); }
.tex-rendered .tex-caption::before { content: "Figure: "; font-weight: 700; }
.tex-rendered .tex-tt { font-family: var(--tex-mono); font-size: .9em; padding: .05em .3em; border-radius: 5px; background: var(--bg-surface-3); }
.tex-rendered .tex-code { margin: .5em 0; padding: .7em .9em; border-radius: 10px; background: #0f1426; color: #e2e8f0; font: 12.5px/1.55 var(--tex-mono); overflow-x: auto; text-align: left; white-space: pre; }
.tex-rendered .tex-code[data-lang]::before { content: attr(data-lang); display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: .6px; color: #94a3b8; margin-bottom: .35em; }
.tex-rendered .tex-sc { font-variant: small-caps; } .tex-rendered .tex-sf { font-family: var(--font-sans); } .tex-rendered .tex-rm { font-family: var(--tex-serif); }
.tex-rendered .tex-emph { font-style: italic; }
.tex-rendered .tex-nowrap { white-space: nowrap; }
.tex-rendered .tex-fbox { border: 1px solid currentColor; padding: .05em .35em; border-radius: 3px; }
.tex-rendered .tex-colorbox { padding: .05em .35em; border-radius: 4px; color: #111; }
.tex-rendered .tex-sp { display: inline-block; } .tex-rendered .tex-vsp { display: block; } .tex-rendered .tex-hfill { display: inline-block; width: 2em; }
.tex-rendered .tex-logo sup { font-size: .72em; vertical-align: .32em; margin-left: -.32em; margin-right: -.12em; }
.tex-rendered .tex-logo sub { font-size: 1em; vertical-align: -.22em; margin-left: -.12em; margin-right: -.1em; }
.tex-rendered .tex-ref { font-style: normal; color: var(--brand-600); }
.tex-rendered .tex-unit { white-space: nowrap; }
.tex-rendered .tex-img { max-width: 100%; height: auto; border-radius: 6px; vertical-align: middle; }
.tex-rendered .tex-fnref { color: var(--brand-600); font-weight: 700; margin-left: 1px; }
.tex-rendered .tex-footnotes { margin: .8em 0 0; padding: .5em 0 0 1.4em; border-top: 1px solid var(--border-subtle); font-size: .85em; color: var(--text-secondary); }
.tex-rendered .tex-pagebreak { border: 0; border-top: 1px dashed var(--border-default); margin: .8em 0; }
.tex-rendered .tex-missing { font-family: var(--tex-mono); font-size: .85em; color: var(--text-tertiary); }
/* tables: booktabs-like by default, borders where the column spec asks for them */
.tex-rendered .tex-table-wrap { max-width: 100%; overflow-x: auto; margin: .55em 0; }
.tex-rendered .tex-float .tex-table-wrap, .tex-rendered .tex-center .tex-table-wrap { display: flex; justify-content: center; }
.tex-rendered .tex-table { border-collapse: collapse; font-size: .95em; }
.tex-rendered .tex-table td { padding: .32em .75em; vertical-align: top; }
.tex-rendered .tex-table td.tex-rb { border-right: 1px solid var(--text-secondary); }
.tex-rendered .tex-table.tex-lb td:first-child { border-left: 1px solid var(--text-secondary); }
.tex-rendered .tex-table tr.tex-rule-thin td { border-top: 1px solid var(--text-secondary); }
.tex-rendered .tex-table tr.tex-rule-thick td { border-top: 1.6px solid var(--text-primary); }
.tex-rendered .tex-table tr.tex-rule-bottom-thin td { border-bottom: 1px solid var(--text-secondary); }
.tex-rendered .tex-table tr.tex-rule-bottom-thick td { border-bottom: 1.6px solid var(--text-primary); }
/* TeX diagrams: real TeX output on "paper" — reads the same in every theme */
.tex-fig { display: block; margin: .6em 0; text-align: center; }
.tex-fig.tex-fig-inline { display: inline-block; margin: 0 .2em; vertical-align: middle; }
.tex-fig-img { display: inline-block; max-width: 100%; height: auto; background: #fff; border-radius: 10px; padding: 8px; box-shadow: 0 0 0 1px rgba(15, 20, 48, .08), 0 6px 18px -8px rgba(15, 20, 48, .25); vertical-align: middle; }
.tex-fig-inline .tex-fig-img { padding: 3px 6px; border-radius: 7px; box-shadow: 0 0 0 1px rgba(15, 20, 48, .08); }
.tex-fig-doc { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 14px; border-radius: 12px; background: var(--bg-surface-3); }
.tex-fig-img.tex-fig-page { padding: 0; border-radius: 2px; box-shadow: 0 2px 4px rgba(0,0,0,.12), 0 12px 32px -10px rgba(0,0,0,.35); }
.tex-fig-loading { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 10px; font-size: 12.5px; color: var(--text-tertiary); border: 1px dashed var(--border-default); }
.tex-spin { width: 13px; height: 13px; border-radius: 50%; border: 2px solid var(--border-default); border-top-color: var(--brand-500); animation: texSpin .8s linear infinite; }
@keyframes texSpin { to { transform: rotate(360deg); } }
.tex-fig-err { display: inline-flex; flex-direction: column; gap: 4px; text-align: left; max-width: 100%; padding: 10px 12px; border-radius: 10px; font-size: 12.5px; line-height: 1.45;
  background: rgba(225, 29, 72, .07); border: 1px solid rgba(225, 29, 72, .3); color: var(--text-secondary); }
.tex-fig-err strong { color: #e11d48; } .tex-fig-err details summary { cursor: pointer; color: var(--text-tertiary); margin-top: 2px; }
.tex-fig-err .tex-code { margin: .4em 0 0; font-size: 11.5px; } .tex-fig-err mark { background: rgba(225, 29, 72, .45); color: #fff; }
.tex-fig-err.tex-fig-err-soft { flex-direction: row; align-items: center; gap: 8px; background: var(--bg-surface-2); border-color: var(--border-default); color: var(--text-tertiary); }
@media (prefers-reduced-motion: reduce) { .tex-spin { animation: none; } }
/* ---- LaTeX authoring: field toolbar, menus, split editor, guide ---- */
.tex-bar {
  position: fixed; z-index: 10040; display: none; align-items: center; gap: 2px; padding: 4px; border-radius: 12px;
  background: var(--bg-elevated, #fff); border: 1px solid var(--border-default); box-shadow: 0 12px 30px -10px rgba(15, 20, 48, .35);
  max-width: calc(100vw - 16px); overflow-x: auto; scrollbar-width: none;
}
.tex-bar::-webkit-scrollbar { display: none; }
.tex-bar.show { display: flex; }
.tex-bar button { flex: 0 0 auto; height: 30px; min-width: 30px; padding: 0 8px; border: 0; border-radius: 8px; background: transparent; color: var(--text-secondary);
  font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.tex-bar button:hover { background: var(--bg-surface-3); color: var(--text-primary); }
.tex-bar button .fa-caret-down { font-size: 10px; opacity: .6; }
.tex-bar-sep { width: 1px; height: 20px; background: var(--border-default); margin: 0 3px; flex: 0 0 auto; }
.tex-menu { position: fixed; z-index: 10045; min-width: 230px; max-height: min(70vh, 460px); overflow-y: auto; padding: 6px; border-radius: 12px;
  background: var(--bg-elevated, #fff); border: 1px solid var(--border-default); box-shadow: 0 20px 44px -12px rgba(15, 20, 48, .4); }
.tex-menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px; background: transparent;
  color: var(--text-primary); font: inherit; font-size: 13.5px; text-align: left; cursor: pointer; }
.tex-menu button i { width: 16px; text-align: center; color: var(--brand-500); }
.tex-menu button:hover { background: var(--bg-surface-3); }
.tex-menu-note { font-size: 11.5px; color: var(--text-tertiary); padding: 4px 10px 6px; display: flex; gap: 6px; align-items: center; }
.tex-editor-ov { z-index: 10060 !important; padding: 12px; }
.tex-editor { width: min(1400px, 100%); height: min(92vh, 980px); display: flex; flex-direction: column; border-radius: 16px; overflow: hidden;
  background: var(--bg-surface); border: 1px solid var(--border-subtle); box-shadow: var(--shadow-xl); }
.tex-editor-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border-subtle); flex-wrap: wrap; }
.tex-editor-title { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--text-primary); min-width: 0; }
.tex-editor-title > i { color: var(--brand-500); }
.tex-editor-status { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--text-tertiary); }
.tex-editor-status.is-ok { color: var(--emerald-600, #059669); } .tex-editor-status.is-bad { color: #e11d48; }
.tex-editor-actions { display: flex; gap: 8px; }
.tex-editor-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 1fr; }
.tex-editor-code { position: relative; display: flex; min-height: 0; background: #0f1426; }
.tex-editor-gutter { margin: 0; padding: 14px 8px 14px 12px; min-width: 42px; text-align: right; color: #475569; font: 13px/1.6 var(--tex-mono); overflow: hidden; user-select: none; background: #0b1020; }
.tex-editor-code textarea { flex: 1; min-width: 0; border: 0; outline: none; resize: none; padding: 14px; background: transparent; color: #e2e8f0;
  font: 13px/1.6 var(--tex-mono); white-space: pre; overflow: auto; tab-size: 2; caret-color: #a5b4fc; }
.tex-editor-preview { min-height: 0; overflow: auto; padding: 22px 26px; background: var(--bg-surface); color: var(--text-primary); font-size: 15px; line-height: 1.6; border-left: 1px solid var(--border-subtle); }
@media (max-width: 860px) {
  .tex-editor-ov { padding: 0; }
  .tex-editor { height: 100dvh; border-radius: 0; }
  .tex-editor-body { grid-template-columns: 1fr; grid-template-rows: 1fr 1fr; }
  .tex-editor-preview { border-left: 0; border-top: 1px solid var(--border-subtle); padding: 16px; }
}
.tex-guide-ov { z-index: 10070 !important; }
.tex-guide { max-width: 760px; }
.tex-guide-head { display: flex; justify-content: space-between; align-items: center; }
.tex-guide-head h3 { margin: 0; display: flex; gap: 10px; align-items: center; } .tex-guide-head h3 i { color: var(--brand-500); }
.tex-guide-x { width: 36px; height: 36px; border: 0; border-radius: 10px; background: transparent; color: var(--text-tertiary); cursor: pointer; font-size: 16px; }
.tex-guide-intro { color: var(--text-secondary); font-size: 13.5px; line-height: 1.55; }
.tex-guide-sec { margin-top: 18px; } .tex-guide-sec h4 { margin: 0 0 4px; font-size: 15px; } .tex-guide-sec > p { margin: 0 0 10px; font-size: 12.5px; color: var(--text-tertiary); }
.tex-guide-item { margin-bottom: 10px; } .tex-guide-item-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; font-size: 13px; }
.tex-guide .tex-code { margin: 0; padding: .6em .8em; border-radius: 9px; background: #0f1426; color: #e2e8f0; font: 12px/1.5 var(--tex-mono); overflow-x: auto; white-space: pre; }
.editor-hint-link { border: 0; background: none; padding: 0; color: var(--brand-600); font: inherit; font-weight: 600; text-decoration: underline; cursor: pointer; }

/* ============================================================
   ⭐ QUIZ SUBMISSIONS & GRADING (2026-10-10)
   ============================================================ */
.modal-overlay.aero-confirm-ov { z-index: 2500; }          /* above the exam shell and the submissions panel */
body.quiz-subs-open { overflow: hidden; }
.quiz-subs-ov {
  position: fixed; inset: 0; z-index: 1500;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 24px 16px; overflow-y: auto;
  background: rgba(15,23,42,.6); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
}
.quiz-subs {
  width: 100%; max-width: 1080px; margin: auto 0;
  background: var(--bg-surface); color: var(--text-primary);
  border: 1px solid var(--border-subtle); border-radius: 18px;
  box-shadow: 0 30px 80px rgba(0,0,0,.35);
  padding: 22px 22px 26px;
}
.quiz-subs-loading { display: flex; gap: 10px; align-items: center; justify-content: center; padding: 48px 8px; color: var(--text-secondary); flex-wrap: wrap; }
.qs-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.qs-head h2 { margin: 2px 0 4px; font-size: 20px; display: flex; gap: 10px; align-items: center; }
.qs-head .back-link { margin-bottom: 6px; }
.qs-head-actions { display: flex; gap: 8px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }
.qs-muted { color: var(--text-tertiary); font-size: 12.5px; }
.qs-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.qs-stat {
  border: 1px solid var(--border-subtle); background: var(--bg-surface-2);
  border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px;
}
.qs-stat b { font-size: 22px; line-height: 1.1; }
.qs-stat span { font-size: 12px; color: var(--text-tertiary); }
.qs-stat.warn b { color: #d97706; }
.qs-stat.bad b { color: var(--rose-500); }
.qs-stat.live b { color: var(--emerald-500); }
.qs-section-title { font-weight: 700; font-size: 13px; margin-bottom: 8px; display: flex; gap: 8px; align-items: center; color: var(--emerald-600); }
.qs-live { border: 1px solid rgba(16,185,129,.3); background: rgba(16,185,129,.06); border-radius: 12px; padding: 12px 14px; margin-bottom: 16px; }
.qs-live-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 5px 0; font-size: 13.5px; }
.qs-live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--emerald-500); box-shadow: 0 0 0 0 rgba(16,185,129,.6); animation: qsPulse 1.6s infinite; }
@keyframes qsPulse { 0% { box-shadow: 0 0 0 0 rgba(16,185,129,.55); } 70% { box-shadow: 0 0 0 8px rgba(16,185,129,0); } 100% { box-shadow: 0 0 0 0 rgba(16,185,129,0); } }
.qs-chip {
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
  font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 999px;
  background: var(--bg-surface-3); color: var(--text-secondary); border: 1px solid var(--border-subtle);
}
.qs-chip.ok { background: rgba(16,185,129,.1); color: var(--emerald-600); border-color: rgba(16,185,129,.25); }
.qs-chip.warn { background: rgba(245,158,11,.12); color: #b45309; border-color: rgba(245,158,11,.3); }
.qs-chip.bad { background: rgba(239,68,68,.1); color: var(--rose-600); border-color: rgba(239,68,68,.25); }
[data-theme="dark"] .qs-chip.warn, [data-theme="dim"] .qs-chip.warn { color: #fbbf24; }
[data-theme="dark"] .qs-chip.ok, [data-theme="dim"] .qs-chip.ok { color: #34d399; }
.qs-link { cursor: pointer; font: inherit; font-size: 11.5px; font-weight: 700; }
.qs-filters { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.qs-filter {
  border: 1px solid var(--border-default); background: transparent; color: var(--text-secondary);
  padding: 6px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 600; cursor: pointer;
}
.qs-filter.on { background: var(--brand-500); border-color: var(--brand-500); color: #fff; }
.qs-table-wrap { overflow-x: auto; border: 1px solid var(--border-subtle); border-radius: 12px; }
.qs-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.qs-table th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .4px; color: var(--text-tertiary); padding: 10px 12px; background: var(--bg-surface-2); white-space: nowrap; }
.qs-table td { padding: 11px 12px; border-top: 1px solid var(--border-subtle); vertical-align: top; }
.qs-table td:last-child { text-align: right; }
.qs-table td .qs-chip + .qs-chip { margin-top: 4px; }
.qs-name { font-weight: 700; }
.qs-empty { text-align: center; padding: 40px 10px; color: var(--text-tertiary); }
.qs-empty i { font-size: 28px; opacity: .6; }
.qs-log { list-style: none; margin: 0; padding: 0; max-height: 50vh; overflow-y: auto; text-align: left; }
.qs-log li { padding: 7px 0; border-bottom: 1px solid var(--border-subtle); font-size: 13.5px; }
.qs-log li.bad { color: var(--rose-600); }
.qs-log li span { color: var(--text-tertiary); font-variant-numeric: tabular-nums; margin-right: 6px; }
.qs-log li em { color: var(--text-tertiary); font-size: 12px; }
.qs-grade-list { display: flex; flex-direction: column; gap: 14px; }
.qs-grade-card { border: 1px solid var(--border-subtle); border-radius: 14px; padding: 16px; background: var(--bg-surface-2); }
.qs-grade-q { font-weight: 600; margin-bottom: 6px; line-height: 1.5; }
.qs-files { display: flex; gap: 10px; flex-wrap: wrap; margin: 12px 0; }
.qs-file {
  display: flex; flex-direction: column; align-items: center; gap: 6px; text-decoration: none;
  width: 132px; padding: 8px; border-radius: 10px; border: 1px solid var(--border-default);
  background: var(--bg-surface); color: var(--text-primary); font-size: 12px;
}
.qs-file:hover { border-color: var(--brand-500); }
.qs-file img { width: 100%; height: 110px; object-fit: cover; border-radius: 6px; background: var(--bg-surface-3); }
.qs-file.pdf i { font-size: 40px; color: #dc2626; padding: 22px 0; }
.qs-file span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qs-grade-form { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.qs-grade-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; font-weight: 600; }
.qs-grade-form input { width: 120px; }
.qs-grade-form .qs-fb { flex: 1 1 260px; }
.qs-grade-form textarea { width: 100%; resize: vertical; }
@media (max-width: 760px) {
  .quiz-subs-ov { padding: 0; }
  .quiz-subs { border-radius: 0; min-height: 100%; padding: 16px 16px 24px; }
  .qs-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .qs-head { flex-direction: column; }
  .qs-head-actions { justify-content: flex-start; }
  .qs-table thead { display: none; }
  .qs-table, .qs-table tbody, .qs-table tr, .qs-table td { display: block; width: 100%; }
  .qs-table tr { border-top: 1px solid var(--border-subtle); padding: 10px 12px; }
  .qs-table td { border: 0; padding: 3px 0; text-align: left !important; }
  .qs-table td[data-label]::before { content: attr(data-label) ": "; color: var(--text-tertiary); font-size: 12px; font-weight: 600; }
  .qs-table td[data-label] > div { display: inline; margin-left: 6px; }
  .qs-file { width: calc(50% - 5px); }
}

/* ⭐ student "My result" */
.myres-total { display: flex; align-items: baseline; justify-content: center; gap: 6px; margin: 4px 0 8px; }
.myres-total b { font-size: 40px; line-height: 1; }
.myres-total span { font-size: 18px; color: var(--text-tertiary); }
.myres-total em { font-style: normal; font-weight: 800; margin-left: 8px; padding: 3px 10px; border-radius: 999px; background: rgba(99,102,241,.12); color: var(--brand-600); font-size: 14px; }
.myres-split { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 16px; font-size: 13px; color: var(--text-secondary); margin-bottom: 10px; }
.myres-written { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; max-height: 46vh; overflow-y: auto; text-align: left; }
.myres-q { border: 1px solid var(--border-subtle); border-radius: 12px; padding: 10px 12px; background: var(--bg-surface-2); }
.myres-q-head { display: flex; gap: 6px; margin-bottom: 6px; }
.myres-q-text { font-size: 13.5px; }
.myres-fb { margin-top: 8px; font-size: 13px; padding: 8px 10px; border-radius: 8px; background: rgba(99,102,241,.08); color: var(--text-primary); }
.myres-fb i { color: var(--brand-500); margin-right: 4px; }
.qs-grade-form input, .qs-grade-form textarea {
  font: inherit; font-weight: 400; font-size: 14px;
  padding: 9px 11px; border-radius: 10px;
  border: 1px solid var(--border-default); background: var(--bg-surface); color: var(--text-primary);
}
.qs-grade-form input:focus, .qs-grade-form textarea:focus { outline: none; border-color: var(--brand-500); box-shadow: 0 0 0 3px rgba(99,102,241,.18); }
.qs-grade-form label .qs-muted { font-weight: 500; }

/* ============================================================
   ⭐ GRADING SECTION (2026-10-10)
   ============================================================ */
.gr-root { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.gr-loading { display: flex; gap: 10px; align-items: center; justify-content: center; padding: 56px 12px; color: var(--text-secondary); flex-wrap: wrap; }
.gr-card { background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: 16px; padding: 18px; min-width: 0; }
.gr-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.gr-card-head h3, .gr-h3 { margin: 0; font-size: 15.5px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.gr-card-head h3 i, .gr-h3 i { color: var(--brand-500); }
.gr-h3 { margin-bottom: 10px; }
.gr-card-head select, .gr-toolbar select {
  padding: 7px 10px; border-radius: 10px; border: 1px solid var(--border-default);
  background: var(--bg-surface); color: var(--text-primary); font: inherit; font-size: 13px;
}

/* KPI tiles */
.gr-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.gr-kpis-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.gr-kpi {
  position: relative; overflow: hidden;
  background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: 14px;
  padding: 14px 16px; display: flex; flex-direction: column; gap: 2px;
}
.gr-kpi i { position: absolute; right: 14px; top: 14px; font-size: 18px; color: var(--brand-400); opacity: .55; }
.gr-kpi b { font-size: 26px; line-height: 1.1; letter-spacing: -.5px; }
.gr-kpi span { font-size: 12.5px; color: var(--text-tertiary); }
.gr-kpi.warn { border-color: rgba(245,158,11,.35); background: linear-gradient(135deg, rgba(245,158,11,.10), transparent 70%); }
.gr-kpi.warn b, .gr-kpi.warn i { color: #d97706; opacity: 1; }
.gr-kpi.bad b { color: var(--rose-500); }
.gr-kpi.ok b { color: var(--emerald-500); }
.gr-kpi.live b, .gr-kpi.live i { color: var(--emerald-500); opacity: 1; }

/* queue */
.gr-queue { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.gr-queue-item, .gr-test {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  border: 1px solid var(--border-subtle); background: var(--bg-surface-2); color: var(--text-primary);
  border-radius: 12px; padding: 12px 14px; cursor: pointer; font: inherit;
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.gr-queue-item:hover, .gr-test:hover { border-color: var(--brand-500); box-shadow: 0 6px 18px rgba(99,102,241,.12); transform: translateY(-1px); }
.gr-queue-main, .gr-test-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.gr-queue-main b, .gr-test-main b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gr-queue-main .qs-muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gr-queue-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.gr-go { color: var(--text-tertiary); font-size: 12px; flex-shrink: 0; }
.gr-more { margin-top: 10px; }
.gr-allclear { display: flex; align-items: center; gap: 14px; }
.gr-allclear > i { font-size: 28px; color: var(--emerald-500); }
.gr-allclear div { display: flex; flex-direction: column; gap: 2px; }

.gr-avatar {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--brand-500), #8b5cf6);
}
.gr-avatar.lg { width: 64px; height: 64px; font-size: 26px; }

/* tests by course */
.gr-toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.gr-toolbar .qs-filters { margin: 0; }
.gr-search { position: relative; flex: 1 1 220px; min-width: 0; }
.gr-search i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-tertiary); font-size: 13px; }
.gr-search input {
  width: 100%; padding: 9px 12px 9px 34px; border-radius: 10px; font: inherit; font-size: 13.5px;
  border: 1px solid var(--border-default); background: var(--bg-surface); color: var(--text-primary);
}
.gr-course { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.gr-course header { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; padding: 2px 2px 4px; }
.gr-course h3 { margin: 0; font-size: 15px; }
.gr-code { font-size: 11.5px; font-weight: 800; letter-spacing: .4px; padding: 3px 8px; border-radius: 6px; background: rgba(99,102,241,.12); color: var(--brand-600); }
[data-theme="dark"] .gr-code, [data-theme="dim"] .gr-code { color: var(--brand-300); }
.gr-test-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12.5px; color: var(--text-tertiary); }
.gr-test-meta i { margin-right: 3px; }
.gr-test-stats { display: flex; align-items: center; gap: 8px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }
.gr-subs { font-size: 12.5px; color: var(--text-tertiary); white-space: nowrap; }
.gr-subs b { color: var(--text-primary); font-size: 14px; }
.gr-avg { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; min-width: 110px; }
.gr-mode { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--bg-surface-3); text-transform: capitalize; }
.gr-mode-manual { background: rgba(245,158,11,.14); color: #b45309; }
.gr-mode-scheduled { background: rgba(14,165,233,.14); color: #0369a1; }
[data-theme="dark"] .gr-mode-manual, [data-theme="dim"] .gr-mode-manual { color: #fbbf24; }
[data-theme="dark"] .gr-mode-scheduled, [data-theme="dim"] .gr-mode-scheduled { color: #7dd3fc; }

/* bars */
.gr-bar { position: relative; display: inline-block; width: 70px; height: 7px; border-radius: 999px; background: var(--bg-surface-3); overflow: hidden; vertical-align: middle; }
.gr-bar.lg { display: block; width: 100%; height: 10px; margin: 8px 0; }
.gr-bar-fill { position: absolute; inset: 0 auto 0 0; border-radius: inherit; }
.gr-bar-fill.ok { background: linear-gradient(90deg, #10b981, #34d399); }
.gr-bar-fill.mid { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.gr-bar-fill.bad { background: linear-gradient(90deg, #ef4444, #f87171); }
.gr-mini { display: inline-flex; align-items: center; gap: 6px; }

/* breadcrumbs + head */
.gr-crumbs { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.gr-crumbs button { background: none; border: 0; padding: 0; color: var(--brand-500); font: inherit; font-weight: 600; cursor: pointer; }
.gr-crumbs button:hover { text-decoration: underline; }
.gr-crumbs i { font-size: 10px; color: var(--text-tertiary); }
.gr-crumbs span { color: var(--text-secondary); font-weight: 600; }
.gr-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; flex-wrap: wrap; }
.gr-head h2 { margin: 0 0 6px; font-size: 22px; }
.gr-head-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* histogram + question table */
.gr-split { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 16px; }
.gr-hist { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 6px; height: 190px; align-items: end; }
.gr-hist-col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; }
.gr-hist-bar { width: 100%; min-height: 2px; border-radius: 6px 6px 2px 2px; }
.gr-hist-bar.ok { background: linear-gradient(180deg, #34d399, #10b981); }
.gr-hist-bar.mid { background: linear-gradient(180deg, #fbbf24, #f59e0b); }
.gr-hist-bar.bad { background: linear-gradient(180deg, #f87171, #ef4444); }
.gr-hist-n { font-size: 11.5px; font-weight: 700; }
.gr-hist-l { font-size: 10.5px; color: var(--text-tertiary); }
.gr-qtable { max-height: 330px; overflow-y: auto; }
.gr-qtext { max-width: 360px; }
.gr-qtext .latex-content { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.gr-hard { color: var(--rose-500); }

/* submissions table */
.gr-row { cursor: pointer; transition: background .12s; }
.gr-row:hover { background: rgba(99,102,241,.06); }
.gr-who { display: flex; align-items: center; gap: 10px; }
.gr-who > span:last-child { display: flex; flex-direction: column; }

/* attempt */
.gr-attempt { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 16px; align-items: start; }
.gr-side { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 12px; }
.gr-student { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.gr-student h2 { margin: 8px 0 0; font-size: 19px; }
.gr-facts { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; width: 100%; text-align: left; font-size: 13.5px; }
.gr-facts li { display: flex; gap: 10px; align-items: baseline; line-height: 1.4; word-break: break-word; }
.gr-facts li > i { width: 16px; color: var(--text-tertiary); flex-shrink: 0; text-align: center; }
.gr-facts a { color: var(--brand-500); }
.gr-score-big { display: flex; align-items: baseline; gap: 6px; }
.gr-score-big b { font-size: 40px; line-height: 1; letter-spacing: -1px; }
.gr-score-big span { font-size: 18px; color: var(--text-tertiary); }
.gr-score-row { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; color: var(--text-secondary); flex-wrap: wrap; }
.gr-score .btn-block { margin-top: 14px; }
.ok-t { color: var(--emerald-600); font-weight: 700; }
.bad-t { color: var(--rose-500); font-weight: 700; }
.gr-main { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.gr-attempt-bar {
  position: sticky; top: 0; z-index: 3; display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: 14px; padding: 10px 12px;
}
.gr-jump { display: flex; flex-wrap: wrap; gap: 5px; }
.gr-jump button {
  width: 32px; height: 32px; border-radius: 8px; font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer;
  border: 1px solid var(--border-default); background: var(--bg-surface-2); color: var(--text-secondary);
}
.gr-jump button.ok { background: rgba(16,185,129,.14); border-color: rgba(16,185,129,.4); color: var(--emerald-600); }
.gr-jump button.bad { background: rgba(239,68,68,.12); border-color: rgba(239,68,68,.35); color: var(--rose-600); }
.gr-jump button.warn { background: rgba(245,158,11,.14); border-color: rgba(245,158,11,.45); color: #b45309; }
.gr-nav { display: flex; gap: 6px; }
.gr-q { background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: 14px; padding: 16px; scroll-margin-top: 70px; }
.gr-q.is-pending { border-color: rgba(245,158,11,.5); box-shadow: 0 0 0 3px rgba(245,158,11,.08); }
.gr-q header { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.gr-q-chip { margin-left: auto; }
.gr-q-text { font-weight: 600; line-height: 1.6; margin-bottom: 10px; overflow-x: auto; }
.gr-opts { display: flex; flex-direction: column; gap: 6px; }
.gr-opt { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--border-subtle); background: var(--bg-surface-2); }
.gr-opt-l { width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; background: var(--bg-surface-3); flex-shrink: 0; }
.gr-opt .latex-content { flex: 1; min-width: 0; overflow-x: auto; }
.gr-opt-tags { display: flex; gap: 5px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }
.gr-opt.key { border-color: rgba(16,185,129,.45); }
.gr-opt.pick-ok { border-color: rgba(16,185,129,.6); background: rgba(16,185,129,.09); }
.gr-opt.pick-ok .gr-opt-l, .gr-opt.key .gr-opt-l { background: #10b981; color: #fff; }
.gr-opt.pick-bad { border-color: rgba(239,68,68,.55); background: rgba(239,68,68,.08); }
.gr-opt.pick-bad .gr-opt-l { background: #ef4444; color: #fff; }
.gr-num { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.gr-num > div { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border-radius: 10px; background: var(--bg-surface-2); border: 1px solid var(--border-subtle); }
.gr-num b { font-size: 18px; }
.gr-num b.ok, .gr-matrix td.ok { color: var(--emerald-600); }
.gr-num b.bad, .gr-matrix td.bad { color: var(--rose-500); }
[data-theme="dark"] .gr-num b.ok, [data-theme="dark"] .gr-matrix td.ok, [data-theme="dim"] .gr-num b.ok, [data-theme="dim"] .gr-matrix td.ok, [data-theme="dark"] .ok-t, [data-theme="dim"] .ok-t { color: #34d399; }
.gr-matrix { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.gr-matrix th { text-align: left; font-size: 11.5px; color: var(--text-tertiary); padding: 6px 8px; text-transform: uppercase; letter-spacing: .4px; }
.gr-matrix td { padding: 8px; border-top: 1px solid var(--border-subtle); }
.gr-expl { margin-top: 10px; font-size: 13.5px; }
.gr-expl summary { cursor: pointer; color: var(--brand-500); font-weight: 600; }
.gr-expl div { margin-top: 6px; padding: 10px 12px; border-radius: 10px; background: rgba(99,102,241,.07); }
.gr-legacy { padding: 10px 12px; border-radius: 10px; background: var(--bg-surface-2); }
.gr-quick { display: flex; gap: 4px; align-self: flex-end; padding-bottom: 2px; }
.gr-quick button { padding: 7px 9px; border-radius: 8px; border: 1px solid var(--border-default); background: var(--bg-surface-2); color: var(--text-secondary); font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.gr-quick button:hover { border-color: var(--brand-500); color: var(--brand-500); }
/* ⭐ AI check suggestion under a written answer */
.gr-ai-result { flex-basis: 100%; display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border-radius: 10px;
  background: rgba(99,102,241,.07); border: 1px solid rgba(99,102,241,.2); font-size: 13.5px; }
.gr-ai-result[hidden] { display: none; }
.gr-ai-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.gr-ai-result summary { cursor: pointer; color: var(--brand-500); font-weight: 600; }
.gr-ai-reason { margin-top: 4px; white-space: pre-wrap; color: var(--text-secondary); }
.gr-hist-table td, .gr-hist-table th { padding: 7px 8px; font-size: 12.5px; }

/* professor overlay */
.gr-overlay { position: fixed; inset: 0; z-index: 1500; background: var(--bg-surface-2, #0f172a); overflow-y: auto; padding: 0 16px 32px; }
.gr-overlay-bar {
  position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; gap: 10px;
  margin: 0 -16px 16px; padding: 12px 16px; background: var(--bg-surface); border-bottom: 1px solid var(--border-subtle);
}
.gr-overlay-bar span { display: flex; gap: 6px; }
.gr-overlay .gr-root { max-width: 1280px; margin: 0 auto; }

@media (max-width: 1100px) {
  .gr-kpis, .gr-kpis-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .gr-split { grid-template-columns: minmax(0, 1fr); }
  .gr-attempt { grid-template-columns: minmax(0, 1fr); }
  .gr-side { position: static; }
}
@media (max-width: 760px) {
  .gr-card { padding: 14px; border-radius: 14px; }
  .gr-kpis, .gr-kpis-6 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .gr-kpi b { font-size: 22px; }
  .gr-queue { grid-template-columns: minmax(0, 1fr); }
  .gr-test { flex-wrap: wrap; }
  .gr-test-stats { width: 100%; justify-content: flex-start; }
  .gr-test .gr-go { display: none; }
  .gr-hist { height: 150px; gap: 3px; }
  .gr-qtext { max-width: none; }
  .gr-qtable .qs-table td:last-child { text-align: left !important; }
  .gr-subs-table td:first-child { padding-bottom: 6px; }
  .gr-num { grid-template-columns: minmax(0, 1fr); }
  .gr-opt { flex-wrap: wrap; }
  .gr-opt-tags { width: 100%; justify-content: flex-start; padding-left: 36px; }
  .gr-attempt-bar { position: static; }
  .gr-quick { order: 3; width: 100%; }
}

/* ============================================================
   ⭐ LEARNING FEATURES (2026-10-11)
   ============================================================ */
/* nav dot (Practice has something waiting) */
.nav-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #f59e0b; margin-left: 4px; vertical-align: middle; box-shadow: 0 0 0 2px rgba(245,158,11,.25); }

/* paper editor */
.qe-topic-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: rgba(99,102,241,.12); color: var(--brand-600); }
[data-theme="dark"] .qe-topic-chip, [data-theme="dim"] .qe-topic-chip { color: var(--brand-300); }
.qe-diff-chip { display: inline-flex; align-items: center; font-size: 11px; font-weight: 800; padding: 2px 9px; border-radius: 999px; text-transform: capitalize; background: var(--bg-surface-3); color: var(--text-secondary); }
.qe-diff-easy { background: rgba(16,185,129,.12); color: var(--emerald-600); }
.qe-diff-medium { background: rgba(245,158,11,.14); color: #b45309; }
.qe-diff-hard { background: rgba(239,68,68,.12); color: var(--rose-600); }
[data-theme="dark"] .qe-diff-easy, [data-theme="dim"] .qe-diff-easy { color: #34d399; }
[data-theme="dark"] .qe-diff-medium, [data-theme="dim"] .qe-diff-medium { color: #fbbf24; }
[data-theme="dark"] .qe-diff-hard, [data-theme="dim"] .qe-diff-hard { color: #f87171; }
.qe-kind { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.qe-kind-opt { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; border: 1.5px solid var(--border-default); cursor: pointer; background: var(--bg-surface-2); }
.qe-kind-opt:has(input:checked) { border-color: var(--brand-500); background: rgba(99,102,241,.08); }
.qe-kind-opt input { margin-top: 3px; }
.qe-kind-opt span { display: flex; flex-direction: column; gap: 2px; }
.qe-kind-opt small { color: var(--text-tertiary); font-size: 12px; }
.qe-check { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; cursor: pointer; line-height: 1.45; }
.qe-check input { margin-top: 3px; flex-shrink: 0; }
.qe-bank-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; margin: 4px 0 12px; border-radius: 12px; border: 1px dashed var(--border-default); background: var(--bg-surface-2); }
.qe-bank-bar > span:first-child i { color: var(--brand-500); }
.qe-bank-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* in-exam assignment */
.quiz-proctor-pill.assign { background: rgba(14,165,233,.12); color: #0369a1; border-color: rgba(14,165,233,.25); }
[data-theme="dark"] .quiz-proctor-pill.assign, [data-theme="dim"] .quiz-proctor-pill.assign { color: #7dd3fc; }
.quiz-exam-timer.assign-due { font-size: 15px; letter-spacing: 0; font-family: inherit; }

/* my result */
.myres-standing { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 6px 0 10px; }
.myres-standing div { display: flex; flex-direction: column; align-items: center; padding: 8px; border-radius: 10px; background: var(--bg-surface-2); border: 1px solid var(--border-subtle); }
.myres-standing b { font-size: 18px; }
.myres-standing span { font-size: 11.5px; color: var(--text-tertiary); }
.myres-board { margin: 8px 0; text-align: left; border: 1px solid var(--border-subtle); border-radius: 12px; overflow: hidden; }
.myres-board-h { padding: 8px 12px; font-weight: 700; font-size: 13px; background: var(--bg-surface-2); }
.myres-board-h i { color: #f59e0b; }
.myres-board-row { display: flex; align-items: center; gap: 10px; padding: 7px 12px; border-top: 1px solid var(--border-subtle); font-size: 13.5px; }
.myres-board-row span:nth-child(2) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.myres-board-row.me { background: rgba(99,102,241,.1); font-weight: 700; }
.myres-board-row em { font-style: normal; color: var(--brand-500); font-size: 12px; }
.myres-medal { width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 11.5px; font-weight: 800; background: var(--bg-surface-3); flex-shrink: 0; }
.myres-medal.r1 { background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #fff; }
.myres-medal.r2 { background: linear-gradient(135deg, #cbd5e1, #94a3b8); color: #fff; }
.myres-medal.r3 { background: linear-gradient(135deg, #f0a875, #c2410c); color: #fff; }

/* Q&A */
.qa-ask-about { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 13px; color: var(--text-secondary); flex-wrap: wrap; }
.qa-ask-about select { flex: 1 1 220px; min-width: 0; }
.qa-toolbar { display: flex; gap: 6px; flex-wrap: wrap; margin: 14px 0 10px; }
.qa-about { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--brand-600); background: rgba(99,102,241,.08); padding: 3px 10px; border-radius: 999px; margin: 6px 0 2px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
[data-theme="dark"] .qa-about, [data-theme="dim"] .qa-about { color: var(--brand-300); }
.qa-body { display: flex; gap: 12px; align-items: flex-start; }
.qa-body .qa-question { flex: 1; min-width: 0; margin: 8px 0; overflow-x: auto; }
.qa-vote { display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 42px; padding: 6px 4px; margin-top: 4px; border-radius: 10px; cursor: pointer; border: 1px solid var(--border-default); background: var(--bg-surface-2); color: var(--text-secondary); font: inherit; }
.qa-vote b { font-size: 13px; }
.qa-vote.on { border-color: var(--brand-500); background: rgba(99,102,241,.12); color: var(--brand-600); }
.qa-vote:disabled { cursor: default; opacity: .75; }
.qa-vote:not(:disabled):hover { border-color: var(--brand-500); }
.mat-ask-btn span { display: inline; }
@media (max-width: 520px) { .mat-ask-btn span { display: none; } }

/* home banner */
.lp-banner { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin: 0 0 18px; padding: 14px 18px; border-radius: 16px;
  background: linear-gradient(135deg, rgba(99,102,241,.12), rgba(139,92,246,.06)); border: 1px solid rgba(99,102,241,.25); }
.lp-banner-main { display: flex; align-items: center; gap: 14px; min-width: 0; flex: 1 1 280px; }
.lp-banner-main > div:last-child { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.lp-banner-main span { font-size: 13px; color: var(--text-secondary); }
.lp-banner-main span i { color: #f97316; }
.lp-due { color: var(--rose-500); }
.lp-banner-icon { width: 46px; height: 46px; border-radius: 14px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 20px; color: #fff; background: linear-gradient(135deg, #6366f1, #8b5cf6); }
.lp-banner-icon.done { background: linear-gradient(135deg, #10b981, #059669); }
.lp-banner-actions { display: flex; gap: 8px; }

/* practice page */
.lp-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.lp-head h2 { margin: 0 0 4px; display: flex; gap: 10px; align-items: center; }
.lp-head h2 i { color: var(--brand-500); }
.lp-head p { margin: 0; color: var(--text-secondary); font-size: 14px; }
.lp-streak { display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 14px; border: 1px solid var(--border-subtle); background: var(--bg-surface); }
.lp-streak i { font-size: 22px; color: var(--text-tertiary); }
.lp-streak b { font-size: 24px; }
.lp-streak span { font-size: 12.5px; color: var(--text-tertiary); }
.lp-streak.on { border-color: rgba(249,115,22,.4); background: linear-gradient(135deg, rgba(249,115,22,.12), transparent); }
.lp-streak.on i { color: #f97316; }
.lp-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; margin-bottom: 16px; scrollbar-width: none; }
.lp-tabs::-webkit-scrollbar { display: none; }
.lp-tab { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; padding: 10px 16px; border-radius: 12px; border: 1px solid var(--border-subtle); background: var(--bg-surface); color: var(--text-secondary); font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; }
.lp-tab.on { background: var(--brand-500); border-color: var(--brand-500); color: #fff; }
.lp-tab em { font-style: normal; font-size: 11.5px; font-weight: 800; min-width: 20px; padding: 1px 6px; border-radius: 999px; background: rgba(245,158,11,.2); color: #b45309; text-align: center; }
.lp-tab.on em { background: rgba(255,255,255,.25); color: #fff; }
.lp-body { display: flex; flex-direction: column; gap: 12px; }
.lp-empty { text-align: center; padding: 46px 16px; border-radius: 16px; border: 1px dashed var(--border-default); background: var(--bg-surface); }
.lp-empty > i { font-size: 34px; color: var(--brand-400); }
.lp-empty h3 { margin: 12px 0 6px; }
.lp-empty p { color: var(--text-secondary); max-width: 520px; margin: 0 auto 14px; line-height: 1.55; }
.lp-progress { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 14px; background: var(--bg-surface); border: 1px solid var(--border-subtle); }
.lp-dots { display: flex; gap: 6px; }
.lp-dots span { width: 26px; height: 8px; border-radius: 999px; background: var(--bg-surface-3); }
.lp-dots span.ok { background: #10b981; }
.lp-dots span.bad { background: #ef4444; }
.lp-done { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 14px 16px; border-radius: 14px; background: linear-gradient(135deg, rgba(16,185,129,.12), transparent); border: 1px solid rgba(16,185,129,.3); }
.lp-done > i { font-size: 26px; color: #f59e0b; }
.lp-done > div { display: flex; flex-direction: column; gap: 2px; flex: 1 1 220px; }
.lp-done span { font-size: 13px; color: var(--text-secondary); }
.lp-card { background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: 14px; padding: 16px; }
.lp-card.is-right { border-color: rgba(16,185,129,.45); }
.lp-card.is-wrong { border-color: rgba(239,68,68,.4); }
.lp-card header { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.lp-q { font-weight: 600; line-height: 1.6; margin-bottom: 10px; overflow-x: auto; }
.lp-tag { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 999px; border: 0; cursor: default; font-family: inherit;
  background: rgba(99,102,241,.1); color: var(--brand-600); }
button.lp-tag { cursor: pointer; }
.lp-tag.on, button.lp-tag:hover { background: var(--brand-500); color: #fff; }
.lp-tag b { font-weight: 800; opacity: .8; }
[data-theme="dark"] .lp-tag, [data-theme="dim"] .lp-tag { color: var(--brand-300); }
[data-theme="dark"] .lp-tag.on, [data-theme="dim"] .lp-tag.on { color: #fff; }
.lp-verdict { margin-left: auto; font-size: 12.5px; font-weight: 800; display: inline-flex; gap: 5px; align-items: center; color: var(--text-secondary); }
.lp-verdict.ok { color: var(--emerald-600); }
.lp-verdict.bad { color: var(--rose-500); }
.lp-opts { display: flex; flex-direction: column; gap: 6px; }
.lp-opt { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border-subtle); background: var(--bg-surface-2); cursor: pointer; }
.lp-opt input { position: absolute; opacity: 0; pointer-events: none; }
.lp-opt .latex-content { flex: 1; min-width: 0; overflow-x: auto; }
.lp-opt.sel { border-color: var(--brand-500); background: rgba(99,102,241,.1); }
.lp-opt.sel .lp-opt-l { background: var(--brand-500); color: #fff; }
.lp-opt-l { width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; background: var(--bg-surface-3); }
.lp-opts.done .lp-opt { cursor: default; }
.lp-opt.key { border-color: rgba(16,185,129,.5); }
.lp-opt.key .lp-opt-l, .lp-opt.right .lp-opt-l { background: #10b981; color: #fff; }
.lp-opt.right { background: rgba(16,185,129,.1); }
.lp-opt.wrong { border-color: rgba(239,68,68,.5); background: rgba(239,68,68,.08); }
.lp-opt.wrong .lp-opt-l { background: #ef4444; color: #fff; }
.lp-opt em { font-style: normal; font-size: 11.5px; font-weight: 700; color: var(--text-tertiary); flex-shrink: 0; }
.lp-num { width: 100%; max-width: 260px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border-default); background: var(--bg-surface); color: var(--text-primary); font: inherit; }
.lp-numkey { display: flex; gap: 18px; flex-wrap: wrap; font-size: 14px; }
.lp-numkey .ok { color: var(--emerald-600); }
.lp-matrix { display: flex; flex-direction: column; gap: 6px; }
.lp-mrow { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 8px 10px; border-radius: 10px; background: var(--bg-surface-2); }
.lp-mrow select { min-width: 160px; flex: 0 1 260px; }
.lp-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.lp-ai { margin-top: 12px; padding: 12px 14px; border-radius: 12px; background: rgba(99,102,241,.06); border: 1px solid rgba(99,102,241,.2); }
.lp-was { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border-radius: 10px; background: var(--bg-surface-2); }
.lp-was .lp-verdict { margin-left: 0; }
.lp-mhead { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.lp-mstat { display: flex; flex-direction: column; padding: 10px 16px; border-radius: 12px; background: var(--bg-surface); border: 1px solid var(--border-subtle); }
.lp-mstat b { font-size: 22px; color: var(--rose-500); }
.lp-mstat.ok b { color: var(--emerald-500); }
.lp-mstat span { font-size: 12px; color: var(--text-tertiary); }
.lp-mtopics { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; flex: 1 1 260px; }
.lp-assign-list { display: flex; flex-direction: column; gap: 10px; }
.lp-assign { display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--border-subtle); background: var(--bg-surface); }
.lp-assign.urgent { border-color: rgba(239,68,68,.45); }
.lp-assign-ic { width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; color: #0ea5e9; background: rgba(14,165,233,.12); font-size: 18px; }
.lp-assign-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.lp-assign-top { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.lp-assign-due { font-size: 13px; color: var(--text-secondary); }
.lp-assign-score { font-size: 13.5px; }
.lp-assign-act { display: flex; flex-direction: column; gap: 6px; flex-shrink: 0; }
.lp-series { background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: 16px; padding: 16px; }
.lp-series header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.lp-series h3 { margin: 0 0 4px; display: flex; gap: 8px; align-items: center; }
.lp-series h3 i { color: #f59e0b; }
.lp-series-me { display: flex; align-items: baseline; gap: 6px; padding: 8px 14px; border-radius: 12px; background: rgba(99,102,241,.1); }
.lp-series-me b { font-size: 22px; }
.lp-series-me em { font-style: normal; font-weight: 800; color: var(--brand-500); margin-left: 6px; }
.lp-series-progress { display: flex; align-items: center; gap: 12px; margin: 12px 0; }
.lp-series-progress .gr-bar { flex: 1; margin: 0; }
.lp-series-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 14px; }
.lp-series-tests { display: flex; flex-direction: column; gap: 6px; }
.lp-st { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: var(--bg-surface-2); }
.lp-st-n { width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; background: var(--bg-surface-3); flex-shrink: 0; }
.lp-st.done .lp-st-n { background: #10b981; color: #fff; }
.lp-st-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.lp-st-main b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ok-t, .lp-st .ok-t { color: var(--emerald-600); }
.mid-t { color: #d97706; }
.bad-t { color: var(--rose-500); }
.lp-series-board { border: 1px solid var(--border-subtle); border-radius: 12px; overflow: hidden; align-self: start; }

/* analytics performance */
.lp-perf { margin-bottom: 20px; display: flex; flex-direction: column; gap: 14px; }
.lp-perf-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.lp-perf-head h3 { margin: 0; display: flex; gap: 8px; align-items: center; }
.lp-perf-head h3 i { color: var(--brand-500); }
.lp-perf-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.gr-kpi.mid b { color: #d97706; }
.lp-advice { display: flex; flex-direction: column; gap: 8px; }
.lp-advice-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border-subtle); background: var(--bg-surface); }
.lp-advice-row > i { font-size: 18px; margin-top: 2px; }
.lp-advice-row.bad > i { color: var(--rose-500); }
.lp-advice-row.ok > i { color: #f59e0b; }
.lp-advice-row > div { display: flex; gap: 6px 10px; align-items: center; flex-wrap: wrap; font-size: 14px; }
.lp-perf-split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.lp-topic { display: grid; grid-template-columns: minmax(0, 140px) minmax(0, 1fr) 46px 44px; gap: 10px; align-items: center; padding: 5px 0; font-size: 13px; }
.lp-topic .gr-bar { margin: 0; }
.lp-topic-n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.lp-diff { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.lp-ranks { display: flex; flex-direction: column; }
.lp-rank-row { display: grid; grid-template-columns: minmax(0, 1fr) 54px 56px 40px; gap: 8px; align-items: center; padding: 8px 0; border-top: 1px solid var(--border-subtle); font-size: 13.5px; }
.lp-rank-row:first-child { border-top: 0; }
.lp-rank-main { display: flex; flex-direction: column; min-width: 0; }
.lp-rank-main b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lp-rank-pct { font-weight: 800; text-align: right; }
.lp-rank-pos { font-weight: 800; text-align: right; }
.lp-rank-pos small { color: var(--text-tertiary); font-weight: 600; }
.lp-rank-pctl { font-size: 11.5px; font-weight: 800; color: var(--brand-500); text-align: right; }

/* bank picker / modals */
.bk-ov { position: fixed; inset: 0; z-index: 1600; display: flex; align-items: flex-start; justify-content: center; padding: 28px 16px; overflow-y: auto; background: rgba(15,23,42,.6); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.bk-modal { width: 100%; max-width: 820px; margin: auto 0; background: var(--bg-surface); color: var(--text-primary); border: 1px solid var(--border-subtle); border-radius: 18px; padding: 20px; box-shadow: 0 30px 80px rgba(0,0,0,.35); display: flex; flex-direction: column; gap: 12px; }
.bk-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.bk-head h3 { margin: 0; display: flex; gap: 8px; align-items: center; }
.bk-head h3 i { color: var(--brand-500); }
.bk-list { display: flex; flex-direction: column; gap: 6px; max-height: 56vh; overflow-y: auto; }
.qb-row + .qb-row { margin-top: 0; }
.bk-item { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border-subtle); background: var(--bg-surface-2); cursor: pointer; }
.bk-item.qb-row { cursor: default; }
.bk-item.there { opacity: .6; cursor: default; }
.bk-item input { margin-top: 4px; flex-shrink: 0; }
.bk-item-main { display: flex; flex-direction: column; gap: 6px; min-width: 0; flex: 1; }
.bk-item-main > .latex-content { overflow-x: auto; line-height: 1.5; }
.bk-meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: 12px; }
.bk-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding-top: 4px; }
.bk-foot > span:last-child { display: flex; gap: 8px; }
.bk-pager { display: flex; justify-content: center; align-items: center; gap: 12px; padding: 8px 0; }
.bk-topic { width: 150px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--border-default); background: var(--bg-surface); color: var(--text-primary); font: inherit; font-size: 13px; }
.qb-acts { display: flex; gap: 4px; flex-shrink: 0; }
.qb-topics { display: flex; gap: 6px; flex-wrap: wrap; }
.qb-opt { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.qb-opt input[type=text] { flex: 1; min-width: 0; }
.qb-csv-help { white-space: pre-wrap; font-size: 12.5px; padding: 10px 12px; border-radius: 10px; background: var(--bg-surface-2); border: 1px solid var(--border-subtle); margin: 0; }
.qb-csv-notes { margin: 0; padding-left: 18px; font-size: 13px; color: var(--text-secondary); line-height: 1.7; }
.qb-drop { position: relative; display: flex; align-items: center; justify-content: center; padding: 22px; border-radius: 12px; border: 2px dashed var(--border-default); color: var(--brand-500); font-weight: 700; }
.qb-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.qb-sample { font-size: 13px; color: var(--brand-500); align-self: flex-start; }
.qb-preview ol { margin: 8px 0 0; padding-left: 20px; font-size: 13px; line-height: 1.7; }
.ap-mix { display: flex; gap: 10px; flex-wrap: wrap; }
.ap-mix label { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.ap-mix input { width: 70px; }
.ap-topics, .sr-pick { display: flex; flex-direction: column; gap: 4px; max-height: 260px; overflow-y: auto; padding: 4px; border: 1px solid var(--border-subtle); border-radius: 10px; }
.ap-topic { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 8px; cursor: pointer; font-size: 13.5px; }
.ap-topic:hover { background: var(--bg-surface-2); }
.ap-topic span { flex: 1; min-width: 0; }
.ap-topic em { font-style: normal; font-size: 12px; color: var(--text-tertiary); }
.sr-list { display: flex; flex-direction: column; gap: 6px; }
.sr-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--bg-surface-2); border: 1px solid var(--border-subtle); }
.sr-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }

@media (max-width: 860px) {
  .lp-series-grid, .lp-perf-split { grid-template-columns: minmax(0, 1fr); }
  .lp-perf-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .qe-kind { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .lp-head h2 { font-size: 20px; }
  .lp-streak { padding: 8px 12px; }
  .lp-assign { flex-wrap: wrap; }
  .lp-assign-act { flex-direction: row; width: 100%; }
  .lp-assign-act .btn { flex: 1; justify-content: center; }
  .lp-topic { grid-template-columns: minmax(0, 1fr) 42px 40px; }
  .lp-topic .gr-bar { grid-column: 1 / -1; grid-row: 2; }
  .lp-rank-row { grid-template-columns: minmax(0, 1fr) 46px 50px; }
  .lp-rank-pctl { display: none; }
  .lp-banner-actions { width: 100%; }
  .lp-banner-actions .btn { flex: 1; justify-content: center; }
  .bk-ov { padding: 0; }
  .bk-modal { border-radius: 0; min-height: 100%; }
  .bk-list { max-height: none; }
  .lp-progress { flex-direction: column; align-items: flex-start; }
}
.quiz-exam-timer.assign-due { font-family: inherit !important; font-variant-numeric: normal; }
.qa-ask-about select { padding: 7px 10px; border-radius: 10px; border: 1px solid var(--border-default); background: var(--bg-surface); color: var(--text-primary); font: inherit; font-size: 13.5px; }

/* ⭐ 2026-10-11 — header links animate colour only, never their size (the
   size animation made the header "vibrate" while it re-fitted itself) */
.main-nav a { transition: color .2s var(--ease), background-color .2s var(--ease), box-shadow .2s var(--ease), opacity .2s var(--ease) !important; }
#appHeader.hdr-measuring, #appHeader.hdr-measuring * { transition: none !important; }

/* ============================================================
   ⭐ 2026-10-11 — phone / tablet menu (☰) must be solid
   The Space and Aurora skins make #mainNav transparent so the desktop
   header shows through behind the links — but on phones #mainNav is the
   drop-down panel, so the page underneath showed through it and the
   links were hard to read. The panel now gets a solid background in
   every skin, and the page behind it is dimmed while it is open.
   ============================================================ */
@media (max-width: 860px) {
  html[data-skin="space"] #appHeader #mainNav {
    background: linear-gradient(180deg, #0a0d2a 0%, #070920 100%) !important;
    border-bottom: 1px solid rgba(157, 140, 255, .28);
  }
  html[data-skin="aurora"] #appHeader #mainNav {
    background: linear-gradient(160deg, #0b1030 0%, #111a4c 55%, #0d2c46 100%) !important;
    border-bottom: 1px solid rgba(99, 214, 198, .35);
  }
  /* readable links in every skin */
  #appHeader #mainNav a { color: rgba(255,255,255,.9) !important; }
  #appHeader #mainNav a:not(.active) { background: rgba(255,255,255,.08) !important; }
  #appHeader #mainNav a:not(.active):hover { background: rgba(255,255,255,.14) !important; }
  #appHeader #mainNav a.active { color: #fff !important; }

  /* dim the page behind the open menu (a tap on it closes the menu — app.js).
     A real element, not body::before — the Space / Aurora skins draw their
     sky on body::before / ::after. */
  #aeroNavScrim.show {
    display: block; position: fixed; inset: 0; z-index: 199;
    background: rgba(2, 6, 23, .55);
    animation: aeroNavScrim .2s ease both;
  }
}
#aeroNavScrim { display: none; }
@keyframes aeroNavScrim { from { opacity: 0; } to { opacity: 1; } }

/* ============================================================
   Google Play build of the Android app (2026-10-12): Play policy
   allows no buying inside the app — hide every price, Buy /
   Unlock / Subscribe button and plan banner (app.js also blocks
   the checkout functions themselves).
   ============================================================ */
html.aero-play-store [onclick*="showPaymentModal"],
html.aero-play-store [onclick*="startSubscriptionCheckout"],
html.aero-play-store [onclick*="openPlansShowcaseModal"],
html.aero-play-store [onclick*="startCheckoutForPlan"],
html.aero-play-store .subscribe-cta,
html.aero-play-store .subscribe-banner { display: none !important; }

/* ⭐ 2026-10-14 — sign-in screen with no connection: open the notes on this device */
.lg-offline-notes {
  margin-top: 16px; padding: 14px; border-radius: 14px;
  background: rgba(245, 158, 11, .10); border: 1px solid rgba(245, 158, 11, .35);
}
.lg-offline-notes[hidden] { display: none; }
.lg-offline-head { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; color: var(--text-primary); }
.lg-offline-head i { color: #d97706; }
.lg-offline-notes p { margin: 6px 0 10px; font-size: 13px; line-height: 1.5; color: var(--text-secondary); }
.lg-offline-btn { margin-top: 6px; justify-content: center; }

/* ============================================================
   ⭐ DEPARTMENTS — scrollable chip bar + "All departments" grid
   (students + admin), 2026-10-16. Each department has an icon and a
   hue (--dh, set inline); the picked one is filled and glows.
   ============================================================ */
.dept-bar { display: flex; align-items: center; gap: 6px; margin: 4px 0 16px; min-width: 0; }
.dept-bar:empty { display: none; }
.dept-scroll {
  display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x proximity; scroll-behavior: smooth;
  padding: 6px 4px 10px; flex: 1; min-width: 0; -webkit-overflow-scrolling: touch;
  scrollbar-width: thin; scrollbar-color: var(--border-default) transparent;
  mask-image: linear-gradient(90deg, transparent 0, #000 16px, #000 calc(100% - 16px), transparent 100%);
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 16px, #000 calc(100% - 16px), transparent 100%);
}
.dept-scroll::-webkit-scrollbar { height: 6px; }
.dept-scroll::-webkit-scrollbar-thumb { background: var(--border-default); border-radius: 6px; }

.dept-ic {
  --dh: 230; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 50%; font-size: 13px;
  background: hsl(var(--dh) 85% 55% / .14); color: hsl(var(--dh) 70% 42%);
}
.dept-ic.lg { width: 46px; height: 46px; font-size: 20px; border-radius: 14px; }
.dept-ic.title { width: 34px; height: 34px; font-size: 16px; border-radius: 10px; vertical-align: middle; }
[data-theme="dark"] .dept-ic, [data-theme="dim"] .dept-ic { background: hsl(var(--dh) 80% 60% / .18); color: hsl(var(--dh) 90% 72%); }

.dept-chip {
  --dh: 230; flex: 0 0 auto; scroll-snap-align: center; display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 12px 5px 5px; border-radius: 999px; border: 1px solid hsl(var(--dh) 60% 50% / .28);
  background: hsl(var(--dh) 80% 55% / .06); color: var(--text-primary, inherit); font: inherit; font-size: 13.5px; font-weight: 600;
  white-space: nowrap; cursor: pointer; transition: transform .15s, box-shadow .15s, border-color .15s, background .15s;
}
.dept-chip:hover { border-color: hsl(var(--dh) 70% 50%); background: hsl(var(--dh) 80% 55% / .12); transform: translateY(-1px); }
.dept-chip:focus-visible { outline: 2px solid hsl(var(--dh) 75% 50%); outline-offset: 2px; }
.dept-chip.empty { opacity: .62; }
.dept-chip.on {
  opacity: 1; color: #fff; border-color: transparent;
  background: linear-gradient(135deg, hsl(var(--dh) 75% 50%), hsl(calc(var(--dh) + 35) 75% 46%));
  box-shadow: 0 4px 16px hsl(var(--dh) 80% 50% / .4);
}
.dept-chip.on .dept-ic { background: rgba(255,255,255,.22); color: #fff; }
.dept-chip-n { font-size: 11.5px; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: rgba(127,127,127,.16); }
.dept-chip.on .dept-chip-n { background: rgba(255,255,255,.25); }

.dept-arrow, .dept-browse {
  flex: 0 0 auto; height: 34px; border-radius: 999px; border: 1px solid var(--border-default);
  background: var(--bg-surface-2); color: var(--text-secondary); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; font: inherit; font-size: 13px; font-weight: 700;
}
.dept-arrow { width: 34px; }
.dept-browse { padding: 0 14px; }
.dept-arrow:hover, .dept-browse:hover { border-color: var(--brand-500); color: var(--brand-500); }
.dept-title { display: flex; align-items: center; gap: 10px; }
.dept-linked { font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 6px; background: rgba(99,102,241,.12); color: var(--brand-500); }

/* "All departments" grid */
.dept-picker-overlay {
  position: fixed; inset: 0; z-index: 2000; background: rgba(8,12,24,.55); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.dept-picker {
  width: min(920px, 100%); max-height: min(86vh, 760px); display: flex; flex-direction: column; gap: 12px;
  background: var(--bg-surface, var(--bg-surface-2)); color: var(--text-primary, inherit);
  border: 1px solid var(--border-default); border-radius: 18px; padding: 18px; box-shadow: 0 24px 60px rgba(0,0,0,.35);
}
.dept-picker-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.dept-picker-head h3 { margin: 0; font-size: 18px; display: flex; gap: 10px; align-items: center; }
.dept-picker-x { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border-default); background: var(--bg-surface-2); color: inherit; cursor: pointer; }
.dept-picker-search { margin: 0; }
.dept-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px;
  overflow-y: auto; padding: 2px 2px 6px; overscroll-behavior: contain;
}
.dept-tile {
  --dh: 230; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; text-align: left;
  padding: 14px; border-radius: 14px; border: 1px solid hsl(var(--dh) 60% 50% / .25);
  background: hsl(var(--dh) 80% 55% / .06); color: inherit; font: inherit; cursor: pointer;
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.dept-tile:hover, .dept-tile:focus-visible { transform: translateY(-2px); border-color: hsl(var(--dh) 70% 50%); box-shadow: 0 8px 22px hsl(var(--dh) 80% 50% / .22); outline: none; }
.dept-tile.on { border: 2px solid hsl(var(--dh) 75% 50%); box-shadow: 0 6px 20px hsl(var(--dh) 80% 50% / .3); }
.dept-tile[hidden] { display: none; }
.dept-tile-name { font-weight: 700; font-size: 14px; line-height: 1.3; }
.dept-tile-n { font-size: 12px; color: var(--text-tertiary, var(--text-secondary)); }
.dept-picker-empty { margin: 8px 0; text-align: center; color: var(--text-tertiary, var(--text-secondary)); }

@media (max-width: 640px) {
  .dept-arrow { display: none; }
  .dept-browse span { display: none; }
  .dept-browse { width: 38px; padding: 0; }
  .dept-chip { font-size: 13px; }
  .dept-picker-overlay { align-items: flex-end; padding: 0; }
  .dept-picker { max-height: 88vh; border-radius: 18px 18px 0 0; padding: 16px; }
  .dept-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .dept-tile { padding: 12px; }
}

/* ⭐ course code already used (Admin → New course / Edit), 2026-10-16 */
input.input-error { border-color: var(--rose-500, #ef4444) !important; box-shadow: 0 0 0 3px rgba(239,68,68,.15) !important; }
.hint.code-clash { display: block; margin-top: 6px; color: var(--rose-500, #ef4444); font-weight: 600; }
.hint.code-clash[hidden] { display: none; }

/* ⭐ 2026-10-17 — Admin → Organization: the founder photo preview is a 120 px circle
   (it had no sized frame, so the 100% width/height rule above let it fill the whole tab) */
.thumbnail-editor > .owner-preview-img,
.thumbnail-editor > .owner-preview-fallback {
  width: 120px !important; height: 120px !important; flex: 0 0 120px !important;
  align-self: flex-start !important; border-radius: 50% !important; object-fit: cover !important;
  border: 3px solid var(--brand-500, #6366f1) !important; box-sizing: border-box !important;
}
.thumbnail-editor > .owner-preview-fallback {
  display: flex !important; align-items: center !important; justify-content: center !important;
  font-size: 36px; font-weight: 800; color: var(--brand-500, #6366f1); background: var(--bg-surface-3, #eef);
}

/* ⭐ 2026-10-17 — notes only professors see (e.g. "premium is set by the admin") */
body:not(.aero-prof) .prof-only { display: none !important; }

.pw-course-actions .pw-del { margin-left: auto; color: #dc2626; border-color: rgba(220,38,38,.35); }
.pw-course-actions .pw-del:hover { background: rgba(220,38,38,.08); }

/* ⭐ 2026-10-19 — badge colours for the added material types */
.mat-type.tutorial-sol    { background: linear-gradient(135deg, #047857, #34d399); }
.mat-type.assignment      { background: linear-gradient(135deg, #7c3aed, #a78bfa); }
.mat-type.assignment-sol  { background: linear-gradient(135deg, #6d28d9, #c4b5fd); }
.mat-type.practice        { background: linear-gradient(135deg, #0f766e, #2dd4bf); }
.mat-type.hints           { background: linear-gradient(135deg, #ca8a04, #facc15); color: #1f2937; }
.mat-type.question-bank   { background: linear-gradient(135deg, #9d174d, #f472b6); }
.mat-type.handout         { background: linear-gradient(135deg, #15803d, #4ade80); }
.mat-type.research-paper  { background: linear-gradient(135deg, #1e40af, #60a5fa); }
.mat-type.formula-sheet   { background: linear-gradient(135deg, #b45309, #fbbf24); }
.mat-type.syllabus        { background: linear-gradient(135deg, #334155, #64748b); }
.mat-type.project         { background: linear-gradient(135deg, #c2410c, #fb923c); }
.mat-type.seminar         { background: linear-gradient(135deg, #0e7490, #22d3ee); }

/* ⭐ 2026-10-20 — material folders (course page tree + editor) and downloads */
.mat-folder-tools { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; margin-bottom: 10px; }
.mat-folder-tree { display: flex; flex-direction: column; gap: 10px; }
.mat-folder-tree > .material-list, .mat-folder-body > .material-list { margin: 2px 0; }
.mat-folder {
  background: var(--bg-surface); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md); overflow: hidden;
}
.mat-folder > summary {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px;
  cursor: pointer; list-style: none; user-select: none; min-height: 48px;
  font-weight: 650; color: var(--text-primary);
}
.mat-folder > summary::-webkit-details-marker { display: none; }
.mat-folder > summary:hover { background: var(--bg-surface-2); }
.mat-folder > summary:focus-visible { outline: 2px solid var(--brand-500); outline-offset: -2px; }
.mat-folder-ico { color: #e3a008; font-size: 18px; width: 20px; text-align: center; }
.mat-folder-ico.open, .mat-folder[open] > summary .mat-folder-ico:not(.open) { display: none; }
.mat-folder[open] > summary .mat-folder-ico.open { display: inline-block; }
.mat-folder-name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.mat-folder-count { font-size: 12px; font-weight: 600; color: var(--text-secondary); white-space: nowrap; }
.mat-folder-count .fa-check-circle { color: var(--emerald-600, #059669); }
.mat-folder-chev { color: var(--text-secondary); font-size: 12px; transition: transform .2s var(--ease); }
.mat-folder[open] > summary .mat-folder-chev { transform: rotate(180deg); }
.mat-folder[open] > summary { border-bottom: 1px solid var(--border-subtle); }
.mat-folder-body { padding: 12px; display: flex; flex-direction: column; gap: 10px; background: var(--bg-surface-2); }
.mat-folder-body .mat-folder { background: var(--bg-surface); }
@media (max-width: 600px) {
  .mat-folder > summary { padding: 10px 12px; gap: 8px; }
  .mat-folder-body { padding: 8px; }
  .mat-folder-tools { justify-content: stretch; }
  .mat-folder-tools .btn { flex: 1; }
}

.mat-dl-staff { font-size: 10px; opacity: .65; }
.mat-badge.dl { background: rgba(79,70,229,.12); color: var(--brand-600); }
.me-folder-chip {
  display: inline-flex; align-items: center; gap: 5px; max-width: 220px;
  font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: var(--radius-pill);
  background: rgba(227,160,8,.14); color: #a16207; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.toggle-box.dl { border-color: rgba(79,70,229,.3); color: var(--brand-600); }
.mat-folder-pick .hint { display: block; margin-top: 6px; line-height: 1.5; }
.mat-folder-pick .hint.picked { color: var(--text-primary); }
.mat-folder-pick .hint.picked .fa-folder { color: #e3a008; }
.mat-folder-pick .hint .warn { color: #dc2626; font-weight: 600; }

/* ⭐ 2026-10-20 — folders in the course editor's material list */
#mordList .me-folder { margin: 6px 0; }
#mordList .me-folder > .mat-folder-body > .mord-list > .material-editor { background: var(--bg-surface); }
#mordList .me-folder-del { margin-left: auto; color: #dc2626; border-color: rgba(220,38,38,.35); padding: 4px 10px; }
#mordList .me-folder-del:hover { background: rgba(220,38,38,.08); }
#mordList .me-folder > summary .mat-folder-count { margin-left: auto; }
#mordList .me-folder > summary .me-folder-del { margin-left: 4px; }
@media (max-width: 600px) { #mordList .me-folder-del span { display: none; } }

/* ⭐ 2026-10-23 — Notes-only sign-in: the four sign-in tabs fit a phone; the notes take the whole window */
#loginView .login-role-toggle button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; flex: 1 1 0; }
@media (max-width: 420px) {
  #loginView .login-role-toggle button { flex-direction: column; gap: 3px; font-size: 11.5px; padding: 8px 2px; }
  #loginView .login-role-toggle button i { font-size: 14px; }
}

/* ⭐ 2026-10-24 — roll number beside a student's name (staff screens) */
.roll-tag { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 6px; vertical-align: 1px;
  font: 700 11px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .02em; white-space: nowrap;
  background: color-mix(in srgb, var(--brand-500) 13%, transparent); color: var(--brand-700, var(--brand-600)); border: 1px solid color-mix(in srgb, var(--brand-500) 25%, transparent); }
html[data-theme="dark"] .roll-tag, html[data-theme="space"] .roll-tag, html[data-theme="dim"] .roll-tag, html[data-theme="aurora"] .roll-tag { color: var(--brand-300, #a5b4fc); }

/* ⭐ 2026-10-24 — professor viewing a course that is not theirs */
.vo-banner { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 16px; margin-bottom: 14px; border-radius: 14px; font-size: 13.5px; line-height: 1.5;
  background: color-mix(in srgb, var(--gold-400) 14%, var(--bg-surface)); border: 1px solid color-mix(in srgb, var(--gold-500) 40%, transparent); color: var(--text-primary); }
.vo-banner > i { color: var(--gold-600); font-size: 18px; }
.vo-banner > div { flex: 1 1 260px; }

/* ===========================================================
   ⭐ 2026-10-24 — professor workspace: sidebar + Today page
   =========================================================== */
.pw-shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 22px; align-items: start; }
.pw-main { min-width: 0; }
.pw-tabs.pw-side { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 2px; width: auto; max-width: none; margin: 0; padding: 10px;
  border-radius: 18px; background: var(--bg-surface); border: 1px solid var(--border-subtle); overflow: visible; max-height: calc(100vh - 100px); overflow-y: auto; }
.pw-tabs.pw-side button { justify-content: flex-start; width: 100%; text-align: left; padding: 9px 12px; border-radius: 11px; gap: 10px; font-size: 13.5px; }
.pw-tabs.pw-side button i { width: 18px; text-align: center; }
.pw-tabs.pw-side button > span:not(.nav-count) { flex: 1; }
.pw-tabs.pw-side button.active { background: color-mix(in srgb, var(--brand-500) 14%, transparent); color: var(--brand-700, var(--brand-600)); box-shadow: inset 3px 0 0 var(--brand-500); }
.pw-side-h { font-size: 10.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--text-tertiary); padding: 12px 12px 4px; }
.pw-search-btn { display: flex; align-items: center; gap: 8px; width: 100%; padding: 9px 12px; margin-bottom: 4px; border-radius: 11px; border: 1px solid var(--border-default);
  background: var(--bg-page, var(--bg-surface-2)); color: var(--text-tertiary); font: 500 13px var(--font-sans, inherit); cursor: pointer; }
.pw-search-btn span { flex: 1; text-align: left; }
.pw-search-btn kbd { font: 600 10.5px ui-monospace, monospace; border: 1px solid var(--border-default); border-radius: 5px; padding: 1px 5px; }
.pw-hero.compact { padding: 14px 20px; margin-bottom: 16px; }
.pw-hero.compact .pw-hero-chips, .pw-hero.compact .pw-hero-text p { display: none; }
.pw-hero.compact .pw-avatar { width: 40px; height: 40px; font-size: 15px; }
.pw-hero.compact h2 { font-size: 18px; margin: 0; }
.pw-hero.compact .pw-hero-actions .btn { padding: 7px 12px; font-size: 13px; }
/* Today */
.pw-today { display: grid; gap: 16px; margin-bottom: 22px; }
.pw-kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.pw-kpi { display: flex; gap: 12px; align-items: center; padding: 14px 16px; border-radius: 16px; background: var(--bg-surface); border: 1px solid var(--border-subtle); cursor: pointer; text-align: left; font: inherit; color: inherit; }
.pw-kpi:hover { border-color: color-mix(in srgb, var(--brand-500) 45%, var(--border-subtle)); transform: translateY(-1px); }
.pw-kpi .ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 17px; flex: none; }
.pw-kpi strong { display: block; font-size: 22px; line-height: 1.1; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.pw-kpi span { font-size: 12px; color: var(--text-tertiary); }
.pw-kpi.warn strong { color: var(--rose-600); }
.ic.k1 { background: color-mix(in srgb, var(--brand-500) 16%, transparent); color: var(--brand-600); }
.ic.k2 { background: color-mix(in srgb, var(--rose-500) 15%, transparent); color: var(--rose-600); }
.ic.k3 { background: color-mix(in srgb, var(--emerald-500) 16%, transparent); color: var(--emerald-600); }
.ic.k4 { background: color-mix(in srgb, var(--gold-400) 22%, transparent); color: var(--gold-600); }
.pw-today-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; }
.pw-panel { background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: 18px; padding: 16px 18px; min-width: 0; }
.pw-panel h3 { margin: 0 0 10px; font-size: 15px; display: flex; align-items: center; gap: 8px; color: var(--text-primary); }
.pw-panel h3 .more { margin-left: auto; font-size: 12px; font-weight: 600; }
.pw-agenda { display: grid; gap: 2px; }
.pw-ag { display: grid; grid-template-columns: 64px 10px minmax(0, 1fr); gap: 10px; align-items: start; padding: 8px 4px; border-bottom: 1px solid var(--border-subtle); font-size: 13px; }
.pw-ag:last-child { border-bottom: 0; }
.pw-ag time { color: var(--text-tertiary); font-size: 11.5px; line-height: 1.3; font-variant-numeric: tabular-nums; }
.pw-ag time b { display: block; color: var(--text-secondary); font-size: 12px; }
.pw-ag .dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 4px; background: var(--brand-500); }
.pw-ag .dot.due { background: var(--rose-500); } .pw-ag .dot.attendance { background: var(--emerald-500); } .pw-ag .dot.officehours { background: var(--gold-500); }
.pw-ag small { display: block; color: var(--text-tertiary); }
.pw-qa { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.pw-qa button { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 12px; border: 1px solid var(--border-subtle); background: var(--bg-page, var(--bg-surface-2));
  color: var(--text-primary); font: 600 13px var(--font-sans, inherit); cursor: pointer; text-align: left; }
.pw-qa button:hover { border-color: var(--brand-500); }
.pw-qa button i { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; background: color-mix(in srgb, var(--brand-500) 14%, transparent); color: var(--brand-600); flex: none; }
.pw-cc { display: grid; gap: 10px; }
.pw-cc-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 14px; align-items: center; padding: 10px 2px; border-bottom: 1px solid var(--border-subtle); }
.pw-cc-row:last-child { border-bottom: 0; }
.pw-cc-row strong { color: var(--text-primary); font-size: 14px; }
.pw-cc-row small { color: var(--text-tertiary); font-size: 12px; }
.pw-cc-meta { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--text-secondary); margin-top: 3px; }
.pw-cc-meta .bad { color: var(--rose-600); font-weight: 700; }
.pw-cc-bar { grid-column: 1 / -1; height: 6px; border-radius: 4px; background: var(--bg-surface-3); overflow: hidden; }
.pw-cc-bar i { display: block; height: 100%; background: var(--emerald-500); }
/* command palette */
.pt-pal { position: fixed; inset: 0; z-index: 10080; background: rgba(15, 23, 42, .5); display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; }
.pt-pal-box { width: min(620px, 100%); background: var(--bg-surface); border-radius: 18px; box-shadow: var(--shadow-xl); overflow: hidden; border: 1px solid var(--border-subtle); }
.pt-pal-box input { width: 100%; border: 0; border-bottom: 1px solid var(--border-subtle); padding: 16px 18px; font: 500 16px var(--font-sans, inherit); background: transparent; color: var(--text-primary); outline: none; }
.pt-pal-list { max-height: 52vh; overflow: auto; padding: 6px; }
.pt-pal-g { font-size: 10.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--text-tertiary); padding: 10px 12px 4px; }
.pt-pal-it { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 10px; cursor: pointer; font-size: 14px; color: var(--text-primary); }
.pt-pal-it i { width: 18px; text-align: center; color: var(--text-tertiary); }
.pt-pal-it small { margin-left: auto; color: var(--text-tertiary); font-size: 12px; }
.pt-pal-it.on { background: color-mix(in srgb, var(--brand-500) 14%, transparent); }
.pt-pal-foot { display: flex; gap: 14px; padding: 8px 14px; border-top: 1px solid var(--border-subtle); font-size: 11.5px; color: var(--text-tertiary); }
@media (max-width: 1100px) { .pw-today-grid { grid-template-columns: 1fr; } }
@media (max-width: 900px) {
  .pw-shell { grid-template-columns: 1fr; gap: 12px; }
  .pw-tabs.pw-side { position: static; flex-direction: row; overflow-x: auto; overflow-y: hidden; max-height: none; padding: 4px; border-radius: 14px; background: var(--bg-surface-3); border: 0; }
  .pw-tabs.pw-side button { width: auto; flex: none; white-space: nowrap; }
  .pw-tabs.pw-side button.active { box-shadow: none; }
  .pw-side-h, .pw-search-btn kbd { display: none; }
  .pw-search-btn { width: auto; flex: none; margin: 0; }
  .pw-qa { grid-template-columns: 1fr 1fr; }
}

/* ===========================================================
   ⭐ 2026-10-24 — professor ↔ admin chat (chat.js)
   =========================================================== */
.ch-root { display: grid; grid-template-columns: 1fr; height: min(78vh, 820px); min-height: 460px; background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: 18px; overflow: hidden; }
.ch-root.adm { grid-template-columns: 320px minmax(0, 1fr); }
.ch-list { display: flex; flex-direction: column; border-right: 1px solid var(--border-subtle); min-height: 0; }
.ch-list-top { padding: 12px; border-bottom: 1px solid var(--border-subtle); display: grid; gap: 8px; }
.ch-search { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 11px; background: var(--bg-surface-2, var(--bg-page)); border: 1px solid var(--border-subtle); color: var(--text-tertiary); }
.ch-search input { border: 0; background: transparent; outline: none; flex: 1; font: 500 13.5px var(--font-sans, inherit); color: var(--text-primary); min-width: 0; }
.ch-filters { display: flex; gap: 6px; }
.ch-filters button { border: 1px solid var(--border-subtle); background: transparent; color: var(--text-secondary); border-radius: 999px; padding: 4px 12px; font: 600 12px var(--font-sans, inherit); cursor: pointer; }
.ch-filters button.on { background: color-mix(in srgb, var(--brand-500) 14%, transparent); color: var(--brand-600); border-color: transparent; }
.ch-threads { overflow-y: auto; flex: 1; padding: 6px; }
.ch-thread { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; gap: 10px; align-items: center; width: 100%; padding: 9px 10px; border: 0; border-radius: 12px; background: transparent; cursor: pointer; text-align: left; color: var(--text-primary); font: inherit; }
.ch-thread:hover { background: var(--bg-surface-2, rgba(127,127,127,.08)); }
.ch-thread.on { background: color-mix(in srgb, var(--brand-500) 13%, transparent); }
.ch-thread strong { display: block; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-thread small { display: block; font-size: 12px; color: var(--text-tertiary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-thread small em { color: var(--emerald-600); font-style: normal; }
.ch-thread.unread strong, .ch-thread.unread small { color: var(--text-primary); font-weight: 700; }
.ch-meta { display: grid; justify-items: end; gap: 4px; font-size: 11px; color: var(--text-tertiary); }
.ch-meta b { background: var(--brand-500); color: #fff; border-radius: 999px; min-width: 20px; padding: 1px 6px; text-align: center; font-size: 11px; }
.ch-sep { font-size: 10.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--text-tertiary); padding: 14px 10px 4px; }
.ch-av { position: relative; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font: 700 14px var(--font-sans, inherit); color: #fff; background: linear-gradient(135deg, var(--brand-500), var(--brand-700, #4338ca)); flex: none; }
.ch-av.big { width: 42px; height: 42px; }
.ch-dot { position: absolute; right: 0; bottom: 1px; width: 11px; height: 11px; border-radius: 50%; background: var(--emerald-500); border: 2px solid var(--bg-surface); }
.ch-dot.inline { position: static; display: inline-block; width: 8px; height: 8px; border: 0; margin-right: 3px; vertical-align: middle; }
.ch-empty { padding: 26px; text-align: center; color: var(--text-tertiary); font-size: 13px; }
.ch-conv { display: flex; flex-direction: column; min-width: 0; min-height: 0; position: relative; }
.ch-conv.drop::after { content: 'Drop to attach'; position: absolute; inset: 8px; border: 2px dashed var(--brand-500); border-radius: 14px; display: grid; place-items: center; font-weight: 700; color: var(--brand-600); background: color-mix(in srgb, var(--bg-surface) 85%, transparent); z-index: 3; }
.ch-pick { margin: auto; text-align: center; color: var(--text-tertiary); padding: 30px; }
.ch-pick i { font-size: 34px; color: var(--brand-500); margin-bottom: 10px; }
.ch-pick h3 { color: var(--text-primary); margin: 0 0 6px; }
.ch-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border-subtle); }
.ch-who strong { display: block; font-size: 15px; color: var(--text-primary); }
.ch-who small { font-size: 12px; color: var(--text-tertiary); }
.ch-back { display: none; border: 0; background: transparent; color: var(--text-secondary); font-size: 17px; cursor: pointer; padding: 6px; }
.ch-msgs { flex: 1; overflow-y: auto; padding: 14px 18px; display: flex; flex-direction: column; gap: 3px;
  background: radial-gradient(circle at 1px 1px, color-mix(in srgb, var(--text-tertiary) 14%, transparent) 1px, transparent 0) 0 0 / 22px 22px; }
.ch-start { margin: auto; max-width: 360px; text-align: center; color: var(--text-tertiary); font-size: 13.5px; padding: 18px; background: var(--bg-surface); border-radius: 14px; border: 1px solid var(--border-subtle); }
.ch-start i { display: block; font-size: 24px; color: var(--gold-500, #f59e0b); margin-bottom: 8px; }
.ch-older { align-self: center; border: 1px solid var(--border-subtle); background: var(--bg-surface); color: var(--text-secondary); border-radius: 999px; padding: 5px 14px; font: 600 12px var(--font-sans, inherit); cursor: pointer; margin-bottom: 8px; }
.ch-day { align-self: center; margin: 10px 0 6px; }
.ch-day span { background: var(--bg-surface); border: 1px solid var(--border-subtle); color: var(--text-secondary); font-size: 11.5px; font-weight: 600; padding: 3px 10px; border-radius: 999px; }
.ch-msg { display: flex; flex-direction: column; max-width: min(78%, 560px); }
.ch-msg.mine { align-self: flex-end; align-items: flex-end; }
.ch-msg.theirs { align-self: flex-start; }
.ch-from { font-size: 11.5px; font-weight: 700; color: var(--brand-600); margin: 6px 4px 2px; }
.ch-bubble { position: relative; padding: 8px 12px 6px; border-radius: 16px; font-size: 14px; line-height: 1.45; color: var(--text-primary); background: var(--bg-surface); border: 1px solid var(--border-subtle); box-shadow: 0 1px 1px rgba(0,0,0,.04); word-wrap: break-word; overflow-wrap: anywhere; }
.ch-msg.theirs .ch-bubble { border-top-left-radius: 6px; }
.ch-msg.mine .ch-bubble { background: color-mix(in srgb, var(--brand-500) 16%, var(--bg-surface)); border-color: transparent; border-top-right-radius: 6px; }
.ch-msg.deleted .ch-bubble { font-style: italic; color: var(--text-tertiary); }
.ch-text a { color: var(--brand-600); text-decoration: underline; }
.ch-time { display: block; text-align: right; font-size: 10.5px; color: var(--text-tertiary); margin-top: 2px; white-space: nowrap; }
.ch-time .read { color: var(--sky-500, #0ea5e9); }
.ch-tag { display: inline-flex; gap: 5px; align-items: center; font-size: 11px; font-weight: 700; color: var(--brand-600); background: color-mix(in srgb, var(--brand-500) 12%, transparent); padding: 2px 8px; border-radius: 999px; margin-bottom: 5px; }
.ch-img { display: block; margin: 2px 0 4px; }
.ch-img img { display: block; max-width: min(320px, 100%); max-height: 260px; border-radius: 10px; object-fit: cover; }
.ch-file { display: flex; align-items: center; gap: 10px; padding: 8px 10px; margin: 2px 0 4px; border-radius: 10px; background: var(--bg-surface-2, rgba(127,127,127,.08)); color: var(--text-primary); text-decoration: none; }
.ch-file i { font-size: 22px; color: var(--rose-500); }
.ch-file span { display: grid; font-size: 13px; font-weight: 600; min-width: 0; }
.ch-file small { font-weight: 500; color: var(--text-tertiary); font-size: 11px; }
.ch-del { position: absolute; top: 4px; left: -30px; border: 0; background: var(--bg-surface); color: var(--text-tertiary); width: 24px; height: 24px; border-radius: 50%; cursor: pointer; opacity: 0; transition: opacity .15s; box-shadow: var(--shadow-sm); }
.ch-msg:hover .ch-del, .ch-del:focus { opacity: 1; }
.ch-del:hover { color: var(--rose-600); }
.ch-typing { padding: 4px 20px 6px; font-size: 12px; color: var(--text-tertiary); }
.ch-dots { display: inline-flex; gap: 3px; margin-right: 4px; vertical-align: middle; }
.ch-dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--text-tertiary); animation: chDot 1.2s infinite; }
.ch-dots i:nth-child(2) { animation-delay: .2s; } .ch-dots i:nth-child(3) { animation-delay: .4s; }
@keyframes chDot { 0%, 60%, 100% { opacity: .3; transform: none; } 30% { opacity: 1; transform: translateY(-2px); } }
.ch-compose { border-top: 1px solid var(--border-subtle); padding: 10px 12px 8px; background: var(--bg-surface); }
.ch-row { display: flex; align-items: flex-end; gap: 8px; }
.ch-row textarea { flex: 1; resize: none; border: 1px solid var(--border-default); border-radius: 14px; padding: 9px 13px; font: 400 14px/1.4 var(--font-sans, inherit); background: var(--bg-surface-2, var(--bg-page)); color: var(--text-primary); outline: none; max-height: 160px; min-width: 0; }
.ch-row textarea:focus { border-color: var(--brand-500); }
.ch-attach, .ch-send { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: none; cursor: pointer; border: 0; font-size: 16px; }
.ch-attach { color: var(--text-secondary); background: transparent; }
.ch-attach:hover { background: var(--bg-surface-2, rgba(127,127,127,.1)); }
.ch-send { background: var(--brand-500); color: #fff; }
.ch-send:disabled { opacity: .6; }
.ch-course { max-width: 120px; height: 40px; border-radius: 12px; border: 1px solid var(--border-default); background: var(--bg-surface); color: var(--text-secondary); font: 600 12px var(--font-sans, inherit); padding: 0 8px; }
.ch-hint { font-size: 11px; color: var(--text-tertiary); padding: 4px 6px 0; }
.ch-pending { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 6px 10px; margin-bottom: 8px; border-radius: 10px; background: var(--bg-surface-2, rgba(127,127,127,.08)); color: var(--text-primary); }
.ch-pending small { color: var(--text-tertiary); }
.ch-pending button { margin-left: auto; border: 0; background: transparent; color: var(--text-tertiary); cursor: pointer; }
@media (max-width: 760px) {
  .ch-root { height: calc(100vh - 84px); height: calc(100dvh - 84px); min-height: 380px; border-radius: 14px; scroll-margin-top: 76px; }
  .ch-root.adm { grid-template-columns: 1fr; }
  .ch-root.adm .ch-conv { display: none; }
  .ch-root.adm.has-open .ch-list { display: none; }
  .ch-root.adm.has-open .ch-conv { display: flex; }
  .ch-back { display: block; }
  .ch-msg { max-width: 88%; }
  .ch-hint { display: none; }
  .ch-del { opacity: 1; position: static; display: inline-grid; margin-top: 4px; width: 22px; height: 22px; }
  .ch-course { max-width: 84px; }
}
.ch-pending[hidden], .ch-typing[hidden], [data-chat-badge][hidden] { display: none !important; }

/* ===========================================================
   ⭐ 2026-10-24 — Head of Department (hod.js)
   =========================================================== */
.hd-root { display: grid; gap: 14px; }
.hd-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.hd-head h2 { margin: 4px 0 0; font-size: 22px; color: var(--text-primary); }
.hd-badge { display: inline-flex; gap: 6px; align-items: center; font-size: 11.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--brand-600); background: color-mix(in srgb, var(--brand-500) 13%, transparent); padding: 3px 10px; border-radius: 999px; }
.hd-tabs { display: flex; gap: 6px; overflow-x: auto; padding: 4px; border-radius: 14px; background: var(--bg-surface-3, rgba(127,127,127,.08)); }
.hd-tabs button { flex: none; display: inline-flex; align-items: center; gap: 7px; border: 0; background: transparent; color: var(--text-secondary); padding: 8px 14px; border-radius: 10px; font: 600 13px var(--font-sans, inherit); cursor: pointer; white-space: nowrap; }
.hd-tabs button.on { background: var(--bg-surface); color: var(--text-primary); box-shadow: var(--shadow-sm); }
.hd-tabs b { background: var(--rose-500); color: #fff; border-radius: 999px; padding: 0 7px; font-size: 11px; }
.hd-h { margin: 6px 0 2px; font-size: 15px; color: var(--text-primary); display: flex; gap: 8px; align-items: center; }
.hd-h span, .hd-count { font-size: 12px; background: var(--bg-surface-3, rgba(127,127,127,.12)); color: var(--text-secondary); border-radius: 999px; padding: 1px 9px; font-weight: 700; }
.hd-count.warn { background: color-mix(in srgb, var(--rose-500) 15%, transparent); color: var(--rose-600); }
.hd-app { display: grid; gap: 10px; }
.hd-app-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.hd-app-top strong { color: var(--text-primary); }
.hd-line { padding: 10px 0; border-bottom: 1px solid var(--border-subtle); }
.hd-line:last-child { border-bottom: 0; }
.hd-dl { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px 16px; margin: 0; }
.hd-dl dt { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-tertiary); font-weight: 700; }
.hd-dl dd { margin: 0; font-size: 13.5px; color: var(--text-primary); overflow-wrap: anywhere; }
.hd-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.hd-row .pi-select { min-width: 220px; max-width: 100%; }
.hd-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; padding: 2px 4px 2px 9px; margin: 2px; border-radius: 999px; background: color-mix(in srgb, var(--brand-500) 12%, transparent); color: var(--brand-600); }
.hd-chip button { border: 0; background: transparent; color: inherit; cursor: pointer; font-size: 14px; line-height: 1; padding: 0 4px; border-radius: 50%; }
.hd-chip button:hover { background: color-mix(in srgb, var(--rose-500) 20%, transparent); color: var(--rose-600); }
.hd-tag { font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; padding: 1px 7px; border-radius: 999px; background: color-mix(in srgb, var(--gold-400, #fbbf24) 25%, transparent); color: var(--gold-700, #b45309); vertical-align: middle; }
.hd-tag.g { background: var(--bg-surface-3, rgba(127,127,127,.12)); color: var(--text-secondary); }
.hd-warn { color: var(--rose-600); font-weight: 600; font-size: 12.5px; }
.hd-give { min-width: 0; max-width: 190px; }
.hd-li { display: flex; gap: 10px; align-items: center; padding: 8px 2px; border-bottom: 1px solid var(--border-subtle); font-size: 13px; color: var(--text-secondary); }
.hd-li:last-child { border-bottom: 0; }
.hd-li > i { color: var(--brand-500); width: 18px; text-align: center; }
.hd-li > span { flex: 1; min-width: 0; }
.hd-li small { display: block; color: var(--text-tertiary); font-size: 11.5px; }
.hd-state { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 12px; margin-bottom: 12px; background: var(--bg-surface-3, rgba(127,127,127,.08)); }
.hd-state > i { font-size: 20px; }
.hd-state > div { flex: 1; display: grid; }
.hd-state span { font-size: 12.5px; color: var(--text-tertiary); }
.hd-state.wait > i { color: var(--gold-500, #f59e0b); }
.hd-state.no > i { color: var(--rose-500); }
#prRegDepartmentPick { width: 100%; }

/* ⭐ 2026-10-24 — professor course cards: nothing ever spills out of a card
   (wider fonts / Windows 125 % / long names). The buttons wrap onto the next
   line and shrink with "…" instead of pushing past the edge. */
.pw-course { min-width: 0; }
.pw-course-top h3, .pw-course-code, .pw-course-sem { overflow-wrap: anywhere; max-width: 100%; }
.pw-course-stats > div { min-width: 0; overflow: hidden; }
.pw-course-stats span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pw-course-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.pw-course-actions .btn { flex: 1 1 128px; min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pw-course-actions .btn:first-child { flex-basis: 160px; }
.pw-course-actions .pw-del { flex: 0 0 40px; margin-left: 0; padding-left: 0; padding-right: 0; }
/* Home → Course health: on a narrow panel the buttons go under the course, never on top of it */
.pw-panel { container-type: inline-size; }
.pw-cc-row .rv-actions { flex-wrap: wrap; }
.pw-cc-row strong { overflow-wrap: anywhere; }
@container (max-width: 560px) {
  .pw-cc-row { grid-template-columns: minmax(0, 1fr); }
  .pw-cc-row .rv-actions { justify-content: flex-start; }
}
@media (max-width: 640px) {
  .pw-cc-row { grid-template-columns: minmax(0, 1fr); }
  .pw-cc-row .rv-actions { justify-content: flex-start; }
}

/* ===========================================================
   ⭐ 2026-10-24 — professor profiles & faculty directory (faculty.js)
   =========================================================== */
.fc-av { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; flex: none; background: var(--bg-surface-3, #e5e7eb); }
.fc-av-i { display: grid; place-items: center; color: #fff; font: 700 18px var(--font-sans, inherit); background: linear-gradient(135deg, var(--brand-500), var(--brand-700, #4338ca)); }
.fc-av.big { width: 96px; height: 96px; font-size: 30px; }
.fc-av.xl { width: 116px; height: 116px; font-size: 36px; border: 4px solid var(--bg-surface); box-shadow: var(--shadow-md); }
/* editor */
.fc-edit { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.fc-form { display: grid; gap: 14px; }
.fc-edit-head { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; flex-wrap: wrap; }
.fc-edit-head h3 { margin: 0 0 4px; font-size: 17px; color: var(--text-primary); }
.fc-switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; padding: 6px 12px 6px 6px; border-radius: 999px; border: 1px solid var(--border-default); background: var(--bg-surface); font-size: 13px; user-select: none; }
.fc-switch input { position: absolute; opacity: 0; pointer-events: none; }
.fc-knob { width: 40px; height: 22px; border-radius: 999px; background: var(--bg-surface-3, #cbd5e1); position: relative; transition: background .2s; }
.fc-knob::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.fc-switch.on { border-color: var(--emerald-500); }
.fc-switch.on .fc-knob { background: var(--emerald-500); }
.fc-switch.on .fc-knob::after { transform: translateX(18px); }
.fc-switch.on b { color: var(--emerald-600); }
.fc-alert { padding: 10px 12px; border-radius: 10px; font-size: 13px; background: color-mix(in srgb, var(--rose-500) 12%, transparent); color: var(--rose-600); }
.fc-alert.info { background: color-mix(in srgb, var(--brand-500) 10%, transparent); color: var(--brand-600); }
.fc-photo-row { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.fc-photo-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.fc-photo-actions small { flex-basis: 100%; color: var(--text-tertiary); font-size: 12px; }
.fc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.fc-f { display: grid; gap: 5px; font-size: 12.5px; font-weight: 600; color: var(--text-secondary); min-width: 0; }
.fc-f small { font-weight: 500; color: var(--text-tertiary); }
.fc-f input, .fc-f select, .fc-f textarea { width: 100%; padding: 9px 11px; border-radius: 10px; border: 1px solid var(--border-default); background: var(--bg-surface-2, var(--bg-page)); color: var(--text-primary); font: 400 14px/1.4 var(--font-sans, inherit); min-width: 0; }
.fc-f input:focus, .fc-f select:focus, .fc-f textarea:focus { outline: none; border-color: var(--brand-500); }
.fc-tags { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px 8px; border-radius: 10px; border: 1px solid var(--border-default); background: var(--bg-surface-2, var(--bg-page)); cursor: text; }
.fc-tags input { flex: 1; min-width: 140px; border: 0 !important; padding: 4px !important; background: transparent !important; }
.fc-tag { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 600; padding: 3px 4px 3px 10px; border-radius: 999px; background: color-mix(in srgb, var(--brand-500) 14%, transparent); color: var(--brand-600); }
.fc-tag button { border: 0; background: transparent; color: inherit; cursor: pointer; font-size: 15px; line-height: 1; padding: 0 4px; }
.fc-check { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--text-secondary); }
.fc-save { display: flex; gap: 10px; align-items: center; justify-content: flex-end; position: sticky; bottom: 0; padding: 10px 0 2px; background: var(--bg-surface); border-top: 1px solid var(--border-subtle); }
.fc-save span { margin-right: auto; font-size: 12.5px; font-weight: 600; }
.fc-dirty { color: var(--gold-600, #d97706); }
.fc-saved { color: var(--emerald-600); }
.fc-side { position: sticky; top: 84px; display: grid; gap: 10px; }
.fc-side-h { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--text-tertiary); }
.fc-reg-photo { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.fc-reg-photo small { color: var(--text-tertiary); font-size: 12px; }
/* directory */
.fc-dir { display: grid; gap: 16px; }
.fc-hero h2 { margin: 0 0 4px; font-size: 24px; color: var(--text-primary); }
.fc-hero p { margin: 0; color: var(--text-secondary); }
.fc-search { display: flex; align-items: center; gap: 10px; padding: 11px 16px; border-radius: 14px; border: 1px solid var(--border-default); background: var(--bg-surface); color: var(--text-tertiary); }
.fc-search input { flex: 1; border: 0; outline: none; background: transparent; font: 500 15px var(--font-sans, inherit); color: var(--text-primary); min-width: 0; }
.fc-depts { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.fc-depts button { flex: none; border: 1px solid var(--border-subtle); background: var(--bg-surface); color: var(--text-secondary); border-radius: 999px; padding: 6px 12px; font: 600 12.5px var(--font-sans, inherit); cursor: pointer; white-space: nowrap; }
.fc-depts button b { margin-left: 4px; color: var(--text-tertiary); }
.fc-depts button.on { background: var(--brand-500); border-color: var(--brand-500); color: #fff; }
.fc-depts button.on b { color: #fff; }
.fc-depts button:disabled { opacity: .45; cursor: default; }
.fc-group h3 { margin: 6px 0 10px; font-size: 16px; color: var(--text-primary); display: flex; gap: 8px; align-items: center; }
.fc-group h3 span { font-size: 12px; background: var(--bg-surface-3, rgba(127,127,127,.12)); color: var(--text-secondary); border-radius: 999px; padding: 1px 9px; }
.fc-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.fc-card { display: flex; gap: 14px; align-items: flex-start; text-align: left; padding: 14px; border-radius: 16px; border: 1px solid var(--border-subtle); background: var(--bg-surface); color: inherit; font: inherit; cursor: pointer; min-width: 0; transition: transform .15s, border-color .15s; }
button.fc-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--brand-500) 45%, var(--border-subtle)); }
.fc-card-tx { display: grid; gap: 3px; min-width: 0; }
.fc-card-tx strong { font-size: 15px; color: var(--text-primary); overflow-wrap: anywhere; }
.fc-card-tx > span { font-size: 12.5px; color: var(--text-secondary); }
.fc-card-tx em { font-style: normal; font-size: 12.5px; color: var(--brand-600); font-weight: 600; }
.fc-card-tx small { font-size: 11.5px; color: var(--text-tertiary); margin-top: 2px; }
.fc-hod { display: inline-block; width: max-content; font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; padding: 1px 8px; border-radius: 999px; background: color-mix(in srgb, var(--gold-400, #fbbf24) 25%, transparent); color: var(--gold-700, #b45309); }
.fc-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.fc-chips span { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--bg-surface-3, rgba(127,127,127,.1)); color: var(--text-secondary); }
.fc-chips.big span { font-size: 12.5px; padding: 4px 11px; background: color-mix(in srgb, var(--brand-500) 12%, transparent); color: var(--brand-600); }
/* profile */
.fc-dlg { width: min(720px, 100%) !important; position: relative; display: grid; gap: 16px; max-height: 88vh; overflow-y: auto; }
.fc-x { position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--bg-surface-3, rgba(127,127,127,.12)); color: var(--text-secondary); cursor: pointer; }
.fc-pf-top { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; padding-right: 30px; }
.fc-pf-top h2 { margin: 0 0 4px; font-size: 22px; color: var(--text-primary); }
.fc-pf-top p { margin: 4px 0 2px; color: var(--text-secondary); }
.fc-pf-top em { font-style: normal; color: var(--brand-600); font-weight: 600; font-size: 14px; }
.fc-pf-act { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.fc-dlg section h4 { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--text-tertiary); }
.fc-bio { margin: 0; line-height: 1.6; color: var(--text-primary); }
.fc-courses { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.fc-course { display: grid; text-align: left; gap: 2px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border-subtle); background: var(--bg-surface-2, var(--bg-page)); color: var(--text-primary); font: 500 13.5px var(--font-sans, inherit); cursor: pointer; }
.fc-course b { color: var(--brand-600); }
.fc-course small { color: var(--text-tertiary); font-size: 11.5px; }
.fc-course:hover { border-color: var(--brand-500); }
.fc-facts { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px 16px; }
.fc-facts li { display: flex; gap: 10px; font-size: 14px; color: var(--text-primary); }
.fc-facts i { width: 18px; text-align: center; color: var(--text-tertiary); margin-top: 3px; }
.fc-pubs { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: 13.5px; color: var(--text-primary); }
@media (max-width: 1000px) { .fc-edit { grid-template-columns: 1fr; } .fc-side { position: static; order: -1; } }
@media (max-width: 560px) { .fc-cards { grid-template-columns: 1fr; } .fc-pf-top { flex-direction: column; align-items: flex-start; } }
/* the full profile page */
.fp { max-width: 1120px; margin: 0 auto; display: grid; gap: 18px; }
.fp-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.fp-back { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--border-subtle); background: var(--bg-surface); color: var(--text-secondary); border-radius: 999px; padding: 8px 16px; font: 600 13.5px var(--font-sans, inherit); cursor: pointer; }
.fp-back:hover { color: var(--text-primary); border-color: var(--brand-500); }
.fp-note { font-size: 13px; font-weight: 600; color: var(--brand-600); background: color-mix(in srgb, var(--brand-500) 12%, transparent); padding: 6px 12px; border-radius: 999px; }
.fp-hero { position: relative; border-radius: 24px; overflow: hidden; background: var(--bg-surface); border: 1px solid var(--border-subtle); box-shadow: var(--shadow-sm); }
.fp-cover { height: 150px; background:
  radial-gradient(circle at 20% 30%, rgba(255,255,255,.18) 0 2px, transparent 3px) 0 0 / 26px 26px,
  linear-gradient(120deg, var(--brand-600, #4f46e5), var(--accent-500, #8b5cf6) 55%, #0ea5e9); }
.fp-id { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 22px; align-items: end; padding: 0 28px 24px; margin-top: -64px; }
.fc-av.fp-photo { width: 148px; height: 148px; font-size: 46px; border: 5px solid var(--bg-surface); box-shadow: 0 10px 30px rgba(15,23,42,.25); background-color: var(--bg-surface); }
.fp-name { min-width: 0; padding-bottom: 4px; }
.fp-name h1 { margin: 0; font-size: clamp(24px, 3vw, 32px); line-height: 1.15; color: var(--text-primary); overflow-wrap: anywhere; }
.fp-badges { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 4px; }
.fp-dept { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 2px 10px; border-radius: 999px; background: color-mix(in srgb, var(--brand-500) 12%, transparent); color: var(--brand-600); }
.fp-name p { margin: 4px 0 0; color: var(--text-secondary); font-size: 15px; }
.fp-name em { display: block; margin-top: 4px; font-style: normal; font-weight: 700; color: var(--brand-600); font-size: 14.5px; }
.fp-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; padding-bottom: 6px; max-width: 380px; }
.fp-body { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 18px; align-items: start; }
.fp-main, .fp-side { display: grid; gap: 16px; min-width: 0; }
.fp-side { position: sticky; top: 84px; }
.fp-card { background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: 18px; padding: 18px 20px; }
.fp-card h3 { margin: 0 0 12px; font-size: 15px; display: flex; align-items: center; gap: 9px; color: var(--text-primary); }
.fp-card h3 > i { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-size: 13px; color: var(--brand-600); background: color-mix(in srgb, var(--brand-500) 13%, transparent); }
.fp-count { font-size: 12px; background: var(--bg-surface-3, rgba(127,127,127,.12)); color: var(--text-secondary); border-radius: 999px; padding: 1px 9px; }
.fp-bio { margin: 0; font-size: 15px; line-height: 1.7; color: var(--text-primary); }
.fp-muted { margin: 0; color: var(--text-tertiary); font-size: 13.5px; }
.fp-courses { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.fp-course { position: relative; display: grid; gap: 4px; text-align: left; padding: 14px 40px 14px 14px; border-radius: 14px; border: 1px solid var(--border-subtle); background: var(--bg-surface-2, var(--bg-page)); color: var(--text-primary); font: inherit; cursor: pointer; transition: border-color .15s, transform .15s; }
.fp-course:hover { border-color: var(--brand-500); transform: translateY(-1px); }
.fp-course .fp-code { width: max-content; font-size: 11px; font-weight: 800; letter-spacing: .05em; padding: 2px 8px; border-radius: 6px; color: #fff; background: linear-gradient(135deg, var(--brand-500), var(--accent-500, #8b5cf6)); }
.fp-course strong { font-size: 14.5px; overflow-wrap: anywhere; }
.fp-course small { color: var(--text-tertiary); font-size: 12px; }
.fp-course > i { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--text-tertiary); }
.fp-pubs { margin: 0; padding-left: 20px; display: grid; gap: 10px; font-size: 14px; line-height: 1.55; color: var(--text-primary); }
.fp-pubs li::marker { color: var(--brand-500); font-weight: 700; }
.fp-dl { margin: 0; display: grid; gap: 12px; }
.fp-dl dt { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-tertiary); display: flex; gap: 7px; align-items: center; }
.fp-dl dt i { width: 14px; text-align: center; }
.fp-dl dd { margin: 3px 0 0 21px; font-size: 14.5px; color: var(--text-primary); overflow-wrap: anywhere; }
.fp-dl dd a { color: var(--brand-600); }
.fp-more { display: flex; align-items: center; gap: 10px; width: 100%; padding: 14px 16px; border-radius: 16px; border: 1px dashed var(--border-default); background: transparent; color: var(--text-secondary); font: 600 13.5px var(--font-sans, inherit); cursor: pointer; text-align: left; }
.fp-more i:last-child { margin-left: auto; }
.fp-more:hover { border-color: var(--brand-500); color: var(--brand-600); }
.fp-full { position: fixed; inset: 0; z-index: 10070; overflow-y: auto; background: var(--bg-page, var(--bg-surface-2)); padding: 20px 16px 40px; }
@media (max-width: 900px) {
  .fp-body { grid-template-columns: 1fr; }
  .fp-side { position: static; }
  .fp-id { grid-template-columns: 1fr; justify-items: start; margin-top: -58px; padding: 0 18px 20px; gap: 12px; }
  .fp-actions { justify-content: flex-start; max-width: none; }
  .fc-av.fp-photo { width: 116px; height: 116px; font-size: 36px; }
  .fp-cover { height: 120px; }
}
/* only the photo sits on the cover; the name stays below it */
.fp-id { margin-top: 0; align-items: start; }
.fc-av.fp-photo { margin-top: -74px; }
.fp-name, .fp-actions { padding-top: 16px; }
@media (max-width: 900px) { .fp-id { margin-top: 0; } .fc-av.fp-photo { margin-top: -62px; } .fp-name, .fp-actions { padding-top: 0; } }
/* ⭐ 2026-10-24 — Director (director.js) */
.rv-table tr.dir-row { cursor: pointer; }
.rv-table tr.dir-row:hover td { background: color-mix(in srgb, var(--brand-500) 7%, transparent); }
/* ⭐ 2026-10-24 — attendance: marks that may be a proxy */
.at-row.flagged { background: color-mix(in srgb, var(--gold-400, #fbbf24) 12%, transparent); border-radius: 10px; }
.at-flag { display: block; margin-top: 4px; font-size: 11.5px; font-weight: 600; color: var(--gold-700, #b45309); }
.at-warn { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; margin-bottom: 8px; border-radius: 10px; font-size: 13px;
  background: color-mix(in srgb, var(--gold-400, #fbbf24) 18%, transparent); color: var(--text-primary); }
.at-warn > i { color: var(--gold-600, #d97706); margin-top: 2px; }

/* ===== Language picker (translate.js) ===== */
.tr-btn { position: relative; display: inline-flex; align-items: center; gap: 3px; }
.tr-btn .tr-code { font-size: 10px; font-weight: 800; letter-spacing: .02em; }
.tr-btn .tr-code:empty { display: none; }
.tr-btn.on { color: var(--accent-primary, #4f46e5); }
.tr-btn.is-busy i { animation: tr-pulse 1s ease-in-out infinite; }
@keyframes tr-pulse { 50% { opacity: .35; } }
.tr-pop {
  position: fixed; z-index: 10060; width: min(320px, calc(100vw - 16px)); max-height: min(520px, calc(100vh - 90px));
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--bg-elevated, #fff); color: var(--text-primary); border: 1px solid var(--border-subtle); border-radius: 16px;
  box-shadow: 0 18px 50px -12px rgba(15,18,30,.45);
}
.tr-head { padding: 14px 16px 8px; display: flex; flex-direction: column; gap: 2px; }
.tr-head b { font-size: 15px; }
.tr-head span { font-size: 12px; color: var(--text-tertiary); }
.tr-find { margin: 4px 12px 8px; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--border-subtle); background: var(--bg-surface-2); color: var(--text-primary); font: inherit; font-size: 14px; }
.tr-list { flex: 1 1 auto; overflow-y: auto; padding: 0 6px 6px; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.tr-list button {
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px; position: relative;
  padding: 8px 10px; border: 1px solid transparent; border-radius: 10px; background: transparent; color: inherit; cursor: pointer; text-align: left; font: inherit;
}
.tr-list button[hidden] { display: none; }
.tr-list button:hover { background: var(--bg-surface-2); }
.tr-list button.on { border-color: var(--accent-primary, #4f46e5); background: rgba(99,102,241,.08); }
.tr-list button i { position: absolute; top: 9px; right: 9px; font-size: 11px; color: var(--accent-primary, #4f46e5); }
.tr-native { font-size: 15px; font-weight: 700; }
.tr-en { font-size: 11.5px; color: var(--text-tertiary); }
.tr-foot { padding: 8px 14px 12px; border-top: 1px solid var(--border-subtle); display: flex; flex-direction: column; gap: 3px; }
.tr-note { font-size: 12px; color: var(--accent-primary, #4f46e5); font-weight: 600; }
.tr-note:empty { display: none; }
.tr-foot small { font-size: 11px; color: var(--text-tertiary); line-height: 1.35; }
.tr-offer {
  position: fixed; z-index: 10055; left: 50%; bottom: 18px; transform: translateX(-50%); max-width: calc(100vw - 24px);
  display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 14px; border-radius: 99px;
  background: #1e1b4b; color: #fff; box-shadow: 0 12px 30px -10px rgba(15,18,30,.6); font-size: 14px;
}
.tr-offer button { border: 0; border-radius: 99px; cursor: pointer; font: inherit; font-weight: 700; padding: 6px 14px; background: #fff; color: #1e1b4b; }
.tr-offer button[data-no] { background: transparent; color: #c7d2fe; padding: 6px 8px; }

/* ===== PDF viewer: translation panel (media-viewer.js) ===== */
.pdfv-main { flex: 1 1 auto; min-height: 0; display: flex; }
.pdfv-main > .pdfv-body { flex: 1 1 auto; min-width: 0; }
.pdfv-tr-btn { width: auto !important; padding: 0 12px !important; gap: 6px; font-weight: 600; }
.pdfv-tr-btn span { font-size: 13px; }
.pdfv-tr-btn.active { background: #4f46e5; border-color: #6366f1; color: #fff; }
.pdfv-tr {
  flex: 0 0 min(42%, 560px); min-width: 0; display: flex; flex-direction: column;
  background: #0f1324; color: #e5e7f0; border-left: 1px solid rgba(255,255,255,.08);
  -webkit-user-select: none; user-select: none;
}
.pdfv-tr[hidden] { display: none; }
.pdfv-tr-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px 10px 16px; border-bottom: 1px solid rgba(255,255,255,.08); flex-shrink: 0; }
.pdfv-tr-head b { flex: 1; font-size: 14px; color: #fff; }
.pdfv-tr-head button { border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.06); color: #e5e7f0; border-radius: 9px; height: 32px; padding: 0 10px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.pdfv-tr-head button:hover { background: rgba(255,255,255,.12); }
.pdfv-tr-head .pdfv-tr-x { width: 32px; padding: 0; justify-content: center; }
.pdfv-tr-head .pdfv-tr-both.on { background: #4f46e5; border-color: #6366f1; color: #fff; }
.pdfv-tr-lang i { font-size: 10px; opacity: .7; }
.pdfv-tr-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 16px 20px 28px; overscroll-behavior: contain; }
.pdfv-tr-p { margin: 0 0 14px; }
.pdfv-tr-p p { margin: 0; font-size: 15.5px; line-height: 1.7; color: #eef0f8; }
.pdfv-tr-p p.pdfv-tr-miss { color: #9aa0b8; font-style: italic; }
.pdfv-tr-orig { display: none; font-size: 12.5px !important; line-height: 1.5 !important; color: #8a90a8 !important; margin-top: 4px !important; padding-left: 10px; border-left: 2px solid rgba(255,255,255,.12); }
.pdfv-tr-both .pdfv-tr-orig { display: block; }
.pdfv-tr-md { font-size: 15.5px; line-height: 1.7; color: #eef0f8; }
.pdfv-tr-md h4 { margin: 14px 0 6px; font-size: 16px; color: #fff; }
.pdfv-tr-md p { margin: 0 0 12px; }
.pdfv-tr-md ul { margin: 0 0 12px; padding-left: 20px; }
.pdfv-tr-wait { color: #9aa0b8; font-size: 14px; margin: 8px 0; }
.pdfv-tr-note { background: rgba(245,158,11,.12); border: 1px solid rgba(245,158,11,.3); color: #fcd34d; border-radius: 10px; padding: 10px 12px; font-size: 13.5px; line-height: 1.5; }
.pdfv-tr-note button { margin-left: 6px; border: 0; border-radius: 7px; padding: 4px 10px; background: #f59e0b; color: #1f1300; font: inherit; font-weight: 700; cursor: pointer; }
.pdfv-tr-skel i { display: block; height: 12px; margin: 0 0 12px; border-radius: 6px; background: linear-gradient(90deg, rgba(255,255,255,.06), rgba(255,255,255,.14), rgba(255,255,255,.06)); background-size: 200% 100%; animation: pdfv-tr-sh 1.2s linear infinite; }
.pdfv-tr-skel i:nth-child(2n) { width: 82%; }
.pdfv-tr-skel i:nth-child(3n) { width: 64%; }
@keyframes pdfv-tr-sh { to { background-position: -200% 0; } }
.pdfv-tr-foot { flex-shrink: 0; padding: 8px 16px; font-size: 11.5px; color: #7c829c; border-top: 1px solid rgba(255,255,255,.06); }
.pdfv-tr-langs { flex: 1 1 auto; overflow-y: auto; padding: 12px; display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; align-content: start; }
.pdfv-tr-langs button { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px 12px; border-radius: 10px; border: 1px solid rgba(255,255,255,.1); background: rgba(255,255,255,.04); color: #fff; font: inherit; cursor: pointer; text-align: left; }
.pdfv-tr-langs button:hover { border-color: #6366f1; background: rgba(99,102,241,.14); }
.pdfv-tr-langs b { font-size: 15px; }
.pdfv-tr-langs span { font-size: 11.5px; color: #9aa0b8; }
@media (max-width: 760px) {
  .pdfv-main { flex-direction: column; }
  .pdfv-tr { flex: 0 0 52%; border-left: 0; border-top: 1px solid rgba(255,255,255,.12); border-radius: 16px 16px 0 0; }
  .pdfv-tr-btn span { display: none; }
  .pdfv-tr-btn { padding: 0 10px !important; }
  .pdfv-tr-body { padding: 12px 16px 20px; }
}
@media (prefers-reduced-motion: reduce) { .pdfv-tr-skel i { animation: none; } }

/* ===== Login: keep me signed in on this device ===== */
.lg-keep { display: flex; align-items: flex-start; gap: 10px; margin: 2px 0 14px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border-subtle); background: var(--bg-surface-2); cursor: pointer; }
.lg-keep[hidden] { display: none; }
.lg-keep input { width: 18px; height: 18px; margin: 2px 0 0; flex: 0 0 auto; accent-color: var(--accent-primary, #4f46e5); cursor: pointer; }
.lg-keep span { display: flex; flex-direction: column; gap: 2px; }
.lg-keep b { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.lg-keep small { font-size: 12px; color: var(--text-tertiary); line-height: 1.35; }

/* ===== Student: My marks (attendance.js) ===== */
.mk-course { margin: 0 0 14px; }
.mk-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 0 6px; }
.mk-head small { color: var(--text-tertiary); }
.mk-grade { margin-left: auto; padding: 3px 10px; border-radius: 99px; font-size: 12.5px; font-weight: 700; background: rgba(16,185,129,.14); color: var(--emerald-600, #059669); }
.mk-grade.f { background: rgba(225,29,72,.12); color: #e11d48; }
.mk-val { white-space: nowrap; font-variant-numeric: tabular-nums; }
.mk-val b { font-size: 15px; }
.mk-val small { color: var(--text-tertiary); }

/* ===== Course: Exams tab (exams.js) ===== */
.ex-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 6px 0 16px; }
.ex-head h3 { margin: 0 0 4px; font-size: 19px; color: var(--text-primary); display: flex; align-items: center; gap: 9px; }
.ex-head h3 i { color: var(--accent-primary, #4f46e5); }
.ex-head p { margin: 0; color: var(--text-secondary); font-size: 14px; }
.ex-list { display: flex; flex-direction: column; gap: 12px; }
.ex-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 16px 18px; border-radius: 16px; border: 1px solid var(--border-subtle); background: var(--bg-surface); box-shadow: var(--shadow-sm); }
.ex-card.ex-live { border-color: color-mix(in srgb, #10b981 55%, transparent); box-shadow: 0 0 0 3px color-mix(in srgb, #10b981 12%, transparent), var(--shadow-sm); }
.ex-main { flex: 1 1 320px; min-width: 0; }
.ex-title { display: flex; align-items: center; gap: 10px; font-size: 16.5px; font-weight: 700; color: var(--text-primary); flex-wrap: wrap; }
.ex-badge { font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; padding: 3px 9px; border-radius: 99px; }
.ex-badge.live { background: #10b981; color: #fff; animation: ex-pulse 2s ease-in-out infinite; }
.ex-badge.soon { background: rgba(99,102,241,.14); color: var(--accent-primary, #4f46e5); }
.ex-badge.draft { background: var(--bg-surface-3); color: var(--text-secondary); }
.ex-badge.done { background: rgba(16,185,129,.14); color: var(--emerald-600, #059669); }
.ex-badge.closed { background: var(--bg-surface-3); color: var(--text-tertiary); }
@keyframes ex-pulse { 50% { box-shadow: 0 0 0 5px rgba(16,185,129,.18); } }
.ex-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ex-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-secondary); background: var(--bg-surface-2); border: 1px solid var(--border-subtle); padding: 4px 10px; border-radius: 99px; }
.ex-side { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.ex-side small { color: var(--text-tertiary); font-size: 12.5px; }
.ex-start { font-size: 15px; padding: 10px 20px; }
.ex-wait { color: var(--accent-primary, #4f46e5); font-weight: 600; font-size: 13.5px; display: inline-flex; gap: 6px; align-items: center; }
.ex-score { font-size: 14px; color: var(--text-secondary); }
.ex-score b { font-size: 20px; color: var(--text-primary); }
.ex-score.pending { color: #b45309; font-weight: 600; font-size: 13px; }
.ex-score.missed { color: var(--text-tertiary); font-weight: 600; }
.ex-acts .ex-del { color: #e11d48; }
.ex-empty { text-align: center; padding: 40px 16px; color: var(--text-secondary); border: 1px dashed var(--border-default); border-radius: 16px; }
.ex-empty i { font-size: 30px; color: var(--text-tertiary); margin-bottom: 8px; display: block; }
.ex-ov { position: fixed; inset: 0; z-index: 10040; background: rgba(8,10,20,.5); display: flex; align-items: center; justify-content: center; padding: 16px; }
.ex-dlg { width: min(520px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--bg-elevated, var(--bg-surface)); color: var(--text-primary); border: 1px solid var(--border-subtle); border-radius: 18px; padding: 20px 22px; box-shadow: 0 24px 60px -16px rgba(0,0,0,.5); display: flex; flex-direction: column; gap: 12px; }
.ex-dlg h3 { margin: 0; font-size: 18px; display: flex; gap: 9px; align-items: center; }
.ex-dlg label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 600; color: var(--text-secondary); }
.ex-dlg input { padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border-default); background: var(--bg-surface); color: var(--text-primary); font: inherit; font-size: 14px; font-weight: 500; }
.ex-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ex-presets { display: flex; flex-wrap: wrap; gap: 6px; }
.ex-presets button { border: 1px solid var(--border-default); background: var(--bg-surface); color: var(--text-primary); border-radius: 99px; padding: 6px 12px; font: 600 12.5px inherit; cursor: pointer; }
.ex-presets button:hover { border-color: var(--accent-primary, #4f46e5); color: var(--accent-primary, #4f46e5); }
.ex-hint { margin: 0; font-size: 12.5px; color: var(--text-tertiary); line-height: 1.45; }
.ex-dlg .ex-acts { display: flex; justify-content: flex-end; gap: 8px; }
@media (max-width: 560px) { .ex-row { grid-template-columns: 1fr; } .ex-side { width: 100%; justify-content: stretch; } .ex-start { flex: 1; } }
@media (prefers-reduced-motion: reduce) { .ex-badge.live { animation: none; } }

/* ===== What to re-teach (exams.js) ===== */
.ex-dlg.ex-wide { width: min(980px, 100%); gap: 14px; }
.rt-load { padding: 40px; text-align: center; color: var(--text-secondary); }
.rt-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.rt-head h3 { margin: 0 0 4px; }
.rt-head p { margin: 0; color: var(--text-secondary); font-size: 13.5px; }
.rt-topics { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 10px; }
.rt-topic { border: 1px solid var(--border-subtle); border-left: 4px solid #10b981; border-radius: 12px; padding: 12px 14px; background: var(--bg-surface); display: flex; flex-direction: column; gap: 8px; }
.rt-topic.bad { border-left-color: #e11d48; } .rt-topic.mid { border-left-color: #f59e0b; }
.rt-tline { display: flex; align-items: center; gap: 10px; justify-content: space-between; }
.rt-tname { display: flex; flex-direction: column; min-width: 0; }
.rt-tname b { font-size: 15px; color: var(--text-primary); }
.rt-tname small { color: var(--text-tertiary); font-size: 12px; }
.rt-bar { display: inline-block; width: 90px; height: 8px; border-radius: 99px; background: var(--bg-surface-3); overflow: hidden; vertical-align: middle; }
.rt-bar i { display: block; height: 100%; border-radius: inherit; background: #10b981; }
.rt-bar.bad i { background: #e11d48; } .rt-bar.mid i { background: #f59e0b; }
.rt-pct { margin-left: 6px; font-size: 13px; font-variant-numeric: tabular-nums; }
.rt-pct.bad { color: #e11d48; } .rt-pct.mid { color: #b45309; } .rt-pct.good { color: var(--emerald-600, #059669); }
.rt-weak summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--text-secondary); }
.rt-names { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.rt-names span { font-size: 12.5px; padding: 3px 9px; border-radius: 99px; background: var(--bg-surface-2); border: 1px solid var(--border-subtle); }
.rt-names small { color: var(--text-tertiary); } .rt-names em { font-style: normal; color: #e11d48; font-weight: 700; }
.rt-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.rt-ok { margin: 0; font-size: 13px; color: var(--emerald-600, #059669); }
.rt-note textarea { width: 100%; box-sizing: border-box; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--border-default); background: var(--bg-surface); color: var(--text-primary); font: inherit; font-size: 13.5px; }
.rt-sub { margin: 4px 0 0; font-size: 15px; }
.rt-table { overflow: auto; max-height: 420px; border: 1px solid var(--border-subtle); border-radius: 12px; }
.rt-table table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.rt-table th { position: sticky; top: 0; background: var(--bg-surface-2); text-align: left; padding: 8px 10px; font-size: 12px; color: var(--text-secondary); }
.rt-table td { padding: 8px 10px; border-top: 1px solid var(--border-subtle); vertical-align: top; color: var(--text-primary); }
.rt-table td small { display: block; color: var(--text-tertiary); font-size: 12px; }
.rt-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.rt-mis { font-weight: 600; color: #b45309; }
@media (max-width: 640px) { .rt-topics { grid-template-columns: 1fr; } .rt-bar { width: 60px; } }

/* ===== class list notes (2026-10-26) ===== */
.qs-note, .gb-note { display: flex; gap: 8px; align-items: flex-start; margin: 10px 0; padding: 10px 12px; border-radius: 10px; font-size: 13.5px; line-height: 1.45;
  background: color-mix(in srgb, var(--brand-500, #6366f1) 9%, var(--bg-surface)); border: 1px solid color-mix(in srgb, var(--brand-500, #6366f1) 30%, transparent); color: var(--text-primary); }
.qs-note i, .gb-note i { color: var(--brand-500, #6366f1); margin-top: 2px; }

/* ===== ⭐ 2026-10-28 — every device: touch targets and classroom smartboards =====
   Touch screens (phones, tablets, boards): small links and close buttons get a
   finger-sized hit area. Big touch screens (75–86" classroom boards, read from the
   back of the room): the header and the page content are drawn larger — only
   those, so full-screen views (PDF reader, live class) and pop-ups keep their own
   sizing (zooming the whole page would also stretch every 100vh). */
@media (any-pointer: coarse) {
  .lg-mini-link { padding: 10px 2px; margin: -6px 0; }
  .lg-keep input { width: 22px; height: 22px; }
  .pw-panel h3 a.more { display: inline-flex; align-items: center; min-height: 36px; padding: 0 6px; margin: -8px -6px; }
  .pdfv-toolbar .pdfv-btn { min-width: 36px; min-height: 36px; }
  .pdfv-toolbar .pdfv-color { width: 30px; height: 30px; }
}
@media (any-pointer: coarse) and (min-width: 1600px) and (max-width: 2399px) {
  #appHeader, #app > .main-content { zoom: 1.25; }
}
@media (any-pointer: coarse) and (min-width: 2400px) and (max-width: 3199px) {
  #appHeader, #app > .main-content { zoom: 1.6; }
}
@media (min-width: 3200px) {   /* 4K at 100 %: everything is tiny otherwise, touch or not */
  #appHeader, #app > .main-content { zoom: 2; }
}

/* ===== ⭐ 2026-10-28 — activate an institute account (login page) ===== */
.lg-activate { display: flex; align-items: center; gap: 12px; width: 100%; margin-top: 14px; padding: 12px 14px; border-radius: 14px; border: 1px dashed color-mix(in srgb, var(--brand-500) 55%, transparent);
  background: color-mix(in srgb, var(--brand-500) 7%, var(--bg-surface)); color: var(--text-primary); font: inherit; text-align: left; cursor: pointer; }
.lg-activate:hover { border-style: solid; background: color-mix(in srgb, var(--brand-500) 12%, var(--bg-surface)); }
.lg-activate > i:first-child { font-size: 18px; color: var(--brand-600); } .lg-activate span { flex: 1; display: grid; gap: 2px; } .lg-activate small { color: var(--text-secondary); font-size: 12px; }
.act-ov { position: fixed; inset: 0; z-index: 10040; display: grid; place-items: center; padding: 16px; background: rgba(2,6,23,.55); backdrop-filter: blur(4px); }
.act-card { position: relative; width: min(440px, 100%); max-height: calc(100dvh - 32px); overflow: auto; padding: 22px; border-radius: 20px; background: var(--bg-surface); color: var(--text-primary); box-shadow: 0 30px 80px rgba(0,0,0,.35); border: 1px solid var(--border-subtle); }
.act-card h3 { margin: 6px 0 6px; font-size: 19px; } .act-card p { margin: 0 0 14px; color: var(--text-secondary); font-size: 14px; line-height: 1.5; }
.act-card form { display: grid; gap: 12px; } .act-card label { display: grid; gap: 5px; font-size: 13px; font-weight: 600; color: var(--text-secondary); }
.act-card input, .act-card select { padding: 11px 12px; border-radius: 11px; border: 1px solid var(--border-default); background: var(--bg-surface-2, var(--bg-surface)); color: var(--text-primary); font: inherit; font-size: 15px; }
.act-card input:focus, .act-card select:focus { outline: none; border-color: var(--brand-500); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-500) 22%, transparent); }
.act-x { position: absolute; right: 12px; top: 12px; width: 34px; height: 34px; border-radius: 10px; border: 0; background: transparent; color: var(--text-secondary); cursor: pointer; font-size: 16px; }
.act-steps { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; } .act-steps span { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--bg-surface-3, #e2e8f0); color: var(--text-secondary); }
.act-steps span.on { background: var(--brand-600); color: #fff; } .act-steps i { width: 22px; height: 2px; background: var(--border-default); }
.act-inst { display: flex; gap: 8px; align-items: center; padding: 9px 12px; border-radius: 11px; background: color-mix(in srgb, var(--brand-500) 9%, transparent); font-size: 13.5px; font-weight: 600; }
.act-row { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; } .act-row a { color: var(--brand-600); text-decoration: none; }
.act-note { font-size: 13px; text-align: center; }
.act-done { text-align: center; } .act-done > i { font-size: 46px; color: var(--emerald-600, #059669); margin: 6px 0; } .act-done .btn { margin-top: 6px; }
@media (any-pointer: coarse) { .act-row a { padding: 8px 0; } .act-x { width: 40px; height: 40px; } }
/* ⭐ 2026-10-28 — Admin → Institutions */
#adminTabInstitutions .in-pick { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
#adminTabInstitutions .in-upload { display: grid; gap: 10px; } #adminTabInstitutions .in-upload input[type=file] { font: inherit; font-size: 14px; max-width: 100%; color: var(--text-secondary); }
#adminTabInstitutions .in-upload input[type=file]::file-selector-button { margin-right: 10px; padding: 7px 12px; border-radius: 9px; border: 1px solid var(--border-default); background: var(--bg-surface); color: var(--text-primary); font: inherit; cursor: pointer; }
#adminTabInstitutions .in-radio { display: flex; gap: 8px; align-items: flex-start; font-size: 13.5px; cursor: pointer; } #adminTabInstitutions .in-radio input { margin-top: 3px; }
#adminTabInstitutions .in-codes { flex-wrap: wrap; justify-content: flex-start; }
#adminTabInstitutions .in-q { min-width: 200px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--border-default); background: var(--bg-surface); color: var(--text-primary); font: inherit; }
#adminTabInstitutions select { padding: 8px 10px; border-radius: 10px; border: 1px solid var(--border-default); background: var(--bg-surface); color: var(--text-primary); font: inherit; }
#adminTabInstitutions .in-add summary { cursor: pointer; font-weight: 700; } #adminTabInstitutions .in-add form { margin-top: 12px; }
#adminTabInstitutions .in-pager { margin-top: 10px; }
@media (max-width: 640px) { #adminTabInstitutions .in-q { min-width: 0; flex: 1 1 100%; } #adminTabInstitutions .rv-bar { flex-wrap: wrap; } }

/* ⭐ 2026-10-28 — Admin → Subscriptions: are the courses locked? */
.sub-lock-state { margin: 12px 0 0; padding: 10px 12px; border-radius: 10px; font-size: 13.5px; line-height: 1.5;
  background: color-mix(in srgb, var(--text-secondary) 8%, transparent); color: var(--text-secondary); }
.sub-lock-state.on { background: color-mix(in srgb, var(--brand-500) 10%, transparent); color: var(--text-primary); }
.sub-lock-state i { margin-right: 6px; }
.sub-toggle-row { flex-wrap: wrap; gap: 12px; }

/* ⭐ 2026-10-28 — the Subscribe dialog for premium features */
.sub-prompt { text-align: center; }
.sub-prompt-icon { width: 56px; height: 56px; margin: 4px auto 10px; border-radius: 16px; display: grid; place-items: center; font-size: 24px;
  color: #b45309; background: color-mix(in srgb, #f59e0b 18%, transparent); }
.sub-prompt h3 { font-size: 18px; }

/* ===== ⭐ 2026-10-29 — Lecture → Everything (professor) and Revision notes (students) ===== */
.lk-wrap { width: min(980px, 100%) !important; }
.lk-dlg, .rn-dlg { display: grid; gap: 14px; }
.lk-head { display: flex; gap: 12px; align-items: flex-start; } .lk-head > div { flex: 1; }
.lk-head h3 { margin: 0 0 4px; font-size: 19px; } .lk-head p { margin: 0; color: var(--text-secondary); font-size: 13.5px; }
.lk-working { display: grid; gap: 8px; justify-items: center; text-align: center; padding: 40px 16px; color: var(--text-secondary); }
.lk-working > i { font-size: 34px; color: var(--brand-600); } .lk-working b { color: var(--text-primary); font-size: 16px; }
.lk-tabs { display: flex; gap: 6px; flex-wrap: wrap; border-bottom: 1px solid var(--border-subtle); padding-bottom: 8px; }
.lk-tabs button { border: 1px solid var(--border-default); background: transparent; color: var(--text-secondary); border-radius: 999px; padding: 7px 14px; font: inherit; font-size: 13.5px; cursor: pointer; }
.lk-tabs button.on { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }
.lk-body { max-height: min(58vh, 620px); overflow: auto; display: grid; gap: 12px; padding-right: 4px; }
.lk-item { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--border-subtle); border-radius: 12px; background: var(--bg-surface); }
.lk-item-top { display: flex; gap: 10px; align-items: center; }
.lk-dlg textarea, .lk-dlg input[type=text], .lk-dlg input[type=number], .lk-dlg select { width: 100%; padding: 8px 10px; border-radius: 9px; border: 1px solid var(--border-default); background: var(--bg-surface-2, var(--bg-surface)); color: var(--text-primary); font: inherit; font-size: 14px; resize: vertical; }
.lk-item-top select { width: auto; } .lk-marks { display: flex; gap: 6px; align-items: center; font-size: 13px; } .lk-marks input { width: 70px !important; }
.lk-opt { display: flex; gap: 8px; align-items: center; padding: 2px 6px; border-radius: 9px; } .lk-opt.on { background: color-mix(in srgb, var(--emerald-600, #059669) 14%, transparent); }
.lk-opt input[type=radio] { width: 18px; height: 18px; flex: none; accent-color: var(--emerald-600, #059669); }
.lk-sub { font-size: 12.5px; color: var(--text-secondary); }
.lk-notes { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; } .lk-preview { padding: 10px 14px; border: 1px solid var(--border-subtle); border-radius: 12px; overflow: auto; max-height: 520px; }
.lk-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.lk-card { display: grid; gap: 6px; padding: 10px; border: 1px solid var(--border-subtle); border-radius: 12px; } .lk-card .btn { justify-self: end; }
.lk-foot { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; border-top: 1px solid var(--border-subtle); padding-top: 12px; }
.lk-picks { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13.5px; } .lk-pick { display: flex; gap: 6px; align-items: center; cursor: pointer; }
.lk-done { color: var(--emerald-600, #059669); font-weight: 600; }
.rn-summary { line-height: 1.65; font-size: 15px; } .rn-summary h4 { margin: 14px 0 6px; font-size: 16px; } .rn-summary ul { margin: 4px 0 8px 18px; }
.rn-cards-title { margin: 8px 0 0; } .rn-cards-title small { font-weight: 400; color: var(--text-secondary); margin-left: 6px; }
.rn-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.rn-card { min-height: 110px; padding: 14px; border-radius: 14px; border: 1px solid var(--border-default); background: color-mix(in srgb, var(--brand-500) 7%, var(--bg-surface)); color: var(--text-primary); font: inherit; font-size: 14.5px; cursor: pointer; text-align: center; display: grid; place-items: center; }
.rn-card .rn-back { display: none; } .rn-card.flipped { background: color-mix(in srgb, var(--emerald-600, #059669) 12%, var(--bg-surface)); }
.rn-card.flipped .rn-front { display: none; } .rn-card.flipped .rn-back { display: block; }
@media (max-width: 720px) { .lk-notes { grid-template-columns: 1fr; } .lk-foot .rv-sp { display: none; } }

/* ⭐ 2026-10-29 — Lecture → Everything: Edit / Student view */
.lk-tabs { align-items: center; }
.lk-view { display: inline-flex; border: 1px solid var(--border-default); border-radius: 999px; overflow: hidden; }
.lk-view button { border: 0; background: transparent; color: var(--text-secondary); padding: 7px 14px; font: inherit; font-size: 13.5px; cursor: pointer; }
.lk-view button.on { background: var(--emerald-600, #059669); color: #fff; }
.lk-view-note { padding: 7px 12px; font-size: 13px; color: var(--text-secondary); }
.lk-sv { margin: 0; }
.lk-sv-key { margin-top: 10px; padding: 8px 12px; border-radius: 10px; font-size: 13px; color: var(--text-secondary);
  background: color-mix(in srgb, var(--emerald-600, #059669) 9%, transparent); border: 1px dashed color-mix(in srgb, var(--emerald-600, #059669) 40%, transparent); }
.lk-sv-key b { color: var(--emerald-600, #059669); }
.lk-sv-answer { width: 100%; margin-top: 8px; padding: 10px; border-radius: 10px; border: 1px dashed var(--border-default); background: transparent; color: var(--text-secondary); font: inherit; resize: none; }
.lk-diff { margin-left: 6px; padding: 1px 8px; border-radius: 999px; font-size: 11.5px; text-transform: capitalize; background: var(--bg-surface-3, #e2e8f0); color: var(--text-secondary); }
.lk-diff.easy { color: #047857; } .lk-diff.hard { color: #b91c1c; }

/* ⭐ 2026-10-29 — Head of Department → Parent reports */
.pr-root { display: grid; gap: 14px; }
.pr-head { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; }
.pr-period { display: grid; gap: 4px; font-size: 12.5px; color: var(--text-secondary); font-weight: 600; }
.pr-period select, .pr-period input { padding: 8px 10px; border-radius: 10px; border: 1px solid var(--border-default); background: var(--bg-surface); color: var(--text-primary); font: inherit; font-size: 14px; }
.pr-period input { margin-top: 4px; }
.pr-kpis { display: flex; gap: 8px; flex-wrap: wrap; }
.pr-kpis > div { min-width: 104px; padding: 8px 12px; border-radius: 12px; border: 1px solid var(--border-subtle); background: var(--bg-surface); display: grid; }
.pr-kpis strong { font-size: 20px; line-height: 1.2; color: var(--text-primary); }
.pr-kpis span { font-size: 12px; color: var(--text-secondary); }
.pr-kpis .warn strong { color: #b45309; }
.pr-msg summary { cursor: pointer; font-weight: 700; } .pr-msg summary small { font-weight: 400; color: var(--text-secondary); }
.pr-msg-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; margin-top: 12px; }
.pr-msg-grid label, .pr-sample { display: grid; gap: 6px; align-content: start; }
.pr-msg-grid textarea { width: 100%; padding: 9px 10px; border-radius: 10px; border: 1px solid var(--border-default); background: var(--bg-surface-2, var(--bg-surface)); color: var(--text-primary); font: inherit; font-size: 13.5px; resize: vertical; }
.pr-msg-grid small { color: var(--text-secondary); font-size: 12px; }
.pr-lab { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; color: var(--text-secondary); }
.pr-langs { display: inline-flex; border: 1px solid var(--border-default); border-radius: 999px; overflow: hidden; }
.pr-langs button { border: 0; background: transparent; color: var(--text-secondary); font: inherit; font-size: 12px; padding: 3px 10px; cursor: pointer; }
.pr-langs button.on { background: var(--brand-600); color: #fff; }
.pr-sample pre { margin: 0; white-space: pre-wrap; font: 13px/1.5 var(--font-sans, inherit); padding: 10px 12px; border-radius: 12px 12px 12px 2px; background: color-mix(in srgb, #25d366 12%, var(--bg-surface)); border: 1px solid var(--border-subtle); color: var(--text-primary); }
.pr-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.pr-filters { display: flex; gap: 6px; flex-wrap: wrap; }
.pr-filters button { border: 1px solid var(--border-default); background: transparent; color: var(--text-secondary); border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 13px; cursor: pointer; }
.pr-filters button b { margin-left: 4px; }
.pr-filters button.on { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }
.pr-bulk { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 8px 12px; border-radius: 12px; border: 1px dashed var(--border-default); color: var(--text-secondary); font-size: 13.5px; }
.pr-bulk.on { border-style: solid; border-color: var(--brand-600); background: color-mix(in srgb, var(--brand-500) 7%, transparent); color: var(--text-primary); }
.btn.pr-wa { background: #128c4b; border-color: #128c4b; color: #fff; }
.btn.pr-wa:hover:not(:disabled) { background: #0e7a40; }
.btn.pr-wa:disabled { opacity: .45; }
.pr-table td { vertical-align: top; }
.pr-table td small { display: block; color: var(--text-secondary); font-size: 12px; margin-top: 2px; }
.pr-table tr.pr-on td { background: color-mix(in srgb, var(--brand-500) 6%, transparent); }
.pr-table input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--brand-600); }
.pr-acts { white-space: nowrap; } .pr-acts .btn { margin-left: 4px; }
.pr-bad { color: var(--rose-600, #b91c1c); }
.pr-link { border: 0; background: none; color: var(--brand-600); font: inherit; font-size: 12px; padding: 0; cursor: pointer; text-decoration: underline; }
.rv-pill.warn { background: color-mix(in srgb, #f59e0b 16%, transparent); color: #b45309; }
[data-theme="dark"] .rv-pill.warn, [data-theme="dim"] .rv-pill.warn, [data-theme="dark"] .pr-kpis .warn strong { color: #fcd34d; }
.pr-q { width: min(460px, 100%); }
.pr-q-prog { height: 6px; border-radius: 3px; background: var(--bg-surface-3, #e5e7eb); overflow: hidden; margin: 6px 0 2px; }
.pr-q-prog i { display: block; height: 100%; background: #128c4b; }
.pr-q-who { display: grid; gap: 4px; margin: 12px 0; padding: 12px; border-radius: 12px; border: 1px solid var(--border-subtle); }
.pr-q-who small { color: var(--text-secondary); }
.pr-edit { display: grid; gap: 10px; width: min(420px, 100%); }
.pr-edit label { display: grid; gap: 4px; font-size: 13px; font-weight: 600; color: var(--text-secondary); }
.pr-edit input { padding: 9px 10px; border-radius: 10px; border: 1px solid var(--border-default); background: var(--bg-surface); color: var(--text-primary); font: inherit; font-size: 14px; }
@media (max-width: 900px) { .pr-msg-grid { grid-template-columns: 1fr; } }
.pr-bar input[type=search] { width: min(260px, 100%); padding: 8px 12px; border-radius: 10px; border: 1px solid var(--border-default); background: var(--bg-surface); color: var(--text-primary); font: inherit; font-size: 14px; }

/* ⭐ 2026-10-29 — Mentors (mentor.js) */
.mt-root { display: grid; gap: 14px; }
.mt-hero h2 { margin: 0 0 4px; font-size: 22px; } .mt-hero p { margin: 0; color: var(--text-secondary); max-width: 760px; }
.mt-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.mt-chip { border: 1px solid var(--border-default); background: var(--bg-surface); color: var(--text-secondary); border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 13px; cursor: pointer; }
.mt-chip.on { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }
.mt-chip:focus-visible { outline: 2px solid var(--brand-500); outline-offset: 2px; }
.mt-form { display: grid; gap: 12px; }
.mt-form h3 { margin: 0; }
.mt-form label { display: grid; gap: 4px; font-size: 13px; font-weight: 600; color: var(--text-secondary); }
.mt-form input:not([type=radio]), .mt-form select, .mt-form textarea { padding: 9px 10px; border-radius: 10px; border: 1px solid var(--border-default); background: var(--bg-surface); color: var(--text-primary); font: inherit; font-size: 14px; }
.mt-lab { margin-top: 4px; } .mt-lab small { font-weight: 400; }
.mt-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.mt-radio { display: flex !important; grid-auto-flow: column; align-items: center; gap: 8px !important; padding: 10px 12px; border: 1px solid var(--border-default); border-radius: 12px; cursor: pointer; color: var(--text-primary) !important; }
.mt-main { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 14px; align-items: start; }
.mt-card { display: grid; gap: 10px; padding: 16px; border-radius: 16px; border: 1px solid var(--border-subtle); background: var(--bg-surface); }
.mt-card.small { padding: 12px; gap: 8px; }
.mt-card-top { display: flex; gap: 12px; align-items: flex-start; }
.mt-card h3 { margin: 0; font-size: 18px; } .mt-card.small h3 { font-size: 15.5px; }
.mt-av { flex: none; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 18px; color: #fff; background: var(--brand-600); }
.mt-card.small .mt-av, .mt-mentee .mt-av { width: 40px; height: 40px; font-size: 14px; }
.mt-av.k-alumni { background: #0f766e; } .mt-av.k-professor { background: #9a3412; }
.mt-kind { display: inline-flex; gap: 6px; align-items: center; font-size: 12.5px; color: var(--text-secondary); font-weight: 600; }
.mt-head { margin: 4px 0 0; font-size: 14px; } .mt-sub { margin: 2px 0 0; font-size: 12.5px; color: var(--text-secondary); }
.mt-why { list-style: none; margin: 0; padding: 10px 12px; border-radius: 12px; background: color-mix(in srgb, var(--emerald-500, #10b981) 9%, transparent); display: grid; gap: 4px; font-size: 13.5px; }
.mt-why i { color: var(--emerald-600, #059669); margin-right: 6px; }
.mt-tags { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; font-size: 12.5px; }
.mt-tags span { color: var(--text-secondary); font-weight: 600; margin-right: 4px; }
.mt-tags em { font-style: normal; padding: 2px 9px; border-radius: 999px; background: var(--bg-surface-3, rgba(127,127,127,.12)); color: var(--text-primary); }
.mt-tags em.on { background: color-mix(in srgb, var(--brand-500) 18%, transparent); color: var(--brand-600); font-weight: 600; }
.mt-bio { margin: 0; font-size: 14px; line-height: 1.55; white-space: pre-wrap; }
.mt-li { font-size: 13.5px; font-weight: 600; color: #0a66c2; text-decoration: none; }
.mt-mine { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; font-size: 13.5px; color: var(--text-secondary); padding: 10px 12px; border: 1px dashed var(--border-default); border-radius: 12px; }
.mt-alts { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.mt-alts > div { display: grid; gap: 8px; align-content: start; } .mt-alts .btn { justify-self: start; }
.mt-thread { display: grid; gap: 10px; }
.mt-msgs { max-height: 380px; min-height: 160px; overflow: auto; display: grid; gap: 8px; align-content: start; padding: 4px; }
.mt-msg { max-width: 82%; justify-self: start; padding: 8px 12px; border-radius: 14px 14px 14px 4px; background: var(--bg-surface-3, rgba(127,127,127,.12)); }
.mt-msg.me { justify-self: end; border-radius: 14px 14px 4px 14px; background: var(--brand-600); color: #fff; }
.mt-msg p { margin: 0; white-space: pre-wrap; word-break: break-word; font-size: 14px; }
.mt-msg small { display: block; font-size: 11px; opacity: .7; margin-top: 2px; }
.mt-empty { color: var(--text-secondary); font-size: 13.5px; text-align: center; padding: 30px 10px; }
.mt-send { display: flex; gap: 8px; align-items: flex-end; }
.mt-send textarea { flex: 1; padding: 9px 10px; border-radius: 12px; border: 1px solid var(--border-default); background: var(--bg-surface); color: var(--text-primary); font: inherit; font-size: 14px; resize: vertical; }
.mt-status { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border-subtle); background: var(--bg-surface); font-size: 13.5px; }
.mt-load { font-weight: 700; } .mt-load.full { color: #b45309; }
.mt-mentees { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 14px; align-items: start; }
.mt-list { display: grid; gap: 6px; }
.mt-mentee { display: flex; gap: 10px; text-align: left; padding: 10px; border-radius: 12px; border: 1px solid var(--border-subtle); background: var(--bg-surface); color: var(--text-primary); font: inherit; cursor: pointer; }
.mt-mentee.on { border-color: var(--brand-600); box-shadow: 0 0 0 1px var(--brand-600); }
.mt-mentee small { display: block; font-size: 12px; color: var(--text-secondary); }
.mt-dot { font-style: normal; display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 999px; background: var(--rose-500, #f43f5e); color: #fff; font-size: 11px; text-align: center; }
.mt-adm { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.mt-adm-card { display: grid; gap: 8px; align-content: start; }
.mt-new { border-color: var(--emerald-500, #10b981); }
@media (max-width: 860px) { .mt-main, .mt-mentees { grid-template-columns: 1fr; } }

/* ⭐ 2026-10-29 — CDC & Placements (cdc.js) */
.cdc-root { display: grid; gap: 14px; }
.cdc-head { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.cdc-head h2 { margin: 0; font-size: 21px; } .cdc-head select { padding: 8px 10px; border-radius: 10px; border: 1px solid var(--border-default); background: var(--bg-surface); color: var(--text-primary); font: inherit; }
.cdc-filters { display: grid; gap: 10px; }
.cdc-filters .mt-chip small { opacity: .7; margin-left: 3px; }
.cdc-filters .mt-chip:disabled { opacity: .4; cursor: default; }
.cdc-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; align-items: end; }
.cdc-row label { display: grid; gap: 4px; font-size: 12.5px; font-weight: 600; color: var(--text-secondary); }
.cdc-row select, .cdc-row input[type=search] { padding: 8px 10px; border-radius: 10px; border: 1px solid var(--border-default); background: var(--bg-surface); color: var(--text-primary); font: inherit; font-size: 14px; }
.cdc-check { display: flex !important; align-items: center; gap: 8px !important; padding-bottom: 8px; }
.cdc-name { font-weight: 700; font-size: 14px; text-decoration: none; color: var(--text-primary); }
.cdc-f { display: inline-block; margin: 2px 4px 2px 0; padding: 2px 8px; border-radius: 999px; font-size: 12px; background: var(--bg-surface-3, rgba(127,127,127,.12)); }
.cdc-f b { font-weight: 700; }
.cdc-f.asked { box-shadow: inset 0 0 0 1px currentColor; }
.t1 { color: var(--emerald-600, #047857); } .t2 { color: var(--brand-600, #4f46e5); } .t3 { color: var(--text-secondary); }
.cdc-bar { display: grid; grid-template-columns: 170px 1fr 120px; gap: 10px; align-items: center; font-size: 13.5px; margin: 6px 0; }
.cdc-bar .bar { height: 8px; border-radius: 4px; background: var(--bg-surface-3, rgba(127,127,127,.15)); overflow: hidden; }
.cdc-bar .bar i { display: block; height: 100%; border-radius: 4px; background: currentColor; }
.cdc-bar .bar i.t1 { background: var(--emerald-600, #047857); } .cdc-bar .bar i.t2 { background: var(--brand-600, #4f46e5); } .cdc-bar .bar i.t3 { background: var(--text-secondary); }
.cdc-bar b { text-align: right; }
.cdc-dlg { width: min(860px, 100%); max-height: 88vh; overflow: auto; display: grid; gap: 10px; }
.cdc-dlg h4 { margin: 8px 0 0; }
.cdc-dlg-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; } .cdc-dlg-head h3 { margin: 0; }
.cdc-send { width: min(480px, 100%); }
.cdc-link { display: flex; gap: 8px; margin: 8px 0; } .cdc-link input { flex: 1; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--border-default); background: var(--bg-surface); color: var(--text-primary); font: inherit; font-size: 13.5px; }
.cdc-auto { color: var(--text-secondary); font-style: italic; }
.cdc-pgrid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.cdc-pside { display: grid; gap: 14px; }
.cdc-pside h3 { margin: 0 0 8px; }
.cdc-consent { display: flex !important; gap: 10px !important; align-items: flex-start; padding: 12px; border: 1px solid var(--border-default); border-radius: 12px; cursor: pointer; color: var(--text-primary) !important; font-weight: 400 !important; }
.cdc-consent input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--brand-600); flex: none; }
.cdc-consent small { display: block; color: var(--text-secondary); font-size: 12.5px; margin-top: 2px; }
@media (max-width: 860px) { .cdc-pgrid { grid-template-columns: 1fr; } .cdc-bar { grid-template-columns: 110px 1fr 90px; } }

/* ⭐ 2026-10-29 — Hall warden (hall.js) */
.hl-contacts { display: grid; gap: 6px; padding: 10px 12px; border: 1px solid var(--border-subtle); border-radius: 12px; font-size: 13.5px; }
.hl-contacts > div { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.hl-contacts b { min-width: 150px; color: var(--text-secondary); font-weight: 600; }
.hl-note { display: flex; gap: 8px; align-items: flex-start; flex-wrap: wrap; }
.hl-note select, .hl-note textarea { padding: 8px 10px; border-radius: 10px; border: 1px solid var(--border-default); background: var(--bg-surface); color: var(--text-primary); font: inherit; font-size: 14px; }
.hl-note textarea { flex: 1; min-width: 220px; resize: vertical; }
.hl-notes { display: grid; gap: 4px; }
.hl-notes .hd-li small { display: block; color: var(--text-secondary); font-size: 12px; }
.hl-add { margin-top: 6px; } .hl-add input { max-width: 200px; }
@media (max-width: 600px) { .hl-contacts b { min-width: 0; width: 100%; } }
/* the new screens: wide tables scroll inside their card, the page never scrolls sideways on a phone */
#profHallSlot, #profCdcSlot, #profMentoringSlot, .cdc-root, .pr-root, .mt-root { min-width: 0; max-width: 100%; }
.cdc-root > *, .pr-root > *, .mt-root > * { min-width: 0; }
.cdc-root .rv-table-wrap, .pr-root .rv-table-wrap, .mt-root .rv-table-wrap { overflow-x: auto; max-width: 100%; }

/* ⭐ 2026-10-29 — the student's care team (care.js) */
.care-dlg { width: min(980px, 100%); }
.care-grid { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 14px; align-items: start; }
.care-grid h4 { margin: 4px 0 8px; }
.care-member { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border-subtle); }
.care-member > span:nth-child(2) { flex: 1; min-width: 0; } .care-member small { display: block; color: var(--text-secondary); font-size: 12px; }
.care-member .mt-av { width: 38px; height: 38px; font-size: 13px; }
.care-acts { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.care-acts .btn { padding: 5px 9px; }
.care-from { display: block; font-weight: 700; opacity: .85 !important; margin: 0 0 2px !important; }
.care-inbox { display: grid; gap: 6px; grid-template-columns: minmax(0, 1fr); }
.care-row { display: flex; gap: 12px; align-items: center; text-align: left; width: 100%; padding: 12px; border-radius: 12px; border: 1px solid var(--border-subtle); background: var(--bg-surface); color: var(--text-primary); font: inherit; cursor: pointer; }
.care-row.unread { border-color: var(--brand-600); box-shadow: 0 0 0 1px var(--brand-600); }
.care-row-main { flex: 1; min-width: 0; } .care-row-main small { color: var(--text-secondary); }
.care-last { display: block; color: var(--text-secondary); font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.care-row.unread .care-last { color: var(--text-primary); font-weight: 600; }
.care-row-side { display: grid; justify-items: end; gap: 4px; color: var(--text-secondary); }
#profAdviseesSlot, #profDiscussionsSlot { min-width: 0; max-width: 100%; }
@media (max-width: 860px) { .care-grid { grid-template-columns: 1fr; } }
/* the record / discussion dialogs are wide (the plain dialog is a small box) */
.aero-dialog.cdc-dlg { width: min(860px, 96vw); max-width: min(860px, 96vw); }
.aero-dialog.care-dlg { width: min(980px, 96vw); max-width: min(980px, 96vw); }
.care-dlg .mt-msg { max-width: 88%; }
.care-dlg .mt-send textarea { margin-bottom: 0; min-width: 0; }
