/* ============================================================================
   EduWonderLab Math Fluency Lab 2.0 — Unified Design & Signature Innovations CSS
   Consolidates competing generational layers into one calm, high-craft studio
   ============================================================================ */

:root {
  --fl2-surface: #ffffff;
  --fl2-bg-soft: #f8fafc;
  --fl2-border: #cbd5e1;
  --fl2-ink: #0f172a;
  --fl2-muted: #475569;
  --fl2-teal: #0d9488;
  --fl2-teal-bg: #f0fdfa;
  --fl2-blue: #2563eb;
  --fl2-blue-bg: #eff6ff;
  --fl2-amber: #d97706;
  --fl2-amber-bg: #fffbeb;
  --fl2-radius: 14px;
}

/* 1. Architectural De-duplication: Prevent stacked competing hero banners & redundant navs */
body:not([data-grade-experience]) #grade-experience-banner {
  display: none !important;
}

/* Keep the top hero compact when inside a grade library or workspace so the student reaches math immediately */
#library-view .practice-subnav {
  display: none; /* Consolidated into #grade-hub-tabs which already has Today, Skills, Fact Trail, Skill Map, Rewards */
}

/* Streamlined Problem Stage Hierarchy */
.problem-arena {
  position: relative;
  border-radius: var(--fl2-radius);
}

/* 2. Live Tri-Representation Morphing Bench */
.fl2-tri-bench {
  margin: 0.9rem 0;
  padding: 1rem 1.15rem;
  border-radius: var(--fl2-radius);
  border: 1.5px solid var(--fl2-border);
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.fl2-tri-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.85rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid #e2e8f0;
}

.fl2-eyebrow {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #0b4f4a;
  background: var(--fl2-teal-bg);
  padding: 2px 8px;
  border-radius: 999px;
  margin-bottom: 3px;
}

.fl2-tri-header h4 {
  margin: 0;
  font-size: 0.95rem;
  color: var(--fl2-ink);
  font-weight: 700;
}

.fl2-slider-label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--fl2-ink);
  background: #f1f5f9;
  padding: 6px 12px;
  border-radius: 999px;
}

.fl2-slider-label input[type="range"] {
  accent-color: var(--fl2-teal);
  cursor: pointer;
}

.fl2-tri-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0.85rem;
}

.fl2-tri-pane {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.fl2-pane-tag {
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--fl2-muted);
  margin-bottom: 0.45rem;
}

.fl2-tri-svg {
  width: 100%;
  max-height: 110px;
  display: block;
  margin: 0 auto;
}

.fl2-pane-caption {
  margin: 0.45rem 0 0;
  font-size: 0.8rem;
  color: var(--fl2-muted);
  text-align: center;
}

.fl2-symbolic-stack {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  justify-content: center;
  min-height: 76px;
  font-size: 0.95rem;
}

.fl2-sym-line code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.95rem;
  font-weight: 700;
  background: #f8fafc;
  padding: 2px 6px;
  border-radius: 5px;
}

.fl2-hl-teal {
  color: #0f766e;
  background: #ccfbf1;
  padding: 1px 5px;
  border-radius: 4px;
}

.fl2-hl-blue {
  color: #1d4ed8;
  background: #dbeafe;
  padding: 1px 5px;
  border-radius: 4px;
}

.fl2-hl-amber {
  color: #b45309;
  background: #fef3c7;
  padding: 1px 5px;
  border-radius: 4px;
}

.fl2-tape-box {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 4px;
  background: #ccfbf1;
  border: 1px solid #0d9488;
  font-weight: 800;
  font-size: 0.82rem;
}

.fl2-tape-b {
  background: #dbeafe;
  border-color: #2563eb;
}

.fl2-mini-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  text-align: center;
}

.fl2-mini-table th,
.fl2-mini-table td {
  border: 1px solid #cbd5e1;
  padding: 4px 8px;
}

/* 3. Socratic Counterexample Card */
.fl2-socratic-card {
  margin: 0.75rem 0;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  border-left: 4px solid #f59e0b;
  background: #fffbeb;
  color: #78350f;
}

.fl2-socratic-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.35rem;
}

.fl2-socratic-badge {
  font-size: 0.7rem;
  font-weight: 800;
  background: #fef3c7;
  color: #92400e;
  padding: 2px 8px;
  border-radius: 999px;
}

.fl2-socratic-prompt {
  margin: 0.25rem 0 0.5rem;
  font-size: 0.92rem;
  line-height: 1.45;
}

.fl2-counterexample-svg {
  width: 100%;
  max-width: 360px;
  background: #ffffff;
  border-radius: 8px;
  border: 1px solid #fde68a;
  padding: 4px;
}

/* 4. Tactile Expression Decomposer */
.fl2-tactile-tokens {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  margin: 0.55rem 0;
  padding: 0.5rem 0.85rem;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
}

.fl2-tokens-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--fl2-muted);
}

.fl2-tokens-stage {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.fl2-token {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 4px 10px;
  border-radius: 8px;
  font-weight: 800;
  font-size: 1rem;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  color: var(--fl2-ink);
}

.fl2-token--splittable {
  cursor: pointer;
  border-color: var(--fl2-teal);
  background: var(--fl2-teal-bg);
  color: #0f766e;
  transition: transform 0.15s ease;
}

.fl2-token--splittable:hover {
  transform: translateY(-1px);
}

.fl2-token--splittable small {
  font-size: 0.72rem;
  font-weight: 700;
  color: #0b4f4a;
}

.fl2-token--part {
  cursor: pointer;
  border-color: var(--fl2-blue);
  background: var(--fl2-blue-bg);
  color: #1d4ed8;
}

.fl2-token-merge {
  border: 1px solid #cbd5e1;
  background: #ffffff;
  border-radius: 6px;
  padding: 2px 7px;
  cursor: pointer;
  font-weight: 800;
}

/* 5. Tomorrow's 10-Minute Small-Group Table Kit */
.fl2-teacher-kit {
  margin: 1.25rem 0;
  padding: 1.25rem;
  border-radius: var(--fl2-radius);
  border: 1.5px solid var(--fl2-border);
  background: #ffffff;
}

.fl2-kit-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.fl2-kit-header h3 {
  margin: 0.2rem 0;
}

.fl2-kit-header p {
  margin: 0;
  color: var(--fl2-muted);
  font-size: 0.92rem;
}

.fl2-kit-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.9rem;
}

.fl2-kit-card {
  padding: 0.9rem;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
}

.fl2-kit-card header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.fl2-kit-pill {
  font-size: 0.75rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #0f172a;
}

.fl2-kit--concrete .fl2-kit-pill {
  background: #fef3c7;
  color: #92400e;
}

.fl2-kit--strategic .fl2-kit-pill {
  background: #ccfbf1;
  color: #115e59;
}

.fl2-kit--transfer .fl2-kit-pill {
  background: #dbeafe;
  color: #1e40af;
}

/* 6. Live Browser Audit Fixes (SVG Icon Sizing, Sticky Scroll Container, Mobile Overflow, Duplicate Confidence) */
.gh-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.gh-tab svg.fl-icon,
.fl-icon {
  width: 1.15rem !important;
  height: 1.15rem !important;
  flex-shrink: 0;
}

/* Fix CSS sticky positioning broken by overflow-x: hidden on html/body */
html,
body {
  overflow-x: clip !important;
}

/* Prevent horizontal overflow on 375px mobile viewports */
.confidence-gauge-wrap,
.conf-gauge-row,
.lens-row,
.lens-modes,
.problem-arena {
  max-width: 100%;
  box-sizing: border-box;
}

/* De-duplicate redundant second confidence gauge inside #answer-form (#confidence-meter-row is already present) */
#answer-form .confidence-gauge-wrap {
  display: none;
}

