/**
 * Education Module Styles
 * Following Bubble Charte Graphique:
 * - White backgrounds privileged
 * - Violet var(--bubble-primary) for accents
 * - Inter font family
 * - Border-radius: 24px (cards), 50px (buttons/inputs)
 * - Animation timing: 0.3s-0.6s with cubic-bezier(0.16, 1, 0.3, 1)
 */

/* ===========================================
   CSS Variables (Education-specific)
   =========================================== */
:root {
  --education-bg: #FFFFFF;
  --education-card-bg: #F8F8F8;
  --education-primary: #333333;
  --education-accent: var(--bubble-primary);
  --education-accent-light: var(--bubble-primary-08);
  --education-accent-medium: var(--bubble-primary-15);
  --education-gain: #10B981;
  --education-loss: #EF4444;
  --education-neutral: #6B7280;
  --education-border: #EEEEEE;
  --education-glass: rgba(255, 255, 255, 0.7);
  --education-glass-blur: 10px;
  --education-radius-card: 24px;
  --education-radius-button: 50px;
  --education-timing: cubic-bezier(0.16, 1, 0.3, 1);

  /* Avatar sizing system for mobile responsiveness */
  --avatar-size-xs: 28px;   /* 360px screens and below */
  --avatar-size-sm: 32px;   /* 480px screens */
  --avatar-size-md: 36px;   /* 768px screens (tablet) */
  --avatar-size-lg: 40px;   /* 1024px+ screens (desktop) */

  /* Touch target sizing */
  --touch-target-min: 44px; /* Accessibility minimum */
  --touch-target-comfortable: 48px; /* Comfortable mobile reach */
}

/* ===========================================
   Education Hub Page
   =========================================== */
.education-hub {
  min-height: 100vh;
  background: var(--education-bg);
}

/* Education pages use standard .hero.hero-purple classes from styles.css */
/* Back button positioning inside hero */
.hero .back-button {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--education-border);
  z-index: 10;
}

@media (max-width: 768px) {
  .hero .back-button {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    margin-bottom: 1rem;
  }
}

/* ===========================================
   Dual Path Selector
   =========================================== */
.education-paths {
  padding: clamp(2rem, 4vw, 3rem) 0;
}

.paths-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  max-width: 900px;
  margin: 0 auto;
}

@media (max-width: 768px) {
  .paths-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
    padding: 0 1rem;
  }
}

/* Path Card - Glasmorphism with white dominance */
.path-card {
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(var(--glass-blur)) saturate(180%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(180%);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: var(--education-radius-card);
  padding: 1.5rem;
  text-decoration: none;
  color: inherit;
  transition: all 0.4s var(--education-timing);
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.path-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--bubble-primary-60), rgba(129, 140, 248, 0.3));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.path-card:hover {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(0, 0, 0, 0.12);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.6);
  transform: translateY(-4px);
}

.path-card:hover::before {
  opacity: 1;
}

/* Path Icon */
.path-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: var(--education-accent-light);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  color: var(--education-accent);
  transition: all 0.3s var(--education-timing);
}

.path-card:hover .path-icon {
  background: var(--education-accent);
  color: white;
  transform: scale(1.05);
}

/* Path Badge */
.path-badge {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--education-accent);
  background: var(--education-accent-light);
  padding: 0.3rem 0.625rem;
  border-radius: var(--education-radius-button);
  margin-bottom: 0.5rem;
  width: fit-content;
}

/* Path Title */
.path-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--education-primary);
  margin-bottom: 0.5rem;
}

/* Path Description */
.path-description {
  font-size: 0.875rem;
  color: var(--education-neutral);
  line-height: 1.55;
  margin-bottom: 1rem;
  flex-grow: 1;
}

/* Path Features - Obside-inspired transparent pills */
.path-features {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.path-features .feature-item {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--education-primary);
  /* Obside-inspired: transparent with subtle border */
  background: var(--bubble-primary-06);
  border: 1px solid var(--bubble-primary-15);
  border-radius: 50px;
  padding: 0.375rem 0.75rem;
  box-shadow: none;
  min-height: auto;
  transition: all 0.3s var(--education-timing);
  width: fit-content;
}

.path-features .feature-item svg {
  color: var(--education-accent);
  flex-shrink: 0;
  width: 14px;
  height: 14px;
}

.path-features .feature-item:hover {
  background: var(--bubble-primary-10);
  border-color: var(--bubble-primary-25);
  transform: translateX(2px);
  box-shadow: none;
}

/* Mini Chart Preview (Arena Card) */
.path-chart-preview {
  background: var(--education-card-bg);
  border-radius: 12px;
  padding: 0.75rem;
  margin-bottom: 1rem;
}

.mini-chart-container {
  width: 100%;
  height: 60px;
  margin-bottom: 0.5rem;
}

.mini-chart {
  width: 100%;
  height: 100%;
}

/* Animated line drawing effect */
.chart-line {
  stroke-dasharray: 300;
  stroke-dashoffset: 300;
  animation: drawLine 2s ease-out forwards;
}

.chart-line-equi { animation-delay: 0.1s; }
.chart-line-pari { animation-delay: 0.2s; }
.chart-line-momo { animation-delay: 0.3s; }
.chart-line-sage { animation-delay: 0.4s; }

@keyframes drawLine {
  to {
    stroke-dashoffset: 0;
  }
}

/* Animated playhead */
.chart-playhead {
  animation: movePlayhead 3s ease-in-out infinite;
}

@keyframes movePlayhead {
  0% { transform: translateX(0); }
  50% { transform: translateX(200px); }
  100% { transform: translateX(0); }
}

.mini-chart-legend {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.6875rem;
  color: var(--education-neutral);
}

.legend-item::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--legend-color);
}

/* Bot Avatars (Arena Card) */
.path-bots {
  display: flex;
  gap: 0.375rem;
  margin-bottom: 1rem;
}

.bot-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bot-color, var(--bubble-primary));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8125rem;
  transition: transform 0.3s var(--education-timing);
}

.path-card:hover .bot-avatar {
  transform: scale(1.1);
}

.path-card:hover .bot-avatar:nth-child(1) { transition-delay: 0.05s; }
.path-card:hover .bot-avatar:nth-child(2) { transition-delay: 0.1s; }
.path-card:hover .bot-avatar:nth-child(3) { transition-delay: 0.15s; }
.path-card:hover .bot-avatar:nth-child(4) { transition-delay: 0.2s; }

/* Chat Preview (Simulator Card) */
.path-chat-preview {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: var(--education-card-bg);
  border-radius: 12px;
}

.chat-bubble {
  padding: 0.5rem 0.75rem;
  border-radius: 12px;
  font-size: 0.75rem;
  max-width: 90%;
}

.chat-bubble.user {
  background: var(--education-accent);
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.chat-bubble.bot {
  background: white;
  color: var(--education-primary);
  border: 1px solid var(--education-border);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

/* Chat Animation - Continuous looping */
.chat-animate {
  animation: chatLoop 4s ease-in-out infinite;
}

.chat-animate-1 { animation-delay: 0s; }
.chat-animate-2 { animation-delay: 0.8s; }
.chat-animate-3 { animation-delay: 2s; }

@keyframes chatLoop {
  0%, 5% {
    opacity: 0;
    transform: translateY(10px);
  }
  15%, 85% {
    opacity: 1;
    transform: translateY(0);
  }
  95%, 100% {
    opacity: 0;
    transform: translateY(-5px);
  }
}

/* Typing Indicator */
.chat-typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0.5rem 0.75rem;
  background: white;
  border: 1px solid var(--education-border);
  border-radius: 12px;
  border-bottom-left-radius: 4px;
  align-self: flex-start;
  width: fit-content;
}

.chat-typing-indicator span {
  width: 6px;
  height: 6px;
  background: var(--education-neutral);
  border-radius: 50%;
  animation: typingDot 1.4s ease-in-out infinite;
}

.chat-typing-indicator span:nth-child(1) { animation-delay: 0s; }
.chat-typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.chat-typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingDot {
  0%, 60%, 100% {
    opacity: 0.3;
    transform: translateY(0);
  }
  30% {
    opacity: 1;
    transform: translateY(-4px);
  }
}

/* Typing indicator visibility synced with chat loop */
.chat-animate-2 {
  animation: typingLoop 4s ease-in-out infinite;
  animation-delay: 0.8s;
}

@keyframes typingLoop {
  0%, 5% {
    opacity: 0;
    transform: translateY(10px);
  }
  15%, 40% {
    opacity: 1;
    transform: translateY(0);
  }
  50%, 100% {
    opacity: 0;
    transform: translateY(0);
  }
}

/* Path CTA */
.path-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 0.75rem 1.25rem;
  background: linear-gradient(135deg, var(--bubble-primary-90) 0%, rgba(129, 140, 248, 0.8) 100%);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: white;
  border-radius: var(--education-radius-button);
  font-weight: 600;
  font-size: 0.875rem;
  transition: all 0.3s var(--education-timing);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 12px var(--bubble-primary-20);
}

.path-card:hover .path-cta {
  transform: scale(1.02);
  background: #6b7280;
  border-color: transparent;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.path-cta svg {
  width: 16px;
  height: 16px;
  transition: transform 0.3s ease;
}

.path-card:hover .path-cta svg {
  transform: translateX(4px);
}

/* ===========================================
   Why Learn Section
   =========================================== */
.education-why {
  padding: clamp(3rem, 6vw, 5rem) 0;
  background: var(--education-card-bg);
}

.education-why .section-title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  color: var(--education-primary);
  text-align: center;
  margin-bottom: 3rem;
}

.why-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  max-width: 1000px;
  margin: 0 auto;
}

@media (max-width: 768px) {
  .why-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 0 1rem;
  }
}

.why-card {
  background: var(--education-bg);
  border-radius: var(--education-radius-card);
  padding: 2rem;
  text-align: center;
  border: 1px solid var(--education-border);
  transition: all 0.3s var(--education-timing);
}

.why-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
}

.why-icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: var(--education-accent-light);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem;
}

.why-card h3 {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--education-primary);
  margin-bottom: 0.75rem;
}

.why-card p {
  font-size: 0.9375rem;
  color: var(--education-neutral);
  line-height: 1.6;
}

/* ===========================================
   Foundation Learning Series Section
   =========================================== */
.education-foundation {
  padding: clamp(3rem, 6vw, 5rem) 0;
  background: var(--education-card-bg);
}

.foundation-header {
  text-align: center;
  margin-bottom: 3rem;
}

.foundation-header .section-title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  color: var(--education-primary);
  margin-bottom: 1rem;
}

.foundation-subtitle {
  font-size: 1rem;
  color: var(--education-neutral);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}

.foundation-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

@media (max-width: 768px) {
  .foundation-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
}

.foundation-card {
  position: relative;
  background: var(--education-bg);
  border-radius: var(--education-radius-card);
  padding: 2rem;
  border: 1px solid var(--education-border);
  transition: all 0.3s var(--education-timing);
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
}

.foundation-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
  border-color: var(--education-accent);
}

.foundation-step {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--education-accent), var(--education-accent-light));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
  color: white;
}

.foundation-icon {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background: var(--education-accent-light);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  flex-shrink: 0;
}

.foundation-icon svg {
  color: var(--education-accent);
}

.foundation-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--education-primary);
  margin-bottom: 0.75rem;
  margin-top: 0.5rem;
  text-align: left;
}

.foundation-description {
  font-size: 0.9375rem;
  color: var(--education-neutral);
  line-height: 1.6;
  margin-bottom: 1.5rem;
  flex-grow: 1;
  text-align: left;
}

.foundation-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--education-accent);
  font-weight: 600;
  font-size: 0.9375rem;
  transition: gap 0.3s var(--education-timing);
  padding-top: 0.5rem;
  border-top: 1px solid var(--education-border);
}

.foundation-card:hover .foundation-cta {
  gap: 0.75rem;
}

.foundation-cta svg {
  flex-shrink: 0;
  transition: transform 0.3s var(--education-timing);
}

.foundation-card:hover .foundation-cta svg {
  transform: translateX(2px);
}

.foundation-note {
  background: linear-gradient(135deg, var(--bubble-primary-05) 0%, rgba(255, 255, 255, 0) 100%);
  border: 1px solid var(--education-accent-light);
  border-radius: var(--education-radius-card);
  padding: 1.5rem;
  text-align: center;
  margin-top: 1rem;
}

.foundation-note p {
  font-size: 0.9375rem;
  color: var(--education-primary);
  line-height: 1.6;
  margin: 0;
}

/* ===========================================
   Video Section
   =========================================== */
.education-videos {
  padding: clamp(2rem, 4vw, 3rem) 0;
  background: linear-gradient(180deg, var(--bubble-primary-03) 0%, transparent 100%);
}

.videos-header {
  text-align: center;
  margin-bottom: 2rem;
}

.videos-subtitle {
  font-size: 1rem;
  color: var(--education-neutral);
  max-width: 500px;
  margin: 0.75rem auto 0;
  line-height: 1.5;
}

.videos-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

@media (min-width: 640px) {
  .videos-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .videos-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
  }
}

.video-card {
  display: flex;
  flex-direction: column;
  background: var(--education-bg);
  border: 1px solid var(--education-border);
  border-radius: var(--education-radius-card);
  overflow: hidden;
  text-decoration: none;
  transition: all 0.3s var(--education-timing);
}

.video-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  border-color: var(--education-accent);
}

.video-thumbnail {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #1a1a2e;
}

.video-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.video-card:hover .video-thumbnail img {
  transform: scale(1.05);
}

.video-play-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 48px;
  height: 48px;
  background: var(--bubble-primary-90);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  opacity: 0;
  transition: all 0.3s ease;
}

.video-play-overlay svg {
  width: 20px;
  height: 20px;
  margin-left: 3px;
}

.video-card:hover .video-play-overlay {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1.1);
}

.video-duration {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.8);
  color: white;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}

.video-info {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.video-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--education-primary);
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.video-description {
  font-size: 0.8125rem;
  color: var(--education-neutral);
  line-height: 1.5;
  flex-grow: 1;
  margin-bottom: 0.75rem;
}

.video-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.video-channel {
  font-size: 0.75rem;
  color: var(--education-neutral);
  font-weight: 500;
}

.video-tag {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--education-accent);
  background: var(--education-accent-light);
  padding: 0.25rem 0.5rem;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ===========================================
   CTA Hook Section
   =========================================== */
.arena-cta-hook,
.simulator-cta-hook {
  margin: 2rem 0;
  padding: 0 1rem;
}

.cta-hook-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem;
  background: linear-gradient(135deg, var(--bubble-primary-08) 0%, rgba(139, 92, 246, 0.08) 100%);
  border: 1px solid var(--bubble-primary-20);
  border-radius: var(--education-radius-card);
  text-align: center;
}

@media (min-width: 768px) {
  .cta-hook-content {
    flex-direction: row;
    text-align: left;
    padding: 1.5rem 2rem;
  }
}

.cta-hook-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--education-accent), #8b5cf6);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cta-hook-icon svg {
  width: 24px;
  height: 24px;
  color: white;
}

.cta-hook-text {
  flex-grow: 1;
}

.cta-hook-text h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--education-primary);
  margin-bottom: 0.25rem;
}

.cta-hook-text p {
  font-size: 0.875rem;
  color: var(--education-neutral);
  margin: 0;
  line-height: 1.5;
}

.cta-hook-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  background: linear-gradient(135deg, var(--education-accent), #8b5cf6);
  color: white;
  text-decoration: none;
  border-radius: 24px;
  font-weight: 600;
  font-size: 0.875rem;
  transition: all 0.3s ease;
  white-space: nowrap;
  box-shadow: 0 4px 12px var(--bubble-primary-30);
}

.cta-hook-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px var(--bubble-primary-40);
}

.cta-hook-button svg {
  width: 16px;
  height: 16px;
}

/* Minimal inline CTA */
.inline-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--education-accent-light);
  color: var(--education-accent);
  text-decoration: none;
  border-radius: 20px;
  font-size: 0.8125rem;
  font-weight: 600;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.inline-cta:hover {
  background: white;
  border-color: var(--education-accent);
}

.inline-cta svg {
  width: 14px;
  height: 14px;
}

/* ===========================================
   Compliance Ribbon
   =========================================== */
.compliance-ribbon {
  background: var(--education-accent-light);
  padding: 1rem 0;
  border-top: 1px solid var(--education-accent-medium);
}

.compliance-ribbon p {
  font-size: 0.8125rem;
  color: var(--education-neutral);
  text-align: center;
  margin: 0;
  line-height: 1.5;
}

.compliance-ribbon strong {
  color: var(--education-primary);
}

/* ===========================================
   Education CTA Section
   =========================================== */
.education-cta-section {
  padding: clamp(2rem, 4vw, 3rem) 0;
}

.education-cta-card {
  background: linear-gradient(135deg, var(--bubble-primary-08) 0%, rgba(129, 140, 248, 0.05) 100%);
  border: 1px solid var(--bubble-primary-20);
  border-radius: var(--education-radius-card);
  padding: 2rem;
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
}

.education-cta-card h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--education-accent);
  margin-bottom: 0.75rem;
}

.education-cta-card p {
  font-size: 0.9375rem;
  color: var(--education-neutral);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.education-cta-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 2rem;
  background: linear-gradient(135deg, #333333 0%, #444444 100%);
  color: white;
  text-decoration: none;
  border-radius: var(--education-radius-button);
  font-weight: 600;
  font-size: 0.9375rem;
  transition: all 0.3s var(--education-timing);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.education-cta-button:hover {
  background: #6b7280;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.education-cta-button svg {
  transition: transform 0.3s ease;
}

.education-cta-button:hover svg {
  transform: translateX(4px);
}

/* ===========================================
   Arena Page Specific Styles
   =========================================== */
.arena-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: clamp(1.5rem, 4vw, 3rem);
  min-height: 100vh;
}

/* Arena Header */
.arena-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid var(--education-border);
}

/* Bot Cards Grid */
.arena-bots-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

@media (max-width: 1024px) {
  .arena-bots-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  /* Convert grid to horizontal carousel on mobile */
  .arena-bots-grid {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch; /* Momentum scrolling on iOS */
    gap: 1rem;
    padding: 0 1rem;
    margin-left: -1rem;
    margin-right: -1rem;
    margin-bottom: 2rem;
  }

  .arena-bot-card {
    flex: 0 0 calc(100% - 2rem);
    scroll-snap-align: start;
    padding: 1rem;
  }

  .arena-bot-avatar {
    width: 40px;
    height: 40px;
    font-size: 0.95rem;
  }
}

/* Individual Bot Card */
.arena-bot-card {
  background: var(--education-bg);
  border: 2px solid var(--education-border);
  border-radius: var(--education-radius-card);
  padding: 1.25rem;
  transition: all 0.3s var(--education-timing);
  cursor: pointer;
}

.arena-bot-card:hover,
.arena-bot-card.active {
  border-color: var(--bot-color, var(--education-accent));
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.arena-bot-card.active {
  background: var(--education-accent-light);
}

/* Recommended Bot Badge (Profile-based) */
.arena-bot-card.recommended {
  border-color: var(--bot-color, var(--education-accent));
  box-shadow: 0 0 0 3px var(--bubble-primary-15), 0 8px 24px rgba(0, 0, 0, 0.08);
  position: relative;
}

.arena-bot-recommended-badge {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  background: linear-gradient(135deg, var(--bubble-primary) 0%, #764ba2 100%);
  color: white;
  font-size: 0.7rem;
  font-weight: 600;
  border-radius: 50px;
  white-space: nowrap;
  box-shadow: 0 4px 12px var(--bubble-primary-35);
  z-index: 10;
  animation: badgePulse 2s ease-in-out infinite;
}

.arena-bot-recommended-badge svg {
  width: 12px;
  height: 12px;
  fill: #FFE066;
}

@keyframes badgePulse {
  0%, 100% {
    box-shadow: 0 4px 12px var(--bubble-primary-35);
  }
  50% {
    box-shadow: 0 4px 20px rgba(var(--bubble-primary-rgb), 0.55);
  }
}

/* Viewed Bot Card (user has clicked/interacted) */
.arena-bot-card.viewed::after {
  content: '';
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  background: var(--education-gain);
  border-radius: 50%;
}

@media (max-width: 600px) {
  .arena-bot-recommended-badge {
    font-size: 0.65rem;
    padding: 0.25rem 0.6rem;
    top: -8px;
  }

  .arena-bot-recommended-badge svg {
    width: 10px;
    height: 10px;
  }
}

.arena-bot-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.arena-bot-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--bot-color, var(--education-accent));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.25rem;
}

.arena-bot-info h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--education-primary);
  margin: 0;
}

.arena-bot-info .bot-strategy {
  font-size: 0.75rem;
  color: var(--education-neutral);
}

/* Bot Dialogue Bubble */
.arena-bot-dialogue {
  background: var(--education-card-bg);
  border-radius: 12px;
  padding: 0.875rem;
  margin-top: 0.75rem;
  font-size: 0.8125rem;
  color: var(--education-primary);
  line-height: 1.5;
  min-height: 60px;
}

.arena-bot-dialogue .typing-indicator {
  display: inline-flex;
  gap: 4px;
}

.arena-bot-dialogue .typing-indicator span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--education-neutral);
  animation: typing-bounce 1.4s infinite;
}

.arena-bot-dialogue .typing-indicator span:nth-child(2) {
  animation-delay: 0.2s;
}

.arena-bot-dialogue .typing-indicator span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typing-bounce {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.7;
  }
  30% {
    transform: translateY(-6px);
    opacity: 1;
  }
}

/* Bot P&L Display */
.arena-bot-pnl {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--education-border);
}

.pnl-value {
  font-size: 1.25rem;
  font-weight: 700;
}

.pnl-value.positive {
  color: var(--education-gain);
}

.pnl-value.negative {
  color: var(--education-loss);
}

/* P&L Pulse Animation */
@keyframes pnl-pulse {
  0%, 100% {
    box-shadow: 0 0 0 transparent;
  }
  50% {
    box-shadow: 0 0 12px rgba(var(--pulse-color-rgb), 0.3);
  }
}

.pnl-value.pulsing {
  animation: pnl-pulse 0.6s ease-out;
}

/* ===========================================
   Arena Chart Section
   =========================================== */
.arena-chart-section {
  background: var(--education-bg);
  border: 1px solid var(--education-border);
  border-radius: var(--education-radius-card);
  padding: 1.5rem;
  margin-bottom: 2rem;
}

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

.arena-chart-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--education-primary);
}

/* Timeline Controls */
.arena-timeline-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.timeline-btn {
  padding: 0.5rem 1rem;
  border: 1px solid var(--education-border);
  background: var(--education-bg);
  border-radius: var(--education-radius-button);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--education-neutral);
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.timeline-btn:hover {
  border-color: var(--education-accent);
  color: var(--education-accent);
}

.timeline-btn.active {
  background: var(--education-accent);
  color: white;
  border-color: var(--education-accent);
}

/* Mobile: Convert event buttons to horizontal scrollable timeline */
@media (max-width: 768px) {
  .arena-events {
    margin-bottom: 1.5rem !important;
  }

  .arena-events > div {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    gap: 0.5rem;
    padding: 0 0 0.5rem 0;
  }

  .timeline-btn {
    flex: 0 0 auto;
    min-width: fit-content;
    scroll-snap-align: start;
    white-space: nowrap;
    height: var(--touch-target-min, 44px);
  }
}

/* Play/Pause Button - Prominent */
.play-pause-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--education-accent) 0%, #8b5cf6 100%);
  color: white;
  border: 3px solid rgba(255, 255, 255, 0.3);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s var(--education-timing);
  box-shadow:
    0 4px 15px var(--bubble-primary-40),
    0 0 0 0 var(--bubble-primary-40);
  animation: pulse-glow 2s infinite;
  position: relative;
}

.play-pause-btn svg {
  width: 24px;
  height: 24px;
}

.play-pause-btn:hover {
  transform: scale(1.15);
  box-shadow:
    0 8px 25px var(--bubble-primary-50),
    0 0 30px var(--bubble-primary-30);
  animation: none;
}

.play-pause-btn:active {
  transform: scale(1.05);
}

/* Pulse glow animation for Play button */
@keyframes pulse-glow {
  0% {
    box-shadow:
      0 4px 15px var(--bubble-primary-40),
      0 0 0 0 var(--bubble-primary-50);
  }
  50% {
    box-shadow:
      0 4px 15px var(--bubble-primary-40),
      0 0 0 12px rgba(var(--bubble-primary-rgb), 0);
  }
  100% {
    box-shadow:
      0 4px 15px var(--bubble-primary-40),
      0 0 0 0 rgba(var(--bubble-primary-rgb), 0);
  }
}

/* Stop pulsing when playing */
.play-pause-btn.playing {
  animation: none;
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
}

/* Timeline Slider */
.arena-timeline-slider {
  width: 100%;
  margin: 1rem 0;
  position: relative;
}

.timeline-slider-track {
  width: 100%;
  height: 8px;
  -webkit-appearance: none;
  background: var(--education-border);
  border-radius: 4px;
  outline: none;
}

.timeline-slider-track::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--education-accent);
  cursor: pointer;
  box-shadow: 0 2px 8px var(--bubble-primary-35);
}

/* Event Markers on Timeline */
.timeline-event-markers {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 0;
  pointer-events: none;
}

.timeline-event-marker {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--education-loss);
  border: 2px solid white;
  transform: translate(-50%, -50%);
  cursor: pointer;
  pointer-events: auto;
  transition: transform 0.2s ease;
}

.timeline-event-marker:hover {
  transform: translate(-50%, -50%) scale(1.3);
}

.timeline-event-marker.positive {
  background: var(--education-gain);
}

/* Current Date Display */
.arena-current-date {
  text-align: center;
  font-size: 1rem;
  font-weight: 600;
  color: var(--education-primary);
  margin-top: 0.5rem;
}

/* ===========================================
   Leaderboard Section
   =========================================== */
.arena-leaderboard {
  background: var(--education-bg);
  border: 1px solid var(--education-border);
  border-radius: var(--education-radius-card);
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.leaderboard-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--education-primary);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.leaderboard-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: var(--education-card-bg);
  border-radius: 12px;
  transition: all 0.3s ease;
}

.leaderboard-item:hover {
  transform: translateX(4px);
}

.leaderboard-rank {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--education-neutral);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
}

.leaderboard-item:nth-child(1) .leaderboard-rank {
  background: linear-gradient(135deg, #FFD700, #FFA500);
}

.leaderboard-item:nth-child(2) .leaderboard-rank {
  background: linear-gradient(135deg, #C0C0C0, #A0A0A0);
}

.leaderboard-item:nth-child(3) .leaderboard-rank {
  background: linear-gradient(135deg, #CD7F32, #8B4513);
}

.leaderboard-bot-info {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.leaderboard-bot-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bot-color, var(--education-accent));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
}

.leaderboard-bot-name {
  font-weight: 600;
  color: var(--education-primary);
}

.leaderboard-pnl {
  font-size: 1.125rem;
  font-weight: 700;
}

.leaderboard-pnl.positive {
  color: var(--education-gain);
}

.leaderboard-pnl.negative {
  color: var(--education-loss);
}

/* ===========================================
   Tutorial Stepper
   =========================================== */
.arena-tutorial {
  background: var(--education-accent-light);
  border: 1px solid var(--education-accent-medium);
  border-radius: var(--education-radius-card);
  padding: 1.5rem;
  margin-bottom: 2rem;
}

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

.tutorial-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--education-accent);
}

.tutorial-progress {
  font-size: 0.875rem;
  color: var(--education-neutral);
}

.tutorial-steps {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.tutorial-step {
  flex: 1;
  height: 4px;
  background: var(--education-border);
  border-radius: 2px;
  transition: background 0.3s ease;
}

.tutorial-step.completed {
  background: var(--education-accent);
}

.tutorial-step.active {
  background: linear-gradient(90deg, var(--education-accent), #818CF8);
}

.tutorial-content {
  font-size: 0.9375rem;
  color: var(--education-primary);
  line-height: 1.6;
}

.tutorial-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}

.tutorial-btn {
  padding: 0.625rem 1.25rem;
  border-radius: var(--education-radius-button);
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.tutorial-btn.primary {
  background: var(--education-accent);
  color: white;
  border: none;
}

.tutorial-btn.primary:hover {
  background: #5a67d8;
}

.tutorial-btn.secondary {
  background: transparent;
  color: var(--education-accent);
  border: 1px solid var(--education-accent);
}

.tutorial-btn.secondary:hover {
  background: var(--education-accent-light);
}

/* ===========================================
   Tutorial Overlay (Modal)
   =========================================== */
.tutorial-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.tutorial-overlay.active {
  opacity: 1;
  visibility: visible;
}

.tutorial-overlay .arena-tutorial {
  position: relative;
  max-width: 560px;
  width: 100%;
  margin: 0;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--bubble-primary-25);
  box-shadow: 0 28px 80px rgba(17, 24, 39, 0.35);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 1.75rem 1.75rem 1.5rem;
  animation: tutorialSlideIn 0.3s ease;
}

.tutorial-overlay .tutorial-header {
  padding-right: 3.25rem; /* Leave breathing room for the close icon */
}

@keyframes tutorialSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.tutorial-close-btn {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  width: 36px;
  height: 36px;
  border: 1px solid var(--bubble-primary-20);
  background: rgba(255, 255, 255, 0.9);
  color: var(--education-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.tutorial-close-btn:hover {
  background: var(--education-accent-light);
  color: var(--education-accent);
}

/* Help Button (fixed position) */
.arena-help-btn {
  position: fixed;
  bottom: 5.5rem;
  right: 1.5rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--education-accent);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px var(--bubble-primary-40);
  transition: all 0.3s ease;
  z-index: 1250;
  opacity: 0;
  visibility: hidden;
  transform: scale(0.8);
}

.arena-help-btn.visible {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
}

.arena-help-btn:hover {
  background: #5a67d8;
  transform: scale(1.1);
  box-shadow: 0 6px 16px var(--bubble-primary-50);
}

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

/* Mobile adjustments for help button */
@media (max-width: 768px) {
  .arena-help-btn {
    bottom: 4.5rem;
    right: 1rem;
    width: 40px;
    height: 40px;
  }

  .tutorial-overlay {
    padding: 0.75rem;
    align-items: flex-start;
  }

  .tutorial-overlay .arena-tutorial {
    max-width: 100%;
    margin-top: 0.5rem;
    padding: 1.25rem 1.1rem 1rem;
    max-height: calc(100vh - 1.5rem);
    overflow-y: auto;
  }

  .tutorial-header {
    align-items: flex-start;
    gap: 0.4rem;
  }

  .tutorial-title {
    font-size: 0.95rem;
  }

  .tutorial-progress {
    font-size: 0.8rem;
  }

  .tutorial-steps {
    gap: 0.35rem;
    margin-bottom: 0.75rem;
  }

  .tutorial-content {
    font-size: 0.9rem;
    line-height: 1.5;
  }

  .tutorial-actions {
    flex-direction: column;
  }

  .tutorial-btn {
    width: 100%;
    text-align: center;
  }

  .tutorial-close-btn {
    top: 0.75rem;
    right: 0.75rem;
    width: 32px;
    height: 32px;
  }
}

/* ===========================================
   Simulator Page Specific Styles
   Mobile-First Responsive Design
   =========================================== */
.simulator-edu-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 1rem;
  min-height: 100vh;
  padding-bottom: 100px; /* Space for FAB */
  width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}

/* ═══════════════════════════════════════════════════════════════
   Mobile-First Chatbot Interface
   ═══════════════════════════════════════════════════════════════ */

/* Chat Hero Section - HIDDEN (functionality moved to chatbot panel) */
.simulator-chat-hero {
  display: none !important; /* Quick actions are now in the floating chatbot */
}

.simulator-chat-hero-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--education-primary);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.simulator-chat-hero-title svg {
  width: 20px;
  height: 20px;
  color: var(--education-accent);
}

/* Chat Input in Hero */
.simulator-chat-input-wrapper {
  position: relative;
  margin-bottom: 1rem;
}

.simulator-chat-input {
  width: 100%;
  padding: 0.875rem 3rem 0.875rem 1rem;
  font-size: 1rem;
  font-family: inherit;
  border: 2px solid var(--bubble-primary-30);
  border-radius: 24px;
  background: white;
  color: var(--education-primary);
  transition: all 0.3s ease;
}

.simulator-chat-input:focus {
  outline: none;
  border-color: var(--education-accent);
  box-shadow: 0 0 0 4px var(--bubble-primary-15);
}

.simulator-chat-input::placeholder {
  color: #9CA3AF;
}

.simulator-chat-send-btn {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--education-accent), #8b5cf6);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.simulator-chat-send-btn:hover {
  transform: translateY(-50%) scale(1.05);
  box-shadow: 0 4px 12px var(--bubble-primary-40);
}

.simulator-chat-send-btn svg {
  width: 18px;
  height: 18px;
}

/* Quick Action Chips */
.simulator-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.simulator-quick-chip {
  padding: 0.5rem 0.875rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--education-accent);
  background: white;
  border: 1px solid var(--bubble-primary-25);
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.simulator-quick-chip:hover {
  background: var(--bubble-primary-10);
  border-color: var(--education-accent);
  transform: translateY(-1px);
}

.simulator-quick-chip:active {
  transform: translateY(0);
}

/* Chat Response Bubble */
.simulator-chat-response {
  background: white;
  border: 1px solid var(--education-border);
  border-radius: 16px;
  padding: 1rem;
  margin-top: 1rem;
  animation: chat-bubble-in 0.3s ease;
}

@keyframes chat-bubble-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.simulator-chat-response-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.simulator-chat-response-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--education-accent), #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
}

.simulator-chat-response-avatar svg {
  width: 16px;
  height: 16px;
  color: white;
}

.simulator-chat-response-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--education-primary);
}

.simulator-chat-response-text {
  font-size: 0.9375rem;
  color: var(--education-neutral);
  line-height: 1.5;
}

.simulator-chat-response-text strong {
  color: var(--education-primary);
}

/* Allocation Applied Confirmation */
.allocation-applied {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: rgba(16, 185, 129, 0.1);
  border-radius: 8px;
  margin-top: 0.75rem;
  font-size: 0.8125rem;
  color: #059669;
  font-weight: 500;
}

.allocation-applied svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Collapsible Controls Section on Mobile */
.simulator-controls-collapsible {
  margin-bottom: 1rem;
}

.simulator-controls-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 1rem;
  background: var(--education-bg);
  border: 1px solid var(--education-border);
  border-radius: var(--education-radius-card);
  cursor: pointer;
  transition: all 0.2s ease;
}

.simulator-controls-toggle:hover {
  border-color: var(--education-accent);
}

.simulator-controls-toggle-text {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--education-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.simulator-controls-toggle svg {
  width: 16px;
  height: 16px;
  color: var(--education-neutral);
  transition: transform 0.3s ease;
}

.simulator-controls-toggle[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.simulator-controls-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.simulator-controls-content.expanded {
  max-height: 1000px;
}

/* Hide chat hero on all screens - quick actions are in the chatbot */
@media (min-width: 1024px) {
  .simulator-chat-hero {
    display: none;
  }

  .simulator-controls-collapsible .simulator-controls-toggle {
    display: none;
  }

  .simulator-controls-content {
    max-height: none;
    overflow: visible;
  }
}

/* Mobile: More padding at bottom for floating chat input */
@media (max-width: 767px) {
  .simulator-edu-container {
    padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px));
  }
}

@media (min-width: 768px) {
  .simulator-edu-container {
    padding: 1.5rem;
    padding-bottom: 2rem;
  }
}

@media (min-width: 1024px) {
  .simulator-edu-container {
    max-width: 1200px;
    padding: 2rem 3rem;
    /* Make room for floating chat on right */
    padding-right: 460px;
  }
}

/* ===========================================
   Floating Chat FAB (Mobile/Tablet)
   =========================================== */
.chat-fab {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  min-width: 56px;
  height: 48px;
  padding: 0 0.9rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #111827;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
  z-index: 1000;
  transition: all 0.3s var(--education-timing);
}

.chat-fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.18);
}

.chat-fab:active {
  transform: scale(0.95);
}

.chat-fab-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 22px;
  height: 22px;
  background: var(--education-loss);
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid white;
}

.chat-fab-badge:empty,
.chat-fab-badge.hidden {
  display: none;
}

/* Hide FAB on desktop (chat always visible) */
@media (min-width: 1024px) {
  .chat-fab {
    display: none;
  }
}

/* Hide FAB when chat is open */
.chat-modal.open ~ .chat-fab,
body.chat-open .chat-fab {
  opacity: 0;
  pointer-events: none;
  transform: scale(0);
}

/* ===========================================
   Chat Modal Container
   =========================================== */
.chat-modal {
  position: fixed;
  inset: 0;
  z-index: 1001;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s var(--education-timing);
}

.chat-modal.open {
  pointer-events: auto;
  opacity: 1;
}

.chat-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.3s var(--education-timing);
}

.chat-modal.open .chat-modal-overlay {
  opacity: 1;
}

/* Desktop: no overlay, always visible */
@media (min-width: 1024px) {
  .chat-modal {
    pointer-events: auto;
    opacity: 1;
  }

  .chat-modal-overlay {
    display: none;
  }
}

/* ===========================================
   Chat Panel - Floating Window
   =========================================== */
.simulator-chat-panel {
  position: fixed;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(0, 0, 0, 0.06);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  z-index: 1002;
  transition: all 0.3s var(--education-timing);

  /* Mobile: Full screen */
  inset: 0;
  border-radius: 0;
  transform: translateY(100%);
}

.chat-modal.open .simulator-chat-panel {
  transform: translateY(0);
}

/* Tablet: Modal style */
@media (min-width: 768px) {
  .simulator-chat-panel {
    inset: auto;
    bottom: 1rem;
    right: 1rem;
    left: 1rem;
    top: auto;
    height: 80vh;
    max-height: 700px;
    border-radius: var(--education-radius-card);
    transform: translateY(20px) scale(0.95);
    opacity: 0;
  }

  .chat-modal.open .simulator-chat-panel {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

/* Desktop: Fixed sidebar */
@media (min-width: 1024px) {
  .simulator-chat-panel {
    position: fixed;
    top: auto;
    right: 1.25rem;
    bottom: 1.25rem;
    left: auto;
    width: 420px;
    height: auto;
    max-height: 88vh;
    border-radius: var(--education-radius-card);
    transform: none;
    opacity: 1;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.14);
  }

  /* Minimized state on desktop */
  .simulator-chat-panel.minimized {
    height: 60px;
    bottom: auto;
    overflow: hidden;
  }

  .simulator-chat-panel.minimized .chat-messages,
  .simulator-chat-panel.minimized .chat-input-container,
  .simulator-chat-panel.minimized .chat-quick-chips,
  .simulator-chat-panel.minimized .allocation-sliders,
  .simulator-chat-panel.minimized .chat-embedded-results {
    display: none;
  }
}

/* Chat Panel Header - Mobile First */
.chat-panel-header {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--education-border);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

@media (min-width: 768px) {
  .chat-panel-header {
    padding: 1rem 1.25rem;
    gap: 0.75rem;
  }
}

.chat-panel-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--education-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

@media (min-width: 768px) {
  .chat-panel-avatar {
    width: 36px;
    height: 36px;
  }
}

.chat-panel-avatar img {
  width: 20px;
  height: 20px;
}

@media (min-width: 768px) {
  .chat-panel-avatar img {
    width: 24px;
    height: 24px;
  }
}

.chat-panel-info h3 {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--education-primary);
  margin: 0;
}

@media (min-width: 768px) {
  .chat-panel-info h3 {
    font-size: 1rem;
  }
}

.chat-panel-info p {
  font-size: 0.6875rem;
  color: var(--education-gain);
  margin: 0;
}

@media (min-width: 768px) {
  .chat-panel-info p {
    font-size: 0.75rem;
  }
}

/* Chat Panel Controls - Minimize/Close Buttons */
.chat-panel-controls {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.chat-minimize-btn,
.chat-close-btn {
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--education-neutral);
  transition: all 0.2s ease;
}

.chat-minimize-btn:hover,
.chat-close-btn:hover {
  background: var(--education-accent-light);
  color: var(--education-accent);
}

.chat-minimize-btn:active,
.chat-close-btn:active {
  transform: scale(0.9);
}

/* Hide minimize on mobile, show close */
.chat-minimize-btn {
  display: none;
}

@media (min-width: 1024px) {
  .chat-minimize-btn {
    display: flex;
  }

  /* Close becomes restore on desktop when minimized */
  .simulator-chat-panel.minimized .chat-close-btn svg {
    transform: rotate(180deg);
  }
}

/* ===========================================
   Embedded Results (Mobile-only Chart inside Chat)
   =========================================== */
.chat-embedded-results {
  display: block;
  padding: 0.75rem;
  background: var(--education-card-bg);
  border-bottom: 1px solid var(--education-border);
  flex-shrink: 0;
}

.embedded-chart-container {
  aspect-ratio: 16 / 9;
  max-height: 350px;
  background: white;
  border-radius: 12px;
  padding: 0.5rem;
  margin-bottom: 0.75rem;
}

@media (max-width: 768px) {
  .embedded-chart-container {
    aspect-ratio: 4 / 3;
    max-height: 280px;
  }
}

@media (max-width: 480px) {
  .embedded-chart-container {
    aspect-ratio: 1.2 / 1;
    max-height: 240px;
  }
}

.embedded-chart-container canvas {
  width: 100%;
  height: 100%;
}

.embedded-metrics {
  display: flex;
  gap: 0.75rem;
  justify-content: space-around;
}

.embedded-metric {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.125rem;
}

.embedded-metric-label {
  font-size: 0.625rem;
  font-weight: 500;
  color: var(--education-neutral);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.embedded-metric-value {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--education-primary);
}

.embedded-metric-value.positive {
  color: var(--education-gain);
}

.embedded-metric-value.negative {
  color: var(--education-loss);
}

/* Tablet: smaller embedded results */
@media (min-width: 768px) {
  .embedded-chart-container {
    height: 120px;
  }

  .embedded-metrics {
    gap: 1rem;
  }

  .embedded-metric-label {
    font-size: 0.6875rem;
  }

  .embedded-metric-value {
    font-size: 1rem;
  }
}

/* Desktop: Hide embedded results (main chart always visible) */
@media (min-width: 1024px) {
  .chat-embedded-results {
    display: none;
  }
}

/* Chat Messages - Mobile First */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 0.875rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 120px;
}

@media (min-width: 768px) {
  .chat-messages {
    padding: 1.25rem;
    gap: 1rem;
    min-height: 180px;
  }
}

/* Chat Message Bubbles - Mobile First */
.chat-message {
  max-width: 90%;
  padding: 0.75rem 0.875rem;
  border-radius: 14px;
  font-size: 0.875rem;
  line-height: 1.45;
}

@media (min-width: 768px) {
  .chat-message {
    max-width: 85%;
    padding: 0.875rem 1rem;
    border-radius: 16px;
    font-size: 0.9375rem;
    line-height: 1.5;
  }
}

.chat-message.bot {
  background: var(--education-card-bg);
  color: var(--education-primary);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.chat-message.user {
  background: var(--education-accent);
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

/* Chat Input Container - Mobile First */
.chat-input-container {
  padding: 0.75rem;
  border-top: 1px solid var(--education-border);
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

@media (min-width: 768px) {
  .chat-input-container {
    padding: 1rem 1.25rem;
    gap: 0.75rem;
  }
}

/* Chat Input - Mobile First with iOS zoom prevention */
.chat-input {
  flex: 1;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--education-border);
  border-radius: var(--education-radius-button);
  /* 16px prevents iOS zoom on focus */
  font-size: 16px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.3s ease;
  min-width: 0; /* Flex item shrink fix */
}

@media (min-width: 768px) {
  .chat-input {
    padding: 0.75rem 1rem;
    font-size: 0.9375rem;
  }
}

.chat-input:focus {
  border-color: var(--education-accent);
}

/* Chat Send Button - Mobile First (44px touch target) */
.chat-send-btn {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 50%;
  background: var(--education-accent);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

/* Remove hover effects on touch devices */
@media (hover: hover) {
  .chat-send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px var(--bubble-primary-35);
  }
}

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

/* Results Panel - Mobile First */
.simulator-results-panel {
  background: var(--education-bg);
  border: 1px solid var(--education-border);
  border-radius: var(--education-radius-card);
  padding: 1rem;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  box-sizing: border-box;
}

@media (min-width: 768px) {
  .simulator-results-panel {
    padding: 1.5rem;
  }
}

.results-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--education-primary);
  margin-bottom: 0.75rem;
}

@media (min-width: 768px) {
  .results-title {
    font-size: 1.125rem;
    margin-bottom: 1rem;
  }
}

/* Results Chart - Mobile First with Responsive Aspect Ratio */
.results-chart-container {
  width: 100%;
  max-width: 100%;
  aspect-ratio: 4 / 3;
  min-height: 250px;
  max-height: 350px;
  margin-bottom: 1rem;
  overflow: hidden;
}

.results-chart-container canvas {
  width: 100% !important;
  height: 100% !important;
}

@media (min-width: 768px) {
  .results-chart-container {
    aspect-ratio: 16 / 9;
    min-height: 280px;
    max-height: 400px;
    margin-bottom: 1.5rem;
  }
}

@media (min-width: 1024px) {
  .results-chart-container {
    aspect-ratio: 16 / 9;
    min-height: 320px;
    max-height: 450px;
  }
}

/* Results Metrics Grid - Mobile First */
.results-metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}

@media (min-width: 768px) {
  .results-metrics-grid {
    gap: 0.75rem;
  }
}

/* Results Metric Card - Mobile First */
.results-metric-card {
  background: var(--education-card-bg);
  border-radius: 10px;
  padding: 0.75rem;
  text-align: center;
}

@media (min-width: 768px) {
  .results-metric-card {
    border-radius: 12px;
    padding: 1rem;
  }
}

.results-metric-label {
  font-size: 0.625rem;
  color: var(--education-neutral);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 0.125rem;
}

@media (min-width: 768px) {
  .results-metric-label {
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
  }
}

.results-metric-value {
  font-size: 1rem;
  font-weight: 700;
  color: var(--education-primary);
}

@media (min-width: 768px) {
  .results-metric-value {
    font-size: 1.25rem;
  }
}

.results-metric-value.positive {
  color: var(--education-gain);
}

.results-metric-value.negative {
  color: var(--education-loss);
}

/* ===========================================
   Mobile Optimizations (Legacy - keeping for education page)
   =========================================== */
@media (max-width: 480px) {
  .education-hero-title {
    font-size: 1.75rem;
  }

  .path-card {
    padding: 1.5rem;
  }

  .path-title {
    font-size: 1.25rem;
  }

  .arena-bots-grid {
    grid-template-columns: 1fr;
  }

  .arena-bot-card {
    padding: 1rem;
  }
}

/* ===========================================
   Allocation Sliders Component - Mobile First
   =========================================== */
.allocation-sliders {
  margin-top: 0.75rem;
  padding: 0.75rem;
  background: var(--education-card-bg, #F8F8F8);
  border-radius: 12px;
  border: 1px solid var(--education-border);
}

@media (min-width: 768px) {
  .allocation-sliders {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 16px;
  }
}

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

@media (min-width: 768px) {
  .sliders-header {
    margin-bottom: 1rem;
  }
}

.sliders-header h4 {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--education-primary);
  margin: 0;
}

@media (min-width: 768px) {
  .sliders-header h4 {
    font-size: 0.875rem;
  }
}

.sliders-total {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 16px;
  transition: all 0.3s ease;
}

@media (min-width: 768px) {
  .sliders-total {
    font-size: 0.875rem;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
  }
}

.sliders-total.valid {
  color: var(--education-gain);
  background: rgba(16, 185, 129, 0.1);
}

.sliders-total.invalid {
  color: var(--education-loss);
  background: rgba(239, 68, 68, 0.1);
}

.slider-row {
  margin-bottom: 0.625rem;
  position: relative;
}

@media (min-width: 768px) {
  .slider-row {
    margin-bottom: 0.75rem;
  }
}

.slider-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.25rem;
}

@media (min-width: 768px) {
  .slider-label {
    margin-bottom: 0.375rem;
  }
}

.slider-asset-name {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--education-primary);
}

@media (min-width: 768px) {
  .slider-asset-name {
    font-size: 0.8125rem;
  }
}

.slider-value {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--education-accent);
  min-width: 36px;
  text-align: right;
}

@media (min-width: 768px) {
  .slider-value {
    font-size: 0.8125rem;
    min-width: 40px;
  }
}

/* Slider Bar - Mobile optimized touch target */
.slider-bar {
  height: 10px;
  background: #E5E7EB;
  border-radius: 5px;
  overflow: hidden;
  position: relative;
}

@media (min-width: 768px) {
  .slider-bar {
    height: 8px;
    border-radius: 4px;
  }
}

.slider-fill {
  height: 100%;
  border-radius: 5px;
  transition: width 0.15s ease;
}

@media (min-width: 768px) {
  .slider-fill {
    border-radius: 4px;
  }
}

/* Hide native slider, show custom bar - 44px touch target */
.allocation-slider {
  position: absolute;
  width: 100%;
  height: 44px;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
  bottom: -17px;
  left: 0;
  margin: 0;
  -webkit-tap-highlight-color: transparent;
}

@media (min-width: 768px) {
  .allocation-slider {
    height: 24px;
    bottom: 0;
  }
}

/* Custom slider track styling (when slider is visible) */
.slider-row:hover .allocation-slider {
  opacity: 0;
}

/* Apply button - Mobile First */
.sliders-apply-btn {
  width: 100%;
  margin-top: 0.75rem;
  padding: 0.75rem 1rem;
  background: linear-gradient(135deg, var(--education-accent), #818CF8);
  color: white;
  border: none;
  border-radius: 50px;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  min-height: 44px; /* Touch target */
}

@media (min-width: 768px) {
  .sliders-apply-btn {
    margin-top: 1rem;
    font-size: 0.875rem;
    min-height: auto;
  }
}

/* Remove hover effects on touch devices */
@media (hover: hover) {
  .sliders-apply-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--bubble-primary-30);
  }
}

.sliders-apply-btn:active {
  transform: scale(0.98);
}

.sliders-apply-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ===========================================
   Quick Reply Chips (Chat Templates) - Mobile First
   =========================================== */
.chat-quick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  padding: 0.5rem 0.75rem;
  margin: 0;
  border-top: 1px solid var(--education-border);
  flex-shrink: 0;
}

@media (min-width: 768px) {
  .chat-quick-chips {
    gap: 0.5rem;
    padding: 0.75rem 1rem;
  }
}

/* Quick Chip Button - Mobile First with 44px touch target */
.quick-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--education-accent);
  background: var(--bubble-primary-08);
  border: 1px solid var(--bubble-primary-25);
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.25s ease;
  white-space: nowrap;
  min-height: 36px;
  -webkit-tap-highlight-color: transparent;
}

@media (min-width: 768px) {
  .quick-chip {
    gap: 0.375rem;
    padding: 0.5rem 0.875rem;
    font-size: 0.8125rem;
    min-height: auto;
  }
}

/* Remove hover effects on touch devices */
@media (hover: hover) {
  .quick-chip:hover {
    background: var(--bubble-primary-15);
    border-color: var(--education-accent);
    transform: translateY(-1px);
  }
}

.quick-chip:active {
  transform: scale(0.95);
  background: var(--bubble-primary-20);
}

.quick-chip.active {
  background: var(--education-accent);
  color: white;
  border-color: var(--education-accent);
}

@media (hover: hover) {
  .quick-chip.active:hover {
    background: #5169d6;
    border-color: #5169d6;
  }
}

/* ===========================================
   Arena Event Markers & Badges
   =========================================== */
.event-marker {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--education-loss);
  border: 2px solid white;
  transform: translateX(-50%);
  top: -11px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  z-index: 5;
}

.event-marker:hover {
  transform: translateX(-50%) scale(1.4);
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
}

.event-marker.event-crash { background: var(--education-loss); }
.event-marker.event-recovery { background: var(--education-gain); }
.event-marker.event-rally { background: #22C55E; }
.event-marker.event-volatility { background: #F59E0B; }
.event-marker.event-geopolitical { background: #8B5CF6; }
.event-marker.event-bear { background: #EF4444; }
.event-marker.event-banking { background: #DC2626; }
.event-marker.event-correction { background: #F97316; }

/* Event Badge (shown in date display) */
.event-badge {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: white;
  background: var(--education-loss);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  margin-left: 0.5rem;
  vertical-align: middle;
  animation: eventBadgePulse 2s ease-in-out infinite;
}

@keyframes eventBadgePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* Typing Cursor */
.typing-cursor {
  display: inline-block;
  animation: cursorBlink 1s step-end infinite;
  color: var(--education-accent);
  font-weight: 400;
}

@keyframes cursorBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* Arena Error State */
.arena-error {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--education-radius-card);
  padding: 1.5rem;
  margin-bottom: 2rem;
  color: var(--education-loss);
}

.arena-error svg {
  flex-shrink: 0;
}

.arena-error p {
  margin: 0;
  font-size: 0.9375rem;
}

/* Leaderboard Leader Animation */
.leaderboard-item.leader {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(255, 165, 0, 0.05));
  border: 1px solid rgba(255, 215, 0, 0.3);
}

.leaderboard-item.leader .leaderboard-rank {
  animation: leaderGlow 2s ease-in-out infinite;
}

@keyframes leaderGlow {
  0%, 100% { box-shadow: 0 0 0 transparent; }
  50% { box-shadow: 0 0 12px rgba(255, 215, 0, 0.5); }
}

/* Rank Change Animation */
.leaderboard-item {
  transition: all 0.4s var(--education-timing);
}

.leaderboard-item[data-rank="1"] { order: 1; }
.leaderboard-item[data-rank="2"] { order: 2; }
.leaderboard-item[data-rank="3"] { order: 3; }
.leaderboard-item[data-rank="4"] { order: 4; }

/* Event Button Active State */
.event-btn.active {
  background: var(--education-accent);
  color: white;
  border-color: var(--education-accent);
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
  .path-card,
  .arena-bot-card,
  .timeline-btn,
  .tutorial-btn {
    min-height: 44px;
  }

  .path-card:hover {
    transform: none;
  }

  .path-card:active {
    transform: scale(0.98);
  }
}

/* Reduced Motion Preference */
@media (prefers-reduced-motion: reduce) {
  .path-card,
  .arena-bot-card,
  .bot-avatar,
  .pnl-value {
    transition: none;
  }

  .typing-indicator span,
  .chat-typing-indicator span {
    animation: none;
  }

  .chat-animate {
    opacity: 1;
    transform: none;
    animation: none;
  }

  .chart-line {
    stroke-dasharray: none;
    stroke-dashoffset: 0;
    animation: none;
  }

  .chart-playhead {
    animation: none;
  }

  @keyframes pnl-pulse {
    0%, 100% {
      box-shadow: none;
    }
  }
}

/* ===========================================
   Trade Tape Component
   =========================================== */
.trade-tape {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 280px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0.5rem;
  scrollbar-width: thin;
  scrollbar-color: var(--education-accent) transparent;
}

.trade-tape::-webkit-scrollbar {
  width: 6px;
}

.trade-tape::-webkit-scrollbar-track {
  background: transparent;
}

.trade-tape::-webkit-scrollbar-thumb {
  background: var(--education-accent);
  border-radius: 3px;
}

.trade-tape::-webkit-scrollbar-thumb:hover {
  background: var(--education-accent-dark, #5a6fd1);
}

.trade-tape-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0.5rem 0.5rem;
  border-bottom: 1px solid var(--education-border);
  margin-bottom: 0.5rem;
}

.trade-tape-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--education-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Title icon removed - keeping title text clean */

/* Trade Entry */
.trade-entry {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.75rem;
  background: var(--education-card-bg);
  border-radius: 12px;
  font-size: 0.8125rem;
  opacity: 0;
  transform: translateX(-20px);
  transition: all 0.3s var(--education-timing);
}

.trade-entry.visible {
  opacity: 1;
  transform: translateX(0);
}

.trade-entry.slide-out {
  opacity: 0;
  transform: translateX(20px);
}

/* Trade type colors */
.trade-entry.trade-buy {
  border-left: 3px solid var(--education-gain);
}

.trade-entry.trade-sell {
  border-left: 3px solid var(--education-loss);
}

.trade-entry.trade-neutral {
  border-left: 3px solid var(--education-accent);
}

.ask-trade-btn {
  justify-self: end;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--bubble-primary-25);
  background: var(--bubble-primary-08);
  color: #333333;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.ask-trade-btn:hover {
  background: var(--bubble-primary-12);
  border-color: var(--bubble-primary-35);
}
.ask-trade-btn:active {
  transform: scale(0.98);
}

/* Chat suggestion tiles (shared for hub/arena/simulator side panel) */
.chat-suggestion-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}
.chat-suggestion-btn {
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--bubble-primary-25);
  background: var(--bubble-primary-08);
  color: #1f2937;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.chat-suggestion-btn:hover {
  background: var(--bubble-primary-14);
  border-color: var(--bubble-primary-35);
}
.chat-suggestion-btn:active {
  transform: scale(0.98);
}

/* Toggle button - mobile only (desktop uses minimized sidebar) */
/* Styled as a clean dialogue bubble shape - no border, just shadow */
.education-chat-toggle {
  display: none;
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  width: 54px;
  height: 48px;
  border-radius: 24px;
  border: none;
  background: #FFFFFF;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  color: #111827;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1300;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  overflow: visible;
}

/* Dialogue bubble tail - using SVG approach for clean single shape */
.education-chat-toggle::after {
  content: '';
  position: absolute;
  bottom: -6px;
  right: 6px;
  width: 14px;
  height: 12px;
  background: #FFFFFF;
  clip-path: path('M0,0 Q14,0 14,12 L0,0');
  z-index: 1;
}

/* Show toggle only on mobile when not hidden */
@media (max-width: 768px) {
  .education-chat-toggle:not(.hidden) {
    display: inline-flex;
  }
}
.education-chat-toggle.hidden {
  display: none !important;
}
.education-chat-toggle:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(0, 0, 0, 0.2);
}
.education-chat-toggle:active {
  transform: scale(0.95);
}
.education-chat-toggle svg {
  width: 28px;
  height: 28px;
}

/* Trade Bot Info */
.trade-bot {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 80px;
}

.trade-bot-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--bot-color, var(--education-accent));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
}

.trade-bot-name {
  font-weight: 500;
  color: var(--education-primary);
}

/* Trade Action */
.trade-action {
  color: var(--education-neutral);
  font-size: 0.75rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Trade Details (Assets) */
.trade-details {
  display: flex;
  gap: 0.25rem;
}

.trade-asset {
  display: inline-flex;
  align-items: center;
  gap: 0.125rem;
  padding: 0.125rem 0.375rem;
  background: var(--education-accent-light);
  border-radius: 4px;
  font-size: 0.6875rem;
  color: var(--education-accent);
  font-weight: 500;
}

/* Trade P&L */
.trade-pnl {
  font-weight: 600;
  font-size: 0.8125rem;
  min-width: 60px;
  text-align: right;
}

.trade-pnl.positive {
  color: var(--education-gain);
}

.trade-pnl.negative {
  color: var(--education-loss);
}

/* Responsive Trade Tape */
@media (max-width: 768px) {
  .trade-tape {
    max-height: 220px;
  }

  .trade-entry {
    grid-template-columns: auto 1fr auto;
    gap: 0.5rem;
    padding: 0.5rem;
  }

  .trade-details {
    display: none;
  }

  .trade-action {
    font-size: 0.6875rem;
  }

  .trade-bot-name {
    font-size: 0.75rem;
  }

  .trade-bot-avatar {
    width: 20px;
    height: 20px;
    font-size: 0.625rem;
  }
}

/* Mobile: Accordion pattern for Trade Tape section */
@media (max-width: 768px) {
  /* Container should stack vertically on tablet and below */
  [style*="grid-template-columns: 1fr 1fr"] {
    display: flex !important;
    flex-direction: column !important;
  }

  .trade-tape {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    opacity: 0;
  }

  .trade-tape.expanded {
    max-height: 400px;
    opacity: 1;
  }

  /* Toggle button styling */
  .trade-tape-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 1rem;
    background: var(--education-card-bg);
    border: 1px solid var(--education-border);
    border-radius: var(--education-radius-card);
    cursor: pointer;
    font-weight: 600;
    color: var(--education-primary);
    transition: all 0.3s ease;
  }

  .trade-tape-toggle:active {
    background: var(--education-accent-light);
  }

  .trade-tape-toggle.expanded {
    background: var(--education-accent-light);
    border-color: var(--education-accent);
  }
}

@media (max-width: 480px) {
  .trade-tape {
    max-height: 180px;
  }

  .trade-entry {
    grid-template-columns: auto 1fr auto;
  }

  .trade-bot {
    min-width: auto;
  }

  .trade-bot-name {
    display: none;
  }
}

/* ===========================================
   Action Vignettes Component
   Shows bot buy/sell actions during events
   =========================================== */
.action-vignettes {
  margin-top: 1rem;
  padding: 1rem;
  background: linear-gradient(135deg, var(--bubble-primary-05), var(--bubble-primary-10));
  border: 1px solid var(--bubble-primary-20);
  border-radius: var(--education-radius-card);
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: all 0.4s var(--education-timing);
}

.action-vignettes.visible {
  opacity: 1;
  max-height: 400px;
  padding: 1.25rem;
}

.vignettes-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--education-border);
}

.vignettes-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--education-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Title icon removed - keeping title text clean */

.vignettes-event {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--education-accent);
  background: var(--education-accent-light);
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
}

.vignettes-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
}

.vignette-item {
  background: white;
  border-radius: 12px;
  padding: 0.75rem;
  text-align: center;
  border: 2px solid transparent;
  transition: all 0.3s var(--education-timing);
  position: relative;
  opacity: 0;
  transform: translateY(10px);
  animation: vignette-slide-in 0.4s var(--education-timing) forwards;
}

/* Staggered animation for vignette items */
.vignette-item:nth-child(1) { animation-delay: 0.1s; }
.vignette-item:nth-child(2) { animation-delay: 0.2s; }
.vignette-item:nth-child(3) { animation-delay: 0.3s; }
.vignette-item:nth-child(4) { animation-delay: 0.4s; }

@keyframes vignette-slide-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.vignette-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--action-color, var(--education-accent));
  border-radius: 12px 12px 0 0;
}

.vignette-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.vignette-bot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  margin-bottom: 0.5rem;
}

.vignette-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bot-color, var(--education-accent));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 700;
}

.vignette-name {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--education-primary);
}

.vignette-action {
  font-size: 0.875rem;
  font-weight: 800;
  color: var(--action-color, var(--education-primary));
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.375rem;
}

.vignette-reason {
  font-size: 0.6875rem;
  color: var(--education-neutral);
  line-height: 1.4;
}

/* Vignette Ask Button */
.vignette-ask-btn {
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.375rem 0.5rem;
  font-size: 0.625rem;
  font-weight: 600;
  color: var(--education-accent);
  background: var(--bubble-primary-10);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
}

.vignette-ask-btn:hover {
  background: var(--bubble-primary-20);
  transform: scale(1.02);
}

.vignette-ask-btn svg {
  width: 12px;
  height: 12px;
}

/* Proactive Chatbot Prompt */
.proactive-prompt {
  margin-top: 1rem;
  padding: 0.875rem 1rem;
  background: linear-gradient(135deg, var(--education-accent-light), rgba(139, 92, 246, 0.1));
  border: 1px solid var(--bubble-primary-25);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  opacity: 0;
  transform: translateY(10px);
  animation: vignette-slide-in 0.4s var(--education-timing) 0.5s forwards;
}

.proactive-prompt-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.proactive-prompt-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--education-accent), #8b5cf6);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  flex-shrink: 0;
}

.proactive-prompt-icon svg {
  width: 20px;
  height: 20px;
}

.proactive-prompt-text {
  font-size: 0.875rem;
  color: var(--education-primary);
  line-height: 1.4;
}

.proactive-prompt-text strong {
  color: var(--education-accent);
}

.proactive-prompt-btn {
  padding: 0.625rem 1rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: white;
  background: linear-gradient(135deg, var(--education-accent), #8b5cf6);
  border: none;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
  box-shadow: 0 2px 8px var(--bubble-primary-30);
}

.proactive-prompt-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--bubble-primary-40);
}

/* Engagement tooltip for bot cards */
.bot-card-tooltip {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  background: var(--education-primary);
  color: white;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.375rem 0.75rem;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
  z-index: 10;
}

.bot-card-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--education-primary);
}

.arena-bot-card:hover .bot-card-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(-4px);
}

/* Responsive Vignettes */
@media (max-width: 768px) {
  .vignettes-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .vignettes-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .vignette-item {
    padding: 0.625rem;
  }

  .vignette-avatar {
    width: 28px;
    height: 28px;
    font-size: 0.75rem;
  }
}

@media (max-width: 480px) {
  .vignettes-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }

  .vignette-reason {
    font-size: 0.625rem;
  }

.vignette-action {
  font-size: 0.75rem;
}
}

/* ===========================================
   Education Chat (floating) - shared across hub/arena/simulator
   =========================================== */
.floating-chat-input[data-page-context^="education"] {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  width: min(90vw, 420px);
  z-index: 1200;
  /* Safe area support for phones with home indicator */
  bottom: max(1.25rem, env(safe-area-inset-bottom, 1.25rem));
}

.floating-chat-input[data-page-context^="education"] .floating-input-container {
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.18);
}

/* Mobile: Full width floating chat */
@media (max-width: 768px) {
  .floating-chat-input[data-page-context^="education"] {
    left: 1rem;
    right: 1rem;
    transform: none;
    width: auto;
    bottom: max(0.75rem, calc(env(safe-area-inset-bottom, 0px) + 0.75rem));
  }
}

/* Hide subtitle in chat panel for education pages */
.chat-side-panel-subtitle {
  display: none !important;
}

/* ===========================================
   Chat Side Panel - Mobile: hide title text, show logo only
   Minimized state is hidden on mobile (toggle button is used instead)
   =========================================== */
@media (max-width: 768px) {
  .chat-side-panel .chat-side-panel-title {
    display: none;
  }
  .chat-side-panel .chat-side-panel-icon {
    width: 24px;
    height: 24px;
  }
  /* Hide minimized sidebar on mobile - toggle button handles this */
  .chat-side-panel.is-minimized {
    display: none !important;
  }
}

/* ===========================================
   Dynamic Results Panel Expansion (Desktop)
   When chat is collapsed, expand to use full width
   =========================================== */
@media (min-width: 1024px) {
  /* Add smooth transitions to simulator container */
  .simulator-edu-container {
    transition: padding-right 0.4s cubic-bezier(0.16, 1, 0.3, 1),
                max-width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  }

  /* Chat collapsed: expand container to use full width */
  body.chat-collapsed .simulator-edu-container {
    padding-right: 3rem;
    max-width: 1100px;
  }

  /* Results panel expands with container */
  .simulator-results-panel {
    transition: padding 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  }

  body.chat-collapsed .simulator-results-panel {
    padding: 2rem;
  }

  /* Chart height expansion */
  .results-chart-container {
    transition: min-height 0.4s cubic-bezier(0.16, 1, 0.3, 1),
                max-height 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  }

  body.chat-collapsed .results-chart-container {
    min-height: 400px;
    max-height: 500px;
  }

  /* Metrics grid expansion - 3 columns when chat collapsed */
  .results-metrics-grid {
    transition: grid-template-columns 0.4s cubic-bezier(0.16, 1, 0.3, 1),
                gap 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  }

  body.chat-collapsed .results-metrics-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
  }

  /* Metric cards slightly larger when expanded */
  body.chat-collapsed .results-metric-card {
    padding: 1.25rem;
  }

  body.chat-collapsed .results-metric-value {
    font-size: 1.375rem;
  }
}

/* Ultra-wide screens: single row of metrics when collapsed */
@media (min-width: 1280px) {
  body.chat-collapsed .simulator-edu-container {
    max-width: 1200px;
  }

  body.chat-collapsed .results-chart-container {
    min-height: 450px;
    max-height: 550px;
  }

  body.chat-collapsed .results-metrics-grid {
    grid-template-columns: repeat(6, 1fr);
    gap: 1.25rem;
  }

  body.chat-collapsed .results-metric-card {
    padding: 1rem 0.75rem;
  }

  body.chat-collapsed .results-metric-label {
    font-size: 0.6875rem;
  }

  body.chat-collapsed .results-metric-value {
    font-size: 1.25rem;
  }
}

/* ===========================================
   Education Simulator - Period/Leverage/Baseline Controls
   =========================================== */

/* Controls Row */
.simulator-controls-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  align-items: center;
}

/* Period Selector */
.period-selector {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.period-buttons {
  display: flex;
  gap: 0.25rem;
}

.period-btn {
  padding: 0.375rem 0.75rem;
  border-radius: 20px;
  border: 1px solid #E5E7EB;
  background: white;
  font-size: 0.75rem;
  font-weight: 500;
  color: #4B5563;
  cursor: pointer;
  transition: all 0.2s ease;
}

.period-btn:hover {
  border-color: var(--education-accent);
  color: var(--education-accent);
}

.period-btn.active {
  border-color: var(--education-accent);
  background: var(--bubble-primary-10);
  color: var(--education-accent);
  font-weight: 600;
}

/* Leverage Toggle */
.leverage-toggle {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.leverage-pills {
  display: flex;
  gap: 0.25rem;
}

.leverage-pill {
  padding: 0.375rem 0.75rem;
  border-radius: 20px;
  border: 1px solid #E5E7EB;
  background: white;
  font-size: 0.75rem;
  font-weight: 500;
  color: #4B5563;
  cursor: pointer;
  transition: all 0.2s ease;
}

.leverage-pill:hover {
  border-color: var(--education-accent);
  color: var(--education-accent);
}

.leverage-pill.active {
  border-color: var(--education-accent);
  background: var(--bubble-primary-10);
  color: var(--education-accent);
  font-weight: 600;
}

.leverage-warning {
  display: none;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.6875rem;
  color: #F97316;
  background: rgba(249, 115, 22, 0.1);
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
}

.leverage-warning:not(.hidden) {
  display: flex;
}

/* Control Label */
.control-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #6B7280;
}

/* Baseline Toggle Chips */
.baseline-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
  align-items: center;
}

.baseline-label {
  font-size: 0.75rem;
  color: #9CA3AF;
  margin-right: 0.25rem;
}

.baseline-chip {
  padding: 0.25rem 0.625rem;
  border-radius: 16px;
  border: 1px solid #E5E7EB;
  background: white;
  color: #9CA3AF;
  font-size: 0.6875rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
}

.baseline-chip:hover {
  border-color: #6B7280;
  color: #6B7280;
}

.baseline-chip.active {
  border-color: currentColor;
  background: rgba(107, 114, 128, 0.1);
}

.baseline-chip.active[data-baseline="optimizedRP"] {
  border-color: #7C3AED;
  background: rgba(124, 58, 237, 0.1);
  color: #7C3AED;
}

.baseline-chip.active[data-baseline="equalWeight"] {
  border-color: #6B7280;
  background: rgba(107, 114, 128, 0.1);
  color: #6B7280;
}

.baseline-chip.active[data-baseline="SPY"] {
  border-color: #14B8A6;
  background: rgba(20, 184, 166, 0.1);
  color: #14B8A6;
}

/* Comparison Callout */
.comparison-callout {
  margin-top: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--bubble-primary-05);
  border-radius: 12px;
  border: 1px solid var(--bubble-primary-15);
  font-size: 0.8125rem;
  color: #4B5563;
}

.comparison-callout .positive {
  color: var(--education-gain);
}

.comparison-callout .negative {
  color: var(--education-loss);
}

/* ═══════════════════════════════════════════════════════════════
   Phase 9: Allocation Toggle & Collapsible Comparison Sections
   ═══════════════════════════════════════════════════════════════ */

/* Your Allocation Toggle Row */
.allocation-toggle-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  background: var(--bubble-primary-05);
  border-radius: 12px;
  border: 1px solid var(--bubble-primary-15);
}

.allocation-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

.allocation-toggle input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--bubble-primary);
  cursor: pointer;
}

.allocation-toggle .toggle-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #374151;
}

.allocation-badge {
  font-size: 0.75rem;
  color: #6B7280;
  background: white;
  padding: 0.25rem 0.5rem;
  border-radius: 8px;
  margin-left: auto;
}

/* Comparison Sections (collapsible) */
.comparison-section {
  margin-bottom: 0.75rem;
}

.comparison-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.5rem 0;
  background: none;
  border: none;
  font-size: 0.8125rem;
  font-weight: 600;
  font-family: inherit;
  color: #4B5563;
  cursor: pointer;
  text-align: left;
}

.comparison-header:hover {
  color: #374151;
}

.comparison-header .chevron {
  transition: transform 0.2s ease;
  margin-left: auto;
}

.comparison-header .chevron.rotated {
  transform: rotate(180deg);
}

.chip-count {
  font-size: 0.6875rem;
  color: #9CA3AF;
  font-weight: 400;
}

.comparison-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  padding: 0.5rem 0;
  max-height: 200px;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
}

.comparison-chips.collapsed {
  max-height: 0;
  padding: 0;
}

/* ETF Chips (styled similar to baseline chips) */
.etf-chip {
  padding: 0.25rem 0.625rem;
  border-radius: 16px;
  border: 1px solid #E5E7EB;
  background: white;
  color: #9CA3AF;
  font-size: 0.6875rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
}

.etf-chip:hover {
  border-color: #6B7280;
  color: #6B7280;
}

.etf-chip.active {
  border-color: currentColor;
  background: rgba(107, 114, 128, 0.1);
}

/* ETF Notice */
.etf-notice {
  font-size: 0.6875rem;
  color: #9CA3AF;
  margin: 0.5rem 0 1rem;
  padding: 0.5rem;
  background: #F9FAFB;
  border-radius: 8px;
  text-align: center;
}

/* ═══════════════════════════════════════════════════════════════
   Allocation Sliders Panel
   ═══════════════════════════════════════════════════════════════ */

.allocation-sliders-panel {
  background: #F8F8F8;
  border-radius: 16px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  font-family: inherit;
}

.sliders-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: #6B7280;
  margin-bottom: 0.75rem;
}

.allocation-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  color: #6B7280;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #E5E7EB;
}

.allocation-total-value {
  font-weight: 700;
  font-size: 0.875rem;
  color: #6B7280;
  transition: color 0.2s ease;
}

.allocation-total-value.valid {
  color: #10B981;
}

.allocation-total-value.invalid {
  color: #EF4444;
}

.allocation-total-value.warning {
  color: #F97316;
}

.slider-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.slider-label {
  display: flex;
  flex-direction: column;
  width: 70px;
  flex-shrink: 0;
}

.slider-label-text {
  font-size: 0.8125rem;
  font-weight: 500;
  color: #374151;
}

.slider-ticker {
  font-size: 0.625rem;
  color: #9CA3AF;
  font-weight: 400;
}

.slider-container {
  flex: 1;
  position: relative;
  height: 24px;
  display: flex;
  align-items: center;
}

.allocation-slider {
  width: 100%;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: #E5E7EB;
  border-radius: 3px;
  cursor: pointer;
  position: relative;
  z-index: 2;
}

.slider-track-fill {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 6px;
  border-radius: 3px;
  pointer-events: none;
  z-index: 1;
  transition: width 0.1s ease;
}

.allocation-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: white;
  border: 3px solid var(--bubble-primary);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.allocation-slider::-webkit-slider-thumb:hover {
  transform: scale(1.1);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}

.allocation-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: white;
  border: 3px solid var(--bubble-primary);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  cursor: pointer;
}

/* Color-coded slider thumbs */
.slider-row[data-ticker="SPY"] .allocation-slider::-webkit-slider-thumb {
  border-color: var(--bubble-primary);
}
.slider-row[data-ticker="IEF"] .allocation-slider::-webkit-slider-thumb {
  border-color: #10B981;
}
.slider-row[data-ticker="GLD"] .allocation-slider::-webkit-slider-thumb {
  border-color: #F97316;
}
.slider-row[data-ticker="CASH"] .allocation-slider::-webkit-slider-thumb {
  border-color: #6B7280;
}

.slider-row[data-ticker="SPY"] .allocation-slider::-moz-range-thumb {
  border-color: var(--bubble-primary);
}
.slider-row[data-ticker="IEF"] .allocation-slider::-moz-range-thumb {
  border-color: #10B981;
}
.slider-row[data-ticker="GLD"] .allocation-slider::-moz-range-thumb {
  border-color: #F97316;
}
.slider-row[data-ticker="CASH"] .allocation-slider::-moz-range-thumb {
  border-color: #6B7280;
}

.slider-value {
  width: 40px;
  font-size: 0.8125rem;
  font-weight: 600;
  text-align: right;
  color: #374151;
  flex-shrink: 0;
}

.apply-allocation-btn {
  width: 100%;
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  background: linear-gradient(135deg, var(--bubble-primary) 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.apply-allocation-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px var(--bubble-primary-35);
}

.apply-allocation-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.apply-allocation-btn.is-loading {
  position: relative;
  pointer-events: none;
  opacity: 0.9;
}

.apply-allocation-btn.is-loading::after {
  content: '';
  position: absolute;
  right: 0.85rem;
  top: 50%;
  width: 16px;
  height: 16px;
  margin-top: -8px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.6);
  border-top-color: #fff;
  animation: spinner 0.7s linear infinite;
}

.apply-allocation-btn.is-loading:hover {
  transform: none;
  box-shadow: none;
}

.apply-allocation-btn.is-loading:disabled {
  opacity: 0.9;
}

@keyframes spinner {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Export & Share Actions */
.export-share-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.export-btn,
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  border: 1px solid #E5E7EB;
  background: white;
  font-size: 0.75rem;
  font-weight: 500;
  color: #4B5563;
  cursor: pointer;
  transition: all 0.2s ease;
}

.export-btn:hover {
  border-color: var(--education-accent);
  color: var(--education-accent);
}

.share-btn {
  border-color: var(--education-accent);
  background: var(--bubble-primary-10);
  color: var(--education-accent);
}

.share-btn:hover {
  background: var(--bubble-primary-20);
}

#shareStatus {
  display: none;
  font-size: 0.75rem;
  color: var(--education-gain);
  align-items: center;
  gap: 0.25rem;
}

/* Mobile Responsive Adjustments */
@media (max-width: 640px) {
  .simulator-controls-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .period-selector,
  .leverage-toggle {
    width: 100%;
  }

  .period-buttons,
  .leverage-pills {
    flex-wrap: wrap;
  }

  .period-btn,
  .leverage-pill {
    padding: 0.5rem 0.875rem;
    min-height: 44px; /* Touch-friendly */
  }

  .baseline-toggles {
    gap: 0.375rem;
  }

  .baseline-chip {
    padding: 0.375rem 0.75rem;
    min-height: 36px;
  }

  .export-share-actions {
    width: 100%;
    justify-content: space-between;
  }

  .export-btn,
  .share-btn {
    flex: 1;
    justify-content: center;
    min-height: 44px;
  }
}

/* ============================================
   PLAYGROUND CHATBOT SYSTEM
   Chatbot-first experience for personality assessment
   ============================================ */

/* Playground Chat Container - Matches Product Demo Design */
.playground-chat-wrapper {
  max-width: 700px;
  margin: 0 auto;
  padding: 0 1rem;
}

.playground-chat-container {
  background: white;
  border-radius: 24px;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.15);
  overflow: hidden;
  min-height: 500px;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Chat Messages Area */
.playground-messages {
  flex: 1;
  padding: 1.25rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-height: 60vh;
  scroll-behavior: smooth;
}

/* Scrollbar Styling */
.playground-messages::-webkit-scrollbar {
  width: 6px;
}

.playground-messages::-webkit-scrollbar-track {
  background: transparent;
}

.playground-messages::-webkit-scrollbar-thumb {
  background: #ddd;
  border-radius: 3px;
}

.playground-messages::-webkit-scrollbar-thumb:hover {
  background: #bbb;
}

/* Message Bubbles - Matches Product Demo Design */
.playground-message {
  display: flex;
  animation: fadeInMessage 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  max-width: 90%;
}

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

.playground-message.user {
  justify-content: flex-end;
  align-self: flex-end;
}

.playground-message.bot {
  justify-content: flex-start;
  align-self: flex-start;
}

.playground-message .message-avatar {
  display: none; /* Hidden to match demo style */
}

.playground-message .message-content {
  padding: 0.85rem 1.05rem;
  border-radius: 20px;
  word-wrap: break-word;
  line-height: 1.45;
  font-size: 0.95rem;
  white-space: pre-wrap;
}

.playground-message.bot .message-content {
  background: #f8f8f8;
  color: #444444;
  border: 1px solid #eeeeee;
}

.playground-message.user .message-content {
  background: linear-gradient(135deg, #333333, #444444);
  color: white;
  font-weight: 500;
}

/* Typing Indicator - Matches Demo Design */
.playground-typing {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 1rem 1.2rem;
  background: #f8f8f8;
  border: 1px solid #eeeeee;
  border-radius: 20px;
  width: fit-content;
}

.playground-typing span {
  width: 8px;
  height: 8px;
  background: #999;
  border-radius: 50%;
  animation: typing 1.4s infinite;
}

.playground-typing span:nth-child(2) { animation-delay: 0.2s; }
.playground-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.6;
  }
  30% {
    transform: translateY(-10px);
    opacity: 1;
  }
}

/* Option Buttons */
.playground-options {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  padding: 0 0.5rem 1rem 3rem;
}

.playground-option {
  padding: 0.875rem 1.25rem;
  background: white;
  border: 2px solid #E5E7EB;
  border-radius: 16px;
  cursor: pointer;
  text-align: left;
  font-size: 0.95rem;
  color: #374151;
  transition: all 0.2s ease;
  animation: optionSlide 0.3s ease backwards;
}

.playground-option:nth-child(1) { animation-delay: 0.05s; }
.playground-option:nth-child(2) { animation-delay: 0.1s; }
.playground-option:nth-child(3) { animation-delay: 0.15s; }
.playground-option:nth-child(4) { animation-delay: 0.2s; }
.playground-option:nth-child(5) { animation-delay: 0.25s; }

@keyframes optionSlide {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.playground-option:hover {
  border-color: #333333;
  background: #FAFAFA;
  transform: translateX(4px);
}

.playground-option:active {
  transform: translateX(2px);
}

/* Navigation Cards */
.playground-nav-cards {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  padding: 0 0.5rem 1rem 3rem;
}

.playground-nav-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: white;
  border: 2px solid #E5E7EB;
  border-radius: 16px;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease;
  animation: optionSlide 0.3s ease backwards;
}

.playground-nav-card:hover {
  border-color: #333333;
  background: #FAFAFA;
  transform: translateX(4px);
}

.playground-nav-card .nav-card-icon {
  font-size: 1.5rem;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #F3F4F6;
  border-radius: 12px;
}

.playground-nav-card .nav-card-content {
  flex: 1;
}

.playground-nav-card .nav-card-title {
  font-weight: 600;
  color: #1F2937;
  display: block;
  margin-bottom: 0.125rem;
}

.playground-nav-card .nav-card-description {
  font-size: 0.875rem;
  color: #6B7280;
}

.playground-nav-card .nav-card-arrow {
  color: #9CA3AF;
  transition: transform 0.2s ease;
}

.playground-nav-card:hover .nav-card-arrow {
  transform: translateX(4px);
  color: #333333;
}

/* Profile Card */
.playground-profile-card {
  margin: 0 0.5rem 1rem 3rem;
  padding: 1.5rem;
  background: linear-gradient(135deg, #FAFAFA 0%, #F3F4F6 100%);
  border: 2px solid #E5E7EB;
  border-radius: 20px;
  animation: profileReveal 0.5s ease;
}

@keyframes profileReveal {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.playground-profile-card .profile-header {
  text-align: center;
  margin-bottom: 1.25rem;
}

.playground-profile-card .profile-badge {
  display: inline-block;
  padding: 0.5rem 1.25rem;
  background: linear-gradient(135deg, #333333 0%, #444444 100%);
  color: white;
  border-radius: 50px;
  font-weight: 700;
  font-size: 1.125rem;
  margin-bottom: 0.75rem;
}

.playground-profile-card .profile-allocation {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.playground-profile-card .allocation-item {
  padding: 0.375rem 0.75rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
}

.playground-profile-card .allocation-item.stocks {
  background: var(--bubble-primary-15);
  color: var(--bubble-primary);
}

.playground-profile-card .allocation-item.bonds {
  background: rgba(16, 185, 129, 0.15);
  color: #10B981;
}

.playground-profile-card .profile-spectrum {
  margin-bottom: 1rem;
}

.playground-profile-card .spectrum-bar {
  height: 8px;
  background: linear-gradient(90deg, #10B981 0%, #FBBF24 50%, #EF4444 100%);
  border-radius: 4px;
  position: relative;
  margin-bottom: 0.5rem;
}

.playground-profile-card .spectrum-marker {
  position: absolute;
  top: -4px;
  width: 16px;
  height: 16px;
  background: white;
  border: 3px solid #333333;
  border-radius: 50%;
  transform: translateX(-50%);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.playground-profile-card .spectrum-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: #6B7280;
}

.playground-profile-card .profile-note {
  font-size: 0.8rem;
  color: #9CA3AF;
  text-align: center;
  margin: 0;
  font-style: italic;
}

/* Chat Input */
.playground-input-container {
  padding: 1rem 1.5rem;
  background: white;
  border-top: 1px solid #E5E7EB;
  display: flex;
  gap: 0.75rem;
}

.playground-input {
  flex: 1;
  padding: 0.875rem 1.25rem;
  border: 2px solid #E5E7EB;
  border-radius: 50px;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s ease;
}

.playground-input:focus {
  border-color: #333333;
}

.playground-input::placeholder {
  color: #9CA3AF;
}

.playground-send-btn {
  width: 40px;
  height: 40px;
  border: none;
  background: linear-gradient(135deg, rgba(107, 114, 128, 0.9), rgba(107, 114, 128, 0.7));
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  transition: all 0.3s ease;
}

.playground-send-btn:hover {
  background: linear-gradient(135deg, #6b7280, #6b7280);
  transform: scale(1.05);
}

.playground-send-btn:active {
  transform: scale(0.98);
}

/* Message Animation */
.playground-message.animate {
  animation: messageSlideIn 0.3s ease-out forwards;
}

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

/* Action Buttons */
.playground-action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
  padding: 0.5rem 0;
}

.playground-action-btn {
  padding: 0.5rem 1rem;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s ease;
  border: 1px solid #E5E7EB;
  background: white;
  color: #374151;
}

.playground-action-btn:hover {
  border-color: #333333;
  background: #F9FAFB;
}

.playground-action-btn.primary {
  background: linear-gradient(135deg, #333333, #444444);
  color: white;
  border: none;
}

.playground-action-btn.primary:hover {
  background: linear-gradient(135deg, #444444, #555555);
  transform: translateY(-1px);
}

/* Hub Hero with Chat */
.education-hub .hub-chat-hero {
  padding: 2rem 0 3rem;
  background: linear-gradient(180deg, #F8F8FC 0%, #FFFFFF 100%);
}

.hub-chat-hero .hero-header {
  text-align: center;
  margin-bottom: 2rem;
}

.hub-chat-hero .hero-eyebrow {
  display: inline-block;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(17, 24, 39, 0.55);
  margin-bottom: 1.6rem;
}

.hub-chat-hero h1 {
  font-size: 2.5rem;
  font-weight: 800;
  color: #1F2937;
  margin-bottom: 0.75rem;
  line-height: 1.2;
}

.hub-chat-hero .hero-subtitle {
  font-size: 1.125rem;
  color: #6B7280;
  max-width: 600px;
  margin: 0 auto;
}

.hero-subtitle .subtitle-tagline {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--bubble-primary);
  letter-spacing: 0.02em;
}

/* Mobile Responsive */
@media (max-width: 640px) {
  .playground-chat-container {
    border-radius: 0;
    min-height: calc(100vh - 120px);
  }

  /* Auto-collapse older messages - show only last 4 */
  .playground-messages {
    max-height: calc(100vh - 200px);
    padding: 1rem;
  }

  .playground-message {
    display: flex;
  }

  .playground-message:nth-child(-n+1) {
    display: none; /* Hide first message */
  }

  /* "Earlier messages" toggle could be implemented with JavaScript */
  .playground-messages.expanded .playground-message {
    display: flex;
  }

  .playground-message .message-content {
    max-width: 90%;
    padding: 0.875rem 1rem;
    font-size: 0.9rem;
  }

  .playground-options,
  .playground-nav-cards,
  .playground-profile-card {
    padding-left: 0.5rem;
    margin-left: 0;
  }

  .hub-chat-hero h1 {
    font-size: 1.75rem;
  }

  .hub-chat-hero .hero-subtitle {
    font-size: 1rem;
  }

  .playground-input-container {
    padding: 0.75rem 1rem;
  }
}

/* ============================================
   FLOATING PLAYGROUND CHATBOT
   For Arena and Simulator pages
   ============================================ */

.floating-playground-chat {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.75rem;
}

/* Collapsed state - just the button */
.floating-playground-toggle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #333333 0%, #444444 100%);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
}

.floating-playground-toggle:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.floating-playground-toggle svg {
  width: 24px;
  height: 24px;
}

.floating-playground-toggle .icon-chat { display: block; }
.floating-playground-toggle .icon-close { display: none; }

.floating-playground-chat.open .floating-playground-toggle .icon-chat { display: none; }
.floating-playground-chat.open .floating-playground-toggle .icon-close { display: block; }

/* Expanded chat panel */
.floating-playground-panel {
  width: 360px;
  max-height: 500px;
  background: white;
  border-radius: 24px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.floating-playground-chat.open .floating-playground-panel {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* Panel header */
.floating-playground-header {
  padding: 1rem 1.25rem;
  background: linear-gradient(135deg, #333333 0%, #444444 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.floating-playground-header-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.floating-playground-avatar {
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.floating-playground-title {
  font-weight: 600;
  font-size: 0.95rem;
}

.floating-playground-subtitle {
  font-size: 0.75rem;
  opacity: 0.8;
  display: block;
}

.floating-playground-close {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.floating-playground-close:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* Panel messages */
.floating-playground-messages {
  height: 300px;
  padding: 1rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Reuse playground message styles */
.floating-playground-messages .playground-message .message-content {
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  max-width: 85%;
}

.floating-playground-messages .playground-options {
  padding: 0 0.25rem 0.75rem 2.5rem;
  gap: 0.5rem;
}

.floating-playground-messages .playground-option {
  padding: 0.625rem 1rem;
  font-size: 0.875rem;
}

.floating-playground-messages .playground-nav-cards {
  padding: 0 0.25rem 0.75rem 2.5rem;
  gap: 0.5rem;
}

.floating-playground-messages .playground-nav-card {
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
}

/* Panel input */
.floating-playground-input-container {
  padding: 0.75rem 1rem;
  background: #F9FAFB;
  border-top: 1px solid #E5E7EB;
  display: flex;
  gap: 0.5rem;
}

.floating-playground-input {
  flex: 1;
  padding: 0.625rem 1rem;
  border: 1px solid #E5E7EB;
  border-radius: 50px;
  font-size: 0.875rem;
  outline: none;
  transition: border-color 0.2s ease;
}

.floating-playground-input:focus {
  border-color: #333333;
}

.floating-playground-send {
  width: 36px;
  height: 36px;
  border: none;
  background: linear-gradient(135deg, rgba(107, 114, 128, 0.9), rgba(107, 114, 128, 0.7));
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  transition: all 0.3s ease;
}

.floating-playground-send:hover {
  background: linear-gradient(135deg, #6b7280, #6b7280);
}

/* Profile badge in floating chat */
.floating-playground-messages .playground-profile-card {
  margin: 0 0.25rem 0.5rem 2.5rem;
  padding: 1rem;
}

.floating-playground-messages .playground-profile-card .profile-badge {
  font-size: 1rem;
  padding: 0.375rem 1rem;
}

/* Mobile floating chat */
@media (max-width: 640px) {
  .floating-playground-chat {
    bottom: 1rem;
    right: 1rem;
  }

  .floating-playground-panel {
    width: calc(100vw - 2rem);
    max-width: 360px;
    max-height: 60vh;
  }

  .floating-playground-messages {
    height: 250px;
  }

  /* Arena chart height optimization for mobile */
  div[style*="height: 350px"] {
    height: 250px !important;
  }

  .arena-chart-section {
    padding: 1rem;
  }

  .arena-chart-title {
    font-size: 1rem;
  }
}

/* Extra small screens (360px and below) */
@media (max-width: 360px) {
  /* Further reduce chart height for very small screens */
  div[style*="height: 350px"] {
    height: 180px !important;
  }

  .arena-chart-section {
    padding: 0.875rem;
  }

  .timeline-btn {
    padding: 0.375rem 0.75rem;
    font-size: 0.8rem;
  }

  .arena-timeline-controls {
    gap: 0.5rem;
  }
}

/* ============================================
   BLOG ARTICLES SECTION STYLING
   ============================================ */

.education-articles {
  padding: clamp(3rem, 6vw, 5rem) 0;
  background: linear-gradient(135deg, var(--bubble-primary-03) 0%, rgba(249, 115, 22, 0.03) 100%);
  border-top: 1px solid var(--education-border);
}

.articles-header {
  text-align: center;
  margin-bottom: 3rem;
}

.articles-subtitle {
  max-width: 600px;
  margin: 1rem auto 0;
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.6;
}

.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.article-card {
  display: flex;
  flex-direction: column;
  background: var(--education-bg);
  border: 1px solid var(--education-border);
  border-radius: var(--education-radius-card);
  overflow: hidden;
  transition: all 0.3s var(--education-timing);
  text-decoration: none;
  color: inherit;
}

.article-card:hover {
  transform: translateY(-4px);
  border-color: var(--education-accent);
  box-shadow: 0 12px 40px var(--bubble-primary-10);
}

.article-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: linear-gradient(135deg, var(--education-accent), var(--education-accent-light));
  display: block;
}

.article-image-placeholder {
  width: 100%;
  height: 200px;
  background: linear-gradient(135deg, var(--education-accent), var(--education-accent-light));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: rgba(255, 255, 255, 0.3);
}

.article-content {
  flex: 1;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.article-tag {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: linear-gradient(135deg, var(--education-accent), var(--education-accent-light));
  color: white;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.article-title {
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
  word-wrap: break-word;
}

.article-summary {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  flex-grow: 1;
}

.article-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1rem;
  border-top: 1px solid var(--education-border);
}

.article-date {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.article-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--education-accent);
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.3s var(--education-timing);
}

.article-cta svg {
  width: 16px;
  height: 16px;
  transition: transform 0.3s var(--education-timing);
}

.article-card:hover .article-cta {
  gap: 0.75rem;
}

.article-card:hover .article-cta svg {
  transform: translateX(2px);
}

/* RESPONSIVE ADJUSTMENTS */

@media (max-width: 768px) {
  .articles-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .article-image {
    height: 180px;
  }

  .article-content {
    padding: 1.25rem;
  }

  .article-title {
    font-size: 1rem;
  }

  .article-summary {
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  .articles-grid {
    gap: 1rem;
  }

  .article-content {
    padding: 1rem;
  }

  .article-image {
    height: 150px;
  }

  .article-title {
    font-size: 0.95rem;
    line-height: 1.3;
  }

  .article-summary {
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
  }

  .article-footer {
    padding-top: 0.75rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
}

/* ========================================
   PLAYGROUND MOBILE BUTTON OPTIMIZATIONS
   For screens 640px and below
   ======================================== */
@media (max-width: 640px) {
  /* Stack navigation cards vertically with full-width touch targets */
  .playground-nav-cards {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0 1rem 1rem 1rem;
  }

  .playground-nav-card {
    min-height: 48px;
    padding: 1rem;
    justify-content: flex-start;
    border-radius: 24px;
  }

  .playground-nav-card .nav-card-icon {
    width: 44px;
    height: 44px;
    font-size: 1.5rem;
    flex-shrink: 0;
  }

  .playground-nav-card .nav-card-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0;
  }

  .playground-nav-card .nav-card-description {
    display: none;
  }

  /* Ensure input buttons meet touch target requirements (44px minimum) */
  .playground-mic-btn,
  .playground-send-btn {
    width: 44px;
    height: 44px;
    min-width: 44px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .playground-mic-btn svg,
  .playground-send-btn svg {
    width: 20px;
    height: 20px;
  }
}

@media (max-width: 480px) {
  /* Header optimization for very small screens */
  .playground-header {
    gap: 0.5rem;
    padding: 0.65rem 0.75rem;
  }

  .playground-header-actions {
    gap: 0.4rem;
  }

  .playground-lang-toggle {
    padding: 0.4rem 0.6rem;
    font-size: 0.75rem;
    min-width: auto;
  }

  .playground-close-btn {
    width: 40px;
    height: 40px;
    min-width: 40px;
  }

  /* Ensure nav cards remain full-width and stacked */
  .playground-nav-cards {
    padding: 0 0.75rem 1rem 0.75rem;
  }

  .playground-nav-card {
    padding: 0.875rem;
  }

  .playground-nav-card .nav-card-icon {
    width: 40px;
    height: 40px;
    font-size: 1.25rem;
  }

  .playground-nav-card .nav-card-title {
    font-size: 0.9rem;
  }
}

@media (max-width: 360px) {
  /* Ultra-small screen optimization */
  .playground-header {
    padding: 0.5rem 0.5rem;
  }

  .playground-lang-toggle {
    font-size: 0.7rem;
    padding: 0.3rem 0.5rem;
  }

  .playground-close-btn {
    width: 36px;
    height: 36px;
  }

  .playground-nav-cards {
    gap: 0.5rem;
    padding: 0 0.5rem 0.75rem 0.5rem;
  }

  .playground-nav-card {
    min-height: 44px;
    padding: 0.75rem;
    gap: 0.75rem;
  }

  .playground-nav-card .nav-card-icon {
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }

  .playground-nav-card .nav-card-title {
    font-size: 0.85rem;
  }

  .playground-input-form {
    gap: 0.35rem;
  }

  .playground-mic-btn,
  .playground-send-btn {
    width: 40px;
    height: 40px;
  }
}

/* ========================================
   FINAL MOBILE INPUT & BUTTON FIXES
   For missing text and placeholder issues
   ======================================== */

/* Ensure input field shows full placeholder text on mobile */
@media (max-width: 640px) {
  .playground-input {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    min-height: 40px;
  }

  .playground-input::placeholder {
    color: #9CA3AF;
    font-size: 0.85rem;
  }
}

@media (max-width: 480px) {
  .playground-input {
    padding: 0.625rem 0.875rem;
    font-size: 0.85rem;
  }

  .playground-input-form {
    gap: 0.35rem;
  }
}

@media (max-width: 360px) {
  .playground-input {
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
    border-radius: 20px;
  }

  /* Shorter placeholder for very small screens */
  .playground-input::placeholder {
    font-size: 0.75rem;
  }

  .playground-input-form {
    gap: 0.3rem;
  }
}

/* Force nav cards to be full-width vertical on all mobile devices */
@media (max-width: 768px) {
  .playground-nav-cards {
    display: flex !important;
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    gap: 0.75rem !important;
    padding: 0 0.5rem 1rem 0.5rem !important;
    width: 100% !important;
  }

  .playground-nav-card {
    display: flex !important;
    flex-direction: row !important;
    width: 100% !important;
    min-height: 44px !important;
    padding: 0.75rem 1rem !important;
    gap: 1rem !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
  }

  .playground-nav-card .nav-card-icon {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    font-size: 1.25rem !important;
    flex-shrink: 0 !important;
  }

  .playground-nav-card .nav-card-content {
    flex: 1 !important;
    min-width: 0 !important;
    overflow: hidden !important;
  }

  .playground-nav-card .nav-card-title {
    font-size: 0.95rem !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    margin-bottom: 0 !important;
  }

  .playground-nav-card .nav-card-description {
    display: none !important;
  }
}

@media (max-width: 480px) {
  .playground-nav-cards {
    padding: 0 0.5rem 0.75rem 0.5rem !important;
  }

  .playground-nav-card {
    min-height: 40px !important;
    padding: 0.625rem 0.75rem !important;
  }

  .playground-nav-card .nav-card-icon {
    width: 36px !important;
    height: 36px !important;
  }

  .playground-nav-card .nav-card-title {
    font-size: 0.85rem !important;
  }
}

/* ========================================
   ULTIMATE FIX: NAV CARDS STACKING
   This MUST come last to override all other rules
   ======================================== */
@media (max-width: 800px) {
  .playground-nav-cards {
    display: flex !important;
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    gap: 0.75rem !important;
    padding: 0 0.5rem 1rem !important;
    margin: 0 !important;
    width: auto !important;
  }

  .playground-nav-card {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    width: 100% !important;
    min-height: 44px !important;
    padding: 0.75rem 1rem !important;
    gap: 1rem !important;
    flex-wrap: nowrap !important;
    border-radius: 24px !important;
    justify-content: flex-start !important;
  }

  .playground-nav-card .nav-card-icon {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    flex-shrink: 0 !important;
  }

  .playground-nav-card .nav-card-content {
    flex: 1 !important;
    min-width: 0 !important;
    display: flex !important;
    flex-direction: column !important;
  }

  .playground-nav-card .nav-card-title {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    font-size: 0.95rem !important;
    margin-bottom: 0 !important;
  }

  .playground-nav-card .nav-card-description {
    display: none !important;
  }

  .playground-nav-card .nav-card-arrow {
    display: none !important;
  }
}

/* ===========================================
   Education Floating Chat Modal
   Fullscreen on mobile, modal on desktop
   Connects to Playground session
   =========================================== */
.education-chat-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s var(--education-timing), visibility 0.3s var(--education-timing);
}

.education-chat-modal.open {
  opacity: 1;
  visibility: visible;
}

.education-chat-container {
  width: 100%;
  max-width: 500px;
  height: 80vh;
  max-height: 700px;
  background: var(--education-bg);
  border-radius: var(--education-radius-card);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  transform: translateY(20px) scale(0.95);
  transition: transform 0.3s var(--education-timing);
}

.education-chat-modal.open .education-chat-container {
  transform: translateY(0) scale(1);
}

/* Mobile: Fullscreen */
@media (max-width: 768px) {
  .education-chat-container {
    max-width: 100%;
    height: 100%;
    max-height: 100%;
    border-radius: 0;
  }
}

/* Header */
.education-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--education-border);
  background: var(--education-card-bg);
}

.education-chat-header-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.education-chat-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--education-accent);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
}

.education-chat-titles {
  display: flex;
  flex-direction: column;
}

.education-chat-title {
  font-weight: 600;
  font-size: 1rem;
  color: var(--education-primary);
}

.education-chat-subtitle {
  font-size: 0.75rem;
  color: var(--education-neutral);
}

.education-chat-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--education-neutral);
  transition: all 0.2s ease;
}

.education-chat-close:hover {
  background: var(--education-card-bg);
  color: var(--education-primary);
}

/* Messages */
.education-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.education-chat-message {
  display: flex;
  gap: 0.5rem;
  animation: fadeInUp 0.3s ease;
}

.education-chat-message.user {
  flex-direction: row-reverse;
}

.education-chat-message .message-avatar {
  width: 28px;
  height: 28px;
  min-width: 28px;
  border-radius: 50%;
  background: var(--education-accent);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.education-chat-message.user .message-avatar {
  display: none;
}

.education-chat-message .message-content {
  max-width: 80%;
  padding: 0.75rem 1rem;
  border-radius: 16px;
  font-size: 0.9375rem;
  line-height: 1.5;
}

.education-chat-message.bot .message-content {
  background: var(--education-card-bg);
  color: var(--education-primary);
  border-bottom-left-radius: 4px;
}

.education-chat-message.user .message-content {
  background: var(--education-accent);
  color: white;
  border-bottom-right-radius: 4px;
}

/* Typing indicator */
.education-chat-typing {
  display: flex;
  gap: 0.5rem;
  animation: fadeInUp 0.3s ease;
}

.education-chat-typing .typing-dots {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0.75rem 1rem;
  background: var(--education-card-bg);
  border-radius: 16px;
  border-bottom-left-radius: 4px;
}

.education-chat-typing .typing-dots span {
  width: 8px;
  height: 8px;
  background: var(--education-neutral);
  border-radius: 50%;
  animation: typingBounce 1.4s ease-in-out infinite;
}

.education-chat-typing .typing-dots span:nth-child(1) { animation-delay: 0s; }
.education-chat-typing .typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.education-chat-typing .typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.5;
  }
  30% {
    transform: translateY(-6px);
    opacity: 1;
  }
}

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

/* Suggestions */
.education-chat-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0 1rem 0.75rem;
}

.education-suggestion-btn {
  padding: 0.5rem 0.875rem;
  font-size: 0.8125rem;
  background: var(--education-accent-light);
  color: var(--education-accent);
  border: 1px solid var(--bubble-primary-20);
  border-radius: var(--education-radius-button);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.education-suggestion-btn:hover {
  background: var(--education-accent);
  color: white;
  border-color: var(--education-accent);
}

/* Input form */
.education-chat-input-form {
  display: flex;
  gap: 0.5rem;
  padding: 1rem;
  border-top: 1px solid var(--education-border);
  background: var(--education-bg);
}

.education-chat-input {
  flex: 1;
  padding: 0.875rem 1rem;
  font-size: 1rem;
  border: 1px solid var(--education-border);
  border-radius: var(--education-radius-button);
  background: var(--education-card-bg);
  outline: none;
  transition: border-color 0.2s ease;
}

.education-chat-input:focus {
  border-color: var(--education-accent);
}

.education-chat-send {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 50%;
  border: none;
  background: var(--education-accent);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.education-chat-send:hover {
  background: #5a6fd6;
  transform: scale(1.05);
}

.education-chat-send:active {
  transform: scale(0.95);
}

/* Mic button for voice input */
.education-chat-mic {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 50%;
  border: 1px solid var(--education-border);
  background: var(--education-card-bg);
  color: var(--education-neutral);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.education-chat-mic:hover {
  border-color: var(--education-accent);
  color: var(--education-accent);
  transform: scale(1.05);
}

.education-chat-mic:active {
  transform: scale(0.95);
}

.education-chat-mic.recording {
  background: #EF4444;
  border-color: #EF4444;
  color: white;
  animation: pulse-recording 1.5s ease-in-out infinite;
}

@keyframes pulse-recording {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
  }
}

/* Mobile touch target fixes for education pages */
@media (max-width: 768px) {
  /* Ensure all interactive elements have 44px minimum touch target */
  .arena-bot-card,
  .timeline-btn,
  .event-btn,
  .play-pause-btn {
    min-height: var(--touch-target-min);
  }

  /* Timeline slider touch area */
  .timeline-slider-track {
    height: var(--touch-target-min);
    -webkit-appearance: none;
    cursor: pointer;
  }

  .timeline-slider-track::-webkit-slider-thumb {
    width: 24px;
    height: 24px;
    -webkit-appearance: none;
    cursor: grab;
  }

  /* Bot cards grid - single column on small screens */
  .arena-bots-grid {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }

  /* Chart touch interactions */
  .arena-chart-section canvas {
    touch-action: pan-x pan-y;
  }

  /* Floating chat input touch friendly */
  .floating-chat-input .floating-input-field {
    font-size: 16px !important; /* Prevents iOS zoom */
    min-height: var(--touch-target-min);
  }

  .floating-chat-input .floating-input-submit {
    width: var(--touch-target-min);
    height: var(--touch-target-min);
  }
}

/* Very small screens - 2 column bots grid */
@media (min-width: 400px) and (max-width: 768px) {
  .arena-bots-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* ═══════════════════════════════════════════════════════════════
   SIMULATOR IMPROVEMENTS - Phase 2
   ═══════════════════════════════════════════════════════════════ */

/* Task 1: Onboarding CTA in Chat */
.education-chat-onboarding-cta {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem;
  margin: 0.5rem 0;
  background: linear-gradient(135deg, var(--bubble-primary-08), rgba(139, 92, 246, 0.08));
  border: 1px solid var(--bubble-primary-20);
  border-radius: 16px;
  animation: fadeInUp 0.4s ease;
}

.onboarding-start-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 1.25rem;
  background: linear-gradient(135deg, var(--bubble-primary), #8b5cf6);
  color: white;
  font-size: 0.9375rem;
  font-weight: 600;
  border: none;
  border-radius: 50px;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px var(--bubble-primary-30);
}

.onboarding-start-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--bubble-primary-40);
}

.onboarding-start-btn:active {
  transform: scale(0.98);
}

.onboarding-skip-btn {
  padding: 0.625rem 1rem;
  background: transparent;
  color: var(--education-neutral);
  font-size: 0.8125rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: color 0.2s ease;
}

.onboarding-skip-btn:hover {
  color: var(--education-primary);
}

/* Task 2: Hide "Describe your strategy" card on mobile */
@media (max-width: 768px) {
  .simulator-chat-hero {
    display: none !important;
  }
}

/* Task 5: Metrics Tooltips */
.results-metric-card {
  position: relative;
}

.metric-info-icon {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 18px;
  height: 18px;
  color: var(--education-neutral);
  opacity: 0.5;
  cursor: help;
  transition: opacity 0.2s ease, color 0.2s ease;
}

.metric-info-icon:hover {
  opacity: 1;
  color: var(--education-accent);
}

.metric-tooltip {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: 240px;
  padding: 0.75rem 1rem;
  background: var(--education-primary);
  color: white;
  font-size: 0.75rem;
  line-height: 1.5;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  pointer-events: none;
}

.metric-tooltip::before {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-bottom-color: var(--education-primary);
}

.results-metric-card:hover .metric-tooltip,
.results-metric-card:focus-within .metric-tooltip {
  opacity: 1;
  visibility: visible;
}

.metric-tooltip-link {
  display: inline-block;
  margin-top: 0.5rem;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.6875rem;
  text-decoration: underline;
}

.metric-tooltip-link:hover {
  color: white;
}

/* Mobile: tap to show tooltip */
@media (max-width: 768px) {
  .metric-tooltip {
    left: 0;
    right: 0;
    transform: none;
    max-width: none;
    margin: 0 -0.5rem;
  }

  .metric-tooltip::before {
    left: calc(50% - 6px);
    transform: none;
  }
}

/* Task 6: Strategy Presets Mobile Carousel */
@media (max-width: 768px) {
  .baseline-toggles {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.5rem;
    margin: 0 -1rem;
    padding-left: 1rem;
    padding-right: 1rem;
    scrollbar-width: none;
  }

  .baseline-toggles::-webkit-scrollbar {
    display: none;
  }

  .baseline-chip,
  .etf-chip {
    flex-shrink: 0;
    scroll-snap-align: start;
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  .comparison-chips {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 0.5rem 0;
  }

  .comparison-chips::-webkit-scrollbar {
    display: none;
  }
}

/* Task 7: Control Info Icons */
.control-info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin-left: 0.25rem;
  color: var(--education-neutral);
  opacity: 0.6;
  cursor: help;
  transition: opacity 0.2s ease;
  vertical-align: middle;
}

.control-info-icon:hover {
  opacity: 1;
}

.control-label-with-tooltip {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.control-tooltip {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: max-content;
  max-width: 220px;
  padding: 0.625rem 0.875rem;
  background: var(--education-primary);
  color: white;
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1.4;
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  pointer-events: none;
}

.control-label-with-tooltip:hover .control-tooltip,
.control-label-with-tooltip:focus-within .control-tooltip {
  opacity: 1;
  visibility: visible;
}

/* Task 8: Chart Legend Cleanup */
.chart-legend-item.hidden {
  display: none !important;
}

.chart-legend-item:not(.active) {
  opacity: 0;
  height: 0;
  overflow: hidden;
  margin: 0;
  padding: 0;
}

/* Task 9: Remove vs bet card - hide by default */
.vs-bet-card,
.comparison-vs-bet {
  display: none !important;
}

/* Task 10: Smooth Animations */
.simulator-results-panel,
.results-metric-card,
.results-chart-container,
.allocation-sliders-panel,
.simulator-controls-row,
.comparison-section {
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.results-metric-value {
  transition: color 0.2s ease, transform 0.2s ease;
}

.results-metric-value.animating {
  animation: metricPulse 0.4s ease;
}

@keyframes metricPulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

/* Panel expand/collapse animation */
.comparison-chips {
  transition: max-height 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              padding 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.2s ease;
}

.comparison-chips.collapsed {
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  opacity: 0;
}

/* Chart update animation */
.results-chart-container canvas {
  transition: opacity 0.15s ease;
}

.results-chart-container.updating canvas {
  opacity: 0.6;
}

/* Slider animation */
.slider-track-fill {
  transition: width 0.15s ease-out;
}

/* Mobile-specific animation tweaks */
@media (max-width: 768px) {
  /* Reduce motion on mobile for performance */
  .simulator-results-panel,
  .results-metric-card,
  .results-chart-container {
    transition-duration: 0.2s;
  }

  /* Disable transform animations on low-power devices */
  @media (prefers-reduced-motion: reduce) {
    .results-metric-value.animating,
    .comparison-chips,
    .slider-track-fill {
      transition: none;
      animation: none;
    }
  }
}

/* Strategy pill info tooltips */
.baseline-chip,
.etf-chip {
  position: relative;
}

.chip-tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: 200px;
  padding: 0.5rem 0.75rem;
  background: var(--education-primary);
  color: white;
  font-size: 0.6875rem;
  line-height: 1.4;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  pointer-events: none;
  white-space: normal;
  text-align: center;
}

.chip-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--education-primary);
}

.baseline-chip:hover .chip-tooltip,
.etf-chip:hover .chip-tooltip {
  opacity: 1;
  visibility: visible;
}

/* Mobile: touch to show */
@media (max-width: 768px) {
  .chip-tooltip {
    bottom: auto;
    top: calc(100% + 8px);
    font-size: 0.75rem;
    max-width: 180px;
  }

  .chip-tooltip::after {
    top: auto;
    bottom: 100%;
    border-top-color: transparent;
    border-bottom-color: var(--education-primary);
  }
}

/* ═══════════════════════════════════════════════════════════════
   ARENA IMPROVEMENTS - Mobile & Animations
   ═══════════════════════════════════════════════════════════════ */

/* Arena Onboarding Prompt */
.arena-onboarding-prompt {
  background: linear-gradient(135deg, var(--bubble-primary-08), rgba(139, 92, 246, 0.08));
  border: 1px solid var(--bubble-primary-20);
  border-radius: var(--education-radius-card, 24px);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  animation: slideInDown 0.3s ease;
}

.arena-onboarding-prompt.dismissed {
  animation: slideOutUp 0.3s ease forwards;
}

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

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

.onboarding-prompt-content {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.onboarding-prompt-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--bubble-primary), #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  flex-shrink: 0;
}

.onboarding-prompt-text {
  flex: 1;
  min-width: 200px;
}

.onboarding-prompt-text strong {
  display: block;
  font-size: 1rem;
  color: var(--education-primary, #1F2937);
  margin-bottom: 0.25rem;
}

.onboarding-prompt-text p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--education-neutral, #6B7280);
  line-height: 1.5;
}

.onboarding-prompt-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.onboarding-prompt-btn {
  padding: 0.625rem 1.25rem;
  border-radius: 50px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.onboarding-prompt-btn.primary {
  background: linear-gradient(135deg, var(--bubble-primary), #8b5cf6);
  color: white;
  border: none;
  box-shadow: 0 2px 8px var(--bubble-primary-30);
}

.onboarding-prompt-btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--bubble-primary-40);
}

.onboarding-prompt-btn.secondary {
  background: transparent;
  color: var(--education-neutral, #6B7280);
  border: 1px solid var(--education-border, #E5E7EB);
}

.onboarding-prompt-btn.secondary:hover {
  border-color: var(--education-accent, var(--bubble-primary));
  color: var(--education-accent, var(--bubble-primary));
}

/* Mobile onboarding prompt */
@media (max-width: 480px) {
  .onboarding-prompt-content {
    flex-direction: column;
    text-align: center;
  }

  .onboarding-prompt-actions {
    width: 100%;
    justify-content: center;
  }

  .onboarding-prompt-btn {
    flex: 1;
    justify-content: center;
  }
}

/* Play/Pause Button Tap Animation */
.play-pause-btn.tapped {
  transform: scale(0.9);
}

/* Speed indicator more prominent on mobile */
@media (max-width: 768px) {
  #speedBtn {
    background: var(--education-accent-light, var(--bubble-primary-10));
    border-color: var(--education-accent, var(--bubble-primary));
    color: var(--education-accent, var(--bubble-primary));
    font-weight: 700;
    min-width: 60px;
  }
}

/* Leaderboard Change Animations */
.leaderboard-item.highlight {
  animation: leaderboardHighlight 0.6s ease;
}

.leaderboard-item.rank-up .leaderboard-rank {
  background: linear-gradient(135deg, #10B981, #059669) !important;
}

.leaderboard-item.rank-down .leaderboard-rank {
  background: linear-gradient(135deg, #EF4444, #DC2626) !important;
}

@keyframes leaderboardHighlight {
  0%, 100% { background: var(--education-card-bg); }
  50% { background: var(--bubble-primary-15); }
}

.rank-change {
  font-size: 0.625rem;
  margin-left: 0.25rem;
  display: inline-block;
  animation: rankChangePopIn 0.3s ease;
}

.rank-change.up {
  color: #10B981;
}

.rank-change.down {
  color: #EF4444;
}

@keyframes rankChangePopIn {
  0% { transform: scale(0); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* Trade Tape Mobile Improvements */
@media (max-width: 768px) {
  /* Full-width stacked cards on mobile */
  .arena-trade-tape {
    padding: 0.75rem !important;
  }

  .arena-sidebar-grid .trade-tape {
    max-height: none !important;
    overflow: visible !important;
    opacity: 1 !important;
  }

  .arena-sidebar-grid .trade-entry {
    grid-template-columns: 1fr !important;
    gap: 0.5rem !important;
    padding: 0.875rem !important;
    min-height: var(--touch-target-min, 44px);
  }

  .arena-sidebar-grid .trade-entry .trade-bot {
    justify-content: flex-start;
  }

  .arena-sidebar-grid .trade-entry .trade-action {
    font-size: 0.8125rem !important;
    white-space: normal !important;
  }

  .arena-sidebar-grid .trade-entry .trade-details {
    display: flex !important;
    flex-wrap: wrap;
  }

  .arena-sidebar-grid .trade-entry .trade-pnl {
    text-align: left !important;
    font-size: 1rem !important;
  }

  .arena-sidebar-grid .trade-entry .ask-trade-btn {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    min-height: var(--touch-target-min, 44px);
    margin-top: 0.5rem;
  }

  .arena-sidebar-grid .trade-bot-avatar {
    width: 32px !important;
    height: 32px !important;
    font-size: 0.875rem !important;
  }

  .arena-sidebar-grid .trade-bot-name {
    display: inline !important;
    font-size: 0.875rem !important;
  }
}

/* Trade entry slide-in animation (improved) */
.trade-entry.slide-in {
  animation: tradeSlideIn 0.2s ease-out forwards;
}

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

/* Leaderboard Mobile Improvements */
@media (max-width: 768px) {
  .arena-leaderboard {
    padding: 1rem !important;
  }

  .arena-leaderboard .leaderboard-item {
    padding: 0.875rem 1rem !important;
    min-height: var(--touch-target-min, 44px);
  }

  .arena-leaderboard .leaderboard-rank {
    width: 36px !important;
    height: 36px !important;
    font-size: 1rem !important;
  }

  .arena-leaderboard .leaderboard-bot-avatar {
    width: 40px !important;
    height: 40px !important;
    font-size: 1.125rem !important;
  }

  .arena-leaderboard .leaderboard-bot-name {
    font-size: 0.9375rem !important;
  }

  .arena-leaderboard .leaderboard-pnl {
    font-size: 1rem !important;
  }
}

/* Action Vignettes Mobile Improvements */
@media (max-width: 480px) {
  .action-vignettes.visible {
    padding: 1rem;
    max-height: none;
  }

  .action-vignettes .vignettes-grid {
    grid-template-columns: 1fr !important;
    gap: 0.75rem;
  }

  .action-vignettes .vignette-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    text-align: left;
    padding: 0.875rem !important;
    gap: 0.75rem;
    position: relative;
    padding-right: 6rem !important;
  }

  .action-vignettes .vignette-bot {
    flex-direction: row;
    margin-bottom: 0 !important;
    flex-shrink: 0;
  }

  .action-vignettes .vignette-avatar {
    width: 36px !important;
    height: 36px !important;
    font-size: 1rem !important;
  }

  .action-vignettes .vignette-name {
    font-size: 0.875rem !important;
  }

  .action-vignettes .vignette-action {
    font-size: 0.75rem !important;
    margin-bottom: 0 !important;
  }

  .action-vignettes .vignette-reason {
    font-size: 0.75rem !important;
    flex: 1;
  }

  .action-vignettes .vignette-ask-btn {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: auto !important;
    margin-top: 0 !important;
    padding: 0.5rem 0.75rem !important;
    font-size: 0.75rem !important;
    min-height: 36px;
  }

  /* Proactive prompt on mobile */
  .action-vignettes .proactive-prompt {
    flex-direction: column;
    text-align: center;
    gap: 0.75rem;
  }

  .action-vignettes .proactive-prompt-content {
    flex-direction: column;
  }

  .action-vignettes .proactive-prompt-btn {
    width: 100%;
    padding: 0.875rem 1.5rem;
    font-size: 0.9375rem;
    min-height: var(--touch-target-min, 44px);
  }
}

/* Event Buttons Mobile Carousel */
@media (max-width: 768px) {
  .arena-events > div {
    display: flex !important;
    overflow-x: auto !important;
    scroll-snap-type: x mandatory !important;
    -webkit-overflow-scrolling: touch !important;
    padding-bottom: 0.75rem !important;
    margin: 0 -1rem;
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .arena-events > div::-webkit-scrollbar {
    display: none;
  }

  .arena-events .event-btn {
    flex: 0 0 auto !important;
    scroll-snap-align: start !important;
    white-space: nowrap !important;
    padding: 0.75rem 1rem !important;
    font-size: 0.8125rem !important;
  }
}

/* Timeline Controls Mobile Improvements */
@media (max-width: 768px) {
  .arena-chart-header {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }

  .arena-timeline-controls {
    justify-content: center;
    gap: 1rem;
  }

  .arena-timeline-controls .play-pause-btn {
    width: 64px !important;
    height: 64px !important;
  }

  .arena-timeline-controls .play-pause-btn svg {
    width: 28px !important;
    height: 28px !important;
  }

  /* Timeline slider touch friendly */
  .arena-timeline-slider {
    margin: 1.5rem 0;
    padding: 0.5rem 0;
  }

  .arena-timeline-slider .timeline-slider-track {
    height: 8px !important;
  }

  .arena-timeline-slider .timeline-slider-track::-webkit-slider-thumb {
    width: 28px !important;
    height: 28px !important;
  }

  .arena-timeline-slider .timeline-slider-track::-moz-range-thumb {
    width: 28px !important;
    height: 28px !important;
  }

  .arena-current-date {
    font-size: 1rem !important;
    text-align: center;
  }

  .arena-current-date .event-badge {
    display: block;
    margin-top: 0.25rem;
  }
}

/* Bot Cards Mobile Spacing */
@media (max-width: 768px) {
  .arena-bots-grid {
    gap: 0.75rem !important;
    margin-bottom: 1.5rem;
  }

  .arena-bot-card {
    padding: 1rem !important;
  }

  .arena-bot-header {
    gap: 0.75rem;
  }

  .arena-bot-avatar {
    width: 40px !important;
    height: 40px !important;
  }

  .arena-bot-avatar svg {
    width: 24px !important;
    height: 24px !important;
  }

  .arena-bot-info h3 {
    font-size: 0.875rem !important;
  }

  .arena-bot-dialogue {
    font-size: 0.8125rem !important;
    min-height: 3rem;
  }

  .arena-bot-pnl {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
  }

  .arena-bot-pnl .pnl-value {
    font-size: 1.125rem !important;
  }
}

/* 2x2 grid on tablets */
@media (min-width: 480px) and (max-width: 768px) {
  .arena-bots-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.875rem !important;
  }
}

/* ============================================================================
   PHASE 5: "FLOATING IN WATER" ANIMATION FOR DUAL PATH CARDS
   ============================================================================ */

/* Apply subtle floating animation to dual path cards (2 cards with 7s duration) */
.path-card {
  animation: floatSubtle 7s ease-in-out infinite;
}

.path-card:nth-child(1) {
  animation-delay: 0s;
}

.path-card:nth-child(2) {
  animation-delay: 1.2s;
}

/* Pause animations on hover for stable interaction */
.path-card:hover {
  animation: none;
}
