/* ===== VARIABLES ===== */
:root {
  --bg: #0d0d0f;
  --bg2: #141417;
  --bg3: #1c1c21;
  --surface: #1e1e24;
  --surface2: #26262e;
  --border: #2e2e38;
  --text: #f0f0f5;
  --text2: #9090a8;
  --text3: #5a5a72;
  --accent: #5b7af5;
  --accent2: #9d8fff;
  --accent-glow: rgba(91, 122, 245, 0.2);
  --green: #3ecf7a;
  --red: #f44c60;
  --yellow: #f5a623;
  --blue: #4a9eff;
  --quant-color: #5b7af5;
  --lrdi-color: #3ecf7a;
  --varc-color: #4a9eff;
  --radius: 14px;
  --radius-sm: 8px;
  --sidebar-w: 240px;
  --passage-font-size: 15px;
  --font-display: 'Syne', sans-serif;
  --font-body: 'DM Sans', sans-serif;
  --font-mono: 'DM Mono', monospace;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  /* V2 fix-mode phase colors */
  --fix-p1-color: #f44c60;
  --fix-p1-bg: rgba(244, 76, 96, 0.07);
  --fix-p1-border: rgba(244, 76, 96, 0.3);
  --fix-p2-color: #5b7af5;
  --fix-p2-bg: rgba(91, 122, 245, 0.07);
  --fix-p2-border: rgba(91, 122, 245, 0.3);
  --orange: #f59e0b;
  --orange-bg: rgba(245, 158, 11, 0.1);
  --orange-border: rgba(245, 158, 11, 0.35);
}

[data-theme="light"] {
  --bg: #f4f4f8;
  --bg2: #eaeaf0;
  --bg3: #e0e0ea;
  --surface: #ffffff;
  --surface2: #f0f0f7;
  --border: #dcdce8;
  --text: #16161e;
  --text2: #5a5a72;
  --text3: #9090a8;
  --accent: #5b7af5;
  --accent2: #8b7fff;
  --accent-glow: rgba(91, 122, 245, 0.12);
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
}

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

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

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background 0.3s, color 0.3s;
}


/* ===== SCREENS ===== */
.screen {
  display: none;
}

.screen.active {
  display: block;
}

/* ===== AUTH ===== */
#auth-screen {
  min-height: 100vh;
  position: relative;
}

#auth-screen.active {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 9000;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.auth-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.auth-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.25;
  animation: float 8s ease-in-out infinite;
}

.orb1 {
  width: 400px;
  height: 400px;
  background: var(--accent);
  top: -100px;
  left: -100px;
}

.orb2 {
  width: 300px;
  height: 300px;
  background: var(--blue);
  bottom: -50px;
  right: -50px;
  animation-delay: -3s;
}

.orb3 {
  width: 200px;
  height: 200px;
  background: var(--green);
  top: 50%;
  left: 50%;
  animation-delay: -5s;
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0) scale(1)
  }

  50% {
    transform: translateY(-20px) scale(1.04)
  }
}

.auth-container {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  width: 100%;
  max-width: 420px;
  padding: 2rem;
}

.auth-brand {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-align: center;
}

.brand-icon {
  font-size: clamp(1.4rem, 4vw, 2.2rem);
}

.auth-brand h1 {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 4vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -1px;
  background: linear-gradient(135deg, var(--accent2), var(--blue));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.auth-brand p {
  color: var(--text2);
  margin-top: 0.25rem;
}

.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  width: 100%;
  box-shadow: var(--shadow);
}

.auth-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.auth-tab {
  flex: 1;
  padding: 0.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text2);
  font-family: var(--font-body);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}

.auth-tab.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.auth-form {
  display: none;
  flex-direction: column;
  gap: 1rem;
}

.auth-form.active {
  display: flex;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-group label {
  font-size: 0.8rem;
  color: var(--text2);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-group input,
.filter-select {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.7rem 1rem;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
  width: 100%;
}

.form-group input:focus,
.filter-select:focus {
  border-color: var(--accent);
}

/* ── Subtopic pill row ───────────────────────────────────────── */
.subtopic-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding: 0.75rem 0 0.25rem;
  width: 100%;
}

.subtopic-pill {
  font-size: 0.78rem;
  font-weight: 500;
  padding: 0.32rem 0.85rem;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text2);
  cursor: pointer;
  font-family: var(--font-body);
  transition: all 0.15s ease;
  user-select: none;
  line-height: 1.4;
}

.subtopic-pill:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(91, 122, 245, 0.06);
}

.subtopic-pill.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}

/* Strict-match toggle */
.filter-match-all-label {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.78rem;
  color: var(--text3);
  cursor: pointer;
  padding: 0.2rem 0;
  width: 100%;
}

.filter-match-all-label input[type="checkbox"] {
  accent-color: var(--accent);
  width: 13px;
  height: 13px;
  cursor: pointer;
}

.auth-error {
  background: rgba(244, 76, 96, 0.1);
  border: 1px solid var(--red);
  color: var(--red);
  padding: 0.7rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}

.auth-success {
  background: rgba(52, 168, 83, 0.1);
  border: 1px solid #34a853;
  color: #34a853;
  padding: 0.7rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}

.auth-hint {
  font-size: 0.85rem;
  color: var(--text2);
  margin: 0;
}

.forgot-pw-link {
  display: flex;
  justify-content: flex-end;
  margin-top: -0.25rem;
}

.auth-text-btn {
  background: none;
  border: none;
  color: var(--accent);
  font-family: var(--font-body);
  font-size: 0.82rem;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: opacity 0.15s;
}

.auth-text-btn:hover { opacity: 0.75; }

.auth-text-btn--center {
  text-align: center;
  width: 100%;
  display: block;
  padding: 0.25rem 0;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text3);
  font-size: 0.78rem;
  margin: 0.25rem 0;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.72rem 1rem;
  background: #fff;
  border: 1px solid #dadce0;
  border-radius: var(--radius-sm);
  color: #3c4043;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: box-shadow 0.15s, background 0.15s;
}

.btn-google:hover {
  background: #f8f9fa;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}

/* ===== BUTTONS ===== */
.btn-primary {
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.8rem 1.5rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
}

.btn-primary:hover {
  background: var(--accent2);
  transform: translateY(-1px);
}

.btn-demo {
  background: transparent;
  color: var(--text2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.8rem;
  font-family: var(--font-body);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
  margin-top: 0.5rem;
}

.btn-demo:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  cursor: pointer;
  font-family: var(--font-body);
  transition: all 0.2s;
  width: auto;
}

.btn-sm:hover {
  border-color: var(--accent);
}

.btn-sm.btn-primary {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1rem;
  font-weight: 600;
}

.btn-nav {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.7rem 1.5rem;
  color: var(--text);
  font-family: var(--font-body);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-nav:hover,
.btn-nav.btn-primary {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.btn-danger {
  background: rgba(244, 76, 96, 0.12);
  border: 1px solid var(--red);
  color: var(--red);
  border-radius: var(--radius-sm);
  padding: 0.5rem 1rem;
  font-family: var(--font-body);
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s;
}

.btn-danger:hover {
  background: var(--red);
  color: white;
}

.icon-btn {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.6rem;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  transition: all 0.2s;
}

.icon-btn:hover {
  border-color: var(--accent);
}

.icon-btn.active {
  border-color: var(--accent);
  background: var(--accent-glow);
}

/* ===== APP LAYOUT ===== */
#app-screen {
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  transition: transform 0.3s ease;
}

.sidebar.hidden {
  transform: translateX(-100%);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 90;
  backdrop-filter: blur(2px);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.5rem 1.25rem;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent);
}

.sidebar-nav {
  flex: 1;
  padding: 1rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  color: var(--text2);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: all 0.2s;
}

.nav-item:hover {
  background: var(--surface2);
  color: var(--text);
}

.nav-item.active {
  background: var(--accent-glow);
  color: var(--accent);
  border-left-color: var(--accent);
}

.nav-icon {
  font-size: 1.1rem;
}

.nav-badge {
  margin-left: auto;
  background: var(--red);
  color: white;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 10px;
  font-family: var(--font-mono);
}

.sidebar-bottom {
  padding: 1rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.daily-goal-mini {
  background: var(--surface2);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
}

.goal-label {
  font-size: 0.75rem;
  color: var(--text2);
  display: block;
  margin-bottom: 0.4rem;
}

.goal-bar {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.goal-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.5s;
}

.goal-count {
  font-size: 0.75rem;
  color: var(--text2);
  display: block;
  margin-top: 0.3rem;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.user-info {
  flex: 1;
  min-width: 0;
}

.user-name {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-sub {
  display: block;
  font-size: 0.7rem;
  color: var(--text2);
}

.logout-btn {
  background: none;
  border: none;
  color: var(--text3);
  cursor: pointer;
  font-size: 1rem;
  padding: 0.25rem;
  transition: color 0.2s;
}

.logout-btn:hover {
  color: var(--red);
}

/* ===== MAIN CONTENT ===== */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
}

.top-bar {
  position: sticky;
  top: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 0.5rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 50;
}

.hamburger {
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.25rem;
  cursor: pointer;
  display: none;
}

.top-bar-right {
  display: flex;
  gap: 0.75rem;
}

.theme-toggle {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.6rem;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s;
}

/* ===== PAGES ===== */
.page {
  display: none;
  padding: 1.5rem 2rem 3rem;
  max-width: 1100px;
}

.page.active {
  display: block;
}

.page-header {
  margin-bottom: 1.5rem;
}

.page-title {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.page-sub {
  color: var(--text2);
  margin-top: 0.2rem;
  font-size: 0.9rem;
}

/* ===== DASHBOARD ===== */
/* MVP: 2-column stats grid (only 2 visible, others hidden in HTML) */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  transition: transform 0.2s;
}

.stat-card:hover {
  transform: translateY(-2px);
}

.stat-card.accent {
  border-color: var(--accent);
  background: linear-gradient(135deg, var(--surface), rgba(91, 122, 245, 0.07));
}

.stat-icon {
  font-size: 1.25rem;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text2);
}

.dash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.dash-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

/* ===== DASHBOARD: tighten spacing so it fits without scrolling ===== */
#page-dashboard {
  padding-top: 1rem;
  padding-bottom: 1rem;
}

#page-dashboard .page-header {
  margin-bottom: 0.9rem;
}

#page-dashboard .page-title {
  font-size: 1.4rem;
}

#page-dashboard .stats-grid {
  gap: 0.75rem;
  margin-bottom: 1rem;
}

#page-dashboard .stat-card {
  padding: 1rem;
  gap: 0.25rem;
}

#page-dashboard .stat-icon {
  font-size: 1.1rem;
}

#page-dashboard .stat-value {
  font-size: 1.5rem;
}

#page-dashboard .dash-grid {
  gap: 1rem;
}

#page-dashboard .dash-card {
  padding: 1.1rem;
}

#page-dashboard .fix-cta-banner {
  padding: 0.9rem 1.25rem;
  margin-bottom: 1rem;
}

/* ===== FIX MY MISTAKES CTA BANNER ===== */
.fix-cta-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: linear-gradient(135deg, rgba(244, 76, 96, 0.12), rgba(91, 122, 245, 0.1));
  border: 1px solid rgba(244, 76, 96, 0.3);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.fix-cta-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.fix-cta-icon {
  font-size: 2rem;
}

.fix-cta-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}

.fix-cta-sub {
  font-size: 0.8rem;
  color: var(--text2);
  margin-top: 0.15rem;
}

.btn-fix-mistakes {
  background: linear-gradient(135deg, var(--red), #c62a42);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.75rem 1.5rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  letter-spacing: 0.01em;
  box-shadow: 0 4px 16px rgba(244, 76, 96, 0.3);
}

.btn-fix-mistakes:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(244, 76, 96, 0.45);
}

.card-title {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.daily-goal-display {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.goal-circle {
  position: relative;
  width: 100px;
  height: 100px;
  flex-shrink: 0;
}

.goal-circle svg {
  transform: rotate(-90deg);
}

.goal-track {
  fill: none;
  stroke: var(--border);
  stroke-width: 8;
}

.goal-progress {
  fill: none;
  stroke: var(--accent);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 264;
  stroke-dashoffset: 264;
  transition: stroke-dashoffset 0.6s ease;
}

.goal-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.goal-center span {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
}

.goal-center small {
  color: var(--text2);
  font-size: 0.75rem;
}

.goal-setter {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0.5rem 0;
}

.goal-adj {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  width: 28px;
  height: 28px;
  cursor: pointer;
  color: var(--text);
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.goal-adj:hover {
  border-color: var(--accent);
}

#goal-target-val {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  min-width: 30px;
  text-align: center;
}

.subject-bars {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.subject-bar-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
}

.subject-bar-item>span:first-child {
  width: 45px;
  color: var(--text2);
}

.bar-wrap {
  flex: 1;
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s ease;
}

.bar-fill.quant {
  background: var(--quant-color);
}

.bar-fill.lrdi {
  background: var(--lrdi-color);
}

.bar-fill.varc {
  background: var(--varc-color);
}

.subject-bar-item>span:last-child {
  width: 35px;
  text-align: right;
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.weak-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.weak-topic-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.75rem;
  background: rgba(244, 76, 96, 0.07);
  border: 1px solid rgba(244, 76, 96, 0.2);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  transition: transform 0.15s;
}

.weak-topic-item:hover {
  transform: translateX(2px);
}

.weak-topic-left {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.weak-topic-rank {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--red);
  font-weight: 700;
  opacity: 0.8;
}

.weak-topic-name {
  color: var(--text);
}

.weak-topic-badge {
  background: rgba(244, 76, 96, 0.15);
  color: var(--red);
  font-size: 0.72rem;
  padding: 0.15rem 0.5rem;
  border-radius: 20px;
  font-family: var(--font-mono);
  font-weight: 600;
}

.weak-topic-pct {
  color: var(--red);
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.8rem;
}

.weak-rank-1 .weak-topic-rank {
  color: var(--red);
}

.weak-rank-2 .weak-topic-rank {
  color: var(--yellow);
}

.weak-rank-3 .weak-topic-rank {
  color: var(--text2);
}

.activity-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.activity-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
  color: var(--text2);
  padding: 0.3rem 0;
  border-bottom: 1px solid var(--border);
}

.activity-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

.empty-state {
  color: var(--text3);
  font-size: 0.85rem;
  font-style: italic;
}

/* ===== FILTER BAR ===== */
/* ── Practice topbar (filter toggle) ─────────────────────────── */
.practice-topbar {
  display: flex;
  align-items: center;
  margin-bottom: 0.5rem;
}

.filter-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 1rem;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--bg3);
  color: var(--text1);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  letter-spacing: 0.01em;
}

/* Stands out when closed — signals it's interactive */
.filter-toggle-btn:not(.is-open) {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(91, 122, 245, 0.08);
}

.filter-toggle-btn:hover {
  background: rgba(91, 122, 245, 0.15);
  border-color: var(--accent);
  color: var(--accent);
}

.filter-toggle-btn .ftb-chevron {
  transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  transform: rotate(0deg);
}

.filter-toggle-btn:not(.is-open) .ftb-chevron {
  transform: rotate(-90deg);
}


/* ── Collapsible filter panel ─────────────────────────────────── */
.filter-panel {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
  overflow: hidden;
  max-height: 300px;
  opacity: 1;
  margin-bottom: 1.5rem;
  margin-top: 0.5rem;
  transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.2s ease,
              margin 0.2s ease;
}

.filter-panel.collapsed {
  max-height: 0;
  opacity: 0;
  margin-top: 0;
  margin-bottom: 0;
}

.filter-bar {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
  align-items: center;
}

.filter-select {
  width: auto;
}

/* ===== QUESTION CARD ===== */
.practice-mode-badge {
  display: inline-block;
  background: var(--accent-glow);
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 0.35rem 0.8rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.q-meta-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.q-counter {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text2);
  background: var(--surface2);
  padding: 0.3rem 0.75rem;
  border-radius: 20px;
  border: 1px solid var(--border);
}

.q-timer {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text2);
  margin-left: auto;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.2rem 0.6rem;
  letter-spacing: 0.04em;
  transition: color 0.4s, border-color 0.4s, background 0.4s;
}

.q-timer.timer-warn {
  color: var(--amber);
  border-color: rgba(245, 158, 11, 0.4);
  background: rgba(245, 158, 11, 0.06);
}

.q-timer.timer-urgent {
  color: var(--red);
  border-color: rgba(244, 76, 96, 0.4);
  background: rgba(244, 76, 96, 0.06);
}

.q-tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.tag {
  padding: 0.25rem 0.6rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--accent-glow);
  color: var(--accent);
  border: 1px solid rgba(91, 122, 245, 0.3);
}

.tag-topic {
  background: rgba(74, 158, 255, 0.1);
  color: var(--blue);
  border-color: rgba(74, 158, 255, 0.3);
}

.tag-diff {
  background: rgba(245, 166, 35, 0.1);
  color: var(--yellow);
  border-color: rgba(245, 166, 35, 0.3);
}

.tag-diff.easy {
  background: rgba(62, 207, 122, 0.1);
  color: var(--green);
  border-color: rgba(62, 207, 122, 0.3);
}

.tag-diff.hard {
  background: rgba(244, 76, 96, 0.1);
  color: var(--red);
  border-color: rgba(244, 76, 96, 0.3);
}

.tag-type {
  background: rgba(245, 166, 35, 0.1);
  color: var(--yellow);
  border-color: rgba(245, 166, 35, 0.3);
}

.q-actions {
  display: flex;
  gap: 0.4rem;
}

.question-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  margin-bottom: 1rem;
}

.question-text {
  font-size: 1.05rem;
  line-height: 1.75;
  margin-bottom: 1.5rem;
}

.passage-context {
  background: rgba(74, 158, 255, 0.05);
  border: 1px solid rgba(74, 158, 255, 0.2);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
}

.passage-context.is-sticky {
  position: sticky;
  top: 65px;
  z-index: 2;
  background: #111827;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}

/* Inner wrapper for structured passage content — always a bounded scroll box */
.passage-box {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 200px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.passage-box.has-scroll {
  max-height: 200px;
  overflow-y: auto;
}

/* "Show full passage" state — taller but still bounded so it never covers options */
.passage-box.expanded {
  max-height: 55vh;
}

/* Row: label on left, font-size controls on right */
.passage-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.passage-context-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--blue);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.passage-font-controls {
  display: flex;
  gap: 0.25rem;
  align-items: center;
}

.passage-font-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text2);
  border-radius: 4px;
  width: 22px;
  height: 22px;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, border-color 0.15s;
  font-family: var(--font-body);
}
.passage-font-btn:hover:not(:disabled) { color: var(--text); border-color: var(--text2); }
.passage-font-btn:disabled { opacity: 0.3; cursor: default; }

.passage-context-text,
.passage-body {
  font-size: var(--passage-font-size, 15px);
  line-height: 1.75;
  color: var(--text2);
}

.rc-para {
  margin-bottom: 14px;
  line-height: 1.7;
}

/* Instruction text shown above the passage for RC/LRDI sets */
.passage-instruction {
  font-size: 0.8rem;
  color: var(--text3);
  font-style: italic;
  margin-bottom: 0.6rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.passage-toggle-btn {
  display: block;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text2);
  font-size: 0.75rem;
  font-family: var(--font-body);
  padding: 0.35rem 0.75rem;
  cursor: pointer;
  margin-top: 0.5rem;
  width: 100%;
  transition: color 0.15s, border-color 0.15s;
}
.passage-toggle-btn:hover { color: var(--text); border-color: var(--text2); }

/* passage-collapsed class is no longer used — passage is always a scroll box */

.first-session-nudge {
  background: rgba(91, 122, 245, 0.08);
  border: 1px solid rgba(91, 122, 245, 0.25);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  font-size: 0.83rem;
  color: var(--text2);
  line-height: 1.5;
  margin-bottom: 1rem;
}
.first-session-nudge strong { color: var(--accent); }

/* Images inside the passage block */
.passage-image-wrap {
  margin-top: 0.75rem;
  text-align: center;
}

.passage-img {
  max-width: 100%;
  max-height: 280px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

/* Solution diagram shown below solution text */
.solution-img-wrap {
  margin-top: 0.75rem;
  text-align: center;
}

.solution-img {
  max-width: 100%;
  max-height: 300px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.options-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.option-btn {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 1.25rem;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--text);
  text-align: left;
  transition: all 0.2s;
  width: 100%;
}

.option-btn:hover:not(.disabled) {
  border-color: var(--accent);
  background: var(--accent-glow);
}

.option-btn.selected {
  border-color: var(--accent);
  background: var(--accent-glow);
}

.option-btn.correct {
  border-color: var(--green);
  background: rgba(62, 207, 122, 0.1);
}

.option-btn.wrong {
  border-color: var(--red);
  background: rgba(244, 76, 96, 0.1);
}

.option-btn.disabled {
  cursor: default;
  pointer-events: none;
}

/* Unchosen options fade out so correct/wrong stand out */
.option-btn.disabled:not(.correct):not(.wrong) {
  opacity: 0.38;
}

/* "your answer" / "correct" right-side labels */
.option-btn.wrong::after {
  content: 'your answer';
  margin-left: auto;
  font-size: 0.72rem;
  color: #f44c60;
  color: var(--red);
  font-weight: 500;
  white-space: nowrap;
}

.option-btn.correct::after {
  content: 'correct';
  margin-left: auto;
  font-size: 0.72rem;
  color: var(--green);
  font-weight: 500;
  white-space: nowrap;
}

.option-label {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--surface2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.85rem;
  flex-shrink: 0;
  font-family: var(--font-mono);
}

.option-btn.correct .option-label {
  background: var(--green);
  color: white;
}

.option-btn.wrong .option-label {
  background: var(--red);
  color: white;
}

.option-btn.selected .option-label {
  background: var(--accent);
  color: white;
}

/* TITA */
.tita-area {
  margin-bottom: 1rem;
}

.tita-label {
  font-size: 0.85rem;
  color: var(--text2);
  margin-bottom: 0.5rem;
}

.tita-input-row {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.tita-input {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 1.1rem;
  width: 180px;
  outline: none;
  transition: border-color 0.2s;
}

.tita-input:focus {
  border-color: var(--accent);
}

.hint-toggle-wrap {
  margin-bottom: 1rem;
}

.btn-hint {
  background: rgba(245, 166, 35, 0.1);
  border: 1px solid rgba(245, 166, 35, 0.3);
  color: var(--yellow);
  border-radius: var(--radius-sm);
  padding: 0.5rem 1rem;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.85rem;
  transition: all 0.2s;
}

.btn-hint:hover {
  background: rgba(245, 166, 35, 0.2);
}

.hint-box {
  background: rgba(245, 166, 35, 0.06);
  border: 1px solid rgba(245, 166, 35, 0.2);
  border-radius: var(--radius-sm);
  padding: 1rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.answer-area {
  margin-top: 1.25rem;
}

.solution-box {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
}

.solution-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.show-solution-btn {
  margin-left: auto;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.9rem;
  font-family: var(--font-body);
  font-size: 0.82rem;
  color: var(--text2);
  cursor: pointer;
  transition: all 0.2s;
}

.show-solution-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.correct-badge {
  background: var(--green);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}

.correct-badge.wrong-badge {
  background: var(--red);
}

.correct-ans {
  font-size: 0.9rem;
  color: var(--text2);
}

.solution-text {
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--text2);
}

.note-area {
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 1rem;
  margin-bottom: 1rem;
}

.note-area textarea {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.9rem;
  resize: vertical;
  min-height: 70px;
  outline: none;
}

.note-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.practice-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

/* ===== INLINE ERROR TAGGING PANEL ===== */
.error-tag-inline {
  margin-top: 1rem;
  background: linear-gradient(135deg, rgba(244, 76, 96, 0.05), rgba(91, 122, 245, 0.03));
  border: 1px solid rgba(244, 76, 96, 0.2);
  border-radius: var(--radius-sm);
  padding: 0.9rem 1rem;
  animation: slideUp 0.2s ease;
}

.etag-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  margin-bottom: 0.65rem;
}

.etag-prompt {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.etag-hint {
  font-size: 0.72rem;
  color: var(--text3);
}

/* Compact pill row — replaces old 2-column card grid */
.etag-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.etag-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.65rem 1.1rem;
  background: var(--surface2);
  border: 1.5px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  transition: all 0.15s;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.etag-btn:hover {
  transform: translateY(-1px);
}

/* Type-specific hover colors */
.etag-btn[data-type="concept_gap"]:hover {
  border-color: var(--accent);
  background: rgba(91, 122, 245, 0.12);
  color: var(--accent2);
  box-shadow: 0 2px 8px rgba(91, 122, 245, 0.2);
}

.etag-btn[data-type="calculation"]:hover {
  border-color: var(--red);
  background: rgba(244, 76, 96, 0.12);
  color: var(--red);
  box-shadow: 0 2px 8px rgba(244, 76, 96, 0.2);
}

.etag-btn[data-type="misread"]:hover {
  border-color: var(--blue);
  background: rgba(74, 158, 255, 0.12);
  color: var(--blue);
  box-shadow: 0 2px 8px rgba(74, 158, 255, 0.2);
}

.etag-btn[data-type="guess"]:hover {
  border-color: var(--yellow);
  background: rgba(245, 166, 35, 0.12);
  color: var(--yellow);
  box-shadow: 0 2px 8px rgba(245, 166, 35, 0.2);
}

/* Type-specific selected states */
.etag-btn[data-type="concept_gap"].selected {
  border-color: var(--accent);
  background: rgba(91, 122, 245, 0.18);
  color: var(--accent2);
  box-shadow: 0 0 0 3px rgba(91, 122, 245, 0.18);
}

.etag-btn[data-type="calculation"].selected {
  border-color: var(--red);
  background: rgba(244, 76, 96, 0.18);
  color: var(--red);
  box-shadow: 0 0 0 3px rgba(244, 76, 96, 0.18);
}

.etag-btn[data-type="misread"].selected {
  border-color: var(--blue);
  background: rgba(74, 158, 255, 0.18);
  color: var(--blue);
  box-shadow: 0 0 0 3px rgba(74, 158, 255, 0.18);
}

.etag-btn[data-type="guess"].selected {
  border-color: var(--yellow);
  background: rgba(245, 166, 35, 0.18);
  color: var(--yellow);
  box-shadow: 0 0 0 3px rgba(245, 166, 35, 0.18);
}

.etag-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none;
}

.etag-footer {
  display: flex;
  align-items: center;
  margin-top: 0.5rem;
}

.etag-skip {
  background: none;
  border: none;
  color: var(--text3);
  font-family: var(--font-body);
  font-size: 0.78rem;
  cursor: pointer;
  padding: 0.3rem 0;
  transition: color 0.2s;
  text-decoration: underline;
}

.etag-skip:hover {
  color: var(--text2);
}


/* SESSION SUMMARY */
.session-summary-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem;
  text-align: center;
  max-width: 560px;
}

.ss-hero {
  margin-bottom: 1.5rem;
}

.ss-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.6rem;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.ss-result-line {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 0.35rem;
  line-height: 1.2;
}

.ss-correct {
  color: var(--text);
}

.ss-dot {
  color: var(--text3);
  font-weight: 800;
  font-size: 1em;
  margin: 0 0.25em;
}

.ss-wrong-num {
  color: #f44c60;
  color: var(--fix-p1-color);
}

.ss-acc {
  font-size: 0.88rem;
  color: var(--text2);
  margin-top: 0;
}

.ss-diagnostic {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: #f59e0b;
  color: var(--orange);
  margin-bottom: 1.25rem;
}

.ss-text-cta {
  background: none;
  border: none;
  color: var(--text3);
  font-family: var(--font-body);
  font-size: 0.88rem;
  cursor: pointer;
  padding: 0.5rem 0;
  transition: color 0.15s;
}

.ss-text-cta:hover {
  color: var(--text2);
}

.ss-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.ss-stat {
  background: var(--bg2);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
}

.ss-stat-val {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
}

.ss-stat-label {
  font-size: 0.75rem;
  color: var(--text2);
  margin-top: 0.2rem;
}

.ss-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: center;
}

.ss-actions .btn-fix-mistakes {
  width: 100%;
  max-width: 320px;
}

/* ===== EMPTY ===== */
.empty-state-full {
  text-align: center;
  padding: 3rem;
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

/* ===== TEST MODE ===== */
.test-setup-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  max-width: 600px;
}

.test-setup-card h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
}

.test-config-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.test-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.timer-display {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--accent);
  min-width: 70px;
}

.timer-display.urgent {
  color: var(--red);
  animation: pulse 1s infinite;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1
  }

  50% {
    opacity: 0.6
  }
}

.test-progress {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.8rem;
  color: var(--text2);
}

.test-progress-bar {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.test-progress-bar div {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.3s;
}

.test-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1rem;
}

.test-q-dots {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  justify-content: center;
  flex: 1;
  padding: 0 1rem;
}

.q-dot {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface2);
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.7rem;
  font-family: var(--font-mono);
  display: flex;
  align-items: center;
  justify-content: center;
}

.q-dot.current {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
}

.q-dot.answered {
  border-color: var(--green);
  background: rgba(62, 207, 122, 0.15);
}

.results-hero {
  text-align: center;
  padding: 2.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
}

.results-score {
  font-family: var(--font-display);
  font-size: 4rem;
  font-weight: 800;
  color: var(--accent);
}

.results-label {
  font-size: 1rem;
  color: var(--text2);
}

.results-sub {
  font-size: 0.85rem;
  color: var(--text3);
  margin-top: 0.5rem;
  font-family: var(--font-mono);
}

.results-breakdown {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.result-q-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  font-size: 0.85rem;
  display: flex;
  gap: 0.75rem;
}

.result-q-item.correct {
  border-color: rgba(62, 207, 122, 0.3);
}

.result-q-item.wrong {
  border-color: rgba(244, 76, 96, 0.3);
}

/* ===== REVIEW ===== */
.review-tabs {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.rtab {
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: transparent;
  color: var(--text2);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.8rem;
  transition: all 0.15s;
}

.rtab.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.rtab:hover:not(.active) {
  border-color: var(--text2);
  color: var(--text);
}

.review-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.review-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.review-item.correct {
  border-left: 3px solid var(--green);
}

.review-item.wrong {
  border-left: 3px solid var(--red);
}

.review-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.review-result {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
}

.review-result.correct {
  background: rgba(62, 207, 122, 0.12);
  color: var(--green);
}

.review-result.wrong {
  background: rgba(244, 76, 96, 0.12);
  color: var(--red);
}

.review-question {
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  line-height: 1.6;
}

.review-answers {
  display: flex;
  gap: 1rem;
  font-size: 0.8rem;
  color: var(--text2);
  flex-wrap: wrap;
}

.review-ans-yours {
  color: var(--red);
}

.review-ans-correct {
  color: var(--green);
}

.review-solution {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text2);
  line-height: 1.6;
}

.review-note {
  margin-top: 0.5rem;
  background: rgba(245, 166, 35, 0.07);
  border: 1px solid rgba(245, 166, 35, 0.2);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
  font-size: 0.8rem;
  color: var(--yellow);
}

/* ===== ERROR LOG SCREEN ===== */
/* Summary grid — 4 type cards + 3 status cards = 7 max, responsive */
.error-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
}

.es-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem;
  text-align: center;
  transition: all 0.2s;
}

.es-card-clickable {
  cursor: pointer;
}

.es-card-clickable:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.es-card-active {
  box-shadow: 0 0 0 2px var(--accent) !important;
  background: var(--accent-glow) !important;
}

/* Error type card colors */
.es-card.concept_gap,
.es-card.conceptual {
  border-color: rgba(91, 122, 245, 0.4);
}

.es-card.calculation,
.es-card.silly {
  border-color: rgba(245, 166, 35, 0.4);
}

.es-card.misread {
  border-color: rgba(74, 158, 255, 0.4);
}

.es-card.guess,
.es-card.time {
  border-color: rgba(62, 207, 122, 0.4);
}

.es-card.unclassified {
  border-color: rgba(144, 144, 168, 0.3);
}

/* ===== ERROR LOG: CTA BANNER ===== */
/* ── S11 Biggest Issue block ──────────────────────────────────── */
.el-page-header .page-title {
  font-size: 1.4rem;
}

.el-biggest-issue {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: rgba(244, 76, 96, 0.07);
  border: 1px solid rgba(244, 76, 96, 0.3);
  border-left: 3px solid var(--fix-p1-color);
  border-radius: var(--radius);
  padding: 1.1rem 1.4rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.el-bi-content {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.el-bi-label {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text1);
}

.el-bi-type {
  color: var(--fix-p1-color);
}

.el-bi-cost {
  font-size: 0.85rem;
  font-weight: 600;
  color: #f59e0b;
}

.el-bi-cta {
  flex-shrink: 0;
  white-space: nowrap;
}

@media (max-width: 600px) {
  .el-biggest-issue { flex-direction: column; align-items: flex-start; }
  .el-bi-cta { width: 100%; }
}

/* ── S11: 3-stat row ─────────────────────────────────────────── */
.el-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.el-stat-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
}

.el-stat-num {
  font-size: 1.8rem;
  font-weight: 800;
  font-family: var(--font-head);
  line-height: 1;
  margin-bottom: 0.3rem;
}

.el-stat-label {
  font-size: 0.72rem;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}

.el-stat-pending { border-color: rgba(244, 76, 96, 0.35); }
.el-stat-pending .el-stat-num { color: var(--fix-p1-color); }

.el-stat-fixed { border-color: rgba(62, 207, 122, 0.35); }
.el-stat-fixed .el-stat-num { color: var(--green); }

.el-stat-total .el-stat-num { color: var(--text1); }

/* ── S11: pill filter row ────────────────────────────────────── */
.el-filter-pills {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.el-pill {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.35rem 0.9rem;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text2);
  cursor: pointer;
  font-family: var(--font-body);
  transition: all 0.18s;
}

.el-pill:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.el-pill.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ── S11: Fix → pill button on list items ───────────────────── */
.el-fix-pill {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.28rem 0.8rem;
  border: 1px solid var(--accent);
  color: var(--accent);
  background: rgba(91, 122, 245, 0.08);
  border-radius: 20px;
  cursor: pointer;
  font-family: var(--font-body);
  transition: all 0.18s;
  flex-shrink: 0;
  margin-top: 2px;
  white-space: nowrap;
}

.el-fix-pill:hover {
  background: rgba(91, 122, 245, 0.2);
}

/* ── S11: footer bar ─────────────────────────────────────────── */
.el-footer-bar {
  position: fixed;
  bottom: 0;
  left: var(--sidebar-w);
  right: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  background: var(--bg);
  border-top: 2px solid rgba(244, 76, 96, 0.45);
  padding: 0.9rem 2rem;
  flex-wrap: wrap;
}

.el-footer-msg {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text1);
}

.el-footer-cta {
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.4rem 1.1rem;
  border-radius: 20px;
  border: none;
  background: var(--fix-p1-color);
  color: #fff;
  cursor: pointer;
  font-family: var(--font-body);
  white-space: nowrap;
  transition: opacity 0.18s;
}

.el-footer-cta:hover { opacity: 0.85; }

/* Push page content above the fixed footer */
#page-errorlog { padding-bottom: 1.5rem; }

@media (max-width: 768px) {
  .el-footer-bar {
    left: 0;
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }
}

@media (max-width: 600px) {
  .el-footer-bar {
    flex-direction: column;
    align-items: flex-start;
  }
  .el-footer-cta { width: 100%; text-align: center; }
  /* Footer is now ~2 rows tall — give the list more clearance */
  .error-log-list { padding-bottom: 8rem; }
}

.el-cta-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: linear-gradient(135deg, rgba(244, 76, 96, 0.1), rgba(91, 122, 245, 0.08));
  border: 1px solid rgba(244, 76, 96, 0.25);
  border-radius: var(--radius);
  padding: 1rem 1.5rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.el-cta-text {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.el-cta-text strong {
  font-size: 0.95rem;
  color: var(--text);
}

.el-cta-text span {
  font-size: 0.8rem;
  color: var(--text2);
}

/* ===== ERROR LOG: INSIGHT SECTION ===== */
.el-insight-section {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.el-insight-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  flex: 1;
  min-width: 180px;
  transition: transform 0.2s;
}

.el-insight-card:hover {
  transform: translateY(-1px);
}

.el-insight-icon {
  font-size: 1.75rem;
  flex-shrink: 0;
}

.el-insight-label {
  font-size: 0.72rem;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.el-insight-value {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  margin-top: 0.15rem;
  color: var(--text);
}

/* ===== ERROR LOG: EMPTY STATE ===== */
.el-empty-state {
  text-align: center;
  padding: 3.5rem 2rem;
  color: var(--text2);
}

.el-empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.el-empty-state h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.el-empty-state p {
  font-size: 0.9rem;
  color: var(--text2);
}

.es-icon {
  font-size: 1.5rem;
  margin-bottom: 0.4rem;
}

.es-count {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
}

.es-label {
  font-size: 0.8rem;
  color: var(--text2);
  margin-top: 0.2rem;
}

.error-log-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
  height: calc(100vh - 380px);
  min-height: 200px;
  overflow-y: auto;
  padding-right: 0.25rem;
  padding-bottom: 4rem; /* clear fixed footer */
  scroll-behavior: smooth;
}

.error-log-list::-webkit-scrollbar {
  width: 4px;
}
.error-log-list::-webkit-scrollbar-track {
  background: transparent;
}
.error-log-list::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

.el-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  transition: transform 0.2s;
  flex-shrink: 0;
}

.el-item:hover {
  transform: translateX(3px);
}

.el-item.fixed {
  opacity: 0.45;
}

.el-type-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  flex-shrink: 0;
  margin-top: 2px;
}

/* New error type badge styles */
.el-type-badge.concept_gap,
.el-type-badge.conceptual {
  background: rgba(91, 122, 245, 0.15);
  color: var(--accent);
}

.el-type-badge.calculation,
.el-type-badge.silly {
  background: rgba(245, 166, 35, 0.15);
  color: var(--yellow);
}

.el-type-badge.misread {
  background: rgba(74, 158, 255, 0.15);
  color: var(--blue);
}

.el-type-badge.guess,
.el-type-badge.time {
  background: rgba(62, 207, 122, 0.15);
  color: var(--green);
}

.el-type-badge.unclassified {
  background: rgba(144, 144, 168, 0.1);
  color: var(--text2);
}

.el-body {
  flex: 1;
}

.el-question {
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.el-meta {
  font-size: 0.75rem;
  color: var(--text3);
  font-family: var(--font-mono);
  margin-bottom: 0.3rem;
}

.el-note {
  font-size: 0.8rem;
  color: var(--text2);
  font-style: italic;
}

.el-fix-btn {
  font-size: 0.75rem;
  padding: 0.3rem 0.75rem;
  border: 1px solid var(--green);
  color: var(--green);
  background: rgba(62, 207, 122, 0.08);
  border-radius: 20px;
  cursor: pointer;
  font-family: var(--font-body);
  transition: all 0.2s;
  flex-shrink: 0;
  margin-top: 2px;
}

.el-fix-btn:hover {
  background: rgba(62, 207, 122, 0.18);
}

.el-fixed-badge {
  font-size: 0.75rem;
  color: var(--green);
  flex-shrink: 0;
  margin-top: 2px;
}

/* ===== ERROR LOG — NEW COMPONENTS ===== */

/* Header row: title left, "+ Add Mistake" right */
.el-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}
.el-add-btn {
  flex-shrink: 0;
  white-space: nowrap;
  align-self: center;
}

/* 2-row filter bar */
.el-filter-bar {
  margin-bottom: 1rem;
}
.el-filter-row {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

/* "Filters ▼" toggle button */
.el-more-filters-toggle {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text2);
  background: none;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 0.3rem 0.85rem;
  cursor: pointer;
  font-family: var(--font-body);
  transition: border-color 0.18s, color 0.18s;
  margin-bottom: 0.5rem;
}
.el-more-filters-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Expandable filter panel */
.el-expanded-filters {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  margin-bottom: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.el-subject-chips {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}
.el-topic-row {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}
.el-topic-select {
  flex: 1;
  min-width: 140px;
  max-width: 200px;
}
.el-search-wrap {
  flex: 2;
  min-width: 200px;
}
.el-search-input {
  width: 100%;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.65rem 1rem;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}
.el-search-input:focus {
  border-color: var(--accent);
}

/* v2 card: left-stripe layout */
.el-item-v2 {
  padding: 0;
  overflow: hidden;
  flex-direction: row;
  align-items: stretch;
  gap: 0;
}
.el-stripe {
  width: 4px;
  flex-shrink: 0;
}
.el-stripe-concept_gap,
.el-stripe-conceptual  { background: var(--accent); }
.el-stripe-calculation,
.el-stripe-silly       { background: var(--yellow); }
.el-stripe-misread     { background: var(--blue); }
.el-stripe-guess,
.el-stripe-time        { background: var(--green); }
.el-stripe-unclassified { background: var(--text3); }

.el-item-v2 .el-body {
  flex: 1;
  padding: 0.9rem 0.75rem 0.9rem 0.85rem;
  min-width: 0;
}
.el-header-row-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.3rem;
  flex-wrap: wrap;
}
.el-badges {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.el-date {
  font-size: 0.72rem;
  color: var(--text3);
  font-family: var(--font-mono);
  white-space: nowrap;
  margin-left: auto;
}
.el-manual-tag {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 20px;
  background: var(--orange-bg);
  color: var(--orange);
  border: 1px solid var(--orange-border);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.el-item-v2 .el-action {
  display: flex;
  align-items: flex-start;
  padding: 0.9rem 0.85rem 0.9rem 0;
  flex-shrink: 0;
}
.el-item-v2.fixed {
  opacity: 0.5;
}
.el-item-v2.fixed .el-type-badge {
  text-decoration: line-through;
}

/* Mobile adjustments */
@media (max-width: 600px) {
  .el-header-row {
    flex-direction: column;
    gap: 0.75rem;
  }
  .el-add-btn {
    width: 100%;
    text-align: center;
  }
  .el-topic-row {
    flex-direction: column;
  }
  .el-topic-select,
  .el-search-wrap {
    max-width: 100%;
    min-width: 0;
    width: 100%;
  }
}

/* ===== MODALS ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  z-index: 7000;
  padding: 1.5rem 1rem;
  backdrop-filter: blur(4px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.modal-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%;
  max-width: 460px;
  box-shadow: var(--shadow);
  animation: slideUp 0.22s ease;
}

@keyframes slideUp {
  from {
    transform: translateY(24px);
    opacity: 0
  }

  to {
    transform: translateY(0);
    opacity: 1
  }
}

.modal-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.1rem;
}

.modal-header p {
  font-size: 0.8rem;
  color: var(--text2);
}

.modal-body {
  padding: 1.25rem 1.5rem;
}

.modal-body .form-group label {
  font-size: 0.75rem;
  color: var(--text2);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: block;
  margin-bottom: 0.4rem;
}

.modal-body textarea {
  width: 100%;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.7rem 1rem;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.9rem;
  resize: none;
  outline: none;
  transition: border-color 0.2s;
}

.modal-body textarea:focus {
  border-color: var(--accent);
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
}

.btn-skip {
  background: none;
  border: none;
  color: var(--text3);
  font-family: var(--font-body);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0.4rem;
  transition: color 0.2s;
}

.btn-skip:hover {
  color: var(--text2);
}

.error-type-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.error-type-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  padding: 0.8rem 0.9rem;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: var(--font-body);
  color: var(--text);
  width: 100%;
  transition: all 0.15s;
  text-align: left;
}

.error-type-btn span {
  font-size: 1.2rem;
}

.error-type-btn strong {
  font-size: 0.82rem;
  display: block;
}

.error-type-btn small {
  font-size: 0.7rem;
  color: var(--text2);
  line-height: 1.3;
}

.error-type-btn:hover {
  border-color: var(--accent);
  background: var(--accent-glow);
}

.error-type-btn.selected {
  border-color: var(--red);
  background: rgba(244, 76, 96, 0.1);
  color: var(--red);
}

.error-type-btn.selected small {
  color: rgba(244, 76, 96, 0.7);
}

/* FEEDBACK */
.feedback-fab {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(91, 122, 245, 0.4);
  z-index: 6000;
  transition: transform 0.2s;
  display: none;
}

.feedback-fab:hover {
  transform: scale(1.1);
}

.star-row {
  display: flex;
  gap: 0.4rem;
  font-size: 1.75rem;
  cursor: pointer;
}

.star {
  color: var(--border);
  transition: color 0.15s;
}

.star.on {
  color: var(--yellow);
}

/* ===== LOADING + TOAST ===== */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  z-index: 9999;
}

.loader-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

#loading-text {
  color: var(--text2);
  font-size: 0.9rem;
}

.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1.5rem;
  font-size: 0.9rem;
  box-shadow: var(--shadow);
  z-index: 9999;
  transition: transform 0.3s ease;
  white-space: nowrap;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

.toast.success {
  border-color: var(--green);
  color: var(--green);
}

.toast.error {
  border-color: var(--red);
  color: var(--red);
}

/* ===== UTILITIES ===== */
.hidden {
  display: none !important;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar.open+.sidebar-overlay {
    display: block;
  }

  .main-content {
    margin-left: 0;
  }

  .hamburger {
    display: block;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .dash-grid {
    grid-template-columns: 1fr;
  }

  .test-config-grid {
    grid-template-columns: 1fr;
  }

  .error-summary-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .fix-cta-banner {
    flex-direction: column;
    align-items: flex-start;
  }

  .el-cta-banner {
    flex-direction: column;
    align-items: flex-start;
  }

  .etag-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  /* Remove sticky on mobile — avoids z-index overlap with answer feedback */
  .passage-context.is-sticky {
    position: static;
    box-shadow: none;
  }

  /* passage-toggle-btn is always block (set globally above) */

  .option-btn {
    padding: 1.15rem 1rem;
    width: 100%;
  }

  .tita-input-row {
    flex-direction: column;
    align-items: stretch;
  }

  .tita-input-row .btn-primary,
  .tita-input-row input {
    width: 100%;
  }

  #tita-submit {
    width: 100% !important;
  }

  .question-text {
    font-size: 15px;
    line-height: 1.6;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }
  .passage-body,
  .passage-context-text {
    font-size: var(--passage-font-size, 15px);
    line-height: 1.6;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  .error-tag-panel {
    flex-direction: column;
    align-items: stretch;
  }

  .etag-btn {
    width: 100%;
    justify-content: center;
    padding: 0.7rem 1rem;
  }

  /* Fix empty space issues on mobile */
  .filter-bar,
  .filter-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }

  .filter-panel.collapsed {
    display: none;
  }

  .filter-select {
    width: 100%;
  }

  #load-practice-btn {
    grid-column: 1 / -1;
    width: 100%;
  }

  .q-meta-bar {
    /* No space-between needed if we use flex-grow */
  }

  .q-tags {
    flex: 1;
    /* Pushes the next elements to line 2 */
    min-width: 100px;
  }

  .q-actions {
    flex: 1;
    display: flex;
    gap: 0.5rem;
    min-width: 200px;
    /* Force it to wrap if needed */
  }

  .q-actions .icon-btn {
    flex: 1;
    padding: 0.22rem 0;
    min-width: 0;
    border-radius: 6px;
  }

  /* Hide FAB on all mobile pages except dashboard */
  #feedback-fab {
    display: none !important;
  }

  body:has(#page-dashboard.active) #feedback-fab {
    display: flex !important;
    bottom: 1.5rem;
    right: 1rem;
  }
}

@media (max-width: 500px) {
  .page {
    padding: 1rem 1rem 2rem;
  }

  .question-card {
    padding: 1.25rem;
  }

  .page-title {
    font-size: 1.4rem;
  }

  .ss-stats {
    grid-template-columns: 1fr 1fr 1fr;
  }

}

/* ===== PHASE 2: PER-SUBJECT GOAL WIDGET ===== */
.sg-widget {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.sg-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.25rem;
  border-bottom: 1px solid var(--border);
}

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

.sg-left {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 70px;
}

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

.sg-label {
  font-size: 0.78rem;
  color: var(--text2);
  font-weight: 600;
}

.sg-bar-wrap {
  flex: 1;
  height: 6px;
  background: var(--border);
  border-radius: 6px;
  overflow: hidden;
}

.sg-bar-fill {
  height: 100%;
  border-radius: 6px;
  transition: width 0.4s ease;
}

.sg-right {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.sg-status {
  font-size: 0.9rem;
}

.sg-count {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text2);
  min-width: 60px;
  text-align: right;
}

.sg-adj {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--text2);
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  padding: 0;
  line-height: 1;
}

.sg-adj:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

/* ===== PHASE 2: UPGRADE BUTTON + TRIAL BANNER ===== */
/* Sidebar fix bar — "N mistakes left  Fix →" */
.sidebar-fix-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0.75rem 0.6rem;
  padding: 0.5rem 0.75rem;
  background: rgba(244, 76, 96, 0.1);
  border: 1px solid rgba(244, 76, 96, 0.28);
  border-radius: var(--radius-sm);
}

.sfb-label {
  font-size: 0.78rem;
  color: #f0f0f5;
  color: var(--text);
  font-weight: 500;
}

.sfb-fix {
  background: none;
  border: none;
  color: #f44c60;
  color: var(--fix-p1-color);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  font-family: var(--font-body);
  transition: opacity 0.15s;
}

.sfb-fix:hover {
  opacity: 0.8;
}

.upgrade-btn {
  width: calc(100% - 1.5rem);
  margin: 0 0.75rem 0.6rem;
  background: linear-gradient(135deg, var(--accent), #5a4cd0);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.65rem 1rem;
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.01em;
  box-shadow: 0 4px 14px rgba(91, 122, 245, 0.35);
}

.upgrade-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(91, 122, 245, 0.5);
}

.trial-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(245, 166, 35, 0.1);
  border: 1px solid rgba(245, 166, 35, 0.25);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.75rem;
  margin: 0 0.75rem 0.6rem;
  font-size: 0.75rem;
  color: var(--yellow);
}

.trial-banner.trial-expired {
  background: rgba(244, 76, 96, 0.1);
  border-color: rgba(244, 76, 96, 0.25);
  color: var(--red);
}

/* ===== PHASE 2: UPGRADE MODAL ===== */
.upgrade-box {
  max-width: 420px;
  text-align: center;
}

.upgrade-hero {
  margin-bottom: 1.5rem;
}

.upgrade-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
  background: linear-gradient(135deg, var(--accent), #5a4cd0);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.upgrade-hero h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 0.35rem;
}

.upgrade-hero p {
  font-size: 0.85rem;
  color: var(--text2);
}

.upgrade-founders {
  font-size: 0.85rem;
  color: var(--text2);
  line-height: 1.5;
}

.upgrade-founders strong {
  color: #f59e0b;
  font-weight: 700;
}

.upgrade-features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  text-align: left;
}

.upgrade-feat {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
  font-size: 0.8rem;
  color: var(--text);
}

.upgrade-price {
  background: linear-gradient(135deg, rgba(91, 122, 245, 0.12), rgba(91, 122, 245, 0.05));
  border: 1px solid rgba(91, 122, 245, 0.3);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1.25rem;
}

.upgrade-amount {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent);
}

.upgrade-amount span {
  font-size: 0.9rem;
  color: var(--text2);
}

.upgrade-sub {
  font-size: 0.75rem;
  color: var(--text3);
  margin-top: 0.25rem;
}

.upgrade-founder-note {
  font-size: 0.76rem;
  font-weight: 600;
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.75rem;
  text-align: center;
  margin-bottom: 0.75rem;
}

.upgrade-plans {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  margin-bottom: 1.25rem;
}

.upgrade-plan {
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 0.75rem 0.9rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
  background: var(--bg2);
  position: relative;
  user-select: none;
}

.upgrade-plan:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.upgrade-plan.plan-selected {
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(91, 122, 245, 0.1), rgba(91, 122, 245, 0.04));
}

.plan-badge {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.15rem 0.5rem;
  border-radius: 20px;
  display: inline-block;
  margin-bottom: 0.5rem;
}

.plan-badge-amber {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.plan-badge-blue {
  background: rgba(91, 122, 245, 0.12);
  color: var(--accent);
  border: 1px solid rgba(91, 122, 245, 0.3);
}

.plan-amount {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
  margin-bottom: 0.4rem;
}

.upgrade-plan.plan-selected .plan-amount {
  color: var(--accent);
}

.plan-amount span {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text2);
}

.plan-desc {
  font-size: 0.72rem;
  color: var(--text2);
  line-height: 1.4;
}

/* ── Urgency bar ────────────────────────────────────────── */
.upgrade-urgency-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
  font-size: 0.8rem;
  color: #ef4444;
  margin-bottom: 0.75rem;
  font-weight: 500;
}

.urgency-dot {
  width: 7px;
  height: 7px;
  background: #ef4444;
  border-radius: 50%;
  animation: pulse-red 1.5s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes pulse-red {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

/* ── Coaching anchor line ────────────────────────────────── */
.upgrade-anchor-line {
  font-size: 0.78rem;
  color: var(--text2);
  text-align: center;
  margin-bottom: 0.75rem;
}

.upgrade-anchor-line s {
  color: var(--text3);
  text-decoration-color: #ef4444;
}

/* ── Hero plan card (₹489) ───────────────────────────────── */
.upgrade-hero-plan {
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  padding: 1rem;
  background: linear-gradient(135deg, rgba(91,122,245,0.1), rgba(91,122,245,0.04));
  cursor: pointer;
  margin-bottom: 0.65rem;
  position: relative;
  transition: transform 0.15s, box-shadow 0.15s;
}

.upgrade-hero-plan:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(91,122,245,0.2);
}

.hero-plan-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.6rem;
}

.hero-plan-badge {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.02em;
}

.hero-plan-scarcity {
  font-size: 0.7rem;
  font-weight: 600;
  color: #f59e0b;
  background: rgba(245,158,11,0.1);
  border: 1px solid rgba(245,158,11,0.25);
  padding: 2px 8px;
  border-radius: 20px;
}

.hero-plan-price {
  margin-bottom: 0.4rem;
}

.hero-plan-equiv {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
  font-family: var(--font-display);
}

.hero-plan-equiv span {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text2);
}

.hero-plan-total {
  font-size: 0.78rem;
  color: var(--text2);
  margin-top: 0.2rem;
}

.hero-plan-perday {
  font-size: 0.75rem;
  color: var(--text3);
  border-top: 1px solid rgba(91,122,245,0.15);
  padding-top: 0.5rem;
  margin-top: 0.5rem;
}

/* ── Secondary monthly plan ─────────────────────────────── */
.upgrade-secondary-plan {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  transition: border-color 0.15s;
  background: var(--bg2);
}

.upgrade-secondary-plan:hover,
.upgrade-secondary-plan.plan-selected {
  border-color: var(--accent);
}

.secondary-plan-label {
  font-size: 0.78rem;
  color: var(--text2);
  font-weight: 500;
}

.secondary-plan-price {
  font-size: 0.82rem;
  color: var(--text);
  font-weight: 600;
}

.secondary-plan-price span {
  font-weight: 400;
  color: var(--text2);
}

/* ── Features v2 ─────────────────────────────────────────── */
.upgrade-feats-v2 {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1rem;
  text-align: left;
}

.upgrade-feat-v2 {
  font-size: 0.82rem;
  color: var(--text);
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--border);
}

.upgrade-feat-v2:last-child { border-bottom: none; }
.upgrade-feat-v2 em { font-style: normal; font-weight: 600; color: var(--accent); }

/* ── Trust row ───────────────────────────────────────────── */
.upgrade-trust-row {
  display: flex;
  justify-content: center;
  gap: 1rem;
  font-size: 0.72rem;
  color: var(--text3);
  margin-top: 0.6rem;
  flex-wrap: wrap;
}

.refund-trust-link {
  color: var(--text3);
  text-decoration: none;
  border-bottom: 1px dashed rgba(148,163,184,0.35);
  transition: color 0.15s;
}
.refund-trust-link:hover { color: var(--primary); }

/* ── Refund note ─────────────────────────────────────────── */
.upgrade-refund-note {
  font-size: 0.73rem;
  color: var(--text3);
  text-align: center;
  margin-top: 0.4rem;
  margin-bottom: 0;
}

/* ── Paywall locked row sub-label ───────────────────────── */
.lock-sub {
  font-size: 0.72rem;
  color: var(--text3);
  font-weight: 400;
}

/* ── Tier tabs ─────────────────────────────────────────── */
.upgrade-tier-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  background: var(--bg2);
  border-radius: var(--radius-sm);
  padding: 4px;
}

.upgrade-tier-tab {
  flex: 1;
  padding: 0.45rem 0.75rem;
  border: none;
  border-radius: calc(var(--radius-sm) - 2px);
  background: transparent;
  color: var(--text2);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.upgrade-tier-tab.active {
  background: var(--accent);
  color: #fff;
}

.tier-soon-badge {
  font-size: 0.62rem;
  font-weight: 700;
  background: rgba(255,255,255,0.2);
  color: inherit;
  padding: 1px 5px;
  border-radius: 4px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.upgrade-tier-tab:not(.active) .tier-soon-badge {
  background: var(--bg3, rgba(91,122,245,0.15));
  color: var(--accent);
}

/* ── Pay now button ─────────────────────────────────────── */
.btn-pay-now {
  display: block;
  width: 100%;
  padding: 0.875rem 1rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 1rem;
  transition: opacity 0.15s, transform 0.1s;
  letter-spacing: -0.01em;
}

.btn-pay-now:hover { opacity: 0.9; }
.btn-pay-now:active { transform: scale(0.98); }
.btn-pay-now:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-pay-now.btn-notify {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
}

/* ── Max coming-soon section ────────────────────────────── */
.max-coming-icon {
  font-size: 2rem;
  margin-bottom: 0.25rem;
}

.upgrade-plans-dim .upgrade-plan {
  opacity: 0.5;
  pointer-events: none;
  cursor: default;
}

/* ── Trust line ─────────────────────────────────────────── */
.upgrade-trust {
  font-size: 0.75rem;
  color: var(--text3);
  text-align: center;
  margin-top: 0.75rem;
  margin-bottom: 0;
}

/* ═══════════════════════════════════════════════════════════
   UPGRADE v2 — Redesigned modal + paywall
   ═══════════════════════════════════════════════════════════ */

/* Box entrance animation */
.upv2-box {
  animation: upv2Enter 0.3s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes upv2Enter {
  from { opacity: 0; transform: scale(0.92) translateY(20px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* Topbar: tabs left, close right */
.upv2-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.1rem;
}
.upv2-close-btn {
  background: none;
  border: none;
  color: var(--text3);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.3rem 0.5rem;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
  flex-shrink: 0;
}
.upv2-close-btn:hover { color: var(--text1); background: rgba(255,255,255,0.06); }

/* Countdown strip */
.upv2-countdown {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(239,68,68,0.07);
  border: 1px solid rgba(239,68,68,0.18);
  border-radius: 8px;
  padding: 0.55rem 0.9rem;
  font-size: 0.8rem;
  color: #fca5a5;
  margin-bottom: 1rem;
}
.upv2-urgency-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #ef4444;
  flex-shrink: 0;
  animation: pulse-red 1.4s ease-in-out infinite;
}
.upv2-count {
  font-weight: 800;
  font-size: 1rem;
  color: #f87171;
}

/* Price hero block */
.upv2-price-block {
  background: rgba(255,255,255,0.03);
  border: 1.5px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 1.1rem 1.25rem 1rem;
  margin-bottom: 1rem;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.upv2-price-block.plan-selected {
  border-color: #5b7af5;
  box-shadow: 0 0 0 1px rgba(91,122,245,0.25), 0 4px 32px rgba(91,122,245,0.1);
}
.upv2-pb-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}
.upv2-pb-amount {
  font-size: 2.6rem;
  font-weight: 900;
  color: #fff;
  letter-spacing: -1.5px;
  line-height: 1;
}
.upv2-pb-badge {
  background: rgba(245,158,11,0.12);
  color: #fbbf24;
  border: 1px solid rgba(245,158,11,0.25);
  border-radius: 20px;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.18rem 0.6rem;
  white-space: nowrap;
  flex-shrink: 0;
}
.upv2-pb-meta {
  font-size: 0.76rem;
  color: var(--text3);
  margin-bottom: 0.55rem;
}
.upv2-pb-vs {
  display: inline-block;
  font-size: 0.71rem;
  font-weight: 600;
  color: #4ade80;
  background: rgba(74,222,128,0.07);
  border: 1px solid rgba(74,222,128,0.18);
  border-radius: 6px;
  padding: 0.18rem 0.55rem;
}

/* Feature 2×2 grid */
.upv2-feat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.upv2-feat-cell {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(255,255,255,0.055);
  border-radius: 9px;
  padding: 0.55rem 0.65rem;
  font-size: 0.73rem;
  color: var(--text2);
  line-height: 1.35;
}
.upv2-fi { font-size: 0.95rem; flex-shrink: 0; margin-top: 0.05rem; }

/* Primary CTA */
.upv2-cta-btn {
  width: 100%;
  padding: 0.88rem 1rem;
  background: linear-gradient(130deg, #5b7af5 0%, #7c6af7 100%);
  color: #fff;
  font-size: 0.97rem;
  font-weight: 700;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: opacity 0.2s, transform 0.1s;
  margin-bottom: 0.65rem;
  letter-spacing: 0.01em;
}
.upv2-cta-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  left: -120%;
  width: 55%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.16), transparent);
  animation: upv2Shimmer 2.8s 0.8s infinite;
}
@keyframes upv2Shimmer {
  0%   { left: -120%; }
  100% { left: 180%; }
}
.upv2-cta-btn:hover   { opacity: 0.92; transform: translateY(-1px); }
.upv2-cta-btn:active  { transform: translateY(0); }
.upv2-cta-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

/* Monthly secondary row */
.upv2-monthly-row {
  text-align: center;
  font-size: 0.78rem;
  color: var(--text3);
  cursor: pointer;
  padding: 0.45rem 0.5rem;
  border-radius: 8px;
  transition: color 0.15s, background 0.15s;
  margin-bottom: 0.65rem;
}
.upv2-monthly-row:hover { color: var(--text2); background: rgba(255,255,255,0.04); }
.upv2-monthly-row.plan-selected { color: #5b7af5; background: rgba(91,122,245,0.07); }
.upv2-monthly-row strong { color: var(--text1); font-weight: 700; }
.upv2-monthly-row.plan-selected strong { color: #7c9cf8; }

/* ── Max tier (coming soon) ──────────────────────────────── */
.upv2-max-hero { text-align: center; margin-bottom: 1.25rem; }
.upv2-max-icon { font-size: 2rem; margin-bottom: 0.4rem; }
.upv2-max-title { font-size: 1.2rem; font-weight: 800; color: var(--text1); margin-bottom: 0.3rem; }
.upv2-max-sub { font-size: 0.82rem; color: var(--text3); }
.upv2-max-feats { display: flex; flex-direction: column; gap: 0.45rem; margin-bottom: 1.25rem; }
.upv2-max-feat { font-size: 0.82rem; color: var(--text2); padding: 0.4rem 0.5rem; }
.upv2-max-plans {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin-bottom: 1.25rem;
  opacity: 0.55;
}
.upv2-max-plan {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 10px;
  padding: 0.85rem;
  text-align: center;
}
.upv2-max-plan-badge {
  font-size: 0.65rem; font-weight: 700; border-radius: 20px;
  padding: 0.15rem 0.5rem; display: inline-block; margin-bottom: 0.5rem;
}
.upv2-max-plan-badge.amber { background: rgba(245,158,11,0.12); color: #fbbf24; border: 1px solid rgba(245,158,11,0.25); }
.upv2-max-plan-badge.blue  { background: rgba(91,122,245,0.12); color: #7c9cf8; border: 1px solid rgba(91,122,245,0.25); }
.upv2-max-plan-price { font-size: 1.5rem; font-weight: 900; color: var(--text1); }
.upv2-max-plan-desc { font-size: 0.71rem; color: var(--text3); margin-top: 0.2rem; }
.upv2-notify-btn {
  width: 100%; padding: 0.8rem; background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1); border-radius: 10px;
  color: var(--text2); font-size: 0.85rem; font-weight: 600;
  cursor: pointer; margin-bottom: 0.6rem; transition: background 0.2s;
}
.upv2-notify-btn:hover { background: rgba(255,255,255,0.08); }
.upv2-max-coming { text-align: center; font-size: 0.72rem; color: var(--text3); }

/* ── Paywall v2 ──────────────────────────────────────────── */
.upv2-pw-box {} /* inherits paywall-box sizing/scroll */
.upv2-pw-header { text-align: center; margin-bottom: 1rem; }
.upv2-pw-lock-icon { font-size: 1.75rem; margin-bottom: 0.4rem; }
.upv2-pw-title {
  font-size: 1.2rem; font-weight: 800; color: var(--text1); margin-bottom: 0.35rem;
}
.upv2-pw-desc { font-size: 0.82rem; color: var(--text2); }
.upv2-pw-locked-row {
  display: flex; align-items: center; justify-content: center;
  gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1rem;
}
.upv2-pw-lock-pill {
  font-size: 0.72rem; color: #fca5a5;
  background: rgba(239,68,68,0.07);
  border: 1px solid rgba(239,68,68,0.16);
  border-radius: 20px; padding: 0.22rem 0.65rem;
}

/* ═══════════════════════════════════════════════════════════
   UPGRADE v3 — Complete redesign (side-by-side plans)
   ═══════════════════════════════════════════════════════════ */

/* Box */
.upv3-box {
  animation: upv3Enter 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
  padding: 1.25rem 1.25rem 1.1rem;
}
@keyframes upv3Enter {
  from { opacity: 0; transform: translateY(28px) scale(0.94); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Topbar */
.upv3-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.upv3-close {
  background: none; border: none;
  color: var(--text3); font-size: 1rem;
  cursor: pointer; padding: 0.3rem 0.5rem;
  border-radius: 6px; line-height: 1;
  transition: color 0.15s, background 0.15s;
}
.upv3-close:hover { color: var(--text1); background: rgba(255,255,255,0.06); }

/* Urgency block */
.upv3-urgency {
  background: rgba(239,68,68,0.07);
  border: 1px solid rgba(239,68,68,0.18);
  border-radius: 10px;
  padding: 0.7rem 0.9rem 0.6rem;
  margin-bottom: 0.75rem;
}
.upv3-urgency-pw { margin-bottom: 0.6rem; }
.upv3-urgency-top {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.5rem;
  font-size: 0.78rem;
  color: #fca5a5;
}
.upv3-udot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #ef4444;
  flex-shrink: 0;
  animation: pulse-red 1.4s ease-in-out infinite;
}
.upv3-ulabel { flex: 1; }
.upv3-ulabel strong { color: #f87171; font-size: 0.9rem; }
.upv3-slots {
  font-size: 0.68rem;
  font-weight: 700;
  color: #fca5a5;
  background: rgba(239,68,68,0.12);
  border: 1px solid rgba(239,68,68,0.22);
  border-radius: 20px;
  padding: 0.15rem 0.55rem;
  white-space: nowrap;
  flex-shrink: 0;
}
/* Progress bar */
.upv3-bar-track {
  height: 4px;
  background: rgba(239,68,68,0.15);
  border-radius: 4px;
  overflow: hidden;
}
.upv3-bar-fill {
  height: 100%;
  width: 0%;
  --bar-pct: 52%;
  background: linear-gradient(90deg, #ef4444, #f97316);
  border-radius: 4px;
  animation: upv3BarGrow 1.4s 0.35s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
@keyframes upv3BarGrow {
  from { width: 0%; }
  to   { width: var(--bar-pct); }
}

/* Anchor row */
.upv3-anchor {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  margin-bottom: 0.85rem;
  flex-wrap: wrap;
}
.upv3-anchor-left { color: var(--text3); }
.upv3-anchor-left s { color: #f87171; text-decoration-color: #f87171; }
.upv3-anchor-vs {
  color: var(--text3);
  font-size: 0.7rem;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 4px;
  padding: 0.1rem 0.35rem;
}
.upv3-anchor-right { color: var(--text2); }
.upv3-anchor-right strong { color: #4ade80; }

/* ── Side-by-side plan cards ──────────────────────────────── */
.upv3-plans {
  display: grid;
  grid-template-columns: 1.65fr 1fr;
  gap: 0.65rem;
  margin-bottom: 0.85rem;
}

/* Base card */
.upv3-card {
  border-radius: 14px;
  padding: 1rem 0.9rem 0.9rem;
  cursor: pointer;
  position: relative;
  transition: border-color 0.2s, box-shadow 0.2s, opacity 0.2s;
  overflow: hidden;
  min-height: 160px;
}

/* ₹489 recommended card */
.upv3-rec {
  background: linear-gradient(140deg, rgba(91,122,245,0.1) 0%, rgba(91,122,245,0.04) 100%);
  border: 2px solid rgba(91,122,245,0.35);
}
.upv3-rec.plan-selected {
  border-color: #5b7af5;
  box-shadow: 0 0 0 1px rgba(91,122,245,0.2), 0 4px 40px rgba(91,122,245,0.18);
  animation: upv3RecPulse 3s 0.5s ease-in-out infinite;
}
@keyframes upv3RecPulse {
  0%, 100% { box-shadow: 0 0 0 1px rgba(91,122,245,0.2), 0 4px 30px rgba(91,122,245,0.15); }
  50%       { box-shadow: 0 0 0 1px rgba(91,122,245,0.3), 0 4px 50px rgba(91,122,245,0.28); }
}
.upv3-sec.plan-selected {
  border-color: #5b7af5;
  box-shadow: 0 0 0 1px rgba(91,122,245,0.2);
}
/* Dim the non-selected card */
.upv3-plans:has(.upv3-sec.plan-selected) .upv3-rec { opacity: 0.5; animation: none; }
.upv3-plans:has(.upv3-rec.plan-selected) .upv3-sec { opacity: 0.55; }

/* ₹489 badge */
.upv3-rec-badge {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #fbbf24;
  background: rgba(245,158,11,0.12);
  border: 1px solid rgba(245,158,11,0.25);
  border-radius: 20px;
  display: inline-block;
  padding: 0.15rem 0.55rem;
  margin-bottom: 0.55rem;
}

/* ₹99 secondary card */
.upv3-sec {
  background: rgba(255,255,255,0.025);
  border: 1.5px solid rgba(255,255,255,0.07);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: 1rem;
}
.upv3-sec-label {
  font-size: 0.62rem;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 0.3rem;
}
.upv3-sec-divider {
  width: 30px; height: 1px;
  background: rgba(255,255,255,0.1);
  margin: 0.55rem auto;
}
.upv3-sec-pros {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.69rem;
  color: #94a3b8;
}

/* Shared price text */
.upv3-price {
  font-size: 2.2rem;
  font-weight: 900;
  color: #fff;
  letter-spacing: -1px;
  line-height: 1;
  margin-bottom: 0.2rem;
}
.upv3-price-sm { font-size: 1.75rem; }
.upv3-period {
  font-size: 0.72rem;
  color: #94a3b8;
  margin-bottom: 0.45rem;
}
.upv3-equiv {
  font-size: 0.7rem;
  color: var(--text3);
  margin-bottom: 0.45rem;
}
.upv3-save-pill {
  display: inline-block;
  font-size: 0.66rem;
  font-weight: 700;
  color: #4ade80;
  background: rgba(74,222,128,0.08);
  border: 1px solid rgba(74,222,128,0.2);
  border-radius: 6px;
  padding: 0.18rem 0.5rem;
  margin-bottom: 0.45rem;
}
.upv3-once {
  font-size: 0.7rem;
  color: var(--text3);
}
.upv3-sub-cancel {
  font-size: 0.68rem;
  color: var(--text3);
  line-height: 1.4;
}

/* Price breakdown pills inside ₹489 card */
.upv3-price-breakdowns {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin-bottom: 0.45rem;
  flex-wrap: wrap;
}
.upv3-breakdown-pill {
  font-size: 0.7rem;
  font-weight: 600;
  color: #cbd5e1;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.13);
  border-radius: 6px;
  padding: 0.14rem 0.45rem;
}
.upv3-breakdown-sep { font-size: 0.65rem; color: #64748b; }

/* Feature single line */
.cd-feat-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  font-size: 0.73rem;
  color: var(--text3);
  margin-bottom: 0.9rem;
  padding: 0.5rem 0;
  border-top: 1px solid rgba(255,255,255,0.05);
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.cd-feat-sep { opacity: 0.3; }

/* Bottom row: social proof + trust merged */
.cd-bottom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.7rem;
  flex-wrap: wrap;
}
.cd-trust-mini {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.7rem;
  color: var(--text3);
}
.cd-trust-mini .refund-trust-link { font-size: 0.7rem; }

/* Legacy — keep grid styles but hide if unused */
.upv3-feats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.4rem;
  margin-bottom: 0.9rem;
}
.upv3-feat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 8px;
  padding: 0.5rem 0.3rem;
  font-size: 0.67rem;
  color: var(--text3);
  text-align: center;
  line-height: 1.2;
}
.upv3-feat span:first-child { font-size: 1rem; }

/* CTA */
.upv3-cta {
  width: 100%;
  padding: 0.9rem;
  background: linear-gradient(130deg, #4f6ef0 0%, #7c6af7 100%);
  color: #fff;
  font-size: 0.97rem;
  font-weight: 700;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  margin-bottom: 0.7rem;
  letter-spacing: 0.01em;
  transition: opacity 0.2s, transform 0.1s;
}
.upv3-cta::after {
  content: '';
  position: absolute;
  inset: 0;
  left: -120%;
  width: 50%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  animation: upv3Shimmer 2.6s 1.2s infinite;
}
@keyframes upv3Shimmer {
  0%   { left: -120%; }
  100% { left: 180%; }
}
.upv3-cta:hover   { opacity: 0.92; transform: translateY(-1px); }
.upv3-cta:active  { transform: translateY(0); }
.upv3-cta:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

/* ── Max coming soon ─────────────────────────────────────── */
.upv3-max-hero { text-align: center; margin-bottom: 1.1rem; }
.upv3-max-icon { font-size: 1.8rem; margin-bottom: 0.35rem; }
.upv3-max-title { font-size: 1.15rem; font-weight: 800; color: var(--text1); margin-bottom: 0.25rem; }
.upv3-max-sub { font-size: 0.8rem; color: var(--text3); }
.upv3-max-feats { display: flex; flex-direction: column; gap: 0.4rem; margin-bottom: 1.1rem; }
.upv3-max-feat { font-size: 0.8rem; color: var(--text2); padding: 0.35rem 0.25rem; }
.upv3-max-plans {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem;
  margin-bottom: 1rem; opacity: 0.5;
}
.upv3-max-plan {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 10px; padding: 0.8rem; text-align: center;
}
.upv3-mpbadge {
  font-size: 0.62rem; font-weight: 700; border-radius: 20px;
  padding: 0.14rem 0.5rem; display: inline-block; margin-bottom: 0.4rem;
}
.upv3-mpbadge.amber { background: rgba(245,158,11,0.12); color: #fbbf24; border: 1px solid rgba(245,158,11,0.25); }
.upv3-mpbadge.blue  { background: rgba(91,122,245,0.12); color: #7c9cf8; border: 1px solid rgba(91,122,245,0.25); }
.upv3-mpprice { font-size: 1.4rem; font-weight: 900; color: var(--text1); }
.upv3-mpdesc { font-size: 0.68rem; color: var(--text3); margin-top: 0.18rem; }
.upv3-notify-btn {
  width: 100%; padding: 0.75rem;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.09);
  border-radius: 10px; color: var(--text2); font-size: 0.83rem; font-weight: 600;
  cursor: pointer; margin-bottom: 0.5rem; transition: background 0.15s;
}
.upv3-notify-btn:hover { background: rgba(255,255,255,0.07); }
.upv3-max-coming { text-align: center; font-size: 0.7rem; color: var(--text3); }

/* ── Slot machine comparison ─────────────────────────────── */
.cd-machine {
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 14px;
  padding: 0.85rem 1rem 0.7rem;
  margin-bottom: 0.85rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}
/* subtle shimmer stripe across the machine */
.cd-machine::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(91,122,245,0.04) 50%, transparent 70%);
  animation: cdMachineSheen 4s 1s linear infinite;
  pointer-events: none;
}
@keyframes cdMachineSheen {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(200%); }
}
.cd-machine-label {
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.6rem;
}
.cd-machine-sm { padding: 0.7rem 1rem 0.6rem; margin-bottom: 0.75rem; }
.cd-drum-wrap {
  min-height: 2.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.55rem;
}
.cd-drum {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.cd-emoji { font-size: 1.4rem; flex-shrink: 0; }
.cd-lines {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  text-align: left;
}
.cd-main { font-size: 0.88rem; font-weight: 700; color: var(--text1); }
.cd-sub  { font-size: 0.68rem; color: var(--text3); }

/* Progress dots inside machine */
.cd-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding-top: 2px;
}
.cd-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  transition: background 0.3s, transform 0.25s, width 0.25s;
  flex-shrink: 0;
}
.cd-dot-active {
  background: #5b7af5;
  width: 14px;
  border-radius: 3px;
  transform: none;
}

/* ── Paywall mistake counter ─────────────────────────────── */
.cd-pw-hook {
  text-align: center;
  margin-bottom: 0.85rem;
}
.cd-pw-num-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}
.cd-pw-num {
  font-size: 4.5rem;
  font-weight: 900;
  color: #ef4444;
  letter-spacing: -3px;
  line-height: 1;
  animation: cdNumGlow 2s ease-in-out infinite;
}
@keyframes cdNumGlow {
  0%, 100% { text-shadow: 0 0 16px rgba(239,68,68,0.35); }
  50%       { text-shadow: 0 0 40px rgba(239,68,68,0.65); }
}
.cd-pw-num-label {
  font-size: 0.78rem;
  color: var(--text3);
  line-height: 1.4;
  text-align: left;
}
.cd-pw-sub {
  font-size: 0.8rem;
  color: var(--text2);
  line-height: 1.5;
  max-width: 300px;
  margin: 0 auto;
}

/* ── Social proof avatars ────────────────────────────────── */
.cd-social {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  margin-bottom: 0.8rem;
}
.cd-avs { display: flex; }
.cd-av {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, #5b7af5, #7c6af7);
  border: 2px solid var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.57rem;
  font-weight: 800;
  color: #fff;
  margin-left: -5px;
  flex-shrink: 0;
}
.cd-av:first-child { margin-left: 0; }
.cd-social-txt { font-size: 0.72rem; color: var(--text3); }

/* ── Modal box glow (breathing feel) ────────────────────── */
.upv3-box {
  animation: upv3Enter 0.32s cubic-bezier(0.22,1,0.36,1) both, upv3BoxBreathe 5s 1s ease-in-out infinite;
}
@keyframes upv3BoxBreathe {
  0%, 100% { box-shadow: 0 0 0 1px rgba(91,122,245,0.18), 0 24px 64px rgba(0,0,0,0.55); }
  50%       { box-shadow: 0 0 0 1px rgba(91,122,245,0.32), 0 24px 64px rgba(0,0,0,0.55), 0 0 60px rgba(91,122,245,0.1); }
}

/* ── Paywall v3 ──────────────────────────────────────────── */
.upv3-pw-box { padding: 1.4rem 1.25rem 1.1rem; animation: upv3Enter 0.3s cubic-bezier(0.22, 1, 0.36, 1) both; }
.upv3-pw-hook { text-align: center; margin-bottom: 0.9rem; }
.upv3-pw-emoji { font-size: 1.6rem; margin-bottom: 0.35rem; }
.upv3-pw-title { font-size: 1.1rem; font-weight: 800; color: var(--text1); margin-bottom: 0.3rem; }
.upv3-pw-sub { font-size: 0.8rem; color: var(--text2); line-height: 1.45; }
.upv3-pw-locked {
  display: flex; align-items: center; justify-content: center;
  gap: 0.4rem; flex-wrap: wrap; margin-bottom: 0.75rem;
}
.upv3-pw-pill {
  font-size: 0.69rem; color: #fca5a5;
  background: rgba(239,68,68,0.07);
  border: 1px solid rgba(239,68,68,0.16);
  border-radius: 20px; padding: 0.2rem 0.6rem;
}

.upgrade-pay {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  text-align: left;
  margin-bottom: 0.5rem;
}

.pay-step {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
}

.pay-step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.pay-step-label {
  font-size: 0.8rem;
  color: var(--text2);
  margin-bottom: 0.2rem;
}

.pay-upi-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.1rem;
}

.pay-upi {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.02em;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.pay-copy-btn {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
}

.pay-copy-btn:hover { background: var(--accent); color: #fff; }
.pay-copy-btn.copied { background: var(--green); border-color: var(--green); color: #fff; }

.pay-whatsapp {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--green);
  text-decoration: none;
}

.pay-whatsapp:hover {
  text-decoration: underline;
}

@media (max-width: 900px) {
  .upgrade-features {
    grid-template-columns: 1fr;
  }

  .sg-count {
    font-size: 0.68rem;
    min-width: 44px;
  }

  .upgrade-box {
    max-width: 95vw;
  }
}

/* ===== END PRACTICE BUTTON ===== */
.btn-end-practice {
  padding: 0.6rem 1.1rem;
  background: transparent;
  border: 1px solid rgba(244, 76, 96, 0.25);
  border-radius: var(--radius-sm);
  color: var(--text3);
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.01em;
}

.btn-end-practice:hover {
  background: rgba(244, 76, 96, 0.08);
  border-color: rgba(244, 76, 96, 0.5);
  color: var(--red);
}

/* ============================================================
   V2 SYSTEM — Phase A CSS additions
   All classes below are new. Nothing above is modified.
   ============================================================ */

/* ── Wrong state: applied to #question-card on wrong answer ── */
.question-card.wrong-state {
  border-color: var(--fix-p1-border);
  background: var(--fix-p1-bg);
  transition: border-color 0.2s, background 0.2s;
}
.question-card.wrong-state .passage-context {
  background: rgba(244, 76, 96, 0.06);
  border-color: rgba(244, 76, 96, 0.25);
  transition: background 0.2s, border-color 0.2s;
}

/* ── Correct state: applied to #question-card on correct answer ── */
.question-card.correct-state .passage-context {
  background: rgba(62, 207, 122, 0.05);
  border-color: rgba(62, 207, 122, 0.22);
  transition: background 0.2s, border-color 0.2s;
}

/* A sticky passage is pinned on top (z-index) while the options scroll past
   beneath it. The wrong/correct-state tints above have higher specificity than
   .passage-context.is-sticky, so they were replacing its opaque background with
   a near-transparent one — letting the options show through and overlap the
   passage. Re-assert an opaque base here (tint composited over it) so the pinned
   passage always hides what scrolls behind it. */
.question-card.wrong-state .passage-context.is-sticky {
  background: linear-gradient(rgba(244, 76, 96, 0.06), rgba(244, 76, 96, 0.06)), #111827;
}
.question-card.correct-state .passage-context.is-sticky {
  background: linear-gradient(rgba(62, 207, 122, 0.05), rgba(62, 207, 122, 0.05)), #111827;
}

/* ── Fix Mode Phase 1 (red accent) ─────────────────────────── */
/* Applied to #practice-area. Overrides accent-colored elements */
/* Fix Mode P1 banner strip */
#practice-area.fix-mode-p1 #practice-mode-badge {
  display: block;
  background: rgba(244, 76, 96, 0.08);
  color: var(--fix-p1-color);
  border: 1px solid rgba(244, 76, 96, 0.25);
  border-radius: 0.5rem;
  padding: 0.6rem 1rem;
  text-align: center;
  font-size: 0.875rem;
  font-weight: 600;
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 1rem;
}

/* Per-question context label (phase 1 = red, phase 2 = blue) */
.wrong-before-label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--fix-p1-color);
  margin-bottom: 0.75rem;
}

.fix-mode-p2 .wrong-before-label {
  color: var(--fix-p2-color);
}

.fix-mode-p1 #question-card {
  border-top: 2.5px solid var(--fix-p1-color);
}

.fix-mode-p1 .q-counter {
  color: var(--fix-p1-color);
}
.fix-mode-p1 .btn-primary {
  background: var(--fix-p1-color);
}
.fix-mode-p1 .btn-primary:hover {
  background: #e03550;
}
.fix-mode-p1 .option-btn.correct {
  border-color: var(--green);
  background: rgba(62, 207, 122, 0.12);
}
.fix-mode-p1 .option-btn.wrong {
  border-color: var(--fix-p1-color);
  background: rgba(244, 76, 96, 0.12);
}

/* ── Fix Mode Phase 2 (blue/accent) ────────────────────────── */
#practice-area.fix-mode-p2 #practice-mode-badge {
  display: block;
  background: rgba(91, 122, 245, 0.08);
  color: var(--fix-p2-color);
  border: 1px solid rgba(91, 122, 245, 0.25);
  border-radius: 0.5rem;
  padding: 0.6rem 1rem;
  text-align: center;
  font-size: 0.875rem;
  font-weight: 600;
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 1rem;
}

.fix-mode-p2 #question-card {
  border-top: 2.5px solid var(--fix-p2-color);
}

.fix-mode-p2 .q-counter {
  color: var(--fix-p2-color);
}

/* ── Diagnostic callout box (S5 session complete) ───────────── */
/* "🔥 This is why your score is stuck." */
.diagnostic-box {
  background: var(--orange-bg);
  border: 1px solid var(--orange-border);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1.1rem;
  text-align: center;
  font-size: 1rem;
  font-weight: 700;
  color: var(--orange);
  margin: 1rem 0;
  letter-spacing: 0.01em;
}

/* ── Session error type pills (S5 wrong answer breakdown) ───── */
.session-pills-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin: 0.75rem 0;
}
.session-error-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text2);
}
.session-error-pill.calculation,
.session-error-pill.silly {
  border-color: var(--fix-p1-border);
  color: var(--fix-p1-color);
  background: var(--fix-p1-bg);
}
.session-error-pill.concept_gap,
.session-error-pill.conceptual {
  border-color: rgba(91, 122, 245, 0.3);
  color: var(--accent2);
  background: var(--fix-p2-bg);
}
.session-error-pill.misread {
  border-color: rgba(74, 158, 255, 0.3);
  color: var(--blue);
  background: rgba(74, 158, 255, 0.07);
}
.session-error-pill.guess {
  border-color: rgba(245, 166, 35, 0.3);
  color: var(--yellow);
  background: rgba(245, 166, 35, 0.07);
}
.session-error-pill.unclassified {
  border-color: var(--border);
  color: var(--text3);
}

/* ── V2 Auth / S0 redesign ──────────────────────────────────── */

/* Root fix: auth screen has no background of its own in V1,
   relying on body showing through the fixed overlay.
   Preview environments render that as white. Set it explicitly. */
#auth-screen {
  background: #0d0d0f;
  background: var(--bg);
}

/* Tighten the container gap — now has 3 visible children
   (brand + hero + ctas) so 2rem gap was too spread */
#auth-screen .auth-container {
  gap: 1.25rem;
  padding: 0.6rem 1.5rem 2.5rem;
  min-height: 100vh;
  justify-content: center;
  margin: 0 auto;
}

/* Hero message block */
.auth-hero {
  text-align: center;
  width: 100%;
}

.auth-headline {
  font-family: 'Syne', sans-serif;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 6.5vw, 2.6rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -1px;
  color: #f0f0f5;
  color: var(--text);
  margin-bottom: 0.75rem;
}

.auth-headline-accent {
  color: #f44c60;
  color: var(--fix-p1-color);
}

.auth-sub1 {
  font-size: clamp(0.82rem, 3vw, 1rem);
  color: #f0f0f5;
  color: var(--text);
  font-weight: 400;
  margin-bottom: 0.3rem;
}

.auth-sub2 {
  font-size: clamp(0.78rem, 2.5vw, 0.9rem);
  color: #9090a8;
  color: var(--text2);
}

/* CTA stack */
.auth-ctas {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
}

/* Primary CTA — "Try 2-min Fix Session ⚡" */
.btn-fix-session {
  background: #5b7af5;
  background: var(--accent);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  border-radius: var(--radius-sm);
  padding: 1rem 1.5rem;
  font-family: 'DM Sans', sans-serif;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
  letter-spacing: 0.01em;
  display: block;
}

.btn-fix-session:hover {
  background: #9d8fff;
  background: var(--accent2);
  transform: translateY(-1px);
}

/* "Already have an account?" line */
.auth-login-link {
  text-align: center;
  color: #5a5a72;
  color: var(--text3);
  font-size: 0.85rem;
  margin: 0;
}

/* "Login / Sign up" inline toggle button */
.auth-login-toggle {
  background: none;
  border: none;
  color: #9d8fff;
  color: var(--accent2);
  font-size: 0.85rem;
  font-family: 'DM Sans', sans-serif;
  font-family: var(--font-body);
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-decoration-color: rgba(157, 143, 255, 0.5);
  text-underline-offset: 3px;
  transition: color 0.15s, text-decoration-color 0.15s;
}

.auth-login-toggle:hover {
  color: #ffffff;
  text-decoration-color: rgba(255, 255, 255, 0.4);
}

/* Auth card: always visible (demo mode removed) */
#auth-card-collapsible {
  display: block;
  width: 100%;
}

/* ── V2 Auth: targeted fixes ─────────────────────────────────── */

/* Force solid dark background so app-screen can't bleed through */
#auth-screen.active {
  background: #0d0d0f;
  background: var(--bg);
}

/* CTA column stack — align-items: stretch ensures full-width buttons */
.auth-ctas {
  align-items: stretch;
}

/* Ensure both CTA buttons fill full width regardless of display mode */
.auth-ctas .btn-fix-session,
.auth-ctas .btn-demo {
  width: 100%;
  box-sizing: border-box;
  display: block;
}

/* Wrong state banner */
.wrong-banner {
  background: rgba(244, 76, 96, 0.1);
  border: 1px solid rgba(244, 76, 96, 0.3);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
}

.wrong-banner-title {
  display: block;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  color: #f44c60;
  color: var(--fix-p1-color);
  margin-bottom: 0.2rem;
}

.wrong-banner-sub {
  display: block;
  font-size: 0.85rem;
  color: #f59e0b;
  color: var(--orange);
  font-weight: 500;
}

/* Practice screen behavioral nudge */
.practice-nudge {
  text-align: center;
  font-size: 0.78rem;
  color: var(--text3);
  margin: 0 0 0.85rem;
  letter-spacing: 0.01em;
}

#practice-area.fix-mode-p1 .practice-nudge,
#practice-area.fix-mode-p2 .practice-nudge {
  display: none;
}

/* Login link row should not stretch (it's a paragraph, not a button) */
.auth-ctas .auth-login-link {
  width: 100%;
  box-sizing: border-box;
}

/* ── S1 Dashboard Hero (new user / returning user) ───────────── */
.dash-state-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius);
  margin-bottom: 1.25rem;
  border: 1px solid var(--border);
  background: var(--surface);
}

.dash-state-new {
  border-color: rgba(91, 122, 245, 0.3);
  background: rgba(91, 122, 245, 0.06);
  flex-direction: column;
  align-items: flex-start;
}

.dash-state-returning {
  border-color: rgba(244, 76, 96, 0.3);
}

/* Left block: takes remaining space */
.dash-state-left {
  flex: 1;
  min-width: 0;
}

/* Text block: emoji above title */
.dash-state-text {
  display: flex;
  flex-direction: column;
}

.dash-state-icon {
  display: block;
  font-size: 1.5rem;
  line-height: 1;
  margin-bottom: 0.5rem;
}

.dash-state-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
  margin: 0 0 0.35rem;
  line-height: 1.15;
}

.dash-state-count {
  color: #f44c60;
  color: var(--fix-p1-color);
}

.dash-state-sub {
  font-size: 0.88rem;
  color: var(--text2);
  margin: 0;
}

/* CTA button: fixed width on desktop, full width on mobile */
.dash-state-cta {
  flex-shrink: 0;
  width: auto;
  padding: 0.75rem 1.5rem;
  white-space: nowrap;
}

@media (max-width: 768px) {
  .dash-state-returning {
    flex-direction: column;
    align-items: flex-start;
  }
  .dash-state-cta {
    width: 100%;
    box-sizing: border-box;
  }
}

/* ── Hide filter UI during full-screen states ─────────────────── */
#page-practice:has(#session-summary:not(.hidden)) #practice-filters,
#page-practice:has(#session-summary:not(.hidden)) #practice-topbar,
#page-practice:has(#fix-mode-entry:not(.hidden)) #practice-filters,
#page-practice:has(#fix-mode-entry:not(.hidden)) #practice-topbar,
#page-practice:has(#fix-transition:not(.hidden)) #practice-filters,
#page-practice:has(#fix-transition:not(.hidden)) #practice-topbar,
#page-practice:has(#fix-session-complete:not(.hidden)) #practice-filters,
#page-practice:has(#fix-session-complete:not(.hidden)) #practice-topbar {
  display: none;
}

/* ── S10 Fix Session Complete card ───────────────────────────── */
.fix-sc-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 2.5rem 2rem;
  max-width: 560px;
  margin: 3rem auto;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 1.25rem;
  gap: 1rem;
}

.fsc-hero {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.fsc-title {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text1);
  letter-spacing: -0.03em;
}

.fsc-stat-val.fsc-green { color: var(--green); }
.fsc-stat-val.fsc-red   { color: var(--fix-p1-color); }

.fsc-remain {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--fix-p1-color);
}

.fsc-alert {
  width: 100%;
  padding: 0.8rem 1.25rem;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 0.6rem;
  color: #f59e0b;
  font-size: 1rem;
  font-weight: 700;
}

.fsc-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  width: 100%;
}

.fsc-stat {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 0.85rem 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
}

.fsc-stat-val {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text1);
  letter-spacing: -0.02em;
}

.fsc-stat-label {
  font-size: 0.75rem;
  color: var(--text3);
  font-weight: 500;
}

.fsc-cta {
  width: 100%;
  padding: 0.95rem 1.5rem;
  font-size: 1rem;
  font-weight: 700;
  border-radius: 0.75rem;
  margin-top: 0.25rem;
}

.fsc-footer {
  font-size: 0.82rem;
  color: var(--text3);
  margin: 0;
}

@media (max-width: 600px) {
  .fix-sc-card {
    margin: 1.5rem 1rem;
    padding: 1.75rem 1.25rem;
  }
  .fsc-title { font-size: 1.6rem; }
  .fsc-stat-val { font-size: 1.3rem; }
}

/* ── S8 Fix Mode Transition card ──────────────────────────────── */
.fix-transition-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 3rem 2rem;
  max-width: 520px;
  margin: 4rem auto;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 1.25rem;
  gap: 0.9rem;
}

.ft-check {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--green);
  letter-spacing: -0.01em;
}

.ft-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text1);
  margin: 0;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.ft-topic {
  color: var(--fix-p1-color);
}

.ft-sub {
  font-size: 0.95rem;
  color: var(--text2);
  margin: 0;
}

.ft-cta {
  width: 100%;
  max-width: 340px;
  padding: 0.9rem 1.5rem;
  font-size: 1rem;
  font-weight: 700;
  border-radius: 0.75rem;
  margin-top: 0.5rem;
}

.ft-skip {
  background: none;
  border: none;
  color: var(--text3);
  font-size: 0.875rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  transition: color 0.15s;
}

.ft-skip:hover {
  color: var(--text2);
}

@media (max-width: 600px) {
  .fix-transition-card {
    margin: 2rem 1rem;
    padding: 2rem 1.25rem;
  }
  .ft-title { font-size: 1.3rem; }
}

.fix-mode-entry-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3rem 2rem;
  max-width: 480px;
  margin: 4rem auto;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 1.25rem;
  gap: 1rem;
}

.fme-icon {
  font-size: 3.5rem;
  line-height: 1;
  margin-bottom: 0.25rem;
}

.fme-title {
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent);
  margin: 0;
  letter-spacing: -0.02em;
}

.fme-sub {
  font-size: 1rem;
  color: var(--text2);
  margin: 0;
  max-width: 340px;
}

.fme-checklist {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  text-align: left;
  width: 100%;
  max-width: 320px;
}

.fme-checklist li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.95rem;
  color: var(--text1);
}

.fme-checklist li::before {
  content: '✓';
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

.fme-cta {
  width: 100%;
  max-width: 320px;
  padding: 0.9rem 1.5rem;
  font-size: 1rem;
  font-weight: 700;
  border-radius: 0.75rem;
  background: var(--accent);
  color: #fff;
  border: none;
  cursor: pointer;
  margin-top: 0.5rem;
  transition: opacity 0.15s, transform 0.1s;
}

.fme-cta:hover {
  opacity: 0.88;
  transform: translateY(-1px);
}

@media (max-width: 600px) {
  .fix-mode-entry-card {
    margin: 2rem 1rem;
    padding: 2rem 1.25rem;
  }
  .fme-title { font-size: 1.6rem; }
}

/* ===== ONBOARDING TOUR ===== */
.tour-overlay {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: transparent;
  transition: background 0.3s ease;
  pointer-events: none;
}
.tour-overlay.is-blocking {
  background: rgba(0, 0, 0, 0.82);
  pointer-events: all;
}
.tour-spotlight {
  position: fixed;
  z-index: 9999;
  border-radius: 12px;
  pointer-events: none;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.72);
  outline: 2px solid var(--accent);
  outline-offset: 0;
  opacity: 0;
  transition:
    top 0.45s cubic-bezier(0.4, 0, 0.2, 1),
    left 0.45s cubic-bezier(0.4, 0, 0.2, 1),
    width 0.45s cubic-bezier(0.4, 0, 0.2, 1),
    height 0.45s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.25s ease;
}
.tour-tooltip {
  position: fixed;
  z-index: 10000;
  width: 280px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.45);
  pointer-events: auto;
  opacity: 0;
  transition:
    top 0.45s cubic-bezier(0.4, 0, 0.2, 1),
    left 0.45s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.3s ease;
}
.tt-progress {
  font-size: 0.7rem;
  color: var(--text3);
  font-family: var(--font-mono);
  margin-bottom: 0.5rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.tt-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 0.4rem;
}
.tt-body {
  font-size: 0.875rem;
  color: var(--text2);
  line-height: 1.55;
  margin-bottom: 1rem;
}
.tt-btn {
  width: 100%;
  padding: 0.65rem 1rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-body);
  transition: opacity 0.15s;
}
.tt-btn:hover { opacity: 0.88; }
.tt-actions {
  margin-top: 0.75rem;
}

/* ── Tooltip inline formatting helpers ─────────── */
.tt-chip {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  vertical-align: middle;
}
.tt-chip.p1 { background: var(--fix-p1-bg); color: var(--fix-p1-color); border: 1px solid var(--fix-p1-border); }
.tt-chip.p2 { background: var(--fix-p2-bg); color: var(--fix-p2-color); border: 1px solid var(--fix-p2-border); }
.tt-body .tt-list {
  margin: 0.3rem 0 0;
  padding-left: 1.1rem;
  line-height: 1.6;
}
.tt-body .tt-list li { margin-bottom: 0.15rem; }
.tt-body .tt-list li:last-child { margin-bottom: 0; }

/* ── Desktop drag ───────────────────────────────── */
@media (min-width: 769px) {
  .tour-tooltip { cursor: grab; }
  .tour-tooltip button { cursor: pointer; }
  .tour-tooltip.is-dragging {
    transition: opacity 0.3s ease; /* suppress position transition during drag */
    cursor: grabbing !important;
    user-select: none;
  }
}

/* ── Tour minimize button ───────────────────────── */
.tt-minimize-btn {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  width: 1.4rem;
  height: 1.4rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text3);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  z-index: 1;
  font-family: var(--font-mono);
}
.tt-minimize-btn:hover { color: var(--text2); border-color: var(--text3); }

/* Minimised pill — collapses to progress chip */
.tour-tooltip.is-minimized {
  padding: 0.45rem 2rem 0.45rem 0.75rem;
  cursor: pointer;
  width: auto !important;
  min-width: 0;
}
.tour-tooltip.is-minimized .tt-title,
.tour-tooltip.is-minimized .tt-body,
.tour-tooltip.is-minimized .tt-actions { display: none; }
.tour-tooltip.is-minimized .tt-progress { margin-bottom: 0; font-size: 0.75rem; }

/* ── Docked tabs (mobile swipe-to-edge) ─────────── */
.tour-tooltip.is-docked-top,
.tour-tooltip.is-docked-bottom,
.tour-tooltip.is-docked-left,
.tour-tooltip.is-docked-right {
  padding: 0.45rem 0.6rem;
  cursor: pointer;
}
.tour-tooltip.is-docked-top    { border-radius: 0 0 var(--radius-sm) var(--radius-sm); }
.tour-tooltip.is-docked-bottom { border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
.tour-tooltip.is-docked-left   { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; writing-mode: vertical-rl; text-orientation: mixed; }
.tour-tooltip.is-docked-right  { border-radius: var(--radius-sm) 0 0 var(--radius-sm); writing-mode: vertical-rl; text-orientation: mixed; transform: rotate(180deg); }
.tour-tooltip[class*="is-docked-"] .tt-title,
.tour-tooltip[class*="is-docked-"] .tt-body,
.tour-tooltip[class*="is-docked-"] .tt-actions,
.tour-tooltip[class*="is-docked-"] .tt-minimize-btn { display: none; }
.tour-tooltip[class*="is-docked-"] .tt-progress { margin-bottom: 0; font-size: 0.72rem; }
.tour-dismiss-bar {
  position: fixed;
  top: 0.85rem;
  right: 1rem;
  z-index: 10001;
  display: flex;
  gap: 0.4rem;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
@media (max-width: 768px) {
  .tour-dismiss-bar {
    top: 60px; /* below the mobile top bar */
    right: 0.75rem;
  }
}
.tour-dismiss-bar.is-visible {
  opacity: 1;
  pointer-events: auto;
}
.tour-dismiss-btn {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text3);
  font-size: 0.72rem;
  font-family: var(--font-body);
  padding: 0.38rem 0.75rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.tour-dismiss-btn:hover { color: var(--text2); border-color: var(--text3); }
@media (max-width: 768px) {
  .tour-tooltip {
    max-width: calc(100vw - 2rem);
  }
}

/* ── Auth screen: mobile layout ──────────────────────────────── */
@media (max-width: 900px) {
  #auth-screen .auth-container {
    gap: 0.75rem;
    padding: 1.5rem 1rem 2rem;
    min-height: unset;
    justify-content: flex-start;
  }

  /* Brand: compact inline row */
  .auth-brand {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
  }
  .auth-brand .brand-icon { font-size: 1.35rem; }
  .auth-brand h1 { font-size: 1.45rem; }

  /* Hide marketing copy — just show the form on mobile */
  .auth-hero { display: none; }

  /* Card: tighter padding */
  .auth-card { padding: 1.1rem 1rem; }
  .auth-tabs { margin-bottom: 0.75rem; }

  /* Form: smaller gaps and inputs */
  .auth-form { gap: 0.6rem; }
  #auth-screen .form-group input {
    padding: 0.55rem 0.85rem;
    font-size: 0.88rem;
  }

  /* Buttons: slightly shorter */
  #auth-screen .btn-primary {
    padding: 0.65rem 1rem;
    font-size: 0.88rem;
  }
  #auth-screen .btn-google {
    padding: 0.65rem 1rem;
    font-size: 0.88rem;
  }
}

/* ── PWA install prompt ──────────────────────────────────────── */
#pwa-prompt {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9100;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
}
#pwa-prompt.visible {
  transform: translateY(0);
}
.pwa-inner {
  background: var(--surface2);
  border-top: 1px solid var(--border);
  border-radius: 20px 20px 0 0;
  padding: 1.5rem 1.5rem 2.5rem;
  position: relative;
  max-width: 480px;
  margin: 0 auto;
}
.pwa-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: var(--text3);
  font-size: 1rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  line-height: 1;
}
.pwa-icon {
  font-size: 2rem;
  margin-bottom: 0.6rem;
}
.pwa-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.3rem;
  font-family: var(--font-display);
}
.pwa-sub {
  font-size: 0.85rem;
  color: var(--text2);
  margin-bottom: 1.25rem;
}
.pwa-ios-steps {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.pwa-ios-step {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.88rem;
  color: var(--text);
}
.pwa-num {
  width: 24px;
  height: 24px;
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}
.pwa-add-btn {
  width: 100%;
  padding: 0.85rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 700;
  font-family: var(--font-body);
  cursor: pointer;
  margin-bottom: 0.75rem;
}
.pwa-later {
  width: 100%;
  padding: 0.5rem;
  background: none;
  border: none;
  color: var(--text3);
  font-size: 0.83rem;
  font-family: var(--font-body);
  cursor: pointer;
}

/* ── Push notification permission banner ─────────────────────── */
#push-banner {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  z-index: 8500;
  width: min(400px, calc(100vw - 2rem));
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
}
#push-banner.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.push-banner-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.push-banner-text strong {
  font-size: 0.88rem;
  color: var(--text);
}
.push-banner-text span {
  font-size: 0.76rem;
  color: var(--text2);
}
.push-banner-btns {
  display: flex;
  gap: 0.45rem;
  flex-shrink: 0;
}
.push-banner-btns button {
  padding: 0.38rem 0.85rem;
  border-radius: 20px;
  border: 1px solid transparent;
  font-size: 0.78rem;
  font-family: var(--font-body);
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}
.push-banner-btns button:hover { opacity: 0.85; }
#push-yes {
  background: var(--accent);
  color: #fff;
}

/* ===== PAYWALL ===== */
.paywall-overlay {
  position: fixed;
  inset: 0;
  z-index: 9500;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 1.5rem 1rem 3rem;
}
.paywall-overlay.hidden { display: none; }

.paywall-box {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  animation: slideUp 0.25s ease;
}

.paywall-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.paywall-icon {
  font-size: 2.5rem;
  margin-bottom: 0.6rem;
}

.paywall-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 0.35rem;
  letter-spacing: -0.02em;
}

.paywall-desc {
  font-size: 0.88rem;
  color: var(--text2);
  line-height: 1.5;
}

.paywall-stat-block {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  background: linear-gradient(135deg, rgba(244, 76, 96, 0.08), rgba(91, 122, 245, 0.06));
  border: 1px solid rgba(244, 76, 96, 0.25);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.paywall-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.paywall-stat-num {
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--red);
  line-height: 1;
}

.paywall-stat-label {
  font-size: 0.7rem;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}

.paywall-stat-divider {
  width: 1px;
  height: 44px;
  background: var(--border);
  flex-shrink: 0;
}

.paywall-locked {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
}

.paywall-locked-title {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 0.5rem;
}

.paywall-locked-row {
  font-size: 0.85rem;
  color: var(--text2);
  padding: 0.22rem 0;
}

.paywall-already-paid {
  text-align: center;
  font-size: 0.78rem;
  color: var(--text3);
  margin-top: 0.75rem;
  margin-bottom: 0;
}

.paywall-back-btn {
  display: block;
  width: 100%;
  margin-top: 1rem;
  padding: 0.55rem;
  background: none;
  border: none;
  color: var(--text3);
  font-size: 0.8rem;
  font-family: var(--font-body);
  cursor: pointer;
  text-align: center;
  transition: color 0.15s;
}
.paywall-back-btn:hover { color: var(--text2); }
#push-no {
  background: transparent;
  border-color: var(--border);
  color: var(--text2);
}

/* ============================================================
   ANALYTICS PAGE
   ============================================================ */

/* Tab bar */
.an-tabs {
  display: flex;
  gap: 0.25rem;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 1.25rem;
}
.an-tab {
  flex: 1;
  padding: 0.5rem 0.75rem;
  border: none;
  background: transparent;
  color: var(--text2);
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: 7px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  font-family: var(--font-body);
}
.an-tab.active {
  background: var(--accent);
  color: #fff;
}
.an-tab:not(.active):hover { background: var(--bg3); color: var(--text); }

/* Panel visibility */
.an-panel-hidden { display: none !important; }

/* Generic card */
.an-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.1rem 1.25rem;
  margin-bottom: 1rem;
}
.an-card-header {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.an-card-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.01em;
}
.an-card-sub {
  font-size: 0.75rem;
  color: var(--text3);
}
.an-empty {
  color: var(--text3);
  font-size: 0.85rem;
  text-align: center;
  padding: 1.5rem 0;
}

/* Two-column layout */
.an-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}
@media (max-width: 680px) { .an-two-col { grid-template-columns: 1fr; } }

/* ── KPI Cards ─────────────────────────────────────────── */
.an-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-bottom: 1rem;
}
@media (max-width: 680px) { .an-kpi-row { grid-template-columns: repeat(2, 1fr); } }

.an-kpi-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
}
.an-kpi-num {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
  margin-bottom: 0.2rem;
}
.an-kpi-label {
  font-size: 0.75rem;
  color: var(--text2);
  font-weight: 500;
  margin-bottom: 0.3rem;
}
.an-kpi-sub {
  font-size: 0.72rem;
  color: var(--text3);
}
.an-kpi-delta {
  font-size: 0.72rem;
  font-weight: 600;
  display: block;
}
.an-kpi-delta.pos { color: #22c55e; }
.an-kpi-delta.neg { color: #ef4444; }

/* ── Heatmap ───────────────────────────────────────────── */
.an-hm-months {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  margin-bottom: 0.3rem;
}
.an-hm-months span {
  font-size: 0.68rem;
  color: var(--text3);
}
.an-hm-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  grid-template-rows: repeat(7, 1fr);
  grid-auto-flow: column;
  gap: 3px;
}
.an-hm-cell {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 2px;
}
.an-hm-0 { background: var(--bg3); }
.an-hm-1 { background: rgba(91,122,245,0.25); }
.an-hm-2 { background: rgba(91,122,245,0.50); }
.an-hm-3 { background: rgba(91,122,245,0.75); }
.an-hm-4 { background: var(--accent); }

.an-hm-footer {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.6rem;
  justify-content: flex-end;
}
.an-hm-lbl { font-size: 0.68rem; color: var(--text3); }
.an-hm-legend { display: flex; gap: 3px; }
.an-hm-legend .an-hm-cell { width: 12px; height: 12px; }

/* ── 14-day trend ──────────────────────────────────────── */
.an-trend-chart {
  display: flex;
  gap: 4px;
  align-items: flex-end;
  height: 100px;
}
.an-trend-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  height: 100%;
}
.an-trend-wrap {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: flex-end;
}
.an-trend-bar {
  width: 100%;
  min-height: 2px;
  border-radius: 3px 3px 0 0;
  transition: height 0.3s ease;
}
.an-trend-lbl {
  font-size: 0.62rem;
  color: var(--text3);
}
.an-trend-today { color: var(--accent); font-weight: 700; }
.an-trend-legend {
  display: flex;
  gap: 1rem;
  font-size: 0.72rem;
  color: var(--text2);
  margin-top: 0.75rem;
  flex-wrap: wrap;
}
.an-leg-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 3px;
  vertical-align: middle;
}

/* ── Donut ─────────────────────────────────────────────── */
.an-donut-wrap {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0.5rem 0;
}
.an-donut-ring {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.an-donut-hole {
  width: 65px;
  height: 65px;
  background: var(--bg2);
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.an-donut-total { font-size: 1.1rem; font-weight: 800; color: var(--text); line-height: 1; }
.an-donut-lbl { font-size: 0.6rem; color: var(--text3); }
.an-donut-legend { display: flex; flex-direction: column; gap: 0.4rem; }
.an-dl-row { font-size: 0.8rem; color: var(--text2); display: flex; align-items: center; gap: 0.4rem; }
.an-dl-row strong { color: var(--text); }
.an-dl-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }

/* ── Subject cards ─────────────────────────────────────── */
.an-sub-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}
@media (max-width: 680px) { .an-sub-cards { grid-template-columns: 1fr; } }

.an-sub-card {
  background: var(--bg3);
  border-radius: 10px;
  padding: 1rem;
}
.an-sub-header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.6rem;
}
.an-sub-icon { font-size: 1rem; }
.an-sub-name { font-size: 0.85rem; font-weight: 600; color: var(--text); flex: 1; }
.an-sub-trend { font-size: 0.72rem; font-weight: 700; }
.an-sub-trend.pos { color: #22c55e; }
.an-sub-trend.neg { color: #ef4444; }
.an-sub-acc { font-size: 2rem; font-weight: 800; line-height: 1; }
.an-sub-label { font-size: 0.7rem; color: var(--text3); margin-bottom: 0.5rem; }
.an-sub-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text2);
  margin-bottom: 0.4rem;
}
.an-sub-weak {
  font-size: 0.72rem;
  color: #f59e0b;
  margin-bottom: 0.5rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.an-sub-bar-track {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}
.an-sub-bar {
  height: 100%;
  border-radius: 2px;
  transition: width 0.5s ease;
}

/* ── Error breakdown ───────────────────────────────────── */
.an-err-row {
  display: grid;
  grid-template-columns: 160px 1fr auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}
.an-err-row:last-of-type { border-bottom: none; }
.an-err-label { display: flex; flex-direction: column; gap: 0.2rem; }
.an-err-name { font-size: 0.82rem; font-weight: 600; color: var(--text); }
.an-err-count { font-size: 0.7rem; color: var(--text3); }
.an-err-bars { display: flex; flex-direction: column; gap: 4px; }
.an-err-bar-track, .an-err-fixbar-track {
  height: 6px;
  background: var(--bg3);
  border-radius: 3px;
  overflow: hidden;
}
.an-err-bar, .an-err-fixbar {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s ease;
}
.an-err-meta { text-align: right; }
.an-err-fix-label { font-size: 0.7rem; color: #22c55e; font-weight: 600; }
.an-err-legend {
  display: flex;
  gap: 1rem;
  font-size: 0.72rem;
  color: var(--text2);
  margin-top: 0.75rem;
}
@media (max-width: 540px) {
  .an-err-row { grid-template-columns: 1fr; }
}

/* ── Speed analysis ────────────────────────────────────── */
.an-speed-top {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0.5rem 0 1rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1rem;
}
.an-speed-kpi { display: flex; flex-direction: column; align-items: center; }
.an-speed-val { font-size: 1.6rem; font-weight: 800; }
.an-speed-lbl { font-size: 0.7rem; color: var(--text2); }
.an-speed-vs { color: var(--text3); font-size: 0.8rem; }
.an-speed-bars { display: flex; flex-direction: column; gap: 0.6rem; }
.an-speed-row {
  display: grid;
  grid-template-columns: 50px 1fr 40px 80px;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.8rem;
}
.an-speed-sub { color: var(--text2); font-weight: 500; }
.an-speed-bar-track { height: 8px; background: var(--bg3); border-radius: 4px; overflow: hidden; }
.an-speed-bar { height: 100%; border-radius: 4px; transition: width 0.5s; }
.an-speed-num { color: var(--text); font-weight: 600; text-align: right; }
.an-speed-hint { color: var(--text3); font-size: 0.7rem; }
.an-speed-note { font-size: 0.72rem; color: var(--text3); margin-top: 0.75rem; }

/* ── Topic heatmap ─────────────────────────────────────── */
.an-hm-section { margin-bottom: 1.25rem; }
.an-hm-sec-label { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 0.5rem; }
.an-hm-topic-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.an-topic-cell {
  padding: 0.35rem 0.6rem;
  border-radius: 6px;
  font-size: 0.7rem;
  color: #fff;
  font-weight: 500;
  line-height: 1.3;
  cursor: default;
  text-align: center;
}
.an-topic-cell small { font-size: 0.65rem; opacity: 0.85; }

/* ── Coverage donut ────────────────────────────────────── */
.an-cov-top {
  display: flex;
  align-items: center;
  gap: 2rem;
  padding-bottom: 1rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.an-cov-big { font-size: 2rem; font-weight: 800; color: var(--text); line-height: 1; margin-bottom: 0.2rem; }
.an-cov-subs { display: flex; flex-direction: column; gap: 0.6rem; }
.an-cov-row {
  display: grid;
  grid-template-columns: 50px 1fr 120px;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.8rem;
}
.an-cov-sub { font-weight: 700; }
.an-cov-bar-track { height: 8px; background: var(--bg3); border-radius: 4px; overflow: hidden; }
.an-cov-bar { height: 100%; border-radius: 4px; transition: width 0.5s; }
.an-cov-pct { font-size: 0.75rem; color: var(--text2); text-align: right; }

/* ── Topic table ───────────────────────────────────────── */
.an-table-wrap { overflow-x: auto; }
.an-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}
.an-table th {
  text-align: left;
  color: var(--text3);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid var(--border);
}
.an-table td {
  padding: 0.5rem 0.6rem;
  color: var(--text2);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.an-table tr:last-child td { border-bottom: none; }
.an-table tr:hover td { background: var(--bg3); }
.an-table-bar-track { height: 5px; background: var(--border); border-radius: 2px; overflow: hidden; width: 80px; margin-bottom: 2px; }
.an-table-bar { height: 100%; border-radius: 2px; }

/* ── Blind spots ───────────────────────────────────────── */
.an-blind-grid { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.an-blind-chip {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.35rem 0.65rem;
  font-size: 0.78rem;
  color: var(--text2);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.an-blind-n { font-size: 0.68rem; color: var(--text3); }

/* ── Hard questions ────────────────────────────────────── */
.an-hard-list { display: flex; flex-direction: column; gap: 0.5rem; }
.an-hard-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--border);
}
.an-hard-row:last-child { border-bottom: none; }
.an-hard-rank { font-size: 0.72rem; color: var(--text3); width: 24px; flex-shrink: 0; }
.an-hard-info { flex: 1; }
.an-hard-topic { font-size: 0.82rem; color: var(--text); font-weight: 500; display: block; }
.an-hard-meta { font-size: 0.7rem; color: var(--text3); }
.an-hard-acc { font-size: 0.9rem; font-weight: 800; }