:root {
  --bg:#f8fafc;
  --bg2:#f1f5f9;
  --panel:#ffffff;
  --panel2:#f8fafc;
  --line:#e2e8f0;
  --text:#0f172a;
  --text-soft:#334155;
  --muted:#64748b;
  --indigo:#6366f1;
  --coral:#f43f5e;
  --emerald:#10b981;
  --amber:#f59e0b;
  --sky:#0ea5e9;
  --cyan:#0284c7;
  --shadow:0 10px 25px -5px rgba(15,23,42,0.06), 0 8px 10px -6px rgba(15,23,42,0.04);
  --shadow-lg:0 20px 35px -8px rgba(15,23,42,0.09), 0 10px 15px -5px rgba(15,23,42,0.04);
  --radius:20px;
}

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

body {
  margin: 0;
  background: var(--bg);
  background-image:
    radial-gradient(circle at 85% 0%, rgba(99,102,241,0.04) 0%, transparent 35%),
    radial-gradient(circle at 15% 15%, rgba(14,165,233,0.04) 0%, transparent 25%),
    linear-gradient(180deg, #f8fafc, #f1f5f9 45%, #f8fafc);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  min-height: 100vh;
}

.noise { display: none; }
.shell { width: min(1200px, calc(100% - 40px)); margin-inline: auto; position: relative; z-index: 1; }

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: fixed;
  left: 12px;
  top: -60px;
  z-index: 1000;
  background: var(--indigo);
  color: #fff;
  padding: 10px 16px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 800;
}
.skip-link:focus { top: 12px; }

/* View Routing & Global Utilities */
.app-view {
  display: none;
}
.app-view.active {
  display: block;
}

.hidden {
  display: none !important;
}

/* Topbar Navigation */
.topbar {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px max(20px, calc((100vw - 1200px)/2));
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  position: sticky;
  top: 0;
  z-index: 50;
  flex-wrap: wrap;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 28px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: var(--indigo);
  font-weight: 900;
  background: #f8fafc;
  box-shadow: 0 2px 6px rgba(15,23,42,0.05);
}

.brand-copy strong {
  display: block;
  letter-spacing: 0.16em;
  font-size: 13px;
  font-weight: 900;
  color: var(--text);
}

.brand-copy small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.14em;
  margin-top: 1px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-btn {
  background: transparent;
  border: none;
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.nav-btn:hover {
  background: #f1f5f9;
  color: var(--text);
}

.nav-btn.active {
  background: #eef2ff;
  color: var(--indigo);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.search-wrap {
  position: relative;
}

#globalSearch {
  background: #f8fafc;
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 12px;
  padding: 8px 14px;
  font-size: 13px;
  width: 220px;
  outline: none;
  transition: all 0.2s ease;
}

#globalSearch:focus {
  background: #ffffff;
  border-color: var(--indigo);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
  width: 260px;
}

.nav-cta {
  padding: 8px 16px;
  font-size: 13px;
}

/* Base Form & Button Controls */
button, input, select, textarea { font: inherit; }

.primary-btn, .secondary-btn, .ghost-btn {
  border-radius: 12px;
  padding: 8px 14px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: 0.2s ease;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.primary-btn {
  background: var(--indigo);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(99,102,241,0.25);
}
.primary-btn:hover {
  background: #4f46e5;
  transform: translateY(-1px);
}

.secondary-btn {
  background: #f1f5f9;
  color: var(--text);
  border-color: var(--line);
}
.secondary-btn:hover {
  background: #e2e8f0;
}

.ghost-btn {
  background: transparent;
  color: var(--text-soft);
  border-color: var(--line);
}
.ghost-btn:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: var(--text);
}
.ghost-btn.active {
  background: #fef3c7;
  color: #b45309;
  border-color: #fde68a;
}
.ghost-btn.full { width: 100%; justify-content: center; }

.large-btn {
  padding: 12px 24px;
  font-size: 15px;
  border-radius: 14px;
}

.category-pill {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 10px;
  letter-spacing: 0.12em;
  font-weight: 900;
  background: #f1f5f9;
  color: var(--indigo);
}

.lab-num-badge {
  font-size: 11px;
  letter-spacing: 0.14em;
  font-weight: 800;
  color: var(--muted);
}

/* ==========================================================================
   VIEW 1: HOME PAGE HERO & SECTIONS
   ========================================================================== */
.hero-shell {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 36px;
  align-items: center;
  padding-block: 50px 30px;
}

.hero-eyebrow {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 0.18em;
  font-weight: 900;
  color: var(--indigo);
  background: #eef2ff;
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 16px;
}

.hero-title {
  font-size: clamp(32px, 4.5vw, 54px);
  line-height: 1.12;
  letter-spacing: -0.04em;
  font-weight: 900;
  color: var(--text);
  margin: 0 0 16px;
}

.hero-gradient {
  background: linear-gradient(135deg, #4f46e5 0%, #0284c7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 17px;
  line-height: 1.6;
  color: var(--text-soft);
  margin: 0 0 24px;
  max-width: 580px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.hero-proof {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  flex-wrap: wrap;
}

.hero-preview-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 18px;
  box-shadow: var(--shadow-lg);
}

.preview-stage-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  letter-spacing: 0.1em;
  font-weight: 900;
  color: var(--emerald);
  background: #ecfdf5;
  padding: 3px 8px;
  border-radius: 999px;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  background: var(--emerald);
  border-radius: 50%;
  animation: stagePulse 1.5s infinite;
}

.preview-tag {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
}

.hero-preview-stage {
  width: 100%;
  min-height: 220px;
  border-radius: 16px;
  background: #f8fafc;
  overflow: hidden;
}

.hero-slider-row {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hero-slider-row label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-soft);
  display: flex;
  justify-content: space-between;
}

.hero-slider-row input[type=range] {
  width: 100%;
  accent-color: var(--indigo);
}

/* Section Standards */
.section-space {
  padding-block: 40px 24px;
}

.section-head {
  margin-bottom: 24px;
}

.section-kicker {
  font-size: 11px;
  letter-spacing: 0.16em;
  font-weight: 900;
  color: var(--indigo);
  margin-bottom: 6px;
}

.section-title {
  font-size: clamp(24px, 3.5vw, 36px);
  font-weight: 900;
  letter-spacing: -0.03em;
  color: var(--text);
  margin: 0 0 6px;
}

.section-desc {
  font-size: 15px;
  color: var(--muted);
  margin: 0;
  max-width: 700px;
  line-height: 1.5;
}

/* Popular Concepts Grid */
.concepts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.concept-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 18px 20px;
  box-shadow: 0 4px 16px rgba(15,23,42,0.03);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.2,0.8,0.2,1);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.concept-card:hover {
  transform: translateY(-3px);
  border-color: #cbd5e1;
  box-shadow: var(--shadow);
}

.concept-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.concept-category {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.1em;
}

.concept-lab-id {
  font-size: 10px;
  font-weight: 800;
  color: var(--muted);
}

.concept-card-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--text);
  margin: 0 0 6px;
  line-height: 1.3;
}

.concept-card-question {
  font-size: 13px;
  color: var(--text-soft);
  margin: 0 0 16px;
  line-height: 1.5;
  flex: 1;
}

.concept-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.concept-formal-name {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
}

.concept-launch-arrow {
  color: var(--indigo);
  font-weight: 900;
  font-size: 16px;
}

/* Explore Portals Grid */
.portals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 18px;
}

.portal-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 16px rgba(15,23,42,0.03);
  transition: all 0.2s ease;
  cursor: pointer;
}

.portal-card:hover {
  transform: translateY(-4px);
  border-color: #cbd5e1;
  box-shadow: var(--shadow);
}

.portal-icon {
  font-size: 32px;
  margin-bottom: 12px;
}

.portal-card h3 {
  font-size: 19px;
  font-weight: 800;
  color: var(--text);
  margin: 0 0 8px;
}

.portal-card p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
  margin: 0 0 18px;
  flex: 1;
}

.portal-btn {
  align-self: flex-start;
}

/* ==========================================================================
   VIEW 2: LEARNING PATH (6 STAGES)
   ========================================================================== */
.stages-flow {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.stage-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 24px;
  box-shadow: 0 4px 16px rgba(15,23,42,0.03);
}

.stage-card-head {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.stage-num-badge {
  background: var(--indigo);
  color: #ffffff;
  font-size: 13px;
  font-weight: 900;
  padding: 6px 12px;
  border-radius: 10px;
  flex-shrink: 0;
}

.stage-card-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  margin: 0 0 4px;
}

.stage-card-desc {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
  line-height: 1.5;
}

.stage-labs-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.stage-lab-item {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 14px;
  display: flex;
  gap: 12px;
  align-items: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.stage-lab-item:hover {
  background: #ffffff;
  border-color: var(--indigo);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(15,23,42,0.05);
}

.stage-lab-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.stage-lab-info {
  flex: 1;
  min-width: 0;
}

.stage-lab-info strong {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stage-lab-info small {
  display: block;
  font-size: 11px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 2px;
}

.bookmark-flag {
  color: #f59e0b;
  font-size: 14px;
}

.stage-card-foot {
  display: flex;
  justify-content: flex-end;
}

/* ==========================================================================
   VIEW 3: FORMULA LIBRARY
   ========================================================================== */
.library-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 18px;
}

.library-search-box input {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 16px;
  font-size: 13px;
  width: 300px;
  outline: none;
  transition: all 0.2s ease;
}

.library-search-box input:focus {
  border-color: var(--indigo);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}

.category-filters-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.filter-chip {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-soft);
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.filter-chip:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.filter-chip.active {
  background: var(--text);
  color: #ffffff;
  border-color: var(--text);
}

.library-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
}

.library-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(15,23,42,0.03);
  transition: all 0.2s ease;
}

.library-card:hover {
  transform: translateY(-3px);
  border-color: #cbd5e1;
  box-shadow: var(--shadow);
}

.library-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.category-badge {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.1em;
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid;
}

.lib-num {
  font-size: 10px;
  font-weight: 800;
  color: var(--muted);
}

.library-card-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  margin: 0 0 6px;
  line-height: 1.3;
}

.library-card-question {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
  font-style: italic;
  margin: 0 0 14px;
}

.library-math-preview {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  margin-bottom: 14px;
  text-align: center;
  overflow-x: auto;
  font-size: 14px;
}

.library-card-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.lib-formal-sub {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
}

.lib-enter-btn {
  font-size: 12px;
  color: var(--indigo);
  font-weight: 800;
}

.empty-state {
  text-align: center;
  color: var(--muted);
  padding: 40px;
  font-size: 15px;
}

/* ==========================================================================
   VIEW 4: INTERACTIVE PRACTICE
   ========================================================================== */
.practice-layout {
  display: grid;
  grid-template-columns: 290px 1fr;
  gap: 22px;
  align-items: start;
}

.challenges-menu-panel {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 18px;
}

.challenge-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}

.challenge-item-btn {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  gap: 10px;
  align-items: center;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
  width: 100%;
}

.challenge-item-btn:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.challenge-item-btn.active {
  background: #eef2ff;
  border-color: var(--indigo);
}

.challenge-info strong {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
}

.challenge-info small {
  display: block;
  font-size: 10px;
  color: var(--muted);
  margin-top: 1px;
}

.practice-active-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 24px;
  box-shadow: 0 4px 16px rgba(15,23,42,0.03);
}

.practice-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.practice-lab-num {
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
}

.practice-title {
  font-size: 24px;
  font-weight: 900;
  margin: 0 0 14px;
  color: var(--text);
  letter-spacing: -0.02em;
}

.practice-prompt-box {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 18px;
  font-size: 14px;
  line-height: 1.6;
  color: #334155;
  margin-bottom: 18px;
}

.practice-visual-box {
  margin-bottom: 18px;
}

.practice-situation-graphic {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 14px;
  padding: 12px 16px;
  display: flex;
  gap: 12px;
  align-items: center;
}

.situation-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.situation-summary {
  font-size: 13px;
  color: #1e40af;
  line-height: 1.5;
}

.practice-input-row {
  margin-bottom: 18px;
}

.practice-input-row label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-soft);
  margin-bottom: 8px;
}

.input-and-check {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

#practiceAnswerInput {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 9px 14px;
  font-size: 15px;
  font-weight: 700;
  width: 170px;
  outline: none;
}

#practiceAnswerInput:focus {
  border-color: var(--indigo);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}

.practice-unit {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}

.practice-feedback-box {
  padding: 12px 16px;
  border-radius: 12px;
  margin-bottom: 18px;
  font-size: 13px;
  line-height: 1.6;
}

.practice-feedback-box.good {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
}

.practice-feedback-box.bad {
  background: #fff1f2;
  border: 1px solid #fecdd3;
  color: #9f1239;
}

.practice-actions-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.practice-hint-text, .practice-equation-reveal {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 13px;
  margin-top: 12px;
  line-height: 1.6;
}

/* ==========================================================================
   VIEW 5: LIVE LABS HEADER & STORY
   ========================================================================== */
.lab-topbar {
  background: #ffffff;
  border-bottom: 1px solid var(--line);
  padding: 8px 0;
  position: sticky;
  top: 72px;
  z-index: 40;
}

.lab-topbar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.lab-selector-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-step-btn {
  padding: 7px 12px;
  font-size: 12px;
}

.lab-select-control {
  appearance: none;
  background: #f8fafc;
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 10px;
  padding: 8px 34px 8px 12px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  outline: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 14px;
}

.lab-select-control:focus {
  border-color: var(--indigo);
  background-color: #ffffff;
}

.lab-utility-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.lab-hero-header {
  padding: 22px 0 16px;
}

.lab-badge-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.lab-main-title {
  margin: 0 0 8px;
}

.concept-headline {
  display: block;
  font-size: clamp(26px, 4vw, 38px);
  font-weight: 900;
  color: var(--text);
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.formal-headline {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: var(--muted);
  margin-top: 4px;
}

.lab-question-lead {
  font-size: 16px;
  color: var(--text-soft);
  margin: 0;
  line-height: 1.5;
  max-width: 800px;
}

.playground-stage-wrapper {
  margin-bottom: 24px;
}

.stage-kicker {
  text-align: center;
  font-size: 10px;
  letter-spacing: 0.18em;
  font-weight: 900;
  color: var(--indigo);
  margin-bottom: 12px;
}

.blocks-section {
  margin: 28px 0;
}

.blocks-kicker {
  text-align: center;
  font-size: 10px;
  letter-spacing: 0.18em;
  font-weight: 900;
  color: var(--indigo);
  margin-bottom: 16px;
}

.story-panel-section {
  margin: 28px 0;
}

.story-card {
  border-radius: 22px;
  padding: 24px;
}

.story-card-header {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.story-card-header h3 {
  margin: 0 0 4px;
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
}

.story-lead {
  font-size: 15px;
  line-height: 1.65;
  color: #334155;
  margin: 0;
}

.story-three-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.story-col strong {
  display: block;
  font-size: 12px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 4px;
}

.story-col p {
  margin: 0;
  font-size: 13px;
  color: var(--text-soft);
  line-height: 1.55;
}

.formal-math-section {
  margin: 24px 0 60px;
}

.formal-toggle-row {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.math-toggle-btn {
  border-radius: 999px;
  padding: 10px 24px;
  font-size: 13px;
  font-weight: 800;
  background: #ffffff;
  border: 1px solid var(--line);
  box-shadow: 0 2px 8px rgba(15,23,42,0.04);
}

.math-toggle-btn:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.mascot-widget {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  align-items: flex-end;
  gap: 10px;
  z-index: 90;
  pointer-events: none;
}

.mascot-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid var(--line);
  display: grid;
  place-items: center;
  font-size: 24px;
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  pointer-events: auto;
  transition: transform 0.2s cubic-bezier(0.2,0.8,0.2,1);
}

.mascot-avatar:hover {
  transform: scale(1.1) rotate(6deg);
}

.mascot-speech-bubble {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 16px;
  padding: 12px 16px;
  box-shadow: var(--shadow-lg);
  max-width: 260px;
  pointer-events: auto;
  position: relative;
}

.mascot-speech-bubble p {
  margin: 0;
  font-size: 12px;
  color: #1e293b;
  line-height: 1.5;
  font-weight: 600;
}

.mascot-close {
  position: absolute;
  top: 4px;
  right: 6px;
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  padding: 2px 5px;
}

.playground-kicker {
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.18em;
  font-weight: 900;
  color: var(--indigo);
  margin: 0 0 16px;
}

.visual-stage-card {
  background: linear-gradient(180deg, #ffffff, #f8fbff);
  border: 1px solid #e2e8f0;
  border-radius: 28px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.visual-stage {
  width: 100%;
  min-height: 300px;
}

.stage-svg {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}

.stage-bg {
  fill: #f8fafc;
  stroke: #e2e8f0;
  stroke-width: 1;
}

.stage-caption {
  margin: 10px 12px 2px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  line-height: 1.5;
}

.playground-story-card {
  max-width: 900px;
  margin: 22px auto 26px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  padding: 16px 22px;
  display: flex;
  gap: 14px;
  align-items: center;
  box-shadow: 0 4px 16px rgba(15,23,42,0.03);
}

.story-icon { font-size: 24px; flex-shrink: 0; }
.playground-story-card p {
  margin: 0;
  color: #334155;
  font-size: 15px;
  line-height: 1.6;
}

.playground-blocks-row {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  max-width: 1200px;
  margin: 0 auto;
}

.playground-block {
  --block-color: var(--indigo);
  flex: 1 1 180px;
  max-width: 250px;
  min-width: 165px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-top: 4px solid var(--block-color);
  border-radius: 20px;
  padding: 15px;
  box-shadow: 0 8px 24px rgba(15,23,42,0.04);
  transition: transform 0.2s cubic-bezier(0.2,0.8,0.2,1), box-shadow 0.2s ease, border-color 0.2s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.playground-block:hover, .playground-block.focused {
  transform: translateY(-4px);
  box-shadow: 0 16px 36px rgba(15,23,42,0.08);
  border-color: color-mix(in srgb, var(--block-color) 40%, #e2e8f0);
}

.playground-block.calculated {
  background: color-mix(in srgb, var(--block-color) 4%, #ffffff);
}
.playground-block.output {
  border-width: 2px;
  border-top-width: 5px;
}

.block-info {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  width: 100%;
  display: flex;
  gap: 10px;
  align-items: center;
  text-align: left;
  cursor: pointer;
  color: inherit;
  border-radius: 10px;
}
.block-info:hover strong {
  color: var(--block-color);
}

.block-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--block-color) 12%, white);
  display: grid;
  place-items: center;
  font-size: 20px;
  flex: 0 0 auto;
}

.block-info strong {
  display: block;
  color: #0f172a;
  font-size: 14px;
  line-height: 1.2;
}

.block-info small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.block-value-row {
  display: grid;
  grid-template-columns: 28px minmax(60px, 1fr) auto 28px;
  gap: 5px;
  align-items: center;
  margin: 14px 0 10px;
}

.block-nudge {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #475569;
  font-weight: 900;
  font-size: 14px;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all 0.15s ease;
}
.block-nudge:hover {
  background: color-mix(in srgb, var(--block-color) 10%, white);
  border-color: color-mix(in srgb, var(--block-color) 35%, #e2e8f0);
  color: var(--block-color);
}

.play-number {
  width: 100%;
  min-width: 0;
  border: 0;
  background: color-mix(in srgb, var(--block-color) 8%, white);
  color: #0f172a;
  border-radius: 10px;
  padding: 6px 8px;
  font-weight: 800;
  font-size: 12px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  outline: none;
}
.play-number:focus {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--block-color) 20%, transparent);
}

.block-unit {
  font-size: 9px;
  color: var(--muted);
  white-space: nowrap;
}

.play-range {
  width: 100%;
  appearance: none;
  height: 18px;
  background: transparent;
  cursor: pointer;
  margin-top: 2px;
}
.play-range::-webkit-slider-runnable-track {
  height: 6px;
  background: #e2e8f0;
  border-radius: 999px;
}
.play-range::-webkit-slider-thumb {
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--block-color);
  margin-top: -6px;
  border: 3px solid #ffffff;
  box-shadow: 0 2px 8px rgba(15,23,42,0.18);
}
.play-range::-moz-range-track {
  height: 6px;
  background: #e2e8f0;
  border-radius: 999px;
}
.play-range::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--block-color);
  border: 3px solid #ffffff;
  box-shadow: 0 2px 8px rgba(15,23,42,0.18);
}

.calculated-value {
  margin-top: 14px;
  padding: 12px;
  border-radius: 14px;
  background: #ffffff;
  border: 1px solid color-mix(in srgb, var(--block-color) 20%, #e2e8f0);
  color: var(--block-color);
  font-size: 18px;
  font-weight: 900;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.calculated-value span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  margin-top: 4px;
}

.operator-badge {
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  align-self: center;
  display: grid;
  place-items: center;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  color: #64748b;
  font-size: 16px;
  font-weight: 900;
  box-shadow: 0 4px 12px rgba(15,23,42,0.04);
}

/* Block Explainer Detail Drawer */
.block-explainer {
  max-width: 900px;
  margin: 18px auto 0;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 20px;
  padding: 20px 24px;
  box-shadow: var(--shadow-lg);
  position: relative;
}
.block-explainer.hidden { display: none; }

.explainer-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.explainer-badge {
  font-size: 10px;
  letter-spacing: 0.14em;
  font-weight: 900;
  color: var(--indigo);
  background: #eef2ff;
  padding: 4px 10px;
  border-radius: 999px;
}

.close-explainer-btn {
  background: transparent;
  border: none;
  font-size: 18px;
  color: var(--muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
}
.close-explainer-btn:hover {
  background: #f1f5f9;
  color: var(--text);
}

.explainer-title-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 10px;
}
.explainer-icon { font-size: 28px; }
.explainer-title-row h4 {
  margin: 0;
  font-size: 20px;
  color: var(--text);
}
.explainer-symbol {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  color: var(--indigo);
  font-weight: 700;
}
.explainer-desc {
  color: #334155;
  font-size: 15px;
  line-height: 1.6;
  margin: 0 0 12px;
}
.explainer-val {
  background: #f8fafc;
  border: 1px solid var(--line);
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 10px;
  display: inline-block;
}
.explainer-val b { color: var(--indigo); font-weight: 800; }
.explainer-tip {
  font-size: 12px;
  color: var(--muted);
}

.playground-precision-note {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  margin: 24px auto 0;
  max-width: 800px;
  line-height: 1.6;
}
.playground-precision-note span {
  color: var(--text);
  font-weight: 800;
}

/* Secondary Tabs & Panels */
.lab-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 32px 0 20px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.lab-tab {
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--text-soft);
  border-radius: 12px;
  padding: 10px 16px;
  cursor: pointer;
  font-weight: 700;
  font-size: 13px;
  transition: all 0.2s ease;
}
.lab-tab:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}
.lab-tab.active {
  background: var(--indigo);
  color: #ffffff;
  border-color: var(--indigo);
  box-shadow: 0 4px 12px rgba(99,102,241,0.2);
}

.lab-mode { display: none; }
.lab-mode.active { display: block; }

.panel {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}

.panel-label {
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--indigo);
  font-weight: 900;
  margin-bottom: 14px;
}

/* Precision Lab Layout */
.precision-lab, .precision-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.equation-display {
  font-size: 26px;
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: #0f172a;
  margin-bottom: 16px;
}

.eli5 {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-soft);
  margin: 0 0 16px;
}

.symbol-list {
  border-top: 1px solid var(--line);
  padding-top: 16px;
  display: grid;
  gap: 8px;
}

.symbol-row {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 12px;
  font-size: 13px;
}
.symbol-row b { color: #0f172a; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.symbol-row span { color: var(--muted); }

.concept-callout {
  margin-top: 20px;
  border: 1px solid #e0e7ff;
  background: #f5f7ff;
  border-radius: 14px;
  padding: 16px;
}
.concept-callout span {
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--indigo);
  font-weight: 900;
}
.concept-callout p {
  margin: 6px 0 0;
  color: #334155;
  line-height: 1.6;
  font-size: 13px;
}

.control-list {
  display: grid;
  gap: 16px;
  margin-top: 14px;
}

.control {
  display: grid;
  grid-template-columns: 1fr 90px;
  gap: 10px;
  align-items: center;
}
.control label {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  color: #334155;
  font-size: 13px;
  font-weight: 600;
}
.control label small { color: var(--muted); }
.control input[type=range] {
  grid-column: 1;
  accent-color: var(--indigo);
  width: 100%;
}
.control input[type=number] {
  grid-column: 2;
  grid-row: 1/3;
  background: #f8fafc;
  border: 1px solid var(--line);
  color: #0f172a;
  border-radius: 10px;
  padding: 8px;
  width: 100%;
  font-weight: 700;
  outline: none;
}
.control input[type=number]:focus {
  border-color: var(--indigo);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}

.validation-line {
  margin: 16px 0 12px;
  font-size: 12px;
  border-radius: 10px;
  padding: 9px 12px;
  border: 1px solid var(--line);
}
.validation-line.good { color: var(--emerald); background: #ecfdf5; border-color: #a7f3d0; }
.validation-line.warn { color: var(--amber); background: #fffbeb; border-color: #fde68a; }
.validation-line.bad { color: var(--coral); background: #fff1f2; border-color: #fecdd3; }

.output-card {
  margin: 16px 0 18px;
  padding: 18px;
  border-radius: 16px;
  background: #f8fafc;
  border: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: baseline;
  gap: 10px;
}
.output-card span { color: var(--muted); font-size: 12px; font-weight: 600; }
.output-card strong { font-size: 26px; color: var(--indigo); font-weight: 900; }
.output-card small { color: var(--muted); font-size: 12px; }

.sensitivity-wrap {
  border-top: 1px solid var(--line);
  padding-top: 16px;
  margin-bottom: 16px;
}

.mini-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.08em;
  font-weight: 700;
}
.mini-head select {
  background: #f8fafc;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 5px 8px;
}

.sensitivity-wrap svg {
  width: 100%;
  height: 180px;
  margin-top: 6px;
}
.plot-axis { stroke: #cbd5e1; stroke-width: 1; }
.plot-line { fill: none; stroke: var(--indigo); stroke-width: 3; }
.plot-fill { fill: url(#plotGradient); opacity: 0.15; }
.plot-dot { fill: var(--indigo); stroke: #ffffff; stroke-width: 2; }

.lab-bottom, .lab-bottom-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.why-card p, .example-card p {
  color: #334155;
  line-height: 1.65;
  margin: 0;
  font-size: 14px;
}

/* Derivation & Notes Content Panels */
.content-panel {
  padding: 28px;
  min-height: 280px;
}

.step-list {
  display: grid;
  gap: 16px;
  margin: 20px 0;
  padding-left: 24px;
}
.step-list li {
  padding-left: 6px;
  color: #334155;
  line-height: 1.7;
  font-size: 15px;
}
.step-list li::marker {
  color: var(--indigo);
  font-weight: 900;
}

.derive-check {
  border-top: 1px solid var(--line);
  padding-top: 18px;
  margin-top: 20px;
}
.derive-check label {
  display: flex;
  gap: 10px;
  align-items: center;
  color: #1e293b;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}
.derive-check input {
  accent-color: var(--emerald);
  width: 18px;
  height: 18px;
}

.big-note {
  font-size: 17px;
  line-height: 1.8;
  color: #1e293b;
  max-width: 850px;
  margin: 0 0 20px;
}

.unit-mini-challenge {
  margin-top: 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
  background: #f8fafc;
  display: grid;
  grid-template-columns: 1fr minmax(140px, 200px) auto;
  gap: 12px;
  align-items: center;
}
.unit-mini-challenge p { margin: 0; color: #334155; font-size: 14px; }
.unit-mini-challenge input {
  background: #ffffff;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 12px;
  outline: none;
}
.unit-mini-challenge .feedback {
  grid-column: 1 / -1;
  font-size: 13px;
  font-weight: 700;
}
.feedback.good { color: var(--emerald); }
.feedback.bad { color: var(--coral); }

.assumption-list {
  margin: 18px 0;
  display: grid;
  gap: 10px;
  color: #334155;
  line-height: 1.65;
  font-size: 14px;
}

.scope-warning {
  border-left: 4px solid var(--amber);
  padding: 14px 18px;
  background: #fffbeb;
  color: #92400e;
  border-radius: 0 12px 12px 0;
  font-size: 13px;
  line-height: 1.6;
}

.notebook-panel p {
  color: var(--muted);
  line-height: 1.6;
  margin: 0 0 14px;
  font-size: 14px;
}
.notebook-panel textarea {
  width: 100%;
  box-sizing: border-box;
  background: #f8fafc;
  color: #0f172a;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  font: 500 14px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace;
  resize: vertical;
  outline: none;
}
.notebook-panel textarea:focus {
  border-color: var(--indigo);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
  background: #ffffff;
}
.notebook-actions {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-top: 14px;
}
.notebook-actions span {
  color: var(--emerald);
  font-size: 12px;
  font-weight: 700;
}

/* Footer */
.footer {
  border-top: 1px solid var(--line);
  padding: 30px 0 50px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  flex-wrap: wrap;
  gap: 16px;
}
.footer strong { display: block; color: var(--text); font-size: 13px; }
.footer span { display: block; font-size: 12px; margin-top: 4px; }
.footer-links { display: flex; gap: 10px; align-items: center; }
.file-btn { position: relative; cursor: pointer; }
.file-btn input { display: none; }

/* SVG Stage Styling & Animations */
.stage-label { fill: #64748b; font-size: 12px; font-weight: 650; }
.stage-value { fill: #312e81; font-size: 15px; font-weight: 900; }
.grid-ray, .gravity-ring, .target-ring { stroke: #cbd5e1; stroke-width: 1.5; fill: none; stroke-dasharray: 5 6; }
.galaxy-dot { fill: #6366f1; }
.home-dot { fill: #0ea5e9; stroke: white; stroke-width: 5; }
.tug-arrow, .flow-arrow, .predict-arrow, .gravity-arrow, .speed-arrow, .sail-arrow, .thermal-arrow, .magnetic-arrow, .reddening-arrow {
  stroke: #f43f5e; stroke-width: 5; stroke-linecap: round; marker-end: url(#stageArrow);
}
.ruler, .tick, .state-track { stroke: #cbd5e1; stroke-width: 3; stroke-linecap: round; }
.standard-star { fill: #f59e0b; filter: drop-shadow(0 0 18px rgba(245,158,11,0.28)); }
.seen-star { fill: #0ea5e9; filter: drop-shadow(0 0 18px rgba(14,165,233,0.22)); }
.density-local { fill: rgba(244,63,94,0.15); stroke: #f43f5e; stroke-width: 3; }
.density-mean { fill: rgba(245,158,11,0.12); stroke: #f59e0b; stroke-width: 3; }
.flow-core { stroke-width: 4; }
.flow-core.dense { fill: rgba(99,102,241,0.16); stroke: #6366f1; }
.flow-core.void { fill: rgba(14,165,233,0.06); stroke: #0ea5e9; stroke-dasharray: 7 7; }
.scale-bar { fill: #475569; }
.belief-prior { fill: #6366f1; opacity: 0.76; }
.belief-post { fill: #10b981; opacity: 0.78; }
.scale-stand { fill: #cbd5e1; }
.predict-dot { fill: #6366f1; }
.observe-dot { fill: #f43f5e; }
.updated-dot { fill: #10b981; stroke: #ffffff; stroke-width: 5; }
.sigma-ring { fill: rgba(14,165,233,0.08); stroke: #0ea5e9; stroke-width: 2; stroke-dasharray: 6 5; }
.noise-dot { fill: #f43f5e; }
.sieve { fill: #ffffff; stroke: #cbd5e1; stroke-width: 3; }
.source-glow { fill: #f59e0b; filter: drop-shadow(0 0 25px rgba(245,158,11,0.3)); }
.dust-curtain { fill: #64748b; }
.photon-beam, .photon-line { stroke: #f59e0b; stroke-width: 7; stroke-linecap: round; }
.detector { fill: #0f172a; }
.blue-band { fill: #38bdf8; }
.visual-band { fill: #fbbf24; }
.prism { fill: rgba(99,102,241,0.1); stroke: #6366f1; stroke-width: 3; }
.radio-galaxy { fill: rgba(16,185,129,0.12); stroke: #10b981; stroke-width: 3; }
.radio-wave { fill: none; stroke: #0ea5e9; stroke-width: 4; stroke-linecap: round; }
.dish { fill: none; stroke: #475569; stroke-width: 8; stroke-linecap: round; }
.dish-arm { stroke: #475569; stroke-width: 5; }
.hi-disk { fill: rgba(14,165,233,0.14); stroke: #0ea5e9; stroke-width: 3; }
.stellar-disk { fill: rgba(245,158,11,0.33); stroke: #f59e0b; stroke-width: 2; }
.distance-beam { stroke: #cbd5e1; stroke-width: 2; stroke-dasharray: 8 7; }
.state-current { fill: #6366f1; }
.state-next { fill: #10b981; }
.sensor-ping { fill: none; stroke: #0ea5e9; stroke-width: 4; }
.sun { fill: #f59e0b; filter: drop-shadow(0 0 20px rgba(245,158,11,0.22)); }
.probe { fill: #0f172a; stroke: #ffffff; stroke-width: 4; }
.orbit-line, .bound-path { fill: none; stroke: #94a3b8; stroke-width: 3; }
.escape-path { fill: none; stroke: #10b981; stroke-width: 4; stroke-dasharray: 10 7; }
.rocket-body { fill: #ffffff; stroke: #475569; stroke-width: 3; }
.rocket-window { fill: #0ea5e9; }
.rocket-flame { fill: none; stroke: #f43f5e; stroke-width: 12; stroke-linecap: round; }
.fuel-tank { fill: #fef3c7; stroke: #f59e0b; stroke-width: 2; }
.sail { fill: rgba(14,165,233,0.12); stroke: #0ea5e9; stroke-width: 4; }
.earth { fill: #0ea5e9; stroke: #10b981; stroke-width: 6; }
.radio-ping { stroke: #6366f1; stroke-width: 4; stroke-dasharray: 12 9; }
.electron-dot { fill: #0ea5e9; }
.charge-dot { fill: #f43f5e; }
.debye-shell { fill: rgba(16,185,129,0.06); stroke: #10b981; stroke-width: 3; stroke-dasharray: 8 7; }
.field-line { fill: none; stroke: #6366f1; stroke-width: 3; }
.wave-packet { fill: #0ea5e9; }
.balance-divider { stroke: #cbd5e1; stroke-width: 4; }
.thermal-arrow { stroke: #f43f5e; }
.magnetic-arrow { stroke: #6366f1; }

@keyframes stagePulse {
  0%, 100% { transform: scale(1); opacity: 0.9; }
  50% { transform: scale(1.06); opacity: 1; }
}

@keyframes stageDrift {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(var(--drift, 7px)); }
}

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

.stage-pulse {
  transform-box: fill-box;
  transform-origin: center;
  animation: stagePulse 2.2s ease-in-out infinite;
}

.stage-drift {
  animation: stageDrift 3.2s ease-in-out infinite;
}

.stage-wave {
  animation: stageWave 1.45s ease-in-out infinite;
}

/* Reduced motion accessibility */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .stage-pulse, .stage-drift, .stage-wave, * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* Responsive adjustments */
@media (max-width: 900px) {
  .topbar { flex-direction: column; align-items: stretch; gap: 12px; }
  .top-nav-controls { justify-content: center; }
  .topbar-select { max-width: 100%; flex: 1; }
  .precision-lab, .lab-bottom { grid-template-columns: 1fr; }
  .playground-blocks-row { gap: 10px; }
  .playground-block { flex-basis: 150px; min-width: 140px; }
}

@media (max-width: 600px) {
  .top-nav-controls { display: grid; grid-template-columns: 1fr 1fr; }
  .select-wrap { grid-column: 1 / -1; }
  .playground-blocks-row { display: grid; grid-template-columns: 1fr; }
  .playground-block { max-width: none; min-width: 0; }
  .operator-badge { margin: 0 auto; transform: rotate(90deg); }
  .unit-mini-challenge { grid-template-columns: 1fr; }
  .lab-tabs { overflow-x: auto; flex-wrap: nowrap; }
}

/* ==========================================================================
   PIXEL-EXACT STYLES: REFERENCES 1 & 2
   ========================================================================== */

/* Topbar Brand & Actions */
.brand-cube-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 4px 6px rgba(37,99,235,0.18));
}
.brand-copy strong {
  font-size: 17px;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: #0f172a;
}
.brand-copy small {
  font-size: 11px;
  color: #64748b;
  font-weight: 600;
  letter-spacing: 0.05em;
}
.nav-signin-btn {
  border-radius: 999px;
  border-color: #cbd5e1;
  background: #ffffff;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 700;
  color: #1e293b;
}
.nav-signin-btn:hover {
  background: #f8fafc;
  border-color: #94a3b8;
}
.nav-cta {
  border-radius: 999px;
  background: #2563eb;
  color: #ffffff;
  padding: 9px 20px;
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 4px 14px rgba(37,99,235,0.3);
}
.nav-cta:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
}
.hero-blue-accent, .lib-blue-accent {
  color: #2563eb;
}

/* ==========================================================================
   VIEW 3: FORMULA LIBRARY LAYOUT (Reference 2: media_1790550855876.jpg)
   ========================================================================== */
.library-split-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 32px;
  align-items: start;
  padding: 24px 0 60px;
}

/* Left Sidebar */
.library-sidebar {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 16px;
  box-shadow: 0 2px 10px rgba(15,23,42,0.02);
  position: sticky;
  top: 90px;
}
.sidebar-cat-list {
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sidebar-cat-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  border-radius: 12px;
  color: #334155;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
}
.sidebar-cat-item:hover {
  background: #f1f5f9;
  color: #0f172a;
}
.sidebar-cat-item.active {
  background: #eff6ff;
  color: #2563eb;
  font-weight: 800;
}
.sidebar-cat-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-cat-icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
}
.cat-count-badge {
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
  background: #f8fafc;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid #e2e8f0;
}
.sidebar-cat-item.active .cat-count-badge {
  background: #dbeafe;
  color: #1d4ed8;
  border-color: #bfdbfe;
}

.sidebar-paths-block {
  border-top: 1px solid var(--line);
  padding-top: 18px;
}
.sidebar-paths-title {
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #0f172a;
  margin: 0 0 12px 10px;
}
.sidebar-paths-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sidebar-path-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  width: 100%;
  text-align: left;
}
.sidebar-path-item:hover {
  background: #f8fafc;
  border-color: #e2e8f0;
}
.sidebar-path-item.active {
  background: #eff6ff;
  border-color: #bfdbfe;
}
.path-icon {
  font-size: 20px;
  flex-shrink: 0;
}
.path-info strong {
  display: block;
  font-size: 13px;
  font-weight: 800;
  color: #0f172a;
}
.path-info small {
  display: block;
  font-size: 11px;
  color: #64748b;
  margin-top: 1px;
}

/* Main Library Hero Banner */
.library-main-panel {
  display: flex;
  flex-direction: column;
  gap: 28px;
  min-width: 0;
}
.library-hero-banner {
  background: linear-gradient(135deg, #f0f7ff 0%, #e0effe 100%);
  border: 1px solid #bfdbfe;
  border-radius: 28px;
  padding: 34px 38px;
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 24px;
  align-items: center;
  position: relative;
  overflow: hidden;
}
.lib-breadcrumb {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  color: #2563eb;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  padding: 5px 14px;
  border-radius: 999px;
  border: 1px solid #bfdbfe;
  margin-bottom: 14px;
}
.lib-hero-title {
  font-size: clamp(28px, 3.2vw, 38px);
  font-weight: 900;
  line-height: 1.15;
  color: #0f172a;
  letter-spacing: -0.03em;
  margin: 0 0 10px;
}
.lib-hero-desc {
  font-size: 14px;
  color: #475569;
  line-height: 1.6;
  margin: 0 0 20px;
  max-width: 520px;
}
.lib-search-box {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  padding: 5px 6px 5px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 500px;
  box-shadow: 0 4px 14px rgba(15,23,42,0.04);
  margin-bottom: 18px;
}
.search-lens-icon {
  font-size: 16px;
  color: #94a3b8;
}
.lib-search-box input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 14px;
  color: #0f172a;
  flex: 1;
}
.lib-search-btn {
  border-radius: 999px;
  padding: 9px 22px;
  font-size: 13px;
  background: #2563eb;
}

/* Category Filter Pills (Reference 2) */
.category-filters-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.filter-chip {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 700;
  color: #334155;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.filter-chip:hover {
  background: #f8fafc;
  border-color: #94a3b8;
}
.filter-chip.active {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
  box-shadow: 0 2px 8px rgba(37,99,235,0.25);
}

/* Hero Mascot Graphic */
.lib-hero-graphic {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.hero-mascot-svg-wrap {
  width: 100%;
  max-width: 250px;
  filter: drop-shadow(0 10px 20px rgba(15,23,42,0.1));
}

/* Section Header */
.library-section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
}
.library-section-title {
  font-size: 24px;
  font-weight: 900;
  color: #0f172a;
  letter-spacing: -0.02em;
  margin: 0 0 4px;
}
.library-section-desc {
  font-size: 13px;
  color: #64748b;
  margin: 0;
}
.library-sort-control {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #64748b;
  font-weight: 600;
}
.library-sort-select {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 6px 28px 6px 12px;
  font-size: 13px;
  font-weight: 700;
  color: #1e293b;
  cursor: pointer;
  outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 12px;
}

/* 3-Column Formula Grid (Reference 2) */
.library-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 20px;
}
.library-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 10px rgba(15,23,42,0.02);
  cursor: pointer;
}
.library-card:hover {
  transform: translateY(-4px);
  border-color: #cbd5e1;
  box-shadow: 0 14px 28px -6px rgba(15,23,42,0.08);
}
.lib-card-top {
  display: grid;
  grid-template-columns: 85px 1fr 28px;
  gap: 14px;
  align-items: start;
  margin-bottom: 14px;
}
.lib-card-graphic {
  width: 85px;
  height: 85px;
  border-radius: 16px;
  background: #f8fafc;
  border: 1px solid #f1f5f9;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.lib-card-meta {
  min-width: 0;
}
.lib-card-title {
  font-size: 15px;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 4px;
  line-height: 1.3;
}
.lib-card-question {
  font-size: 12px;
  color: #64748b;
  line-height: 1.45;
  margin: 0;
}
.lib-card-open-arrow {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  display: grid;
  place-items: center;
  color: #64748b;
  font-size: 13px;
  font-weight: 900;
  transition: all 0.15s ease;
}
.library-card:hover .lib-card-open-arrow {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
}
.lib-formula-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 10px;
  margin-bottom: 14px;
  text-align: center;
  font-size: 15px;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-x: auto;
}
.lib-card-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.lib-path-badge {
  font-size: 11px;
  font-weight: 800;
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
  padding: 3px 10px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.lib-cat-badge {
  font-size: 11px;
  font-weight: 700;
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
  padding: 3px 10px;
  border-radius: 999px;
}
.lib-card-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  border-top: 1px solid #f1f5f9;
  padding-top: 12px;
  margin-top: auto;
}
.lib-bookmark-btn {
  background: transparent;
  border: none;
  font-size: 16px;
  color: #cbd5e1;
  cursor: pointer;
  padding: 2px;
  transition: color 0.15s ease;
}
.lib-bookmark-btn.bookmarked, .lib-bookmark-btn:hover {
  color: #f59e0b;
}
.lib-level-label {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
}
.lib-progress-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
}
.lib-progress-track {
  flex: 1;
  height: 6px;
  background: #f1f5f9;
  border-radius: 999px;
  overflow: hidden;
}
.lib-progress-fill {
  height: 100%;
  background: #3b82f6;
  border-radius: 999px;
}
.lib-progress-text {
  font-size: 11px;
  font-weight: 800;
  color: #64748b;
  width: 28px;
  text-align: right;
}

/* History Trays (Reference 2) */
.library-history-trays {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 14px;
}
.history-tray-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 20px 24px;
  box-shadow: 0 2px 10px rgba(15,23,42,0.02);
}
.tray-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.tray-title-box {
  display: flex;
  align-items: center;
  gap: 12px;
}
.tray-icon {
  font-size: 20px;
  color: #3b82f6;
}
.tray-icon.icon-rose {
  color: #f43f5e;
}
.tray-title {
  font-size: 16px;
  font-weight: 800;
  color: #0f172a;
  margin: 0;
}
.tray-desc {
  font-size: 12px;
  color: #64748b;
  margin: 2px 0 0;
}
.tray-action-link {
  background: transparent;
  border: none;
  font-size: 12px;
  font-weight: 800;
  color: #2563eb;
  cursor: pointer;
}
.tray-action-link:hover {
  text-decoration: underline;
}
.tray-cards-row {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 6px;
}
.mini-tray-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 8px 14px 8px 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}
.mini-tray-card:hover {
  background: #ffffff;
  border-color: #2563eb;
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(15,23,42,0.06);
}
.mini-card-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid #f1f5f9;
  display: grid;
  place-items: center;
}
.mini-card-text strong {
  display: block;
  font-size: 12px;
  font-weight: 800;
  color: #0f172a;
}
.mini-card-text small {
  display: block;
  font-size: 11px;
  color: #64748b;
  font-family: monospace;
}
.mini-card-arrow {
  color: #94a3b8;
  font-weight: 900;
  font-size: 12px;
}

/* ==========================================================================
   VIEW 5: LIVE LABS LAYOUT (Reference 1: media_1790550902705.jpg)
   ========================================================================== */
.live-lab-stage-hero-row {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 32px;
  align-items: stretch;
  margin: 20px 0 32px;
}
.live-lab-hero-col {
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.live-lab-pill {
  background: #eef2ff !important;
  color: #4338ca !important;
  border: 1px solid #c7d2fe !important;
  font-weight: 800;
}
.lab-main-title {
  margin: 10px 0 12px;
}
.concept-headline {
  display: block;
  font-size: clamp(30px, 3.8vw, 44px);
  font-weight: 900;
  color: #0f172a;
  letter-spacing: -0.03em;
  line-height: 1.12;
}
.formal-headline {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: #64748b;
  margin-top: 6px;
}
.lab-question-lead {
  font-size: 15px;
  color: #475569;
  line-height: 1.6;
  margin: 0 0 22px;
  max-width: 500px;
}
.lab-hero-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.lab-open-cta {
  border-radius: 999px;
  background: #2563eb;
  color: #ffffff;
  padding: 12px 26px;
  font-size: 14px;
  font-weight: 800;
  box-shadow: 0 6px 18px rgba(37,99,235,0.3);
}
.lab-open-cta:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
}
.lab-tour-btn {
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #1e293b;
  padding: 11px 22px;
  font-size: 14px;
  font-weight: 700;
}
.lab-tour-btn:hover {
  background: #f8fafc;
  border-color: #94a3b8;
}
.lab-feature-checks {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.feat-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #475569;
}
.feat-icon {
  font-size: 13px;
}
.check-green { color: #10b981; }
.icon-purple { color: #8b5cf6; }
.icon-red { color: #ef4444; }
.icon-gold { color: #f59e0b; }

/* Visual Stage Card (Deep Space Dark Theme) */
.live-lab-stage-col {
  min-width: 0;
}
/* Visual Stage Card (Deep Space Dark Theme - Zero Overlays) */
.live-lab-stage-col {
  min-width: 0;
}
.visual-stage-card.dark-cosmic-theme {
  background: #080f24 !important;
  border: 1px solid #1e293b !important;
  border-radius: 24px !important;
  position: relative !important;
  overflow: hidden !important;
  box-shadow: 0 18px 40px -10px rgba(2,6,23,0.45) !important;
  padding: 0 !important;
  display: flex !important;
  flex-direction: column !important;
}
.dark-cosmic-theme .stage-bg {
  fill: #080f24;
  stroke: none;
}

/* Dedicated Stage Top Toolbar: Formula Legend & Vectors (No overlay on canvas!) */
.stage-legend-card, #stageLegendCard {
  position: static !important;
  top: auto !important;
  right: auto !important;
  left: auto !important;
  bottom: auto !important;
  background: rgba(11, 19, 43, 0.98) !important;
  border: none !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 24px 24px 0 0 !important;
  padding: 12px 18px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  flex-wrap: wrap !important;
  gap: 14px !important;
  font-size: 11px !important;
  color: #f1f5f9 !important;
  z-index: 2 !important;
  box-shadow: none !important;
  min-width: 0 !important;
  width: 100% !important;
  margin: 0 !important;
}
.legend-formulas-wrap {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
.legend-formula-item {
  margin-bottom: 0;
}
.legend-formula-label {
  display: block;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
}
.legend-formula-eq {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #ffffff;
  margin-top: 1px;
}
.legend-divider-vertical {
  width: 1px;
  height: 24px;
  background: rgba(255, 255, 255, 0.15);
}
.legend-vectors-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.legend-vector-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #cbd5e1;
  margin-bottom: 0;
}
.vector-arrow-blue { color: #38bdf8; font-weight: 900; }
.vector-arrow-red { color: #f43f5e; font-weight: 900; }

/* 100% Unobstructed Visual Canvas Viewport */
.dark-cosmic-theme .visual-stage, #playgroundStage {
  min-height: 340px !important;
  position: relative !important;
  background: #080f24 !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}
.dark-cosmic-theme .visual-stage .stage-svg,
#playgroundStage .stage-svg {
  width: 100% !important;
  height: auto !important;
  max-height: 100% !important;
  display: block !important;
}
@media (max-width: 640px) {
  .stage-legend-card, #stageLegendCard {
    padding: 10px 14px !important;
    gap: 8px !important;
  }
  .legend-divider-vertical {
    display: none !important;
  }
  .stage-playback-bar, #stagePlaybackBar {
    padding: 8px 12px !important;
    gap: 8px !important;
  }
  .dark-cosmic-theme .visual-stage, #playgroundStage {
    min-height: 220px !important;
  }
}

/* Dedicated Stage Bottom Playback Bar (No overlay on canvas or caption!) */
.stage-playback-bar, #stagePlaybackBar {
  position: static !important;
  top: auto !important;
  right: auto !important;
  left: auto !important;
  bottom: auto !important;
  background: rgba(11, 19, 43, 0.98) !important;
  border: none !important;
  border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 0 !important;
  padding: 10px 18px !important;
  display: flex !important;
  align-items: center !important;
  gap: 14px !important;
  z-index: 2 !important;
  box-shadow: none !important;
  margin: 0 !important;
  width: 100% !important;
}
.playback-btn {
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 14px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  display: grid;
  place-items: center;
}
.playback-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}
.playback-scrubber-track {
  flex: 1;
  display: flex;
  align-items: center;
}
.playback-scrubber-track input[type="range"] {
  width: 100%;
  accent-color: #38bdf8;
  height: 5px;
  cursor: pointer;
}
.playback-time-text {
  font-size: 11px;
  font-weight: 700;
  color: #cbd5e1;
  white-space: nowrap;
}
.fullscreen-btn {
  font-size: 15px;
}

/* Stage Caption: Cleanly below playback controls, never truncated or overlapped */
.stage-caption {
  margin: 0;
  padding: 10px 18px 14px;
  background: #080f24;
  color: #94a3b8;
  font-size: 12px;
  text-align: center;
  line-height: 1.5;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* ==========================================================================
   TACTILE EQUATION BLOCKS (Reference 1: Build the equation, see it in action)
   ========================================================================== */
.blocks-header {
  margin-bottom: 22px;
}
.blocks-title {
  font-size: 22px;
  font-weight: 900;
  color: #0f172a;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
}
.blocks-subtitle {
  font-size: 14px;
  color: #64748b;
  margin: 0;
}
.playground-blocks-row {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}
.tactile-equation-card {
  flex: 1 1 300px;
  max-width: 360px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 22px;
  box-shadow: 0 4px 16px rgba(15,23,42,0.03);
  display: flex;
  flex-direction: column;
}
.tactile-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}
.tactile-icon-title {
  display: flex;
  align-items: center;
  gap: 10px;
}
.tactile-icon {
  font-size: 24px;
}
.tactile-icon-title strong {
  font-size: 18px;
  font-weight: 800;
  color: #0f172a;
}
.tactile-pill-tag {
  font-size: 11px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 999px;
}
.tag-blue { background: #eff6ff; color: #2563eb; border: 1px solid #bfdbfe; }
.tag-coral { background: #fff1f2; color: #e11d48; border: 1px solid #fecdd3; }
.tag-mint { background: #ecfdf5; color: #059669; border: 1px solid #a7f3d0; }

.tactile-card-lead {
  font-size: 12px;
  color: #64748b;
  line-height: 1.5;
  margin: 0 0 14px;
}
.tactile-math-box {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 10px;
  margin-bottom: 16px;
  text-align: center;
  font-size: 16px;
  font-weight: 800;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(15,23,42,0.02);
}
.tactile-slider-row {
  margin-bottom: 12px;
}
.tactile-slider-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
  color: #334155;
  margin-bottom: 6px;
}
.tactile-num-badge {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 2px 10px;
  font-size: 13px;
  font-weight: 800;
  color: #0f172a;
  min-width: 50px;
  text-align: center;
}
.tactile-range-input {
  width: 100%;
  height: 6px;
  accent-color: #2563eb;
  cursor: pointer;
}
.tactile-range-input.coral-range {
  accent-color: #f43f5e;
}

/* Calculated Results Boxes (Matching Reference 1 colors) */
.tactile-result-box {
  border-radius: 14px;
  padding: 12px 16px;
  text-align: center;
  margin-top: auto;
}
.result-box-blue {
  background: #e0f2fe;
  color: #0369a1;
}
.result-box-blue strong {
  font-size: 17px;
  font-weight: 900;
}
.result-box-coral {
  background: #fee2e2;
  color: #b91c1c;
}
.result-box-coral strong {
  font-size: 17px;
  font-weight: 900;
  display: block;
}
.result-box-coral small {
  display: block;
  font-size: 11px;
  color: #991b1b;
  margin-top: 2px;
}
.result-box-mint {
  background: #dcfce7;
  color: #15803d;
}
.result-box-mint strong {
  font-size: 20px;
  font-weight: 900;
}

/* Dynamic Insight Callout Chip */
.dynamic-insight-chip {
  background: #fff1f2;
  border: 1px solid #fecdd3;
  border-radius: 12px;
  padding: 10px 14px;
  margin-top: 10px;
  font-size: 12px;
  color: #9f1239;
  line-height: 1.45;
}
.dynamic-insight-chip strong {
  display: block;
  font-weight: 800;
  margin-bottom: 2px;
}

/* Circular Operator Badges between cards */
.tactile-operator-badge {
  align-self: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #2563eb;
  display: grid;
  place-items: center;
  font-size: 22px;
  font-weight: 900;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(37,99,235,0.12);
}

/* ==========================================================================
   BOTTOM ROW: THE BIG PICTURE (ELI5) & WORKED EXAMPLE (Reference 1)
   ========================================================================== */
.lab-bottom-cards-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin: 32px 0;
}
.eli5-mascot-card, .worked-example-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 4px 16px rgba(15,23,42,0.03);
}
.eli5-card-header, .worked-example-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.card-doc-icon {
  font-size: 20px;
  color: #2563eb;
}
.eli5-card-title, .worked-example-title {
  font-size: 18px;
  font-weight: 800;
  color: #0f172a;
  margin: 0;
}
.eli5-card-body {
  display: grid;
  grid-template-columns: 1fr 180px;
  gap: 18px;
  align-items: center;
}
.story-lead {
  font-size: 14px;
  line-height: 1.65;
  color: #334155;
  margin: 0;
}
.eli5-mascot-bubble-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.eli5-speech-bubble {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 14px;
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 700;
  color: #1e40af;
  position: relative;
  margin-bottom: 8px;
  text-align: center;
  line-height: 1.4;
}
.bubble-bulb {
  font-size: 14px;
  display: block;
  margin-bottom: 2px;
}
.eli5-mascot-robot {
  width: 90px;
  height: 95px;
}

/* Worked Example Card */
.worked-example-lead {
  font-size: 13px;
  color: #475569;
  margin: 0 0 14px;
}
.worked-example-steps {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.step-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}
.step-name {
  color: #2563eb;
  font-weight: 700;
}
.step-calc {
  font-family: monospace;
  font-weight: 700;
  color: #0f172a;
}
.worked-example-result-pill {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: 999px;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #065f46;
  font-weight: 700;
}
.check-pill-badge {
  background: #10b981;
  color: #ffffff;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 900;
  flex-shrink: 0;
}

/* Keep Exploring Tray (Reference 1) */
.keep-exploring-tray {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 22px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  margin: 20px 0 36px;
  box-shadow: 0 4px 16px rgba(15,23,42,0.03);
}
.keep-exploring-header {
  display: flex;
  align-items: center;
  gap: 14px;
}
.explore-rocket-icon {
  font-size: 28px;
}
.keep-exploring-header h3 {
  font-size: 18px;
  font-weight: 900;
  color: #0f172a;
  margin: 0;
}
.keep-exploring-header p {
  font-size: 13px;
  color: #64748b;
  margin: 2px 0 0;
}
.keep-exploring-cards {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}
.explore-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 10px 16px 10px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.explore-card:hover {
  background: #ffffff;
  border-color: #2563eb;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(15,23,42,0.06);
}
.explore-card-icon {
  font-size: 22px;
}
.explore-card-info strong {
  display: block;
  font-size: 13px;
  font-weight: 800;
  color: #0f172a;
}
.explore-card-info small {
  display: block;
  font-size: 11px;
  color: #64748b;
}
.explore-card-arrow {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 900;
  color: #64748b;
}
.explore-card:hover .explore-card-arrow {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
}

/* 1-Minute Tour Modal */
.tour-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(6px);
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 20px;
}
.tour-modal-content {
  background: #ffffff;
  border-radius: 28px;
  max-width: 580px;
  width: 100%;
  padding: 32px;
  box-shadow: 0 25px 50px -12px rgba(15,23,42,0.25);
}
.tour-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.tour-badge {
  background: #eff6ff;
  color: #2563eb;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid #bfdbfe;
}
.tour-close-btn {
  background: transparent;
  border: none;
  font-size: 16px;
  color: #94a3b8;
  cursor: pointer;
}
.tour-title {
  font-size: 22px;
  font-weight: 900;
  color: #0f172a;
  letter-spacing: -0.02em;
  margin: 0 0 20px;
}
.tour-steps-wrap {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 24px;
}
.tour-step-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 14px 18px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.tour-step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #2563eb;
  color: #ffffff;
  font-weight: 900;
  font-size: 14px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.tour-step-info strong {
  display: block;
  font-size: 14px;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 2px;
}
.tour-step-info p {
  font-size: 12px;
  color: #475569;
  line-height: 1.5;
  margin: 0;
}
.tour-modal-foot {
  display: flex;
  justify-content: flex-end;
}

/* Responsive Overrides */
@media (max-width: 1024px) {
  .library-split-layout { grid-template-columns: 1fr; }
  .library-sidebar { position: static; }
  .live-lab-stage-hero-row { grid-template-columns: 1fr; }
  .lab-bottom-cards-row { grid-template-columns: 1fr; }
  .library-hero-banner { grid-template-columns: 1fr; }
  .lib-hero-graphic { display: none; }
}

/* Quick Lab Switcher Carousel */
.lab-thumbnail-carousel {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding: 8px 4px 6px;
  margin-top: 4px;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
  -webkit-overflow-scrolling: touch;
}
.lab-thumbnail-carousel::-webkit-scrollbar {
  height: 4px;
}
.lab-thumbnail-carousel::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 999px;
}
.lab-thumb-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  font-size: 12px;
  font-weight: 700;
  color: #475569;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  flex-shrink: 0;
}
.lab-thumb-chip:hover {
  background: #ffffff;
  border-color: #2563eb;
  color: #2563eb;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(37,99,235,0.12);
}
.lab-thumb-chip.active {
  background: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(37,99,235,0.25);
}
.lab-thumb-chip .chip-num {
  font-size: 10px;
  opacity: 0.8;
  letter-spacing: 0.05em;
}
.lab-thumb-chip.active .chip-num {
  color: #ffffff;
  opacity: 0.95;
}

/* Dynamic Insight Pill on Tactile Result Block */
.block-insight-pill {
  margin-top: 10px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: 999px;
  padding: 6px 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #065f46;
  font-weight: 700;
  line-height: 1.3;
}
.block-insight-pill .check-pill-badge {
  width: 16px;
  height: 16px;
  font-size: 10px;
}

/* Stage Fullscreen Mode */
.visual-stage-card:fullscreen,
.visual-stage-card:-webkit-full-screen {
  border-radius: 0 !important;
  padding: 24px !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  align-items: center !important;
  background: #020617 !important;
}
.visual-stage-card:fullscreen .stage-legend-card,
.visual-stage-card:fullscreen #stageLegendCard,
.visual-stage-card:-webkit-full-screen .stage-legend-card,
.visual-stage-card:-webkit-full-screen #stageLegendCard {
  max-width: 1200px !important;
  width: 100% !important;
  position: static !important;
}
.visual-stage-card:fullscreen .visual-stage,
.visual-stage-card:fullscreen #playgroundStage,
.visual-stage-card:-webkit-full-screen .visual-stage,
.visual-stage-card:-webkit-full-screen #playgroundStage {
  max-width: 1200px !important;
  width: 100% !important;
  position: relative !important;
  min-height: 0 !important;
  flex: 1 !important;
}
.visual-stage-card:fullscreen .stage-playback-bar,
.visual-stage-card:fullscreen #stagePlaybackBar,
.visual-stage-card:-webkit-full-screen .stage-playback-bar,
.visual-stage-card:-webkit-full-screen #stagePlaybackBar {
  max-width: 1200px !important;
  width: 100% !important;
  position: static !important;
}
.visual-stage-card:fullscreen .stage-caption,
.visual-stage-card:fullscreen #stageCaption,
.visual-stage-card:-webkit-full-screen .stage-caption,
.visual-stage-card:-webkit-full-screen #stageCaption {
  max-width: 1200px !important;
  width: 100% !important;
  position: static !important;
}
.visual-stage.paused *, .stage-svg.paused * {
  animation-play-state: paused !important;
}

/* ==========================================================================
   CONSOLIDATED EXACT REFERENCE STYLES (Matching References 1, 2, 3, 4, 5)
   ========================================================================== */

/* Home View Layout (Reference 4) */
.home-hero-layout {
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  gap: 40px;
  align-items: center;
  padding: 30px 0 20px;
}
.home-checks-row {
  margin-top: 24px;
}
.home-3d-stage-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 28px;
  padding: 22px;
  box-shadow: 0 20px 45px -12px rgba(15,23,42,0.08);
  min-height: 420px;
  display: flex !important;
  flex-direction: column !important;
  gap: 14px;
  position: relative;
}
.home-stage-top-bar {
  display: flex !important;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  gap: 12px;
  flex-wrap: wrap;
  position: static !important;
}
.home-stage-speech-bubble {
  position: static !important;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #2563eb;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 6px;
}
.home-3d-interactive-canvas, #home3dInteractiveCanvas, #home3dCanvas {
  width: 100% !important;
  height: 250px !important;
  display: flex !important;
  justify-content: center;
  align-items: center;
  cursor: grab;
  user-select: none;
  touch-action: none;
  position: relative !important;
  background: #f8fafc;
  border-radius: 20px;
  border: 1px solid #f1f5f9;
  z-index: 1 !important;
}
.home-shape-svg {
  width: 100% !important;
  height: 100% !important;
  max-height: 250px !important;
  display: block !important;
}
#home3dCanvas {
  width: 100% !important;
  height: 100% !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  pointer-events: none !important;
}
.stage-cube-formula-card {
  position: static !important;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 8px 14px;
  box-shadow: 0 4px 14px rgba(15,23,42,0.04);
}
.cube-card-name {
  display: block;
  font-size: 11px;
  font-weight: 800;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.cube-card-eq {
  display: block;
  font-size: 15px;
  font-weight: 800;
  color: #0f172a;
}
.cube-card-sub {
  display: block;
  font-size: 10px;
  color: #94a3b8;
}
.stage-cube-speech-callout {
  position: static !important;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 14px;
  padding: 10px 14px;
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  line-height: 1.45;
  color: #92400e;
  font-weight: 600;
}
.home-stage-carousel-controls {
  position: static !important;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 4px;
}
.carousel-arrow-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  color: #475569;
  font-size: 16px;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all 0.15s ease;
}
.carousel-arrow-btn:hover {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
}
.carousel-dots {
  display: flex;
  gap: 6px;
}
.carousel-dots .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #cbd5e1;
}
.carousel-dots .dot.active {
  width: 16px;
  border-radius: 999px;
  background: #2563eb;
}

/* Popular Formulas Grid (Reference 4) */
.section-head-split {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}
.popular-formulas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}
.shape-formula-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  padding: 18px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 4px 16px rgba(15,23,42,0.03);
}
.shape-formula-card:hover {
  transform: translateY(-3px);
  border-color: #2563eb;
  box-shadow: 0 12px 28px rgba(37,99,235,0.1);
}
.shape-card-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.shape-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 22px;
}
.shape-card-title {
  font-size: 15px;
  font-weight: 800;
  color: #0f172a;
}
.shape-card-eq {
  font-size: 15px;
  font-weight: 800;
  color: #2563eb;
  margin-bottom: 4px;
}
.shape-card-desc {
  font-size: 11px;
  color: #64748b;
  line-height: 1.4;
  margin: 0;
}
.shape-card-foot {
  margin-top: 14px;
  display: flex;
  justify-content: flex-end;
}
.shape-card-arrow {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  display: grid;
  place-items: center;
  font-size: 12px;
  color: #64748b;
  transition: all 0.15s ease;
}
.shape-formula-card:hover .shape-card-arrow {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
}

/* Explore Z-Space 4 Portals (Reference 4) */
.explore-portals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}
.explore-portal-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 22px;
  padding: 22px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 4px 16px rgba(15,23,42,0.03);
}
.explore-portal-card:hover {
  transform: translateY(-3px);
  border-color: #2563eb;
  box-shadow: 0 14px 30px rgba(37,99,235,0.09);
}
.portal-icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 24px;
  margin-bottom: 14px;
}
.icon-blue { background: #eff6ff; color: #2563eb; }
.icon-amber { background: #fffbeb; color: #f59e0b; }
.icon-coral { background: #fff1f2; color: #f43f5e; }
.icon-purple { background: #f5f3ff; color: #8b5cf6; }
.portal-main-info h3 {
  font-size: 18px;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 6px;
}
.portal-main-info p {
  font-size: 13px;
  color: #64748b;
  line-height: 1.5;
  margin: 0;
}
.portal-bottom-stat {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.portal-stat-text {
  font-size: 12px;
  font-weight: 700;
  color: #475569;
}
.portal-bar-track {
  width: 60px;
  height: 6px;
  background: #f1f5f9;
  border-radius: 999px;
  overflow: hidden;
}
.portal-bar-fill {
  height: 100%;
  background: #2563eb;
  border-radius: 999px;
}
.portal-launch-arrow {
  position: absolute;
  top: 22px;
  right: 22px;
  font-size: 16px;
  color: #94a3b8;
  transition: transform 0.15s ease;
}
.explore-portal-card:hover .portal-launch-arrow {
  transform: translateX(3px);
  color: #2563eb;
}

/* Global Social Proof Banner (References 1, 3, 4, 5 bottom) */
.trusted-learners-banner {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 24px;
  padding: 20px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  margin: 36px 0;
  box-shadow: 0 4px 16px rgba(15,23,42,0.03);
}
.trusted-lead {
  display: flex;
  align-items: center;
  gap: 14px;
}
.trusted-icon {
  font-size: 28px;
}
.trusted-lead strong {
  display: block;
  font-size: 16px;
  font-weight: 800;
  color: #0f172a;
}
.trusted-lead p {
  font-size: 12px;
  color: #64748b;
  margin: 2px 0 0;
}
.trusted-stats-row {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
.stat-item {
  display: flex;
  align-items: center;
  gap: 8px;
}
.stat-emoji {
  font-size: 20px;
}
.stat-item strong {
  display: block;
  font-size: 14px;
  font-weight: 900;
  color: #0f172a;
  line-height: 1;
}
.stat-item small {
  display: block;
  font-size: 11px;
  color: #64748b;
}

/* Practice View Layout (Reference 3: media_1790551983421.jpg) */
.practice-hero-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 36px;
  align-items: center;
  margin-bottom: 24px;
}
.practice-progress-card-wrap {
  position: relative;
}
.practice-mascot-star-speech {
  position: absolute;
  top: -24px;
  right: 30px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #2563eb;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 10;
}
.user-progress-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 24px;
  padding: 22px 26px;
  box-shadow: 0 16px 36px rgba(15,23,42,0.06);
}
.progress-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.progress-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.progress-target-icon {
  font-size: 18px;
}
.progress-card-title {
  font-size: 15px;
  font-weight: 800;
  color: #0f172a;
}
.stats-link-btn {
  background: transparent;
  border: none;
  color: #2563eb;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.progress-level-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.level-cube-icon {
  font-size: 20px;
}
.level-info strong {
  display: block;
  font-size: 13px;
  font-weight: 800;
  color: #0f172a;
}
.level-info small {
  display: block;
  font-size: 11px;
  color: #64748b;
}
.xp-ratio-text {
  margin-left: auto;
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
}
.xp-progress-bar-track {
  width: 100%;
  height: 8px;
  background: #f1f5f9;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 18px;
}
.xp-progress-bar-fill {
  height: 100%;
  background: #2563eb;
  border-radius: 999px;
}
.progress-stats-quad {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  border-top: 1px solid #f1f5f9;
  padding-top: 14px;
}
.quad-item {
  text-align: center;
}
.quad-icon {
  display: block;
  font-size: 14px;
  margin-bottom: 2px;
}
.quad-item strong {
  display: block;
  font-size: 15px;
  font-weight: 900;
  color: #0f172a;
}
.quad-item small {
  display: block;
  font-size: 10px;
  color: #64748b;
}

/* Interactive Challenge Card (Reference 3) */
.interactive-challenge-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 28px;
  padding: 28px;
  box-shadow: 0 16px 36px rgba(15,23,42,0.05);
  margin-bottom: 30px;
}
.challenge-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 16px;
  margin-bottom: 22px;
}
.challenge-step-box {
  display: flex;
  align-items: center;
  gap: 12px;
}
.challenge-step-cube { font-size: 18px; }
.challenge-step-text {
  font-size: 13px;
  font-weight: 800;
  color: #0f172a;
}
.challenge-header-bar-track {
  width: 140px;
  height: 6px;
  background: #f1f5f9;
  border-radius: 999px;
  overflow: hidden;
}
.challenge-header-bar-fill {
  height: 100%;
  background: #2563eb;
  border-radius: 999px;
}
.challenge-meta-badges {
  display: flex;
  align-items: center;
  gap: 8px;
}
.xp-reward-pill {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #b45309;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
}
.difficulty-pill {
  font-size: 11px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
}
.difficulty-pill.easy {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #047857;
}

.challenge-card-main-split {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 32px;
}
.challenge-title {
  font-size: 22px;
  font-weight: 900;
  color: #0f172a;
  margin: 0 0 6px;
}
.challenge-prompt {
  font-size: 14px;
  color: #475569;
  margin: 0 0 18px;
}
.challenge-shape-visual {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  height: 200px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 20px;
}
.challenge-options-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.challenge-option-btn {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 14px;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  cursor: pointer;
  transition: all 0.15s ease;
  width: 100%;
  text-align: left;
}
.challenge-option-btn:hover {
  border-color: #2563eb;
  background: #f8fafc;
}
.challenge-option-btn.selected-correct {
  background: #ecfdf5;
  border-color: #10b981;
  color: #065f46;
}
.challenge-option-btn.selected-wrong {
  background: #fff1f2;
  border-color: #f43f5e;
  color: #9f1239;
}
.option-letter-badge {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #f1f5f9;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
  color: #475569;
  flex-shrink: 0;
}
.challenge-option-btn.selected-correct .option-letter-badge {
  background: #10b981;
  color: #ffffff;
}
.challenge-option-btn.selected-wrong .option-letter-badge {
  background: #f43f5e;
  color: #ffffff;
}

/* Stage Preview & Need a Hint (Reference 3) */
.stage-preview-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  padding: 16px;
  margin-bottom: 16px;
}
.stage-preview-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.stage-preview-head strong {
  display: block;
  font-size: 13px;
  font-weight: 800;
  color: #0f172a;
}
.stage-preview-head small {
  display: block;
  font-size: 11px;
  color: #64748b;
}
.stage-badge-small {
  margin-left: auto;
  font-size: 10px;
  font-weight: 700;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 4px 8px;
  color: #475569;
  text-align: right;
  line-height: 1.2;
}
.stage-preview-canvas {
  width: 100%;
  height: 120px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 10px;
}
.stage-preview-desc {
  font-size: 11px;
  color: #64748b;
  line-height: 1.4;
  margin: 0;
}
.need-a-hint-card {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 18px;
  padding: 14px 18px;
}
.hint-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
}
.hint-card-head strong {
  font-size: 13px;
  font-weight: 800;
  color: #92400e;
}
.hint-toggle-btn {
  margin-left: auto;
  background: transparent;
  border: none;
  color: #b45309;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
.hint-body {
  margin-top: 10px;
  font-size: 12px;
  color: #78350f;
  line-height: 1.5;
}

/* Timed Mission Challenges Deck (Reference 3) */
.timed-missions-section {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 24px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 4px 16px rgba(15,23,42,0.03);
}
.timed-missions-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 18px;
}
.timed-missions-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}
.mission-rocket-icon { font-size: 24px; }
.timed-missions-title {
  font-size: 18px;
  font-weight: 900;
  color: #0f172a;
  margin: 0;
}
.timed-missions-desc {
  font-size: 12px;
  color: #64748b;
  margin: 2px 0 0;
}
.timed-missions-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}
.streak-pill-box {
  background: #fff7ed;
  border: 1px solid #ffedd5;
  border-radius: 999px;
  padding: 6px 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #c2410c;
}
.missions-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}
.mission-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.15s ease;
}
.mission-card:hover {
  background: #ffffff;
  border-color: #2563eb;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(15,23,42,0.06);
}
.mission-icon-box {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  display: grid;
  place-items: center;
  font-size: 20px;
  margin-bottom: 12px;
}
.mission-card strong {
  display: block;
  font-size: 14px;
  font-weight: 800;
  color: #0f172a;
}
.mission-card small {
  display: block;
  font-size: 11px;
  color: #64748b;
  margin-top: 2px;
}
.mission-card-foot {
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.mission-start-btn {
  font-size: 11px;
  padding: 6px 12px;
}
.mission-xp-tag {
  font-size: 11px;
  font-weight: 800;
  color: #b45309;
}

/* Equation Blocks Tray Section (Reference 3) */
.equation-blocks-tray-section {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 24px;
  padding: 22px;
  margin-bottom: 24px;
  box-shadow: 0 4px 16px rgba(15,23,42,0.03);
}
.equation-tray-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.tray-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}
.tray-cube-icon { font-size: 20px; }
.equation-tray-title {
  font-size: 17px;
  font-weight: 900;
  color: #0f172a;
  margin: 0;
}
.equation-tray-desc {
  font-size: 12px;
  color: #64748b;
  margin: 2px 0 0;
}
.practice-equation-blocks-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}
.formula-chip-block {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 12px;
  text-align: center;
  cursor: grab;
  transition: all 0.15s ease;
}
.formula-chip-block:hover {
  background: #ffffff;
  border-color: #2563eb;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(15,23,42,0.06);
}
.formula-chip-block strong {
  display: block;
  font-size: 13px;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 2px;
}
.formula-chip-block small {
  display: block;
  font-size: 10px;
  color: #64748b;
}

/* Responsive Rules for Consolidated Reference Layouts */
@media (max-width: 1024px) {
  .home-hero-layout { grid-template-columns: 1fr; }
  .practice-hero-row { grid-template-columns: 1fr; }
  .challenge-card-main-split { grid-template-columns: 1fr; }
}

/* Home 3D Interactive Canvas & Live Slider Panel */
.home-3d-interactive-canvas {
  width: 100%;
  height: 250px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: grab;
  user-select: none;
  touch-action: none;
  position: relative;
}
.home-3d-interactive-canvas.grabbing {
  cursor: grabbing;
}
.home-stage-slider-panel {
  width: 100%;
  max-width: 440px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 12px 16px;
  margin-top: 8px;
  margin-bottom: 24px;
}
.home-slider-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  gap: 10px;
  flex-wrap: wrap;
}
.home-slider-label {
  font-size: 13px;
  font-weight: 700;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 6px;
}
.home-slider-label b {
  color: #2563eb;
  font-size: 14px;
}
.home-volume-pill {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 5px;
}
.home-volume-pill strong {
  color: #2563eb;
}
.home-slider-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}
.slider-min-tag, .slider-max-tag {
  font-size: 10px;
  font-weight: 700;
  color: #64748b;
  white-space: nowrap;
}
.home-dim-slider {
  flex: 1;
  height: 6px;
  accent-color: #2563eb;
  cursor: pointer;
}
.home-drag-hint-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 6px;
  color: #64748b;
  font-size: 11px;
}

/* Practice Enhanced Interactive Styles */
.formula-chip-block.active {
  border-color: #2563eb;
  background: #eff6ff;
  box-shadow: 0 0 0 2px rgba(37,99,235,0.2), 0 6px 16px rgba(37,99,235,0.12);
  transform: translateY(-2px);
}
.step-check-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  margin-bottom: 6px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  font-size: 13px;
}
.step-badge-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #10b981;
  color: #ffffff;
  font-size: 12px;
  font-weight: 900;
  animation: popCheck 0.3s ease-out;
}
@keyframes popCheck {
  0% { transform: scale(0); opacity: 0; }
  70% { transform: scale(1.3); }
  100% { transform: scale(1); opacity: 1; }
}
.hint-step-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  background: #fef3c7;
  color: #92400e;
  padding: 2px 8px;
  border-radius: 6px;
  margin-bottom: 6px;
}

/* Live Labs Tactile Interactivity */
.interactive-rocket {
  cursor: grab;
  transition: transform 0.05s ease-out;
}
.interactive-rocket:active {
  cursor: grabbing;
}
.interactive-exhaust {
  cursor: pointer;
}
.interactive-exhaust:hover {
  filter: drop-shadow(0 0 10px rgba(249,115,22,0.8));
}
.interactive-sail {
  cursor: grab;
  transition: transform 0.05s ease-out;
}
.interactive-sail:active {
  cursor: grabbing;
}
.plasma-stage-interactive {
  cursor: crosshair;
}
.plasma-particle-clickable {
  cursor: pointer;
  transition: r 0.2s ease, fill 0.2s ease;
}
.plasma-particle-clickable:hover {
  r: 8px !important;
  fill: #f43f5e !important;
}
.ripple-wave-circle {
  animation: rippleExpand 1s ease-out forwards;
}
@keyframes rippleExpand {
  0% { r: 5px; opacity: 1; stroke-width: 3px; }
  100% { r: 70px; opacity: 0; stroke-width: 0.5px; }
}

.home-3d-interactive-canvas.is-dragging,
.home-3d-interactive-canvas.is-dragging * {
  transition: none !important;
}
.home-learno-mascot-group {
  filter: drop-shadow(0 4px 8px rgba(37,99,235,0.15));
}
.carousel-dots .dot {
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease;
}
.carousel-dots .dot:hover,
.carousel-dots .dot:focus-visible {
  transform: scale(1.3);
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}
.equation-block-active-card {
  margin-top: 14px;
  background: #ffffff;
  border: 1.5px solid #3b82f6;
  border-radius: 16px;
  padding: 16px 20px;
  box-shadow: 0 4px 20px rgba(59,130,246,0.08);
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: popCheck 0.25s ease-out;
}
.equation-block-active-card.hidden {
  display: none;
}
.eq-detail-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.eq-detail-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}
.eq-detail-icon {
  font-size: 26px;
}
.eq-detail-title {
  font-size: 17px;
  font-weight: 800;
  color: #0f172a;
  margin: 0;
}
.eq-detail-sub {
  font-size: 13px;
  color: #64748b;
  margin: 0;
}
.eq-detail-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  background: #f8fafc;
  border-radius: 12px;
  padding: 14px 18px;
  border: 1px solid #e2e8f0;
}
@media (max-width: 768px) {
  .eq-detail-body {
    grid-template-columns: 1fr;
  }
}
.eq-detail-formula-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.eq-detail-math {
  font-size: 18px;
  font-weight: 800;
  color: #2563eb;
}
.eq-detail-desc {
  font-size: 13px;
  color: #475569;
  line-height: 1.4;
}
.eq-calc-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.eq-calc-label {
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.eq-calc-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.eq-calc-input {
  width: 90px;
  padding: 6px 10px;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  color: #1e293b;
  background: #ffffff;
}
.eq-calc-input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.15);
}
.eq-calc-result-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: 8px;
  color: #065f46;
  font-weight: 800;
  font-size: 13px;
}
.eq-detail-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ==========================================================================
   UNIFIED ROUTING & NAV PILL BADGES
   ========================================================================== */
.nav-pill-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  border-radius: 9999px;
  background: #e0f2fe;
  color: #0369a1;
  margin-left: 6px;
  vertical-align: middle;
}
.nav-btn.active .nav-pill-badge {
  background: #2563eb;
  color: #ffffff;
}

/* ==========================================================================
   VIEW 6: FORMULA SANDBOX WORKBENCH
   ========================================================================== */
.sandbox-shell {
  max-width: 1240px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

.sandbox-hero-header {
  text-align: center;
  max-width: 820px;
  margin: 0 auto 36px;
}
.sandbox-hero-header .pill-badge-row {
  display: flex;
  justify-content: center;
  margin-bottom: 14px;
}
.workbench-pill {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #334155;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 9999px;
}
.sandbox-main-title {
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 900;
  color: #0f172a;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin: 0 0 14px;
}
.sandbox-subtitle {
  font-size: 16px;
  line-height: 1.6;
  color: #64748b;
  margin: 0 auto;
}

/* Sandbox Tabs */
.sandbox-category-tabs {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.sandbox-tab-btn {
  padding: 8px 18px;
  border-radius: 9999px;
  font-size: 14px;
  font-weight: 700;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #475569;
  cursor: pointer;
  transition: all 0.2s ease;
}
.sandbox-tab-btn:hover {
  border-color: #cbd5e1;
  color: #0f172a;
  background: #f8fafc;
}
.sandbox-tab-btn.active {
  background: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(37,99,235,0.25);
}

/* Sandbox Equation Cards Grid */
.sandbox-equation-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 14px;
  margin-bottom: 36px;
}
.sandbox-eq-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 16px 18px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 2px 8px rgba(15,23,42,0.03);
}
.sandbox-eq-card:hover {
  transform: translateY(-2px);
  border-color: #93c5fd;
  box-shadow: 0 8px 20px rgba(37,99,235,0.08);
}
.sandbox-eq-card.active {
  border: 2px solid #2563eb;
  background: #eff6ff;
  box-shadow: 0 8px 24px rgba(37,99,235,0.12);
}
.sandbox-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.sandbox-card-cat {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  color: #64748b;
  letter-spacing: 0.04em;
}
.sandbox-card-title {
  font-size: 15px;
  font-weight: 800;
  color: #1e293b;
  margin: 0 0 6px;
}
.sandbox-card-eq {
  font-size: 16px;
  font-family: 'KaTeX_Math', 'Times New Roman', serif;
  color: #2563eb;
  font-weight: 700;
  margin-bottom: 6px;
}
.sandbox-card-desc {
  font-size: 12px;
  color: #64748b;
  line-height: 1.4;
  margin: 0;
}

/* Active Workbench Layout */
.sandbox-active-workbench {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 24px;
  padding: 32px;
  box-shadow: 0 12px 36px rgba(15,23,42,0.06);
}
.workbench-grid-row {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 36px;
}
@media (max-width: 900px) {
  .workbench-grid-row {
    grid-template-columns: 1fr;
  }
}

.workbench-controls-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.workbench-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.workbench-cat-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 9999px;
  background: #f1f5f9;
  color: #475569;
  margin-bottom: 6px;
}
.workbench-formula-title {
  font-size: 24px;
  font-weight: 900;
  color: #0f172a;
  margin: 0;
}
.reset-param-btn {
  font-size: 13px;
  font-weight: 700;
  padding: 6px 14px;
}

/* Presets */
.sandbox-presets-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 14px 18px;
}
.presets-label {
  display: block;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  margin-bottom: 10px;
}
.sandbox-presets-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.sandbox-preset-chip {
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #1e293b;
  cursor: pointer;
  transition: all 0.15s ease;
}
.sandbox-preset-chip:hover {
  background: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
}

/* Sliders */
.sandbox-sliders-group {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.sandbox-slider-item {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 16px;
}
.sandbox-slider-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.sandbox-slider-label {
  font-size: 14px;
  font-weight: 800;
  color: #1e293b;
}
.sandbox-slider-val-input {
  width: 90px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  font-size: 14px;
  font-weight: 800;
  text-align: right;
  color: #2563eb;
  background: #f8fafc;
}
.sandbox-slider-track {
  width: 100%;
  accent-color: #2563eb;
  cursor: pointer;
}

/* Readout Panel */
.workbench-readout-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.sandbox-result-hero-card {
  background: linear-gradient(135deg, #1e293b, #0f172a);
  border-radius: 20px;
  padding: 24px;
  color: #ffffff;
  box-shadow: 0 10px 30px rgba(15,23,42,0.18);
  position: relative;
  overflow: hidden;
}
.sandbox-result-hero-card::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 140px;
  height: 140px;
  background: radial-gradient(circle, rgba(56,189,248,0.2) 0%, transparent 70%);
  pointer-events: none;
}
.result-badge-label {
  display: block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #38bdf8;
  margin-bottom: 8px;
}
.result-hero-value-wrap {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.result-hero-number {
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 900;
  color: #ffffff;
  letter-spacing: -0.02em;
  font-feature-settings: 'tnum';
}
.result-hero-unit {
  font-size: 18px;
  font-weight: 700;
  color: #94a3b8;
}
.result-formula-tex {
  font-size: 18px;
  color: #cbd5e1;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.12);
}

/* Step breakdown card */
.sandbox-step-breakdown-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  padding: 20px;
}
.step-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.step-card-head .step-icon {
  font-size: 18px;
}
.step-card-head .step-title {
  font-size: 15px;
  font-weight: 800;
  color: #1e293b;
  margin: 0;
}
.step-calculation-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.step-calc-line {
  padding: 8px 12px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  font-size: 14px;
  color: #334155;
  font-weight: 600;
  line-height: 1.5;
}

/* Workbench actions */
.workbench-bottom-actions {
  display: flex;
  gap: 12px;
}
.workbench-goto-playground {
  flex: 1;
  padding: 14px 20px;
  font-size: 15px;
  font-weight: 800;
  border-radius: 12px;
  text-align: center;
}




