/* =====================================================
   COURSE ENGINE — Component Styles
   Loaded AFTER learn.css (uses --wing-accent variables)
   ===================================================== */

/* =====================================================
   PAGE LAYOUT
   ===================================================== */

.course-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 1.5rem 3rem;
}

.course-hero {
  text-align: center;
  padding: 2.5rem 1rem 2rem;
}

.course-hero h1 {
  font-size: 2.25rem;
  font-weight: 800;
  color: #fff;
  margin: 0 0 0.5rem;
  line-height: 1.2;
}

.course-hero .course-subtitle {
  font-size: 1.1rem;
  color: var(--ag-text-muted, #9CA3AF);
  line-height: 1.5;
  margin: 0;
}

/* =====================================================
   SECTIONS
   ===================================================== */

.course-section {
  display: none;
}

.course-section.active {
  display: block;
}

.course-section h2 {
  font-size: 1.75rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 1rem;
}

.course-section h3 {
  font-size: 1.35rem;
  font-weight: 600;
  color: #fff;
  margin: 1.5rem 0 0.75rem;
}

.course-section p {
  font-size: 1.125rem;
  color: rgba(255,255,255,0.85);
  line-height: 1.7;
  margin: 0 0 1rem;
}

.course-section ul,
.course-section ol {
  font-size: 1.125rem;
  color: rgba(255,255,255,0.85);
  line-height: 1.7;
  margin: 0 0 1rem;
  padding-left: 1.5rem;
}

.course-section li {
  margin-bottom: 0.5rem;
}

/* =====================================================
   PROGRESS BAR
   ===================================================== */

.course-progress {
  position: sticky;
  top: 64px;  /* below nav */
  z-index: 50;
  background: var(--ag-surface, #1a1f2e);
  border-bottom: 1px solid var(--ag-border, rgba(255,255,255,0.1));
  padding: 1rem 0;
  margin-bottom: 2rem;
  /* Extend background to full viewport width so overflowing tabs are covered */
  width: 100vw;
  margin-left: calc(-50vw + 50%);
}

.course-progress-track {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  max-width: 700px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Connecting lines */
.course-progress-line {
  flex: 1;
  height: 2px;
  background: rgba(255, 255, 255, 0.15);
  max-width: 60px;
}

.course-progress-line.completed {
  background: var(--wing-accent, #4A90D9);
}

/* Step (dot + label) */
.course-progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  background: none;
  border: none;
  padding: 0.25rem;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.4);
  transition: color 0.2s;
  flex-shrink: 0;
}

.course-progress-step:hover:not(.locked) {
  color: #fff;
}

.course-progress-step .step-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  background: transparent;
}

.course-progress-step .step-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: normal;
  max-width: 120px;
  text-align: center;
}

/* Staggered vertical offset — alternating steps up/down */
.course-progress-step:nth-child(4n+1) {
  transform: translateY(-8px);
}
.course-progress-step:nth-child(4n+3) {
  transform: translateY(8px);
}

/* Completed step */
.course-progress-step.completed .step-dot {
  background: var(--wing-accent, #4A90D9);
  border-color: var(--wing-accent, #4A90D9);
  color: #fff;
}

.course-progress-step.completed {
  color: var(--wing-accent, #4A90D9);
}

/* Current step */
.course-progress-step.current .step-dot {
  border-color: var(--wing-accent, #4A90D9);
  box-shadow: 0 0 0 3px rgba(74, 144, 217, 0.25);
}

.course-progress-step.current {
  color: #fff;
}

/* Locked step */
.course-progress-step.locked {
  cursor: not-allowed;
  color: rgba(255, 255, 255, 0.35);
}

.course-progress-step.locked .step-dot {
  border-color: rgba(255, 255, 255, 0.1);
}

/* =====================================================
   NAVIGATION BUTTONS
   ===================================================== */

.course-nav-buttons {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--ag-border, rgba(255,255,255,0.1));
}

.course-nav-back,
.course-nav-next {
  min-height: 48px;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

.course-nav-back {
  background: rgba(255, 255, 255, 0.08);
  color: var(--ag-text-muted, #9CA3AF);
}

.course-nav-back:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.course-nav-next {
  background: var(--wing-accent, #4A90D9);
  color: #fff;
}

.course-nav-next:hover {
  background: var(--wing-accent-light, #6BA8E8);
}

.course-nav-next.course-nav-done {
  background: rgba(45, 90, 61, 0.3);
  color: #6CBF84;
  cursor: default;
}

/* =====================================================
   RESUME BANNER
   ===================================================== */

.course-resume-banner {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: rgba(74, 144, 217, 0.08);
  border: 1px solid var(--wing-accent, #4A90D9);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 2rem;
}

.course-resume-banner p {
  flex: 1;
  font-size: 1rem;
  color: var(--ag-text-muted, #9CA3AF);
  margin: 0;
}

.course-resume-banner strong {
  color: #fff;
}

.course-resume-banner .btn {
  flex-shrink: 0;
}

/* =====================================================
   QUIZ STYLES
   ===================================================== */

.quiz-container {
  background: var(--ag-surface, #1a1f2e);
  border: 1px solid var(--ag-border, rgba(255,255,255,0.1));
  border-radius: 12px;
  padding: 2rem;
  margin: 1.5rem 0;
}

.quiz-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.quiz-progress-text {
  font-size: 0.875rem;
  color: var(--ag-text-muted, #9CA3AF);
  font-weight: 600;
}

.quiz-score-running {
  font-size: 0.875rem;
  color: var(--wing-accent, #4A90D9);
  font-weight: 600;
}

.quiz-scenario {
  font-style: italic;
  border-left: 3px solid var(--wing-accent, #4A90D9);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  background: rgba(74, 144, 217, 0.06);
  border-radius: 0 8px 8px 0;
  font-size: 1.0625rem;
  color: var(--ag-text-muted, #9CA3AF);
  line-height: 1.6;
}

.quiz-question-text {
  font-size: 1.25rem;
  font-weight: 600;
  color: #fff;
  line-height: 1.5;
  margin-bottom: 1.5rem;
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.quiz-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  min-height: 48px;
  padding: 0.875rem 1rem;
  background: rgba(255, 255, 255, 0.04);
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
  color: #fff;
  font-size: 1.0625rem;
  line-height: 1.4;
}

.quiz-option:hover:not(.disabled) {
  border-color: var(--wing-accent, #4A90D9);
  background: rgba(74, 144, 217, 0.08);
}

.quiz-option:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring, 0 0 0 3px rgba(212, 168, 75, 0.5));
}

.quiz-option .option-letter {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  font-weight: 700;
  font-size: 0.875rem;
  flex-shrink: 0;
}

.quiz-option .option-text {
  flex: 1;
}

/* Answered states */
.quiz-option.disabled {
  cursor: default;
  opacity: 0.7;
}

.quiz-option.selected.correct {
  border-color: #22c55e;
  background: rgba(34, 197, 94, 0.12);
  opacity: 1;
}

.quiz-option.selected.correct .option-letter {
  background: #22c55e;
  color: #fff;
}

.quiz-option.selected.incorrect {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.12);
  opacity: 1;
}

.quiz-option.selected.incorrect .option-letter {
  background: #ef4444;
  color: #fff;
}

.quiz-option.was-correct {
  border-color: rgba(34, 197, 94, 0.5);
  opacity: 1;
}

.quiz-option.was-correct .option-letter {
  background: rgba(34, 197, 94, 0.3);
}

/* Explanation */
.quiz-explanation {
  margin-top: 1.25rem;
  padding: 1rem 1.25rem;
  border-radius: 8px;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ag-text-muted, #9CA3AF);
  animation: quizSlideIn 0.3s ease;
}

.quiz-explanation.correct {
  border-left: 3px solid #22c55e;
  background: rgba(34, 197, 94, 0.06);
}

.quiz-explanation.incorrect {
  border-left: 3px solid #ef4444;
  background: rgba(239, 68, 68, 0.06);
}

.quiz-explanation strong {
  color: #fff;
}

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

/* Next button wrap */
.quiz-next-wrap {
  margin-top: 1.5rem;
  text-align: right;
}

.quiz-next-btn {
  min-height: 48px;
}

/* =====================================================
   QUIZ SUMMARY
   ===================================================== */

.quiz-summary {
  text-align: center;
  padding: 2rem 0;
}

.quiz-summary-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 1.5rem;
}

.quiz-summary-score {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.25rem;
  margin-bottom: 0.5rem;
}

.quiz-summary-score .score-number {
  font-size: 3.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--wing-accent, #4A90D9), var(--wing-accent-light, #6BA8E8));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.quiz-summary-score .score-divider {
  font-size: 2rem;
  color: rgba(255, 255, 255, 0.3);
}

.quiz-summary-score .score-total {
  font-size: 2rem;
  color: rgba(255, 255, 255, 0.5);
}

.quiz-summary-pct {
  font-size: 1.25rem;
  color: var(--ag-text-muted, #9CA3AF);
  margin-bottom: 1.5rem;
}

.quiz-summary-dots {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.quiz-summary-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
}

.quiz-summary-dot.dot-correct {
  background: #22c55e;
}

.quiz-summary-dot.dot-incorrect {
  background: #ef4444;
}

.quiz-review-btn,
.quiz-retake-btn,
.quiz-back-summary-btn {
  margin: 0.5rem;
}

/* =====================================================
   QUIZ REVIEW
   ===================================================== */

.quiz-review {
  padding: 1rem 0;
}

.quiz-review-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 1.5rem;
}

.quiz-review-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--ag-border, rgba(255,255,255,0.1));
  border-radius: 8px;
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.quiz-review-question {
  font-size: 1.0625rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 0.75rem;
}

.quiz-review-your-answer,
.quiz-review-correct {
  font-size: 0.9375rem;
  color: var(--ag-text-muted, #9CA3AF);
  margin-bottom: 0.35rem;
}

.quiz-review-your-answer .incorrect {
  color: #ef4444;
  font-weight: 600;
}

.quiz-review-correct .correct {
  color: #22c55e;
  font-weight: 600;
}

.quiz-review-explanation {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--ag-border, rgba(255,255,255,0.1));
  font-size: 0.9375rem;
  color: var(--ag-text-muted, #9CA3AF);
  line-height: 1.5;
}

/* =====================================================
   TIMER
   ===================================================== */

.tool-timer {
  text-align: center;
  padding: 1.5rem;
  background: var(--ag-surface, #1a1f2e);
  border: 1px solid var(--ag-border, rgba(255,255,255,0.1));
  border-radius: 12px;
  margin: 1.5rem 0;
}

.tool-timer-label {
  font-size: 1rem;
  color: var(--ag-text-muted, #9CA3AF);
  margin-bottom: 0.75rem;
}

.tool-timer-display {
  font-size: 3.5rem;
  font-weight: 700;
  font-family: 'Courier New', Courier, monospace;
  color: #fff;
  margin-bottom: 1rem;
  letter-spacing: 0.05em;
}

.tool-timer-bar-track {
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 1.25rem;
}

.tool-timer-bar-fill {
  height: 100%;
  background: var(--wing-accent, #4A90D9);
  border-radius: 3px;
  transition: width 1s linear;
}

.tool-timer-controls {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
}

.tool-timer-controls .btn {
  min-width: 80px;
}

.tool-timer.complete {
  border-color: #22c55e;
  animation: timerGlow 1.5s ease-in-out 2;
}

.tool-timer.complete .tool-timer-display {
  color: #22c55e;
}

@keyframes timerGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
  50% { box-shadow: 0 0 20px 4px rgba(34, 197, 94, 0.2); }
}

/* =====================================================
   REFLECTION
   ===================================================== */

.tool-reflection {
  background: var(--ag-surface, #1a1f2e);
  border: 1px solid var(--ag-border, rgba(255,255,255,0.1));
  border-radius: 12px;
  padding: 1.5rem;
  margin: 1.5rem 0;
}

.tool-reflection-prompt {
  font-size: 1.125rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 1rem;
  line-height: 1.5;
}

.tool-reflection-textarea {
  width: 100%;
  font-size: 1rem;
  line-height: 1.6;
  color: #fff;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 0.875rem 1rem;
  resize: vertical;
  font-family: inherit;
  box-sizing: border-box;
}

.tool-reflection-textarea::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

.tool-reflection-textarea:focus {
  outline: none;
  border-color: var(--wing-accent, #4A90D9);
  box-shadow: 0 0 0 2px rgba(74, 144, 217, 0.2);
}

.tool-reflection-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.5rem;
}

.tool-reflection-count {
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.6);
}

.tool-reflection-saved {
  font-size: 0.8125rem;
  color: #22c55e;
  font-weight: 600;
  animation: fadeSaved 0.3s ease;
}

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

/* =====================================================
   CHECKLIST
   ===================================================== */

.tool-checklist {
  background: var(--ag-surface, #1a1f2e);
  border: 1px solid var(--ag-border, rgba(255,255,255,0.1));
  border-radius: 12px;
  padding: 1.5rem;
  margin: 1.5rem 0;
}

.tool-checklist-progress {
  font-size: 0.875rem;
  color: var(--ag-text-muted, #9CA3AF);
  margin-bottom: 1rem;
  font-weight: 600;
}

.tool-checklist-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 48px;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  cursor: pointer;
  transition: background 0.15s;
}

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

.tool-checklist-item:hover {
  background: rgba(255, 255, 255, 0.02);
}

.tool-checklist-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.tool-checklist-check {
  width: 24px;
  height: 24px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.tool-checklist-item.checked .tool-checklist-check {
  background: var(--wing-accent, #4A90D9);
  border-color: var(--wing-accent, #4A90D9);
}

.tool-checklist-item.checked .tool-checklist-check::after {
  content: '';
  width: 6px;
  height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  margin-top: -2px;
}

.tool-checklist-text {
  font-size: 1rem;
  color: var(--ag-text-muted, #9CA3AF);
  line-height: 1.4;
}

.tool-checklist-item.checked .tool-checklist-text {
  color: rgba(255, 255, 255, 0.4);
  text-decoration: line-through;
}

/* =====================================================
   EXPANDABLE PANEL
   ===================================================== */

.tool-expandable {
  border: 1px solid var(--ag-border, rgba(255,255,255,0.1));
  border-radius: 12px;
  margin: 1.5rem 0;
  overflow: hidden;
}

.tool-expandable-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 1rem 1.25rem;
  background: var(--ag-surface, #1a1f2e);
  border: none;
  cursor: pointer;
  color: #fff;
  font-size: 1.0625rem;
  font-weight: 600;
  text-align: left;
  transition: background 0.2s;
}

.tool-expandable-header:hover {
  background: rgba(255, 255, 255, 0.04);
}

.tool-expandable-chevron {
  transition: transform 0.3s;
  color: var(--ag-text-muted, #9CA3AF);
  display: flex;
}

.tool-expandable.open .tool-expandable-chevron {
  transform: rotate(180deg);
}

.tool-expandable-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
  padding: 0 1.25rem;
}

.tool-expandable.open .tool-expandable-content {
  padding: 0 1.25rem 1.25rem;
}

/* =====================================================
   MODIFICATION TOGGLE
   ===================================================== */

.tool-mod-toggle {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 1rem 0;
}

.tool-mod-pill {
  padding: 0.5rem 1.25rem;
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  background: transparent;
  color: var(--ag-text-muted, #9CA3AF);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  min-height: 40px;
}

.tool-mod-pill:hover {
  border-color: var(--wing-accent, #4A90D9);
  color: #fff;
}

.tool-mod-pill.active {
  background: var(--wing-accent, #4A90D9);
  border-color: var(--wing-accent, #4A90D9);
  color: #fff;
}

/* =====================================================
   CALCULATOR
   ===================================================== */

.tool-calculator {
  background: var(--ag-surface, #1a1f2e);
  border: 1px solid var(--ag-border, rgba(255,255,255,0.1));
  border-radius: 12px;
  padding: 1.5rem;
  margin: 1.5rem 0;
}

.tool-calculator-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 1.25rem;
}

.tool-calculator-field {
  margin-bottom: 1rem;
}

.tool-calculator-field label {
  display: block;
  font-size: 0.875rem;
  color: var(--ag-text-muted, #9CA3AF);
  margin-bottom: 0.35rem;
  font-weight: 600;
}

.tool-calculator-field input {
  width: 100%;
  padding: 0.625rem 0.875rem;
  font-size: 1rem;
  color: #fff;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  box-sizing: border-box;
}

.tool-calculator-field input:focus {
  outline: none;
  border-color: var(--wing-accent, #4A90D9);
  box-shadow: 0 0 0 2px rgba(74, 144, 217, 0.2);
}

.tool-calculator-btn {
  margin-bottom: 1rem;
}

.tool-calculator-error {
  color: #ef4444;
  font-size: 0.875rem;
  margin-bottom: 0.75rem;
}

.tool-calculator-result {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.25rem;
  background: rgba(74, 144, 217, 0.08);
  border: 1px solid rgba(74, 144, 217, 0.2);
  border-radius: 8px;
}

.tool-calculator-result .result-label {
  font-size: 0.875rem;
  color: var(--ag-text-muted, #9CA3AF);
  margin-bottom: 0.25rem;
}

.tool-calculator-result .result-value {
  font-size: 2.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--wing-accent, #4A90D9), var(--wing-accent-light, #6BA8E8));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* =====================================================
   BUTTON OVERRIDES (for course context)
   ===================================================== */

.course-page .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
  min-height: 48px;
  border: none;
}

.course-page .btn-primary {
  background: var(--wing-accent, #4A90D9);
  color: #fff;
}

.course-page .btn-primary:hover {
  background: var(--wing-accent-light, #6BA8E8);
}

.course-page .btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--ag-text-muted, #9CA3AF);
}

.course-page .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.course-page .btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* =====================================================
   VIDEO EMBED (responsive 16:9)
   ===================================================== */

.video-embed {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  margin: 1.5rem 0;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
}

.video-embed iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* =====================================================
   CALLOUT BOXES
   ===================================================== */

.callout {
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
  font-size: 1rem;
  line-height: 1.6;
}

.callout p {
  margin: 0 0 0.5rem;
  color: inherit;
}

.callout p:last-child {
  margin-bottom: 0;
}

.callout strong {
  color: #fff;
}

.callout-info {
  background: rgba(74, 144, 217, 0.08);
  border: 1px solid rgba(74, 144, 217, 0.2);
  color: var(--ag-text-muted, #9CA3AF);
}

.callout-warning {
  background: rgba(239, 68, 68, 0.06);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: var(--ag-text-muted, #9CA3AF);
}

.callout-success {
  background: rgba(34, 197, 94, 0.06);
  border: 1px solid rgba(34, 197, 94, 0.2);
  color: var(--ag-text-muted, #9CA3AF);
}

/* =====================================================
   OBJECTIVES LIST
   ===================================================== */

.objectives-list {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0;
}

.objectives-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.625rem 0;
  font-size: 1.0625rem;
  color: var(--ag-text-muted, #9CA3AF);
  line-height: 1.5;
}

.objectives-list li::before {
  content: '';
  width: 22px;
  height: 22px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  flex-shrink: 0;
  margin-top: 2px;
}

.objectives-list li.done {
  color: rgba(255, 255, 255, 0.5);
}

.objectives-list li.done::before {
  content: '';
  background: var(--wing-accent, #4A90D9);
  border-color: var(--wing-accent, #4A90D9);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Cpath d='M2.5 7L5.5 10L11.5 4' stroke='white' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
}

/* =====================================================
   COMPARISON TABLE
   ===================================================== */

.comparison-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 1.5rem 0;
  font-size: 1rem;
}

.comparison-table th {
  text-align: left;
  padding: 0.75rem 1rem;
  font-weight: 700;
  color: #fff;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 2px solid var(--ag-border, rgba(255,255,255,0.1));
}

.comparison-table td {
  padding: 0.75rem 1rem;
  color: var(--ag-text-muted, #9CA3AF);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  line-height: 1.5;
}

.comparison-table th:first-child {
  border-radius: 8px 0 0 0;
}

.comparison-table th:last-child {
  border-radius: 0 8px 0 0;
}

/* =====================================================
   TAP-TO-CATEGORIZE
   ===================================================== */

.categorize-tool {
  margin: 1.5rem 0;
}

.categorize-buckets {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.categorize-bucket {
  flex: 1;
  min-height: 60px;
  border: 2px dashed rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 1rem;
  text-align: center;
  transition: border-color 0.2s, background 0.2s;
}

.categorize-bucket-label {
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.75rem;
}

.categorize-bucket.reactive {
  border-color: rgba(239, 68, 68, 0.4);
}

.categorize-bucket.reactive .categorize-bucket-label {
  color: #ef4444;
}

.categorize-bucket.reactive.active {
  background: rgba(239, 68, 68, 0.08);
  border-color: #ef4444;
}

.categorize-bucket.proactive {
  border-color: rgba(34, 197, 94, 0.4);
}

.categorize-bucket.proactive .categorize-bucket-label {
  color: #22c55e;
}

.categorize-bucket.proactive.active {
  background: rgba(34, 197, 94, 0.08);
  border-color: #22c55e;
}

.categorize-placed-item {
  font-size: 0.875rem;
  padding: 0.375rem 0.75rem;
  border-radius: 6px;
  margin: 0.25rem 0;
  text-align: left;
}

.categorize-placed-item.correct {
  background: rgba(34, 197, 94, 0.12);
  color: #22c55e;
}

.categorize-placed-item.incorrect {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
}

.categorize-items {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.categorize-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  background: var(--ag-surface, #1a1f2e);
  border: 1px solid var(--ag-border, rgba(255,255,255,0.1));
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 1rem;
  color: #fff;
  min-height: 48px;
}

.categorize-item:hover:not(.placed) {
  border-color: var(--wing-accent, #4A90D9);
  background: rgba(74, 144, 217, 0.06);
}

.categorize-item.placed {
  opacity: 0.4;
  cursor: default;
}

.categorize-item.active {
  border-color: var(--wing-accent, #4A90D9);
  box-shadow: 0 0 0 2px rgba(74, 144, 217, 0.3);
}

.categorize-feedback {
  text-align: center;
  font-size: 0.9375rem;
  font-weight: 600;
  padding: 0.75rem;
  margin-top: 1rem;
  border-radius: 8px;
}

.categorize-feedback.correct {
  background: rgba(34, 197, 94, 0.08);
  color: #22c55e;
}

.categorize-feedback.incorrect {
  background: rgba(239, 68, 68, 0.08);
  color: #ef4444;
}

.categorize-feedback.complete {
  background: rgba(34, 197, 94, 0.1);
  color: #22c55e;
}

/* =====================================================
   VISIONING TOOL (Section 4)
   ===================================================== */

.visioning-tool {
  margin: 1.5rem 0;
}

.visioning-category-title {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  margin: 1.25rem 0 0.5rem;
}

.visioning-activities {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.5rem;
}

.visioning-activity {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  cursor: pointer;
}

.visioning-activity input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--wing-accent, #4A90D9);
  flex-shrink: 0;
}

.visioning-activity label {
  font-size: 1rem;
  color: var(--ag-text-muted, #9CA3AF);
  cursor: pointer;
}

.visioning-custom-add {
  display: flex;
  gap: 0.5rem;
  margin: 1rem 0;
}

.visioning-custom-add input {
  flex: 1;
  padding: 0.625rem 0.875rem;
  font-size: 1rem;
  color: #fff;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  font-family: inherit;
}

.visioning-age-selector {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 1rem 0;
}

.visioning-age-option {
  padding: 0.5rem 1.25rem;
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  background: transparent;
  color: var(--ag-text-muted, #9CA3AF);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  min-height: 44px;
}

.visioning-age-option:hover {
  border-color: var(--wing-accent, #4A90D9);
  color: #fff;
}

.visioning-age-option.selected {
  background: var(--wing-accent, #4A90D9);
  border-color: var(--wing-accent, #4A90D9);
  color: #fff;
}

.visioning-backcasting {
  margin: 1.5rem 0;
}

.backcasting-card {
  border-left: 3px solid var(--wing-accent, #4A90D9);
  background: rgba(74, 144, 217, 0.04);
  border-radius: 0 8px 8px 0;
  padding: 1rem 1.25rem;
  margin: 0.75rem 0;
}

.backcasting-card-activity {
  font-size: 1.0625rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 0.5rem;
}

.backcasting-card-detail {
  font-size: 0.9375rem;
  color: var(--ag-text-muted, #9CA3AF);
  line-height: 1.5;
}

.visioning-save-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1.5rem;
}

.visioning-saved-indicator {
  font-size: 0.875rem;
  color: #22c55e;
  font-weight: 600;
}

/* =====================================================
   FAMILY HISTORY TOOL
   ===================================================== */

.family-history-tool {
  margin: 1.5rem 0;
}

.family-history-group {
  background: var(--ag-surface, #1a1f2e);
  border: 1px solid var(--ag-border, rgba(255,255,255,0.1));
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin: 0.75rem 0;
}

.family-history-group-title {
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 0.5rem;
}

.family-history-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0;
  cursor: pointer;
}

.family-history-option input {
  width: 18px;
  height: 18px;
  accent-color: var(--wing-accent, #4A90D9);
}

.family-history-option label {
  font-size: 0.9375rem;
  color: var(--ag-text-muted, #9CA3AF);
  cursor: pointer;
}

.family-history-summary {
  background: rgba(74, 144, 217, 0.06);
  border: 1px solid rgba(74, 144, 217, 0.15);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-top: 1rem;
  font-size: 1rem;
  color: var(--ag-text-muted, #9CA3AF);
}

/* =====================================================
   ACTION CARDS (Section 5)
   ===================================================== */

.action-cards {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 1.5rem 0;
}

.action-card {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  background: var(--ag-surface, #1a1f2e);
  border: 1px solid var(--ag-border, rgba(255,255,255,0.1));
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
}

.action-card-number {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--wing-accent, #4A90D9);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  flex-shrink: 0;
}

.action-card-content h4 {
  font-size: 1.0625rem;
  font-weight: 600;
  color: #fff;
  margin: 0 0 0.35rem;
}

.action-card-content p {
  font-size: 0.9375rem;
  color: var(--ag-text-muted, #9CA3AF);
  margin: 0;
  line-height: 1.5;
}

.action-card-content a {
  color: var(--wing-accent, #4A90D9);
  text-decoration: none;
}

.action-card-content a:hover {
  text-decoration: underline;
}

/* =====================================================
   LECTURE SEGMENTS (Section 3)
   ===================================================== */

.lecture-segment {
  margin-bottom: 0.5rem;
}

.segment-intro {
  font-size: 1.05rem;
  color: var(--ag-text-muted, #9CA3AF);
  line-height: 1.6;
  margin-bottom: 1.25rem;
}

/* =====================================================
   ASSESSMENT CARDS (Week 2+)
   ===================================================== */

.assessment-card {
  border: 1px solid var(--ag-border, rgba(255,255,255,0.1));
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  background: var(--ag-bg-card, rgba(255,255,255,0.03));
}

.assessment-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.assessment-header h4 {
  margin: 0;
  font-size: 1.125rem;
  color: var(--ag-text, #F5F0EB);
}

.assessment-pillar-badge {
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  white-space: nowrap;
  color: #fff;
}

.assessment-pillar-badge.pillar-strength     { background: var(--strength, #DC2626); }
.assessment-pillar-badge.pillar-cardio       { background: var(--cardio, #8B5CF6); }
.assessment-pillar-badge.pillar-stability    { background: var(--stability, #3B82F6); }
.assessment-pillar-badge.pillar-mobility     { background: var(--mobility, #059669); }
.assessment-pillar-badge.pillar-power        { background: var(--power, #D97706); }
.assessment-pillar-badge.pillar-cognition    { background: #6366F1; }
.assessment-pillar-badge.pillar-vitals       { background: #64748B; }
.assessment-pillar-badge.pillar-survey       { background: #64748B; }

.assessment-why {
  font-size: 1rem;
  color: var(--ag-text-muted, #9CA3AF);
  line-height: 1.6;
  margin-bottom: 1.25rem;
}

.assessment-entry {
  margin-top: 1.25rem;
}

.assessment-entry h5 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--ag-text, #F5F0EB);
  margin: 0 0 0.75rem;
}

.assessment-field {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.assessment-field label {
  font-size: 1rem;
  color: var(--ag-text, #F5F0EB);
  min-width: 120px;
}

.assessment-field input {
  font-size: 1.125rem;
  padding: 0.625rem 0.75rem;
  min-height: 48px;
  border: 1px solid var(--ag-border, rgba(255,255,255,0.15));
  border-radius: 8px;
  background: var(--ag-bg-input, rgba(255,255,255,0.05));
  color: var(--ag-text, #F5F0EB);
  width: 120px;
  text-align: center;
}

.assessment-field input:focus {
  outline: none;
  border-color: var(--wing-accent, #D4A84B);
  box-shadow: 0 0 0 2px rgba(212,168,75,0.2);
}

.assessment-field .field-unit {
  font-size: 0.9375rem;
  color: var(--ag-text-muted, #9CA3AF);
}

.assessment-field .field-side-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ag-text-muted, #9CA3AF);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.assessment-age-sex {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.assessment-age-sex label {
  font-size: 0.9375rem;
  color: var(--ag-text-muted, #9CA3AF);
}

.assessment-age-sex select,
.assessment-age-sex input {
  font-size: 1rem;
  padding: 0.5rem 0.75rem;
  min-height: 44px;
  border: 1px solid var(--ag-border, rgba(255,255,255,0.15));
  border-radius: 8px;
  background: var(--ag-bg-input, rgba(255,255,255,0.05));
  color: var(--ag-text, #F5F0EB);
}

.assessment-result {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 8px;
  background: var(--ag-bg-card, rgba(255,255,255,0.03));
  border: 1px solid var(--ag-border, rgba(255,255,255,0.08));
}

.assessment-result-category {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.assessment-result-text {
  font-size: 0.9375rem;
  color: var(--ag-text-muted, #9CA3AF);
  line-height: 1.5;
}

.assessment-result-bar {
  height: 8px;
  border-radius: 4px;
  background: rgba(255,255,255,0.08);
  margin-top: 0.75rem;
  overflow: hidden;
}

.assessment-result-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.4s ease;
}

.assessment-saved {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.875rem;
  color: var(--accent-green, #00d9a5);
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.assessment-saved.visible {
  opacity: 1;
}

/* Category Navigation
   sticky below the main site-nav.
   --main-nav-height is set by JS measuring the actual nav element.
   NO z-index — avoids creating a stacking context so dropdowns
   (z-index:90) can appear above page content but below main nav (z-index:100). */
.category-nav {
  position: sticky !important;
  top: var(--main-nav-height, 57px) !important;
  display: flex;
  flex-wrap: wrap;
  gap: 3px 5px;
  padding: 5px 10px;
  margin-bottom: 16px;
  background-color: #0f1219 !important;
  border-bottom: 1px solid rgba(255,255,255,0.15);
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  box-shadow: 0 4px 8px rgba(0,0,0,0.5);
}

.category-nav::before {
  content: '';
  position: absolute;
  top: -4px;
  left: 0;
  right: 0;
  height: calc(100% + 8px);
  background: #0f1219;
  z-index: -1;
}

.cat-nav-item {
  position: relative;
  display: inline-block;
  padding-bottom: 8px; /* extends hover zone to bridge gap to dropdown */
}

.cat-nav-link {
  font-size: 12px;
  padding: 4px 8px;
  white-space: nowrap;
  border-radius: 4px;
  text-decoration: none;
  color: #B4D7FF !important;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  display: inline-block;
  transition: background 0.2s, color 0.2s;
}

.cat-nav-link:hover {
  background: rgba(255,255,255,0.15);
  color: #D6E9FF !important;
}

.cat-nav-dropdown {
  display: none;
  position: absolute;
  z-index: 9999;
  background: #1a1f2e !important;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 8px;
  padding: 8px 0;
  min-width: 220px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.6);
}

.cat-nav-dropdown a {
  display: block;
  padding: 8px 16px;
  font-size: 15px;
  text-decoration: none;
  color: #B4D7FF !important;
}

.cat-nav-dropdown a:hover {
  background: rgba(255,255,255,0.1);
  color: #D6E8FF !important;
}

/* Legacy fallback for category-nav a (non-dropdown pages) */
.category-nav > a {
  font-size: 0.875rem;
  padding: 0.375rem 0.75rem;
  border-radius: 6px;
  background: rgba(255,255,255,0.05);
  color: var(--ag-text-muted, #9CA3AF);
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}

.category-nav > a:hover {
  background: rgba(255,255,255,0.1);
  color: var(--ag-text, #F5F0EB);
}

/* On wider screens, single row with horizontal scroll if needed */
@media (min-width: 768px) {
  .category-nav {
    flex-wrap: nowrap;
    overflow: visible;
  }
}

/* On narrow screens, allow wrapping with larger tap targets */
@media (max-width: 767px) {
  .category-nav {
    flex-wrap: wrap;
  }
  .cat-nav-link {
    font-size: 14px;
    padding: 11px 14px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
}

.category-desc {
  font-size: 1rem;
  color: var(--ag-text-muted, #9CA3AF);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.category-progress {
  font-size: 0.875rem;
  color: var(--ag-text-muted, #9CA3AF);
  margin-bottom: 1rem;
}

/* External Link (for tests on other sites) */
.assessment-external-link {
  margin: 1rem 0 1.25rem;
  text-align: center;
}

.assessment-external-link .btn {
  display: inline-flex;
  min-height: 48px;
  font-size: 1rem;
}

.assessment-external-note {
  font-size: 0.9375rem;
  color: var(--ag-text-muted, #9CA3AF);
  margin: 0.75rem 0 0;
  line-height: 1.5;
}

/* DEXA Provider Note */
.assessment-dexa-note {
  background: rgba(74, 144, 217, 0.08);
  border: 1px solid rgba(74, 144, 217, 0.2);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin: 1rem 0;
}

.assessment-dexa-note p {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--ag-text-muted, #9CA3AF);
  line-height: 1.5;
}

.assessment-dexa-note a {
  color: var(--wing-accent, #4A90D9);
  text-decoration: none;
}

.assessment-dexa-note a:hover {
  text-decoration: underline;
}

/* Auto-Calculate Display */
.assessment-auto-calc {
  border-top: 1px solid var(--ag-border, rgba(255,255,255,0.1));
  padding-top: 0.75rem;
  margin-top: 0.5rem;
}

.assessment-calc-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--wing-accent, #4A90D9);
}

/* Select fields in assessment cards */
.assessment-field select {
  font-size: 1.125rem;
  padding: 0.625rem 0.75rem;
  min-height: 48px;
  border-radius: 8px;
  border: 1px solid var(--ag-border, rgba(255,255,255,0.15));
  background: rgba(255,255,255,0.05);
  color: #fff;
  font-family: inherit;
}

/* =====================================================
   SECTION DIVIDERS
   ===================================================== */

.section-divider {
  border: none;
  border-top: 1px solid var(--ag-border, rgba(255,255,255,0.1));
  margin: 2.5rem 0;
}

/* =====================================================
   PRINT STYLES
   ===================================================== */

@media print {
  body {
    background: #fff !important;
    color: #000 !important;
  }

  .bg-grid,
  .site-nav,
  .hub-footer,
  .course-progress,
  .course-nav-buttons,
  .tool-timer-controls,
  .quiz-options,
  .course-resume-banner,
  .quiz-next-wrap,
  .quiz-retake-btn,
  .quiz-review-btn,
  .quiz-next-btn,
  .mod-toggle,
  #celebration-overlay,
  .btn {
    display: none !important;
  }

  .course-page {
    background: #fff !important;
    color: #000 !important;
  }

  .course-section {
    display: block !important;
    background: #fff !important;
    color: #000 !important;
    border-color: #ccc !important;
    page-break-inside: avoid;
  }

  .course-section h2,
  .course-section h3,
  .course-section h4 {
    color: #000 !important;
  }

  .course-section p,
  .course-section li {
    color: #333 !important;
  }

  .callout {
    background: #f5f5f5 !important;
    color: #333 !important;
    border-color: #ccc !important;
  }

  .tool-expandable-content {
    max-height: none !important;
    overflow: visible !important;
    display: block !important;
  }

  .quiz-container,
  .action-card,
  .comparison-table {
    background: #fff !important;
    color: #000 !important;
    border-color: #ccc !important;
  }

  .comparison-table th {
    background: #f0f0f0 !important;
    color: #000 !important;
  }

  .comparison-table td {
    color: #333 !important;
  }

  .video-embed {
    display: none !important;
  }

  a {
    color: #000 !important;
    text-decoration: underline !important;
  }
}

/* =====================================================
   CELEBRATION ANIMATION
   ===================================================== */

@keyframes celebrationIn {
  0% {
    opacity: 0;
    transform: scale(0.5);
  }
  60% {
    opacity: 1;
    transform: scale(1.1);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* =====================================================
   RESPONSIVE
   ===================================================== */

@media (max-width: 768px) {
  .course-hero h1 {
    font-size: 1.75rem;
  }

  .course-section h2 {
    font-size: 1.5rem;
  }

  .course-progress-step .step-label {
    font-size: 0.5625rem;
    max-width: 50px;
  }

  .course-progress-step .step-dot {
    width: 24px;
    height: 24px;
  }

  .quiz-question-text {
    font-size: 1.125rem;
  }

  .quiz-option {
    font-size: 1rem;
    padding: 0.75rem;
  }

  .tool-timer-display {
    font-size: 2.5rem;
  }

  .course-nav-buttons {
    gap: 0.75rem;
  }

  .course-resume-banner {
    flex-direction: column;
    text-align: center;
  }

  .categorize-buckets {
    flex-direction: column;
  }

  .visioning-activities {
    grid-template-columns: 1fr;
  }

  .comparison-table {
    font-size: 0.9375rem;
  }

  .comparison-table th,
  .comparison-table td {
    padding: 0.5rem 0.75rem;
  }
}

@media (max-width: 480px) {
  .course-page {
    padding: 0 1rem 2rem;
  }

  .course-hero {
    padding: 2rem 0.5rem 1.5rem;
  }

  .course-hero h1 {
    font-size: 1.5rem;
  }

  .course-progress-track {
    flex-wrap: wrap;
    gap: 0.25rem;
  }

  .course-progress-line {
    display: none;
  }

  .course-progress-step {
    flex: 0 0 auto;
  }

  .course-progress-step .step-label {
    display: none;
  }

  .quiz-container {
    padding: 1.25rem;
  }

  .quiz-summary-score .score-number {
    font-size: 2.5rem;
  }

  .tool-calculator-result .result-value {
    font-size: 2rem;
  }
}

/* =====================================================
   ASSESSMENT DATE INPUT
   ===================================================== */

.assessment-date-field {
  margin-bottom: 12px;
}

.assessment-date-input {
  font-size: 18px;
  padding: 10px 14px;
  min-height: 48px;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 8px;
  background: rgba(255,255,255,0.05);
  color: #fff;
  width: auto;
}

/* =====================================================
   VISUAL PERCENTILE BAR
   ===================================================== */

.result-bar-container {
  margin-bottom: 12px;
}

.result-bar-track {
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(to right,
    #D94A4A 0%, #D94A4A 20%,
    #E07C24 20%, #E07C24 40%,
    #D4A84B 40%, #D4A84B 60%,
    #4A90D9 60%, #4A90D9 80%,
    #00d9a5 80%, #00d9a5 100%);
  position: relative;
}

.result-bar-marker {
  position: absolute;
  top: -4px;
  transform: translateX(-50%);
  transition: left 0.4s ease;
}

.result-bar-marker-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid #D4A84B;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.result-bar-labels {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #9CA3AF;
  margin-top: 4px;
}

/* (result-interpretation, result-category, result-description removed — replaced by unified display) */

/* =====================================================
   HISTORY TABLE
   ===================================================== */

.assessment-history {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.assessment-history h6 {
  font-size: 16px;
  color: #9CA3AF;
  margin: 0 0 8px 0;
  font-weight: 600;
}

.history-table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.history-table {
  width: 100%;
  font-size: 16px;
  border-collapse: collapse;
}

.history-table th {
  text-align: center;
  padding: 8px 10px;
  color: #9CA3AF;
  font-weight: normal;
  font-size: 13px;
  line-height: 1.3;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  white-space: normal;
  word-wrap: break-word;
  max-width: 120px;
  vertical-align: top;
}

.history-table td {
  text-align: center;
  padding: 8px 10px;
  white-space: nowrap;
  vertical-align: top;
}

.history-table th:first-child,
.history-table td:first-child {
  text-align: left;
  white-space: nowrap;
}

.change-positive { color: #00d9a5 !important; }
.change-negative { color: #DC2626 !important; }

/* =====================================================
   GLOBAL USER INFO (Welcome section)
   ===================================================== */

.welcome-user-info {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 20px 24px;
  margin-top: 24px;
}

.welcome-user-info h4 {
  font-size: 20px;
  margin: 0 0 4px 0;
  color: #F3F4F6;
}

.welcome-user-info > p {
  font-size: 16px;
  color: #9CA3AF;
  margin: 0 0 16px 0;
}

.welcome-user-fields {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  align-items: flex-end;
}

.welcome-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.welcome-field label {
  font-size: 14px;
  color: #9CA3AF;
  font-weight: 600;
}

.welcome-field input,
.welcome-field select {
  padding: 8px 12px;
  font-size: 16px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.08);
  color: #F3F4F6;
  min-height: 44px;
}

.welcome-field input:focus,
.welcome-field select:focus {
  outline: none;
  border-color: #4A90D9;
  box-shadow: 0 0 0 2px rgba(74,144,217,0.25);
}

/* =====================================================
   UNIFIED RESULTS DISPLAY
   ===================================================== */

.assessment-results-unified {
  margin: 16px 0;
}

.norm-display {
  margin-bottom: 16px;
}

.norm-display h4 {
  font-size: 16px;
  color: #9CA3AF;
  margin: 0 0 10px 0;
  font-weight: 600;
}

.norm-score {
  margin-top: 10px;
}

.norm-category {
  font-size: 20px;
  font-weight: bold;
  display: block;
}

.norm-percentile {
  font-size: 15px;
  color: #9CA3AF;
  display: block;
  margin-top: 2px;
}

.norm-target {
  margin-top: 8px;
  padding: 8px 12px;
  background: rgba(74, 144, 217, 0.08);
  border-radius: 6px;
  border-left: 3px solid #4A90D9;
}

.norm-target p {
  margin: 0;
  font-size: 15px;
  color: #9CA3AF;
}

/* =====================================================
   RISK INTERPRETATION
   ===================================================== */

.risk-indicator {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 8px;
}

.risk-indicator.risk-excellent {
  background: rgba(0, 217, 165, 0.1);
  border-left: 4px solid #00d9a5;
}

.risk-indicator.risk-good {
  background: rgba(74, 144, 217, 0.1);
  border-left: 4px solid #4A90D9;
}

.risk-indicator.risk-moderate {
  background: rgba(212, 168, 75, 0.1);
  border-left: 4px solid #D4A84B;
}

.risk-indicator.risk-elevated {
  background: rgba(220, 38, 38, 0.1);
  border-left: 4px solid #DC2626;
}

.risk-indicator.risk-neutral {
  background: rgba(255, 255, 255, 0.04);
  border-left: 4px solid #6B7280;
}

.risk-icon {
  font-size: 24px;
  flex-shrink: 0;
  line-height: 1;
}

.risk-category {
  font-weight: bold;
  font-size: 18px;
  display: block;
  color: #F3F4F6;
}

.risk-description {
  font-size: 16px;
  color: #9CA3AF;
  margin: 4px 0 0 0;
  line-height: 1.5;
}

.risk-note {
  font-size: 14px;
  color: #D4A84B;
  margin: 8px 0 0 0;
  font-style: italic;
  line-height: 1.4;
}

.risk-notes {
  margin-top: 12px;
}

/* =====================================================
   SELECT DROPDOWNS — Dark Mode
   Native appearance with dark background. NO custom SVG arrows.
   ===================================================== */

select,
.welcome-user-info select,
.welcome-field select,
.assessment-field select,
.assessment-card select,
#global-assess-sex {
  background-color: #1a1f2e !important;
  color: #ffffff !important;
  border: 1px solid rgba(255,255,255,0.3) !important;
  font-size: 18px;
  padding: 10px 14px;
  min-height: 48px;
  border-radius: 8px;
  -webkit-appearance: menulist !important;
  -moz-appearance: menulist !important;
  appearance: menulist !important;
  background-image: none !important;
}

select option,
.welcome-user-info select option,
.assessment-field select option,
.assessment-card select option,
#global-assess-sex option {
  background-color: #1a1f2e !important;
  color: #ffffff !important;
  padding: 8px;
  font-size: 16px;
}

/* LINK COLORS: Dark mode = #B4D7FF, Light mode = #1D4ED8. ALWAYS use these. */

/* =====================================================
   LINK CONTRAST — Dark Mode
   #B4D7FF passes WCAG AA on dark backgrounds
   ===================================================== */

.course-section a,
.assessment-card a,
.category-nav a,
.callout a,
.course-page a {
  color: #B4D7FF !important;
}

.course-section a:hover,
.assessment-card a:hover,
.category-nav a:hover,
.callout a:hover,
.course-page a:hover {
  color: #D6E8FF !important;
}

/* =====================================================
   EXPANDABLE HEADER — Dark Mode explicit lock (Fix 1)
   Prevents white-on-white when --ag-surface resolves to
   the light-mode value (#FFFFFF) before theme JS runs.
   ===================================================== */
html.theme-dark .tool-expandable-header {
  background: #1a1f2e !important;
  color: #e0e0e0 !important;
}

html.theme-dark .tool-expandable-header:hover {
  background: rgba(255, 255, 255, 0.08) !important;
}

/* =====================================================
   REVEAL ANSWER BUTTONS — Dark Mode contrast (Fix 2)
   Replaces low-contrast btn-secondary muted grey.
   ===================================================== */
button[data-reveal-target],
.reveal-answer,
.btn-reveal {
  color: #B4D7FF !important;
  border: 1px solid rgba(180, 215, 255, 0.4) !important;
  background: transparent !important;
}
