:root {
  --primary-color: #336699;
  --primary-dark: #2a5580;
  --primary-light: #4d7aa6;
  --secondary-color: #f39c12;
  --accent-color: #e74c3c;
  --text-primary: #2c3e50;
  --text-secondary: #7f8c8d;
  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fa;
  --bg-tertiary: #ecf0f1;
  --border-color: #e9ecef;
  --shadow-light: 0 2px 10px rgba(0,0,0,0.1);
  --shadow-medium: 0 4px 20px rgba(0,0,0,0.15);
  --shadow-heavy: 0 8px 30px rgba(0,0,0,0.2);
  --gradient-primary: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  --gradient-hero: linear-gradient(135deg, rgba(51,102,153,0.95) 0%, rgba(42,85,128,0.95) 100%);
  --s1: #336699;
  --s2: #443399;
  --s3: #883399;
  --s4: #993366;
  --s5: #994433;
  --s6: #998833;
  --s7: #669933;
  --s8: #339944;
  --s9: #339988;
}

[data-theme="dark"] {
  --text-primary: #ecf0f1;
  --text-secondary: #bdc3c7;
  --bg-primary: #1a1a1a;
  --bg-secondary: #2c2c2c;
  --bg-tertiary: #3a3a3a;
  --border-color: #404040;
  --shadow-light: 0 2px 10px rgba(0,0,0,0.3);
  --shadow-medium: 0 4px 20px rgba(0,0,0,0.4);
  --shadow-heavy: 0 8px 30px rgba(0,0,0,0.5);
  --gradient-hero: linear-gradient(135deg, rgba(51,102,153,0.9) 0%, rgba(42,85,128,0.9) 100%);
  --s1: hsl(210 55% 62%);
  --s2: hsl(250 55% 62%);
  --s3: hsl(290 55% 62%);
  --s4: hsl(330 55% 62%);
  --s5: hsl(10 55% 62%);
  --s6: hsl(50 55% 62%);
  --s7: hsl(90 55% 62%);
  --s8: hsl(130 55% 62%);
  --s9: hsl(170 55% 62%);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-primary);
  transition: background 0.3s, color 0.3s;
  padding-top: 70px;
}

code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.88em;
  background: var(--bg-tertiary);
  padding: 0.1em 0.35em;
  border-radius: 3px;
  color: var(--primary-color);
}

[data-theme="dark"] code {
  background: var(--bg-tertiary);
  color: var(--s1);
}

/* Navbar */
.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
  z-index: 1000;
  transition: background 0.3s, border-color 0.3s;
}
[data-theme="dark"] .navbar { background: rgba(26,26,26,0.95); }

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
  gap: 1rem;
}

.nav-logo {
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--primary-color);
  text-decoration: none;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 0.25rem;
  align-items: center;
}

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.4rem 0.65rem;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
}
.nav-links a:hover, .nav-links a.active {
  color: var(--primary-color);
  background: var(--bg-secondary);
}

.theme-toggle {
  background: none;
  border: 2px solid var(--primary-color);
  color: var(--primary-color);
  padding: 0.5rem;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  width: 45px;
  height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s, transform 0.2s;
  flex-shrink: 0;
}
.theme-toggle:hover { background: var(--primary-color); color: #fff; transform: scale(1.1); }
.theme-toggle:focus-visible { outline: 2px solid var(--primary-light); outline-offset: 2px; }

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

/* Hero strip */
.hero-strip {
  background: var(--gradient-hero);
  color: #fff;
  text-align: center;
  padding: 2.5rem 1.5rem 2rem;
}
.hero-strip h1 { font-size: clamp(1.5rem, 4vw, 2.2rem); font-weight: 700; margin-bottom: 0.4rem; }
.hero-strip p { font-size: 1rem; opacity: 0.9; }

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

/* Readiness meter */
.readiness {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 2rem;
}
.readiness-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}
.readiness-label strong { color: var(--text-primary); }
.readiness-bar {
  height: 10px;
  background: var(--border-color);
  border-radius: 5px;
  overflow: hidden;
  margin-bottom: 0.75rem;
}
.readiness-fill {
  height: 100%;
  background: var(--gradient-primary);
  border-radius: 5px;
  transition: width 0.4s ease;
}
.readiness-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

/* Section tiles grid */
.section-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.section-tile {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--tile-color, var(--primary-color));
  border-radius: 10px;
  padding: 1.1rem 1rem;
  cursor: pointer;
  text-decoration: none;
  color: var(--text-primary);
  transition: box-shadow 0.2s, transform 0.2s;
  display: block;
}
.section-tile:hover { box-shadow: var(--shadow-medium); transform: translateY(-2px); }
.section-tile:focus-visible { outline: 2px solid var(--primary-light); outline-offset: 2px; }

.tile-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.6rem;
}
.tile-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--tile-color, var(--primary-color));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
}
.tile-num { font-size: 0.75rem; color: var(--text-secondary); font-weight: 600; }
.tile-title { font-size: 0.95rem; font-weight: 600; line-height: 1.3; }
.tile-count { font-size: 0.8rem; color: var(--text-secondary); margin-bottom: 0.6rem; }

.mini-bars { display: flex; flex-direction: column; gap: 0.3rem; }
.mini-bar-row { display: flex; align-items: center; gap: 0.5rem; font-size: 0.75rem; color: var(--text-secondary); }
.mini-bar-track {
  flex: 1;
  height: 5px;
  background: var(--border-color);
  border-radius: 3px;
  overflow: hidden;
}
.mini-bar-fill {
  height: 100%;
  background: var(--tile-color, var(--primary-color));
  border-radius: 3px;
  transition: width 0.4s ease;
}
.mini-bar-pct { width: 2.5rem; text-align: right; }

/* Exam history table */
.history-section { margin-top: 2rem; }
.history-section h2 { font-size: 1.1rem; margin-bottom: 0.75rem; color: var(--text-primary); }
.history-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.history-table th, .history-table td {
  padding: 0.5rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}
.history-table th { color: var(--text-secondary); font-weight: 600; }
.pass-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
}
.pass-badge.pass { background: #d4edda; color: #155724; }
.pass-badge.fail { background: #f8d7da; color: #721c24; }
[data-theme="dark"] .pass-badge.pass { background: #1a3a24; color: #7dd9a0; }
[data-theme="dark"] .pass-badge.fail { background: #3a1a1e; color: #f08080; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.1rem;
  border: none;
  border-radius: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  text-decoration: none;
  white-space: nowrap;
}
.btn:focus-visible { outline: 2px solid var(--primary-light); outline-offset: 2px; }

.btn-primary {
  background: var(--primary-color);
  color: #fff;
}
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: var(--shadow-light); }

.btn-secondary {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}
.btn-secondary:hover { background: var(--bg-tertiary); transform: translateY(-1px); }

.btn-ghost {
  background: transparent;
  color: var(--primary-color);
  border: 1px solid var(--primary-color);
}
.btn-ghost:hover { background: var(--primary-color); color: #fff; }

.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.82rem; }
.btn-lg { padding: 0.75rem 1.5rem; font-size: 1rem; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

/* Study view */
.study-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  gap: 1rem;
  flex-wrap: wrap;
}
.section-pill {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
  background: var(--pill-color, var(--primary-color));
}

.study-block {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.study-block h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.study-block h2 i { color: var(--primary-color); }

.takeaway-list, .trap-list { list-style: none; display: flex; flex-direction: column; gap: 0.6rem; }
.takeaway-list li, .trap-list li {
  padding: 0.6rem 0.75rem 0.6rem 2rem;
  background: var(--bg-primary);
  border-radius: 8px;
  border: 1px solid var(--border-color);
  font-size: 0.9rem;
  position: relative;
}
.takeaway-list li::before { content: "\2713"; position: absolute; left: 0.65rem; color: #27ae60; font-weight: 700; }
.trap-list li::before { content: "\26a0"; position: absolute; left: 0.65rem; color: var(--accent-color); }

.card-table { width: 100%; border-collapse: collapse; }
.card-table th, .card-table td {
  padding: 0.6rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.88rem;
  vertical-align: top;
}
.card-table th { color: var(--text-secondary); font-weight: 600; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.03em; }
.card-table tr:last-child td { border-bottom: none; }
.card-table td:first-child { width: 45%; }

/* Flashcard view */
.card-toolbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}
.chip {
  padding: 0.3rem 0.7rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  border: 2px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.chip:hover { border-color: var(--primary-color); color: var(--primary-color); }
.chip.active { background: var(--chip-color, var(--primary-color)); color: #fff; border-color: transparent; }
.chip:focus-visible { outline: 2px solid var(--primary-light); outline-offset: 2px; }

.card-counter {
  margin-left: auto;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.card-stage {
  perspective: 1200px;
  height: 320px;
  margin-bottom: 1.25rem;
}

@media (prefers-reduced-motion: reduce) {
  .flashcard { transition: opacity 0.25s; }
  .flashcard.flipped .card-front { opacity: 0; }
  .flashcard.flipped .card-back { opacity: 1; }
  .card-front, .card-back { transform: none !important; backface-visibility: visible !important; }
  .card-back { opacity: 0; position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
}

.flashcard {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.5s cubic-bezier(0.4,0,0.2,1);
  cursor: pointer;
}
.flashcard.flipped { transform: rotateY(180deg); }

.card-face {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  box-shadow: var(--shadow-medium);
}
.card-front {
  background: var(--gradient-primary);
  color: #fff;
  flex-direction: column;
  gap: 0.75rem;
}
.card-back {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  transform: rotateY(180deg);
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  overflow-y: auto;
}

.card-section-pill {
  align-self: flex-start;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  color: rgba(255,255,255,0.9);
  background: rgba(255,255,255,0.2);
}
.card-question {
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  font-weight: 600;
  text-align: center;
  line-height: 1.4;
}
.card-hint { font-size: 0.8rem; opacity: 0.75; }

.card-answer-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}
.card-answer {
  font-size: 0.95rem;
  line-height: 1.6;
}

.card-grade-row {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.btn-review { background: #e74c3c; color: #fff; }
.btn-review:hover { background: #c0392b; }
.btn-known { background: #27ae60; color: #fff; }
.btn-known:hover { background: #219a52; }

.card-nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.reset-confirm {
  display: none;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--accent-color);
  border-radius: 8px;
  margin-top: 1rem;
  font-size: 0.9rem;
}
.reset-confirm.visible { display: flex; flex-wrap: wrap; }

/* Quiz view */
.quiz-setup {
  max-width: 600px;
  margin: 0 auto;
}
.quiz-setup h2 { font-size: 1.3rem; margin-bottom: 1.25rem; }

.section-checklist {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}
.section-check-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 500;
  transition: border-color 0.15s, background 0.15s;
}
.section-check-label:has(input:checked) {
  border-color: var(--check-color, var(--primary-color));
  background: var(--bg-secondary);
}
.section-check-label input { accent-color: var(--check-color, var(--primary-color)); }

.count-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.count-btn {
  padding: 0.4rem 0.9rem;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.count-btn.active { border-color: var(--primary-color); background: var(--primary-color); color: #fff; }
.count-btn:focus-visible { outline: 2px solid var(--primary-light); outline-offset: 2px; }

.quiz-question-block {
  max-width: 700px;
  margin: 0 auto;
}
.quiz-progress-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}
.quiz-progress-bar {
  flex: 1;
  height: 6px;
  background: var(--border-color);
  border-radius: 3px;
  overflow: hidden;
}
.quiz-progress-fill {
  height: 100%;
  background: var(--gradient-primary);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.quiz-q-section { margin-bottom: 1rem; }
.quiz-q-text {
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.5;
  margin-bottom: 1.25rem;
}

.quiz-options { display: flex; flex-direction: column; gap: 0.6rem; margin-bottom: 1rem; }
.quiz-option {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border: 2px solid var(--border-color);
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.9rem;
  background: var(--bg-primary);
  transition: border-color 0.15s, background 0.15s;
  text-align: left;
  width: 100%;
  font-family: 'Inter', sans-serif;
  line-height: 1.4;
  color: var(--text-primary);
}
.quiz-option:hover:not(:disabled) { border-color: var(--primary-color); background: var(--bg-secondary); }
.quiz-option:focus-visible { outline: 2px solid var(--primary-light); outline-offset: 2px; }
.quiz-option.correct { border-color: #27ae60; background: #f0fff4; color: #155724; }
.quiz-option.wrong { border-color: var(--accent-color); background: #fff5f5; color: #721c24; }
[data-theme="dark"] .quiz-option.correct { background: #1a3a24; color: #7dd9a0; }
[data-theme="dark"] .quiz-option.wrong { background: #3a1a1e; color: #f08080; }

.option-letter {
  font-weight: 700;
  font-size: 0.85rem;
  min-width: 1.4rem;
  color: var(--text-secondary);
}
.quiz-option.correct .option-letter,
.quiz-option.wrong .option-letter { color: inherit; }

.quiz-feedback {
  padding: 0.85rem 1rem;
  border-radius: 8px;
  font-size: 0.88rem;
  line-height: 1.5;
  margin-bottom: 1rem;
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
}
.quiz-feedback.correct { border-color: #27ae60; background: #f0fff4; }
.quiz-feedback.wrong { border-color: var(--accent-color); background: #fff5f5; }
[data-theme="dark"] .quiz-feedback.correct { background: #1a3a24; }
[data-theme="dark"] .quiz-feedback.wrong { background: #3a1a1e; }

.quiz-end { max-width: 700px; margin: 0 auto; }
.score-display {
  text-align: center;
  padding: 2rem;
  background: var(--gradient-primary);
  color: #fff;
  border-radius: 14px;
  margin-bottom: 1.5rem;
}
.score-display .score-num { font-size: 3rem; font-weight: 700; line-height: 1; }
.score-display .score-label { font-size: 1rem; opacity: 0.85; margin-top: 0.3rem; }

.section-breakdown {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.6rem;
  margin-bottom: 1.5rem;
}
.breakdown-card {
  padding: 0.75rem 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--bc-color, var(--primary-color));
  border-radius: 8px;
  font-size: 0.85rem;
}
.breakdown-card .bc-title { font-weight: 600; margin-bottom: 0.25rem; }
.breakdown-card .bc-score { color: var(--text-secondary); }

/* Exam view */
.exam-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.exam-timer {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary-color);
  padding: 0.3rem 0.75rem;
  border: 2px solid var(--primary-color);
  border-radius: 8px;
}
.exam-timer.warning { color: var(--accent-color); border-color: var(--accent-color); }

.exam-end { max-width: 700px; margin: 0 auto; }
.exam-target {
  text-align: center;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.review-list { display: flex; flex-direction: column; gap: 0.75rem; margin-top: 1.5rem; }
.review-item {
  padding: 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--ri-color, var(--border-color));
  border-radius: 10px;
  font-size: 0.88rem;
}
.review-item.ri-correct { --ri-color: #27ae60; }
.review-item.ri-wrong { --ri-color: var(--accent-color); }
.review-item .ri-q { font-weight: 600; margin-bottom: 0.5rem; line-height: 1.4; }
.review-item .ri-row { display: flex; gap: 0.4rem; align-items: flex-start; margin-bottom: 0.25rem; }
.review-item .ri-label { font-weight: 600; min-width: 4rem; color: var(--text-secondary); font-size: 0.8rem; }
.review-item .ri-exp { margin-top: 0.4rem; color: var(--text-secondary); font-size: 0.85rem; }

.weak-sections {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}
.weak-badge {
  padding: 0.4rem 0.9rem;
  border-radius: 8px;
  background: #fff5f5;
  border: 1px solid var(--accent-color);
  color: #721c24;
  font-size: 0.85rem;
  font-weight: 600;
}
[data-theme="dark"] .weak-badge { background: #3a1a1e; color: #f08080; }

/* Timer setup row */
.timer-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
  flex-wrap: wrap;
}
.timer-row label { display: flex; align-items: center; gap: 0.4rem; cursor: pointer; }

/* Footer */
footer {
  margin-top: 4rem;
  padding: 1.5rem;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-secondary);
}
footer a { color: var(--primary-color); text-decoration: none; }
footer a:hover { text-decoration: underline; }

/* Mobile */
@media (max-width: 768px) {
  .nav-links { display: none; flex-direction: column; position: absolute; top: 70px; left: 0; right: 0; background: var(--bg-primary); border-bottom: 1px solid var(--border-color); padding: 1rem; gap: 0.25rem; }
  .nav-links.open { display: flex; }
  .hamburger { display: block; }
  .section-grid { grid-template-columns: 1fr; }
  .card-stage { height: 260px; }
  .card-face { padding: 1.25rem; }
  .card-question { font-size: 1rem; }
  .readiness-actions { flex-direction: column; }
  .readiness-actions .btn { width: 100%; justify-content: center; }
  .quiz-setup { max-width: 100%; }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .section-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Print stylesheet for Study view */
@media print {
  .navbar, footer, .study-nav .btn, .no-print { display: none !important; }
  body { padding-top: 0; color: #000; background: #fff; }
  .container { max-width: 100%; padding: 0; }
  .study-block { break-inside: avoid; border: 1px solid #ccc; }
  code { background: #f5f5f5; border: 1px solid #ddd; }
  a { color: #000; text-decoration: none; }
}
