/* ── GRE Master — Stylesheet ────────────────────────────────────────────── */
/* Design: clean academic, high contrast, mobile-first responsive */

:root {
  --brand:       #1a3a5c;
  --brand-mid:   #2563a8;
  --brand-light: #dbeafe;
  --accent:      #e05c1a;
  --accent-light:#fff3ed;
  --success:     #16a34a;
  --success-bg:  #dcfce7;
  --error:       #dc2626;
  --error-bg:    #fee2e2;
  --warn:        #ca8a04;
  --warn-bg:     #fef9c3;
  --neutral-50:  #f8fafc;
  --neutral-100: #f1f5f9;
  --neutral-200: #e2e8f0;
  --neutral-300: #cbd5e1;
  --neutral-400: #94a3b8;
  --neutral-500: #64748b;
  --neutral-600: #475569;
  --neutral-700: #334155;
  --neutral-800: #1e293b;
  --neutral-900: #0f172a;
  --radius:      10px;
  --radius-lg:   16px;
  --shadow-sm:   0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
  --shadow:      0 4px 12px rgba(0,0,0,.1), 0 2px 6px rgba(0,0,0,.06);
  --shadow-lg:   0 10px 30px rgba(0,0,0,.13), 0 4px 12px rgba(0,0,0,.08);
  --transition:  all .2s cubic-bezier(.4,0,.2,1);
  --font:        'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono:   'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--neutral-50);
  color: var(--neutral-800);
  line-height: 1.6;
  min-height: 100vh;
}
a { color: var(--brand-mid); text-decoration: none; }
a:hover { text-decoration: underline; }
button { cursor: pointer; font-family: var(--font); border: none; }
input, textarea, select { font-family: var(--font); }

/* ── Auth Layer ── */
#auth-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: linear-gradient(135deg, #0f172a 0%, #1a3a5c 60%, #2563a8 100%);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.auth-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 48px 40px;
  width: 100%; max-width: 420px;
  box-shadow: var(--shadow-lg);
  text-align: center;
}
.auth-logo { font-size: 2.2rem; font-weight: 800; color: var(--brand); letter-spacing: -1px; margin-bottom: 4px; }
.auth-logo span { color: var(--accent); }
.auth-tagline { font-size: .88rem; color: var(--neutral-500); margin-bottom: 36px; }
.auth-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 20px 0; color: var(--neutral-400); font-size: .82rem;
}
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--neutral-200);
}
.auth-input {
  width: 100%; padding: 11px 14px;
  border: 1.5px solid var(--neutral-200); border-radius: var(--radius);
  font-size: .92rem; margin-bottom: 12px;
  transition: var(--transition);
}
.auth-input:focus { outline: none; border-color: var(--brand-mid); box-shadow: 0 0 0 3px rgba(37,99,168,.12); }
.auth-error { color: var(--error); font-size: .82rem; margin-top: -6px; margin-bottom: 10px; text-align: left; display: none; }
.auth-switch { font-size: .85rem; color: var(--neutral-500); margin-top: 20px; }
.auth-switch a { color: var(--brand-mid); font-weight: 600; }

/* ── App Shell ── */
#app { display: none; flex-direction: column; min-height: 100vh; }
#app.visible { display: flex; }

/* ── Top Bar ── */
.topbar {
  background: var(--brand);
  color: #fff;
  padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between;
  height: 58px;
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
}
.topbar-logo { font-size: 1.3rem; font-weight: 800; letter-spacing: -.5px; }
.topbar-logo span { color: #f97316; }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.topbar-user { font-size: .82rem; opacity: .75; }
.topbar-signout {
  font-size: .78rem; padding: 5px 12px;
  background: rgba(255,255,255,.12); border-radius: 6px; color: #fff;
  transition: var(--transition);
}
.topbar-signout:hover { background: rgba(255,255,255,.22); }

/* ── Session Stats Bar ── */
.stats-bar {
  background: var(--brand-mid);
  color: #fff;
  padding: 8px 24px;
  display: flex; align-items: center; gap: 24px;
  font-size: .8rem; font-weight: 500; flex-wrap: wrap;
}
.stat-item { display: flex; align-items: center; gap: 6px; opacity: .92; }
.stat-value { font-weight: 700; font-size: .9rem; }
.stat-hard { color: #fca5a5; }
.stat-mastered { color: #86efac; }

/* ── Nav Tabs ── */
.nav-tabs {
  background: #fff;
  border-bottom: 2px solid var(--neutral-200);
  display: flex; overflow-x: auto;
  scrollbar-width: none; padding: 0 16px;
  position: sticky; top: 58px; z-index: 90;
  box-shadow: var(--shadow-sm);
}
.nav-tabs::-webkit-scrollbar { display: none; }
.nav-tab {
  padding: 14px 18px; font-size: .85rem; font-weight: 600;
  color: var(--neutral-500); white-space: nowrap;
  border-bottom: 3px solid transparent; margin-bottom: -2px;
  transition: var(--transition); background: none;
  display: flex; align-items: center; gap: 7px;
}
.nav-tab:hover { color: var(--brand-mid); }
.nav-tab.active { color: var(--brand); border-bottom-color: var(--brand); }
.nav-tab-icon { font-size: 1rem; }

/* ── Main Content Area ── */
.mode-view { display: none; padding: 28px 24px; max-width: 860px; margin: 0 auto; width: 100%; }
.mode-view.active { display: block; }

/* ── Shared Section Header ── */
.section-header { margin-bottom: 24px; }
.section-title { font-size: 1.45rem; font-weight: 800; color: var(--brand); margin-bottom: 4px; }
.section-subtitle { font-size: .9rem; color: var(--neutral-500); }

/* ── Cluster Grid ── */
.cluster-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px; margin-bottom: 28px;
}
.cluster-card {
  background: #fff; border-radius: var(--radius);
  padding: 20px; cursor: pointer;
  border: 2px solid var(--neutral-200);
  transition: var(--transition);
  position: relative; overflow: hidden;
}
.cluster-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, var(--brand), var(--brand-mid));
}
.cluster-card:hover { border-color: var(--brand-mid); box-shadow: var(--shadow); transform: translateY(-2px); }
.cluster-card.completed::before { background: linear-gradient(90deg, var(--success), #22c55e); }
.cluster-number { font-size: .75rem; font-weight: 700; color: var(--neutral-400); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 6px; }
.cluster-name { font-size: 1rem; font-weight: 700; color: var(--neutral-800); margin-bottom: 6px; }
.cluster-tagline { font-size: .78rem; color: var(--neutral-500); line-height: 1.4; margin-bottom: 12px; }
.cluster-progress {
  background: var(--neutral-100); border-radius: 4px; height: 5px; overflow: hidden;
}
.cluster-progress-fill { height: 100%; background: var(--brand-mid); border-radius: 4px; transition: width .4s; }
.cluster-count { font-size: .72rem; color: var(--neutral-400); margin-top: 6px; }

/* ── Cluster Detail View ── */
.back-btn {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .84rem; font-weight: 600; color: var(--brand-mid);
  background: none; border: none; padding: 0; margin-bottom: 20px;
  transition: var(--transition);
}
.back-btn:hover { gap: 10px; }
.cluster-header {
  background: var(--brand); color: #fff;
  border-radius: var(--radius); padding: 24px;
  margin-bottom: 24px;
}
.cluster-header-name { font-size: 1.4rem; font-weight: 800; margin-bottom: 4px; }
.cluster-header-tagline { font-size: .88rem; opacity: .8; margin-bottom: 12px; }
.gre-context-note {
  background: rgba(255,255,255,.12); border-radius: 8px;
  padding: 12px 16px; font-size: .82rem; line-height: 1.5;
}
.gre-context-note strong { display: block; margin-bottom: 4px; opacity: .9; }

/* ── Word Cards Deck ── */
.deck-controls {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px; flex-wrap: wrap; gap: 12px;
}
.deck-progress-text { font-size: .85rem; color: var(--neutral-500); font-weight: 600; }
.btn-se { padding: 9px 18px; font-size: .84rem; font-weight: 700; }

.card-container {
  perspective: 1200px; width: 100%; max-width: 600px;
  margin: 0 auto 24px; height: 300px;
}
.card-inner {
  position: relative; width: 100%; height: 100%;
  transform-style: preserve-3d; transition: transform .5s cubic-bezier(.4,0,.2,1);
  cursor: pointer;
}
.card-inner.flipped { transform: rotateY(180deg); }
.card-face {
  position: absolute; inset: 0; backface-visibility: hidden;
  border-radius: var(--radius-lg); padding: 32px;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow);
}
.card-front {
  background: var(--brand);
  color: #fff;
  justify-content: space-between;
}
.card-back {
  background: #fff;
  border: 2px solid var(--neutral-200);
  transform: rotateY(180deg);
  justify-content: flex-start;
  overflow-y: auto;
}
.card-cluster-tag {
  font-size: .7rem; font-weight: 700; letter-spacing: .6px;
  text-transform: uppercase; opacity: .65; margin-bottom: 8px;
}
.card-word { font-size: 2rem; font-weight: 800; margin-bottom: 4px; letter-spacing: -.5px; }
.card-pos { font-size: .82rem; opacity: .75; font-style: italic; }
.card-tap-hint {
  font-size: .72rem; opacity: .5; text-align: center;
  display: flex; align-items: center; justify-content: center; gap: 4px;
}
.card-definition { font-size: 1rem; font-weight: 600; color: var(--brand); margin-bottom: 12px; line-height: 1.5; }
.card-example { font-size: .88rem; color: var(--neutral-600); font-style: italic; margin-bottom: 14px; padding-left: 12px; border-left: 3px solid var(--brand-light); line-height: 1.55; }
.card-mnemonic { font-size: .82rem; color: var(--accent); background: var(--accent-light); border-radius: 8px; padding: 10px 14px; margin-bottom: 12px; }
.card-mnemonic strong { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .4px; margin-bottom: 4px; }
.card-synonyms { font-size: .78rem; color: var(--neutral-500); }
.card-synonyms strong { color: var(--neutral-600); }

/* Rating Buttons */
.rating-buttons {
  display: flex; gap: 10px; margin-top: 16px; justify-content: center;
}
.btn-rate {
  flex: 1; max-width: 140px; padding: 10px;
  border-radius: var(--radius); font-size: .82rem; font-weight: 700;
  transition: var(--transition); border: 2px solid transparent;
}
.btn-hard { background: var(--error-bg); color: var(--error); border-color: #fca5a5; }
.btn-hard:hover { background: var(--error); color: #fff; }
.btn-getting { background: var(--warn-bg); color: var(--warn); border-color: #fde68a; }
.btn-getting:hover { background: var(--warn); color: #fff; }
.btn-got { background: var(--success-bg); color: var(--success); border-color: #86efac; }
.btn-got:hover { background: var(--success); color: #fff; }

/* ── SE Mini-Game ── */
.se-container { max-width: 640px; margin: 0 auto; }
.se-question-counter { font-size: .8rem; font-weight: 600; color: var(--neutral-400); margin-bottom: 12px; text-transform: uppercase; letter-spacing: .5px; }
.se-sentence {
  background: #fff; border-radius: var(--radius); padding: 24px;
  font-size: 1.05rem; line-height: 1.7; color: var(--neutral-800);
  border: 2px solid var(--neutral-200); margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}
.se-blank { display: inline-block; min-width: 100px; border-bottom: 2.5px solid var(--brand); padding: 0 6px; color: var(--brand); font-weight: 700; }
.se-instruction {
  font-size: .84rem; color: var(--neutral-500); margin-bottom: 16px;
  padding: 10px 16px; background: var(--brand-light); border-radius: 8px;
  display: flex; align-items: center; gap: 8px;
}
.se-options {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 10px; margin-bottom: 20px;
}
.se-option {
  padding: 12px 16px; border-radius: var(--radius);
  border: 2.5px solid var(--neutral-200); background: #fff;
  font-size: .9rem; font-weight: 600; color: var(--neutral-700);
  transition: var(--transition); text-align: left;
}
.se-option:hover { border-color: var(--brand-mid); background: var(--brand-light); color: var(--brand); }
.se-option.selected { border-color: var(--brand); background: var(--brand); color: #fff; }
.se-option.correct { border-color: var(--success); background: var(--success-bg); color: var(--success); }
.se-option.incorrect { border-color: var(--error); background: var(--error-bg); color: var(--error); }
.se-option.missed { border-color: var(--success); background: var(--success-bg); color: var(--success); opacity: .6; }
.se-feedback {
  border-radius: var(--radius); padding: 16px 20px;
  margin-bottom: 20px; font-size: .88rem; line-height: 1.6; display: none;
}
.se-feedback.correct { background: var(--success-bg); border: 1.5px solid #86efac; color: #166534; }
.se-feedback.incorrect { background: var(--error-bg); border: 1.5px solid #fca5a5; color: #991b1b; }
.se-score {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--brand-light); color: var(--brand); font-size: .85rem;
  font-weight: 700; padding: 8px 16px; border-radius: 100px;
}

/* ── Buttons (shared) ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 22px; border-radius: var(--radius);
  font-size: .88rem; font-weight: 700; transition: var(--transition);
  border: none; cursor: pointer;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-mid); box-shadow: 0 4px 14px rgba(37,99,168,.35); }
.btn-secondary { background: var(--neutral-100); color: var(--neutral-700); border: 1.5px solid var(--neutral-200); }
.btn-secondary:hover { background: var(--neutral-200); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: #c44b10; box-shadow: 0 4px 14px rgba(224,92,26,.35); }
.btn-outline { background: transparent; color: var(--brand); border: 2px solid var(--brand); }
.btn-outline:hover { background: var(--brand); color: #fff; }
.btn-google {
  background: #fff; color: var(--neutral-700); border: 1.5px solid var(--neutral-200);
  font-weight: 600; font-size: .9rem; width: 100%;
  justify-content: center; padding: 13px;
  box-shadow: var(--shadow-sm); gap: 10px;
}
.btn-google:hover { box-shadow: var(--shadow); border-color: var(--neutral-300); }
.btn-email-auth {
  background: var(--brand); color: #fff; width: 100%;
  padding: 13px; font-size: .9rem; font-weight: 700; border-radius: var(--radius);
  margin-top: 4px;
}
.btn-email-auth:hover { background: var(--brand-mid); }
.btn-sm { padding: 7px 14px; font-size: .8rem; }
.btn-disabled { opacity: .4; cursor: not-allowed; pointer-events: none; }

/* ── Google Icon ── */
.google-icon { width: 18px; height: 18px; }

/* ── Verbal Strategy Mode ── */
.strategy-filters {
  display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px;
}
.filter-chip {
  padding: 6px 14px; border-radius: 100px; font-size: .78rem; font-weight: 600;
  border: 1.5px solid var(--neutral-200); background: #fff; color: var(--neutral-500);
  transition: var(--transition); cursor: pointer;
}
.filter-chip:hover { border-color: var(--brand-mid); color: var(--brand-mid); }
.filter-chip.active { border-color: var(--brand); background: var(--brand); color: #fff; }

/* Strategy card (small flip) */
.strategy-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px;
}
.strategy-card {
  background: #fff; border-radius: var(--radius); border: 2px solid var(--neutral-200);
  cursor: pointer; overflow: hidden; transition: var(--transition);
  box-shadow: var(--shadow-sm);
}
.strategy-card:hover { border-color: var(--brand-mid); box-shadow: var(--shadow); transform: translateY(-2px); }
.strategy-card-header {
  padding: 16px 20px 0; display: flex; align-items: flex-start; justify-content: space-between; gap: 8px;
}
.strategy-category-tag {
  font-size: .68rem; font-weight: 700; letter-spacing: .5px; text-transform: uppercase;
  padding: 3px 10px; border-radius: 100px; background: var(--brand-light); color: var(--brand);
}
.strategy-difficulty {
  font-size: .68rem; font-weight: 600; padding: 3px 10px; border-radius: 100px;
}
.diff-fundamental { background: var(--neutral-100); color: var(--neutral-500); }
.diff-advanced { background: var(--warn-bg); color: var(--warn); }
.diff-critical { background: var(--error-bg); color: var(--error); }
.diff-reference { background: var(--success-bg); color: var(--success); }
.strategy-card-title { font-size: .95rem; font-weight: 700; color: var(--neutral-800); padding: 10px 20px 4px; }
.strategy-card-preview { font-size: .8rem; color: var(--neutral-500); padding: 0 20px 16px; line-height: 1.5; }
/* Strategy modal */
.strategy-modal-overlay {
  position: fixed; inset: 0; background: rgba(15,23,42,.6); z-index: 500;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.strategy-modal-overlay.open { opacity: 1; pointer-events: all; }
.strategy-modal {
  background: #fff; border-radius: var(--radius-lg);
  padding: 32px; max-width: 560px; width: 100%;
  max-height: 80vh; overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: scale(.95); transition: transform .2s;
}
.strategy-modal-overlay.open .strategy-modal { transform: scale(1); }
.strategy-modal-close {
  position: absolute; top: 16px; right: 16px; background: var(--neutral-100);
  color: var(--neutral-500); border: none; border-radius: 50%; width: 32px; height: 32px;
  font-size: 1.1rem; display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.strategy-content {
  font-size: .9rem; color: var(--neutral-700); line-height: 1.75;
  white-space: pre-line;
}
.strategy-tip {
  margin-top: 20px; padding: 14px 18px;
  background: var(--accent-light); border-radius: 8px; border-left: 4px solid var(--accent);
  font-size: .85rem; color: var(--neutral-700); line-height: 1.55;
}
.strategy-tip strong { color: var(--accent); }

/* Self-rating row for strategy cards */
.strategy-rating { display: flex; gap: 8px; margin-top: 20px; }
.strategy-rating .btn-rate { font-size: .78rem; padding: 7px; }

/* ── Formula Bank Mode ── */
.formula-filter-group { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; }
.formula-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px;
}
.formula-card {
  background: #fff; border-radius: var(--radius); border: 2px solid var(--neutral-200);
  overflow: hidden; box-shadow: var(--shadow-sm); cursor: pointer;
  transition: var(--transition);
}
.formula-card:hover { border-color: var(--brand-mid); box-shadow: var(--shadow); transform: translateY(-2px); }
.formula-card-header { background: var(--brand); color: #fff; padding: 14px 18px; }
.formula-card-cat { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; opacity: .7; margin-bottom: 4px; }
.formula-card-title { font-size: .95rem; font-weight: 700; }
.formula-card-body { padding: 16px 18px; }
.formula-math {
  font-family: var(--font-mono); font-size: .82rem; background: var(--neutral-50);
  border-radius: 6px; padding: 12px; color: var(--neutral-800);
  white-space: pre-line; margin-bottom: 10px; border: 1px solid var(--neutral-200);
  line-height: 1.8;
}
.formula-example { font-size: .8rem; color: var(--neutral-600); line-height: 1.55; }
.formula-notes { font-size: .75rem; color: var(--brand-mid); margin-top: 8px; line-height: 1.5; font-style: italic; }

/* ── Quant Practice Mode ── */
.difficulty-selector {
  display: flex; gap: 10px; margin-bottom: 24px; flex-wrap: wrap;
}
.diff-btn {
  padding: 10px 20px; border-radius: var(--radius); font-size: .85rem; font-weight: 700;
  border: 2px solid transparent; transition: var(--transition); cursor: pointer;
  background: #fff;
}
.diff-btn-easy { border-color: var(--success); color: var(--success); }
.diff-btn-easy:hover, .diff-btn-easy.active { background: var(--success); color: #fff; }
.diff-btn-medium { border-color: var(--warn); color: var(--warn); }
.diff-btn-medium:hover, .diff-btn-medium.active { background: var(--warn); color: #fff; }
.diff-btn-hard { border-color: var(--error); color: var(--error); }
.diff-btn-hard:hover, .diff-btn-hard.active { background: var(--error); color: #fff; }
.diff-btn-locked { border-color: var(--neutral-300); color: var(--neutral-400); cursor: not-allowed; background: var(--neutral-100); }
.lock-badge {
  display: inline-block; font-size: .72rem; padding: 2px 8px;
  background: var(--neutral-200); border-radius: 4px; margin-left: 6px; vertical-align: middle;
}
.quant-score-bar {
  display: flex; gap: 20px; flex-wrap: wrap; margin-bottom: 24px;
  background: #fff; padding: 16px 20px; border-radius: var(--radius);
  border: 1.5px solid var(--neutral-200); box-shadow: var(--shadow-sm);
}
.quant-score-item { text-align: center; }
.quant-score-val { font-size: 1.4rem; font-weight: 800; color: var(--brand); }
.quant-score-label { font-size: .72rem; color: var(--neutral-400); font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }

.question-card {
  background: #fff; border-radius: var(--radius); border: 2px solid var(--neutral-200);
  padding: 28px; margin-bottom: 20px; box-shadow: var(--shadow-sm);
}
.question-meta { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.topic-tag {
  font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .4px;
  padding: 4px 10px; border-radius: 100px;
  background: var(--brand-light); color: var(--brand);
}
.diff-tag { font-size: .72rem; font-weight: 700; padding: 4px 10px; border-radius: 100px; }
.diff-tag-easy { background: var(--success-bg); color: var(--success); }
.diff-tag-medium { background: var(--warn-bg); color: var(--warn); }
.diff-tag-hard { background: var(--error-bg); color: var(--error); }
.type-tag { font-size: .72rem; color: var(--neutral-400); font-weight: 500; }

.question-prompt { font-size: .98rem; color: var(--neutral-700); margin-bottom: 16px; line-height: 1.65; }
.qc-table {
  display: grid; grid-template-columns: 1fr auto 1fr;
  gap: 4px; margin-bottom: 20px; align-items: center;
}
.qc-col { background: var(--neutral-50); border-radius: var(--radius); padding: 18px; text-align: center; border: 1.5px solid var(--neutral-200); }
.qc-col-label { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--neutral-400); margin-bottom: 8px; }
.qc-col-value { font-size: 1rem; font-weight: 700; color: var(--neutral-800); font-family: var(--font-mono); line-height: 1.4; }
.qc-vs { font-size: 1.1rem; font-weight: 800; color: var(--neutral-400); text-align: center; }

.mc-options { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.mc-option {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 16px; border-radius: var(--radius);
  border: 2px solid var(--neutral-200); background: #fff;
  cursor: pointer; transition: var(--transition); font-size: .9rem; color: var(--neutral-700);
}
.mc-option:hover { border-color: var(--brand-mid); background: var(--brand-light); }
.mc-option.selected { border-color: var(--brand); background: var(--brand-light); }
.mc-option.correct { border-color: var(--success); background: var(--success-bg); color: var(--success); }
.mc-option.incorrect { border-color: var(--error); background: var(--error-bg); color: var(--error); }
.mc-option.missed { border-color: var(--success); background: var(--success-bg); opacity: .7; }
.mc-option input[type="radio"], .mc-option input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--brand); flex-shrink: 0; }

.numeric-input-wrap { display: flex; gap: 12px; align-items: center; margin-bottom: 20px; }
.numeric-input {
  width: 160px; padding: 12px 16px; font-size: 1rem; font-weight: 700;
  font-family: var(--font-mono); border: 2px solid var(--neutral-300);
  border-radius: var(--radius); text-align: center;
  transition: var(--transition);
}
.numeric-input:focus { outline: none; border-color: var(--brand-mid); box-shadow: 0 0 0 3px rgba(37,99,168,.12); }
.numeric-input.correct { border-color: var(--success); background: var(--success-bg); }
.numeric-input.incorrect { border-color: var(--error); background: var(--error-bg); }

.solution-box {
  background: var(--neutral-50); border: 1.5px solid var(--neutral-200);
  border-radius: var(--radius); padding: 16px 20px;
  font-size: .88rem; color: var(--neutral-700); line-height: 1.65;
  display: none; margin-top: 16px;
}
.solution-box strong { color: var(--brand); font-size: .8rem; text-transform: uppercase; letter-spacing: .4px; display: block; margin-bottom: 8px; }
.solution-box.visible { display: block; }
.feedback-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: 100px; font-weight: 700; font-size: .85rem;
  margin-bottom: 12px;
}
.feedback-correct { background: var(--success-bg); color: var(--success); }
.feedback-incorrect { background: var(--error-bg); color: var(--error); }

.question-nav { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

/* ── Writing Lab Mode ── */
.writing-lab-controls {
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 24px;
}
.timer-display {
  font-size: 1.3rem; font-weight: 800; font-family: var(--font-mono);
  color: var(--brand); background: #fff; border: 2px solid var(--brand-light);
  padding: 8px 18px; border-radius: var(--radius);
}
.timer-display.warning { color: var(--warn); border-color: #fde68a; }
.timer-display.danger { color: var(--error); border-color: #fca5a5; animation: pulse 1s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .6; } }
.timer-toggle { font-size: .8rem; }

.prompt-selector { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }
.prompt-select-btn {
  padding: 8px 16px; border-radius: 100px; font-size: .82rem; font-weight: 600;
  border: 1.5px solid var(--neutral-200); background: #fff; color: var(--neutral-500);
  transition: var(--transition); cursor: pointer;
}
.prompt-select-btn:hover { border-color: var(--brand); color: var(--brand); }
.prompt-select-btn.active { border-color: var(--brand); background: var(--brand); color: #fff; }

.essay-prompt-box {
  background: var(--brand); color: #fff;
  border-radius: var(--radius); padding: 22px 24px; margin-bottom: 20px;
}
.prompt-task-label {
  font-size: .72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .6px; opacity: .7; margin-bottom: 8px;
}
.prompt-title { font-size: 1.05rem; font-weight: 800; margin-bottom: 12px; }
.prompt-text { font-size: .9rem; line-height: 1.65; opacity: .9; margin-bottom: 14px; }
.prompt-instruction { font-size: .8rem; opacity: .75; line-height: 1.55; font-style: italic; }
.thinking-prompts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.thinking-chip {
  font-size: .72rem; background: rgba(255,255,255,.12);
  border-radius: 100px; padding: 4px 12px; line-height: 1.5;
}

.essay-area-wrap { position: relative; margin-bottom: 16px; }
.essay-textarea {
  width: 100%; min-height: 320px; padding: 20px;
  border: 2px solid var(--neutral-200); border-radius: var(--radius);
  font-size: .95rem; line-height: 1.8; color: var(--neutral-800);
  resize: vertical; transition: var(--transition); background: #fff;
}
.essay-textarea:focus { outline: none; border-color: var(--brand-mid); box-shadow: 0 0 0 3px rgba(37,99,168,.1); }
.word-count-bar {
  display: flex; justify-content: space-between; align-items: center;
  font-size: .78rem; color: var(--neutral-400); padding: 6px 2px;
}
.word-count-val { font-weight: 700; color: var(--neutral-600); }
.word-count-target { color: var(--neutral-400); }

/* Rubric Scoring Output */
.score-output { margin-top: 24px; }
.score-headline {
  text-align: center; padding: 28px;
  background: linear-gradient(135deg, var(--brand), var(--brand-mid));
  color: #fff; border-radius: var(--radius); margin-bottom: 20px;
}
.score-number { font-size: 4rem; font-weight: 900; line-height: 1; letter-spacing: -2px; }
.score-out-of { font-size: 1rem; opacity: .7; margin-top: 4px; }
.score-label { font-size: .85rem; opacity: .8; margin-top: 8px; }

.rubric-bars { display: flex; flex-direction: column; gap: 14px; margin-bottom: 24px; }
.rubric-row { background: #fff; border-radius: var(--radius); padding: 16px 20px; border: 1.5px solid var(--neutral-200); }
.rubric-row-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.rubric-crit-name { font-size: .9rem; font-weight: 700; color: var(--neutral-800); }
.rubric-crit-score { font-size: .9rem; font-weight: 800; color: var(--brand); }
.rubric-bar-track { background: var(--neutral-100); border-radius: 100px; height: 8px; overflow: hidden; margin-bottom: 10px; }
.rubric-bar-fill { height: 100%; border-radius: 100px; transition: width .8s cubic-bezier(.4,0,.2,1); }
.score-0 { background: var(--neutral-300); }
.score-1 { background: var(--error); }
.score-2 { background: #f97316; }
.score-3 { background: var(--warn); }
.score-4 { background: var(--success); }
.rubric-feedback-text { font-size: .82rem; color: var(--neutral-600); line-height: 1.55; }

.essay-next-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 20px; }

/* ── Deck Complete Screen ── */
.deck-complete {
  text-align: center; padding: 40px 20px;
  background: #fff; border-radius: var(--radius-lg); border: 2px solid var(--neutral-200);
  box-shadow: var(--shadow);
}
.deck-complete-icon { font-size: 3rem; margin-bottom: 16px; }
.deck-complete-title { font-size: 1.4rem; font-weight: 800; color: var(--brand); margin-bottom: 8px; }
.deck-complete-stats {
  display: flex; justify-content: center; gap: 32px; margin: 24px 0;
  flex-wrap: wrap;
}
.complete-stat { text-align: center; }
.complete-stat-num { font-size: 1.8rem; font-weight: 800; color: var(--brand); }
.complete-stat-label { font-size: .78rem; color: var(--neutral-400); font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }

/* ── Toast Notifications ── */
.toast-container { position: fixed; top: 80px; right: 20px; z-index: 900; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--neutral-800); color: #fff; padding: 12px 18px;
  border-radius: var(--radius); font-size: .84rem; font-weight: 500;
  box-shadow: var(--shadow-lg); max-width: 320px;
  animation: slideIn .3s ease;
}
.toast-success { background: var(--success); }
.toast-error { background: var(--error); }
@keyframes slideIn { from { transform: translateX(110%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ── Empty States ── */
.empty-state { text-align: center; padding: 48px 20px; color: var(--neutral-400); }
.empty-state-icon { font-size: 2.5rem; margin-bottom: 12px; }
.empty-state-text { font-size: .9rem; line-height: 1.6; }

/* ── Utility Classes ── */
.hidden { display: none !important; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.gap-8 { gap: 8px; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.text-center { text-align: center; }
.font-bold { font-weight: 700; }
.text-sm { font-size: .85rem; }
.text-xs { font-size: .75rem; }
.text-muted { color: var(--neutral-400); }
.text-brand { color: var(--brand); }
.text-success { color: var(--success); }
.text-error { color: var(--error); }

/* ── Responsive ── */
@media (max-width: 640px) {
  .mode-view { padding: 20px 16px; }
  .cluster-grid { grid-template-columns: 1fr; }
  .se-options { grid-template-columns: 1fr; }
  .qc-table { grid-template-columns: 1fr; }
  .qc-vs { display: none; }
  .quant-score-bar { justify-content: space-around; }
  .difficulty-selector { justify-content: center; }
  .stats-bar { gap: 12px; justify-content: center; }
  .formula-grid { grid-template-columns: 1fr; }
  .strategy-grid { grid-template-columns: 1fr; }
  .auth-card { padding: 32px 24px; }
  .card-container { height: 260px; }
  .card-word { font-size: 1.6rem; }
}
@media (max-width: 400px) {
  .nav-tab { padding: 12px 12px; font-size: .78rem; }
  .topbar-user { display: none; }
}
