/* ==========================================================================
   MAS291 STUDY HUB — PREMIUM LIGHT DESIGN SYSTEM
   Senior Frontend Engineer build — Clean, legible, professional
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

/* ==================== DESIGN TOKENS ==================== */
:root {
  /* Surfaces */
  --bg-body: #f5f7fa;
  --bg-white: #ffffff;
  --bg-elevated: #ffffff;
  --bg-subtle: #f0f2f5;
  --bg-input: #f8f9fb;
  --bg-hover: #eef1f6;

  /* Text */
  --text-primary: #1a1d23;
  --text-secondary: #5a6070;
  --text-tertiary: #8b91a0;
  --text-inverse: #ffffff;

  /* Brand */
  --brand-600: #4f46e5;
  --brand-500: #6366f1;
  --brand-100: #e0e7ff;
  --brand-50: #eef2ff;

  /* Accents */
  --teal-600: #0d9488;
  --teal-100: #ccfbf1;
  --teal-50: #f0fdfa;
  --amber-600: #d97706;
  --amber-100: #fef3c7;
  --amber-50: #fffbeb;

  /* Feedback */
  --green-700: #15803d;
  --green-600: #16a34a;
  --green-100: #dcfce7;
  --green-50: #f0fdf4;
  --red-700: #b91c1c;
  --red-600: #dc2626;
  --red-100: #fee2e2;
  --red-50: #fef2f2;

  /* Borders */
  --border-default: #e2e5eb;
  --border-light: #eef0f4;
  --border-focus: var(--brand-500);

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.06), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.06), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-card: 0 1px 3px rgba(0,0,0,0.04), 0 0 0 1px rgba(0,0,0,0.02);

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --radius-full: 9999px;

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --duration-fast: 150ms;
  --duration-normal: 250ms;
}

/* ==================== RESET & BASE ==================== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-body);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #ccd0d9; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #adb3bf; }

/* ==================== LAYOUT ==================== */
.app-shell {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 28px 80px;
}

/* ==================== HEADER ==================== */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 0 20px;
  border-bottom: 1px solid var(--border-default);
  margin-bottom: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--brand-600), #7c3aed);
  color: var(--text-inverse);
  font-weight: 800;
  font-size: 12px;
  border-radius: var(--radius-md);
  letter-spacing: 0.3px;
  flex-shrink: 0;
}

.brand-text h1 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.3px;
  line-height: 1.3;
}

.brand-text p {
  font-size: 13px;
  color: var(--text-tertiary);
  font-weight: 400;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.progress-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-white);
  border: 1px solid var(--border-default);
  padding: 7px 16px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  box-shadow: var(--shadow-xs);
}

.progress-chip .count {
  font-weight: 700;
  color: var(--brand-600);
}

/* ==================== MAIN NAV ==================== */
.main-nav {
  display: flex;
  gap: 6px;
  background: var(--bg-white);
  padding: 5px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-default);
  margin-bottom: 32px;
  box-shadow: var(--shadow-xs);
}

.main-nav__btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
  user-select: none;
}

.main-nav__btn:hover {
  background: var(--bg-subtle);
  color: var(--text-primary);
}

.main-nav__btn.active {
  background: var(--brand-600);
  color: var(--text-inverse);
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.25);
}

/* ==================== VIEW CONTAINERS ==================== */
.view-panel { display: none; }
.view-panel.is-active { display: block; }

/* ==================== THEORY VIEW ==================== */
.theory-grid {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 28px;
  align-items: start;
}

.chapter-nav {
  background: var(--bg-white);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: 14px;
  position: sticky;
  top: 20px;
  box-shadow: var(--shadow-card);
}

.chapter-nav__heading {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  font-weight: 700;
  color: var(--text-tertiary);
  padding: 4px 10px 10px;
}

.chapter-nav__list {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.ch-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  text-align: left;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
  line-height: 1.4;
}

.ch-btn:hover { background: var(--bg-subtle); color: var(--text-primary); }

.ch-btn.active {
  background: var(--brand-50);
  border-color: var(--brand-100);
  color: var(--brand-600);
  font-weight: 600;
}

.ch-btn__code {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 24px;
  padding: 0 6px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 5px;
  background: var(--bg-subtle);
  color: var(--text-tertiary);
  flex-shrink: 0;
}

.ch-btn.active .ch-btn__code {
  background: var(--brand-100);
  color: var(--brand-600);
}

.theory-body {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.ch-hero {
  background: var(--bg-white);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: 28px 30px;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}

.ch-hero::after {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 4px; height: 100%;
  background: linear-gradient(180deg, var(--brand-600), var(--teal-600));
  border-radius: 0 2px 2px 0;
}

.ch-hero__title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 10px;
  letter-spacing: -0.3px;
}

.ch-hero__summary {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.75;
  margin-bottom: 20px;
}

.tips-box {
  background: var(--amber-50);
  border: 1px solid var(--amber-100);
  border-radius: var(--radius-md);
  padding: 16px 20px;
}

.tips-box__heading {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--amber-600);
  margin-bottom: 8px;
}

.tips-box__list {
  padding-left: 18px;
  font-size: 14px;
  color: var(--text-primary);
  line-height: 1.75;
}

.tips-box__list li + li { margin-top: 4px; }

.formula-section { margin-top: 4px; }

.formula-section__heading {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.formula-cards {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.f-card {
  background: var(--bg-white);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: 24px 26px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: var(--shadow-card);
  transition: transform var(--duration-normal) var(--ease-out),
              box-shadow var(--duration-normal) var(--ease-out);
}

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

.f-card__name {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.4;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-light);
}

.f-card__definition {
  padding: 12px 16px;
  background: #f8fafc;
  border-radius: var(--radius-md);
  border-left: 3.5px solid #475569;
}
.f-card__definition .f-card__sublabel {
  color: #334155;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 5px;
}
.f-card__definition .f-card__subtext {
  color: #1e293b;
  font-size: 14px;
  line-height: 1.65;
}

.f-card__math {
  background: #f8fafc;
  padding: 20px 24px;
  border-radius: var(--radius-md);
  text-align: center;
  font-size: clamp(14.5px, 1.8vw, 18px);
  color: var(--text-primary);
  overflow-x: auto;
  scrollbar-width: thin;
  border: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.f-math-line {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.f-math-line .katex-display {
  margin: 4px 0 !important;
}

.f-math-separator {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 2px 12px;
  background: var(--bg-body);
  border-radius: var(--radius-full);
}

.f-card__sublabel {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 5px;
}

.f-card__subtext {
  font-size: 13.5px;
  line-height: 1.65;
}

.f-card__symbols {
  padding: 12px 16px;
  background: #eff6ff;
  border-radius: var(--radius-md);
  border-left: 3.5px solid #2563eb;
}
.f-card__symbols .f-card__sublabel {
  color: #1d4ed8;
}
.f-card__symbols .f-card__subtext {
  color: #1e293b;
}

.f-card__signal {
  padding: 12px 16px;
  background: #fffbeb;
  border-radius: var(--radius-md);
  border-left: 3.5px solid #d97706;
}
.f-card__signal .f-card__sublabel {
  color: #b45309;
}
.f-card__signal .f-card__subtext {
  color: #78350f;
  font-weight: 500;
}

.f-card__tip {
  padding: 12px 16px;
  background: #f0fdf4;
  border-radius: var(--radius-md);
  border-left: 3.5px solid #16a34a;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.f-card__tip .f-card__sublabel {
  color: #15803d;
}
.f-card__tip .f-card__subtext {
  color: #14532d;
}

/* ==================== QUIZ VIEW ==================== */
.quiz-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: var(--bg-white);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: 14px 20px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-card);
}

.quiz-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.select-field {
  appearance: none;
  background: var(--bg-input) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235a6070' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 12px center;
  border: 1px solid var(--border-default);
  color: var(--text-primary);
  padding: 9px 36px 9px 14px;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  outline: none;
  transition: border-color var(--duration-fast);
  min-width: 180px;
}

.select-field:focus {
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.mode-switcher {
  display: flex;
  background: var(--bg-subtle);
  padding: 3px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
}

.mode-switcher__btn {
  padding: 7px 16px;
  background: transparent;
  border: none;
  border-radius: 7px;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--duration-fast);
  white-space: nowrap;
}

.mode-switcher__btn.active {
  background: var(--bg-white);
  color: var(--brand-600);
  box-shadow: var(--shadow-sm);
}

.question-feed {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.q-card {
  background: var(--bg-white);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: 26px 28px;
  box-shadow: var(--shadow-card);
  transition: border-color var(--duration-fast);
}

.q-card:hover { border-color: #d1d5e0; }

.q-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 8px;
}

.q-card__tags { display: flex; flex-wrap: wrap; gap: 6px; }

.tag {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  letter-spacing: 0.2px;
}

.tag--chapter { background: var(--brand-50); color: var(--brand-600); border: 1px solid var(--brand-100); }
.tag--topic { background: var(--teal-50); color: var(--teal-600); border: 1px solid var(--teal-100); }

.q-card__source { font-size: 12px; color: var(--text-tertiary); font-weight: 500; }

.q-card__body {
  font-size: 15px;
  line-height: 1.8;
  color: var(--text-primary);
  margin-bottom: 20px;
}

.options { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }

.opt-btn {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  width: 100%;
  padding: 14px 18px;
  background: var(--bg-input);
  border: 1.5px solid var(--border-default);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
  line-height: 1.6;
}

.opt-btn:hover:not(.locked) {
  background: var(--brand-50);
  border-color: var(--brand-100);
  transform: translateX(2px);
}

.opt-btn__key {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 1.5px solid var(--border-default);
  background: var(--bg-white);
  font-weight: 700;
  font-size: 13px;
  color: var(--text-secondary);
  flex-shrink: 0;
  transition: all var(--duration-fast);
}

.opt-btn__text { flex: 1; padding-top: 3px; }

.opt-btn.is-correct { background: var(--green-50); border-color: var(--green-600); }
.opt-btn.is-correct .opt-btn__key { background: var(--green-600); border-color: var(--green-600); color: #fff; }

.opt-btn.is-wrong { background: var(--red-50); border-color: var(--red-600); }
.opt-btn.is-wrong .opt-btn__key { background: var(--red-600); border-color: var(--red-600); color: #fff; }

.opt-btn.show-answer { background: var(--green-50); border-color: var(--green-600); border-style: dashed; }
.opt-btn.show-answer .opt-btn__key { background: var(--green-600); border-color: var(--green-600); color: #fff; }

.opt-btn.exam-selected { background: var(--brand-50); border-color: var(--brand-500); }
.opt-btn.exam-selected .opt-btn__key { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }

.solution-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid var(--border-default);
  color: var(--brand-600);
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--duration-fast);
}

.solution-trigger:hover { background: var(--brand-50); border-color: var(--brand-100); }

.solution-panel {
  margin-top: 14px;
  padding: 18px 22px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  border-left: 4px solid var(--brand-600);
  display: none;
  animation: slideDown 0.25s var(--ease-out);
}

.solution-panel.open { display: block; }

.solution-panel__label {
  font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.5px; color: var(--brand-600); margin-bottom: 10px;
}

.solution-panel__content { font-size: 14px; line-height: 1.85; color: var(--text-primary); }

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

.empty-state { text-align: center; padding: 64px 20px; }
.empty-state h3 { font-size: 18px; font-weight: 600; color: var(--text-primary); margin-bottom: 6px; }
.empty-state p { font-size: 14px; color: var(--text-tertiary); }

/* ==================== PAGINATION ==================== */
.pagination-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--bg-white);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: 16px 22px;
  margin-top: 24px;
  box-shadow: var(--shadow-card);
}

.pagination-info {
  font-size: 13.5px;
  color: var(--text-secondary);
  font-weight: 500;
}

.pagination-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.page-numbers {
  display: flex;
  align-items: center;
  gap: 4px;
}

.page-nav-btn {
  padding: 8px 14px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--bg-white);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
}
.page-nav-btn:hover:not(:disabled) {
  background: var(--bg-subtle);
  border-color: var(--border-focus);
}
.page-nav-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.page-num-btn {
  min-width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
}
.page-num-btn:hover {
  background: var(--bg-subtle);
  color: var(--text-primary);
}
.page-num-btn.active {
  background: var(--brand-600);
  color: var(--text-inverse);
  box-shadow: 0 2px 6px rgba(79, 70, 229, 0.3);
}

.page-ellipsis {
  padding: 0 4px;
  color: var(--text-tertiary);
  font-weight: 700;
}

/* ==================== STATS ==================== */
.metrics-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
  margin-bottom: 28px;
}

.metric-card {
  background: var(--bg-white);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  box-shadow: var(--shadow-card);
}

.metric-card__label {
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.8px;
  font-weight: 700; color: var(--text-tertiary); margin-bottom: 6px;
}

.metric-card__value { font-size: 32px; font-weight: 800; color: var(--text-primary); letter-spacing: -0.5px; }
.metric-card__value--success { color: var(--green-600); }
.metric-card__value--danger { color: var(--red-600); }

.progress-track { height: 6px; background: var(--bg-subtle); border-radius: 3px; overflow: hidden; margin-top: 10px; }
.progress-track__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--brand-600), var(--teal-600));
  border-radius: 3px;
  transition: width 0.6s var(--ease-out);
}

.review-section {
  background: var(--bg-white);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  box-shadow: var(--shadow-card);
}

.review-section__heading { font-size: 16px; font-weight: 700; color: var(--text-primary); margin-bottom: 18px; }

.review-item {
  padding: 14px 16px;
  background: var(--bg-subtle);
  border-radius: var(--radius-md);
  border-left: 3px solid var(--red-600);
  margin-bottom: 10px;
}
.review-item:last-child { margin-bottom: 0; }
.review-item__chapter { font-size: 12px; font-weight: 600; color: var(--brand-600); margin-bottom: 4px; }
.review-item__question { font-size: 14px; color: var(--text-primary); line-height: 1.7; }
.review-item__answer { font-size: 13px; color: var(--green-700); font-weight: 600; margin-top: 6px; }

.reset-btn {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 20px;
  background: transparent; border: 1px solid var(--border-default);
  color: var(--red-600); padding: 8px 16px; border-radius: var(--radius-sm);
  font-family: var(--font-sans); font-size: 13px; font-weight: 600; cursor: pointer;
  transition: all var(--duration-fast);
}
.reset-btn:hover { background: var(--red-50); border-color: var(--red-100); }

/* ==================== RESPONSIVE ==================== */
@media (max-width: 860px) {
  .theory-grid { grid-template-columns: 1fr; }
  .chapter-nav { position: static; }
  .site-header { flex-direction: column; align-items: flex-start; gap: 12px; }
  .main-nav { flex-direction: column; }
  .quiz-toolbar { flex-direction: column; align-items: stretch; }
  .formula-cards { grid-template-columns: 1fr; }
}
