/* ═══════════════════════════════════════════════════════════════
   NU SCHOOL — Design System & Styles
   Mobile-first. Dark mode default.
═══════════════════════════════════════════════════════════════ */

/* ── 1. DESIGN TOKENS ────────────────────────────────────────── */
:root {
  --bg:             #0D0F14;
  --surface:        #1A1D24;
  --surface-raised: #22262F;
  --border:         #2A2D35;
  --text-primary:   #F0F2F7;
  --text-secondary: #8B8FA8;
  --accent:         #4A7FF7;
  --accent-dim:     rgba(74, 127, 247, 0.15);
  --success:        #4CAF7D;
  --success-dim:    rgba(76, 175, 125, 0.15);
  --failure:        #E85D5D;
  --failure-dim:    rgba(232, 93, 93, 0.15);
  --warning:        #F5A623;
  --warning-dim:    rgba(245, 166, 35, 0.15);

  --radius-sm:  8px;
  --radius-md:  12px;
  --radius-lg:  16px;
  --radius-xl:  24px;

  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.5);

  --timer-circumference: 138.23; /* 2 * PI * 22 */
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

[data-theme="light"] {
  --bg:             #F5F6FA;
  --surface:        #FFFFFF;
  --surface-raised: #EDEEF5;
  --border:         #DFE1EC;
  --text-primary:   #0D0F14;
  --text-secondary: #6B7080;
  --accent-dim:     rgba(74, 127, 247, 0.10);
  --success-dim:    rgba(76, 175, 125, 0.12);
  --failure-dim:    rgba(232, 93, 93, 0.12);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.12);
}

[data-theme="colourful"] {
  --bg:             #1A0533;
  --surface:        #2D1060;
  --surface-raised: #3D1880;
  --border:         #5B2FA0;
  --text-primary:   #FFFFFF;
  --text-secondary: #D4B8FF;
  --accent:         #FFD600;
  --accent-dim:     rgba(255, 214, 0, 0.18);
  --success:        #00E676;
  --success-dim:    rgba(0, 230, 118, 0.18);
  --failure:        #FF5252;
  --failure-dim:    rgba(255, 82, 82, 0.18);
  --warning:        #FF9100;
  --warning-dim:    rgba(255, 145, 0, 0.18);
  --shadow-sm: 0 2px 10px rgba(255, 214, 0, 0.12);
  --shadow-md: 0 4px 24px rgba(90, 0, 200, 0.5);
}

/* ── 2. RESET & BASE ─────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  height: 100%;
  overflow: hidden;
  font-family: var(--font);
  font-size: 16px;
  background: var(--bg);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button {
  font-family: var(--font);
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

input {
  font-family: var(--font);
  color: var(--text-primary);
}

img {
  display: block;
  max-width: 100%;
}

/* ── 3. SCREEN SYSTEM ────────────────────────────────────────── */
.screen {
  position: fixed;
  inset: 0;
  background: var(--bg);
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px);
  transition: opacity 220ms ease, transform 220ms ease;
  overflow: hidden;
  z-index: 10;
}

.screen.active {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
}

.screen-inner {
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 0 20px;
  padding-bottom: max(20px, env(safe-area-inset-bottom));
  overflow-y: auto;
  max-width: 520px;
  margin: 0 auto;
  width: 100%;
}

.screen-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 0 8px;
  flex-shrink: 0;
}

.header-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.header-name {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-secondary);
}

/* ── 4. BUTTONS ──────────────────────────────────────────────── */
.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  padding: 0 20px;
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  border-radius: var(--radius-md);
  transition: opacity 150ms, transform 100ms;
}
.btn-primary:active { opacity: 0.85; transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.4; cursor: default; }

.btn-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  padding: 0 20px;
  background: var(--surface);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 600;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  transition: opacity 150ms, transform 100ms;
}
.btn-secondary:active { opacity: 0.75; transform: scale(0.98); }

.btn-ghost {
  background: none;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  transition: color 150ms;
}
.btn-ghost:hover { color: var(--text-primary); }

.btn-danger {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 20px;
  background: var(--failure);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  border-radius: var(--radius-md);
  flex: 1;
  transition: opacity 150ms;
}
.btn-danger:active { opacity: 0.85; }

.btn-back {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 18px;
  color: var(--text-primary);
  flex-shrink: 0;
  transition: background 150ms;
}
.btn-back:active { background: var(--surface-raised); }

.btn-menu {
  position: absolute;
  top: max(16px, env(safe-area-inset-top));
  right: 20px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 20px;
  letter-spacing: -2px;
  color: var(--text-secondary);
  z-index: 20;
}

.btn-link-small {
  background: none;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 400;
  padding: 6px 4px;
  text-decoration: underline;
  text-decoration-color: transparent;
  transition: color 150ms, text-decoration-color 150ms;
}
.btn-link-small:hover {
  color: var(--text-primary);
  text-decoration-color: var(--text-secondary);
}

/* ── 5. LANDING SCREEN ───────────────────────────────────────── */
#screen-landing .screen-inner {
  position: relative;
  justify-content: space-between;
  padding-top: 0;
  padding-bottom: 0;
}

.landing-top {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding-top: max(64px, env(safe-area-inset-top));
  padding-bottom: 12px;
}

.landing-bottom {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-bottom: max(28px, env(safe-area-inset-bottom));
}

.landing-steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 320px;
  text-align: left;
}

.landing-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.landing-step-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.landing-step-text {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.landing-step-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}
.landing-step-link:hover { text-decoration: underline; }

.landing-brand {
  text-align: center;
}

.landing-brand h1 {
  font-size: 40px;
  font-weight: 900;
  font-family: 'Poppins', 'Inter', sans-serif;
  color: var(--text-primary);
  letter-spacing: -1px;
  line-height: 1.1;
}

.tagline {
  font-size: 15px;
  font-weight: 400;
  color: var(--text-secondary);
  margin-top: 6px;
}

.landing-audio {
  display: flex;
  justify-content: center;
}

.audio-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 100px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: border-color 200ms, color 200ms, background 200ms;
}
.audio-pill:active { transform: scale(0.97); }
.audio-pill.playing {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}
.audio-pill-icon {
  font-size: 15px;
  line-height: 1;
}
[data-theme="colourful"] .audio-pill.playing {
  border-color: var(--accent);
  color: var(--accent);
}

.greeting-wrap {
  text-align: center;
  margin-bottom: 4px;
}

.greeting-text {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.last-session-text {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.landing-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.input-group input {
  width: 100%;
  min-height: 56px;
  padding: 0 18px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 17px;
  font-weight: 400;
  outline: none;
  transition: border-color 200ms;
}

.input-group input::placeholder { color: var(--text-secondary); }
.input-group input:focus { border-color: var(--accent); }

.landing-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding-bottom: 8px;
}

.landing-footer-hint {
  font-size: 12px;
  color: var(--text-secondary);
  opacity: 0.5;
}

/* ── 6. MODE SELECT SCREEN ───────────────────────────────────── */
#screen-mode .screen-inner {
  padding-top: max(16px, env(safe-area-inset-top));
}

.mode-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 32px;
}

.mode-title {
  font-size: 26px;
  font-weight: 900;
  font-family: 'Poppins', 'Inter', sans-serif;
  line-height: 1.25;
  letter-spacing: -0.5px;
}

.mode-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.mode-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 20px 16px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  text-align: left;
  min-height: 140px;
  transition: border-color 150ms, background 150ms;
}
.mode-card:active {
  background: var(--surface-raised);
  border-color: var(--accent);
}

.mode-card-ai {
  border-color: var(--border);
  background: var(--surface);
}
.mode-card-ai .mode-card-icon { color: var(--accent); }

.mode-card-icon {
  font-size: 24px;
  margin-bottom: 4px;
}
.mode-card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}
.mode-card-desc {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 400;
}
.mode-card-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--surface-raised);
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 600;
  padding: 3px 7px;
  border-radius: 20px;
  border: 1px solid var(--border);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ── 7. CATEGORY SCREEN ──────────────────────────────────────── */
#screen-category .screen-inner {
  padding-top: max(16px, env(safe-area-inset-top));
}

.breadcrumb {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list-view {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0 16px;
}

.list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 60px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 10px;
  text-align: left;
  transition: border-color 150ms, background 150ms;
}
.list-item:active {
  background: var(--surface-raised);
  border-color: var(--accent);
}

.list-item-label {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-primary);
  flex: 1;
}

.list-item-meta {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.list-item-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex-shrink: 0;
  margin-left: 12px;
}

.list-item-chevron {
  font-size: 16px;
  color: var(--text-secondary);
}

.list-item-my-content {
  font-size: 10px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-dim);
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.leaf-start-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  flex-shrink: 0;
  transition: opacity 150ms;
}
.leaf-start-btn:active { opacity: 0.85; }

/* ── 8. EXAM SCREEN ──────────────────────────────────────────── */
#screen-exam {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.exam-top {
  flex-shrink: 0;
  background: var(--bg);
}

.progress-bar-track {
  height: 3px;
  background: var(--border);
  width: 100%;
}
.progress-bar-fill {
  height: 100%;
  background: var(--accent);
  width: 0%;
  transition: width 400ms ease;
}

.exam-controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px 8px;
  max-width: 520px;
  margin: 0 auto;
  width: 100%;
}

.btn-pause {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  width: 44px;
  min-height: 44px;
  font-size: 16px;
  color: var(--text-secondary);
  padding: 6px 4px;
  transition: border-color 150ms;
}
.btn-pause:active { border-color: var(--accent); }
.btn-pause.paused-out { opacity: 0.35; cursor: not-allowed; }

.pause-dots {
  display: flex;
  gap: 3px;
}
.pause-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}
.pause-dot.used {
  background: var(--border);
}

.exam-counter {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.3px;
}

/* ── 9. TIMER RING ───────────────────────────────────────────── */
.timer-wrap {
  position: relative;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.timer-ring {
  width: 48px;
  height: 48px;
  position: absolute;
  inset: 0;
}

.timer-bg {
  fill: none;
  stroke: var(--border);
  stroke-width: 4;
}

.timer-progress-ring {
  fill: none;
  stroke: var(--accent);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 138.23;
  stroke-dashoffset: 0;
  transform: rotate(-90deg);
  transform-origin: 28px 28px;
  transition: stroke-dashoffset 1s linear, stroke 0.4s ease;
}

.timer-number {
  position: relative;
  z-index: 1;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

/* ── 10. EXAM SCROLL (Question) ──────────────────────────────── */
.exam-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px 20px 8px;
  max-width: 520px;
  margin: 0 auto;
  width: 100%;
}

.question-image {
  margin-bottom: 14px;
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: zoom-in;
  border: 1.5px solid var(--border);
}
.question-image img {
  width: 100%;
  height: auto;
  max-height: 200px;
  object-fit: cover;
  display: block;
}

.question-text {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.55;
  color: var(--text-primary);
}
.question-text p { margin-bottom: 10px; }
.question-text p:last-child { margin-bottom: 0; }
.question-text strong { color: var(--text-primary); font-weight: 700; }
.question-text em { color: var(--text-secondary); font-style: italic; }

/* ── 11. EXAM BOTTOM (Sticky) ────────────────────────────────── */
.exam-bottom {
  flex-shrink: 0;
  padding: 8px 16px max(16px, env(safe-area-inset-bottom));
  background: var(--bg);
  border-top: 1px solid var(--border);
  max-width: 520px;
  margin: 0 auto;
  width: 100%;
}

.options-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 6px;
}

.option-card {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 52px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  text-align: left;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
  transition: background 120ms, border-color 120ms, transform 80ms;
  gap: 12px;
}
.option-card:not(:disabled):active {
  background: var(--surface-raised);
  border-color: var(--accent);
  transform: scale(0.99);
}
.option-card:disabled { cursor: default; }

.option-prefix {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  min-width: 20px;
  flex-shrink: 0;
  letter-spacing: 0.3px;
}
.option-text { flex: 1; line-height: 1.4; }
.option-result-icon { font-size: 14px; flex-shrink: 0; }

.option-card.correct {
  background: var(--success-dim);
  border-color: var(--success);
}
.option-card.correct .option-prefix { color: var(--success); }

.option-card.wrong {
  background: var(--failure-dim);
  border-color: var(--failure);
}
.option-card.wrong .option-prefix { color: var(--failure); }

/* Feedback panel */
.feedback-panel {
  padding: 12px 4px 8px;
  animation: slideUp 220ms ease-out;
}

.feedback-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.feedback-icon {
  font-size: 22px;
  line-height: 1;
}

.feedback-correct-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--success);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.feedback-reason {
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.feedback-next {
  margin-top: 4px;
}

/* Exam extras row */
.exam-extras {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 0 0;
}
.exam-extras-left { display: flex; gap: 8px; }

.btn-tip {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  transition: border-color 150ms, color 150ms;
}
.btn-tip:active, .btn-tip.active {
  border-color: var(--warning);
  color: var(--warning);
}

.btn-stop {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  background: var(--failure);
  color: #fff;
  transition: opacity 150ms;
}
.btn-stop:active { opacity: 0.85; }

.tip-content {
  background: var(--warning-dim);
  border: 1.5px solid var(--warning);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.5;
  margin-top: 6px;
  animation: slideUp 180ms ease-out;
}

/* Star animation layer */
.star-layer {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 64px;
  z-index: 50;
  pointer-events: none;
  animation: starPop 700ms ease forwards;
}
.star-layer.star-layer-multi {
  font-size: 40px;
  letter-spacing: 4px;
  animation: starMultiPop 900ms ease forwards;
}
.star-layer.hidden { display: none; }

@keyframes starPop {
  0%   { transform: translate(-50%, -50%) scale(0) rotate(-20deg); opacity: 0; }
  55%  { transform: translate(-50%, -50%) scale(1.3) rotate(8deg);  opacity: 1; }
  80%  { transform: translate(-50%, -50%) scale(1.0) rotate(0deg);  opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1.0) rotate(0deg);  opacity: 0; }
}

@keyframes starMultiPop {
  0%   { transform: translate(-50%, -50%) scale(0) rotate(-10deg); opacity: 0; }
  40%  { transform: translate(-50%, -60%) scale(1.4) rotate(5deg);  opacity: 1; }
  70%  { transform: translate(-50%, -50%) scale(1.1) rotate(-3deg); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1.0) rotate(0deg);  opacity: 0; }
}

@keyframes failureFlash {
  0%   { background: var(--bg); }
  25%  { background: rgba(232, 93, 93, 0.08); }
  100% { background: var(--bg); }
}

.exam-flash {
  animation: failureFlash 350ms ease forwards;
}

/* ── 12. RESULTS SCREEN ──────────────────────────────────────── */
.results-inner {
  overflow-y: auto;
  padding-top: 12px;
  align-items: center;
  text-align: center;
  gap: 0;
}

#screen-results {
  display: flex;
  flex-direction: column;
}

.results-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.results-score-block {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
  margin-bottom: 6px;
}

.results-big-number {
  font-size: 72px;
  font-weight: 900;
  color: var(--text-primary);
  line-height: 1;
  letter-spacing: -3px;
}

.results-denom {
  font-size: 28px;
  font-weight: 500;
  color: var(--text-secondary);
}

.results-accuracy-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 24px;
}

.results-accuracy-num {
  font-size: 32px;
  font-weight: 700;
  color: var(--accent);
}

.results-accuracy-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.results-stats-card {
  width: 100%;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 4px 16px;
  margin-bottom: 16px;
}

.stat-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
}

.stat-icon {
  font-size: 14px;
  width: 20px;
  text-align: center;
  color: var(--text-secondary);
}

.success-icon { color: var(--success); }
.failure-icon { color: var(--failure); }

.stat-label {
  font-size: 14px;
  color: var(--text-secondary);
  flex: 1;
  text-align: left;
}

.stat-value {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.stat-divider {
  height: 1px;
  background: var(--border);
}

.results-breakdown {
  width: 100%;
  margin-bottom: 16px;
}

.breakdown-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.breakdown-row:last-child { border-bottom: none; }
.breakdown-name {
  color: var(--text-secondary);
  flex: 1;
  text-align: left;
}
.breakdown-pct {
  font-weight: 600;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.results-verdict {
  font-size: 14px;
  font-style: italic;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 20px;
  padding: 0 8px;
}

.results-actions {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.results-footer-links {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 8px;
}

.footer-divider {
  color: var(--border);
  font-size: 16px;
}

/* ── 13. LEARN FROM MISTAKES ─────────────────────────────────── */
#screen-mistakes .screen-inner {
  padding-top: max(16px, env(safe-area-inset-top));
  gap: 12px;
}

.mistakes-counter {
  font-size: 13px;
  color: var(--text-secondary);
  padding: 0 4px;
}

.mistakes-card {
  flex: 1;
  overflow-y: auto;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.mistake-question {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.5;
  margin-bottom: 16px;
}

.mistake-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
}

.mistake-row-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
}

.mistake-answer-wrong {
  font-size: 14px;
  font-weight: 500;
  color: var(--failure);
  background: var(--failure-dim);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
}

.mistake-answer-correct {
  font-size: 14px;
  font-weight: 500;
  color: var(--success);
  background: var(--success-dim);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
}

.mistake-reason {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  padding: 10px 12px;
  background: var(--surface-raised);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--accent);
}

.mistakes-nav {
  display: flex;
  justify-content: space-between;
  padding: 0 4px;
}

/* ── 14. MY PROGRESS ─────────────────────────────────────────── */
#screen-progress .screen-inner {
  padding-top: max(16px, env(safe-area-inset-top));
}

.progress-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 8px 0;
}

.progress-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}

.progress-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.progress-date {
  font-size: 12px;
  color: var(--text-secondary);
}

.progress-mode-tag {
  font-size: 10px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-dim);
  padding: 2px 7px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.progress-mode-tag.mode-ai {
  color: var(--warning);
  background: rgba(245,166,35,0.12);
}

.progress-topic {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.progress-stats {
  font-size: 13px;
  color: var(--text-secondary);
  display: flex;
  gap: 16px;
}

.progress-note {
  font-size: 12px;
  color: var(--text-secondary);
  text-align: center;
  padding: 12px 0 4px;
  flex-shrink: 0;
}

.progress-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--text-secondary);
  font-size: 14px;
  text-align: center;
}

/* ── 15. PAUSE OVERLAY ───────────────────────────────────────── */
.overlay-pause {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 200ms;
}

.pause-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 32px 24px;
  max-width: 300px;
  text-align: center;
}

.pause-icon-wrap {
  font-size: 40px;
  margin-bottom: 4px;
}

.pause-title {
  font-size: 28px;
  font-weight: 900;
}

.pause-count-text {
  font-size: 13px;
  color: var(--text-secondary);
}

/* ── 16. IMAGE ZOOM OVERLAY ──────────────────────────────────── */
.overlay-zoom {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  animation: fadeIn 180ms ease;
}

.overlay-zoom img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: var(--radius-md);
}

.zoom-close {
  position: absolute;
  top: max(16px, env(safe-area-inset-top));
  right: 20px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.1);
  border-radius: 50%;
  font-size: 22px;
  color: #fff;
  z-index: 1;
}

/* ── 17. MODALS ──────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 250;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(24px, env(safe-area-inset-top)) 20px max(28px, env(safe-area-inset-bottom));
  overflow-y: auto;
  animation: fadeIn 150ms ease;
}

.modal {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 24px 20px;
  width: 100%;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow-md);
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-body {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.modal-input {
  width: 100%;
  min-height: 48px;
  padding: 0 16px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 16px;
  outline: none;
  transition: border-color 200ms;
}
.modal-input:focus { border-color: var(--accent); }

.modal-error {
  font-size: 13px;
  color: var(--failure);
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}
.modal-actions .btn-ghost {
  flex: 1;
  min-height: 48px;
  background: var(--surface-raised);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
}

/* ── 18. BOTTOM SHEET ────────────────────────────────────────── */
.backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 90;
  animation: fadeIn 180ms ease;
}

.bottom-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--surface);
  border-top: 1.5px solid var(--border);
  border-radius: 20px 20px 0 0;
  z-index: 100;
  padding: 12px 20px max(24px, env(safe-area-inset-bottom));
  max-width: 520px;
  margin: 0 auto;
  animation: slideUp 250ms ease-out;
  max-height: calc(100vh - 64px);
  overflow-y: auto;
}

.sheet-handle {
  width: 40px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: 0 auto 16px;
}

.sheet-section {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.sheet-section:last-of-type { border-bottom: none; }

.sheet-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.7px;
  margin-bottom: 10px;
}

.display-mode-group {
  display: flex;
  gap: 8px;
}

.display-mode-btn {
  flex: 1;
  min-height: 40px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all 150ms;
}
.display-mode-btn.active {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
}
.display-mode-btn:active { opacity: 0.75; }

.sheet-about-text {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.sheet-close-btn {
  width: 100%;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-raised);
  border-radius: var(--radius-md);
  margin-top: 12px;
  font-size: 15px;
  font-weight: 500;
}

.social-link-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 15px;
  color: var(--text-primary);
  text-decoration: none;
  width: 100%;
}
.social-link-item:last-child { border-bottom: none; }
.social-link-arrow { color: var(--text-secondary); }

/* ── 19. TOAST ───────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: max(80px, calc(env(safe-area-inset-bottom) + 70px));
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface-raised);
  border: 1.5px solid var(--border);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
  padding: 12px 20px;
  border-radius: 100px;
  white-space: nowrap;
  z-index: 400;
  box-shadow: var(--shadow-md);
  animation: toastIn 250ms ease;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(10px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ── 20. UTILITIES & ANIMATIONS ──────────────────────────────── */
.hidden { display: none !important; }

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

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

/* Scrollbar styling */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* Markdown rendered content in questions */
.question-text ul, .question-text ol {
  padding-left: 20px;
  margin: 8px 0;
}
.question-text li { margin-bottom: 4px; }
.question-text code {
  background: var(--surface-raised);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 14px;
}

/* ── 21. GO AI SCREENS ───────────────────────────────────────── */

/* AI Setup */
.ai-setup-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 20px 0 32px;
  text-align: center;
}
.ai-setup-icon {
  font-size: 56px;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 4px;
}
.ai-setup-title {
  font-size: 28px;
  font-weight: 900;
  font-family: 'Poppins', 'Inter', sans-serif;
  color: var(--text-primary);
  margin: 0;
}
.ai-setup-desc {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 320px;
  margin: 0;
}
.ai-key-link {
  font-size: 14px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}
.ai-key-link:hover { text-decoration: underline; }
.ai-key-error {
  font-size: 13px;
  color: var(--failure);
  margin: -6px 0 0;
}
.ai-setup-note {
  font-size: 12px;
  color: var(--text-secondary);
  opacity: 0.7;
  margin: 0;
}
.ai-setup-body .input-group { width: 100%; }
.ai-setup-body .btn-primary  { width: 100%; }

/* AI Home */
.ai-home-body {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 8px 0 32px;
}
.ai-home-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ai-brand-icon {
  font-size: 28px;
  color: var(--accent);
}
.ai-brand-label {
  font-size: 26px;
  font-weight: 900;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}
.ai-home-prompt {
  font-size: 16px;
  color: var(--text-secondary);
  margin: -8px 0 0;
}
.ai-topic-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: -8px;
}
.ai-chip {
  padding: 7px 14px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: border-color 120ms, color 120ms, background 120ms;
}
.ai-chip:hover, .ai-chip.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}
.ai-mode-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.ai-mode-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 24px 12px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: border-color 120ms, background 120ms, transform 80ms;
  text-align: center;
}
.ai-mode-card:hover { border-color: var(--accent); background: var(--accent-dim); }
.ai-mode-card:active { transform: scale(0.98); }
.ai-mode-icon  { font-size: 28px; }
.ai-mode-title { font-size: 16px; font-weight: 700; color: var(--text-primary); }
.ai-mode-desc  { font-size: 12px; color: var(--text-secondary); }

/* Teach Me screen */
#screen-teach {
  display: flex;
  flex-direction: column;
}
.teach-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px 12px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border);
}
.teach-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  -webkit-overflow-scrolling: touch;
}
.teach-content h1, .teach-content h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 20px 0 8px;
}
.teach-content h2:first-child { margin-top: 0; }
.teach-content p  { font-size: 15px; line-height: 1.7; color: var(--text-secondary); margin: 0 0 12px; }
.teach-content ul, .teach-content ol { padding-left: 20px; margin: 0 0 12px; }
.teach-content li { font-size: 15px; line-height: 1.7; color: var(--text-secondary); margin-bottom: 4px; }
.teach-content strong { color: var(--text-primary); font-weight: 600; }
.teach-footer {
  flex-shrink: 0;
  padding: 14px 20px calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
}
.teach-footer .btn-primary { width: 100%; }

/* AI Loading Overlay */
.overlay-ai-loading {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.ai-loading-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.ai-loading-spinner {
  width: 44px;
  height: 44px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: aiSpin 0.8s linear infinite;
}
@keyframes aiSpin {
  to { transform: rotate(360deg); }
}
.ai-loading-text {
  font-size: 15px;
  color: var(--text-secondary);
  font-weight: 500;
}

/* ── 22. CONTRIBUTOR SCREEN ──────────────────────────────────── */
.contributor-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 12px 0;
}
.contributor-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}
.upload-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 20px;
  cursor: pointer;
  transition: border-color 150ms, background 150ms;
  text-align: center;
}
.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--accent);
  background: rgba(74,127,247,0.08);
}
.upload-zone-icon { font-size: 32px; }
.upload-zone-label { font-size: 15px; font-weight: 600; color: var(--text-primary); }
.upload-zone-sub   { font-size: 12px; color: var(--text-secondary); }
.contributor-status {
  font-size: 14px;
  padding: 10px 14px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
}
.contributor-current {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
}
.contributor-current-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.contributor-current-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--success);
}
.contributor-note {
  font-size: 13px;
  color: var(--text-secondary);
  padding: 12px 14px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--accent);
  line-height: 1.5;
}

/* ── 22. SHARED SHEET / LOGO STYLES ──────────────────────────── */
.sheet-admin-row { padding: 8px 0; border-top: 1px solid var(--border); }
.sheet-admin-link {
  font-size: 14px;
  color: var(--text-secondary);
  text-decoration: none;
  display: block;
  padding: 8px 0;
  transition: color 150ms;
}
.sheet-admin-link:hover { color: var(--accent); }
.app-logo {
  max-height: 48px;
  max-width: 200px;
  object-fit: contain;
  display: inline-block;
}

/* ── 24. SHARE CARD MODAL ────────────────────────────────────── */
.share-modal { padding: 20px; }

.share-card {
  background: var(--surface);
  border: 1.5px solid var(--accent);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 18px;
  text-align: center;
}
.share-card-header {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 14px;
}
.share-card-appname {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.share-card-topic {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}
.share-card-score {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 2px;
  margin-bottom: 16px;
}
.share-card-num {
  font-size: 64px;
  font-weight: 900;
  color: var(--text-primary);
  line-height: 1;
}
.share-card-denom {
  font-size: 24px;
  font-weight: 600;
  color: var(--text-secondary);
}
.share-card-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 14px;
}
.share-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  flex: 1;
}
.share-stat-val {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}
.share-stat-label {
  font-size: 11px;
  color: var(--text-secondary);
}
.share-stat-divider {
  width: 1px;
  height: 28px;
  background: var(--border);
  flex-shrink: 0;
}
.share-card-verdict {
  font-size: 13px;
  font-style: italic;
  color: var(--text-secondary);
  margin: 0;
}

/* ── 25. QR CODE MODAL ───────────────────────────────────────── */
.qr-modal { text-align: center; }
.qr-wrap {
  display: flex;
  justify-content: center;
  margin: 16px 0 12px;
}
.qr-image {
  width: 180px;
  height: 180px;
  border-radius: 12px;
  background: #fff;
  padding: 8px;
}
.qr-url-text {
  font-size: 11px;
  color: var(--text-secondary);
  word-break: break-all;
  margin: 0 0 16px;
  opacity: 0.7;
}

/* ── 26. WHATSAPP SHARE ──────────────────────────────────────── */
.btn-notify-admin {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 8px;
  padding: 11px 16px;
  font-size: 14px;
  font-weight: 600;
  color: #25D366;
  background: rgba(37, 211, 102, 0.08);
  border: 1.5px solid rgba(37, 211, 102, 0.35);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 150ms, border-color 150ms;
}
.btn-notify-admin::before { content: '💬'; font-size: 16px; }
.btn-notify-admin:active {
  background: rgba(37, 211, 102, 0.15);
  border-color: #25D366;
}

/* ── 27. SHEET NAV BUTTONS ───────────────────────────────────── */
.sheet-nav-btn {
  display: block;
  width: 100%;
  text-align: left;
  padding: 12px 0;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
  background: none;
  border: none;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: color 150ms;
}
.sheet-nav-btn:last-child { border-bottom: none; }
.sheet-nav-btn:active { color: var(--accent); }

/* ── 28. QR SHARE ROW ────────────────────────────────────────── */
.qr-share-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 0 0 16px;
}
.qr-share-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 4px;
  background: var(--surface-raised);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 11px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: border-color 120ms, color 120ms;
}
.qr-share-btn:active { border-color: var(--accent); color: var(--accent); }
.qr-share-icon { font-size: 22px; }

/* ── 29. COLOURFUL MODE EXTRAS ───────────────────────────────── */
[data-theme="colourful"] .landing-brand h1 {
  background: linear-gradient(135deg, #FFD600, #FF6B9D, #C084FC);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
[data-theme="colourful"] .btn-primary {
  background: linear-gradient(135deg, #FFD600, #FF6B9D);
  color: #1A0533;
  font-weight: 700;
}
[data-theme="colourful"] .mode-card-ai {
  border-color: var(--accent);
  background: var(--accent-dim);
}

/* ── 30. CATEGORY ACCORDION ──────────────────────────────────── */
.cat-accordion { margin-bottom: 4px; }

.cat-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 14px 16px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  text-align: left;
  transition: border-color 120ms, background 120ms;
  gap: 8px;
}
.cat-hdr:active { background: var(--surface-raised); }
.cat1-hdr { border-radius: var(--radius-md); margin-bottom: 2px; }
.cat2-hdr {
  border-radius: var(--radius-sm);
  background: var(--bg);
  border-color: var(--border);
  padding: 12px 14px;
  margin-bottom: 2px;
}
.cat-hdr-left { flex: 1; min-width: 0; }
.cat-hdr-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.acc-chevron {
  font-size: 16px;
  color: var(--text-secondary);
  transition: transform 200ms ease;
  display: inline-block;
}

.cat-body {
  padding: 4px 0 4px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.cat2-wrap { display: flex; flex-direction: column; gap: 2px; }

.cat-leaf {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 11px 14px;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
  transition: border-color 120ms, background 120ms;
  gap: 8px;
}
.cat-leaf:active { border-color: var(--accent); background: var(--accent-dim); }

/* ── 31. RESULTS TOPBAR & BENTO GRID ─────────────────────────── */
.results-topbar {
  display: flex;
  align-items: center;
  padding: max(12px, env(safe-area-inset-top)) 20px 0;
  flex-shrink: 0;
  gap: 8px;
  max-width: 520px;
  margin: 0 auto;
  width: 100%;
}

.results-action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
  margin-bottom: 12px;
}

.results-footer-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.mistakes-badge:empty { display: none; }
.mistakes-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  background: var(--failure);
  color: #fff;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 700;
  margin-left: 4px;
  vertical-align: middle;
}

/* ── 32. NEW BUTTON VARIANTS ─────────────────────────────────── */
.btn-nu-home {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 900;
  font-family: 'Poppins', 'Inter', sans-serif;
  color: var(--accent);
  flex-shrink: 0;
  letter-spacing: -0.5px;
  transition: background 150ms;
}
.btn-nu-home:active { background: var(--surface-raised); }

.btn-hamburger {
  position: absolute;
  top: max(16px, env(safe-area-inset-top));
  right: 20px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 17px;
  color: var(--accent);
  z-index: 20;
  transition: background 150ms;
}
.btn-hamburger:active { background: var(--surface-raised); }

.btn-hamburger-inline {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 17px;
  color: var(--accent);
  flex-shrink: 0;
  margin-left: auto;
  transition: background 150ms;
}
.btn-hamburger-inline:active { background: var(--surface-raised); }

/* ── 33. DASHBOARD ───────────────────────────────────────────── */
.dashboard-wrap {
  height: 100%;
  display: flex;
  flex-direction: column;
  max-width: 520px;
  margin: 0 auto;
  width: 100%;
}

.dashboard-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: max(14px, env(safe-area-inset-top)) 20px 12px;
  flex-shrink: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.dashboard-toggle {
  flex: 1;
  display: flex;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.dash-tab {
  flex: 1;
  min-height: 45px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  background: none;
  border: none;
  cursor: pointer;
  transition: background 150ms, color 150ms;
}
.dash-tab.active {
  background: var(--accent);
  color: #fff;
}
.dash-tab:active { opacity: 0.8; }

.dash-panel {
  flex: 1;
  overflow-y: auto;
  padding: 12px 20px max(20px, env(safe-area-inset-bottom));
  -webkit-overflow-scrolling: touch;
}

.goai-activate-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 40px 0 32px;
  text-align: center;
}

/* ── 34. RESULTS REDESIGN ────────────────────────────────────── */
.results-score-line {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

.results-score-text {
  font-size: 34px;
  font-weight: 900;
  font-family: 'Poppins', 'Inter', sans-serif;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  letter-spacing: -1px;
  line-height: 1.15;
  text-align: center;
}

.results-quad-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
  margin-bottom: 16px;
}

.btn-result-action {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-md);
  background: var(--accent);
  color: #fff;
  transition: opacity 150ms, transform 100ms;
  text-align: center;
}
.btn-result-action:active { opacity: 0.85; transform: scale(0.98); }
.btn-result-action:disabled { opacity: 0.32; cursor: default; transform: none; }

.btn-result-secondary {
  background: var(--surface);
  color: var(--text-primary);
  border: 1.5px solid var(--border);
}
.btn-result-secondary:active { background: var(--surface-raised); }

.btn-result-wa {
  background: rgba(37, 211, 102, 0.1);
  color: #25D366;
  border: 1.5px solid rgba(37, 211, 102, 0.3);
}
.btn-result-wa:active { background: rgba(37, 211, 102, 0.2); }

/* ── 35. MENU SHEET UPDATES ──────────────────────────────────── */
/* NOTE: do NOT add position:relative here — it overrides position:fixed from section 18 */

.sheet-x-btn {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-raised);
  border-radius: 50%;
  font-size: 15px;
  color: var(--text-secondary);
  transition: color 150ms;
}
.sheet-x-btn:active { color: var(--text-primary); }

.sheet-contact-btns {
  display: flex;
  gap: 8px;
}

.btn-contact-sheet {
  flex: 1;
  min-height: 40px;
  padding: 0 10px;
  background: var(--surface-raised);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  transition: border-color 150ms, color 150ms;
}
.btn-contact-sheet:active { border-color: var(--accent); color: var(--accent); }

.sheet-about-clamped {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.sheet-about-expanded {
  display: block;
  overflow: visible;
  -webkit-line-clamp: unset;
}

.btn-share-friends {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  background: var(--accent-dim);
  border: 1.5px solid var(--accent);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  transition: background 150ms;
}
.btn-share-friends:active { background: var(--accent); color: #fff; }

.btn-sheet-close-bottom {
  width: 100%;
  min-height: 44px;
  background: var(--surface-raised);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: border-color 150ms, color 150ms;
}
.btn-sheet-close-bottom:active { border-color: var(--accent); color: var(--accent); }

.sheet-admin-footer {
  padding: 12px 0 4px;
  text-align: center;
  border-top: 1px solid var(--border);
}
.sheet-admin-footer-link {
  font-size: 12px;
  color: var(--text-secondary);
  text-decoration: none;
  opacity: 0.55;
  transition: opacity 150ms;
}
.sheet-admin-footer-link:hover { opacity: 1; color: var(--accent); }

/* ── 36. ANNOUNCEMENT BANNER ─────────────────────────────────── */
.announcement-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: var(--accent);
  color: #fff;
  padding: 10px 44px 10px 16px;
  z-index: 500;
  font-size: 13px;
  font-weight: 500;
  text-align: center;
}
.announcement-text { line-height: 1.4; }
.announcement-dismiss {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  font-size: 20px;
  color: #fff;
  opacity: 0.8;
  background: none;
}
.announcement-dismiss:active { opacity: 1; }

/* ── 37. DANGER SMALL BUTTON ─────────────────────────────────── */
.btn-danger-sm {
  font-size: 12px;
  font-weight: 600;
  color: var(--failure);
  background: var(--failure-dim);
  border: 1px solid var(--failure);
  border-radius: var(--radius-sm);
  padding: 5px 10px;
  cursor: pointer;
  transition: opacity 150ms;
}
.btn-danger-sm:active { opacity: 0.75; }

/* ══════════════════════════════════════════════════════════════
   38. PERSISTENT APP HEADER
══════════════════════════════════════════════════════════════ */
.app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  display: flex;
  align-items: center;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  z-index: 300;
}
.app-header.hidden { display: none; }

.app-header-inner {
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  padding: 0 8px 0 4px;
  gap: 4px;
  height: 100%;
}

.header-logo-btn {
  font-family: 'Poppins', sans-serif;
  font-weight: 900;
  font-size: 15px;
  color: var(--accent);
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 10px;
  white-space: nowrap;
  letter-spacing: -0.3px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  transition: background 150ms;
}
.header-logo-btn:active { background: var(--accent-dim); }

.header-username-btn {
  flex: 1;
  min-width: 0;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  background: none;
  border: none;
  cursor: pointer;
  text-align: center;
  padding: 6px 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border-radius: var(--radius-sm);
  transition: color 150ms, background 150ms;
}
.header-username-btn:active { background: var(--surface-raised); color: var(--text-primary); }

.header-menu-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-raised);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 16px;
  color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 150ms;
}
.header-menu-btn:active { background: var(--border); }

/* screens that live below the fixed header */
#screen-dashboard,
#screen-exam,
#screen-results,
#screen-mistakes,
#screen-ai-setup,
#screen-teach,
#screen-contributor,
#screen-progress {
  padding-top: 56px;
}

/* ══════════════════════════════════════════════════════════════
   39. DASHBOARD — SUBNAV + STICKY SCROLL
══════════════════════════════════════════════════════════════ */
.dashboard-wrap {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.dash-subnav {
  flex-shrink: 0;
  display: flex;
  background: var(--bg);
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
}

.dash-tab-group {
  display: flex;
  flex: 1;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  padding: 3px;
  gap: 3px;
}

.dash-tab {
  flex: 1;
  min-height: 45px;
  padding: 0 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  background: none;
  border: none;
  border-radius: calc(var(--radius-md) - 3px);
  cursor: pointer;
  transition: background 150ms, color 150ms;
}
.dash-tab.active {
  background: var(--accent);
  color: #fff;
}

/* scroll containers — fill remaining height */
.cat-scroll-container,
.goai-scroll-container {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 8px 16px 24px;
}

/* sticky category headers within scroll container */
.cat1-hdr {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg);
}
.cat2-hdr {
  position: sticky;
  top: 64px; /* cat1 header height */
  z-index: 19;
  background: var(--surface);
}

/* last played badge on cat3 leaf */
.last-played-tag {
  font-size: 10px;
  color: var(--text-secondary);
  font-weight: 400;
  margin-left: 4px;
  opacity: 0.75;
}

/* ══════════════════════════════════════════════════════════════
   40. EXAM — TIMER ROW + PAUSE PILL
══════════════════════════════════════════════════════════════ */
/* hide old exam-controls-row if present */
.exam-controls-row { display: none !important; }

.exam-timer-row {
  display: flex;
  justify-content: flex-end;
  padding: 6px 16px 0;
}

/* Pause + counter combined pill */
.btn-pause-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 20px;
  cursor: pointer;
  transition: border-color 150ms, background 150ms;
}
.btn-pause-pill:active { border-color: var(--accent); background: var(--surface-raised); }
.btn-pause-pill.paused-out { opacity: 0.35; cursor: not-allowed; }

.pause-pill-icon {
  font-size: 14px;
  color: var(--accent);
  line-height: 1;
}
.pause-pill-counter {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  font-family: 'Poppins', sans-serif;
  letter-spacing: 0.3px;
}

/* exam-extras: evenly spaced row */
.exam-extras {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 16px 0;
}

/* ══════════════════════════════════════════════════════════════
   41. RESULTS — NEUTRAL BUTTONS + SCORE SPACING
══════════════════════════════════════════════════════════════ */
/* override all result buttons to be uniform neutral */
.btn-result-action {
  background: var(--surface) !important;
  color: var(--text-primary) !important;
  border: 1.5px solid var(--border) !important;
  font-weight: 500 !important;
}
.btn-result-action:active { background: var(--surface-raised) !important; opacity: 1 !important; }
.btn-result-secondary, .btn-result-wa { background: var(--surface) !important; color: var(--text-primary) !important; border: 1.5px solid var(--border) !important; }

/* Retry + Switch Topic get accent border */
.btn-result-primary-border {
  border-color: var(--accent) !important;
  color: var(--accent) !important;
}
.btn-result-primary-border:active { background: var(--accent-dim) !important; }

/* score text spacing */
.results-score-text {
  letter-spacing: 0.04em;
  padding: 0 8px;
}
.results-score-line {
  padding: 8px 0 16px;
}

/* stats stagger animation */
.stat-row-anim {
  animation: statFadeIn 300ms ease both;
  animation-delay: calc(var(--row-i) * 150ms + 200ms);
  opacity: 0;
}
@keyframes statFadeIn {
  from { opacity: 0; transform: translateX(-8px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ══════════════════════════════════════════════════════════════
   42. LANDING — CENTER-ALIGNED INPUT
══════════════════════════════════════════════════════════════ */
#input-name {
  text-align: center;
}

/* ══════════════════════════════════════════════════════════════
   43. IMAGE AUTO-SCALING
══════════════════════════════════════════════════════════════ */
.question-image img,
.mistakes-card img {
  width: 100%;
  height: auto;
  object-fit: contain;
  border-radius: var(--radius-sm);
  display: block;
}

/* ══════════════════════════════════════════════════════════════
   44. GO AI SETUP STEPS IN ACTIVATE PANEL
══════════════════════════════════════════════════════════════ */
.goai-setup-steps {
  width: 100%;
  max-width: 320px;
  margin: 12px auto 4px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
}
.goai-step {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.goai-step-num {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent-dim);
  border: 1.5px solid var(--accent);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}
.goai-step-text {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}
.goai-step-link {
  color: var(--accent);
  text-decoration: none;
  margin-left: 4px;
}

/* ══════════════════════════════════════════════════════════════
   45. SHARE WITH FRIENDS MODAL
══════════════════════════════════════════════════════════════ */
.share-friends-modal {
  max-width: 320px;
  text-align: center;
}

.share-friends-qr {
  display: flex;
  justify-content: center;
  margin: 16px 0 8px;
}
.share-friends-qr-img {
  width: 140px;
  height: 140px;
  border-radius: var(--radius-sm);
  border: 3px solid var(--border);
  background: #fff;
}

.share-friends-url {
  font-size: 11px;
  color: var(--text-secondary);
  word-break: break-all;
  margin-bottom: 16px;
}

.share-friends-platforms {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}
.sf-platform-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--surface);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  transition: background 150ms, border-color 150ms;
}
.sf-platform-icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
  font-style: normal;
  font-weight: 900;
}
.sf-wa { border-color: rgba(37,211,102,0.3); }
.sf-wa:active { background: rgba(37,211,102,0.12); }
.sf-fb { border-color: rgba(66,103,178,0.4); }
.sf-fb:active { background: rgba(66,103,178,0.12); }
.sf-fb .sf-platform-icon { color: #4267B2; font-family: 'Poppins', sans-serif; }
.sf-tg { border-color: rgba(0,136,204,0.4); }
.sf-tg:active { background: rgba(0,136,204,0.12); }
.sf-em:active { background: var(--surface-raised); }

/* ══════════════════════════════════════════════════════════════
   46. MENU SCHOOL SONG
══════════════════════════════════════════════════════════════ */
.sheet-song-wrap {
  padding: 16px 16px 8px;
  display: flex;
  justify-content: center;
}
.sheet-song-pill {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  border: 2px solid var(--accent);
  border-radius: 24px;
  overflow: hidden;
}
.menu-song-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  background: none;
  border: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
  transition: background 150ms;
}
.menu-song-btn:active { background: var(--accent-dim); }
.menu-song-icon { font-size: 14px; }
.menu-song-download {
  padding: 9px 12px;
  font-size: 14px;
  color: var(--accent);
  text-decoration: none;
  background: none;
  border-left: 1px solid var(--accent);
  display: flex;
  align-items: center;
  transition: background 150ms;
}
.menu-song-download:active { background: var(--accent-dim); }

/* ══════════════════════════════════════════════════════════════
   47. ANSWER FEEDBACK ANIMATIONS
══════════════════════════════════════════════════════════════ */
@keyframes correctOptionFlash {
  0%   { box-shadow: 0 0 0 3px var(--success), 0 0 20px rgba(76,175,125,0.4); }
  100% { box-shadow: none; }
}
.option-card.correct {
  animation: correctOptionFlash 700ms ease forwards;
}

@keyframes examShake {
  0%,100% { transform: translateX(0); }
  20%,60%  { transform: translateX(-5px); }
  40%,80%  { transform: translateX(5px); }
}
.exam-flash {
  animation: examShake 400ms ease !important;
}

/* ══════════════════════════════════════════════════════════════
   48. CONFETTI
══════════════════════════════════════════════════════════════ */
.confetti-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
  overflow: hidden;
}
.confetti-piece {
  position: absolute;
  top: -12px;
  width: 8px;
  height: 10px;
  border-radius: 2px;
  animation: confettiFall linear forwards;
}
@keyframes confettiFall {
  0%   { transform: translateY(0) rotate(0deg) scale(1);   opacity: 1; }
  80%  { opacity: 1; }
  100% { transform: translateY(105vh) rotate(600deg) scale(0.7); opacity: 0; }
}

/* ══════════════════════════════════════════════════════════════
   49. SWIPE-TO-DISMISS MENU TRANSITION
══════════════════════════════════════════════════════════════ */
.bottom-sheet {
  transition: transform 300ms cubic-bezier(0.32,0.72,0,1);
}
.bottom-sheet.sheet-dragging {
  transition: none;
}


/* ══════════════════════════════════════════════════════════════
   50. AI MODE CARDS — 3-COLUMN GRID
══════════════════════════════════════════════════════════════ */
.ai-mode-cards {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}
.ai-mode-card {
  padding: 18px 8px;
}

/* ══════════════════════════════════════════════════════════════
   51. MODE PICKER MODAL
══════════════════════════════════════════════════════════════ */
.mode-picker-modal {
  text-align: center;
  padding: 24px 20px 16px;
  gap: 0;
}
.mode-picker-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 16px;
}
.mode-picker-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  margin-bottom: 12px;
}
.mode-picker-option {
  width: 100%;
  min-height: 48px;
  padding: 12px 16px;
  background: var(--surface-raised);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  text-align: center;
  cursor: pointer;
  transition: background 120ms, border-color 120ms, color 120ms;
}
.mode-picker-option:hover  { border-color: var(--accent); background: var(--accent-dim); color: var(--accent); }
.mode-picker-option:active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ══════════════════════════════════════════════════════════════
   52. TELL ME CHAT SCREEN
══════════════════════════════════════════════════════════════ */
#screen-tell {
  padding-top: 56px;
}
.tell-wrap {
  height: 100%;
  display: flex;
  flex-direction: column;
  max-width: 520px;
  margin: 0 auto;
  width: 100%;
}
.tell-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.tell-chat {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px 16px 8px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.tell-msg {
  display: flex;
  flex-direction: column;
  max-width: 92%;
}
.tell-msg-ai   { align-self: flex-start; }
.tell-msg-user { align-self: flex-end; }

.tell-msg-bubble {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 14px;
  line-height: 1.65;
}
.tell-msg-ai .tell-msg-bubble {
  background: var(--surface);
  border: 1.5px solid var(--border);
  color: var(--text-primary);
}
.tell-msg-ai .tell-msg-bubble h1,
.tell-msg-ai .tell-msg-bubble h2,
.tell-msg-ai .tell-msg-bubble h3 {
  font-size: 15px;
  font-weight: 700;
  margin: 10px 0 4px;
  color: var(--text-primary);
}
.tell-msg-ai .tell-msg-bubble h2:first-child,
.tell-msg-ai .tell-msg-bubble h3:first-child { margin-top: 0; }
.tell-msg-ai .tell-msg-bubble p   { margin-bottom: 8px; }
.tell-msg-ai .tell-msg-bubble p:last-child { margin-bottom: 0; }
.tell-msg-ai .tell-msg-bubble ul,
.tell-msg-ai .tell-msg-bubble ol  { padding-left: 18px; margin-bottom: 8px; }
.tell-msg-ai .tell-msg-bubble li  { margin-bottom: 3px; }
.tell-msg-ai .tell-msg-bubble strong { color: var(--text-primary); font-weight: 600; }

.tell-msg-user .tell-msg-bubble {
  background: var(--accent-dim);
  border: 1.5px solid var(--accent);
  color: var(--text-primary);
}

.tell-typing-bubble {
  color: var(--text-secondary);
  font-size: 18px;
  letter-spacing: 3px;
  padding: 10px 16px;
}

.tell-footer {
  flex-shrink: 0;
  padding: 8px 16px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  background: var(--bg);
}
.tell-hits-info {
  font-size: 12px;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 8px;
  min-height: 16px;
}
.tell-input-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.tell-input-row input {
  flex: 1;
  min-height: 44px;
  padding: 0 14px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 15px;
  color: var(--text-primary);
  outline: none;
  transition: border-color 200ms;
}
.tell-input-row input::placeholder { color: var(--text-secondary); }
.tell-input-row input:focus { border-color: var(--accent); }
.btn-tell-send {
  width: 44px;
  height: 44px;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-md);
  font-size: 20px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: opacity 150ms;
}
.btn-tell-send:active { opacity: 0.85; }
.btn-tell-send:disabled { opacity: 0.35; cursor: default; }

/* ══════════════════════════════════════════════════════════════
   53. MY ACCOUNT — LEVEL & LANGUAGE SELECTORS
══════════════════════════════════════════════════════════════ */
.sheet-account-selectors {
  margin-bottom: 4px;
}
.sheet-account-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.sheet-account-row:last-child { border-bottom: none; }
.sheet-account-label {
  font-size: 14px;
  color: var(--text-secondary);
}
.sheet-select {
  background: var(--surface-raised);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 13px;
  font-family: var(--font);
  padding: 6px 10px;
  cursor: pointer;
  outline: none;
  max-width: 160px;
  transition: border-color 150ms;
}
.sheet-select:focus { border-color: var(--accent); }

/* ══════════════════════════════════════════════════════════════
   54. RESULTS PAGE — MORE BREATHING ROOM
══════════════════════════════════════════════════════════════ */
.results-inner {
  gap: 0;
  padding-top: 28px;
  padding-bottom: max(28px, env(safe-area-inset-bottom));
}
.results-label    { margin-bottom: 12px; }
.results-score-line { padding: 4px 0 20px; }
.results-stats-card { margin-bottom: 24px; }
.results-verdict  { margin-bottom: 28px; margin-top: 4px; }
.results-breakdown { margin-bottom: 20px; }

/* ══════════════════════════════════════════════════════════════
   55. EXIT CONFIRMATION MODAL
══════════════════════════════════════════════════════════════ */
.exit-confirm-modal {
  max-width: 300px;
  text-align: center;
  padding: 28px 24px 20px;
}
.exit-confirm-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 8px;
}
.exit-confirm-body {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0 0 24px;
}
.exit-confirm-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.exit-confirm-actions .btn-primary { width: 100%; }
.exit-confirm-actions .btn-ghost   { width: 100%; }

/* ── Dashboard Search ────────────────────────────────────────── */
.dash-search-wrap { padding: 8px 16px 0; }
.dash-search-input {
  width: 100%;
  height: 40px;
  padding: 0 14px 0 36px;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23888' stroke-width='2' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E") no-repeat 12px center;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  font-size: 14px;
  font-family: var(--font);
  color: var(--text-primary);
  outline: none;
  transition: border-color 200ms;
}
.dash-search-input:focus { border-color: var(--accent); }
.dash-search-input::placeholder { color: var(--text-secondary); }

/* ── Menu nav buttons cleanup ────────────────────────────────── */
.sheet-nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  padding: 0 16px;
  background: var(--surface-raised);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  font-family: var(--font);
  cursor: pointer;
  transition: background 150ms;
}
.sheet-nav-btn:active { background: var(--border); }

/* ── Progress — Streak & Chart ───────────────────────────────── */
.progress-summary {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.progress-streak { display: flex; align-items: center; gap: 8px; }
.streak-flame  { font-size: 28px; }
.streak-count  { font-size: 32px; font-weight: 900; color: var(--accent); line-height: 1; }
.streak-label  { font-size: 13px; color: var(--text-secondary); }

.progress-chart-wrap { display: flex; flex-direction: column; gap: 6px; }
.chart-title { font-size: 11px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.06em; }

.progress-chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 60px;
}
.chart-bar-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 3px;
  height: 100%;
}
.chart-bar {
  width: 100%;
  min-height: 4px;
  background: var(--accent);
  border-radius: 3px 3px 0 0;
  opacity: 0.75;
}
.chart-label { font-size: 9px; color: var(--text-secondary); }
