/* ==========================================================================
   EASY10 v3.0 — Score 9.5/10 Ultra-Easy Indian Class 10 Portal Design System
   Warm, joyful, zero-jargon, kid-friendly, multilingual + Kanika Di Voice
   ========================================================================== */

:root {
  --v3-bg: #fffbf5;
  --v3-surface: #ffffff;
  --v3-soft: #f8f4ee;
  --v3-ink: #1e1b4b;
  --v3-text: #475569;
  --v3-muted: #64748b;
  --v3-border: #ebe3d5;
  --v3-border-strong: #d6cbb8;

  --v3-indigo: #4f46e5;
  --v3-indigo-dark: #4338ca;
  --v3-indigo-soft: #eef2ff;
  --v3-emerald: #059669;
  --v3-emerald-soft: #dcfce7;
  --v3-amber: #d97706;
  --v3-amber-soft: #fef3c7;
  --v3-rose: #e11d48;
  --v3-rose-soft: #fff1f2;
  --v3-rose-border: #fda4af;
  --v3-teal: #0d9488;
  --v3-teal-soft: #f0fdfa;
  --v3-navy: #1e1b4b;

  --v3-r-sm: 12px;
  --v3-r-md: 18px;
  --v3-r-lg: 24px;
  --v3-r-xl: 28px;
  --v3-shadow-sm: 0 4px 16px rgba(30, 27, 75, 0.05);
  --v3-shadow-md: 0 12px 32px rgba(30, 27, 75, 0.08);
  --v3-shadow-rose: 0 14px 36px rgba(225, 29, 72, 0.14);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body.e10-v3 {
  margin: 0;
  font-family: "Plus Jakarta Sans", "Noto Sans Devanagari", "Noto Sans Tamil", "Noto Sans Bengali", "Inter", system-ui, sans-serif;
  background: var(--v3-bg);
  color: var(--v3-ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 118px;
}

a { color: var(--v3-indigo); text-decoration: none; }

/* ---------- Single Ultra-Clean Sticky Header (1 Row on Desktop!) ---------- */
.v3-header {
  position: sticky;
  top: 0;
  z-index: 80;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1.5px solid var(--v3-border);
}

.v3-header-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 9px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: nowrap;
}

.v3-brand {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 800;
  font-size: 16.5px;
  color: var(--v3-ink);
  letter-spacing: -0.02em;
  white-space: nowrap;
  flex-shrink: 0;
}

.v3-brand .v3-pill {
  padding: 4px 8px;
  font-size: 11px;
  white-space: nowrap;
}

.v3-logo {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #4f46e5, #0d9488);
  color: #ffffff;
  font-size: 12.5px;
  font-weight: 800;
  box-shadow: 0 6px 14px rgba(79, 70, 229, 0.28);
}

.v3-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-wrap: nowrap;
}

.v3-nav-link {
  padding: 6px 8px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--v3-text);
  white-space: nowrap;
  transition: all 0.16s ease;
}

.v3-nav-link:hover,
.v3-nav-link.is-active {
  background: var(--v3-indigo-soft);
  color: var(--v3-indigo);
}

.v3-header-controls {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: nowrap;
  flex-shrink: 0;
}

.v3-lang-select {
  appearance: none;
  background: var(--v3-indigo-soft);
  border: 1.5px solid #c7d2fe;
  color: var(--v3-indigo-dark);
  font-weight: 700;
  font-size: 12px;
  padding: 5px 8px;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
}

/* ---------- Buttons & Pills (Big, Joyful, Touch-Friendly) ---------- */
.v3-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 22px;
  border-radius: 16px;
  font-size: 15px;
  font-weight: 700;
  border: 2px solid transparent;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.14s ease, box-shadow 0.16s ease, background 0.16s ease;
  white-space: nowrap;
}

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

.v3-btn-primary {
  background: var(--v3-indigo);
  color: #ffffff;
  box-shadow: 0 6px 0 #3730a3, 0 10px 20px rgba(79, 70, 229, 0.25);
}
.v3-btn-primary:hover { background: var(--v3-indigo-dark); }

.v3-btn-rose {
  background: var(--v3-rose);
  color: #ffffff;
  box-shadow: 0 5px 0 #9f1239, 0 10px 20px rgba(225, 29, 72, 0.22);
}

.v3-btn-rose-soft {
  background: var(--v3-rose-soft);
  color: #be123c;
  border-color: var(--v3-rose-border);
}
.v3-btn-rose-soft:hover { background: #ffe4e6; }

.v3-btn-soft {
  background: var(--v3-surface);
  color: var(--v3-ink);
  border-color: var(--v3-border-strong);
}
.v3-btn-soft:hover { background: var(--v3-soft); }

.v3-btn-emerald {
  background: var(--v3-emerald);
  color: #ffffff;
  box-shadow: 0 5px 0 #047857;
}

.v3-btn-sm {
  padding: 9px 15px;
  font-size: 13.5px;
  border-radius: 12px;
  box-shadow: none;
}

.v3-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 13px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 800;
}
.v3-pill-emerald { background: var(--v3-emerald-soft); color: #15803d; }
.v3-pill-amber { background: var(--v3-amber-soft); color: #b45309; }
.v3-pill-indigo { background: var(--v3-indigo-soft); color: var(--v3-indigo); }
.v3-pill-rose { background: var(--v3-rose-soft); color: #be123c; }
.v3-pill-teal { background: var(--v3-teal-soft); color: var(--v3-teal); }

/* ---------- Layout & Containers ---------- */
.v3-container {
  max-width: 1260px;
  margin: 0 auto;
  padding: 0 20px;
}

.v3-section {
  padding: 44px 0;
}

.v3-hero {
  padding: 44px 0 36px;
  background: radial-gradient(circle at 85% 15%, rgba(244, 63, 94, 0.08), transparent 45%),
              radial-gradient(circle at 12% 80%, rgba(79, 70, 229, 0.08), transparent 45%);
}

.v3-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  gap: 36px;
  align-items: center;
}

.v3-hero h1 {
  margin: 14px 0 14px;
  font-size: clamp(32px, 4.2vw, 48px);
  font-weight: 800;
  line-height: 1.14;
  letter-spacing: -0.03em;
  color: var(--v3-ink);
}

.v3-hero-lead {
  margin: 0 0 24px;
  font-size: 17px;
  color: var(--v3-text);
  max-width: 580px;
}

.v3-lang-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.v3-lang-chip {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1.5px solid var(--v3-border-strong);
  background: var(--v3-surface);
  color: var(--v3-ink);
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}

.v3-lang-chip:not(.is-active):hover {
  background: var(--v3-indigo-soft);
  border-color: #818cf8;
  color: var(--v3-indigo-dark);
}

.v3-lang-chip.is-active {
  background: var(--v3-indigo);
  border-color: var(--v3-indigo);
  color: #ffffff;
}

/* ---------- Kanika Di Hero & Floating Voice Companion ---------- */
.v3-didi-card {
  background: var(--v3-surface);
  border: 2px solid #fbcfe8;
  border-radius: var(--v3-r-xl);
  padding: 26px;
  box-shadow: var(--v3-shadow-rose);
}

.v3-didi-avatar {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: linear-gradient(135deg, #fb7185, #f472b6, #818cf8);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 26px;
  flex-shrink: 0;
  box-shadow: 0 0 0 6px #ffe4e6;
}

.v3-didi-quote {
  background: #fff7ed;
  border: 1.5px solid #fed7aa;
  border-radius: 18px;
  padding: 16px 18px;
  font-size: 15px;
  font-weight: 600;
  color: var(--v3-ink);
  margin: 16px 0;
}

/* Floating Animated Kanika Di Character Overlay (Global on EVERY page) */
.didi-float-wrap {
  position: fixed;
  right: 20px;
  bottom: 18px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  pointer-events: none;
}

.didi-float-wrap > * {
  pointer-events: auto;
}

.didi-speech-bubble {
  max-width: 260px;
  background: #ffffff;
  border: 2px solid #fbcfe8;
  border-radius: 18px 18px 4px 18px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 700;
  color: var(--v3-ink);
  box-shadow: 0 12px 28px rgba(30, 27, 75, 0.14);
  line-height: 1.4;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.didi-speech-bubble.is-hidden {
  display: none;
}

.didi-char-fab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px 5px 5px;
  border-radius: 999px;
  border: 2px solid #fda4af;
  background: linear-gradient(135deg, #fff1f2 0%, #ffffff 55%, #eef2ff 100%);
  color: var(--v3-ink);
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(225, 29, 72, 0.22);
  font-family: inherit;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.didi-char-fab:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 18px 36px rgba(225, 29, 72, 0.30);
}

.didi-char-medallion {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  overflow: hidden;
  background: radial-gradient(circle at 50% 35%, #fff7ed 0%, #ffe4e6 68%, #fbcfe8 100%);
  border: 2.5px solid #fb7185;
  flex-shrink: 0;
  position: relative;
  box-shadow: 0 0 0 0 rgba(244, 63, 94, 0.45);
}

.didi-char-medallion.is-speaking {
  animation: didiAuraGlow 1.3s ease-in-out infinite;
}

@keyframes didiAuraGlow {
  0% { box-shadow: 0 0 0 0 rgba(244, 63, 94, 0.48); }
  70% { box-shadow: 0 0 0 14px rgba(244, 63, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(244, 63, 94, 0); }
}

.didi-stage-avatar {
  width: 138px;
  height: 138px;
  min-width: 138px;
  min-height: 138px;
  flex-shrink: 0;
  border-radius: 50%;
  overflow: hidden;
  background: radial-gradient(circle at 50% 30%, #fffbeb 0%, #ffe4e6 65%, #e0e7ff 100%);
  border: 3px solid #fb7185;
  margin: 0 auto;
  box-shadow: 0 12px 28px rgba(225, 29, 72, 0.18);
  position: relative;
}

.didi-stage-avatar.is-speaking {
  animation: didiAuraGlow 1.2s ease-in-out infinite;
}

/* HD Portrait Kanika Di Living Animation & Pixel-Locked Real-Time Audio Lip-Sync */
.didi-photo-rig {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
  border-radius: 50%;
  --lip-x: 50%;
  --lip-y: 52.4%;
  --lip-w: 14.2%;
  --lip-h: 7.4%;
}

/* Unified animated wrapper so portrait and mouth overlay move together with zero drift */
.didi-photo-stage {
  position: relative;
  width: 100%;
  height: 100%;
  transform-origin: 50% 62%;
  animation: didiPhotoBreathe 4.4s ease-in-out infinite;
  will-change: transform;
}

.is-speaking .didi-photo-stage {
  animation: didiPhotoTalk 1.35s ease-in-out infinite;
}

.didi-photo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  display: block;
  user-select: none;
  pointer-events: none;
}

@keyframes didiPhotoBreathe {
  0%, 100% { transform: scale(1.02) translateY(0px); }
  50% { transform: scale(1.038) translateY(-1px); }
}

@keyframes didiPhotoTalk {
  0%, 100% { transform: scale(1.025) translateY(0px) rotate(-0.45deg); }
  38% { transform: scale(1.045) translateY(-1.2px) rotate(0.55deg); }
  72% { transform: scale(1.032) translateY(-0.4px) rotate(-0.3deg); }
}

/* Calibrated anatomical jaw-drop SVG viseme mouth anchored at upper lip seam (zero CSS lag!) */
.didi-lip-overlay {
  position: absolute;
  left: var(--lip-x);
  top: var(--lip-y);
  width: var(--lip-w);
  height: var(--lip-h);
  transform: translate(-50%, -22%);
  opacity: 0;
  pointer-events: none;
  overflow: visible;
  will-change: opacity;
  filter: drop-shadow(0 0.8px 1.2px rgba(72, 22, 24, 0.28));
}

.didi-lip-overlay svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

.didi-lip-overlay svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

/* Subtle Audio Ring inside portrait when speaking */
.didi-speaking-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid rgba(244, 63, 94, 0);
  pointer-events: none;
  transition: border-color 0.2s ease;
}

.is-speaking .didi-speaking-ring {
  border-color: rgba(244, 63, 94, 0.72);
  box-shadow: inset 0 0 18px rgba(244, 63, 94, 0.28);
}

.didi-head-group {
  transform-origin: 100px 135px;
  animation: didiIdleBreathe 3.8s ease-in-out infinite;
}

.is-speaking .didi-head-group {
  animation: didiTalkNod 0.9s ease-in-out infinite;
}

@keyframes didiIdleBreathe {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-2.2px) rotate(1.2deg); }
}

@keyframes didiTalkNod {
  0%, 100% { transform: translateY(0px) rotate(-1.5deg); }
  35% { transform: translateY(-2.8px) rotate(1.8deg); }
  70% { transform: translateY(-1px) rotate(-0.8deg); }
}

.didi-eyelids {
  transform-origin: 100px 92px;
  animation: didiBlink 4.6s ease-in-out infinite;
}

@keyframes didiBlink {
  0%, 92%, 100% { transform: scaleY(0); }
  95%, 97% { transform: scaleY(1); }
}

.didi-hand-wave {
  transform-origin: 158px 168px;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.is-speaking .didi-hand-wave {
  opacity: 1;
  animation: didiHandExplain 1.2s ease-in-out infinite;
}

@keyframes didiHandExplain {
  0%, 100% { transform: rotate(0deg) translateY(0px); }
  50% { transform: rotate(-10deg) translateY(-5px); }
}

.didi-hair-strand {
  transform-origin: 132px 60px;
  animation: didiHairSway 4.2s ease-in-out infinite;
}

@keyframes didiHairSway {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(1.8deg); }
}

.didi-drawer {
  position: fixed;
  right: 20px;
  bottom: 114px;
  width: min(400px, calc(100vw - 28px));
  max-height: calc(100vh - 134px);
  overflow-y: auto;
  z-index: 998;
  background: var(--v3-surface);
  border: 2px solid #fbcfe8;
  border-radius: 26px;
  padding: 18px 20px;
  box-shadow: 0 24px 60px rgba(30, 27, 75, 0.22);
  display: none;
  flex-direction: column;
  gap: 11px;
}

.didi-drawer.is-open { display: flex; }
.didi-drawer > * { flex-shrink: 0; }

.didi-wave {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 32px;
  background: #fff1f2;
  border-radius: 12px;
  padding: 4px 12px;
}

.didi-wave span {
  width: 4px;
  height: 8px;
  border-radius: 999px;
  background: #e11d48;
  transition: height 0.15s ease;
}

.didi-wave.is-speaking span {
  animation: didiWave 0.7s ease-in-out infinite alternate;
}
.didi-wave.is-speaking span:nth-child(2n) { animation-delay: 0.15s; background: #ec4899; }
.didi-wave.is-speaking span:nth-child(3n) { animation-delay: 0.3s; background: #4f46e5; }

@keyframes didiWave {
  from { height: 6px; }
  to { height: 24px; }
}

.didi-action-btn {
  width: 100%;
  text-align: left;
  padding: 11px 14px;
  border-radius: 14px;
  border: 1.5px solid var(--v3-border);
  background: var(--v3-bg);
  color: var(--v3-ink);
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s ease;
}
.didi-action-btn:hover {
  background: #fff1f2;
  border-color: #fda4af;
  color: #be123c;
}

.didi-caption {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 14px;
  padding: 11px 14px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--v3-ink);
  min-height: 52px;
  max-height: 112px;
  overflow-y: auto;
}

/* Global In-Drawer 10-Avatar Strip & 4-Mode Behaviour Pills */
.didi-beh-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 11px;
  border-radius: 999px;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  color: #3730a3;
  font-size: 11.5px;
  font-weight: 800;
}

.didi-avatar-strip-wrap {
  background: var(--v3-bg);
  border: 1.5px solid var(--v3-border);
  border-radius: 14px;
  padding: 8px 10px;
}

.didi-strip-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 800;
  color: var(--v3-muted);
  margin-bottom: 6px;
}

.didi-strip-head a {
  color: var(--v3-indigo);
  text-decoration: none;
}

.didi-avatar-strip {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 2px 2px 4px;
  scrollbar-width: thin;
}

.didi-mini-av {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 50%;
  padding: 0;
  overflow: hidden;
  border: 2.5px solid transparent;
  background: #fff7ed;
  cursor: pointer;
  transition: transform 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
}

.didi-mini-av img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  display: block;
}

.didi-mini-av:hover {
  transform: scale(1.08);
  border-color: #fda4af;
}

.didi-mini-av.is-active {
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.22);
}

.didi-behavior-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
}

.didi-beh-chip {
  padding: 6px 4px;
  border-radius: 10px;
  border: 1.5px solid var(--v3-border);
  background: var(--v3-bg);
  color: var(--v3-ink);
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
  text-align: center;
  transition: all 0.14s ease;
}

.didi-beh-chip:hover {
  border-color: #fda4af;
  background: #fff1f2;
  color: #be123c;
}

.didi-beh-chip.is-active {
  background: #4f46e5;
  border-color: #4f46e5;
  color: #ffffff;
}

body.e10-theme-dark .didi-beh-badge {
  background: rgba(99, 102, 241, 0.22);
  border-color: #6366f1;
  color: #e0e7ff;
}

body.e10-theme-dark .didi-beh-chip {
  background: #0f172a;
  border-color: #334155;
  color: #f1f5f9;
}

body.e10-theme-dark .didi-beh-chip.is-active {
  background: #6366f1;
  border-color: #818cf8;
  color: #ffffff;
}

body.e10-theme-dark #heroBehaviorBadge {
  background: rgba(99, 102, 241, 0.25) !important;
  color: #e0e7ff !important;
}

/* ---------- Big Joyful Subject & Chapter Cards ---------- */
.v3-subject-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.v3-subject-card {
  background: var(--v3-surface);
  border: 2px solid var(--v3-border);
  border-radius: var(--v3-r-lg);
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  box-shadow: var(--v3-shadow-sm);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.v3-subject-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--v3-shadow-md);
  border-color: var(--v3-indigo);
}

.v3-subject-card h3 {
  margin: 8px 0 4px;
  font-size: 21px;
  font-weight: 800;
}

.v3-subject-card p {
  margin: 0;
  font-size: 14px;
  color: var(--v3-text);
}

/* Big Subject Tabs (Study Material Hub) */
.v3-subject-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px;
  background: var(--v3-surface);
  border: 2px solid var(--v3-border);
  border-radius: 20px;
  margin-bottom: 20px;
  box-shadow: var(--v3-shadow-sm);
}

.v3-subject-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: 14px;
  font-size: 14.5px;
  font-weight: 800;
  color: var(--v3-text);
  background: var(--v3-soft);
  border: 1.5px solid transparent;
  transition: all 0.15s ease;
}

.v3-subject-tab:hover {
  background: var(--v3-indigo-soft);
  color: var(--v3-indigo);
}

.v3-subject-tab.is-active {
  background: var(--v3-indigo);
  color: #ffffff;
  box-shadow: 0 6px 14px rgba(79, 70, 229, 0.28);
}

/* Clean 2-Column Study Material Cards (Uncluttered!) */
.v3-chapter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.v3-card {
  background: var(--v3-surface);
  border: 2px solid var(--v3-border);
  border-radius: var(--v3-r-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  box-shadow: var(--v3-shadow-sm);
}

.v3-card h2, .v3-card h3 {
  margin: 0;
  font-weight: 800;
  color: var(--v3-ink);
}

.v3-formula-box {
  background: #f0fdfa;
  border: 1.5px solid #99f6e4;
  border-radius: 16px;
  padding: 14px 18px;
}

.v3-formula-box ul {
  margin: 8px 0 0;
  padding-left: 18px;
  font-size: 14.5px;
  color: #134e4a;
}

.v3-formula-box li { margin-bottom: 5px; }

.v3-search-bar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  background: var(--v3-surface);
  border: 2px solid var(--v3-border);
  border-radius: 18px;
  padding: 14px;
  margin-bottom: 24px;
  align-items: center;
}

.v3-search-bar input,
.v3-search-bar select {
  flex: 1;
  min-width: 200px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1.5px solid var(--v3-border-strong);
  font-size: 15px;
  font-family: inherit;
  background: var(--v3-bg);
  color: var(--v3-ink);
}

.v3-steps-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.v3-step-card {
  background: var(--v3-surface);
  border: 2px solid var(--v3-border);
  border-radius: var(--v3-r-lg);
  padding: 24px;
  text-align: left;
}

.v3-more-links summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  color: var(--v3-muted);
  list-style: none;
  padding-top: 4px;
}

/* ---------- v4.0 Eye-Comfort Study Themes (Sepia & Night Dark) ---------- */
body.e10-theme-sepia {
  --v3-bg: #f6efe2;
  --v3-surface: #fdf9f0;
  --v3-soft: #efe5d2;
  --v3-ink: #2b2118;
  --v3-text: #5a4938;
  --v3-muted: #7a6652;
  --v3-border: #dfd1b8;
  --v3-border-strong: #c9b796;
}

body.e10-theme-dark {
  --v3-bg: #0f172a;
  --v3-surface: #1e293b;
  --v3-soft: #273449;
  --v3-ink: #f8fafc;
  --v3-text: #cbd5e1;
  --v3-muted: #94a3b8;
  --v3-border: #334155;
  --v3-border-strong: #475569;
  --v3-indigo-soft: rgba(99, 102, 241, 0.18);
  --v3-emerald-soft: rgba(16, 185, 129, 0.18);
  --v3-amber-soft: rgba(245, 158, 11, 0.18);
  --v3-rose-soft: rgba(244, 63, 94, 0.18);
  --v3-teal-soft: rgba(20, 184, 166, 0.18);
}

body.e10-theme-dark .v3-header {
  background: rgba(15, 23, 42, 0.94);
}
body.e10-theme-dark .v3-formula-box {
  background: rgba(13, 148, 136, 0.14);
  border-color: rgba(45, 212, 191, 0.35);
}
body.e10-theme-dark .v3-formula-box ul,
body.e10-theme-dark .v3-formula-box li { color: #ccfbf1; }
body.e10-theme-dark .v3-didi-quote,
body.e10-theme-dark .didi-caption {
  background: #273449;
  border-color: #475569;
  color: #f8fafc;
}
body.e10-theme-dark .didi-char-fab {
  background: linear-gradient(135deg, #1e293b 0%, #312e81 100%);
  color: #ffffff;
}
body.e10-theme-dark .didi-char-fab span { color: #f8fafc !important; }
body.e10-theme-dark .v3-btn-rose-soft {
  background: rgba(244, 63, 94, 0.24);
  color: #ffe4e6;
  border-color: rgba(253, 164, 175, 0.55);
}
body.e10-theme-dark .v3-lang-select {
  background: #1e293b;
  color: #e0e7ff;
  border-color: #6366f1;
}
body.e10-theme-dark .v3-pill-rose { color: #fecdd3; }
body.e10-theme-dark .v3-pill-amber { color: #fde68a; }
body.e10-theme-dark .v3-pill-emerald { color: #6ee7b7; }
body.e10-theme-dark .v3-pill-indigo { color: #c7d2fe; }
body.e10-theme-dark .didi-speech-bubble {
  background: #1e293b;
  color: #f8fafc;
}
body.e10-theme-dark .sprint-shell,
body.e10-theme-dark .lab-card,
body.e10-theme-dark .fc-stage,
body.e10-theme-dark .manip-card,
body.e10-theme-dark .calm-card,
body.e10-theme-dark .leaf-card,
body.e10-theme-dark .sheet-box {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #f8fafc !important;
}

/* ---------- v4.0 Mega-Product 4-Mission Hub & Weightage Heatmap ---------- */
.v4-mega-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.v4-mission-col {
  background: var(--v3-surface);
  border: 2px solid var(--v3-border);
  border-radius: 22px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--v3-shadow-sm);
}

.v4-mission-col h3 {
  margin: 4px 0 4px;
  font-size: 18px;
  font-weight: 800;
}

.v4-tool-link {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 11px 13px;
  border-radius: 14px;
  background: var(--v3-bg);
  border: 1.5px solid var(--v3-border);
  color: var(--v3-ink);
  transition: all 0.15s ease;
}

.v4-tool-link:hover {
  border-color: var(--v3-indigo);
  background: var(--v3-indigo-soft);
  transform: translateY(-1px);
}

.v4-tool-link strong { font-size: 14px; font-weight: 800; }
.v4-tool-link span { font-size: 12px; color: var(--v3-text); }

/* Pinned Pocket Revision Tray */
.v4-pocket-drawer {
  position: fixed;
  left: 20px;
  bottom: 20px;
  width: min(380px, calc(100vw - 28px));
  max-height: 70vh;
  overflow-y: auto;
  z-index: 997;
  background: var(--v3-surface);
  border: 2px solid var(--v3-indigo);
  border-radius: 24px;
  padding: 18px;
  box-shadow: 0 24px 60px rgba(30, 27, 75, 0.24);
  display: none;
  flex-direction: column;
  gap: 10px;
}
.v4-pocket-drawer.is-open { display: flex; }

/* Heatmap Cards */
.v4-heat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.v4-heat-card {
  background: var(--v3-surface);
  border: 2px solid var(--v3-border);
  border-left-width: 7px;
  border-radius: 18px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}
.v4-heat-card:hover { transform: translateY(-2px); box-shadow: var(--v3-shadow-md); }
.v4-heat-high { border-left-color: #e11d48; }
.v4-heat-med  { border-left-color: #f59e0b; }
.v4-heat-low  { border-left-color: #10b981; }
.v4-heat-card.is-done { opacity: 0.78; background: var(--v3-emerald-soft); }

.v4-icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 8px;
  border-radius: 999px;
  border: 1.5px solid var(--v3-border-strong);
  background: var(--v3-surface);
  color: var(--v3-ink);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}
.v4-icon-btn:hover { border-color: var(--v3-indigo); background: var(--v3-indigo-soft); }

@media (max-width: 1220px) {
  .v3-header-inner { flex-wrap: wrap; }
  .v3-nav, .v3-header-controls { flex-wrap: wrap; }
}

@media (max-width: 1120px) {
  .v4-mega-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1024px) {
  .v3-hero-grid,
  .v3-subject-grid,
  .v3-chapter-grid,
  .v3-steps-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .v4-mega-grid { grid-template-columns: 1fr; }
}
