/* Subtle, Calm & Peaceful dMAT Exam Prep Stylesheet */
:root {
  --primary: #c2410c;          /* Warm Terracotta / Burnt Amber */
  --primary-hover: #9a3412;    /* Deep Earth Terracotta */
  --primary-light: #fff7ed;    /* Soft Warm Cream / Linen Tint */
  --primary-dark: #7c2d12;
  --secondary: #0284c7;        /* Calm Oceanic Slate */
  --accent: #d97706;           /* Warm Amber Ochre */
  --success: #059669;          /* Calm Sage Green */
  --success-bg: #ecfdf5;       /* Subtle Pastel Green Tint */
  --pastel-green: #dcfce7;
  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --warning-bg: #fffbeb;
  
  --bg-main: #fafaf9;          /* Calm Warm Stone Paper */
  --bg-card: #ffffff;
  --bg-elevated: #ffffff;
  --border: #e7e5e4;           /* Warm Stone Border */
  --border-strong: #d6d3d1;
  
  --text-main: #1c1917;        /* Deep Charcoal Stone */
  --text-muted: #78716c;       /* Muted Stone Slate */
  --text-inverse: #ffffff;
  
  --shadow-sm: 0 1px 2px 0 rgb(28 25 23 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(28 25 23 / 0.08), 0 2px 4px -2px rgb(28 25 23 / 0.05);
  --shadow-lg: 0 10px 15px -3px rgb(28 25 23 / 0.08), 0 4px 6px -4px rgb(28 25 23 / 0.04);
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

[data-theme="dark"] {
  --bg-main: #0c0a09;          /* Deep Warm Stone Dark */
  --bg-card: #1c1917;
  --bg-elevated: #292524;
  --border: #292524;
  --border-strong: #44403c;
  
  --text-main: #f5f5f4;
  --text-muted: #a8a29e;
  
  --primary: #ea580c;          /* Warm Glowing Amber-Orange */
  --primary-hover: #f97316;
  --primary-light: #2d1808;
  --success: #10b981;
  --success-bg: #064e3b;
  --danger-bg: #450a0a;
  --warning-bg: #451a03;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* =======================================
   APP HEADER (FROSTED GLASS & MODERN NAVIGATION)
   ======================================= */
.app-header {
  position: sticky;
  top: 0;
  z-index: 500;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.85);
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.04);
  transition: background 0.3s ease, border-color 0.3s ease;
}

[data-theme="dark"] .app-header {
  background: rgba(11, 15, 25, 0.88);
  border-bottom-color: rgba(35, 48, 75, 0.85);
  box-shadow: 0 4px 25px -2px rgba(0, 0, 0, 0.35);
}

.header-content,
.header-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0.65rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}

/* Brand Identity */
.brand-group {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-shrink: 0;
  cursor: pointer;
  text-decoration: none;
}

.brand-logo {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--primary), #ea580c);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  box-shadow: 0 4px 14px rgba(194, 65, 12, 0.25);
  flex-shrink: 0;
  transition: transform 0.2s ease;
}
.brand-group:hover .brand-logo {
  transform: scale(1.05);
}

.brand-title {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.4px;
  color: var(--text-main);
  line-height: 1.2;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.brand-badge {
  font-size: 0.65rem;
  font-weight: 800;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--primary), #ea580c);
  color: white;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 6px rgba(194, 65, 12, 0.25);
}

.brand-subtitle {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-top: 0.1rem;
}

/* 2-Tier Header Architecture */
.header-top-row {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0.65rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}

.header-subnav-row {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0.45rem 1.5rem;
  display: flex;
  align-items: center;
  background: var(--bg-card);
}

/* Static Navigation Tabs with Uniform Gap */
.nav-tabs-static {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  flex-wrap: wrap;
  justify-content: flex-start;
}

/* Modern Pill Navigation Tabs */
.nav-tabs {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  background: var(--bg-main);
  padding: 0.3rem 0.35rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.nav-tabs::-webkit-scrollbar {
  display: none;
}

.nav-tab {
  background: var(--bg-main);
  border: 1px solid var(--border);
  padding: 0.45rem 0.95rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: var(--radius-full);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.nav-tab:hover {
  color: var(--text-main);
  background: var(--primary-light);
  border-color: rgba(194, 65, 12, 0.3);
}

.nav-tab.active {
  background: var(--primary-light);
  color: var(--primary-dark);
  font-weight: 700;
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(194, 65, 12, 0.12);
}

[data-theme="dark"] .nav-tab.active {
  background: #431407;
  color: #fb923c;
  border-color: rgba(251, 146, 60, 0.5);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

/* Header Action Buttons */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

/* Auth & User Profile in Header */
.auth-header-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  position: relative;
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 0.35rem 0.75rem 0.35rem 0.4rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  box-shadow: var(--shadow-sm);
}

.user-pill:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 800;
  overflow: hidden;
}

.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-arrow {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 230px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 0.5rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
}

.dropdown-header {
  padding: 0.5rem 0.75rem;
  display: flex;
  flex-direction: column;
}

.dropdown-header strong {
  font-size: 0.9rem;
  color: var(--text-main);
}

.dropdown-header small {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 0.35rem 0;
}

.dropdown-item {
  background: none;
  border: none;
  padding: 0.55rem 0.75rem;
  text-align: left;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.15s ease;
}

.dropdown-item:hover {
  background: var(--bg-main);
  color: var(--primary);
}

.dropdown-item.text-danger:hover {
  background: #fef2f2;
  color: #dc2626;
}

.theme-btn,
.btn-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.theme-btn:hover,
.btn-icon:hover {
  background: var(--bg-main);
  border-color: var(--primary);
  transform: scale(1.05);
}

@media (max-width: 1024px) {
  .header-content,
  .header-container {
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
  }
  .nav-tabs {
    order: 3;
    width: 100%;
    justify-content: flex-start;
  }
}

/* Notice Banner */
.strict-rule-banner {
  background: linear-gradient(90deg, #fef3c7, #fee2e2);
  color: #991b1b;
  border-bottom: 1px solid #fecaca;
  padding: 0.5rem 1.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-align: center;
}

[data-theme="dark"] .strict-rule-banner {
  background: linear-gradient(90deg, #451a03, #450a0a);
  color: #fca5a5;
  border-bottom-color: #7f1d1d;
}

/* Main Layout */
.main-container {
  max-width: 1280px;
  margin: 1.5rem auto;
  padding: 0 1.5rem;
}

/* Views */
.view-section {
  display: none;
}

.view-section.active {
  display: block;
}

/* Common Card */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.card-title {
  font-size: 1.25rem;
  font-weight: 700;
}

.card-subtitle {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-top: 0.2rem;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.badge-low { background: #dcfce7; color: #15803d; }
.badge-medium { background: #fef9c3; color: #a16207; }
.badge-high { background: #fee2e2; color: #b91c1c; }
.badge-category { background: #e0e7ff; color: #4338ca; }
.badge-subtopic { background: #f1f5f9; color: #475569; }

[data-theme="dark"] .badge-low { background: #064e3b; color: #86efac; }
[data-theme="dark"] .badge-medium { background: #713f12; color: #fde047; }
[data-theme="dark"] .badge-high { background: #7f1d1d; color: #fca5a5; }
[data-theme="dark"] .badge-category { background: #312e81; color: #c7d2fe; }
[data-theme="dark"] .badge-subtopic { background: #1e293b; color: #cbd5e1; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.55rem 1.15rem;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: white;
}
.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-secondary {
  background: var(--bg-card);
  border-color: var(--border);
  color: var(--text-main);
}
.btn-secondary:hover {
  background: var(--bg-main);
}

.btn-accent {
  background: var(--secondary);
  color: white;
}
.btn-accent:hover {
  filter: brightness(0.9);
}

.btn-success {
  background: var(--success);
  color: white;
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
}

/* =======================================
   FIGURE SEQUENCES STYLING
   ======================================= */
.figure-task-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.sequence-strip {
  display: flex;
  align-items: center;
  gap: 1rem;
  overflow-x: auto;
  padding: 1rem 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
}

.matrix-step-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  overflow-x: auto;
  padding: 1rem 0.5rem;
  justify-content: center;
}

.matrix-step-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-card);
  padding: 0.65rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.matrix-step-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.matrix-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.figure-matrix-svg {
  background: #ffffff;
  border-radius: var(--radius-sm);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.05);
  transition: transform 0.15s;
}

.matrix-question {
  border: 2px dashed #a855f7 !important;
  animation: pulse-border 2s infinite ease-in-out;
}

@keyframes pulse-border {
  0%, 100% { border-color: #a855f7; }
  50% { border-color: #d8b4fe; }
}

/* Figure Options Grid */
.options-columns-wrapper {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.option-column {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.option-column-header {
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 1rem;
  text-align: center;
  color: var(--primary);
  background: var(--primary-light);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-sm);
}

.figure-choices-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

@media (max-width: 480px) {
  .figure-choices-list {
    grid-template-columns: 1fr;
  }
}

.figure-choice-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-main);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.figure-choice-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.figure-choice-card.selected {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(194, 65, 12, 0.2);
}

.choice-index {
  font-weight: 800;
  font-size: 0.85rem;
  color: var(--primary-dark);
  background: var(--primary-light);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.25rem;
}

.figure-choice-card.selected .choice-index {
  background: var(--primary);
  color: #ffffff;
}


/* =======================================
   MATHEMATICAL EQUATIONS STYLING
   ======================================= */
.equations-box {
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin: 1rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  font-family: var(--font-mono);
  font-size: 1.3rem;
  font-weight: 700;
  text-align: center;
  color: var(--primary-dark);
}

[data-theme="dark"] .equations-box {
  color: #c084fc;
}

.equations-box.mental-masked {
  filter: blur(8px);
  user-select: none;
  pointer-events: none;
  transition: filter 0.3s ease;
}

.mental-mode-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  background: var(--warning-bg);
  border: 1px solid #fde68a;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
}

[data-theme="dark"] .mental-mode-controls {
  border-color: #92400e;
}

.equation-options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

@media (max-width: 640px) {
  .equation-options-grid {
    grid-template-columns: 1fr;
  }
}

.eq-option-btn {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  font-size: 1.05rem;
  font-weight: 700;
  font-family: var(--font-mono);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: center;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.eq-option-btn:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.eq-option-btn.selected {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary-dark);
  box-shadow: 0 0 0 3px rgba(194, 65, 12, 0.2);
}

/* =======================================
   LATIN SQUARES STYLING
   ======================================= */
.latin-game-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  margin: 1rem 0;
}

.latin-grid-wrapper {
  background: var(--bg-card);
  padding: 1rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
}

.latin-table {
  border-collapse: collapse;
  margin: 0 auto;
}

.latin-col-header, .latin-row-header {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--primary);
  padding: 0.5rem;
  text-align: center;
}

.latin-cell {
  width: 58px;
  height: 58px;
  border: 2px solid #cbd5e1;
  text-align: center;
  vertical-align: middle;
  font-size: 1.5rem;
  font-weight: 700;
  background: #ffffff;
  color: #1e293b;
  position: relative;
  transition: background 0.2s;
}

.latin-cell-filled {
  background: #f8fafc;
}

.latin-cell-target {
  background: #fef2f2 !important;
  color: #ef4444 !important;
  border: 3px solid #ef4444 !important;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.15) !important;
  animation: pulse-target 1.8s infinite ease-in-out;
}

@keyframes pulse-target {
  0%, 100% { box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2); }
  50% { box-shadow: 0 0 0 7px rgba(239, 68, 68, 0.05); }
}

.latin-highlight-active .latin-cell-cross {
  background: #eff6ff !important;
}

.latin-choices-row {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
}

.latin-choice-btn {
  width: 58px;
  height: 58px;
  font-size: 1.4rem;
  font-weight: 800;
  border-radius: var(--radius-md);
  border: 2px solid var(--border);
  background: var(--bg-card);
  color: var(--text-main);
  cursor: pointer;
  box-shadow: 0 3px 0 var(--border-strong);
  transition: all 0.15s ease;
}

.latin-choice-btn:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 5px 0 var(--border-strong);
}

.latin-choice-btn:active {
  transform: translateY(1px);
  box-shadow: 0 1px 0 var(--border-strong);
}

.latin-choice-btn.selected {
  border-color: var(--primary);
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 3px 0 var(--primary-dark);
}

[data-theme="dark"] .latin-cell {
  background: #1e293b;
  border-color: #334155;
  color: #f1f5f9;
}
[data-theme="dark"] .latin-cell-filled {
  background: #0f172a;
}
[data-theme="dark"] .latin-cell-target {
  background: #450a0a !important;
  color: #fca5a5 !important;
  border-color: #ef4444 !important;
}
[data-theme="dark"] .latin-highlight-active .latin-cell-cross {
  background: #1e1b4b !important;
}

/* =======================================
   DATA SCIENCE MODULE STYLING
   ======================================= */
.ds-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.ds-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.q-number {
  margin-left: auto;
  font-weight: 700;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.code-block-wrapper {
  background: #0f172a;
  color: #f8fafc;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  overflow-x: auto;
  border: 1px solid #334155;
}

.ds-options-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 0.5rem;
}

.ds-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  cursor: pointer;
  transition: all 0.15s;
}

.ds-option:hover {
  border-color: var(--primary);
  background: var(--bg-main);
}

.ds-option.selected {
  border-color: var(--primary);
  background: var(--primary-light);
}

.opt-key {
  font-weight: 700;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  background: var(--bg-main);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.85rem;
}

.ds-option.selected .opt-key {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* Explanations */
.explanation-box {
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  margin-top: 1rem;
  border-left: 4px solid;
}

.correct-banner {
  background: var(--success-bg);
  border-left-color: var(--success);
}

.incorrect-banner {
  background: var(--danger-bg);
  border-left-color: var(--danger);
}

.exp-title {
  font-weight: 700;
  margin-bottom: 0.4rem;
  font-size: 0.95rem;
}

.exp-body {
  font-size: 0.9rem;
  line-height: 1.6;
}

.section-results-card {
  background: var(--bg-card);
  border: 2px solid var(--primary);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-md);
  animation: fadeIn 0.25s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.exam-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.stat-card {
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  text-align: center;
}

.stat-number {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--primary);
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-top: 0.25rem;
}

/* Action Bars */
.action-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

/* Study Guide Accordion / Cards */
.guide-category {
  margin-bottom: 1.5rem;
}

.guide-category h3 {
  font-size: 1.15rem;
  margin-bottom: 0.75rem;
  color: var(--primary);
  border-bottom: 2px solid var(--primary-light);
  padding-bottom: 0.35rem;
}

.guide-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.guide-list li {
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
}

/* Footer */
.app-footer {
  text-align: center;
  padding: 2.25rem 1.5rem;
  color: var(--text-muted);
  font-size: 0.8rem;
  border-top: 1px solid var(--border);
  margin-top: 3rem;
}

.footer-attribution {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.4rem;
  letter-spacing: -0.2px;
}

.footer-attribution strong {
  color: var(--primary);
  font-weight: 800;
}

.footer-subtext {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* =======================================
   HOME VIEW: HERO SPLIT & ARCHITECTURAL DATE CARD
   ======================================= */
.home-hero-split {
  display: grid;
  grid-template-columns: 1.4fr 0.9fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
  align-items: stretch;
}

@media (max-width: 960px) {
  .home-hero-split {
    grid-template-columns: 1fr;
  }
}

/* ULTRA-MODERN DYNAMIC HERO CARD */
.dmat-modern-hero-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  transition: all 0.25s ease;
}

.dmat-modern-hero-card:hover {
  box-shadow: var(--shadow-md);
  border-color: rgba(194, 65, 12, 0.3);
}

.hero-top-badges {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.hero-pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--primary);
  background: var(--primary-light);
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full);
  border: 1px solid rgba(194, 65, 12, 0.2);
}

.hero-sub-badge {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}

.hero-punchy-title {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.2;
  color: var(--text-main);
  letter-spacing: -0.6px;
  margin-bottom: 0.65rem;
}

.hero-short-subtitle {
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  max-width: 600px;
}

/* DYNAMIC READINESS DECK */
.dynamic-readiness-deck {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.75rem;
}

@media (max-width: 680px) {
  .dynamic-readiness-deck {
    grid-template-columns: 1fr;
  }
}

.readiness-item {
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.85rem 0.95rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.readiness-item:hover {
  background: var(--bg-card);
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.readiness-icon-box {
  font-size: 1.35rem;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.readiness-text {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.readiness-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.readiness-text strong {
  font-size: 0.85rem;
  color: var(--text-main);
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.readiness-badge {
  font-size: 0.7rem;
  font-weight: 800;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-full);
  background: var(--primary-light);
  color: var(--primary);
  font-family: var(--font-mono);
}

/* RAPID ACTION STRIP */
.hero-quick-actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.btn-hero-start {
  padding: 0.75rem 1.4rem;
  font-weight: 700;
  font-size: 0.92rem;
  box-shadow: 0 4px 14px rgba(194, 65, 12, 0.25);
}

.btn-hero-drill {
  padding: 0.75rem 1.15rem;
  font-weight: 700;
  font-size: 0.92rem;
}

.hero-guarantee-tag {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-left: auto;
}

/* INSTANT COGNITIVE CHALLENGE WIDGET */
.home-quick-challenge-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-md);
  padding: 1.5rem 1.75rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.challenge-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.challenge-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 800;
  font-size: 0.85rem;
  color: var(--primary);
}

.challenge-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
}

.challenge-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.challenge-stimulus {
  flex: 1;
  min-width: 250px;
}

.challenge-math-box {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.math-eq {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
  background: var(--bg-main);
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  display: inline-block;
  width: fit-content;
}

.math-prompt {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.challenge-options {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.btn-challenge-opt {
  min-width: 48px;
  height: 42px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-main);
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-challenge-opt:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary-dark);
  transform: translateY(-2px);
}

.challenge-feedback {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.5;
  animation: fadeIn 0.2s ease;
}

.challenge-feedback.success {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
}

.challenge-feedback.wrong {
  background: #fff1f2;
  border: 1px solid #fecdd3;
  color: #9f1239;
}

/* BIG ARCHITECTURAL DATE CARD: 26 SEPTEMBER */
.exam-date-card {
  background: var(--bg-card);
  border: 2px solid var(--primary);
  border-radius: var(--radius-md);
  padding: 2rem 1.75rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 10px 25px -5px rgba(194, 65, 12, 0.12);
  position: relative;
  overflow: hidden;
}

.exam-date-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(90deg, #c2410c, #ea580c);
}

.date-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}

.date-card-badge {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--primary);
  background: var(--primary-light);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
}

.date-status-pill {
  font-size: 0.78rem;
  font-weight: 700;
  color: #15803d;
}

.date-big-display {
  display: flex;
  align-items: baseline;
  gap: 1.25rem;
  margin: 0.5rem 0 1.25rem 0;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.date-day-num {
  font-size: 5rem;
  font-weight: 900;
  line-height: 1;
  color: var(--text-main);
  font-family: var(--font-sans);
  letter-spacing: -2px;
}

.date-month-year {
  display: flex;
  flex-direction: column;
}

.date-month-name {
  font-size: 1.45rem;
  font-weight: 900;
  letter-spacing: 1px;
  color: var(--primary);
  line-height: 1.1;
}

.date-year-num {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.date-card-details {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-bottom: 1.5rem;
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
}

.date-detail-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
}

.detail-label {
  color: var(--text-muted);
  font-weight: 600;
}

.detail-value {
  color: var(--text-main);
  font-weight: 700;
}

.date-cta-btn {
  width: 100%;
  padding: 0.85rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.2px;
}

/* =======================================
   REAL-TIME 4-PARAMETER COUNTDOWN TIMER
   ======================================= */
.home-countdown-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.75rem 2rem;
  margin-bottom: 2.25rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
}

.countdown-heading-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.countdown-title-group {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.countdown-icon {
  font-size: 1.75rem;
}

.countdown-title-group h3 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
}

.countdown-title-group p {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.countdown-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  background: #ecfdf5;
  color: #15803d;
  border: 1px solid #bbf7d0;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full);
}

[data-theme="dark"] .countdown-live-badge {
  background: #064e3b;
  color: #86efac;
  border-color: #047857;
}

.pulse-dot-green {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.3);
}

.countdown-tiles-grid {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.countdown-tile {
  background: var(--bg-main);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  min-width: 140px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
  transition: transform 0.2s, border-color 0.2s;
}

.countdown-tile:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

.countdown-tile-sec {
  border-color: rgba(194, 65, 12, 0.35);
  background: linear-gradient(180deg, var(--bg-main), var(--bg-card));
}

.count-num {
  font-size: 3.2rem;
  font-weight: 900;
  font-family: var(--font-mono);
  color: var(--text-main);
  line-height: 1;
}

.countdown-tile-sec .count-num {
  color: var(--primary);
}

.count-lbl {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  margin-top: 0.65rem;
}

.countdown-tile-sep {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--border-strong);
  font-family: var(--font-mono);
  margin-top: -1rem;
}

@media (max-width: 680px) {
  .countdown-tile-sep {
    display: none;
  }
  .countdown-tile {
    min-width: calc(50% - 0.75rem);
    padding: 1rem;
  }
  .count-num {
    font-size: 2.4rem;
  }
}

/* =======================================
   HOME MODULE PORTAL GATEWAY
   ======================================= */
.home-modules-section {
  margin-top: 2rem;
}

.section-title-row {
  margin-bottom: 1.25rem;
}

.section-title-row h2 {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.4px;
}

.section-title-row p {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.portal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}

.portal-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.portal-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
}

.portal-sim::before { background: linear-gradient(90deg, #c2410c, #ea580c); }
.portal-fig::before { background: linear-gradient(90deg, #0ea5e9, #3b82f6); }
.portal-eq::before { background: linear-gradient(90deg, #10b981, #059669); }
.portal-latin::before { background: linear-gradient(90deg, #f59e0b, #d97706); }
.portal-mental::before { background: linear-gradient(90deg, #d97706, #b45309); }
.portal-guide::before { background: linear-gradient(90deg, #64748b, #475569); }

.portal-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.08);
}

.portal-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.85rem;
}

.portal-icon {
  font-size: 1.6rem;
}

.portal-card h3 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 0.4rem;
}

.portal-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 1.25rem;
  flex: 1;
}

.portal-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  padding: 0.5rem 0.75rem;
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
}

.portal-action-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary);
}

.portal-action-row .arrow {
  transition: transform 0.2s ease;
}

.portal-card:hover .portal-action-row .arrow {
  transform: translateX(4px);
}

/* =======================================
   ATTEMPT HISTORY & PROGRESS TRACKING TABLES
   ======================================= */
.attempt-history-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-top: 2rem;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.03);
}

.history-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.history-card-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
}

.history-card-subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.history-table-wrapper {
  overflow-x: auto;
}

.history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  text-align: left;
}

.history-table th {
  padding: 0.75rem 1rem;
  background: var(--bg-main);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid var(--border);
}

.history-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-main);
  vertical-align: middle;
}

.history-table tbody tr:hover {
  background: var(--bg-main);
}

.badge-pass {
  background: #ecfdf5;
  color: #15803d;
  border: 1px solid #bbf7d0;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
  display: inline-block;
}

.badge-review {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
  display: inline-block;
}

[data-theme="dark"] .badge-pass {
  background: #064e3b;
  color: #86efac;
  border-color: #047857;
}

[data-theme="dark"] .badge-review {
  background: #451a03;
  color: #fcd34d;
  border-color: #78350f;
}

.empty-history-cell {
  text-align: center;
  padding: 2.5rem 1rem !important;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* =======================================
   AESTHETIC SCOREBOARD & TOPIC CARDS
   ======================================= */
.scoreboard-container,
.topic-scoreboard {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2.25rem;
  position: relative;
  z-index: 1;
}

.topic-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.35rem 1.4rem;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}
.topic-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  transition: height 0.2s ease;
}
.topic-card-sim::before { background: linear-gradient(90deg, #c2410c, #ea580c); }
.topic-card-figures::before { background: linear-gradient(90deg, #0ea5e9, #3b82f6); }
.topic-card-equations::before { background: linear-gradient(90deg, #10b981, #059669); }
.topic-card-latin::before { background: linear-gradient(90deg, #f59e0b, #d97706); }

.topic-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.09);
  border-color: var(--primary);
}
.topic-card:hover::before {
  height: 6px;
}

.topic-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.topic-title-group {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}
.topic-icon-badge {
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: var(--bg-main);
  border: 1px solid var(--border);
}
.topic-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-main);
}

.badge-score {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  background: var(--bg-main);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.badge-score.has-score {
  background: #ecfdf5;
  color: #15803d;
  border-color: #a7f3d0;
}
[data-theme="dark"] .badge-score.has-score {
  background: #064e3b;
  color: #86efac;
  border-color: #047857;
}

.topic-score-row {
  display: flex;
  align-items: baseline;
  gap: 0.65rem;
}
.topic-score-val {
  font-size: 2.2rem;
  font-weight: 800;
  font-family: var(--font-mono);
  line-height: 1;
}
.topic-card-sim .topic-score-val { color: var(--primary); }
.topic-card-figures .topic-score-val { color: #0ea5e9; }
.topic-card-equations .topic-score-val { color: #10b981; }
.topic-card-latin .topic-score-val { color: #f59e0b; }

.topic-score-lbl {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
}

.progress-bar-bg {
  width: 100%;
  height: 8px;
  background: var(--bg-main);
  border-radius: var(--radius-full);
  overflow: hidden;
  border: 1px solid var(--border);
}
.progress-bar-fill {
  height: 100%;
  transition: width 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.progress-fill-sim { background: linear-gradient(90deg, #c2410c, #ea580c); }
.progress-fill-figures { background: linear-gradient(90deg, #0ea5e9, #3b82f6); }
.progress-fill-equations { background: linear-gradient(90deg, #10b981, #059669); }
.progress-fill-latin { background: linear-gradient(90deg, #f59e0b, #d97706); }

.topic-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-top: 0.25rem;
}
.card-quick-arrow {
  color: var(--primary);
  font-weight: 700;
  transition: transform 0.2s ease;
}
.topic-card:hover .card-quick-arrow {
  transform: translateX(4px);
}

/* =======================================
   SIMULATOR INTRO & MILESTONES
   ======================================= */
.sim-intro-card {
  border-top: 3px solid var(--primary);
}
.sim-milestones-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  margin: 1.5rem 0;
}
.sim-milestone-card {
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem 1.25rem;
  position: relative;
  transition: all 0.2s ease;
}
.sim-milestone-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}
.milestone-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
  text-transform: uppercase;
}
.milestone-icon {
  font-size: 1.8rem;
  margin-bottom: 0.6rem;
}
.sim-milestone-card h4 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.2rem;
  color: var(--text-main);
}
.sim-milestone-card p {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.5rem;
}
.milestone-detail {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.sim-regulations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0 2rem 0;
}
.regulation-item {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
}
.reg-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
}
.regulation-item strong {
  display: block;
  font-size: 0.9rem;
  color: var(--text-main);
  margin-bottom: 0.25rem;
}
.regulation-item p {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.45;
}
.sim-launch-bar {
  text-align: center;
  padding: 0.5rem 0 1rem 0;
}
#start-mock-btn.btn-lg {
  padding: 1rem 2.5rem;
  font-size: 1.05rem;
  font-weight: 800;
  border-radius: var(--radius-sm);
  box-shadow: 0 6px 20px rgba(194, 65, 12, 0.3);
}

/* Question Palette */
.q-palette {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  max-height: 140px;
  overflow-y: auto;
  padding: 0.5rem;
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
}

.palette-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card);
  cursor: pointer;
  color: var(--text-muted);
}

.palette-btn.active {
  border-color: var(--primary);
  color: var(--primary);
  font-weight: 800;
}

.palette-btn.answered {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* Section Mock Mode Banner */
.mock-mode-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--primary-light);
  color: var(--primary-dark);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.25rem;
  font-weight: 600;
  flex-wrap: wrap;
  gap: 0.5rem;
}

[data-theme="dark"] .mock-mode-banner {
  color: #e9d5ff;
}

/* Wrong Answers Review */
.review-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 1.5rem 0 1rem 0;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.review-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-sm);
}

.review-card.is-wrong {
  border-left: 5px solid var(--danger);
}

.review-card.is-correct {
  border-left: 5px solid var(--success);
}

.ans-comparison {
  display: flex;
  gap: 1.5rem;
  margin: 0.75rem 0;
  flex-wrap: wrap;
  font-size: 0.95rem;
}

.ans-user {
  color: var(--danger);
  font-weight: 700;
  background: var(--danger-bg);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
}

.ans-solution {
  color: var(--success);
  font-weight: 700;
  background: var(--success-bg);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
}

.solution-details-box {
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  font-size: 0.9rem;
  line-height: 1.6;
  margin-top: 0.75rem;
}

/* =======================================
   MOCK TEST SELECTION HUB (SETS 1 - 4)
   ======================================= */
.mock-hub-header {
  margin-bottom: 1.5rem;
}

.mock-hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
  margin: 1.5rem 0;
}

.mock-hub-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.mock-hub-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
}

.mock-hub-card:nth-child(1)::before {
  background: linear-gradient(90deg, #0284c7, #6366f1);
}

.mock-hub-card:nth-child(2)::before {
  background: linear-gradient(90deg, #10b981, #06b6d4);
}

.mock-hub-card:nth-child(3)::before {
  background: linear-gradient(90deg, #f59e0b, #ea580c);
}

.mock-hub-card:nth-child(4)::before {
  background: linear-gradient(90deg, #c2410c, #ea580c);
}

.mock-hub-card:hover {
  border-color: var(--primary);
  transform: translateY(-4px);
  box-shadow: 0 12px 24px -4px rgba(15, 23, 42, 0.08), 0 4px 8px -2px rgba(15, 23, 42, 0.04);
}

.mock-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mock-set-tag {
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--primary);
}

.mock-card-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-top: 0.25rem;
  color: var(--text-main);
}

.mock-card-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-top: 0.4rem;
}

.mock-tier-breakdown {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.6rem;
}

.mock-tier-breakdown span {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
  background: var(--bg-main);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.mock-card-stats {
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 600;
}

.mock-card-action {
  margin-top: 0.5rem;
}

/* =======================================
   DIFFICULTY TIER BADGES
   ======================================= */
.badge-foundational { background: #e0f2fe; color: #0369a1; }
.badge-intermediate  { background: #fef9c3; color: #854d0e; }
.badge-tough         { background: #fee2e2; color: #b91c1c; }
.badge-expert        { background: #581c87; color: #f3e8ff; }

/* =======================================
   FULLSCREEN TEST OVERLAY
   ======================================= */
.test-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: var(--bg-main);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.test-overlay.active {
  display: flex !important;
}

.palette-btn.active.answered {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

/* =======================================
   FULLSCREEN TEST OVERLAY (PROFESSIONAL CBT INTERFACE)
   ======================================= */
.test-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: var(--bg-main);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.test-overlay.active {
  display: flex !important;
}

/* TOP BAR */
.test-overlay-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 1.25rem;
  background: var(--bg-card);
  border-bottom: 2px solid var(--primary);
  flex-shrink: 0;
}

.test-topbar-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  min-width: 0;
}

.test-topbar-center {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.test-topbar-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.test-section-label {
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--primary);
  white-space: nowrap;
}

.test-progress-pill {
  background: var(--primary-light);
  color: var(--primary-dark);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  white-space: nowrap;
}

.test-timer-pill {
  background: var(--bg-main);
  border: 2px solid var(--primary);
  color: var(--primary);
  font-weight: 800;
  font-size: 1rem;
  font-family: var(--font-mono);
  padding: 0.25rem 0.85rem;
  border-radius: 999px;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: color 0.3s, border-color 0.3s;
}
.test-timer-pill.urgent {
  color: var(--danger);
  border-color: var(--danger);
  animation: pulse 1s infinite;
}

/* Font Zoom Controls */
.font-zoom-controls {
  display: flex;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.btn-zoom {
  background: var(--bg-card);
  border: none;
  padding: 0.25rem 0.55rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
}
.btn-zoom:hover {
  background: var(--bg-main);
  color: var(--text);
}
.btn-zoom:first-child {
  border-right: 1px solid var(--border);
}

/* WORKSPACE LAYOUT (SPLIT SIDEBAR + STAGE) */
.test-workspace-layout {
  display: flex;
  flex: 1;
  height: calc(100vh - 58px);
  overflow: hidden;
}

/* SIDEBAR DRAWER */
.test-sidebar-drawer {
  width: 270px;
  min-width: 270px;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 1.2rem 1rem;
  overflow-y: auto;
  flex-shrink: 0;
}

.palette-drawer-top {
  margin-bottom: 0.75rem;
}

.drawer-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.6rem;
}
.drawer-title-row h4 {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text);
}
#palette-count-summary {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
}

.palette-status-stats {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
  font-size: 0.8rem;
}

.stat-pill {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 600;
  color: var(--text);
}

.dot-answered {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #2563eb;
  display: inline-block;
}
.dot-flagged {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #f59e0b;
  display: inline-block;
}
.dot-unanswered {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #cbd5e1;
  display: inline-block;
}
.dot-current {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 2px solid var(--primary);
  background: #ffffff;
  display: inline-block;
}

/* PALETTE GRID */
.test-palette-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.45rem;
  margin: 0.5rem 0 1rem 0;
}

.palette-btn {
  height: 38px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-main);
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: all 0.15s ease;
}
.palette-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* Palette Statuses */
.palette-btn.answered {
  background: #eff6ff;
  border-color: #3b82f6;
  color: #1d4ed8;
}
.palette-btn.flagged {
  border-color: #f59e0b;
  background: #fffbeb;
  color: #b45309;
}
.palette-btn.flagged::after {
  content: '⚑';
  position: absolute;
  top: 1px;
  right: 3px;
  font-size: 0.65rem;
  color: #d97706;
}
.palette-btn.answered.flagged {
  background: #fdf4ff;
  border-color: #a855f7;
  color: #7e22ce;
}
.palette-btn.current {
  box-shadow: 0 0 0 2px var(--primary);
  border-color: var(--primary);
  font-weight: 900;
  z-index: 2;
}

.palette-drawer-legend {
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

/* MAIN STAGE */
.test-main-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-main);
}

.stage-notice-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 1.5rem;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
}
.exam-caution-pill {
  font-size: 0.8rem;
  font-weight: 600;
  color: #b45309;
}
.autosave-pill {
  font-size: 0.78rem;
  font-weight: 600;
  color: #16a34a;
}

/* CONTENT AREA (SCROLLABLE) */
.test-overlay-content {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem 2.5rem;
}
.test-overlay.zoom-sm .test-overlay-content { font-size: 0.9rem; }
.test-overlay.zoom-md .test-overlay-content { font-size: 1rem; }
.test-overlay.zoom-lg .test-overlay-content { font-size: 1.15rem; }

/* FOOTER NAV BAR */
.test-overlay-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  gap: 1rem;
}

/* PRE-SUBMISSION CONFIRMATION MODAL */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10005;
  animation: fadeIn 0.15s ease-out;
}
.modal-dialog {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  width: 90%;
  max-width: 520px;
  padding: 1.75rem;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.25);
  animation: modalPop 0.2s ease-out;
}
@keyframes modalPop {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-header h3 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text);
}
.modal-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}
.modal-stat-box {
  padding: 1rem 0.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  text-align: center;
}
.modal-stat-num {
  display: block;
  font-size: 1.85rem;
  font-weight: 800;
}
.modal-stat-lbl {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 0.25rem;
}
.answered-box { background: #f0fdf4; border-color: #bbf7d0; color: #15803d; }
.flagged-box { background: #fffbeb; border-color: #fde68a; color: #b45309; }
.unans-box { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }

@media (max-width: 768px) {
  .test-workspace-layout {
    flex-direction: column;
  }
  .test-sidebar-drawer {
    width: 100%;
    min-width: 100%;
    max-height: 180px;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .test-overlay-content {
    padding: 1rem;
  }
}

/* Difficulty progress bar in test view */
.difficulty-progress-strip {
  display: flex;
  gap: 0.25rem;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}
.diff-segment {
  height: 6px;
  border-radius: 3px;
}
.diff-seg-foundational { background: #0ea5e9; flex: 4; }
.diff-seg-intermediate  { background: #f59e0b; flex: 5; }
.diff-seg-tough         { background: #ef4444; flex: 8; }
.diff-seg-expert        { background: #c2410c; flex: 8; }

/* Dark Mode Overrides for Figure Matrices & Cards */
[data-theme="dark"] .figure-matrix-svg rect:first-child {
  fill: #1c1917;
  stroke: #44403c;
}

[data-theme="dark"] .figure-matrix-svg line {
  stroke: #292524;
}

[data-theme="dark"] .matrix-step-card {
  background: #1c1917;
  border-color: #292524;
}

[data-theme="dark"] .figure-choice-card {
  background: #1c1917;
  border-color: #292524;
}

[data-theme="dark"] .figure-choice-card:hover {
  border-color: var(--primary);
}

[data-theme="dark"] .figure-choice-card.selected {
  background: #431407;
  border-color: var(--primary);
}

/* =======================================
   SEO BLOG & STRATEGY GUIDES STYLING
   ======================================= */
.blog-view-container {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.blog-hero-banner {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 2.25rem;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.blog-hero-banner::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}

.blog-hero-title {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.5px;
  margin-bottom: 0.5rem;
}

.blog-hero-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  max-width: 820px;
  line-height: 1.6;
}

.blog-articles-grid {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.blog-post-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.25s ease;
}

.blog-post-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.blog-post-header {
  margin-bottom: 1.25rem;
}

.blog-badge-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.blog-category-badge {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--primary);
  background: var(--primary-light);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
}

.blog-read-time {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
}

.blog-post-title {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.3;
  margin-bottom: 0.75rem;
  letter-spacing: -0.3px;
}

.blog-post-content {
  font-size: 0.92rem;
  line-height: 1.7;
  color: var(--text-main);
}

.blog-post-content p {
  margin-bottom: 1rem;
}

.blog-post-content h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 1.25rem 0 0.5rem 0;
}

.blog-post-content ul,
.blog-post-content ol {
  margin-left: 1.5rem;
  margin-bottom: 1.25rem;
}

.blog-post-content li {
  margin-bottom: 0.4rem;
}

.blog-highlight-box {
  background: var(--bg-main);
  border-left: 4px solid var(--primary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 1rem 1.25rem;
  margin: 1.25rem 0;
  font-size: 0.88rem;
}

.blog-highlight-box strong {
  color: var(--primary);
}

.blog-action-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  border: 1px solid rgba(194, 65, 12, 0.2);
  cursor: pointer;
  margin-top: 0.75rem;
  transition: all 0.2s ease;
}

.blog-action-cta:hover {
  background: var(--primary);
  color: white;
}

/* FAQ SECTION */
.seo-faq-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 2rem;
  margin-top: 1rem;
  box-shadow: var(--shadow-sm);
}

.seo-faq-card h2 {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1.5rem;
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-main);
  overflow: hidden;
}

.faq-question {
  padding: 1rem 1.25rem;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
}

.faq-answer {
  padding: 0 1.25rem 1rem 1.25rem;
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text-muted);
}

/* =======================================
   AUTHENTICATION MODAL STYLING
   ======================================= */
.auth-dialog {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 440px;
  overflow: hidden;
  animation: modalScaleIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  margin: auto;
}

@keyframes modalScaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.auth-dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.auth-brand-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--text-main);
}

.auth-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: var(--bg-main);
}

.auth-tab-btn {
  flex: 1;
  padding: 0.85rem;
  background: none;
  border: none;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
}

.auth-tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background: var(--bg-card);
}

.auth-body {
  padding: 1.75rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.75rem;
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-google:hover {
  background: var(--bg-card);
  border-color: #cbd5e1;
  box-shadow: var(--shadow-sm);
}

.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border);
}

.auth-divider span {
  padding: 0 0.75rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.form-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-main);
}

.form-input {
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-main);
  color: var(--text-main);
  font-size: 0.92rem;
  outline: none;
  transition: border-color 0.2s ease;
}

.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(194, 65, 12, 0.15);
}

.btn-auth-submit {
  width: 100%;
  padding: 0.8rem;
  font-size: 0.95rem;
  font-weight: 800;
  margin-top: 0.5rem;
}

.auth-alert {
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.4;
}

.auth-alert.error {
  background: #fff1f2;
  border: 1px solid #fecdd3;
  color: #9f1239;
}

.auth-alert.success {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
}

.auth-footer-note {
  padding: 0.85rem 1.5rem;
  background: var(--bg-main);
  border-top: 1px solid var(--border);
  font-size: 0.76rem;
  color: var(--text-muted);
  line-height: 1.4;
  text-align: center;
}

/* =======================================
   GOOGLE ACCOUNT CHOOSER DIALOG STYLES
   ======================================= */
.google-auth-dialog {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  width: 100%;
  max-width: 420px;
  overflow: hidden;
  animation: modalScaleIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  margin: auto;
}

.google-dialog-header {
  padding: 1.5rem 1.5rem 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.google-dialog-top {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  position: relative;
}

.google-dialog-titles {
  flex: 1;
}

.google-dialog-titles h3 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 0.2rem;
}

.google-dialog-titles p {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.google-accounts-list {
  padding: 0.75rem 1.25rem 1.25rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.google-account-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.google-account-item:hover {
  background: var(--bg-main);
  border-color: var(--border);
  transform: translateY(-1px);
}

.google-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.google-account-info {
  display: flex;
  flex-direction: column;
}

.google-account-info strong {
  font-size: 0.9rem;
  color: var(--text-main);
}

.google-account-info span {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.google-custom-account-row {
  margin-top: 0.75rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.google-custom-account-row label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
}

.google-custom-input-group {
  display: flex;
  gap: 0.5rem;
}

.google-custom-input-group .form-input {
  flex: 1;
  padding: 0.55rem 0.75rem;
  font-size: 0.88rem;
}

.google-dialog-footer {
  padding: 0.85rem 1.5rem;
  background: var(--bg-main);
  border-top: 1px solid var(--border);
  font-size: 0.74rem;
  color: var(--text-muted);
  line-height: 1.4;
  text-align: center;
}

/* =======================================
   FIREBASE INTEGRATION & CONFIG MODAL
   ======================================= */
.firebase-badge-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.75rem;
  margin-bottom: 0.5rem;
}

[data-theme="dark"] .firebase-badge-row {
  background: #271406;
  border-color: #7c2d12;
}

.firebase-live-pill {
  font-size: 0.78rem;
  font-weight: 700;
  color: #c2410c;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.flame-icon {
  font-style: normal;
  font-size: 0.95rem;
}

.btn-firebase-settings {
  background: none;
  border: none;
  color: #c2410c;
  font-size: 0.75rem;
  font-weight: 800;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

.firebase-config-dialog {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  width: 100%;
  max-width: 520px;
  overflow: hidden;
  animation: modalScaleIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  margin: auto;
}

.firebase-dialog-header {
  padding: 1.25rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
}

.firebase-header-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.firebase-header-title h3 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 0.15rem;
}

.firebase-header-title p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.firebase-dialog-body {
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.firebase-status-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--bg-main);
  border: 1px solid var(--border);
}

.status-indicator-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.status-info {
  display: flex;
  flex-direction: column;
}

.status-info strong {
  font-size: 0.85rem;
  color: var(--text-main);
}

.status-info small {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.firebase-instruction-box {
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  font-size: 0.82rem;
  color: var(--text-main);
  line-height: 1.5;
}

.firebase-instruction-box ol {
  margin: 0.5rem 0 0 1.25rem;
}

.firebase-instruction-box a {
  color: var(--primary);
  font-weight: 700;
}

.form-textarea {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-main);
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.4;
  outline: none;
  resize: vertical;
}

.form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(194, 65, 12, 0.15);
}

.firebase-action-row {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

/* =========================================================================
   UNIFIED RESULTS & PERFORMANCE HUB STYLES
   ========================================================================= */
.results-hub-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.results-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 0.25rem 0.65rem;
  background: var(--primary-light);
  color: var(--primary-dark);
  border-radius: var(--radius-full);
  margin-bottom: 0.5rem;
}

.results-title {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text-main);
  margin-bottom: 0.4rem;
}

.results-subtitle {
  font-size: 0.95rem;
  color: var(--text-muted);
  max-width: 680px;
  line-height: 1.5;
}

.results-header-actions {
  display: flex;
  gap: 0.65rem;
  flex-shrink: 0;
}

.results-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 2.25rem;
}

.results-kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.4rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.results-kpi-card:hover {
  transform: translateY(-2px);
  border-color: rgba(194, 65, 12, 0.4);
}

.kpi-label {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 0.4rem;
}

.kpi-value {
  font-size: 1.85rem;
  font-weight: 900;
  letter-spacing: -0.5px;
  color: var(--text-main);
  line-height: 1.2;
}

.kpi-value.highlight {
  color: var(--primary);
}

.kpi-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

.unified-modules-grid {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.unified-module-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.unified-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.85rem;
}

.unified-module-info {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.module-symbol {
  font-size: 1.6rem;
}

.unified-module-info h3 {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 0.15rem;
}

.unified-module-info p {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.unified-empty-state {
  text-align: center;
  padding: 2.25rem 1.5rem;
  background: var(--bg-main);
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.empty-icon {
  font-size: 2rem;
  opacity: 0.6;
}

.unified-empty-state p {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.badge-solid {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
}

[data-theme="dark"] .badge-solid {
  background: #451a03;
  color: #fcd34d;
  border-color: #78350f;
}

.dropdown-item-highlight {
  background: var(--primary-light);
  color: var(--primary-dark) !important;
  font-weight: 800 !important;
}

.dropdown-item-highlight:hover {
  background: var(--primary) !important;
  color: white !important;
}

