body.bg-slate {
  background: radial-gradient(circle at top left, #182848 0%, #1b1b2f 40%, #16213e 100%);
  min-height: 100vh;
}

.navbar { padding: 0.6rem 0; }
.navbar .container { padding-top: 0.35rem !important; padding-bottom: 0.35rem !important; }
.navbar .navbar-brand { font-size: 1.65rem; }
.navbar .navbar-brand.fs-3,
.navbar .navbar-brand.fs-4 { font-size: 1.65rem !important; }
.navbar .navbar-brand img { width: 34px; height: 34px; }
.navbar .navbar-nav { gap: 0.5rem; }
.navbar .nav-link { font-size: 0.95rem; padding: 0.35rem 0; }
.navbar .btn { font-size: 0.85rem; padding: 0.32rem 0.85rem; }
.navbar .btn.btn-icon { padding: 0.35rem 0.55rem; line-height: 1; display: inline-flex; align-items: center; justify-content: center; }
.navbar-divider { width: 1px; height: 32px; background: rgba(255,255,255,0.25); }
.navbar-actions { width: 100%; }
.navbar-actions-list li { width: 100%; }
.navbar-actions .btn { min-width: 0; white-space: nowrap; }
.navbar-actions-list #user-name { display: inline-flex; align-items: center; padding: 0 0.5rem; }
.navbar-collapse-inner { display: flex; flex-direction: column; gap: 1rem; align-items: stretch; }
.nav-primary-group .dropdown-toggle { font-weight: 600; }
.nav-primary-group .dropdown-menu-dark { border-radius: 0.75rem; padding: 0.5rem; }
.nav-primary-group .dropdown-menu-dark .dropdown-item { border-radius: 0.5rem; }
.nav-primary-group .dropdown-menu-dark .dropdown-item:hover { background: rgba(59,130,246,0.2); }
.word-bank-card { background: rgba(59,130,246,0.15); border: 1px solid rgba(59,130,246,0.35); border-radius: 1.25rem; padding: 1rem 1.25rem; box-shadow: 0 16px 32px rgba(15,23,42,0.25); color: #e2e8f0; }
.word-bank-card-title { color: #f8fafc; letter-spacing: 0.1em; }
.word-bank-card-body { margin-top: 0.25rem; }
.word-bank-card .text-muted { color: rgba(226,232,240,0.75) !important; }
.word-bank-chip { background: rgba(59,130,246,0.2); color: #bfdbfe; border: 1px solid rgba(59,130,246,0.3); border-radius: 999px; padding: 0.4rem 0.85rem; font-size: 0.9rem; font-weight: 600; }
.word-bank-input { border-radius: 14px; border: 1px solid rgba(255,255,255,0.2); background: rgba(16,20,40,0.85); color: #f8fafc; }
.word-bank-input:focus { border-color: rgba(147,197,253,0.8); box-shadow: 0 0 0 0.2rem rgba(59,130,246,0.3); }
.word-bank-card-body.reading-passage p { margin-bottom: 0.75rem; line-height: 1.6; }
.word-bank-card-body.reading-passage p:last-child { margin-bottom: 0; }
.word-bank-card { background: rgba(59,130,246,0.15); border: 1px solid rgba(59,130,246,0.35); border-radius: 1.25rem; padding: 1rem 1.25rem; box-shadow: 0 16px 32px rgba(15,23,42,0.25); }
.word-bank-card-title { color: #bfdbfe; letter-spacing: 0.1em; }
.word-bank-card-body { margin-top: 0.3rem; }
.story-card { background: rgba(129,140,248,0.12); border: 1px solid rgba(129,140,248,0.32); border-radius: 1.25rem; padding: 1.25rem; box-shadow: 0 16px 32px rgba(15,23,42,0.22); color: #e2e8f0; }
.story-card h4, .story-card .h4 { color: #dbeafe; }
.story-body p { margin-bottom: 0.9rem; line-height: 1.65; }
.story-body p:last-child { margin-bottom: 0; }
.wizard-option-card { background: rgba(30,41,59,0.68); border: 1px solid rgba(148,163,184,0.25); border-radius: 1.25rem; padding: 1.25rem; box-shadow: 0 18px 36px rgba(15,23,42,0.24); transition: border-color 0.2s ease, box-shadow 0.2s ease; }
.wizard-option-card:hover { border-color: rgba(148,163,184,0.45); box-shadow: 0 22px 44px rgba(15,23,42,0.32); }
.wizard-option-card h6, .wizard-option-card .h6 { color: #e2e8f0; letter-spacing: 0.05em; text-transform: uppercase; }
.question-type-grid { display: grid; gap: 0.65rem; }
.question-type-option { background: rgba(148,163,184,0.08); border: 1px solid rgba(148,163,184,0.18); border-radius: 1rem; padding: 0.9rem 1rem; width: 100%; display: flex; align-items: flex-start; gap: 0.75rem; cursor: pointer; transition: border-color 0.2s ease, background 0.2s ease; }
.question-type-option:hover { border-color: rgba(148,163,184,0.32); }
.question-type-option .form-check-input { margin-top: 0.35rem; }
.question-type-option .form-check-label { font-weight: 600; color: #f8fafc; }
.wizard-option-divider { border-top: 1px solid rgba(148,163,184,0.25); }
.wizard-upload-options.disabled-by-type { opacity: 0.45; pointer-events: none; filter: grayscale(12%); }
.wizard-upload-options.disabled-by-type .btn { pointer-events: none; }
.spelling-meta { background: rgba(30,64,175,0.18); border: 1px solid rgba(99,102,241,0.35); border-radius: 1rem; padding: 0.85rem 1rem; font-size: 0.9rem; line-height: 1.45; color: #e2e8f0; }
.word-bank-chip { background: rgba(59,130,246,0.2); color: #bfdbfe; border: 1px solid rgba(59,130,246,0.3); border-radius: 999px; padding: 0.4rem 0.85rem; font-size: 0.9rem; font-weight: 600; }

@media (max-width: 991.98px) {
  .navbar .navbar-nav { width: 100%; align-items: flex-start; }
  .navbar .navbar-nav .nav-link { width: 100%; padding: 0.4rem 0; }
  .navbar .collapse > .navbar-collapse-inner { padding-top: 0.75rem; }
  .navbar .navbar-actions { width: 100%; }
  .navbar .navbar-actions .btn { width: 100%; }
  .navbar-divider { display: none; }
  .nav-primary { width: 100%; }
  .nav-primary-group { width: 100%; }
  .nav-primary-group .dropdown-menu { width: 100%; }
  .nav-primary-group .dropend .dropdown-menu { margin-left: 0 !important; width: 100%; position: static !important; transform: none !important; }
}

@media (min-width: 992px) {
  .navbar-actions { width: auto; }
  .navbar-actions-list { flex-direction: row; align-items: center; gap: 0.75rem; }
  .navbar-actions-list li { width: auto; }
  .navbar-actions-list .btn { width: auto; }
  .navbar-collapse-inner { flex-direction: row; align-items: center; gap: 1.5rem; }
  .nav-primary { width: auto; }
  .nav-primary-group .dropdown-menu-dark { min-width: 230px; }
  .nav-primary-group .dropend .dropdown-menu { margin-left: 0.75rem; }
}

body.study-light-mode .word-bank-card {
  background: rgba(59,130,246,0.1);
  border-color: rgba(59,130,246,0.35);
  box-shadow: 0 18px 36px rgba(15,23,42,0.12);
}
body.study-light-mode .word-bank-card-title { color: #1d4ed8; }
body.study-light-mode .word-bank-card { color: #0f172a; }
body.study-light-mode .word-bank-card .text-muted { color: #475569 !important; }
body.study-light-mode .word-bank-chip {
  background: rgba(59,130,246,0.18);
  color: #1d4ed8;
  border-color: rgba(59,130,246,0.35);
}
body.study-light-mode .word-bank-card-body.reading-passage p { color: #0f172a; }
body.study-light-mode .wizard-option-card { background: #ffffff; border-color: rgba(148,163,184,0.35); box-shadow: 0 14px 32px rgba(148,163,184,0.25); }
body.study-light-mode .wizard-option-card:hover { border-color: rgba(99,102,241,0.35); box-shadow: 0 18px 38px rgba(99,102,241,0.24); }
body.study-light-mode .wizard-option-card h6, body.study-light-mode .wizard-option-card .h6 { color: #312e81; }
body.study-light-mode .question-type-option { background: #f8fafc; border-color: rgba(148,163,184,0.35); }
body.study-light-mode .question-type-option:hover { border-color: rgba(99,102,241,0.35); }
body.study-light-mode .question-type-option .form-check-label { color: #1f2937; }
body.study-light-mode .wizard-option-divider { border-color: rgba(148,163,184,0.35); }
body.study-light-mode .spelling-meta { background: #eef2ff; border-color: rgba(129,140,248,0.35); color: #312e81; }
body.study-light-mode .story-card { background: #eef2ff; border-color: rgba(99,102,241,0.25); color: #1f2937; box-shadow: 0 12px 24px rgba(99,102,241,0.18); }
body.study-light-mode .story-card h4, body.study-light-mode .story-card .h4 { color: #312e81; }
body.study-light-mode .story-body p { color: #1f2937; }
body.study-light-mode .word-bank-input {
  background: #ffffff;
  color: #0f172a;
  border: 1px solid rgba(148,163,184,0.6);
  box-shadow: inset 0 1px 2px rgba(148,163,184,0.12);
}
body.study-light-mode .word-bank-input:focus {
  border-color: rgba(59,130,246,0.5);
  box-shadow: 0 0 0 0.2rem rgba(59,130,246,0.2);
}
body.study-light-mode .glass-card {
  background: #ffffff;
  border: 1px solid rgba(148,163,184,0.35);
  color: #111827;
  box-shadow: 0 20px 40px rgba(15,23,42,0.12);
}
body.study-light-mode .glass-card .text-muted {
  color: #475569 !important;
}

/* Light mode: question blocks */
body.study-light-mode .question {
  background: #fff;
  color: #0f172a;
  border: 1px solid rgba(148,163,184,0.35);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  box-shadow: 0 10px 24px rgba(15,23,42,0.08);
}
body.study-light-mode .question .h5,
body.study-light-mode .question h5,
body.study-light-mode .question .fw-bold {
  color: #0f172a;
}

/* Light mode: toggle/switch (one-at-a-time) */
body.study-light-mode .form-check-input {
  background-color: #e2e8f0;
  border-color: rgba(15,23,42,0.5);
  box-shadow: inset 0 1px 2px rgba(15,23,42,0.08);
}
body.study-light-mode .form-check-input:checked {
  background-color: #1f2937;
  border-color: #1f2937;
}
body.study-light-mode .form-check-input:focus {
  border-color: #1f2937;
  box-shadow: 0 0 0 0.2rem rgba(31,41,55,0.25);
}
body.study-light-mode .form-check-label {
  color: #0f172a;
}
body.study-light-mode .question .text-muted {
  color: #475569 !important;
}
body.study-light-mode .question .form-control,
body.study-light-mode .question .form-select {
  background: #ffffff;
  color: #0f172a;
  border: 1px solid rgba(148,163,184,0.6);
  box-shadow: inset 0 1px 2px rgba(148,163,184,0.12);
}
body.study-light-mode .question .form-control:focus,
body.study-light-mode .question .form-select:focus {
  border-color: rgba(59,130,246,0.5);
  box-shadow: 0 0 0 0.2rem rgba(59,130,246,0.2);
}
body.study-light-mode .question .btn-outline-light {
  color: #0f172a;
  border-color: #0f172a;
}
body.study-light-mode .question .btn-outline-light:hover {
  background: #0f172a;
  color: #ffffff;
}
body.study-light-mode .question .icon-btn {
  color: #0f172a;
}
body.study-light-mode .navbar { background: linear-gradient(135deg, rgba(59,130,246,0.9), rgba(129,140,248,0.85)) !important; }
body.study-light-mode .navbar .nav-link,
body.study-light-mode .navbar .navbar-brand { color: #f8fafc !important; }
body.study-light-mode .navbar .btn-outline-light { color: #0f172a; border-color: #0f172a; }
body.study-light-mode .navbar .btn-outline-light:hover { background: #0f172a; color: #ffffff; }

.navbar.bg-gradient {
  background: linear-gradient(135deg, rgba(91,119,255,0.8) 0%, rgba(155,98,234,0.9) 50%, rgba(244,152,94,0.85) 100%);
}

.glass-card {
  background: rgba(30, 34, 66, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(12px);
}

textarea.form-control,
input.form-control,
select.form-select {
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background-color: rgba(101, 101, 101, 0.75);
  color: #f5f5f5;
}

/* Light mode: select appearance + placeholder tone */
body.study-light-mode select.form-select {
  background-color: #ffffff;
  color: #0f172a;
  border: 1px solid rgba(148,163,184,0.6);
  box-shadow: inset 0 1px 2px rgba(148,163,184,0.12);
}
/* Not all browsers support ::placeholder on select; these rules style a disabled selected option
   used as a placeholder so it renders an off‑white color in light mode */
body.study-light-mode select.form-select:invalid { color: #e5e7eb; }
body.study-light-mode select.form-select option[disabled][selected] { color: #e5e7eb; }

/* Ensure consistent height for small form elements */
.form-control-sm,
.form-select-sm {
  height: calc(1.5em + 0.5rem + 2px);
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
  line-height: 1.5;
}

textarea.form-control:focus,
input.form-control:focus,
select.form-select:focus {
  border-color: rgba(147, 197, 253, 0.8);
  box-shadow: 0 0 0 0.25rem rgba(91, 119, 255, 0.25);
}

.btn-primary {
  background: linear-gradient(135deg, #5b77ff 0%, #9b62ea 100%);
  border: none;
}

.btn-secondary {
  background: linear-gradient(135deg, #f4985e 0%, #f3686b 100%);
  border: none;
}

.btn-outline-light {
  border-width: 2px;
  color: #f8f9fa;
}

.btn-outline-light:hover {
  background: rgba(248, 249, 250, 0.2);
  color: #fff;
}

.ai-wizard {
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(135deg, rgba(22, 30, 56, 0.9), rgba(44, 53, 94, 0.92));
  box-shadow: 0 22px 45px -18px rgba(15, 21, 52, 0.6);
}

.ai-wizard-progress {
  list-style: none;
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
  padding: 0;
  margin: 0 0 1.75rem 0;
}

.ai-wizard-progress li {
  flex: 1;
  position: relative;
  text-align: center;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(226, 232, 240, 0.45);
  transition: color .2s ease;
  padding-top: 0.25rem;
}

.ai-wizard-progress li::before {
  content: '';
  position: absolute;
  top: 23px;
  left: calc(-50% + 20px);
  right: calc(50% + 20px);
  height: 2px;
  background: rgba(148, 163, 184, 0.18);
}

.ai-wizard-progress li:first-child::before {
  display: none;
}

.ai-wizard-progress .step-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(148, 163, 184, 0.25);
  color: #e2e8f0;
  font-weight: 600;
  margin-bottom: 0.35rem;
  border: 2px solid transparent;
  transition: background .2s ease, border-color .2s ease, transform .2s ease;
}

.ai-wizard-progress .step-label {
  display: block;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.ai-wizard-progress li.active,
.ai-wizard-progress li.completed {
  color: #f8fafc;
}

.ai-wizard-progress li.active .step-index {
  background: linear-gradient(135deg, #38bdf8, #6366f1);
  border-color: rgba(255, 255, 255, 0.35);
  transform: scale(1.05);
}

.ai-wizard-progress li.completed .step-index {
  background: rgba(34, 197, 94, 0.85);
  border-color: rgba(255, 255, 255, 0.32);
}

.ai-wizard-progress li.completed::before {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.55), rgba(59, 130, 246, 0.55));
}

.ai-wizard .wizard-step {
  display: none;
}

.ai-wizard .wizard-step.active {
  display: block;
}

.ai-wizard .wizard-footer {
  border-top: 1px solid rgba(148, 163, 184, 0.12);
  padding-top: 1.5rem;
}

.ai-wizard .wizard-footer .btn {
  min-width: 140px;
}

.wizard-premium {
  border: 1px dashed rgba(148, 163, 184, 0.35);
  border-radius: 1rem;
  padding: 1.25rem;
  background: rgba(15, 23, 42, 0.35);
}

.wizard-premium .btn {
  white-space: nowrap;
}

.wizard-upload-options {
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 1.25rem;
  padding: 1.5rem;
  background: rgba(15, 23, 42, 0.4);
}

.wizard-upload-card {
  position: relative;
  border-radius: 1rem;
  padding: 1.5rem;
  border: 1px solid rgba(148, 163, 184, 0.15);
  background: rgba(12, 19, 36, 0.65);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
  height: 100%;
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.wizard-upload-card:hover,
.wizard-upload-card:focus-within,
.wizard-upload-card.selected {
  border-color: rgba(94, 234, 212, 0.55);
  box-shadow: 0 18px 35px -20px rgba(94, 234, 212, 0.45);
  transform: translateY(-3px);
}

.wizard-upload-card .icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(56, 189, 248, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #38bdf8;
  font-size: 1.15rem;
  margin-bottom: 1rem;
}

.wizard-upload-card.selected .icon-wrap {
  background: rgba(56, 189, 248, 0.35);
  color: #f8fafc;
}

.wizard-upload-card button {
  align-self: flex-start;
}

.wizard-upload-upgrade {
  border: 1px dashed rgba(248, 113, 113, 0.35);
  border-radius: 1rem;
  padding: 0.85rem 1rem;
  background: rgba(45, 16, 16, 0.4);
}

.ai-wizard-status-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

@media (min-width: 768px) {
  .ai-wizard-status-wrap {
    flex-direction: row;
    align-items: center;
  }
}

.navbar-nav .nav-link {
  color: rgba(241, 245, 249, 0.9);
  font-weight: 500;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link:focus,
.navbar-nav .nav-link.active {
  color: #ffffff;
}

/* My Skills: mobile-friendly cards */
.mytest-card { background: rgba(23,25,45,0.85); }
.test-card { background: rgba(23,25,45,0.85); border:1px solid rgba(255,255,255,0.06); transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
.test-card:hover { transform: translateY(-4px); box-shadow:0 12px 28px -4px rgba(0,0,0,0.5); border-color: rgba(255,255,255,0.15); }
.test-card .fw-semibold { font-weight:600; letter-spacing:.25px; }
/* Utility: constrain long titles/subtopics to ~50 characters width and allow safe wrapping */
.title-wrap-50ch { display:inline-block; max-width:50ch; overflow-wrap:break-word; word-break:break-word; white-space:normal; vertical-align:middle; }
.topic-card { position: relative; overflow:hidden; }
.topic-card:before { content:""; position:absolute; inset:0; background: radial-gradient(circle at 85% 15%, rgba(255,255,255,0.08), transparent 60%); pointer-events:none; }
.topic-dot { position:relative; }
.mytest-actions .btn { white-space: nowrap; }
/* Hierarchical category flair */
.cat-level-legend {display:flex;flex-wrap:wrap;gap:.75rem;margin-bottom:1.25rem;align-items:center;}
.cat-level-legend .legend-item {display:flex;align-items:center;gap:.4rem;padding:.45rem .75rem;border:1px solid rgba(255,255,255,0.15);border-radius:999px;background:rgba(255,255,255,0.05);font-size:.75rem;letter-spacing:.5px;text-transform:uppercase;font-weight:600;color:#e2e8f0;}
.cat-level-legend .legend-item span.level-dot {width:10px;height:10px;border-radius:50%;display:inline-block;box-shadow:0 0 0 3px rgba(255,255,255,0.08);}
.breadcrumb-bar {position:relative;padding:1rem 1.15rem;border:1px solid rgba(255,255,255,0.1);background:linear-gradient(135deg,rgba(91,119,255,0.15),rgba(155,98,234,0.12));border-radius:18px;display:flex;flex-wrap:wrap;align-items:center;gap:.75rem;margin-bottom:1.25rem;}
.breadcrumb-bar .crumb {display:flex;align-items:center;gap:.5rem;font-weight:600;color:#fff;font-size:.9rem;}
.breadcrumb-bar .crumb:not(:last-child)::after {content:"/";opacity:.35;}
.breadcrumb-bar .back-btn {background:rgba(255,255,255,0.12);border:1px solid rgba(255,255,255,0.18);color:#fff;font-size:.75rem;font-weight:600;padding:.4rem .75rem;border-radius:10px;backdrop-filter:blur(4px);}
.breadcrumb-bar .back-btn:hover {background:rgba(255,255,255,0.2);} 
.subcategory-card {transition:transform .18s ease, box-shadow .25s ease, border-color .25s ease;}
.subcategory-card:hover {transform:translateY(-6px) scale(1.015);box-shadow:0 18px 44px -10px rgba(0,0,0,0.55);}
.subcategory-card:active {transform:translateY(-2px) scale(0.99);} 
.topic-card {transition:transform .18s ease, box-shadow .25s ease, border-color .25s ease;}
.topic-card:hover {transform:translateY(-4px);box-shadow:0 14px 36px -8px rgba(0,0,0,0.5);} 
.level-badge {font-size:.6rem;letter-spacing:.7px;font-weight:700;padding:.3rem .55rem;border-radius:6px;background:linear-gradient(135deg,#ff6b6b,#f4985e);color:#fff;box-shadow:0 4px 12px -2px rgba(0,0,0,0.4);} 
.level-badge.level-sub {background:linear-gradient(135deg,#6a8cff,#5b77ff);} 
.level-badge.level-topic {background:linear-gradient(135deg,#9b62ea,#c8b6ff);color:#1b1d33;} 
.gradient-separator {height:2px;width:100%;background:linear-gradient(90deg,rgba(91,119,255,0) 0%,rgba(91,119,255,.65) 25%,rgba(155,98,234,.65) 50%,rgba(244,152,94,.65) 75%,rgba(244,152,94,0) 100%);margin:1rem 0;border-radius:2px;}
.floating-hint {position:relative;font-size:.7rem;text-transform:uppercase;letter-spacing:.8px;color:#cbd5e1;font-weight:600;display:inline-flex;align-items:center;gap:.4rem;}
.floating-hint .pulse {width:8px;height:8px;border-radius:50%;background:#63b3ff;box-shadow:0 0 0 0 rgba(99,179,255,0.8);animation:pulse 2.2s infinite;}
@keyframes pulse {0%{box-shadow:0 0 0 0 rgba(99,179,255,0.8);}70%{box-shadow:0 0 0 10px rgba(99,179,255,0);}100%{box-shadow:0 0 0 0 rgba(99,179,255,0);}}
@media (max-width: 576px) {
  .btn-block-sm { width: 100%; }
}

/* Prevent horizontal overflow for action clusters */
.d-none.d-md-flex.gap-2 { flex-wrap: wrap; }
.dropdown-menu-dark.w-100 { width: 100%; }

/* Icon-only buttons (e.g., speaker) */
.icon-btn {
  border: 0;
  padding: 4px;
  line-height: 1;
  color: #fff;
}
.icon-btn i { font-size: 20px; }
.icon-btn:hover { opacity: 0.85; }
.icon-btn:focus { outline: 2px solid rgba(255,255,255,0.35); outline-offset: 2px; }

.text-pink { color: #f472b6 !important; }

/* Solid light-green Rate button */
.btn.btn-rate {
  background-color: #15803d !important; /* darker green */
  color: #ffffff !important;
  border-color: #15803d !important;
}
.btn.btn-rate:hover {
  background-color: #166534 !important; /* even darker on hover */
  border-color: #166534 !important;
}
.btn.btn-rate:disabled { opacity: 0.65; }

/* SweetAlert star rating visuals */
.swal-star {
  font-size: 40px; /* bigger stars */
  line-height: 1;
  color: #d1d5db; /* gray until filled */
  text-decoration: none !important;
}
.swal-star.filled { color: #f59e0b; /* amber */ }

.result-panel {
  background: rgba(11, 14, 35, 0.75);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 1.5rem;
}

.result-panel .code {
  font-family: "Fira Code", "Courier New", monospace;
  font-size: 1.2rem;
  letter-spacing: 0.1em;
}

.result-panel ul {
  padding-left: 1.25rem;
}

footer {
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
}


.hero-section {
  position: relative;
  background: linear-gradient(135deg, rgba(12, 14, 30, 0.95), rgba(18, 22, 48, 0.9));
  overflow: hidden;
}

.hero-bubble {
  position: absolute;
  inset: -20% -10% 0 0;
  background: radial-gradient(circle at 15% 25%, rgba(91, 119, 255, 0.35), transparent 65%),
              radial-gradient(circle at 80% 10%, rgba(244, 152, 94, 0.3), transparent 70%),
              radial-gradient(circle at 20% 80%, rgba(155, 98, 234, 0.25), transparent 60%);
  pointer-events: none;
}

.hero-section .display-4 {
  font-family: 'Baloo 2', system-ui, sans-serif;
  line-height: 1.05;
}

.hero-actions .btn {
  border-radius: 999px;
  min-width: 220px;
}

.hero-stats {
  position: relative;
  z-index: 1;
}

.hero-chip {
  display: inline-flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.75rem 1.1rem;
  border-radius: 18px;
  background: rgba(17, 20, 40, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  min-width: 170px;
}

.hero-chip .label {
  text-transform: uppercase;
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  color: white;
}

.hero-chip .value {
  font-weight: 700;
  color: #f8fafc;
}

.hero-visual {
  position: relative;
  display: grid;
  gap: 1.5rem;
}

.hero-avatar-card {
  position: relative;
  overflow: hidden;
}

.hero-avatar-card::after {
  content: "";
  position: absolute;
  inset: -40% 30% 0 -25%;
  background: radial-gradient(circle at 70% 20%, rgba(255, 255, 255, 0.12), transparent 65%);
  pointer-events: none;
}

.hero-avatar-frame {
  width: 86px;
  height: 86px;
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(91, 119, 255, 0.35), rgba(155, 98, 234, 0.45));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  color: #fff;
}

.hero-badges {
  margin: 0;
  padding: 0;
}

.hero-badges li {
  list-style: none;
  border-radius: 14px;
  padding: 0.45rem 0.9rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(226, 232, 240, 0.9);
}

.hero-badges li.unlocked {
  border-color: rgba(56, 189, 248, 0.8);
  background: rgba(56, 189, 248, 0.18);
}

.hero-badges li.locked {
  border-style: dashed;
  opacity: 0.7;
}

.hero-plan-card {
  background: rgba(18, 21, 46, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 26px 58px rgba(0, 0, 0, 0.35);
}

.cta-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.cta-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.35);
}

.cta-card-bubbly {
  background: linear-gradient(135deg, rgba(250, 208, 196, 0.18), rgba(203, 213, 255, 0.28));
}

.cta-card-focused {
  background: linear-gradient(135deg, rgba(14, 21, 40, 0.9), rgba(74, 88, 120, 0.95));
  color: #f8fafc;
}

.gradient-divider-top {
  background: linear-gradient(180deg, rgba(13, 16, 32, 0.95) 0%, rgba(13, 16, 32, 0.9) 55%, rgba(13, 16, 32, 0.85) 100%);
  position: relative;
}

.gradient-divider-top::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, transparent 0%, rgba(155, 98, 234, 0.35) 80%);
  opacity: 0.6;
  pointer-events: none;
}

.gradient-divider-bottom {
  position: relative;
  background: linear-gradient(180deg, rgba(26, 35, 70, 0.9) 0%, rgba(26, 35, 70, 0.92) 100%);
}

.gradient-divider-bottom::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(244, 152, 94, 0.1), transparent 70%);
  pointer-events: none;
}

.role-panel {
  position: relative;
  border-radius: 24px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.role-panel:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 42px rgba(0, 0, 0, 0.4);
  border-color: rgba(255, 255, 255, 0.2);
}

.role-panel .stretched-link {
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.role-icon {
  width: 60px;
  height: 60px;
  border-radius: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  margin-bottom: 1rem;
}

.role-panel-teacher .role-icon { background: rgba(91, 119, 255, 0.35); color: rgb(255, 255, 255); }
.role-panel-parent .role-icon { background: rgba(244, 152, 94, 0.35); color: rgb(255, 255, 255); }
.role-panel-student .role-icon { background: rgba(56, 176, 0, 0.35); color: rgb(255, 255, 255); }

.lesson-plan-preview {
  background: linear-gradient(135deg, rgba(30, 34, 66, 0.85), rgba(20, 25, 52, 0.92));
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.35);
}
x
.timeline li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  align-items: center;
  padding: 1rem 0;
}

.timeline li + li {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.timeline-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.testimonials-row .testimonial-card {
  background: rgba(27, 31, 62, 0.85);
  border-radius: 24px;
  padding: 2.5rem 2rem;
  border: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.testimonials-row .quote {
  font-size: 1.05rem;
  line-height: 1.6;
}

.testimonials-row .author {
  font-weight: 600;
  color: rgba(148, 163, 184, 0.9);
}

.callout {
  background: linear-gradient(135deg, rgba(91, 119, 255, 0.6), rgba(155, 98, 234, 0.6));
}

.callout .btn-outline-light {
  border-color: rgba(255, 255, 255, 0.75);
}

@media (max-width: 991.98px) {
  .hero-section .display-4 {
    font-size: 2.4rem;
  }
}

.banded-section {
  background: linear-gradient(135deg, rgba(20, 24, 52, 0.9), rgba(40, 49, 94, 0.92));
  position: relative;
}

.banded-section::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 15% 20%, rgba(253, 242, 208, 0.18), transparent 60%),
              radial-gradient(circle at 85% 25%, rgba(164, 227, 255, 0.18), transparent 70%);
  pointer-events: none;
}

.feature-tier {
  position: relative;
  border-radius: 28px;
  padding: 2.25rem 2rem;
  background: rgba(18, 22, 50, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.38);
}

.tier-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.feature-tier li i {
  width: 18px;
  text-align: center;
}

.insights-section {
  background: linear-gradient(135deg, rgba(18, 20, 42, 0.95), rgba(24, 28, 56, 0.9));
}

.insight-copy {
  padding: 2.4rem;
  border-radius: 28px;
  background: rgba(17, 20, 40, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.35);
}

.insight-grid {
  display: grid;
  gap: 1.8rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.insight-card {
  position: relative;
  border-radius: 24px;
  background: rgba(24, 28, 60, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.07);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
}

.insight-card .label {
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(226, 232, 240, 0.68);
}

.mini-chart {
  display: grid;
  grid-template-columns: repeat(5, minmax(12px, 1fr));
  gap: 0.4rem;
  align-items: end;
  height: 90px;
}

.mini-chart .bar {
  background: linear-gradient(180deg, rgba(91, 119, 255, 0.85), rgba(155, 98, 234, 0.7));
  border-radius: 6px 6px 2px 2px;
}

.integration-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chip,
.integration-chips .chip {
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  font-size: 0.75rem;
  color: rgba(226, 232, 240, 0.9);
  letter-spacing: 0.04em;
}

.membership-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(91, 119, 255, 0.2);
  color: rgba(226, 232, 240, 0.95);
  margin-bottom: 0.75rem;
}

.alert-upgrade {
  background: rgba(255, 193, 7, 0.12);
  border: 1px solid rgba(255, 193, 7, 0.35);
  color: rgba(252, 211, 77, 0.9);
  padding: 0.75rem 1rem;
  border-radius: 16px;
}

.btn-disabled {
  opacity: 0.6;
  pointer-events: none;
}

.monetization-section {
  background: linear-gradient(135deg, rgba(17, 19, 42, 0.95), rgba(24, 28, 58, 0.9));
}

.plan-card {
  border-radius: 28px;
  background: rgba(17, 21, 46, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 2.2rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  box-shadow: 0 28px 58px rgba(0, 0, 0, 0.35);
}

.plan-card-featured {
  position: relative;
  background: linear-gradient(135deg, rgba(91, 119, 255, 0.28), rgba(155, 98, 234, 0.35));
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.plan-card-featured::after {
  content: 'Most popular';
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
  color: #1b1f36;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.plan-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.plan-toggle {
  display: inline-flex;
  border-radius: 999px;
  background: rgba(20, 24, 52, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.35rem;
  margin: 0 auto 2rem;
  gap: 0.35rem;
}

.toggle-btn {
  border: none;
  background: transparent;
  color: rgba(226, 232, 240, 0.8);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.6rem 1.35rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.toggle-btn.active {
  background: linear-gradient(135deg, rgba(91, 119, 255, 0.85), rgba(155, 98, 234, 0.85));
  color: #0f172a;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}

.plan-set {
  display: none;
  transition: opacity 0.2s ease;
}

.plan-set.active {
  display: block;
  opacity: 1;
}

.monetization-callout .glass-card {
  min-height: 100%;
}

.lessonplans-layout .glass-card {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.lessonplans-layout .glass-card header {
  border-bottom: 1px solid rgba(255,255,255,0.08);
  padding-bottom: 0.5rem;
}

.lessonplans-layout .glass-card header .btn-group .btn {
  border-radius: 999px;
}

.lessonplans-layout .glass-card header .btn-group .btn.active {
  background: rgba(91, 119, 255, 0.35);
  color: #0f172a;
}

.toggle-level .btn {
  border-radius: 999px !important;
}

.lesson-row {
  width: 100%;
  background: rgba(18, 21, 46, 0.8);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 16px;
  padding: 0.9rem 1rem;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
  gap: 1rem;
  color: #f8fafc;
  cursor: pointer;
  transition: all 0.2s ease;
}

.lesson-row:hover {
  border-color: rgba(255,255,255,0.18);
  background: rgba(22, 26, 54, 0.9);
}

.lesson-row-main {
  flex: 1;
  min-width: 0;
}

.lesson-row.active {
  border-color: rgba(91, 119, 255, 0.6);
  box-shadow: 0 0 0 2px rgba(91, 119, 255, 0.35);
}

.lesson-row-actions .btn {
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.library-list {
  overflow-y: auto;
  max-height: 420px;
  padding-right: 0.3rem;
}

.library-preview {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 1rem;
}

.preview-question {
  background: rgba(16, 20, 45, 0.85);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 14px;
  padding: 0.75rem 1rem;
  margin-bottom: 0.6rem;
}

.preview-lecture-body {
  max-height: 220px;
  overflow-y: auto;
  padding: 0.75rem 1rem;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 14px;
  background: rgba(18, 21, 46, 0.7);
}

.plan-drop {
  border: 1px dashed rgba(255,255,255,0.15);
  border-radius: 16px;
  padding: 1rem;
  min-height: 240px;
  background: rgba(15, 18, 42, 0.65);
}

.plan-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 1.1rem;
  background: rgba(18, 21, 46, 0.85);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px;
}

.plan-item-info {
  flex: 1;
}

.plan-item .btn-group .btn {
  border-radius: 50%;
  width: 34px;
  height: 34px;
}

.glass-subcard {
  background: rgba(15, 18, 40, 0.85);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 1rem 1.1rem;
}

.plan-lessons {
  transition: all 0.2s ease;
}

.plan-lessons.show {
  display: block;
}

.lessonplans-layout .glass-card footer {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 0.75rem;
}
.trophy-room-section {
  background: linear-gradient(135deg, rgba(13, 16, 38, 0.95), rgba(18, 22, 48, 0.9));
}

.locked-trophies {
  border: 1px dashed rgba(255, 255, 255, 0.18);
}

.categories-section {
  background: linear-gradient(135deg, rgba(15, 18, 40, 0.92), rgba(21, 25, 52, 0.9));
}

.category-pill-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

.category-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  padding: 0.75rem 1.3rem; /* Slightly increased padding for a more button-like look */
  border-radius: 25px; /* Adjusted border-radius to make it more pill-like */
  background: rgba(26, 30, 62, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(226, 232, 240, 0.92);
  font-size: 0.9rem; /* Slightly larger font size for more readability */
  letter-spacing: 0.02em;
  text-transform: uppercase; /* Capitalize text for a more button-like effect */
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2); /* Soft shadow to give a 3D effect */
  transition: all 0.2s ease; /* Smooth transition for hover effects */
}

.category-pill:hover {
  background: rgba(26, 30, 62, 1); /* Darker background on hover */
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3); /* Stronger shadow on hover */
  transform: translateY(-2px); /* Slight lift on hover */
}

.category-pill:active {
  background: rgba(26, 30, 62, 0.8); /* Slightly lighter background when clicked */
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); /* Subtle shadow when clicked */
  transform: translateY(1px); /* Mimics a pressed effect */
}

.category-pill i {
  color: rgba(148, 197, 255, 0.9);
}

.subject-scroll {
  display: flex;
  gap: 1.25rem;
  overflow-x: auto;
  padding: 0.5rem 0 1rem;
  scroll-snap-type: x proximity;
}

.subject-scroll::-webkit-scrollbar {
  height: 8px;
}

.subject-scroll::-webkit-scrollbar-thumb {
  background: rgba(91, 119, 255, 0.4);
  border-radius: 999px;
}

.dynamic-subject-card {
  flex: 0 0 auto;
  width: 240px;
  border-radius: 26px;
  padding: 1.6rem 1.5rem;
  color: #f8fafc;
  text-decoration: none;
  position: relative;
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(8px);
  scroll-snap-align: start;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.dynamic-subject-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 28px 60px rgba(0, 0, 0, 0.45);
}

.subject-icon-wrap {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  background: rgba(15, 18, 38, 0.35);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  margin-bottom: 1rem;
}

.subject-name {
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.02em;
}

.subject-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.75rem;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(248, 250, 252, 0.85);
}

.page-hero {
  background: linear-gradient(135deg, rgba(26, 32, 68, 0.92), rgba(31, 39, 84, 0.94));
  position: relative;
  overflow: hidden;
}

.page-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top left, rgba(253, 255, 180, 0.25), transparent 65%);
  pointer-events: none;
}

.page-hero-bubbly::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 20% 20%, rgba(255, 188, 220, 0.3), transparent 40%),
                    radial-gradient(circle at 80% 30%, rgba(147, 197, 253, 0.25), transparent 45%),
                    radial-gradient(circle at 30% 80%, rgba(167, 243, 208, 0.2), transparent 35%);
  pointer-events: none;
}

.grade-page .glass-card {
  background: rgba(26, 28, 58, 0.78);
}


.collab-card {
  border-radius: 24px;
  background: rgba(21, 25, 52, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.collab-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

.benefit-card {
  border-radius: 26px;
  background: rgba(22, 25, 54, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.07);
  position: relative;
}

.benefit-icon {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.grade-band-section {
  background: linear-gradient(135deg, rgba(20, 25, 56, 0.9), rgba(30, 32, 68, 0.92));
}

.grade-band-card {
  border-radius: 28px;
  background: rgba(18, 21, 48, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 2rem;
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.35);
  display: grid;
  gap: 0.9rem;
}

.grade-band-card li i {
  width: 18px;
  text-align: center;
}

.resource-section {
  background: linear-gradient(135deg, rgba(15, 18, 40, 0.95), rgba(21, 25, 52, 0.92));
}

.resource-card {
  border-radius: 26px;
  background: rgba(18, 21, 44, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.07);
  padding: 2rem;
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.32);
  display: grid;
  gap: 0.8rem;
}

.avatar-section {
  background: linear-gradient(135deg, rgba(17, 21, 48, 0.95), rgba(24, 28, 60, 0.92));
}

.avatar-card {
  position: relative;
  overflow: hidden;
}

.avatar-card::after {
  content: "";
  position: absolute;
  inset: -20% 40% 20% -20%;
  background: radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.12), transparent 65%);
  pointer-events: none;
}

.avatar-card .btn {
  border-radius: 999px;
}

.trophy-preview {
  background: rgba(18, 21, 46, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 24px 54px rgba(0, 0, 0, 0.35);
}

.trophy-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}

.trophy-tile {
  border-radius: 18px;
  padding: 1rem;
  background: rgba(16, 19, 38, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  text-align: center;
}

.trophy-tile.unlocked {
  border-color: rgba(99, 179, 255, 0.35);
}

.trophy-tile .emoji {
  font-size: 1.6rem;
  display: block;
  margin-bottom: 0.5rem;
}

.trophy-tile.locked {
  border-style: dashed;
  opacity: 0.75;
}

.higher-page .glass-card {
  background: rgba(18, 21, 44, 0.86);
}

.page-hero-focused::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 80% 20%, rgba(91, 119, 255, 0.38), transparent 55%),
              radial-gradient(circle at 15% 75%, rgba(244, 152, 94, 0.28), transparent 60%);
  pointer-events: none;
}

.analytics-card .progress {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 999px;
}

.analytics-card .progress-bar {
  background: linear-gradient(135deg, #5b77ff, #9b62ea);
}

.pathway-card {
  border-radius: 24px;
  background: rgba(19, 22, 46, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.pathway-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.45);
}

.mentor-card {
  border-radius: 28px;
}

.mentor-actions .btn {
  border-radius: 14px;
}

.higher-benefit {
  border-radius: 24px;
  background: rgba(16, 18, 38, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.benefit-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(91, 119, 255, 0.2);
  color: rgba(203, 213, 225, 0.95);
  margin-bottom: 1rem;
}

.analytics-section {
  background: linear-gradient(135deg, rgba(15, 18, 42, 0.94), rgba(21, 26, 58, 0.92));
}

.metric-panel {
  border-radius: 20px;
  background: rgba(12, 16, 36, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 1.1rem 1.2rem;
  display: grid;
  gap: 0.35rem;
}

.metric-panel .label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(148, 163, 184, 0.75);
}

.metric-panel .value {
  font-size: 1.5rem;
  font-weight: 700;
}

.metric-panel .caption {
  font-size: 0.75rem;
  color: rgba(148, 163, 184, 0.85);
}

.timeline-ordered {
  list-style: none;
  counter-reset: step;
  padding: 0;
  display: grid;
  gap: 0.9rem;
}

.timeline-ordered li {
  position: relative;
  padding-left: 2.6rem;
}

.timeline-ordered li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 50%;
  background: rgba(91, 119, 255, 0.25);
  color: #f8fafc;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

.resource-bullets li i {
  width: 18px;
  text-align: center;
}

.readiness-section {
  background: linear-gradient(135deg, rgba(14, 18, 42, 0.96), rgba(22, 24, 54, 0.9));
}

.dashboard-hero {
  position: relative;
  background: linear-gradient(135deg, rgba(18, 21, 44, 0.95), rgba(31, 39, 85, 0.9));
  overflow: hidden;
}

.dashboard-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 15% 20%, rgba(255, 255, 255, 0.08), transparent 55%),
              radial-gradient(circle at 80% 25%, rgba(155, 98, 234, 0.22), transparent 65%);
  pointer-events: none;
}

.teacher-hero::after {
  background-image: radial-gradient(circle at 10% 20%, rgba(130, 206, 255, 0.28), transparent 60%),
                    radial-gradient(circle at 80% 30%, rgba(253, 219, 146, 0.25), transparent 60%);
}

.parent-hero::after {
  background-image: radial-gradient(circle at 20% 20%, rgba(254, 226, 226, 0.25), transparent 60%),
                    radial-gradient(circle at 80% 30%, rgba(252, 211, 77, 0.28), transparent 65%);
}

.student-hero::after {
  background-image: radial-gradient(circle at 15% 20%, rgba(165, 243, 252, 0.3), transparent 60%),
                    radial-gradient(circle at 85% 35%, rgba(134, 239, 172, 0.35), transparent 65%);
}

.stat-pill,
.snapshot-item {
  background: rgba(16, 19, 38, 0.9);
  border-radius: 18px;
  padding: 1rem 1.2rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.stat-pill .label,
.snapshot-item .label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(203, 213, 225, 0.75);
}

.stat-pill .value,
.snapshot-item .value {
  font-size: 1.35rem;
  font-weight: 700;
  color: #f8fafc;
}

.quick-actions .btn {
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.quick-actions .btn i {
  width: 20px;
}

.snapshot-item + .snapshot-item {
  margin-top: 0.25rem;
}

.snapshot-item .value {
  font-size: 1.15rem;
}

.lesson-plan-card {
  border-radius: 26px;
  background: rgba(18, 21, 44, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.07);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
}

.lesson-plan-card .badge {
  align-self: flex-start;
}

.lesson-plan-card .plan-actions {
  margin-top: auto;
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.focus-card {
  border-radius: 22px;
  background: rgba(16, 19, 38, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 1.5rem;
}

.focus-card .badge {
  font-size: 0.65rem;
  letter-spacing: 0.08em;
}

.celebration-item {
  background: rgba(18, 22, 42, 0.82);
  border-radius: 18px;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.celebration-item i {
  font-size: 1.4rem;
}

.learner-card {
  border-radius: 26px;
  background: rgba(21, 25, 52, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 1.75rem;
  display: grid;
  gap: 1rem;
}

.learner-card header {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1rem;
  align-items: center;
  justify-content: space-between;
}

.learner-card .stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.75rem;
  background: rgba(91, 119, 255, 0.18);
  color: rgba(226, 232, 240, 0.95);
}

.learner-card .stat-chip i {
  font-size: 1rem;
}

.avatar-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(91, 119, 255, 0.18);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #f8fafc;
  font-size: 1.1rem;
}

.schedule-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.9rem 1.1rem;
  background: rgba(19, 21, 40, 0.78);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.support-tip {
  border-radius: 18px;
  background: rgba(26, 32, 60, 0.8);
  padding: 1.15rem;
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.progress-entry {
  border-radius: 22px;
  background: rgba(18, 20, 40, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 1.5rem;
  display: grid;
  gap: 0.75rem;
}

.progress-entry header {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1rem;
  align-items: center;
  justify-content: space-between;
}

.progress-entry .score {
  font-size: 1.4rem;
  font-weight: 700;
}

.progress-entry .badge {
  font-size: 0.65rem;
  letter-spacing: 0.08em;
}

.progress-entry .insight {
  background: rgba(91, 119, 255, 0.15);
  border-radius: 14px;
  padding: 0.65rem 0.9rem;
  font-size: 0.85rem;
  color: rgba(226, 232, 240, 0.9);
}

.student-snapshot .stat-pill {
  background: rgba(15, 24, 45, 0.92);
}

.student-snapshot .value {
  font-size: 1.2rem;
}

.achievement-banner {
  background: linear-gradient(135deg, rgba(91, 119, 255, 0.3), rgba(155, 98, 234, 0.28));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 28px;
  box-shadow: 0 22px 55px rgba(0, 0, 0, 0.35);
}

.recommended-plan-card {
  border-radius: 20px;
  background: rgba(19, 24, 48, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.07);
  padding: 1.3rem 1.5rem;
}

.family-communication {
  background: linear-gradient(135deg, rgba(17, 20, 44, 0.95), rgba(23, 28, 58, 0.9));
}

.comms-card {
  border-radius: 24px;
  background: rgba(20, 23, 50, 0.84);
  border: 1px solid rgba(255, 255, 255, 0.07);
  padding: 1.8rem;
  box-shadow: 0 22px 45px rgba(0, 0, 0, 0.32);
  display: grid;
  gap: 0.8rem;
}

.comms-card li i {
  width: 18px;
  text-align: center;
}

.family-roadmap {
  background: linear-gradient(135deg, rgba(14, 18, 42, 0.95), rgba(18, 22, 48, 0.9));
}

.workflow-section {
  background: linear-gradient(135deg, rgba(14, 18, 42, 0.96), rgba(26, 32, 66, 0.9));
}

.workflow-card {
  position: relative;
  border-radius: 24px;
  background: rgba(19, 23, 48, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 1.8rem 1.6rem 1.6rem 1.6rem;
  box-shadow: 0 24px 42px rgba(0, 0, 0, 0.34);
}

.workflow-card .step {
  position: absolute;
  top: -18px;
  left: 18px;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(91, 119, 255, 0.85), rgba(155, 98, 234, 0.85));
  color: #f8fafc;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.roadmap-section {
  background: linear-gradient(135deg, rgba(15, 18, 42, 0.94), rgba(20, 23, 50, 0.9));
}

.badge-section {
  background: linear-gradient(135deg, rgba(17, 20, 44, 0.95), rgba(24, 29, 58, 0.9));
}

.badge-card {
  border-radius: 24px;
  background: rgba(19, 22, 48, 0.84);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 1.6rem;
  display: grid;
  gap: 0.8rem;
  text-align: left;
  box-shadow: 0 20px 46px rgba(0, 0, 0, 0.32);
}

.badge-icon {
  width: 52px;
  height: 52px;
  border-radius: 18px;
  background: rgba(91, 119, 255, 0.22);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.45rem;
  color: #f8fafc;
}

.planning-section {
  background: linear-gradient(135deg, rgba(15, 18, 42, 0.95), rgba(20, 24, 52, 0.9));
}

.option label {
  cursor: pointer;
}

.question {
  border-radius: 18px;
  padding: 1.5rem;
  background: rgba(19, 20, 38, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
}

.question + .question {
  margin-top: 1.5rem;
}

.question img {
  border-radius: 16px;
  max-height: 240px;
  object-fit: cover;
}

#results details {
  background: rgba(11, 14, 35, 0.75);
  border-radius: 16px;
  padding: 1rem;
}

#results summary {
  cursor: pointer;
  font-weight: 600;
}

.text-muted {
  color: rgba(255, 255, 255, 0.75) !important;
}

.text-success {
  color: #87ceeb !important; /* Light blue text */
}

/* Cookie banner */
.cookie-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0.75rem 0;
  z-index: 1050;
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
}

/* Lesson Cards - Inviting and Modern Design */
.sb-lesson-card {
  position: relative;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(135deg, 
    rgba(30, 34, 66, 0.85) 0%, 
    rgba(25, 30, 58, 0.9) 50%, 
    rgba(23, 28, 54, 0.95) 100%);
  backdrop-filter: blur(12px);
  /* Reduced glow/shadow effects for 508 compliance */
  box-shadow: 
    0 4px 16px rgba(0, 0, 0, 0.2),
    0 1px 4px rgba(0, 0, 0, 0.1);
  transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
  border-radius: 16px;
  cursor: pointer;
  z-index: 1;
  /* Improved focus for accessibility */
  outline: none;
}

/* Focus state for keyboard navigation */
.sb-lesson-card:focus {
  border-color: #ffdd44;
  outline: 2px solid #ffdd44;
  outline-offset: 2px;
  box-shadow: 
    0 4px 16px rgba(0, 0, 0, 0.2),
    0 0 0 4px rgba(255, 221, 68, 0.3);
}

.sb-lesson-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, 
    rgba(var(--sb-accent-rgb, 91, 119, 255), 0.05) 0%, 
    rgba(var(--sb-accent-rgb, 91, 119, 255), 0.02) 50%, 
    rgba(var(--sb-accent-rgb, 91, 119, 255), 0.08) 100%);
  border-radius: 18px;
  transition: all 0.3s ease;
  z-index: -1;
}

.sb-lesson-card:hover {
  transform: translateY(-4px) scale(1.01); /* Reduced movement */
  /* Reduced glow effects */
  box-shadow: 
    0 8px 24px rgba(0, 0, 0, 0.25),
    0 2px 8px rgba(var(--sb-accent-rgb, 91, 119, 255), 0.1);
  border-color: rgba(var(--sb-accent-rgb, 91, 119, 255), 0.3);
}

.sb-lesson-card:hover::before {
  background: linear-gradient(135deg, 
    rgba(var(--sb-accent-rgb, 91, 119, 255), 0.08) 0%, 
    rgba(var(--sb-accent-rgb, 91, 119, 255), 0.05) 50%, 
    rgba(var(--sb-accent-rgb, 91, 119, 255), 0.1) 100%);
}

.sb-lesson-card:active {
  transform: translateY(-2px) scale(0.99); /* Reduced movement */
}

/* Lesson card accent elements */
.sb-lesson-accent {
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, 
    var(--sb-accent, #5b77ff) 0%, 
    rgba(255, 255, 255, 0.6) 50%, 
    var(--sb-accent, #5b77ff) 100%);
  box-shadow: 0 0 20px var(--sb-accent, #5b77ff);
  border-radius: 0 4px 4px 0;
  z-index: 2;
}

.sb-lesson-tint {
  position: absolute;
  top: -10px;
  right: -10px;
  width: 80px;
  height: 80px;
  background: radial-gradient(circle at center, 
    rgba(var(--sb-accent-rgb, 91, 119, 255), 0.3) 0%, 
    rgba(var(--sb-accent-rgb, 91, 119, 255), 0.1) 40%, 
    transparent 70%);
  border-radius: 50%;
  animation: gentle-pulse 3s ease-in-out infinite;
  z-index: 1;
}

@keyframes gentle-pulse {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 0.8; transform: scale(1.1); }
}

/* Enhanced lesson card content */
.sb-lesson-card .fw-semibold {
  font-weight: 700;
  font-size: 1.3rem;
  color: #ffffff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  letter-spacing: 0.3px;
  margin-bottom: 0.35rem;
  position: relative;
  z-index: 3;
  line-height: 1.2;
}

.sb-lesson-card .text-muted {
  color: rgba(203, 213, 225, 0.8) !important;
  font-weight: 500;
  font-size: 0.9rem;
  position: relative;
  z-index: 3;
}

/* Practice test button enhancements */
.sb-lesson-card .test-chip,
.sb-lesson-card .study-lecture-chip,
.sb-lesson-card .share-qr-chip {
  background: linear-gradient(135deg, 
    var(--sb-accent, #5b77ff) 0%, 
    rgba(var(--sb-accent-rgb, 91, 119, 255), 0.8) 100%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: 12px;
  transition: all 0.2s ease;
  box-shadow: 0 3px 8px rgba(var(--sb-accent-rgb, 91, 119, 255), 0.2);
  position: relative;
  z-index: 3;
  overflow: hidden;
  text-decoration: none;
}

.sb-lesson-card .study-lecture-chip {
  background: linear-gradient(135deg, 
    rgba(155, 98, 234, 0.9) 0%, 
    rgba(200, 182, 255, 0.8) 100%);
  box-shadow: 0 3px 8px rgba(155, 98, 234, 0.2);
}

.sb-lesson-card .share-qr-chip {
  background: linear-gradient(135deg, 
    rgba(244, 152, 94, 0.9) 0%, 
    rgba(255, 214, 102, 0.8) 100%);
  box-shadow: 0 3px 8px rgba(244, 152, 94, 0.2);
}

.sb-lesson-card .test-chip::before,
.sb-lesson-card .study-lecture-chip::before,
.sb-lesson-card .share-qr-chip::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, 
    transparent, 
    rgba(255, 255, 255, 0.4), 
    transparent);
  transition: left 0.5s ease;
}

.sb-lesson-card:hover .test-chip::before,
.sb-lesson-card:hover .study-lecture-chip::before,
.sb-lesson-card:hover .share-qr-chip::before {
  left: 100%;
}

.sb-lesson-card .test-chip:hover {
  background: linear-gradient(135deg, 
    var(--sb-accent, #5b77ff) 0%, 
    rgba(var(--sb-accent-rgb, 91, 119, 255), 1) 100%);
  transform: translateY(-1px);
  /* Reduced glow effect */
  box-shadow: 0 3px 8px rgba(var(--sb-accent-rgb, 91, 119, 255), 0.15);
}

.sb-lesson-card .study-lecture-chip:hover {
  background: linear-gradient(135deg, 
    rgba(155, 98, 234, 1) 0%, 
    rgba(200, 182, 255, 1) 100%);
  transform: translateY(-1px);
  /* Reduced glow effect */
  box-shadow: 0 3px 8px rgba(155, 98, 234, 0.15);
}

.sb-lesson-card .share-qr-chip:hover {
  background: linear-gradient(135deg, 
    rgba(244, 152, 94, 1) 0%, 
    rgba(255, 214, 102, 1) 100%);
  transform: translateY(-1px);
  /* Reduced glow effect */
  box-shadow: 0 3px 8px rgba(244, 152, 94, 0.15);
}

/* Focus states for keyboard navigation (508 compliance) */
.sb-lesson-card .test-chip:focus,
.sb-lesson-card .study-lecture-chip:focus,
.sb-lesson-card .share-qr-chip:focus {
  outline: 2px solid #ffdd44;
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(255, 221, 68, 0.3);
}

/* Always visible example content styling */
.sb-teardrop-preview {
  position: relative;
  width: 100%;
  margin-top: 1rem;
  opacity: 1;
  transform: none;
  transition: none;
  z-index: 1;
  pointer-events: auto;
}

.sb-lesson-card .sb-teardrop-preview {
  opacity: 1;
  position: static;
  transform: none;
}

/* Remove the teardrop pointer - no longer needed */
.sb-drop {
  display: none;
}

.sb-preview-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 1.25rem;
  width: 100%;
  font-size: 1rem; /* Larger font size */
  line-height: 1.5;
  color: #e2e8f0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(8px);
  margin-top: 0.5rem;
}

/* Better contrast for the example text */
.sb-preview-card strong {
  color: #ffdd44;
  font-weight: 600;
}

.sb-preview-card em {
  color: #87ceeb;
  font-style: italic;
}

/* 508 Compliant Lesson cards container */
#lesson-cards {
  gap: 1.25rem !important;
  /* Better touch targets for mobile */
  min-height: 44px;
}

/* Ensure proper spacing and touch targets on all devices */
@media (min-width: 768px) {
  #lesson-cards {
    gap: 1.5rem !important;
  }
}

/* Reduced motion for users who prefer it (508 compliance) */
@media (prefers-reduced-motion: reduce) {
  .sb-lesson-card {
    transition: none;
  }
  
  .sb-lesson-card:hover {
    transform: none;
  }
  
  .sb-lesson-card:active {
    transform: none;
  }
  
  .sb-lesson-card:nth-child(odd),
  .sb-lesson-card:nth-child(even) {
    animation: none;
  }
}

/* Fun floating animation for lesson cards */
.sb-lesson-card:nth-child(odd) {
  animation: float-gentle 6s ease-in-out infinite;
}

.sb-lesson-card:nth-child(even) {
  animation: float-gentle 6s ease-in-out infinite reverse;
}

@keyframes float-gentle {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-3px); }
}

/* Mobile enhancements */
@media (max-width: 576px) {
  /* Categories: make CTA buttons full-width and easier to tap */
  #categories-buttons {
    display: grid !important;
    grid-template-columns: 1fr;
    gap: 0.75rem !important;
    margin-bottom: 1.5rem !important;
  }
  
  #categories-buttons .btn {
    width: 100% !important;
    text-align: center !important;
    padding: 1.2rem 1rem !important;
    border-radius: 16px !important;
    font-size: 1.05rem !important;
    font-weight: 700 !important;
    min-height: 44px; /* iOS minimum touch target */
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: relative !important;
    overflow: hidden !important;
    border: 2px solid rgba(255, 255, 255, 0.1) !important;
    transition: all 0.2s ease !important;
  }
  
  #categories-buttons .btn:hover,
  #categories-buttons .btn:focus {
    transform: translateY(-2px) !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
  }
  
  #categories-buttons .btn:active {
    transform: translateY(0) !important;
  }
  
  /* Enhanced badge styling on mobile */
  #categories-buttons .btn .badge {
    font-size: 0.8rem !important;
    padding: 0.35rem 0.65rem !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    margin-left: 0.75rem !important;
  }
  
  /* Active state styling */
  #categories-buttons .btn.opacity-75 {
    opacity: 1 !important;
    border-color: rgba(255, 255, 255, 0.4) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 
                0 0 0 4px rgba(255, 255, 255, 0.1) !important;
  }
  
  /* Delete button positioning on mobile */
  #categories-buttons .d-flex {
    flex-direction: column !important;
    gap: 0.5rem !important;
    width: 100% !important;
  }
  
  #categories-buttons .d-flex .btn:first-child {
    order: 1;
  }
  
  #categories-buttons .d-flex .btn[data-delete-category] {
    order: 2;
    width: auto !important;
    padding: 0.5rem 0.75rem !important;
    font-size: 0.8rem !important;
    border-radius: 8px !important;
    align-self: center !important;
    background: rgba(220, 38, 127, 0.2) !important;
    border-color: rgba(220, 38, 127, 0.4) !important;
    color: #fca5a5 !important;
  }
  /* Categories: test chips become full-width rows */
  #categories-list .cat-test-chip {
    display: block !important;
    width: 100%;
    text-align: left;
    padding: 0.55rem 0.9rem;
    border-radius: 12px !important;
    font-size: 1rem;
  }
  #categories-list .cat-test-chip i { margin-right: 0.5rem; }
  /* Categories: reduce padding on subcategory cards */
  #categories-list > .rounded-4 { padding: 1rem !important; }
  
  /* Breadcrumb mobile optimizations */
  .breadcrumb-bar {
    padding: 0.75rem 1rem !important;
    margin-bottom: 1rem !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.75rem !important;
    border-radius: 14px !important;
  }
  
  .breadcrumb-bar .crumb {
    font-size: 0.85rem !important;
    gap: 0.35rem !important;
    line-height: 1.3;
    word-break: break-word;
  }
  
  .breadcrumb-bar .back-btn {
    font-size: 0.8rem !important;
    padding: 0.5rem 0.8rem !important;
    border-radius: 8px !important;
    min-height: 44px; /* iOS minimum touch target */
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
  
  /* Stack breadcrumbs vertically on very small screens */
  .breadcrumb-bar .crumb:not(:last-child)::after {
    content: "→" !important;
    opacity: 0.5 !important;
    margin-left: 0.25rem;
  }
  
  /* Make breadcrumb text more readable on small screens */
  .breadcrumb-bar .crumb {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  
  /* Long breadcrumb handling */
  .breadcrumb-bar {
    overflow-x: auto;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
  }
  
  .breadcrumb-bar::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
  }
  
  /* Lesson cards mobile optimizations */
  .sb-lesson-card {
    padding: 1.25rem !important;
    margin-bottom: 0.75rem;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 1rem !important;
  }
  
  .sb-lesson-card:hover {
    transform: translateY(-3px) scale(1.005); /* Subtle mobile hover */
  }
  
  .sb-lesson-card .fw-semibold {
    font-size: 1.4rem !important; /* Larger titles on mobile */
    margin-bottom: 0.5rem !important;
    text-align: left;
  }
  
  .sb-lesson-card .test-chip,
  .sb-lesson-card .study-lecture-chip,
  .sb-lesson-card .share-qr-chip {
    padding: 0.8rem 1rem;
    font-size: 0.95rem;
    width: 100%;
    text-align: center;
    margin-bottom: 0.5rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15) !important; /* Reduced glow on mobile */
  }
  
  .sb-lesson-card .d-flex.flex-wrap {
    flex-direction: column !important;
    gap: 0.6rem !important;
  }
  
  /* Show examples on mobile with adjusted styling */
  .sb-preview-card {
    font-size: 0.9rem;
    padding: 1rem;
  }
  
  .sb-lesson-tint {
    width: 60px;
    height: 60px;
    top: -5px;
    right: -5px;
  }
  
  /* Disable floating animation on mobile for better performance */
  .sb-lesson-card:nth-child(odd),
  .sb-lesson-card:nth-child(even) {
    animation: none;
  }
  
  /* Lesson cards container - better mobile spacing and touch targets */
  #lesson-cards {
    gap: 1rem !important;
  }
  
  /* Improved touch targets for mobile */
  .sb-lesson-card {
    min-height: 120px;
    padding: 1.25rem !important;
  }
  
  /* Larger buttons for better touch accessibility */
  .sb-lesson-card .test-chip,
  .sb-lesson-card .study-lecture-chip,
  .sb-lesson-card .share-qr-chip {
    min-height: 44px;
    padding: 0.75rem 1rem !important;
    font-size: 0.9rem !important;
  }
}

/* Large mobile optimizations */
@media (max-width: 768px) and (min-width: 480px) {
  #categories-buttons .btn {
    font-size: 1.1rem !important;
    padding: 1.3rem 1rem !important;
  }
  
  #categories-buttons .btn .badge {
    font-size: 0.85rem !important;
    padding: 0.4rem 0.7rem !important;
  }
}

/* Extra small mobile optimizations */
@media (max-width: 479px) {
  #categories-buttons {
    gap: 0.6rem !important;
    margin-bottom: 1.25rem !important;
  }
  
  #categories-buttons .btn {
    font-size: 0.95rem !important;
    padding: 1rem !important;
    letter-spacing: 0.3px !important;
  }
  
  #categories-buttons .btn .badge {
    font-size: 0.75rem !important;
    padding: 0.3rem 0.55rem !important;
    margin-left: 0.5rem !important;
  }
}

/* Tablet optimizations */
@media (max-width: 768px) and (min-width: 577px) {
  .sb-lesson-card {
    padding: 1.25rem !important;
  }
  
  .sb-lesson-card .test-chip,
  .sb-lesson-card .study-lecture-chip,
  .sb-lesson-card .share-qr-chip {
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
  }
  
  /* Show examples on tablets with adjusted styling */
  .sb-preview-card {
    font-size: 0.95rem;
    padding: 1.1rem;
  }
  
  /* Breadcrumb tablet optimizations */
  .breadcrumb-bar {
    padding: 0.85rem 1rem !important;
    gap: 0.6rem !important;
  }
  
  .breadcrumb-bar .crumb {
    font-size: 0.85rem !important;
  }
  
  .breadcrumb-bar .back-btn {
    font-size: 0.75rem !important;
    padding: 0.45rem 0.75rem !important;
    min-height: 40px; /* Tablet touch target */
  }
  
  /* Categories buttons tablet layout */
  #categories-buttons {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 0.75rem !important;
  }
  
  #categories-buttons .btn {
    padding: 1rem !important;
    font-size: 1rem !important;
    text-align: center !important;
    min-height: 42px !important;
  }
  
  #categories-buttons .d-flex {
    flex-direction: column !important;
    gap: 0.4rem !important;
  }
}
.nav-primary-group .dropdown-menu-dark .dropdown-toggle::after {
  margin-left: 0.5rem;
}
.nav-primary-group .dropdown-menu-dark .dropdown-menu {
  margin-left: 0.25rem;
}
.nav-primary-group .dropdown-menu-dark .dropend .dropdown-toggle::after {
  transform: rotate(-90deg);
}
.nav-primary-group .dropdown-menu-dark .dropend .dropdown-menu {
  margin-left: 0.5rem;
}
