/* ── Google Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=Sora:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;600;700&display=swap');

/* ─────────────────────────────────────────────────────────────────────────── */
/* DESIGN TOKENS                                                               */
/* ─────────────────────────────────────────────────────────────────────────── */

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

:root {
  /* Sidebar */
  --sidebar-bg:      #1e3a5f;
  --sidebar-w:       240px;
  --sidebar-active:  #2a4f7c;
  --sidebar-hover:   rgba(255,255,255,0.08);
  --sidebar-text:    #ffffff;
  --sidebar-muted:   rgba(255,255,255,0.6);
  --sidebar-border:  rgba(255,255,255,0.08);

  /* Main layout */
  --main-bg:         #f4f6f9;
  --header-bg:       #ffffff;
  --header-h:        60px;
  --header-border:   #e5e7eb;

  /* Surfaces */
  --surface:         #ffffff;
  --surface-2:       #f8fafc;
  --surface-3:       #f1f5f9;

  /* Text */
  --text:            #1a1a2e;
  --text-muted:      #6b7280;

  /* Border */
  --border:          #e5e7eb;

  /* Accent / primary */
  --accent:          #2563eb;
  --accent-dim:      rgba(37,99,235,0.1);
  --accent-hover:    #1d4ed8;

  /* Semantic */
  --green:           #16a34a;
  --green-dim:       rgba(22,163,74,0.1);
  --red:             #dc2626;
  --red-dim:         rgba(220,38,38,0.1);
  --orange:          #d97706;
  --orange-dim:      rgba(217,119,6,0.1);

  /* Misc */
  --radius:          10px;
  --radius-sm:       6px;
  --font:            'Sora', -apple-system, sans-serif;
  --mono:            'Sora', sans-serif;

  /* Card shadow */
  --shadow-card:     0 1px 4px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-modal:    0 20px 60px rgba(0,0,0,.18);
}

/* ─────────────────────────────────────────────────────────────────────────── */
/* BASE                                                                        */
/* ─────────────────────────────────────────────────────────────────────────── */

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--main-bg);
  color: var(--text);
  overflow-x: hidden;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ─────────────────────────────────────────────────────────────────────────── */
/* SCREENS — global                                                            */
/* ─────────────────────────────────────────────────────────────────────────── */

.screen { display: none; min-height: 100vh; max-width: 100vw; overflow-x: hidden; }
.screen.active { display: flex; flex-direction: column; max-width: 100vw; overflow-x: hidden; }

/* ─────────────────────────────────────────────────────────────────────────── */
/* TOAST                                                                       */
/* ─────────────────────────────────────────────────────────────────────────── */

.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--green);
  color: #fff;
  font-size: .9rem;
  font-weight: 600;
  padding: 12px 24px;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,.2);
  z-index: 600;
  white-space: nowrap;
  transition: opacity .3s;
}
.toast.hidden { display: none; }

/* ─────────────────────────────────────────────────────────────────────────── */
/* LOADING OVERLAY                                                             */
/* ─────────────────────────────────────────────────────────────────────────── */

.loading-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(244,246,249,0.88);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 16px;
  backdrop-filter: blur(4px);
}
.loading-overlay.hidden { display: none; }
.loading-msg { color: var(--text-muted); font-size: .9rem; }

@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--surface-3);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

/* ─────────────────────────────────────────────────────────────────────────── */
/* APP SIDEBAR                                                                 */
/* ─────────────────────────────────────────────────────────────────────────── */

.app-sidebar {
  display: none;
  position: fixed;
  left: 0; top: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  flex-direction: column;
  z-index: 200;
  overflow: hidden;
}

/* Show sidebar on app screens */
body[data-screen="my-exams"]       .app-sidebar,
body[data-screen="dashboard"]      .app-sidebar,
body[data-screen="flashcards"]     .app-sidebar,
body[data-screen="downloads"]      .app-sidebar,
body[data-screen="session-review"] .app-sidebar,
body[data-screen="study-mode"]     .app-sidebar,
body[data-screen="practice-exam"]  .app-sidebar,
body[data-screen="settings"]       .app-sidebar,
body[data-screen="help"]           .app-sidebar,
body[data-screen="planner"]        .app-sidebar {
  display: flex;
}

/* Push content right when sidebar visible */
body[data-screen="my-exams"]       #screen-my-exams.active,
body[data-screen="dashboard"]      #screen-dashboard.active,
body[data-screen="flashcards"]     #screen-flashcards.active,
body[data-screen="downloads"]      #screen-downloads.active,
body[data-screen="session-review"] #screen-session-review.active,
body[data-screen="study-mode"]     #screen-study-mode.active,
body[data-screen="practice-exam"]  #screen-practice-exam.active,
body[data-screen="settings"]       #screen-settings.active,
body[data-screen="help"]           #screen-help.active,
body[data-screen="planner"]        #screen-planner.active {
  margin-left: var(--sidebar-w);
}

/* Brand */
.sidebar-brand {
  padding: 22px 18px 18px;
  border-bottom: 1px solid var(--sidebar-border);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-brand-icon { width: 32px; height: 32px; flex-shrink: 0; }
.sidebar-brand-icon svg { width: 32px; height: 32px; }
.sidebar-wordmark { display: flex; flex-direction: column; align-items: flex-end; justify-content: center; }
.sidebar-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--sidebar-text);
  letter-spacing: -.3px;
  line-height: 1;
  margin-top: 4px;
}
.sidebar-subtitle {
  font-size: 10px;
  color: var(--sidebar-muted);
  font-weight: 400;
  margin-top: 1px;
}

/* Nav */
.sidebar-nav {
  flex: 1;
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
}
.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--sidebar-muted);
  cursor: pointer;
  text-decoration: none;
  border: none;
  background: none;
  font-family: var(--font);
  width: 100%;
  text-align: left;
  transition: background .12s, color .12s;
}
.sidebar-nav-item:hover {
  background: var(--sidebar-hover);
  color: var(--sidebar-text);
}
.sidebar-nav-item.active {
  background: var(--sidebar-active);
  color: var(--sidebar-text);
}
.sidebar-nav-item svg { width: 16px; height: 16px; flex-shrink: 0; opacity: .7; }
.sidebar-nav-item:hover svg,
.sidebar-nav-item.active svg { opacity: 1; }

.sidebar-nav-divider {
  height: 1px;
  background: var(--sidebar-border);
  margin: 6px 4px;
}

/* Redeem label + Shop link */
.sidebar-redeem-label {
  font-size: 11px;
  color: rgba(255,255,255,0.45);
  padding: 8px 12px 2px;
  margin: 0;
}
.sidebar-nav-item--redeem {
  width: 100%;
  margin-bottom: 8px;
}
.sidebar-shop-section {
  padding: 0 8px 8px;
  flex-shrink: 0;
}
.sidebar-shop-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid rgba(255,255,255,0.2);
  border-radius: 8px;
  background: transparent;
  color: rgba(255,255,255,0.7);
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font);
  cursor: pointer;
  text-decoration: none;
  transition: border-color .15s, color .15s, background .15s;
}
.sidebar-shop-btn:hover {
  border-color: rgba(255,255,255,0.5);
  color: #fff;
  background: rgba(255,255,255,0.05);
}

/* User info */
.sidebar-user {
  padding: 12px 8px;
  border-top: 1px solid var(--sidebar-border);
  display: flex;
  align-items: center;
  gap: 9px;
  flex-shrink: 0;
  min-width: 0;
}
.sidebar-user-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  text-transform: uppercase;
}
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name {
  font-size: 13px; font-weight: 600;
  color: var(--sidebar-text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-user-email {
  font-size: 11px; color: var(--sidebar-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-top: 1px;
}
.sidebar-logout-btn {
  background: none; border: none;
  color: var(--sidebar-muted);
  cursor: pointer; padding: 6px;
  border-radius: 6px;
  display: flex; align-items: center;
  flex-shrink: 0;
  transition: color .15s, background .15s;
}
.sidebar-logout-btn:hover {
  color: var(--sidebar-text);
  background: rgba(255,255,255,0.09);
}
.sidebar-logout-btn svg { width: 16px; height: 16px; }

/* ─────────────────────────────────────────────────────────────────────────── */
/* TOP BAR (dash-header) — app screens                                         */
/* ─────────────────────────────────────────────────────────────────────────── */

.dash-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: var(--header-h);
  background: var(--header-bg);
  border-bottom: 1px solid var(--header-border);
  position: sticky;
  top: 0;
  z-index: 50;
  flex-shrink: 0;
}
.dash-header-left  { display: flex; align-items: center; gap: 20px; }
.dash-header-right { display: flex; align-items: center; gap: 12px; }

/* Page title — shown when sidebar is present */
.topbar-page-title {
  display: none;
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}
body[data-screen="my-exams"]       .topbar-page-title,
body[data-screen="dashboard"]      .topbar-page-title,
body[data-screen="study-mode"]     .topbar-page-title,
body[data-screen="practice-exam"]  .topbar-page-title,
body[data-screen="flashcards"]     .topbar-page-title,
body[data-screen="downloads"]      .topbar-page-title,
body[data-screen="settings"]       .topbar-page-title,
body[data-screen="help"]           .topbar-page-title {
  display: block;
}

/* Topbar avatar */
.topbar-avatar,
.topbar-avatar-dash,
.topbar-avatar-study,
.topbar-avatar-pe,
.topbar-avatar-fc,
.topbar-avatar-downloads,
.topbar-avatar-settings,
.topbar-avatar-help {
  display: none;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--accent-dim);
  border: 1.5px solid var(--accent);
  color: var(--accent);
  font-size: 13px; font-weight: 700;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
  cursor: default;
  flex-shrink: 0;
}
body[data-screen="my-exams"]       .topbar-avatar,
body[data-screen="dashboard"]      .topbar-avatar-dash,
body[data-screen="study-mode"]     .topbar-avatar-study,
body[data-screen="practice-exam"]  .topbar-avatar-pe,
body[data-screen="flashcards"]     .topbar-avatar-fc,
body[data-screen="downloads"]      .topbar-avatar-downloads,
body[data-screen="settings"]       .topbar-avatar-settings,
body[data-screen="help"]           .topbar-avatar-help {
  display: flex;
}

/* Hide elements that are duplicated by the sidebar */
body[data-screen="my-exams"]  .dash-header .code-logo,
body[data-screen="dashboard"] .dash-header .code-logo,
body[data-screen="dashboard"] #btn-back-to-exams,
body[data-screen="my-exams"]  .dash-header .shop-link,
body[data-screen="dashboard"] .dash-header .shop-link,
body[data-screen="my-exams"]  #my-exams-welcome,
body[data-screen="dashboard"] #dash-welcome,
body[data-screen="my-exams"]  #btn-exams-logout,
body[data-screen="dashboard"] #btn-dash-logout,
body[data-screen="my-exams"]  #theme-toggle-exams,
body[data-screen="dashboard"] #theme-toggle-dash {
  display: none !important;
}

.dash-welcome {
  font-size: .85rem;
  color: var(--text-muted);
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Shop link (original header variant) */
.shop-link {
  text-decoration: none;
  font-size: .78rem;
  font-weight: 600;
  color: var(--text-muted);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 5px 12px;
  transition: all .15s;
}
.shop-link:hover { border-color: var(--accent); color: var(--accent); }

/* ─────────────────────────────────────────────────────────────────────────── */
/* BUTTONS                                                                     */
/* ─────────────────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background .15s, transform .1s, opacity .15s, box-shadow .15s;
  white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.btn-primary  { background: var(--accent); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }

.btn-ghost {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); }

.btn-green  { background: var(--green); color: #fff; }
.btn-green:hover:not(:disabled) { background: #15803d; }

.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #b91c1c; }

.btn-full { width: 100%; }
.btn-sm   { padding: 7px 14px; font-size: .82rem; }

/* Theme toggle */
.theme-toggle {
  background: transparent;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 6px 8px;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  transition: border-color .15s, color .15s;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }
.theme-toggle svg { width: 16px; height: 16px; }

/* ─────────────────────────────────────────────────────────────────────────── */
/* AUTH SCREENS (login, register, forgot pw, code entry, email, reset)        */
/* ─────────────────────────────────────────────────────────────────────────── */

#screen-login,
#screen-forgot-password,
#screen-code,
#screen-email,
#screen-reset-password {
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--main-bg);
  overflow-y: auto;
}

.code-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px 36px;
  width: 100%;
  max-width: 440px;
  text-align: center;
  box-shadow: 0 4px 24px rgba(0,0,0,.08);
}

.auth-card { max-width: 400px; }
.auth-card h1 { font-size: 1.4rem; margin-bottom: 6px; }
.auth-card p  { font-size: .88rem; color: var(--text-muted); margin-bottom: 20px; }

.code-logo {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -.5px;
  margin-bottom: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.code-logo svg { width: 40px; height: 40px; }

.code-card h1 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
}
.code-card p {
  font-size: .9rem;
  color: var(--text-muted);
  margin-bottom: 28px;
  line-height: 1.5;
}

/* Input wrapper */
.code-input-wrap {
  position: relative;
  margin-bottom: 12px;
}
.pw-toggle {
  position: absolute;
  right: 12px; top: 50%;
  transform: translateY(-50%);
  background: none; border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px;
  line-height: 1;
  display: flex; align-items: center;
}
.pw-toggle:hover { color: var(--text); }
.pw-toggle svg { pointer-events: none; }

/* Auth text inputs */
#code-input,
#firstname-input, #email-input,
#login-email, #login-password,
#reg-firstname, #reg-email, #reg-password, #reg-confirm,
#forgot-email,
#reset-new-password, #reset-confirm-password,
#redeem-code-input {
  width: 100%;
  padding: 13px 16px;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font);
  font-size: .95rem;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  box-sizing: border-box;
}
#code-input {
  font-family: var(--mono);
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 3px;
  text-align: center;
  text-transform: uppercase;
}
#code-input::placeholder { letter-spacing: 1px; font-size: .95rem; font-weight: 400; color: var(--text-muted); }

#code-input:focus,
#firstname-input:focus, #email-input:focus,
#login-email:focus, #login-password:focus,
#reg-firstname:focus, #reg-email:focus,
#reg-password:focus, #reg-confirm:focus,
#forgot-email:focus,
#reset-new-password:focus, #reset-confirm-password:focus,
#redeem-code-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
  background: var(--surface);
}

#login-email::placeholder, #login-password::placeholder,
#reg-firstname::placeholder, #reg-email::placeholder,
#reg-password::placeholder, #reg-confirm::placeholder,
#forgot-email::placeholder,
#reset-new-password::placeholder, #reset-confirm-password::placeholder,
#firstname-input::placeholder, #email-input::placeholder,
#settings-current-pw::placeholder, #settings-new-pw::placeholder,
#settings-confirm-pw::placeholder {
  color: var(--text-muted);
  font-size: .9rem;
}

.code-error {
  color: var(--red);
  font-size: .85rem;
  min-height: 20px;
  margin-bottom: 16px;
  text-align: left;
}
.code-error.hidden { visibility: hidden; }

/* Google button */
.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 12px 16px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-family: var(--font);
  font-size: .95rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: border-color .15s, box-shadow .15s;
  margin-bottom: 16px;
}
.btn-google:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0;
  color: var(--text-muted);
  font-size: .78rem;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.auth-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 16px;
}
.auth-link {
  font-size: .82rem;
  color: var(--accent);
  text-decoration: none;
  cursor: pointer;
}
.auth-link:hover { text-decoration: underline; }

.auth-note {
  font-size: .78rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 16px;
  line-height: 1.5;
}

/* Exam info card (after code validation) */
.exam-info-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 20px;
  text-align: left;
}
.exam-info-card.hidden { display: none; }
.exam-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .88rem;
  padding: 4px 0;
  color: var(--text-muted);
}
.exam-info-row span:last-child { color: var(--text); font-weight: 500; }

/* ─────────────────────────────────────────────────────────────────────────── */
/* MY EXAMS SCREEN                                                             */
/* ─────────────────────────────────────────────────────────────────────────── */

#screen-my-exams.active {
  background: var(--main-bg);
}

.my-exams-body {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 40px 80px;
}
.my-exams-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}
.my-exams-heading h2 { font-size: 1.4rem; font-weight: 700; color: var(--text); }

.my-exams-empty { display: flex; justify-content: center; padding: 60px 0; }

.my-exams-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.my-exams-vendor-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.exam-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  cursor: pointer;
  min-height: 230px;
  transition: border-color .15s, transform .15s, box-shadow .15s;
  box-shadow: var(--shadow-card);
}
.exam-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(37,99,235,.1);
}
.exam-card-title { font-size: 1rem; font-weight: 700; color: var(--text); margin-bottom: 16px; line-height: 1.3; }
.exam-card-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}
.exam-card-stat { display: flex; flex-direction: column; gap: 3px; }
.exam-card-stat-value { font-family: var(--mono); font-size: 1.2rem; font-weight: 700; color: var(--text); }
.exam-card-stat-label { font-size: .7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }

.exam-card-readiness {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.exam-card-readiness-bar-wrap {
  flex: 1; height: 6px;
  background: var(--surface-3);
  border-radius: 99px;
  overflow: hidden;
  margin: 0 12px;
}
.exam-card-readiness-bar { height: 100%; border-radius: 99px; transition: width .6s ease; }
.readiness-bar-green   { background: var(--green); }
.readiness-bar-ltgreen { background: #7ec88a; }
.readiness-bar-yellow  { background: var(--orange); }
.readiness-bar-red     { background: var(--red); }

.exam-card-readiness-label { font-size: .75rem; font-weight: 600; white-space: nowrap; }
.exam-card-last-session    { font-size: .75rem; color: var(--text-muted); margin-top: 10px; }

.exam-card-date-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  gap: 10px;
}
.exam-card-date-label {
  font-size: .7rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  white-space: nowrap;
}
.exam-card-date-input {
  font-size: .78rem;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 8px;
  background: var(--surface);
  cursor: pointer;
}
.exam-card-date-input:focus {
  outline: none;
  border-color: var(--accent);
}
.exam-card-new {
  border: 2px dashed var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: .9rem;
  box-shadow: none;
}
.exam-card-new:hover { border-color: var(--accent); color: var(--accent); }

/* ─────────────────────────────────────────────────────────────────────────── */
/* DASHBOARD SCREEN                                                            */
/* ─────────────────────────────────────────────────────────────────────────── */

#screen-dashboard.active { background: var(--main-bg); }

.dash-body {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 32px 40px 80px;
  overflow-x: hidden;
}

/* New student welcome */
.dash-new-student { display: flex; justify-content: center; padding: 60px 0; }
.dash-welcome-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 48px 40px;
  text-align: center;
  max-width: 480px;
  box-shadow: var(--shadow-card);
}
.dash-welcome-icon { font-size: 3rem; margin-bottom: 16px; }
.dash-welcome-card h2 { font-size: 1.3rem; font-weight: 700; margin-bottom: 10px; }
.dash-welcome-card p  { color: var(--text-muted); font-size: .9rem; line-height: 1.6; margin-bottom: 28px; }

/* Hero stats */
.dash-hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}
.hero-stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 16px;
  text-align: center;
  box-shadow: var(--shadow-card);
}
.hero-stat-icon  { font-size: 1.4rem; margin-bottom: 8px; }
.hero-stat-value {
  font-family: var(--mono);
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--text);
}
.hero-stat-value.score-green  { color: var(--green); }
.hero-stat-value.score-yellow { color: var(--orange); }
.hero-stat-value.score-red    { color: var(--red); }
.hero-stat-label {
  font-size: .72rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
}

/* Domain callout */
.dash-domain-callout {
  display: flex;
  align-items: center;
  background: var(--surface-alt, #f4f6fa);
  border: 0.5px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 0 12px 12px 0;
  padding: 16px 24px;
  margin-bottom: 24px;
  gap: 0;
  box-shadow: var(--shadow-card);
}
.domain-callout-item {
  flex: 1; display: flex; align-items: center; gap: 10px;
}
.domain-callout-divider {
  width: 1px; height: 40px;
  background: var(--border);
  margin: 0 24px;
}
.callout-icon  { font-size: 1.2rem; }
.callout-label {
  font-size: .7rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-muted); min-width: 70px;
}
.callout-domain { font-size: .9rem; font-weight: 600; color: var(--text); flex: 1; }
.callout-score  { font-family: var(--mono); font-size: .9rem; font-weight: 700; }
.strongest .callout-score { color: var(--green); }
.weakest   .callout-score { color: var(--red); }

/* Charts row */
.dash-charts-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto;
  gap: 14px;
  margin-bottom: 24px;
}
.dash-chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  box-shadow: var(--shadow-card);
}
.dash-chart-card.chart-wide   { min-height: 280px; }
.dash-chart-card.chart-square { min-height: 240px; }
.dash-card-title {
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.dash-chart-empty {
  color: var(--text-muted); font-size: .85rem;
  text-align: center; padding: 40px 0;
}
.dash-chart-wrap { height: 200px; position: relative; }

/* Readiness */

/* Hero Bar */
.dash-hero-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, #1B2A4A 0%, #2563eb 100%);
  border-radius: 16px;
  padding: 24px 32px;
  margin-bottom: 24px;
  color: #ffffff;
}
.dash-hero-bar-left  { display: flex; flex-direction: column; gap: 4px; }
.dash-hero-bar-right { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.dash-hero-date { font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; opacity: 0.7; }
.dash-hero-message { font-size: 1.4rem; font-weight: 700; line-height: 1.2; }
.dash-hero-sub { font-size: .88rem; opacity: 0.8; margin-top: 2px; }
.dash-hero-countdown { text-align: right; line-height: 1.1; }
.hero-countdown-number { display: block; font-size: 2.4rem; font-weight: 700; text-align: right; }
.hero-countdown-label { display: flex; align-items: center; justify-content: flex-end; font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: rgba(255,255,255,0.75); margin-top: 2px; gap: 4px; }
.dash-hero-set-date-btn { background: rgba(255,255,255,0.15); border: 1px solid rgba(255,255,255,0.4); border-radius: 8px; color: #ffffff; font-size: .82rem; font-weight: 600; padding: 8px 16px; cursor: pointer; transition: background .15s; }
.hero-date-tip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px; height: 15px; border-radius: 50%;
  background: var(--border);
  color: var(--text-muted);
  font-size: .6rem; font-weight: 700;
  cursor: default; user-select: none;
  margin-left: 6px;
  vertical-align: middle;
  transition: background .15s;
  text-transform: none; letter-spacing: 0;
  flex-shrink: 0;
}
.hero-date-tip:hover { background: var(--accent-dim); color: var(--accent); }
.hero-date-tip::after {
  content: attr(data-tooltip);
  position: fixed;
  bottom: auto;
  top: auto;
  right: auto;
  left: auto;
  transform: translateX(-90%);
  margin-top: -80px;
  width: 200px;
  padding: 10px 14px;
  background: #ffffff !important;
  color: #1a1a1a !important;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,.15);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  font-size: .78rem; font-weight: 400; line-height: 1.55;
  white-space: normal;
  text-align: left;
  text-transform: none; letter-spacing: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity .15s;
  z-index: 9999;
}
.hero-date-tip:hover::after { opacity: 1; }
.dash-hero-set-date-btn:hover { background: rgba(255,255,255,0.25); }
.dash-readiness-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-card);
}
.readiness-bar-wrap {
  height: 16px;
  background: var(--surface-3);
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 10px;
}
.readiness-bar {
  height: 100%; border-radius: 99px;
  transition: width .6s ease; width: 0%;
}
.readiness-bar.readiness-red     { background: var(--red); }
.readiness-bar.readiness-yellow  { background: var(--orange); }
.readiness-bar.readiness-ltgreen { background: #7ec88a; }
.readiness-bar.readiness-green   { background: var(--green); }

.readiness-zones {
  display: flex; justify-content: space-between; margin-bottom: 8px;
}
.zone { font-size: .72rem; font-weight: 700; color: var(--text-muted); text-align: center; line-height: 1.3; width: 25%; }
.zone-red     { color: rgba(220,38,38,0.85); }
.zone-yellow  { color: rgba(217,119,6,0.85); }
.zone-ltgreen { color: rgba(126,200,138,0.85); }
.zone-green   { color: rgba(22,163,74,0.85); }
.readiness-label {
  font-size: .95rem;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  margin-top: 8px;
}

/* Info tooltip (used on Exam Readiness title) */
.info-tip {
  position: relative; display: inline-flex; align-items: center;
}
.info-tip-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 15px; height: 15px; border-radius: 50%;
  background: var(--border); color: var(--text-muted);
  font-size: .6rem; font-weight: 700; font-style: normal;
  cursor: default; user-select: none; flex-shrink: 0;
  /* Override parent text-transform/letter-spacing from .dash-card-title */
  text-transform: none; letter-spacing: 0;
  transition: background .15s;
}
.info-tip:hover .info-tip-icon { background: var(--accent-dim); color: var(--accent); }
.info-tip-text {
  position: absolute; top: calc(100% + 10px); left: 0;
  width: 270px; padding: 10px 14px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,.12);
  font-size: .78rem; font-weight: 400; line-height: 1.55;
  text-transform: none; letter-spacing: 0;
  white-space: normal; z-index: 200; pointer-events: none;
  opacity: 0; transition: opacity .15s;
}
.info-tip:hover .info-tip-text,
.info-tip:focus-within .info-tip-text { opacity: 1; }

.info-tip.tip-left .info-tip-text { left: auto; right: 0; }

/* Recent sessions */
.dash-sessions-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-card);
}
.sessions-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.sessions-table th {
  text-align: left;
  font-size: .7rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-muted);
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}
.sessions-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); color: var(--text); }
.sessions-table tr:last-child td { border-bottom: none; }
.sessions-table tr:hover td { background: var(--surface-2); }
.sessions-table tbody tr { cursor: pointer; }

.sess-score-badge {
  display: inline-block;
  font-family: var(--mono); font-size: .78rem; font-weight: 700;
  padding: 2px 8px; border-radius: 99px;
}
.sess-score-badge.score-pass { background: var(--green-dim); color: var(--green); }
.sess-score-badge.score-fail { background: var(--red-dim);   color: var(--red); }
.dash-empty-msg { color: var(--text-muted); font-size: .85rem; padding: 8px 0; }

/* Resources */
.dash-resources-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-card);
}
.resources-list { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.resource-item {
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.resource-name {
  display: flex; align-items: center; gap: 10px;
  font-size: .9rem; color: var(--text); font-weight: 500;
}
.resource-icon { font-size: 1.1rem; }
.btn-download {
  font-size: .78rem; padding: 6px 14px;
  background: var(--accent-dim);
  border: 1px solid var(--accent);
  color: var(--accent);
  border-radius: 6px;
  cursor: pointer; font-family: var(--font); font-weight: 600;
  transition: all .15s;
}
.btn-download:hover { background: var(--accent); color: white; }

/* ── New dashboard layout ───────────────────────────────────────────────── */

/* Stats row (4 cards) */
.dash-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}
.dash-stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 16px;
  text-align: center;
  box-shadow: var(--shadow-card);
}
.dash-stat-label {
  font-size: .7rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.dash-stat-value {
  font-family: var(--mono);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
}
.dash-stat-value.score-green  { color: var(--green); }
.dash-stat-value.score-yellow { color: var(--orange); }
.dash-stat-value.score-red    { color: var(--red); }

/* Analytics row (2 cols) */
.dash-analytics-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 20px;
}

/* Bottom row (2 cols) */
.dash-bottom-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 20px;
}

/* Heatmap */
.chart-subtitle {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

/* Focus areas */
.dash-focus-subtitle {
  font-size: .8rem;
  color: var(--text-muted);
  margin-bottom: 14px;
}
.focus-area-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.focus-area-item:last-child { border-bottom: none; }
.focus-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.focus-domain {
  flex: 1;
  font-size: .88rem;
  color: var(--text);
  font-weight: 500;
}
.focus-pct {
  font-family: var(--mono);
  font-size: .85rem;
  font-weight: 700;
  color: var(--text-muted);
}

/* Responsive adjustments for new layout */
@media (max-width: 900px) {
  .dash-stats-row { grid-template-columns: repeat(2, 1fr); }
  .dash-analytics-row,
  .dash-bottom-row { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .dash-stats-row { grid-template-columns: repeat(2, 1fr); }
}

/* Mode legend */
.mode-legend { display: flex; flex-direction: column; gap: 8px; margin-top: 0; padding: 12px 16px 16px; font-size: .78rem; }
.mode-legend-item { display: flex; align-items: center; gap: 6px; color: var(--text-muted); }
.mode-legend-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* Start new session */
.dash-start-wrap { display: flex; justify-content: center; gap: 12px; padding: 8px 0 24px; flex-wrap: wrap; }
.dash-start-btn  { padding: 14px 40px; font-size: 1rem; }

/* Upsell */
.dash-upsell { margin: 8px 0 24px; }
.upsell-content {
  display: flex; align-items: center;
  justify-content: space-between;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 16px 20px; gap: 16px;
  box-shadow: var(--shadow-card);
}
.upsell-content:hover { border-color: var(--accent); transition: border-color .15s; }
.upsell-text { display: flex; align-items: center; gap: 14px; }
.upsell-icon { font-size: 1.6rem; }
.upsell-heading { font-size: .95rem; font-weight: 600; color: var(--text); margin-bottom: 3px; }
.upsell-subtext { font-size: .8rem; color: var(--text-muted); }
.btn-upsell {
  white-space: nowrap; text-decoration: none;
  font-size: .82rem; font-weight: 600; padding: 8px 16px;
  background: var(--accent); color: white;
  border-radius: 8px; transition: opacity .15s;
}
.btn-upsell:hover { opacity: .85; }

/* Recs grid */
.recs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.rec-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 16px;
  display: flex; align-items: flex-start; gap: 12px;
  box-shadow: var(--shadow-card);
}
.rec-icon { font-size: 1.2rem; flex-shrink: 0; margin-top: 1px; }
.rec-text { font-size: .85rem; line-height: 1.5; color: var(--text-muted); }
.rec-text strong { color: var(--text); }

/* ─────────────────────────────────────────────────────────────────────────── */
/* MODE SELECTION SCREEN                                                       */
/* ─────────────────────────────────────────────────────────────────────────── */

#screen-study-mode,
#screen-practice-exam {
  overflow-y: auto;
  background: var(--main-bg);
}

.mode-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  width: 100%;
}

.mode-container { width: 100%; max-width: 720px; }

.mode-cards { display: flex; gap: 14px; margin-bottom: 24px; }
.mode-card {
  flex: 1;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 24px 18px;
  cursor: pointer;
  text-align: center;
  transition: border-color .15s, background .15s, transform .1s;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  font-family: var(--font);
  box-shadow: var(--shadow-card);
}
.mode-card:hover    { border-color: var(--accent); background: var(--accent-dim); }
.mode-card.selected { border-color: var(--accent); background: var(--accent-dim); }
.mode-card:active   { transform: scale(.98); }

.mode-card-icon  { font-size: 1.8rem; line-height: 1; }
.mode-card-title { font-size: .95rem; font-weight: 700; color: var(--text); }
.mode-card-desc  { font-size: .78rem; color: var(--text-muted); line-height: 1.5; }

.mode-options {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 32px 40px;
  display: flex; flex-direction: column; gap: 28px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-card);
}
.mode-option-group { display: flex; flex-direction: column; gap: 12px; }
.mode-option-label {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  text-transform: none;
  letter-spacing: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

.mode-option-emoji {
  font-size: 1.1rem;
  line-height: 1;
}
.mode-domain-sel {
  width: 100%; padding: 13px 16px;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  color: var(--text); font-family: var(--font); font-size: .95rem;
  outline: none; cursor: pointer; transition: border-color .15s;
}
.mode-domain-sel:focus { border-color: var(--accent); }

.q-count-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.q-count-btn {
  padding: 12px 28px;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-family: var(--mono); font-size: 1rem; font-weight: 700;
  cursor: pointer;
  transition: border-color .15s, background .15s, color .15s;
}
.q-count-btn:hover    { border-color: var(--accent); color: var(--text); }
.q-count-btn.selected { border-color: var(--accent); background: var(--accent-dim); color: var(--accent); }

.sim-exam-info {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  display: flex; flex-direction: column; gap: 14px;
}
.sim-info-row { display: flex; align-items: center; gap: 12px; }
.sim-info-icon  { font-size: 1.1rem; }
.sim-info-label { font-size: .85rem; color: var(--text-muted); min-width: 110px; }
.sim-info-value { font-family: var(--mono); font-size: .95rem; font-weight: 600; color: var(--text); }
.sim-info-note  { font-size: .8rem; color: var(--text-muted); margin-top: 4px; line-height: 1.55; }

.mode-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
}
.mode-actions .btn-primary {
  width: 100%;
  padding: 16px;
  font-size: 1rem;
  font-weight: 700;
}
.mode-actions .btn-ghost {
  align-self: center;
  font-size: .88rem;
}

/* ─────────────────────────────────────────────────────────────────────────── */
/* EXAM SCREEN                                                                 */
/* ─────────────────────────────────────────────────────────────────────────── */

#screen-exam { background: var(--main-bg); }

/* Exam header */
.exam-header {
  height: var(--header-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 20px; gap: 16px;
  position: sticky; top: 0; z-index: 50; flex-shrink: 0;
}
.exam-logo {
  font-size: .95rem; font-weight: 700;
  color: var(--accent); letter-spacing: -.3px; white-space: nowrap;
}
.exam-title-badge {
  background: var(--accent-dim); color: var(--accent);
  font-size: .75rem; font-weight: 600;
  padding: 4px 10px; border-radius: 99px;
  border: 1px solid rgba(37,99,235,.25);
  white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; max-width: 220px;
}
.header-spacer { flex: 1; }
.q-counter {
  font-family: var(--mono); font-size: .82rem; font-weight: 600;
  color: var(--text-muted); white-space: nowrap;
}
.exam-timer {
  font-family: var(--mono); font-size: .95rem; font-weight: 700;
  color: var(--text); background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 5px 12px; min-width: 70px; text-align: center;
}
.exam-timer.warning { color: var(--orange); border-color: var(--orange); }
.exam-timer.danger  { color: var(--red); border-color: var(--red); animation: pulse-timer 1s infinite; }

@keyframes pulse-timer { 0%,100% { opacity: 1; } 50% { opacity: .6; } }

.sidebar-toggle {
  background: none; border: 1px solid var(--border);
  color: var(--text); border-radius: var(--radius-sm);
  padding: 6px 10px; cursor: pointer; font-size: 1rem; line-height: 1;
  display: none;
}

/* Exam layout */
.exam-layout { flex: 1; display: flex; overflow: hidden; position: relative; }

/* Exam progress sidebar */
.sidebar {
  width: 260px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  overflow-y: auto; flex-shrink: 0;
  transition: transform .25s ease;
}
.sidebar-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 16px 12px; border-bottom: 1px solid var(--border);
  font-size: .8rem; font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .06em;
}
.sidebar-close {
  background: none; border: none; color: var(--text-muted);
  cursor: pointer; font-size: 1rem; padding: 2px; display: none;
}

.progress-section { padding: 16px; border-bottom: 1px solid var(--border); }
.progress-bar-wrap {
  height: 6px; background: var(--surface-3);
  border-radius: 99px; overflow: hidden; margin-bottom: 12px;
}
.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--green));
  border-radius: 99px; transition: width .3s ease; width: 0%;
}
.progress-stats { display: flex; gap: 8px; flex-wrap: wrap; }
.stat-pill {
  font-size: .72rem; font-weight: 600;
  padding: 3px 8px; border-radius: 99px;
  display: flex; align-items: center; gap: 4px;
}
.stat-pill.answered  { background: var(--accent-dim); color: var(--accent); }
.stat-pill.unanswered{ background: var(--surface-3);  color: var(--text-muted); }
.stat-pill.flagged   { background: var(--orange-dim); color: var(--orange); }

.navigator-section { padding: 16px; }
.navigator-label {
  font-size: .72rem; font-weight: 600;
  color: var(--text-muted); text-transform: uppercase;
  letter-spacing: .06em; margin-bottom: 10px;
}
.nav-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; }
.nav-cell {
  aspect-ratio: 1; border-radius: 4px; border: none; cursor: pointer;
  font-family: var(--mono); font-size: .62rem; font-weight: 600;
  background: var(--surface-3); color: var(--text-muted);
  transition: background .12s, transform .1s; position: relative;
}
.nav-cell:hover      { transform: scale(1.1); }
.nav-cell.current    { outline: 2px solid var(--accent); outline-offset: 1px; color: var(--text); }
.nav-cell.answered   { background: var(--accent-dim); color: var(--accent); }
.nav-cell.correct    { background: var(--green-dim);  color: var(--green); }
.nav-cell.incorrect  { background: var(--red-dim);    color: var(--red); }
.nav-cell.flagged::after {
  content: ''; position: absolute; top: 2px; right: 2px;
  width: 4px; height: 4px; border-radius: 50%; background: var(--orange);
}

.domain-section { padding: 16px; border-top: 1px solid var(--border); }
.domain-item { margin-bottom: 10px; }
.domain-item-label {
  display: flex; justify-content: space-between;
  font-size: .72rem; color: var(--text-muted); margin-bottom: 4px;
}
.domain-item-bar  { height: 3px; background: var(--surface-3); border-radius: 99px; overflow: hidden; }
.domain-item-fill { height: 100%; background: var(--accent); border-radius: 99px; transition: width .3s; }

/* Question area */
.question-area {
  flex: 1; overflow-y: auto;
  padding: 28px 32px 100px;
  display: flex; flex-direction: column; gap: 20px;
}
.question-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px; padding: 28px;
  box-shadow: var(--shadow-card);
}
.question-meta { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.q-domain-badge {
  background: var(--surface-2); color: var(--text-muted);
  font-size: .72rem; font-weight: 600;
  padding: 3px 10px; border-radius: 99px; border: 1px solid var(--border);
}
.q-diff-badge { font-size: .72rem; font-weight: 600; padding: 3px 10px; border-radius: 99px; }
.q-diff-badge.Easy   { background: var(--green-dim);  color: var(--green); }
.q-diff-badge.Medium { background: var(--accent-dim); color: var(--accent); }
.q-diff-badge.Hard   { background: var(--red-dim);    color: var(--red); }

.question-text { font-size: 1rem; line-height: 1.65; color: var(--text); margin-bottom: 24px; }

/* Options */
.options-list { display: flex; flex-direction: column; gap: 10px; }
.option-card {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 14px 18px;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color .15s, background .15s;
  text-align: left; width: 100%;
}
.option-card:hover:not(.locked) { border-color: var(--accent); background: var(--accent-dim); }
.option-card.selected { border-color: var(--accent); background: var(--accent-dim); }
.option-card.correct  { border-color: var(--green) !important; background: var(--green-dim) !important; }
.option-card.wrong    { border-color: var(--red) !important; background: var(--red-dim) !important; opacity: .65; }
.option-card.locked   { cursor: default; }

.option-letter {
  width: 28px; height: 28px; flex-shrink: 0;
  border-radius: 50%; background: var(--surface-3);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: .78rem; font-weight: 700;
  color: var(--text-muted); transition: background .15s, color .15s;
}
.option-card.selected .option-letter { background: var(--accent); color: #fff; }
.option-card.correct  .option-letter { background: var(--green);  color: #fff; }
.option-card.wrong    .option-letter { background: var(--red);    color: #fff; }

.option-text { font-size: .9rem; line-height: 1.5; color: var(--text); padding-top: 3px; }

/* Explanation */
.explanation-panel {
  margin-top: 20px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  animation: fadeIn .2s ease;
}
.explanation-panel.hidden { display: none; }
.explanation-verdict {
  font-size: .82rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em;
  margin-bottom: 12px; display: block;
}
.explanation-verdict.correct { color: var(--green); }
.explanation-verdict.wrong   { color: var(--red); }
.explanation-body { font-size: .85rem; line-height: 1.65; color: var(--text-muted); }
.explanation-body .rationale-line { margin-bottom: 6px; }
.explanation-body .rationale-line strong { color: var(--text); }
.explanation-body .rationale-correct strong { color: var(--green); }

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

/* Nav controls */
.nav-controls {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px; padding: 16px 20px;
  box-shadow: var(--shadow-card);
}
.nav-controls .spacer { flex: 1; }

.btn-flag {
  background: none; border: 1.5px solid var(--border);
  color: var(--text-muted); border-radius: var(--radius);
  padding: 10px 16px; font-family: var(--font);
  font-size: .85rem; font-weight: 600; cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
}
.btn-flag:hover   { border-color: var(--orange); color: var(--orange); }
.btn-flag.flagged { border-color: var(--orange); color: var(--orange); background: var(--orange-dim); }

.btn-submit-exam { background: var(--green); color: #fff; font-weight: 700; }
.btn-submit-exam:hover { background: #15803d; }

.btn-end-exam {
  background: transparent;
  border: 1.5px solid rgba(220,38,38,0.35);
  color: var(--red);
  font-size: .8rem; padding: 5px 12px;
  border-radius: 8px; cursor: pointer;
  font-family: var(--font); font-weight: 500;
  transition: all .15s;
}
.btn-end-exam:hover { background: var(--red-dim); border-color: var(--red); }

/* Sidebar overlay (mobile) */
.sidebar-overlay {
  display: none; position: fixed; inset: 0;
  z-index: 99; background: rgba(26,26,46,.4);
}
.sidebar-overlay.open { display: block; }

/* ─────────────────────────────────────────────────────────────────────────── */
/* RESULTS SCREEN                                                              */
/* ─────────────────────────────────────────────────────────────────────────── */

#screen-results {
  align-items: center;
  padding: 40px 24px 80px;
  overflow-y: auto;
  background: var(--main-bg);
}
.results-container { width: 100%; max-width: 720px; }

.results-header {
  display: flex; align-items: center; gap: 40px; margin-bottom: 36px;
}
.score-ring-wrap { position: relative; flex-shrink: 0; width: 140px; height: 140px; }
.score-ring { width: 140px; height: 140px; transform: rotate(-90deg); }
.score-ring-bg   { fill: none; stroke: var(--surface-3); stroke-width: 10; }
.score-ring-fill {
  fill: none; stroke: var(--green); stroke-width: 10;
  stroke-linecap: round; stroke-dasharray: 314; stroke-dashoffset: 314;
  transition: stroke-dashoffset 1.2s cubic-bezier(.4,0,.2,1), stroke .3s;
}
.score-ring-fill.fail { stroke: var(--red); }
.score-center {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}
.score-pct {
  font-family: var(--mono); font-size: 1.8rem;
  font-weight: 700; color: var(--text); line-height: 1;
}
.score-label { font-size: .7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; margin-top: 2px; }

.results-right { flex: 1; min-width: 0; }
.pass-fail-badge {
  font-size: .9rem; font-weight: 700;
  padding: 8px 20px; border-radius: 99px;
  display: inline-block; margin-bottom: 20px;
}
.pass-fail-badge.pass { background: var(--green-dim); color: var(--green); border: 1px solid rgba(22,163,74,.3); }
.pass-fail-badge.fail { background: var(--red-dim);   color: var(--red);   border: 1px solid rgba(220,38,38,.3); }

.result-stats { display: flex; gap: 20px; }
.result-stat-num {
  font-family: var(--mono); font-size: 1.4rem; font-weight: 700;
  display: block; color: var(--text);
}
.result-stat-label { font-size: .72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; }

/* Domain breakdown */
.breakdown-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; overflow: hidden; margin-bottom: 24px;
  box-shadow: var(--shadow-card);
}
.breakdown-card h3 {
  font-size: .8rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-muted); padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}
.breakdown-table { width: 100%; border-collapse: collapse; }
.breakdown-table th {
  text-align: left; font-size: .72rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-muted); padding: 10px 20px;
  border-bottom: 1px solid var(--border);
}
.breakdown-table td   { padding: 12px 20px; border-bottom: 1px solid var(--border); font-size: .88rem; }
.breakdown-table tr:last-child td { border-bottom: none; }
.breakdown-table tr:hover td { background: var(--surface-2); }
.breakdown-table .pct-cell { font-family: var(--mono); font-weight: 600; }
.pct-pass { color: var(--green); }
.pct-fail { color: var(--red); }
.breakdown-bar-cell { width: 120px; }
.breakdown-bar-wrap { height: 4px; background: var(--surface-3); border-radius: 99px; overflow: hidden; }
.breakdown-bar-fill { height: 100%; border-radius: 99px; transition: width .6s ease; }
.breakdown-bar-fill.pass { background: var(--green); }
.breakdown-bar-fill.fail { background: var(--red); }

.results-actions { display: flex; gap: 12px; margin-bottom: 32px; }

/* Review section */
.review-section { display: flex; flex-direction: column; gap: 16px; }
.review-section.hidden { display: none; }
.review-q-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 20px 22px;
  box-shadow: var(--shadow-card);
}
.review-q-header { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.review-q-num { font-family: var(--mono); font-size: .8rem; color: var(--text-muted); font-weight: 600; }
.review-verdict { font-size: .75rem; font-weight: 700; padding: 3px 10px; border-radius: 99px; }
.review-verdict.correct { background: var(--green-dim); color: var(--green); }
.review-verdict.wrong   { background: var(--red-dim);   color: var(--red); }
.review-q-text { font-size: .9rem; line-height: 1.55; margin-bottom: 14px; }
.review-options { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.review-opt {
  display: flex; gap: 10px; font-size: .82rem;
  padding: 7px 12px; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-muted);
}
.review-opt .opt-l { font-family: var(--mono); font-weight: 700; color: var(--text-muted); }
.review-opt.correct-opt { background: var(--green-dim); border-color: rgba(22,163,74,.3); color: var(--text); }
.review-opt.correct-opt .opt-l { color: var(--green); }
.review-opt.user-wrong  { background: var(--red-dim); border-color: rgba(220,38,38,.3); }
.review-rationale {
  font-size: .8rem; line-height: 1.6; color: var(--text-muted);
  border-top: 1px solid var(--border); padding-top: 12px; margin-top: 4px;
}
.review-rationale strong { color: var(--text); }

/* ─────────────────────────────────────────────────────────────────────────── */
/* SESSION REVIEW SCREEN                                                       */
/* ─────────────────────────────────────────────────────────────────────────── */

#screen-session-review.active { background: var(--main-bg); }

.sr-header {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 24px; flex-wrap: wrap;
}
.sr-summary-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 20px 24px; margin-bottom: 24px;
  display: flex; gap: 24px; align-items: center; flex-wrap: wrap;
  box-shadow: var(--shadow-card);
}
.sr-summary-score { font-size: 2.8rem; font-weight: 700; font-family: var(--mono); line-height: 1; }
.sr-summary-score.pass { color: var(--green); }
.sr-summary-score.fail { color: var(--red); }
.sr-summary-meta { display: flex; flex-direction: column; gap: 4px; }
.sr-summary-meta-item { font-size: .82rem; color: var(--text-muted); }
.sr-summary-meta-item span { color: var(--text); font-weight: 500; }
.sr-pass-badge {
  display: inline-block; font-size: .7rem; font-weight: 700;
  padding: 3px 10px; border-radius: 99px;
  text-transform: uppercase; letter-spacing: .05em;
}
.sr-pass-badge.pass { background: var(--green-dim); color: var(--green); }
.sr-pass-badge.fail { background: var(--red-dim);   color: var(--red); }

.sr-section-title {
  font-size: .72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .07em;
  color: var(--text-muted); margin-bottom: 14px;
}
.sr-question-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 20px 22px; margin-bottom: 14px;
  box-shadow: var(--shadow-card);
}
.sr-question-card.sr-correct { border-left: 3px solid var(--green); }
.sr-question-card.sr-wrong   { border-left: 3px solid var(--red); }
.sr-q-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 12px; margin-bottom: 12px;
}
.sr-q-num    { font-size: .72rem; color: var(--text-muted); font-weight: 600; flex-shrink: 0; }
.sr-q-domain {
  font-size: .68rem; font-weight: 600;
  padding: 2px 8px; border-radius: 99px;
  background: var(--surface-2); color: var(--text-muted); flex-shrink: 0;
}
.sr-q-text { font-size: .92rem; line-height: 1.55; color: var(--text); margin-bottom: 14px; }
.sr-options { display: flex; flex-direction: column; gap: 7px; margin-bottom: 14px; }
.sr-opt {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 9px 13px; border-radius: 8px;
  border: 1px solid var(--border); background: transparent;
  font-size: .85rem; line-height: 1.45; color: var(--text);
}
.sr-opt.sr-opt-correct {
  border-color: rgba(22,163,74,.4); background: var(--green-dim);
}
.sr-opt.sr-opt-selected-wrong {
  border-color: rgba(220,38,38,.4); background: var(--red-dim); opacity: .85;
}
.sr-opt-letter {
  font-weight: 700; font-size: .78rem;
  min-width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--border); color: var(--text-muted);
  flex-shrink: 0; margin-top: 1px;
}
.sr-opt.sr-opt-correct .sr-opt-letter        { background: var(--green); color: #fff; }
.sr-opt.sr-opt-selected-wrong .sr-opt-letter { background: var(--red);   color: #fff; }
.sr-explanation {
  font-size: .82rem; line-height: 1.6; color: var(--text-muted);
  border-top: 1px solid var(--border); padding-top: 12px; margin-top: 4px;
}
.sr-explanation strong { color: var(--text); font-weight: 600; }
.sr-row-review-btn {
  background: transparent; border: none; color: var(--accent);
  font-size: .78rem; font-weight: 600; cursor: pointer;
  padding: 4px 8px; border-radius: 6px; white-space: nowrap;
}
.sr-row-review-btn:hover { background: var(--accent-dim); }

/* ─────────────────────────────────────────────────────────────────────────── */
/* FLASHCARDS SCREEN                                                           */
/* ─────────────────────────────────────────────────────────────────────────── */

#screen-flashcards.active { background: var(--main-bg); }

.fc-mode-card-grid { display: flex; flex-direction: column; gap: 12px; width: 100%; margin: 16px 0 20px; }
.fc-mode-btn {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 14px; padding: 22px 24px;
  cursor: pointer; text-align: left;
  color: var(--text); font-family: var(--font);
  display: flex; align-items: center; gap: 18px; width: 100%;
  transition: border-color .15s, background .15s, transform .1s;
  box-shadow: var(--shadow-card);
}
.fc-mode-btn:hover    { border-color: var(--accent); transform: translateY(-1px); }
.fc-mode-btn.fc-selected { border-color: var(--accent); background: var(--accent-dim); }
.fc-mode-icon { font-size: 1.8rem; flex-shrink: 0; }
.fc-mode-name { font-size: 1rem; font-weight: 600; }
.fc-mode-desc { font-size: .8rem; color: var(--text-muted); margin-top: 3px; line-height: 1.4; }

.fc-domain-row { display: flex; flex-direction: column; gap: 6px; width: 100%; margin-bottom: 16px; }
.fc-domain-sel {
  flex: 1; padding: 10px 14px;
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: var(--radius); color: var(--text);
  font-family: var(--font); font-size: .9rem; outline: none; cursor: pointer;
}
.fc-domain-sel:focus { border-color: var(--accent); }

.fc-count-controls { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.fc-count-all-btn {
  padding: 8px 16px; border-radius: 8px;
  border: 1.5px solid var(--border); background: var(--surface);
  color: var(--text); font-family: var(--font); font-size: .85rem;
  font-weight: 500; cursor: pointer; transition: border-color .15s, background .15s, color .15s;
}
.fc-count-all-btn.active {
  border-color: var(--accent); background: var(--accent-dim);
  color: var(--accent); font-weight: 600;
}
.fc-count-or { color: var(--text-muted); font-size: .8rem; }
.fc-count-stepper {
  display: flex; align-items: center;
  border: 1.5px solid var(--border); border-radius: 8px;
  overflow: hidden; background: var(--surface);
}
.fc-count-adj {
  width: 34px; height: 36px; border: none; background: transparent;
  color: var(--text); font-size: 1.1rem; font-family: var(--font);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background .1s;
}
.fc-count-adj:hover { background: var(--bg); }
.fc-count-input {
  width: 52px; height: 36px; border: none;
  border-left: 1px solid var(--border); border-right: 1px solid var(--border);
  background: transparent; text-align: center;
  font-family: var(--font); font-size: .9rem; color: var(--text); outline: none;
  -moz-appearance: textfield;
}
.fc-count-input::-webkit-inner-spin-button,
.fc-count-input::-webkit-outer-spin-button { -webkit-appearance: none; }
.fc-count-cap-msg { font-size: .78rem; color: var(--accent); margin-top: 6px; font-weight: 500; }

.fc-start-btns { width: 100%; display: flex; flex-direction: column; gap: 10px; margin-top: 28px; }
.fc-start-btns .btn { width: 100%; justify-content: center; }

.fc-top-bar {
  height: 56px; display: flex; align-items: center; gap: 14px;
  padding: 0 16px; background: var(--surface);
  border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.fc-progress-track { flex: 1; height: 5px; background: var(--surface-3); border-radius: 3px; overflow: hidden; }
.fc-progress-fill  { height: 100%; background: var(--accent); border-radius: 3px; transition: width .35s ease; }
.fc-progress-text  { font-size: .78rem; color: var(--text-muted); white-space: nowrap; font-family: var(--mono); }

.fc-card-area {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 28px 20px 16px;
}

/* 3-D flip card */
.flashcard {
  width: 100%; max-width: 680px; height: 340px;
  perspective: 1200px; cursor: pointer;
  user-select: none; -webkit-tap-highlight-color: transparent;
}
.flashcard-inner {
  width: 100%; height: 100%; position: relative;
  transform-style: preserve-3d;
  transition: transform .5s cubic-bezier(.4, 0, .2, 1);
}
.flashcard-inner.flipped { transform: rotateY(180deg); }
.flashcard-face {
  position: absolute; inset: 0;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  border-radius: 18px; padding: 28px 32px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center; overflow: hidden;
}
.flashcard-front { background: var(--surface); border: 1.5px solid var(--border); box-shadow: var(--shadow-card); }
.flashcard-back  {
  background: var(--surface); border: 1.5px solid var(--accent);
  transform: rotateY(180deg); justify-content: center; overflow-y: auto;
}
.fc-domain-chip {
  flex-shrink: 0; font-size: .68rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .07em;
  color: var(--accent); background: var(--accent-dim);
  padding: 3px 10px; border-radius: 99px; margin-bottom: 14px;
}
.fc-question-text { font-size: 1rem; font-weight: 500; line-height: 1.6; color: var(--text); max-height: 220px; overflow-y: auto; }
.fc-tap-hint      { margin-top: 18px; font-size: .73rem; color: var(--text-muted); flex-shrink: 0; }
.fc-answer-letter { flex-shrink: 0; font-size: 1.5rem; font-weight: 700; color: var(--green); font-family: var(--mono); margin-bottom: 2px; }
.fc-answer-text   { flex-shrink: 0; font-size: .95rem; font-weight: 600; color: var(--text); margin-bottom: 14px; line-height: 1.45; }
.fc-explanation   { font-size: .8rem; color: var(--text-muted); line-height: 1.6; overflow-y: auto; text-align: left; width: 100%; }

.fc-actions {
  display: flex; gap: 14px; justify-content: center;
  padding: 12px 24px 32px; flex-shrink: 0;
}
.fc-actions.invisible { visibility: hidden; pointer-events: none; }
.btn-fc-review {
  padding: 12px 28px; background: var(--surface-2);
  border: 1.5px solid var(--border); border-radius: var(--radius);
  color: var(--text-muted); font-family: var(--font);
  font-size: .92rem; font-weight: 600; cursor: pointer;
  transition: border-color .15s, color .15s;
}
.btn-fc-review:hover { border-color: var(--orange); color: var(--orange); }
.btn-fc-again {
  padding: 12px 28px;
  background: var(--orange-dim);
  border: 1.5px solid var(--orange);
  border-radius: var(--radius);
  color: var(--orange);
  font-family: var(--font);
  font-size: .92rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.btn-fc-again:hover { background: var(--orange); color: #fff; }
.btn-fc-gotit {
  padding: 12px 32px; background: var(--green);
  border: none; border-radius: var(--radius);
  color: #fff; font-family: var(--font);
  font-size: .92rem; font-weight: 700; cursor: pointer;
  transition: background .15s;
}
.btn-fc-gotit:hover { background: #15803d; }
.btn-fc-flag {
  padding: 12px 20px; background: white;
  border: 1.5px solid var(--border); border-radius: var(--radius);
  color: var(--text-muted); font-family: var(--font);
  font-size: .92rem; font-weight: 600; cursor: pointer;
  transition: all .15s;
}
.btn-fc-flag:hover { border-color: var(--orange); color: var(--orange); }
.btn-fc-flag.flagged { border-color: var(--orange); color: var(--orange); background: var(--orange-dim, #fff7ed); }

/* Completion */
.fc-complete-wrap {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 40px 24px; text-align: center; min-height: 100vh;
}
.fc-complete-wrap h2  { font-size: 1.5rem; font-weight: 700; margin-bottom: 8px; }
.fc-complete-stats    { display: flex; gap: 20px; margin-bottom: 36px; flex-wrap: wrap; justify-content: center; }
.fc-stat-box {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 18px 28px; min-width: 100px;
  box-shadow: var(--shadow-card);
}
.fc-stat-num   { font-size: 2rem; font-weight: 700; font-family: var(--mono); color: var(--accent); }
.fc-stat-label { font-size: .72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; margin-top: 4px; }
.fc-complete-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }

/* ─────────────────────────────────────────────────────────────────────────── */
/* MODALS                                                                      */
/* ─────────────────────────────────────────────────────────────────────────── */

.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(26,26,46,.5);
  z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  backdrop-filter: blur(4px);
}
.modal-overlay.hidden { display: none; }

.modal-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 36px 32px;
  max-width: 380px; width: 100%;
  box-shadow: var(--shadow-modal);
}
.modal-box h2 { font-size: 1.2rem; font-weight: 700; margin-bottom: 20px; }
.modal-box h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 16px; }

.modal-stats { display: flex; gap: 12px; margin-bottom: 28px; }
.modal-stat {
  flex: 1; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px; text-align: center;
}
.modal-stat-num {
  font-family: var(--mono); font-size: 1.5rem; font-weight: 700;
  display: block; margin-bottom: 2px;
}
.modal-stat-label { font-size: .72rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; }
.modal-stat.answered  .modal-stat-num { color: var(--accent); }
.modal-stat.remaining .modal-stat-num { color: var(--text-muted); }
.modal-stat.flagged   .modal-stat-num { color: var(--orange); }

.modal-actions { display: flex; gap: 10px; }
.modal-actions .btn { flex: 1; }

/* ─────────────────────────────────────────────────────────────────────────── */
/* UTILITIES                                                                   */
/* ─────────────────────────────────────────────────────────────────────────── */

.hidden { display: none !important; }

/* ─────────────────────────────────────────────────────────────────────────── */
/* MOBILE APP SIDEBAR — base styles (drawer elements)                          */
/* ─────────────────────────────────────────────────────────────────────────── */

/* Full-screen overlay behind drawer */
.app-sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  z-index: 299;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(2px);
}
.app-sidebar-overlay.open { display: block; }

/* Close button inside sidebar — hidden on desktop */
.app-sidebar-close {
  display: none;
  background: none; border: none;
  color: var(--sidebar-muted);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 6px;
  line-height: 1;
  flex-shrink: 0;
  transition: color .15s;
  margin-left: auto;
}
.app-sidebar-close:hover { color: var(--sidebar-text); }

/* Hamburger button in app screen headers — hidden on desktop */
.btn-mobile-nav {
  display: none;
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  min-height: 40px;
  flex-shrink: 0;
  transition: border-color .15s, color .15s;
}
.btn-mobile-nav:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ─────────────────────────────────────────────────────────────────────────── */
/* RESPONSIVE                                                                  */
/* ─────────────────────────────────────────────────────────────────────────── */

@media (min-width: 769px) and (max-width: 1023px) {
  .my-exams-vendor-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {

  /* ══ APP SIDEBAR — mobile drawer ══════════════════════════════════════════ */

  /* Slide sidebar off-screen (data-screen selectors still set display:flex) */
  body[data-screen="my-exams"]       .app-sidebar,
  body[data-screen="dashboard"]      .app-sidebar,
  body[data-screen="flashcards"]     .app-sidebar,
  body[data-screen="downloads"]      .app-sidebar,
  body[data-screen="session-review"] .app-sidebar,
  body[data-screen="study-mode"]     .app-sidebar,
  body[data-screen="practice-exam"]  .app-sidebar,
  body[data-screen="settings"]       .app-sidebar,
  body[data-screen="help"]           .app-sidebar,
  body[data-screen="planner"]        .app-sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    z-index: 300;
    box-shadow: none;
    overflow-y: auto;
  }
  body[data-screen="my-exams"]       .app-sidebar.mobile-open,
  body[data-screen="dashboard"]      .app-sidebar.mobile-open,
  body[data-screen="flashcards"]     .app-sidebar.mobile-open,
  body[data-screen="downloads"]      .app-sidebar.mobile-open,
  body[data-screen="session-review"] .app-sidebar.mobile-open,
  body[data-screen="study-mode"]     .app-sidebar.mobile-open,
  body[data-screen="practice-exam"]  .app-sidebar.mobile-open,
  body[data-screen="settings"]       .app-sidebar.mobile-open,
  body[data-screen="help"]           .app-sidebar.mobile-open {
    transform: translateX(0);
    box-shadow: 4px 0 28px rgba(0,0,0,0.28);
  }
  .app-sidebar-close { display: flex; }

  /* Content takes full width — no sidebar indent */
  body[data-screen="my-exams"]       #screen-my-exams.active,
  body[data-screen="dashboard"]      #screen-dashboard.active,
  body[data-screen="flashcards"]     #screen-flashcards.active,
  body[data-screen="downloads"]      #screen-downloads.active,
  body[data-screen="session-review"] #screen-session-review.active,
  body[data-screen="study-mode"]     #screen-study-mode.active,
  body[data-screen="practice-exam"]  #screen-practice-exam.active,
  body[data-screen="settings"]       #screen-settings.active,
  body[data-screen="help"]           #screen-help.active,
  body[data-screen="planner"]        #screen-planner.active {
    margin-left: 0;
  }

  /* ══ APP HEADER — mobile layout ═══════════════════════════════════════════ */

  .dash-header {
    padding: 0 12px;
    position: relative;
  }
  .dash-header-left { gap: 6px; }
  .dash-header-right { gap: 6px; }

  /* Show hamburger on app screens */
  .btn-mobile-nav { display: flex; }

  /* Page title centered via absolute positioning */
  .dash-header .topbar-page-title {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-size: 16px;
    white-space: nowrap;
    pointer-events: none;
    z-index: 1;
  }

  /* Show page title on ALL app screens on mobile */
  body[data-screen="my-exams"]       .topbar-page-title,
  body[data-screen="dashboard"]      .topbar-page-title,
  body[data-screen="settings"]       .topbar-page-title,
  body[data-screen="help"]           .topbar-page-title { display: block; }

  /* Hide desktop-only header elements (replaced by sidebar drawer) */
  .dash-header .code-logo { display: none !important; }
  .dash-header .shop-link { display: none !important; }
  #my-exams-welcome,
  #dash-welcome { display: none !important; }
  #btn-exams-logout,
  #btn-dash-logout { display: none !important; }
  #btn-back-to-exams { display: none !important; }
  #theme-toggle-exams,
  #theme-toggle-dash { display: none !important; }

  /* ══ EXAM SCREEN HEADER ════════════════════════════════════════════════════ */

  .exam-logo { display: none; }
  .exam-title-badge { max-width: 140px; font-size: .7rem; }
  .sidebar-toggle { display: flex; }

  /* ══ EXAM PROGRESS SIDEBAR — drawer ════════════════════════════════════════ */

  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0;
    z-index: 100; transform: translateX(-100%);
    box-shadow: 4px 0 20px rgba(0,0,0,.15);
  }
  .sidebar.open  { transform: translateX(0); }
  .sidebar-close { display: block; }

  /* ══ QUESTION AREA ══════════════════════════════════════════════════════════ */

  .question-area { padding: 16px 16px 100px; }
  .question-card { padding: 18px; }

  /* ══ NAV CONTROLS — fixed bar at bottom ════════════════════════════════════ */

  .nav-controls {
    position: fixed; bottom: 0; left: 0; right: 0;
    border-radius: 0; border-left: none; border-right: none; border-bottom: none;
    z-index: 40; padding: 12px 16px; gap: 8px;
  }
  .btn-flag { padding: 10px 12px; }

  /* ══ RESULTS ════════════════════════════════════════════════════════════════ */

  .results-header { flex-direction: column; align-items: flex-start; gap: 20px; }
  .result-stats   { flex-wrap: wrap; }
  .modal-stats    { flex-direction: column; gap: 8px; }

  /* ══ EXAM NAVIGATOR GRID ════════════════════════════════════════════════════ */

  .nav-grid { grid-template-columns: repeat(10, 1fr); }

  /* ══ DASHBOARD ══════════════════════════════════════════════════════════════ */

  .dash-body { padding: 16px 12px 80px; }
  .dash-stats-row { grid-template-columns: repeat(2, 1fr); }
  .dash-analytics-row,
  .dash-bottom-row { grid-template-columns: 1fr; }
  .dash-hero-stats { grid-template-columns: repeat(2, 1fr); }
  .dash-domain-callout { flex-direction: column; gap: 12px; }
  .domain-callout-divider { width: 100%; height: 1px; margin: 4px 0; }
  .dash-welcome-card { padding: 32px 20px; }
  .dash-hero-bar { flex-direction: column; align-items: flex-start; gap: 12px; padding: 20px; }
  .dash-hero-bar-right { align-items: flex-start; }
  .dash-hero-countdown { font-size: 1.3rem; text-align: left; }
  .dash-hero-countdown span { text-align: left; }
  .dash-hero-message { font-size: 1.2rem; }
  .exam-card-date-row { flex-direction: column; align-items: flex-start; gap: 6px; }
  .exam-card-date-input { width: 100%; }
  .dash-readiness-card { padding: 14px; }

  /* ══ MY EXAMS ═══════════════════════════════════════════════════════════════ */

  .my-exams-body { padding: 16px 12px 80px; }
  .my-exams-vendor-grid { grid-template-columns: 1fr; }
  .my-exams-heading { margin-bottom: 16px; }

  /* ══ STUDY MODE / PRACTICE EXAM ════════════════════════════════════════════ */

  .mode-wrap { padding: 16px; }
  .mode-options { padding: 20px 16px; gap: 20px; }
  .q-count-btns { flex-wrap: wrap; }
  .q-count-btn {
    flex: 0 1 calc(50% - 5px);
    padding: 10px 12px;
    text-align: center;
    min-height: 44px;
  }

  /* ══ AUTH SCREENS ═══════════════════════════════════════════════════════════ */

  .code-card {
    padding: 28px 20px;
    max-width: calc(100vw - 32px);
    border-radius: 12px;
  }

  /* ══ DOWNLOADS ══════════════════════════════════════════════════════════════ */

  .downloads-body { padding: 12px 12px 60px; width: 100vw; max-width: 100vw; box-sizing: border-box; overflow-x: hidden; }
  #downloads-content { grid-template-columns: 1fr !important; width: 100%; max-width: 100%; box-sizing: border-box; }
  .downloads-exam-card { width: 100%; max-width: 100%; box-sizing: border-box; margin-bottom: 12px; padding: 16px; }
  .downloads-file-item { flex-wrap: wrap; gap: 8px; }
  .btn-download { width: 100%; justify-content: center; }
  #screen-downloads { max-width: 100vw; overflow-x: hidden; }

  /* ══ SETTINGS ═══════════════════════════════════════════════════════════════ */

  .settings-body { padding: 16px 12px 60px; }

  /* ══ HELP ═══════════════════════════════════════════════════════════════════ */

  .help-body { padding: 16px 12px 60px; gap: 16px; }
  .help-steps-grid { grid-template-columns: 1fr; }

  /* ══ FLASHCARDS ═════════════════════════════════════════════════════════════ */

  .flashcard { width: 100%; height: 280px; }
  .fc-card-area { padding: 16px 12px; }
  .fc-actions { padding: 8px 16px 20px; }

  /* ══ TOUCH TARGETS ══════════════════════════════════════════════════════════ */

  .btn       { min-height: 44px; }
  .btn-sm    { min-height: 36px; }
  .sidebar-nav-item { min-height: 44px; }
  .sidebar-shop-btn { min-height: 44px; }
  .btn-fc-review,
  .btn-fc-gotit { min-height: 48px; padding: 12px 20px; }
  .option-card  { min-height: 52px; }

  /* On mobile, shrink pill font and padding so it fits alongside title */
  .exam-context-pill {
    font-size: 10px;
    padding: 2px 6px;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-left: 6px;
  }
}

@media (max-width: 480px) {
  .code-card { padding: 24px 16px; }
  .modal-box { padding: 24px 16px; }
  .dash-body { padding: 12px 8px 80px; }
  .my-exams-body { padding: 12px 8px 80px; }
  .dash-welcome-card { padding: 28px 16px; }
  .flashcard { height: 260px; }
  .fc-question-text { font-size: .9rem; }
  .score-ring-wrap { width: 100px; height: 100px; }
  .score-ring { width: 100px; height: 100px; }
  .score-pct  { font-size: 1.5rem; }
  .q-count-btn { flex: 0 1 calc(50% - 5px); font-size: .88rem; }
  .mode-options { padding: 16px 12px; }
  .exam-card-stats { grid-template-columns: 1fr 1fr; }
}

/* ─────────────────────────────────────────────────────────────────────────── */
/* DOWNLOADS SCREEN                                                            */
/* ─────────────────────────────────────────────────────────────────────────── */

.downloads-body {
  padding: 28px 32px 60px;
  width: 100%;
}

#downloads-content {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  align-items: start;
  width: 100%;
}

.downloads-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 48px 0;
  color: var(--text-muted);
  font-size: .9rem;
}

.downloads-empty {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 40px 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: .9rem;
  box-shadow: var(--shadow-card);
}

.downloads-section-header {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
  margin: 20px 0 8px;
  grid-column: 1 / -1;
}
.downloads-section-header:first-child { margin-top: 0; }

.downloads-exam-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-card);
}

.downloads-exam-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.downloads-file-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.downloads-file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: border-color .15s;
}
.downloads-file-item:hover { border-color: var(--accent); }

.downloads-file-name {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .88rem;
  color: var(--text);
  font-weight: 500;
}

.downloads-file-icon {
  color: var(--accent);
  flex-shrink: 0;
}

.downloads-no-files {
  color: var(--text-muted);
  font-size: .85rem;
  padding: 8px 0;
  font-style: italic;
}

/* ─────────────────────────────────────────────────────────────────────────── */
/* SETTINGS SCREEN                                                             */
/* ─────────────────────────────────────────────────────────────────────────── */

.settings-body {
  max-width: 640px;
  margin: 0 auto;
  padding: 32px 24px 64px;
  width: 100%;
}

.settings-page-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 28px;
}

.settings-section {
  margin-bottom: 24px;
}

.settings-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.settings-card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  font-size: .88rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  background: var(--surface-2);
}

.settings-card-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.settings-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.settings-field label {
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-muted);
}

.settings-field input {
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: .9rem;
  font-family: var(--font);
  transition: border-color .15s;
}

.settings-field input:focus {
  outline: none;
  border-color: var(--accent);
}

.settings-msg {
  font-size: .83rem;
  font-weight: 500;
  min-height: 1.2em;
  display: none;
}

.settings-msg.success { color: var(--green); display: block; }
.settings-msg.error   { color: var(--red);   display: block; }

/* Appearance toggle row */
.appearance-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.appearance-row-label {
  font-size: .92rem;
  font-weight: 600;
  color: var(--text);
}

.appearance-toggle-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.appearance-toggle-label {
  font-size: .85rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Toggle switch */
.toggle-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.toggle-switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-track {
  width: 44px;
  height: 24px;
  background: var(--border);
  border-radius: 12px;
  position: relative;
  transition: background .2s;
  flex-shrink: 0;
}

.toggle-switch input:checked ~ .toggle-track {
  background: var(--accent);
}

.toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: transform .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}

.toggle-switch input:checked ~ .toggle-track .toggle-thumb {
  transform: translateX(20px);
}

/* Danger zone */
.danger-zone-card {
  background: var(--surface);
  border: 1.5px solid var(--red-dim);
  border-radius: var(--radius);
  padding: 20px;
}

.danger-zone-title {
  font-size: .88rem;
  font-weight: 700;
  color: var(--red);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 8px;
}

.danger-zone-desc {
  font-size: .85rem;
  color: var(--text-muted);
  margin-bottom: 16px;
  line-height: 1.5;
}

/* ─────────────────────────────────────────────────────────────────────────── */
/* HELP SCREEN                                                                 */
/* ─────────────────────────────────────────────────────────────────────────── */

.help-body {
  max-width: 760px;
  margin: 0 auto;
  padding: 32px 24px 64px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.help-page-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.help-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.help-card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}

.help-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.help-card-subtitle {
  font-size: .82rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.help-card-body {
  padding: 20px;
}

.help-steps-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.help-step-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.help-step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-dim);
  color: var(--accent);
  font-size: .8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.help-step-title {
  font-size: .9rem;
  font-weight: 700;
  color: var(--text);
}

.help-step-desc {
  font-size: .82rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.help-links-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.help-link-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--accent);
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: border-color .15s, background .15s;
}

.help-link-item:hover {
  border-color: var(--accent);
  background: var(--accent-dim);
}

.help-guide-card-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.help-guide-desc {
  font-size: .9rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.help-guide-note {
  font-size: .78rem;
  color: var(--text-muted);
  font-style: italic;
}

/* ─────────────────────────────────────────────────────────────────────────── */
/* DARK MODE                                                                   */
/* ─────────────────────────────────────────────────────────────────────────── */

body.dark-mode {
  --main-bg:       #0f1117;
  --header-bg:     #1a1d27;
  --header-border: #2a2f3e;
  --surface:       #1a1d27;
  --surface-2:     #1f2233;
  --surface-3:     #252a38;
  --text:          #e8eaf0;
  --text-muted:    #9ca3af;
  --border:        #2a2f3e;
  --sidebar-bg:    #0f1a2e;
  --sidebar-active:#1e3a5f;
}

body.dark-mode .app-sidebar {
  background: #0f1a2e;
}

body.dark-mode input,
body.dark-mode select,
body.dark-mode textarea {
  background: #252a38;
  color: var(--text);
  border-color: var(--border);
}

/* ── .btn-redeem ──────────────────────────────────────────────────────────── */
.btn-redeem {
  background: #2563eb !important;
  color: #ffffff !important;
  border: none !important;
  padding: 12px !important;
  width: 100% !important;
  border-radius: 8px !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  margin-top: 16px !important;
  display: block !important;
}

.btn-redeem:hover {
  background: #1d4ed8 !important;
}

/* ── Redeem code screen submit button — force visibility ──────────────────── */
#btn-begin {
  background: #2563eb !important;
  color: #ffffff !important;
  border: none !important;
  padding: 12px !important;
  width: 100%;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 16px;
}

/* ── Exam Context Pill ── */
.exam-context-pill {
  display: inline-flex;
  align-items: center;
  background: #dbeafe;
  color: #1e40af;
  font-size: 12px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 20px;
  margin-left: 12px;
  white-space: nowrap;
  vertical-align: middle;
}
body.dark-mode .exam-context-pill {
  background: #1e3a5f;
  color: #93c5fd;
}
.exam-context-pill.hidden {
  display: none;
}

/* ── Study Planner ── */
.planner-countdown {
  margin-top: 16px;
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
}
.planner-countdown-label {
  font-size: .85rem;
  color: var(--text-muted);
  margin-top: 4px;
}
.planner-weekly-progress {
  margin-top: 20px;
  font-size: .88rem;
}
.planner-alert {
  margin-top: 8px;
  padding: 14px 16px;
  border-radius: 10px;
  background: rgba(234,179,8,0.1);
  border: 1.5px solid rgba(234,179,8,0.3);
  color: var(--yellow, #eab308);
  font-size: .88rem;
}

/* ── Study Planner spacing fixes ── */
.settings-section-title {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.settings-label {
  display: block;
  font-size: .85rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  margin-top: 4px;
}

/* ── Setup screen contextual help ───────────────────────────────────────── */
.mode-option-hint {
  font-size: .78rem;
  color: var(--text-muted);
  margin-top: 6px;
  line-height: 1.5;
}

.mode-help-callout {
  background: var(--hover);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  padding: 14px 16px;
  margin-top: 20px;
}

.mode-help-callout-title {
  font-size: .82rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.mode-help-callout-list {
  margin: 0;
  padding-left: 18px;
  list-style: disc;
}

.mode-help-callout-list li {
  font-size: .82rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 4px;
}

.mode-help-callout-list li:last-child {
  margin-bottom: 0;
}
