/* MasterExam CBT & Study Suite - High Performance Modern Styling */
/* DEFAULT THEME: DARK MODE (Priority 2) */
:root,
[data-theme="dark"] {
  --primary: #3b82f6;
  --primary-hover: #60a5fa;
  --primary-light: #1e293b;
  --primary-border: #3b82f6;
  
  --success: #22c55e;
  --success-light: #052e16;
  --success-border: #166534;
  
  --danger: #ef4444;
  --danger-light: #450a0a;
  --danger-border: #991b1b;
  
  --warning: #f59e0b;
  --warning-light: #451a03;
  --warning-border: #92400e;

  --purple: #a855f7;
  --purple-light: #3b0764;
  --purple-border: #7e22ce;

  --bg-page: #0b0f19;
  --bg-card: #151d2e;
  --bg-subtle: #1e293b;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --border: #334155;
  --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.4);
  --shadow-lg: 0 10px 20px -3px rgb(0 0 0 / 0.5);
  --font-base: 16px;
  --radius: 10px;
}

/* LIGHT THEME (User Toggleable) */
[data-theme="light"] {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --primary-border: #bfdbfe;
  
  --success: #16a34a;
  --success-light: #f0fdf4;
  --success-border: #bbf7d0;
  
  --danger: #dc2626;
  --danger-light: #fef2f2;
  --danger-border: #fecaca;
  
  --warning: #d97706;
  --warning-light: #fffbeb;
  --warning-border: #fde68a;
  
  --purple: #9333ea;
  --purple-light: #faf5ff;
  --purple-border: #e9d5ff;

  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --bg-subtle: #f1f5f9;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.08), 0 2px 4px -2px rgb(0 0 0 / 0.06);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.07);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg-page);
  color: var(--text-main);
  font-size: var(--font-base);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color 0.2s ease, color 0.2s ease;
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
  padding-bottom: env(safe-area-inset-bottom);
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-page);
}
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Header & Nav */
header.app-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.05);
}

.header-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-main);
  cursor: pointer;
}

.brand-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  font-size: 1.25rem;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.brand-title {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.nav-btn {
  background: transparent;
  border: 1px solid transparent;
  padding: 0.45rem 0.75rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.15s ease;
}

.nav-btn:hover {
  background: var(--bg-subtle);
  color: var(--text-main);
}

.nav-btn.active {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary-border);
  font-weight: 600;
}

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

.icon-btn {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  color: var(--text-main);
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.95rem;
  transition: all 0.15s ease;
}

.icon-btn:hover {
  background: var(--border);
  transform: translateY(-1px);
}

/* MAIN SUBJECT CARDS (LANDING SELECTION) */
.subject-selection-hero {
  text-align: center;
  margin: 1.5rem auto 2.5rem auto;
  max-width: 900px;
}

.subject-selection-hero h1 {
  font-size: 2.25rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.subject-selection-hero p {
  color: var(--text-muted);
  font-size: 1.1rem;
}

.subject-cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  max-width: 1360px;
  margin: 0 auto 3rem auto;
}

@media (max-width: 1200px) {
  .subject-cards-grid {
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
  }
}

@media (max-width: 768px) {
  .subject-cards-grid {
    grid-template-columns: 1fr;
  }
}

.subject-main-card {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: 18px;
  padding: 2.5rem 2rem;
  text-align: center;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.subject-main-card:hover {
  transform: translateY(-6px);
  border-color: var(--primary);
  box-shadow: 0 15px 30px -5px rgba(37, 99, 235, 0.25);
}

.subject-card-icon {
  font-size: 4rem;
  line-height: 1;
  margin-bottom: 1.25rem;
  display: inline-block;
  transition: transform 0.2s ease;
}

.subject-main-card:hover .subject-card-icon {
  transform: scale(1.1);
}

.subject-card-title {
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: 0.6rem;
  color: var(--text-main);
}

.subject-card-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.subject-card-features {
  display: flex;
  justify-content: center;
  gap: 0.6rem;
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
}

.subject-open-btn {
  width: 100%;
  padding: 0.85rem 1.5rem;
  font-size: 1.05rem;
  font-weight: 700;
}

.back-to-subjects-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.group-switcher-pills {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.35rem;
  display: flex;
  gap: 0.35rem;
  box-shadow: var(--shadow);
}

.group-pill-btn {
  border: none;
  background: transparent;
  padding: 0.55rem 1.25rem;
  border-radius: 8px;
  font-size: 0.925rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.group-pill-btn:hover {
  color: var(--text-main);
  background: var(--bg-subtle);
}

.group-pill-btn.active {
  background: var(--primary);
  color: white;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
}

.pill-count-badge {
  font-size: 0.75rem;
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.2);
  color: inherit;
}
.group-pill-btn:not(.active) .pill-count-badge {
  background: var(--bg-subtle);
  color: var(--text-muted);
}

/* Main Container */
main.app-main {
  flex: 1;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 1.25rem 1.25rem;
}

.view-section {
  display: none;
}
.view-section.active {
  display: block;
  animation: fadeIn 0.2s ease-in-out;
}

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

/* Dashboard Styles */
.dashboard-hero {
  background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 50%, #3b82f6 100%);
  color: white;
  padding: 2.25rem 2rem;
  border-radius: 16px;
  margin-bottom: 2rem;
  box-shadow: 0 10px 25px -5px rgba(30, 58, 138, 0.25);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.hero-content h1 {
  font-size: 1.9rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 0.5rem;
}

.hero-content p {
  font-size: 1rem;
  opacity: 0.9;
  max-width: 650px;
}

.hero-stats {
  display: flex;
  gap: 1.25rem;
}

.hero-stat-card {
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
  padding: 0.85rem 1.25rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  text-align: center;
}

.hero-stat-value {
  font-size: 1.75rem;
  font-weight: 800;
}

.hero-stat-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.85;
}

/* Cards Grid */
.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.action-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow);
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.action-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}

.card-header-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  margin-bottom: 1rem;
}

.icon-blue { background: #dbeafe; color: #1d4ed8; }
.icon-purple { background: #f3e8ff; color: #7e22ce; }
.icon-green { background: #dcfce7; color: #15803d; }
.icon-amber { background: #fef3c7; color: #b45309; }
.icon-indigo { background: #e0e7ff; color: #4338ca; }

.action-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.action-card p {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: 1.25rem;
  flex-grow: 1;
}

.badge-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 9999px;
  background: var(--bg-subtle);
  color: var(--text-muted);
}
.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-success { background: var(--success-light); color: var(--success); }
.badge-purple { background: var(--purple-light); color: var(--purple); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  font-size: 0.925rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  text-decoration: none;
}

.btn-sm {
  padding: 0.4rem 0.75rem;
  font-size: 0.825rem;
}

.btn-lg {
  padding: 0.85rem 1.75rem;
  font-size: 1.05rem;
}

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.25);
}
.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 4px 8px rgba(37, 99, 235, 0.35);
}

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

.btn-success {
  background: var(--success);
  color: white;
}
.btn-success:hover { filter: brightness(0.92); }

.btn-danger {
  background: var(--danger);
  color: white;
}
.btn-danger:hover { filter: brightness(0.92); }

.btn-purple {
  background: var(--purple);
  color: white;
}
.btn-purple:hover { filter: brightness(0.92); }

.btn-outline-primary {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}
.btn-outline-primary:hover { background: var(--primary-light); }

/* Upload Section */
.upload-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: var(--shadow);
  margin-bottom: 2rem;
}

.section-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-desc {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
}

.dropzone {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 2.5rem 1.5rem;
  text-align: center;
  cursor: pointer;
  background: var(--bg-subtle);
  transition: all 0.2s ease;
  position: relative;
}

.dropzone:hover, .dropzone.dragover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.dropzone-icon {
  font-size: 2.5rem;
  color: var(--primary);
  margin-bottom: 0.75rem;
}

.dropzone-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.dropzone-subtitle {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.file-input-hidden {
  display: none;
}

.upload-actions-row {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(3px);
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  width: 100%;
  max-width: 650px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
}

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

.modal-header h3 {
  font-size: 1.2rem;
  font-weight: 700;
}

.modal-close-btn {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-muted);
  line-height: 1;
}

.modal-body {
  padding: 1.5rem;
  flex: 1;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  background: var(--bg-subtle);
  border-bottom-left-radius: 14px;
  border-bottom-right-radius: 14px;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--text-main);
}

input, select, textarea, .form-control {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-main);
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input[type="checkbox"], input[type="radio"] {
  width: auto;
  accent-color: var(--primary);
  cursor: pointer;
}

input:focus, select:focus, textarea:focus, .form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

textarea.form-control, textarea {
  min-height: 140px;
  resize: vertical;
}

/* CBT EXAM INTERFACE */
.exam-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 950px) {
  .exam-layout {
    grid-template-columns: 1fr;
  }
}

.exam-main-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  min-height: 580px;
}

.exam-panel-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  background: var(--bg-subtle);
  border-top-left-radius: var(--radius);
  border-top-right-radius: var(--radius);
}

.q-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.q-num-pill {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
}

.q-marks-pill {
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
}

.exam-question-body {
  padding: 1.75rem 1.5rem;
  flex: 1;
}

.question-text {
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.6;
  margin-bottom: 1.75rem;
  color: var(--text-main);
}

/* Bilingual Question & Options Styling */
.bilingual-q-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.q-lang-en {
  font-size: 1.08rem;
  font-weight: 600;
  color: #f8fafc;
  line-height: 1.55;
  letter-spacing: -0.01em;
}

.q-lang-hi {
  font-size: 1.05rem;
  font-weight: 500;
  color: #93c5fd;
  line-height: 1.55;
  padding-top: 0.4rem;
  border-top: 1px dashed rgba(148, 163, 184, 0.25);
}

.bilingual-opt-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  width: 100%;
}

.opt-lang-en {
  font-size: 0.98rem;
  font-weight: 500;
  color: var(--text-main);
  line-height: 1.4;
}

.opt-lang-hi {
  font-size: 0.92rem;
  font-weight: 400;
  color: #bfdbfe;
  line-height: 1.4;
}

.options-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.option-item {
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 0.9rem 1.15rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  cursor: pointer;
  background: var(--bg-card);
  transition: all 0.15s ease;
  user-select: none;
}

.option-item:hover {
  border-color: var(--primary);
  background: var(--bg-subtle);
  transform: translateX(2px);
}

.option-item.selected {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: 0 0 0 1px var(--primary);
}

.option-indicator {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
  background: var(--bg-card);
  color: var(--text-muted);
  transition: all 0.15s ease;
}

.option-item.selected .option-indicator {
  border-color: var(--primary);
  background: var(--primary);
  color: white;
}

.option-text {
  font-size: 1rem;
  line-height: 1.45;
  color: var(--text-main);
  flex: 1;
}

.exam-action-bar {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  background: var(--bg-subtle);
  border-bottom-left-radius: var(--radius);
  border-bottom-right-radius: var(--radius);
}

.exam-action-bar .left-actions,
.exam-action-bar .right-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

/* Question Palette Sidebar */
.exam-sidebar {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 75px;
}

.timer-box {
  background: linear-gradient(135deg, #1e293b, #0f172a);
  color: white;
  padding: 1rem 1.25rem;
  border-top-left-radius: var(--radius);
  border-top-right-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.timer-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.8;
}

.timer-display {
  font-size: 1.75rem;
  font-weight: 800;
  font-family: monospace;
  letter-spacing: 0.05em;
}

.timer-warning {
  color: #fbbf24 !important;
}

.timer-danger {
  color: #f87171 !important;
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.status-legend {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  font-size: 0.78rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.legend-dot {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  flex-shrink: 0;
}

.status-answered { background: var(--success); color: white; }
.status-not-answered { background: var(--danger); color: white; }
.status-not-visited { background: var(--bg-subtle); color: var(--text-muted); border: 1px solid var(--border); }
.status-marked { background: var(--purple); color: white; }
.status-marked-answered { background: var(--purple); color: white; position: relative; }
.status-marked-answered::after {
  content: "";
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
}

.palette-container {
  padding: 1rem;
  max-height: 380px;
  overflow-y: auto;
}

.palette-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.5rem;
}

.palette-btn {
  aspect-ratio: 1;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  border: none;
  cursor: pointer;
  transition: all 0.1s ease;
}

.palette-btn:hover {
  filter: brightness(0.9);
  transform: scale(1.05);
}

.palette-btn.current {
  box-shadow: 0 0 0 2px var(--text-main), 0 0 0 4px var(--primary);
  font-weight: 900;
}

.palette-btn.palette-locked {
  background: rgba(30, 41, 59, 0.65) !important;
  color: var(--text-muted) !important;
  border: 1px dashed rgba(148, 163, 184, 0.45) !important;
  position: relative;
  cursor: pointer;
}

.palette-btn.palette-locked:hover {
  filter: brightness(1.2);
  border-color: #fbbf24 !important;
  transform: scale(1.08);
}

.palette-btn.palette-locked .pal-lock-badge {
  position: absolute;
  top: 1px;
  right: 2px;
  font-size: 0.62rem;
  line-height: 1;
}

.palette-btn.palette-premium-locked {
  background: rgba(45, 30, 15, 0.75) !important;
  color: #fbbf24 !important;
  border: 1px dashed rgba(245, 158, 11, 0.6) !important;
  position: relative;
  cursor: pointer;
}

.palette-btn.palette-premium-locked:hover {
  filter: brightness(1.25);
  border-color: #f59e0b !important;
  transform: scale(1.08);
}

.palette-btn.palette-premium-locked .pal-lock-badge {
  position: absolute;
  top: 1px;
  right: 2px;
  font-size: 0.62rem;
  line-height: 1;
}

/* Secure Diagram & Image Overlay System */
.premium-diagram-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  margin: 1.5rem 0;
}

.secure-image-container {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  margin-top: 0.75rem;
  background: #0f172a;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 220px;
}

.secure-premium-img {
  width: 100%;
  max-height: 380px;
  object-fit: contain;
  border-radius: 8px;
  display: block;
}

.secure-img-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(6px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  cursor: pointer;
  text-align: center;
  padding: 1rem;
  transition: all 0.2s ease;
}

.secure-img-overlay:hover {
  background: rgba(15, 23, 42, 0.94);
}

.secure-img-overlay .lock-icon {
  font-size: 2.2rem;
}

.secure-img-overlay .lock-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: #f59e0b;
}

.secure-img-overlay .lock-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.auth-prompt-banner {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(245, 158, 11, 0.15));
  border: 1px solid rgba(245, 158, 11, 0.5);
  border-radius: 8px;
  padding: 0.85rem 1rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  animation: fadeInBanner 0.25s ease-out;
}

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

.auth-prompt-banner .auth-prompt-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
  line-height: 1.2;
}

.auth-prompt-banner .auth-prompt-text {
  flex: 1;
  color: #fef08a;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.45;
}

.palette-footer {
  padding: 1rem;
  border-top: 1px solid var(--border);
}

/* Practice Mode specifics */
.practice-feedback {
  margin-top: 1.5rem;
  padding: 1.25rem;
  border-radius: 10px;
  animation: fadeIn 0.2s ease;
}

.feedback-correct {
  background: var(--success-light);
  border: 1px solid var(--success-border);
  color: var(--success);
}

.feedback-incorrect {
  background: var(--danger-light);
  border: 1px solid var(--danger-border);
  color: var(--danger);
}

.feedback-title {
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.feedback-explanation {
  color: var(--text-main);
  font-size: 0.95rem;
  line-height: 1.5;
}

/* Flashcard Mode */
.flashcard-wrapper {
  max-width: 700px;
  margin: 1.5rem auto;
  perspective: 1000px;
}

.flashcard-card {
  min-height: 320px;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  padding: 2.5rem 2rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.flashcard-card:hover {
  border-color: var(--primary);
}

.flashcard-q {
  font-size: 1.35rem;
  font-weight: 700;
  margin: auto 0;
  line-height: 1.5;
}

.flashcard-a {
  font-size: 1.2rem;
  color: var(--success);
  margin: auto 0;
  line-height: 1.6;
  font-weight: 600;
}

.flashcard-controls {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.5rem;
}

/* Rapid Fire Drill */
.drill-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 1.25rem;
}

.drill-card {
  max-width: 680px;
  margin: 2rem auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.drill-streak {
  font-size: 1.05rem;
  font-weight: 800;
  color: #f59e0b;
}

.drill-timer-container {
  width: 100%;
  height: 6px;
  background: var(--bg-subtle);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 1.25rem;
}

.drill-timer-bar {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #8b5cf6, #ec4899);
  width: 100%;
  transition: width 0.08s linear;
}

.drill-timer-badge {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-weight: 800;
  font-size: 0.95rem;
  color: #60a5fa;
  padding: 0.2rem 0.6rem;
  background: rgba(59, 130, 246, 0.15);
  border-radius: 6px;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.drill-timer-danger {
  color: #ef4444 !important;
  background: rgba(239, 68, 68, 0.15) !important;
  border-color: rgba(239, 68, 68, 0.4) !important;
}

.drill-prompt {
  font-size: 1.35rem;
  font-weight: 800;
  margin-bottom: 1.5rem;
  line-height: 1.4;
  color: var(--text-main);
}

.drill-options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}

.drill-opt-btn {
  padding: 1rem 0.85rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 12px;
  border: 2px solid var(--border);
  background: var(--bg-subtle);
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
  line-height: 1.35;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

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

.drill-opt-btn:disabled {
  cursor: default;
  transform: none;
}

.drill-opt-btn.drill-correct {
  background: var(--success) !important;
  color: white !important;
  border-color: var(--success) !important;
}

.drill-opt-btn.drill-wrong {
  background: var(--danger) !important;
  color: white !important;
  border-color: var(--danger) !important;
}

@media (max-width: 600px) {
  .drill-card {
    padding: 1.25rem 1rem;
    margin: 1rem auto;
  }
  .drill-options-grid {
    grid-template-columns: 1fr;
    gap: 0.6rem;
  }
  .drill-opt-btn {
    padding: 0.85rem 0.75rem;
    font-size: 0.95rem;
  }
  .drill-prompt {
    font-size: 1.15rem;
    margin-bottom: 1.15rem;
  }
}

/* NOTES VIEWER STYLES */
.notes-container {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 900px) {
  .notes-container {
    grid-template-columns: 1fr;
  }
}

.notes-toc-sidebar {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  position: sticky;
  top: 75px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  box-shadow: var(--shadow);
}

.notes-toc-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.notes-toc-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.notes-toc-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  padding: 0.35rem 0.6rem;
  border-radius: 6px;
  display: block;
  transition: all 0.15s ease;
}

.notes-toc-link:hover {
  background: var(--bg-subtle);
  color: var(--primary);
}

.notes-content-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.25rem 2.5rem;
  box-shadow: var(--shadow);
  line-height: 1.7;
}

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

.notes-search-input {
  max-width: 320px;
}

.notes-rendered-body h1 {
  font-size: 1.85rem;
  font-weight: 800;
  margin-top: 1.5rem;
  margin-bottom: 1rem;
  color: var(--primary);
  border-bottom: 2px solid var(--primary-border);
  padding-bottom: 0.4rem;
}

.notes-rendered-body h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-top: 1.75rem;
  margin-bottom: 0.75rem;
  color: var(--text-main);
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.3rem;
}

.notes-rendered-body h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
}

.notes-rendered-body p, .notes-rendered-body ul, .notes-rendered-body ol {
  margin-bottom: 1rem;
}

.notes-rendered-body ul, .notes-rendered-body ol {
  padding-left: 1.5rem;
}

.notes-rendered-body li {
  margin-bottom: 0.35rem;
}

.notes-rendered-body strong {
  color: var(--primary);
  font-weight: 700;
}

.notes-rendered-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.925rem;
}

.notes-rendered-body th, .notes-rendered-body td {
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
}

.notes-rendered-body th {
  background: var(--bg-subtle);
  font-weight: 700;
}

/* Result / Analytics View */
.result-header-banner {
  background: linear-gradient(135deg, #1e3a8a, #2563eb);
  color: white;
  border-radius: 16px;
  padding: 2.5rem 2rem;
  text-align: center;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-lg);
}

.result-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.result-score-big {
  font-size: 4rem;
  font-weight: 900;
  line-height: 1;
  margin: 1rem 0;
  letter-spacing: -0.02em;
}

.result-score-sub {
  font-size: 1.25rem;
  opacity: 0.9;
}

.result-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}

.metric-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.metric-val {
  font-size: 1.75rem;
  font-weight: 800;
}

.metric-val.correct { color: var(--success); }
.metric-val.incorrect { color: var(--danger); }
.metric-val.skipped { color: var(--text-muted); }

.breakdown-bar {
  height: 24px;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  margin-bottom: 2rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
}

.breakdown-correct { background: var(--success); }
.breakdown-incorrect { background: var(--danger); }
.breakdown-skipped { background: var(--border); }

.data-table-container,
.table-responsive {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.data-table th, .data-table td {
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.data-table th {
  background: var(--bg-subtle);
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.data-table tr:last-child td {
  border-bottom: none;
}

.review-filter-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

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

.review-q-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.review-opt-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.review-opt {
  padding: 0.65rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.review-opt.is-correct {
  background: var(--success-light);
  border-color: var(--success-border);
  color: var(--success);
  font-weight: 600;
}

.review-opt.is-user-wrong {
  background: var(--danger-light);
  border-color: var(--danger-border);
  color: var(--danger);
  font-weight: 600;
}

.review-explanation-box {
  background: var(--bg-subtle);
  border-left: 4px solid var(--primary);
  padding: 0.85rem 1rem;
  border-radius: 4px;
  font-size: 0.9rem;
}

@media print {
  header.app-header, .exam-sidebar, .btn, .nav-links, .upload-card, .notes-toc-sidebar, .notes-header-controls, .mobile-bottom-nav, .mobile-nav-drawer {
    display: none !important;
  }
  body, main.app-main {
    background: white !important;
    color: black !important;
    max-width: 100% !important;
    padding: 0 !important;
  }
  .result-header-banner {
    background: #f1f5f9 !important;
    color: black !important;
  }
}

/* ========================================================= */
/* MOBILE NAVIGATION DRAWER & BACKDROP                       */
/* ========================================================= */
.mobile-nav-backdrop,
.palette-drawer-backdrop,
.notes-toc-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.mobile-nav-backdrop.active,
.palette-drawer-backdrop.active,
.notes-toc-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.mobile-nav-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(320px, 86vw);
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  z-index: 1001;
  transform: translateX(-100%);
  visibility: hidden;
  pointer-events: none;
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.28s;
  display: flex;
  flex-direction: column;
  box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.mobile-nav-drawer.active {
  transform: translateX(0);
  visibility: visible;
  pointer-events: auto;
}

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

.drawer-close-btn,
.palette-close-btn,
.toc-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.drawer-close-btn:hover,
.palette-close-btn:hover,
.toc-close-btn:hover {
  color: var(--text-main);
  background: var(--bg-subtle);
}

.drawer-account-box {
  margin: 1rem;
  padding: 0.9rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.drawer-user-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.drawer-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.1rem;
}

.drawer-user-name {
  font-weight: 700;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.drawer-user-status {
  font-size: 0.75rem;
  color: var(--primary);
  font-weight: 600;
}

.drawer-nav {
  padding: 0.5rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
}

.drawer-nav-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  background: transparent;
  border: none;
  color: var(--text-main);
  font-size: 0.95rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  min-height: 46px;
  transition: all 0.15s ease;
  width: 100%;
}

.drawer-nav-item:hover,
.drawer-nav-item.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 700;
}

.drawer-item-icon {
  font-size: 1.15rem;
}

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

.drawer-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border);
  background: var(--bg-subtle);
}

/* Bottom Quick Nav Bar */
.mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  display: none;
  align-items: center;
  justify-content: space-around;
  z-index: 900;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2);
  padding-bottom: env(safe-area-inset-bottom);
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  flex: 1;
  height: 100%;
  transition: color 0.15s ease;
}

.bottom-nav-item:hover,
.bottom-nav-item.active {
  color: var(--primary);
}

.bnav-icon {
  font-size: 1.25rem;
  line-height: 1.2;
}

.bnav-label {
  font-size: 0.7rem;
  font-weight: 600;
  margin-top: 0.1rem;
}

/* Gradient Primary Button */
.btn-primary-gradient {
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: white;
  border: none;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
  transition: all 0.2s ease;
}

.btn-primary-gradient:hover {
  background: linear-gradient(135deg, #1d4ed8, #6d28d9);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.45);
}

/* Password Input Wrapper */
.password-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.password-input-wrapper input {
  padding-right: 2.75rem;
  width: 100%;
}

.btn-toggle-pw {
  position: absolute;
  right: 0.5rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.35rem;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Auth Tabs */
.auth-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.25rem;
}

.auth-tab-btn {
  flex: 1;
  padding: 0.75rem;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 44px;
}

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

/* Premium Modal Styling */
.premium-price-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.15), rgba(124, 58, 237, 0.15));
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
}

.price-left {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.price-strikethrough {
  font-size: 1rem;
  color: var(--text-muted);
  text-decoration: line-through;
}

.price-highlight {
  font-size: 2rem;
  font-weight: 800;
  color: #60a5fa;
  line-height: 1;
}

.price-sub {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
}

.price-badge-pill {
  background: #dc2626;
  color: white;
  padding: 0.3rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 700;
}

.premium-features-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 1.25rem;
}

.premium-feat-item {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: 0.88rem;
  line-height: 1.4;
}

.feat-check {
  color: var(--success);
  font-weight: 800;
  font-size: 1rem;
  flex-shrink: 0;
}

.upi-payment-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.15rem;
}

.upi-box-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
}

.upi-secure-tag {
  font-size: 0.75rem;
  color: var(--success);
  font-weight: 600;
}

.upi-details-row {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.upi-id-badge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 0.85rem;
}

.upi-apps-icons {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.app-pill {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.2rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
}

.qr-code-box {
  display: flex;
  justify-content: center;
  margin: 0.75rem 0;
}

.qr-code-graphic {
  background: var(--bg-card);
  border: 2px dashed var(--primary);
  border-radius: 12px;
  padding: 1rem 1.5rem;
  text-align: center;
  display: inline-block;
}

/* Admin Stats Grid */
.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.admin-stat-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
  text-align: center;
}

.admin-stat-val {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 0.2rem;
}

.admin-stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ========================================================= */
/* RESPONSIVE MEDIA QUERIES                                 */
/* ========================================================= */

.mobile-menu-btn {
  display: none;
}

.mobile-palette-btn {
  display: none;
}

.mobile-toc-btn {
  display: none;
}

.sidebar-mobile-header {
  display: none;
}

.notes-toc-header {
  display: none;
}

.mobile-timer-pill {
  display: none;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-light);
  border: 1px solid var(--primary-border);
  padding: 0.3rem 0.65rem;
  border-radius: 20px;
}

/* Table / Tablet Landscape and below (< 1024px) */
@media (max-width: 1024px) {
  .exam-layout {
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }

  .mobile-palette-btn {
    display: inline-flex !important;
  }

  .mobile-timer-pill {
    display: inline-flex !important;
  }

  .exam-sidebar {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: min(340px, 88vw) !important;
    height: 100vh !important;
    background: var(--bg-card) !important;
    border-left: 1px solid var(--border) !important;
    z-index: 1000 !important;
    transform: translateX(100%);
    visibility: hidden;
    pointer-events: none;
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.28s;
    box-shadow: -8px 0 25px rgba(0, 0, 0, 0.6);
    overflow-y: auto;
    display: flex !important;
    flex-direction: column;
  }

  .exam-sidebar.active {
    transform: translateX(0) !important;
    visibility: visible !important;
    pointer-events: auto !important;
  }

  .sidebar-mobile-header {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border);
  }

  .notes-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }

  .mobile-toc-btn {
    display: inline-flex !important;
  }

  .notes-toc-sidebar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    bottom: 0 !important;
    width: min(320px, 86vw) !important;
    height: 100vh !important;
    background: var(--bg-card) !important;
    border-right: 1px solid var(--border) !important;
    z-index: 1000 !important;
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 8px 0 25px rgba(0, 0, 0, 0.6);
    overflow-y: auto;
  }

  .notes-toc-sidebar.active {
    transform: translateX(0) !important;
  }

  .notes-toc-header {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border);
  }
}

/* Screens <= 900px */
@media (max-width: 900px) {
  .nav-links {
    display: none !important;
  }

  .mobile-menu-btn {
    display: flex !important;
  }

  .header-container {
    padding: 0.6rem 1rem;
  }
}

/* Screens <= 768px (Mobile & Portrait Tablets) */
@media (max-width: 768px) {
  /* Mobile Subject Cards: Remove descriptions & badges for clean, compact view */
  .subject-main-card .subject-card-desc,
  .subject-main-card .subject-card-features {
    display: none !important;
  }

  .subject-main-card {
    padding: 1.5rem 1.25rem;
    gap: 1rem;
  }

  .subject-card-icon {
    font-size: 3rem;
    margin-bottom: 0.6rem;
  }

  .subject-card-title {
    font-size: 1.35rem;
    margin-bottom: 0.75rem;
  }

  body {
    padding-bottom: calc(75px + env(safe-area-inset-bottom)) !important;
  }

  main.app-main {
    padding: 0.35rem 0.4rem calc(15px + env(safe-area-inset-bottom)) 0.4rem !important;
  }

  .mobile-bottom-nav {
    display: flex;
  }

  /* Hide keyboard shortcuts hint on mobile touchscreens */
  #cbt-shortcuts-hint {
    display: none !important;
  }

  .dashboard-hero {
    flex-direction: column;
    padding: 1rem 0.85rem;
    gap: 0.75rem;
  }

  .hero-stats {
    width: 100%;
    justify-content: space-around;
  }

  .exam-main-panel {
    min-height: auto !important;
    margin-bottom: 0.5rem !important;
  }

  .exam-panel-header {
    padding: 0.45rem 0.65rem !important;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
  }

  .q-meta {
    gap: 0.35rem !important;
  }

  .q-num-pill {
    font-size: 0.92rem !important;
  }

  .q-marks-pill {
    font-size: 0.72rem !important;
    padding: 0.15rem 0.45rem !important;
  }

  .header-cbt-tools {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
  }

  .mobile-timer-pill {
    font-size: 0.85rem !important;
    padding: 0.22rem 0.55rem !important;
  }

  .mobile-palette-btn {
    font-size: 0.82rem !important;
    padding: 0.24rem 0.55rem !important;
  }

  .exam-question-body {
    padding: 0.6rem 0.65rem !important;
  }

  .question-text {
    font-size: 1rem !important;
    line-height: 1.4 !important;
    margin-bottom: 0.55rem !important;
  }

  .q-lang-en {
    font-size: 1rem !important;
    line-height: 1.4 !important;
  }

  .q-lang-hi {
    font-size: 0.94rem !important;
    line-height: 1.38 !important;
    padding-top: 0.25rem !important;
    margin-top: 0.25rem !important;
  }

  .options-list {
    gap: 0.35rem !important;
  }

  .option-item {
    padding: 0.5rem 0.65rem !important;
    gap: 0.55rem !important;
    min-height: 42px !important;
    border-radius: 8px !important;
  }

  .option-indicator {
    width: 26px !important;
    height: 26px !important;
    font-size: 0.8rem !important;
  }

  .bilingual-opt-wrapper {
    gap: 0.15rem !important;
  }

  .opt-lang-en {
    font-size: 0.94rem !important;
    line-height: 1.35 !important;
  }

  .opt-lang-hi {
    font-size: 0.88rem !important;
    line-height: 1.3 !important;
  }

  /* CBT Exam Action Controls - 2-Column Responsive Grid */
  #exam-view .exam-action-bar {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 0.45rem !important;
    padding: 0.65rem 0.75rem !important;
  }

  #exam-view .exam-action-bar .left-actions,
  #exam-view .exam-action-bar .right-actions {
    display: contents !important;
  }

  #btn-prev-q {
    grid-column: 1 !important;
    grid-row: 1 !important;
    order: 1 !important;
    min-height: 44px !important;
    font-size: 0.84rem !important;
    padding: 0.5rem 0.35rem !important;
    justify-content: center !important;
  }

  #btn-save-next {
    grid-column: 2 !important;
    grid-row: 1 !important;
    order: 2 !important;
    min-height: 44px !important;
    font-size: 0.88rem !important;
    font-weight: 700 !important;
    padding: 0.5rem 0.35rem !important;
    justify-content: center !important;
  }

  #btn-mark-review {
    grid-column: 1 !important;
    grid-row: 2 !important;
    order: 3 !important;
    min-height: 40px !important;
    font-size: 0.76rem !important;
    padding: 0.4rem 0.25rem !important;
    justify-content: center !important;
  }

  #btn-clear-response {
    grid-column: 2 !important;
    grid-row: 2 !important;
    order: 4 !important;
    min-height: 40px !important;
    font-size: 0.76rem !important;
    padding: 0.4rem 0.25rem !important;
    justify-content: center !important;
  }

  #btn-submit-exam-cbt {
    grid-column: 1 / -1 !important;
    grid-row: 3 !important;
    order: 5 !important;
    min-height: 42px !important;
    font-size: 0.86rem !important;
    font-weight: 700 !important;
    padding: 0.55rem 0.5rem !important;
    justify-content: center !important;
  }

  /* Study Mode Practice Action Controls */
  #practice-view .exam-action-bar {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 0.45rem !important;
    padding: 0.65rem 0.75rem !important;
  }

  #btn-practice-prev {
    grid-column: 1 !important;
    grid-row: 1 !important;
    min-height: 44px !important;
    font-size: 0.84rem !important;
    padding: 0.5rem 0.35rem !important;
    justify-content: center !important;
  }

  #btn-practice-next {
    grid-column: 2 !important;
    grid-row: 1 !important;
    min-height: 44px !important;
    font-size: 0.88rem !important;
    font-weight: 700 !important;
    padding: 0.5rem 0.35rem !important;
    justify-content: center !important;
  }

  #btn-practice-reveal {
    grid-column: 1 / -1 !important;
    grid-row: 2 !important;
    min-height: 40px !important;
    font-size: 0.82rem !important;
    padding: 0.45rem 0.35rem !important;
    justify-content: center !important;
  }

  /* Mobile Modals */
  .modal-backdrop {
    z-index: 1200 !important;
    padding: 0.75rem !important;
    padding-bottom: calc(0.75rem + env(safe-area-inset-bottom)) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .modal-card {
    max-width: 95vw !important;
    width: 100% !important;
    max-height: calc(100dvh - 2.5rem - env(safe-area-inset-bottom)) !important;
    margin: auto !important;
    padding: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    border-radius: 12px !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }

  .modal-header {
    padding: 0.85rem 1rem !important;
    flex-shrink: 0 !important;
  }

  .modal-header h3 {
    font-size: 1.05rem !important;
  }

  .modal-body {
    padding: 1rem 0.9rem !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
  }

  .modal-footer {
    padding: 0.75rem 0.9rem !important;
    flex-shrink: 0 !important;
    background: var(--bg-subtle) !important;
    display: flex !important;
    gap: 0.5rem !important;
  }

  .modal-footer .btn {
    flex: 1 !important;
    min-height: 44px !important;
    font-size: 0.88rem !important;
    padding: 0.6rem 0.5rem !important;
    justify-content: center !important;
  }

  .back-to-subjects-bar {
    margin-bottom: 0.75rem !important;
  }

  /* Remove examination hub hero card and switcher pills on mobile, keep in PC mode */
  #dashboard-module-view .dashboard-hero,
  .group-switcher-pills {
    display: none !important;
  }

  .notes-header-controls {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .result-metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Medium Screens <= 640px */
@media (max-width: 640px) {
  #btn-font-dec, #btn-font-inc, #btn-fullscreen {
    display: none !important;
  }
  .header-tools {
    gap: 0.35rem;
  }
}

/* Small Screens <= 480px (320px–480px Mobile Phones) */
@media (max-width: 480px) {
  .header-container {
    padding: 0.55rem 0.75rem;
    gap: 0.5rem;
  }

  .brand {
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
  }

  .brand-title {
    font-size: 0.92rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 170px;
  }

  .brand-subtitle {
    display: none;
  }

  #btn-font-dec, #btn-font-inc, #btn-fullscreen {
    display: none !important;
  }

  #btn-header-premium {
    padding: 0.3rem 0.5rem;
    font-size: 0.75rem;
  }

  #btn-header-auth {
    padding: 0.3rem 0.5rem;
    font-size: 0.75rem;
  }

  .subject-main-card {
    padding: 1.5rem 1.15rem;
  }

  .subject-selection-hero h1 {
    font-size: 1.5rem;
  }

  .subject-selection-hero p {
    font-size: 0.95rem;
  }

  .question-text {
    font-size: 1rem !important;
    line-height: 1.42;
    margin-bottom: 0.65rem !important;
  }

  .option-item {
    padding: 0.55rem 0.7rem !important;
    font-size: 0.9rem !important;
    min-height: 44px;
    gap: 0.55rem !important;
  }

  .result-metrics-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }

  .metric-card {
    padding: 0.85rem 0.5rem;
  }

  .metric-val {
    font-size: 1.25rem;
  }

  .result-score-big {
    font-size: 2.25rem;
  }

  /* Safe inputs on mobile Safari to prevent auto-zoom */
  input, select, textarea, .form-control {
    font-size: 16px !important;
  }
}

/* Ultra Small Screens <= 360px (320px iPhone SE 1st Gen) */
@media (max-width: 360px) {
  .header-container {
    padding: 0.45rem 0.5rem !important;
    gap: 0.25rem !important;
  }

  .brand {
    gap: 0.35rem !important;
    max-width: 145px;
  }

  .brand-icon {
    width: 28px !important;
    height: 28px !important;
    font-size: 0.95rem !important;
  }

  .brand-title {
    font-size: 0.82rem !important;
    max-width: 110px !important;
  }

  .header-tools {
    gap: 0.2rem !important;
  }

  #btn-header-auth {
    padding: 0.25rem 0.35rem !important;
    font-size: 0.7rem !important;
    gap: 0.2rem !important;
  }

  #btn-header-auth span {
    font-size: 0.95rem !important;
  }

  #btn-header-auth #header-user-label {
    font-size: 0.75rem !important;
  }

  .icon-btn {
    width: 32px !important;
    height: 32px !important;
    font-size: 0.85rem !important;
  }

  .btn-sm {
    padding: 0.25rem 0.4rem;
    font-size: 0.7rem;
  }

  .q-meta {
    flex-wrap: wrap;
    gap: 0.35rem;
  }

  #exam-view .exam-action-bar,
  #practice-view .exam-action-bar {
    gap: 0.35rem !important;
    padding: 0.5rem 0.5rem !important;
  }

  #btn-prev-q, #btn-save-next {
    font-size: 0.8rem !important;
    padding: 0.45rem 0.2rem !important;
  }

  #btn-mark-review, #btn-clear-response {
    font-size: 0.72rem !important;
    padding: 0.35rem 0.15rem !important;
  }

  #btn-submit-exam-cbt {
    font-size: 0.82rem !important;
    padding: 0.5rem 0.35rem !important;
  }
}

/* Ensure wide markdown tables NEVER blow out horizontal layout */
.notes-rendered-body table {
  display: block !important;
  width: 100% !important;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch !important;
  border-collapse: collapse !important;
  margin: 1.25rem 0 !important;
  border: 1px solid var(--border) !important;
}

.notes-rendered-body table th,
.notes-rendered-body table td {
  padding: 0.65rem 0.85rem !important;
  border: 1px solid var(--border) !important;
  white-space: normal !important;
  min-width: 110px !important;
}

.notes-rendered-body table th {
  background: var(--bg-subtle) !important;
  font-weight: 700 !important;
}

/* ======================================================== */
/* CISF ASI LDCE 2023 SPECIAL PURPOSE PORTAL STYLES         */
/* ======================================================== */

/* Special Purpose Badge */
.ldce-special-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 1.15rem;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.18), rgba(245, 158, 11, 0.18));
  border: 1px solid rgba(245, 158, 11, 0.45);
  border-radius: 9999px;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: #fbbf24;
  margin-bottom: 1rem;
  text-transform: uppercase;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.ldce-badge-star {
  color: #f59e0b;
  font-size: 0.95rem;
}

.ldce-hero-title {
  font-size: 2.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.35rem;
  background: linear-gradient(135deg, #ffffff 40%, #93c5fd 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.ldce-hero-sub-bilingual {
  font-size: 1.12rem;
  font-weight: 600;
  color: #93c5fd;
  margin-bottom: 0.85rem;
}

.ldce-hero-desc {
  max-width: 820px;
  margin: 0 auto 1.5rem auto;
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--text-muted);
}

.ldce-hero-pillars {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.65rem;
  margin-bottom: 0.5rem;
}

.ldce-pillar-tag {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(59, 130, 246, 0.25);
  padding: 0.35rem 0.85rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #cbd5e1;
}

/* Website Mission Card */
.ldce-mission-card {
  max-width: 1360px;
  margin: 0 auto 3rem auto;
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.95), rgba(30, 41, 59, 0.95));
  border: 2px solid rgba(245, 158, 11, 0.35);
  border-radius: 18px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), 0 0 20px rgba(245, 158, 11, 0.08);
  overflow: hidden;
  text-align: left;
}

.ldce-mission-header {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.5rem 2rem;
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.12), transparent);
  border-bottom: 1px solid rgba(245, 158, 11, 0.25);
}

.ldce-insignia-badge {
  width: 58px;
  height: 58px;
  border-radius: 14px;
  background: linear-gradient(135deg, #1e293b, #0f172a);
  border: 2px solid #f59e0b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  flex-shrink: 0;
}

.ldce-mission-kicker {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #fbbf24;
  text-transform: uppercase;
  margin-bottom: 0.2rem;
}

.ldce-mission-heading {
  font-size: 1.45rem;
  font-weight: 800;
  color: #ffffff;
  margin: 0;
}

.ldce-mission-subtext {
  font-size: 0.9rem;
  color: #94a3b8;
  margin-top: 0.15rem;
}

.ldce-mission-body {
  padding: 2rem;
}

.ldce-mission-quote {
  margin: 0 0 1.75rem 0;
  padding: 1.5rem 1.75rem;
  background: rgba(15, 23, 42, 0.6);
  border-left: 4px solid #f59e0b;
  border-radius: 0 12px 12px 0;
  font-size: 1.05rem;
  line-height: 1.75;
  color: #e2e8f0;
}

.ldce-mission-quote p {
  margin-bottom: 1rem;
}

.ldce-mission-quote p:last-child {
  margin-bottom: 0;
}

.ldce-mission-salute {
  color: #fbbf24;
  font-size: 1.1rem;
  margin-top: 1.25rem !important;
  font-weight: 700;
}

.ldce-mission-hindi-card {
  background: rgba(30, 41, 59, 0.65);
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
}

.ldce-hindi-label {
  font-size: 0.95rem;
  font-weight: 700;
  color: #93c5fd;
  margin-bottom: 0.5rem;
}

.ldce-mission-hindi-card p {
  font-size: 0.98rem;
  line-height: 1.65;
  color: #cbd5e1;
  margin: 0;
}

/* Transparent Access Tiers Section */
.ldce-tiers-section {
  max-width: 1360px;
  margin: 0 auto 3rem auto;
}

.ldce-tiers-header {
  text-align: center;
  margin-bottom: 2rem;
}

.ldce-tiers-pill {
  display: inline-block;
  padding: 0.35rem 0.9rem;
  background: rgba(37, 99, 235, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #60a5fa;
  margin-bottom: 0.5rem;
}

.ldce-tiers-title {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 0.4rem;
  color: #ffffff;
}

.ldce-tiers-sub {
  color: var(--text-muted);
  font-size: 1rem;
  max-width: 750px;
  margin: 0 auto;
}

.ldce-tiers-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  align-items: stretch;
}

@media (max-width: 992px) {
  .ldce-tiers-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
}

.ldce-tier-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem 1.65rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-md);
  transition: transform 0.2s ease, border-color 0.2s ease;
  position: relative;
}

.ldce-tier-box:hover {
  transform: translateY(-4px);
  border-color: rgba(59, 130, 246, 0.5);
}

.ldce-tier-popular {
  border: 2px solid #3b82f6;
  background: linear-gradient(180deg, rgba(30, 58, 138, 0.15), var(--bg-card));
  box-shadow: 0 8px 25px rgba(37, 99, 235, 0.15);
}

.ldce-tier-support {
  border: 2px solid rgba(245, 158, 11, 0.45);
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.08), var(--bg-card));
}

.ldce-tier-head {
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1.25rem;
}

.ldce-tier-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 0.25rem 0.65rem;
  border-radius: 4px;
  margin-bottom: 0.75rem;
}

.tier-free {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.tier-student {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.4);
}

.tier-maintenance {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.ldce-tier-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.65rem;
  color: #ffffff;
}

.ldce-tier-cost {
  font-size: 2.25rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1;
  margin-bottom: 0.35rem;
}

.ldce-tier-cost span {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
}

.ldce-tier-condition {
  font-size: 0.82rem;
  color: #94a3b8;
}

.ldce-tier-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.ldce-tier-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  font-size: 0.92rem;
  line-height: 1.45;
  color: #cbd5e1;
}

.feat-ico {
  font-weight: 800;
  font-size: 1rem;
  line-height: 1.3;
  flex-shrink: 0;
}

.feat-check {
  color: #10b981;
}

.feat-lock {
  color: #f59e0b;
}

/* Educational Disclaimer Box */
.ldce-disclaimer-card {
  max-width: 1360px;
  margin: 0 auto 3rem auto;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 14px;
  padding: 1.75rem 2rem;
  text-align: left;
}

.ldce-disclaimer-badge {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: #94a3b8;
  margin-bottom: 0.85rem;
}

.ldce-disclaimer-icon {
  font-size: 1.25rem;
}

.ldce-disclaimer-body {
  font-size: 0.9rem;
  line-height: 1.65;
  color: #94a3b8;
}

.ldce-disclaimer-body p {
  margin-bottom: 0.75rem;
}

.ldce-disclaimer-body p:last-child {
  margin-bottom: 0;
}

.ldce-disclaimer-body strong {
  color: #e2e8f0;
}

/* Honest Modal Pricing Box (replaces fake discounts) */
.ldce-honest-pricing-box {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 12px;
  padding: 1.15rem 1.25rem;
  margin-bottom: 1.25rem;
}

.ldce-honest-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid rgba(245, 158, 11, 0.2);
  padding-bottom: 0.65rem;
}

.ldce-honest-pill {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  padding: 0.25rem 0.6rem;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 4px;
  color: #fbbf24;
}

.ldce-honest-cost {
  font-size: 1.75rem;
  font-weight: 800;
  color: #fbbf24;
}

.ldce-cost-sub {
  font-size: 0.78rem;
  font-weight: 500;
  color: #94a3b8;
}

.ldce-honest-explanation {
  font-size: 0.84rem;
  line-height: 1.5;
  color: #cbd5e1;
}

/* Dedicated Footer */
.app-footer {
  margin-top: 4rem;
  border-top: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.95);
  padding: 2.25rem 1.5rem;
  text-align: center;
}

.footer-container {
  max-width: 900px;
  margin: 0 auto;
}

.footer-badge {
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: #fbbf24;
  margin-bottom: 0.65rem;
}

.footer-mission-reminder {
  font-size: 1rem;
  font-style: italic;
  color: #e2e8f0;
  margin-bottom: 0.65rem;
}

.footer-legal-tag {
  font-size: 0.8rem;
  color: #64748b;
}

/* Mobile Responsiveness for LDCE Components */
@media (max-width: 768px) {
  .ldce-hero-title {
    font-size: 1.65rem;
  }
  .ldce-hero-sub-bilingual {
    font-size: 0.95rem;
  }
  .ldce-mission-card {
    border-radius: 12px;
  }
  .ldce-mission-header {
    padding: 1.15rem 1.25rem;
  }
  .ldce-mission-body {
    padding: 1.25rem;
  }
  .ldce-mission-quote {
    padding: 1.15rem;
    font-size: 0.95rem;
  }
  .ldce-disclaimer-card {
    padding: 1.25rem;
  }
  .app-footer {
    padding-bottom: 6rem; /* Extra space for mobile bottom nav bar */
  }
}


