:root {
  --bg-primary: #0a0f1d;
  --bg-secondary: #0f172a;
  --bg-card: #1e293b;
  --bg-card-hover: #24344d;
  --bg-glass: rgba(30, 41, 59, 0.7);
  --border-subtle: #334155;
  --border-focus: #38bdf8;

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --accent-cyan: #38bdf8;
  --accent-blue: #3b82f6;
  --accent-green: #10b981;
  --accent-amber: #f59e0b;
  --accent-red: #ef4444;
  --accent-purple: #a855f7;
  --accent-pink: #ec4899;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'Fira Code', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
  --shadow-glow-cyan: 0 0 15px rgba(56, 189, 248, 0.25);
  --shadow-glow-amber: 0 0 15px rgba(245, 158, 11, 0.25);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ============================================================
   HEADER & TOP BAR
   ============================================================ */
.app-header {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
}

.header-content {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.brand-logo-mark {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
  color: #04101e;
  font-weight: 800;
  font-size: 1.4rem;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-glow-cyan);
}

.brand-title {
  font-size: 1.25rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  letter-spacing: -0.02em;
}

.brand-tagline {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 9999px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.badge-version {
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent-cyan);
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.badge-success {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-green);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-stop {
  background: rgba(239, 68, 68, 0.15);
  color: var(--accent-red);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-redesign {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-amber);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-active {
  background: rgba(168, 85, 247, 0.2);
  color: var(--accent-purple);
  border: 1px solid rgba(168, 85, 247, 0.4);
}

.badge-paused {
  background: rgba(100, 116, 139, 0.2);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

.badge-ready {
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent-cyan);
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.badge-completed-locally {
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent-cyan);
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Explainer Switcher */
.explainer-toggle-card {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  padding: 0.25rem 0.35rem;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  font-size: 0.8rem;
}

.explainer-label {
  color: var(--text-muted);
  font-weight: 500;
  margin-right: 0.4rem;
  margin-left: 0.3rem;
}

.mode-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.mode-btn:hover {
  color: var(--text-primary);
}

.mode-btn.active {
  background: var(--accent-blue);
  color: #fff;
  box-shadow: 0 2px 4px rgba(59, 130, 246, 0.4);
}

#btnModeSimple.active {
  background: linear-gradient(135deg, var(--accent-amber), #d97706);
  color: #1e1b18;
}

.btn-github {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--bg-card);
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.45rem 0.85rem;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  transition: all 0.2s ease;
}

.btn-github:hover {
  background: var(--bg-card-hover);
  border-color: var(--text-muted);
}

/* ============================================================
   NAVIGATION TABS
   ============================================================ */
.nav-tabs {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1.5rem 0.75rem;
  background: rgba(15, 23, 42, 0.4);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.nav-tab {
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.07);
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.5rem 0.85rem;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.nav-tab:hover {
  background: rgba(51, 65, 85, 0.7);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}

.nav-tab.active {
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent-cyan);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.25);
}

.nav-tab.highlight-tab {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24 !important;
  border-color: rgba(245, 158, 11, 0.45);
  font-weight: 700;
}

.nav-tab.highlight-tab:hover {
  background: rgba(245, 158, 11, 0.25);
  border-color: var(--accent-amber);
}

.nav-tab.highlight-tab.active {
  background: rgba(245, 158, 11, 0.25);
  border-color: var(--accent-amber);
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.4);
}

/* Quick Nav Launchpad */
.quick-nav-launchpad {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.launchpad-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-right: 0.25rem;
}

.launchpad-btn {
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.45rem 0.85rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.launchpad-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-cyan);
  transform: translateY(-1px);
}

.btn-highlight-launch {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.4);
  color: #fbbf24;
}

.btn-highlight-launch:hover {
  background: rgba(245, 158, 11, 0.25);
  border-color: var(--accent-amber);
}

.nav-tab:hover {
  color: var(--text-primary);
}

.nav-tab.active {
  color: var(--accent-cyan);
  border-bottom-color: var(--accent-cyan);
}

/* ============================================================
   LAYOUT & PANELS
   ============================================================ */
.app-main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
  flex: 1;
  width: 100%;
}

.tab-panel {
  display: none;
  animation: fadeIn 0.25s ease forwards;
}

.tab-panel.active {
  display: block;
}

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

.panel-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 1.25rem;
}

.panel-title {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
}

.panel-desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
  max-width: 780px;
}

.section-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 2.5rem 0 1.2rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ============================================================
   TAB 1: HERO & BRIEFING
   ============================================================ */
.hero-banner {
  background: radial-gradient(circle at top right, rgba(56, 189, 248, 0.12), transparent 40%),
              linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-card) 100%);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 2.5rem 2rem;
  margin-bottom: 2.5rem;
  box-shadow: var(--shadow-lg);
}

.hero-pill {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.12);
  padding: 0.3rem 0.75rem;
  border-radius: 9999px;
  margin-bottom: 1rem;
  border: 1px solid rgba(56, 189, 248, 0.25);
}

.hero-title {
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-bottom: 1rem;
}

.hero-subtitle {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 840px;
  line-height: 1.6;
}

.hero-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
  margin-top: 2.2rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.stat-card {
  background: rgba(15, 23, 42, 0.6);
  padding: 1.2rem 1.4rem;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
}

.stat-num {
  font-size: 2.2rem;
  font-weight: 800;
  font-family: var(--font-mono);
  line-height: 1.1;
  margin-bottom: 0.3rem;
}

.highlight-cyan { color: var(--accent-cyan); }
.highlight-green { color: var(--accent-green); }
.highlight-amber { color: var(--accent-amber); }
.highlight-purple { color: var(--accent-purple); }

.stat-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
}

.stat-sub {
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

/* Feature Cards Grid */
.cards-grid {
  display: grid;
  gap: 1.25rem;
}

.cols-3 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.cols-2 { grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); }

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 1.5rem;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.feature-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-cyan);
}

.card-icon {
  font-size: 1.7rem;
  margin-bottom: 0.75rem;
}

.feature-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
  color: var(--text-primary);
}

.text-dynamic {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

/* FAQ section */
.faq-container {
  margin-top: 3rem;
  background: var(--bg-secondary);
  border-radius: 14px;
  padding: 2rem;
  border: 1px solid var(--border-subtle);
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.faq-item {
  background: var(--bg-card);
  border-radius: 10px;
  padding: 1.25rem;
  border: 1px solid var(--border-subtle);
}

.faq-q {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-primary);
  margin-bottom: 0.4rem;
}

.faq-a {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ============================================================
   TAB 2: TIMELINE STREAM
   ============================================================ */
.timeline-filters {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.search-input, .filter-select {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 0.5rem 0.85rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-family: inherit;
}

.search-input:focus, .filter-select:focus {
  outline: none;
  border-color: var(--accent-cyan);
}

.timeline-stream {
  position: relative;
  padding-left: 2rem;
  margin-top: 1.5rem;
}

.timeline-stream::before {
  content: '';
  position: absolute;
  left: 9px;
  top: 10px;
  bottom: 10px;
  width: 2px;
  background: var(--border-subtle);
}

.timeline-phase-group {
  margin-bottom: 2.5rem;
}

.timeline-phase-header {
  position: relative;
  margin-bottom: 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.timeline-phase-dot {
  position: absolute;
  left: -2rem;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--bg-primary);
  border: 3px solid var(--accent-cyan);
}

.phase-title-text {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
}

.phase-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.timeline-node-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
  transition: all 0.15s ease;
}

.timeline-node-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(56, 189, 248, 0.4);
}

.node-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.4rem;
}

.node-id {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent-cyan);
}

.node-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
}

.node-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 0.75rem;
}

.node-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 0.6rem;
}

.node-link {
  color: var(--accent-cyan);
  text-decoration: none;
  font-family: var(--font-mono);
}

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

/* ============================================================
   TAB 3: ROADBLOCKS & PIVOTS
   ============================================================ */
.roadblocks-grid {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  margin-bottom: 3rem;
}

.roadblock-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 1.75rem;
  position: relative;
  overflow: hidden;
}

.roadblock-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 4px;
}

.roadblock-card.rb-stop::before { background: var(--accent-red); }
.roadblock-card.rb-redesign::before { background: var(--accent-amber); }
.roadblock-card.rb-guard::before { background: var(--accent-cyan); }

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

.roadblock-id {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-amber);
  margin-bottom: 0.2rem;
}

.roadblock-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.roadblock-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 1.2rem;
  background: rgba(15, 23, 42, 0.4);
  padding: 1.25rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.rb-col-title {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.rb-trap .rb-col-title { color: #f87171; }
.rb-pivot .rb-col-title { color: #34d399; }

.adr-index-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 1.75rem;
}

.adr-index-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.adr-table-wrapper {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.88rem;
}

.data-table th, .data-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
}

.data-table th {
  background: var(--bg-secondary);
  font-weight: 600;
  color: var(--text-secondary);
}

.data-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* ============================================================
   TAB 4: METRICS & CHARTS
   ============================================================ */
.metric-summary-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
}

.metric-card-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.5rem;
}

.metric-big-val {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text-primary);
  font-family: var(--font-mono);
  margin-bottom: 1rem;
}

.metric-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.88rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.metric-status-box {
  margin: 1rem 0;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  text-align: center;
}

.tag-pipeline { background: rgba(56, 189, 248, 0.15); color: var(--accent-cyan); }
.tag-stop { background: rgba(239, 68, 68, 0.2); color: var(--accent-red); }
.tag-redesign { background: rgba(245, 158, 11, 0.2); color: var(--accent-amber); }
.tag-proceed { background: rgba(16, 185, 129, 0.2); color: var(--accent-green); }

.metric-note {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: auto;
  line-height: 1.45;
}

.chart-section-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 2rem;
  margin: 2rem 0;
}

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

.chart-subtitle {
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  font-size: 0.82rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.color-null { background: #64748b; }
.color-logistic { background: #38bdf8; }
.color-xgboost { background: #a855f7; }
.color-target { background: #ef4444; }

.svg-chart-wrapper {
  width: 100%;
  overflow-x: auto;
}

.metric-chart-svg {
  width: 100%;
  min-width: 600px;
  height: auto;
  display: block;
}

.chart-caption {
  margin-top: 1rem;
  font-size: 0.88rem;
  color: var(--text-secondary);
  background: rgba(15, 23, 42, 0.6);
  padding: 1rem 1.25rem;
  border-radius: 8px;
  border-left: 3px solid var(--accent-cyan);
}

.test-health-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 1.75rem;
}

.test-health-card h3 {
  margin-bottom: 1.25rem;
  font-size: 1.15rem;
  font-weight: 700;
}

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

.test-stat-box {
  background: rgba(15, 23, 42, 0.5);
  padding: 1rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.test-num {
  font-family: var(--font-mono);
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--accent-cyan);
}

.test-label {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-top: 0.2rem;
}

/* ============================================================
   TAB 5: ARCHITECTURE
   ============================================================ */
.arch-diagram-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 2rem;
  margin-bottom: 2rem;
}

.arch-diagram-card h3 {
  margin-bottom: 1.5rem;
  font-size: 1.2rem;
  font-weight: 700;
}

.authority-flow {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 0.75rem;
  overflow-x: auto;
  padding-bottom: 1rem;
}

.flow-step {
  flex: 1;
  min-width: 200px;
  display: flex;
  flex-direction: column;
}

.flow-badge {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.35rem 0.6rem;
  border-radius: 6px 6px 0 0;
  text-align: center;
}

.tier-1 { background: #1e3a8a; color: #93c5fd; }
.tier-2 { background: #065f46; color: #6ee7b7; }
.tier-3 { background: #581c87; color: #d8b4fe; }
.tier-4 { background: #831843; color: #fbcfe8; }

.flow-card {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-subtle);
  border-top: none;
  border-radius: 0 0 10px 10px;
  padding: 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.flow-card h4 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.flow-role {
  font-size: 0.8rem;
  color: var(--accent-cyan);
  margin-bottom: 0.85rem;
}

.flow-boundary {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.45;
  margin-top: auto;
}

.flow-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 1.2rem;
}

.code-box {
  background: #040914;
  border-radius: 8px;
  padding: 0.85rem 1.1rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: #38bdf8;
  margin-top: 1rem;
  border: 1px solid rgba(56, 189, 248, 0.2);
}

/* ============================================================
   FOOTER
   ============================================================ */
.app-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-subtle);
  padding: 1.5rem;
  margin-top: auto;
}

.footer-content {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  font-size: 0.84rem;
  color: var(--text-secondary);
}

.footer-right {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.footer-right code {
  font-family: var(--font-mono);
  color: var(--accent-cyan);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 860px) {
  .authority-flow {
    flex-direction: column;
  }
  .flow-arrow {
    transform: rotate(90deg);
    margin: 0.5rem 0;
  }
  .roadblock-cols {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   VISUAL STORY STRIP (TAB 1)
   ============================================================ */
.visual-story-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 1.5rem 0 2.5rem;
  background: var(--bg-card);
  padding: 1.5rem 2rem;
  border-radius: 14px;
  border: 1px solid var(--border-subtle);
  overflow-x: auto;
}

.story-step-card {
  flex: 1;
  min-width: 220px;
  background: rgba(15, 23, 42, 0.6);
  padding: 1.25rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  position: relative;
}

.story-num {
  position: absolute;
  top: -10px;
  left: -10px;
  width: 24px;
  height: 24px;
  background: var(--accent-cyan);
  color: #04101e;
  font-weight: 800;
  font-size: 0.75rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.story-icon {
  font-size: 1.6rem;
  margin-bottom: 0.5rem;
}

.story-step-card h4 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  color: var(--text-primary);
}

.story-step-card p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.story-arrow {
  font-size: 1.5rem;
  color: var(--text-muted);
}

/* ============================================================
   THRESHOLDS EXPLAINER & GAUGES (TAB 4)
   ============================================================ */
.threshold-cards-grid {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.threshold-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 1.75rem 2rem;
  box-shadow: var(--shadow-md);
}

.th-header {
  margin-bottom: 1.5rem;
}

.th-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.5rem;
}

.th-badge.fail {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.th-badge.pass {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.th-title {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
}

.th-target {
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.th-target strong {
  color: var(--text-primary);
}

/* Horizontal Gauge */
.gauge-wrapper {
  margin: 2rem 0 2.5rem;
  padding: 0 1rem;
}

.gauge-bar-bg {
  height: 28px;
  background: #0f172a;
  border-radius: 9999px;
  display: flex;
  overflow: visible;
  position: relative;
  border: 1px solid var(--border-subtle);
}

.zone {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.zone-coin {
  background: rgba(100, 116, 139, 0.25);
  color: #94a3b8;
  border-right: 1px dashed rgba(255, 255, 255, 0.15);
}

.zone-weak {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border-right: 1px dashed rgba(255, 255, 255, 0.15);
}

.zone-target {
  background: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
}

.gauge-marker {
  position: absolute;
  top: -8px;
  bottom: -8px;
  width: 4px;
  transform: translateX(-50%);
  z-index: 10;
}

.marker-actual {
  background: #ef4444;
  box-shadow: 0 0 10px #ef4444;
}

.marker-target {
  background: #10b981;
  box-shadow: 0 0 10px #10b981;
}

.marker-label {
  position: absolute;
  top: -26px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
}

.marker-actual .marker-label {
  background: #ef4444;
  color: #fff;
}

.marker-target .marker-label {
  background: #10b981;
  color: #04101e;
}

/* 20 Seeds Visual Grid */
.seeds-visual-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 0.6rem;
  margin: 1.5rem 0 0.8rem;
  background: #0f172a;
  padding: 1.25rem;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
}

.seed-dot {
  aspect-ratio: 1;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-family: var(--font-mono);
  font-weight: 700;
  transition: transform 0.15s ease;
}

.seed-dot:hover {
  transform: scale(1.15);
}

.seed-dot.fail {
  background: rgba(239, 68, 68, 0.25);
  color: #f87171;
  border: 1px solid #ef4444;
}

.seed-dot.pass {
  background: rgba(16, 185, 129, 0.25);
  color: #34d399;
  border: 1px solid #10b981;
}

.seed-legend {
  display: flex;
  gap: 1.5rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

/* Explanation Cards inside Threshold */
.th-explanation {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-top: 1.25rem;
}

.th-box {
  background: rgba(15, 23, 42, 0.6);
  padding: 1.2rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.th-box strong {
  display: block;
  font-size: 0.85rem;
  margin-bottom: 0.45rem;
}

.th-box.why-chosen strong {
  color: var(--accent-cyan);
}

.th-box.what-happened strong {
  color: var(--accent-amber);
}

.th-box p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.table-subdesc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

@media (max-width: 860px) {
  .visual-story-strip {
    flex-direction: column;
  }
  .story-arrow {
    transform: rotate(90deg);
  }
  .th-explanation {
    grid-template-columns: 1fr;
  }
  .seeds-visual-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

/* ============================================================
   ANIMATED PIPELINE SIMULATOR (TAB 7)
   ============================================================ */
.highlight-tab {
  color: var(--accent-amber) !important;
  border-bottom-color: var(--accent-amber) !important;
  animation: pulseAmber 2.5s infinite ease-in-out;
}

@keyframes pulseAmber {
  0%, 100% { opacity: 0.9; }
  50% { opacity: 1; text-shadow: 0 0 10px rgba(245, 158, 11, 0.6); }
}

.sim-controls-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  background: var(--bg-card);
  padding: 1rem 1.5rem;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  margin-top: 0.5rem;
}

.sim-scenario-selector {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.88rem;
  font-weight: 600;
}

.btn-primary-sim {
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
  color: #04101e;
  border: none;
  font-weight: 700;
  font-size: 0.88rem;
  padding: 0.55rem 1.25rem;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(56, 189, 248, 0.3);
}

.btn-primary-sim:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(56, 189, 248, 0.5);
}

.btn-primary-sim:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary-sim {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  padding: 0.55rem 1rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-secondary-sim:hover {
  color: var(--text-primary);
  border-color: var(--text-muted);
}

/* Stages Flow */
.pipeline-tracker-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 2rem 1.5rem;
  margin: 1.5rem 0 2rem;
  position: relative;
  overflow-x: auto;
}

.pipeline-progress-bar-container {
  position: absolute;
  top: 52px;
  left: 5%;
  right: 5%;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 9999px;
  z-index: 1;
}

.pipeline-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-green));
  border-radius: 9999px;
  transition: width 0.4s ease, background 0.4s ease;
  box-shadow: 0 0 12px var(--accent-cyan);
}

.pipeline-progress-bar.stop-line {
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-red));
  box-shadow: 0 0 12px var(--accent-red);
}

.pipeline-progress-bar.redesign-line {
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-amber));
  box-shadow: 0 0 12px var(--accent-amber);
}

.pipeline-stages-flow {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  position: relative;
  z-index: 2;
  min-width: 760px;
}

.pipeline-stage-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 110px;
  transition: all 0.25s ease;
  opacity: 0.6;
}

.pipeline-stage-node.active-stage {
  opacity: 1;
  transform: scale(1.08);
}

.pipeline-stage-node.completed-stage {
  opacity: 1;
}

.stage-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #0f172a;
  border: 3px solid #334155;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin-bottom: 0.6rem;
  transition: all 0.3s ease;
}

.active-stage .stage-circle {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.6);
  animation: stagePulse 1.5s infinite;
}

@keyframes stagePulse {
  0%, 100% { box-shadow: 0 0 10px rgba(56, 189, 248, 0.4); }
  50% { box-shadow: 0 0 20px rgba(56, 189, 248, 0.8); }
}

.completed-stage .stage-circle {
  border-color: var(--accent-green);
  background: rgba(16, 185, 129, 0.15);
}

.stop-stage .stage-circle {
  border-color: var(--accent-red) !important;
  background: rgba(239, 68, 68, 0.2) !important;
  box-shadow: 0 0 18px var(--accent-red) !important;
  animation: shakeStop 0.4s ease;
}

.redesign-stage .stage-circle {
  border-color: var(--accent-amber) !important;
  background: rgba(245, 158, 11, 0.2) !important;
  box-shadow: 0 0 18px var(--accent-amber) !important;
}

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

.stage-num {
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.stage-status-icon {
  display: none;
  font-size: 1rem;
}

.completed-stage .stage-num { display: none; }
.completed-stage .stage-status-icon { display: inline-block; }

.stop-stage .stage-num { display: none; }
.stop-stage .stage-status-icon { display: inline-block; }

.redesign-stage .stage-num { display: none; }
.redesign-stage .stage-status-icon { display: inline-block; }

.stage-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.15rem;
}

.stage-subtitle {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* Inspection Grid */
.sim-inspection-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.sim-stage-detail-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
}

.detail-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.detail-header h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
}

.sim-anim-graphic {
  background: #0a0f1d;
  border-radius: 12px;
  padding: 2rem 1.5rem;
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.05);
  margin-bottom: 1.25rem;
}

.anim-pulse-box {
  text-align: center;
}

.graphic-icon {
  font-size: 2.5rem;
  margin-bottom: 0.6rem;
}

.graphic-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
  max-width: 380px;
  margin: 0 auto;
  line-height: 1.5;
}

.sim-stage-desc h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent-cyan);
  margin-bottom: 0.35rem;
}

.sim-stage-desc p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

/* Terminal View */
.sim-terminal-card {
  background: #050811;
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: var(--font-mono);
}

.terminal-header {
  background: #0e1526;
  padding: 0.65rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.terminal-dots {
  display: flex;
  gap: 0.35rem;
}

.tdot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.tdot-red { background: #ef4444; }
.tdot-yellow { background: #f59e0b; }
.tdot-green { background: #10b981; }

.terminal-title {
  font-size: 0.76rem;
  color: var(--text-muted);
}

.btn-term-clear {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.72rem;
  cursor: pointer;
}

.btn-term-clear:hover {
  color: var(--text-primary);
}

.terminal-body {
  padding: 1rem;
  flex: 1;
  min-height: 320px;
  max-height: 380px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.82rem;
}

.term-line {
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-all;
}

.info-line { color: var(--accent-cyan); }
.muted-line { color: var(--text-muted); }
.success-line { color: #34d399; font-weight: 600; }
.error-line { color: #f87171; font-weight: 700; background: rgba(239, 68, 68, 0.1); padding: 0.15rem 0.3rem; border-radius: 4px; }
.warn-line { color: #fbbf24; font-weight: 600; }

@media (max-width: 860px) {
  .sim-inspection-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   Iteration Matrix & Root Cause Analysis Component Styles
   ============================================================ */
.iteration-matrix-section {
  margin-bottom: 3.5rem;
}

.matrix-header {
  margin-bottom: 1.75rem;
}

.matrix-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.12);
  color: var(--accent-cyan);
  border: 1px solid rgba(56, 189, 248, 0.3);
  margin-bottom: 0.75rem;
}

.matrix-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.matrix-desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.iteration-matrix-grid {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.iteration-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 1.75rem;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.iteration-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 5px;
}

.iteration-card.status-stop::before { background: var(--accent-red); }
.iteration-card.status-redesign::before { background: var(--accent-amber); }
.iteration-card.status-warn::before { background: #eab308; }
.iteration-card.status-pass::before { background: var(--accent-green); }

.iteration-card-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-subtle);
}

.iteration-title-group {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.iteration-gen-tag {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent-cyan);
}

.iteration-card-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
}

.iteration-badge {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.35rem 0.85rem;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.iteration-badge.status-stop {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.iteration-badge.status-redesign {
  background: rgba(245, 158, 11, 0.15);
  color: #fcd34d;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.iteration-badge.status-warn {
  background: rgba(234, 179, 8, 0.15);
  color: #fef08a;
  border: 1px solid rgba(234, 179, 8, 0.3);
}

.iteration-badge.status-pass {
  background: rgba(16, 185, 129, 0.15);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.iteration-formula-box {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 0.85rem 1.2rem;
  margin-bottom: 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: #cbd5e1;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  overflow-x: auto;
}

.iteration-formula-label {
  font-weight: 700;
  color: var(--accent-cyan);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.iteration-cols-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}

.iter-box {
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  padding: 1.15rem;
}

.iter-box-title {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.iter-box.failure .iter-box-title { color: #f87171; }
.iter-box.root-cause .iter-box-title { color: #38bdf8; }
.iter-box.decision .iter-box-title { color: #4ade80; }

.iter-box p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin: 0;
}

.iter-adr-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  margin-top: 0.6rem;
  color: var(--accent-green);
}

/* ============================================================
   REAL-WORLD OPERATIONS & MATHEMATICAL FORMULATION STYLES
   ============================================================ */
.operations-math-section {
  margin-top: 2.5rem;
  margin-bottom: 2rem;
}

.ladder-container {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 1.5rem;
  margin-top: 1rem;
  box-shadow: var(--shadow-md);
}

.ladder-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.ladder-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent-cyan);
  border: 1px solid rgba(56, 189, 248, 0.3);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.3rem 0.75rem;
  border-radius: 9999px;
}

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

.ladder-steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.ladder-step {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.ladder-step:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.15);
}

.ladder-step.active-focus {
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.08) 0%, rgba(15, 23, 42, 0.8) 100%);
  border: 1px solid rgba(245, 158, 11, 0.4);
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.12);
}

.ladder-step-num {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-cyan);
  margin-bottom: 0.35rem;
}

.ladder-step.active-focus .ladder-step-num {
  color: var(--accent-amber);
}

.ladder-step-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.6rem;
}

.ladder-step-icon {
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
}

.ladder-step .text-dynamic {
  font-size: 0.84rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

.formula-box {
  background: rgba(10, 15, 29, 0.85);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 6px;
  padding: 0.65rem 0.85rem;
  margin-bottom: 0.85rem;
  overflow-x: auto;
}

.formula-box code {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--accent-cyan);
  display: block;
  white-space: nowrap;
}
