/* ============================================================
   ESAT Pearson VUE Emulator — Stylesheet
   Faithful reproduction of the Pearson VUE test player aesthetic
   ============================================================ */

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  overflow: hidden;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
  color: #222;
  background: #e8e8e8;
  -webkit-font-smoothing: antialiased;
}

body {
  display: flex;
  flex-direction: column;
}

/* Prevent text selection on UI chrome (not on question content) */
.no-select {
  -webkit-user-select: none;
  user-select: none;
}

/* ============================================================
   SCREEN CONTAINERS — only one visible at a time
   ============================================================ */
.screen {
  display: none;
  flex-direction: column;
  height: 100vh;
  width: 100%;
}

.screen.active {
  display: flex;
}

/* ============================================================
   UPLOAD SCREEN
/* ============================================================
   SCREEN 1: UPLOAD SCREEN (White, Gold & Navy Blue Motif)
   ============================================================ */
#upload-screen {
  background: radial-gradient(circle at 50% 0%, rgba(212, 175, 55, 0.09) 0%, rgba(10, 17, 40, 0.03) 50%, #f8f9fc 100%);
  justify-content: center;
  align-items: center;
  position: relative;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  transition: background 0.5s ease;
}

/* ============================================================
   EXAM MODE PILL TOGGLE (ESAT / TMUA)
   ============================================================ */
.exam-mode-switch-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 18px;
}

.exam-mode-switch-label {
  font-size: 13px;
  font-weight: 600;
  color: #6b7280;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

.exam-mode-pill-toggle {
  display: inline-flex;
  align-items: center;
  background: #f1f3f8;
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.08);
  position: relative;
}

.mode-toggle-btn {
  position: relative;
  z-index: 1;
  border: none;
  outline: none;
  border-radius: 999px;
  padding: 7px 22px;
  font-size: 14px;
  font-weight: 700;
  font-family: 'Plus Jakarta Sans', sans-serif;
  cursor: pointer;
  transition: color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
  color: #9ca3af;
  background: transparent;
  letter-spacing: 0.03em;
}

.mode-toggle-btn.active[data-mode="ESAT"] {
  color: #0a1128;
  background: linear-gradient(135deg, #ffffff 0%, #fffbeb 100%);
  box-shadow: 0 2px 8px rgba(212, 175, 55, 0.35), 0 0 0 1px rgba(212, 175, 55, 0.4);
}

.mode-toggle-btn.active[data-mode="TMUA"] {
  color: #ffffff;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.45), 0 0 0 1px rgba(37, 99, 235, 0.5);
}

.mode-toggle-btn:not(.active):hover {
  color: #374151;
  background: rgba(0,0,0,0.04);
}

/* ============================================================
   TMUA MODE THEME OVERRIDES (body.mode-tmua)
   All ESAT White & Gold → Royal Cobalt & Navy Blue
   Layout, card sizes, border-radius, typography unchanged.
   ============================================================ */
body.mode-tmua #upload-screen {
  background: radial-gradient(circle at 50% 0%, rgba(37, 99, 235, 0.09) 0%, rgba(11, 25, 44, 0.04) 50%, #f0f4ff 100%);
}

body.mode-tmua .upload-container {
  border-color: rgba(37, 99, 235, 0.32);
  box-shadow: 0 24px 60px -12px rgba(11, 25, 44, 0.11), 0 0 0 1px rgba(37, 99, 235, 0.13);
}

body.mode-tmua .upload-container::before {
  background: linear-gradient(90deg, transparent, #2563eb, #60a5fa, #2563eb, transparent);
}

body.mode-tmua .upload-container h1 {
  color: #0b192c;
}

body.mode-tmua .upload-container h1::before {
  background: linear-gradient(135deg, #2563eb, #0ea5e9);
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.35);
}

body.mode-tmua .subtitle {
  color: #1e3a5f;
}

body.mode-tmua .upload-dropzone {
  border-color: rgba(37, 99, 235, 0.45);
}

body.mode-tmua .upload-dropzone:hover,
body.mode-tmua .upload-dropzone.dragover {
  border-color: #2563eb;
  background: rgba(37, 99, 235, 0.04);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.10);
}

body.mode-tmua .upload-dropzone .icon {
  background: linear-gradient(135deg, #2563eb 0%, #0ea5e9 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

body.mode-tmua .btn-primary {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #fff;
  border: none;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
}

body.mode-tmua .btn-primary:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
  box-shadow: 0 4px 18px rgba(37, 99, 235, 0.55);
}

body.mode-tmua .file-badge {
  border-color: rgba(37, 99, 235, 0.35);
  color: #1d4ed8;
  background: rgba(37, 99, 235, 0.06);
}

body.mode-tmua .module-select-container h2,
body.mode-tmua .module-select-container label {
  color: #0b192c;
}

body.mode-tmua .module-select-container select:focus,
body.mode-tmua .module-select-container input[type="checkbox"]:checked {
  accent-color: #2563eb;
}

body.mode-tmua .module-select-container select:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

body.mode-tmua .section-info {
  border-left-color: #2563eb;
  background: rgba(37, 99, 235, 0.05);
}

body.mode-tmua .exam-mode-switch-label {
  color: #1e3a5f;
}

.upload-container {
  background: #ffffff;
  border: 1px solid rgba(212, 175, 55, 0.32);
  border-radius: 20px;
  padding: 44px 52px;
  max-width: 820px;
  max-height: 90vh;
  overflow-y: auto;
  width: 92%;
  text-align: center;
  box-sizing: border-box;
  box-shadow: 0 24px 60px -12px rgba(10, 17, 40, 0.09), 0 0 0 1px rgba(212, 175, 55, 0.12);
  position: relative;
}

.upload-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 40px;
  right: 40px;
  height: 3px;
  background: linear-gradient(90deg, transparent, #d4af37, #f3e5ab, #d4af37, transparent);
  border-radius: 3px;
}

.upload-container h1 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 28px;
  font-weight: 800;
  color: #0a1128;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.upload-container h1::before {
  content: "CAMBRIDGE ADMISSIONS ASSESSMENT SUITE";
  display: inline-block;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.16em;
  color: #b8860b;
  background: rgba(212, 175, 55, 0.12);
  border: 1px solid rgba(212, 175, 55, 0.3);
  padding: 3px 12px;
  border-radius: 9999px;
  margin-bottom: 4px;
}

.upload-container .subtitle {
  font-size: 13.5px;
  color: #475569;
  line-height: 1.55;
  margin-bottom: 30px;
  max-width: 620px;
  margin-left: auto;
  margin-right: auto;
}

.dual-upload-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 14px;
  margin-bottom: 12px;
  width: 100%;
}

@media (max-width: 680px) {
  .dual-upload-grid {
    grid-template-columns: 1fr;
  }
}

.upload-dropzone {
  border: 2px dashed rgba(212, 175, 55, 0.45);
  border-radius: 14px;
  padding: 38px 22px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  background: #fafbfe;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.upload-dropzone:hover,
.upload-dropzone.dragover {
  border-color: #d4af37;
  background: #fffdf7;
  box-shadow: 0 10px 28px rgba(212, 175, 55, 0.16), 0 0 0 1px rgba(212, 175, 55, 0.25);
  transform: translateY(-2px);
}

.upload-dropzone .icon {
  font-size: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.16) 0%, rgba(212, 175, 55, 0.06) 100%);
  border: 1px solid rgba(212, 175, 55, 0.35);
  margin-bottom: 12px;
  transition: transform 0.25s ease;
}

.upload-dropzone:hover .icon {
  transform: scale(1.08);
}

.upload-dropzone .dropzone-title {
  font-weight: 700;
  font-size: 15px;
  color: #0a1128;
  margin-bottom: 6px;
}

.upload-dropzone p {
  font-size: 12.5px;
  color: #64748b;
  line-height: 1.45;
}

.upload-dropzone.markscheme-dropzone {
  border-color: rgba(22, 34, 68, 0.3);
  background: #f8fafc;
}

.upload-dropzone.markscheme-dropzone .icon {
  background: linear-gradient(135deg, rgba(10, 17, 40, 0.08) 0%, rgba(212, 175, 55, 0.1) 100%);
  border-color: rgba(22, 34, 68, 0.2);
}

.upload-dropzone.markscheme-dropzone:hover {
  border-color: #0a1128;
  background: #f4f6fb;
  box-shadow: 0 10px 28px rgba(10, 17, 40, 0.12), 0 0 0 1px rgba(10, 17, 40, 0.2);
}

.file-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 700;
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #86efac;
  box-shadow: 0 2px 6px rgba(22, 101, 52, 0.08);
}

.file-badge.error {
  background: #fef2f2;
  color: #b91c1c;
  border-color: #fca5a5;
  box-shadow: 0 2px 6px rgba(185, 28, 28, 0.08);
}

.upload-error {
  color: #b91c1c;
  font-size: 13px;
  font-weight: 600;
  margin-top: 14px;
  min-height: 20px;
}

.upload-status {
  color: #0a1128;
  font-size: 13px;
  font-weight: 600;
  margin-top: 14px;
  min-height: 20px;
}

/* ============================================================
   SCREEN 2: MODULE SELECTION SCREEN (White, Gold & Navy Motif)
   ============================================================ */
#module-select-screen {
  background: radial-gradient(circle at 50% 0%, rgba(212, 175, 55, 0.09) 0%, rgba(10, 17, 40, 0.03) 50%, #f8f9fc 100%);
  justify-content: center;
  align-items: center;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.module-select-container {
  background: #ffffff;
  border: 1px solid rgba(212, 175, 55, 0.32);
  border-radius: 20px;
  padding: 42px 48px;
  max-width: 600px;
  width: 90%;
  box-shadow: 0 24px 60px -12px rgba(10, 17, 40, 0.09), 0 0 0 1px rgba(212, 175, 55, 0.12);
  position: relative;
}

.module-select-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 36px;
  right: 36px;
  height: 3px;
  background: linear-gradient(90deg, transparent, #d4af37, #f3e5ab, #d4af37, transparent);
  border-radius: 3px;
}

.module-select-container h2 {
  font-size: 22px;
  font-weight: 800;
  color: #0a1128;
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}

.module-select-container .paper-info {
  font-size: 13px;
  color: #475569;
  margin-bottom: 22px;
  font-weight: 500;
}

.module-select-container label {
  display: block;
  font-size: 12px;
  color: #0a1128;
  margin-bottom: 8px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.module-select-container select {
  width: 100%;
  padding: 11px 14px;
  font-size: 14px;
  font-weight: 600;
  border: 1.5px solid rgba(212, 175, 55, 0.35);
  border-radius: 10px;
  background: #ffffff;
  color: #0a1128;
  margin-bottom: 18px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  cursor: pointer;
}

.module-select-container select:focus {
  border-color: #d4af37;
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.2);
}

.section-checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
  background: #fafbfe;
  padding: 16px 18px;
  border: 1.5px solid rgba(212, 175, 55, 0.25);
  border-radius: 12px;
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 13.5px;
  color: #0a1128;
  cursor: pointer;
  user-select: none;
  padding: 4px 0;
}

.checkbox-label input[type="checkbox"] {
  width: 19px;
  height: 19px;
  margin-top: 1px;
  accent-color: #d4af37;
  cursor: pointer;
}

.checkbox-text {
  display: flex;
  flex-direction: column;
}

.checkbox-text strong {
  font-weight: 700;
  font-size: 13.5px;
  color: #0a1128;
}

.section-desc {
  font-size: 11.5px;
  color: #64748b;
  margin-top: 1px;
}

.module-ms-card {
  background: #fffdf5;
  border: 1.5px dashed rgba(212, 175, 55, 0.6);
  border-radius: 10px;
  padding: 12px 16px;
  margin: 14px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  color: #8a6508;
  font-weight: 600;
}

.module-ms-card.loaded {
  border-color: #22c55e;
  border-style: solid;
  background: #f0fdf4;
  color: #166534;
}

.module-ms-card .ms-icon {
  font-size: 20px;
}

.section-info {
  font-size: 12px;
  color: #475569;
  margin-bottom: 18px;
  padding: 12px 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  line-height: 1.5;
}

.module-select-container .btn-row {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 14px;
}

#module-select-screen .btn {
  padding: 9px 20px;
  font-size: 13.5px;
  font-weight: 700;
  border-radius: 10px;
  transition: all 0.2s ease;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

#btn-back-upload {
  background: #ffffff;
  border: 1.5px solid rgba(10, 17, 40, 0.2);
  color: #0a1128;
}

#btn-back-upload:hover {
  background: #f8fafc;
  border-color: #0a1128;
}

#btn-start-module {
  background: linear-gradient(135deg, #d4af37 0%, #c59b27 100%);
  color: #0a1128;
  border: none;
  box-shadow: 0 4px 16px rgba(212, 175, 55, 0.35);
}

#btn-start-module:hover {
  background: linear-gradient(135deg, #e0be4e 0%, #d4af37 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(212, 175, 55, 0.45);
}

#btn-start-module:active {
  transform: translateY(0);
}

#btn-module-upload-ms {
  background: #ffffff;
  border: 1.5px solid rgba(212, 175, 55, 0.5);
  color: #8a6508;
  border-radius: 8px;
  font-weight: 700;
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
}

#btn-module-upload-ms:hover {
  background: #d4af37;
  color: #0a1128;
}

/* ============================================================
   INSTRUCTIONS SCREEN
   ============================================================ */
#instructions-screen {
  background: #f5f6f7;
  justify-content: center;
  align-items: center;
}

.instructions-container {
  background: #fff;
  border: 1px solid #ccc;
  padding: 40px 48px;
  max-width: 700px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
}

.instructions-container h2 {
  font-size: 18px;
  font-weight: 700;
  color: #1a6a7a;
  margin-bottom: 20px;
}

.instructions-container p,
.instructions-container li {
  font-size: 14px;
  color: #333;
  line-height: 1.65;
  margin-bottom: 10px;
}

.instructions-container ul {
  padding-left: 22px;
  margin-bottom: 16px;
}

.instructions-container .btn-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 24px;
}

/* ============================================================
   BUTTONS — Institutional Pearson style
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 18px;
  font-size: 13px;
  font-family: Arial, Helvetica, sans-serif;
  border: 1px solid #888;
  background: #f0f0f0;
  color: #222;
  cursor: pointer;
  transition: background 0.1s;
  white-space: nowrap;
}

.btn:hover {
  background: #e0e0e0;
}

.btn:active {
  background: #d0d0d0;
}

.btn-primary {
  background: #1a6a7a;
  color: #fff;
  border-color: #14545f;
}

.btn-primary:hover {
  background: #15596a;
}

.btn-primary:active {
  background: #0f4855;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ============================================================
   EXAM PLAYER — Main Testing Interface
   ============================================================ */
#exam-screen {
  flex-direction: column;
  background: #fff;
}

/* --- Top Header Bar --- */
.exam-header {
  background: #1a6a7a;
  color: #fff;
  padding: 6px 16px;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 32px;
  flex-shrink: 0;
}

.exam-header .title {
  font-size: 14px;
  font-weight: 700;
}

.exam-header .question-counter {
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 4px;
}

.exam-header .question-counter .icon-lines {
  font-size: 14px;
}

/* --- Sub-header Bar --- */
.exam-subheader {
  background: #6db8c7;
  color: #fff;
  padding: 4px 16px;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 26px;
  flex-shrink: 0;
}

.exam-subheader .left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.exam-subheader .right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.flag-review-btn {
  background: none;
  border: none;
  color: #fff;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  font-family: Arial, Helvetica, sans-serif;
}

.flag-review-btn:hover {
  text-decoration: underline;
}

.flag-review-btn .flag-icon {
  font-size: 13px;
}

.flag-review-btn.flagged .flag-icon {
  color: #ffd700;
}

.subheader-link {
  font-size: 12px;
  color: #fff;
  opacity: 0.9;
  cursor: default;
}

.timer-display {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}

.timer-display.warning {
  color: #ffdddd;
  animation: timer-pulse 1s ease-in-out infinite;
}

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

/* --- Question Content Area --- */
.exam-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px 28px 20px 28px;
  background: #fff;
}

.question-image-container {
  max-width: 900px;
  margin: 0 auto 20px auto;
}

.question-image-container img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 2px;
}

/* --- Answer Options — Pearson VUE authentic borderless options list --- */
.answer-options {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 4px 0 24px 4px;
}

.answer-options.grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 24px;
  row-gap: 16px;
}

.answer-options.grid-2col .answer-option-item {
  width: 100%;
}

.answer-option-item {
  display: flex;
  align-items: flex-start; /* Crucial: aligns top edges so marginTop on radio aligns with baseline */
  gap: 14px;
  padding: 3px 0;
  min-height: 28px;
  background: transparent;
  border: none;
  border-radius: 0;
  cursor: pointer;
  user-select: none;
}

.answer-option-item:hover {
  background: transparent;
}

.answer-option-item.selected {
  background: transparent;
}

.option-radio {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid #666;
  background: #fff;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.12s ease, background 0.12s ease;
  margin-top: 4px; /* default fallback, overridden dynamically by baselineOffset */
}

.answer-option-item:hover .option-radio {
  border-color: #1a6a7a;
}

.answer-option-item.selected .option-radio {
  border-color: #1a6a7a;
  background: #1a6a7a;
}

.option-radio-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #fff;
  transform: scale(0);
  opacity: 0;
  transition: transform 0.12s ease, opacity 0.12s ease;
}

.answer-option-item.selected .option-radio-dot {
  transform: scale(1);
  opacity: 1;
}

.option-crop-img {
  display: block;
  max-width: calc(100% - 36px);
  height: auto;
  vertical-align: top;
}

/* --- Bottom Navigation Bar --- */
.exam-footer {
  background: #1a6a7a;
  padding: 4px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 34px;
  flex-shrink: 0;
}

.exam-footer .left-controls {
  display: flex;
  align-items: center;
}

.exam-footer .right-controls {
  display: flex;
  align-items: center;
  gap: 2px;
}

.footer-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 14px;
  font-size: 12px;
  font-family: Arial, Helvetica, sans-serif;
  font-weight: 600;
  border: 1px solid rgba(255,255,255,0.35);
  background: rgba(255,255,255,0.1);
  color: #fff;
  cursor: pointer;
  transition: background 0.1s;
  white-space: nowrap;
}

.footer-btn:hover {
  background: rgba(255,255,255,0.2);
}

.footer-btn:active {
  background: rgba(255,255,255,0.3);
}

.footer-btn .arrow {
  font-size: 11px;
}

.end-exam-btn {
  background: rgba(180,50,50,0.25);
  border-color: rgba(255,255,255,0.3);
}

.end-exam-btn:hover {
  background: rgba(180,50,50,0.45);
}

/* ============================================================
   NAVIGATOR POPUP
   ============================================================ */
.navigator-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.25);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

.navigator-overlay.active {
  display: flex;
}

.navigator-popup {
  background: #fff;
  border: 3px solid #3a99b0;
  width: 520px;
  max-height: 480px;
  display: flex;
  flex-direction: column;
  box-shadow: 2px 2px 8px rgba(0,0,0,0.2);
}

.navigator-popup .nav-header {
  background: #e8f4f7;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
  color: #1a6a7a;
  border-bottom: 1px solid #3a99b0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.navigator-popup .nav-header .gear-icon {
  font-size: 14px;
}

.navigator-popup .nav-subtitle {
  font-size: 11px;
  font-weight: 400;
  color: #555;
  margin-left: 4px;
}

/* Navigator Table */
.navigator-table-wrap {
  flex: 1;
  overflow-y: auto;
  border-bottom: 1px solid #ccc;
}

.navigator-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.navigator-table thead th {
  background: #2a8da0;
  color: #fff;
  padding: 6px 12px;
  text-align: left;
  font-weight: 700;
  font-size: 12px;
  position: sticky;
  top: 0;
  z-index: 1;
  border-bottom: 1px solid #1a6a7a;
}

.navigator-table thead th:first-child {
  width: 140px;
}

.navigator-table thead th:nth-child(2) {
  width: 160px;
}

.navigator-table tbody tr {
  border-bottom: 1px solid #ddd;
  cursor: pointer;
}

.navigator-table tbody tr:hover {
  background: #eef7f9;
}

.navigator-table tbody tr.current-row {
  background: #fff8b0;
}

.navigator-table tbody td {
  padding: 5px 12px;
  vertical-align: middle;
}

.navigator-table .q-link {
  color: #1a6a7a;
  text-decoration: underline;
  cursor: pointer;
  font-weight: 500;
}

.navigator-table .q-link:hover {
  color: #0d4a56;
}

.navigator-table .status-complete {
  color: #222;
}

.navigator-table .status-incomplete {
  color: #d48a00;
}

.navigator-table .status-unseen {
  color: #c05000;
}

.navigator-table .flag-cell .flag-indicator {
  color: #1a6a7a;
  font-size: 14px;
}

/* Navigator Footer */
.navigator-popup .nav-footer {
  padding: 8px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8f8f8;
}

.navigator-popup .nav-footer .summary {
  font-size: 12px;
  font-weight: 600;
  color: #444;
}

/* ============================================================
   REVIEW SCREEN
   ============================================================ */
#review-screen {
  flex-direction: column;
  background: #fff;
}

.review-header {
  background: #1a6a7a;
  color: #fff;
  padding: 6px 16px;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 32px;
  flex-shrink: 0;
}

.review-subheader {
  background: #6db8c7;
  color: #fff;
  padding: 4px 16px;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 26px;
  flex-shrink: 0;
}

.review-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px 32px;
}

.review-body h2 {
  font-size: 18px;
  font-weight: 700;
  color: #222;
  margin-bottom: 20px;
}

.review-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

/* Review Tabs */
.review-tabs {
  display: flex;
  gap: 0;
  border-bottom: 3px solid #1a6a7a;
  margin-bottom: 16px;
}

.review-tab {
  padding: 8px 28px;
  font-size: 13px;
  color: #1a6a7a;
  background: #fff;
  border: 1px solid #ccc;
  border-bottom: none;
  cursor: pointer;
  font-weight: 600;
  font-family: Arial, Helvetica, sans-serif;
  position: relative;
  top: 3px;
}

.review-tab:hover {
  background: #f0f7f9;
}

.review-tab.active {
  background: #fff;
  border-bottom: 3px solid #fff;
  color: #1a6a7a;
  font-weight: 700;
}

/* Review Table */
.review-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.review-table thead th {
  text-align: left;
  padding: 8px 14px;
  font-size: 11px;
  font-weight: 700;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid #ddd;
}

.review-table tbody tr {
  border-bottom: 1px solid #eee;
}

.review-table tbody tr:hover {
  background: #f8fafb;
}

.review-table tbody td {
  padding: 8px 14px;
  vertical-align: middle;
}

.review-table .review-link {
  color: #1a6a7a;
  text-decoration: none;
  cursor: pointer;
  font-weight: 600;
}

.review-table .review-link:hover {
  text-decoration: underline;
}

.review-table .status-complete-text {
  color: #1a8a1a;
  font-weight: 600;
}

.review-table .status-incomplete-text {
  color: #c00;
  font-weight: 600;
}

.review-table .status-unseen-text {
  color: #c05000;
  font-weight: 600;
}

.review-table .flag-yes {
  color: #1a6a7a;
}

/* Status Pill Badges (faithful to Pearson VUE Item Review specification) */
.tag-status {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  line-height: 1.4;
  letter-spacing: 0.2px;
}

.tag-status.correct {
  background-color: #e6f4ea;
  color: #137333;
  border: 1px solid #ceead6;
}

.tag-status.incorrect {
  background-color: #fce8e6;
  color: #c5221f;
  border: 1px solid #fad2cf;
}

.tag-status.incomplete {
  background-color: #f1f3f4;
  color: #5f6368;
  border: 1px solid #dadce0;
}

.tag-status.complete {
  background-color: #e6f4ea;
  color: #137333;
  border: 1px solid #ceead6;
}

/* Score Summary Banner in Item Review */
.review-score-banner {
  background: #f0f7f9;
  border: 1.5px solid #1a6a7a;
  border-radius: 6px;
  padding: 12px 18px;
  margin: 10px 0 16px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.review-score-banner .score-primary {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.review-score-banner .score-title {
  font-size: 15px;
  font-weight: 700;
  color: #1a6a7a;
}

.review-score-banner .score-val {
  font-size: 20px;
  font-weight: 800;
  color: #0f172a;
}

.review-score-banner .score-pct {
  font-size: 14px;
  font-weight: 700;
  color: #137333;
}

.review-score-banner .score-breakdown {
  display: flex;
  gap: 14px;
  font-size: 13px;
  color: #475569;
}

.review-score-banner .score-breakdown strong {
  color: #1e293b;
}

/* Question Review Banner (in Exam player during Post-Exam Review) */
.exam-review-banner {
  background: #f8fafc;
  border: 1.5px solid #cbd5e1;
  border-radius: 6px;
  padding: 10px 16px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13px;
}

.exam-review-banner.status-correct {
  background: #f0fdf4;
  border-color: #86efac;
  color: #166534;
}

.exam-review-banner.status-incorrect {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #991b1b;
}

.exam-review-banner.status-incomplete {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #475569;
}

.option-choice.review-correct-highlight {
  border: 2px solid #16a34a !important;
  background-color: #f0fdf4 !important;
}

.option-choice.review-wrong-highlight {
  border: 2px solid #dc2626 !important;
  background-color: #fef2f2 !important;
}

/* ============================================================
   END SCORE CARD (White, Gold & Navy Motif)
   ============================================================ */
.end-score-card {
  background: linear-gradient(145deg, #0a1128 0%, #162244 55%, #0d1b3e 100%);
  border: 2px solid #d4af37;
  border-radius: 18px;
  padding: 34px 40px;
  margin: 24px auto;
  max-width: 580px;
  text-align: center;
  box-shadow: 0 20px 50px rgba(10, 17, 40, 0.28), 0 0 30px rgba(212, 175, 55, 0.22);
  position: relative;
  overflow: hidden;
}

.end-score-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, #f3e5ab, #d4af37, #f3e5ab, transparent);
}

.end-score-card .final-scaled-badge {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #f3e5ab;
  background: rgba(212, 175, 55, 0.16);
  border: 1px solid rgba(212, 175, 55, 0.45);
  padding: 5px 18px;
  border-radius: 9999px;
  margin-bottom: 10px;
}

.end-score-card .final-score {
  font-size: 64px;
  font-weight: 900;
  color: #f3e5ab;
  line-height: 1;
  margin: 8px 0 10px;
  letter-spacing: -0.03em;
  text-shadow: 0 2px 20px rgba(212, 175, 55, 0.4);
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.end-score-card .final-score .score-max {
  font-size: 28px;
  font-weight: 600;
  color: rgba(243, 229, 171, 0.75);
  margin-left: 4px;
}

.end-score-card .final-pct {
  font-size: 15.5px;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 6px;
}

.end-score-card .final-pct strong {
  color: #f3e5ab;
  font-weight: 750;
}

.end-score-card .conversion-disclaimer {
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.65);
  font-style: italic;
  margin-top: 8px;
}

.end-score-card .breakdown-pills {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 20px;
  font-size: 13px;
  color: #ffffff;
  flex-wrap: wrap;
}

.end-score-card .breakdown-pills span {
  padding: 6px 14px;
  border-radius: 8px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.end-score-card .breakdown-pills span:nth-child(1) {
  background: rgba(34, 197, 94, 0.16);
  border-color: rgba(34, 197, 94, 0.4);
  color: #86efac;
}

.end-score-card .breakdown-pills span:nth-child(2) {
  background: rgba(239, 68, 68, 0.16);
  border-color: rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}

.end-score-card .breakdown-pills span:nth-child(3) {
  background: rgba(243, 229, 171, 0.14);
  border-color: rgba(243, 229, 171, 0.35);
  color: #fde68a;
}

.end-score-card .breakdown-pills span strong {
  color: #ffffff;
  font-weight: 800;
}

/* Review Footer */
.review-footer {
  background: #1a6a7a;
  padding: 4px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 34px;
  flex-shrink: 0;
}

/* ============================================================
   MODULE TRANSITION SCREEN
   ============================================================ */
#transition-screen {
  background: #f5f6f7;
  justify-content: center;
  align-items: center;
}

.transition-container {
  background: #fff;
  border: 1px solid #ccc;
  padding: 40px 48px;
  max-width: 580px;
  width: 90%;
  text-align: center;
}

.transition-container h2 {
  font-size: 18px;
  font-weight: 700;
  color: #1a6a7a;
  margin-bottom: 12px;
}

.transition-container p {
  font-size: 14px;
  color: #444;
  line-height: 1.6;
  margin-bottom: 12px;
}

.transition-container .btn-row {
  margin-top: 24px;
}

/* ============================================================
   SCREEN 7: END OF EXAM SCREEN (White, Gold & Navy Motif)
   ============================================================ */
#end-screen {
  background: radial-gradient(circle at 50% 0%, rgba(212, 175, 55, 0.08) 0%, rgba(10, 17, 40, 0.02) 60%, #f8f9fc 100%);
  overflow-y: auto !important;
  overflow-x: hidden;
  height: 100vh;
  width: 100%;
  padding: 30px 20px 80px 20px;
  position: relative;
  box-sizing: border-box;
  -webkit-overflow-scrolling: touch;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* FIX: Override .screen.active flex display which caused vertical centering bug */
#end-screen.active {
  display: block !important;
}

.end-container {
  background: #ffffff;
  border: 1px solid rgba(212, 175, 55, 0.32);
  border-radius: 20px;
  padding: 44px 52px;
  max-width: 1080px;
  width: 100%;
  margin: 36px auto 40px auto;
  box-shadow: 0 20px 60px -15px rgba(10, 17, 40, 0.09), 0 0 0 1px rgba(212, 175, 55, 0.12);
  position: relative;
  box-sizing: border-box;
}

.end-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 48px;
  right: 48px;
  height: 3.5px;
  background: linear-gradient(90deg, transparent, #d4af37, #f3e5ab, #d4af37, transparent);
  border-radius: 3px;
}

.end-container h2 {
  font-size: 28px;
  font-weight: 850;
  color: #0a1128;
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}

.end-container p {
  font-size: 14.5px;
  color: #475569;
  line-height: 1.6;
  margin-bottom: 10px;
}

#end-summary {
  font-size: 14px;
  color: #1e293b;
  line-height: 1.8;
  background: #fafbfe;
  border: 1px solid rgba(212, 175, 55, 0.25);
  border-radius: 12px;
  padding: 16px 22px;
  margin: 18px 0 24px;
}

#end-summary strong {
  color: #b8860b;
  font-weight: 750;
}

.end-container .btn-row {
  margin-top: 36px;
  display: flex;
  justify-content: center;
  gap: 16px;
}

#end-screen .btn {
  padding: 11px 26px;
  font-size: 14px;
  font-weight: 750;
  border-radius: 10px;
  transition: all 0.2s ease;
  font-family: 'Plus Jakarta Sans', sans-serif;
  cursor: pointer;
}

#btn-return-review {
  background: #ffffff;
  border: 1.5px solid rgba(10, 17, 40, 0.25);
  color: #0a1128;
}

#btn-return-review:hover {
  background: #f8fafc;
  border-color: #0a1128;
  transform: translateY(-1px);
}

#btn-new-exam {
  background: linear-gradient(135deg, #d4af37 0%, #c59b27 100%);
  color: #0a1128;
  border: none;
  box-shadow: 0 4px 18px rgba(212, 175, 55, 0.4);
}

#btn-new-exam:hover {
  background: linear-gradient(135deg, #e0be4e 0%, #d4af37 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(212, 175, 55, 0.5);
}

#btn-new-exam:active {
  transform: translateY(0);
}

/* ============================================================
   CONFIRMATION DIALOG
   ============================================================ */
.confirm-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.35);
  z-index: 2000;
  justify-content: center;
  align-items: center;
}

.confirm-overlay.active {
  display: flex;
}

.confirm-dialog {
  background: #fff;
  border: 2px solid #1a6a7a;
  padding: 28px 32px;
  max-width: 420px;
  width: 90%;
  box-shadow: 2px 2px 10px rgba(0,0,0,0.2);
}

.confirm-dialog p {
  font-size: 14px;
  color: #222;
  line-height: 1.6;
  margin-bottom: 20px;
}

.confirm-dialog .btn-row {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ============================================================
   LOADING SPINNER
   ============================================================ */
.loading-spinner {
  display: none;
  text-align: center;
  padding: 20px;
}

.loading-spinner.active {
  display: block;
}

.spinner {
  border: 3px solid #ddd;
  border-top: 3px solid #1a6a7a;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 12px auto;
}

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

/* ============================================================
   SCROLLBAR STYLING — Subtle, institutional
   ============================================================ */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: #f0f0f0;
}

::-webkit-scrollbar-thumb {
  background: #bbb;
  border-radius: 2px;
}

::-webkit-scrollbar-thumb:hover {
  background: #999;
}

/* ============================================================
   TIMER WARNING BAR
   ============================================================ */
.time-warning-bar {
  display: none;
  background: #c00;
  color: #fff;
  text-align: center;
  padding: 6px;
  font-size: 13px;
  font-weight: 700;
}

.time-warning-bar.active {
  display: block;
}



/* ============================================================
   REVIEW SCORE BANNER
   ============================================================ */
.review-score-banner {
  background: linear-gradient(135deg, #1a6a7a 0%, #0e4f5c 100%);
  color: #fff;
  border-radius: 6px;
  padding: 14px 20px;
  margin: 12px 16px 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.review-score-banner .score-primary {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.review-score-banner .score-title {
  font-size: 13px;
  font-weight: 600;
  opacity: 0.85;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.review-score-banner .score-val {
  font-size: 26px;
  font-weight: 800;
}

.review-score-banner .score-pct {
  font-size: 14px;
  opacity: 0.8;
}

.review-score-banner .score-breakdown {
  display: flex;
  gap: 18px;
  font-size: 13px;
  opacity: 0.9;
  flex-wrap: wrap;
}

/* ============================================================
   STATUS PILLS in Review Table
   ============================================================ */
.tag-status {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tag-status.correct {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #86efac;
}

.tag-status.incorrect {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}

.tag-status.incomplete {
  background: #fef9c3;
  color: #854d0e;
  border: 1px solid #fde047;
}

.tag-status.complete {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #7dd3fc;
}

/* ============================================================
   POST-EXAM ANSWER OPTION HIGHLIGHTS
   ============================================================ */
.answer-option-item.review-correct-highlight {
  background: transparent !important;
  border: none !important;
}

.answer-option-item.review-correct-highlight .option-radio {
  border-color: #22c55e !important;
  border-width: 2.5px !important;
  background: #ffffff !important;
}

.answer-option-item.review-correct-highlight .option-radio-dot {
  background: #22c55e !important;
  transform: scale(1) !important;
  opacity: 1 !important;
}

.answer-option-item.review-wrong-highlight {
  background: transparent !important;
  border: none !important;
}

.answer-option-item.review-wrong-highlight .option-radio {
  border-color: #ef4444 !important;
  border-width: 2.5px !important;
  background: #ffffff !important;
}

.answer-option-item.review-wrong-highlight .option-radio-dot {
  background: #ef4444 !important;
  transform: scale(1) !important;
  opacity: 1 !important;
}

/* ============================================================
   EXAM REVIEW BANNER (shown above question in post-exam mode)
   ============================================================ */
.exam-review-banner {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 4px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.exam-review-banner.status-correct {
  display: flex;
  background: #f0fdf4;
  border: 1.5px solid #22c55e;
  color: #166534;
}

.exam-review-banner.status-incorrect {
  display: flex;
  background: #fff1f2;
  border: 1.5px solid #ef4444;
  color: #991b1b;
}


.exam-review-banner.status-incomplete {
  display: flex;
  background: #fffbeb;
  border: 1.5px solid #f59e0b;
  color: #92400e;
}

/* ============================================================
   AI TUTOR — FLOATING TAB BUTTON
   ============================================================ */
.ai-tutor-tab {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 52px;
  padding: 14px 0;
  background: #1a6a7a;
  color: #fff;
  border: none;
  border-radius: 8px 0 0 8px;
  cursor: pointer;
  box-shadow: -2px 0 12px rgba(0,0,0,0.18);
  transition: background 0.15s, box-shadow 0.15s, transform 0.15s;
  writing-mode: horizontal-tb;
}

.ai-tutor-tab:hover {
  background: #155e6e;
  box-shadow: -3px 0 18px rgba(0,0,0,0.28);
}

.ai-tutor-tab .ai-tutor-tab-icon {
  font-size: 20px;
  line-height: 1;
}

.ai-tutor-tab .ai-tutor-tab-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-align: center;
  line-height: 1.3;
}

/* ============================================================
   AI TUTOR — OVERLAY BACKDROP
   ============================================================ */
.ai-tutor-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.18);
  z-index: 1101;
}

.ai-tutor-overlay.active {
  display: block;
}

/* ============================================================
   AI TUTOR — SLIDE-IN DRAWER
   ============================================================ */
.ai-tutor-drawer {
  position: fixed;
  top: 0;
  right: -440px;
  width: 420px;
  max-width: 96vw;
  height: 100vh;
  background: #fff;
  box-shadow: -4px 0 32px rgba(0,0,0,0.2);
  z-index: 1102;
  display: flex;
  flex-direction: column;
  transition: right 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.ai-tutor-drawer.open {
  right: 0;
}

/* Header */
.ai-tutor-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: #1a6a7a;
  color: #fff;
  flex-shrink: 0;
}

.ai-tutor-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ai-tutor-drawer-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.ai-model-tag {
  font-size: 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  background: rgba(255, 255, 255, 0.18);
  color: #e0f2fe;
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 500;
  letter-spacing: 0.03em;
  border: 1px solid rgba(255, 255, 255, 0.25);
  line-height: 1.3;
}

.ai-tutor-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ai-tutor-icon-btn {
  background: none;
  border: none;
  color: #fff;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  transition: background 0.12s, transform 0.12s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ai-tutor-icon-btn:hover {
  background: rgba(255, 255, 255, 0.22);
  transform: rotate(20deg);
}

.ai-tutor-keys-badge-btn {
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #ffffff;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  padding: 3px 8px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.ai-tutor-keys-badge-btn:hover {
  background: rgba(255, 255, 255, 0.28);
  border-color: rgba(255, 255, 255, 0.45);
  transform: translateY(-1px);
}

.ai-tutor-close-btn {
  background: none;
  border: none;
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 3px;
  transition: background 0.12s;
}

.ai-tutor-close-btn:hover {
  background: rgba(255, 255, 255, 0.18);
}

/* ── Settings Panel ─────────────────────────────────────────── */
.ai-tutor-settings-panel {
  background: #f1f5f9;
  border-bottom: 2px solid #cbd5e1;
  padding: 16px;
  animation: aiSettingsSlide 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  flex-shrink: 0;
  max-height: 80vh;
  overflow-y: auto;
}

.ai-settings-cascade-notice {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: #e0f2fe;
  border: 1px solid #bae6fd;
  color: #0369a1;
  font-size: 11px;
  line-height: 1.4;
  padding: 8px 10px;
  border-radius: 6px;
  margin-bottom: 4px;
}

.ai-cascade-badge {
  display: inline-block;
  background: #0284c7;
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  margin-right: 4px;
  vertical-align: middle;
  letter-spacing: 0.02em;
}

.ai-tier-tag {
  display: inline-block;
  background: #e2e8f0;
  color: #475569;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 3px;
  margin-left: 4px;
  text-transform: none;
  letter-spacing: normal;
}

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

.ai-settings-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.ai-settings-title {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
}

.ai-settings-close-text {
  background: none;
  border: none;
  color: #64748b;
  font-size: 14px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
}

.ai-settings-close-text:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.ai-settings-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ai-engine-status-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 8px 10px;
}

.ai-engine-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  padding: 4px 0;
  border-bottom: 1px solid #f1f5f9;
}

.ai-engine-item:last-child {
  border-bottom: none;
}

.ai-engine-item .engine-badge {
  font-weight: 700;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 4px;
}

.ai-engine-item .engine-badge.primary {
  background: #dcfce7;
  color: #15803d;
}

.ai-engine-item .engine-badge.fallback {
  background: #f1f5f9;
  color: #475569;
}

.ai-engine-item .engine-name {
  font-weight: 600;
  color: #1e293b;
  flex: 1;
  margin: 0 8px;
}

.ai-engine-item .engine-status {
  font-size: 10px;
  color: #059669;
  font-weight: 600;
}

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

.ai-settings-field label {
  font-size: 11px;
  font-weight: 700;
  color: #334155;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ai-settings-field input {
  padding: 7px 10px;
  font-size: 12px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  background: #ffffff;
  color: #0f172a;
  outline: none;
  font-family: inherit;
  transition: border-color 0.15s;
}

.ai-settings-field input:focus {
  border-color: #0284c7;
  box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.15);
}

.ai-settings-hint {
  font-size: 11px;
  color: #64748b;
  line-height: 1.35;
}

.ai-settings-status {
  font-size: 11px;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: 4px;
  background: #e2e8f0;
  color: #1e293b;
  border-left: 3px solid #0284c7;
}

.ai-settings-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.ai-settings-actions .btn-sm {
  padding: 5px 12px;
  font-size: 12px;
}

/* ── Loading state ──────────────────────────────────────────── */
/* ── Loading state: Response Generation Progress Bar ─────────────────────── */
.ai-tutor-loading {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  padding: 24px 20px;
  color: #334155;
  font-size: 13px;
  flex: 1;
  overflow-y: auto;
  box-sizing: border-box;
}

.ai-progress-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 16px 18px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.ai-progress-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  gap: 8px;
}

.ai-progress-stage {
  font-size: 13px;
  font-weight: 600;
  color: #0f766e;
  line-height: 1.3;
}

.ai-progress-percent {
  font-size: 14px;
  font-weight: 700;
  color: #0d9488;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.ai-progress-track {
  width: 100%;
  height: 9px;
  background: #e2e8f0;
  border-radius: 9999px;
  overflow: hidden;
  position: relative;
}

.ai-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #0284c7 0%, #0d9488 60%, #10b981 100%);
  border-radius: 9999px;
  transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.ai-progress-fill::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.45) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  animation: ai-progress-shimmer 1.8s infinite;
}

@keyframes ai-progress-shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(200%); }
}

.ai-progress-subtext {
  font-size: 11px;
  color: #64748b;
  margin-top: 8px;
  letter-spacing: 0.01em;
}

.ai-progress-model-info {
  font-size: 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  color: #0284c7;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 4px;
  padding: 3px 8px;
  margin-top: 8px;
  display: inline-block;
  letter-spacing: 0.02em;
}

/* ── Skeletons ────────────────────────────────────────────── */
.ai-loading-skeletons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 18px;
}

.ai-skeleton-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  background: #ffffff;
  border: 1px solid #f1f5f9;
  border-radius: 6px;
}

.ai-skeleton-icon {
  font-size: 16px;
  line-height: 1;
  padding-top: 2px;
}

.ai-skeleton-lines {
  flex: 1;
}

.ai-skeleton-title {
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  margin-bottom: 8px;
}

.ai-skeleton-line {
  height: 6px;
  background: #e2e8f0;
  border-radius: 3px;
  margin-top: 6px;
  position: relative;
  overflow: hidden;
}

.ai-skeleton-line::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.7) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  animation: ai-skeleton-shimmer 1.6s infinite;
}

@keyframes ai-skeleton-shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(200%); }
}

/* ── Error state ────────────────────────────────────────────── */
.ai-tutor-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 48px 24px;
  color: #7f1d1d;
  font-size: 13px;
  text-align: center;
  flex: 1;
}

.ai-tutor-error-icon {
  font-size: 32px;
}

.ai-tutor-error-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 6px;
}

.ai-tutor-retry-btn {
  margin-top: 0;
}

.ai-tutor-settings-link-btn {
  font-size: 12px;
  padding: 8px 14px;
}

/* ── Content area ───────────────────────────────────────────── */
.ai-tutor-content {
  flex: 1;
  overflow-y: auto;
  padding: 0 0 24px 0;
}

/* Sections */
.ai-tutor-section {
  border-bottom: 1px solid #eee;
  padding: 16px 18px;
}

.ai-tutor-section:last-child {
  border-bottom: none;
}

.ai-tutor-section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.ai-tutor-section-icon {
  font-size: 15px;
  flex-shrink: 0;
}

.ai-tutor-section-title {
  font-size: 12px;
  font-weight: 700;
  color: #1a6a7a;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.ai-tutor-section-body {
  font-size: 13.5px;
  line-height: 1.68;
  color: #1e293b;
}

.ai-tutor-section-body p {
  margin: 0 0 8px 0;
}

.ai-tutor-section-body p:last-child {
  margin-bottom: 0;
}

/* ── Step Cards for Step-by-Step Solutions ────────────────── */
.ai-step-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-left: 3.5px solid #0f766e;
  border-radius: 6px;
  padding: 11px 14px;
  margin: 10px 0;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

.ai-step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background: #0f766e;
  color: #fff;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}

.ai-step-body {
  flex: 1;
  font-size: 13.5px;
  line-height: 1.65;
  color: #1e293b;
  min-width: 0;
}

.ai-step-body strong {
  color: #0f172a;
  font-weight: 600;
  display: block;
  margin-bottom: 4px;
}

.ai-step-spacer {
  height: 6px;
}

.ai-p-gap {
  margin: 8px 0;
}

/* ── Custom Bullet Items ──────────────────────────────────── */
.ai-bullet-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 7px 0;
  font-size: 13.5px;
  line-height: 1.6;
  color: #334155;
}

.ai-bullet-dot {
  color: #0f766e;
  font-weight: bold;
  flex-shrink: 0;
  margin-top: -1px;
}

/* ── Pitfalls List ────────────────────────────────────────── */
.ai-tutor-pitfalls-list {
  margin: 0;
  padding: 0 0 0 18px;
  font-size: 13.5px;
  line-height: 1.65;
  color: #334155;
}

.ai-tutor-pitfalls-list li {
  margin-bottom: 8px;
}

.ai-tutor-pitfalls-list li:last-child {
  margin-bottom: 0;
}

.ai-tutor-pitfalls-list strong {
  color: #0f172a;
}

/* ── KaTeX Mathematical Typesetting Overrides ─────────────── */
.ai-tutor-drawer .katex-display {
  margin: 8px 0 !important;
  padding: 4px 0 !important;
  overflow-x: auto;
  overflow-y: hidden;
  text-align: center;
}

.ai-tutor-drawer .katex {
  font-size: 1.05em;
  color: #0f172a;
}

.ai-tutor-drawer .katex-html {
  white-space: normal;
}

/* ── Fallback Math Styles (when offline) ───────────────────── */
.ai-fallback-math-display {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: 7px 12px;
  margin: 8px 0;
  font-family: "Consolas", "Courier New", monospace;
  font-weight: 600;
  color: #0f172a;
  text-align: center;
  overflow-x: auto;
}

.ai-fallback-math-inline {
  background: rgba(15, 118, 110, 0.08);
  color: #0f766e;
  padding: 1px 4px;
  border-radius: 3px;
  font-family: inherit;
  font-weight: 600;
}

/* ── AI Tutor Footer Debug Meta ───────────────────────────── */
.ai-tutor-footer-meta {
  margin-top: 24px;
  padding: 12px 4px 0;
  border-top: 1px dashed #cbd5e1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.ai-footer-model-badge {
  font-size: 10px;
  color: #94a3b8;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.ai-footer-model-badge span,
.ai-footer-model-badge strong {
  color: #475569;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  padding: 2px 6px;
  border-radius: 3px;
  font-weight: 600;
}

/* Regenerate button — quota-free refresh for garbled/incomplete AI responses */
.ai-tutor-regen-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  font-weight: 600;
  color: #92400e;
  background: #fef3c7;
  border: 1px solid #fbbf24;
  border-radius: 5px;
  padding: 3px 9px;
  cursor: pointer;
  transition: background 0.14s, transform 0.12s;
  font-family: inherit;
  white-space: nowrap;
}
.ai-tutor-regen-btn:hover {
  background: #fde68a;
  transform: translateY(-1px);
}

/* ============================================================
   FINE TOPIC BREAKDOWN & NHI DASHBOARD STYLING
   ============================================================ */

.topic-breakdown-section {
  margin-top: 36px;
  border-top: 2px solid #e2e8f0;
  padding-top: 32px;
  text-align: left;
}

/* ── Subject Badges ────────────────────────────────────────── */
.topic-sub-badge,
.review-sub-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: 4px;
  white-space: nowrap;
}

.topic-sub-badge.mathematics1,
.review-sub-tag.mathematics1 {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.topic-sub-badge.mathematics2,
.review-sub-tag.mathematics2 {
  background: #faf5ff;
  color: #7e22ce;
  border: 1px solid #e9d5ff;
}

.topic-sub-badge.tmua-paper1,
.review-sub-tag.tmua-paper1,
.topic-sub-badge.tmua-paper2,
.review-sub-tag.tmua-paper2 {
  background: #f5f3ff;
  color: #6d28d9;
  border: 1px solid #ddd6fe;
}

.topic-sub-badge.physics,
.review-sub-tag.physics {
  background: #fff7ed;
  color: #c2410c;
  border: 1px solid #fed7aa;
}

.topic-sub-badge.chemistry,
.review-sub-tag.chemistry {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.topic-sub-badge.biology,
.review-sub-tag.biology {
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

/* ── Executive Priority Action Card (White, Gold & Navy Motif) ────────────── */
.nhi-priority-card {
  background: linear-gradient(135deg, #ffffff 0%, #fdfbf7 100%);
  border: 1.5px solid #d4af37;
  border-radius: 16px;
  padding: 26px 30px;
  margin-bottom: 34px;
  box-shadow: 0 8px 26px rgba(212, 175, 55, 0.12);
  position: relative;
}

.nhi-priority-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.nhi-priority-icon {
  font-size: 26px;
  line-height: 1;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: rgba(212, 175, 55, 0.14);
  border: 1px solid rgba(212, 175, 55, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.nhi-priority-title {
  font-size: 20px;
  font-weight: 850;
  color: #0a1128;
  margin: 0 0 4px 0;
  letter-spacing: -0.01em;
}

.nhi-priority-desc {
  font-size: 13.5px;
  color: #555566;
  margin: 0;
  line-height: 1.45;
}

.nhi-priority-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.nhi-priority-item {
  background: #ffffff;
  border: 1px solid rgba(212, 175, 55, 0.32);
  border-radius: 12px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.nhi-priority-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(212, 175, 55, 0.18);
  border-color: #d4af37;
}

.nhi-priority-item-left {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.nhi-priority-rank-badge {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  color: #b8860b;
  letter-spacing: 0.08em;
}

.nhi-priority-topic-title {
  font-size: 16px;
  font-weight: 750;
  color: #0a1128;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.nhi-priority-tip {
  font-size: 12.5px;
  color: #475569;
  line-height: 1.45;
  margin-top: 2px;
}

.nhi-priority-item-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  flex-shrink: 0;
}

/* ── Heatmap Toolbar & Filters (White, Gold & Navy Motif) ──── */
.nhi-heatmap-header {
  margin-bottom: 22px;
}

.nhi-heatmap-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.nhi-heatmap-title-group h3 {
  font-size: 20px;
  font-weight: 800;
  color: #0a1128;
  margin: 0;
  letter-spacing: -0.01em;
}

.nhi-badge-count {
  font-size: 12px;
  font-weight: 700;
  color: #8a6508;
  background: #fffdf5;
  border: 1px solid rgba(212, 175, 55, 0.4);
  padding: 3px 12px;
  border-radius: 20px;
}

.nhi-controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  background: #fafbfe;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid rgba(212, 175, 55, 0.25);
}

.nhi-filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.nhi-tab-btn {
  background: #ffffff;
  border: 1.5px solid rgba(10, 17, 40, 0.15);
  color: #475569;
  font-size: 12px;
  font-weight: 650;
  padding: 7px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.18s ease;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.nhi-tab-btn:hover {
  background: #f8fafc;
  color: #0a1128;
  border-color: rgba(212, 175, 55, 0.5);
}

.nhi-tab-btn.active {
  background: #0a1128;
  color: #f3e5ab;
  border-color: #d4af37;
  box-shadow: 0 4px 12px rgba(10, 17, 40, 0.2);
}

.nhi-sort-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  color: #0a1128;
}

.nhi-select {
  font-size: 12.5px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1.5px solid rgba(212, 175, 55, 0.4);
  background: #ffffff;
  color: #0a1128;
  cursor: pointer;
  outline: none;
  font-family: 'Plus Jakarta Sans', sans-serif;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.nhi-select:focus {
  border-color: #d4af37;
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.2);
}

/* ── Topics Heatmap Grid (White, Gold & Navy Motif) ────────── */
.nhi-topics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.nhi-card {
  background: #ffffff;
  border: 1.5px solid rgba(10, 17, 40, 0.08);
  border-radius: 14px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s ease;
  position: relative;
  box-shadow: 0 4px 16px rgba(10, 17, 40, 0.03);
}

.nhi-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(10, 17, 40, 0.08), 0 0 16px rgba(212, 175, 55, 0.12);
  border-color: #d4af37;
}

.nhi-card-top {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.nhi-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.nhi-card-topic-title {
  font-size: 15.5px;
  font-weight: 800;
  color: #0a1128;
  line-height: 1.35;
  margin: 4px 0 0 0;
}

.nhi-card-q-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.nhi-q-tag {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  background: #f1f5f9;
  color: #475569;
}

.nhi-q-tag.correct {
  background: #dcfce7;
  color: #166534;
}

.nhi-q-tag.incorrect {
  background: #fee2e2;
  color: #991b1b;
}

/* ── Tier Badges ──────────────────────────────────────────── */
.nhi-tier-badge {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 9px;
  border-radius: 6px;
  white-space: nowrap;
  align-self: flex-start;
}

.tier-needs-most {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fca5a5;
}

.tier-needs-some {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}

.tier-solid {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #86efac;
}

/* ── NHI Progress Meter ────────────────────────────────────── */
.nhi-meter-container {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: #fafbfe;
  padding: 9px 12px;
  border-radius: 8px;
  border: 1px solid rgba(212, 175, 55, 0.2);
}

.nhi-meter-labels {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
}

.nhi-meter-val {
  font-size: 13.5px;
  font-weight: 850;
  color: #0a1128;
}

.nhi-meter-track {
  width: 100%;
  height: 8px;
  background: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
}

.nhi-meter-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.4s ease;
}

.fill-needs-most {
  background: linear-gradient(90deg, #f87171 0%, #ef4444 100%);
}

.fill-needs-some {
  background: linear-gradient(90deg, #fbbf24 0%, #f59e0b 100%);
}

.fill-solid {
  background: linear-gradient(90deg, #34d399 0%, #10b981 100%);
}

/* ── Diagnostic Indicator Pills ───────────────────────────── */
.nhi-diagnostics-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nhi-indicator-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 5px;
  width: fit-content;
}

.pill-fluency-slow {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}

.pill-fluency-fast {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.pill-fluency-normal {
  background: #f1f5f9;
  color: #475569;
}

.pill-careless-warning {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fca5a5;
  animation: subtle-pulse 2s infinite ease-in-out;
}

@keyframes subtle-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.85; }
}

/* ── Metrics Stats Strip ──────────────────────────────────── */
.nhi-metrics-strip {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 12px;
  font-size: 11.5px;
  color: #64748b;
  border-top: 1px dashed #e2e8f0;
  padding-top: 8px;
}

.nhi-metric-item strong {
  color: #1e293b;
}

/* ── Card Footer & Drilldown Trigger ──────────────────────── */
.nhi-card-bottom {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-top: 1px solid #f1f5f9;
  padding-top: 12px;
}

.nhi-card-tip {
  font-size: 11.5px;
  color: #64748b;
  line-height: 1.4;
  font-style: italic;
}

.btn-inspect-topic {
  background: #fffdf5;
  border: 1.5px solid #d4af37;
  color: #0a1128;
  font-size: 12.5px;
  font-weight: 750;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s ease;
  width: 100%;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.btn-inspect-topic:hover {
  background: #d4af37;
  color: #0a1128;
  box-shadow: 0 4px 14px rgba(212, 175, 55, 0.35);
  transform: translateY(-1px);
}

.btn-inspect-topic:active {
  transform: translateY(0);
}

/* ── Question Drilldown Modal ─────────────────────────────── */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.drilldown-modal-card {
  background: #ffffff;
  border-radius: 14px;
  max-width: 820px;
  width: 100%;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.22);
  overflow: hidden;
  text-align: left;
}

.modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8fafc;
}

.drilldown-header-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.drilldown-title {
  font-size: 17px;
  font-weight: 800;
  color: #0f172a;
  margin: 0;
}

.modal-close-btn {
  background: transparent;
  border: none;
  font-size: 24px;
  color: #64748b;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}

.modal-close-btn:hover {
  color: #0f172a;
}

.drilldown-stats-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 24px;
  background: #f1f5f9;
  border-bottom: 1px solid #e2e8f0;
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  flex-wrap: wrap;
  gap: 8px;
}

.drilldown-body {
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.drilldown-q-card {
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  padding: 18px;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.drilldown-q-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.drilldown-q-num {
  font-size: 15px;
  font-weight: 800;
  color: #0f172a;
}

.drilldown-q-stem {
  max-width: 100%;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  overflow: hidden;
  background: #f8fafc;
  padding: 8px;
}

.drilldown-q-stem img {
  max-width: 100%;
  height: auto;
  display: block;
}

.drilldown-q-details {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13px;
  background: #f8fafc;
  padding: 10px 14px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
}

.drilldown-ans-badge {
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
}

.ans-correct {
  background: #dcfce7;
  color: #15803d;
}

.ans-wrong {
  background: #fee2e2;
  color: #b91c1c;
}

.ans-unanswered {
  background: #f1f5f9;
  color: #64748b;
}

/* ── Review Table Topic Enhancement ───────────────────────── */
.review-topic-name {
  font-weight: 600;
  color: #1e293b;
  margin-left: 6px;
}


/* ── A2O Studios Header / Logo & Cambridge Guides Callout ────────────────── */
.a2o-brand-header {
  position: absolute;
  top: 22px;
  left: 26px;
  z-index: 100;
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.a2o-brand-header .a2o-logo-btn {
  position: static;
  top: auto;
  left: auto;
}

.a2o-guides-callout {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px 8px 14px;
  background: #000000;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1.5px solid rgba(212, 175, 55, 0.6);
  border-radius: 9999px;
  box-shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.4), 0 0 16px rgba(212, 175, 55, 0.25);
  text-decoration: none;
  color: #ffffff;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13px;
  font-weight: 700;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  white-space: nowrap;
}

.a2o-guides-callout:hover {
  transform: translateY(-2px);
  border-color: #d4af37;
  background: #111111;
  box-shadow: 0 12px 32px -4px rgba(0, 0, 0, 0.5), 0 0 22px rgba(212, 175, 55, 0.4);
  color: #ffffff;
}

.a2o-guides-arrow {
  display: inline-block;
  font-size: 16px;
  line-height: 1;
  color: #d4af37;
  font-weight: 800;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.a2o-guides-callout:hover .a2o-guides-arrow {
  transform: translateX(-4px);
}

@media (max-width: 900px) {
  .a2o-guides-callout {
    display: none;
  }
}

.a2o-logo-btn {
  position: absolute;
  top: 22px;
  left: 26px;
  z-index: 100;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 20px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1.5px solid rgba(212, 175, 55, 0.45);
  border-radius: 9999px;
  box-shadow: 0 8px 24px -4px rgba(10, 17, 40, 0.08), 0 0 16px rgba(212, 175, 55, 0.15);
  text-decoration: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.a2o-logo-btn:hover {
  opacity: 1;
  transform: translateY(-2px);
  border-color: #d4af37;
  background: #ffffff;
  box-shadow: 0 12px 32px -4px rgba(10, 17, 40, 0.12), 0 0 22px rgba(212, 175, 55, 0.35);
}

.a2o-logo-img {
  width: auto;
  height: 32px;
  max-width: 190px;
  object-fit: contain;
  display: block;
}

#end-screen .a2o-logo-btn {
  position: absolute;
  top: 22px;
  left: 26px;
  z-index: 50;
}

/* On the end-screen the background may be light — switch to normal blending */
#end-screen .a2o-logo-img,
#upload-screen .a2o-logo-img {
  mix-blend-mode: normal;
}

/* ============================================================
   A2O OMNITEST AUTHENTICATION GATE & USER TOPBAR
   ============================================================ */

/* Locked state prevents interacting with test emulator until authenticated & verified */
body.auth-locked .screen,
body.auth-locked #a2o-user-topbar {
  filter: blur(4px);
  pointer-events: none;
  user-select: none;
}

/* Modal Overlay */
.a2o-auth-overlay {
  display: none;
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 99999;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow-y: auto;
}

.a2o-auth-overlay.active {
  display: flex;
}

/* Auth Card */
.a2o-auth-card {
  background: #ffffff;
  width: 440px;
  max-width: 95vw;
  border-radius: 20px;
  border: 1.5px solid rgba(212, 175, 55, 0.4);
  box-shadow: 0 25px 60px rgba(10, 17, 40, 0.4), 0 0 24px rgba(212, 175, 55, 0.2);
  padding: 36px 32px;
  position: relative;
  display: flex;
  flex-direction: column;
  animation: authCardPop 0.28s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.a2o-auth-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 30px;
  right: 30px;
  height: 3px;
  background: linear-gradient(90deg, transparent, #d4af37, #f3e5ab, #d4af37, transparent);
  border-radius: 3px;
}

@keyframes authCardPop {
  0% { transform: scale(0.95) translateY(10px); opacity: 0; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

/* Brand Header */
.a2o-auth-brand {
  text-align: center;
  margin-bottom: 22px;
}

.a2o-auth-logo {
  height: 48px;
  width: auto;
  max-width: 180px;
  object-fit: contain;
  margin-bottom: 10px;
}

.a2o-auth-brand h2 {
  font-size: 24px;
  font-weight: 850;
  color: #0a1128;
  letter-spacing: -0.02em;
  margin-bottom: 5px;
}

.a2o-auth-subtitle {
  font-size: 13px;
  color: #64748b;
  line-height: 1.45;
}

/* Tabs */
.a2o-auth-tabs {
  display: flex;
  background: #f1f5f9;
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 20px;
  gap: 4px;
}

.a2o-auth-tab {
  flex: 1;
  border: none;
  background: transparent;
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 700;
  color: #64748b;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.18s ease;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.a2o-auth-tab:hover {
  color: #0a1128;
}

.a2o-auth-tab.active {
  background: #0a1128;
  color: #f3e5ab;
  border: 1px solid #d4af37;
  box-shadow: 0 2px 8px rgba(10, 17, 40, 0.2);
}

/* Google Auth Button & Divider */
.a2o-auth-social {
  margin-bottom: 12px;
  width: 100%;
}

.btn-google {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 11px 16px;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 10px;
  color: #1e293b;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: all 0.18s ease;
}

.btn-google:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}

.btn-google:active {
  transform: translateY(0);
}

.btn-google:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.google-icon {
  width: 19px;
  height: 19px;
  flex-shrink: 0;
}

.a2o-auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin-bottom: 14px;
  color: #94a3b8;
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.a2o-auth-divider::before,
.a2o-auth-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid #e2e8f0;
}

.a2o-auth-divider span {
  padding: 0 10px;
}

/* Forms */
.a2o-auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.a2o-form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  text-align: left;
}

.a2o-form-group label {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #0a1128;
}

.a2o-form-group input {
  padding: 10px 14px;
  font-size: 14px;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  color: #0a1128;
  outline: none;
  font-family: 'Plus Jakarta Sans', sans-serif;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.a2o-form-group input:focus {
  border-color: #d4af37;
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.2);
}

.a2o-password-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.a2o-password-wrap input {
  width: 100%;
  padding-right: 42px;
}

.a2o-eye-btn {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease;
}

.a2o-eye-btn:hover {
  color: #0a1128;
}

.a2o-eye-btn svg {
  width: 18px;
  height: 18px;
}

.a2o-forgot-link {
  text-align: right;
  margin-top: -6px;
  margin-bottom: 2px;
}

.a2o-forgot-link a {
  font-size: 12px;
  font-weight: 600;
  color: #0284c7;
  text-decoration: none;
  transition: color 0.15s ease;
}

.a2o-forgot-link a:hover {
  color: #0369a1;
  text-decoration: underline;
}

.a2o-phone-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  font-size: 11.5px;
  font-weight: 600;
  color: #334155;
  padding: 4px 8px;
  background: #f1f5f9;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
}

.a2o-phone-indicator .indicator-icon {
  font-size: 13px;
}

.a2o-auth-btn {
  width: 100%;
  padding: 12px 16px;
  background: linear-gradient(135deg, #d4af37 0%, #c59b27 100%);
  color: #0a1128;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  margin-top: 6px;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 16px rgba(212, 175, 55, 0.35);
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.a2o-auth-btn:hover {
  background: linear-gradient(135deg, #e0be4e 0%, #d4af37 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(212, 175, 55, 0.45);
}

.a2o-auth-btn:active {
  transform: translateY(0);
}

.a2o-auth-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

/* Alerts */
.a2o-auth-alert {
  padding: 9px 12px;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.45;
}

.a2o-auth-alert.error {
  background: #fef2f2;
  border-left: 3px solid #ef4444;
  color: #b91c1c;
}

.a2o-auth-alert.info {
  background: #f0fdf4;
  border-left: 3px solid #22c55e;
  color: #15803d;
}

/* Email Verification Box */
.a2o-auth-verify {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
}

.a2o-verify-icon {
  font-size: 42px;
  line-height: 1;
  margin-bottom: 2px;
}

.a2o-auth-verify h3 {
  font-size: 20px;
  font-weight: 700;
  color: #0f172a;
}

.a2o-verify-text {
  font-size: 13px;
  color: #64748b;
  margin-bottom: -4px;
}

.a2o-verify-email-pill {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  color: #0369a1;
  font-weight: 700;
  font-size: 13px;
  padding: 6px 16px;
  border-radius: 20px;
  max-width: 100%;
  word-break: break-all;
}

.a2o-verify-hint {
  font-size: 12px;
  color: #64748b;
  line-height: 1.5;
  margin: 6px 0 10px 0;
}

.a2o-verify-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.a2o-verify-actions .btn {
  width: 100%;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
}

.a2o-verify-actions .btn-outline {
  background: transparent;
  border: 1px solid #cbd5e1;
  color: #475569;
}

.a2o-verify-actions .btn-outline:hover {
  background: #f8fafc;
  color: #0f172a;
}

/* User Topbar Chip & Referral Banner (Floating widgets) */
/* Hide floating user topbar pill and promo banner during active exam and review sessions */
body:has(#exam-screen.active) #a2o-user-topbar,
body:has(#review-screen.active) #a2o-user-topbar,
body.in-exam #a2o-user-topbar,
body.in-review #a2o-user-topbar,
body:has(#exam-screen.active) #a2o-referral-banner,
body:has(#review-screen.active) #a2o-referral-banner,
body.in-exam #a2o-referral-banner,
body.in-review #a2o-referral-banner {
  display: none !important;
}

.a2o-user-topbar {
  position: fixed;
  top: 14px;
  right: 18px;
  z-index: 1050;
  display: flex;
  align-items: center;
  pointer-events: auto;
}

.a2o-user-chip {
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1.5px solid rgba(212, 175, 55, 0.45);
  box-shadow: 0 6px 20px rgba(10, 17, 40, 0.08), 0 0 14px rgba(212, 175, 55, 0.15);
  border-radius: 9999px;
  padding: 5px 14px 5px 6px;
  display: flex;
  align-items: center;
  gap: 9px;
  transition: all 0.2s ease;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.a2o-user-chip:hover {
  box-shadow: 0 8px 26px rgba(10, 17, 40, 0.12), 0 0 20px rgba(212, 175, 55, 0.25);
  border-color: #d4af37;
}

.a2o-chip-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #0a1128;
  color: #f3e5ab;
  border: 1px solid #d4af37;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}

.a2o-chip-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.a2o-chip-name {
  font-size: 12px;
  font-weight: 750;
  color: #0a1128;
  max-width: 120px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.a2o-chip-plan {
  font-size: 9.5px;
  font-weight: 800;
  color: #8a6508;
  background: rgba(212, 175, 55, 0.16);
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: 6px;
  padding: 1px 6px;
  width: fit-content;
  margin-top: 1px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.a2o-chip-plan.pro {
  background: #fef08a;
  color: #854d0e;
}

.a2o-quota-badge {
  background: #fffdf5;
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: 14px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 700;
  color: #0a1128;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.a2o-quota-badge .quota-bolt {
  color: #d4af37;
  font-size: 12px;
}

.a2o-quota-badge.depleted {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #b91c1c;
}

.a2o-chip-signout {
  border: none;
  background: none;
  color: #64748b;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  padding: 3px 5px;
  border-radius: 4px;
  transition: color 0.15s ease, background 0.15s ease;
}

.a2o-chip-signout:hover {
  color: #ef4444;
  background: #fee2e2;
}

/* AI Drawer Quota Pill */
.ai-drawer-quota-pill {
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.35);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.ai-drawer-quota-pill.depleted {
  background: #ef4444;
  border-color: #f87171;
}

/* ============================================================
   A2O OMNITEST PRO REFERRAL BANNER
   ============================================================ */
.a2o-referral-banner {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 1040;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  max-width: 410px;
  padding: 12px 16px;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1.5px solid rgba(212, 175, 55, 0.4);
  border-radius: 14px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.35), 0 0 16px rgba(212, 175, 55, 0.18);
  color: #f8fafc;
  cursor: pointer;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease, border-color 0.25s ease, background 0.25s ease;
  user-select: none;
  font-family: inherit;
  outline: none;
}

.a2o-referral-banner:hover,
.a2o-referral-banner:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(212, 175, 55, 0.85);
  box-shadow: 0 14px 30px -4px rgba(0, 0, 0, 0.45), 0 0 22px rgba(212, 175, 55, 0.28);
  background: rgba(15, 23, 42, 0.98);
}

.a2o-referral-icon {
  font-size: 1.25rem;
  line-height: 1;
  padding: 6px;
  background: rgba(212, 175, 55, 0.15);
  border-radius: 8px;
  border: 1px solid rgba(212, 175, 55, 0.35);
  flex-shrink: 0;
}

.a2o-referral-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.a2o-referral-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #f1f5f9;
}

.a2o-referral-tag {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.35), rgba(245, 158, 11, 0.25));
  color: #fbbf24;
  border: 1px solid rgba(212, 175, 55, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.a2o-referral-desc {
  margin: 0;
  font-size: 0.74rem;
  line-height: 1.35;
  color: #94a3b8;
}

.a2o-referral-cta {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 3px;
  font-size: 0.72rem;
  font-weight: 600;
  color: #38bdf8;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.a2o-referral-arrow {
  font-size: 0.85rem;
  display: inline-block;
  text-decoration: none;
  transition: transform 0.2s ease;
}

.a2o-referral-banner:hover .a2o-referral-arrow {
  transform: translate(3px, -2px);
}

/* Phone Country Detection Indicator */
.a2o-phone-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  padding: 5px 10px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 8px;
  font-size: 0.74rem;
  font-weight: 600;
  color: #38bdf8;
  transition: all 0.2s ease;
}

.a2o-phone-indicator .indicator-icon {
  font-size: 0.85rem;
  line-height: 1;
}



/* ============================================================
   A2O BRAND HEADER & CAMBRIDGE GUIDES CALLOUT
   (Upload screen — logo + arrow annotation)
   ============================================================ */

.a2o-brand-header {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 18px 28px 4px;
  position: relative;
}

.a2o-logo-btn {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.a2o-logo-btn:hover {
  transform: scale(1.04);
  opacity: 0.88;
}

.a2o-logo-img {
  height: 52px;
  width: auto;
  display: block;
}

/* The callout pill that sits next to the logo with an arrow */
.a2o-guides-callout {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px 8px 12px;
  background: #000000 !important;
  border: 1.5px solid rgba(255, 215, 80, 0.65);
  border-radius: 40px;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.22s ease, border-color 0.22s ease, transform 0.22s ease, box-shadow 0.22s ease;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5), 0 0 16px rgba(255, 193, 7, 0.2);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: callout-pulse 3s ease-in-out infinite;
}

.a2o-guides-callout:hover {
  background: #111111 !important;
  border-color: rgba(255, 215, 80, 0.9);
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.6), 0 0 22px rgba(255, 193, 7, 0.35);
  animation: none;
}

/* The curved arrow (←) pointing toward the logo */
.a2o-guides-arrow {
  font-size: 1.3rem;
  color: #fbbf24;
  line-height: 1;
  display: inline-block;
  transform: scaleX(-1); /* flip so it points LEFT toward the logo */
  transition: transform 0.22s ease;
  animation: arrow-bounce 1.6s ease-in-out infinite;
}

.a2o-guides-callout:hover .a2o-guides-arrow {
  animation: none;
  transform: scaleX(-1) translateX(4px);
}

.a2o-guides-text {
  font-size: 0.82rem;
  font-weight: 700;
  color: #fde68a;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

@keyframes callout-pulse {
  0%, 100% { box-shadow: 0 2px 16px rgba(255, 193, 7, 0.08); }
  50%       { box-shadow: 0 4px 22px rgba(255, 193, 7, 0.22); }
}

@keyframes arrow-bounce {
  0%, 100% { transform: scaleX(-1) translateX(0); }
  50%       { transform: scaleX(-1) translateX(-5px); }
}

/* ============================================================
   ACTIVE RECALL — Toggle Card (Instructions Screen)
   ============================================================ */
.active-recall-toggle-card {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.12) 0%, rgba(59, 130, 246, 0.10) 100%);
  border: 1.5px solid rgba(139, 92, 246, 0.30);
  border-radius: 14px;
  padding: 14px 18px;
  margin: 18px 0 10px;
  transition: border-color 0.2s;
}
.active-recall-toggle-card:hover {
  border-color: rgba(139, 92, 246, 0.50);
}
.ar-toggle-content {
  display: flex;
  align-items: center;
  gap: 14px;
}
.ar-toggle-icon {
  font-size: 26px;
  flex-shrink: 0;
  line-height: 1;
}
.ar-toggle-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ar-toggle-text strong {
  font-size: 14px;
  color: #c4b5fd;
  font-weight: 700;
}
.ar-toggle-text span {
  font-size: 12px;
  color: #94a3b8;
  line-height: 1.4;
}
/* Toggle Switch */
.ar-toggle-switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 26px;
  cursor: pointer;
  flex-shrink: 0;
}
.ar-toggle-switch input { display: none; }
.ar-toggle-track {
  display: block;
  width: 46px;
  height: 26px;
  background: #334155;
  border-radius: 13px;
  transition: background 0.25s;
  position: relative;
}
.ar-toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.25s, background 0.25s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.35);
}
.ar-toggle-switch input:checked ~ .ar-toggle-track {
  background: linear-gradient(90deg, #8b5cf6, #6366f1);
}
.ar-toggle-switch input:checked ~ .ar-toggle-track .ar-toggle-thumb {
  transform: translateX(20px);
}
.ar-drive-status {
  font-size: 11.5px;
  color: #94a3b8;
  margin-top: 8px;
  min-height: 14px;
  padding-left: 40px;
}
.ar-drive-status.ok   { color: #4ade80; }
.ar-drive-status.warn { color: #fbbf24; }
.ar-drive-status.err  { color: #f87171; }

/* ============================================================
   ACTIVE RECALL — Upload Button (Post-Exam Review)
   ============================================================ */
.ar-upload-zone {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0 4px;
  margin-top: 6px;
  border-top: 1px solid rgba(139,92,246,0.18);
  flex-wrap: wrap;
}
.ar-upload-btn {
  background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%) !important;
  color: #fff !important;
  border: none !important;
  padding: 9px 18px !important;
  border-radius: 10px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  display: flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
}
.ar-upload-btn:hover:not(:disabled) {
  opacity: 0.9;
  transform: translateY(-1px);
}
.ar-upload-btn:disabled {
  opacity: 0.5;
  cursor: default;
}
.ar-upload-icon { font-size: 15px; }
.ar-upload-feedback {
  font-size: 12px;
  color: #94a3b8;
  transition: color 0.2s;
}
.ar-upload-feedback.ok   { color: #4ade80; }
.ar-upload-feedback.err  { color: #f87171; }

/* ============================================================
   ACTIVE RECALL — Recall Card Displayed During Exam
   ============================================================ */
.ar-exam-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
  padding: 20px 24px 22px;
  background: linear-gradient(145deg, #1e1b4b 0%, #1a1a3e 100%);
  border: 1.5px solid rgba(139, 92, 246, 0.35);
  border-radius: 18px;
  width: min(90vw, 1100px);
  margin: 0 auto;
  text-align: center;
  animation: ar-card-in 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow-y: auto;
  max-height: calc(100vh - 160px);
}
@keyframes ar-card-in {
  from { opacity: 0; transform: scale(0.92) translateY(18px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.ar-card-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(139,92,246,0.18);
  border: 1px solid rgba(139,92,246,0.35);
  border-radius: 999px;
  padding: 4px 14px;
  font-size: 11.5px;
  font-weight: 700;
  color: #c4b5fd;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  flex-shrink: 0;
}
.ar-card-img-wrap {
  width: 100%;
  background: #0f172a;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}
.ar-card-img-wrap img {
  width: 100%;
  height: auto;
  display: block;
  max-height: 74vh;
  object-fit: contain;
}
.ar-card-msg {
  font-size: 14px;
  color: #cbd5e1;
  line-height: 1.5;
  max-width: 600px;
  flex-shrink: 0;
}
.ar-card-msg strong {
  color: #c4b5fd;
}
.ar-card-cta {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  flex-shrink: 0;
}
.ar-card-btn-next {
  background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
  color: #fff;
  border: none;
  padding: 11px 28px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
  display: flex;
  align-items: center;
  gap: 8px;
}
.ar-card-btn-next:hover {
  opacity: 0.88;
  transform: translateY(-1px);
}
.ar-card-no-img {
  font-size: 52px;
  opacity: 0.45;
  margin-bottom: -10px;
}

/* ============================================================
   ACTIVE RECALL — Annotation Tool Modal
   ============================================================ */
.ar-annotate-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 12px;
  overflow: auto;
}
.ar-annotate-modal {
  background: #1a1a2e;
  border: 1.5px solid rgba(139,92,246,0.4);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  gap: 0;
  max-width: min(96vw, 1200px);
  width: 100%;
  overflow: hidden;
  flex-shrink: 0;
}
.ar-annotate-topbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(139,92,246,0.12);
  border-bottom: 1px solid rgba(139,92,246,0.2);
  flex-wrap: wrap;
}
.ar-annotate-topbar-title {
  font-size: 13px;
  font-weight: 700;
  color: #c4b5fd;
  margin-right: 8px;
  white-space: nowrap;
}
.ar-annotate-tools {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  flex: 1;
}
.ar-annotate-tool-btn {
  background: rgba(255,255,255,0.07);
  border: 1.5px solid rgba(255,255,255,0.12);
  color: #e2e8f0;
  border-radius: 7px;
  padding: 5px 11px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  white-space: nowrap;
}
.ar-annotate-tool-btn:hover {
  background: rgba(139,92,246,0.18);
  border-color: rgba(139,92,246,0.55);
  color: #c4b5fd;
}
.ar-annotate-tool-btn.active {
  background: rgba(139,92,246,0.3);
  border-color: #8b5cf6;
  color: #e9d5ff;
}
.ar-annotate-color-swatch {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  cursor: pointer;
  border: 2.5px solid rgba(255,255,255,0.15);
  flex-shrink: 0;
  transition: border-color 0.15s, transform 0.1s;
}
.ar-annotate-color-swatch:hover { transform: scale(1.15); }
.ar-annotate-color-swatch.active { border-color: #fff !important; box-shadow: 0 0 0 2px #8b5cf6; }
.ar-annotate-size-label {
  font-size: 11px;
  color: #94a3b8;
  white-space: nowrap;
}
.ar-annotate-size-slider {
  width: 70px;
  accent-color: #8b5cf6;
}
.ar-tool-divider {
  width: 1px;
  height: 20px;
  background: rgba(255,255,255,0.15);
  margin: 0 4px;
  flex-shrink: 0;
}
.ar-annotate-color-group {
  display: flex;
  align-items: center;
  gap: 5px;
}
.ar-annotate-canvas-wrap {
  background: #0a0a1a;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 12px;
  max-height: calc(100vh - 145px);
  overflow-y: auto;
  overflow-x: auto;
}
#ar-annotate-canvas {
  display: block;
  cursor: crosshair;
  max-width: 100%;
  max-height: calc(100vh - 165px);
  width: auto;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.45);
  transition: max-height 0.2s ease, width 0.2s ease;
}
#ar-annotate-canvas.full-size {
  max-height: none;
  width: 100%;
  height: auto;
}
.ar-card-timer-frozen-notice {
  margin: 14px auto 12px;
  padding: 10px 18px;
  background: rgba(59, 130, 246, 0.16);
  border: 1.5px solid rgba(59, 130, 246, 0.45);
  border-radius: 10px;
  color: #93c5fd;
  font-size: 13.5px;
  line-height: 1.5;
  text-align: center;
  max-width: 620px;
  box-shadow: 0 2px 12px rgba(59, 130, 246, 0.15);
}
.timer-frozen {
  opacity: 0.65;
  filter: grayscale(0.2);
}
.ar-annotate-bottombar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(0,0,0,0.2);
  border-top: 1px solid rgba(139,92,246,0.15);
  flex-wrap: wrap;
}
.ar-annotate-text-input-wrap {
  display: none;
  align-items: center;
  gap: 6px;
  margin-right: auto;
}
.ar-annotate-text-input-wrap.visible { display: flex; }
.ar-annotate-text-input {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(139,92,246,0.35);
  border-radius: 6px;
  color: #e2e8f0;
  padding: 5px 10px;
  font-size: 13px;
  width: 200px;
  outline: none;
}
.ar-annotate-text-input:focus { border-color: #8b5cf6; }
.ar-annotate-place-text-btn {
  background: rgba(139,92,246,0.25);
  border: 1px solid rgba(139,92,246,0.5);
  color: #c4b5fd;
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.ar-annotate-save-btn {
  background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
  color: #fff;
  border: none;
  padding: 9px 22px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.18s;
}
.ar-annotate-save-btn:hover { opacity: 0.88; }
.ar-annotate-cancel-btn {
  background: transparent;
  color: #94a3b8;
  border: 1.5px solid rgba(255,255,255,0.12);
  padding: 8px 18px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.ar-annotate-cancel-btn:hover { border-color: #ef4444; color: #f87171; }



/* ============================================================
   ACTIVE RECALL — Re-auth & Drive Action Controls
   ============================================================ */
.ar-reauth-btn {
  background: transparent !important;
  color: #a78bfa !important;
  border: 1.5px solid rgba(139,92,246,0.45) !important;
  padding: 8px 16px !important;
  border-radius: 9px !important;
  font-size: 12.5px !important;
  font-weight: 600 !important;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.18s, color 0.18s, border-color 0.18s;
  white-space: nowrap;
}
.ar-reauth-btn:hover {
  background: rgba(139,92,246,0.14) !important;
  border-color: rgba(139,92,246,0.7) !important;
  color: #c4b5fd !important;
}
.ar-drive-actions {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.ar-api-link {
  font-size: 11.5px;
  color: #64748b;
  text-decoration: none;
  transition: color 0.15s;
}
.ar-upload-feedback.warn { color: #fbbf24; }

/* ============================================================
   OMNITEST PRO — MOCK MODE SELECTOR (Standard vs B2B vs AR Exam)
   ============================================================ */
.mock-mode-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  padding: 6px;
  border-radius: 14px;
  margin: 0 auto 24px auto;
  max-width: 680px;
  width: 100%;
  box-sizing: border-box;
}

.mock-mode-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: #475569;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}

.mock-mode-tab:hover {
  background: rgba(255, 255, 255, 0.65);
  color: #0f172a;
}

.mock-mode-tab.active {
  background: #ffffff;
  color: #0f172a;
  border-color: rgba(212, 175, 55, 0.4);
  box-shadow: 0 4px 12px rgba(10, 17, 40, 0.08), 0 0 0 1px rgba(212, 175, 55, 0.2);
}

.mock-mode-tab .tab-icon {
  font-size: 16px;
}

.pro-chip {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.05em;
  padding: 2px 6px;
  border-radius: 6px;
  background: linear-gradient(135deg, #d4af37 0%, #b8860b 100%);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(212, 175, 55, 0.35);
}

/* ============================================================
   OMNITEST PRO — BACK-TO-BACK MOCK PANEL
   ============================================================ */
.b2b-panel, .ar-exam-panel {
  background: #ffffff;
  border: 1px solid rgba(212, 175, 55, 0.32);
  border-radius: 18px;
  padding: 28px 32px;
  box-shadow: 0 12px 36px rgba(10, 17, 40, 0.06);
  text-align: left;
  margin-top: 10px;
  box-sizing: border-box;
}

.b2b-header-card, .ar-exam-header-card {
  margin-bottom: 24px;
}

.b2b-badge, .ar-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.04em;
  color: #92400e;
  background: #fef3c7;
  border: 1px solid #fde68a;
  padding: 4px 10px;
  border-radius: 20px;
  margin-bottom: 10px;
  text-transform: uppercase;
}

.b2b-header-card h3, .ar-exam-header-card h3 {
  font-size: 22px;
  font-weight: 800;
  color: #0a1128;
  margin: 0 0 6px 0;
  letter-spacing: -0.015em;
}

.b2b-header-card p, .ar-exam-header-card p {
  font-size: 13.5px;
  color: #64748b;
  line-height: 1.55;
  margin: 0;
}

/* ESAT Module Dropdowns */
.b2b-modules-setup {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 22px;
}

.b2b-selectors-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}

@media (max-width: 720px) {
  .b2b-selectors-row { grid-template-columns: 1fr; }
}

.b2b-select-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.b2b-select-group label {
  font-size: 11.5px;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.b2b-fixed-module {
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 13.5px;
  font-weight: 600;
  color: #1e293b;
}

.b2b-select {
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 13.5px;
  font-weight: 600;
  color: #0f172a;
  font-family: inherit;
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s;
}

.b2b-select:focus {
  border-color: #d4af37;
}

/* B2B Progress Cards Grid */
.b2b-progress-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.b2b-progress-card {
  background: #fafbfe;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px 16px;
  transition: all 0.2s ease;
}

.b2b-progress-card.ready {
  border-color: #10b981;
  background: #f0fdf4;
}

.b2b-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.b2b-mod-name {
  font-size: 13.5px;
  font-weight: 700;
  color: #0f172a;
}

.b2b-status-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  background: #e2e8f0;
  color: #475569;
}

.b2b-progress-card.ready .b2b-status-pill {
  background: #dcfce7;
  color: #15803d;
}

.b2b-progress-track {
  height: 7px;
  background: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 6px;
}

.b2b-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #d4af37, #f59e0b);
  border-radius: 4px;
  transition: width 0.3s ease;
}

.b2b-progress-card.ready .b2b-progress-fill {
  background: linear-gradient(90deg, #10b981, #059669);
}

.b2b-card-hint {
  font-size: 11px;
  color: #64748b;
}

.b2b-progress-card.ready .b2b-card-hint {
  color: #15803d;
  font-weight: 600;
}

/* B2B Upload Area */
.b2b-upload-dropzone {
  border: 2px dashed rgba(212, 175, 55, 0.45);
  background: #fbfcfe;
  border-radius: 12px;
  padding: 22px;
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 12px;
}

.b2b-upload-dropzone:hover {
  background: #fffdf7;
  border-color: #d4af37;
}

.b2b-drop-icon {
  font-size: 28px;
}

.b2b-drop-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.b2b-drop-text strong {
  font-size: 13.5px;
  color: #0a1128;
}

.b2b-drop-text span {
  font-size: 12px;
  color: #64748b;
}

.b2b-actions-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.b2b-autofill-btn {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%) !important;
  color: #92400e !important;
  border: 1px solid #fbbf24 !important;
  font-weight: 700 !important;
  transition: transform 0.15s, box-shadow 0.15s !important;
}

.b2b-autofill-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.25);
}

.b2b-papers-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 18px;
}

.b2b-paper-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 12px;
  color: #334155;
}

.b2b-start-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 18px;
  border-top: 1px solid #e2e8f0;
  margin-top: 12px;
}

.b2b-total-meta {
  font-size: 13px;
  font-weight: 600;
  color: #475569;
}

.b2b-begin-btn, .ar-begin-btn {
  padding: 12px 24px !important;
  font-size: 14.5px !important;
  font-weight: 750 !important;
  border-radius: 10px !important;
}

/* ============================================================
   ACTIVE RECALL ONLY EXAM PANEL
   ============================================================ */
.ar-subject-selector-card {
  margin-bottom: 22px;
}

.ar-subject-selector-card label {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 10px;
}

.ar-subject-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ar-subj-pill {
  padding: 8px 16px;
  border-radius: 9px;
  border: 1.5px solid #cbd5e1;
  background: #ffffff;
  color: #334155;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.16s ease;
}

.ar-subj-pill:hover {
  border-color: #8b5cf6;
  color: #6d28d9;
}

.ar-subj-pill.active {
  background: #ede9fe;
  border-color: #8b5cf6;
  color: #5b21b6;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.2);
}

.ar-folder-card {
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 20px;
}

.ar-folder-status {
  display: flex;
  align-items: center;
  gap: 14px;
}

.ar-folder-icon {
  font-size: 26px;
}

.ar-folder-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.ar-folder-details strong {
  font-size: 14px;
  color: #0f172a;
}

.ar-folder-details span {
  font-size: 12px;
  color: #64748b;
}

.ar-folder-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.ar-folder-actions button {
  padding: 7px 14px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 650;
  cursor: pointer;
  transition: all 0.15s ease;
  outline: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

#btn-ar-exam-connect-folder {
  background: #0a1128;
  color: #ffffff;
  border: 1px solid #0a1128;
}

#btn-ar-exam-connect-folder:hover {
  background: #1e293b;
  border-color: #1e293b;
}

#btn-ar-exam-change-folder {
  background: #ffffff;
  color: #334155;
  border: 1.5px solid #cbd5e1;
}

#btn-ar-exam-change-folder:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #0f172a;
}

.ar-exam-summary-card {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #e2e8f0;
}

.ar-exam-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px;
}

.ar-stat-val {
  font-size: 18px;
  font-weight: 800;
  color: #5b21b6;
}

.ar-stat-lbl {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  margin-top: 2px;
}

.ar-start-bar {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

/* ============================================================
   OMNITEST PRO MODAL
   ============================================================ */
.a2o-pro-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 17, 40, 0.72);
  backdrop-filter: blur(8px);
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: a2oFadeIn 0.2s ease-out;
}

.a2o-pro-modal-card {
  background: #ffffff;
  border: 1.5px solid rgba(212, 175, 55, 0.45);
  border-radius: 20px;
  max-width: 540px;
  width: 100%;
  padding: 36px 36px 28px 36px;
  box-shadow: 0 24px 64px rgba(10, 17, 40, 0.28), 0 0 0 1px rgba(212, 175, 55, 0.15);
  position: relative;
  text-align: left;
  animation: a2oCardScale 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

.a2o-pro-modal-close {
  position: absolute;
  top: 16px;
  right: 18px;
  background: transparent;
  border: none;
  font-size: 26px;
  color: #94a3b8;
  cursor: pointer;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 6px;
}

.a2o-pro-modal-close:hover {
  color: #0f172a;
  background: #f1f5f9;
}

.a2o-pro-modal-badge {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #b45309;
  background: #fef3c7;
  border: 1px solid #fde68a;
  display: inline-block;
  padding: 3px 9px;
  border-radius: 14px;
  margin-bottom: 12px;
}

.a2o-pro-modal-card h3 {
  font-size: 24px;
  font-weight: 850;
  color: #0a1128;
  margin: 0 0 6px 0;
  letter-spacing: -0.02em;
}

.a2o-pro-modal-lead {
  font-size: 13.5px;
  color: #475569;
  line-height: 1.5;
  margin: 0 0 20px 0;
}

.a2o-pro-features-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
  background: #fafbfe;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
}

.a2o-pro-feature-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.a2o-pro-feature-item .feat-icon {
  font-size: 20px;
  line-height: 1.2;
}

.a2o-pro-feature-item strong {
  display: block;
  font-size: 13px;
  color: #0f172a;
}

.a2o-pro-feature-item span {
  font-size: 11.5px;
  color: #64748b;
  line-height: 1.4;
}

.a2o-pro-modal-cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.btn-claim-pro {
  width: 100%;
  padding: 13px 20px !important;
  font-size: 14px !important;
  font-weight: 750 !important;
  background: linear-gradient(135deg, #d4af37 0%, #b8860b 100%) !important;
  border: none !important;
  border-radius: 10px !important;
  box-shadow: 0 6px 20px rgba(212, 175, 55, 0.35) !important;
  cursor: pointer;
}

.btn-claim-pro:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(212, 175, 55, 0.45) !important;
}

.a2o-pro-subtext {
  font-size: 11.5px;
  color: #64748b;
  margin: 8px 0 0 0;
}

/* ============================================================
   B2B UNIFIED SCORECARD (END SCREEN)
   ============================================================ */
.b2b-unified-scorecard {
  background: #ffffff;
  border: 1.5px solid rgba(212, 175, 55, 0.35);
  border-radius: 16px;
  padding: 24px 28px;
  margin: 20px 0 28px 0;
  box-shadow: 0 10px 30px rgba(10, 17, 40, 0.05);
}

.b2b-overall-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 16px;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 20px;
}

.b2b-overall-badge {
  font-size: 12px;
  font-weight: 750;
  color: #b45309;
  background: #fef3c7;
  padding: 4px 10px;
  border-radius: 8px;
}

.b2b-overall-score-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.b2b-overall-title {
  font-size: 13.5px;
  font-weight: 600;
  color: #475569;
}

.b2b-overall-val {
  font-size: 26px;
  font-weight: 850;
  color: #0a1128;
}

.b2b-overall-val small {
  font-size: 16px;
  color: #64748b;
  font-weight: 600;
}

.b2b-modules-results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.b2b-mod-res-card {
  background: #fafbfe;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.b2b-mod-res-card.active-tab {
  border-color: #d4af37;
  background: #fffdf7;
  box-shadow: 0 4px 12px rgba(212, 175, 55, 0.15);
}

.b2b-res-sub {
  font-size: 13.5px;
  font-weight: 750;
  color: #0f172a;
}

.b2b-res-scaled {
  font-size: 22px;
  font-weight: 850;
  color: #0a1128;
}

.b2b-res-raw {
  font-size: 12.5px;
  color: #64748b;
}

.b2b-report-nav {
  padding-top: 14px;
  border-top: 1px solid #e2e8f0;
}

.b2b-report-nav label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #475569;
  margin-bottom: 8px;
}

.b2b-report-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.b2b-report-tab-btn {
  padding: 7px 14px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #334155;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.b2b-report-tab-btn:hover {
  background: #ffffff;
  border-color: #d4af37;
}

.b2b-report-tab-btn.active {
  background: #0a1128;
  color: #ffffff;
  border-color: #0a1128;
}

