:root {
  /* Modern Light Palette */
  --bg-top: #EEF4FF;
  --bg-bottom: #FFF8F1;
  --glow-1: rgba(99, 102, 241, 0.16);
  --glow-2: rgba(14, 165, 233, 0.14);
  --glow-3: rgba(245, 158, 11, 0.12);

  --surface: rgba(255, 255, 255, 0.9);
  --surface-solid: #FFFFFF;
  --surface-muted: #F4F7FC;
  --surface-elevated: #FFFFFF;
  --topbar-bg: linear-gradient(125deg, rgba(255, 255, 255, 0.95) 0%, rgba(238, 242, 255, 0.92) 52%, rgba(224, 242, 254, 0.94) 100%);
  --topbar-border: rgba(99, 102, 241, 0.22);
  --topbar-shadow: 0 12px 30px -10px rgba(79, 70, 229, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.92);
  --border-subtle: rgba(148, 163, 184, 0.24);
  --border-strong: #CBD5E1;

  --ink: #0F172A;
  --ink-soft: #475569;
  --ink-muted: #64748B;

  --primary: #4F46E5;
  --primary-light: #6366F1;
  --primary-dark: #3730A3;
  --primary-soft: #EEF2FF;
  --primary-border: #C7D2FE;

  --accent: #F59E0B;
  --accent-dark: #D97706;
  --success: #10B981;
  --success-dark: #059669;
  --danger: #F43F5E;
  --danger-dark: #E11D48;

  --bubble-bg: #F0F7FF;
  --bubble-border: #BAE6FD;
  --bubble-amazed-bg: #ECFDF5;
  --bubble-amazed-border: #6EE7B7;
  --bubble-confused-bg: #FFF7ED;
  --bubble-confused-border: #FDBA74;

  --board-frame: linear-gradient(145deg, #D99B52, #A86424);
  --board-surface: radial-gradient(circle at 25% 20%, #1F5F4B 0%, #123D30 100%);
  --recap-bg: linear-gradient(135deg, #ECFDF5, #F0FDF4);
  --recap-border: #6EE7B7;
  --recap-ink: #065F46;
  --recap-head: #059669;

  --radius-lg: 26px;
  --radius-md: 18px;
  --shadow-card: 0 18px 40px -14px rgba(15, 23, 42, 0.1), 0 4px 12px -4px rgba(15, 23, 42, 0.04);
  --shadow-soft: 0 8px 24px -8px rgba(15, 23, 42, 0.08);
}

/* Female Teacher Accent Theme */
body.theme-female {
  --bg-top: #FFF1F6;
  --bg-bottom: #FFFBEB;
  --glow-1: rgba(244, 63, 94, 0.14);
  --glow-2: rgba(236, 72, 153, 0.14);
  --primary: #E11D48;
  --primary-light: #F43F5E;
  --primary-dark: #9F1239;
  --primary-soft: #FFF1F2;
  --primary-border: #FECDD3;
  --topbar-bg: linear-gradient(125deg, rgba(255, 255, 255, 0.96) 0%, rgba(255, 241, 242, 0.93) 50%, rgba(254, 243, 199, 0.88) 100%);
  --topbar-border: rgba(244, 63, 94, 0.22);
  --topbar-shadow: 0 12px 30px -10px rgba(225, 29, 72, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

/* ==================== MODERN DARK MODE ==================== */
body.theme-dark {
  --bg-top: #090E1A;
  --bg-bottom: #111827;
  --glow-1: rgba(99, 102, 241, 0.22);
  --glow-2: rgba(14, 165, 233, 0.16);
  --glow-3: rgba(168, 85, 247, 0.15);

  --surface: rgba(20, 29, 47, 0.88);
  --surface-solid: #162033;
  --surface-muted: #1E293B;
  --surface-elevated: #1B273F;
  --topbar-bg: linear-gradient(125deg, rgba(30, 41, 59, 0.93) 0%, rgba(30, 27, 75, 0.88) 55%, rgba(15, 23, 42, 0.94) 100%);
  --topbar-border: rgba(129, 140, 248, 0.28);
  --topbar-shadow: 0 14px 34px -10px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  --border-subtle: rgba(148, 163, 184, 0.16);
  --border-strong: #334155;

  --ink: #F1F5F9;
  --ink-soft: #CBD5E1;
  --ink-muted: #94A3B8;

  --primary: #6366F1;
  --primary-light: #818CF8;
  --primary-dark: #4338CA;
  --primary-soft: rgba(99, 102, 241, 0.18);
  --primary-border: rgba(129, 140, 248, 0.35);

  --bubble-bg: rgba(30, 41, 59, 0.92);
  --bubble-border: rgba(56, 189, 248, 0.4);
  --bubble-amazed-bg: rgba(6, 78, 59, 0.55);
  --bubble-amazed-border: rgba(52, 211, 153, 0.5);
  --bubble-confused-bg: rgba(124, 45, 18, 0.48);
  --bubble-confused-border: rgba(251, 146, 60, 0.55);

  --board-frame: linear-gradient(145deg, #8B5E34, #593A1E);
  --board-surface: radial-gradient(circle at 25% 20%, #123D33 0%, #09221C 100%);
  --recap-bg: linear-gradient(135deg, rgba(6, 78, 59, 0.55), rgba(16, 185, 129, 0.18));
  --recap-border: rgba(52, 211, 153, 0.45);
  --recap-ink: #D1FAE5;
  --recap-head: #6EE7B7;

  --shadow-card: 0 22px 48px -14px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.05);
  --shadow-soft: 0 10px 28px -8px rgba(0, 0, 0, 0.45);
}

body.theme-dark.theme-female {
  --bg-top: #140D1B;
  --bg-bottom: #121524;
  --glow-1: rgba(244, 63, 94, 0.2);
  --glow-2: rgba(168, 85, 247, 0.18);
  --primary: #F43F5E;
  --primary-light: #FB7185;
  --primary-dark: #BE123C;
  --primary-soft: rgba(244, 63, 94, 0.18);
  --primary-border: rgba(251, 113, 133, 0.35);
  --topbar-bg: linear-gradient(125deg, rgba(35, 21, 46, 0.93) 0%, rgba(56, 22, 43, 0.88) 55%, rgba(24, 24, 42, 0.94) 100%);
  --topbar-border: rgba(251, 113, 133, 0.28);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--ink);
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 8%, var(--glow-1), transparent 40%),
    radial-gradient(circle at 88% 16%, var(--glow-2), transparent 38%),
    radial-gradient(circle at 50% 95%, var(--glow-3), transparent 45%),
    linear-gradient(160deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
  background-attachment: fixed;
  overflow-x: hidden;
  transition: background 0.35s ease, color 0.25s ease;
}

h1, h2, h3, .brand-name, .btn {
  font-family: 'Baloo 2', 'Nunito', sans-serif;
}

.hidden {
  display: none !important;
}

/* ==================== MODERN SVG ICONS ==================== */
.ui-svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.ui-svg-sm {
  width: 16px;
  height: 16px;
}

.mic-svg {
  width: 34px;
  height: 34px;
  position: relative;
  z-index: 1;
}

.star-svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 4px rgba(245, 158, 11, 0.35));
}

.edit-pen-svg {
  width: 14px;
  height: 14px;
  opacity: 0.75;
}

#confetti-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 999;
}

/* ==================== BUTTONS (Modern Tactile 3D) ==================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 18px;
  padding: 12px 20px;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.14s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.14s ease, filter 0.15s ease;
  user-select: none;
  line-height: 1.25;
}

.btn:active:not(:disabled) {
  transform: translateY(3px);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-xl {
  padding: 15px 24px;
  font-size: 1.2rem;
  border-radius: 20px;
}

.full-width {
  width: 100%;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  color: #FFFFFF;
  box-shadow: 0 5px 0 var(--primary-dark), 0 10px 20px -6px rgba(79, 70, 229, 0.35);
}
.btn-primary:hover:not(:disabled) { filter: brightness(1.06); }
.btn-primary:active:not(:disabled) { box-shadow: 0 2px 0 var(--primary-dark); }

.btn-success {
  background: linear-gradient(135deg, #34D399, #10B981);
  color: #FFFFFF;
  box-shadow: 0 5px 0 var(--success-dark), 0 10px 20px -6px rgba(16, 185, 129, 0.35);
}
.btn-success:hover:not(:disabled) { filter: brightness(1.05); }
.btn-success:active:not(:disabled) { box-shadow: 0 2px 0 var(--success-dark); }

.btn-danger {
  background: linear-gradient(135deg, #FB7185, #F43F5E);
  color: #FFFFFF;
  box-shadow: 0 5px 0 var(--danger-dark), 0 10px 22px -6px rgba(244, 63, 94, 0.35);
}
.btn-danger:hover:not(:disabled) { filter: brightness(1.06); }
.btn-danger:active:not(:disabled) { box-shadow: 0 2px 0 var(--danger-dark); }

.btn-accent {
  background: linear-gradient(135deg, #FBBF24, #F59E0B);
  color: #FFFFFF;
  box-shadow: 0 4px 0 var(--accent-dark);
}
.btn-accent:active:not(:disabled) { box-shadow: 0 1px 0 var(--accent-dark); }

.btn-sparkle {
  background: linear-gradient(135deg, #8B5CF6, #6366F1);
  color: #FFFFFF;
  box-shadow: 0 4px 0 #4338CA, 0 8px 18px -6px rgba(99, 102, 241, 0.4);
  font-size: 0.98rem;
  padding: 10px 18px;
}
.btn-sparkle:hover:not(:disabled) { filter: brightness(1.08); }
.btn-sparkle:active:not(:disabled) { box-shadow: 0 1px 0 #4338CA; }

.btn-ghost {
  background: var(--surface-muted);
  color: var(--ink-soft);
  border: 1.5px solid var(--border-subtle);
  box-shadow: 0 3px 0 var(--border-strong);
  font-size: 0.95rem;
  padding: 9px 16px;
}
.btn-ghost:hover { filter: brightness(0.97); }

.pulse-btn {
  animation: gentlePulse 2.4s infinite;
}

@keyframes gentlePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.018); }
}

/* ==================== APP SHELL ==================== */
.app-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 16px 18px 26px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ==================== TOP BAR ==================== */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--topbar-bg);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1.5px solid var(--topbar-border);
  border-radius: 24px;
  padding: 11px 18px;
  box-shadow: var(--topbar-shadow);
  flex-wrap: wrap;
}

.brand-area {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 16px -4px rgba(79, 70, 229, 0.45);
}

.brand-logo svg {
  width: 25px;
  height: 25px;
}

.brand-text {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.brand-name {
  font-size: 1.48rem;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.02em;
}

.teacher-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 13px;
  border-radius: 999px;
  border: 1.5px solid var(--primary-border);
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 800;
  font-size: 0.94rem;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease;
}

.teacher-pill:hover {
  transform: translateY(-1px);
  filter: brightness(0.98);
}

.top-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.top-date-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 13px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  border: 1.5px solid var(--border-subtle);
  color: var(--ink-soft);
  font-size: 0.9rem;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 0 2px 8px -2px rgba(15, 23, 42, 0.06);
}

body.theme-dark .top-date-pill {
  background: rgba(15, 23, 42, 0.56);
}

.top-date-pill svg {
  color: var(--primary);
}

.week-badge {
  background: var(--primary-soft);
  color: var(--primary);
  border: 1px solid var(--primary-border);
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 900;
}

.star-board-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1.5px solid rgba(245, 158, 11, 0.45);
  background: linear-gradient(135deg, rgba(254, 243, 199, 0.9), rgba(253, 230, 138, 0.75));
  cursor: pointer;
  font-family: 'Baloo 2', sans-serif;
  transition: transform 0.15s ease;
}

body.theme-dark .star-board-pill {
  background: linear-gradient(135deg, rgba(120, 53, 15, 0.65), rgba(146, 64, 14, 0.45));
  border-color: rgba(251, 191, 36, 0.45);
}

.star-board-pill:hover {
  transform: translateY(-1px);
}

.star-count {
  font-size: 1.2rem;
  font-weight: 800;
  color: #B45309;
}

body.theme-dark .star-count {
  color: #FCD34D;
}

.star-progress-dots {
  display: inline-flex;
  gap: 4px;
  margin-left: 2px;
}

.star-progress-dots .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(253, 230, 138, 0.5);
  border: 1.5px solid #D97706;
  display: inline-block;
  transition: all 0.25s ease;
}

.star-progress-dots .dot.filled {
  background: #F59E0B;
  transform: scale(1.2);
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.75);
}

.icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  border: 1.5px solid var(--border-subtle);
  background: var(--surface-muted);
  color: var(--ink-soft);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.16s ease;
}

.icon-btn:hover {
  transform: translateY(-1px);
  border-color: var(--primary-border);
}

.icon-btn.active {
  background: var(--primary-soft);
  border-color: var(--primary-border);
  color: var(--primary);
}

.icon-btn:not(.active):not(.theme-toggle-btn) {
  opacity: 0.48;
}

.theme-toggle-btn {
  background: var(--surface-muted);
  color: var(--ink);
}

body.theme-dark .theme-toggle-btn {
  background: rgba(250, 204, 21, 0.14);
  border-color: rgba(250, 204, 21, 0.35);
  color: #FDE047;
}

/* ==================== SUBJECT BAR ==================== */
.subject-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.subject-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.subject-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 14px;
  border-radius: 15px;
  border: 1.5px solid var(--border-subtle);
  background: var(--surface);
  backdrop-filter: blur(10px);
  color: var(--ink);
  font-family: 'Baloo 2', sans-serif;
  font-size: 0.98rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--border-strong);
  transition: all 0.15s ease;
}

.subject-btn:hover {
  transform: translateY(-1px);
  border-color: var(--primary-border);
}

.subject-btn.active {
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  border-color: var(--primary-dark);
  color: #FFFFFF;
  box-shadow: 0 4px 0 var(--primary-dark), 0 8px 18px -6px rgba(79, 70, 229, 0.35);
}

/* ==================== MAIN 2-COLUMN CLASSROOM STAGE ==================== */
.classroom-stage {
  display: grid;
  grid-template-columns: 344px 1fr;
  gap: 18px;
  align-items: start;
}

/* LEFT: ROBOT CARD */
.robot-card {
  background: var(--surface);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: var(--radius-lg);
  padding: 18px 16px 18px;
  box-shadow: var(--shadow-card);
  border: 1.5px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  position: relative;
  transition: border-color 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}

.robot-card[data-mood="confused"] {
  border-color: rgba(251, 113, 133, 0.6);
  box-shadow: 0 16px 36px -10px rgba(244, 63, 94, 0.22);
}

.robot-card[data-mood="amazed"] {
  border-color: rgba(52, 211, 153, 0.65);
  box-shadow: 0 16px 36px -10px rgba(16, 185, 129, 0.25);
}

.robot-card[data-mood="listening"] {
  border-color: rgba(167, 139, 250, 0.65);
  box-shadow: 0 16px 36px -10px rgba(139, 92, 246, 0.26);
}

.robot-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--surface-muted);
  border: 1px solid var(--border-subtle);
  color: var(--ink-soft);
  font-weight: 800;
  font-size: 0.86rem;
  padding: 6px 14px;
  border-radius: 999px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10B981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.22);
}

.robot-avatar-stage {
  position: relative;
  width: 196px;
  height: 196px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bipbip-svg {
  width: 188px;
  height: 188px;
  filter: drop-shadow(0 10px 18px rgba(2, 132, 199, 0.22));
  animation: robotFloat 3.4s ease-in-out infinite;
}

@keyframes robotFloat {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-6px); }
}

.eyes-group { display: none; }
.robot-card[data-mood="proud"] .eyes-proud,
.robot-card[data-mood="idle"] .eyes-proud { display: block; }
.robot-card[data-mood="listening"] .eyes-listening { display: block; }
.robot-card[data-mood="thinking"] .eyes-thinking { display: block; }
.robot-card[data-mood="confused"] .eyes-confused { display: block; }
.robot-card[data-mood="amazed"] .eyes-amazed { display: block; }

.robot-card[data-mood="confused"] .antenna-bulb { fill: #F43F5E; }
.robot-card[data-mood="amazed"] .antenna-bulb { fill: #10B981; }
.robot-card[data-mood="thinking"] .antenna-bulb { fill: #FACC15; }
.robot-card[data-mood="listening"] .antenna-bulb { fill: #A855F7; }

.robot-card[data-mood="confused"] .bipbip-svg {
  animation: robotShake 0.55s ease-in-out 2;
}

@keyframes robotShake {
  0%, 100% { transform: translateX(0) rotate(0deg); }
  20% { transform: translateX(-7px) rotate(-4deg); }
  40% { transform: translateX(7px) rotate(4deg); }
  60% { transform: translateX(-5px) rotate(-2deg); }
  80% { transform: translateX(5px) rotate(2deg); }
}

.robot-card[data-mood="amazed"] .bipbip-svg {
  animation: robotJump 0.65s ease-in-out 2;
}

@keyframes robotJump {
  0%, 100% { transform: translateY(0) scale(1); }
  40% { transform: translateY(-16px) scale(1.06); }
  70% { transform: translateY(-4px) scale(0.98); }
}

.confused-mark, .amazed-stars {
  position: absolute;
  top: 4px;
  right: 8px;
  font-family: 'Baloo 2', sans-serif;
  font-size: 2rem;
  font-weight: 800;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.confused-mark {
  color: #F43F5E;
  background: var(--surface-solid);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #FDA4AF;
  box-shadow: 0 4px 12px rgba(244, 63, 94, 0.2);
}

.robot-card[data-mood="confused"] .confused-mark {
  opacity: 1;
  animation: popIn 0.35s ease;
}

.amazed-stars {
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  top: -8px;
  font-size: 1.5rem;
}

.robot-card[data-mood="amazed"] .amazed-stars {
  opacity: 1;
  animation: popIn 0.35s ease;
}

.listening-waves {
  position: absolute;
  inset: 10px;
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.robot-card[data-mood="listening"] .listening-waves {
  display: flex;
}

.listening-waves span {
  position: absolute;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  border: 3px solid rgba(168, 85, 247, 0.45);
  animation: waveRing 1.8s infinite ease-out;
}
.listening-waves span:nth-child(2) { animation-delay: 0.6s; }
.listening-waves span:nth-child(3) { animation-delay: 1.2s; }

@keyframes waveRing {
  0% { transform: scale(0.82); opacity: 0.85; }
  100% { transform: scale(1.38); opacity: 0; }
}

@keyframes popIn {
  0% { transform: scale(0.4); opacity: 0; }
  80% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

/* Speech Bubble */
.speech-bubble {
  position: relative;
  width: 100%;
  background: var(--bubble-bg);
  border: 2px solid var(--bubble-border);
  border-radius: 20px;
  padding: 15px 16px 13px;
  font-size: 1.04rem;
  font-weight: 700;
  line-height: 1.52;
  color: var(--ink);
  transition: background 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

.speech-bubble::before {
  content: '';
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 11px solid transparent;
  border-right: 11px solid transparent;
  border-bottom: 12px solid var(--bubble-border);
}

.robot-card[data-mood="amazed"] .speech-bubble {
  background: var(--bubble-amazed-bg);
  border-color: var(--bubble-amazed-border);
}
.robot-card[data-mood="amazed"] .speech-bubble::before {
  border-bottom-color: var(--bubble-amazed-border);
}

.robot-card[data-mood="confused"] .speech-bubble {
  background: var(--bubble-confused-bg);
  border-color: var(--bubble-confused-border);
}
.robot-card[data-mood="confused"] .speech-bubble::before {
  border-bottom-color: var(--bubble-confused-border);
}

.replay-voice-btn {
  margin-top: 10px;
  border: 1px solid var(--border-subtle);
  background: var(--surface-solid);
  border-radius: 999px;
  padding: 5px 14px;
  font-size: 0.86rem;
  font-weight: 800;
  color: var(--primary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06);
  transition: all 0.15s ease;
}
.replay-voice-btn:hover { transform: translateY(-1px); }
.replay-voice-btn.speaking {
  background: var(--primary-soft);
  border-color: var(--primary-border);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.22);
}
.replay-voice-btn.needs-tap {
  background: #FEF3C7;
  color: #92400E;
  border-color: #F59E0B;
  animation: replayTapPulse 1.6s infinite;
}
body.theme-dark .replay-voice-btn.needs-tap {
  background: rgba(245, 158, 11, 0.2);
  color: #FDE68A;
  border-color: #F59E0B;
}
@keyframes replayTapPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.45); }
  50% { box-shadow: 0 0 0 6px rgba(245, 158, 11, 0); }
}

/* ==================== RIGHT: CHALKBOARD & ACTION PANEL ==================== */
.board-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.chalkboard-frame {
  background: var(--board-frame);
  padding: 10px 10px 6px;
  border-radius: 28px;
  box-shadow: 0 18px 36px -12px rgba(18, 61, 48, 0.35);
}

.chalkboard-surface {
  background: var(--board-surface);
  border-radius: 20px;
  padding: 18px 20px 20px;
  color: #FFFFFF;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.board-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.category-tag {
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.24);
  color: #FEF08A;
  padding: 4px 13px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 800;
}

.question-counter {
  font-size: 0.88rem;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.8);
}

.problem-box {
  background: rgba(0, 0, 0, 0.22);
  border-radius: 16px;
  padding: 13px 16px;
  margin-bottom: 14px;
  border-left: 4px solid #FACC15;
}

.problem-label {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 900;
  color: #FDE047;
  margin-bottom: 4px;
}

.problem-text {
  font-size: 1.3rem;
  font-weight: 800;
  line-height: 1.4;
  color: #FFFFFF;
}

.robot-work-box {
  background: rgba(255, 255, 255, 0.07);
  border: 1.5px dashed rgba(255, 255, 255, 0.28);
  border-radius: 18px;
  padding: 14px 15px;
}

.work-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.9rem;
  font-weight: 800;
  color: #BAE6FD;
  margin-bottom: 12px;
}

.tap-tip {
  background: rgba(251, 191, 36, 0.22);
  color: #FDE68A;
  padding: 3px 11px;
  border-radius: 999px;
  font-size: 0.8rem;
}

/* Interactive Board Visuals */
.interactive-board {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 64px;
  margin-bottom: 10px;
}

.board-token {
  background: rgba(255, 255, 255, 0.13);
  border: 2px solid rgba(255, 255, 255, 0.32);
  color: #FFFFFF;
  padding: 9px 15px;
  border-radius: 14px;
  font-family: 'Baloo 2', 'Nunito', sans-serif;
  font-size: 1.28rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s ease;
}

.board-token:hover {
  background: rgba(255, 255, 255, 0.24);
  transform: translateY(-2px);
}

.board-token.marked-error {
  background: rgba(244, 63, 94, 0.4);
  border-color: #FDA4AF;
  color: #FFF1F2;
  box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.35);
}

.board-token.marked-error::after {
  content: '🔍';
  margin-left: 6px;
  font-size: 1rem;
}

.board-token.shake-mild {
  animation: miniShake 0.35s ease;
}

@keyframes miniShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.vcalc-wrap {
  display: inline-grid;
  grid-template-columns: 36px 52px 52px;
  gap: 6px;
  align-items: center;
  justify-items: center;
  background: rgba(15, 23, 42, 0.32);
  padding: 14px 20px;
  border-radius: 16px;
  border: 1.5px solid rgba(255, 255, 255, 0.2);
}

.vcalc-cell {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Baloo 2', sans-serif;
  font-size: 1.7rem;
  font-weight: 800;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
  border: 2px dashed rgba(255, 255, 255, 0.26);
  color: #FFFFFF;
  cursor: pointer;
  transition: all 0.18s ease;
}

.vcalc-cell.empty { opacity: 0.35; cursor: default; }
.vcalc-cell.marked-error {
  background: rgba(244, 63, 94, 0.48);
  border-color: #FDA4AF;
  box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.4);
}
.vcalc-op { font-size: 1.7rem; font-weight: 800; color: #FDE047; }
.vcalc-line { grid-column: 1 / -1; width: 100%; height: 4px; background: #FFFFFF; border-radius: 4px; margin: 2px 0; }

.clock-stage { display: flex; align-items: center; justify-content: center; gap: 18px; flex-wrap: wrap; }
.clock-svg { width: 148px; height: 148px; filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.25)); }

.robot-work-caption {
  text-align: center;
  font-size: 0.98rem;
  color: rgba(255, 255, 255, 0.88);
  font-weight: 700;
}

.chalk-tray {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 6px 16px 2px;
}
.chalk { width: 34px; height: 7px; border-radius: 4px; display: inline-block; }
.chalk-white { background: #FFFFFF; }
.chalk-yellow { background: #FDE047; }
.chalk-pink { background: #FDA4AF; }
.eraser { width: 44px; height: 12px; border-radius: 4px; background: linear-gradient(to bottom, #334155 55%, #E2E8F0 55%); }

/* ==================== ACTION CARD ==================== */
.action-card {
  background: var(--surface);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-card);
  border: 1.5px solid var(--border-subtle);
}

.phase-sub-actions {
  margin-top: 12px;
  display: flex;
  justify-content: center;
}

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

.explain-title {
  font-family: 'Baloo 2', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ink);
}

.mic-status-badge {
  background: var(--primary-soft);
  color: var(--primary);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 800;
}

.mic-status-badge.recording {
  background: rgba(244, 63, 94, 0.16);
  color: #F43F5E;
}

.mic-center-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin: 4px 0 14px;
}

.mic-btn {
  position: relative;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  color: #FFFFFF;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 26px -4px rgba(79, 70, 229, 0.45), 0 5px 0 var(--primary-dark);
  transition: transform 0.14s ease, background 0.2s ease;
}

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

.mic-btn.recording {
  background: linear-gradient(135deg, #FB7185, #F43F5E) !important;
  box-shadow: 0 0 0 10px rgba(244, 63, 94, 0.2), 0 10px 26px rgba(244, 63, 94, 0.45) !important;
}

.mic-ripple {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 3px solid rgba(244, 63, 94, 0.55);
  opacity: 0;
  pointer-events: none;
}

.mic-btn.recording .mic-ripple {
  animation: micPulse 1.1s infinite ease-out;
}

@keyframes micPulse {
  0% { transform: scale(0.95); opacity: 0.9; }
  100% { transform: scale(1.45); opacity: 0; }
}

.mic-label {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--ink-soft);
  text-align: center;
}

.mic-warning {
  font-size: 0.84rem;
  color: #D97706;
  background: rgba(254, 243, 199, 0.7);
  border: 1px solid #FDE68A;
  padding: 6px 12px;
  border-radius: 10px;
  text-align: center;
}

body.theme-dark .mic-warning {
  background: rgba(120, 53, 15, 0.45);
  border-color: rgba(251, 191, 36, 0.35);
  color: #FDE68A;
}

.chips-section { margin-bottom: 12px; }

.chips-label {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--ink-muted);
  margin-bottom: 7px;
}

.hint-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hint-chip {
  border: 1.5px solid var(--border-strong);
  background: var(--surface-muted);
  color: var(--ink);
  padding: 7px 14px;
  border-radius: 999px;
  font-family: 'Nunito', sans-serif;
  font-size: 0.92rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.14s ease;
}

.hint-chip:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
  transform: translateY(-1px);
}

.hint-chip.used {
  background: rgba(16, 185, 129, 0.18);
  border-color: #34D399;
  color: #10B981;
}

.explain-input-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.explain-textarea {
  flex: 1;
  border: 2px solid var(--border-strong);
  background: var(--surface-solid);
  border-radius: 16px;
  padding: 11px 14px;
  font-family: 'Nunito', sans-serif;
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--ink);
  resize: none;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.explain-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.16);
}

.btn-send {
  min-width: 136px;
  font-size: 1rem;
  padding: 10px 14px;
  text-align: center;
}

/* Phase 3 Success Recap */
.lesson-recap {
  background: var(--recap-bg);
  border: 2px solid var(--recap-border);
  border-radius: 18px;
  padding: 14px 16px;
  margin-bottom: 14px;
}

.recap-head { font-size: 0.9rem; font-weight: 800; color: var(--recap-head); margin-bottom: 4px; }
.recap-answer { font-family: 'Baloo 2', sans-serif; font-size: 1.32rem; font-weight: 800; color: var(--recap-ink); margin-bottom: 4px; }
.recap-rule { font-size: 0.96rem; font-weight: 700; color: var(--recap-ink); line-height: 1.45; }

.success-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

/* ==================== MODALS ==================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.62);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 100;
  overflow-y: auto;
}

.modal-overlay.active { display: flex; }

.onboarding-card, .challenge-card {
  width: 100%;
  max-width: 490px;
  background: var(--surface-solid);
  color: var(--ink);
  border: 1.5px solid var(--border-subtle);
  border-radius: 30px;
  padding: 26px 24px 24px;
  box-shadow: 0 28px 64px rgba(0, 0, 0, 0.35);
  text-align: center;
  animation: modalPop 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes modalPop {
  from { transform: scale(0.9) translateY(16px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}

.onboarding-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #D97706;
  font-weight: 800;
  font-size: 0.86rem;
  padding: 5px 14px;
  border-radius: 999px;
  margin-bottom: 10px;
}

body.theme-dark .onboarding-badge {
  color: #FCD34D;
}

.onboarding-robot-wrap { display: flex; justify-content: center; margin-bottom: 6px; }
.mini-robot { width: 104px; height: 96px; animation: robotFloat 3s ease-in-out infinite; }

.onboarding-title {
  font-size: 1.85rem;
  line-height: 1.2;
  color: var(--ink);
  margin-bottom: 8px;
}
.onboarding-title span { color: var(--primary); }

.onboarding-sub {
  font-size: 0.98rem;
  color: var(--ink-soft);
  line-height: 1.48;
  margin-bottom: 18px;
}

.form-group { text-align: left; margin-bottom: 16px; }
.form-label { display: block; font-size: 0.96rem; font-weight: 800; color: var(--ink); margin-bottom: 8px; }

.req-mark { color: #F43F5E; font-weight: 900; }

.name-input {
  width: 100%;
  padding: 13px 16px;
  border: 2px solid var(--border-strong);
  background: var(--surface-muted);
  color: var(--ink);
  border-radius: 16px;
  font-family: 'Nunito', sans-serif;
  font-size: 1.08rem;
  font-weight: 800;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.name-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.16);
}

.gender-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.gender-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 15px 10px;
  border-radius: 20px;
  border: 2.5px solid var(--border-strong);
  background: var(--surface-muted);
  cursor: pointer;
  transition: all 0.18s ease;
}

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

.gender-avatar {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gender-avatar svg {
  width: 30px;
  height: 30px;
}

.gender-avatar-male {
  background: rgba(79, 70, 229, 0.14);
  color: #4F46E5;
}

.gender-avatar-female {
  background: rgba(225, 29, 72, 0.14);
  color: #E11D48;
}

body.theme-dark .gender-avatar-male { color: #818CF8; }
body.theme-dark .gender-avatar-female { color: #FB7185; }

.gender-card[data-gender="male"].selected {
  border-color: #4F46E5;
  background: rgba(79, 70, 229, 0.12);
  box-shadow: 0 10px 22px -6px rgba(79, 70, 229, 0.25);
}

.gender-card[data-gender="female"].selected {
  border-color: #E11D48;
  background: rgba(225, 29, 72, 0.12);
  box-shadow: 0 10px 22px -6px rgba(225, 29, 72, 0.25);
}

.gender-label { font-family: 'Baloo 2', sans-serif; font-size: 1.15rem; font-weight: 800; color: var(--ink); }

.gender-role-tag {
  font-size: 0.84rem;
  font-weight: 800;
  padding: 2px 11px;
  border-radius: 999px;
  background: var(--surface-solid);
  color: var(--ink-soft);
}

.gender-card[data-gender="male"].selected .gender-role-tag { background: #4F46E5; color: #FFFFFF; }
.gender-card[data-gender="female"].selected .gender-role-tag { background: #E11D48; color: #FFFFFF; }

.role-preview {
  background: var(--surface-muted);
  border: 1.5px dashed var(--border-strong);
  border-radius: 14px;
  padding: 10px 12px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink-soft);
  margin-bottom: 16px;
}

.role-preview strong { font-size: 1.06rem; }

.onboarding-error {
  background: rgba(244, 63, 94, 0.12);
  border: 1.5px solid rgba(244, 63, 94, 0.45);
  color: #E11D48;
  border-radius: 14px;
  padding: 10px 14px;
  font-size: 0.94rem;
  font-weight: 800;
  margin-bottom: 14px;
  animation: miniShake 0.35s ease;
}

body.theme-dark .onboarding-error { color: #FDA4AF; }

/* Challenge & Badges Modal */
.badge-icon-big { font-size: 4rem; margin-bottom: 4px; animation: robotJump 0.8s ease infinite; }

.badge-ribbon {
  display: inline-block;
  background: linear-gradient(135deg, #F59E0B, #EA580C);
  color: #FFFFFF;
  font-weight: 800;
  font-size: 0.82rem;
  padding: 4px 14px;
  border-radius: 999px;
  margin-bottom: 8px;
}

.challenge-title { font-size: 1.65rem; color: var(--ink); margin-bottom: 6px; }
.challenge-sub { font-size: 0.96rem; color: var(--ink-soft); margin-bottom: 16px; }

.mini-challenge-box {
  background: var(--surface-muted);
  border: 1.5px solid var(--border-subtle);
  border-radius: 20px;
  padding: 14px;
  margin-bottom: 16px;
}

.mini-challenge-head { font-weight: 800; font-size: 0.98rem; color: var(--ink); margin-bottom: 10px; }

.challenge-builder { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }

.ch-input, .ch-select {
  width: 68px;
  padding: 9px 6px;
  border: 2px solid var(--border-strong);
  border-radius: 12px;
  font-family: 'Baloo 2', sans-serif;
  font-size: 1.25rem;
  font-weight: 800;
  text-align: center;
  background: var(--surface-solid);
  color: var(--ink);
}
.ch-select { width: 58px; }

.challenge-robot-reply { margin-top: 12px; padding-top: 12px; border-top: 1.5px dashed var(--border-strong); }
.ch-bubble { font-size: 0.96rem; font-weight: 700; color: var(--ink); margin-bottom: 6px; }
.ch-answer-big { font-family: 'Baloo 2', sans-serif; font-size: 1.55rem; font-weight: 800; color: var(--primary); margin-bottom: 10px; }
.ch-grade-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ch-grade-feedback { margin-top: 10px; padding: 10px 12px; border-radius: 12px; font-weight: 800; font-size: 0.95rem; }

.badges-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 18px; }

.badge-item {
  border: 1.5px solid var(--border-subtle);
  border-radius: 16px;
  padding: 12px 10px;
  background: var(--surface-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.badge-item.unlocked {
  border-color: #FCD34D;
  background: linear-gradient(135deg, rgba(254, 243, 199, 0.75), rgba(253, 230, 138, 0.55));
}

body.theme-dark .badge-item.unlocked {
  background: linear-gradient(135deg, rgba(120, 53, 15, 0.55), rgba(146, 64, 14, 0.35));
}

.badge-item.locked { opacity: 0.5; filter: grayscale(0.9); }
.badge-item-icon { font-size: 2rem; }
.badge-item-name { font-family: 'Baloo 2', sans-serif; font-weight: 800; font-size: 0.98rem; color: var(--ink); }
.badge-item-req { font-size: 0.78rem; font-weight: 700; color: var(--ink-muted); }

/* ==================== ABOUT TAB SECTION ==================== */
.about-section {
  display: flex;
  flex-direction: column;
  gap: 18px;
  animation: modalPop 0.25s ease;
}

.about-hero {
  background: var(--surface);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 26px 24px;
  box-shadow: var(--shadow-card);
  text-align: center;
}

.about-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: 999px;
  background: var(--primary-soft);
  border: 1px solid var(--primary-border);
  color: var(--primary);
  font-size: 0.88rem;
  font-weight: 800;
  margin-bottom: 12px;
}

.about-title {
  font-size: 1.75rem;
  line-height: 1.25;
  color: var(--ink);
  margin-bottom: 12px;
}

.about-lead {
  font-size: 1.04rem;
  line-height: 1.65;
  color: var(--ink-soft);
  max-width: 820px;
  margin: 0 auto 10px;
  font-weight: 700;
}

.about-sublead {
  font-size: 0.96rem;
  line-height: 1.6;
  color: var(--ink-muted);
  max-width: 780px;
  margin: 0 auto;
  font-weight: 700;
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.about-card {
  background: var(--surface);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1.5px solid var(--border-subtle);
  border-radius: 22px;
  padding: 20px;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform 0.16s ease, border-color 0.16s ease;
}

.about-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary-border);
}

.about-card-icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}

.about-card-icon svg {
  width: 24px;
  height: 24px;
}

.about-icon-indigo { background: rgba(79, 70, 229, 0.14); color: #4F46E5; }
.about-icon-sky { background: rgba(14, 165, 233, 0.14); color: #0284C7; }
.about-icon-emerald { background: rgba(16, 185, 129, 0.14); color: #059669; }
.about-icon-violet { background: rgba(139, 92, 246, 0.14); color: #7C3AED; }
.about-icon-amber { background: rgba(245, 158, 11, 0.16); color: #D97706; }
.about-icon-rose { background: rgba(244, 63, 94, 0.14); color: #E11D48; }

body.theme-dark .about-icon-indigo { color: #818CF8; }
body.theme-dark .about-icon-sky { color: #38BDF8; }
body.theme-dark .about-icon-emerald { color: #34D399; }
body.theme-dark .about-icon-violet { color: #A78BFA; }
body.theme-dark .about-icon-amber { color: #FBBF24; }
body.theme-dark .about-icon-rose { color: #FB7185; }

.about-card h3 {
  font-size: 1.18rem;
  color: var(--ink);
  line-height: 1.3;
}

.about-card p {
  font-size: 0.95rem;
  line-height: 1.58;
  color: var(--ink-soft);
  font-weight: 700;
}

.about-cta-wrap {
  display: flex;
  justify-content: center;
  margin-top: 4px;
}

/* ==================== GUIDE TAB SECTION ==================== */
.guide-section {
  display: flex;
  flex-direction: column;
  gap: 22px;
  animation: modalPop 0.25s ease;
}

.guide-jump-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 16px;
}

.guide-jump-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 800;
  text-decoration: none;
  border: 1.5px solid var(--primary-border);
  background: var(--primary-soft);
  color: var(--primary);
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}

.guide-jump-chip:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
}

.guide-jump-parents {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.35);
  color: #059669;
}

body.theme-dark .guide-jump-parents {
  color: #34D399;
}

.guide-block {
  display: flex;
  flex-direction: column;
  gap: 14px;
  scroll-margin-top: 16px;
}

.guide-block-header {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.guide-audience-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 800;
}

.guide-badge-kids {
  background: rgba(59, 130, 246, 0.14);
  color: #1D4ED8;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.guide-badge-parents {
  background: rgba(16, 185, 129, 0.14);
  color: #047857;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

body.theme-dark .guide-badge-kids { color: #93C5FD; }
body.theme-dark .guide-badge-parents { color: #6EE7B7; }

.guide-block-header h3 {
  font-size: 1.4rem;
  color: var(--ink);
}

.guide-block-header p {
  font-size: 0.96rem;
  color: var(--ink-muted);
  font-weight: 700;
}

.guide-steps-grid,
.guide-parents-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.guide-step-card,
.guide-parent-card {
  background: var(--surface);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1.5px solid var(--border-subtle);
  border-radius: 22px;
  padding: 20px;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 0.16s ease, border-color 0.16s ease;
}

.guide-step-card:hover,
.guide-parent-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary-border);
}

.guide-step-head,
.guide-parent-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.guide-parent-head .about-card-icon {
  margin-bottom: 0;
  flex-shrink: 0;
}

.guide-step-head h4,
.guide-parent-head h4 {
  font-size: 1.12rem;
  color: var(--ink);
  line-height: 1.3;
}

.guide-step-num {
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 900;
  color: #FFFFFF;
  flex-shrink: 0;
  box-shadow: 0 3px 8px rgba(15, 23, 42, 0.14);
}

.guide-num-1 { background: linear-gradient(135deg, #3B82F6, #2563EB); }
.guide-num-2 { background: linear-gradient(135deg, #10B981, #059669); }
.guide-num-3 { background: linear-gradient(135deg, #8B5CF6, #7C3AED); }
.guide-num-4 { background: linear-gradient(135deg, #F59E0B, #D97706); }

/* Visual UI Mockups inside Guide */
.guide-mockup {
  background: var(--surface-solid, #FFFFFF);
  border: 1.5px dashed var(--border-subtle);
  border-radius: 16px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

body.theme-dark .guide-mockup {
  background: rgba(15, 23, 42, 0.65);
  border-color: rgba(148, 163, 184, 0.25);
}

.mock-window-label {
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
}

.mock-input-box {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.mock-input-label {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--ink-soft);
}

.mock-input-pill {
  flex: 1;
  min-width: 140px;
  padding: 5px 10px;
  border-radius: 10px;
  background: var(--primary-soft);
  border: 1px solid var(--primary-border);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink);
}

.mock-gender-row,
.mock-action-row,
.mock-grade-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mock-gender-pill {
  flex: 1;
  min-width: 120px;
  text-align: center;
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 800;
}

.mock-male {
  background: rgba(59, 130, 246, 0.14);
  border: 1.5px solid rgba(59, 130, 246, 0.4);
  color: #1D4ED8;
}

.mock-female {
  background: rgba(244, 63, 94, 0.14);
  border: 1.5px solid rgba(244, 63, 94, 0.4);
  color: #BE123C;
}

body.theme-dark .mock-male { color: #93C5FD; }
body.theme-dark .mock-female { color: #FDA4AF; }

.mock-cta-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border-radius: 11px;
  font-size: 0.82rem;
  font-weight: 800;
  color: #FFFFFF;
}

.mock-cta-primary { background: linear-gradient(135deg, #3B82F6, #2563EB); align-self: center; }
.mock-cta-danger { background: linear-gradient(135deg, #EF4444, #DC2626); flex: 1; }
.mock-cta-ghost { background: rgba(148, 163, 184, 0.22); color: var(--ink-soft); }
.mock-cta-success { background: linear-gradient(135deg, #10B981, #059669); flex-shrink: 0; }
.mock-cta-accent { background: linear-gradient(135deg, #F59E0B, #D97706); }

.mock-tabs-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.mock-tab {
  font-size: 0.75rem;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.18);
  color: var(--ink-soft);
}

.mock-tab.active {
  background: var(--primary);
  color: #FFFFFF;
}

.mock-chalkboard {
  background: linear-gradient(145deg, #134E3A, #0E3F2F);
  border: 3px solid #D97706;
  border-radius: 12px;
  padding: 10px 12px;
  color: #F8FAFC;
}

.mock-board-top {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: #FDE68A;
  margin-bottom: 4px;
}

.mock-board-eq {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 1.08rem;
  font-weight: 900;
}

.mock-wrong-token {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 9px;
  border-radius: 8px;
  background: rgba(239, 68, 68, 0.25);
  border: 1.5px dashed #FCA5A5;
  color: #FECACA;
}

.mock-finger {
  font-size: 1rem;
}

.mock-mic-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.mock-mic-circle {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: linear-gradient(135deg, #6366F1, #4F46E5);
  color: #FFFFFF;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 5px rgba(99, 102, 241, 0.18);
  flex-shrink: 0;
}

.mock-mic-circle svg {
  width: 19px;
  height: 19px;
}

.mock-mic-caption {
  font-size: 0.84rem;
  font-weight: 800;
  color: var(--ink);
}

.mock-chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  justify-content: center;
}

.mock-chip {
  font-size: 0.76rem;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--primary-soft);
  border: 1px solid var(--primary-border);
  color: var(--primary);
}

.mock-send-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.mock-text-preview {
  flex: 1;
  min-width: 140px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink-soft);
  padding: 5px 8px;
  border-radius: 9px;
  border: 1px solid var(--border-subtle);
  background: rgba(148, 163, 184, 0.08);
}

.mock-star-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.mock-star-badge {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.16);
  border: 1px solid rgba(245, 158, 11, 0.45);
  color: #B45309;
  font-size: 0.8rem;
  font-weight: 900;
}

.mock-trophy-badge {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.14);
  color: #047857;
  font-size: 0.78rem;
  font-weight: 800;
}

body.theme-dark .mock-star-badge { color: #FCD34D; }
body.theme-dark .mock-trophy-badge { color: #6EE7B7; }

.mock-challenge-box {
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mock-ch-title {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--ink);
}

.mock-ch-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
}

.mock-num-box,
.mock-op-box {
  padding: 3px 9px;
  border-radius: 8px;
  background: rgba(148, 163, 184, 0.16);
  font-size: 0.85rem;
  font-weight: 900;
  color: var(--ink);
}

.mock-grade-row {
  justify-content: center;
}

.mock-grade-pill {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 800;
}

.mock-grade-pill.ok {
  background: rgba(16, 185, 129, 0.16);
  color: #047857;
}

.mock-grade-pill.no {
  background: rgba(239, 68, 68, 0.15);
  color: #DC2626;
}

body.theme-dark .mock-grade-pill.ok { color: #6EE7B7; }
body.theme-dark .mock-grade-pill.no { color: #FCA5A5; }

/* Parent Diagrams & Lists */
.guide-list {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: var(--ink-soft);
  font-size: 0.94rem;
  line-height: 1.56;
  font-weight: 700;
}

.guide-mini-diagram {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(148, 163, 184, 0.1);
  border: 1px solid var(--border-subtle);
}

.diag-pill {
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--primary-soft);
  border: 1px solid var(--primary-border);
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 800;
}

.diag-pill-warn {
  background: rgba(245, 158, 11, 0.16);
  border-color: rgba(245, 158, 11, 0.45);
  color: #B45309;
}

body.theme-dark .diag-pill-warn { color: #FCD34D; }

.diag-arrow {
  font-size: 0.85rem;
  font-weight: 900;
  color: var(--ink-muted);
}

.guide-ratio-diagram {
  padding: 10px;
}

.ratio-bar {
  width: 100%;
  display: flex;
  border-radius: 12px;
  overflow: hidden;
  font-size: 0.78rem;
  font-weight: 800;
  color: #FFFFFF;
}

.ratio-focus {
  width: 70%;
  background: linear-gradient(135deg, #4F46E5, #2563EB);
  padding: 7px 10px;
  text-align: center;
}

.ratio-review {
  width: 30%;
  background: linear-gradient(135deg, #10B981, #059669);
  padding: 7px 8px;
  text-align: center;
}

.guide-legend-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.legend-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 9px 10px;
  border-radius: 12px;
  background: rgba(148, 163, 184, 0.1);
  border: 1px solid var(--border-subtle);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--ink-soft);
}

.legend-badge {
  display: inline-block;
  align-self: flex-start;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 800;
}

/* Shortcut / Add-to-Home-Screen Block */
.guide-jump-shortcut {
  background: rgba(139, 92, 246, 0.12);
  border-color: rgba(139, 92, 246, 0.35);
  color: #6D28D9;
}

body.theme-dark .guide-jump-shortcut {
  color: #C4B5FD;
}

.guide-shortcut-card {
  grid-column: 1 / -1;
}

.guide-shortcut-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.guide-shortcut-top .guide-parent-head {
  flex: 1;
  min-width: 240px;
}

.guide-shortcut-sub {
  margin: 4px 0 0;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--ink-muted);
  font-weight: 700;
}

.guide-app-icon-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  border-radius: 16px;
  background: rgba(148, 163, 184, 0.1);
  border: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.guide-app-icon-preview img {
  border-radius: 14px;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.18);
  display: block;
}

.guide-app-icon-preview span {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--ink);
}

.guide-device-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.guide-device-card {
  background: var(--surface-solid, #FFFFFF);
  border: 1.5px solid var(--border-subtle);
  border-radius: 18px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

body.theme-dark .guide-device-card {
  background: rgba(15, 23, 42, 0.65);
}

.device-head {
  display: flex;
  align-items: center;
}

.device-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 900;
}

.device-ios {
  background: rgba(59, 130, 246, 0.14);
  color: #1D4ED8;
}

.device-android {
  background: rgba(16, 185, 129, 0.14);
  color: #047857;
}

.device-desktop {
  background: rgba(139, 92, 246, 0.14);
  color: #6D28D9;
}

body.theme-dark .device-ios { color: #93C5FD; }
body.theme-dark .device-android { color: #6EE7B7; }
body.theme-dark .device-desktop { color: #C4B5FD; }

.device-mockup {
  border-radius: 13px;
  padding: 9px 10px;
  background: rgba(148, 163, 184, 0.1);
  border: 1px dashed var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.mock-browser-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 9px;
  background: var(--surface, #FFFFFF);
  border: 1px solid var(--border-subtle);
}

.mock-url {
  font-size: 0.74rem;
  font-weight: 800;
  color: var(--ink-muted);
}

.mock-share-btn,
.mock-plus-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 7px;
  background: #2563EB;
  color: #FFFFFF;
  font-size: 0.73rem;
  font-weight: 800;
}

.mock-share-btn svg {
  width: 13px;
  height: 13px;
}

.mock-install-icons {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.mock-dots-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 22px;
  border-radius: 7px;
  background: #059669;
  color: #FFFFFF;
  font-weight: 900;
  font-size: 0.9rem;
}

.mock-menu-sheet {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 5px;
}

.mock-menu-item.active {
  padding: 3px 8px;
  border-radius: 8px;
  background: var(--primary-soft);
  border: 1px solid var(--primary-border);
  color: var(--primary);
  font-size: 0.74rem;
  font-weight: 800;
}

.mock-menu-arrow {
  font-size: 0.78rem;
  font-weight: 900;
  color: var(--ink-muted);
}

.mock-menu-confirm {
  padding: 2px 8px;
  border-radius: 8px;
  background: rgba(16, 185, 129, 0.16);
  color: #047857;
  font-size: 0.73rem;
  font-weight: 800;
}

body.theme-dark .mock-menu-confirm {
  color: #6EE7B7;
}

.guide-ordered-list {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--ink-soft);
  font-size: 0.89rem;
  line-height: 1.5;
  font-weight: 700;
}

/* ==================== FEEDBACK / CONTACT TAB SECTION ==================== */
.feedback-section {
  display: flex;
  flex-direction: column;
  gap: 18px;
  animation: modalPop 0.25s ease;
}

.feedback-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.feedback-card {
  background: var(--surface);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1.5px solid var(--border-subtle);
  border-radius: 24px;
  padding: 22px 20px;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.feedback-card:hover {
  transform: translateY(-3px);
  border-color: var(--primary-border);
  box-shadow: var(--shadow-card);
}

.feedback-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.feedback-icon {
  width: 50px;
  height: 50px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.feedback-icon svg {
  width: 25px;
  height: 25px;
}

.feedback-icon-phone { background: rgba(16, 185, 129, 0.14); color: #059669; }
.feedback-icon-email { background: rgba(244, 63, 94, 0.14); color: #E11D48; }
.feedback-icon-zalo  { background: rgba(0, 104, 255, 0.13); color: #0068FF; }

body.theme-dark .feedback-icon-phone { color: #34D399; }
body.theme-dark .feedback-icon-email { color: #FB7185; }
body.theme-dark .feedback-icon-zalo  { color: #60A5FA; background: rgba(59, 130, 246, 0.2); }

.feedback-channel-tag {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  background: rgba(148, 163, 184, 0.14);
  color: var(--ink-muted);
}

.feedback-card h3 {
  font-size: 1.15rem;
  color: var(--ink);
  margin-top: 2px;
}

.feedback-value {
  font-family: "Baloo 2", "Nunito", sans-serif;
  font-size: 1.38rem;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: 0.01em;
  word-break: break-word;
}

.feedback-value-email {
  font-size: 1.08rem;
}

.feedback-desc {
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--ink-soft);
  font-weight: 700;
  flex: 1;
}

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

.feedback-action-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 11px 14px;
  border-radius: 14px;
  font-size: 0.94rem;
  font-weight: 800;
  color: #FFFFFF;
  text-decoration: none;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.14);
  transition: transform 0.14s ease, filter 0.14s ease;
}

.feedback-action-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.feedback-btn-call  { background: linear-gradient(135deg, #10B981, #059669); }
.feedback-btn-email { background: linear-gradient(135deg, #F43F5E, #E11D48); }
.feedback-btn-zalo  { background: linear-gradient(135deg, #0084FF, #005CE6); }

.feedback-copy-btn {
  border: 1.5px solid var(--border-subtle);
  background: var(--surface-solid, #FFFFFF);
  color: var(--ink-soft);
  border-radius: 14px;
  padding: 11px 12px;
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.feedback-copy-btn:hover {
  border-color: var(--primary-border);
  color: var(--primary);
}

.feedback-copy-btn.copied {
  background: rgba(16, 185, 129, 0.16);
  border-color: rgba(16, 185, 129, 0.45);
  color: #047857;
}

body.theme-dark .feedback-copy-btn {
  background: rgba(15, 23, 42, 0.65);
}

body.theme-dark .feedback-copy-btn.copied {
  color: #6EE7B7;
}

.feedback-tip-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 18px;
  border-radius: 18px;
  background: var(--primary-soft);
  border: 1.5px solid var(--primary-border);
  color: var(--ink-soft);
  font-size: 0.94rem;
  line-height: 1.55;
  font-weight: 700;
}

.feedback-tip-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

/* ==================== PRIVACY TAB SECTION ==================== */
.privacy-section {
  display: flex;
  flex-direction: column;
  gap: 18px;
  animation: modalPop 0.25s ease;
}

.privacy-contact-card {
  grid-column: 1 / -1;
}

.privacy-link {
  color: var(--primary);
  font-weight: 800;
  text-decoration: none;
}

.privacy-link:hover {
  text-decoration: underline;
}

/* ==================== BOTTOM INFO BAR (ABOVE FOOTER) ==================== */
.bottom-info-bar {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 8px;
}

.bottom-info-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: 22px;
  background: var(--surface);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1.5px solid var(--border-subtle);
  box-shadow: var(--shadow-soft);
}

.bottom-info-btn {
  min-width: 132px;
  justify-content: center;
}

/* ==================== FOOTER ==================== */
.app-footer {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 5px;
  text-align: center;
  padding: 12px 12px 6px;
  margin: 0 auto;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ink-muted);
}

.app-footer a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 800;
}

.app-footer a:hover {
  text-decoration: underline;
}

/* ==================== RESPONSIVE (MOBILE & TABLET) ==================== */
@media (max-width: 1060px) {
  .top-bar {
    justify-content: center;
    text-align: center;
    gap: 10px 16px;
  }
  .brand-area,
  .brand-text,
  .top-date-pill,
  .top-controls,
  .subject-bar,
  .subject-tabs {
    justify-content: center;
    flex-wrap: wrap;
  }
  .top-date-pill {
    margin-inline: auto;
  }
}

@media (max-width: 780px) {
  .brand-area,
  .top-controls {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 900px) {
  .classroom-stage { grid-template-columns: 1fr; gap: 14px; }
  .guide-steps-grid,
  .guide-parents-grid,
  .guide-device-grid,
  .feedback-grid { grid-template-columns: 1fr; }
  .robot-card { flex-direction: row; align-items: center; padding: 14px; gap: 14px; }
  .robot-status-pill { display: none; }
  .robot-avatar-stage { width: 112px; height: 112px; flex-shrink: 0; }
  .bipbip-svg { width: 108px; height: 108px; }

  .speech-bubble::before {
    top: 50%;
    left: -12px;
    transform: translateY(-50%);
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    border-right: 12px solid var(--bubble-border);
    border-left: none;
  }

  .robot-card[data-mood="amazed"] .speech-bubble::before {
    border-right-color: var(--bubble-amazed-border);
    border-bottom-color: transparent;
  }

  .robot-card[data-mood="confused"] .speech-bubble::before {
    border-right-color: var(--bubble-confused-border);
    border-bottom-color: transparent;
  }
}

@media (max-width: 600px) {
  .app-shell { padding: 10px 10px 24px; gap: 10px; }
  .top-bar { padding: 10px 12px; border-radius: 20px; justify-content: center; }
  .brand-logo { width: 40px; height: 40px; border-radius: 13px; }
  .brand-name { font-size: 1.2rem; }
  .subject-bar { flex-direction: column; align-items: stretch; }
  .subject-bar .btn-sparkle { justify-content: center; }
  .subject-tabs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .subject-btn { padding: 9px 8px; font-size: 0.9rem; justify-content: center; gap: 6px; }
  .bottom-info-tabs { display: grid; grid-template-columns: repeat(2, 1fr); width: 100%; padding: 10px; gap: 8px; }
  .bottom-info-btn { min-width: 0; width: 100%; }
  .about-hero { padding: 20px 16px; }
  .about-title { font-size: 1.42rem; }
  .about-grid { grid-template-columns: 1fr; }
  .guide-legend-grid { grid-template-columns: 1fr; }
  .ratio-bar { flex-direction: column; }
  .ratio-focus, .ratio-review { width: 100%; }
  .robot-card { padding: 12px; gap: 10px; }
  .robot-avatar-stage { width: 90px; height: 90px; }
  .bipbip-svg { width: 88px; height: 88px; }
  .speech-bubble { font-size: 0.95rem; padding: 10px 12px; }
  .chalkboard-surface { padding: 14px 13px 16px; }
  .problem-text { font-size: 1.12rem; }
  .board-token { font-size: 1.12rem; padding: 8px 12px; }
  .explain-input-row { flex-direction: column; }
  .btn-send { width: 100%; padding: 12px; }
  .btn-send br { display: none; }
  .success-actions { grid-template-columns: 1fr; }
  .onboarding-card, .challenge-card { padding: 20px 16px; border-radius: 24px; }
}

/* In-App Browser Banner (Zalo / Messenger) */
.inapp-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  background: rgba(254, 243, 199, 0.92);
  border: 1.5px solid #F59E0B;
  color: #78350F;
  border-radius: 18px;
  padding: 10px 14px;
  font-size: 0.9rem;
  line-height: 1.45;
  box-shadow: var(--shadow-soft);
}

body.theme-dark .inapp-banner {
  background: rgba(120, 53, 15, 0.55);
  border-color: rgba(251, 191, 36, 0.45);
  color: #FEF3C7;
}

.inapp-banner-text { flex: 1; min-width: 220px; }
.inapp-banner-actions { display: flex; align-items: center; gap: 6px; }
.btn-xs { padding: 6px 12px; font-size: 0.85rem; border-radius: 12px; }

.mic-btn.mic-unavailable {
  opacity: 0.72;
  filter: grayscale(0.35);
}
