/* ============================================================
   SAT Interactive Practice — Ultra-Clean Minimal Design System
   ============================================================ */

/* ---- Design Tokens ---- */
:root {
  /* Monochrome / Zinc palette (Replacing Bluebook) */
  --bb-navy: #09090b; /* Zinc 950 */
  --bb-navy-light: #18181b; /* Zinc 900 */
  --bb-blue: #09090b; /* Primary Accent (Black) */
  --bb-blue-hover: #27272a; /* Zinc 800 */
  --bb-blue-soft: #f4f4f5; /* Zinc 100 */
  --bb-blue-glow: rgba(0, 0, 0, 0.04);

  /* Neutrals */
  --ink: #09090b; /* Zinc 950 */
  --ink-secondary: #52525b; /* Zinc 600 */
  --ink-muted: #a1a1aa; /* Zinc 400 */
  --paper: #f8fafc; /* Slate 50 - Very subtle off-white */
  --panel: #ffffff;
  --line: #e4e4e7; /* Zinc 200 */
  --line-light: #f4f4f5; /* Zinc 100 */

  /* Semantic */
  --green: #10b981;
  --green-bg: #ecfdf5;
  --green-border: #a7f3d0;
  --red: #ef4444;
  --red-bg: #fef2f2;
  --red-border: #fecaca;
  --amber: #f59e0b;
  --amber-bg: #fffbeb;
  --amber-border: #fde68a;
  --teal: #14b8a6;
  --blue: #3b82f6;

  /* Elevation (Flatter, subtler shadows) */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05);

  /* Shape */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-pill: 9999px;

  color-scheme: light;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  margin: 0;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#app {
  min-height: 100vh;
  min-width: 0;
  width: 100%;
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; border: none; background: none; }
button:disabled, input:disabled { cursor: not-allowed; opacity: 0.45; }
img, svg { max-width: 100%; height: auto; }

/* ---- iOS Touch Fixes ---- */
button, label, a, div[onclick], .vocab-card, .vocab-flashcard-container, .choice-button, .vocab-match-btn { -webkit-tap-highlight-color: transparent; }

/* ---- Scrollbar styling ---- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.15); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.25); }

/* ============================================================
   SHARED COMPONENTS
   ============================================================ */

/* ---- App Shell ---- */
.app-shell {
  display: flex;
  max-width: 100%;
  min-height: 100vh;
  min-width: 0;
  width: 100%;
}
.sidebar {
  width: 260px;
  flex-shrink: 0;
  border-right: 1px solid var(--line);
  background: var(--panel);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 100;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: none;
}

.sidebar-collapsed .sidebar {
  width: 76px;
}

.sidebar-collapsed .sidebar .nav-label,
.sidebar-collapsed .sidebar .nav-heading,
.sidebar-collapsed .brand-mark .nav-label {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: opacity 0.1s;
  position: absolute;
}

.sidebar-collapsed .sidebar-header {
  padding: 24px 16px;
  justify-content: center;
}

.sidebar-collapsed .sidebar > .sidebar-header .sidebar-toggle {
  margin: 0 auto;
}

.sidebar-collapsed .brand-icon {
  margin: 0 auto;
  display: block;
}

.sidebar-collapsed .brand-mark {
  display: none; /* Let's just hide the brand mark and only show the toggle button when collapsed */
}

.sidebar-collapsed .nav-item {
  justify-content: center;
  padding: 12px;
}
.sidebar-collapsed .nav-item svg {
  margin: 0;
}

.sidebar-collapsed .sidebar-footer {
  padding-left: 8px;
  padding-right: 8px;
}
.sidebar-collapsed .sidebar .sync-status-container {
  justify-content: center;
  padding: 0;
  width: 36px;
  height: 36px;
  overflow: hidden;
}
.sidebar-collapsed .sidebar .sync-status-container svg, 
.sidebar-collapsed .sidebar .sync-status-container .sync-icon, 
.sidebar-collapsed .sidebar .sync-status-container .sync-spinner {
  margin: 0;
}

.sidebar-header {
  padding: 24px;
  border-bottom: 1px solid var(--line);
}
.sidebar-nav {
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  flex: 1;
  overflow-y: auto;
}
.nav-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.nav-section.mt-auto {
  margin-top: auto;
}
.nav-heading {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-muted);
  font-weight: 600;
  margin: 0 0 4px 8px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  color: var(--ink);
  font-weight: 500;
  font-size: 14px;
  text-decoration: none;
  transition: all 150ms ease;
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
}
.nav-item svg {
  color: var(--ink-muted);
  transition: color 150ms ease;
}
.nav-item:hover {
  background: var(--bb-blue-soft);
}
.nav-item.active {
  background: color-mix(in srgb, var(--bb-blue) 10%, transparent);
  color: var(--bb-blue);
}
.nav-item.active svg {
  color: var(--bb-blue);
}
.sidebar-footer {
  padding-top: 16px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.main-content-wrapper {
  flex: 1;
  padding: 32px 48px;
  max-width: 1200px;
  margin: 0 auto;
  min-width: 0;
  width: 100%;
}

/* ---- Boot Loader ---- */
.boot-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  padding: 24px;
}

.boot-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
  width: 100%;
  max-width: 340px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 40px 32px 32px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.08);
}

.boot-logo {
  width: 48px;
  height: 48px;
}

.boot-card h1 {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
  color: var(--ink);
}

.boot-card p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--ink-muted);
}

.boot-progress-bg {
  width: 100%;
  height: 4px;
  background: var(--line);
  border-radius: var(--radius-pill);
  overflow: hidden;
  margin-top: 8px;
}

.boot-progress-fill {
  height: 100%;
  width: 50%;
  background: var(--bb-blue);
  border-radius: var(--radius-pill);
  animation: shadcn-indeterminate 1.5s infinite ease-in-out;
  transform-origin: 0% 50%;
}

/* ---- Buttons ---- */
.ghost-btn, .primary-btn, .secondary-btn, .danger-btn, .bb-end-btn {
  border-radius: var(--radius-md); /* Shadcn SaaS styling */
  font-weight: 500; /* Minimalist typography */
  letter-spacing: -0.01em;
  min-height: 36px;
  padding: 8px 16px;
  transition: all 150ms ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

.ghost-btn:focus-visible, .primary-btn:focus-visible, .secondary-btn:focus-visible, .danger-btn:focus-visible, .bb-end-btn:focus-visible {
  outline: 2px solid var(--bb-blue);
  outline-offset: 2px;
}

.ghost-btn {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
}
.ghost-btn:hover { background: var(--bb-blue-soft); color: var(--ink); }

.primary-btn {
  background: var(--bb-blue);
  color: white;
  box-shadow: var(--shadow-sm);
}
.primary-btn:hover { background: var(--bb-blue-hover); box-shadow: var(--shadow-md); transform: translateY(-1px); }

.secondary-btn {
  background: var(--bb-blue-soft);
  border: 1px solid var(--line);
  color: var(--bb-blue);
}
.secondary-btn:hover { background: var(--line-light); border-color: var(--bb-blue); }

.primary-btn.large, .ghost-btn.large {
  min-height: 46px;
  padding: 12px 24px;
  font-size: 15px;
}

.icon-btn {
  padding: 8px;
  min-height: unset;
  flex-shrink: 0;
}
.icon-btn svg {
  flex-shrink: 0;
}

.danger-btn, .bb-end-btn {
  background: var(--red-bg);
  border: 1px solid var(--red-border);
  color: var(--red);
}
.danger-btn:hover, .bb-end-btn:hover {
  background: #fde8e8;
}

/* ---- Notices / Alerts ---- */
.notice, .test-notice {
  align-items: center;
  border-radius: var(--radius-xl);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 16px;
  padding: 14px 16px 14px 20px;
  font-size: 14px;
  font-weight: 500;
  position: fixed;
  bottom: 24px;
  right: 24px;
  top: auto;
  left: auto;
  transform: translateY(150%) scale(0.95);
  z-index: 9999;
  box-shadow: 0 10px 40px -10px rgba(0,0,0,0.15), 0 0 0 1px var(--line);
  width: max-content;
  max-width: min(90vw, 400px);
  background: rgba(255, 255, 255, 0.85);
  color: var(--ink);
  animation: slide-up-toast 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
:root[data-theme="dark"] .notice, :root[data-theme="dark"] .test-notice {
  background: rgba(15, 23, 42, 0.85);
}

@keyframes slide-up-toast {
  from { transform: translateY(150%) scale(0.95); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

@keyframes notice-countdown {
  from { stroke-dashoffset: 0; }
  to { stroke-dashoffset: 69.11; }
}

/* ---- Telemetry Consent ---- */
.telemetry-banner {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
}

[data-theme="dark"] .telemetry-banner {
  background: rgba(0, 0, 0, 0.6);
}

.telemetry-content {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-2xl);
  padding: 24px;
  width: min(480px, calc(100vw - 32px));
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.telemetry-banner strong {
  display: block;
  margin-bottom: 8px;
  font-size: 1.1rem;
}

.telemetry-banner p {
  color: var(--ink-secondary);
  font-size: 14px;
  line-height: 1.5;
  margin: 0;
}

.telemetry-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 8px;
}

/* ---- Eyebrow Label ---- */
.eyebrow {
  color: var(--bb-blue);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  margin: 0;
  text-transform: uppercase;
}

/* ---- Muted Text ---- */
.muted {
  color: var(--ink-muted);
  line-height: 1.6;
}

/* ============================================================
   TOPBAR / NAVIGATION
   ============================================================ */
.topbar {
  align-items: center;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 20px;
}

.brand-mark {
  align-items: center;
  color: var(--ink);
  display: flex;
  gap: 12px;
  padding: 0;
  text-align: left;
}

.brand-icon {
  height: 44px;
  width: 44px;
  object-fit: contain;
  background: white;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
}

.brand-mark strong, .brand-mark small { display: block; }
.brand-mark strong { font-size: 16px; font-weight: 800; letter-spacing: -0.02em; }
.brand-mark small { color: var(--ink-muted); font-size: 12px; margin-top: 1px; }

.top-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.top-actions .ghost-btn {
  padding: 6px 12px;
  font-size: 13px;
  min-height: 34px;
}

/* ============================================================
   DASHBOARD
   ============================================================ */
.main-grid {
  display: grid;
  gap: 20px;
  min-width: 0;
  width: 100%;
}

.main-grid > *,
.dashboard-card-grid,
.cloud-sync-banner,
.hero-card,
.review-card,
.review-question,
.review-question > *,
.review-stimulus,
.choice-list,
.choice-row,
.choice-button,
.metric-card,
.panel {
  min-width: 0;
  max-width: 100%;
}

.dashboard-card-grid {
  width: 100%;
}

.volume-bar-chart {
  max-width: 100%;
  min-width: 0;
  overflow: visible;
  -webkit-tap-highlight-color: transparent;
}

.volume-bar-group {
  min-width: 0;
}

.volume-bar-group:focus {
  outline: none;
}

.volume-bar-tooltip {
  width: max-content;
  max-width: min(220px, calc(100vw - 48px));
  overflow-wrap: anywhere;
  white-space: normal !important;
}

.cloud-sync-banner > svg {
  flex: 0 0 auto;
}

.cloud-sync-banner > div {
  min-width: 0;
}

.cloud-sync-actions {
  flex-wrap: wrap;
  min-width: 0;
}

/* ---- Hero Card ---- */
.hero-card, .panel, .metric-card {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
}

.hero-card {
  align-items: center;
  border-radius: var(--radius-xl);
  contain: paint;
  display: flex;
  gap: 24px;
  justify-content: space-between;
  overflow: hidden;
  padding: 32px 36px;
  position: relative;
}

.hero-card::after {
  background: radial-gradient(circle at center, var(--bb-blue-soft) 0%, transparent 70%);
  border-radius: 50%;
  content: "";
  height: 300px;
  position: absolute;
  right: 0;
  top: -100px;
  width: 300px;
  pointer-events: none;
  opacity: 0.5;
}

.hero-card > * { position: relative; z-index: 1; }

.hero-card h1 {
  font-size: clamp(26px, 3.5vw, 44px);
  letter-spacing: -0.04em;
  line-height: 1.05;
  margin: 6px 0 10px;
  max-width: 720px;
}

.hero-card p {
  color: var(--ink-secondary);
  font-size: 15px;
  line-height: 1.6;
  margin: 0;
  max-width: 640px;
}

.hero-actions {
  display: flex;
  gap: 10px;
}

.compact-hero h1 { font-size: clamp(24px, 3vw, 36px); }

/* ---- Metric Cards ---- */
.metric-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.metric-card {
  border-radius: var(--radius-lg);
  padding: 20px;
}

.metric-card span, .metric-card small {
  color: var(--ink-muted);
  display: block;
  font-size: 13px;
}

.metric-card strong {
  display: block;
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  margin: 8px 0 6px;
}

/* ---- Panels ---- */
.panel {
  border-radius: var(--radius-lg);
  padding: 24px;
}

.two-column {
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.two-column.compact { align-items: stretch; }

.panel-heading { margin-bottom: 14px; }
.panel-heading h2 {
  font-size: 20px;
  letter-spacing: -0.03em;
  margin: 4px 0 0;
}

/* ---- Domain / Stats Rows ---- */
.domain-list, .callout-list {
  display: grid;
  gap: 10px;
}

.domain-row, .timing-row, .callout-card, .module-summary-card {
  align-items: center;
  background: var(--paper);
  border: 1px solid var(--line-light);
  border-radius: var(--radius-md);
  display: grid;
  gap: 12px;
  padding: 14px;
}

.domain-row { grid-template-columns: minmax(0, 1.4fr) minmax(100px, 1fr) auto; }
.compact-row, .timing-row, .callout-card { grid-template-columns: minmax(0, 1fr) auto; }

.subject-total {
  background: var(--bb-blue-soft);
  border-color: #c7d9f5;
}

.domain-row strong, .timing-row strong, .callout-card strong { display: block; }
.domain-row small, .timing-row small, .callout-card span, .module-summary-card small {
  color: var(--ink-muted);
  font-size: 13px;
}

/* ---- Skill Level Meter ---- */
.level-meter {
  background: var(--line-light);
  border-radius: var(--radius-pill);
  height: 8px;
  overflow: hidden;
}

.level-meter span {
  background: linear-gradient(90deg, var(--bb-blue), var(--teal));
  border-radius: inherit;
  display: block;
  height: 100%;
  transition: width 400ms ease;
}

/* ---- Weakness / Strength Callouts ---- */
.callout-card.warn {
  background: var(--amber-bg);
  border-color: var(--amber-border);
}
.callout-card.good {
  background: var(--green-bg);
  border-color: var(--green-border);
}

/* ============================================================
   TEST CONFIGURATION
   ============================================================ */
.config-panel { display: grid; gap: 18px; }

.segmented, .difficulty-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.segmented label, .difficulty-pill { flex: 1; min-width: 150px; }

.segmented input, .difficulty-pill input, .check-card input {
  opacity: 0;
  position: absolute;
  pointer-events: none;
}

.segmented span, .difficulty-pill span {
  align-items: center;
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: var(--radius-md);
  display: flex;
  font-weight: 700;
  justify-content: center;
  min-height: 50px;
  padding: 12px;
  transition: all 150ms ease;
  cursor: pointer;
}

.segmented input:checked + span, .difficulty-pill input:checked + span {
  background: var(--bb-blue-soft);
  border-color: var(--bb-blue);
  color: var(--bb-blue);
}

.check-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.check-card {
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: var(--radius-md);
  cursor: pointer;
  display: block;
  min-height: 84px;
  padding: 14px;
  position: relative;
  transition: all 150ms ease;
}

.check-card:has(input:checked) {
  background: var(--bb-blue-soft);
  border-color: var(--bb-blue);
}

.check-card span, .check-card small { display: block; }
.check-card span { font-weight: 800; }
.check-card small { color: var(--ink-muted); margin-top: 4px; font-size: 13px; }

/* ---- Toggle ---- */
.toggle-card {
  align-items: center;
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  gap: 14px;
  min-height: 86px;
  padding: 16px;
  transition: all 0.2s ease;
}
.toggle-card:hover { border-color: var(--bb-blue); }
.toggle-card:active { transform: scale(0.98); }

.toggle-card input { opacity: 0; position: absolute; pointer-events: none; }

.toggle-ui {
  background: #c8d3e0;
  border-radius: var(--radius-pill);
  display: block;
  flex-shrink: 0;
  height: 26px;
  position: relative;
  transition: background 180ms ease;
  width: 48px;
}

.toggle-ui::after {
  background: white;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
  content: "";
  height: 20px;
  left: 3px;
  position: absolute;
  top: 3px;
  transition: left 180ms ease;
  width: 20px;
}

.toggle-card input:checked + .toggle-ui { background: var(--bb-blue); }
.toggle-card input:checked + .toggle-ui::after { left: 25px; }

.toggle-card small, .limit-field small {
  color: var(--ink-muted);
  display: block;
  font-size: 13px;
}

/* ---- Action Panel ---- */
.action-panel {
  align-items: center;
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.limit-field span { display: block; font-weight: 800; margin-bottom: 6px; }
.limit-field input {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink);
  min-height: 42px;
  padding: 8px 12px;
  width: 110px;
  transition: all 150ms ease;
  box-shadow: var(--shadow-sm);
}
.limit-field input:focus { border-color: var(--bb-blue); outline: 2px solid var(--bb-blue); outline-offset: 2px; }

.start-summary { text-align: right; }
.start-summary strong, .start-summary span { display: block; }
.start-summary strong { font-size: 26px; font-weight: 800; letter-spacing: -0.04em; }
.start-summary span { color: var(--ink-muted); font-size: 13px; }

/* ---- Module Summary Grid ---- */
.module-summary-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.module-summary-card { align-items: start; display: grid; }

/* ============================================================
   TEST HISTORY
   ============================================================ */
.history-panel { display: grid; gap: 18px; }

.history-tabs {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  display: flex;
  gap: 4px;
  padding: 4px;
  width: fit-content;
  max-width: 100%;
}

.history-tabs button {
  border-radius: var(--radius-sm);
  color: var(--ink-muted);
  font-weight: 700;
  padding: 10px 16px;
  transition: all 150ms ease;
}

.history-tabs button.active {
  background: white;
  box-shadow: var(--shadow-sm);
  color: var(--bb-navy);
}

.history-tabs span {
  background: var(--line-light);
  border-radius: var(--radius-pill);
  font-size: 12px;
  margin-left: 6px;
  padding: 2px 8px;
}

.history-list { display: grid; gap: 10px; }

.history-card {
  align-items: center;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(200px, 1.2fr) minmax(200px, 1fr) auto;
  padding: 18px;
  transition: box-shadow 150ms ease;
}
.history-card:hover { box-shadow: var(--shadow-md); }

.history-card h2 { font-size: 18px; margin: 4px 0; letter-spacing: -0.02em; }
.history-card small, .history-score span {
  color: var(--ink-muted);
  display: block;
  font-size: 13px;
}

.history-score strong {
  color: var(--bb-navy);
  display: block;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.empty-message {
  color: var(--ink-muted);
  margin: 0;
  padding: 32px;
  text-align: center;
}

/* ============================================================
   TEST REVIEW
   ============================================================ */
.review-heading { display: grid; gap: 18px; }

.review-heading-top {
  align-items: start;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}

.review-heading h1 {
  font-size: 30px;
  letter-spacing: -0.04em;
  margin: 4px 0;
  overflow-wrap: anywhere;
}

.review-heading p { color: var(--ink-muted); margin: 0; }

.review-summary {
  display: grid;
  gap: 4px;
  margin-top: 4px;
}

.review-summary-row {
  display: grid;
  gap: 8px;
  grid-template-columns: max-content minmax(0, 1fr);
  line-height: 1.6;
}

.review-summary-label {
  color: var(--ink-secondary);
  font-weight: 500;
  min-width: 70px;
}

.review-summary-single {
  line-height: 1.6;
  margin-top: 4px !important;
  overflow-wrap: anywhere;
}

.review-filter-bar {
  max-width: 100%;
  min-width: 0;
}

.review-subject-tabs {
  min-width: 0;
}

.review-subject-tabs button {
  min-width: 0;
}

.wrong-toggle {
  align-items: center;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  gap: 12px;
  padding: 12px 16px;
  width: fit-content;
  transition: all 0.2s ease;
}
.wrong-toggle:hover { border-color: var(--bb-blue); }
.wrong-toggle:active { transform: scale(0.98); }

.wrong-toggle input { opacity: 0; position: absolute; pointer-events: none; }
.wrong-toggle input:checked + .toggle-ui { background: var(--bb-blue); }
.wrong-toggle input:checked + .toggle-ui::after { left: 25px; }

.review-list { display: grid; gap: 16px; }

.review-card { display: grid; gap: 18px; }

.review-card-header, .review-meta {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  flex-wrap: wrap;
}

.scroll-top-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 100;
  box-shadow: var(--shadow-lg);
  border-radius: 50%;
  width: 48px;
  height: 48px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.scroll-top-btn.visible {
  opacity: 1;
  pointer-events: auto;
}
.scroll-top-btn:active {
  transform: scale(0.95);
}

.review-card-header strong { display: block; }

.review-question.split {
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
}

.review-stimulus {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow-x: auto;
  padding: 18px;
  -webkit-overflow-scrolling: touch;
}

/* ---- Status / Time Pills ---- */
.time-pill, .status-pill {
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 700;
  padding: 6px 12px;
  white-space: nowrap;
}

.time-pill { background: var(--paper); border: 1px solid var(--line); color: var(--ink-muted); }
.status-pill.correct { background: var(--green-bg); color: var(--green); }
.status-pill.incorrect { background: var(--red-bg); color: var(--red); }
.status-pill.unanswered { background: var(--amber-bg); color: var(--amber); }
.status-pill.skipped { background: #f0f4f8; color: var(--ink-muted); }

/* ---- Review Choices ---- */
.review-choices .choice-button {
  cursor: default;
  grid-template-columns: auto minmax(0, 1fr) auto;
  position: relative;
  width: 100%;
}

.review-choices .choice-button.correct-answer {
  background: var(--green-bg);
  border-color: var(--green-border);
}

.review-choices .choice-button.selected-answer:not(.correct-answer) {
  background: var(--red-bg);
  border-color: var(--red-border);
}

.choice-tag {
  align-self: center;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  white-space: nowrap;
}

.choice-tag.correct { background: #c6ecd5; color: var(--green); }
.choice-tag.selected { background: #f5c6c6; color: var(--red); }

.review-response-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.review-response-grid div {
  background: var(--red-bg);
  border-radius: var(--radius-md);
  padding: 14px;
}
.review-response-grid div.correct { background: var(--green-bg); }

.review-response-grid span, .review-response-grid strong { display: block; }
.review-response-grid span { color: var(--ink-muted); font-size: 13px; }
.review-response-grid strong { font-size: 18px; margin-top: 4px; }

.explanation-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 18px;
}
.explanation-card > summary {
  cursor: pointer;
  list-style: none;
  outline: none;
}
.explanation-card > summary::-webkit-details-marker {
  display: none;
}
.explanation-card > summary > strong {
  color: var(--bb-blue);
  display: inline-block;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  user-select: none;
}
.explanation-card[open] > summary {
  margin-bottom: 12px;
}
.rationale { font-size: 15px; line-height: 1.6; }

/* ============================================================
   TEST SHELL — BLUEBOOK LAYOUT
   ============================================================ */
.test-shell {
  background: #eef1f6;
  display: flex;
  flex-direction: column;
  height: 100dvh;
  min-height: 100vh;
  overflow: hidden;
}

/* ---- Bluebook Top Bar ---- */
.bb-topbar {
  align-items: center;
  background: var(--bb-navy);
  color: white;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  min-height: 56px;
  padding: 8px 20px;
  flex-shrink: 0;
}

.bb-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.bb-title strong, .bb-title span { display: block; }
.bb-title strong { font-size: 15px; font-weight: 700; white-space: nowrap; }
.bb-title span { color: rgba(255,255,255,0.55); font-size: 12px; margin-top: 1px; }

.bb-tools {
  display: flex;
  align-items: center;
  gap: 2px;
}

.bb-tool-btn {
  align-items: center;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,0.8);
  display: flex;
  font-size: 12px;
  font-weight: 600;
  gap: 5px;
  padding: 8px 12px;
  transition: all 120ms ease;
  white-space: nowrap;
}
.bb-tool-btn:hover { background: rgba(255,255,255,0.1); color: white; }
.bb-tool-btn.active { background: rgba(255,255,255,0.15); color: white; }
.bb-tool-btn svg { width: 16px; height: 16px; flex-shrink: 0; }

.bb-right-section {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.bb-timer {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: var(--radius-pill);
  font-family: 'JetBrains Mono', monospace;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 6px 16px;
  text-align: center;
}

.bb-end-btn {
  font-size: 13px;
  min-height: 34px;
  padding: 6px 14px;
}

/* ---- Main Layout ---- */
.bb-layout {
  display: flex;
  flex: 1 1 auto;
  gap: 0;
  min-height: 0;
  padding: 0;
}

/* ---- Question Workspace ---- */
.bb-workspace {
  display: grid;
  flex: 1 1 auto;
  gap: 0;
  min-height: 0;
  min-width: 0;
}

.bb-workspace.split {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.bb-workspace.single {
  grid-template-columns: minmax(0, 1fr);
}

/* ---- Content Panes ---- */
.passage-pane, .question-pane {
  background: white;
  border: none;
  border-radius: 0;
  box-shadow: none;
  min-height: 0;
  overflow-y: auto;
  padding: clamp(20px, 3vh, 32px) clamp(24px, 3vw, 40px);
}

.passage-pane {
  border-right: 1px solid var(--line);
}

.pane-label, .question-number {
  color: var(--bb-blue);
  display: block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  margin-bottom: 12px;
  text-transform: uppercase;
}

.question-header-row {
  align-items: start;
  border-bottom: 1px solid var(--line-light);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 18px;
  padding-bottom: 14px;
}

.question-header-row small { color: var(--ink-muted); font-size: 13px; }

/* ---- Mark for Review Button ---- */
.mark-btn {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: var(--radius-pill);
  color: var(--ink-muted);
  font-size: 12px;
  font-weight: 700;
  padding: 6px 12px;
  transition: all 150ms ease;
  white-space: nowrap;
  border-color: var(--line);
}
.mark-btn:hover { background: var(--amber-bg); border-color: var(--amber-border); }
.mark-btn.active {
  background: var(--amber-bg);
  border-color: var(--amber-border);
  color: var(--amber);
}

/* ---- HTML Content (passages, prompts) ---- */
.html-content {
  color: var(--ink);
  font-size: clamp(15px, 1.8vh, 17px);
  line-height: 1.65;
  max-width: 100%;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: normal;
}

.html-content math, .choice-content math {
  font-family: 'Cambria Math', 'STIX Two Math', 'Latin Modern Math', serif;
  font-size: 1.1em;
  line-height: 1;
  vertical-align: -0.1em;
}

.html-content math mi, .html-content math mn, .html-content math mo, .html-content math mtext,
.choice-content math mi, .choice-content math mn, .choice-content math mo, .choice-content math mtext {
  font-size: 1em;
}

.html-content math mo, .choice-content math mo {
  padding-inline: 0.03em;
}

.html-content img, .html-content svg:not(.katex svg) { height: auto; max-width: 100%; }
.html-content table {
  border-collapse: collapse;
  display: block;
  max-width: 100%;
  overflow-x: auto;
  width: max-content;
  -webkit-overflow-scrolling: touch;
}
.html-content > :first-child, .choice-content > :first-child { margin-top: 0; }
.html-content > :last-child, .choice-content > :last-child { margin-bottom: 0; }
.html-content td, .html-content th {
  border: 1px solid var(--ink);
  padding: 6px 10px;
  font-size: 14px;
  overflow-wrap: normal;
  word-break: normal;
}

/* KaTeX overrides */
.html-content .katex, .choice-content .katex {
  font-size: 1.05em;
}

.html-content .katex-display, .choice-content .katex-display {
  overflow-x: auto;
  overflow-y: hidden;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
}

.prompt { margin-bottom: clamp(10px, 1.5vh, 16px); }

/* ---- Two-column layout for math questions without stimulus ---- */
.question-content-layout.fit-columns {
  align-items: start;
  display: grid;
  gap: clamp(16px, 2vw, 28px);
  grid-template-columns: minmax(260px, 1fr) minmax(300px, 0.96fr);
}

.question-content-layout.fit-columns .prompt { margin-bottom: 0; }
.question-content-layout.fit-columns .choice-list { align-self: start; }

/* ---- Answer Choices (Bluebook-style) ---- */
.choice-list {
  display: grid;
  gap: clamp(6px, 0.8vh, 10px);
}

.choice-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: stretch;
  gap: 0;
  position: relative;
}

.choice-button {
  align-items: center;
  background: white;
  border: 2px solid var(--line);
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  color: var(--ink);
  display: grid;
  gap: 10px;
  grid-template-columns: auto minmax(0, 1fr);
  padding: clamp(10px, 1.2vh, 14px) 14px;
  text-align: left;
  transition: all 120ms ease;
  position: relative;
  min-width: 0;
  width: 100%;
}

.choice-button:hover { border-color: var(--bb-blue); }

.choice-button.selected {
  background: var(--bb-blue-soft);
  border-color: var(--bb-blue);
}

.choice-button.eliminated {
  opacity: 0.45;
  text-decoration: line-through;
  text-decoration-color: var(--red);
  pointer-events: none;
}

.choice-button.eliminated .choice-letter {
  text-decoration: line-through;
  text-decoration-color: var(--red);
}

.choice-elim-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  background: var(--paper);
  border: 2px solid var(--line);
  border-left: 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--ink-muted);
  cursor: pointer;
  transition: all 120ms ease;
  flex-shrink: 0;
}

.choice-elim-btn:hover {
  background: var(--red-bg, #fef2f2);
  color: var(--red);
  border-color: var(--red-border, #fca5a5);
}

.choice-elim-btn.active {
  background: var(--red-bg, #fef2f2);
  color: var(--red);
  border-color: var(--red-border, #fca5a5);
}

.choice-row.eliminated .choice-elim-btn {
  background: var(--red-bg, #fef2f2);
  color: var(--red);
  border-color: var(--red-border, #fca5a5);
}

.choice-letter {
  align-items: center;
  border: 2px solid var(--line);
  border-radius: 50%;
  display: inline-flex;
  font-weight: 800;
  font-size: 14px;
  height: 32px;
  justify-content: center;
  width: 32px;
  flex-shrink: 0;
  transition: all 120ms ease;
}

.choice-button.selected .choice-letter {
  background: var(--bb-blue);
  border-color: var(--bb-blue);
  color: white;
}

.choice-content {
  font-size: 15px;
  line-height: 1.5;
  max-width: 100%;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: normal;
}

.choice-content p { margin: 0; }

/* ---- Compact content modes ---- */
.question-pane.compact-content { padding: 14px 20px; }
.question-pane.compact-content .question-header-row { margin-bottom: 10px; padding-bottom: 8px; }
.question-pane.compact-content .html-content { font-size: 15px; line-height: 1.4; }
.question-pane.compact-content .choice-content { font-size: 14px; line-height: 1.4; }
.question-pane.compact-content .choice-list { gap: 5px; }
.question-pane.compact-content .choice-button { padding: 8px 12px; }

.question-pane.tight-content .html-content { font-size: 14px; line-height: 1.3; }
.question-pane.tight-content .choice-content { font-size: 14px; line-height: 1.3; }
.question-pane.tight-content .choice-letter { height: 28px; width: 28px; font-size: 12px; }

/* ---- SPR (Student-Produced Response) ---- */
.spr-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  display: grid;
  gap: 8px;
  max-width: 480px;
  padding: 18px;
}
.spr-card label { font-weight: 800; font-size: 14px; }
.spr-card input {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-size: 18px;
  min-height: 48px;
  padding: 10px 14px;
  transition: all 150ms ease;
  box-shadow: var(--shadow-sm);
}
.spr-card input:focus { border-color: var(--bb-blue); outline: 2px solid var(--bb-blue); outline-offset: 2px; }
.spr-card small { color: var(--ink-muted); font-size: 13px; }

/* ---- Bluebook Footer / Navigation Bar ---- */
.bb-footer {
  align-items: center;
  background: var(--bb-navy);
  color: white;
  display: flex;
  flex-shrink: 0;
  justify-content: space-between;
  min-height: 56px;
  padding: 8px 20px;
  width: 100%;
}

.bb-footer .ghost-btn {
  background: transparent;
  border-color: rgba(255,255,255,0.25);
  color: white;
  font-size: 13px;
  min-height: 34px;
}
.bb-footer .ghost-btn:hover { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.4); }
.bb-footer .ghost-btn:disabled { opacity: 0.3; }

.bb-footer .primary-btn {
  font-size: 13px;
  min-height: 34px;
}

.footer-center {
  color: rgba(255,255,255,0.5);
  font-size: 12px;
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  padding: 0 16px;
}

/* ---- Bottom Question Nav (Bluebook-style) ---- */
.bb-question-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  padding: 4px 0;
  scrollbar-width: none;
}
.bb-question-nav::-webkit-scrollbar { display: none; }

.bb-nav-dot {
  align-items: center;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 6px;
  color: rgba(255,255,255,0.7);
  display: flex;
  font-size: 11px;
  font-weight: 700;
  height: 30px;
  justify-content: center;
  min-width: 30px;
  padding: 0 2px;
  transition: all 100ms ease;
  flex-shrink: 0;
}

.bb-nav-dot:hover { background: rgba(255,255,255,0.18); }
.bb-nav-dot.current {
  background: var(--bb-blue);
  border-color: var(--bb-blue);
  color: white;
}
.bb-nav-dot.answered:not(.current) {
  background: rgba(255,255,255,0.25);
  border-color: rgba(255,255,255,0.35);
  color: white;
}
.bb-nav-dot.marked:not(.current) {
  box-shadow: inset 0 -3px 0 var(--amber);
}

/* ---- Test Notice (in test shell) ---- */
.test-notice {
  flex-shrink: 0;
  margin: 8px 16px 0;
}

/* ============================================================
   MODULE CHECK / REVIEW SCREEN
   ============================================================ */
.module-check-screen {
  align-items: center;
  display: flex;
  flex: 1 1 auto;
  justify-content: center;
  min-height: 0;
  overflow: auto;
  padding: 24px;
}

.module-check-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  display: grid;
  gap: 20px;
  max-width: 680px;
  padding: 36px;
  width: 100%;
}

.module-check-card h1 {
  font-size: 36px;
  letter-spacing: -0.04em;
  line-height: 1;
  margin: 0;
}

.module-check-card > p:not(.eyebrow) {
  color: var(--ink-secondary);
  margin: 0;
  line-height: 1.5;
}

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

.module-check-stats div {
  background: var(--paper);
  border: 1px solid var(--line-light);
  border-radius: var(--radius-md);
  display: grid;
  gap: 2px;
  padding: 16px;
}

.module-check-stats strong {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.module-check-stats span { color: var(--ink-muted); font-size: 13px; }

.module-review-legend {
  align-items: center;
  color: var(--ink-muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 13px;
  gap: 8px;
}

.module-review-legend span {
  border: 1px solid var(--line);
  border-radius: 4px;
  display: inline-block;
  height: 14px;
  margin-left: 10px;
  width: 14px;
}

.module-review-legend span:first-child { margin-left: 0; }
.module-review-legend .answered { background: var(--bb-blue); border-color: var(--bb-blue); }
.module-review-legend .flagged { border-bottom: 3px solid var(--amber); }

.module-review-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fill, minmax(42px, 1fr));
}

.module-review-grid button {
  aspect-ratio: 1;
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 14px;
  transition: all 100ms ease;
}

.module-review-grid button:hover { border-color: var(--bb-blue); }
.module-review-grid button.answered {
  background: var(--bb-blue);
  border-color: var(--bb-blue);
  color: white;
}
.module-review-grid button.marked {
  box-shadow: inset 0 -3px 0 var(--amber);
}

.module-check-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* ============================================================
   MODULE TRANSITION SCREEN
   ============================================================ */
.transition-screen {
  align-items: center;
  background: linear-gradient(135deg, #eef3fb, #f7f9fd);
  display: flex;
  flex: 1 1 auto;
  justify-content: center;
  min-height: 0;
  overflow: auto;
  padding: 24px;
}

.transition-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  max-width: 560px;
  padding: 48px;
  text-align: center;
  width: 100%;
}

.transition-card h1 {
  font-size: clamp(28px, 4vw, 44px);
  letter-spacing: -0.04em;
  line-height: 1.05;
  margin: 8px 0 16px;
}

.transition-card p {
  color: var(--ink-secondary);
  line-height: 1.6;
  margin: 0 0 8px;
}

.transition-card .primary-btn { margin-top: 20px; }

/* ============================================================
   BREAK SCREEN
   ============================================================ */
.break-screen {
  align-items: center;
  background: linear-gradient(135deg, #eef3fb 0%, #f7f9fd 50%, #eef3fb 100%);
  display: flex;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

.break-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  max-width: 560px;
  padding: 48px;
  text-align: center;
}

.break-card h1 {
  font-size: clamp(28px, 4vw, 44px);
  letter-spacing: -0.04em;
  line-height: 1.05;
  margin: 8px 0 16px;
}

.break-card p { color: var(--ink-secondary); line-height: 1.6; }

.break-timer {
  color: var(--bb-navy);
  font-family: 'JetBrains Mono', monospace;
  font-size: 64px;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 20px 0;
}

/* ============================================================
   OVERLAYS — DESMOS, REFERENCE SHEET
   ============================================================ */
.overlay-backdrop {
  background: rgba(0,0,0,0.5);
  inset: 0;
  position: fixed;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.overlay-panel {
  background: white;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  display: flex;
  flex-direction: column;
  max-height: 90vh;
  max-width: 900px;
  overflow: hidden;
  width: 100%;
}

.overlay-header {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 16px 20px;
}

.overlay-header strong { font-size: 16px; }

.overlay-close {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink-muted);
  display: flex;
  font-size: 18px;
  height: 32px;
  justify-content: center;
  width: 32px;
  transition: all 120ms ease;
}
.overlay-close:hover { background: var(--paper); color: var(--ink); }

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

.overlay-body.desmos-body {
  padding: 0;
  min-height: 500px;
}

.overlay-body.desmos-body #desmos-calculator {
  width: 100%;
  height: 100%;
  min-height: 500px;
}

/* ---- Reference Sheet ---- */
.ref-sheet {
  display: grid;
  gap: 24px;
}

.ref-section h3 {
  color: var(--bb-blue);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.06em;
  margin: 0 0 12px;
  text-transform: uppercase;
}

.ref-formulas {
  display: grid;
  gap: 8px;
}

.ref-formula {
  align-items: center;
  background: var(--paper);
  border: 1px solid var(--line-light);
  border-radius: var(--radius-sm);
  display: flex;
  gap: 12px;
  padding: 10px 14px;
  font-size: 15px;
}

.ref-formula .katex { font-size: 1.1em; }

/* ============================================================
   SESSION EXPIRED BUBBLE
   ============================================================ */
.session-expired-bubble {
  position: fixed;
  bottom: 24px;
  left: 280px;
  transform: none;
  background: var(--card-bg, #fff);
  color: var(--text, #0f172a);
  padding: 14px 16px;
  border-radius: 12px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  border: 1px solid var(--border, #e2e8f0);
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: default;
  width: max-content;
  max-width: 320px;
  text-align: left;
  transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-collapsed .session-expired-bubble {
  left: 96px;
}

.session-expired-bubble-arrow {
  position: absolute;
  top: 50%;
  left: -6px;
  width: 12px;
  height: 12px;
  background: var(--card-bg, #fff);
  border-left: 1px solid var(--border, #e2e8f0);
  border-bottom: 1px solid var(--border, #e2e8f0);
  transform: translateY(-50%) rotate(45deg);
  z-index: 1;
}

.session-expired-bubble-content {
  position: relative;
  z-index: 2;
  pointer-events: none;
}

.session-expired-bubble-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--foreground, #0f172a);
}

.session-expired-bubble-desc {
  font-size: 13px;
  margin-top: 2px;
  color: var(--muted-foreground, #64748b);
}

.session-expired-bubble-close {
  position: relative;
  z-index: 2;
  background: none;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  padding: 4px;
  color: var(--muted-foreground, #64748b);
  line-height: 1;
  margin-left: 8px;
  transition: color 0.2s;
}

.session-expired-bubble-close:hover {
  color: var(--foreground, #0f172a);
}

.backup-col-left {
  border-right: 1px solid var(--border);
  padding-right: 24px;
}
.backup-col-right {
  padding-left: 24px;
}

/* Mobile Header and Sidebar Overlay */
.sidebar-overlay, .mobile-header, .mobile-only { display: none !important; }
.desktop-only { display: flex; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 920px) {
  html, body {
    max-width: 100%;
    overflow-x: clip;
  }

  @supports not (overflow: clip) {
    html, body { overflow-x: hidden; }
  }

  .backup-col-left {
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding-right: 0;
    padding-bottom: 24px;
    margin-bottom: 24px;
  }
  .backup-col-right {
    padding-left: 0;
  }
  
  .app-shell { display: block; }
  .mobile-header {
    display: flex !important;
    align-items: center;
    justify-content: flex-start;
    padding: 12px 16px;
    background: var(--panel);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 90;
    gap: 12px;
    max-width: 100%;
    min-width: 0;
  }
  .mobile-brand {
    font-weight: 700;
    font-size: 16px;
    margin-left: 0;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .mobile-brand small { color: var(--ink-muted); font-weight: normal; margin-left: 4px; }
  .mobile-sync-container {
    flex: 0 1 auto;
    min-width: 0;
  }
  .mobile-header .sync-status-container {
    max-width: 42vw;
    min-width: 0;
  }
  .mobile-header .sync-status-container .nav-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .desktop-only { display: none !important; }
  .mobile-only { display: flex !important; }
  
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    height: 100dvh;
    z-index: 100;
    transform: translateX(0);
    width: 260px;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
    overscroll-behavior: none;
  }
  .sidebar-collapsed .sidebar {
    transform: translateX(-100%);
    box-shadow: none;
  }
  .app-shell:not(.sidebar-collapsed) .sidebar-overlay {
    display: block !important;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(2px);
    z-index: 99;
    animation: fade-in 0.2s ease-out forwards;
    touch-action: none;
  }
  
  body:has(.app-shell:not(.sidebar-collapsed)) {
    overflow: hidden;
  }

  .session-expired-bubble {
    position: absolute;
    bottom: calc(100% + 12px);
    left: 16px;
    width: max-content;
    max-width: 240px;
    transform: none;
    z-index: 100;
  }

  .session-expired-bubble-arrow {
    top: auto;
    bottom: -6px;
    left: 24px;
    border-left: none;
    border-top: none;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
  }

  .mobile-header .session-expired-bubble {
    top: calc(100% + 12px);
    bottom: auto;
    right: 0;
    left: auto;
  }

  .mobile-header .session-expired-bubble-arrow {
    top: -6px;
    bottom: auto;
    left: auto;
    right: 24px;
    border-bottom: none;
    border-right: none;
    border-top: 1px solid var(--border);
    border-left: 1px solid var(--border);
    transform: rotate(45deg);
  }

  .mobile-header .sync-status-container .nav-label {
    display: inline;
    position: static;
    opacity: 1;
    visibility: visible;
  }
  
  .desktop-only {
    display: none !important;
  }

  .main-content-wrapper {
    padding: 16px;
  }

  .cloud-sync-banner {
    flex-wrap: wrap;
  }

  .topbar, .hero-card, .action-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar, .hero-card { display: flex; }
  .top-actions { justify-content: flex-start; }

  .metric-grid, .two-column, .check-grid, .module-summary-grid,
  .action-panel, .history-card, .review-question.split {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-actions, .review-heading-top {
    align-items: stretch;
    flex-direction: column;
  }

  .test-shell { height: auto; overflow: visible; }

  .bb-layout { flex-direction: column; height: auto; }

  .bb-workspace.split { grid-template-columns: 1fr; }

  .question-content-layout.fit-columns {
    display: block;
  }
  .question-content-layout.fit-columns .prompt {
    margin-bottom: clamp(10px, 1.5vh, 16px);
  }

  .bb-topbar {
    flex-wrap: wrap;
    gap: 8px;
    min-height: auto;
    padding: 8px 12px;
  }

  .bb-tools { gap: 0; }
  .bb-tool-btn { padding: 8px; font-size: 0; gap: 0; }
  .bb-tool-btn svg { width: 20px; height: 20px; }

  .bb-footer {
    flex-wrap: wrap;
    gap: 8px;
    min-height: auto;
    padding: 8px 12px;
  }

  .footer-center { display: none; }
  .bb-question-nav { order: 3; width: 100%; }

  #persistent-desmos {
    width: 100vw !important;
    height: 100dvh !important;
    top: 0 !important;
    left: 0 !important;
    right: auto !important;
    bottom: auto !important;
    border-radius: 0;
    resize: none;
  }

  .bb-nav-dot {
    min-width: 44px;
    height: 44px;
    font-size: 13px;
  }

  .choice-button {
    padding: 16px 14px;
  }

  .choice-elim-btn {
    width: 44px;
  }
}

@media (max-width: 560px) {
  .telemetry-actions {
    grid-template-columns: 1fr 1fr;
    display: grid;
  }

  .telemetry-actions .ghost-btn,
  .telemetry-actions .primary-btn {
    padding-inline: 10px;
  }
  .hero-card { padding: 24px; }
  .hero-card h1 { font-size: 28px; }
  .metric-card strong { font-size: 28px; }

  .domain-row { grid-template-columns: 1fr; }

  .passage-pane, .question-pane { padding: 16px; }
  .html-content { font-size: 15px; }

  .module-review-grid { grid-template-columns: repeat(5, 1fr); }
  .module-check-card { padding: 24px; }

  .module-check-stats, .review-response-grid { grid-template-columns: 1fr; }

  .cloud-sync-banner {
    align-items: stretch !important;
    flex-direction: column;
    padding: 16px !important;
  }

  .cloud-sync-actions {
    display: grid !important;
    flex-shrink: 1 !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    width: 100%;
  }

  .cloud-sync-actions > * {
    width: 100%;
  }

  .review-heading {
    gap: 16px;
    padding: 20px;
  }

  .review-heading h1 {
    font-size: clamp(24px, 8vw, 32px);
    line-height: 1.08;
  }

  .review-summary {
    gap: 8px;
  }

  .review-summary-row {
    align-items: start;
    grid-template-columns: minmax(54px, max-content) minmax(0, 1fr);
    line-height: 1.45;
  }

  .review-summary-label {
    min-width: 0;
  }

  .review-filter-bar {
    align-items: stretch !important;
    display: grid !important;
    gap: 12px !important;
    grid-template-columns: minmax(0, 1fr);
  }

  .review-subject-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
  }

  .review-subject-tabs button {
    padding-inline: 8px !important;
    white-space: normal;
  }

  .review-filter-divider {
    display: none;
  }

  .wrong-toggle {
    justify-content: flex-start;
    min-height: 52px;
    width: 100%;
  }

  .review-meta {
    justify-content: flex-start;
    width: 100%;
  }

  .review-choices .choice-button {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .review-choices .choice-tag {
    grid-column: 2;
    justify-self: start;
    margin-top: 2px;
    white-space: normal;
  }

  .volume-bar-chart {
    border-top: none !important;
    padding-top: 16px !important;
  }

  @supports not (overflow: clip) {
    .volume-bar-chart { overflow: hidden; }
  }

  .volume-bar-tooltip {
    width: max-content;
    max-width: min(220px, calc(100vw - 48px));
    white-space: normal !important;
  }
}

/* Persistent Desmos Overlay */
#persistent-desmos {
  background: white;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  flex-direction: column;
  position: fixed;
  z-index: 2000;
  width: 650px;
  height: 550px;
  top: 50px;
  right: 50px;
  resize: both;
  overflow: hidden;
  border: 1px solid var(--line);
}

.desmos-drag-header {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--paper);
  cursor: grab;
  user-select: none;
}

.desmos-drag-header:active {
  cursor: grabbing;
}

#desmos-calculator-inner {
  flex: 1;
  width: 100%;
  height: 100%;
}

/* ── Support Panel ── */

.support-panel {
  border-color: #a78bfa;
  background: rgba(124, 58, 237, 0.05);
}

.support-panel .panel-heading h2 {
  color: #7c3aed;
}

.support-code-wrap {
  align-items: center;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  display: inline-flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
  max-width: 100%;
  min-width: 0;
  padding: 8px 16px;
}

.support-code-wrap span {
  color: var(--ink-muted);
  font-size: 13px;
  font-weight: 500;
}

.support-code-wrap code {
  color: #7c3aed;
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  font-weight: 600;
  min-width: 0;
  overflow-wrap: anywhere;
  user-select: all;
  cursor: copy;
}

.support-btn {
  color: #7c3aed;
  border-color: #7c3aed;
}

.support-btn:hover {
  background: #f5f3ff;
  border-color: #6d28d9;
  color: #6d28d9;
}

.support-modal {
  border-color: #a78bfa;
  background: white;
  width: 400px;
  max-width: 90vw;
}

[data-theme="dark"] {
  --bb-navy: #0f172a; 
  --bb-navy-light: #1e293b;
  --bb-blue: #3b82f6;
  --bb-blue-hover: #60a5fa;
  --bb-blue-soft: #1e3a8a;
  --bb-blue-glow: rgba(59,130,246,0.25);

  --ink: #f8fafc;
  --ink-secondary: #cbd5e1;
  --ink-muted: #94a3b8;
  --paper: #0f172a;
  --panel: #1e293b;
  --line: #334155;
  --line-light: #1e293b;
  
  --green-bg: #064e3b;
  --green-border: #047857;
  --green: #34d399;
  
  --red-bg: #7f1d1d;
  --red-border: #b91c1c;
  --red: #f87171;

  --amber-bg: #78350f;
  --amber-border: #b45309;
  --amber: #fbbf24;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.4), 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 14px rgba(0,0,0,0.5), 0 2px 6px rgba(0,0,0,0.4);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.6);
  --shadow-xl: 0 20px 60px rgba(0,0,0,0.7);

  color-scheme: dark;
}

/* ===========================================================
   MARKETING & ONBOARDING
   =========================================================== */

@keyframes fade-in-up {
  0% { opacity: 0; transform: translateY(20px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes global-fade-in {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

@keyframes float-blobs {
  0% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(150px, -150px) scale(1.2); }
  66% { transform: translate(-100px, 100px) scale(0.8); }
  100% { transform: translate(0, 0) scale(1); }
}

.marketing-hero {
  position: relative;
  overflow: hidden;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px;
  background: var(--bb-navy);
  color: #f8fafc;
  animation: global-fade-in 1.5s ease-out forwards;
}

.marketing-hero::before, .marketing-hero::after {
  content: "";
  position: absolute;
  width: 60vw;
  height: 60vw;
  min-width: 600px;
  min-height: 600px;
  border-radius: 50%;
  filter: blur(80px);
  z-index: 0;
  opacity: 0.7;
  animation: float-blobs 15s infinite alternate ease-in-out;
  pointer-events: none;
  mix-blend-mode: screen;
}

.marketing-hero::before {
  background: radial-gradient(circle, #3b82f6, transparent 65%);
  top: -10vh;
  left: -10vw;
}

.marketing-hero::after {
  background: radial-gradient(circle, #8b5cf6, transparent 65%);
  bottom: -10vh;
  right: -10vw;
  animation-delay: -7.5s;
}

.marketing-hero h1 { color: #f8fafc; margin-top: 0; }

.marketing-content {
  position: relative;
  z-index: 1;
  max-width: 800px;
  animation: fade-in-up 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: 0.2s;
  opacity: 0;
}

.onboarding-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background: var(--surface);
  animation: fade-in 0.4s ease forwards;
}

.setup-wizard {
  width: 100%;
  max-width: 600px;
  padding: 40px;
}

.wizard-steps {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-top: 32px;
}

.wizard-steps .step {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.step-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bb-blue);
  color: white;
  font-weight: 700;
  font-size: 1.125rem;
  flex-shrink: 0;
}

.wizard-steps h3 {
  font-size: 1.125rem;
  margin-bottom: 4px;
  color: var(--ink);
}

.wizard-steps p {
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
}

.drop-zone {
  margin-top: 12px;
  border: 2px dashed var(--line);
  border-radius: var(--radius-md);
  padding: 32px 24px;
  text-align: center;
  background: var(--paper);
  color: var(--ink-muted);
  cursor: pointer;
  transition: all 0.2s;
}

.drop-zone:hover, .drop-zone.drag-active {
  border-color: var(--bb-blue);
  background: var(--bb-blue-glow);
  color: var(--bb-blue);
}

/* ===========================================================
   GAMIFICATION (STREAKS & HEATMAP)
   =========================================================== */

.streak-panel {
  background: var(--panel);
  border: 1px solid var(--amber-border);
  box-shadow: 0 4px 12px rgba(251, 191, 36, 0.05);
}

.streak-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.streak-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--line);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.streak-dot.active {
  background: var(--amber);
  box-shadow: 0 4px 12px rgba(251, 191, 36, 0.4);
}

.streak-dot.today:not(.active) {
  border: 2px dashed var(--amber);
  background: transparent;
}

.streak-dot.future {
  background: var(--paper);
  border: 1px dashed var(--line);
  opacity: 0.5;
}

.streak-day small {
  font-size: 11px;
  color: var(--ink-muted);
  font-weight: 600;
}

/* ===========================================================
   RESPONSIVE LAYOUT (MOBILE)
   =========================================================== */
@media (max-width: 800px) {
  .app-shell { padding: 0; }
  
  .hero-card {
    flex-direction: column;
    text-align: center;
    padding: 24px;
    gap: 16px;
  }
  .hero-card::after { display: none; }
  .hero-actions { flex-direction: column; width: 100%; }
  .hero-actions > * { width: 100%; }
  
  .metric-grid, .module-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  
  .check-grid {
    grid-template-columns: 1fr;
  }
  
  .two-column, .review-question.split, .review-response-grid, .history-card, .action-panel {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }
  
  .start-summary { text-align: left; }
  
  .streak-panel > div > div > div:first-child { justify-content: center; width: 100%; }
  .streak-week { justify-content: space-between; width: 100%; margin-top: 12px; gap: 4px; }
  .streak-day small { font-size: 10px; }
  .streak-dot { width: 20px; height: 20px; }
  
  .domain-row {
    grid-template-columns: 1fr;
  }
  
  .review-heading-top {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .wizard-steps .step {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 480px) {
  .metric-grid, .module-summary-grid {
    grid-template-columns: 1fr;
  }

  .main-content-wrapper {
    padding: 12px;
  }

  .mobile-header {
    padding: 10px 12px;
  }

  .mobile-brand small {
    display: none;
  }

  .mobile-header .sync-status-container {
    padding-inline: 10px;
  }

  .panel,
  .metric-card {
    padding: 18px;
  }

  .review-card {
    gap: 14px;
  }

  .busy-card {
    max-width: 320px;
    padding: 24px 20px;
  }
  .busy-card-header {
    margin-bottom: 24px;
  }
  .busy-card-header h1 {
    font-size: 1.25rem;
  }
  .boot-card {
    max-width: 280px;
    padding: 32px 24px 24px;
  }
}

/* ============================================================
   VIEW TRANSITIONS
   ============================================================ */

/* Continuity Transition for persistent elements */
.topbar { view-transition-name: topbar; }
.bb-topbar { view-transition-name: topbar; }

/* Prevent scrolling during transition */
html::view-transition-group(root) {
  animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Context Transition: Sliding Fade */
html[data-transition="context"]::view-transition-old(root) {
  animation: fade-out 0.2s ease-in forwards;
}
html[data-transition="context"]::view-transition-new(root) {
  animation: slide-in-fade 0.3s ease-out backwards;
}

/* Drill Transition: Scale down & Slide in from bottom/right */
html[data-transition="drill"]::view-transition-old(root) {
  animation: scale-down-fade 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
html[data-transition="drill"]::view-transition-new(root) {
  animation: slide-up-fade 0.4s cubic-bezier(0.4, 0, 0.2, 1) backwards;
}

@keyframes fade-out {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes slide-in-fade {
  from { opacity: 0; transform: translateX(10px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes scale-down-fade {
  from { opacity: 1; transform: scale(1); }
  to { opacity: 0; transform: scale(0.98); }
}

@keyframes slide-up-fade {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.review-card, .history-card, .check-card, .domain-card, .mistake-stat-card, .hero-card, .panel, .metric-card, .bb-card {
  animation: slide-up-fade 0.2s ease-out forwards;
}

.volume-bar-group:hover .volume-bar-tooltip {
  opacity: 1 !important;
}
.volume-bar-group:hover > div:not(.volume-bar-tooltip) {
  opacity: 1 !important;
}

/* Modal Overlay */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; width: 100vw; height: 100vh;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
}

/* Review List CSS Filtering */
.review-list.filter-incorrect:not(.filter-skipped) .review-card:not([data-status="incorrect"]),
.review-list.filter-skipped:not(.filter-incorrect) .review-card:not([data-status="skipped"]),
.review-list.filter-incorrect.filter-skipped .review-card:not([data-status="incorrect"]):not([data-status="skipped"]) {
  display: none !important;
}

.modal-overlay.visible {
  opacity: 1;
}

.modal-content.confirm-modal {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px;
  max-width: 400px;
  width: 90%;
  box-shadow: var(--shadow-lg);
  transform: scale(0.95) translateY(10px);
  opacity: 0;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Immediate Feedback Styling */
.choice-list.submitted .choice-button:disabled {
  opacity: 0.7;
  cursor: default;
}
.choice-list.submitted .choice-row.correct-choice .choice-button {
  border-color: var(--green) !important;
  background: var(--green-bg) !important;
  opacity: 1 !important;
  box-shadow: 0 0 0 1px var(--green);
}
.choice-list.submitted .choice-row.incorrect-choice .choice-button {
  border-color: var(--red) !important;
  background: var(--red-bg) !important;
  opacity: 1 !important;
  box-shadow: 0 0 0 1px var(--red);
}
.spr-card.correct {
  border-color: var(--green) !important;
  background: var(--green-bg) !important;
}
.spr-card.incorrect {
  border-color: var(--red) !important;
  background: var(--red-bg) !important;
}
.explanation-card.correct-expl {
  border-color: var(--green-border) !important;
  background: var(--green-bg) !important;
}
.explanation-card.incorrect-expl {
  border-color: var(--red-border) !important;
  background: var(--red-bg) !important;
}

.modal-content.confirm-modal.visible {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.modal-message {
  font-size: 1.125rem;
  font-weight: 500;
  color: var(--ink);
  margin: 0;
  line-height: 1.5;
}

.mistake-domain-card {
  align-items: center;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  gap: 12px;
  padding: 12px 16px;
  transition: all 0.2s ease;
}
.mistake-domain-card:hover { border-color: var(--bb-blue); }
.mistake-domain-card:active { transform: scale(0.98); }
.mistake-domain-card.selected { border-color: var(--bb-blue); background: rgba(37,99,235,0.05); }
.mistake-domain-card input { opacity: 0; position: absolute; pointer-events: none; }

/* Accessibity screen-reader text visually hidden */
[class*='sr-only' i], [class*='screen-reader' i], [class*='visually-hidden' i],
[class*='offscreen' i], [class*='accessib' i], [class*='a11y' i],
[data-testid*='accessib' i] {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}



.sync-spinner {
  animation: spin 1s linear infinite;
  color: var(--ink-muted);
}
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.sync-status-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-secondary);
  background: var(--paper);
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
  border: 1px solid var(--line);
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.sync-status-container:hover {
  background: var(--line-light);
}
.sync-status-container.is-synced {
  background: color-mix(in srgb, var(--green) 8%, transparent);
  border-color: color-mix(in srgb, var(--green) 20%, transparent);
  color: color-mix(in srgb, var(--green) 90%, var(--ink));
}
.sync-status-container.is-synced:hover {
  background: color-mix(in srgb, var(--green) 12%, transparent);
}
.sync-status-container.is-syncing {
  background: color-mix(in srgb, var(--blue) 8%, transparent);
  border-color: color-mix(in srgb, var(--blue) 20%, transparent);
  color: color-mix(in srgb, var(--blue) 90%, var(--ink));
}
.sync-status-container.is-syncing:hover {
  background: color-mix(in srgb, var(--blue) 12%, transparent);
}
.sync-status-container.is-expired {
  background: color-mix(in srgb, var(--amber) 8%, transparent);
  border-color: color-mix(in srgb, var(--amber) 20%, transparent);
  color: color-mix(in srgb, var(--amber) 90%, var(--ink));
}
.sync-status-container.is-expired:hover {
  background: color-mix(in srgb, var(--amber) 12%, transparent);
}

/* Busy / Skeleton UI */
.busy-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  padding: 24px;
}
.busy-card {
  width: 100%;
  max-width: 420px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.08);
}
.busy-card-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  margin-bottom: 32px;
}
.busy-icon-wrap {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(37, 99, 235, 0.1);
  color: var(--bb-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.busy-icon-wrap svg {
  width: 28px;
  height: 28px;
}
.busy-card-header h1 {
  font-size: 1.5rem;
  margin: 0;
}
.busy-card-header p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.skeleton-layout {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.skeleton-box, .skeleton-line, .skeleton-panel, .skeleton-chart {
  background-color: var(--line-light);
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
  border-radius: var(--radius-sm);
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .4; }
}
.skeleton-line { height: 16px; width: 100%; border-radius: 8px; }
.skeleton-line.short { width: 60%; }
.skeleton-line.skeleton-title { height: 24px; width: 40%; }
.skeleton-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}
.skeleton-box { height: 80px; flex: 1 1 calc(50% - 8px); border-radius: var(--radius-md); }
.skeleton-panel {
  height: 120px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-radius: var(--radius-md);
}
.skeleton-chart { height: 60px; width: 100%; margin-top: auto; border-radius: var(--radius-md); }

/* Tutorial Overlay & Spotlight */
.tour-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  pointer-events: none;
}
.tour-spotlight {
  position: absolute;
  border-radius: 8px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
  z-index: 10001;
}
.tour-card {
  position: absolute;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 20px 24px;
  box-shadow: 0 20px 40px -10px rgba(0,0,0,0.2), 0 0 0 1px var(--line);
  pointer-events: auto;
  z-index: 10002;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  gap: 8px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
:root[data-theme="dark"] .tour-card {
  background: rgba(15, 23, 42, 0.95);
}
.tour-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
}
.tour-actions div {
  display: flex;
  gap: 8px;
}

@media (prefers-reduced-motion: reduce) {
  .tour-spotlight, .tour-card {
    transition: none;
  }
  .skeleton-box, .skeleton-line, .skeleton-panel, .skeleton-chart {
    animation: none;
    background-image: none;
  }
}

/* ---- Shadcn Pro Max Loading States ---- */
.shadcn-progress-container {
  width: 100%;
  margin-top: 16px;
}
.shadcn-progress-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 8px;
}
.shadcn-progress-bg {
  background: var(--line);
  border-radius: var(--radius-pill);
  height: 8px;
  overflow: hidden;
  width: 100%;
  position: relative;
}
.shadcn-progress-fill {
  background: var(--bb-blue);
  height: 100%;
  width: 0%;
  transition: width 300ms ease;
}
.shadcn-progress-fill.indeterminate {
  width: 50%;
  animation: shadcn-indeterminate 1.5s infinite ease-in-out;
  transform-origin: 0% 50%;
}
@keyframes shadcn-indeterminate {
  0% { transform: translateX(-100%) scaleX(0.2); }
  50% { transform: translateX(0%) scaleX(0.5); }
  100% { transform: translateX(200%) scaleX(0.2); }
}

.shadcn-spinner-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 0;
  gap: 16px;
}
.shadcn-loader {
  animation: shadcn-spin 1s linear infinite;
  color: var(--bb-blue);
}
@keyframes shadcn-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ---- Mistakes Log ---- */
.tag-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.85em;
  font-weight: 500;
  background: var(--surface-hover);
  color: var(--ink-main);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}
.tag-badge:hover {
  background: var(--line);
}
.tag-badge.active {
  background: var(--bb-blue);
  color: #ffffff;
  border-color: var(--bb-blue);
}

/* ---- Shadcn UI Polyfills ---- */
.shadcn-card {
  border-radius: 0.75rem;
  border: 1px solid var(--line);
  background-color: var(--panel);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}
.shadcn-card-header {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  padding: 1.5rem;
}
.shadcn-card-title {
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.025em;
  font-size: 1.25rem;
}
.shadcn-card-description {
  font-size: 0.875rem;
  color: var(--ink-muted);
}
.shadcn-card-content {
  padding: 1.5rem;
  padding-top: 0;
}

.shadcn-accordion {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.shadcn-accordion-item {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel);
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.shadcn-accordion-item:not(.expanded):hover {
  border-color: var(--ink-secondary);
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}
.shadcn-accordion-item:last-child {
}
.shadcn-accordion-trigger {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  color: var(--ink);
  cursor: pointer;
}
.shadcn-accordion-trigger:hover {
  background: transparent;
}
.shadcn-accordion-trigger svg {
  height: 1rem;
  width: 1rem;
  flex-shrink: 0;
  color: var(--ink-muted);
  transition: transform 0.2s;
}
.shadcn-accordion-trigger[aria-expanded="true"] svg {
  transform: rotate(180deg);
}
.shadcn-accordion-content {
  overflow: hidden;
  font-size: 0.875rem;
  animation: shadcn-accordion-down 0.2s ease-out;
}
.shadcn-accordion-content-inner {
  padding: 0 1.25rem 1.25rem 1.25rem;
}
@keyframes shadcn-accordion-down {
  from { height: 0; opacity: 0; }
  to { height: auto; opacity: 1; }
}

.shadcn-filters-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.styled-select {
  appearance: none;
  -webkit-appearance: none;
  background-color: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 10px 36px 10px 14px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  outline: none;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
  width: 180px;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}
.styled-select:hover {
  background-color: var(--surface-1);
  border-color: var(--ink-muted);
}
.styled-select:focus-visible {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}
.styled-select:focus:not(:focus-visible) {
  border-color: var(--line);
  box-shadow: var(--shadow-sm);
}

.explanation-card[open] > summary .show-text { display: none; }
.explanation-card:not([open]) > summary .hide-text { display: none; }

.ml-note-input:disabled {
  background: var(--surface-2) !important;
  opacity: 0.6;
  cursor: not-allowed;
}

/* ============================================================
   VOCABULARY TAB STYLES
   ============================================================ */
.vocab-phase-badge {
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow-sm);
}

/* Flashcards */
.vocab-flashcard-container {
  background-color: transparent;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  height: 380px;
  perspective: 1000px;
  cursor: pointer;
}
.vocab-flashcard-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  transform-style: preserve-3d;
}
.vocab-flashcard-container.flipped .vocab-flashcard-inner {
  transform: rotateY(180deg);
}
.vocab-flashcard-front, .vocab-flashcard-back {
  position: absolute;
  width: 100%;
  height: 100%;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 48px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--panel);
}
.vocab-flashcard-front:hover {
  box-shadow: var(--shadow-lg);
  border-color: var(--bb-blue-soft);
  transform: translateY(-2px);
  transition: all 0.3s ease;
}
.vocab-flashcard-back {
  transform: rotateY(180deg);
  background: #f8fafc;
}
.vocab-flashcard-hint {
  position: absolute;
  bottom: 24px;
  font-size: 14px;
  font-weight: 500;
}

@media (max-width: 600px) {
  .vocab-flashcard-front, .vocab-flashcard-back {
    padding: 32px 20px;
  }
  .vocab-match-grid {
    gap: 12px;
  }
  .vocab-match-btn {
    padding: 12px 8px;
    font-size: 14px;
    min-height: 52px;
  }
  .vocab-match-btn.text-small {
    font-size: 13px;
  }
}

/* MCQ Adjustments for Vocab */
.choice-row.correct-choice .choice-button {
  background: var(--green-bg);
  border-color: var(--green);
}
.choice-row.correct-choice .choice-letter {
  background: var(--green);
  color: white;
  border-color: var(--green);
}
.choice-row.incorrect-choice .choice-button {
  background: var(--red-bg);
  border-color: var(--red);
}
.choice-row.incorrect-choice .choice-letter {
  background: var(--red);
  color: white;
  border-color: var(--red);
}
.choice-row.dimmed-choice {
  opacity: 0.5;
  pointer-events: none;
}

/* Matching */
.vocab-match-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  max-width: 800px;
  margin: 0 auto;
}
.vocab-match-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.vocab-match-header {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-muted);
  padding: 0 4px;
  margin-bottom: 4px;
}
.vocab-match-btn {
  background: var(--panel);
  border: 2px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  text-align: left;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  min-height: 64px;
  width: 100%;
}
.vocab-match-btn.text-small {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
}
.vocab-match-btn:hover {
  border-color: var(--bb-blue);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.vocab-match-btn.selected {
  border-color: var(--blue);
  transform: scale(1.02);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}
.vocab-match-btn.selected-right {
  border-color: #8b5cf6;
  transform: scale(1.02);
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.1);
}
.vocab-match-btn.correct {
  border-color: var(--green);
  background: var(--green-bg);
  color: #064e3b;
  transform: scale(1.05);
}
.vocab-match-btn.wrong {
  border-color: var(--red);
  background: var(--red-bg);
  animation: shake 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}
.vocab-match-btn.paired {
  opacity: 0.3;
  pointer-events: none;
  background: var(--paper);
  border-color: var(--line-light);
  box-shadow: none;
}

/* Sentence Checker */
.vocab-sentence-card {
  display: flex;
  gap: 16px;
  padding: 8px;
  border-radius: 100px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
  background: var(--panel);
  transition: all 0.3s ease;
}
.vocab-sentence-card:focus-within {
  border-color: var(--amber);
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.1);
}
.vocab-sentence-input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 16px 24px;
  font-size: 16px;
  color: var(--ink);
  outline: none;
}
.vocab-sentence-input::placeholder {
  color: var(--ink-muted);
}
.vocab-sentence-feedback {
  margin-top: 24px;
  animation: fadeIn 0.3s ease;
}
.vocab-sentence-feedback-inner {
  padding: 24px;
  border-radius: var(--radius-xl);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.vocab-sentence-feedback-inner.success {
  background: var(--green-bg);
  border: 1px solid var(--green-border);
  color: #065f46;
}
.vocab-sentence-feedback-inner.error {
  background: var(--amber-bg);
  border: 1px solid var(--amber-border);
  color: #92400e;
}
.vocab-sentence-feedback-inner.rate-limit {
  background: var(--red-bg);
  border: 1px solid var(--red-border);
  color: #b91c1c;
}

@media (max-width: 600px) {
  .vocab-sentence-card {
    flex-direction: column;
    border-radius: var(--radius-xl);
    gap: 8px;
    padding: 12px;
  }
  .vocab-sentence-input {
    padding: 12px;
    width: 100%;
    box-sizing: border-box;
  }
  .vocab-sentence-card button#vocab-check-btn {
    width: 100% !important;
    border-radius: var(--radius-lg) !important;
  }
}

@keyframes shake {
  10%, 90% { transform: translate3d(-1px, 0, 0); }
  20%, 80% { transform: translate3d(2px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
  40%, 60% { transform: translate3d(4px, 0, 0); }
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   FEEDBACK MODAL STYLES (Redesign)
   ============================================================ */
.feedback-overlay {
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 16px;
}

.feedback-dialog {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 480px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  transform: scale(0.95) translateY(20px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.feedback-overlay.visible .feedback-dialog {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.feedback-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 24px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 50%, transparent);
}

.feedback-icon-wrapper {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--bb-blue) 10%, transparent);
  color: var(--bb-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.feedback-title-group h3 {
  margin: 0 0 4px;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--ink);
}

.feedback-title-group p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--ink-muted);
}

.feedback-header .close-btn {
  margin-left: auto;
  background: transparent;
  border: none;
  color: var(--ink-muted);
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.feedback-header .close-btn:hover {
  background: var(--line);
  color: var(--ink);
}

.feedback-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.feedback-form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.feedback-form-group label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink);
}

.feedback-form-row {
  display: flex;
  gap: 16px;
}

.feedback-type-selector {
  display: flex;
  gap: 12px;
}

.fb-radio-card {
  flex: 1;
  position: relative;
  cursor: pointer;
}

.fb-radio-card input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

.fb-radio-content {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 10px 0;
  text-align: center;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink-secondary);
  background: var(--surface);
  transition: all 0.2s ease;
  user-select: none;
}

.fb-radio-card:hover .fb-radio-content {
  background: var(--line-light);
}

.fb-radio-card input:checked ~ .fb-radio-content {
  background: color-mix(in srgb, var(--bb-blue) 10%, transparent);
  border-color: var(--bb-blue);
  color: var(--bb-blue);
  box-shadow: 0 0 0 1px var(--bb-blue);
}

.feedback-textarea,
.feedback-input {
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-family: inherit;
  font-size: 0.875rem;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.feedback-textarea {
  resize: vertical;
  min-height: 100px;
}

.feedback-textarea:focus,
.feedback-input:focus {
  outline: none;
  border-color: var(--bb-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.file-upload-wrapper {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  transition: all 0.2s ease;
}

.file-upload-wrapper:hover {
  border-color: var(--ink-muted);
}

.file-upload-input {
  position: absolute;
  font-size: 100px;
  right: 0;
  top: 0;
  opacity: 0;
  cursor: pointer;
  height: 100%;
  z-index: 2;
}

.file-upload-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  color: var(--ink-muted);
  font-size: 0.875rem;
  font-weight: 500;
  pointer-events: none;
}

.file-upload-btn span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.feedback-submit-btn {
  margin-top: 8px;
  background: var(--bb-blue);
  color: #fff;
  border: none;
  padding: 14px 24px;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.feedback-submit-btn:hover:not(:disabled) {
  background: #1d4ed8;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.3);
}

.feedback-submit-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.feedback-status {
  padding: 48px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.status-icon-wrapper {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--green) 10%, transparent);
  color: var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  animation: scaleIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes scaleIn {
  from { transform: scale(0); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.feedback-status h4 {
  margin: 0 0 8px;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--ink);
}

.feedback-status p {
  margin: 0;
  font-size: 0.95rem;
}

@media (max-width: 480px) {
  .feedback-form-row {
    flex-direction: column;
    gap: 16px;
  }
}

/* Demo Banner */
.demo-banner {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.4) 0%, rgba(15, 23, 42, 0.2) 100%);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-top-color: rgba(255, 255, 255, 0.25);
  border-left-color: rgba(255, 255, 255, 0.2);
  padding: 8px 8px 8px 20px;
  border-radius: 999px; /* Pill shape */
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 20px;
  box-shadow: 
    0 20px 40px -10px rgba(0, 0, 0, 0.5), 
    inset 0 2px 4px rgba(255, 255, 255, 0.15),
    inset 0 -2px 4px rgba(0, 0, 0, 0.2);
  width: max-content;
  max-width: 90vw;
}

.demo-banner-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.demo-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--blue, #3b82f6);
  box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7);
  animation: pulse-blue 2s infinite;
}

@keyframes pulse-blue {
  0% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7); }
  70% { box-shadow: 0 0 0 6px rgba(59, 130, 246, 0); }
  100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0); }
}

.demo-label {
  color: var(--zinc-100, #f4f4f5);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.02em;
}

.demo-text {
  color: rgba(255, 255, 255, 0.9);
  font-weight: 500;
  font-size: 14px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

.demo-banner button {
  background: var(--blue, #3b82f6);
  color: white;
  border: none;
  padding: 10px 24px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.3);
}

.demo-banner button:hover {
  background: #2563eb;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

@media (max-width: 768px) {
  .demo-banner {
    bottom: 24px;
    top: auto;
    padding: 6px 6px 6px 16px;
    gap: 12px;
  }
  
  .demo-text {
    display: none;
  }
  
  .demo-label {
    font-size: 13px;
  }
  
  .demo-banner button {
    padding: 8px 16px;
    font-size: 13px;
  }
}
