/* ===================================================================
   UPPSC Purvavlokan Solved Papers - Complete Responsive Design System
   Optimized for Phone, Tablet & Desktop Devices
   =================================================================== */

:root {
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Colors - Light Theme */
  --bg-primary: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-subtle: #f1f5f9;
  --bg-hover: #e2e8f0;
  
  --text-main: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  
  --border-light: #e2e8f0;
  --border-medium: #cbd5e1;
  --border-focus: #6366f1;

  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-light: #eef2ff;
  --primary-dark: #3730a3;

  --accent: #0284c7;
  --accent-hover: #0369a1;

  --success: #10b981;
  --success-light: #ecfdf5;
  --success-border: #a7f3d0;
  --success-text: #065f46;

  --danger: #ef4444;
  --danger-light: #fef2f2;
  --danger-border: #fecaca;
  --danger-text: #991b1b;

  --warning: #f59e0b;
  --warning-light: #fffbeb;
  --warning-border: #fde68a;
  --warning-text: #92400e;

  --purple: #8b5cf6;
  --purple-light: #f5f3ff;
  --purple-border: #ddd6fe;
  --purple-text: #5b21b6;

  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.07), 0 2px 4px -2px rgb(0 0 0 / 0.05);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.04);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.06);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
}

/* Dark Theme */
body.theme-dark {
  --bg-primary: #0b0f19;
  --bg-card: #131b2e;
  --bg-card-subtle: #1c2640;
  --bg-hover: #263353;
  
  --text-main: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --border-light: #1e293b;
  --border-medium: #334155;
  --border-focus: #818cf8;

  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-light: #1e1b4b;
  --primary-dark: #818cf8;

  --accent: #38bdf8;
  --accent-hover: #0284c7;

  --success: #10b981;
  --success-light: #064e3b33;
  --success-border: #047857;
  --success-text: #6ee7b7;

  --danger: #f87171;
  --danger-light: #7f1d1d33;
  --danger-border: #b91c1c;
  --danger-text: #fca5a5;

  --warning: #fbbf24;
  --warning-light: #78350f33;
  --warning-border: #b45309;
  --warning-text: #fde68a;

  --purple: #a78bfa;
  --purple-light: #4c1d9533;
  --purple-border: #6d28d9;
  --purple-text: #ddd6fe;

  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.4);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.5);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.6);
}

/* Base Styles & Touch Optimization */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  transition: background-color 0.25s ease, color 0.25s ease;
  touch-action: manipulation;
}

/* App Header */
.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(12px);
}

.header-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.brand-badge {
  background: linear-gradient(135deg, #4f46e5, #06b6d4);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
  flex-shrink: 0;
}

.brand-title {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
  white-space: nowrap;
}

.brand-subtitle {
  font-size: 0.75rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

.header-center {
  flex: 1;
  max-width: 540px;
}

.section-selector-wrapper {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--bg-card-subtle);
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-medium);
}

.selector-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  white-space: nowrap;
}

.custom-select {
  flex: 1;
  min-width: 0;
}

.custom-select select {
  width: 100%;
  background: transparent;
  border: none;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
  outline: none;
  cursor: pointer;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.custom-select select option {
  background-color: var(--bg-card);
  color: var(--text-main);
  padding: 0.5rem;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.icon-btn {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-main);
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.icon-btn:hover {
  background: var(--bg-hover);
  border-color: var(--border-medium);
}

/* Main Container */
.main-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* Views Management */
.view {
  display: none;
}

.view.active {
  display: block;
  animation: fadeIn 0.25s ease-out;
}

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

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-sans);
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  white-space: nowrap;
  touch-action: manipulation;
}

.btn-sm {
  padding: 0.45rem 0.85rem;
  font-size: 0.82rem;
  min-height: 38px;
}

.btn-md {
  padding: 0.65rem 1.25rem;
  font-size: 0.9rem;
  min-height: 44px;
}

.btn-lg {
  padding: 0.85rem 1.6rem;
  font-size: 1rem;
  min-height: 50px;
}

.btn-block {
  width: 100%;
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(79, 70, 229, 0.25);
}

.btn-primary:hover, .btn-primary:active {
  background: var(--primary-hover);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.35);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-main);
  border-color: var(--border-medium);
}

.btn-secondary:hover, .btn-secondary:active {
  background: var(--bg-hover);
  border-color: var(--text-secondary);
}

.btn-accent {
  background: linear-gradient(135deg, #0284c7, #2563eb);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.3);
}

.btn-accent:hover, .btn-accent:active {
  background: linear-gradient(135deg, #0369a1, #1d4ed8);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover, .btn-ghost:active {
  background: var(--bg-card-subtle);
  color: var(--text-main);
}

.btn-outline-danger {
  background: transparent;
  color: var(--danger);
  border-color: var(--danger-border);
}

.btn-outline-danger:hover {
  background: var(--danger-light);
}

.btn-outline-purple {
  background: transparent;
  color: var(--purple-text);
  border-color: var(--purple-border);
}

.btn-outline-purple:hover {
  background: var(--purple-light);
}

.btn-outline-secondary {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border-medium);
}

.btn-outline-secondary:hover {
  background: var(--bg-card-subtle);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.badge-exam {
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid var(--border-light);
}

.badge-page {
  background: var(--bg-card-subtle);
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
}

/* ===================================================================
   VIEW 1: HERO & CHAPTER LIST
   =================================================================== */

.hero-card {
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #1e293b 100%);
  color: #ffffff;
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  margin-bottom: 2.5rem;
  box-shadow: var(--shadow-xl);
  position: relative;
  overflow: hidden;
}

.hero-card::after {
  content: "";
  position: absolute;
  top: -50%;
  right: -20%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.25) 0%, transparent 70%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #10b981;
  box-shadow: 0 0 8px #10b981;
}

.hero-title {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 0.75rem;
  line-height: 1.2;
}

.hero-desc {
  font-size: 1rem;
  color: #cbd5e1;
  margin-bottom: 1.8rem;
  line-height: 1.6;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-pill {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
}

.stat-val {
  font-size: 1.3rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: #38bdf8;
}

.stat-lbl {
  font-size: 0.75rem;
  color: #94a3b8;
  font-weight: 600;
  text-transform: uppercase;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

/* Notice for Unextracted Sections */
.unextracted-notice {
  background: var(--bg-card);
  border: 2px dashed var(--primary);
  border-radius: var(--radius-xl);
  padding: 2rem;
  margin-bottom: 2.5rem;
  display: flex;
  gap: 1.5rem;
  align-items: center;
  box-shadow: var(--shadow-md);
}

.notice-icon {
  font-size: 3rem;
  flex-shrink: 0;
}

.notice-content h3 {
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  color: var(--text-main);
}

.notice-content p {
  color: var(--text-secondary);
  font-size: 0.92rem;
  margin-bottom: 1rem;
}

.notice-command code {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-medium);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--primary);
  display: inline-block;
}

/* Chapters Header */
.chapters-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.section-heading {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.section-subheading {
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 0.5rem 1rem;
  min-width: 380px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.search-box:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.search-icon {
  margin-right: 0.6rem;
  color: var(--text-muted);
}

.search-box input {
  border: none;
  background: transparent;
  width: 100%;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  color: var(--text-main);
  outline: none;
}

.clear-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.9rem;
}

/* Chapter Cards Grid */
.chapters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
}

.chapter-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1.4rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.chapter-card:hover {
  border-color: var(--border-focus);
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.chapter-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
}

.ch-badge {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 700;
  font-size: 0.75rem;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
}

.ch-pages {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.ch-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.75rem;
  line-height: 1.4;
  min-height: 48px;
}

.ch-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.85rem;
  margin-top: 0.85rem;
  border-top: 1px dashed var(--border-light);
}

.ch-q-count {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.ch-status {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
}

.ch-status.status-completed {
  background: var(--success-light);
  color: var(--success-text);
  border: 1px solid var(--success-border);
}

.ch-status.status-not-started {
  background: var(--bg-card-subtle);
  color: var(--text-muted);
}

.chapter-card-actions {
  margin-top: 1rem;
}

/* ===================================================================
   VIEW 2: ACTIVE TEST MODE
   =================================================================== */

.test-topbar {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1rem 1.5rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.test-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.test-chapter-badge {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 700;
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  display: inline-block;
  margin-bottom: 0.2rem;
}

.test-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.test-controls {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.timer-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-medium);
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--primary);
  white-space: nowrap;
}

.mobile-only-btn {
  display: none;
}

/* Test Layout: Question + Palette */
.test-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 1.5rem;
  align-items: start;
}

.question-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: 2rem;
  box-shadow: var(--shadow-md);
}

.question-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-light);
  flex-wrap: wrap;
  gap: 0.75rem;
}

.q-number-pill {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-light);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
}

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

.question-text {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.7;
  margin-bottom: 2rem;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Options Container */
.options-container {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-bottom: 2rem;
}

.option-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  background: var(--bg-card-subtle);
  border: 2px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  min-height: 52px;
}

.option-item:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.option-item.selected {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.25);
}

.opt-prefix {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1.5px solid var(--border-medium);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-secondary);
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.option-item.selected .opt-prefix {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.opt-text {
  font-size: 0.98rem;
  font-weight: 500;
  color: var(--text-main);
  padding-top: 0.2rem;
  flex: 1;
  white-space: pre-wrap;
  word-break: break-word;
}

.opt-key-hint {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  border: 1px solid var(--border-medium);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
}

/* Question Footer */
.question-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-light);
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-left, .footer-right {
  display: flex;
  gap: 0.75rem;
}

.keyboard-hints {
  margin-top: 1.25rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.kbd {
  font-family: var(--font-mono);
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-medium);
  border-radius: 4px;
  padding: 0.1rem 0.4rem;
  font-size: 0.72rem;
  color: var(--text-secondary);
}

/* Question Palette Sidebar */
.palette-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 90px;
}

.palette-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.palette-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-main);
}

.close-drawer-btn {
  background: transparent;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  color: var(--text-muted);
  display: none;
}

.palette-stats {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.p-stat {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.dot.green { background-color: var(--success); }
.dot.purple { background-color: var(--purple); }
.dot.gray { background-color: var(--border-medium); }

.palette-grid-wrapper {
  max-height: 420px;
  overflow-y: auto;
  padding-right: 0.4rem;
  margin-bottom: 1.25rem;
}

.palette-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.5rem;
}

.palette-btn {
  aspect-ratio: 1;
  background: var(--bg-card-subtle);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
  min-height: 38px;
}

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

.palette-btn.current {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary);
  font-weight: 800;
}

.palette-btn.answered {
  background: var(--success);
  border-color: var(--success);
  color: #ffffff;
}

.palette-btn.marked {
  background: var(--purple);
  border-color: var(--purple);
  color: #ffffff;
}

.palette-btn.marked.answered::after {
  content: "";
  position: absolute;
  top: 2px;
  right: 2px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ffffff;
}

/* Mobile Sticky Bottom Bar (Phone & Tablet) */
.mobile-sticky-test-bar {
  display: none;
}

/* ===================================================================
   VIEW 3: RESULTS VIEW (3 SECTIONS ON THE SAME WINDOW)
   =================================================================== */

.results-banner {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: 2rem;
  box-shadow: var(--shadow-md);
  margin-bottom: 2.5rem;
}

.results-banner-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-light);
  flex-wrap: wrap;
  gap: 1.5rem;
}

.results-pretitle {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.results-title {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.results-subtitle {
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.score-card {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-medium);
  padding: 1.25rem 2rem;
  border-radius: var(--radius-lg);
}

.score-dial {
  text-align: center;
}

.score-number {
  font-size: 2.2rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--primary);
  line-height: 1;
}

.score-percent {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.score-tag {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.25rem;
}

.time-spent-tag {
  font-size: 0.82rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

/* 3 Stat Badges Counter (Touch-Friendly Jump Cards) */
.results-stat-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-bottom: 1.75rem;
}

.res-stat-card {
  background: var(--bg-card);
  border: 2px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1.2rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 72px;
}

.res-stat-card:hover, .res-stat-card:active {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.card-incorrect {
  border-color: var(--danger-border);
  background: var(--danger-light);
}

.card-correct {
  border-color: var(--success-border);
  background: var(--success-light);
}

.card-unattempted {
  border-color: var(--border-medium);
  background: var(--bg-card-subtle);
}

.res-stat-icon {
  font-size: 1.8rem;
}

.res-stat-count {
  font-size: 1.8rem;
  font-weight: 800;
  font-family: var(--font-mono);
  line-height: 1.1;
}

.card-incorrect .res-stat-count { color: var(--danger-text); }
.card-correct .res-stat-count { color: var(--success-text); }
.card-unattempted .res-stat-count { color: var(--text-secondary); }

.res-stat-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.res-jump-hint {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* Results Actions Bar */
.results-actions-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.action-buttons-group {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.view-filter-tabs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-card-subtle);
  padding: 0.35rem 0.5rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  overflow-x: auto;
  max-width: 100%;
}

.filter-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-right: 0.25rem;
  white-space: nowrap;
}

.filter-tab {
  background: transparent;
  border: none;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  min-height: 36px;
}

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

.filter-tab.active {
  background: var(--bg-card);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
  font-weight: 700;
}

/* ===================================================================
   3 SECTIONS IN SAME WINDOW: INCORRECT, CORRECT, UNATTEMPTED
   =================================================================== */

.results-sections-container {
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

.result-breakdown-section {
  scroll-margin-top: 90px;
}

.section-title-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.75rem;
  border-radius: var(--radius-lg);
  margin-bottom: 1.5rem;
  border: 1px solid transparent;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.section-title-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.section-icon-badge {
  font-size: 1.5rem;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.badge-red { background: var(--danger-light); color: var(--danger); border: 1px solid var(--danger-border); }
.badge-green { background: var(--success-light); color: var(--success); border: 1px solid var(--success-border); }
.badge-gray { background: var(--bg-card-subtle); color: var(--text-secondary); border: 1px solid var(--border-medium); }

.section-heading-text {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.section-desc-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.section-count-badge {
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.82rem;
  white-space: nowrap;
}

.badge-red-outline { background: var(--danger-light); color: var(--danger-text); border: 1.5px solid var(--danger-border); }
.badge-green-outline { background: var(--success-light); color: var(--success-text); border: 1.5px solid var(--success-border); }
.badge-gray-outline { background: var(--bg-card-subtle); color: var(--text-secondary); border: 1.5px solid var(--border-medium); }

.section-incorrect-block .section-title-bar {
  background: var(--danger-light);
  border-color: var(--danger-border);
}

.section-correct-block .section-title-bar {
  background: var(--success-light);
  border-color: var(--success-border);
}

.section-unattempted-block .section-title-bar {
  background: var(--bg-card-subtle);
  border-color: var(--border-medium);
}

/* Questions Solution List */
.questions-solution-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.empty-section-message {
  background: var(--bg-card);
  border: 1px dashed var(--border-medium);
  border-radius: var(--radius-lg);
  padding: 2.5rem 1.5rem;
  text-align: center;
  color: var(--text-secondary);
}

.empty-icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

/* Individual Solution Review Card */
.solution-review-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.solution-review-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-medium);
}

.sol-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border-light);
  flex-wrap: wrap;
  gap: 0.75rem;
}

.sol-q-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.sol-status-pill {
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}

.sol-status-pill.incorrect {
  background: var(--danger-light);
  color: var(--danger-text);
  border: 1px solid var(--danger-border);
}

.sol-status-pill.correct {
  background: var(--success-light);
  color: var(--success-text);
  border: 1px solid var(--success-border);
}

.sol-status-pill.unattempted {
  background: var(--bg-card-subtle);
  color: var(--text-secondary);
  border: 1px solid var(--border-medium);
}

.sol-question-text {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.6;
  margin-bottom: 1.5rem;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Solution Review Options */
.sol-options-grid {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 1.75rem;
}

.sol-opt-row {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 0.85rem 1.15rem;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-light);
  background: var(--bg-card-subtle);
  font-size: 0.92rem;
  white-space: pre-wrap;
  word-break: break-word;
  flex-wrap: wrap;
}

.sol-opt-row.is-user-incorrect {
  border-color: var(--danger);
  background: var(--danger-light);
  color: var(--danger-text);
}

.sol-opt-row.is-correct-answer {
  border-color: var(--success);
  background: var(--success-light);
  color: var(--success-text);
  font-weight: 600;
}

.sol-opt-row.is-user-correct {
  border-color: var(--success);
  background: var(--success-light);
  color: var(--success-text);
  font-weight: 600;
}

.sol-opt-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  margin-left: auto;
  white-space: nowrap;
}

.badge-your-ans-wrong {
  background: var(--danger);
  color: #ffffff;
}

.badge-correct-key {
  background: var(--success);
  color: #ffffff;
}

.badge-your-ans-right {
  background: var(--success);
  color: #ffffff;
}

/* Solution & Little Description Box */
.solution-box {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  position: relative;
}

.solution-box-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  color: var(--primary);
  font-weight: 800;
  font-size: 0.95rem;
}

.solution-key-indicator {
  margin-bottom: 0.75rem;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
}

.solution-key-indicator b {
  color: var(--success);
  font-size: 1rem;
}

.solution-desc-text {
  font-size: 0.95rem;
  color: var(--text-main);
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Modal Overlay */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: 2.2rem;
  max-width: 500px;
  width: 100%;
  box-shadow: var(--shadow-xl);
  animation: modalPop 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

.modal-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.modal-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.modal-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  text-align: center;
}

.m-stat {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-light);
  padding: 0.85rem 0.5rem;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.m-val {
  display: block;
  font-size: 1.4rem;
  font-weight: 800;
  font-family: var(--font-mono);
  margin-bottom: 0.2rem;
}

.m-val.green { color: var(--success); }
.m-val.purple { color: var(--purple); }
.m-val.gray { color: var(--text-muted); }

.modal-note {
  font-size: 0.82rem;
  color: var(--text-secondary);
  background: var(--primary-light);
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.85rem;
}

/* ===================================================================
   RESPONSIVE DESIGN (PHONE & TABLET ADAPTATIONS)
   =================================================================== */

/* Tablet & Mobile (<1024px) */
@media (max-width: 1024px) {
  .test-layout {
    grid-template-columns: 1fr;
  }

  /* Make Palette a Drawer on Tablet & Mobile */
  .mobile-only-btn {
    display: inline-flex;
  }

  .close-drawer-btn {
    display: block;
  }

  .palette-column {
    position: fixed;
    inset: 0;
    z-index: 90;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: flex-end;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
  }

  .palette-column.open {
    opacity: 1;
    pointer-events: auto;
  }

  .palette-column .palette-card {
    width: 340px;
    max-width: 85vw;
    height: 100%;
    border-radius: 0;
    border-left: 1px solid var(--border-medium);
    top: 0;
    transform: translateX(100%);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
  }

  .palette-column.open .palette-card {
    transform: translateX(0);
  }

  .palette-grid-wrapper {
    max-height: none;
    flex: 1;
  }

  .results-stat-bar {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Mobile Devices (<768px) */
@media (max-width: 768px) {
  html {
    font-size: 15px;
  }

  .main-container {
    padding: 1.25rem 1rem 5rem 1rem;
  }

  /* Compact Header */
  .header-container {
    padding: 0.65rem 1rem;
    gap: 0.75rem;
    flex-direction: row;
    flex-wrap: wrap;
  }

  .header-left {
    gap: 0.6rem;
  }

  .brand-title {
    font-size: 1rem;
  }

  .brand-subtitle {
    display: none;
  }

  .header-center {
    order: 3;
    max-width: 100%;
    width: 100%;
  }

  .section-selector-wrapper {
    padding: 0.35rem 0.65rem;
  }

  .selector-label {
    font-size: 0.68rem;
  }

  .custom-select select {
    font-size: 0.8rem;
  }

  /* Hero Section */
  .hero-card {
    padding: 1.5rem 1.25rem;
    border-radius: var(--radius-lg);
    margin-bottom: 1.5rem;
  }

  .hero-title {
    font-size: 1.5rem;
  }

  .hero-desc {
    font-size: 0.88rem;
    margin-bottom: 1.25rem;
  }

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

  .stat-pill {
    padding: 0.5rem 0.8rem;
  }

  .stat-val {
    font-size: 1.15rem;
  }

  .hero-actions {
    flex-direction: column;
  }

  .hero-actions .btn {
    width: 100%;
  }

  /* Chapters List */
  .chapters-header {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }

  .section-heading {
    font-size: 1.25rem;
  }

  .search-box {
    min-width: 100%;
    width: 100%;
  }

  .chapters-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .chapter-card {
    padding: 1.15rem;
  }

  .ch-title {
    min-height: auto;
    font-size: 1rem;
  }

  /* Test Top Bar */
  .test-topbar {
    padding: 0.85rem 1rem;
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .test-meta {
    justify-content: space-between;
  }

  .test-title {
    font-size: 1rem;
  }

  .test-controls {
    justify-content: space-between;
  }

  .timer-box {
    font-size: 0.95rem;
    padding: 0.35rem 0.65rem;
  }

  .question-card {
    padding: 1.25rem 1rem;
    border-radius: var(--radius-lg);
  }

  .question-text {
    font-size: 1rem;
    margin-bottom: 1.5rem;
  }

  .option-item {
    padding: 0.85rem 1rem;
    gap: 0.75rem;
  }

  .opt-prefix {
    width: 28px;
    height: 28px;
    font-size: 0.8rem;
  }

  .opt-text {
    font-size: 0.92rem;
  }

  .opt-key-hint {
    display: none;
  }

  /* Hide Desktop Footer on Mobile, Show Sticky Footer */
  .desktop-footer {
    display: none !important;
  }

  .keyboard-hints {
    display: none !important;
  }

  .mobile-sticky-test-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-top: 1px solid var(--border-medium);
    padding: 0.65rem 1rem;
    z-index: 80;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.1);
  }

  .mobile-sticky-test-bar .btn {
    flex: 1;
    min-height: 42px;
  }

  /* Results Banner */
  .results-banner {
    padding: 1.25rem 1rem;
    border-radius: var(--radius-lg);
    margin-bottom: 1.75rem;
  }

  .results-banner-main {
    flex-direction: column;
    align-items: stretch;
    gap: 1.25rem;
  }

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

  .score-card {
    padding: 1rem;
    gap: 1rem;
    justify-content: center;
  }

  .score-number {
    font-size: 1.8rem;
  }

  /* Results Stat Cards on Mobile */
  .results-stat-bar {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .res-stat-card {
    padding: 0.85rem 1rem;
  }

  .res-stat-icon {
    font-size: 1.4rem;
  }

  .res-stat-count {
    font-size: 1.4rem;
  }

  .results-actions-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .action-buttons-group {
    flex-direction: column;
  }

  .action-buttons-group .btn {
    width: 100%;
  }

  .view-filter-tabs {
    width: 100%;
    justify-content: space-between;
  }

  /* Solution Review Cards */
  .solution-review-card {
    padding: 1.25rem 1rem;
    border-radius: var(--radius-lg);
  }

  .sol-card-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .sol-q-title {
    font-size: 0.9rem;
  }

  .sol-question-text {
    font-size: 0.98rem;
  }

  .sol-opt-row {
    padding: 0.75rem 0.9rem;
    font-size: 0.88rem;
  }

  .solution-box {
    padding: 1rem;
  }

  .solution-desc-text {
    font-size: 0.9rem;
  }

  .unextracted-notice {
    flex-direction: column;
    text-align: center;
    padding: 1.5rem;
  }

  .notice-command code {
    word-break: break-all;
    font-size: 0.8rem;
  }
}

/* ==========================================================================
   PARTNER STUDY MONITOR & LIVE SYNC STYLES
   ========================================================================== */

/* Mode Toggle in Header */
.mode-toggle-group {
  display: inline-flex;
  align-items: center;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 9999px;
  padding: 3px;
  gap: 2px;
}

.mode-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  color: var(--text-secondary);
  border: none;
  border-radius: 9999px;
  padding: 6px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.mode-pill:hover {
  color: var(--text-primary);
  background: rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] .mode-pill:hover {
  background: rgba(255, 255, 255, 0.06);
}

.mode-pill.active {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(13, 148, 136, 0.35);
}

.sync-dot.live {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
  animation: pulse-dot 1.8s infinite;
}

.mode-pill.active .sync-dot.live {
  background: #a7f3d0;
  box-shadow: 0 0 0 0 rgba(167, 243, 208, 0.7);
}

@keyframes pulse-dot {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
  }
  70% {
    transform: scale(1.1);
    box-shadow: 0 0 0 6px rgba(34, 197, 94, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
  }
}

/* Monitor Banner */
.monitor-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(135deg, rgba(13, 148, 136, 0.08) 0%, rgba(99, 102, 241, 0.08) 100%);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-lg);
  padding: 1.5rem 2rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.monitor-live-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 9999px;
  background: rgba(34, 197, 94, 0.15);
  color: #16a34a;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

[data-theme="dark"] .monitor-live-pill {
  color: #4ade80;
  background: rgba(34, 197, 94, 0.2);
}

.live-pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  animation: pulse-dot 1.5s infinite;
}

.monitor-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.monitor-subtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin: 0;
}

.monitor-banner-right {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

/* 4 Quick Metric Cards */
.monitor-metrics-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.mon-metric-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s;
}

.mon-metric-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.mon-metric-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.mon-metric-info {
  display: flex;
  flex-direction: column;
}

.mon-metric-title {
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.mon-metric-val {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
}

/* Containers */
.mon-card-container {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-sm);
}

.mon-card-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-bottom: 1rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-color);
  flex-wrap: wrap;
  gap: 0.5rem;
}

.mon-card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.mon-card-meta {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.mon-sync-indicator {
  font-size: 0.8rem;
  color: var(--primary);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

/* Section Progress Grid */
.mon-section-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.mon-sec-item {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  background: var(--bg-primary);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.mon-sec-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.mon-sec-name {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text-primary);
}

.mon-sec-percent {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--primary);
}

.mon-sec-bar-bg {
  width: 100%;
  height: 8px;
  background: var(--bg-tertiary);
  border-radius: 9999px;
  overflow: hidden;
}

.mon-sec-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary) 0%, #0ea5e9 100%);
  border-radius: 9999px;
  transition: width 0.4s ease;
}

.mon-sec-detail {
  font-size: 0.78rem;
  color: var(--text-secondary);
  display: flex;
  justify-content: space-between;
}

/* Feed List */
.mon-feed-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.mon-feed-empty {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--text-secondary);
}

.mon-feed-empty-icon {
  font-size: 3rem;
  margin-bottom: 0.75rem;
}

.mon-feed-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
  flex-wrap: wrap;
  gap: 1rem;
}

.mon-feed-item:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.mon-feed-left {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.mon-feed-score-badge {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.95rem;
  flex-shrink: 0;
  border: 3px solid currentColor;
}

.mon-feed-score-badge.high {
  color: #16a34a;
  background: rgba(34, 197, 94, 0.1);
}

.mon-feed-score-badge.mid {
  color: #d97706;
  background: rgba(245, 158, 11, 0.1);
}

.mon-feed-score-badge.low {
  color: #dc2626;
  background: rgba(239, 68, 68, 0.1);
}

.mon-feed-score-sub {
  font-size: 0.65rem;
  font-weight: 600;
  opacity: 0.85;
}

.mon-feed-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.mon-feed-section-tag {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.mon-feed-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.mon-feed-meta-row {
  display: flex;
  gap: 1rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
  flex-wrap: wrap;
}

.mon-feed-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.mon-feed-meta-item.incorrect {
  color: var(--danger);
  font-weight: 600;
}

.mon-feed-meta-item.correct {
  color: var(--success);
  font-weight: 600;
}

.mon-feed-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Toast Notifications */
.toast-notification {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--primary);
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius-md);
  padding: 0.9rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 500;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: slideUpToast 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Mobile responsive for Partner Monitor */
@media (max-width: 768px) {
  .mode-pill .mode-text {
    font-size: 0.78rem;
  }

  .mode-pill {
    padding: 5px 10px;
  }

  .monitor-banner {
    padding: 1.25rem;
  }

  .monitor-title {
    font-size: 1.3rem;
  }

  .mon-feed-item {
    padding: 1rem;
    flex-direction: column;
    align-items: flex-start;
  }

  .mon-feed-right {
    width: 100%;
    justify-content: flex-end;
  }

  .toast-notification {
    bottom: 5.5rem;
    right: 1rem;
    left: 1rem;
  }
}

