@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,700;9..144,900&family=Nunito:wght@400;500;600;700;800&display=swap');

/* Cross-document view transitions — sidebar stays in place, main content fades */
@view-transition { navigation: auto; }

/* ============================================================
   CSS Variables
   ============================================================ */
:root {
  --primary: #F4A629;
  --primary-dark: #D4891F;
  --primary-light: rgba(244, 166, 41, 0.14);

  --navy: #1E2A4A;
  --navy-2: #2A3A60;

  --sidebar-w: 228px;

  --rate-red: #FF4B4B;
  --rate-amber: #FF9600;
  --rate-yellow: #F5C400;
  --rate-green: #45B800;

  /* Light theme */
  --bg: #F7F6F2;
  --surface: #FFFFFF;
  --surface-2: #EFEDE6;
  --text: #1E2A4A;
  --text-muted: #6B7A99;
  --border: #E3E0D8;
  --shadow: 0 2px 10px rgba(30, 42, 74, 0.07);
  --shadow-lg: 0 6px 28px rgba(30, 42, 74, 0.11);

  --radius: 14px;
  --radius-sm: 8px;
  --radius-xs: 5px;
}

[data-theme="dark"] {
  --bg: #0F1523;
  --surface: #18223A;
  --surface-2: #1F2D47;
  --text: #E6E3DA;
  --text-muted: #8090AD;
  --border: #283347;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.28);
  --shadow-lg: 0 6px 28px rgba(0, 0, 0, 0.4);
}

/* ============================================================
   Reset & Base
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; }

body {
  font-family: 'Nunito', sans-serif;
  background: var(--bg);
  color: var(--text);
  transition: background 0.2s, color 0.2s;
  min-height: 100vh;
}

a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, textarea, select { font-family: inherit; }
img { display: block; max-width: 100%; }

/* ============================================================
   App Shell (sidebar + main)
   ============================================================ */
.app-shell {
  display: flex;
  min-height: 100vh;
}

/* ============================================================
   Sidebar
   ============================================================ */
.sidebar {
  view-transition-name: sidebar;
  width: var(--sidebar-w);
  background: var(--navy);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  overflow-y: auto;
}

.sidebar-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 24px 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  flex-shrink: 0;
}

.sidebar-logo img {
  width: 96px;
  height: 96px;
  object-fit: contain;
  border-radius: 14px;
  flex-shrink: 0;
}

.logo-text {
  font-family: 'Fraunces', serif;
  font-weight: 900;
  font-size: 1.2rem;
  color: #fff;
  letter-spacing: -0.02em;
}

.logo-text .logo-ib {
  color: var(--primary);
}

.sidebar-nav {
  flex: 1;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: rgba(255, 255, 255, 0.55);
  font-weight: 700;
  font-size: 0.875rem;
  transition: background 0.14s, color 0.14s;
  width: 100%;
  text-align: left;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.88);
}

.nav-item.active {
  background: var(--primary-light);
  color: var(--primary);
}

.nav-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 8px 8px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
}

.theme-toggle-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.875rem;
  font-weight: 700;
  width: 100%;
  transition: background 0.14s, color 0.14s;
}

.theme-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.88);
}

.theme-icon { font-size: 1rem; }

.sidebar-user {
  padding: 4px 0 0;
}

.sidebar-username {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: rgba(255, 255, 255, 0.3);
  padding: 4px 12px 2px;
}

.logout-btn {
  color: rgba(255, 255, 255, 0.45);
}

.logout-btn:hover {
  color: var(--rate-red) !important;
  background: rgba(255, 75, 75, 0.1) !important;
}

/* ============================================================
   Main Content
   ============================================================ */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: 32px 36px;
  max-width: calc(100vw - var(--sidebar-w));
}

/* ============================================================
   Page Header
   ============================================================ */
.page-header {
  margin-bottom: 24px;
}

.page-title {
  font-family: 'Fraunces', serif;
  font-weight: 900;
  font-size: 1.85rem;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.page-subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 5px;
  font-weight: 600;
}

/* ============================================================
   Stats Row
   ============================================================ */
.stats-row {
  display: flex;
  gap: 14px;
  margin-bottom: 26px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  flex: 1;
  box-shadow: var(--shadow);
}

.stat-value {
  font-family: 'Fraunces', serif;
  font-weight: 900;
  font-size: 2rem;
  color: var(--text);
  line-height: 1;
}

.stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ============================================================
   Unit Sections + Topic Table
   ============================================================ */
.unit-section {
  margin-bottom: 18px;
}

.unit-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  cursor: pointer;
  user-select: none;
  padding: 4px 2px;
}

.unit-badge {
  background: var(--navy);
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.7rem;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 20px;
  letter-spacing: 0.03em;
  flex-shrink: 0;
}

[data-theme="dark"] .unit-badge {
  background: var(--surface-2);
  color: var(--text-muted);
}

.unit-name {
  font-weight: 800;
  font-size: 0.875rem;
  color: var(--text);
}

.unit-count {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}

.unit-chevron {
  margin-left: auto;
  color: var(--text-muted);
  transition: transform 0.2s;
  font-size: 0.75rem;
}

.unit-section.collapsed .unit-chevron { transform: rotate(-90deg); }
.unit-section.collapsed .unit-topics { display: none; }

/* ============================================================
   Cluster rows (within unit-topics)
   ============================================================ */
.cluster-section {
  border-bottom: 1px solid var(--border);
}
.cluster-section:last-child {
  border-bottom: none;
}

.cluster-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  user-select: none;
  transition: background 0.1s;
}
.cluster-row:hover {
  background: var(--surface-2);
}

.cluster-name {
  flex: 1;
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--text);
}

.cluster-indicators {
  display: flex;
  gap: 4px;
  align-items: center;
}

.cluster-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--border);
  flex-shrink: 0;
  transition: background 0.2s;
}
.cluster-dot[data-r="1"] { background: var(--rate-red); }
.cluster-dot[data-r="2"] { background: var(--rate-amber); }
.cluster-dot[data-r="3"] { background: var(--rate-yellow); }
.cluster-dot[data-r="4"] { background: var(--rate-green); }

.cluster-chevron {
  color: var(--text-muted);
  font-size: 0.65rem;
  transition: transform 0.2s;
  flex-shrink: 0;
}

.cluster-section.collapsed .cluster-chevron { transform: rotate(-90deg); }
.cluster-section.collapsed .cluster-skills { display: none; }

/* Skill sub-rows (inside expanded cluster) */
.skill-subrow {
  display: grid;
  grid-template-columns: 1fr 80px auto 36px;
  align-items: center;
  gap: 12px;
  padding: 8px 14px 8px 28px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  transition: background 0.1s;
}
.skill-subrow:hover {
  filter: brightness(0.97);
}
[data-theme="dark"] .skill-subrow:hover {
  filter: brightness(1.06);
}

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

.topic-row {
  display: grid;
  grid-template-columns: 1fr 80px auto 36px;
  align-items: center;
  gap: 12px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}

.topic-row:last-child { border-bottom: none; }
.topic-row:hover { background: var(--surface-2); }

.topic-name {
  font-size: 0.86rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--text);
}

.hl-tag {
  font-size: 0.6rem;
  font-weight: 800;
  background: var(--primary-light);
  color: var(--primary-dark);
  padding: 1px 5px;
  border-radius: 4px;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

/* ============================================================
   Rating Buttons (inline on dashboard)
   ============================================================ */
.rating-btns {
  display: flex;
  gap: 4px;
  align-items: center;
}

.rating-btn {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid transparent;
  transition: transform 0.1s, box-shadow 0.1s;
  flex-shrink: 0;
}

.rating-btn:hover { transform: scale(1.25); }

.rating-btn.selected {
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px currentColor;
}

.rating-btn[data-r="1"] { background: var(--rate-red); color: var(--rate-red); }
.rating-btn[data-r="2"] { background: var(--rate-amber); color: var(--rate-amber); }
.rating-btn[data-r="3"] { background: var(--rate-yellow); color: var(--rate-yellow); }
.rating-btn[data-r="4"] { background: var(--rate-green); color: var(--rate-green); }

/* Self-reported (declared, not earned): hollow ring in the colour */
.rating-btn.self-reported { background: var(--surface) !important; border-color: currentColor; opacity: 0.85; }
.rating-btn.self-reported[data-r="1"] { color: var(--rate-red); }
.rating-btn.self-reported[data-r="2"] { color: var(--rate-amber); }
.rating-btn.self-reported[data-r="3"] { color: var(--rate-yellow); }
.rating-btn.self-reported[data-r="4"] { color: var(--rate-green); }

/* ============================================================
   History Dots
   ============================================================ */
.history-dots {
  display: flex;
  gap: 3px;
  align-items: center;
}

.history-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.history-dot[data-r="1"] { background: var(--rate-red); }
.history-dot[data-r="2"] { background: var(--rate-amber); }
.history-dot[data-r="3"] { background: var(--rate-yellow); }
.history-dot[data-r="4"] { background: var(--rate-green); }

.attempt-count {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 800;
  text-align: right;
}

/* ============================================================
   Login Page
   ============================================================ */
.login-page {
  min-height: 100vh;
  display: flex;
}

.login-brand {
  width: 45%;
  background: var(--navy);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
  gap: 20px;
  position: relative;
  overflow: hidden;
}

.login-brand::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 50% 70%, rgba(244,166,41,0.15) 0%, transparent 70%),
    radial-gradient(ellipse 40% 40% at 20% 20%, rgba(244,166,41,0.07) 0%, transparent 60%);
  pointer-events: none;
}

.login-mascot {
  width: 200px;
  height: 200px;
  object-fit: contain;
  filter: drop-shadow(0 12px 32px rgba(0,0,0,0.35));
  position: relative;
  z-index: 1;
  animation: floatMascot 4s ease-in-out infinite;
}

@keyframes floatMascot {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.login-brand-title {
  font-family: 'Fraunces', serif;
  font-weight: 900;
  font-size: 2.8rem;
  color: white;
  letter-spacing: -0.03em;
  position: relative;
  z-index: 1;
}

.login-brand-title .logo-ib {
  color: var(--primary);
}

.login-brand-tagline {
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.9rem;
  text-align: center;
  max-width: 220px;
  line-height: 1.6;
  position: relative;
  z-index: 1;
  font-weight: 600;
}

.login-form-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
  background: var(--bg);
}

.login-form {
  width: 100%;
  max-width: 340px;
}

.login-form-title {
  font-family: 'Fraunces', serif;
  font-weight: 700;
  font-size: 1.6rem;
  color: var(--text);
  margin-bottom: 6px;
}

.login-form-sub {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: 28px;
  font-weight: 600;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.form-group input {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 600;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-group input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.btn-primary {
  width: 100%;
  padding: 13px;
  background: var(--primary);
  color: white;
  font-size: 1rem;
  font-weight: 800;
  border-radius: var(--radius-sm);
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
  margin-top: 10px;
  letter-spacing: 0.01em;
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(244,166,41,0.4);
}

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

.login-error {
  color: var(--rate-red);
  font-size: 0.82rem;
  font-weight: 700;
  margin-top: 10px;
  text-align: center;
  min-height: 20px;
}

/* ============================================================
   Practice Pages — Setup Screen
   ============================================================ */
.practice-setup {
  max-width: 520px;
  text-align: center;
  margin: 56px auto;
}

.practice-setup .page-title {
  font-size: 2rem;
  margin-bottom: 8px;
}

.practice-desc {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 32px;
  line-height: 1.6;
  font-weight: 600;
}

.count-picker {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 32px;
}

.count-btn {
  width: 68px;
  height: 68px;
  border-radius: 16px;
  border: 2.5px solid var(--border);
  background: var(--surface);
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--text-muted);
  font-family: 'Fraunces', serif;
  transition: all 0.15s;
  box-shadow: var(--shadow);
}

.count-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.count-btn.selected {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.mode-picker {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 24px;
}

.mode-btn {
  padding: 10px 22px;
  border-radius: 50px;
  border: 2px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.mode-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.mode-btn.selected {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}

/* ============================================================
   Definition Session
   ============================================================ */
.def-session {
  max-width: 660px;
  margin: 0 auto;
}

.progress-bar-track {
  background: var(--border);
  height: 8px;
  border-radius: 4px;
  margin-bottom: 28px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 4px;
  transition: width 0.4s ease;
}

.def-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}

.def-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.def-card-unit {
  font-size: 0.72rem;
  font-weight: 800;
  background: var(--surface-2);
  color: var(--text-muted);
  padding: 3px 8px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.def-term {
  font-family: 'Fraunces', serif;
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--text);
  margin-bottom: 18px;
  line-height: 1.2;
}

.def-input {
  width: 100%;
  min-height: 90px;
  padding: 12px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
  resize: vertical;
  outline: none;
  transition: border-color 0.15s;
  line-height: 1.55;
}

.def-input:focus { border-color: var(--primary); }
.def-input:disabled { opacity: 0.7; }

.def-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.btn-secondary {
  flex: 1;
  padding: 11px;
  border: 2.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-muted);
  font-weight: 800;
  font-size: 0.875rem;
  transition: all 0.15s;
}

.btn-secondary:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

.btn-reveal {
  flex: 2;
}

.def-answer {
  margin-top: 16px;
  padding: 14px 16px;
  background: var(--surface-2);
  border-left: 4px solid var(--primary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  display: none;
}

.def-answer.visible {
  display: block;
  animation: fadeSlideIn 0.3s ease;
}

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

.def-answer-label {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--primary);
  margin-bottom: 6px;
}

.def-answer-text {
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.6;
  font-weight: 600;
}

/* ============================================================
   Rating Panel
   ============================================================ */
.rating-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  text-align: center;
  display: none;
  box-shadow: var(--shadow);
}

.rating-panel.visible {
  display: block;
  animation: fadeSlideIn 0.3s ease;
}

.rating-panel-q {
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.rating-options {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.rating-option {
  flex: 1;
  max-width: 120px;
  padding: 14px 8px 10px;
  border-radius: var(--radius-sm);
  border: none;
  font-weight: 800;
  font-size: 0.8rem;
  color: white;
  transition: all 0.15s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  line-height: 1.3;
}

.rating-option[data-r="1"] { background: var(--rate-red); }
.rating-option[data-r="2"] { background: var(--rate-amber); }
.rating-option[data-r="3"] { background: var(--rate-yellow); color: #333; }
.rating-option[data-r="4"] { background: var(--rate-green); }

.rating-option:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.2);
}

.rating-option .rating-emoji {
  font-size: 1.4rem;
}

/* ============================================================
   Session Summary
   ============================================================ */
.session-summary {
  max-width: 520px;
  margin: 40px auto;
  text-align: center;
}

.summary-title {
  font-family: 'Fraunces', serif;
  font-weight: 900;
  font-size: 2rem;
  margin-bottom: 6px;
  color: var(--text);
}

.summary-sub {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 32px;
}

.summary-bars {
  display: flex;
  gap: 14px;
  justify-content: center;
  align-items: flex-end;
  height: 120px;
  margin-bottom: 10px;
}

.summary-bar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex: 1;
  max-width: 80px;
}

.summary-bar-fill {
  width: 100%;
  border-radius: 8px 8px 4px 4px;
  transition: height 0.6s cubic-bezier(.34,1.56,.64,1);
  min-height: 4px;
}

.summary-bar-fill[data-r="1"] { background: var(--rate-red); }
.summary-bar-fill[data-r="2"] { background: var(--rate-amber); }
.summary-bar-fill[data-r="3"] { background: var(--rate-yellow); }
.summary-bar-fill[data-r="4"] { background: var(--rate-green); }

.summary-bar-count {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 800;
}

.summary-bar-label {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.summary-bar-label[data-r="1"] { color: var(--rate-red); }
.summary-bar-label[data-r="2"] { color: var(--rate-amber); }
.summary-bar-label[data-r="3"] { color: var(--rate-yellow); }
.summary-bar-label[data-r="4"] { color: var(--rate-green); }

.summary-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 28px;
}

.btn-outline {
  padding: 11px 24px;
  border: 2.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-weight: 800;
  font-size: 0.9rem;
  transition: all 0.15s;
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* ============================================================
   Calculations Page
   ============================================================ */
.calc-question-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}

.calc-formula-name {
  font-family: 'Fraunces', serif;
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--text);
  margin-bottom: 6px;
}

.calc-formula-str {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 600;
  font-style: italic;
}

.calc-inputs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.calc-input-row {
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}

.calc-input-label {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}

.calc-input-value {
  font-family: 'Fraunces', serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
}

.calc-answer-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.calc-answer-label {
  font-weight: 800;
  font-size: 0.875rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.calc-answer-input {
  flex: 1;
  padding: 11px 13px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text);
  font-size: 1rem;
  font-weight: 700;
  outline: none;
  transition: border-color 0.15s;
}

.calc-answer-input:focus { border-color: var(--primary); }

.calc-correct-answer {
  margin-top: 14px;
  padding: 14px 16px;
  background: var(--surface-2);
  border-left: 4px solid var(--rate-green);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  display: none;
}

.calc-correct-answer.visible { display: block; animation: fadeSlideIn 0.3s ease; }

.calc-correct-label {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--rate-green);
  margin-bottom: 4px;
}

.calc-correct-value {
  font-family: 'Fraunces', serif;
  font-size: 1.3rem;
  font-weight: 900;
  color: var(--text);
}

/* ============================================================
   Formula Peek
   ============================================================ */
.formula-peek-wrap {
  position: relative;
  margin: 16px 0 4px;
  text-align: center;
}

.formula-peek-cover {
  position: absolute;
  inset: -6px -14px;
  background: var(--border);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
  transition: background 0.1s, color 0.1s;
  z-index: 1;
}

.formula-peek-cover:hover {
  color: var(--text);
}

.formula-peek-wrap.peeking .formula-peek-cover {
  display: none;
}

/* ============================================================
   Calc auto-check result
   ============================================================ */
.calc-check-result {
  margin-top: 10px;
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 700;
  animation: fadeSlideIn 0.25s ease;
}

.calc-check-result.check-correct {
  background: var(--rate-green);
  color: #fff;
}

.calc-check-result.check-wrong {
  background: var(--rate-red);
  color: #fff;
}

.calc-check-result.check-no-unit {
  background: var(--rate-amber);
  color: #333;
}

/* ============================================================
   Statements practice
   ============================================================ */

.setup-label {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin: 24px 0 10px;
}

.stmt-type-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 8px;
}

.stmt-type-btn {
  padding: 10px 18px;
  border-radius: 50px;
  border: 2px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.stmt-type-btn.wide { padding: 10px 26px; }

.stmt-type-btn:hover { border-color: var(--primary); color: var(--primary); }

.stmt-type-btn.selected {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}

/* Statement card */
.stmt-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}

.stmt-meta {
  margin-bottom: 18px;
}

.stmt-company {
  font-family: 'Fraunces', serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
}

.stmt-subtitle {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 2px;
}

.stmt-unit {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
  font-style: italic;
}

/* Statement table */
.stmt-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.stmt-table thead tr {
  border-bottom: 2px solid var(--border);
}

.stmt-table thead th {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: 6px 8px;
  text-align: left;
}

.stmt-table th.stmt-val-col,
.stmt-table th.stmt-detail-col { text-align: right; width: 100px; }

.stmt-row-given td,
.stmt-row-calc td,
.stmt-section-hdr td,
.stmt-spacer td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
}

.stmt-spacer td { padding: 4px; border-bottom: none; }

.stmt-section-hdr td {
  background: var(--surface-2);
  font-size: 0.78rem;
  padding: 5px 8px;
  border-bottom: 1px solid var(--border);
}

.stmt-row-calc td { background: color-mix(in srgb, var(--primary-light) 40%, var(--surface)); }

.stmt-val, .stmt-detail, .stmt-total { text-align: right; }
.stmt-detail { color: var(--text-muted); }

/* Input inside table cell */
.stmt-input {
  width: 90px;
  text-align: right;
  border: 1.5px solid var(--primary);
  border-radius: 4px;
  padding: 3px 6px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.875rem;
  font-family: inherit;
}

.stmt-input:focus { outline: none; box-shadow: 0 0 0 3px var(--primary-light); }

.stmt-input-sm { width: 72px; }

/* Check badges after reveal */
.stmt-check {
  font-size: 0.82rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  white-space: nowrap;
}

.stmt-check-ok  { background: var(--rate-green); color: #fff; }
.stmt-check-bad { background: var(--rate-red);   color: #fff; }

/* F / A variance badges */
.fa-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 3px;
  margin-left: 4px;
  vertical-align: middle;
}
.fa-f { background: var(--rate-green); color: #fff; }
.fa-a { background: var(--rate-red);   color: #fff; }

.stmt-input-var { width: 90px; }

/* SFP two-column */
.stmt-two-col .stmt-detail-col { width: 90px; }
.stmt-two-col .stmt-val-col    { width: 100px; }

/* Cash flow scrollable wrapper on small screens */
.stmt-cf-scroll { overflow-x: auto; }

.stmt-cf th, .stmt-cf td { min-width: 80px; }

/* Figures list (work from figures mode) */
.figures-list {
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 4px;
}

.figures-heading {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.fig-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
  gap: 16px;
}

.fig-row:last-child { border-bottom: none; }

.fig-label { font-size: 0.875rem; color: var(--text); }
.fig-val   { font-size: 0.875rem; font-weight: 700; color: var(--text); white-space: nowrap; }

/* Make me hunt — decoy block */
.decoy-block {
  background: var(--surface-2);
  border-left: 3px solid var(--rate-amber);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 10px 14px;
  margin-bottom: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: center;
}

.decoy-heading {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--rate-amber);
  width: 100%;
}

.decoy-item {
  font-size: 0.82rem;
  display: flex;
  gap: 6px;
}

.decoy-label { color: var(--text-muted); }
.decoy-val   { font-weight: 700; color: var(--text); }

/* ============================================================
   Teacher Dashboard
   ============================================================ */
.teacher-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  border-bottom: 2px solid var(--border);
}

.teacher-tab {
  padding: 10px 18px;
  font-weight: 800;
  font-size: 0.875rem;
  color: var(--text-muted);
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: color 0.15s, border-color 0.15s;
}

.teacher-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.teacher-tab:hover { color: var(--text); }

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.data-table th {
  background: var(--surface-2);
  padding: 10px 14px;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.data-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
  font-weight: 600;
}

.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--surface-2); }

/* ============================================================
   Toast
   ============================================================ */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--navy);
  color: white;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.875rem;
  z-index: 999;
  border-left: 4px solid var(--primary);
  animation: toastIn 0.3s ease, toastOut 0.3s ease 2.3s forwards;
}

@keyframes toastIn {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
@keyframes toastOut {
  to { transform: translateY(20px); opacity: 0; }
}

/* ============================================================
   Coming Soon (shell pages)
   ============================================================ */
.coming-soon {
  max-width: 480px;
  margin: 80px auto;
  text-align: center;
}

.coming-soon-emoji {
  font-size: 3.5rem;
  margin-bottom: 16px;
}

.coming-soon h2 {
  font-family: 'Fraunces', serif;
  font-weight: 900;
  font-size: 1.6rem;
  color: var(--text);
  margin-bottom: 8px;
}

.coming-soon p {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.6;
  font-weight: 600;
}

/* ============================================================
   Utility
   ============================================================ */
.hidden { display: none !important; }
.text-muted { color: var(--text-muted); }
.mt-16 { margin-top: 16px; }
.flex { display: flex; }
.gap-8 { gap: 8px; }

/* Mobile menu button — hidden on desktop, shown via media query */
.mobile-menu-btn { display: none; }

/* ============================================================
   Responsive — tablet (≤900px)
   ============================================================ */
@media (max-width: 900px) {
  :root { --sidebar-w: 190px; }

  .main-content { padding: 20px 18px; }

  .stats-row {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }
}

/* ============================================================
   Responsive — mobile (≤640px)
   ============================================================ */
@media (max-width: 640px) {
  :root { --sidebar-w: 0px; }

  /* Sidebar slides off-screen; toggled by .sidebar-open on body */
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    width: 220px;
    z-index: 200;
  }
  body.sidebar-open .sidebar {
    transform: translateX(0);
  }

  /* Overlay when sidebar is open */
  body.sidebar-open::after {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 199;
  }

  /* Main content fills full width */
  .main-content {
    margin-left: 0;
    padding: 16px 14px;
    width: 100%;
  }

  /* Hamburger toggle — shown only on mobile */
  .mobile-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    background: var(--surface);
    border: 1px solid var(--border);
    font-size: 1.1rem;
    cursor: pointer;
    position: fixed;
    top: 14px;
    left: 14px;
    z-index: 201;
    color: var(--text);
  }

  .page-header { margin-top: 44px; }

  /* Dashboard grids — drop history dots on mobile, keep name + rating + count */
  .skill-subrow,
  .topic-row {
    grid-template-columns: 1fr auto 32px;
  }
  .skill-subrow .history-dots,
  .topic-row .history-dots {
    display: none;
  }

  /* Cluster row text size */
  .cluster-name { font-size: 0.78rem; }

  /* Stats row stacks to 1 column */
  .stats-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  /* Practice screens */
  .rating-options {
    flex-wrap: wrap;
  }
  .rating-option {
    flex: 0 0 calc(50% - 5px);
    max-width: none;
  }

  /* Login page stacks vertically */
  .login-page {
    flex-direction: column;
  }
  .login-brand {
    padding: 32px 24px 20px;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .login-form-container {
    padding: 24px;
  }
}
.align-center { align-items: center; }

/* View transition: sidebar frozen, main content fades */
::view-transition-old(sidebar),
::view-transition-new(sidebar) { animation: none; }

/* ── Cluster inline practice buttons ── */
.cluster-practice-btns {
  display: flex;
  gap: 5px;
  align-items: center;
  flex-shrink: 0;
}

.cpb2 {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 20px;
  border: 1.5px solid transparent;
  text-align: center;
  letter-spacing: 0.02em;
  transition: background 0.12s, color 0.12s;
  line-height: 1.4;
  cursor: pointer;
  white-space: nowrap;
}
.cpb2:hover {
  filter: brightness(0.93);
}

.cpb2-defs {
  background: var(--primary-light);
  color: var(--primary-dark);
  border-color: var(--primary);
}
.cpb2-defs:hover { background: var(--primary); color: #fff; }

.cpb2-calc {
  background: rgba(66, 133, 244, 0.12);
  color: #2a5fbf;
  border-color: #4285F4;
}
.cpb2-calc:hover { background: #4285F4; color: #fff; }

.cpb2-stmt {
  background: rgba(69, 184, 0, 0.12);
  color: #2e7a00;
  border-color: var(--rate-green);
}
.cpb2-stmt:hover { background: var(--rate-green); color: #fff; }

[data-theme="dark"] .cpb2-calc { color: #7aadff; }
[data-theme="dark"] .cpb2-stmt { color: #7ddd45; }

/* ── Stmt mode picker in practice modal ── */
.pm-mode-btns {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.pm-mode-btn {
  flex: 1;
  min-width: 100px;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 8px 10px;
  border-radius: 8px;
  border: 2px solid var(--border);
  background: var(--surface-2);
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s, color 0.12s;
}
.pm-mode-btn.selected {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary-dark);
}

/* ── Practice modal ── */
.pm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.pm-overlay.hidden { display: none; }

.pm-box {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 28px 28px 24px;
  position: relative;
}

.pm-close {
  position: absolute;
  top: 12px;
  right: 16px;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--text-muted);
  padding: 4px 8px;
}
.pm-close:hover { color: var(--text); }

.pm-header { margin-bottom: 16px; }

.pm-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 3px 10px;
  border-radius: 20px;
  margin-bottom: 8px;
}
.pm-badge-defs { background: var(--primary-light); color: var(--primary-dark); }
.pm-badge-calc { background: rgba(66,133,244,0.12); color: #2a5fbf; }
[data-theme="dark"] .pm-badge-calc { color: #7aadff; }

.pm-header h3 {
  font-family: 'Fraunces', serif;
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0;
}

#pm-session .def-card { box-shadow: none; border: 1.5px solid var(--border); }

/* Disabled mode button (e.g. Make me hunt when Fill in blanks is active) */
.mode-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* History dot is clickable when it has detail data */
.history-dot[data-has-detail] {
  cursor: pointer;
}
.history-dot[data-has-detail]:hover {
  transform: scale(1.35);
  transition: transform 0.1s;
}

/* ============================================================
   Help modal
   ============================================================ */
.help-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s;
}
.help-overlay.visible {
  opacity: 1;
  pointer-events: all;
}
.help-modal {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 28px 28px 24px;
  max-width: 460px;
  width: 92%;
  position: relative;
  max-height: 82vh;
  overflow-y: auto;
}
.help-close {
  position: absolute;
  top: 12px;
  right: 16px;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--text-muted);
  padding: 4px;
}
.help-close:hover { color: var(--text); }
.help-modal h3 {
  font-family: 'Fraunces', serif;
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 18px;
  color: var(--text);
  padding-right: 24px;
}
.help-item {
  margin-bottom: 13px;
}
.help-item strong {
  display: block;
  font-weight: 800;
  font-size: 0.875rem;
  color: var(--text);
  margin-bottom: 2px;
}
.help-item span {
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Count label (above count picker) */
.count-label {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-bottom: 10px;
}

/* Help button on setup screens */
.btn-help {
  margin-top: 12px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  display: inline-block;
}
.btn-help:hover { color: var(--primary); }

/* ============================================================
   MCQ practice button (dashboard)
   ============================================================ */
.cpb2-mcq {
  background: rgba(139, 92, 246, 0.12);
  color: #6d28d9;
  border-color: #8b5cf6;
}
.cpb2-mcq:hover { background: #8b5cf6; color: #fff; }
[data-theme="dark"] .cpb2-mcq { color: #c4b5fd; }

/* ============================================================
   Understanding page — setup
   ============================================================ */
.uq-setup-wrap {
  max-width: 660px;
}

.uq-section-label {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.uq-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 6px;
}

.uq-chip {
  padding: 7px 14px;
  border-radius: 50px;
  border: 2px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 700;
  transition: border-color 0.14s, background 0.14s, color 0.14s;
}
.uq-chip:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.uq-chip.selected {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary-dark);
}

.uq-avail {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 20px;
  margin-top: 2px;
}

/* ============================================================
   Understanding page — session
   ============================================================ */
.uq-session-wrap {
  max-width: 660px;
}

.uq-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 28px;
  box-shadow: var(--shadow);
}

.uq-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.uq-topic-tag {
  font-size: 0.68rem;
  font-weight: 800;
  background: var(--surface-2);
  color: var(--text-muted);
  padding: 3px 8px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.uq-type-tag {
  font-size: 0.68rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 20px;
  letter-spacing: 0.03em;
}
.uq-type-interpretation { background: rgba(66,133,244,0.12); color: #2a5fbf; }
.uq-type-strategy        { background: rgba(244,166,41,0.14); color: var(--primary-dark); }
.uq-type-scenario        { background: rgba(69,184,0,0.12);   color: #2e7a00; }
.uq-type-purposestakeholder { background: rgba(139,92,246,0.12); color: #6d28d9; }

[data-theme="dark"] .uq-type-interpretation { color: #7aadff; }
[data-theme="dark"] .uq-type-strategy       { color: var(--primary); }
[data-theme="dark"] .uq-type-scenario       { color: #7ddd45; }
[data-theme="dark"] .uq-type-purposestakeholder { color: #c4b5fd; }

.uq-counter {
  margin-left: auto;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
}

.uq-question {
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.55;
  margin-bottom: 20px;
}

.uq-options {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-bottom: 14px;
}

.uq-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  text-align: left;
  transition: border-color 0.14s, background 0.14s;
  width: 100%;
}
.uq-option:not(:disabled):hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.uq-opt-letter {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 900;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: background 0.14s, border-color 0.14s, color 0.14s;
}

.uq-opt-text {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.45;
}

/* Answer states */
.uq-opt-correct {
  border-color: var(--rate-green) !important;
  background: rgba(69,184,0,0.1) !important;
}
.uq-opt-correct .uq-opt-letter {
  background: var(--rate-green);
  border-color: var(--rate-green);
  color: #fff;
}

.uq-opt-wrong {
  border-color: var(--rate-red) !important;
  background: rgba(255,75,75,0.09) !important;
}
.uq-opt-wrong .uq-opt-letter {
  background: var(--rate-red);
  border-color: var(--rate-red);
  color: #fff;
}

.uq-opt-neutral {
  opacity: 0.38;
}

.uq-opt-removed {
  opacity: 0.18;
  pointer-events: none;
  text-decoration: line-through;
}

.uq-actions {
  text-align: center;
  margin-bottom: 4px;
}

.uq-narrow-btn {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 4px 0;
}
.uq-narrow-btn:hover { color: var(--text); }

.uq-explanation {
  margin-top: 16px;
  padding: 14px 18px;
  background: var(--surface-2);
  border-left: 4px solid var(--primary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  animation: fadeSlideIn 0.25s ease;
}
.uq-explanation.hidden { display: none; }

.uq-exp-label {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--primary);
  margin-bottom: 6px;
}

.uq-exp-text {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.55;
}

/* ============================================================
   Understanding page — done screen
   ============================================================ */
.uq-done-card {
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 36px;
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.uq-done-score {
  font-family: 'Fraunces', serif;
  font-size: 2.8rem;
  font-weight: 900;
  color: var(--text);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.uq-done-pct {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 28px;
}

.uq-done-btns {
  display: flex;
  gap: 10px;
  justify-content: center;
}
