/* Student stylesheet bundle. Page sections are scoped to body markers. */


/* ============================================================
   CUSTOM
   Enabled by: cf-css-custom
   ============================================================ */
/**
 * CAMPUS FORMULA – Custom CSS
 * ============================
 * Brand: Primary #fabf2c | Dark #212529
 * Tenant can override --cf-accent via PHP-injected \3c style> in header.php
 *
 * Structure:
 *   1. CSS Variables & Reset
 *   2. Typography
 *   3. Layout (wrapper, sidebar, main)
 *   4. Navbar
 *   5. Sidebar
 *   6. Cards & UI Components
 *   7. Skeleton Loaders
 *   8. Practice Module
 *   9. Mock Exam Module
 *  10. Daily Dose
 *  11. Leaderboard
 *  12. Results
 *  13. Notifications
 *  14. Badges & Pills
 *  15. Utilities
 *  16. Responsive
 */

/* ═══════════════════════════════════════════════════════════════════════════
   1. CSS Variables & Reset
   ═══════════════════════════════════════════════════════════════════════════ */
:root:where(:has(body.cf-css-custom)) {
  --cf-accent: #fabf2c;
  --cf-accent-rgb: 250, 191, 44;
  --cf-dark: #212529;
  --cf-dark-2: #2c3136;
  --cf-dark-3: #343a40;
  --cf-sidebar-w: 260px;
  --cf-navbar-h: 62px;
  --cf-radius: 12px;
  --cf-radius-lg: 18px;
  --cf-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  --cf-shadow-md: 0 4px 24px rgba(0, 0, 0, 0.12);
  --cf-transition: 0.2s ease;
  --cf-font: "Plus Jakarta Sans", system-ui, sans-serif;
}

:where(.cf-css-custom) *,:where(.cf-css-custom) 
*::before,:where(.cf-css-custom) 
*::after,*:where(.cf-css-custom),*:where(:has(body.cf-css-custom)),*:where(.cf-css-custom)::before,*:where(:has(body.cf-css-custom))::before,*:where(.cf-css-custom)::after,*:where(:has(body.cf-css-custom))::after {
  box-sizing: border-box;
}

html:where(:has(body:where(.cf-css-custom).cf-css-custom)) {
  scroll-behavior: smooth;
}

body:where(.cf-css-custom) {
  font-family: var(--cf-font);
  background: #f4f5f7;
  color: var(--cf-dark);
  font-size: 0.9rem;
  line-height: 1.6;
  overflow-x: hidden;
}

/* Prevent layout shift when SweetAlert opens */
body:where(.cf-css-custom).swal2-shown {
  padding-right: 0 !important;
}

/* ═══════════════════════════════════════════════════════════════════════════
   2. Typography
   ═══════════════════════════════════════════════════════════════════════════ */
:where(.cf-css-custom) .fw-600 {
  font-weight: 600 !important;
}

:where(.cf-css-custom) .fw-700 {
  font-weight: 700 !important;
}

:where(.cf-css-custom) .fw-800 {
  font-weight: 800 !important;
}

:where(.cf-css-custom) h1,:where(.cf-css-custom) 
h2,:where(.cf-css-custom) 
h3,:where(.cf-css-custom) 
h4,:where(.cf-css-custom) 
h5,:where(.cf-css-custom) 
h6 {
  font-weight: 700;
}

:where(.cf-css-custom) .cf-page-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--cf-dark);
  margin: 0;
}

:where(.cf-css-custom) .cf-section-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--cf-dark);
  margin-bottom: 0.75rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   3. Layout
   ═══════════════════════════════════════════════════════════════════════════ */
:where(.cf-css-custom) .cf-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

:where(.cf-css-custom) .cf-layout {
  display: flex;
  flex: 1;
  padding-top: var(--cf-navbar-h);
}

:where(.cf-css-custom) .cf-main-content {
  flex: 1;
  margin-left: var(--cf-sidebar-w);
  padding: 1.5rem;
  min-height: calc(100vh - var(--cf-navbar-h));
  transition: margin-left var(--cf-transition);
}

/* ═══════════════════════════════════════════════════════════════════════════
   4. Navbar
   ═══════════════════════════════════════════════════════════════════════════ */
:where(.cf-css-custom) .cf-navbar {
  background: var(--cf-dark);
  height: var(--cf-navbar-h);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1040;
  border-bottom: 3px solid var(--cf-accent);
  padding: 0 1rem;
}

:where(.cf-css-custom) .cf-brand-text {
  font-weight: 800;
  font-size: 1.1rem;
  color: white;
  letter-spacing: -0.5px;
}

:where(.cf-css-custom) .cf-logo {
  border-radius: 6px;
  object-fit: contain;
}

:where(.cf-css-custom) .cf-icon-btn {
  color: rgba(255, 255, 255, 0.8);
  padding: 0.4rem;
  position: relative;
  line-height: 1;
}

:where(.cf-css-custom) .cf-icon-btn:hover {
  color: var(--cf-accent);
}

:where(.cf-css-custom) .cf-notif-dot {
  width: 8px;
  height: 8px;
  background: #ef4444;
  border-radius: 50%;
  position: absolute;
  top: 4px;
  right: 4px;
  border: 2px solid var(--cf-dark);
}

:where(.cf-css-custom) .cf-xp-badge,:where(.cf-css-custom) 
.cf-streak-badge {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--cf-accent);
  background: rgba(var(--cf-accent-rgb), 0.12);
  padding: 0.25rem 0.6rem;
  border-radius: 20px;
  border: 1px solid rgba(var(--cf-accent-rgb), 0.25);
}

:where(.cf-css-custom) .cf-streak-badge {
  color: #f97316;
  background: rgba(249, 115, 22, 0.1);
  border-color: rgba(249, 115, 22, 0.2);
}

/* Avatar */
:where(.cf-css-custom) .cf-avatar-btn {
  padding: 0;
  border: none;
  line-height: 1;
  color: rgba(255, 255, 255, 0.8);
}

:where(.cf-css-custom) .cf-avatar-btn::after {
  display: none;
}

/* Remove dropdown arrow */
:where(.cf-css-custom) .cf-avatar-btn:hover {
  color: var(--cf-accent);
}

:where(.cf-css-custom) .cf-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(var(--cf-accent-rgb), 0.4);
}

:where(.cf-css-custom) .cf-avatar-initials {
  background: var(--cf-accent);
  color: var(--cf-dark);
  font-weight: 800;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Dropdown */
:where(.cf-css-custom) .cf-dropdown {
  border: none;
  border-radius: var(--cf-radius);
  box-shadow: var(--cf-shadow-md);
  min-width: 220px;
}

:where(.cf-css-custom) .cf-dropdown .dropdown-item {
  font-size: 0.875rem;
  padding: 0.5rem 1rem;
  border-radius: 8px;
}

:where(.cf-css-custom) .cf-dropdown .dropdown-item:hover {
  background: rgba(var(--cf-accent-rgb), 0.1);
}

/* Sidebar toggle (mobile) */
:where(.cf-css-custom) .cf-sidebar-toggle {
  color: rgba(255, 255, 255, 0.8);
  padding: 0.3rem;
}

:where(.cf-css-custom) .cf-sidebar-toggle:hover {
  color: var(--cf-accent);
}

/* ═══════════════════════════════════════════════════════════════════════════
   5. Sidebar
   ═══════════════════════════════════════════════════════════════════════════ */
:where(.cf-css-custom) .cf-sidebar {
  width: var(--cf-sidebar-w);
  background: var(--cf-dark);
  position: fixed;
  top: var(--cf-navbar-h);
  bottom: 0;
  left: 0;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 1030;
  display: flex;
  flex-direction: column;
  transition: transform var(--cf-transition);
  scrollbar-width: thin;
  scrollbar-color: rgba(var(--cf-accent-rgb), 0.2) transparent;
}

:where(.cf-css-custom) .cf-sidebar-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.25rem 1rem 1rem;
}

:where(.cf-css-custom) .cf-sidebar-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(var(--cf-accent-rgb), 0.4);
  flex-shrink: 0;
}

:where(.cf-css-custom) .cf-sidebar-user-info {
  flex: 1;
  overflow: hidden;
  color: #fff;
}

:where(.cf-css-custom) .cf-plan-badge {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.6);
}

:where(.cf-css-custom) .cf-xp-strip {
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.8rem;
}

:where(.cf-css-custom) .cf-sidebar-divider {
  border-color: rgba(255, 255, 255, 0.08);
  margin: 0 1rem;
}

:where(.cf-css-custom) .cf-sidebar-nav {
  flex: 1;
  padding: 0.5rem 0;
}

:where(.cf-css-custom) .cf-sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1rem;
  color: rgba(255, 255, 255, 0.65);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.875rem;
  border-left: 3px solid transparent;
  transition: all var(--cf-transition);
  position: relative;
  margin: 1px 0.5rem;
  border-radius: var(--cf-radius);
}

:where(.cf-css-custom) .cf-sidebar-link:hover {
  color: var(--cf-accent);
  background: rgba(var(--cf-accent-rgb), 0.08);
}

:where(.cf-css-custom) .cf-sidebar-link.active {
  color: var(--cf-dark);
  background: var(--cf-accent);
  font-weight: 700;
  border-left-color: transparent;
}

:where(.cf-css-custom) .cf-sidebar-link.active .cf-sidebar-icon {
  color: var(--cf-dark);
}

:where(.cf-css-custom) .cf-sidebar-link.locked {
  opacity: 0.5;
  cursor: not-allowed;
}

:where(.cf-css-custom) .cf-sidebar-icon {
  font-size: 1.05rem;
  flex-shrink: 0;
}

:where(.cf-css-custom) .cf-nav-badge {
  background: #ef4444;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 20px;
  margin-left: auto;
}

:where(.cf-css-custom) .cf-sidebar-footer {
  padding: 0.75rem 0.5rem 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* Overlay for mobile */
:where(.cf-css-custom) .cf-sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1029;
}

:where(.cf-css-custom) .cf-sidebar-overlay.show {
  display: block;
}

/* Offcanvas (notifications) */
:where(.cf-css-custom) .cf-offcanvas {
  width: 350px !important;
  border-left: 3px solid var(--cf-accent);
}

:where(.cf-css-custom) .cf-notif-item {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  transition: background var(--cf-transition);
}

:where(.cf-css-custom) .cf-notif-item.unread {
  background: rgba(var(--cf-accent-rgb), 0.08);
  border-color: rgba(var(--cf-accent-rgb), 0.25);
}

/* ═══════════════════════════════════════════════════════════════════════════
   6. Cards & UI Components
   ═══════════════════════════════════════════════════════════════════════════ */
:where(.cf-css-custom) .cf-card {
  background: #fff;
  border: none;
  border-radius: var(--cf-radius-lg);
  box-shadow: var(--cf-shadow);
  overflow: hidden;
}

:where(.cf-css-custom) .cf-card-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Primary Button */
:where(.cf-css-custom) .btn-cf-primary {
  background: var(--cf-accent);
  color: var(--cf-dark);
  font-weight: 700;
  border: none;
  border-radius: 10px;
  padding: 0.6rem 1.4rem;
  transition: all var(--cf-transition);
}

:where(.cf-css-custom) .btn-cf-primary:hover {
  background: color-mix(in srgb, var(--cf-accent) 85%, #000);
  color: var(--cf-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(var(--cf-accent-rgb), 0.4);
}

:where(.cf-css-custom) .btn-cf-primary:active {
  transform: none;
}

/* Outline Button */
:where(.cf-css-custom) .btn-cf-outline {
  background: transparent;
  color: var(--cf-accent);
  border: 2px solid var(--cf-accent);
  font-weight: 700;
  border-radius: 10px;
  padding: 0.5rem 1.2rem;
  transition: all var(--cf-transition);
}

:where(.cf-css-custom) .btn-cf-outline:hover {
  background: var(--cf-accent);
  color: var(--cf-dark);
}

/* Form controls */
:where(.cf-css-custom) .cf-select,:where(.cf-css-custom) 
.cf-input {
  border: 1.5px solid #dee2e6;
  border-radius: 10px;
  padding: 0.55rem 1rem;
  font-family: var(--cf-font);
  font-size: 0.875rem;
  transition: border-color var(--cf-transition);
  width: 100%;
  background: #fff;
}

:where(.cf-css-custom) .cf-select:focus,:where(.cf-css-custom) 
.cf-input:focus {
  outline: none;
  border-color: var(--cf-accent);
  box-shadow: 0 0 0 3px rgba(var(--cf-accent-rgb), 0.15);
}

/* Badge */
:where(.cf-css-custom) .cf-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
}

:where(.cf-css-custom) .cf-badge-accent {
  background: rgba(var(--cf-accent-rgb), 0.15);
  color: color-mix(in srgb, var(--cf-accent) 70%, #000);
}

:where(.cf-css-custom) .cf-badge-green {
  background: rgba(22, 163, 74, 0.1);
  color: #15803d;
}

:where(.cf-css-custom) .cf-badge-red {
  background: rgba(220, 38, 38, 0.1);
  color: #dc2626;
}

:where(.cf-css-custom) .cf-badge-blue {
  background: rgba(37, 99, 235, 0.1);
  color: #1d4ed8;
}

/* ═══════════════════════════════════════════════════════════════════════════
   7. Skeleton Loaders
   ═══════════════════════════════════════════════════════════════════════════ */
@keyframes cfShimmer {
  0% {
    background-position: -600px 0;
  }

  100% {
    background-position: 600px 0;
  }
}

:where(.cf-css-custom) .cf-skeleton {
  background: linear-gradient(90deg, #e8e8e8 25%, #f5f5f5 50%, #e8e8e8 75%);
  background-size: 600px 100%;
  animation: cfShimmer 1.4s infinite linear;
  border-radius: 8px;
}

/* Preset sizes */
:where(.cf-css-custom) .cf-skeleton-text {
  height: 14px;
  width: 100%;
  margin-bottom: 8px;
}

:where(.cf-css-custom) .cf-skeleton-title {
  height: 22px;
  width: 60%;
  margin-bottom: 12px;
}

:where(.cf-css-custom) .cf-skeleton-btn {
  height: 38px;
  width: 120px;
  border-radius: 10px;
}

:where(.cf-css-custom) .cf-skeleton-card {
  height: 140px;
  border-radius: var(--cf-radius-lg);
}

:where(.cf-css-custom) .cf-skeleton-notif {
  height: 72px;
  border-radius: var(--cf-radius);
}

:where(.cf-css-custom) .cf-skeleton-option {
  height: 52px;
  border-radius: 10px;
  margin-bottom: 10px;
}

:where(.cf-css-custom) .cf-skeleton-q {
  height: 100px;
  border-radius: 12px;
  margin-bottom: 16px;
}

/* Question skeleton block */
:where(.cf-css-custom) .cf-skeleton-question-block {
  background: #fff;
  border-radius: var(--cf-radius-lg);
  padding: 1.5rem;
  box-shadow: var(--cf-shadow);
  margin-bottom: 1.25rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   8. Dashboard
   ═══════════════════════════════════════════════════════════════════════════ */

/* Welcome Banner */
:where(.cf-css-custom) .cf-welcome-banner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

:where(.cf-css-custom) .cf-welcome-greeting {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--cf-accent);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.25rem;
}

/* XP Level Card */
:where(.cf-css-custom) .cf-xp-level-card {
  background: #fff;
  border-radius: var(--cf-radius-lg);
  padding: 1rem 1.25rem;
  min-width: 260px;
  box-shadow: var(--cf-shadow);
  flex-shrink: 0;
}

:where(.cf-css-custom) .cf-level-icon {
  font-size: 1.5rem;
  line-height: 1;
}

:where(.cf-css-custom) .cf-xp-bar-bg {
  height: 8px;
  background: #e5e7eb;
  border-radius: 4px;
  overflow: hidden;
}

:where(.cf-css-custom) .cf-xp-bar-fill {
  height: 100%;
  background: var(--cf-accent);
  border-radius: 4px;
  transition: width 0.6s ease;
}

/* Stat Cards */
:where(.cf-css-custom) .cf-stat-card {
  background: #fff;
  border-radius: var(--cf-radius-lg);
  padding: 1.25rem;
  box-shadow: var(--cf-shadow);
  height: 100%;
}

:where(.cf-css-custom) .cf-stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  margin-bottom: 0.75rem;
}

:where(.cf-css-custom) .cf-stat-value {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--cf-dark);
  line-height: 1;
  margin-bottom: 0.2rem;
}

:where(.cf-css-custom) .cf-stat-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--cf-dark);
}

:where(.cf-css-custom) .cf-stat-sub {
  font-size: 0.72rem;
  color: #9ca3af;
}

/* Quick Actions */
:where(.cf-css-custom) .cf-quick-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

:where(.cf-css-custom) .cf-quick-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  background: #fff;
  border: 1.5px solid #e5e7eb;
  border-radius: var(--cf-radius-lg);
  padding: 1rem 0.75rem;
  min-width: 90px;
  flex: 1;
  text-decoration: none;
  color: var(--cf-dark);
  font-size: 0.78rem;
  font-weight: 700;
  transition: all var(--cf-transition);
  position: relative;
}

:where(.cf-css-custom) .cf-quick-btn i {
  font-size: 1.4rem;
  color: var(--cf-accent);
}

:where(.cf-css-custom) .cf-quick-btn:hover {
  border-color: var(--cf-accent);
  background: rgba(var(--cf-accent-rgb), 0.05);
  transform: translateY(-2px);
  box-shadow: var(--cf-shadow);
  color: var(--cf-dark);
}

:where(.cf-css-custom) .cf-quick-btn-dose i {
  color: #f97316;
}

:where(.cf-css-custom) .cf-quick-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 20px;
  background: #ef4444;
  color: #fff;
}

:where(.cf-css-custom) .cf-quick-badge-done {
  background: #22c55e !important;
}

:where(.cf-css-custom) .cf-quick-badge:empty {
  display: none;
}

/* Result rows (reused in dashboard + results page) */
:where(.cf-css-custom) .cf-result-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  flex-shrink: 0;
}

/* Daily Dose CTA Card */
:where(.cf-css-custom) .cf-dose-cta-card {
  border-radius: var(--cf-radius-lg);
  padding: 1.25rem 1.5rem;
  height: 100%;
  display: flex;
  align-items: center;
}

:where(.cf-css-custom) .cf-dose-pending {
  background: linear-gradient(135deg, var(--cf-dark) 0%, #2c3136 100%);
  color: #fff;
}

:where(.cf-css-custom) .cf-dose-done {
  background: linear-gradient(135deg, #166534 0%, #14532d 100%);
  color: #fff;
}

/* Link button */
:where(.cf-css-custom) .cf-btn-link {
  color: var(--cf-accent);
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
}

:where(.cf-css-custom) .cf-btn-link:hover {
  background: rgba(var(--cf-accent-rgb), 0.1);
  color: var(--cf-accent);
}

/* ═══════════════════════════════════════════════════════════════════════════
   9. Practice Module
   ═══════════════════════════════════════════════════════════════════════════ */

/* Filter bar */
:where(.cf-css-custom) .cf-filter-bar {
  background: #fff;
  border-radius: var(--cf-radius-lg);
  padding: 1.25rem;
  box-shadow: var(--cf-shadow);
  margin-bottom: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-end;
}

:where(.cf-css-custom) .cf-filter-bar label {
  font-size: 0.78rem;
  font-weight: 700;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.3rem;
  display: block;
}

:where(.cf-css-custom) .cf-filter-group {
  flex: 1;
  min-width: 160px;
}

/* Question card */
:where(.cf-css-custom) .cf-question-card {
  background: #fff;
  border-radius: var(--cf-radius-lg);
  padding: 1.5rem;
  box-shadow: var(--cf-shadow);
  margin-bottom: 1.25rem;
  border-left: 4px solid transparent;
  transition:
    border-color var(--cf-transition),
    box-shadow var(--cf-transition);
}

:where(.cf-css-custom) .cf-question-card.answered-correct {
  border-left-color: #22c55e;
}

:where(.cf-css-custom) .cf-question-card.answered-wrong {
  border-left-color: #ef4444;
}

:where(.cf-css-custom) .cf-question-card.answered-skip {
  border-left-color: #94a3b8;
}

:where(.cf-css-custom) .cf-q-number {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--cf-accent);
  background: rgba(var(--cf-accent-rgb), 0.1);
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
  display: inline-block;
  margin-bottom: 0.75rem;
}

:where(.cf-css-custom) .cf-q-text {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--cf-dark);
  line-height: 1.7;
  margin-bottom: 1rem;
}

:where(.cf-css-custom) .cf-q-image {
  max-width: 100%;
  max-height: 300px;
  border-radius: 10px;
  margin-bottom: 1rem;
  object-fit: contain;
}

/* Options */
:where(.cf-css-custom) .cf-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 1rem;
  border: 1.5px solid #e5e7eb;
  border-radius: 10px;
  margin-bottom: 0.6rem;
  cursor: pointer;
  transition: all var(--cf-transition);
  user-select: none;
}

:where(.cf-css-custom) .cf-option:hover {
  border-color: var(--cf-accent);
  background: rgba(var(--cf-accent-rgb), 0.04);
}

:where(.cf-css-custom) .cf-option.selected {
  border-color: var(--cf-accent);
  background: rgba(var(--cf-accent-rgb), 0.1);
}

:where(.cf-css-custom) .cf-option.correct {
  border-color: #22c55e;
  background: rgba(34, 197, 94, 0.08);
}

:where(.cf-css-custom) .cf-option.wrong {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.08);
}

:where(.cf-css-custom) .cf-option.disabled {
  pointer-events: none;
}

:where(.cf-css-custom) .cf-option-letter {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #f3f4f6;
  color: #374151;
  font-weight: 700;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--cf-transition);
}

:where(.cf-css-custom) .cf-option.selected .cf-option-letter {
  background: var(--cf-accent);
  color: var(--cf-dark);
}

:where(.cf-css-custom) .cf-option.correct .cf-option-letter {
  background: #22c55e;
  color: #fff;
}

:where(.cf-css-custom) .cf-option.wrong .cf-option-letter {
  background: #ef4444;
  color: #fff;
}

:where(.cf-css-custom) .cf-option-text {
  font-size: 0.875rem;
  flex: 1;
  color: var(--cf-dark);
}

/* Explanation box */
/* .cf-explanation {
  background: rgba(var(--cf-accent-rgb), 0.06);
  border: 1px solid rgba(var(--cf-accent-rgb), 0.2);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  margin-top: 1rem;
  font-size: 0.875rem;
  display: none;
}
.cf-explanation.show {
  display: block;
}
.cf-explanation strong {
  color: var(--cf-dark);
} */

/* Progress bar (practice session) */
:where(.cf-css-custom) .cf-practice-progress {
  height: 6px;
  background: #e5e7eb;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 1.5rem;
}

:where(.cf-css-custom) .cf-practice-progress-fill {
  height: 100%;
  background: var(--cf-accent);
  border-radius: 3px;
  transition: width 0.3s ease;
}

/* Score summary card */
:where(.cf-css-custom) .cf-score-card {
  background: var(--cf-dark);
  color: #fff;
  border-radius: var(--cf-radius-lg);
  padding: 2rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

:where(.cf-css-custom) .cf-score-card::before {
  content: "";
  position: absolute;
  top: -40px;
  right: -40px;
  width: 160px;
  height: 160px;
  background: rgba(var(--cf-accent-rgb), 0.15);
  border-radius: 50%;
}

:where(.cf-css-custom) .cf-score-big {
  font-size: 3.5rem;
  font-weight: 800;
  color: var(--cf-accent);
  line-height: 1;
}

/* Pagination nav */
:where(.cf-css-custom) .cf-pagination {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

:where(.cf-css-custom) .cf-page-btn {
  width: 36px;
  height: 36px;
  border: 1.5px solid #dee2e6;
  background: #fff;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--cf-transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

:where(.cf-css-custom) .cf-page-btn:hover,:where(.cf-css-custom) 
.cf-page-btn.active {
  background: var(--cf-accent);
  border-color: var(--cf-accent);
  color: var(--cf-dark);
}

/* ═══════════════════════════════════════════════════════════════════════════
   9. Mock Exam Module
   ═══════════════════════════════════════════════════════════════════════════ */
/* Mock listing cards */
:where(.cf-css-custom) .cf-mock-card {
  background: #fff;
  border-radius: var(--cf-radius-lg);
  box-shadow: var(--cf-shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
  transition:
    transform var(--cf-transition),
    box-shadow var(--cf-transition);
}

:where(.cf-css-custom) .cf-mock-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--cf-shadow-md);
}

:where(.cf-css-custom) .cf-mock-card-header {
  padding: 1rem 1.1rem 0.75rem;
  border-bottom: 1px solid #f0f0f0;
  background: linear-gradient(135deg, #fafafa 0%, #fff 100%);
}

:where(.cf-css-custom) .cf-mock-card-body {
  padding: 0.75rem 1.1rem;
  flex: 1;
}

:where(.cf-css-custom) .cf-mock-card-footer {
  padding: 0.75rem 1.1rem 1rem;
  border-top: 1px solid #f0f0f0;
}

:where(.cf-css-custom) .cf-mock-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: #6b7280;
}

:where(.cf-css-custom) .cf-mock-meta span {
  display: flex;
  align-items: center;
  gap: 0.2rem;
}

:where(.cf-css-custom) .cf-timer-bar {
  background: var(--cf-dark);
  color: var(--cf-accent);
  font-size: 1.2rem;
  font-weight: 800;
  padding: 0.5rem 1.25rem;
  border-radius: var(--cf-radius);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-variant-numeric: tabular-nums;
}

:where(.cf-css-custom) .cf-timer-bar.danger {
  color: #ef4444;
  animation: pulse 0.8s infinite;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.6;
  }
}

:where(.cf-css-custom) .cf-subject-tab-nav {
  gap: 0.5rem;
  flex-wrap: wrap;
}

:where(.cf-css-custom) .cf-subject-tab {
  padding: 0.4rem 1rem;
  border-radius: 20px;
  border: 1.5px solid #dee2e6;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  background: #fff;
  transition: all var(--cf-transition);
}

:where(.cf-css-custom) .cf-subject-tab.active {
  background: var(--cf-accent);
  border-color: var(--cf-accent);
  color: var(--cf-dark);
}

/* ═══════════════════════════════════════════════════════════════════════════
   10. Daily Dose
   ═══════════════════════════════════════════════════════════════════════════ */

/* Network offline banner */
:where(.cf-css-custom) .cf-network-banner {
  background: #1e3a5f;
  color: #93c5fd;
  border-radius: var(--cf-radius);
  padding: 0.65rem 1.1rem;
  margin-bottom: 1rem;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  border-left: 4px solid #3b82f6;
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Completion banner */
:where(.cf-css-custom) .cf-dose-complete-banner {
  background: linear-gradient(135deg, var(--cf-dark) 0%, #1a2035 100%);
  color: #fff;
  padding: 2.5rem 2rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

:where(.cf-css-custom) .cf-dose-complete-banner::before {
  content: "";
  position: absolute;
  top: -60px;
  right: -60px;
  width: 200px;
  height: 200px;
  background: rgba(var(--cf-accent-rgb), 0.08);
  border-radius: 50%;
}

/* Session header */
:where(.cf-css-custom) .cf-dose-session-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

/* XP chip that floats in on correct answer */
:where(.cf-css-custom) .cf-dose-xp-chip {
  background: rgba(var(--cf-accent-rgb), 0.15);
  color: color-mix(in srgb, var(--cf-accent) 70%, #000);
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.15rem 0.5rem;
  border-radius: 20px;
  border: 1px solid rgba(var(--cf-accent-rgb), 0.3);
}

:where(.cf-css-custom) .cf-dose-xp-chip-show {
  animation: xpPop 0.4s ease;
}

@keyframes xpPop {
  0% {
    opacity: 0;
    transform: scale(0.6);
  }

  70% {
    transform: scale(1.15);
  }

  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* XP badge pulse */
:where(.cf-css-custom) .cf-xp-pulse {
  animation: xpPulse 0.5s ease;
}

@keyframes xpPulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.12);
    box-shadow: 0 0 12px rgba(var(--cf-accent-rgb), 0.5);
  }
}

/* Sync status indicator (fixed bottom right) */
:where(.cf-css-custom) .cf-sync-indicator {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 20px;
  padding: 0.3rem 0.85rem;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  box-shadow: var(--cf-shadow);
  z-index: 500;
  transition: opacity 0.3s;
}

/* Spinning icon for sync */
:where(.cf-css-custom) .cf-spin {
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

:where(.cf-css-custom) .cf-dose-header {
  background: linear-gradient(135deg, var(--cf-dark) 60%, var(--cf-dark-2));
  color: #fff;
  border-radius: var(--cf-radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  position: relative;
  overflow: hidden;
}

:where(.cf-css-custom) .cf-dose-header::after {
  content: "⚡";
  position: absolute;
  right: 1.5rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 4rem;
  opacity: 0.08;
}

:where(.cf-css-custom) .cf-dose-xp {
  background: rgba(var(--cf-accent-rgb), 0.15);
  color: var(--cf-accent);
  border-radius: var(--cf-radius);
  padding: 0.4rem 1rem;
  font-weight: 700;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   11. Leaderboard
   ═══════════════════════════════════════════════════════════════════════════ */

/* Tab nav */
:where(.cf-css-custom) .cf-lb-tabs {
  border-bottom: 2px solid #e5e7eb;
  gap: 0.25rem;
  flex-wrap: wrap;
}

:where(.cf-css-custom) .cf-lb-tab {
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  padding: 0.65rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #6b7280;
  cursor: pointer;
  transition: all var(--cf-transition);
  border-radius: 0;
}

:where(.cf-css-custom) .cf-lb-tab:hover {
  color: var(--cf-accent);
}

:where(.cf-css-custom) .cf-lb-tab.active {
  color: var(--cf-dark);
  border-bottom-color: var(--cf-accent);
}

/* My rank cards */
:where(.cf-css-custom) .cf-my-rank-card {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  background: #fff;
  border-radius: var(--cf-radius);
  padding: 0.5rem 1rem;
  box-shadow: var(--cf-shadow);
  margin-left: 0.5rem;
}

:where(.cf-css-custom) .cf-my-rank-num {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--cf-accent);
  line-height: 1;
}

/* ── PODIUM ── */
:where(.cf-css-custom) .cf-podium-wrap {
  padding: 1.5rem 1.5rem 0.5rem;
  background: linear-gradient(180deg,
      rgba(var(--cf-accent-rgb), 0.06) 0%,
      transparent 100%);
  border-bottom: 1px solid #f0f0f0;
}

:where(.cf-css-custom) .cf-podium {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 1.5rem;
}

:where(.cf-css-custom) .cf-podium-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  padding-bottom: 1rem;
  animation: podiumRise 0.5s ease both;
}

@keyframes podiumRise {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

:where(.cf-css-custom) .cf-podium-1 {
  animation-delay: 0.1s;
}

:where(.cf-css-custom) .cf-podium-2 {
  animation-delay: 0.2s;
}

:where(.cf-css-custom) .cf-podium-3 {
  animation-delay: 0.3s;
}

:where(.cf-css-custom) .cf-podium-slot::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 4px 4px 0 0;
  width: 80px;
}

:where(.cf-css-custom) .cf-podium-1::after {
  height: 60px;
  background: var(--cf-accent);
  opacity: 0.15;
}

:where(.cf-css-custom) .cf-podium-2::after {
  height: 42px;
  background: #c0c0c0;
  opacity: 0.2;
}

:where(.cf-css-custom) .cf-podium-3::after {
  height: 28px;
  background: #cd7f32;
  opacity: 0.2;
}

:where(.cf-css-custom) .cf-podium-medal {
  font-size: 1.8rem;
  margin-bottom: 0.4rem;
}

:where(.cf-css-custom) .cf-podium-avatar {
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  margin-bottom: 0.5rem;
}

:where(.cf-css-custom) .cf-podium-name {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--cf-dark);
  max-width: 100px;
  word-break: break-word;
  line-height: 1.3;
}

/* Row list */
:where(.cf-css-custom) .cf-leaderboard-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  border-radius: var(--cf-radius);
  transition: background var(--cf-transition);
}

:where(.cf-css-custom) .cf-leaderboard-row:hover {
  background: #f8f9fa;
}

:where(.cf-css-custom) .cf-leaderboard-row.me {
  background: rgba(var(--cf-accent-rgb), 0.08);
  border: 1.5px solid rgba(var(--cf-accent-rgb), 0.25);
}

:where(.cf-css-custom) .cf-rank-badge {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-weight: 800;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

:where(.cf-css-custom) .cf-rank-1 {
  background: #ffd700;
  color: #000;
}

:where(.cf-css-custom) .cf-rank-2 {
  background: #c0c0c0;
  color: #000;
}

:where(.cf-css-custom) .cf-rank-3 {
  background: #cd7f32;
  color: #fff;
}

:where(.cf-css-custom) .cf-rank-n {
  background: #f3f4f6;
  color: #374151;
}

/* ═══════════════════════════════════════════════════════════════════════════
   12. Results
   ═══════════════════════════════════════════════════════════════════════════ */
:where(.cf-css-custom) .cf-result-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #f0f0f0;
  transition: background var(--cf-transition);
}

:where(.cf-css-custom) .cf-result-row:last-child {
  border-bottom: none;
}

:where(.cf-css-custom) .cf-result-row:hover {
  background: #fafafa;
}

:where(.cf-css-custom) .cf-score-pill {
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
}

:where(.cf-css-custom) .cf-score-high {
  background: rgba(34, 197, 94, 0.12);
  color: #15803d;
}

:where(.cf-css-custom) .cf-score-mid {
  background: rgba(234, 179, 8, 0.12);
  color: #854d0e;
}

:where(.cf-css-custom) .cf-score-low {
  background: rgba(239, 68, 68, 0.12);
  color: #b91c1c;
}

/* ═══════════════════════════════════════════════════════════════════════════
   12. Results
   ═══════════════════════════════════════════════════════════════════════════ */

/* Expand button */
:where(.cf-css-custom) .cf-expand-btn {
  width: 30px;
  height: 30px;
  border: 1.5px solid #dee2e6;
  border-radius: 8px;
  background: #fff;
  color: #6b7280;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--cf-transition);
}

:where(.cf-css-custom) .cf-expand-btn:hover {
  border-color: var(--cf-accent);
  color: var(--cf-accent);
}

/* Detail panel */
:where(.cf-css-custom) .cf-result-detail {
  background: #f8f9fa;
  border-top: 1px solid #f0f0f0;
  border-bottom: 1px solid #f0f0f0;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

:where(.cf-css-custom) .cf-detail-table {
  padding: 0.75rem 1rem;
}

:where(.cf-css-custom) .cf-detail-row {
  display: flex;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  margin-bottom: 0.4rem;
  border-left: 3px solid transparent;
}

:where(.cf-css-custom) .cf-detail-row.correct {
  background: rgba(34, 197, 94, 0.05);
  border-left-color: #22c55e;
}

:where(.cf-css-custom) .cf-detail-row.wrong {
  background: rgba(239, 68, 68, 0.05);
  border-left-color: #ef4444;
}

:where(.cf-css-custom) .cf-detail-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #e5e7eb;
  font-size: 0.7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

:where(.cf-css-custom) .cf-detail-q {
  color: var(--cf-dark);
  line-height: 1.5;
}

:where(.cf-css-custom) .cf-detail-exp {
  background: rgba(var(--cf-accent-rgb), 0.06);
  border-radius: 6px;
  padding: 0.4rem 0.6rem;
  color: #6b7280;
  font-style: italic;
}

/* ═══════════════════════════════════════════════════════════════════════════
   13. Notifications
   ═══════════════════════════════════════════════════════════════════════════ */
:where(.cf-css-custom) .cf-notif-card {
  border-radius: var(--cf-radius);
  padding: 0.85rem 1rem;
  background: #fff;
  border: 1px solid #e5e7eb;
  margin-bottom: 0.6rem;
  transition: all var(--cf-transition);
}

:where(.cf-css-custom) .cf-notif-card.unread {
  background: rgba(var(--cf-accent-rgb), 0.05);
  border-color: rgba(var(--cf-accent-rgb), 0.2);
}

/* ═══════════════════════════════════════════════════════════════════════════
   14. Badges & Pills
   ═══════════════════════════════════════════════════════════════════════════ */
:where(.cf-css-custom) .cf-difficulty-easy {
  color: #15803d;
  font-weight: 700;
  font-size: 0.75rem;
}

:where(.cf-css-custom) .cf-difficulty-medium {
  color: #b45309;
  font-weight: 700;
  font-size: 0.75rem;
}

:where(.cf-css-custom) .cf-difficulty-hard {
  color: #b91c1c;
  font-weight: 700;
  font-size: 0.75rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   15. Utilities
   ═══════════════════════════════════════════════════════════════════════════ */
:where(.cf-css-custom) .cf-divider {
  border: none;
  border-top: 1px solid #f0f0f0;
  margin: 1rem 0;
}

:where(.cf-css-custom) .cf-empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: #9ca3af;
}

:where(.cf-css-custom) .cf-empty-state i {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  display: block;
}

:where(.cf-css-custom) .cf-loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2.5px solid rgba(var(--cf-accent-rgb), 0.3);
  border-top-color: var(--cf-accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

/* Make images in question text responsive */
:where(.cf-css-custom) .cf-q-text img,:where(.cf-css-custom) 
.cf-q-text table {
  max-width: 100%;
}

/* Prevent text selection during exam */
:where(.cf-css-custom) .no-select {
  user-select: none;
  -webkit-user-select: none;
}

/* ═══════════════════════════════════════════════════════════════════════════
   16. Responsive
   ═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 991.98px) {
  :where(.cf-css-custom) .cf-sidebar {
    transform: translateX(-100%);
  }

  :where(.cf-css-custom) .cf-sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.3);
  }

  :where(.cf-css-custom) .cf-main-content {
    margin-left: 0;
    padding: 1rem;
  }

  :where(.cf-css-custom) .cf-filter-bar {
    flex-direction: column;
  }

  :where(.cf-css-custom) .cf-filter-group {
    min-width: 100%;
  }
}

@media (max-width: 575.98px) {
  :where(.cf-css-custom) .cf-score-big {
    font-size: 2.5rem;
  }

  :where(.cf-css-custom) .cf-question-card {
    padding: 1rem;
  }

  :where(.cf-css-custom) .cf-main-content {
    padding: 0.75rem;
  }

  :where(.cf-css-custom) .cf-timer-bar {
    font-size: 1rem;
  }
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
  /* Intentionally not implemented – tenant branding overrides */
}

/* ═══════════════════════════════════════════════════════════════════════════
   User Notifications Page
   ═══════════════════════════════════════════════════════════════════════════ */

/* Tab bar */
:where(.cf-css-custom) .cf-notif-tabs {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  padding: 0.4rem;
  background: #fff;
  border-radius: var(--cf-radius-lg);
  box-shadow: var(--cf-shadow);
}

:where(.cf-css-custom) .cf-notif-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.5rem 1rem;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: #6b7280;
  font-size: 0.82rem;
  font-weight: 600;
  font-family: var(--cf-font);
  cursor: pointer;
  transition: all var(--cf-transition);
  white-space: nowrap;
}

:where(.cf-css-custom) .cf-notif-tab:hover {
  background: #f3f4f6;
  color: var(--cf-dark);
}

:where(.cf-css-custom) .cf-notif-tab.active {
  background: var(--cf-accent);
  color: var(--cf-dark);
}

:where(.cf-css-custom) .cf-notif-tab-count {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 10px;
  padding: 0 5px;
  font-size: 0.68rem;
  font-weight: 800;
  min-width: 18px;
  text-align: center;
  line-height: 1.5;
}

:where(.cf-css-custom) .cf-notif-tab.active .cf-notif-tab-count {
  background: rgba(0, 0, 0, 0.15);
}

:where(.cf-css-custom) .unread-tab-badge {
  background: #ef4444 !important;
  color: #fff !important;
}

/* Notification card */
:where(.cf-css-custom) .cf-notif-user-card {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem 1.1rem;
  background: #fff;
  border-radius: var(--cf-radius-lg);
  border: 1px solid #e5e7eb;
  margin-bottom: 0.6rem;
  cursor: pointer;
  transition: all var(--cf-transition);
  position: relative;
}

:where(.cf-css-custom) .cf-notif-user-card:hover {
  border-color: rgba(var(--cf-accent-rgb), 0.3);
  box-shadow: var(--cf-shadow);
  transform: translateY(-1px);
}

:where(.cf-css-custom) .cf-notif-user-card.unread {
  background: rgba(var(--cf-accent-rgb), 0.04);
  border-color: rgba(var(--cf-accent-rgb), 0.2);
}

:where(.cf-css-custom) .cf-notif-user-card.unread::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 60%;
  background: var(--cf-accent);
  border-radius: 0 3px 3px 0;
}

:where(.cf-css-custom) .cf-notif-user-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
}

:where(.cf-css-custom) .cf-notif-user-body {
  flex: 1;
  min-width: 0;
}

:where(.cf-css-custom) .cf-notif-user-title {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--cf-dark);
  margin-bottom: 0.25rem;
}

:where(.cf-css-custom) .cf-notif-user-preview {
  font-size: 0.82rem;
  color: #6b7280;
  line-height: 1.5;
  display: -webkit-box;
  /* -webkit-line-clamp: 2; */
  -webkit-box-orient: vertical;
  overflow: hidden;
}

:where(.cf-css-custom) .cf-notif-user-detail {
  font-size: 0.875rem;
  color: #374151;
  line-height: 1.7;
  margin-top: 0.35rem;
  padding: 0.75rem;
  background: #f8f9fa;
  border-radius: 8px;
  border-left: 3px solid var(--cf-accent);
  animation: fadeIn 0.2s ease;
}

:where(.cf-css-custom) .cf-notif-user-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.4rem;
  font-size: 0.72rem;
  color: #9ca3af;
}

:where(.cf-css-custom) .cf-notif-user-chevron {
  color: #9ca3af;
  font-size: 0.8rem;
  flex-shrink: 0;
  margin-top: 0.15rem;
  transition: transform 0.2s;
}

/* Unread dot */
:where(.cf-css-custom) .cf-unread-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cf-accent);
  flex-shrink: 0;
  margin-top: 3px;
}

/* Heading unread badge */
:where(.cf-css-custom) .cf-unread-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ef4444;
  color: #fff;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 0.1rem 0.5rem;
  vertical-align: middle;
  margin-left: 0.4rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Profile Page
   ═══════════════════════════════════════════════════════════════════════════ */

/* Avatar edit button */
:where(.cf-css-custom) .cf-avatar-edit-btn {
  position: absolute;
  bottom: -4px;
  right: -4px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--cf-accent);
  color: var(--cf-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  cursor: pointer;
  border: 2px solid #fff;
  transition: transform 0.2s;
}

:where(.cf-css-custom) .cf-avatar-edit-btn:hover {
  transform: scale(1.1);
}

/* Subject toggle checkboxes */
:where(.cf-css-custom) .cf-subject-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.8rem;
  border-radius: 20px;
  border: 1.5px solid #dee2e6;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  color: #6b7280;
  user-select: none;
}

:where(.cf-css-custom) .cf-subject-toggle input {
  display: none;
}

:where(.cf-css-custom) .cf-subject-toggle:hover {
  border-color: var(--cf-accent);
  color: var(--cf-dark);
}

:where(.cf-css-custom) .cf-subject-toggle.checked {
  background: rgba(var(--cf-accent-rgb), 0.12);
  border-color: var(--cf-accent);
  color: color-mix(in srgb, var(--cf-accent) 60%, #000);
}

/* ═══════════════════════════════════════════════════════════════════════════
   Resources Hub
   ═══════════════════════════════════════════════════════════════════════════ */
:where(.cf-css-custom) .cf-resource-card {
  background: #fff;
  border-radius: var(--cf-radius-lg);
  border: 1px solid #e5e7eb;
  padding: 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  transition: all var(--cf-transition);
  height: 100%;
}

:where(.cf-css-custom) .cf-resource-card:hover {
  border-color: rgba(var(--cf-accent-rgb), 0.3);
  box-shadow: var(--cf-shadow);
  transform: translateY(-2px);
}

:where(.cf-css-custom) .cf-resource-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

:where(.cf-css-custom) .cf-resource-info {
  flex: 1;
  min-width: 0;
}

:where(.cf-css-custom) .cf-resource-name {
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--cf-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0.3rem;
}

:where(.cf-css-custom) .cf-resource-meta {
  display: flex;
  gap: 0.75rem;
  font-size: 0.72rem;
  color: #9ca3af;
  flex-wrap: wrap;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Upgrade Page table
   ═══════════════════════════════════════════════════════════════════════════ */
:where(.cf-css-custom) .cf-plan-table td,:where(.cf-css-custom) 
.cf-plan-table th {
  vertical-align: middle;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Hover row (admin dashboard recent mocks)
   ═══════════════════════════════════════════════════════════════════════════ */
:where(.cf-css-custom) .cf-hover-row {
  transition: background var(--cf-transition);
}

:where(.cf-css-custom) .cf-hover-row:hover {
  background: #f8f9fa;
}


/* ============================================================
   DASHBOARD
   Enabled by: cf-css-dashboard
   ============================================================ */
/* ═══════════════════════════════════════════════════════════════════════════
   CAMPUS FORMULA – Dashboard (mobile-first)
   Depends on custom.css variables: --cf-accent, --cf-accent-rgb, --cf-dark,
   --cf-radius, --cf-radius-lg, --cf-shadow, --cf-font
   ═══════════════════════════════════════════════════════════════════════════ */

/* Safe-area + spacing tokens */
:root:where(:has(body.cf-css-dashboard)) {
    --cf-dash-gap: clamp(0.75rem, 2.5vw, 1.25rem);
    --cf-dash-pad: clamp(0.9rem, 3vw, 1.5rem);
    --cf-tap-min: 44px;
}

:where(.cf-css-dashboard) .cf-dashboard {
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 1.5rem);
    display: flex;
    flex-direction: column;
    gap: var(--cf-dash-gap);
}

:where(.cf-css-dashboard) .cf-dashboard-section {
    margin: 0;
}

:where(.cf-css-dashboard) .cf-section-heading {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--cf-dark);
    margin: 0.25rem 0 0.1rem 0.1rem;
    letter-spacing: -0.2px;
}

/* Reusable accent link */
:where(.cf-css-dashboard) .cf-link-accent {
    color: var(--cf-accent);
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 2px;
}

:where(.cf-css-dashboard) .cf-link-accent:hover {
    color: var(--cf-accent);
}

/* ═══════════════════════════════════════════════════════════════════════════
   1. GREETING
   ═══════════════════════════════════════════════════════════════════════════ */
:where(.cf-css-dashboard) .cf-greeting-section {
    display: flex;
    flex-direction: column;
    /* mobile: stacked */
    gap: var(--cf-dash-gap);
}

:where(.cf-css-dashboard) .cf-greeting {
    padding: 0.25rem 0.15rem;
}

:where(.cf-css-dashboard) .cf-greeting-eyebrow {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: var(--cf-accent);
    margin-bottom: 0.15rem;
}

:where(.cf-css-dashboard) .cf-greeting-name {
    font-size: clamp(1.35rem, 4.5vw, 1.75rem);
    font-weight: 800;
    color: var(--cf-dark);
    margin: 0 0 0.35rem 0;
    line-height: 1.2;
}

:where(.cf-css-dashboard) .cf-greeting-sub {
    font-size: 0.85rem;
    color: #4b5563;
    margin: 0 0 0.2rem 0;
    line-height: 1.55;
}

:where(.cf-css-dashboard) .cf-greeting-sub--muted {
    color: #6b7280;
}

:where(.cf-css-dashboard) .cf-streak-inline {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    background: rgba(249, 115, 22, 0.12);
    color: #b45309;
    padding: 0.1rem 0.5rem;
    border-radius: 999px;
    font-weight: 800;
    font-size: 0.82rem;
}

:where(.cf-css-dashboard) .cf-streak-inline i {
    font-size: 0.9rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   XP LEVEL CARD
   ═══════════════════════════════════════════════════════════════════════════ */
:where(.cf-css-dashboard) .cf-xp-level-card {
    background: #fff;
    border-radius: var(--cf-radius-lg);
    padding: 1rem 1.1rem;
    box-shadow: var(--cf-shadow);
    border: 1px solid #f0f1f3;
}

:where(.cf-css-dashboard) .cf-xp-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.7rem;
}

:where(.cf-css-dashboard) .cf-xp-identity {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-width: 0;
}

:where(.cf-css-dashboard) .cf-level-icon {
    font-size: 1.45rem;
    line-height: 1;
    flex-shrink: 0;
}

:where(.cf-css-dashboard) .cf-xp-titles {
    min-width: 0;
}

:where(.cf-css-dashboard) .cf-xp-title {
    font-weight: 800;
    font-size: 0.9rem;
    color: var(--cf-dark);
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

:where(.cf-css-dashboard) .cf-xp-subtitle {
    font-size: 0.7rem;
    color: #9ca3af;
    font-weight: 600;
}

:where(.cf-css-dashboard) .cf-xp-amount {
    font-weight: 800;
    font-size: 1.05rem;
    color: var(--cf-accent);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

:where(.cf-css-dashboard) .cf-xp-amount small {
    font-size: 0.7rem;
    color: #9ca3af;
    font-weight: 700;
}

:where(.cf-css-dashboard) .cf-xp-bar-bg {
    height: 10px;
    background: #eef0f3;
    border-radius: 999px;
    overflow: hidden;
}

:where(.cf-css-dashboard) .cf-xp-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--cf-accent), color-mix(in srgb, var(--cf-accent) 70%, #fff));
    border-radius: 999px;
    transition: width 0.8s cubic-bezier(.22, .9, .32, 1);
}

:where(.cf-css-dashboard) .cf-xp-meta {
    display: flex;
    justify-content: space-between;
    margin-top: 0.4rem;
    font-size: 0.68rem;
    color: #9ca3af;
    font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════════════════════
   2. FORMULA PANEL (journey) — container only, panel has its own CSS
   ═══════════════════════════════════════════════════════════════════════════ */
:where(.cf-css-dashboard) .cf-dashboard-section--formula {
    margin-top: 0.25rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   3. STATS CARDS (grid: 2-up mobile, 4-up ≥lg)
   ═══════════════════════════════════════════════════════════════════════════ */
:where(.cf-css-dashboard) .cf-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--cf-dash-gap);
}

:where(.cf-css-dashboard) .cf-stat-card {
    background: #fff;
    border-radius: var(--cf-radius-lg);
    padding: 1rem;
    box-shadow: var(--cf-shadow);
    border: 1px solid #f0f1f3;
    border-top: 3px solid var(--cf-accent);
    min-height: 108px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Stat card internals — matches JS renderer */
:where(.cf-css-dashboard) .cf-stat-card .cf-stat-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    background: rgba(var(--cf-accent-rgb), 0.12);
    color: var(--cf-accent);
}

:where(.cf-css-dashboard) .cf-stat-card .cf-stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--cf-dark);
    line-height: 1;
    margin-bottom: 0.15rem;
    font-variant-numeric: tabular-nums;
}

:where(.cf-css-dashboard) .cf-stat-card .cf-stat-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--cf-dark);
}

:where(.cf-css-dashboard) .cf-stat-card .cf-stat-sub {
    font-size: 0.68rem;
    color: #9ca3af;
    margin-top: 0.15rem;
}

:where(.cf-css-dashboard) .cf-skeleton-card {
    height: 108px;
    border-top-color: transparent;
    background: linear-gradient(90deg, #e8e8e8 25%, #f5f5f5 50%, #e8e8e8 75%);
    background-size: 600px 100%;
    animation: cfShimmer 1.4s infinite linear;
}

/* ═══════════════════════════════════════════════════════════════════════════
   4. QUICK ACTIONS (grid: 2 mobile, up to N on desktop)
   ═══════════════════════════════════════════════════════════════════════════ */
:where(.cf-css-dashboard) .cf-quick-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
}

:where(.cf-css-dashboard) .cf-quick-btn {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    background: #fff;
    border: 1.5px solid #e5e7eb;
    border-radius: var(--cf-radius-lg);
    padding: 0.95rem 0.6rem;
    min-height: 92px;
    text-decoration: none;
    color: var(--cf-dark);
    font-size: 0.78rem;
    font-weight: 700;
    transition: transform var(--cf-transition), border-color var(--cf-transition), box-shadow var(--cf-transition), background var(--cf-transition);
    -webkit-tap-highlight-color: transparent;
}

:where(.cf-css-dashboard) .cf-quick-btn i {
    font-size: 1.45rem;
    color: var(--cf-accent);
    line-height: 1;
}

:where(.cf-css-dashboard) .cf-quick-btn:hover,:where(.cf-css-dashboard) 
.cf-quick-btn:focus-visible {
    border-color: var(--cf-accent);
    background: var(--cf-accent-soft, rgba(var(--cf-accent-rgb), 0.08));
    color: var(--cf-dark);
    transform: translateY(-2px);
    box-shadow: var(--cf-shadow);
    outline: none;
}

:where(.cf-css-dashboard) .cf-quick-btn-dose i {
    color: #f97316;
}

:where(.cf-css-dashboard) .cf-quick-btn .cf-quick-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    font-size: 0.6rem;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    line-height: 1;
}

:where(.cf-css-dashboard) .cf-quick-btn .cf-quick-badge:empty {
    display: none;
}

:where(.cf-css-dashboard) .cf-quick-btn .cf-quick-badge.cf-quick-badge-done {
    background: #22c55e;
}

/* ═══════════════════════════════════════════════════════════════════════════
   5. DOSE CTA + TIP
   ═══════════════════════════════════════════════════════════════════════════ */
:where(.cf-css-dashboard) .cf-dose-tip-grid {
    display: grid;
    grid-template-columns: 1fr;
    /* mobile: stacked */
    gap: var(--cf-dash-gap);
}

:where(.cf-css-dashboard) .cf-tip-card {
    padding: 1.1rem 1.2rem;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

:where(.cf-css-dashboard) .cf-tip-label {
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: var(--cf-accent);
    margin-bottom: 0.35rem;
}

:where(.cf-css-dashboard) .cf-tip-text {
    font-size: 0.9rem;
    color: var(--cf-dark);
    line-height: 1.6;
    margin: 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   6. RECENT RESULTS
   ═══════════════════════════════════════════════════════════════════════════ */
:where(.cf-css-dashboard) .cf-results-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--cf-dash-gap);
}

:where(.cf-css-dashboard) .cf-result-panel {
    overflow: hidden;
}

:where(.cf-css-dashboard) .cf-result-list {
    padding: 0.5rem 0.75rem 0.75rem;
}

:where(.cf-css-dashboard) .cf-result-skeleton,:where(.cf-css-dashboard) 
.cf-lb-skeleton {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.4rem;
}

:where(.cf-css-dashboard) .cf-result-skeleton .cf-skeleton-text+.cf-skeleton-text {
    margin-top: 0.35rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   7. LEADERBOARD PREVIEW (inside <details>)
   ═══════════════════════════════════════════════════════════════════════════ */
:where(.cf-css-dashboard) .cf-leaderboard-preview {
    padding: 0.5rem 0.75rem 0.75rem;
}

/* Collapsible summary */
:where(.cf-css-dashboard) .cf-details {
    background: #fff;
    border-radius: var(--cf-radius-lg);
    box-shadow: var(--cf-shadow);
    border: 1px solid #f0f1f3;
    overflow: hidden;
}

:where(.cf-css-dashboard) .cf-details-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.9rem 1.1rem;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--cf-dark);
    list-style: none;
    min-height: var(--cf-tap-min);
    user-select: none;
}

:where(.cf-css-dashboard) .cf-details-summary::-webkit-details-marker {
    display: none;
}

:where(.cf-css-dashboard) .cf-details-summary:hover {
    background: #fafbfc;
}

:where(.cf-css-dashboard) .cf-details-chevron {
    transition: transform 0.25s ease;
    color: #9ca3af;
    font-size: 0.9rem;
}

:where(.cf-css-dashboard) .cf-details[open] .cf-details-chevron {
    transform: rotate(180deg);
}

:where(.cf-css-dashboard) .cf-details-body {
    border-top: 1px solid #f0f0f0;
    border-radius: 0;
    box-shadow: none;
    border: none;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Powered-by
   ═══════════════════════════════════════════════════════════════════════════ */
:where(.cf-css-dashboard) .cf-powered-by {
    text-align: center;
    font-size: 0.75rem;
    color: #9ca3af;
    padding: 1.25rem 0 0.25rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE — tablet & desktop
   ═══════════════════════════════════════════════════════════════════════════ */

/* ≥ 576px: dose+tip 2-up, results 2-up */
@media (min-width: 576px) {
    :where(.cf-css-dashboard) .cf-dose-tip-grid {
        grid-template-columns: 1fr 1fr;
    }

    :where(.cf-css-dashboard) .cf-results-grid {
        grid-template-columns: 1fr 1fr;
    }

    :where(.cf-css-dashboard) .cf-quick-actions {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* ≥ 768px: greeting & XP become side-by-side */
@media (min-width: 768px) {
    :where(.cf-css-dashboard) .cf-greeting-section {
        flex-direction: row;
        align-items: stretch;
        justify-content: space-between;
        gap: 1.5rem;
    }

    :where(.cf-css-dashboard) .cf-greeting {
        flex: 1 1 auto;
    }

    :where(.cf-css-dashboard) .cf-xp-level-card {
        flex: 0 0 340px;
    }

    :where(.cf-css-dashboard) .cf-quick-actions {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

/* ≥ 992px: stats 4-up */
@media (min-width: 992px) {
    :where(.cf-css-dashboard) .cf-stats-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    :where(.cf-css-dashboard) .cf-dashboard {
        gap: 1.25rem;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {

    :where(.cf-css-dashboard) .cf-quick-btn,:where(.cf-css-dashboard) 
    .cf-xp-bar-fill,:where(.cf-css-dashboard) 
    .cf-details-chevron,:where(.cf-css-dashboard) 
    .cf-skeleton,:where(.cf-css-dashboard) 
    .cf-skeleton-card {
        transition: none !important;
        animation: none !important;
    }
}

/* Add to dashboard.css if not already present */

/* min-width:0 utility for flex children with truncation */
:where(.cf-css-dashboard) .cf-dashboard .min-w-0 {
    min-width: 0;
}

/* Meta line inside result rows */
:where(.cf-css-dashboard) .cf-result-meta {
    font-size: 0.72rem;
    color: #9ca3af;
    line-height: 1.4;
    margin-top: 1px;
}

/* Result row layout tweak so meta truncates cleanly */
:where(.cf-css-dashboard) .cf-result-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    padding: 0.65rem 0.5rem;
    border-bottom: 1px solid #f5f6f8;
}

:where(.cf-css-dashboard) .cf-result-row:last-child {
    border-bottom: none;
}

/* ═══════════════════════════════════════════════════════════════════════════
   CAMPUS FORMULA – Today's Formula panel
   Style: sleek · dark slab · accent glow · modern typographic anchors
   Scoped under .cf-dashboard-section--formula on the dashboard.
   Depends on: --cf-accent, --cf-accent-rgb, --cf-on-accent, --cf-dark
   ═══════════════════════════════════════════════════════════════════════════ */

:where(.cf-css-dashboard) .cf-formula {
    --_accent: var(--cf-accent, #fabf2c);
    --_rgb: var(--cf-accent-rgb, 250, 191, 44);
    --_on: var(--cf-on-accent, #212529);
    --_pad: clamp(1.1rem, 3.4vw, 1.6rem);
    --_gap: clamp(0.9rem, 2.6vw, 1.15rem);
    --_radius: 20px;

    position: relative;
    padding: var(--_pad);
    border-radius: var(--_radius);
    color: #fff;
    background:
        /* Soft accent bloom top-right */
        radial-gradient(140% 120% at 100% 0%,
            rgba(var(--_rgb), 0.22) 0%,
            rgba(var(--_rgb), 0.06) 30%,
            rgba(var(--_rgb), 0.00) 60%),
        /* Base slab */
        linear-gradient(180deg, #1c1f26 0%, #14171c 100%);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.04) inset,
        0 20px 40px -20px rgba(0, 0, 0, 0.35);
    overflow: hidden;
    isolation: isolate;
}

/* Fine grain overlay — subtle texture, kills the "flat" look */
:where(.cf-css-dashboard) .cf-formula::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 3px 3px;
    pointer-events: none;
    z-index: 0;
}

:where(.cf-css-dashboard) .cf-formula>* {
    position: relative;
    z-index: 1;
}

/* ═══════════════════════════════════════════════════════════════════════════
   HERO — title + progress ring
   ═══════════════════════════════════════════════════════════════════════════ */
:where(.cf-css-dashboard) .cf-formula__hero {
    display: grid;
    grid-template-columns: 1fr;
    /* mobile: stacked */
    gap: var(--_gap);
    align-items: center;
    margin-bottom: var(--_gap);
}

:where(.cf-css-dashboard) .cf-formula__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--_accent);
    margin-bottom: 0.4rem;
}

:where(.cf-css-dashboard) .cf-formula__pulse {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--_accent);
    box-shadow: 0 0 0 0 rgba(var(--_rgb), 0.6);
    animation: cfFormulaPulse 2s ease-out infinite;
}

@keyframes cfFormulaPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(var(--_rgb), 0.55);
    }

    70% {
        box-shadow: 0 0 0 8px rgba(var(--_rgb), 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(var(--_rgb), 0);
    }
}

:where(.cf-css-dashboard) .cf-formula__title {
    font-size: clamp(1.35rem, 5vw, 1.75rem);
    font-weight: 800;
    line-height: 1.15;
    margin: 0 0 0.4rem;
    color: #fff;
    letter-spacing: -0.4px;
}

:where(.cf-css-dashboard) .cf-formula__lede {
    font-size: 0.85rem;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.62);
    margin: 0;
}

:where(.cf-css-dashboard) .cf-formula__lede strong {
    color: #fff;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

/* ── Progress ring ──────────────────────────────────────────────────────── */
:where(.cf-css-dashboard) .cf-formula__ring {
    position: relative;
    width: 108px;
    height: 108px;
    justify-self: center;
    flex-shrink: 0;
}

:where(.cf-css-dashboard) .cf-formula__ring svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

:where(.cf-css-dashboard) .cf-formula__ring-track {
    fill: none;
    stroke: rgba(255, 255, 255, 0.08);
    stroke-width: 8;
}

:where(.cf-css-dashboard) .cf-formula__ring-fill {
    fill: none;
    stroke: url(#cfRingGrad);
    stroke-width: 8;
    stroke-linecap: round;
    /* circumference = 2πr ≈ 326.7 for r=52 */
    stroke-dasharray: 326.7;
    stroke-dashoffset: calc(326.7 - (326.7 * var(--pct, 0) / 100));
    filter: drop-shadow(0 0 8px rgba(var(--_rgb), 0.55));
    animation: cfRingIn 1.1s cubic-bezier(.22, .9, .32, 1) both;
}

@keyframes cfRingIn {
    from {
        stroke-dashoffset: 326.7;
    }
}

:where(.cf-css-dashboard) .cf-formula__ring-num {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #fff;
    line-height: 1;
}

:where(.cf-css-dashboard) .cf-formula__ring-num strong {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    font-variant-numeric: tabular-nums;
    display: inline-flex;
    align-items: baseline;
}

:where(.cf-css-dashboard) .cf-formula__ring-num strong small {
    font-size: 0.8rem;
    margin-left: 1px;
    opacity: 0.7;
    font-weight: 700;
}

:where(.cf-css-dashboard) .cf-formula__ring-num span {
    margin-top: 0.3rem;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.55);
}

/* ═══════════════════════════════════════════════════════════════════════════
   STEPS
   ═══════════════════════════════════════════════════════════════════════════ */
:where(.cf-css-dashboard) .cf-formula__steps {
    list-style: none;
    margin: 0 0 var(--_gap);
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    counter-reset: fstep;
}

:where(.cf-css-dashboard) .cf-formula__step {
    counter-increment: fstep;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

:where(.cf-css-dashboard) .cf-formula__step:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(var(--_rgb), 0.4);
}

:where(.cf-css-dashboard) .cf-formula__step-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 0.9rem;
    text-decoration: none;
    color: #fff;
    min-height: 56px;
    -webkit-tap-highlight-color: transparent;
}

:where(.cf-css-dashboard) .cf-formula__step-index {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: rgba(var(--_rgb), 0.14);
    color: var(--_accent);
    font-weight: 800;
    font-size: 0.78rem;
    font-variant-numeric: tabular-nums;
    transition: background 0.2s ease, color 0.2s ease;
}

:where(.cf-css-dashboard) .cf-formula__step-index::before {
    content: counter(fstep);
}

:where(.cf-css-dashboard) .cf-formula__step:hover .cf-formula__step-index {
    background: var(--_accent);
    color: var(--_on);
}

:where(.cf-css-dashboard) .cf-formula__step-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

:where(.cf-css-dashboard) .cf-formula__step-label {
    font-size: 0.9rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    /* -webkit-line-clamp: 2; */
    -webkit-box-orient: vertical;
}

:where(.cf-css-dashboard) .cf-formula__step-note {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.45;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

:where(.cf-css-dashboard) .cf-formula__step-min {
    flex-shrink: 0;
    font-size: 0.82rem;
    font-weight: 800;
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.06);
    padding: 0.28rem 0.55rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: baseline;
    gap: 0.15rem;
    font-variant-numeric: tabular-nums;
}

:where(.cf-css-dashboard) .cf-formula__step-min small {
    font-size: 0.6rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

:where(.cf-css-dashboard) .cf-formula__step-arrow {
    flex-shrink: 0;
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.35);
    transition: transform 0.2s ease, color 0.2s ease;
}

:where(.cf-css-dashboard) .cf-formula__step:hover .cf-formula__step-arrow {
    color: var(--_accent);
    transform: translateX(3px);
}

/* ═══════════════════════════════════════════════════════════════════════════
   PRIMARY CTA
   ═══════════════════════════════════════════════════════════════════════════ */
:where(.cf-css-dashboard) .cf-formula__primary {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    min-height: 52px;
    padding: 0.85rem 1.1rem;
    border-radius: 14px;
    background: var(--_accent);
    color: var(--_on);
    font-weight: 800;
    font-size: 0.95rem;
    letter-spacing: -0.1px;
    text-decoration: none;
    overflow: hidden;
    isolation: isolate;
    box-shadow:
        0 10px 24px -10px rgba(var(--_rgb), 0.65),
        0 2px 0 rgba(0, 0, 0, 0.06) inset;
    transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

/* Sweeping shine animation on hover */
:where(.cf-css-dashboard) .cf-formula__primary-glow {
    position: absolute;
    inset: 0;
    background: linear-gradient(115deg,
            transparent 30%,
            rgba(255, 255, 255, 0.45) 50%,
            transparent 70%);
    transform: translateX(-120%);
    transition: transform 0.7s ease;
    pointer-events: none;
}

:where(.cf-css-dashboard) .cf-formula__primary:hover .cf-formula__primary-glow,:where(.cf-css-dashboard) 
.cf-formula__primary:focus-visible .cf-formula__primary-glow {
    transform: translateX(120%);
}

:where(.cf-css-dashboard) .cf-formula__primary:hover,:where(.cf-css-dashboard) 
.cf-formula__primary:focus-visible {
    color: var(--_on);
    filter: brightness(1.03);
    box-shadow:
        0 14px 32px -10px rgba(var(--_rgb), 0.75),
        0 2px 0 rgba(0, 0, 0, 0.06) inset;
    outline: none;
}

:where(.cf-css-dashboard) .cf-formula__primary:active {
    transform: translateY(1px);
}

:where(.cf-css-dashboard) .cf-formula__primary-arrow {
    font-size: 1.05rem;
    transition: transform 0.2s ease;
}

:where(.cf-css-dashboard) .cf-formula__primary:hover .cf-formula__primary-arrow {
    transform: translateX(4px);
}

/* ═══════════════════════════════════════════════════════════════════════════
   HERO STATS
   ═══════════════════════════════════════════════════════════════════════════ */
:where(.cf-css-dashboard) .cf-formula__hero-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
    margin-top: var(--_gap);
}

:where(.cf-css-dashboard) .cf-formula__stat {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    padding: 0.9rem 0.95rem;
    transition: border-color 0.2s ease, background 0.2s ease;
}

:where(.cf-css-dashboard) .cf-formula__stat:hover {
    border-color: rgba(var(--_rgb), 0.28);
    background: rgba(255, 255, 255, 0.06);
}

:where(.cf-css-dashboard) .cf-formula__stat-num {
    font-size: clamp(1.4rem, 4.6vw, 1.7rem);
    font-weight: 800;
    color: #fff;
    line-height: 1;
    letter-spacing: -0.5px;
    font-variant-numeric: tabular-nums;
    display: inline-flex;
    align-items: baseline;
}

:where(.cf-css-dashboard) .cf-formula__stat-num span {
    font-size: 0.9rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.4);
    margin-left: 2px;
}

:where(.cf-css-dashboard) .cf-formula__stat-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.55);
    margin-top: 0.4rem;
    letter-spacing: 0.02em;
    line-height: 1.35;
}

:where(.cf-css-dashboard) .cf-formula__stat-bar {
    margin-top: 0.6rem;
    height: 4px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.07);
    overflow: hidden;
}

:where(.cf-css-dashboard) .cf-formula__stat-bar span {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--_accent), color-mix(in srgb, var(--_accent) 55%, #fff));
    box-shadow: 0 0 8px rgba(var(--_rgb), 0.55);
    transition: width 1s cubic-bezier(.22, .9, .32, 1);
}

/* ═══════════════════════════════════════════════════════════════════════════
   META CHIPS (target, cycle, baseline)
   ═══════════════════════════════════════════════════════════════════════════ */
:where(.cf-css-dashboard) .cf-formula__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: var(--_gap);
}

:where(.cf-css-dashboard) .cf-formula__chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.72rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.72);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.07);
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    line-height: 1;
}

:where(.cf-css-dashboard) .cf-formula__chip i {
    font-size: 0.78rem;
    color: var(--_accent);
}

:where(.cf-css-dashboard) .cf-formula__chip strong {
    color: #fff;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    margin-left: 0.15rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   BOTTOM LINKS
   ═══════════════════════════════════════════════════════════════════════════ */
:where(.cf-css-dashboard) .cf-formula__links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: var(--_gap);
    padding-top: var(--_gap);
    border-top: 1px solid rgba(255, 255, 255, 0.07);
}

:where(.cf-css-dashboard) .cf-formula__links a {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    padding: 0.5rem 0.75rem;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    min-height: 34px;
}

:where(.cf-css-dashboard) .cf-formula__links a i {
    font-size: 0.85rem;
    color: var(--_accent);
    transition: transform 0.2s ease;
}

:where(.cf-css-dashboard) .cf-formula__links a:hover,:where(.cf-css-dashboard) 
.cf-formula__links a:focus-visible {
    color: #fff;
    background: rgba(var(--_rgb), 0.10);
    border-color: rgba(var(--_rgb), 0.35);
    outline: none;
}

:where(.cf-css-dashboard) .cf-formula__links a:hover i {
    transform: scale(1.15);
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════════════════ */

/* ≥ 640px: hero becomes 2-column with ring on the right */
@media (min-width: 640px) {
    :where(.cf-css-dashboard) .cf-formula__hero {
        grid-template-columns: 1fr auto;
        gap: 1.5rem;
        align-items: center;
    }

    :where(.cf-css-dashboard) .cf-formula__ring {
        justify-self: end;
        width: 124px;
        height: 124px;
    }
}

/* ≥ 768px: primary CTA inline */
@media (min-width: 768px) {
    :where(.cf-css-dashboard) .cf-formula__primary {
        width: auto;
        min-width: 260px;
        padding-inline: 1.5rem;
    }

    :where(.cf-css-dashboard) .cf-formula__hero-stats {
        grid-template-columns: 1fr 1fr;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {

    :where(.cf-css-dashboard) .cf-formula__pulse,:where(.cf-css-dashboard) 
    .cf-formula__ring-fill,:where(.cf-css-dashboard) 
    .cf-formula__stat-bar span,:where(.cf-css-dashboard) 
    .cf-formula__primary-glow,:where(.cf-css-dashboard) 
    .cf-formula__step,:where(.cf-css-dashboard) 
    .cf-formula__step-arrow,:where(.cf-css-dashboard) 
    .cf-formula__step-index,:where(.cf-css-dashboard) 
    .cf-formula__primary,:where(.cf-css-dashboard) 
    .cf-formula__primary-arrow,:where(.cf-css-dashboard) 
    .cf-formula__links a,:where(.cf-css-dashboard) 
    .cf-formula__links a i {
        animation: none !important;
        transition: none !important;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   CORRECTIONS PAGE  (.cf-corrections)
   Sleek · dark hero · tabbed panels · accent-driven
   ═══════════════════════════════════════════════════════════════════════════ */

:where(.cf-css-dashboard) .cf-corrections {
    --_accent: var(--cf-accent, #fabf2c);
    --_rgb: var(--cf-accent-rgb, 250, 191, 44);
    --_on: var(--cf-on-accent, #212529);
    --_gap: clamp(0.85rem, 2.6vw, 1.15rem);
}

/* ═══════════════════════════════════════════════════════════════════════════
   HERO
   ═══════════════════════════════════════════════════════════════════════════ */
:where(.cf-css-dashboard) .cf-corrections__hero {
    position: relative;
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--_gap);
    align-items: center;
    padding: clamp(1.1rem, 3.4vw, 1.6rem);
    border-radius: 20px;
    color: #fff;
    background:
        radial-gradient(140% 120% at 100% 0%,
            rgba(var(--_rgb), 0.22) 0%,
            rgba(var(--_rgb), 0.06) 30%,
            rgba(var(--_rgb), 0.00) 60%),
        linear-gradient(180deg, #1c1f26 0%, #14171c 100%);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.04) inset,
        0 20px 40px -20px rgba(0, 0, 0, 0.35);
    overflow: hidden;
    isolation: isolate;
}

:where(.cf-css-dashboard) .cf-corrections__hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 3px 3px;
    pointer-events: none;
    z-index: 0;
}

:where(.cf-css-dashboard) .cf-corrections__hero>* {
    position: relative;
    z-index: 1;
}

:where(.cf-css-dashboard) .cf-corrections__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--_accent);
    margin-bottom: 0.4rem;
}

:where(.cf-css-dashboard) .cf-corrections__pulse {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--_accent);
    box-shadow: 0 0 0 0 rgba(var(--_rgb), 0.6);
    animation: cfCorrectionsPulse 2s ease-out infinite;
}

@keyframes cfCorrectionsPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(var(--_rgb), 0.55);
    }

    70% {
        box-shadow: 0 0 0 8px rgba(var(--_rgb), 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(var(--_rgb), 0);
    }
}

:where(.cf-css-dashboard) .cf-corrections__title {
    font-size: clamp(1.35rem, 5vw, 1.75rem);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.4px;
    margin: 0 0 0.5rem;
    color: #fff;
}

:where(.cf-css-dashboard) .cf-corrections__lede {
    font-size: 0.85rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.65);
    margin: 0;
    max-width: 60ch;
}

:where(.cf-css-dashboard) .cf-corrections__lede strong {
    color: #fff;
    font-weight: 800;
}

:where(.cf-css-dashboard) .cf-corrections__hero-count {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: rgba(var(--_rgb), 0.14);
    border: 1px solid rgba(var(--_rgb), 0.35);
    box-shadow: 0 0 24px rgba(var(--_rgb), 0.20);
    justify-self: center;
    flex-shrink: 0;
}

:where(.cf-css-dashboard) .cf-corrections__hero-count strong {
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1;
    color: var(--_accent);
    font-variant-numeric: tabular-nums;
}

:where(.cf-css-dashboard) .cf-corrections__hero-count span {
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 0.3rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESUME BANNER
   ═══════════════════════════════════════════════════════════════════════════ */
:where(.cf-css-dashboard) .cf-corrections__resume {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.9rem 1.1rem;
    border-radius: 14px;
    background: var(--_accent);
    color: var(--_on);
    font-weight: 800;
    font-size: 0.9rem;
    text-decoration: none;
    box-shadow: 0 10px 24px -10px rgba(var(--_rgb), 0.55);
    transition: transform 0.15s ease, box-shadow 0.2s ease;
    min-height: 52px;
    -webkit-tap-highlight-color: transparent;
}

:where(.cf-css-dashboard) .cf-corrections__resume:hover,:where(.cf-css-dashboard) 
.cf-corrections__resume:focus-visible {
    color: var(--_on);
    transform: translateY(-1px);
    box-shadow: 0 14px 30px -10px rgba(var(--_rgb), 0.65);
    outline: none;
}

:where(.cf-css-dashboard) .cf-corrections__resume>i:first-child {
    font-size: 1.2rem;
}

:where(.cf-css-dashboard) .cf-corrections__resume-arrow {
    margin-left: auto;
    transition: transform 0.2s ease;
}

:where(.cf-css-dashboard) .cf-corrections__resume:hover .cf-corrections__resume-arrow {
    transform: translateX(4px);
}

/* ═══════════════════════════════════════════════════════════════════════════
   NOTICE (AJAX feedback)
   ═══════════════════════════════════════════════════════════════════════════ */
:where(.cf-css-dashboard) .cf-corrections__notice {
    padding: 0.75rem 1rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    background: rgba(var(--_rgb), 0.10);
    border: 1px solid rgba(var(--_rgb), 0.30);
    color: var(--cf-dark);
    line-height: 1.5;
}

:where(.cf-css-dashboard) .cf-corrections__notice.is-error {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.25);
    color: #b91c1c;
}

:where(.cf-css-dashboard) .cf-corrections__notice.is-success {
    background: rgba(34, 197, 94, 0.08);
    border-color: rgba(34, 197, 94, 0.25);
    color: #15803d;
}

/* ═══════════════════════════════════════════════════════════════════════════
   EMPTY STATE
   ═══════════════════════════════════════════════════════════════════════════ */
:where(.cf-css-dashboard) .cf-corrections__empty {
    background: #fff;
    border-radius: 20px;
    padding: clamp(1.5rem, 5vw, 2.5rem) clamp(1.25rem, 4vw, 2rem);
    text-align: center;
    box-shadow: var(--cf-shadow);
    border: 1px solid #f0f1f3;
}

:where(.cf-css-dashboard) .cf-corrections__empty-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 1rem;
    border-radius: 22px;
    display: grid;
    place-items: center;
    background: rgba(var(--_rgb), 0.12);
    color: var(--_accent);
    font-size: 2rem;
}

:where(.cf-css-dashboard) .cf-corrections__empty h2 {
    font-size: 1.15rem;
    font-weight: 800;
    margin: 0 0 0.5rem;
    color: var(--cf-dark);
}

:where(.cf-css-dashboard) .cf-corrections__empty p {
    font-size: 0.88rem;
    line-height: 1.6;
    color: #6b7280;
    max-width: 46ch;
    margin: 0 auto 1.25rem;
}

:where(.cf-css-dashboard) .cf-corrections__empty-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   TABS
   ═══════════════════════════════════════════════════════════════════════════ */
:where(.cf-css-dashboard) .cf-corrections__tabs {
    display: flex;
    gap: 0.4rem;
    overflow-x: auto;
    padding: 0.35rem;
    margin: 0 -0.35rem;
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-snap-type: x proximity;
}

:where(.cf-css-dashboard) .cf-corrections__tabs::-webkit-scrollbar {
    display: none;
}

:where(.cf-css-dashboard) .cf-corrections__tab {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.6rem 1rem;
    border-radius: 999px;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #4b5563;
    font-family: var(--cf-font);
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s ease;
    scroll-snap-align: start;
    min-height: 40px;
    -webkit-tap-highlight-color: transparent;
}

:where(.cf-css-dashboard) .cf-corrections__tab:hover,:where(.cf-css-dashboard) 
.cf-corrections__tab:focus-visible {
    border-color: rgba(var(--_rgb), 0.5);
    color: var(--cf-dark);
    outline: none;
}

:where(.cf-css-dashboard) .cf-corrections__tab.is-active {
    background: var(--_accent);
    border-color: var(--_accent);
    color: var(--_on);
    box-shadow: 0 8px 20px -10px rgba(var(--_rgb), 0.55);
}

:where(.cf-css-dashboard) .cf-corrections__tab-icon {
    font-size: 0.85rem;
}

:where(.cf-css-dashboard) .cf-corrections__tab-count {
    background: rgba(0, 0, 0, 0.08);
    border-radius: 999px;
    padding: 0.05rem 0.5rem;
    font-size: 0.7rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    min-width: 20px;
    text-align: center;
}

:where(.cf-css-dashboard) .cf-corrections__tab.is-active .cf-corrections__tab-count {
    background: rgba(0, 0, 0, 0.16);
}

/* ═══════════════════════════════════════════════════════════════════════════
   PANELS
   ═══════════════════════════════════════════════════════════════════════════ */
:where(.cf-css-dashboard) .cf-corrections__panel {
    display: flex;
    flex-direction: column;
    gap: var(--_gap);
    animation: cfTabIn 0.25s ease both;
}

:where(.cf-css-dashboard) .cf-corrections__panel[hidden] {
    display: none;
}

@keyframes cfTabIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   CARDS
   ═══════════════════════════════════════════════════════════════════════════ */
:where(.cf-css-dashboard) .cf-corrections__card {
    background: #fff;
    border-radius: 18px;
    padding: clamp(1rem, 3vw, 1.4rem);
    box-shadow: var(--cf-shadow);
    border: 1px solid #f0f1f3;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

:where(.cf-css-dashboard) .cf-corrections__card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    background: linear-gradient(180deg, var(--_accent), color-mix(in srgb, var(--_accent) 55%, #fff));
    opacity: 0.85;
}

:where(.cf-css-dashboard) .cf-corrections__card--retention::before {
    background: linear-gradient(180deg, #22c55e, #86efac);
}

:where(.cf-css-dashboard) .cf-corrections__card-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    justify-content: space-between;
}

:where(.cf-css-dashboard) .cf-corrections__badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    line-height: 1;
}

:where(.cf-css-dashboard) .cf-corrections__badge--explain {
    background: rgba(var(--_rgb), 0.12);
    color: color-mix(in srgb, var(--_accent) 70%, #000);
    border: 1px solid rgba(var(--_rgb), 0.25);
}

:where(.cf-css-dashboard) .cf-corrections__badge--retest {
    background: rgba(59, 130, 246, 0.10);
    color: #1d4ed8;
    border: 1px solid rgba(59, 130, 246, 0.22);
}

:where(.cf-css-dashboard) .cf-corrections__badge--retention {
    background: rgba(34, 197, 94, 0.12);
    color: #15803d;
    border: 1px solid rgba(34, 197, 94, 0.28);
}

:where(.cf-css-dashboard) .cf-corrections__due {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.3rem 0.6rem;
    border-radius: 999px;
    line-height: 1;
}

:where(.cf-css-dashboard) .cf-corrections__due.is-ready {
    background: rgba(34, 197, 94, 0.10);
    color: #15803d;
}

:where(.cf-css-dashboard) .cf-corrections__due.is-future {
    background: #f3f4f6;
    color: #6b7280;
}

:where(.cf-css-dashboard) .cf-corrections__card-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--cf-dark);
    margin: 0;
    letter-spacing: -0.2px;
    line-height: 1.3;
}

:where(.cf-css-dashboard) .cf-corrections__card-sub {
    font-size: 0.82rem;
    color: #6b7280;
    line-height: 1.55;
    margin: 0;
}

:where(.cf-css-dashboard) .cf-corrections__topic {
    font-size: 0.78rem;
    font-weight: 700;
    color: color-mix(in srgb, var(--_accent) 75%, #000);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* ═══════════════════════════════════════════════════════════════════════════
   QUESTION + OPTIONS
   ═══════════════════════════════════════════════════════════════════════════ */
:where(.cf-css-dashboard) .cf-corrections__question {
    font-size: 0.92rem;
    line-height: 1.7;
    color: var(--cf-dark);
    font-weight: 500;
    padding: 0.9rem 1rem;
    border-radius: 12px;
    background: #f8f9fb;
    border-left: 3px solid var(--_accent);
}

:where(.cf-css-dashboard) .cf-corrections__options {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

:where(.cf-css-dashboard) .cf-corrections__option {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    padding: 0.7rem 0.85rem;
    border-radius: 12px;
    border: 1.5px solid #eef0f3;
    background: #fff;
    font-size: 0.86rem;
    line-height: 1.55;
    color: var(--cf-dark);
    transition: border-color 0.2s ease, background 0.2s ease;
}

:where(.cf-css-dashboard) .cf-corrections__option.is-correct {
    border-color: rgba(34, 197, 94, 0.45);
    background: rgba(34, 197, 94, 0.06);
}

:where(.cf-css-dashboard) .cf-corrections__option-key {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    background: #f3f4f6;
    color: #4b5563;
    font-size: 0.75rem;
    font-weight: 800;
    line-height: 1;
}

:where(.cf-css-dashboard) .cf-corrections__option.is-correct .cf-corrections__option-key {
    background: #22c55e;
    color: #fff;
}

:where(.cf-css-dashboard) .cf-corrections__option-text {
    flex: 1;
    min-width: 0;
}

:where(.cf-css-dashboard) .cf-corrections__option-check {
    flex-shrink: 0;
    color: #22c55e;
    font-size: 1rem;
    margin-top: 2px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   EXPLANATION (collapsible details)
   ═══════════════════════════════════════════════════════════════════════════ */
:where(.cf-css-dashboard) .cf-corrections__explain {
    border-radius: 12px;
    background: rgba(var(--_rgb), 0.06);
    border: 1px solid rgba(var(--_rgb), 0.20);
    overflow: hidden;
}

:where(.cf-css-dashboard) .cf-corrections__explain summary {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    cursor: pointer;
    list-style: none;
    font-size: 0.82rem;
    font-weight: 800;
    color: color-mix(in srgb, var(--_accent) 75%, #000);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    min-height: 44px;
    user-select: none;
}

:where(.cf-css-dashboard) .cf-corrections__explain summary::-webkit-details-marker {
    display: none;
}

:where(.cf-css-dashboard) .cf-corrections__explain summary>span {
    flex: 1;
}

:where(.cf-css-dashboard) .cf-corrections__explain-chevron {
    transition: transform 0.25s ease;
    color: color-mix(in srgb, var(--_accent) 60%, #000);
}

:where(.cf-css-dashboard) .cf-corrections__explain[open] .cf-corrections__explain-chevron {
    transform: rotate(180deg);
}

:where(.cf-css-dashboard) .cf-corrections__explain-body {
    padding: 0.25rem 1rem 1rem;
    font-size: 0.88rem;
    line-height: 1.7;
    color: #374151;
    border-top: 1px dashed rgba(var(--_rgb), 0.20);
    padding-top: 0.85rem;
    margin-top: 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   RETEST NOTE
   ═══════════════════════════════════════════════════════════════════════════ */
:where(.cf-css-dashboard) .cf-corrections__retest-note {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.82rem;
    line-height: 1.55;
    color: #4b5563;
    padding: 0.7rem 0.85rem;
    background: #f8f9fb;
    border-radius: 10px;
    margin: 0;
}

:where(.cf-css-dashboard) .cf-corrections__retest-note i {
    color: var(--_accent);
    font-size: 0.9rem;
    margin-top: 2px;
    flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   MISSING CONTENT
   ═══════════════════════════════════════════════════════════════════════════ */
:where(.cf-css-dashboard) .cf-corrections__missing {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.82rem;
    line-height: 1.55;
    color: #6b7280;
    margin: 0;
}

:where(.cf-css-dashboard) .cf-corrections__missing i {
    color: #9ca3af;
    margin-top: 2px;
    flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   RETRY LINE
   ═══════════════════════════════════════════════════════════════════════════ */
:where(.cf-css-dashboard) .cf-corrections__retry {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.72rem;
    font-weight: 600;
    color: #9ca3af;
    margin: 0;
}

:where(.cf-css-dashboard) .cf-corrections__retry i {
    color: #9ca3af;
}

/* ═══════════════════════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════════════════════ */
:where(.cf-css-dashboard) .cf-corrections__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.7rem 1.15rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 800;
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-family: var(--cf-font);
    line-height: 1.2;
    transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s ease, background 0.2s ease;
    min-height: 48px;
    -webkit-tap-highlight-color: transparent;
}

:where(.cf-css-dashboard) .cf-corrections__btn--primary {
    background: var(--_accent);
    color: var(--_on);
    box-shadow: 0 10px 24px -10px rgba(var(--_rgb), 0.55);
}

:where(.cf-css-dashboard) .cf-corrections__btn--primary:hover,:where(.cf-css-dashboard) 
.cf-corrections__btn--primary:focus-visible {
    color: var(--_on);
    transform: translateY(-1px);
    box-shadow: 0 14px 30px -10px rgba(var(--_rgb), 0.65);
    filter: brightness(1.02);
    outline: none;
}

:where(.cf-css-dashboard) .cf-corrections__btn--primary:active {
    transform: translateY(1px);
}

:where(.cf-css-dashboard) .cf-corrections__btn--primary i {
    font-size: 1rem;
}

:where(.cf-css-dashboard) .cf-corrections__btn--primary i.bi-arrow-right {
    transition: transform 0.2s ease;
}

:where(.cf-css-dashboard) .cf-corrections__btn--primary:hover i.bi-arrow-right {
    transform: translateX(3px);
}

:where(.cf-css-dashboard) .cf-corrections__btn--ghost {
    background: #fff;
    color: var(--cf-dark);
    border: 1.5px solid #e5e7eb;
}

:where(.cf-css-dashboard) .cf-corrections__btn--ghost:hover,:where(.cf-css-dashboard) 
.cf-corrections__btn--ghost:focus-visible {
    border-color: var(--_accent);
    background: rgba(var(--_rgb), 0.05);
    color: var(--cf-dark);
    outline: none;
}

:where(.cf-css-dashboard) .cf-corrections__btn--full {
    width: 100%;
}

/* ═══════════════════════════════════════════════════════════════════════════
   NOTE
   ═══════════════════════════════════════════════════════════════════════════ */
:where(.cf-css-dashboard) .cf-corrections__note {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.78rem;
    color: #6b7280;
    background: #f8f9fb;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    border-left: 3px solid var(--_accent);
    margin: 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   RECENT CHECKS (details)
   ═══════════════════════════════════════════════════════════════════════════ */
:where(.cf-css-dashboard) .cf-corrections__history {
    background: #fff;
    border-radius: 18px;
    box-shadow: var(--cf-shadow);
    border: 1px solid #f0f1f3;
    overflow: hidden;
}

:where(.cf-css-dashboard) .cf-corrections__history>summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 1rem 1.15rem;
    cursor: pointer;
    list-style: none;
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--cf-dark);
    min-height: 48px;
    user-select: none;
    transition: background 0.2s ease;
}

:where(.cf-css-dashboard) .cf-corrections__history>summary::-webkit-details-marker {
    display: none;
}

:where(.cf-css-dashboard) .cf-corrections__history>summary:hover {
    background: #fafbfc;
}

:where(.cf-css-dashboard) .cf-corrections__history>summary>span {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

:where(.cf-css-dashboard) .cf-corrections__history>summary i.bi {
    color: var(--_accent);
}

:where(.cf-css-dashboard) .cf-corrections__history-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    padding: 0 0.5rem;
    height: 20px;
    border-radius: 999px;
    background: rgba(var(--_rgb), 0.15);
    color: color-mix(in srgb, var(--_accent) 75%, #000);
    font-size: 0.68rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

:where(.cf-css-dashboard) .cf-corrections__history-chevron {
    transition: transform 0.25s ease;
    color: #9ca3af;
}

:where(.cf-css-dashboard) .cf-corrections__history[open] .cf-corrections__history-chevron {
    transform: rotate(180deg);
}

:where(.cf-css-dashboard) .cf-corrections__history-body {
    padding: 0.35rem 0.6rem 0.75rem;
    border-top: 1px solid #f0f1f3;
}

:where(.cf-css-dashboard) .cf-corrections__history-empty {
    padding: 1rem 0.75rem;
    margin: 0;
    font-size: 0.82rem;
    color: #9ca3af;
    text-align: center;
}

:where(.cf-css-dashboard) .cf-corrections__history-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 0.75rem;
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    transition: background 0.2s ease;
    min-height: 54px;
}

:where(.cf-css-dashboard) .cf-corrections__history-row:hover {
    background: #f8f9fb;
    color: inherit;
}

:where(.cf-css-dashboard) .cf-corrections__history-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: rgba(var(--_rgb), 0.12);
    color: var(--_accent);
    font-size: 0.95rem;
    flex-shrink: 0;
}

:where(.cf-css-dashboard) .cf-corrections__history-info {
    flex: 1;
    min-width: 0;
}

:where(.cf-css-dashboard) .cf-corrections__history-topic {
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--cf-dark);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

:where(.cf-css-dashboard) .cf-corrections__history-meta {
    font-size: 0.7rem;
    color: #9ca3af;
    margin-top: 2px;
    text-transform: capitalize;
}

:where(.cf-css-dashboard) .cf-corrections__history-score {
    flex-shrink: 0;
    font-size: 0.78rem;
    font-weight: 800;
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    font-variant-numeric: tabular-nums;
}

:where(.cf-css-dashboard) .cf-corrections__history-score.is-good {
    background: rgba(34, 197, 94, 0.12);
    color: #15803d;
}

:where(.cf-css-dashboard) .cf-corrections__history-score.is-mid {
    background: rgba(234, 179, 8, 0.14);
    color: #854d0e;
}

:where(.cf-css-dashboard) .cf-corrections__history-score.is-low {
    background: rgba(239, 68, 68, 0.12);
    color: #b91c1c;
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════════════════ */

/* ≥ 560px: hero 2-col with counter on the right */
@media (min-width: 560px) {
    :where(.cf-css-dashboard) .cf-corrections__hero {
        grid-template-columns: 1fr auto;
        gap: 1.5rem;
    }

    :where(.cf-css-dashboard) .cf-corrections__hero-count {
        justify-self: end;
        width: 108px;
        height: 108px;
    }
}

/* ≥ 768px: content roomier */
@media (min-width: 768px) {
    :where(.cf-css-dashboard) .cf-corrections__card {
        padding: 1.4rem 1.5rem;
    }

    :where(.cf-css-dashboard) .cf-corrections__question {
        font-size: 0.95rem;
        padding: 1.05rem 1.15rem;
    }

    :where(.cf-css-dashboard) .cf-corrections__option {
        padding: 0.8rem 1rem;
        font-size: 0.88rem;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {

    :where(.cf-css-dashboard) .cf-corrections__pulse,:where(.cf-css-dashboard) 
    .cf-corrections__panel,:where(.cf-css-dashboard) 
    .cf-corrections__tab,:where(.cf-css-dashboard) 
    .cf-corrections__btn,:where(.cf-css-dashboard) 
    .cf-corrections__btn i,:where(.cf-css-dashboard) 
    .cf-corrections__resume,:where(.cf-css-dashboard) 
    .cf-corrections__resume-arrow,:where(.cf-css-dashboard) 
    .cf-corrections__explain-chevron,:where(.cf-css-dashboard) 
    .cf-corrections__history-chevron {
        animation: none !important;
        transition: none !important;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   CORRECTIONS · loading state + card removal animation
   ═══════════════════════════════════════════════════════════════════════════ */

/* Inline spinner (used inside the loading button) */
@keyframes cfSpin {
    to {
        transform: rotate(360deg);
    }
}

:where(.cf-css-dashboard) .cf-spinner {
    display: inline-block;
    width: 1em;
    height: 1em;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: cfSpin 0.7s linear infinite;
    vertical-align: -0.15em;
    margin-right: 0.1em;
}

/* Loading state on the primary button */
:where(.cf-css-dashboard) .cf-corrections__btn.is-loading {
    cursor: progress;
    filter: saturate(0.85);
}

:where(.cf-css-dashboard) .cf-corrections__btn.is-loading i,:where(.cf-css-dashboard) 
.cf-corrections__btn.is-loading .cf-spinner {
    flex-shrink: 0;
}

/* Card removal animation */
:where(.cf-css-dashboard) .cf-corrections__card.is-removing {
    pointer-events: none;
    will-change: opacity, transform, height, margin, padding;
}

/* Reduced motion: instant remove */
@media (prefers-reduced-motion: reduce) {
    :where(.cf-css-dashboard) .cf-corrections__card.is-removing {
        transition: none !important;
    }

    :where(.cf-css-dashboard) .cf-spinner {
        animation: none !important;
        border-right-color: currentColor;
        opacity: 0.6;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   IMPROVEMENT ROOM  (.cf-improvement)
   Extends the corrections visual language. All classes are additive.
   ═══════════════════════════════════════════════════════════════════════════ */

:where(.cf-css-dashboard) .cf-improvement__hero-link {
    display: inline-block;
    margin-top: 0.15rem;
    color: var(--_accent);
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
}

:where(.cf-css-dashboard) .cf-improvement__hero-link:hover {
    color: var(--_accent);
}

/* ═══════════════════════════════════════════════════════════════════════════
   KPI TILES
   ═══════════════════════════════════════════════════════════════════════════ */
:where(.cf-css-dashboard) .cf-improvement__kpis {
    display: grid;
    grid-template-columns: 1fr;
    /* mobile: stacked */
    gap: var(--cf-dash-gap, 0.85rem);
}

@media (min-width: 640px) {
    :where(.cf-css-dashboard) .cf-improvement__kpis {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

:where(.cf-css-dashboard) .cf-improvement__kpi {
    background: #fff;
    border-radius: 18px;
    padding: 1.1rem 1.15rem;
    box-shadow: var(--cf-shadow);
    border: 1px solid #f0f1f3;
    border-top: 3px solid var(--_accent);
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    position: relative;
}

:where(.cf-css-dashboard) .cf-improvement__kpi-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: rgba(var(--_rgb), 0.12);
    color: var(--_accent);
    font-size: 1.1rem;
    margin-bottom: 0.35rem;
}

:where(.cf-css-dashboard) .cf-improvement__kpi-value {
    font-size: clamp(1.5rem, 5vw, 1.75rem);
    font-weight: 800;
    color: var(--cf-dark);
    line-height: 1;
    letter-spacing: -0.5px;
    font-variant-numeric: tabular-nums;
    display: inline-flex;
    align-items: baseline;
}

:where(.cf-css-dashboard) .cf-improvement__kpi-value span {
    font-size: 0.85rem;
    font-weight: 700;
    color: #9ca3af;
    margin-left: 2px;
}

:where(.cf-css-dashboard) .cf-improvement__kpi-label {
    font-size: 0.8rem;
    font-weight: 800;
    color: var(--cf-dark);
}

:where(.cf-css-dashboard) .cf-improvement__kpi-sub {
    font-size: 0.72rem;
    color: #6b7280;
    line-height: 1.5;
}

:where(.cf-css-dashboard) .cf-improvement__kpi-bar {
    margin-top: 0.5rem;
    height: 4px;
    border-radius: 999px;
    background: #eef0f3;
    overflow: hidden;
}

:where(.cf-css-dashboard) .cf-improvement__kpi-bar span {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--_accent), color-mix(in srgb, var(--_accent) 55%, #fff));
    box-shadow: 0 0 8px rgba(var(--_rgb), 0.45);
    transition: width 0.8s cubic-bezier(.22, .9, .32, 1);
}

/* ═══════════════════════════════════════════════════════════════════════════
   SUMMARY LINE
   ═══════════════════════════════════════════════════════════════════════════ */
:where(.cf-css-dashboard) .cf-improvement__summary {
    background: #fff;
    border-radius: 14px;
    padding: 0.85rem 1.05rem;
    border: 1px solid #f0f1f3;
    font-size: 0.85rem;
    color: #4b5563;
    margin: 0;
    line-height: 1.55;
}

:where(.cf-css-dashboard) .cf-improvement__summary strong {
    color: var(--cf-dark);
    font-weight: 800;
}

/* ═══════════════════════════════════════════════════════════════════════════
   WARNING NOTICE (blocked topics)
   ═══════════════════════════════════════════════════════════════════════════ */
:where(.cf-css-dashboard) .cf-corrections__notice--warning {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    background: rgba(250, 191, 44, 0.10);
    border: 1px solid rgba(250, 191, 44, 0.35);
    color: #6f5700;
    padding: 0.9rem 1rem;
}

:where(.cf-css-dashboard) .cf-corrections__notice--warning>i {
    font-size: 1.1rem;
    color: #b45309;
    margin-top: 1px;
    flex-shrink: 0;
}

:where(.cf-css-dashboard) .cf-corrections__notice--warning strong {
    display: block;
    font-weight: 800;
    font-size: 0.86rem;
    margin-bottom: 0.15rem;
}

:where(.cf-css-dashboard) .cf-corrections__notice--warning p {
    margin: 0;
    font-size: 0.78rem;
    line-height: 1.55;
    color: #6b7280;
    font-weight: 500;
}

/* ═══════════════════════════════════════════════════════════════════════════
   TOPIC CARD EXTRAS
   ═══════════════════════════════════════════════════════════════════════════ */
:where(.cf-css-dashboard) .cf-improvement__topic {
    /* inherits .cf-corrections__card styling */
    gap: 0.85rem;
}

/* Badges */
:where(.cf-css-dashboard) .cf-improvement__badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    line-height: 1;
}

:where(.cf-css-dashboard) .cf-improvement__badge--read {
    background: rgba(59, 130, 246, 0.10);
    color: #1d4ed8;
    border: 1px solid rgba(59, 130, 246, 0.22);
}

:where(.cf-css-dashboard) .cf-improvement__badge--assess {
    background: rgba(var(--_rgb), 0.14);
    color: color-mix(in srgb, var(--_accent) 70%, #000);
    border: 1px solid rgba(var(--_rgb), 0.30);
}

:where(.cf-css-dashboard) .cf-improvement__badge--retest {
    background: rgba(147, 51, 234, 0.10);
    color: #7e22ce;
    border: 1px solid rgba(147, 51, 234, 0.22);
}

:where(.cf-css-dashboard) .cf-improvement__badge--overdue {
    background: rgba(239, 68, 68, 0.10);
    color: #b91c1c;
    border: 1px solid rgba(239, 68, 68, 0.25);
}

:where(.cf-css-dashboard) .cf-improvement__badge--verified {
    background: rgba(34, 197, 94, 0.12);
    color: #15803d;
    border: 1px solid rgba(34, 197, 94, 0.28);
}

/* Overdue due-chip */
:where(.cf-css-dashboard) .cf-corrections__due.is-overdue {
    background: rgba(239, 68, 68, 0.10);
    color: #b91c1c;
}

/* Progress (baseline accuracy) */
:where(.cf-css-dashboard) .cf-improvement__progress {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding: 0.75rem 0.85rem;
    border-radius: 12px;
    background: #f8f9fb;
    border: 1px solid #eef0f3;
}

:where(.cf-css-dashboard) .cf-improvement__progress-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

:where(.cf-css-dashboard) .cf-improvement__progress-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

:where(.cf-css-dashboard) .cf-improvement__progress-value {
    font-size: 0.82rem;
    font-weight: 800;
    color: var(--cf-dark);
    font-variant-numeric: tabular-nums;
}

:where(.cf-css-dashboard) .cf-improvement__progress-value span {
    font-size: 0.72rem;
    color: #9ca3af;
    font-weight: 700;
}

:where(.cf-css-dashboard) .cf-improvement__progress-track {
    height: 6px;
    border-radius: 999px;
    background: #e5e7eb;
    overflow: hidden;
}

:where(.cf-css-dashboard) .cf-improvement__progress-fill {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--_accent), color-mix(in srgb, var(--_accent) 55%, #fff));
    box-shadow: 0 0 8px rgba(var(--_rgb), 0.45);
    transition: width 0.8s cubic-bezier(.22, .9, .32, 1);
}

/* Action label */
:where(.cf-css-dashboard) .cf-improvement__action-label {
    font-size: 0.86rem;
    color: var(--cf-dark);
    margin: 0;
    line-height: 1.5;
}

:where(.cf-css-dashboard) .cf-improvement__action-label strong {
    font-weight: 800;
}

/* Meta line (latest assessment) */
:where(.cf-css-dashboard) .cf-improvement__meta {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.76rem;
    color: #6b7280;
    margin: 0;
    line-height: 1.5;
}

:where(.cf-css-dashboard) .cf-improvement__meta i {
    color: var(--_accent);
    font-size: 0.85rem;
}

:where(.cf-css-dashboard) .cf-improvement__meta strong {
    color: var(--cf-dark);
    font-weight: 800;
}

/* Lesson title */
:where(.cf-css-dashboard) .cf-improvement__lesson-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--cf-dark);
    margin: 0;
    line-height: 1.45;
}

:where(.cf-css-dashboard) .cf-improvement__lesson-title i {
    color: var(--_accent);
    font-size: 1rem;
    flex-shrink: 0;
}

/* Actions container */
:where(.cf-css-dashboard) .cf-improvement__actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.15rem;
}

@media (min-width: 520px) {
    :where(.cf-css-dashboard) .cf-improvement__actions {
        flex-direction: row;
        flex-wrap: wrap;
    }

    :where(.cf-css-dashboard) .cf-improvement__actions .cf-corrections__btn--full {
        width: auto;
    }
}

/* Verified note */
:where(.cf-css-dashboard) .cf-improvement__verified-note {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.82rem;
    font-weight: 700;
    color: #15803d;
    background: rgba(34, 197, 94, 0.10);
    border: 1px solid rgba(34, 197, 94, 0.25);
    border-radius: 12px;
    padding: 0.7rem 0.9rem;
    line-height: 1.45;
}

:where(.cf-css-dashboard) .cf-improvement__verified-note i {
    font-size: 1rem;
    flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   FOOTER (baseline actions)
   ═══════════════════════════════════════════════════════════════════════════ */
:where(.cf-css-dashboard) .cf-improvement__footer {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 0.25rem;
}

:where(.cf-css-dashboard) .cf-improvement__footer-note {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.78rem;
    color: #6b7280;
    background: #f8f9fb;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    border-left: 3px solid var(--_accent);
    margin: 0;
    line-height: 1.55;
}

:where(.cf-css-dashboard) .cf-improvement__footer-note i {
    color: var(--_accent);
    margin-top: 2px;
    flex-shrink: 0;
}

:where(.cf-css-dashboard) .cf-improvement__footer-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE POLISH
   ═══════════════════════════════════════════════════════════════════════════ */
@media (min-width: 768px) {
    :where(.cf-css-dashboard) .cf-improvement__kpi {
        padding: 1.25rem 1.35rem;
    }

    :where(.cf-css-dashboard) .cf-improvement__topic {
        padding: 1.4rem 1.5rem;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {

    :where(.cf-css-dashboard) .cf-improvement__kpi-bar span,:where(.cf-css-dashboard) 
    .cf-improvement__progress-fill {
        transition: none !important;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   JOURNEY PAGE  (.cf-journey)
   Extends corrections + improvement visual language
   ═══════════════════════════════════════════════════════════════════════════ */

:where(.cf-css-dashboard) .cf-journey__ring {
    /* Reuses .cf-formula__ring — just keeps it centered on desktop */
    justify-self: center;
}

/* ═══════════════════════════════════════════════════════════════════════════
   "UP NEXT" CARD
   ═══════════════════════════════════════════════════════════════════════════ */
:where(.cf-css-dashboard) .cf-journey__next {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: clamp(1rem, 3vw, 1.4rem);
    border-radius: 18px;
    background: #fff;
    box-shadow: var(--cf-shadow);
    border: 1px solid #f0f1f3;
    border-top: 3px solid var(--_accent);
}

@media (min-width: 640px) {
    :where(.cf-css-dashboard) .cf-journey__next {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

:where(.cf-css-dashboard) .cf-journey__next-text {
    flex: 1;
    min-width: 0;
}

:where(.cf-css-dashboard) .cf-journey__next-eyebrow {
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--_accent);
    margin-bottom: 0.25rem;
}

:where(.cf-css-dashboard) .cf-journey__next-title {
    font-size: clamp(1.05rem, 3.6vw, 1.25rem);
    font-weight: 800;
    color: var(--cf-dark);
    margin: 0 0 0.25rem;
    line-height: 1.3;
    letter-spacing: -0.2px;
}

:where(.cf-css-dashboard) .cf-journey__next-meta {
    font-size: 0.82rem;
    color: #6b7280;
    margin: 0;
}

:where(.cf-css-dashboard) .cf-journey__next-meta strong {
    color: var(--cf-dark);
    font-weight: 800;
}

:where(.cf-css-dashboard) .cf-journey__next-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   SECTIONS
   ═══════════════════════════════════════════════════════════════════════════ */
:where(.cf-css-dashboard) .cf-journey__section {
    display: flex;
    flex-direction: column;
    gap: var(--cf-dash-gap, 0.1rem);
    margin: 0;
}

:where(.cf-css-dashboard) .cf-journey__lede-note {
    font-size: 0.82rem;
    color: #6b7280;
    line-height: 1.6;
    margin: 0;
    padding: 0.85rem 1rem;
    border-radius: 12px;
    background: #f8f9fb;
    border-left: 3px solid var(--_accent);
}

:where(.cf-css-dashboard) .cf-journey__lede-note strong {
    color: var(--cf-dark);
    font-weight: 800;
}

:where(.cf-css-dashboard) .cf-journey__lede-note em {
    color: var(--cf-dark);
    font-style: normal;
    font-weight: 800;
}

/* ═══════════════════════════════════════════════════════════════════════════
   CYCLE CARDS
   ═══════════════════════════════════════════════════════════════════════════ */
:where(.cf-css-dashboard) .cf-journey__cycles {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

:where(.cf-css-dashboard) .cf-journey__cycle {
    background: #fff;
    border-radius: 18px;
    box-shadow: var(--cf-shadow);
    border: 1px solid #f0f1f3;
    overflow: hidden;
    transition: border-color 0.2s ease;
}

:where(.cf-css-dashboard) .cf-journey__cycle[open] {
    border-color: rgba(var(--_rgb), 0.35);
}

:where(.cf-css-dashboard) .cf-journey__cycle>summary {
    list-style: none;
    cursor: pointer;
    user-select: none;
    min-height: 64px;
}

:where(.cf-css-dashboard) .cf-journey__cycle>summary::-webkit-details-marker {
    display: none;
}

:where(.cf-css-dashboard) .cf-journey__cycle-summary {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.9rem 1.1rem;
    transition: background 0.2s ease;
}

:where(.cf-css-dashboard) .cf-journey__cycle-summary:hover {
    background: #fafbfc;
}

:where(.cf-css-dashboard) .cf-journey__cycle-num {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: rgba(var(--_rgb), 0.14);
    color: color-mix(in srgb, var(--_accent) 75%, #000);
    font-weight: 800;
    font-size: 1rem;
    font-variant-numeric: tabular-nums;
}

:where(.cf-css-dashboard) .cf-journey__cycle-info {
    flex: 1;
    min-width: 0;
}

:where(.cf-css-dashboard) .cf-journey__cycle-title {
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--cf-dark);
    line-height: 1.2;
}

:where(.cf-css-dashboard) .cf-journey__cycle-meta {
    font-size: 0.72rem;
    color: #9ca3af;
    margin-top: 2px;
    line-height: 1.4;
}

:where(.cf-css-dashboard) .cf-journey__cycle-badge {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    line-height: 1;
}

:where(.cf-css-dashboard) .cf-journey__cycle-badge.is-active {
    background: rgba(34, 197, 94, 0.12);
    color: #15803d;
    border: 1px solid rgba(34, 197, 94, 0.28);
}

:where(.cf-css-dashboard) .cf-journey__cycle-badge.is-closed {
    background: #f3f4f6;
    color: #4b5563;
    border: 1px solid #e5e7eb;
}

:where(.cf-css-dashboard) .cf-journey__cycle-badge.is-pending {
    background: rgba(var(--_rgb), 0.12);
    color: color-mix(in srgb, var(--_accent) 75%, #000);
    border: 1px solid rgba(var(--_rgb), 0.28);
}

:where(.cf-css-dashboard) .cf-journey__cycle-chevron {
    flex-shrink: 0;
    color: #9ca3af;
    font-size: 0.9rem;
    transition: transform 0.25s ease;
}

:where(.cf-css-dashboard) .cf-journey__cycle[open] .cf-journey__cycle-chevron {
    transform: rotate(180deg);
}

:where(.cf-css-dashboard) .cf-journey__cycle-body {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    padding: 0.25rem 1.1rem 1.15rem;
    border-top: 1px solid #f0f1f3;
    padding-top: 1rem;
}

/* Metric row */
:where(.cf-css-dashboard) .cf-journey__metric-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.5rem;
}

:where(.cf-css-dashboard) .cf-journey__metric {
    padding: 0.75rem 0.85rem;
    border-radius: 12px;
    background: #f8f9fb;
    border: 1px solid #eef0f3;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

:where(.cf-css-dashboard) .cf-journey__metric-label {
    font-size: 0.68rem;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

:where(.cf-css-dashboard) .cf-journey__metric-value {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--cf-dark);
    font-variant-numeric: tabular-nums;
    line-height: 1.15;
}

/* Pending note */
:where(.cf-css-dashboard) .cf-journey__pending-note,:where(.cf-css-dashboard) 
.cf-journey__close-note {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: #6b7280;
    margin: 0;
    line-height: 1.55;
}

:where(.cf-css-dashboard) .cf-journey__pending-note i,:where(.cf-css-dashboard) 
.cf-journey__close-note i {
    color: var(--_accent);
    margin-top: 2px;
    flex-shrink: 0;
}

/* Change list */
:where(.cf-css-dashboard) .cf-journey__changes {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.85rem 0.95rem;
    background: #f8f9fb;
    border-radius: 12px;
    border: 1px solid #eef0f3;
}

:where(.cf-css-dashboard) .cf-journey__changes-title,:where(.cf-css-dashboard) 
.cf-journey__gaps-title {
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #6b7280;
}

:where(.cf-css-dashboard) .cf-journey__change {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    justify-content: space-between;
    padding: 0.55rem 0.7rem;
    border-radius: 10px;
    background: #fff;
    border: 1px solid #eef0f3;
    font-size: 0.8rem;
}

:where(.cf-css-dashboard) .cf-journey__change-topic {
    font-weight: 700;
    color: var(--cf-dark);
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

:where(.cf-css-dashboard) .cf-journey__change-values {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-variant-numeric: tabular-nums;
    color: #6b7280;
    font-weight: 700;
}

:where(.cf-css-dashboard) .cf-journey__change-values i {
    color: #9ca3af;
}

:where(.cf-css-dashboard) .cf-journey__change-delta {
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
}

:where(.cf-css-dashboard) .cf-journey__change.is-up .cf-journey__change-delta {
    background: rgba(34, 197, 94, 0.14);
    color: #15803d;
}

:where(.cf-css-dashboard) .cf-journey__change.is-down .cf-journey__change-delta {
    background: rgba(239, 68, 68, 0.12);
    color: #b91c1c;
}

:where(.cf-css-dashboard) .cf-journey__change.is-flat .cf-journey__change-delta {
    background: #f3f4f6;
    color: #4b5563;
}

:where(.cf-css-dashboard) .cf-journey__change-note {
    font-size: 0.72rem;
    color: #9ca3af;
    margin: 0.2rem 0 0;
    line-height: 1.5;
    font-style: italic;
}

/* Delta banner */
:where(.cf-css-dashboard) .cf-journey__delta {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    font-size: 0.82rem;
    line-height: 1.55;
    padding: 0.85rem 1rem;
    border-radius: 12px;
    color: #4b5563;
    background: #f8f9fb;
    border: 1px solid #eef0f3;
}

:where(.cf-css-dashboard) .cf-journey__delta strong {
    color: var(--cf-dark);
    font-weight: 800;
}

:where(.cf-css-dashboard) .cf-journey__delta i {
    font-size: 1rem;
    margin-top: 2px;
    flex-shrink: 0;
    color: var(--_accent);
}

:where(.cf-css-dashboard) .cf-journey__delta.is-up {
    background: rgba(34, 197, 94, 0.08);
    border-color: rgba(34, 197, 94, 0.22);
}

:where(.cf-css-dashboard) .cf-journey__delta.is-up i {
    color: #15803d;
}

:where(.cf-css-dashboard) .cf-journey__delta.is-down {
    background: rgba(239, 68, 68, 0.06);
    border-color: rgba(239, 68, 68, 0.20);
}

:where(.cf-css-dashboard) .cf-journey__delta.is-down i {
    color: #b91c1c;
}

/* Weakness gaps list */
:where(.cf-css-dashboard) .cf-journey__gaps {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

:where(.cf-css-dashboard) .cf-journey__gap {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 0.75rem;
    padding: 0.55rem 0.75rem;
    border-radius: 10px;
    background: #fff;
    border: 1px solid #eef0f3;
    font-size: 0.8rem;
}

@media (max-width: 480px) {
    :where(.cf-css-dashboard) .cf-journey__gap {
        grid-template-columns: 1fr auto;
    }

    :where(.cf-css-dashboard) .cf-journey__gap-state {
        grid-column: 1 / -1;
    }
}

:where(.cf-css-dashboard) .cf-journey__gap-topic {
    font-weight: 700;
    color: var(--cf-dark);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

:where(.cf-css-dashboard) .cf-journey__gap-score {
    font-weight: 800;
    color: var(--cf-dark);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

:where(.cf-css-dashboard) .cf-journey__gap-pct {
    font-size: 0.7rem;
    color: #9ca3af;
    font-weight: 700;
    margin-left: 0.25rem;
}

:where(.cf-css-dashboard) .cf-journey__gap-state {
    font-size: 0.72rem;
    font-weight: 700;
    color: color-mix(in srgb, var(--_accent) 75%, #000);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

/* Cycle actions */
:where(.cf-css-dashboard) .cf-journey__cycle-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.15rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   TOPIC EVIDENCE CARDS
   ═══════════════════════════════════════════════════════════════════════════ */
:where(.cf-css-dashboard) .cf-journey__topic {
    gap: 0.85rem;
}

:where(.cf-css-dashboard) .cf-journey__state {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    line-height: 1;
}

:where(.cf-css-dashboard) .cf-journey__state.is-verified {
    background: rgba(34, 197, 94, 0.12);
    color: #15803d;
    border: 1px solid rgba(34, 197, 94, 0.28);
}

:where(.cf-css-dashboard) .cf-journey__state.is-learned {
    background: rgba(59, 130, 246, 0.10);
    color: #1d4ed8;
    border: 1px solid rgba(59, 130, 246, 0.22);
}

:where(.cf-css-dashboard) .cf-journey__state.is-learning {
    background: rgba(var(--_rgb), 0.14);
    color: color-mix(in srgb, var(--_accent) 75%, #000);
    border: 1px solid rgba(var(--_rgb), 0.30);
}

:where(.cf-css-dashboard) .cf-journey__state.is-relapsed {
    background: rgba(239, 68, 68, 0.10);
    color: #b91c1c;
    border: 1px solid rgba(239, 68, 68, 0.25);
}

:where(.cf-css-dashboard) .cf-journey__last {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.72rem;
    font-weight: 600;
    color: #9ca3af;
    white-space: nowrap;
}

:where(.cf-css-dashboard) .cf-journey__last i {
    font-size: 0.78rem;
}

/* Stat chips row */
:where(.cf-css-dashboard) .cf-journey__stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

:where(.cf-css-dashboard) .cf-journey__stat {
    display: inline-flex;
    align-items: baseline;
    gap: 0.3rem;
    padding: 0.4rem 0.7rem;
    border-radius: 10px;
    background: #f8f9fb;
    border: 1px solid #eef0f3;
    font-size: 0.72rem;
    color: #6b7280;
    font-weight: 600;
}

:where(.cf-css-dashboard) .cf-journey__stat strong {
    font-size: 0.9rem;
    color: var(--cf-dark);
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

/* Slices details */
:where(.cf-css-dashboard) .cf-journey__slices {
    border-radius: 12px;
    background: #f8f9fb;
    border: 1px solid #eef0f3;
    overflow: hidden;
}

:where(.cf-css-dashboard) .cf-journey__slices>summary {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 0.9rem;
    cursor: pointer;
    list-style: none;
    font-size: 0.78rem;
    font-weight: 800;
    color: var(--cf-dark);
    min-height: 44px;
    user-select: none;
}

:where(.cf-css-dashboard) .cf-journey__slices>summary::-webkit-details-marker {
    display: none;
}

:where(.cf-css-dashboard) .cf-journey__slices>summary>span {
    flex: 1;
}

:where(.cf-css-dashboard) .cf-journey__slices>summary i.bi-layers {
    color: var(--_accent);
}

:where(.cf-css-dashboard) .cf-journey__slices-chevron {
    color: #9ca3af;
    transition: transform 0.25s ease;
}

:where(.cf-css-dashboard) .cf-journey__slices[open] .cf-journey__slices-chevron {
    transform: rotate(180deg);
}

:where(.cf-css-dashboard) .cf-journey__slices-body {
    padding: 0.25rem 0.9rem 0.85rem;
    border-top: 1px solid #eef0f3;
    padding-top: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

:where(.cf-css-dashboard) .cf-journey__slice {
    padding: 0.6rem 0.7rem;
    border-radius: 10px;
    background: #fff;
    border: 1px solid #eef0f3;
}

:where(.cf-css-dashboard) .cf-journey__slice-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

:where(.cf-css-dashboard) .cf-journey__slice-diff {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.78rem;
    font-weight: 800;
    color: var(--cf-dark);
    text-transform: capitalize;
}

:where(.cf-css-dashboard) .cf-journey__slice-diff i {
    color: var(--_accent);
}

:where(.cf-css-dashboard) .cf-journey__slice-acc {
    font-size: 0.82rem;
    font-weight: 800;
    color: var(--cf-dark);
    font-variant-numeric: tabular-nums;
}

:where(.cf-css-dashboard) .cf-journey__slice-meta {
    font-size: 0.72rem;
    color: #6b7280;
    line-height: 1.5;
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════════════════ */
@media (min-width: 560px) {
    :where(.cf-css-dashboard) .cf-journey__ring {
        justify-self: end;
    }
}

@media (min-width: 768px) {
    :where(.cf-css-dashboard) .cf-journey__cycle-body {
        padding-left: 1.4rem;
        padding-right: 1.4rem;
    }

    :where(.cf-css-dashboard) .cf-journey__cycle-summary {
        padding-left: 1.4rem;
        padding-right: 1.4rem;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {

    :where(.cf-css-dashboard) .cf-journey__cycle-chevron,:where(.cf-css-dashboard) 
    .cf-journey__slices-chevron,:where(.cf-css-dashboard) 
    .cf-improvement__progress-fill {
        transition: none !important;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   DIAGNOSTIC RESULT PAGE  (.cf-diagnostic)
   Extends corrections / improvement / journey visual language
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Estimated-score block inside hero ──────────────────────────────────── */
:where(.cf-css-dashboard) .cf-diagnostic__estimate {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.1rem 1.35rem;
    border-radius: 18px;
    background: rgba(var(--_rgb), 0.14);
    border: 1px solid rgba(var(--_rgb), 0.35);
    box-shadow: 0 0 24px rgba(var(--_rgb), 0.20);
    justify-self: center;
    flex-shrink: 0;
    text-align: center;
    min-width: 180px;
}

:where(.cf-css-dashboard) .cf-diagnostic__estimate-label {
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 0.35rem;
}

:where(.cf-css-dashboard) .cf-diagnostic__estimate-value {
    font-size: clamp(1.75rem, 6vw, 2.15rem);
    font-weight: 800;
    color: var(--_accent);
    line-height: 1;
    letter-spacing: -0.6px;
    font-variant-numeric: tabular-nums;
    display: inline-flex;
    align-items: baseline;
    gap: 0.25rem;
}

:where(.cf-css-dashboard) .cf-diagnostic__estimate-value span {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.55);
    font-weight: 700;
}

:where(.cf-css-dashboard) .cf-diagnostic__estimate-max {
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.55);
    font-weight: 700;
    margin-top: 0.35rem;
    letter-spacing: 0.04em;
}

/* ── Section wrapper ───────────────────────────────────────────────────── */
:where(.cf-css-dashboard) .cf-diagnostic__section {
    display: flex;
    flex-direction: column;
    gap: var(--cf-dash-gap, 0.85rem);
}

/* ── Subject snapshot ──────────────────────────────────────────────────── */
:where(.cf-css-dashboard) .cf-diagnostic__subjects {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.6rem;
}

@media (min-width: 560px) {
    :where(.cf-css-dashboard) .cf-diagnostic__subjects {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 900px) {
    :where(.cf-css-dashboard) .cf-diagnostic__subjects {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

:where(.cf-css-dashboard) .cf-diagnostic__subject {
    background: #fff;
    border-radius: 16px;
    padding: 1rem 1.1rem;
    box-shadow: var(--cf-shadow);
    border: 1px solid #f0f1f3;
    border-top: 3px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

:where(.cf-css-dashboard) .cf-diagnostic__subject.is-good {
    border-top-color: #22c55e;
}

:where(.cf-css-dashboard) .cf-diagnostic__subject.is-mid {
    border-top-color: var(--_accent);
}

:where(.cf-css-dashboard) .cf-diagnostic__subject.is-low {
    border-top-color: #ef4444;
}

:where(.cf-css-dashboard) .cf-diagnostic__subject-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
}

:where(.cf-css-dashboard) .cf-diagnostic__subject-name {
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--cf-dark);
    margin: 0;
    line-height: 1.3;
    min-width: 0;
}

:where(.cf-css-dashboard) .cf-diagnostic__subject-pct {
    font-size: 0.95rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: var(--cf-dark);
    white-space: nowrap;
    flex-shrink: 0;
}

:where(.cf-css-dashboard) .cf-diagnostic__subject.is-good .cf-diagnostic__subject-pct {
    color: #15803d;
}

:where(.cf-css-dashboard) .cf-diagnostic__subject.is-mid .cf-diagnostic__subject-pct {
    color: color-mix(in srgb, var(--_accent) 70%, #000);
}

:where(.cf-css-dashboard) .cf-diagnostic__subject.is-low .cf-diagnostic__subject-pct {
    color: #b91c1c;
}

:where(.cf-css-dashboard) .cf-diagnostic__subject-track {
    height: 6px;
    border-radius: 999px;
    background: #eef0f3;
    overflow: hidden;
}

:where(.cf-css-dashboard) .cf-diagnostic__subject-track span {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: var(--_accent);
    transition: width 0.9s cubic-bezier(.22, .9, .32, 1);
}

:where(.cf-css-dashboard) .cf-diagnostic__subject.is-good .cf-diagnostic__subject-track span {
    background: linear-gradient(90deg, #22c55e, #86efac);
}

:where(.cf-css-dashboard) .cf-diagnostic__subject.is-low .cf-diagnostic__subject-track span {
    background: linear-gradient(90deg, #ef4444, #fca5a5);
}

:where(.cf-css-dashboard) .cf-diagnostic__subject-meta {
    font-size: 0.72rem;
    color: #6b7280;
    line-height: 1.5;
}

:where(.cf-css-dashboard) .cf-diagnostic__subject-meta strong {
    color: var(--cf-dark);
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

/* ── Split panels (strong vs weak) ─────────────────────────────────────── */
:where(.cf-css-dashboard) .cf-diagnostic__split {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--cf-dash-gap, 0.85rem);
}

@media (min-width: 768px) {
    :where(.cf-css-dashboard) .cf-diagnostic__split {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

:where(.cf-css-dashboard) .cf-diagnostic__panel {
    background: #fff;
    border-radius: 18px;
    padding: 1.15rem 1.25rem;
    box-shadow: var(--cf-shadow);
    border: 1px solid #f0f1f3;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}

:where(.cf-css-dashboard) .cf-diagnostic__panel--strong {
    border-top: 3px solid #22c55e;
}

:where(.cf-css-dashboard) .cf-diagnostic__panel--weak {
    border-top: 3px solid #f59e0b;
}

:where(.cf-css-dashboard) .cf-diagnostic__panel-head {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

:where(.cf-css-dashboard) .cf-diagnostic__panel-icon {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    font-size: 1rem;
}

:where(.cf-css-dashboard) .cf-diagnostic__panel--strong .cf-diagnostic__panel-icon {
    background: rgba(34, 197, 94, 0.12);
    color: #15803d;
}

:where(.cf-css-dashboard) .cf-diagnostic__panel--weak .cf-diagnostic__panel-icon {
    background: rgba(245, 158, 11, 0.14);
    color: #b45309;
}

:where(.cf-css-dashboard) .cf-diagnostic__panel-title {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--cf-dark);
    margin: 0;
    line-height: 1.3;
}

:where(.cf-css-dashboard) .cf-diagnostic__panel-empty {
    font-size: 0.82rem;
    color: #6b7280;
    line-height: 1.55;
    margin: 0;
    padding: 0.75rem 0.85rem;
    border-radius: 10px;
    background: #f8f9fb;
}

:where(.cf-css-dashboard) .cf-diagnostic__topic-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

:where(.cf-css-dashboard) .cf-diagnostic__topic {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.6rem 0.8rem;
    border-radius: 10px;
    background: #f8f9fb;
    border: 1px solid #eef0f3;
    font-size: 0.82rem;
}

:where(.cf-css-dashboard) .cf-diagnostic__topic-name {
    font-weight: 700;
    color: var(--cf-dark);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

:where(.cf-css-dashboard) .cf-diagnostic__topic-score {
    font-weight: 800;
    color: var(--cf-dark);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    flex-shrink: 0;
}

:where(.cf-css-dashboard) .cf-diagnostic__topic-pct {
    font-size: 0.72rem;
    color: #9ca3af;
    font-weight: 700;
    margin-left: 0.25rem;
}

:where(.cf-css-dashboard) .cf-diagnostic__panel-note {
    display: flex;
    align-items: flex-start;
    gap: 0.4rem;
    font-size: 0.72rem;
    color: #6b7280;
    line-height: 1.5;
    margin: 0;
    padding-top: 0.4rem;
    border-top: 1px dashed #e5e7eb;
}

:where(.cf-css-dashboard) .cf-diagnostic__panel-note i {
    color: var(--_accent);
    margin-top: 2px;
    flex-shrink: 0;
}

/* ── Speed panel ───────────────────────────────────────────────────────── */
:where(.cf-css-dashboard) .cf-diagnostic__speed {
    background: #fff;
    border-radius: 18px;
    padding: 1.15rem 1.25rem;
    box-shadow: var(--cf-shadow);
    border: 1px solid #f0f1f3;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}

:where(.cf-css-dashboard) .cf-diagnostic__speed-pill {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.7rem 0.9rem;
    border-radius: 12px;
    background: rgba(var(--_rgb), 0.10);
    border: 1px solid rgba(var(--_rgb), 0.25);
}

:where(.cf-css-dashboard) .cf-diagnostic__speed-profile {
    font-size: 0.85rem;
    font-weight: 800;
    color: color-mix(in srgb, var(--_accent) 70%, #000);
}

:where(.cf-css-dashboard) .cf-diagnostic__speed-acc {
    font-size: 0.72rem;
    font-weight: 700;
    color: #6b7280;
    white-space: nowrap;
}

:where(.cf-css-dashboard) .cf-diagnostic__speed-acc strong {
    font-size: 0.9rem;
    color: var(--cf-dark);
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    margin-right: 0.2rem;
}

:where(.cf-css-dashboard) .cf-diagnostic__speed-advice {
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--cf-dark);
    margin: 0;
}

:where(.cf-css-dashboard) .cf-diagnostic__speed-note {
    display: flex;
    align-items: flex-start;
    gap: 0.4rem;
    font-size: 0.72rem;
    color: #9ca3af;
    line-height: 1.55;
    margin: 0;
}

:where(.cf-css-dashboard) .cf-diagnostic__speed-note i {
    color: var(--_accent);
    margin-top: 2px;
    flex-shrink: 0;
}

/* ── Priority lessons ──────────────────────────────────────────────────── */
:where(.cf-css-dashboard) .cf-diagnostic__lessons {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--cf-dash-gap, 0.85rem);
}

@media (min-width: 640px) {
    :where(.cf-css-dashboard) .cf-diagnostic__lessons {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

:where(.cf-css-dashboard) .cf-diagnostic__lesson {
    background: #fff;
    border-radius: 18px;
    padding: 1.1rem 1.2rem;
    box-shadow: var(--cf-shadow);
    border: 1px solid #f0f1f3;
    border-left: 3px solid var(--_accent);
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}

:where(.cf-css-dashboard) .cf-diagnostic__lesson-head {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

:where(.cf-css-dashboard) .cf-diagnostic__lesson-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: rgba(var(--_rgb), 0.14);
    color: var(--_accent);
    font-size: 0.95rem;
}

:where(.cf-css-dashboard) .cf-diagnostic__lesson-title {
    font-size: 0.92rem;
    font-weight: 800;
    color: var(--cf-dark);
    margin: 0;
    line-height: 1.35;
    min-width: 0;
}

:where(.cf-css-dashboard) .cf-diagnostic__lesson-sub {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.78rem;
    color: #6b7280;
    margin: 0;
    line-height: 1.5;
}

:where(.cf-css-dashboard) .cf-diagnostic__lesson-sub i {
    color: var(--_accent);
    flex-shrink: 0;
}

/* ── Plan tiles ────────────────────────────────────────────────────────── */
:where(.cf-css-dashboard) .cf-diagnostic__plan {
    border-top-color: var(--_accent);
}

:where(.cf-css-dashboard) .cf-diagnostic__plan-note {
    font-size: 0.72rem;
    color: #6b7280;
    line-height: 1.55;
    margin: 0.4rem 0 0;
    padding-top: 0.5rem;
    border-top: 1px dashed #e5e7eb;
}

:where(.cf-css-dashboard) .cf-diagnostic__plan-note strong {
    color: var(--cf-dark);
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

:where(.cf-css-dashboard) .cf-diagnostic__plan-date {
    font-size: clamp(1.1rem, 4.2vw, 1.35rem) !important;
    letter-spacing: -0.3px;
    line-height: 1.15;
}

/* ── Action buttons row ────────────────────────────────────────────────── */
:where(.cf-css-dashboard) .cf-diagnostic__actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

@media (min-width: 640px) {
    :where(.cf-css-dashboard) .cf-diagnostic__actions {
        flex-direction: row;
        flex-wrap: wrap;
    }

    :where(.cf-css-dashboard) .cf-diagnostic__actions .cf-corrections__btn {
        flex: 0 1 auto;
    }
}

/* ── Info notice variant ───────────────────────────────────────────────── */
:where(.cf-css-dashboard) .cf-corrections__notice--info {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    background: rgba(var(--_rgb), 0.08);
    border: 1px solid rgba(var(--_rgb), 0.28);
    color: var(--cf-dark);
}

:where(.cf-css-dashboard) .cf-corrections__notice--info>i {
    color: var(--_accent);
    font-size: 1.05rem;
    margin-top: 2px;
    flex-shrink: 0;
}

:where(.cf-css-dashboard) .cf-corrections__notice--info strong {
    font-weight: 800;
}

/* ── Compact empty state ───────────────────────────────────────────────── */
:where(.cf-css-dashboard) .cf-corrections__empty--compact {
    padding: 1.35rem 1.25rem;
}

:where(.cf-css-dashboard) .cf-corrections__empty--compact .cf-corrections__empty-icon {
    width: 52px;
    height: 52px;
    font-size: 1.4rem;
    margin-bottom: 0.65rem;
    border-radius: 14px;
}

:where(.cf-css-dashboard) .cf-corrections__empty--compact h2 {
    font-size: 1rem;
}

:where(.cf-css-dashboard) .cf-corrections__empty--compact p {
    font-size: 0.82rem;
    margin-bottom: 0;
}

/* ── Responsive ────────────────────────────────────────────────────────── */
@media (min-width: 560px) {
    :where(.cf-css-dashboard) .cf-diagnostic__estimate {
        justify-self: end;
        min-width: 200px;
    }
}

/* ── Reduced motion ────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {

    :where(.cf-css-dashboard) .cf-diagnostic__subject-track span,:where(.cf-css-dashboard) 
    .cf-improvement__kpi-bar span {
        transition: none !important;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   CLASSROOM (subject picker + lesson grid)  .cf-classroom
   ═══════════════════════════════════════════════════════════════════════════ */

:where(.cf-css-dashboard) .cf-classroom {
    --_accent: var(--cf-accent, #fabf2c);
    --_rgb: var(--cf-accent-rgb, 250, 191, 44);
    --_on: var(--cf-on-accent, #212529);
    --_gap: clamp(0.85rem, 2.6vw, 1.15rem);
}

/* ── Subject picker grid ──────────────────────────────────────────────── */
:where(.cf-css-dashboard) .cf-classroom__subjects {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--_gap);
}

@media (min-width: 560px) {
    :where(.cf-css-dashboard) .cf-classroom__subjects {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 900px) {
    :where(.cf-css-dashboard) .cf-classroom__subjects {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

:where(.cf-css-dashboard) .cf-classroom__subject-form {
    display: contents;
}

:where(.cf-css-dashboard) .cf-classroom__subject {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
    text-align: left;
    padding: 1.1rem 1.2rem;
    border-radius: 18px;
    background: #fff;
    border: 1px solid #f0f1f3;
    box-shadow: var(--cf-shadow);
    border-left: 4px solid var(--_accent);
    cursor: pointer;
    font-family: inherit;
    transition: transform 0.15s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

:where(.cf-css-dashboard) .cf-classroom__subject:hover,:where(.cf-css-dashboard) 
.cf-classroom__subject:focus-visible {
    transform: translateY(-2px);
    box-shadow: var(--cf-shadow-md);
    border-color: rgba(var(--_rgb), 0.5);
    outline: none;
}

:where(.cf-css-dashboard) .cf-classroom__subject.is-disabled {
    cursor: not-allowed;
    opacity: 0.6;
    border-left-color: #9ca3af;
}

:where(.cf-css-dashboard) .cf-classroom__subject-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: rgba(var(--_rgb), 0.14);
    color: var(--_accent);
    font-size: 1.15rem;
}

:where(.cf-css-dashboard) .cf-classroom__subject.is-disabled .cf-classroom__subject-icon {
    background: #f3f4f6;
    color: #6b7280;
}

:where(.cf-css-dashboard) .cf-classroom__subject-body {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
    flex: 1;
}

:where(.cf-css-dashboard) .cf-classroom__subject-name {
    font-size: 1rem;
    font-weight: 800;
    color: var(--cf-dark);
    line-height: 1.3;
}

:where(.cf-css-dashboard) .cf-classroom__subject-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.76rem;
    font-weight: 700;
    color: color-mix(in srgb, var(--_accent) 75%, #000);
}

:where(.cf-css-dashboard) .cf-classroom__subject.is-disabled .cf-classroom__subject-cta {
    color: #9ca3af;
}

/* Subject switcher form (pills) */
:where(.cf-css-dashboard) .cf-classroom__switch-form {
    display: inline-flex;
}

/* ── Lesson grid ──────────────────────────────────────────────────────── */
:where(.cf-css-dashboard) .cf-classroom__section {
    display: flex;
    flex-direction: column;
    gap: var(--_gap);
}

:where(.cf-css-dashboard) .cf-classroom__lessons {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--_gap);
}

@media (min-width: 640px) {
    :where(.cf-css-dashboard) .cf-classroom__lessons {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1000px) {
    :where(.cf-css-dashboard) .cf-classroom__lessons {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

:where(.cf-css-dashboard) .cf-classroom__lesson {
    background: #fff;
    border-radius: 18px;
    padding: 1.1rem 1.2rem;
    box-shadow: var(--cf-shadow);
    border: 1px solid #f0f1f3;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    border-top: 3px solid var(--_accent);
}

:where(.cf-css-dashboard) .cf-classroom__lesson.is-new {
    border-top-color: var(--_accent);
}

:where(.cf-css-dashboard) .cf-classroom__lesson.is-ready {
    border-top-color: #3b82f6;
}

:where(.cf-css-dashboard) .cf-classroom__lesson.is-done {
    border-top-color: #22c55e;
}

:where(.cf-css-dashboard) .cf-classroom__lesson.is-locked {
    border-top-color: #9ca3af;
    opacity: 0.75;
}

:where(.cf-css-dashboard) .cf-classroom__lesson-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

:where(.cf-css-dashboard) .cf-classroom__lesson-status {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 0.3rem 0.6rem;
    border-radius: 999px;
    background: #f3f4f6;
    color: #4b5563;
    line-height: 1;
}

:where(.cf-css-dashboard) .cf-classroom__lesson.is-new .cf-classroom__lesson-status {
    background: rgba(var(--_rgb), 0.14);
    color: color-mix(in srgb, var(--_accent) 75%, #000);
}

:where(.cf-css-dashboard) .cf-classroom__lesson.is-ready .cf-classroom__lesson-status {
    background: rgba(59, 130, 246, 0.12);
    color: #1d4ed8;
}

:where(.cf-css-dashboard) .cf-classroom__lesson.is-done .cf-classroom__lesson-status {
    background: rgba(34, 197, 94, 0.12);
    color: #15803d;
}

:where(.cf-css-dashboard) .cf-classroom__lesson-title {
    font-size: 1rem;
    font-weight: 800;
    color: var(--cf-dark);
    margin: 0;
    line-height: 1.35;
}

:where(.cf-css-dashboard) .cf-classroom__lesson-topic {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.76rem;
    color: #6b7280;
    margin: 0;
}

:where(.cf-css-dashboard) .cf-classroom__lesson-topic i {
    color: var(--_accent);
}

:where(.cf-css-dashboard) .cf-classroom__lesson-locked {
    font-size: 0.78rem;
    color: #6b7280;
    padding: 0.65rem 0.85rem;
    border-radius: 10px;
    background: #f8f9fb;
    border: 1px solid #eef0f3;
    line-height: 1.5;
}

/* ═══════════════════════════════════════════════════════════════════════════
   LESSON READER  (.cf-lesson)
   ═══════════════════════════════════════════════════════════════════════════ */

:where(.cf-css-dashboard) .cf-lesson {
    --_accent: var(--cf-accent, #fabf2c);
    --_rgb: var(--cf-accent-rgb, 250, 191, 44);
    --_gap: clamp(0.85rem, 2.6vw, 1.15rem);
}

/* Reading-progress bar (fixed under navbar) */
:where(.cf-css-dashboard) .cf-reading-progress {
    position: fixed;
    top: var(--cf-navbar-h, 62px);
    left: var(--cf-sidebar-w, 260px);
    right: 0;
    height: 4px;
    z-index: 1020;
    background: #e5e7eb;
    pointer-events: none;
}

:where(.cf-css-dashboard) .cf-reading-progress span {
    display: block;
    width: 0;
    height: 100%;
    background: var(--_accent);
    transition: width 0.1s linear;
    box-shadow: 0 0 8px rgba(var(--_rgb), 0.6);
}

@media (max-width: 991.98px) {
    :where(.cf-css-dashboard) .cf-reading-progress {
        left: 0;
    }
}

/* Back link */
:where(.cf-css-dashboard) .cf-lesson__back {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.82rem;
    font-weight: 700;
    color: #6b7280;
    text-decoration: none;
    padding: 0.5rem 0.75rem;
    border-radius: 10px;
    align-self: flex-start;
    transition: background 0.2s ease, color 0.2s ease;
    min-height: 40px;
}

:where(.cf-css-dashboard) .cf-lesson__back:hover {
    background: #f3f4f6;
    color: var(--cf-dark);
}

:where(.cf-css-dashboard) .cf-lesson__feedback-due {
    font-size: 0.72rem;
    font-weight: 700;
    color: #6b7280;
}

/* Reader container */
:where(.cf-css-dashboard) .cf-lesson-reader {
    margin: 0 auto;
    width: 100%;
    background: #fff;
    border-radius: 20px;
    box-shadow: var(--cf-shadow);
    overflow: hidden;
}

/* Hero */
:where(.cf-css-dashboard) .cf-lesson-hero {
    position: relative;
    padding: clamp(1.4rem, 4.5vw, 2.8rem) clamp(1.25rem, 4vw, 3rem);
    background:
        radial-gradient(140% 120% at 100% 0%,
            rgba(var(--_rgb), 0.20) 0%,
            rgba(var(--_rgb), 0.05) 30%,
            rgba(var(--_rgb), 0.00) 60%),
        linear-gradient(180deg, #1c1f26 0%, #14171c 100%);
    color: #fff;
    overflow: hidden;
    isolation: isolate;
}

:where(.cf-css-dashboard) .cf-lesson-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 3px 3px;
    pointer-events: none;
    z-index: 0;
}

:where(.cf-css-dashboard) .cf-lesson-hero>* {
    position: relative;
    z-index: 1;
}

:where(.cf-css-dashboard) .cf-lesson-hero__eyebrow {
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--_accent);
    margin-bottom: 0.5rem;
}

:where(.cf-css-dashboard) .cf-lesson-hero__title {
    font-size: clamp(1.35rem, 5vw, 1.9rem);
    font-weight: 800;
    line-height: 1.2;
    color: #fff;
    margin: 0 0 0.75rem;
    letter-spacing: -0.4px;
}

:where(.cf-css-dashboard) .cf-lesson-hero__lede {
    font-size: 0.92rem;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.7);
    margin: 0 0 1rem;
    max-width: 65ch;
}

:where(.cf-css-dashboard) .cf-lesson-hero__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

:where(.cf-css-dashboard) .cf-lesson-hero__meta-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.75);
    line-height: 1;
}

:where(.cf-css-dashboard) .cf-lesson-hero__meta-item i {
    color: var(--_accent);
    font-size: 0.8rem;
}

:where(.cf-css-dashboard) .cf-lesson-hero__meta-item--done {
    background: rgba(34, 197, 94, 0.12);
    border-color: rgba(34, 197, 94, 0.35);
    color: #86efac;
}

:where(.cf-css-dashboard) .cf-lesson-hero__meta-item--done i {
    color: #22c55e;
}

/* Objectives */
:where(.cf-css-dashboard) .cf-lesson-objectives {
    padding: 1.25rem clamp(1.25rem, 4vw, 3rem);
    background: #fffbeb;
    border-bottom: 1px solid #f0f1f3;
}

:where(.cf-css-dashboard) .cf-lesson-objectives__title {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--cf-dark);
    margin: 0 0 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

:where(.cf-css-dashboard) .cf-lesson-objectives__title i {
    color: var(--_accent);
}

:where(.cf-css-dashboard) .cf-lesson-objectives__list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

:where(.cf-css-dashboard) .cf-lesson-objectives__list li {
    position: relative;
    padding-left: 1.6rem;
    font-size: 0.88rem;
    line-height: 1.6;
    color: var(--cf-dark);
}

:where(.cf-css-dashboard) .cf-lesson-objectives__list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.5em;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--_accent);
    box-shadow: 0 0 0 4px rgba(var(--_rgb), 0.18);
}

/* Body + lesson blocks */
:where(.cf-css-dashboard) .cf-lesson-body {
    display: flex;
    flex-direction: column;
}

:where(.cf-css-dashboard) .cf-lesson-block {
    padding: 1.25rem clamp(1.25rem, 4vw, 3rem);
    border-bottom: 1px solid #f0f1f3;
    line-height: 1.8;
    font-size: 0.92rem;
    color: #1f2937;
}

:where(.cf-css-dashboard) .cf-lesson-block:last-child {
    border-bottom: none;
}

:where(.cf-css-dashboard) .cf-lesson-block h3 {
    font-size: 1.02rem;
    font-weight: 800;
    color: var(--cf-dark);
    margin: 0 0 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    letter-spacing: -0.2px;
}

:where(.cf-css-dashboard) .cf-lesson-block h3 i {
    color: var(--_accent);
}

:where(.cf-css-dashboard) .cf-lesson-block ul,:where(.cf-css-dashboard) 
.cf-lesson-block ol {
    padding-left: 1.35rem;
    margin: 0.5rem 0;
}

:where(.cf-css-dashboard) .cf-lesson-block li {
    margin-bottom: 0.4rem;
}

/* Colour variants */
:where(.cf-css-dashboard) .cf-lesson-note {
    background: #eff6ff;
}

:where(.cf-css-dashboard) .cf-lesson-warning {
    background: #fff7ed;
}

:where(.cf-css-dashboard) .cf-lesson-formula {
    background: #f5f3ff;
}

/* .cf-formula {
    font-size: 1.05rem;
    text-align: center;
    background: #fff;
    padding: 0.9rem 1rem;
    border-radius: 10px;
    border: 1px dashed rgba(var(--_rgb), 0.4);
    font-family: "KaTeX_Main", "Cambria Math", serif;
    margin: 0.5rem 0;
} */

/* Worked example */
:where(.cf-css-dashboard) .cf-worked-example {
    background: #f8fafc;
}

:where(.cf-css-dashboard) .cf-example-problem {
    font-weight: 700;
    margin-bottom: 0.85rem;
    color: var(--cf-dark);
}

:where(.cf-css-dashboard) .cf-example-answer {
    padding: 0.85rem 1rem;
    border-left: 4px solid #22c55e;
    background: #ecfdf3;
    border-radius: 10px;
    margin-top: 0.85rem;
}

/* Mistake cards */
:where(.cf-css-dashboard) .cf-lesson-mistake {
    padding: 0.75rem 0.9rem;
    border-radius: 12px;
    background: #fff;
    border: 1px solid #f0f1f3;
    margin-bottom: 0.6rem;
}

:where(.cf-css-dashboard) .cf-lesson-mistake__wrong,:where(.cf-css-dashboard) 
.cf-lesson-mistake__right {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin: 0;
    font-size: 0.86rem;
    line-height: 1.55;
}

:where(.cf-css-dashboard) .cf-lesson-mistake__wrong i {
    color: #ef4444;
    margin-top: 3px;
    flex-shrink: 0;
}

:where(.cf-css-dashboard) .cf-lesson-mistake__right {
    margin-top: 0.4rem;
    color: #4b5563;
}

:where(.cf-css-dashboard) .cf-lesson-mistake__right i {
    color: #22c55e;
    margin-top: 3px;
    flex-shrink: 0;
}

/* Visual block */
:where(.cf-css-dashboard) .cf-lesson-visual {
    padding: 1.25rem clamp(1.25rem, 4vw, 3rem);
    text-align: center;
}

:where(.cf-css-dashboard) .cf-visual-placeholder {
    min-height: 180px;
    border: 2px dashed #d1d5db;
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    color: #6b7280;
    background: #f8f9fb;
}

:where(.cf-css-dashboard) .cf-visual-placeholder i {
    font-size: 2rem;
    color: var(--_accent);
}

:where(.cf-css-dashboard) .cf-lesson-visual figcaption {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.5rem;
}

/* Exam tips block */
:where(.cf-css-dashboard) .cf-exam-tips {
    background: #fffbea;
}

/* Summary block */
:where(.cf-css-dashboard) .cf-lesson-summary {
    background: #f0fdf4;
}

/* Complete card */
:where(.cf-css-dashboard) .cf-lesson-complete {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: center;
    text-align: center;
    padding: 1.5rem 1.25rem;
    background: #fff;
    border-radius: 18px;
    box-shadow: var(--cf-shadow);
    border: 1px solid #f0f1f3;
    border-top: 3px solid var(--_accent);
    /* max-width: 900px; */
    margin: 0 auto;
    width: 100%;
}

@media (min-width: 640px) {
    :where(.cf-css-dashboard) .cf-lesson-complete {
        flex-direction: row;
        text-align: left;
        align-items: center;
    }
}

:where(.cf-css-dashboard) .cf-lesson-complete__icon {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    background: rgba(var(--_rgb), 0.14);
    color: var(--_accent);
    font-size: 1.6rem;
}

:where(.cf-css-dashboard) .cf-lesson-complete__body {
    flex: 1;
    min-width: 0;
}

:where(.cf-css-dashboard) .cf-lesson-complete__title {
    font-size: 1rem;
    font-weight: 800;
    color: var(--cf-dark);
    margin: 0 0 0.25rem;
}

:where(.cf-css-dashboard) .cf-lesson-complete__sub {
    font-size: 0.82rem;
    color: #6b7280;
    line-height: 1.55;
    margin: 0;
}

:where(.cf-css-dashboard) .cf-lesson-complete__btn {
    flex-shrink: 0;
    min-width: 200px;
    justify-content: center;
}

@media (max-width: 639.98px) {
    :where(.cf-css-dashboard) .cf-lesson-complete__btn {
        width: 100%;
    }
}

/* Bottom back button */
:where(.cf-css-dashboard) .cf-lesson-back-bottom {
    margin: 0 auto;
    width: 100%;
    display: flex;
    justify-content: flex-start;
}

/* Responsive tweaks */
@media (max-width: 575.98px) {
    :where(.cf-css-dashboard) .cf-lesson-reader {
        border-radius: 14px;
    }

    :where(.cf-css-dashboard) .cf-lesson-hero__title {
        line-height: 1.25;
    }

    :where(.cf-css-dashboard) .cf-lesson-block {
        font-size: 0.88rem;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {

    :where(.cf-css-dashboard) .cf-classroom__subject,:where(.cf-css-dashboard) 
    .cf-reading-progress span {
        transition: none !important;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   LEADERBOARD PAGE — page-level layout only.
   Podium + rows use existing classes from custom.css (cf-podium*, cf-rank-*, etc.)
   ═══════════════════════════════════════════════════════════════════════════ */

:where(.cf-css-dashboard) .cf-leaderboard {
    --_accent: var(--cf-accent, #fabf2c);
    --_rgb: var(--cf-accent-rgb, 250, 191, 44);
    --_on: var(--cf-on-accent, #212529);
    --_gap: clamp(0.85rem, 2.6vw, 1.15rem);
}

/* Rank badge in hero */
:where(.cf-css-dashboard) .cf-leaderboard__rank-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem 1.35rem;
    border-radius: 18px;
    background: rgba(var(--_rgb), 0.14);
    border: 1px solid rgba(var(--_rgb), 0.35);
    box-shadow: 0 0 24px rgba(var(--_rgb), 0.20);
    justify-self: center;
    min-width: 130px;
    text-align: center;
    flex-shrink: 0;
}

:where(.cf-css-dashboard) .cf-leaderboard__rank-label {
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 0.25rem;
}

:where(.cf-css-dashboard) .cf-leaderboard__rank-value {
    font-size: clamp(1.6rem, 5.5vw, 2rem);
    font-weight: 800;
    color: var(--_accent);
    line-height: 1;
    letter-spacing: -0.6px;
    font-variant-numeric: tabular-nums;
}

/* Controls bar */
:where(.cf-css-dashboard) .cf-leaderboard__controls {
    display: flex;
    flex-direction: column;
    gap: var(--_gap);
    background: #fff;
    border-radius: 18px;
    padding: 1rem 1.1rem;
    box-shadow: var(--cf-shadow);
    border: 1px solid #f0f1f3;
}

@media (min-width: 768px) {
    :where(.cf-css-dashboard) .cf-leaderboard__controls {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

:where(.cf-css-dashboard) .cf-leaderboard__filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    align-items: center;
}

:where(.cf-css-dashboard) .cf-leaderboard__filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

:where(.cf-css-dashboard) .cf-leaderboard__filter-label {
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #9ca3af;
}

:where(.cf-css-dashboard) .cf-leaderboard__select {
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    padding: 0.5rem 0.85rem;
    font-size: 0.82rem;
    font-weight: 600;
    background: #fff;
    color: var(--cf-dark);
    font-family: inherit;
    min-height: 40px;
    cursor: pointer;
}

:where(.cf-css-dashboard) .cf-leaderboard__select:focus {
    outline: none;
    border-color: var(--_accent);
    box-shadow: 0 0 0 3px rgba(var(--_rgb), 0.15);
}

/* Exam pill (read-only) */
:where(.cf-css-dashboard) .cf-leaderboard__exam-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.85rem;
    border-radius: 10px;
    background: rgba(var(--_rgb), 0.12);
    border: 1px solid rgba(var(--_rgb), 0.28);
    color: color-mix(in srgb, var(--_accent) 75%, #000);
    font-size: 0.82rem;
    font-weight: 700;
    min-height: 40px;
}

/* Visibility switch */
:where(.cf-css-dashboard) .cf-leaderboard__visibility {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

:where(.cf-css-dashboard) .cf-leaderboard__switch {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

:where(.cf-css-dashboard) .cf-leaderboard__switch input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

:where(.cf-css-dashboard) .cf-leaderboard__switch-track {
    position: relative;
    width: 42px;
    height: 24px;
    border-radius: 999px;
    background: #d1d5db;
    flex-shrink: 0;
    transition: background 0.25s ease;
}

:where(.cf-css-dashboard) .cf-leaderboard__switch-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    transition: transform 0.25s cubic-bezier(.22, .9, .32, 1);
}

:where(.cf-css-dashboard) .cf-leaderboard__switch input:checked~.cf-leaderboard__switch-track {
    background: var(--_accent);
}

:where(.cf-css-dashboard) .cf-leaderboard__switch input:checked~.cf-leaderboard__switch-track .cf-leaderboard__switch-thumb {
    transform: translateX(18px);
}

:where(.cf-css-dashboard) .cf-leaderboard__switch-label {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--cf-dark);
}

/* Tabs */
:where(.cf-css-dashboard) .cf-leaderboard__tabs {
    display: flex;
    gap: 0.35rem;
    border: none;
    margin: 0;
    padding: 0.35rem;
    background: #fff;
    border-radius: 14px;
    box-shadow: var(--cf-shadow);
    border: 1px solid #f0f1f3;
    width: fit-content;
    list-style: none;
}

:where(.cf-css-dashboard) .cf-leaderboard__tabs .nav-item {
    list-style: none;
}

:where(.cf-css-dashboard) .cf-leaderboard__tab {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.6rem 1.15rem;
    border-radius: 10px;
    border: none;
    background: transparent;
    color: #6b7280;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 42px;
    -webkit-tap-highlight-color: transparent;
}

:where(.cf-css-dashboard) .cf-leaderboard__tab:hover {
    background: #f3f4f6;
    color: var(--cf-dark);
}

:where(.cf-css-dashboard) .cf-leaderboard__tab.active {
    background: var(--_accent);
    color: var(--_on);
    box-shadow: 0 8px 20px -10px rgba(var(--_rgb), 0.55);
}

:where(.cf-css-dashboard) .cf-leaderboard__tab i {
    font-size: 0.95rem;
}

/* Tab content + sections */
:where(.cf-css-dashboard) .cf-leaderboard__tab-content {
    display: flex;
    flex-direction: column;
    gap: var(--_gap);
}

:where(.cf-css-dashboard) .cf-leaderboard__podium-wrap {
    background: linear-gradient(180deg, rgba(var(--_rgb), 0.05) 0%, transparent 100%);
    border-radius: 18px;
    overflow: hidden;
}

:where(.cf-css-dashboard) .cf-leaderboard__list-wrap {
    background: #fff;
    border-radius: 18px;
    padding: 0.5rem 0.75rem;
    box-shadow: var(--cf-shadow);
    border: 1px solid #f0f1f3;
}

:where(.cf-css-dashboard) .cf-leaderboard__list {
    display: flex;
    flex-direction: column;
}

:where(.cf-css-dashboard) .cf-leaderboard__rank-info {
    font-size: 0.72rem;
    color: #9ca3af;
    text-align: center;
    padding: 0.65rem 0 0.25rem;
}

:where(.cf-css-dashboard) .cf-leaderboard__pagination {
    display: flex;
    justify-content: center;
    gap: 0.35rem;
    flex-wrap: wrap;
    padding: 0.5rem 0 0.75rem;
}

/* Profile panel */
:where(.cf-css-dashboard) .cf-leaderboard__profile-panel {
    position: fixed;
    z-index: 1055;
    inset: auto 0 0 0;
    background: transparent;
    animation: lbProfileIn 0.3s ease both;
}

@media (min-width: 768px) {
    :where(.cf-css-dashboard) .cf-leaderboard__profile-panel {
        inset: 0 0 0 auto;
        width: min(420px, 100vw);
    }
}

:where(.cf-css-dashboard) .cf-leaderboard__profile-panel[hidden] {
    display: none;
}

:where(.cf-css-dashboard) .cf-leaderboard__profile-inner {
    position: relative;
    background: #fff;
    border-radius: 22px 22px 0 0;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.15);
    padding: 1.25rem 1.35rem calc(1.5rem + env(safe-area-inset-bottom, 0px));
    max-height: 80vh;
    overflow-y: auto;
}

@media (min-width: 768px) {
    :where(.cf-css-dashboard) .cf-leaderboard__profile-inner {
        height: 100vh;
        max-height: none;
        border-radius: 0;
        box-shadow: -10px 0 40px rgba(0, 0, 0, 0.12);
        padding: 2rem 1.75rem;
    }
}

@keyframes lbProfileIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (min-width: 768px) {
    @keyframes lbProfileIn {
        from {
            opacity: 0;
            transform: translateX(30px);
        }

        to {
            opacity: 1;
            transform: translateX(0);
        }
    }
}

:where(.cf-css-dashboard) .cf-leaderboard__profile-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #f3f4f6;
    border: none;
    color: #4b5563;
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: background 0.2s ease;
}

:where(.cf-css-dashboard) .cf-leaderboard__profile-close:hover {
    background: #e5e7eb;
}

:where(.cf-css-dashboard) .cf-leaderboard__profile-title {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--_accent);
    margin: 0 0 1rem;
}

:where(.cf-css-dashboard) .cf-leaderboard__profile-body {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

:where(.cf-css-dashboard) .cf-leaderboard__profile-body img {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--_accent);
    margin-bottom: 0.5rem;
}

:where(.cf-css-dashboard) .cf-leaderboard__profile-body h2 {
    font-size: 1.35rem;
    font-weight: 800;
    margin: 0;
    color: var(--cf-dark);
}

:where(.cf-css-dashboard) .cf-leaderboard__profile-body p {
    font-size: 0.9rem;
    color: #6b7280;
    margin: 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   RETEST PAGE  (.cf-retest)  — inside standard chrome
   Extends corrections visual language (reuses .cf-corrections__hero)
   ═══════════════════════════════════════════════════════════════════════════ */

:where(.cf-css-dashboard) .cf-retest {
    --_accent: var(--cf-accent, #fabf2c);
    --_rgb: var(--cf-accent-rgb, 250, 191, 44);
    --_on: var(--cf-on-accent, #212529);
    --_gap: clamp(0.85rem, 2.6vw, 1.15rem);
}

/* ── Hero (extends .cf-corrections__hero) ─────────────────────────────── */
:where(.cf-css-dashboard) .cf-retest__hero {
    /* Same visual as corrections hero — just extra room for tips */
    margin-bottom: 0.25rem;
}

:where(.cf-css-dashboard) .cf-retest__tips {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding: 0.85rem 1rem;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
    align-self: center;
}

@media (min-width: 640px) {
    :where(.cf-css-dashboard) .cf-retest__tips {
        align-self: end;
        min-width: 240px;
    }
}

:where(.cf-css-dashboard) .cf-retest__tip {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.72rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.72);
    line-height: 1.4;
}

:where(.cf-css-dashboard) .cf-retest__tip i {
    color: var(--_accent);
    font-size: 0.85rem;
    flex-shrink: 0;
}

:where(.cf-css-dashboard) .cf-retest__tip kbd {
    display: inline-block;
    padding: 0.05rem 0.35rem;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.12);
    font-family: "JetBrains Mono", ui-monospace, monospace;
    font-size: 0.66rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.4;
    vertical-align: middle;
}

/* ── Primary CTA (start / next) ───────────────────────────────────────── */
:where(.cf-css-dashboard) .cf-retest__cta {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    width: 100%;
    min-height: 56px;
    padding: 0.9rem 1.2rem;
    border-radius: 14px;
    border: none;
    cursor: pointer;
    font-family: var(--cf-font);
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: -0.1px;
    text-decoration: none;
    overflow: hidden;
    isolation: isolate;
    background: var(--_accent);
    color: var(--_on);
    box-shadow:
        0 10px 24px -10px rgba(var(--_rgb), 0.65),
        0 2px 0 rgba(0, 0, 0, 0.06) inset;
    transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

:where(.cf-css-dashboard) .cf-retest__cta:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    box-shadow: none;
}

:where(.cf-css-dashboard) .cf-retest__cta:not(:disabled):hover,:where(.cf-css-dashboard) 
.cf-retest__cta:not(:disabled):focus-visible {
    color: var(--_on);
    filter: brightness(1.03);
    box-shadow:
        0 14px 32px -10px rgba(var(--_rgb), 0.75),
        0 2px 0 rgba(0, 0, 0, 0.06) inset;
    outline: none;
}

:where(.cf-css-dashboard) .cf-retest__cta:not(:disabled):active {
    transform: translateY(1px);
}

/* Shine sweep */
:where(.cf-css-dashboard) .cf-retest__cta-glow {
    position: absolute;
    inset: 0;
    background: linear-gradient(115deg,
            transparent 30%,
            rgba(255, 255, 255, 0.45) 50%,
            transparent 70%);
    transform: translateX(-120%);
    transition: transform 0.7s ease;
    pointer-events: none;
}

:where(.cf-css-dashboard) .cf-retest__cta:hover .cf-retest__cta-glow,:where(.cf-css-dashboard) 
.cf-retest__cta:focus-visible .cf-retest__cta-glow {
    transform: translateX(120%);
}

:where(.cf-css-dashboard) .cf-retest__cta-icon {
    font-size: 1.15rem;
}

:where(.cf-css-dashboard) .cf-retest__cta-label {
    flex: 0 1 auto;
}

:where(.cf-css-dashboard) .cf-retest__cta-arrow {
    font-size: 1.05rem;
    transition: transform 0.2s ease;
}

:where(.cf-css-dashboard) .cf-retest__cta:hover .cf-retest__cta-arrow {
    transform: translateX(4px);
}

/* ── Retest room (question view) ─────────────────────────────────────── */
:where(.cf-css-dashboard) .cf-retest__room {
    display: flex;
    flex-direction: column;
    gap: var(--_gap);
}

/* Status card: progress + timer */
:where(.cf-css-dashboard) .cf-retest__status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.8rem 1.1rem;
    background: #fff;
    border-radius: 14px;
    border: 1px solid #f0f1f3;
    box-shadow: var(--cf-shadow);
}

:where(.cf-css-dashboard) .cf-retest__progress {
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--cf-dark);
    letter-spacing: -0.1px;
}

:where(.cf-css-dashboard) .cf-retest__timer {
    font-family: "JetBrains Mono", ui-monospace, monospace;
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--_accent);
    background: rgba(var(--_rgb), 0.10);
    border: 1px solid rgba(var(--_rgb), 0.25);
    padding: 0.35rem 0.75rem;
    border-radius: 10px;
    letter-spacing: 0.02em;
    font-variant-numeric: tabular-nums;
    min-width: 84px;
    text-align: center;
    line-height: 1;
}

:where(.cf-css-dashboard) .cf-retest__timer.is-danger {
    color: #b91c1c;
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.28);
    animation: cfRetestPulse 0.8s ease-in-out infinite;
}

@keyframes cfRetestPulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.55;
    }
}

/* ── Question card ───────────────────────────────────────────────────── */
:where(.cf-css-dashboard) .cf-retest__question {
    background: #fff;
    border-radius: 20px;
    padding: clamp(1.1rem, 3.5vw, 1.6rem);
    box-shadow: var(--cf-shadow);
    border: 1px solid #f0f1f3;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

:where(.cf-css-dashboard) .cf-retest__instruction {
    font-size: 0.78rem;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 0;
}

:where(.cf-css-dashboard) .cf-retest__instruction:empty {
    display: none;
}

:where(.cf-css-dashboard) .cf-retest__text {
    font-size: 1rem;
    line-height: 1.75;
    color: var(--cf-dark);
    font-weight: 500;
    margin: 0;
}

@media (min-width: 768px) {
    :where(.cf-css-dashboard) .cf-retest__text {
        font-size: 1.05rem;
    }
}

:where(.cf-css-dashboard) .cf-retest__image {
    max-width: 100%;
    max-height: 300px;
    border-radius: 12px;
    object-fit: contain;
    align-self: flex-start;
}

/* ── Options (JS produces .question-option buttons) ─────────────────── */
:where(.cf-css-dashboard) .cf-retest__options {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

:where(.cf-css-dashboard) .cf-retest__options .question-option {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 0.9rem 1rem;
    border-radius: 14px;
    border: 1.5px solid #e5e7eb;
    background: #fff;
    font-family: inherit;
    font-size: 0.92rem;
    line-height: 1.55;
    color: var(--cf-dark);
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 56px;
    -webkit-tap-highlight-color: transparent;
    width: 100%;
}

:where(.cf-css-dashboard) .cf-retest__options .question-option:hover:not(:disabled),:where(.cf-css-dashboard) 
.cf-retest__options .question-option:focus-visible:not(:disabled) {
    border-color: rgba(var(--_rgb), 0.5);
    background: rgba(var(--_rgb), 0.04);
    outline: none;
}

:where(.cf-css-dashboard) .cf-retest__options .question-option:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

:where(.cf-css-dashboard) .cf-retest__options .question-option.selected {
    border-color: var(--_accent);
    background: rgba(var(--_rgb), 0.10);
    box-shadow: 0 0 0 3px rgba(var(--_rgb), 0.15);
    color: var(--cf-dark);
    font-weight: 700;
}

/* ── Confidence fieldset ─────────────────────────────────────────────── */
:where(.cf-css-dashboard) .cf-retest__confidence {
    border: none;
    padding: 0;
    margin: 0.25rem 0 0;
}

:where(.cf-css-dashboard) .cf-retest__confidence-legend {
    font-size: 0.72rem;
    font-weight: 800;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.6rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0;
}

:where(.cf-css-dashboard) .cf-retest__confidence-legend i {
    color: var(--_accent);
    font-size: 0.9rem;
}

:where(.cf-css-dashboard) .cf-retest__confidence-legend span {
    color: #9ca3af;
    text-transform: none;
    letter-spacing: 0;
    font-weight: 600;
}

:where(.cf-css-dashboard) .cf-retest__confidence-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

:where(.cf-css-dashboard) .cf-retest__confidence-opt {
    flex: 1 1 0;
    min-width: 130px;
    cursor: pointer;
    position: relative;
}

:where(.cf-css-dashboard) .cf-retest__confidence-opt input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

:where(.cf-css-dashboard) .cf-retest__confidence-pill {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.7rem 0.9rem;
    border-radius: 12px;
    background: #fff;
    border: 1.5px solid #e5e7eb;
    color: #4b5563;
    font-size: 0.82rem;
    font-weight: 700;
    text-align: center;
    transition: all 0.2s ease;
    min-height: 48px;
    -webkit-tap-highlight-color: transparent;
}

:where(.cf-css-dashboard) .cf-retest__confidence-pill i {
    font-size: 1rem;
}

:where(.cf-css-dashboard) .cf-retest__confidence-opt:hover .cf-retest__confidence-pill {
    border-color: rgba(var(--_rgb), 0.5);
    color: var(--cf-dark);
}

:where(.cf-css-dashboard) .cf-retest__confidence-opt input:checked+.cf-retest__confidence-pill {
    border-color: var(--_accent);
    background: rgba(var(--_rgb), 0.10);
    color: color-mix(in srgb, var(--_accent) 75%, #000);
    box-shadow: 0 0 0 3px rgba(var(--_rgb), 0.15);
}

/* ── Connection status ───────────────────────────────────────────────── */
:where(.cf-css-dashboard) .cf-retest__connection {
    font-size: 0.75rem;
    color: #9ca3af;
    text-align: center;
    margin: 0;
    min-height: 1.2em;
    line-height: 1.5;
}

/* ── Abandon button ──────────────────────────────────────────────────── */
:where(.cf-css-dashboard) .cf-retest__leave {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.7rem 1.1rem;
    border-radius: 12px;
    background: transparent;
    border: 1.5px solid #e5e7eb;
    color: #6b7280;
    font-family: var(--cf-font);
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 48px;
    align-self: center;
    -webkit-tap-highlight-color: transparent;
}

:where(.cf-css-dashboard) .cf-retest__leave:hover,:where(.cf-css-dashboard) 
.cf-retest__leave:focus-visible {
    border-color: rgba(239, 68, 68, 0.4);
    background: rgba(239, 68, 68, 0.06);
    color: #b91c1c;
    outline: none;
}

/* ── Result section ──────────────────────────────────────────────────── */
:where(.cf-css-dashboard) .cf-retest__result {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

:where(.cf-css-dashboard) .cf-retest__result h2 {
    font-size: clamp(1.2rem, 4vw, 1.5rem);
    font-weight: 800;
    color: var(--cf-dark);
    margin: 0;
    letter-spacing: -0.3px;
}

:where(.cf-css-dashboard) .cf-retest__result p {
    font-size: 0.9rem;
    line-height: 1.6;
    color: #4b5563;
    margin: 0;
}

/* JS renders .journey-card inside the result */
:where(.cf-css-dashboard) .cf-retest__result .journey-card {
    background: #fff;
    border-radius: 16px;
    padding: 1.1rem 1.25rem;
    box-shadow: var(--cf-shadow);
    border: 1px solid #f0f1f3;
    border-left: 3px solid var(--_accent);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

:where(.cf-css-dashboard) .cf-retest__result .journey-card h3 {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--cf-dark);
    margin: 0;
    line-height: 1.4;
}

:where(.cf-css-dashboard) .cf-retest__result .journey-card p {
    font-size: 0.85rem;
    line-height: 1.6;
    color: #4b5563;
    margin: 0;
}

:where(.cf-css-dashboard) .cf-retest__result .journey-card p:first-of-type {
    color: var(--cf-dark);
    font-weight: 700;
}

/* CTA inside result */
:where(.cf-css-dashboard) .cf-retest__result .journey-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.75rem 1.25rem;
    border-radius: 12px;
    background: var(--_accent);
    color: var(--_on);
    font-weight: 800;
    font-size: 0.9rem;
    text-decoration: none;
    align-self: flex-start;
    min-height: 48px;
    box-shadow: 0 10px 24px -10px rgba(var(--_rgb), 0.55);
    transition: all 0.2s ease;
}

:where(.cf-css-dashboard) .cf-retest__result .journey-button:hover {
    color: var(--_on);
    transform: translateY(-1px);
    box-shadow: 0 14px 30px -10px rgba(var(--_rgb), 0.65);
}

/* ── Reduced motion ──────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {

    :where(.cf-css-dashboard) .cf-retest__cta,:where(.cf-css-dashboard) 
    .cf-retest__cta-glow,:where(.cf-css-dashboard) 
    .cf-retest__cta-arrow,:where(.cf-css-dashboard) 
    .cf-retest__options .question-option,:where(.cf-css-dashboard) 
    .cf-retest__confidence-pill,:where(.cf-css-dashboard) 
    .cf-retest__leave,:where(.cf-css-dashboard) 
    .cf-retest__result .journey-button,:where(.cf-css-dashboard) 
    .cf-retest__timer.is-danger {
        transition: none !important;
        animation: none !important;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   EXAM FOCUS MODE — shared across retest, classroom-assessment, diagnostic
   Apply by adding `cf-exam-active` to <body> while a timed check is running.
   Sidebar links dim + show a padlock; Corrections and Logout stay live.
   ═══════════════════════════════════════════════════════════════════════════ */

/* The list of allowed links is data-driven per page via inline attributes.
   Default fallback: keep Corrections + Logout clickable during retest. */
body:where(.cf-css-dashboard).cf-exam-active .cf-sidebar-link:not(.active):not([data-exam-allow]) {
    opacity: 0.4;
    pointer-events: none;
}

body:where(.cf-css-dashboard).cf-exam-active .cf-sidebar-link:not(.active):not([data-exam-allow])::after {
    content: "\F47A";
    /* bi-lock-fill */
    font-family: "bootstrap-icons";
    font-style: normal;
    font-weight: normal;
    font-variant: normal;
    text-transform: none;
    line-height: 1;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.35);
    margin-left: auto;
    margin-right: 0.25rem;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    flex-shrink: 0;
}

/* Reduced motion: no fade animation on the padlock reveal (it has none anyway) */
@media (prefers-reduced-motion: reduce) {
    body:where(.cf-css-dashboard).cf-exam-active .cf-sidebar-link:not(.active):not([data-exam-allow]) {
        transition: none !important;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   CLASSROOM ASSESSMENT  (.cf-assessment)
   Extends corrections / retest visual language
   ═══════════════════════════════════════════════════════════════════════════ */

:where(.cf-css-dashboard) .cf-assessment {
    --_accent: var(--cf-accent, #fabf2c);
    --_rgb: var(--cf-accent-rgb, 250, 191, 44);
    --_on: var(--cf-on-accent, #212529);
    --_gap: clamp(0.85rem, 2.6vw, 1.15rem);
}

/* ── Hero count badge (extends corrections hero) ──────────────────────── */
:where(.cf-css-dashboard) .cf-assessment__hero-count {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: rgba(var(--_rgb), 0.14);
    border: 1px solid rgba(var(--_rgb), 0.35);
    box-shadow: 0 0 24px rgba(var(--_rgb), 0.20);
    justify-self: center;
    flex-shrink: 0;
}

:where(.cf-css-dashboard) .cf-assessment__hero-count strong {
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1;
    color: var(--_accent);
    font-variant-numeric: tabular-nums;
}

:where(.cf-css-dashboard) .cf-assessment__hero-count span {
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 0.3rem;
}

/* ── Attempt history ──────────────────────────────────────────────────── */
:where(.cf-css-dashboard) .cf-assessment__history-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.82rem;
}

:where(.cf-css-dashboard) .cf-assessment__history-table th {
    text-align: left;
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #6b7280;
    padding: 0.5rem 0.65rem;
    border-bottom: 1px solid #eef0f3;
}

:where(.cf-css-dashboard) .cf-assessment__history-table td {
    padding: 0.65rem;
    color: var(--cf-dark);
    font-weight: 600;
    border-bottom: 1px solid #f5f6f8;
    font-variant-numeric: tabular-nums;
}

:where(.cf-css-dashboard) .cf-assessment__history-table tr:last-child td {
    border-bottom: none;
}

/* ── Form wrapper ─────────────────────────────────────────────────────── */
:where(.cf-css-dashboard) .cf-assessment__form {
    display: flex;
    flex-direction: column;
    gap: var(--_gap);
}

/* ── Question card ────────────────────────────────────────────────────── */
:where(.cf-css-dashboard) .cf-assessment__question {
    background: #fff;
    border-radius: 20px;
    padding: clamp(1.1rem, 3.5vw, 1.6rem);
    box-shadow: var(--cf-shadow);
    border: 1px solid #f0f1f3;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

:where(.cf-css-dashboard) .cf-assessment__question-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    margin-bottom: 0.15rem;
}

:where(.cf-css-dashboard) .cf-assessment__qnum {
    display: inline-flex;
    align-items: center;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: color-mix(in srgb, var(--_accent) 75%, #000);
    background: rgba(var(--_rgb), 0.10);
    border: 1px solid rgba(var(--_rgb), 0.25);
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    line-height: 1;
}

:where(.cf-css-dashboard) .cf-assessment__qcount {
    font-size: 0.72rem;
    font-weight: 700;
    color: #9ca3af;
    font-variant-numeric: tabular-nums;
}

:where(.cf-css-dashboard) .cf-assessment__instruction {
    font-size: 0.78rem;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 0;
}

:where(.cf-css-dashboard) .cf-assessment__text {
    font-size: 0.98rem;
    line-height: 1.75;
    color: var(--cf-dark);
    font-weight: 500;
}

@media (min-width: 768px) {
    :where(.cf-css-dashboard) .cf-assessment__text {
        font-size: 1.02rem;
    }
}

:where(.cf-css-dashboard) .cf-assessment__image {
    max-width: 100%;
    max-height: 320px;
    border-radius: 12px;
    object-fit: contain;
    align-self: flex-start;
}

/* ── Options fieldset ─────────────────────────────────────────────────── */
:where(.cf-css-dashboard) .cf-assessment__fieldset {
    border: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

:where(.cf-css-dashboard) .cf-assessment__fieldset .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Option row (both pre-submit and post-submit states) */
:where(.cf-css-dashboard) .cf-assessment__option,:where(.cf-css-dashboard) 
.cf-answer-option {
    display: flex;
    align-items: flex-start;
    gap: 0;
    padding: 0.9rem 1rem;
    border-radius: 14px;
    border: 1.5px solid #e5e7eb;
    background: #fff;
    font-size: 0.92rem;
    line-height: 1.55;
    color: var(--cf-dark);
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 56px;
    -webkit-tap-highlight-color: transparent;
    position: relative;
}

:where(.cf-css-dashboard) .cf-assessment__option:hover {
    border-color: rgba(var(--_rgb), 0.5);
    background: rgba(var(--_rgb), 0.04);
}

:where(.cf-css-dashboard) .cf-assessment__option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

:where(.cf-css-dashboard) .cf-assessment__option-body {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    width: 100%;
}

:where(.cf-css-dashboard) .cf-assessment__option-key {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 9px;
    display: grid;
    place-items: center;
    background: #f3f4f6;
    color: #4b5563;
    font-size: 0.78rem;
    font-weight: 800;
    line-height: 1;
    transition: all 0.2s ease;
}

:where(.cf-css-dashboard) .cf-assessment__option-text {
    flex: 1;
    min-width: 0;
    padding-top: 2px;
}

/* Selected state */
:where(.cf-css-dashboard) .cf-assessment__option:has(input:checked),:where(.cf-css-dashboard) 
.cf-assessment__option input:checked~.cf-assessment__option-body {
    border-color: var(--_accent);
    color: var(--cf-dark);
}

:where(.cf-css-dashboard) .cf-assessment__option:has(input:checked) {
    border-color: var(--_accent);
    background: rgba(var(--_rgb), 0.10);
    box-shadow: 0 0 0 3px rgba(var(--_rgb), 0.15);
}

:where(.cf-css-dashboard) .cf-assessment__option:has(input:checked) .cf-assessment__option-key {
    background: var(--_accent);
    color: var(--_on);
}

/* Locked while buffering */
:where(.cf-css-dashboard) .cf-assessment__option input:disabled~.cf-assessment__option-body {
    opacity: 0.7;
}

/* Post-submit states (JS renders these as <p class="cf-answer-option …">) */
:where(.cf-css-dashboard) .cf-answer-option {
    cursor: default;
}

:where(.cf-css-dashboard) .cf-answer-option.correct {
    border-color: rgba(34, 197, 94, 0.55);
    background: rgba(34, 197, 94, 0.08);
    color: #15803d;
    font-weight: 700;
}

:where(.cf-css-dashboard) .cf-answer-option.wrong {
    border-color: rgba(239, 68, 68, 0.5);
    background: rgba(239, 68, 68, 0.06);
    color: #b91c1c;
    font-weight: 700;
}

/* Solution block (revealed after submission) */
:where(.cf-css-dashboard) .cf-solution {
    background: #f8f9fb;
    border-radius: 12px;
    padding: 0.9rem 1rem;
    border-left: 3px solid var(--_accent);
    font-size: 0.85rem;
    line-height: 1.6;
    color: #4b5563;
}

:where(.cf-css-dashboard) .cf-solution strong {
    display: block;
    color: var(--cf-dark);
    font-weight: 800;
    margin-bottom: 0.35rem;
}

:where(.cf-css-dashboard) .cf-solution p {
    margin: 0;
}

/* ── Submit CTA ───────────────────────────────────────────────────────── */
:where(.cf-css-dashboard) .cf-assessment__submit {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    width: 100%;
    min-height: 56px;
    padding: 0.95rem 1.2rem;
    border-radius: 14px;
    border: none;
    cursor: pointer;
    font-family: var(--cf-font);
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: -0.1px;
    overflow: hidden;
    isolation: isolate;
    background: var(--_accent);
    color: var(--_on);
    box-shadow:
        0 10px 24px -10px rgba(var(--_rgb), 0.65),
        0 2px 0 rgba(0, 0, 0, 0.06) inset;
    transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    margin-top: 0.25rem;
}

:where(.cf-css-dashboard) .cf-assessment__submit:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    box-shadow: none;
}

:where(.cf-css-dashboard) .cf-assessment__submit:not(:disabled):hover,:where(.cf-css-dashboard) 
.cf-assessment__submit:not(:disabled):focus-visible {
    color: var(--_on);
    filter: brightness(1.03);
    box-shadow:
        0 14px 32px -10px rgba(var(--_rgb), 0.75),
        0 2px 0 rgba(0, 0, 0, 0.06) inset;
    outline: none;
}

:where(.cf-css-dashboard) .cf-assessment__submit:not(:disabled):active {
    transform: translateY(1px);
}

:where(.cf-css-dashboard) .cf-assessment__submit-glow {
    position: absolute;
    inset: 0;
    background: linear-gradient(115deg,
            transparent 30%,
            rgba(255, 255, 255, 0.45) 50%,
            transparent 70%);
    transform: translateX(-120%);
    transition: transform 0.7s ease;
    pointer-events: none;
}

:where(.cf-css-dashboard) .cf-assessment__submit:hover .cf-assessment__submit-glow,:where(.cf-css-dashboard) 
.cf-assessment__submit:focus-visible .cf-assessment__submit-glow {
    transform: translateX(120%);
}

:where(.cf-css-dashboard) .cf-assessment__submit-label {
    flex: 0 1 auto;
}

:where(.cf-css-dashboard) .cf-assessment__submit-arrow {
    font-size: 1.05rem;
    transition: transform 0.2s ease;
}

:where(.cf-css-dashboard) .cf-assessment__submit:hover .cf-assessment__submit-arrow {
    transform: translateX(4px);
}

/* ── Result section ───────────────────────────────────────────────────── */
:where(.cf-css-dashboard) .cf-assessment__result {
    display: flex;
    flex-direction: column;
    gap: var(--_gap);
    margin-top: 0.5rem;
}

:where(.cf-css-dashboard) .cf-assessment__result .journey-card {
    background: #fff;
    border-radius: 20px;
    padding: clamp(1.1rem, 3.5vw, 1.6rem);
    box-shadow: var(--cf-shadow);
    border: 1px solid #f0f1f3;
    border-top: 3px solid var(--_accent);
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    text-align: center;
}

:where(.cf-css-dashboard) .cf-assessment__result .journey-score {
    font-size: clamp(2rem, 8vw, 3rem);
    font-weight: 800;
    color: var(--_accent);
    line-height: 1;
    font-variant-numeric: tabular-nums;
    letter-spacing: -1px;
}

:where(.cf-css-dashboard) .cf-assessment__result .journey-card h2 {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--cf-dark);
    margin: 0;
}

:where(.cf-css-dashboard) .cf-assessment__result .journey-card h3 {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--cf-dark);
    margin: 0.5rem 0 0;
}

:where(.cf-css-dashboard) .cf-assessment__result .journey-card p {
    font-size: 0.86rem;
    line-height: 1.6;
    color: #4b5563;
    margin: 0;
}

:where(.cf-css-dashboard) .cf-assessment__result .journey-card p.muted {
    color: #9ca3af;
}

:where(.cf-css-dashboard) .cf-assessment__result .journey-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 0.6rem;
}

:where(.cf-css-dashboard) .cf-assessment__result .journey-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.75rem 1.15rem;
    border-radius: 12px;
    background: var(--_accent);
    color: var(--_on);
    font-weight: 800;
    font-size: 0.85rem;
    text-decoration: none;
    min-height: 46px;
    box-shadow: 0 10px 24px -10px rgba(var(--_rgb), 0.55);
    transition: all 0.2s ease;
}

:where(.cf-css-dashboard) .cf-assessment__result .journey-button:hover {
    color: var(--_on);
    transform: translateY(-1px);
    box-shadow: 0 14px 30px -10px rgba(var(--_rgb), 0.65);
}

:where(.cf-css-dashboard) .cf-assessment__result .journey-button.secondary {
    background: #fff;
    color: var(--cf-dark);
    border: 1.5px solid #e5e7eb;
    box-shadow: none;
}

:where(.cf-css-dashboard) .cf-assessment__result .journey-button.secondary:hover {
    border-color: var(--_accent);
    background: rgba(var(--_rgb), 0.05);
}

/* When a question is answered correctly during review, dim the card accent */
:where(.cf-css-dashboard) .cf-assessment__result+.cf-assessment__question,:where(.cf-css-dashboard) 
.cf-assessment__question:has(.cf-solution:not([hidden])) {
    border-left: 3px solid var(--_accent);
}

/* ── Responsive ───────────────────────────────────────────────────────── */
@media (min-width: 640px) {
    :where(.cf-css-dashboard) .cf-assessment__hero-count {
        justify-self: end;
    }
}

/* ── Reduced motion ───────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {

    :where(.cf-css-dashboard) .cf-assessment__option,:where(.cf-css-dashboard) 
    .cf-assessment__option-key,:where(.cf-css-dashboard) 
    .cf-assessment__submit,:where(.cf-css-dashboard) 
    .cf-assessment__submit-glow,:where(.cf-css-dashboard) 
    .cf-assessment__submit-arrow,:where(.cf-css-dashboard) 
    .cf-assessment__result .journey-button {
        transition: none !important;
    }
}


/* ═══════════════════════════════════════════════════════════════════════════
   DIAGNOSTIC QUIZ  (.cf-diagnostic — quiz mode)
   Extends corrections / retest / assessment visual language
   NOTE: .cf-diagnostic is also used by diagnostic-result.php.
   Quiz-mode rules below are namespaced with __hero, __intro, __room, etc.,
   so they don't clash with result-mode styles already in this file.
   ═══════════════════════════════════════════════════════════════════════════ */

:where(.cf-css-dashboard) .cf-diagnostic {
    --_accent: var(--cf-accent, #fabf2c);
    --_rgb: var(--cf-accent-rgb, 250, 191, 44);
    --_on: var(--cf-on-accent, #212529);
    --_gap: clamp(0.85rem, 2.6vw, 1.15rem);
}

/* ── Hero count badge (subjects) ──────────────────────────────────────── */
:where(.cf-css-dashboard) .cf-diagnostic__hero-count {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: rgba(var(--_rgb), 0.14);
    border: 1px solid rgba(var(--_rgb), 0.35);
    box-shadow: 0 0 24px rgba(var(--_rgb), 0.20);
    justify-self: center;
    flex-shrink: 0;
}

:where(.cf-css-dashboard) .cf-diagnostic__hero-count strong {
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1;
    color: var(--_accent);
    font-variant-numeric: tabular-nums;
}

:where(.cf-css-dashboard) .cf-diagnostic__hero-count span {
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 0.3rem;
}

/* ── Intro card ───────────────────────────────────────────────────────── */
:where(.cf-css-dashboard) .cf-diagnostic__intro {
    background: #fff;
    border-radius: 20px;
    padding: clamp(1.1rem, 3.5vw, 1.6rem);
    box-shadow: var(--cf-shadow);
    border: 1px solid #f0f1f3;
    display: flex;
    flex-direction: column;
    gap: var(--_gap);
}

:where(.cf-css-dashboard) .cf-diagnostic__intro-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--cf-dark);
    margin: 0;
    letter-spacing: -0.2px;
}

/* Fact grid */
:where(.cf-css-dashboard) .cf-diagnostic__facts {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.6rem;
}

@media (min-width: 640px) {
    :where(.cf-css-dashboard) .cf-diagnostic__facts {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

:where(.cf-css-dashboard) .cf-diagnostic__fact {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.85rem 0.9rem;
    border-radius: 12px;
    background: #f8f9fb;
    border: 1px solid #eef0f3;
}

:where(.cf-css-dashboard) .cf-diagnostic__fact-icon {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: rgba(var(--_rgb), 0.12);
    color: var(--_accent);
    font-size: 1rem;
}

:where(.cf-css-dashboard) .cf-diagnostic__fact-body {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

:where(.cf-css-dashboard) .cf-diagnostic__fact-body strong {
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--cf-dark);
    line-height: 1.3;
}

:where(.cf-css-dashboard) .cf-diagnostic__fact-body span {
    font-size: 0.76rem;
    color: #6b7280;
    line-height: 1.5;
}

/* Issues list inside warning notice */
:where(.cf-css-dashboard) .cf-diagnostic__issues {
    margin: 0.5rem 0 0.35rem;
    padding-left: 1.1rem;
    font-size: 0.82rem;
    line-height: 1.6;
}

:where(.cf-css-dashboard) .cf-diagnostic__issues li {
    margin-bottom: 0.2rem;
}

/* ── Primary CTA ──────────────────────────────────────────────────────── */
:where(.cf-css-dashboard) .cf-diagnostic__cta {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    width: 100%;
    min-height: 56px;
    padding: 0.9rem 1.2rem;
    border-radius: 14px;
    border: none;
    cursor: pointer;
    font-family: var(--cf-font);
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: -0.1px;
    text-decoration: none;
    overflow: hidden;
    isolation: isolate;
    background: var(--_accent);
    color: var(--_on);
    box-shadow:
        0 10px 24px -10px rgba(var(--_rgb), 0.65),
        0 2px 0 rgba(0, 0, 0, 0.06) inset;
    transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

:where(.cf-css-dashboard) .cf-diagnostic__cta:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    box-shadow: none;
}

:where(.cf-css-dashboard) .cf-diagnostic__cta:not(:disabled):hover,:where(.cf-css-dashboard) 
.cf-diagnostic__cta:not(:disabled):focus-visible {
    color: var(--_on);
    filter: brightness(1.03);
    box-shadow:
        0 14px 32px -10px rgba(var(--_rgb), 0.75),
        0 2px 0 rgba(0, 0, 0, 0.06) inset;
    outline: none;
}

:where(.cf-css-dashboard) .cf-diagnostic__cta:not(:disabled):active {
    transform: translateY(1px);
}

:where(.cf-css-dashboard) .cf-diagnostic__cta-glow {
    position: absolute;
    inset: 0;
    background: linear-gradient(115deg,
            transparent 30%,
            rgba(255, 255, 255, 0.45) 50%,
            transparent 70%);
    transform: translateX(-120%);
    transition: transform 0.7s ease;
    pointer-events: none;
}

:where(.cf-css-dashboard) .cf-diagnostic__cta:hover .cf-diagnostic__cta-glow,:where(.cf-css-dashboard) 
.cf-diagnostic__cta:focus-visible .cf-diagnostic__cta-glow {
    transform: translateX(120%);
}

:where(.cf-css-dashboard) .cf-diagnostic__cta-icon {
    font-size: 1.15rem;
}

:where(.cf-css-dashboard) .cf-diagnostic__cta-label {
    flex: 0 1 auto;
}

:where(.cf-css-dashboard) .cf-diagnostic__cta-arrow {
    font-size: 1.05rem;
    transition: transform 0.2s ease;
}

:where(.cf-css-dashboard) .cf-diagnostic__cta:hover .cf-diagnostic__cta-arrow {
    transform: translateX(4px);
}

/* ── Diagnostic room (question view) ──────────────────────────────────── */
:where(.cf-css-dashboard) .cf-diagnostic__room {
    display: flex;
    flex-direction: column;
    gap: var(--_gap);
}

/* Status card */
:where(.cf-css-dashboard) .cf-diagnostic__status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.8rem 1.1rem;
    background: #fff;
    border-radius: 14px;
    border: 1px solid #f0f1f3;
    box-shadow: var(--cf-shadow);
}

:where(.cf-css-dashboard) .cf-diagnostic__progress {
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--cf-dark);
    letter-spacing: -0.1px;
}

:where(.cf-css-dashboard) .cf-diagnostic__timer {
    font-family: "JetBrains Mono", ui-monospace, monospace;
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--_accent);
    background: rgba(var(--_rgb), 0.10);
    border: 1px solid rgba(var(--_rgb), 0.25);
    padding: 0.35rem 0.75rem;
    border-radius: 10px;
    letter-spacing: 0.02em;
    font-variant-numeric: tabular-nums;
    min-width: 84px;
    text-align: center;
    line-height: 1;
}

/* In-card progress track */
:where(.cf-css-dashboard) .cf-diagnostic__progress-track {
    height: 6px;
    border-radius: 999px;
    background: #eef0f3;
    overflow: hidden;
}

:where(.cf-css-dashboard) .cf-diagnostic__progress-track>span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg,
            var(--_accent),
            color-mix(in srgb, var(--_accent) 55%, #fff));
    box-shadow: 0 0 8px rgba(var(--_rgb), 0.45);
    transition: width 0.35s cubic-bezier(.22, .9, .32, 1);
}

/* Question card */
:where(.cf-css-dashboard) .cf-diagnostic__question {
    background: #fff;
    border-radius: 20px;
    padding: clamp(1.1rem, 3.5vw, 1.6rem);
    box-shadow: var(--cf-shadow);
    border: 1px solid #f0f1f3;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Subject chip */
:where(.cf-css-dashboard) .cf-diagnostic__subject {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    align-self: flex-start;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: color-mix(in srgb, var(--_accent) 75%, #000);
    background: rgba(var(--_rgb), 0.10);
    border: 1px solid rgba(var(--_rgb), 0.25);
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    line-height: 1;
}

:where(.cf-css-dashboard) .cf-diagnostic__subject-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--_accent);
    flex-shrink: 0;
}

/* Instruction */
:where(.cf-css-dashboard) .cf-diagnostic__instruction {
    font-size: 0.78rem;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 0;
    min-height: 1em;
}

:where(.cf-css-dashboard) .cf-diagnostic__instruction:empty {
    display: none;
}

/* Question text */
:where(.cf-css-dashboard) .cf-diagnostic__text {
    font-size: 1rem;
    line-height: 1.75;
    color: var(--cf-dark);
    font-weight: 500;
}

@media (min-width: 768px) {
    :where(.cf-css-dashboard) .cf-diagnostic__text {
        font-size: 1.05rem;
    }
}

/* Rich-text children (JS inserts P/STRONG/EM/etc.) */
:where(.cf-css-dashboard) .cf-diagnostic__text p {
    margin: 0 0 0.75rem;
}

:where(.cf-css-dashboard) .cf-diagnostic__text p:last-child {
    margin-bottom: 0;
}

:where(.cf-css-dashboard) .cf-diagnostic__text strong {
    font-weight: 800;
}

:where(.cf-css-dashboard) .cf-diagnostic__text em {
    font-style: italic;
}

:where(.cf-css-dashboard) .cf-diagnostic__text ul,:where(.cf-css-dashboard) 
.cf-diagnostic__text ol {
    margin: 0.5rem 0;
    padding-left: 1.25rem;
}

/* Image */
:where(.cf-css-dashboard) .cf-diagnostic__image {
    max-width: 100%;
    max-height: 320px;
    border-radius: 12px;
    object-fit: contain;
    align-self: flex-start;
}

/* ── Options (JS produces .question-option with .option-letter) ──────── */
:where(.cf-css-dashboard) .cf-diagnostic__options {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

:where(.cf-css-dashboard) .cf-diagnostic__options .question-option {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 0.9rem 1rem;
    border-radius: 14px;
    border: 1.5px solid #e5e7eb;
    background: #fff;
    font-family: inherit;
    font-size: 0.92rem;
    line-height: 1.55;
    color: var(--cf-dark);
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 56px;
    -webkit-tap-highlight-color: transparent;
    width: 100%;
}

:where(.cf-css-dashboard) .cf-diagnostic__options .question-option:hover:not(:disabled),:where(.cf-css-dashboard) 
.cf-diagnostic__options .question-option:focus-visible:not(:disabled) {
    border-color: rgba(var(--_rgb), 0.5);
    background: rgba(var(--_rgb), 0.04);
    outline: none;
}

:where(.cf-css-dashboard) .cf-diagnostic__options .question-option:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

:where(.cf-css-dashboard) .cf-diagnostic__options .question-option.selected {
    border-color: var(--_accent);
    background: rgba(var(--_rgb), 0.10);
    box-shadow: 0 0 0 3px rgba(var(--_rgb), 0.15);
    color: var(--cf-dark);
    font-weight: 700;
}

/* Option letter badge (the JS adds .option-letter span) */
:where(.cf-css-dashboard) .cf-diagnostic__options .option-letter {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 9px;
    display: grid;
    place-items: center;
    background: #f3f4f6;
    color: #4b5563;
    font-size: 0.78rem;
    font-weight: 800;
    line-height: 1;
    transition: all 0.2s ease;
}

:where(.cf-css-dashboard) .cf-diagnostic__options .question-option.selected .option-letter {
    background: var(--_accent);
    color: var(--_on);
}

/* ── Confidence fieldset ─────────────────────────────────────────────── */
:where(.cf-css-dashboard) .cf-diagnostic__confidence {
    border: none;
    padding: 0;
    margin: 0.25rem 0 0;
}

:where(.cf-css-dashboard) .cf-diagnostic__confidence-legend {
    font-size: 0.72rem;
    font-weight: 800;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.6rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0;
}

:where(.cf-css-dashboard) .cf-diagnostic__confidence-legend i {
    color: var(--_accent);
    font-size: 0.9rem;
}

:where(.cf-css-dashboard) .cf-diagnostic__confidence-legend span {
    color: #9ca3af;
    text-transform: none;
    letter-spacing: 0;
    font-weight: 600;
}

:where(.cf-css-dashboard) .cf-diagnostic__confidence-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

:where(.cf-css-dashboard) .cf-diagnostic__confidence-opt {
    flex: 1 1 0;
    min-width: 130px;
    cursor: pointer;
    position: relative;
}

:where(.cf-css-dashboard) .cf-diagnostic__confidence-opt input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

:where(.cf-css-dashboard) .cf-diagnostic__confidence-pill {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.7rem 0.9rem;
    border-radius: 12px;
    background: #fff;
    border: 1.5px solid #e5e7eb;
    color: #4b5563;
    font-size: 0.82rem;
    font-weight: 700;
    text-align: center;
    transition: all 0.2s ease;
    min-height: 48px;
}

:where(.cf-css-dashboard) .cf-diagnostic__confidence-pill i {
    font-size: 1rem;
}

:where(.cf-css-dashboard) .cf-diagnostic__confidence-opt:hover .cf-diagnostic__confidence-pill {
    border-color: rgba(var(--_rgb), 0.5);
    color: var(--cf-dark);
}

:where(.cf-css-dashboard) .cf-diagnostic__confidence-opt input:checked+.cf-diagnostic__confidence-pill {
    border-color: var(--_accent);
    background: rgba(var(--_rgb), 0.10);
    color: color-mix(in srgb, var(--_accent) 75%, #000);
    box-shadow: 0 0 0 3px rgba(var(--_rgb), 0.15);
}

/* ── Action row: next + skip ─────────────────────────────────────────── */
:where(.cf-css-dashboard) .cf-diagnostic__actions-row {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

@media (min-width: 640px) {
    :where(.cf-css-dashboard) .cf-diagnostic__actions-row {
        flex-direction: row;
        align-items: stretch;
    }

    :where(.cf-css-dashboard) .cf-diagnostic__actions-row .cf-diagnostic__cta {
        flex: 1;
    }
}

:where(.cf-css-dashboard) .cf-diagnostic__skip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.75rem 1.15rem;
    border-radius: 12px;
    background: #fff;
    border: 1.5px solid #e5e7eb;
    color: var(--cf-dark);
    font-family: var(--cf-font);
    font-size: 0.85rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 56px;
    -webkit-tap-highlight-color: transparent;
}

:where(.cf-css-dashboard) .cf-diagnostic__skip:hover:not(:disabled),:where(.cf-css-dashboard) 
.cf-diagnostic__skip:focus-visible:not(:disabled) {
    border-color: var(--_accent);
    background: rgba(var(--_rgb), 0.05);
    outline: none;
}

:where(.cf-css-dashboard) .cf-diagnostic__skip:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ── Connection status ────────────────────────────────────────────────── */
:where(.cf-css-dashboard) .cf-diagnostic__connection {
    font-size: 0.75rem;
    color: #9ca3af;
    text-align: center;
    margin: 0;
    min-height: 1.2em;
    line-height: 1.5;
}

/* ── Fullscreen button ────────────────────────────────────────────────── */
:where(.cf-css-dashboard) .cf-diagnostic__fullscreen {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.65rem 1.1rem;
    border-radius: 12px;
    background: transparent;
    border: 1.5px solid #e5e7eb;
    color: #6b7280;
    font-family: var(--cf-font);
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 44px;
    align-self: center;
    -webkit-tap-highlight-color: transparent;
}

:where(.cf-css-dashboard) .cf-diagnostic__fullscreen:hover,:where(.cf-css-dashboard) 
.cf-diagnostic__fullscreen:focus-visible {
    border-color: var(--_accent);
    background: rgba(var(--_rgb), 0.05);
    color: var(--cf-dark);
    outline: none;
}

/* ── Footer (target chip + signout) ───────────────────────────────────── */
:where(.cf-css-dashboard) .cf-diagnostic__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding: 0.9rem 1rem;
    border-radius: 14px;
    background: #fff;
    border: 1px solid #f0f1f3;
    box-shadow: var(--cf-shadow);
}

:where(.cf-css-dashboard) .cf-diagnostic__footer-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

:where(.cf-css-dashboard) .cf-diagnostic__footer-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.4rem 0.7rem;
    border-radius: 999px;
    background: #f8f9fb;
    border: 1px solid #eef0f3;
    color: #4b5563;
    line-height: 1;
}

:where(.cf-css-dashboard) .cf-diagnostic__footer-chip i {
    color: var(--_accent);
    font-size: 0.78rem;
}

:where(.cf-css-dashboard) .cf-diagnostic__footer-chip strong {
    color: var(--cf-dark);
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

:where(.cf-css-dashboard) .cf-diagnostic__signout {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.78rem;
    font-weight: 700;
    color: #9ca3af;
    text-decoration: none;
    padding: 0.4rem 0.7rem;
    border-radius: 10px;
    transition: all 0.2s ease;
}

:where(.cf-css-dashboard) .cf-diagnostic__signout:hover {
    color: #b91c1c;
    background: rgba(239, 68, 68, 0.06);
}

/* ── Responsive ───────────────────────────────────────────────────────── */
@media (min-width: 640px) {
    :where(.cf-css-dashboard) .cf-diagnostic__hero-count {
        justify-self: end;
    }
}

/* ── Reduced motion ───────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {

    :where(.cf-css-dashboard) .cf-diagnostic__cta,:where(.cf-css-dashboard) 
    .cf-diagnostic__cta-glow,:where(.cf-css-dashboard) 
    .cf-diagnostic__cta-arrow,:where(.cf-css-dashboard) 
    .cf-diagnostic__options .question-option,:where(.cf-css-dashboard) 
    .cf-diagnostic__options .option-letter,:where(.cf-css-dashboard) 
    .cf-diagnostic__confidence-pill,:where(.cf-css-dashboard) 
    .cf-diagnostic__skip,:where(.cf-css-dashboard) 
    .cf-diagnostic__fullscreen,:where(.cf-css-dashboard) 
    .cf-diagnostic__progress-track>span {
        transition: none !important;
    }
}

/* Student sidebar navigation groups: preserve destinations, reduce cognitive load. */
:where(.cf-css-dashboard) .cf-sidebar-section-label {
    padding: 15px 18px 6px;
    color: var(--cf-muted, #7b8494);
    font-size: .66rem;
    font-weight: 800;
    letter-spacing: .09em;
    line-height: 1.2;
    text-transform: uppercase;
}
:where(.cf-css-dashboard) .cf-sidebar-section-label:first-child { padding-top: 8px; }

/* Every sidebar item stays locked until the active assessment finishes. */
body:where(.cf-css-dashboard).cf-exam-active #cfSidebar a{pointer-events:none!important;opacity:.42;cursor:not-allowed}
body:where(.cf-css-dashboard).cf-exam-active #cfSidebar a::after{content:"🔒";font-size:11px;margin-left:auto}



/* ============================================================
   MOBILE
   Enabled by: cf-css-mobile
   ============================================================ */
/* Shared student hardening. Tables wrap instead of widening the document. */
:where(.cf-css-mobile) *,:where(.cf-css-mobile) *::before,:where(.cf-css-mobile) *::after,*:where(.cf-css-mobile),*:where(:has(body.cf-css-mobile)),*:where(.cf-css-mobile)::before,*:where(:has(body.cf-css-mobile))::before,*:where(.cf-css-mobile)::after,*:where(:has(body.cf-css-mobile))::after{box-sizing:border-box}html:where(:has(body:where(.cf-css-mobile).cf-css-mobile)),body:where(.cf-css-mobile){max-width:100%;margin-inline:0}body:where(.cf-css-mobile){overflow-wrap:anywhere}:where(.cf-css-mobile) main,:where(.cf-css-mobile) section,:where(.cf-css-mobile) article,:where(.cf-css-mobile) aside,:where(.cf-css-mobile) nav,:where(.cf-css-mobile) .card,:where(.cf-css-mobile) .card-body,:where(.cf-css-mobile) .cf-main-content,:where(.cf-css-mobile) .cf-content,:where(.cf-css-mobile) .journey-shell,:where(.cf-css-mobile) .classroom-room-content{min-width:0}:where(.cf-css-mobile) img,:where(.cf-css-mobile) video,:where(.cf-css-mobile) iframe,:where(.cf-css-mobile) canvas,:where(.cf-css-mobile) svg{max-width:100%}:where(.cf-css-mobile) img,:where(.cf-css-mobile) video{height:auto}:where(.cf-css-mobile) input,:where(.cf-css-mobile) select,:where(.cf-css-mobile) textarea{max-width:100%;min-width:0}:where(.cf-css-mobile) pre{white-space:pre-wrap;overflow-wrap:anywhere}:where(.cf-css-mobile) table{max-width:100%;width:100%}:where(.cf-css-mobile) table th,:where(.cf-css-mobile) table td{white-space:normal!important;overflow-wrap:anywhere}:where(.cf-css-mobile) .cf-network-notice:empty{display:none}:where(.cf-css-mobile) .cf-network-notice{padding:.65rem;border-left:4px solid var(--cf-accent,#fabf2c)}:where(.cf-css-mobile) .cf-save-offline{margin-block:.5rem;font:inherit}:where(.cf-css-mobile) .cf-mobile-table{table-layout:fixed}:where(.cf-css-mobile) .journey-actions{flex-wrap:wrap}:where(.cf-css-mobile) .question-option{white-space:normal!important;overflow-wrap:anywhere}
@media(max-width:575px){:where(.cf-css-mobile) .row>.col,:where(.cf-css-mobile) .row>[class*=col-]{flex:0 0 100%!important;max-width:100%!important;width:100%!important}:where(.cf-css-mobile) .journey-grid,:where(.cf-css-mobile) .journey-output-grid,:where(.cf-css-mobile) .classroom-room-layout,:where(.cf-css-mobile) .classroom-overview,:where(.cf-css-mobile) .classroom-grid,:where(.cf-css-mobile) .cbt-layout,:where(.cf-css-mobile) .leaderboard-grid,:where(.cf-css-mobile) .grid{grid-template-columns:minmax(0,1fr)!important}:where(.cf-css-mobile) .journey-shell{padding:1rem!important}:where(.cf-css-mobile) .classroom-room-header,:where(.cf-css-mobile) .journey-topline{flex-wrap:wrap;gap:.65rem}:where(.cf-css-mobile) .classroom-room-nav{position:static!important;width:100%!important}:where(.cf-css-mobile) .classroom-room-content{padding:.75rem!important}:where(.cf-css-mobile) .cbt-room{padding:.6rem!important}:where(.cf-css-mobile) .d-flex{flex-wrap:wrap}:where(.cf-css-mobile) .cf-main-content,:where(.cf-css-mobile) .cf-content{margin-left:0!important;padding-inline:.75rem!important}:where(.cf-css-mobile) .table-responsive{overflow-x:visible!important}:where(.cf-css-mobile) .modal-dialog{margin:.5rem!important}:where(.cf-css-mobile) h1{font-size:clamp(1.4rem,7vw,2rem)}:where(.cf-css-mobile) .journey-actions>a,:where(.cf-css-mobile) .journey-actions>button{width:100%}:where(.cf-css-mobile) .input-group{flex-wrap:wrap}:where(.cf-css-mobile) .input-group>.form-control{width:100%}:where(.cf-css-mobile) .cf-mobile-table th,:where(.cf-css-mobile) .cf-mobile-table td{padding:.35rem;font-size:.82rem}}
@media(prefers-reduced-motion:reduce){:where(.cf-css-mobile) *,:where(.cf-css-mobile) *::before,:where(.cf-css-mobile) *::after,*:where(.cf-css-mobile),*:where(:has(body.cf-css-mobile)),*:where(.cf-css-mobile)::before,*:where(:has(body.cf-css-mobile))::before,*:where(.cf-css-mobile)::after,*:where(:has(body.cf-css-mobile))::after{animation-duration:.01ms!important;transition-duration:.01ms!important;scroll-behavior:auto!important}}
@media(max-width:575px){:where(.cf-css-mobile) [class$="-grid"],:where(.cf-css-mobile) [class*="-grid "]{grid-template-columns:minmax(0,1fr)!important}:where(.cf-css-mobile) .cf-offcanvas{width:min(350px,100vw)!important}:where(.cf-css-mobile) .cf-xp-level-card{min-width:0!important;max-width:100%}:where(.cf-css-mobile) .cf-user-dropdown{min-width:0!important;max-width:calc(100vw - 1rem)}:where(.cf-css-mobile) .cf-sidebar{max-width:calc(100vw - 2rem)}:where(.cf-css-mobile) .cf-reading-progress{left:0!important}:where(.cf-css-mobile) .cf-stat-grid,:where(.cf-css-mobile) .pr-stats-grid,:where(.cf-css-mobile) .cf-subject-grid,:where(.cf-css-mobile) .classroom-cards{grid-template-columns:minmax(0,1fr)!important}:where(.cf-css-mobile) .cf-topic-bar-wrap{max-width:100%;min-width:0}:where(.cf-css-mobile) .cf-topic-row{flex-wrap:wrap}}

/* Bound uploaded tenant logos to the navbar; preserve image proportions. */
#cfNavbar .cf-student-brand{min-width:0;max-width:min(52vw,440px);overflow:hidden;flex:0 1 auto}#cfNavbar .cf-student-brand .cf-tenant-logo{display:block;width:120px;height:33px;max-width:120px;max-height:33px;object-fit:contain;object-position:left center;flex:0 0 120px}#cfNavbar .cf-student-brand .cf-brand-text{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}#cfNavbar .cf-student-brand+div{flex-shrink:0}@media(max-width:767px){#cfNavbar .cf-student-brand{max-width:32vw;margin-right:.5rem;gap:8px!important}#cfNavbar .cf-student-brand .cf-tenant-logo{width:88px;max-width:88px;flex-basis:88px}}
