/* ==========================================================================
   ExamPathway — Modern Organic Educational Platform Stylesheet
   Crafted with crisp humanist typography, natural watercolor palette & modern product UI.
   ========================================================================== */

@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,400;0,500;0,600;0,700;0,800;1,400;1,500;1,600;1,700&display=swap");
@import "cbt-engine.css";

:root {
  /* Typography System — High-legibility Modern Humanist Sans */
  --font-sans: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-display: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-serif: "Plus Jakarta Sans", sans-serif;
  --font-title: "Plus Jakarta Sans", sans-serif;

  /* Color Palette — Sampled from Watercolor Emblem (Scholar Navy, Laurel Green, Amber Gold, Cerulean) */
  --primary: #0e2242;                  /* Deep Scholar Navy from graduation cap & wordmark */
  --primary-hover: #07152b;
  --primary-soft: #edf4fc;             /* Soft watercolor sky wash */
  --primary-foreground: #ffffff;

  --botanical: #1b6338;                /* Laurel Olive / Forest Green from the wreath */
  --botanical-hover: #124727;
  --botanical-soft: #ebf6ee;
  --botanical-border: #c2e2cc;

  --sky: #0284c7;                      /* Cerulean Sky Blue from the cap tassel/highlights */
  --sky-hover: #0369a1;
  --sky-soft: #e0f2fe;

  --gold: #d97706;                     /* Golden Amber from medal & ribbon */
  --gold-hover: #b45309;
  --gold-soft: #fef3c7;
  --gold-border: #fde68a;

  --brand-orange: #d97706;
  --brand-orange-hover: #b45309;
  --brand-orange-soft: #fef3c7;
  --brand-orange-foreground: #ffffff;

  --background: #fbfcfb;               /* Crisp fresh modern background, zero parchment yellow */
  --background-subtle: #f4f7f4;        /* Soft botanical tint wash */
  --foreground: #0e1726;               /* Sharp readable charcoal-navy ink */

  --card: #ffffff;                     /* Crisp pure white card surface */
  --card-foreground: #0e1726;

  --muted: #f1f5f2;                    /* Clean subtle neutral */
  --muted-foreground: #526071;         /* High-legibility neutral slate */

  --border: #e2eae3;                   /* Subtle fresh hairline border */
  --border-subtle: #edf3ee;
  --border-ornate: #0e2242;
  --border-double: #e2eae3;
  --input: #dce5dd;
  --input-focus: #0e2242;

  --success: #1b6338;
  --success-soft: #ebf6ee;
  --success-foreground: #0e3b20;

  --destructive: #dc2626;
  --destructive-soft: #fee2e2;
  --destructive-foreground: #991b1b;

  --warning: #d97706;
  --warning-soft: #fef3c7;

  /* Modern ergonomic border radii */
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Tactile natural soft shadows */
  --shadow-sm: 0 1px 3px rgba(14, 23, 38, 0.04);
  --shadow-soft: 0 4px 20px -2px rgba(14, 23, 38, 0.06), 0 1px 4px rgba(14, 23, 38, 0.03);
  --shadow-lift: 0 10px 28px -4px rgba(14, 23, 38, 0.09), 0 2px 8px rgba(14, 23, 38, 0.04);
  --shadow-lg: 0 20px 40px -8px rgba(14, 23, 38, 0.12);

  /* Fresh gradient */
  --gradient-hero: linear-gradient(180deg, #f0f6f2 0%, #fbfcfb 100%);
  --gradient-soft: linear-gradient(180deg, #f4f7f4 0%, #fbfcfb 100%);
  --gradient-glow: none;

  --glass-bg: rgba(255, 255, 255, 0.94);
  --glass-border: rgba(226, 234, 227, 0.85);
  --glass-backdrop: blur(12px);

  --max-w-container: 1240px;
  --transition: all 0.2s ease;
}

/* ==========================================================================
   Dark Theme Overrides — Midnight Slate & Warm Ochre
   ========================================================================== */
[data-theme="dark"] {
  --primary: #9bbfe8;
  --primary-hover: #b4d2f5;
  --primary-soft: rgba(155, 191, 232, 0.14);
  --primary-foreground: #0e1724;

  --botanical: #6cae7d;
  --botanical-soft: rgba(108, 174, 125, 0.14);

  --gold: #dcb054;
  --gold-soft: rgba(220, 176, 84, 0.14);

  --brand-orange: #dcb054;
  --brand-orange-hover: #ebd07d;
  --brand-orange-soft: rgba(220, 176, 84, 0.14);

  --background: #0f1622;
  --background-subtle: #141d2c;
  --foreground: #f2edf5;

  --card: #152030;
  --card-foreground: #f2edf5;

  --muted: #1c283c;
  --muted-foreground: #9caab8;

  --border: rgba(228, 220, 206, 0.14);
  --border-subtle: rgba(228, 220, 206, 0.08);
  --border-ornate: #dcb054;
  --border-double: rgba(228, 220, 206, 0.14);
  --input: rgba(228, 220, 206, 0.16);

  --success: #6cae7d;
  --success-soft: rgba(108, 174, 125, 0.15);
  --success-foreground: #c2e6cb;

  --destructive: #f08181;
  --destructive-soft: rgba(240, 129, 129, 0.15);
  --destructive-foreground: #fcd4d4;

  --shadow-soft: 0 4px 16px -2px rgba(0, 0, 0, 0.45);
  --shadow-lift: 0 8px 24px -3px rgba(0, 0, 0, 0.55);

  --gradient-hero: radial-gradient(ellipse at 50% -10%, rgba(26, 42, 68, 0.5) 0%, rgba(15, 22, 34, 1) 75%);
  --gradient-soft: linear-gradient(180deg, #141d2c 0%, #0f1622 100%);

  --glass-bg: rgba(21, 32, 48, 0.94);
  --glass-border: rgba(228, 220, 206, 0.12);
}

/* ==========================================================================
   Base Reset & Modern Canvas
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: var(--font-sans);
  font-size: 16px;
  color: var(--foreground);
  background-color: var(--background);
  scroll-behavior: smooth;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  max-width: 100vw;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.62;
  background-color: transparent;
  overflow-x: hidden;
  max-width: 100vw;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.22;
  color: var(--foreground);
  letter-spacing: -0.015em;
}

a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

/* ==========================================================================
   Layout Containers
   ========================================================================== */
.container {
  width: 100%;
  max-width: var(--max-w-container);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.section {
  padding-top: 4.5rem;
  padding-bottom: 4.5rem;
}

.section-sm {
  padding-top: 2.5rem;
  padding-bottom: 2.5rem;
}

.grid {
  display: grid;
}

.grid-cols-1 { grid-template-columns: 1fr; }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 767px) {
  .grid-cols-2, .grid-cols-3, .grid-cols-4 {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .grid-cols-3, .grid-cols-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

.layout-sidebar-main {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
}
@media (min-width: 1024px) {
  .layout-sidebar-main {
    grid-template-columns: 2fr 1fr;
  }
}

.layout-contact-split {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
}
@media (min-width: 1024px) {
  .layout-contact-split {
    grid-template-columns: 1fr 1.35fr;
  }
}

.flex {
  display: flex;
}

.items-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

.justify-center {
  justify-content: center;
}

.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }
.gap-10 { gap: 2.5rem; }

/* ==========================================================================
   Header & Navigation
   ========================================================================== */
.masthead-topbar {
  background: var(--primary);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  padding: 0.45rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

[data-theme="dark"] .masthead-topbar {
  background: #080f1a;
  border-bottom-color: var(--border);
}

.masthead-bullet {
  color: var(--gold);
  font-size: 0.72rem;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-backdrop);
  -webkit-backdrop-filter: var(--glass-backdrop);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 4px rgba(20, 32, 54, 0.04);
  transition: var(--transition);
  padding: 0.65rem 0;
}

[data-theme="dark"] .site-header {
  background: var(--glass-bg);
  border-bottom-color: var(--border);
}

.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-header-inner > .flex {
  gap: 0.75rem !important;
}

.logo-link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-shrink: 0;
}

.logo-title-group {
  display: flex;
  flex-direction: column;
}

.logo-main-text {
  font-family: var(--font-sans);
  font-weight: 800;
  font-size: 1.22rem;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--primary);
}

[data-theme="dark"] .logo-main-text {
  color: var(--primary);
}

.logo-sub-text {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted-foreground);
  margin-top: 0.05rem;
  display: none;
}

@media (min-width: 1200px) {
  .logo-sub-text {
    display: block;
  }
}

.logo-emblem {
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
  box-shadow: 0 2px 6px rgba(20, 34, 58, 0.08);
  background: #ffffff;
  flex-shrink: 0;
  transition: var(--transition);
}

.logo-link:hover .logo-emblem {
  transform: scale(1.04);
  border-color: var(--primary);
}

.logo-text-highlight {
  color: var(--gold);
}

.nav-links {
  display: none;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

@media (min-width: 1024px) {
  .nav-links {
    display: flex;
  }
}

.nav-auth-login {
  display: none;
}

@media (min-width: 640px) {
  .nav-auth-login {
    display: inline-flex;
  }
}

.nav-link {
  padding: 0.45rem 0.75rem;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--foreground);
  border-radius: var(--radius-sm);
  white-space: nowrap;
  transition: var(--transition);
}

.nav-link:hover {
  color: var(--primary);
  background: var(--primary-soft);
}

.nav-link.active {
  color: var(--primary);
  background: var(--primary-soft);
  font-weight: 700;
}

[data-theme="dark"] .nav-link:hover,
[data-theme="dark"] .nav-link.active {
  background: rgba(155, 191, 232, 0.15);
  color: #ffffff;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}

/* Theme Toggle Button */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: var(--radius-sm);
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--foreground);
  cursor: pointer;
  transition: var(--transition);
}

.icon-btn:hover {
  background: var(--muted);
  border-color: var(--primary);
  color: var(--primary);
}

.icon-btn svg {
  width: 1.15rem;
  height: 1.15rem;
}

/* User Account Dropdown */
.user-menu-wrap {
  position: relative;
}

.user-dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  width: 15rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lift);
  padding: 0.5rem;
  display: none;
  z-index: 150;
  animation: fadeIn 0.15s ease;
}

.user-dropdown.open {
  display: block;
}

.user-dropdown-header {
  padding: 0.75rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.25rem;
}

.user-dropdown-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--foreground);
}

.user-dropdown-email {
  font-size: 0.8rem;
  color: var(--muted-foreground);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  color: var(--foreground);
  cursor: pointer;
}

.user-dropdown-item:hover {
  background: var(--muted);
  color: var(--primary);
}

.user-dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 0.35rem 0;
}

/* Mobile Navigation */
.mobile-menu-btn {
  display: inline-flex;
}

@media (min-width: 1024px) {
  .mobile-menu-btn {
    display: none;
  }
}

.mobile-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 85%;
  max-width: 320px;
  background: var(--card);
  border-left: 1px solid var(--border);
  z-index: 200;
  transform: translateX(100%);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  box-shadow: var(--shadow-lg);
}

.mobile-drawer.open {
  transform: translateX(0);
}

.mobile-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  z-index: 199;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.mobile-drawer-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

/* ==========================================================================
   Buttons & Badges — Clean, Modern, Tactile
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.35rem;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.005em;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  text-decoration: none;
  line-height: 1.25;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 2px 6px rgba(21, 40, 79, 0.18);
}

.btn-primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  box-shadow: 0 4px 14px rgba(21, 40, 79, 0.24);
  color: #ffffff;
}

[data-theme="dark"] .btn-primary {
  background: var(--primary);
  color: #0e1724;
  border-color: var(--primary);
}

[data-theme="dark"] .btn-primary:hover {
  background: var(--primary-hover);
  color: #0e1724;
}

.btn-orange, .btn-gold {
  background: var(--gold);
  color: #ffffff;
  border-color: var(--gold);
  box-shadow: 0 2px 6px rgba(194, 139, 36, 0.2);
}

.btn-orange:hover, .btn-gold:hover {
  background: var(--gold-hover);
  border-color: var(--gold-hover);
  box-shadow: 0 4px 14px rgba(194, 139, 36, 0.28);
  color: #ffffff;
}

.btn-outline {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--foreground);
  box-shadow: 0 1px 2px rgba(20, 34, 54, 0.04);
}

.btn-outline:hover {
  background: var(--muted);
  border-color: var(--primary);
  color: var(--primary);
}

.btn-ghost {
  background: transparent;
  color: var(--foreground);
}

.btn-ghost:hover {
  background: var(--muted);
  color: var(--primary);
}

.btn-sm {
  padding: 0.45rem 0.95rem;
  font-size: 0.82rem;
}

.btn-lg {
  padding: 0.85rem 1.75rem;
  font-size: 0.98rem;
  font-weight: 700;
  border-radius: var(--radius);
}

.btn-full {
  width: 100%;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
}

.badge-primary {
  background: var(--primary-soft);
  color: var(--primary);
  border-color: rgba(21, 40, 79, 0.12);
}

.badge-secondary {
  background: var(--muted);
  color: var(--foreground);
  border-color: var(--border);
}

.badge-orange, .badge-gold {
  background: var(--gold-soft);
  color: #926414;
  border-color: var(--gold-border);
}

[data-theme="dark"] .badge-orange, [data-theme="dark"] .badge-gold {
  color: var(--gold);
}

.badge-botanical, .badge-success {
  background: var(--botanical-soft);
  color: var(--botanical);
  border-color: var(--botanical-border);
}

.badge-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted-foreground);
}

/* ==========================================================================
   Cards, Panels & Section Headers
   ========================================================================== */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  position: relative;
}

.card-hover {
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.card-hover:hover {
  border-color: rgba(21, 40, 79, 0.25);
  box-shadow: var(--shadow-soft);
  transform: translateY(-2px);
}

.glass-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.section-header {
  margin-bottom: 2.75rem;
}

.section-header.text-center {
  text-align: center;
}

.section-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--botanical);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.65rem;
}

.section-title {
  font-family: var(--font-sans);
  font-size: 2.25rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
  letter-spacing: -0.025em;
  color: var(--foreground);
  line-height: 1.2;
}

@media (min-width: 768px) {
  .section-title {
    font-size: 2.5rem;
  }
}

.section-desc {
  font-family: var(--font-sans);
  font-size: 1.08rem;
  color: var(--muted-foreground);
  max-width: 650px;
  line-height: 1.62;
}

.section-header.text-center .section-desc {
  margin-left: auto;
  margin-right: auto;
}

/* ==========================================================================
   Hero Section — Modern Organic Split Hero & Active Console Showcase
   ========================================================================== */
.hero-section, .frontispiece-hero {
  position: relative;
  overflow: hidden;
  background: var(--gradient-hero);
  border-bottom: 1px solid var(--border);
  padding: 3.5rem 0 4.25rem;
}

.hero-split-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.75rem;
  align-items: center;
}

@media (min-width: 992px) {
  .hero-split-container {
    grid-template-columns: 1.15fr 0.95fr;
    gap: 3.5rem;
  }
}

.hero-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
}

.hero-pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--botanical);
  background: var(--botanical-soft);
  border: 1px solid var(--botanical-border);
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  margin-bottom: 1.35rem;
}

.hero-pill-badge .badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--botanical);
  box-shadow: 0 0 0 3px rgba(27, 99, 56, 0.2);
}

.hero-title {
  font-family: var(--font-sans);
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1.14;
  color: var(--primary);
  letter-spacing: -0.035em;
  margin-bottom: 1.15rem;
}

@media (min-width: 768px) {
  .hero-title {
    font-size: 3.25rem;
  }
}

@media (min-width: 1200px) {
  .hero-title {
    font-size: 3.65rem;
  }
}

[data-theme="dark"] .hero-title {
  color: #ffffff;
}

.hero-title .highlight-organic {
  color: var(--botanical);
  position: relative;
  display: inline-block;
}

.hero-desc {
  font-family: var(--font-sans);
  font-size: 1.1rem;
  line-height: 1.65;
  color: var(--muted-foreground);
  max-width: 580px;
  margin-bottom: 1.75rem;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
  margin-bottom: 1.75rem;
}

.hero-guarantees {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--muted-foreground);
}

.guarantee-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.guarantee-item svg {
  color: var(--botanical);
  flex-shrink: 0;
}

/* Right Column: Active Learning Product Showcase */
.hero-showcase {
  position: relative;
  width: 100%;
}

.showcase-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lift);
  overflow: hidden;
  transition: var(--transition);
}

[data-theme="dark"] .showcase-card {
  background: var(--card);
}

.showcase-card-header {
  padding: 1rem 1.35rem;
  background: #f8faf8;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

[data-theme="dark"] .showcase-card-header {
  background: rgba(255, 255, 255, 0.03);
}

.showcase-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.showcase-emblem {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
}

.showcase-brand-name {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.2;
}

[data-theme="dark"] .showcase-brand-name {
  color: #ffffff;
}

.showcase-brand-sub {
  font-size: 0.72rem;
  color: var(--muted-foreground);
  font-weight: 500;
}

.showcase-live-tag {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--botanical);
  background: var(--botanical-soft);
  border: 1px solid var(--botanical-border);
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-full);
}

.showcase-preview-body {
  padding: 1.35rem;
}

/* Hero Showcase 5-Second Countdown Timer Bar */
.showcase-timer-bar-wrap {
  width: 100%;
  height: 3px;
  background: rgba(0, 0, 0, 0.05);
  position: relative;
  overflow: hidden;
}

[data-theme="dark"] .showcase-timer-bar-wrap {
  background: rgba(255, 255, 255, 0.08);
}

.showcase-timer-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--botanical), #34d399);
  transition: none;
}

.showcase-timer-bar.running {
  width: 100%;
  transition: width 5000ms linear;
}

.showcase-track-tags {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.showcase-track-tags .tag-pill {
  font-size: 0.76rem;
  font-weight: 600;
  padding: 0.28rem 0.72rem;
  border-radius: var(--radius-full);
  background: var(--muted);
  color: var(--muted-foreground);
  border: 1px solid transparent;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s ease;
  user-select: none;
}

.showcase-track-tags .tag-pill:hover {
  background: rgba(22, 42, 92, 0.1);
  color: var(--primary);
}

.showcase-track-tags .tag-pill.active {
  background: var(--primary);
  color: #ffffff;
}

.showcase-q-box {
  background: #fdfefe;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem;
  margin-bottom: 1.25rem;
  min-height: 185px;
  transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1), transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.showcase-q-box.fade-out {
  opacity: 0;
  transform: translateY(-4px);
}

[data-theme="dark"] .showcase-q-box {
  background: rgba(0, 0, 0, 0.2);
}

.showcase-q-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.65rem;
  font-size: 0.76rem;
  font-weight: 600;
}

.q-subject {
  color: var(--botanical);
}

.q-difficulty {
  color: var(--gold);
}

.showcase-q-text {
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--foreground);
  margin-bottom: 0.85rem;
}

.showcase-q-options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.showcase-option {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: 0.84rem;
  font-weight: 500;
  background: #ffffff;
}

[data-theme="dark"] .showcase-option {
  background: var(--card);
}

.showcase-option.selected {
  border-color: var(--botanical);
  background: var(--botanical-soft);
  color: var(--botanical);
  font-weight: 600;
}

.opt-bullet {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.05);
  font-size: 0.72rem;
  font-weight: 700;
}

.showcase-option.selected .opt-bullet {
  background: var(--botanical);
  color: #ffffff;
}

.opt-correct {
  margin-left: auto;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--botanical);
}

.showcase-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  text-align: center;
}

.showcase-metric-item .s-val {
  display: block;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.02em;
}

[data-theme="dark"] .showcase-metric-item .s-val {
  color: #ffffff;
}

.showcase-metric-item .s-lbl {
  display: block;
  font-size: 0.72rem;
  color: var(--muted-foreground);
  font-weight: 500;
}

/* Fallback / Shared Frontispiece aliases to ensure no broken layout */
.frontispiece-charter {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: var(--shadow-soft);
}

.frontispiece-rubric {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: var(--botanical);
  background: var(--botanical-soft);
  border: 1px solid var(--botanical-border);
  font-weight: 600;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  margin-bottom: 1.25rem;
}

.frontispiece-title {
  font-family: var(--font-sans);
  font-size: 2.4rem;
  font-weight: 800;
  line-height: 1.2;
  color: var(--primary);
  letter-spacing: -0.025em;
  margin-bottom: 1rem;
}

[data-theme="dark"] .frontispiece-title {
  color: #ffffff;
}

.frontispiece-desc {
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--muted-foreground);
  margin-bottom: 1.5rem;
}

.frontispiece-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Call to Action Banner */
.cta-banner-box {
  background: linear-gradient(135deg, #0e2242 0%, #163665 100%);
  color: #ffffff;
  border-radius: var(--radius-xl);
  padding: 3.75rem 2.5rem;
  text-align: center;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.cta-banner-content {
  position: relative;
  z-index: 2;
  max-width: 660px;
  margin: 0 auto;
}

.cta-title {
  font-family: var(--font-sans);
  font-size: 2.35rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 0.85rem;
  letter-spacing: -0.03em;
}

.cta-desc {
  font-size: 1.05rem;
  color: rgba(255, 255, 255, 0.88);
  line-height: 1.6;
  margin-bottom: 2rem;
}

.cta-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.cta-actions .btn-primary {
  background: #ffffff;
  color: #0e2242;
  border-color: #ffffff;
  font-weight: 700;
}

.cta-actions .btn-primary:hover {
  background: #f0f4f8;
  color: #0e2242;
}

.cta-actions .btn-outline {
  background: transparent;
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.45);
}

.cta-actions .btn-outline:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: #ffffff;
  color: #ffffff;
}

/* ==========================================================================
   Trust Strip & Social Proof (Infinite Revolving Conveyor Belt)
   ========================================================================== */
.trust-strip {
  border-bottom: 1px solid var(--border);
  background: var(--background-subtle);
  padding: 1.15rem 0;
  position: relative;
  overflow: hidden;
  user-select: none;
}

.trust-strip-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.5rem;
}

/* Conveyor belt viewport with smooth gradient edge fade */
.trust-conveyor {
  width: 100%;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  mask-image: linear-gradient(
    to right,
    transparent 0%,
    black 4%,
    black 96%,
    transparent 100%
  );
  -webkit-mask-image: linear-gradient(
    to right,
    transparent 0%,
    black 4%,
    black 96%,
    transparent 100%
  );
}

/* Continuously gliding conveyor track */
.trust-conveyor-track {
  display: flex;
  width: max-content;
  will-change: transform;
  animation: trustConveyorScroll 34s linear infinite;
}

/* Uniform group spacing — padding-right matches gap exactly for a mathematically seamless loop */
.trust-conveyor-group {
  display: flex;
  align-items: center;
  gap: 3.5rem;
  padding-right: 3.5rem;
  flex-shrink: 0;
}

/* Pause motion on hover or keyboard focus for effortless reading */
.trust-strip:hover .trust-conveyor-track,
.trust-strip:focus-within .trust-conveyor-track {
  animation-play-state: paused;
}

/* High-performance compositor-only GPU translation */
@keyframes trustConveyorScroll {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(-50%, 0, 0);
  }
}

.trust-item {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  white-space: nowrap;
  flex-shrink: 0;
  text-decoration: none;
  color: inherit;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), color 0.2s ease;
  cursor: pointer;
}

.trust-item:hover {
  transform: translateY(-1px);
}

.trust-item-icon {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--radius-sm);
  background: var(--card);
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--botanical);
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.trust-item:hover .trust-item-icon {
  border-color: rgba(21, 40, 79, 0.35);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
  transform: scale(1.05);
}

.trust-item-text {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--foreground);
  letter-spacing: -0.01em;
}

/* Accessibility: Respect user prefers-reduced-motion setting */
@media (prefers-reduced-motion: reduce) {
  .trust-conveyor-track {
    animation-play-state: paused;
  }
  .trust-conveyor {
    overflow-x: auto;
    scrollbar-width: thin;
    mask-image: none;
    -webkit-mask-image: none;
  }
}

/* ==========================================================================
   The Four Core Features Grid
   ========================================================================== */
.feature-card, .scholarly-plate, .pillar-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem 1.5rem;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.feature-card:hover, .scholarly-plate:hover, .pillar-card:hover {
  border-color: rgba(21, 40, 79, 0.25);
  box-shadow: var(--shadow-soft);
  transform: translateY(-2px);
}

.feature-card-icon {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: var(--radius-sm);
  background: var(--primary-soft);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
}

.feature-card-num, .scholarly-plate-num, .pillar-num {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--botanical);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.5rem;
}

.feature-card-title, .scholarly-plate-title {
  font-family: var(--font-display);
  font-size: 1.32rem;
  font-weight: 700;
  color: var(--foreground);
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.feature-card-desc, .scholarly-plate-desc {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  color: var(--muted-foreground);
  line-height: 1.6;
}

/* ==========================================================================
   Exam Course Cards
   ========================================================================== */
.course-card, .tome-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.course-card:hover, .tome-card:hover {
  border-color: rgba(21, 40, 79, 0.28);
  box-shadow: var(--shadow-soft);
  transform: translateY(-2px);
}

.course-badge-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.course-card-title, .tome-card-title {
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--foreground);
  margin-bottom: 0.65rem;
  line-height: 1.25;
}

.course-card-desc, .tome-card-desc {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  line-height: 1.58;
  color: var(--muted-foreground);
  margin-bottom: 1.25rem;
}

.course-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1.5rem;
}

.course-tag {
  font-family: var(--font-sans);
  font-size: 0.76rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  background: var(--muted);
  color: var(--foreground);
  border-radius: var(--radius-sm);
}

.course-metric-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: var(--background-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  color: var(--foreground);
  font-weight: 600;
  margin-bottom: 1.5rem;
}

/* ==========================================================================
   Platform Metrics Grid
   ========================================================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem 1.5rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.stat-num {
  font-family: var(--font-display);
  font-size: 2.75rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.1;
  margin-bottom: 0.35rem;
}

[data-theme="dark"] .stat-num {
  color: var(--primary);
}

.stat-label {
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 700;
  color: var(--foreground);
  margin-bottom: 0.25rem;
}

.stat-desc {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  color: var(--muted-foreground);
}

/* ==========================================================================
   Form Controls
   ========================================================================== */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--foreground);
  margin-bottom: 0.35rem;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--foreground);
  outline: none;
  transition: var(--transition);
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.form-textarea {
  resize: vertical;
  min-height: 110px;
}

/* ==========================================================================
   Modals & Toasts
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-box,
.modal-card {
  width: 100%;
  max-width: 720px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 2.25rem;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px) scale(0.97);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.modal-backdrop.open .modal-box,
.modal-backdrop.open .modal-card {
  transform: translateY(0) scale(1);
}

.math-preview-pane {
  background: var(--background-subtle);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 0.85rem;
  margin-top: 0.5rem;
  min-height: 48px;
  font-size: 0.95rem;
}

.modal-close-btn {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: var(--muted-foreground);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close-btn:hover {
  background: var(--muted);
  color: var(--foreground);
}

.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  min-width: 280px;
  max-width: 400px;
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--foreground);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lift);
  font-size: 0.9rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transform: translateY(20px);
  opacity: 0;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast-success {
  border-left: 4px solid var(--success);
}

.toast-error {
  border-left: 4px solid var(--destructive);
}

.toast-info {
  border-left: 4px solid var(--primary);
}

/* ==========================================================================
   Clean Modern Footer
   ========================================================================== */
.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  background: var(--card);
  padding: 4.5rem 0 2.5rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2.5rem;
  margin-bottom: 3rem;
}

.footer-brand p {
  font-family: var(--font-sans);
  color: var(--muted-foreground);
  font-size: 0.95rem;
  margin-top: 0.75rem;
  line-height: 1.6;
}

.footer-col h4 {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--foreground);
}

.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.footer-col a {
  font-family: var(--font-sans);
  font-size: 0.92rem;
  color: var(--muted-foreground);
  transition: var(--transition);
}

.footer-col a:hover {
  color: var(--primary);
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  color: var(--muted-foreground);
}

/* ==========================================================================
   Question Bank & Arena Styles
   ========================================================================== */
.qb-arena-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.5rem;
  box-shadow: var(--shadow-sm);
}

.qb-timer-box {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  background: var(--muted);
  border: 1px solid var(--border);
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.9rem;
}

.qb-timer-digit {
  color: var(--primary);
  font-feature-settings: "tnum";
}

.qb-palette-container {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-sm);
}

.qb-progress-bar-wrap {
  width: 100%;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--muted);
  overflow: hidden;
  margin: 0.75rem 0 1rem 0;
}

.qb-progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary) 0%, var(--success) 100%);
  border-radius: var(--radius-full);
  transition: width 0.4s ease;
}

.qb-dot-strip-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.qb-question-palette {
  min-width: 0;
  max-width: 100%;
}

.qb-question-groups {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
  color: var(--muted-foreground);
  font-size: 0.8rem;
  font-weight: 700;
}

.qb-dot-strip {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.35rem 0.25rem;
}

.qb-dot-pill {
  min-width: 36px;
  min-height: 36px;
  padding: 0 0.25rem;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--border);
  background: var(--card);
  color: var(--foreground);
  font-size: 0.85rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.qb-dot-pill:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
}

.qb-dot-pill.active {
  border-color: var(--primary) !important;
  background: var(--primary-soft) !important;
  box-shadow: 0 0 0 3px rgba(21, 40, 79, 0.18);
}

.qb-dot-pill.answered-correct {
  background: var(--success-soft) !important;
  border-color: var(--success) !important;
  color: var(--success) !important;
}

.qb-dot-pill.answered-incorrect {
  background: var(--destructive-soft) !important;
  border-color: var(--destructive) !important;
  color: var(--destructive) !important;
}

.qb-smart-jump-select {
  padding: 0.45rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 700;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--foreground);
  cursor: pointer;
  outline: none;
}

.qb-smart-jump-select:focus {
  border-color: var(--primary);
}

.qb-solution-card {
  margin-top: 1.5rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.qb-solution-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.85rem;
}

.solution-step {
  border-radius: var(--radius-sm);
  padding: 1.15rem 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.solution-step-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.825rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.solution-step-body {
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--foreground);
}

.solution-step-concept {
  background: var(--primary-soft);
  border-left: 4px solid var(--primary);
}

.solution-step-concept .solution-step-header {
  color: var(--primary);
}

.solution-step-formula {
  background: rgba(14, 165, 233, 0.06);
  border-left: 4px solid #0284c7;
}

.solution-step-formula .solution-step-header {
  color: #0284c7;
}

.solution-step-calc {
  background: rgba(16, 185, 129, 0.06);
  border-left: 4px solid var(--success);
}

.solution-step-calc .solution-step-header {
  color: var(--success);
}

.solution-step-tip {
  background: rgba(245, 158, 11, 0.08);
  border-left: 4px solid var(--brand-orange);
}

.solution-step-tip .solution-step-header {
  color: #b45309;
}

/* Textbook Mathematical Formatter */
.math-derivation-container {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-top: 0.4rem;
}

.math-substep {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: var(--transition);
}

.math-substep:hover {
  border-color: var(--primary);
}

.math-substep-title {
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* ==========================================================================
   High-Precision Mathematical & Scientific Typography (KaTeX Enhancements)
   ========================================================================== */
.katex {
  font-size: 1.08em;
  text-rendering: geometricPrecision;
}

.math-equation-display .katex,
.math-line .katex,
.cbt-solution-step .katex,
.solution-step-body .katex,
.exam-statement-line .katex {
  font-size: 1.12em;
}

/* Crisp, clearly defined horizontal fraction lines */
.katex .mfrac .frac-line {
  border-bottom-width: 0.08em !important;
  opacity: 0.95;
}

/* Generous vertical breathing room for fractions */
.katex .mfrac {
  margin: 0 0.15em;
  vertical-align: -0.42em;
}

/* Clean, visible powers & superscripts */
.katex .msupsub {
  font-size: 0.82em;
  font-weight: 500;
}

.katex .msupsub .vlist-t {
  margin-right: 0.04em;
}

/* Square roots and radicals - clear surd and overline */
.katex .sqrt {
  margin: 0 0.1em;
}

.katex .sqrt > .sqrt-line {
  border-top-width: 0.085em !important;
}

.math-equation-display {
  font-family: inherit;
  font-size: 1.05rem;
  line-height: 2.35;
  color: var(--foreground);
  display: block;
  padding: 1.15rem 1.35rem 1.35rem 1.35rem;
  background: var(--muted);
  border-radius: var(--radius-sm);
  border-left: 3.5px solid var(--primary);
  overflow-x: auto;
  overflow-y: visible;
}

.math-line {
  margin-bottom: 0.55rem;
  line-height: 2.2;
}
.math-line:last-child {
  margin-bottom: 0;
}

.math-integral-wrap {
  display: inline-flex;
  align-items: center;
  vertical-align: -0.32em;
  margin: 0 0.25rem;
  line-height: 1;
}

.math-integral-symbol {
  font-size: 1.85em;
  line-height: 0.9;
  font-family: "Cambria Math", Cambria, "Times New Roman", serif;
  font-weight: 400;
  color: var(--primary, #1e3a8a);
}

.math-integral-limits {
  display: inline-flex;
  flex-direction: column;
  justify-content: space-between;
  height: 2em;
  font-size: 0.68em;
  line-height: 1;
  font-weight: 700;
  vertical-align: middle;
  margin-left: 1px;
  margin-right: 3px;
  text-align: left;
}

.math-integral-sup {
  margin-bottom: auto;
  transform: translateY(-2px);
}

.math-integral-sub {
  margin-top: auto;
  transform: translateY(2px);
}

.math-frac, .math-fraction {
  display: inline-flex;
  flex-direction: column;
  vertical-align: middle;
  text-align: center;
  padding: 0 0.25rem;
  font-size: 0.95em;
  line-height: 1.25;
  margin: 0 0.25rem;
}

.math-num {
  border-bottom: 1.5px solid currentColor;
  padding: 0.1rem 0.35rem 0.2rem 0.35rem;
  display: block;
  font-weight: 600;
}

.math-den {
  padding: 0.2rem 0.35rem 0.1rem 0.35rem;
  display: block;
  font-weight: 600;
}

.math-trig-sup {
  font-size: 0.7em !important;
  line-height: 0.8 !important;
  vertical-align: 0.52em !important;
  font-weight: 700 !important;
  margin: 0 1px 0 0.5px !important;
  display: inline-block !important;
}

.math-sup {
  font-size: 0.72em;
  line-height: 1;
  vertical-align: 0.45em;
  font-weight: 700;
  margin: 0 1px 0 0.5px;
  display: inline-block;
}

.math-sub {
  font-size: 0.72em;
  line-height: 1;
  vertical-align: -0.25em;
  font-weight: 600;
  margin: 0 1px 0 0.5px;
  display: inline-block;
}

.math-sqrt {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  margin: 0 0.2rem;
  line-height: 1;
}

.math-radical {
  font-size: 1.3em;
  line-height: 1;
  margin-right: -1px;
  font-weight: 400;
  font-family: Cambria, "Times New Roman", serif, sans-serif;
  color: inherit;
}

.math-radicand {
  border-top: 2px solid currentColor;
  padding: 2px 4px 1px 2px;
  line-height: 1.25;
  display: inline-flex;
  align-items: center;
  margin-top: -2px;
}

.math-substep-note {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  line-height: 1.5;
  font-style: italic;
}

.qb-options-vertical {
  display: flex !important;
  flex-direction: column !important;
  gap: 0.85rem !important;
  width: 100% !important;
}

.qb-opt-btn {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 1.1rem 1.25rem;
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  width: 100%;
}

.qb-option-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  transition: var(--transition);
  cursor: pointer;
}

.qb-option-card:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.qb-option-card.selected {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.qb-option-card.correct {
  border-color: var(--botanical);
  background: var(--botanical-soft);
}

.qb-option-card.incorrect {
  border-color: var(--destructive);
  background: var(--destructive-soft);
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { transform: translateY(16px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.animate-fade-in {
  animation: fadeIn 0.3s ease forwards;
}

.animate-slide-up {
  animation: slideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* ==========================================================================
   Question Bank Attempt & Unattempted Tracking Styles (Free & Pro Accounts)
   ========================================================================== */

.qb-track-banner {
  background: linear-gradient(135deg, rgba(21, 40, 79, 0.04) 0%, rgba(245, 158, 11, 0.06) 100%);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius);
  padding: 1.15rem 1.35rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
}

.qb-mode-tabs {
  display: inline-flex;
  background: var(--muted);
  border: 1px solid var(--border);
  border-radius: 9999px;
  padding: 0.25rem;
  gap: 0.25rem;
  align-items: center;
}

.qb-mode-pill {
  border: none;
  background: transparent;
  padding: 0.45rem 1rem;
  border-radius: 9999px;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--muted-foreground);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition);
  white-space: nowrap;
}

.qb-mode-pill:hover {
  color: var(--foreground);
  background: rgba(0, 0, 0, 0.04);
}

.qb-mode-pill.active {
  background: var(--card);
  color: var(--primary);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.qb-mode-pill.unattempted-active {
  background: var(--primary) !important;
  color: #fff !important;
  box-shadow: 0 2px 8px rgba(21, 40, 79, 0.3) !important;
}

.qb-mode-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 800;
  background: rgba(0, 0, 0, 0.08);
  color: inherit;
}

.qb-mode-pill.unattempted-active .qb-mode-count {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
}

.qb-chapter-progress-bar {
  width: 100%;
  height: 6px;
  background: var(--muted);
  border-radius: 9999px;
  overflow: hidden;
  margin: 0.65rem 0 0.85rem 0;
}

.qb-chapter-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary) 0%, var(--brand-orange) 100%);
  border-radius: 9999px;
  transition: width 0.4s ease;
}

.qb-completion-card {
  text-align: center;
  padding: 3rem 2rem;
  background: var(--card);
  border: 2px dashed var(--success);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  box-shadow: var(--shadow-md);
}

.qb-completion-icon {
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
  background: var(--success-soft);
  color: var(--success);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.25rem;
}

.qb-submode-tabs {
  display: inline-flex;
  background: var(--muted);
  border: 1px solid var(--border);
  border-radius: 9999px;
  padding: 0.2rem;
  gap: 0.2rem;
  align-items: center;
}

.qb-submode-pill {
  border: none;
  background: transparent;
  padding: 0.3rem 0.75rem;
  border-radius: 9999px;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted-foreground);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: var(--transition);
  white-space: nowrap;
}

.qb-submode-pill:hover {
  color: var(--foreground);
  background: rgba(0, 0, 0, 0.04);
}

.qb-submode-pill.active {
  background: var(--card);
  color: var(--primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.qb-submode-pill.correct-active {
  background: var(--success) !important;
  color: #fff !important;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.3) !important;
}

.qb-submode-pill.wrong-active {
  background: var(--destructive) !important;
  color: #fff !important;
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.3) !important;
}

/* ========================================================
   Exam Markdown Table Formatting & Side-by-Side Match
   ======================================================== */
.exam-table-wrap {
  width: 100%;
  overflow-x: auto;
  margin: 1.25rem 0;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  background: var(--card);
}

.exam-markdown-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.96rem;
  line-height: 1.6;
}

.exam-markdown-table th,
.exam-markdown-table td {
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.exam-markdown-table th {
  background: var(--background-subtle);
  color: var(--foreground);
  font-weight: 800;
  font-size: 0.88rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 2px solid var(--border);
}

.exam-markdown-table tbody tr:nth-child(even) {
  background: rgba(0, 0, 0, 0.015);
}

[data-theme="dark"] .exam-markdown-table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.02);
}

.exam-markdown-table tbody tr:last-child td {
  border-bottom: none;
}

.exam-markdown-table tbody tr:hover {
  background: var(--primary-soft);
}

/* ========================================================
   Mock Test Mode Selection Modal (Subject Test vs Full-Length)
   ======================================================== */
.mt-mode-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s ease;
}

.mt-mode-modal-backdrop.open {
  opacity: 1;
  visibility: visible;
}

.mt-mode-modal-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  max-width: 680px;
  width: 100%;
  padding: 2.25rem;
  transform: scale(0.95);
  transition: transform 0.25s ease;
  position: relative;
}

.mt-mode-modal-backdrop.open .mt-mode-modal-card {
  transform: scale(1);
}

.mt-mode-options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin: 1.5rem 0;
}

@media (max-width: 640px) {
  .mt-mode-options-grid {
    grid-template-columns: 1fr;
  }
}

.mt-mode-option-card {
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--card);
}

.mt-mode-option-card:hover,
.mt-mode-option-card.active {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.mt-subject-pills {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}

.mt-subj-pill {
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 700;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--foreground);
  cursor: pointer;
  transition: var(--transition);
}

.mt-subj-pill:hover,
.mt-subj-pill.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.exam-text-line {
  margin-bottom: 0.5rem;
  line-height: 1.7;
}

.exam-statement-line {
  display: flex;
  align-items: baseline;
  gap: 0.65rem;
  margin: 0.45rem 0 0.45rem 0.75rem;
  line-height: 1.65;
}

.exam-statement-label {
  display: inline-block;
  font-weight: 700;
  color: var(--primary, #2563eb);
  min-width: 1.6rem;
  flex-shrink: 0;
}

.exam-statement-content {
  flex: 1;
}

.exam-statement-directive {
  margin-top: 0.85rem;
  font-weight: 600;
  color: var(--text-dark, #1e293b);
  display: block;
}

/* Question content shares one renderer in practice, tests and solution review. */
.exam-question-content {
  font-size: 1.05rem;
  font-weight: 500;
  line-height: 1.65;
  color: var(--foreground);
  margin: 0 0 0.8rem;
  min-width: 0;
}
.exam-source-question { display: grid; gap: 0.5rem; }
.exam-source-question a { display: block; min-width: 0; }
.exam-source-question img, .exam-question-figure {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  margin: 0;
  background: white;
}
.exam-question-figure { width: auto; margin-top: 0.6rem; max-height: 420px; object-fit: contain; }
.qb-options-vertical { display: grid; gap: 0.5rem; width: 100%; }
.qb-opt-btn {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.7rem 0.85rem;
  border-radius: var(--radius);
  text-align: left;
  font: inherit;
  color: var(--foreground);
  min-width: 0;
}
.qb-opt-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
.qb-opt-btn:disabled { opacity: 1; }
.qb-opt-btn > span:first-child { width: auto !important; min-width: 1.85rem; padding: 0 0.35rem; white-space: nowrap; }
.exam-option-content { flex: 1; min-width: 0; line-height: 1.5; }
.exam-matching-choice { display: flex; flex-wrap: wrap; gap: .35rem 1rem; }
.exam-matching-choice > span { white-space: nowrap; }
.exam-question-crop { width: min(100%, var(--crop-width)); }
.exam-option-content .exam-text-line { display: inline; margin: 0; }
.exam-option-source { display: block; max-width: 100%; width: auto; height: auto; max-height: 240px; object-fit: contain; object-position: left center; background: white; }
.exam-embedded-options { grid-template-columns: repeat(auto-fit, minmax(125px, 1fr)); }
#qb-smart-jump-select { max-width: 100%; min-width: 0; }
.solution-direct-body img { vertical-align: top; }
.exam-source-crop { display: block; position: relative; overflow: hidden; width: min(100%, var(--crop-width)); background: white; }
.exam-source-crop img { position: absolute; height: auto; max-width: none; min-width: 0; margin: 0 !important; }
.exam-option-crop { width: min(100%, var(--crop-width)); }
.exam-solution-crop { margin-bottom: 0.75rem; }
@media (max-width: 640px) {
  .exam-question-content { margin-bottom: 0.65rem; }
  .qb-opt-btn { padding: 0.65rem; gap: 0.5rem; flex-wrap: wrap; }
  .exam-option-source { max-height: 200px; }
  .exam-source-question { overflow-x: auto; }
  .exam-source-question img { min-width: 560px; }
  .exam-source-question .exam-question-crop { min-width: min(560px, var(--crop-width)); }
  .exam-source-question .exam-source-crop img { min-width: 0; }
  .solution-direct-body { overflow-x: auto; }
  .exam-solution-crop { min-width: min(560px, var(--crop-width)); }
  .exam-embedded-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}




/* Keep feedback from squeezing a printed option after it is answered. */
.qb-opt-btn { display: grid; grid-template-columns: auto minmax(0, 1fr); }
.qb-opt-btn > span:last-child:not(.exam-option-content) { grid-column: 2; justify-self: start; margin-left: 0 !important; }
