/* ═══════════════════════════════════════════════════════════════
   Visual Thinking Engine — EdMe Style Design System
   ═══════════════════════════════════════════════════════════════ */

:root {
  /* Colors - Clean, bright palette */
  --white: #ffffff;
  --off-white: #fafbfc;
  --ghost: #f5f7f9;
  --mist: #e9ecef;
  --silver: #dee2e6;
  --gray: #6c757d;
  --charcoal: #495057;
  --ink: #212529;

  /* Semantic Colors */
  --primary: #1a73e8;
  --primary-soft: rgba(26, 115, 232, 0.1);
  --correct: #34a853;
  --correct-soft: rgba(52, 168, 83, 0.15);
  --incorrect: #ea4335;
  --incorrect-soft: rgba(234, 67, 53, 0.1);
  --warning: #fbbc04;
  --warning-soft: rgba(251, 188, 4, 0.2);

  /* Explanation Annotation Palette - Jony Ive: Purposeful, Semantic Color
     Each color has meaning. Muted backgrounds, refined accents. */

  /* Blue family - Attention & Connection (Apple's interactive color) */
  --anno-focus-bg: #EFF6FF;           /* Soft blue tint */
  --anno-focus-line: #3B82F6;         /* Clear blue */

  /* Lavender - Analysis & Claims */
  --anno-claim-bg: #F5F3FF;           /* Soft purple tint */
  --anno-claim-line: #8B5CF6;         /* Refined purple */

  /* Teal - Verified & Positive */
  --anno-verified: #14B8A6;           /* Confident teal */

  /* Amber - Warning & Traps */
  --anno-warning: #F59E0B;            /* Warm amber */

  /* Gray - Eliminated & Dismissed */
  --anno-eliminated: #9CA3AF;         /* Receding gray */

  /* Legacy mappings (for step colors in sidebar) */
  --anno-highlight-focus: var(--anno-focus-bg);
  --anno-highlight-claim: var(--anno-claim-bg);
  --anno-underline-verified: var(--anno-verified);
  --anno-underline-connect: var(--anno-focus-line);
  --anno-strikethrough: var(--anno-eliminated);
  --anno-circle-trap: var(--anno-warning);

  /* Shadows - Jony Ive style: barely visible, creates subtle depth */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.06);
  --shadow-xl: 0 12px 40px rgba(0, 0, 0, 0.08);

  /* Spacing - More generous for breathing room */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;

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

  /* Transitions - Jony Ive style: smooth, spring-like physics */
  --ease-out: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-smooth: cubic-bezier(0.4, 0, 0, 1);
  --duration-fast: 200ms;
  --duration-normal: 400ms;
  --duration-slow: 600ms;
  --duration-glacial: 800ms;

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ═══════════════════════════════════════════════════════════════
   Reset & Base
   ═══════════════════════════════════════════════════════════════ */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-sans);
  font-weight: 400;
  line-height: 1.6;
  color: var(--ink);
  background: var(--off-white);
  min-height: 100vh;
}

/* ═══════════════════════════════════════════════════════════════
   App & Two-Panel Layout
   ═══════════════════════════════════════════════════════════════ */

.app {
  min-height: 100vh;
  background: var(--off-white);
}

.panels {
  display: flex;
  min-height: 100vh;
}

/* Left Panel - Question */
.question-panel {
  flex: 1;
  padding: var(--space-xl);
  padding-right: var(--space-lg);
  max-width: 720px;
  margin: 0 auto;
  transition: max-width var(--duration-normal) var(--ease-out),
              padding var(--duration-normal) var(--ease-out);
}

/* Adjust question panel when sidebar is open */
.panels.sidebar-open .question-panel {
  max-width: calc(100vw - var(--sidebar-width) - var(--space-xl));
  margin-left: var(--space-lg);
  margin-right: auto;
}

/* Right Panel - Sidebar */
:root {
  --sidebar-width: 480px;
}

.sidebar-panel {
  width: var(--sidebar-width);
  background: var(--white);
  border-left: 1px solid var(--mist);
  display: flex;
  flex-direction: column;
  position: fixed;
  right: 0;
  top: 0;
  height: 100vh;
  transform: translateX(100%);
  transition: transform var(--duration-normal) var(--ease-out);
  z-index: 100;
  box-shadow: var(--shadow-xl);
}

.sidebar-panel.open {
  transform: translateX(0);
}

.sidebar-panel.open .sidebar-header,
.sidebar-panel.open .tutor-section,
.sidebar-panel.open .current-explanation,
.sidebar-panel.open .analysis-section {
  animation: sidebar-content-fade 0.4s var(--ease-smooth) backwards;
}

.sidebar-panel.open .sidebar-header { animation-delay: 0.1s; }
.sidebar-panel.open .tutor-section { animation-delay: 0.15s; }
.sidebar-panel.open .current-explanation { animation-delay: 0.2s; }
.sidebar-panel.open .analysis-section { animation-delay: 0.25s; }

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

/* ═══════════════════════════════════════════════════════════════
   Question Panel Header
   ═══════════════════════════════════════════════════════════════ */

.panel-header {
  text-align: center;
  margin-bottom: var(--space-lg);
  animation: header-fade 0.6s var(--ease-smooth);
}

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

.panel-header h1 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: var(--space-xs);
}

.panel-header p {
  font-size: 0.875rem;
  color: var(--gray);
}

/* ═══════════════════════════════════════════════════════════════
   Question Content
   ═══════════════════════════════════════════════════════════════ */

.question-content {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-md);
  margin-bottom: var(--space-lg);
  animation: content-reveal 0.6s var(--ease-smooth);
}

@keyframes content-reveal {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.question-text {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--ink);
  margin-bottom: var(--space-lg);
}

/* ═══════════════════════════════════════════════════════════════
   Text Annotations - Jony Ive Edition

   Two-color system: Warm (attention) + Cool (dismissed)
   Progressive opacity: Previous annotations fade as new ones appear
   ═══════════════════════════════════════════════════════════════ */

/* Base style for pre-wrapped annotation targets */
.anno-target {
  display: inline;
  transition: all var(--duration-slow) var(--ease-smooth);
}

/* Nested annotations (created dynamically for overlapping targets) */
.anno-nested,
.anno-dynamic {
  display: inline;
}

/* ─────────────────────────────────────────────────────────────────
   Blue Family - Focus & Connect (Attention)
   ───────────────────────────────────────────────────────────────── */

/* Highlight - Focus: "Look at this" (soft blue tint) */
.highlight-focus {
  background: var(--anno-focus-bg);
  padding: 2px 4px;
  border-radius: 3px;
  border-bottom: 2px solid var(--anno-focus-line);
  transition: all var(--duration-slow) var(--ease-smooth);
}

/* Underline - Connect: "Links to an option" (blue line) */
.underline-connect {
  text-decoration: underline;
  text-decoration-color: var(--anno-focus-line);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  transition: all var(--duration-slow) var(--ease-smooth);
}

/* ─────────────────────────────────────────────────────────────────
   Lavender - Claims & Analysis
   ───────────────────────────────────────────────────────────────── */

/* Highlight - Claim: "We're analyzing this" (soft lavender) */
.highlight-claim {
  background: var(--anno-claim-bg);
  padding: 2px 4px;
  border-radius: 3px;
  border-bottom: 2px solid var(--anno-claim-line);
  transition: all var(--duration-slow) var(--ease-smooth);
}

/* ─────────────────────────────────────────────────────────────────
   Teal - Verified & Positive
   ───────────────────────────────────────────────────────────────── */

/* Underline - Verified: "This checks out" (confident teal) */
.underline-verified {
  text-decoration: underline;
  text-decoration-color: var(--anno-verified);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  transition: all var(--duration-slow) var(--ease-smooth);
}

/* ─────────────────────────────────────────────────────────────────
   Gray - Eliminated & Dismissed
   ───────────────────────────────────────────────────────────────── */

/* Strikethrough - Eliminated: Clean gray line, text stays readable */
.strikethrough {
  position: relative;
}

.strikethrough::after {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 0;
  height: 1.5px;
  background: var(--anno-eliminated);
  animation: strikethrough-anim var(--duration-slow) var(--ease-smooth) forwards;
}

@keyframes strikethrough-anim {
  to {
    width: 100%;
  }
}

/* ─────────────────────────────────────────────────────────────────
   Amber - Warning & Traps
   ───────────────────────────────────────────────────────────────── */

.circle-trap {
  position: relative;
  display: inline-block;
  padding: 2px 6px;
}

.circle-trap::before {
  content: '';
  position: absolute;
  top: -4px;
  left: -4px;
  right: -4px;
  bottom: -4px;
  border: 2px solid var(--anno-warning);
  border-radius: 50%;
  opacity: 0;
  animation: circle-draw var(--duration-slow) var(--ease-smooth) forwards;
}

@keyframes circle-draw {
  0% {
    opacity: 0;
    transform: scale(0.9);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* Oval/pill shape for longer phrases */
.circle-trap.phrase::before {
  border-radius: 100px;
}

/* ─────────────────────────────────────────────────────────────────
   Animation - Gentle highlight with subtle pulse
   ───────────────────────────────────────────────────────────────── */

.animate-highlight {
  animation: annotation-appear 0.5s var(--ease-smooth);
}

@keyframes annotation-appear {
  0% {
    opacity: 0;
    transform: scale(0.98);
  }
  50% {
    transform: scale(1.02);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* Subtle glow for highlights when they appear */
.highlight-focus.animate-highlight,
.highlight-claim.animate-highlight {
  animation: highlight-pop 0.5s var(--ease-spring);
}

@keyframes highlight-pop {
  0% {
    opacity: 0;
    box-shadow: 0 0 0 0 transparent;
  }
  50% {
    box-shadow: 0 0 12px 2px rgba(59, 130, 246, 0.3);
  }
  100% {
    opacity: 1;
    box-shadow: none;
  }
}

/* Circle draws in with a subtle bounce */
.circle-trap.animate-highlight::before {
  animation: circle-draw-bounce 0.6s var(--ease-spring) forwards;
}

@keyframes circle-draw-bounce {
  0% {
    opacity: 0;
    transform: scale(0.8);
  }
  70% {
    opacity: 1;
    transform: scale(1.05);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* ═══════════════════════════════════════════════════════════════
   Options List
   ═══════════════════════════════════════════════════════════════ */

.options-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.option-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--white);
  border: 1px solid var(--mist);
  border-radius: var(--radius-lg);
  cursor: default;
  transition: all var(--duration-fast) var(--ease-out);
  box-shadow: var(--shadow-sm);
  animation: option-slide-in 0.5s var(--ease-smooth) backwards;
}

/* Staggered entrance for options */
.option-item:nth-child(1) { animation-delay: 0.1s; }
.option-item:nth-child(2) { animation-delay: 0.15s; }
.option-item:nth-child(3) { animation-delay: 0.2s; }
.option-item:nth-child(4) { animation-delay: 0.25s; }

@keyframes option-slide-in {
  from {
    opacity: 0;
    transform: translateX(-12px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.option-item:hover {
  border-color: var(--silver);
  box-shadow: var(--shadow-md);
  transform: translateX(4px);
}

.option-letter {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--charcoal);
  transition: all var(--duration-fast) var(--ease-out);
}

.option-content {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
}

.option-text {
  font-size: 0.9375rem;
  color: var(--ink);
  line-height: 1.5;
}

.option-badge {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

/* Correct Option */
.option-item.correct {
  background: var(--correct-soft);
  border-color: var(--correct);
  animation: correct-reveal 0.5s var(--ease-spring);
}

@keyframes correct-reveal {
  0% {
    box-shadow: 0 0 0 0 rgba(52, 168, 83, 0);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(52, 168, 83, 0.2);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(52, 168, 83, 0);
  }
}

.option-item.correct .option-letter {
  background: var(--correct);
  color: var(--white);
}

.option-item.correct .option-badge {
  background: var(--correct);
  color: var(--white);
  animation: badge-pop 0.4s var(--ease-spring);
}

@keyframes badge-pop {
  0% {
    opacity: 0;
    transform: scale(0.8);
  }
  70% {
    transform: scale(1.1);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* Eliminated Option */
.option-item.eliminated {
  opacity: 0.7;
}

.option-item.eliminated .option-text .strikethrough {
  color: var(--gray);
}

/* ═══════════════════════════════════════════════════════════════
   CTAs - Jony Ive inspired simplicity
   ═══════════════════════════════════════════════════════════════ */

/* Landing CTA - Opens Visual Explanation (shown on first page) */
.visual-explain-cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
  width: 100%;
  padding: var(--space-xl) var(--space-2xl);
  margin-top: var(--space-2xl);
  background: linear-gradient(135deg, #14b8a6 0%, #8b5cf6 100%);
  background-size: 200% 200%;
  border: none;
  border-radius: var(--radius-xl);
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-smooth);
  box-shadow: 0 8px 24px rgba(20, 184, 166, 0.3);
  font-family: inherit;
  animation: cta-entrance 0.8s var(--ease-smooth), cta-glow 3s ease-in-out infinite;
}

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

@keyframes cta-glow {
  0%, 100% {
    box-shadow: 0 8px 24px rgba(20, 184, 166, 0.3);
  }
  50% {
    box-shadow: 0 8px 32px rgba(139, 92, 246, 0.4);
  }
}

.visual-explain-cta:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(139, 92, 246, 0.45);
  animation: none;
}

.visual-explain-cta:active {
  transform: translateY(0);
  box-shadow: 0 4px 12px rgba(20, 184, 166, 0.25);
}

.visual-explain-cta .cta-text {
  font-size: 1rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.9);
  letter-spacing: -0.01em;
}

.visual-explain-cta .cta-action {
  font-size: 1.125rem;
  font-weight: 600;
  color: #ffffff;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.visual-explain-cta .cta-arrow {
  display: inline-block;
  transition: transform var(--duration-fast) var(--ease-spring);
  animation: arrow-bounce 1.5s ease-in-out infinite;
}

@keyframes arrow-bounce {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(4px); }
}

.visual-explain-cta:hover .cta-arrow {
  animation: none;
  transform: translateX(6px);
}

/* EdMe CTA - Links to Play Store (EdMe gradient: teal to purple) */
.edme-cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-lg) var(--space-xl);
  margin-top: var(--space-lg);
  background: linear-gradient(135deg, #14b8a6 0%, #8b5cf6 100%);
  border: none;
  border-radius: var(--radius-xl);
  text-decoration: none;
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-smooth);
  box-shadow: 0 4px 14px rgba(20, 184, 166, 0.25);
}

/* Main CTA - larger size for question panel */
.edme-cta.main-cta {
  width: 100%;
}

.edme-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(20, 184, 166, 0.35);
}

.edme-cta:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(20, 184, 166, 0.2);
}

.edme-cta .cta-text {
  font-size: 0.9375rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.9);
  letter-spacing: -0.01em;
}

.edme-cta .cta-action {
  font-size: 1.0625rem;
  font-weight: 600;
  color: #ffffff;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.edme-cta .cta-arrow {
  display: inline-block;
  transition: transform var(--duration-fast) var(--ease-spring);
}

.edme-cta:hover .cta-arrow {
  transform: translateX(4px);
}

/* ═══════════════════════════════════════════════════════════════
   Sidebar Panel
   ═══════════════════════════════════════════════════════════════ */

/* Sidebar Header - Minimal, airy */
.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-lg) var(--space-xl);
  border-bottom: none;
}

.sidebar-title {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-weight: 500;
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
  color: var(--charcoal);
  text-transform: uppercase;
}

.sidebar-icon {
  font-size: 1rem;
  opacity: 0.7;
}

.close-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ghost);
  border: none;
  border-radius: 50%;
  font-size: 1.125rem;
  color: var(--gray);
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-smooth);
}

.close-btn:hover {
  background: var(--mist);
  color: var(--ink);
  transform: scale(1.05);
}

/* Progress Bar - Subtle, refined */
.progress-bar {
  height: 2px;
  background: var(--ghost);
  margin: 0 var(--space-xl);
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg,
    var(--anno-focus-line) 0%,
    var(--anno-verified) 50%,
    var(--correct) 100%);
  background-size: 200% 100%;
  transition: width var(--duration-slow) var(--ease-smooth);
  border-radius: 1px;
  animation: progress-shimmer 2s ease-in-out infinite;
}

@keyframes progress-shimmer {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* Tutor Section - Compact, minimal */
.tutor-section {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-xl);
}

.tutor-avatar {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
}

.avatar-icon {
  font-size: 1.125rem;
}

.tutor-info {
  flex: 1;
}

.tutor-name {
  font-weight: 500;
  font-size: 0.875rem;
  color: var(--ink);
  margin-bottom: 2px;
}

.tutor-status {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.status-dot {
  width: 6px;
  height: 6px;
  background: var(--warning);
  border-radius: 50%;
  animation: pulse-soft 2s ease-in-out infinite;
}

.tutor-status.ready .status-dot {
  background: var(--correct);
  animation: none;
}

.status-text {
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--white);
  background: var(--warning);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  letter-spacing: 0.02em;
}

.tutor-status.ready .status-text {
  background: var(--correct);
}

@keyframes pulse-soft {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.9); }
}

/* Current Explanation (Typing Area) - Clean, spacious */
.current-explanation {
  padding: var(--space-lg) var(--space-xl);
  min-height: 80px;
  background: linear-gradient(180deg, var(--white) 0%, var(--off-white) 100%);
}

.typing-text {
  font-size: 0.9375rem;
  color: var(--ink);
  line-height: 1.7;
  font-weight: 400;
}

.typing-cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: var(--primary);
  margin-left: 2px;
  animation: cursor-blink 1.2s ease-in-out infinite;
  vertical-align: text-bottom;
}

@keyframes cursor-blink {
  0%, 45% { opacity: 1; }
  50%, 95% { opacity: 0; }
  100% { opacity: 1; }
}

/* Analysis Section - Jony Ive: generous space, clean hierarchy */
.analysis-section {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-lg) var(--space-xl);
  background: var(--off-white);
}

.analysis-header {
  display: none; /* Hide default header, steps are self-explanatory */
}

.analysis-icon {
  display: none;
}

.analysis-title {
  display: none;
}

.steps-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.steps-placeholder {
  font-size: 0.875rem;
  color: var(--gray);
  font-weight: 400;
  text-align: center;
  padding: var(--space-2xl) var(--space-lg);
  opacity: 0.7;
}

/* Individual Step - Jony Ive: vertical gradient border, floating number */
.step-item {
  display: flex;
  gap: var(--space-md);
  padding: var(--space-md) 0;
  padding-left: var(--space-md);
  background: transparent;
  border-left: 3px solid;
  border-image: linear-gradient(
    180deg,
    var(--anno-highlight-focus) 0%,
    var(--anno-underline-verified) 100%
  ) 1;
  border-radius: 0;
  animation: step-appear var(--duration-slow) var(--ease-smooth);
  animation-fill-mode: both;
}

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

.step-number {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(
    135deg,
    var(--anno-highlight-focus) 0%,
    var(--anno-underline-verified) 100%
  );
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  transition: transform var(--duration-normal) var(--ease-spring),
              box-shadow var(--duration-normal) var(--ease-out);
}

.step-item:hover .step-number {
  transform: scale(1.1);
  box-shadow: var(--shadow-md);
}

.step-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.step-text {
  font-size: 0.875rem;
  color: var(--ink);
  line-height: 1.6;
  font-weight: 400;
}

/* Step type label - small caps above text (like IDENTIFY, ANALYZE) */
.step-label {
  display: inline-block;
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 2px;
  opacity: 0.9;
}

/* Color-coded step variants - Semantic colors matching annotation types */

/* Blue - Focus & Connect (Attention) */
.step-item.step-highlight-focus,
.step-item.step-underline-connect {
  border-image: linear-gradient(180deg, var(--anno-focus-line) 0%, #2563EB 100%) 1;
}

.step-item.step-highlight-focus .step-number,
.step-item.step-underline-connect .step-number {
  background: var(--anno-focus-bg);
  border: 1px solid var(--anno-focus-line);
  color: var(--anno-focus-line);
}

.step-item.step-highlight-focus .step-label,
.step-item.step-underline-connect .step-label {
  color: var(--anno-focus-line);
}

/* Lavender - Claim & Analysis */
.step-item.step-highlight-claim {
  border-image: linear-gradient(180deg, var(--anno-claim-line) 0%, #7C3AED 100%) 1;
}

.step-item.step-highlight-claim .step-number {
  background: var(--anno-claim-bg);
  border: 1px solid var(--anno-claim-line);
  color: var(--anno-claim-line);
}

.step-item.step-highlight-claim .step-label {
  color: var(--anno-claim-line);
}

/* Teal - Verified & Positive */
.step-item.step-underline-verified {
  border-image: linear-gradient(180deg, var(--anno-verified) 0%, #0D9488 100%) 1;
}

.step-item.step-underline-verified .step-number {
  background: rgba(20, 184, 166, 0.1);
  border: 1px solid var(--anno-verified);
  color: var(--anno-verified);
}

.step-item.step-underline-verified .step-label {
  color: var(--anno-verified);
}

/* Amber - Warning & Traps */
.step-item.step-circle-trap {
  border-image: linear-gradient(180deg, var(--anno-warning) 0%, #D97706 100%) 1;
}

.step-item.step-circle-trap .step-number {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid var(--anno-warning);
  color: var(--anno-warning);
}

.step-item.step-circle-trap .step-label {
  color: var(--anno-warning);
}

/* Gray - Eliminated & Dismissed */
.step-item.step-strikethrough {
  border-image: linear-gradient(180deg, var(--anno-eliminated) 0%, #6B7280 100%) 1;
}

.step-item.step-strikethrough .step-number {
  background: var(--ghost);
  border: 1px solid var(--anno-eliminated);
  color: var(--charcoal);
}

.step-item.step-strikethrough .step-label {
  color: var(--anno-eliminated);
}

/* Schema Button Container */
.schema-button-container {
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid var(--ghost);
}

.schema-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-md);
  background: var(--white);
  border: 1px solid var(--primary);
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--primary);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
  font-family: inherit;
}

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

.schema-icon {
  font-size: 1rem;
}

/* Playback Controls - Jony Ive: minimal, floating */
.playback-controls {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-xl);
  background: var(--white);
  border-top: none;
}

.control-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ghost);
  border: none;
  border-radius: 50%;
  color: var(--charcoal);
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-smooth);
}

.control-btn:hover {
  background: var(--mist);
  color: var(--ink);
  transform: scale(1.08);
}

.control-btn:active {
  transform: scale(0.95);
}

.speed-control {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--gray);
  font-weight: 500;
}

.speed-control label {
  letter-spacing: 0.02em;
}

.speed-control select {
  padding: var(--space-xs) var(--space-sm);
  border: none;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-family: inherit;
  font-weight: 500;
  background: var(--ghost);
  color: var(--charcoal);
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-out);
  -webkit-appearance: none;
  appearance: none;
  padding-right: var(--space-md);
}

.speed-control select:hover {
  background: var(--mist);
}

.speed-control select:focus {
  outline: none;
  background: var(--mist);
}

/* ═══════════════════════════════════════════════════════════════
   Responsive - Mobile Layout
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 900px) {
  /* Stack panels vertically on mobile */
  .panels {
    flex-direction: column;
    min-height: auto;
  }

  .question-panel {
    padding: var(--space-md);
    max-width: 100%;
    margin: 0;
  }

  /* When sidebar is open, don't hide question panel */
  .panels.sidebar-open .question-panel {
    max-width: 100%;
    margin: 0;
  }

  /* Sidebar becomes inline on mobile, not fixed overlay */
  .sidebar-panel {
    position: relative;
    width: 100%;
    height: auto;
    max-height: none;
    transform: none;
    box-shadow: none;
    border-left: none;
    border-top: 1px solid var(--mist);
    display: none; /* Hidden by default */
  }

  .sidebar-panel.open {
    display: flex;
    transform: none;
  }

  /* Analysis section doesn't need fixed height on mobile */
  .analysis-section {
    max-height: none;
    overflow-y: visible;
  }

  /* Compact tutor section on mobile */
  .tutor-section {
    padding: var(--space-sm) var(--space-md);
  }

  .tutor-avatar {
    width: 32px;
    height: 32px;
  }

  .avatar-icon {
    font-size: 1rem;
  }

  /* Compact current explanation */
  .current-explanation {
    padding: var(--space-md);
    min-height: 60px;
  }

  /* Compact steps on mobile */
  .analysis-section {
    padding: var(--space-md);
  }

  .steps-list {
    gap: var(--space-md);
  }

  .step-item {
    padding: var(--space-sm) 0;
    padding-left: var(--space-sm);
  }

  .step-number {
    width: 24px;
    height: 24px;
    font-size: 0.6875rem;
  }

  .step-text {
    font-size: 0.8125rem;
  }

  /* Compact playback controls */
  .playback-controls {
    padding: var(--space-sm) var(--space-md);
  }

  /* Sidebar header compact */
  .sidebar-header {
    padding: var(--space-md);
  }

  /* Hide close button on mobile since it's inline */
  .close-btn {
    display: none;
  }

  /* Options more compact on mobile */
  .option-item {
    padding: var(--space-sm) var(--space-md);
    gap: var(--space-sm);
  }

  .option-letter {
    width: 32px;
    height: 32px;
    font-size: 0.875rem;
  }

  .option-text {
    font-size: 0.875rem;
  }

  /* Landing CTA - push down near center on mobile */
  .visual-explain-cta {
    padding: var(--space-lg) var(--space-xl);
    margin-top: 35vh; /* Push down near center */
  }

  .edme-cta {
    padding: var(--space-md) var(--space-lg);
  }

  /* Panel header compact */
  .panel-header h1 {
    font-size: 1.25rem;
  }

  .panel-header p {
    font-size: 0.8125rem;
  }

  /* Question text slightly smaller */
  .question-text {
    font-size: 0.9375rem;
    line-height: 1.7;
  }
}
