:root {
  --bg: #f2f6ff;
  --ink: #0b0f1a;
  --navy: #0f234d;
  --blue: #1f4db8;
  --cyan: #13c2c2;
  --sky: #3ba6ff;
  --mint: #7cdb8a;
  --warning: #f2c94c;
  --danger: #ff6b6b;
  --panel: #ffffff;
  --soft: #e6eefb;
  --shadow: 0 10px 40px rgba(15, 35, 77, 0.12);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Space Grotesk", "IBM Plex Sans", "Segoe UI", sans-serif;
  color: var(--ink);
  background: radial-gradient(1200px 800px at 20% -10%, #dbe7ff 0%, rgba(219,231,255,0) 60%),
              radial-gradient(1000px 800px at 90% 0%, #d3f2ff 0%, rgba(211,242,255,0) 55%),
              var(--bg);
}

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

.bg-grid {
  position: fixed;
  inset: 0;
  background-image: linear-gradient(transparent 95%, rgba(31,77,184,0.08) 96%),
    linear-gradient(90deg, transparent 95%, rgba(31,77,184,0.08) 96%);
  background-size: 40px 40px;
  pointer-events: none;
  opacity: 0.4;
}

header.hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 32px;
  padding: 64px 8vw 32px;
  position: relative;
}

.badge {
  display: inline-block;
  padding: 6px 12px;
  border: 1px solid var(--blue);
  border-radius: 999px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--blue);
  background: #eef3ff;
}

h1 {
  font-size: clamp(36px, 5vw, 64px);
  margin: 16px 0 12px;
  color: var(--navy);
}

.subtitle {
  max-width: 520px;
  font-size: 18px;
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.btn {
  border: none;
  padding: 12px 20px;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn.primary {
  background: var(--blue);
  color: #fff;
  box-shadow: var(--shadow);
}

.btn.ghost {
  background: transparent;
  color: var(--blue);
  border: 1px solid var(--blue);
}

.btn.secondary {
  background: #f0f5ff;
  color: var(--blue);
  border: 1px solid var(--blue);
}

/* ==================== DEBUG MODE ==================== */
.debug-mode-toggle {
  position: fixed;
  top: 12px;
  right: 16px;
  z-index: 950;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 12px;
  box-shadow: var(--shadow);
}

.debug-mode-control {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
  cursor: pointer;
}

.debug-mode-control input {
  width: 16px;
  height: 16px;
}

body.teach-mode .debug-mode-toggle {
  top: 64px;
}

body:not(.debug-mode) .feedback-widget,
body:not(.debug-mode) .gen-vote,
body:not(.debug-mode) .generator-log,
body:not(.debug-mode) .feedback-tools {
  display: none !important;
}

/* ==================== FEEDBACK WIDGETS ==================== */
.feedback-widget {
  margin-top: 14px;
  padding: 12px;
  border-radius: 10px;
  border: 1px dashed var(--border);
  background: #f9fbff;
}

.feedback-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.feedback-btn {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 8px;
  padding: 6px 8px;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.2s ease;
}

.feedback-btn.active {
  border-color: var(--blue);
  background: #e7efff;
}

.feedback-label {
  font-size: 12px;
  color: #5a6782;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.feedback-comment {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 13px;
}

.feedback-status {
  margin-top: 8px;
  font-size: 12px;
  color: #5a6782;
}

.feedback-tools {
  margin-top: 32px;
}

.feedback-panel {
  background: var(--panel);
  border-radius: 16px;
  padding: 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.feedback-panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.feedback-panel-summary {
  font-size: 13px;
  color: #5a6782;
  margin-bottom: 10px;
}

.feedback-readme {
  border-top: 1px dashed var(--border);
  padding-top: 12px;
}

.feedback-readme summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--navy);
}

.feedback-readme-body {
  margin-top: 10px;
  font-size: 13px;
  color: #4c5b7a;
}

.feedback-readme-body ol {
  margin: 8px 0 8px 18px;
}

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

.card {
  background: var(--panel);
  border-radius: 18px;
  padding: 20px;
  box-shadow: var(--shadow);
}

.card.glow {
  border: 1px solid rgba(31, 77, 184, 0.2);
}

.card.mini {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
}

.metric {
  background: var(--soft);
  border-radius: 12px;
  padding: 12px;
}

.metric .label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #415072;
}

.metric .value {
  display: block;
  font-size: 20px;
  font-weight: 700;
}

section {
  padding: 32px 8vw;
}

.section-head h2 {
  margin-bottom: 8px;
  font-size: clamp(24px, 4vw, 36px);
  color: var(--navy);
}

.section-head p {
  max-width: 680px;
}

.track-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
  margin-top: 24px;
}

.track-card {
  background: var(--panel);
  border: 1px solid rgba(31, 77, 184, 0.2);
  border-radius: 16px;
  padding: 18px;
  text-align: left;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease;
  animation: fadeUp 0.5s ease both;
}

.track-card:hover {
  transform: translateY(-3px);
  border-color: var(--blue);
}

.track-card.active {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(19, 194, 194, 0.2);
}

.track-card .tag {
  display: inline-block;
  margin-top: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #eef9ff;
  color: var(--blue);
  font-size: 12px;
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
  margin-top: 24px;
}

.module-card {
  background: var(--panel);
  border-radius: 16px;
  padding: 18px;
  border-left: 4px solid var(--blue);
  box-shadow: var(--shadow);
  animation: fadeUp 0.6s ease both;
}

.module-card.clickable {
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.module-card.clickable:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 50px rgba(15, 35, 77, 0.18);
  border-color: var(--blue);
}

.module-icon {
  font-size: 28px;
  margin-bottom: 8px;
}

.module-card .module-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
}

.module-card .start-btn {
  color: var(--blue);
  font-weight: 600;
}

.module-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #4c5b7a;
}

.visual-grid, .tree-grid, .quiz-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 24px;
}

.visual-card {
  background: var(--panel);
  border-radius: 16px;
  padding: 16px;
  box-shadow: var(--shadow);
  animation: fadeUp 0.6s ease both;
}

.visual-card img {
  width: 100%;
  height: auto;
  display: block;
}

.tree-card {
  background: var(--panel);
  border-radius: 16px;
  padding: 16px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(31, 77, 184, 0.18);
  animation: fadeUp 0.6s ease both;
}

.tree-card h3 {
  margin-top: 0;
}

.tree-output {
  padding: 12px;
  background: #f1f6ff;
  border-radius: 12px;
  min-height: 120px;
}

.choice-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.choice-list button {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(31,77,184,0.3);
  background: #fff;
  cursor: pointer;
}

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

.quiz-card {
  background: var(--panel);
  border-radius: 16px;
  padding: 16px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(31,77,184,0.15);
  animation: fadeUp 0.6s ease both;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.quiz-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 50px rgba(15, 35, 77, 0.18);
}

.quiz-card img {
  width: 100%;
  border-radius: 10px;
  border: 1px solid #d7e2f8;
}

.quiz-options {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.quiz-options button {
  padding: 10px;
  border-radius: 10px;
  border: 1px solid rgba(31,77,184,0.3);
  background: #fff;
  cursor: pointer;
}

.quiz-options button.correct {
  border-color: var(--mint);
  background: rgba(124, 219, 138, 0.15);
}

.quiz-options button.incorrect {
  border-color: var(--danger);
  background: rgba(255, 107, 107, 0.12);
}

.quiz-feedback {
  margin-top: 10px;
  font-size: 14px;
}

footer {
  display: flex;
  justify-content: space-between;
  padding: 24px 8vw 40px;
  color: #4c5b7a;
  font-size: 14px;
}

/* ==================== MODULE MODAL & LESSONS ==================== */
.module-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 1000;
  overflow-y: auto;
  padding: 40px 20px;
}

.module-modal.visible {
  display: block;
  animation: fadeIn 0.3s ease;
}

.module-modal-content {
  max-width: 900px;
  margin: 0 auto;
  background: var(--panel);
  border-radius: 20px;
  padding: 32px;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: var(--soft);
  color: var(--ink);
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.modal-close:hover {
  background: #dce4f5;
}

.module-header {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 2px solid var(--soft);
}

.module-icon-large {
  font-size: 48px;
}

.module-header h2 {
  margin: 0 0 4px;
  color: var(--navy);
}

.module-header p {
  margin: 0;
  color: #5a6782;
}

.lesson-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--soft);
}

.lesson-nav-btn {
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.lesson-nav-btn:hover {
  border-color: var(--blue);
}

.lesson-nav-btn.active {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}

.lesson-section {
  margin-bottom: 32px;
  scroll-margin-top: 20px;
}

.lesson-section h3 {
  color: var(--navy);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--blue);
}

.section-content {
  line-height: 1.7;
}

.section-content ul, .section-content ol {
  margin: 12px 0 12px 24px;
}

.section-content li {
  margin-bottom: 8px;
}

.section-content p {
  margin-bottom: 14px;
}

/* Lesson Content Components */
.step-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin: 20px 0;
}

.step-cards.vertical {
  grid-template-columns: 1fr;
}

.step-card {
  background: var(--soft);
  border-radius: 12px;
  padding: 16px;
  border-left: 4px solid var(--blue);
}

.step-card .step-num {
  width: 32px;
  height: 32px;
  background: var(--blue);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  margin-bottom: 10px;
}

.step-card h4 {
  margin: 0 0 8px;
  color: var(--navy);
}

.step-card p {
  margin: 0;
  font-size: 14px;
}

.key-point {
  background: #e3f2fd;
  border-left: 4px solid var(--blue);
  padding: 14px 18px;
  border-radius: 8px;
  margin: 16px 0;
}

.warning-box {
  background: #fff3e0;
  border-left: 4px solid #ff9800;
  padding: 14px 18px;
  border-radius: 8px;
  margin: 16px 0;
}

.rhythm-card {
  background: #f8faff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
  margin: 16px 0;
}

.rhythm-card.danger {
  background: #fff5f5;
  border-color: var(--danger);
}

.rhythm-card h4 {
  margin: 0 0 12px;
  color: var(--navy);
}

.management-box {
  background: #e8f5e9;
  border-left: 4px solid #4caf50;
  padding: 14px 18px;
  border-radius: 8px;
  margin: 16px 0;
}

.management-box.danger {
  background: #ffebee;
  border-color: var(--danger);
}

.management-box h4 {
  margin: 0 0 10px;
  color: #2e7d32;
}

.management-box.danger h4 {
  color: #c62828;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 14px;
}

.data-table th, .data-table td {
  padding: 10px 14px;
  border: 1px solid var(--border);
  text-align: left;
}

.data-table th {
  background: var(--soft);
  color: var(--navy);
  font-weight: 600;
}

.data-table.compare tr td:first-child {
  font-weight: 600;
  background: #fafbff;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin: 16px 0;
}

.pathway-visual {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin: 20px 0;
  padding: 20px;
  background: #f8faff;
  border-radius: 12px;
}

.pathway-step {
  display: flex;
  align-items: center;
  gap: 12px;
}

.node-badge {
  background: var(--soft);
  padding: 8px 14px;
  border-radius: 8px;
  font-weight: 600;
}

.node-badge.sa { background: #e8f5e9; color: #2e7d32; }
.node-badge.av { background: #fff3e0; color: #e65100; }
.node-badge.pk { background: #fce4ec; color: #c2185b; }

.pathway-step .rate {
  font-size: 12px;
  color: #5a6782;
}

.pathway-step .delay {
  font-size: 11px;
  background: #fff3e0;
  color: #e65100;
  padding: 2px 8px;
  border-radius: 4px;
}

.pathway-step .ecg {
  font-size: 12px;
  background: #e3f2fd;
  color: var(--blue);
  padding: 2px 8px;
  border-radius: 4px;
}

.pathway-arrow {
  font-size: 20px;
  color: var(--blue);
}

.module-img {
  width: 100%;
  max-width: 600px;
  border-radius: 10px;
  border: 1px solid var(--border);
  margin: 16px 0;
}

.module-img.zoomable {
  cursor: zoom-in;
  transition: transform 0.2s ease;
}

.module-img.zoomable:hover {
  transform: scale(1.02);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin: 16px 0;
}

.info-card {
  background: #f8faff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}

.info-card h4 {
  margin: 0 0 10px;
  color: var(--navy);
}

.malfunction-grid {
  display: grid;
  gap: 16px;
  margin: 16px 0;
}

.malfunction-card {
  background: #fff5f5;
  border: 1px solid var(--danger);
  border-radius: 12px;
  padding: 16px;
}

.malfunction-card h4 {
  margin: 0 0 8px;
  color: #c62828;
}

.checklist {
  background: #e8f5e9;
  border-radius: 12px;
  padding: 16px;
  margin: 16px 0;
}

.check-item {
  padding: 8px 0;
  border-bottom: 1px solid rgba(76, 175, 80, 0.2);
}

.check-item:last-child {
  border-bottom: none;
}

.method-card {
  background: #f8faff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}

.method-card h4 {
  margin: 0 0 8px;
  color: var(--navy);
}

.method-card .example {
  font-style: italic;
  color: var(--blue);
  margin-top: 10px;
}

/* Module Quiz Styles */
.module-quiz-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 16px;
}

.module-quiz-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}

.module-quiz-card img {
  width: 100%;
  border-radius: 8px;
  margin-bottom: 12px;
}

.module-quiz-card h4 {
  margin: 0 0 12px;
  font-size: 15px;
}

.module-quiz-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.module-quiz-opt {
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
}

.module-quiz-opt:hover:not(:disabled) {
  border-color: var(--blue);
  background: #f8faff;
}

.module-quiz-opt.correct {
  background: rgba(124, 219, 138, 0.2);
  border-color: var(--mint);
}

.module-quiz-opt.incorrect {
  background: rgba(255, 107, 107, 0.15);
  border-color: var(--danger);
}

.module-quiz-feedback {
  display: none;
  margin-top: 12px;
  padding: 12px;
  background: #f0f7ff;
  border-radius: 8px;
  font-size: 14px;
}

.module-quiz-feedback.visible {
  display: block;
}

/* Responsive */
@media (max-width: 720px) {
  .module-modal-content {
    padding: 20px;
    margin: 0 10px;
  }

  .two-col {
    grid-template-columns: 1fr;
  }

  .lesson-nav {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 12px;
  }

  .lesson-nav-btn {
    white-space: nowrap;
  }
}

/* ==================== PROGRESS TRACKING ==================== */
.progress-panel {
  background: var(--panel);
  border-radius: 14px;
  padding: 16px;
  margin-top: 16px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(31, 77, 184, 0.15);
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.progress-header h4 {
  margin: 0;
  font-size: 14px;
  color: var(--navy);
}

.reset-progress-btn {
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid #ccc;
  background: #f5f5f5;
  color: #666;
  font-size: 11px;
  cursor: pointer;
}

.reset-progress-btn:hover {
  background: #eee;
}

.progress-bar-container {
  height: 8px;
  background: var(--soft);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--blue) 0%, var(--cyan) 100%);
  border-radius: 4px;
  transition: width 0.5s ease;
}

.progress-text {
  font-size: 12px;
  color: #5a6782;
  margin: 0 0 10px;
}

.review-missed-btn {
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  border: 2px solid var(--danger);
  background: rgba(255, 107, 107, 0.1);
  color: var(--danger);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.review-missed-btn:hover {
  background: rgba(255, 107, 107, 0.2);
}

.completion-check {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: bold;
}

.completion-check.correct {
  background: var(--mint);
  color: #1b5e20;
}

.completion-check.incorrect {
  background: rgba(255, 107, 107, 0.3);
  color: #c62828;
}

.quiz-card {
  position: relative;
}

.filter-btn.missed {
  border-color: var(--danger);
}

.filter-btn.missed.active {
  background: var(--danger);
  color: #fff;
}

/* ==================== QUIZ FILTERS ==================== */
.quiz-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
  margin-bottom: 8px;
}

.filter-btn {
  padding: 8px 14px;
  border-radius: 999px;
  border: 2px solid var(--blue);
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-btn:hover {
  background: var(--soft);
}

.filter-btn.active {
  background: var(--blue);
  color: #fff;
}

/* Difficulty Toggles */
.filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.difficulty-toggles {
  margin-left: 16px;
  padding-left: 16px;
  border-left: 1px solid var(--soft);
}

.difficulty-toggle {
  padding: 8px 14px;
  border-radius: 999px;
  border: 2px solid;
  background: #fff;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  opacity: 0.5;
}

.difficulty-toggle.basic {
  border-color: #2e7d32;
  color: #2e7d32;
}

.difficulty-toggle.intermediate {
  border-color: #e65100;
  color: #e65100;
}

.difficulty-toggle.advanced {
  border-color: #c2185b;
  color: #c2185b;
}

.difficulty-toggle.active {
  opacity: 1;
}

.difficulty-toggle.basic.active {
  background: #e8f5e9;
}

.difficulty-toggle.intermediate.active {
  background: #fff3e0;
}

.difficulty-toggle.advanced.active {
  background: #fce4ec;
}

.difficulty-toggle:hover {
  opacity: 0.85;
}

@media (max-width: 720px) {
  .difficulty-toggles {
    margin-left: 0;
    padding-left: 0;
    border-left: none;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--soft);
  }
}

/* ==================== QUIZ ENHANCEMENTS ==================== */
.quiz-badges {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.difficulty-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.difficulty-badge.basic {
  background: #e8f5e9;
  color: #2e7d32;
}

.difficulty-badge.intermediate {
  background: #fff3e0;
  color: #e65100;
}

.difficulty-badge.advanced {
  background: #fce4ec;
  color: #c2185b;
}

.category-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  color: #fff;
}

.quiz-feedback {
  display: none;
  padding: 12px;
  background: #f0f7ff;
  border-radius: 8px;
  border-left: 3px solid var(--blue);
}

.quiz-feedback.visible {
  display: block;
}

.explain-btn {
  margin-top: 10px;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--blue);
  background: transparent;
  color: var(--blue);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.explain-btn:hover {
  background: var(--soft);
}

.quiz-rationale {
  display: none;
  margin-top: 10px;
  padding: 12px;
  background: #fffbf0;
  border-radius: 8px;
  border-left: 3px solid var(--warning);
  font-size: 14px;
  line-height: 1.5;
}

.quiz-rationale.visible {
  display: block;
}

/* ==================== TREE ENHANCEMENTS ==================== */
.tree-reset {
  margin-top: 12px;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid #ccc;
  background: #f5f5f5;
  color: #666;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tree-reset:hover {
  background: #eee;
  border-color: #999;
}

.end-badge {
  background: var(--mint);
  color: #1b5e20;
  border: none;
}

/* ==================== CLINICAL SCENARIOS ==================== */
.scenario-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 24px;
  margin-top: 24px;
}

.scenario-card {
  background: var(--panel);
  border-radius: 18px;
  padding: 24px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(31, 77, 184, 0.15);
  animation: fadeUp 0.6s ease both;
}

.scenario-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.scenario-header h3 {
  margin: 0;
  color: var(--navy);
}

.scenario-setting {
  font-size: 14px;
  color: #5a6782;
  margin-bottom: 12px;
  font-style: italic;
}

.scenario-vitals {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px;
  background: #f8faff;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 12px;
}

.scenario-vitals span {
  white-space: nowrap;
}

.scenario-presentation {
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 16px;
}

.scenario-strip {
  width: 100%;
  border-radius: 10px;
  border: 1px solid #d7e2f8;
  margin-bottom: 16px;
}

.scenario-start-btn {
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  border: none;
  background: var(--blue);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.scenario-start-btn:hover {
  background: var(--navy);
  transform: translateY(-2px);
}

.scenario-questions {
  margin-top: 16px;
}

.scenario-question {
  animation: fadeUp 0.3s ease both;
}

.question-number {
  font-size: 12px;
  color: #5a6782;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 8px;
}

.question-text {
  font-size: 16px;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 16px;
}

.scenario-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.scenario-options button {
  padding: 14px 16px;
  border-radius: 10px;
  border: 2px solid rgba(31, 77, 184, 0.25);
  background: #fff;
  text-align: left;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.scenario-options button:hover:not(:disabled) {
  border-color: var(--blue);
  background: #f8faff;
}

.scenario-options button.correct {
  border-color: var(--mint);
  background: rgba(124, 219, 138, 0.15);
}

.scenario-options button.incorrect {
  border-color: var(--danger);
  background: rgba(255, 107, 107, 0.12);
}

.scenario-explanation {
  display: none;
  margin-top: 14px;
  padding: 14px;
  background: #f0f7ff;
  border-radius: 10px;
  border-left: 4px solid var(--blue);
  font-size: 14px;
  line-height: 1.5;
}

.scenario-explanation.visible {
  display: block;
}

.scenario-next-btn {
  margin-top: 16px;
  padding: 12px 24px;
  border-radius: 10px;
  border: none;
  background: var(--cyan);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.scenario-next-btn:hover {
  background: #0fa8a8;
}

.scenario-debrief {
  display: none;
  margin-top: 20px;
  padding: 20px;
  background: linear-gradient(135deg, #f0f7ff 0%, #e8f4ff 100%);
  border-radius: 14px;
  border: 1px solid rgba(31, 77, 184, 0.2);
}

.scenario-debrief.visible {
  display: block;
  animation: fadeUp 0.4s ease both;
}

.scenario-debrief h4 {
  margin: 0 0 12px;
  color: var(--navy);
}

.scenario-debrief h5 {
  margin: 16px 0 10px;
  color: var(--blue);
}

.scenario-debrief ul {
  margin: 0;
  padding-left: 20px;
}

.scenario-debrief li {
  margin-bottom: 6px;
  line-height: 1.5;
}

/* ==================== IMAGE ZOOM MODAL ==================== */
.zoom-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 1000;
  padding: 40px;
  cursor: zoom-out;
}

.zoom-modal.visible {
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.zoom-modal-content {
  position: relative;
  max-width: 95vw;
  max-height: 90vh;
}

.zoom-modal-content img {
  max-width: 100%;
  max-height: 85vh;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.zoom-close {
  position: absolute;
  top: -40px;
  right: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: #fff;
  color: #333;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.zoom-close:hover {
  background: #f0f0f0;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 720px) {
  header.hero { padding-top: 40px; }
  .hero-actions { flex-direction: column; align-items: flex-start; }
  footer { flex-direction: column; gap: 8px; }

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

  .scenario-vitals {
    flex-direction: column;
    gap: 6px;
  }

  .quiz-filters {
    justify-content: flex-start;
  }

  .filter-btn {
    font-size: 12px;
    padding: 6px 10px;
  }
}

/* ==================== TEACH MODE ==================== */
.teach-mode-bar {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: linear-gradient(135deg, var(--navy) 0%, #1a3a6e 100%);
  color: #fff;
  padding: 12px 24px;
  z-index: 900;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

body.teach-mode .teach-mode-bar {
  display: flex;
}

body.teach-mode {
  padding-top: 52px;
}

.teach-mode-bar button {
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: transparent;
  color: #fff;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.2s;
}

.teach-mode-bar button:hover {
  background: rgba(255, 255, 255, 0.15);
}

.teach-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  background: linear-gradient(135deg, var(--navy) 0%, #1a3a6e 100%);
  color: #fff;
  border: none !important;
}

.teach-toggle:hover {
  opacity: 0.9;
}

.teach-icon {
  font-size: 16px;
}

/* Teach Mode Typography Scaling */
body.teach-mode {
  font-size: 18px;
}

body.teach-mode h1 {
  font-size: clamp(48px, 6vw, 80px);
}

body.teach-mode h2 {
  font-size: clamp(32px, 5vw, 48px);
}

body.teach-mode h3 {
  font-size: clamp(24px, 4vw, 32px);
}

body.teach-mode .subtitle {
  font-size: 22px;
}

body.teach-mode .quiz-card h4,
body.teach-mode .question-text {
  font-size: 22px;
}

body.teach-mode .quiz-options button,
body.teach-mode .scenario-options button,
body.teach-mode .choice-list button {
  font-size: 18px;
  padding: 16px 20px;
}

body.teach-mode .quiz-feedback,
body.teach-mode .scenario-explanation {
  font-size: 18px;
}

body.teach-mode .tree-output {
  font-size: 20px;
  min-height: 160px;
  padding: 20px;
}

/* Teach Mode Quiz Reveal */
body.teach-mode .quiz-card .quiz-options,
body.teach-mode .scenario-options {
  position: relative;
}

body.teach-mode .quiz-card:not(.revealed) .quiz-options::after,
body.teach-mode .scenario-question:not(.revealed) .scenario-options::after {
  content: "Click 'Reveal Options' to show answers";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #f0f4ff 0%, #e8f0ff 100%);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: var(--blue);
  font-weight: 500;
  border: 2px dashed var(--blue);
}

body.teach-mode .quiz-card:not(.revealed) .quiz-options button,
body.teach-mode .scenario-question:not(.revealed) .scenario-options button {
  visibility: hidden;
}

.reveal-btn {
  display: none;
  margin-top: 12px;
  padding: 12px 20px;
  border-radius: 10px;
  border: 2px solid var(--blue);
  background: var(--blue);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.reveal-btn:hover {
  background: var(--navy);
  border-color: var(--navy);
}

body.teach-mode .reveal-btn {
  display: block;
}

body.teach-mode .quiz-card.revealed .reveal-btn {
  display: none;
}

/* Teach Mode Strip Viewer */
body.teach-mode .quiz-card img,
body.teach-mode .scenario-strip {
  cursor: zoom-in;
  transition: transform 0.2s ease;
}

body.teach-mode .quiz-card img:hover,
body.teach-mode .scenario-strip:hover {
  transform: scale(1.02);
}

/* Teach Mode Simplified Navigation */
body.teach-mode .quiz-filters {
  font-size: 16px;
}

body.teach-mode .filter-btn {
  padding: 12px 20px;
  font-size: 15px;
}

/* ==================== ECG GENERATOR ==================== */
.generator-container {
  background: var(--panel);
  border-radius: 18px;
  padding: 24px;
  box-shadow: var(--shadow);
  margin-top: 24px;
}

.generator-controls {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.generator-controls select {
  padding: 12px 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 14px;
  min-width: 200px;
  cursor: pointer;
}

/* Rhythm Category Toggles */
.rhythm-category-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
  padding: 16px;
  background: #f8faff;
  border-radius: 12px;
  border: 1px solid var(--soft);
}

.category-checkbox {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--soft);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.category-checkbox:hover {
  border-color: var(--blue);
  background: #f0f5ff;
}

.category-checkbox:has(input:checked) {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}

.category-checkbox input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #fff;
}

.generator-display {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  border: 1px solid var(--border);
  margin-bottom: 20px;
  overflow-x: auto;
}

#ecg-canvas {
  display: block;
  margin: 0 auto;
  background: #ffeef0;
  border-radius: 8px;
}

.generator-quiz {
  background: #f8faff;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
}

.generator-quiz h4 {
  margin: 0 0 16px;
  color: var(--navy);
}

.gen-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
}

.gen-opt-btn {
  padding: 12px 16px;
  border-radius: 10px;
  border: 2px solid var(--border);
  background: #fff;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}

.gen-opt-btn:hover:not(:disabled) {
  border-color: var(--blue);
  background: #f0f5ff;
}

.gen-opt-btn.correct {
  border-color: var(--mint);
  background: rgba(124, 219, 138, 0.2);
}

.gen-opt-btn.incorrect {
  border-color: var(--danger);
  background: rgba(255, 107, 107, 0.15);
}

.gen-feedback {
  margin-top: 16px;
  padding: 12px;
  border-radius: 8px;
  font-weight: 600;
}

.gen-feedback:empty {
  display: none;
}

.gen-feedback.correct {
  background: #e8f5e9;
  color: #2e7d32;
}

.gen-feedback.incorrect {
  background: #ffebee;
  color: #c62828;
}

.gen-info {
  margin-top: 16px;
  padding: 14px;
  background: #fff;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.gen-info p {
  margin: 6px 0;
}

.gen-vote {
  margin-top: 14px;
  padding: 14px;
  background: #fff;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.gen-vote-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.gen-vote-note label {
  display: block;
  font-size: 12px;
  color: #5a6782;
  margin-bottom: 6px;
}

.gen-vote-note input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 14px;
}

.gen-vote-status {
  margin-top: 10px;
  font-size: 13px;
  color: #5a6782;
}

.generator-stats {
  display: flex;
  gap: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  color: #5a6782;
  font-size: 14px;
}

.generator-stats strong {
  color: var(--navy);
}

.generator-log {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.generator-log-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.generator-log-summary {
  font-size: 13px;
  color: #5a6782;
}

/* ==================== PRESENTATION MODE ==================== */
.presentation-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #0f234d 0%, #1a3a6e 100%);
  z-index: 1100;
  flex-direction: column;
  outline: none;
}

.presentation-modal.visible {
  display: flex;
}

/* Compact header - auto-hides unless mouse near top */
.presentation-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
  background: rgba(0, 0, 0, 0.6);
  z-index: 10;
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* Invisible hover zone at top of screen */
.presentation-header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  z-index: -1;
}

.presentation-header:hover,
.presentation-header:focus-within {
  opacity: 1;
}

.presentation-title {
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  opacity: 0.9;
}

.exit-presentation {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: transparent;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.exit-presentation:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.5);
}

/* Slide content fills viewport */
.slide-content {
  flex: 1;
  overflow: hidden;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.slide {
  max-width: min(98vw, 1400px);
  max-height: calc(100vh - 80px);
  width: 100%;
  background: #fff;
  border-radius: 12px;
  padding: clamp(16px, 2.5vw, 28px);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  animation: slideIn 0.3s ease;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

/* Images in slides */
.slide-body img,
.slide-body .module-img {
  max-width: 100%;
  max-height: 40vh;
  width: auto;
  height: auto;
  display: block;
  margin: 12px auto;
  border-radius: 8px;
}

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

.slide-title {
  color: var(--navy);
  font-size: clamp(22px, 3vw, 28px);
  margin: 0 0 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--blue);
  flex-shrink: 0;
}

.slide-body {
  font-size: clamp(15px, 2vw, 18px);
  line-height: 1.6;
  flex: 1;
  overflow-y: auto;
}

.slide-body ul, .slide-body ol {
  margin: 10px 0 10px 24px;
}

.slide-body li {
  margin-bottom: 8px;
}

.slide-body .step-cards {
  gap: 12px;
}

.slide-body .step-card {
  padding: 14px;
}

.slide-body .data-table {
  font-size: clamp(13px, 1.5vw, 16px);
}

.slide-body .data-table th,
.slide-body .data-table td {
  padding: 10px 14px;
}

.slide-body .key-point,
.slide-body .warning-box,
.slide-body .management-box {
  padding: 12px 16px;
  font-size: clamp(13px, 1.6vw, 15px);
}

/* Pathway visual in slides */
.slide-body .pathway-visual {
  padding: 12px;
  margin: 12px 0;
  gap: 2px;
}

.slide-body .pathway-step {
  gap: 8px;
}

.slide-body .pathway-arrow {
  font-size: 14px;
  color: #999;
}

/* Two column in slides */
.slide-body .two-col {
  gap: 16px;
  margin: 12px 0;
}

/* Rhythm cards in slides */
.slide-body .rhythm-card {
  padding: 12px;
  margin: 10px 0;
}

.slide-body .rhythm-card h4 {
  font-size: clamp(13px, 1.6vw, 15px);
  margin-bottom: 8px;
}

.slide-body .rhythm-card ul {
  margin: 6px 0 6px 16px;
}

/* Compact bottom nav */
.slide-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  padding: 8px 16px;
  background: rgba(0, 0, 0, 0.4);
}

.prev-slide, .next-slide {
  padding: 8px 20px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: transparent;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.prev-slide:hover:not(:disabled),
.next-slide:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.5);
}

.prev-slide:disabled,
.next-slide:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.slide-indicator {
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
  font-weight: 500;
  min-width: 60px;
  text-align: center;
}

/* Compact thumbnails - hidden by default, show on hover */
.slide-thumbnails {
  display: flex;
  justify-content: center;
  gap: 4px;
  padding: 6px 12px;
  background: rgba(0, 0, 0, 0.5);
  overflow-x: auto;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.3s ease, opacity 0.3s ease, padding 0.3s ease;
}

.presentation-modal:hover .slide-thumbnails,
.slide-thumbnails:focus-within {
  max-height: 50px;
  opacity: 1;
  padding: 6px 12px;
}

.slide-thumbnail {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.slide-thumbnail:hover {
  border-color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.1);
}

.slide-thumbnail.active {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

/* Practice slide styles */
.practice-slide {
  text-align: center;
}

.practice-slide-img {
  max-width: 100%;
  max-height: clamp(150px, 30vh, 250px);
  border-radius: 8px;
  border: 1px solid var(--soft);
  margin-bottom: 16px;
  cursor: zoom-in;
}

.practice-slide h3 {
  font-size: clamp(16px, 2.5vw, 20px);
  color: var(--navy);
  margin-bottom: 16px;
}

.practice-slide-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  max-width: 700px;
  margin: 0 auto;
}

.practice-slide-opt {
  padding: 12px 16px;
  border-radius: 8px;
  border: 2px solid rgba(31, 77, 184, 0.3);
  background: #fff;
  font-size: clamp(14px, 1.8vw, 16px);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}

.practice-slide-opt:hover:not(:disabled) {
  border-color: var(--blue);
  background: #f8faff;
}

.practice-slide-opt.correct {
  border-color: var(--mint);
  background: rgba(124, 219, 138, 0.2);
}

.practice-slide-opt.incorrect {
  border-color: var(--danger);
  background: rgba(255, 107, 107, 0.15);
}

.practice-slide-feedback {
  display: none;
  margin-top: 16px;
  padding: 14px;
  background: #f0f7ff;
  border-radius: 8px;
  border-left: 3px solid var(--blue);
  font-size: clamp(13px, 1.6vw, 15px);
  text-align: left;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.practice-slide-feedback.visible {
  display: block;
}

/* Present button in module header */
.present-btn {
  margin-left: auto;
}

/* Presentation header controls */
.presentation-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.presentation-control-btn {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.presentation-control-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.5);
  color: #fff;
}

.presentation-control-btn.active {
  background: rgba(255, 255, 255, 0.2);
  border-color: var(--blue);
  color: #fff;
}

.control-icon {
  font-family: inherit;
  line-height: 1;
  font-size: 12px;
}

/* Fit-to-screen mode - compact with scroll fallback */
.presentation-modal.fit-to-screen .slide-content {
  padding: 4px 12px;
}

.presentation-modal.fit-to-screen .slide {
  max-height: calc(100vh - 60px);
  padding: clamp(12px, 2vw, 20px);
}

.presentation-modal.fit-to-screen .slide-title {
  font-size: clamp(16px, 2.2vw, 22px);
  margin-bottom: 10px;
  padding-bottom: 6px;
}

.presentation-modal.fit-to-screen .slide-body {
  font-size: clamp(12px, 1.6vw, 15px);
  line-height: 1.45;
}

.presentation-modal.fit-to-screen .slide-body ul,
.presentation-modal.fit-to-screen .slide-body ol {
  margin: 6px 0 6px 18px;
}

.presentation-modal.fit-to-screen .slide-body li {
  margin-bottom: 3px;
}

.presentation-modal.fit-to-screen .slide-body img,
.presentation-modal.fit-to-screen .slide-body .module-img {
  max-height: 30vh;
  margin: 8px auto;
}

.presentation-modal.fit-to-screen .slide-body .data-table {
  font-size: clamp(10px, 1.2vw, 13px);
}

.presentation-modal.fit-to-screen .slide-body .data-table th,
.presentation-modal.fit-to-screen .slide-body .data-table td {
  padding: 5px 8px;
}

.presentation-modal.fit-to-screen .slide-body .key-point,
.presentation-modal.fit-to-screen .slide-body .warning-box,
.presentation-modal.fit-to-screen .slide-body .management-box {
  padding: 8px 12px;
  font-size: clamp(11px, 1.4vw, 13px);
}

.presentation-modal.fit-to-screen .slide-body .step-cards {
  gap: 6px;
}

.presentation-modal.fit-to-screen .slide-body .step-card {
  padding: 8px;
}

.presentation-modal.fit-to-screen .practice-slide-img {
  max-height: 25vh;
}

.presentation-modal.fit-to-screen .practice-slide-options {
  gap: 6px;
}

.presentation-modal.fit-to-screen .practice-slide-opt {
  padding: 8px 12px;
  font-size: clamp(11px, 1.4vw, 13px);
}

/* Hide thumbnails completely in fit mode */
.presentation-modal.fit-to-screen .slide-thumbnails {
  display: none;
}

/* ==================== PRESENTATION SLIDE STYLES ==================== */
/* These are optimized for projection with large, readable content */

.pres-centered {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 40vh;
}

.pres-big {
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 700;
  color: var(--navy);
  margin: 0;
  line-height: 1.2;
}

.pres-emphasis {
  color: var(--blue);
}

.pres-danger {
  color: var(--danger) !important;
}

.pres-subtitle {
  font-size: clamp(18px, 2.5vw, 28px);
  color: #5a6782;
  margin-top: 16px;
}

/* Numbered point (for step-by-step) */
.pres-point {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 24px;
}

.pres-num {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  color: white;
  font-size: 42px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pres-num-sm {
  display: inline-flex;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--blue);
  color: white;
  font-size: 18px;
  font-weight: 700;
  align-items: center;
  justify-content: center;
  margin-right: 12px;
}

.pres-point h2 {
  font-size: clamp(28px, 4vw, 40px);
  color: var(--navy);
  margin: 0 0 8px;
}

.pres-point p {
  font-size: clamp(18px, 2.5vw, 26px);
  color: #5a6782;
  margin: 0;
}

/* Large list items */
.pres-list-large {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px 0;
}

.pres-item-large {
  font-size: clamp(22px, 3vw, 32px);
  padding: 16px 24px;
  background: #f8faff;
  border-radius: 12px;
  border-left: 4px solid var(--blue);
}

.pres-list-large.pres-danger .pres-item-large {
  border-left-color: var(--danger);
  background: rgba(255, 107, 107, 0.1);
}

/* Styled list with label/value */
.pres-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pres-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: #f8faff;
  border-radius: 10px;
  font-size: clamp(18px, 2.5vw, 24px);
}

.pres-item strong {
  color: var(--navy);
}

/* Boxes */
.pres-box {
  background: #f0f7ff;
  border: 2px solid var(--blue);
  border-radius: 16px;
  padding: 32px 40px;
  text-align: center;
}

.pres-box h2 {
  font-size: clamp(24px, 3.5vw, 36px);
  color: var(--navy);
  margin: 0 0 12px;
}

.pres-box p {
  font-size: clamp(18px, 2.5vw, 26px);
  color: #5a6782;
  margin: 8px 0;
}

.pres-box-danger {
  background: rgba(255, 107, 107, 0.15);
  border: 2px solid var(--danger);
  border-radius: 16px;
  padding: 24px 32px;
  margin: 12px 0;
}

.pres-box-danger p {
  font-size: clamp(20px, 2.8vw, 28px);
  color: var(--danger);
  margin: 8px 0;
}

.pres-box-emphasis {
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  color: white;
  font-size: clamp(22px, 3vw, 32px);
  font-weight: 600;
  padding: 20px 32px;
  border-radius: 12px;
  margin-top: 16px;
}

/* Table-style layout */
.pres-table {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.pres-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  padding: 14px 20px;
  background: #f8faff;
  border-radius: 8px;
  font-size: clamp(16px, 2vw, 22px);
}

.pres-row.pres-header {
  background: var(--navy);
  color: white;
  font-weight: 600;
}

/* Comparison layout */
.pres-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  width: 100%;
}

.pres-col {
  background: #f8faff;
  border-radius: 16px;
  padding: 24px;
  text-align: center;
}

.pres-col h3 {
  font-size: clamp(22px, 3vw, 30px);
  color: var(--navy);
  margin: 0 0 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--blue);
}

.pres-col p {
  font-size: clamp(16px, 2vw, 22px);
  margin: 10px 0;
  color: #333;
}

.pres-risk-low {
  color: var(--mint) !important;
  font-weight: 600;
}

.pres-risk-high {
  color: var(--danger) !important;
  font-weight: 600;
}

.pres-shock {
  background: rgba(124, 219, 138, 0.2);
  border: 2px solid var(--mint);
}

.pres-no-shock {
  background: rgba(255, 107, 107, 0.15);
  border: 2px solid var(--danger);
}

/* Rhythm card for presentation */
.pres-rhythm {
  text-align: center;
  padding: 20px;
}

.pres-rhythm h2 {
  font-size: clamp(26px, 3.5vw, 38px);
  color: var(--navy);
  margin: 0 0 20px;
}

.pres-rhythm.pres-danger h2 {
  color: var(--danger);
}

.pres-features {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin: 16px 0;
}

.pres-features span {
  background: #e8f4ff;
  color: var(--navy);
  padding: 10px 20px;
  border-radius: 20px;
  font-size: clamp(14px, 1.8vw, 20px);
  font-weight: 500;
}

.pres-rhythm.pres-danger .pres-features span {
  background: rgba(255, 107, 107, 0.15);
  color: var(--danger);
}

.pres-action {
  font-size: clamp(18px, 2.5vw, 26px);
  color: var(--blue);
  font-weight: 600;
  margin-top: 20px;
  padding: 16px;
  background: #f0f7ff;
  border-radius: 10px;
}

.pres-action-danger {
  font-size: clamp(20px, 2.8vw, 28px);
  color: white;
  font-weight: 700;
  margin-top: 20px;
  padding: 16px 24px;
  background: var(--danger);
  border-radius: 10px;
}

/* Criteria list */
.pres-criteria {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pres-crit-item {
  display: flex;
  gap: 16px;
  font-size: clamp(20px, 2.5vw, 28px);
  padding: 12px 20px;
  background: #f8faff;
  border-radius: 8px;
}

.pres-crit-item span:first-child {
  font-weight: 600;
  color: var(--navy);
  min-width: 100px;
}

/* Pathway visual */
.pres-pathway {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px;
}

.pres-path-item {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: clamp(18px, 2.2vw, 26px);
}

.pres-path-arrow {
  font-size: 28px;
  color: #999;
}

.pres-badge {
  padding: 8px 20px;
  background: #e8f4ff;
  border-radius: 20px;
  font-weight: 600;
  color: var(--navy);
}

.pres-badge.sa {
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  color: white;
}

.pres-badge.av {
  background: var(--mint);
  color: #1a5928;
}

.pres-rate {
  color: var(--blue);
  font-weight: 600;
}

.pres-ecg {
  color: var(--danger);
  font-style: italic;
}

/* Method card */
.pres-method {
  text-align: center;
  padding: 16px;
}

.pres-method h2 {
  font-size: clamp(24px, 3vw, 34px);
  color: var(--navy);
  margin: 0 0 20px;
}

.pres-steps {
  text-align: left;
  max-width: 500px;
  margin: 0 auto;
}

.pres-steps p {
  font-size: clamp(18px, 2.2vw, 26px);
  margin: 12px 0;
  padding-left: 20px;
}

.pres-example {
  font-size: clamp(22px, 2.8vw, 32px);
  color: var(--blue);
  font-weight: 600;
  margin-top: 20px;
  padding: 16px;
  background: #f0f7ff;
  border-radius: 10px;
}

.pres-sequence {
  font-size: clamp(20px, 2.5vw, 30px);
  color: var(--navy);
  font-weight: 600;
  letter-spacing: 4px;
  margin-top: 20px;
}

/* Cards grid */
.pres-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.pres-card {
  background: #f8faff;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
}

.pres-card h3 {
  font-size: clamp(18px, 2.2vw, 24px);
  color: var(--navy);
  margin: 0 0 10px;
}

.pres-card p {
  font-size: clamp(14px, 1.8vw, 18px);
  color: #5a6782;
  margin: 0;
}

/* Help overlay */
.presentation-help {
  display: none;
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 10;
  align-items: center;
  justify-content: center;
}

.presentation-help.visible {
  display: flex;
}

.presentation-help-content {
  background: #fff;
  border-radius: 16px;
  padding: 32px 40px;
  max-width: 400px;
  text-align: center;
}

.presentation-help-content h3 {
  margin: 0 0 20px;
  color: var(--navy);
  font-size: 22px;
}

.shortcut-list {
  text-align: left;
  margin-bottom: 20px;
}

.shortcut-item {
  padding: 8px 0;
  font-size: 15px;
  color: #333;
  border-bottom: 1px solid #eee;
}

.shortcut-item:last-child {
  border-bottom: none;
}

.shortcut-item kbd {
  display: inline-block;
  padding: 4px 8px;
  background: #f0f0f0;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-family: monospace;
  font-size: 13px;
  margin-right: 4px;
}

.help-note {
  font-size: 13px;
  color: #666;
  margin-bottom: 16px;
  padding: 12px;
  background: #f8f9fa;
  border-radius: 8px;
}

.close-help-btn {
  padding: 12px 32px;
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
}

.close-help-btn:hover {
  background: var(--navy);
}

@media (max-width: 720px) {
  .slide-content {
    padding: 8px 12px;
  }

  .slide {
    padding: 16px;
    max-height: calc(100vh - 80px);
  }

  .practice-slide-options {
    grid-template-columns: 1fr;
  }

  .slide-nav {
    padding: 6px 12px;
    gap: 12px;
  }

  .prev-slide, .next-slide {
    padding: 6px 14px;
    font-size: 13px;
  }

  .presentation-controls {
    gap: 4px;
  }

  .presentation-control-btn {
    width: 24px;
    height: 24px;
  }

  .exit-presentation {
    width: 28px;
    height: 28px;
    font-size: 18px;
  }
}

/* ==================== PRINT STYLES ==================== */
@media print {
  .bg-grid,
  .hero-actions,
  footer,
  .quiz-filters,
  .scenario-start-btn,
  .scenario-next-btn,
  .explain-btn,
  .tree-reset {
    display: none !important;
  }

  .quiz-card,
  .scenario-card,
  .tree-card {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #ccc;
  }
}
