/* ── Product Simulator — Jablotron Design System ── */
/* Mirrors jablotron.com: Roboto type, yellow primary #ffcf00 with dark text */

:root {
  /* Jablotron brand */
  --c-brand: #ffcf00;          /* primary yellow */
  --c-brand-hover: #f2ae00;    /* darker gold for hover */
  --c-brand-pale: #fffad4;     /* pale yellow for tints */
  --c-brand-text: #35301b;     /* dark brown-black that pairs with yellow */

  /* Neutrals (Jablotron gray scale — shifted one step darker for contrast) */
  --c-dark: #231f20;
  --c-body: #3d4350;   /* primary body text — WCAG AAA on white */
  --c-muted: #5a6675;  /* secondary text — WCAG AA on white (7.7:1) */
  --c-light: #c7ccd3;
  --c-border: #d7dbe1;  /* slightly more visible than gray-300 */
  --c-pale: #f4f5f6;
  --c-bg: #f4f5f6;     /* page background — Jablotron gray-200, so white cards pop */
  --c-white: #ffffff;

  /* Semantic (Jablotron palette) */
  --c-red: #e40032;
  --c-green: #19b42e;
  --c-orange: #ff5700;
  --c-blue: #1971c2;
  --c-purple: #9d27c6;         /* used as rare secondary accent */

  /* Legacy aliases kept so older JS inline refs keep working */
  --c-lavender: var(--c-brand-pale);
  --c-purple-text: var(--c-brand-text);
  --c-sage: #C8D5B9;

  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;

  --radius: 6px;
  --radius-lg: 10px;

  --shadow-sm: 0 1px 3px rgba(35, 31, 32, 0.08);
  --shadow-md: 0 4px 12px rgba(35, 31, 32, 0.10);
  --shadow-lg: 0 8px 24px rgba(35, 31, 32, 0.14);
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Roboto', 'Helvetica Neue', Arial, sans-serif;
  font-size: 16px;
  color: var(--c-body);
  background: var(--c-bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 {
  font-family: 'Roboto', 'Helvetica Neue', Arial, sans-serif;
  color: var(--c-dark);
  font-weight: 700;
  letter-spacing: -0.01em;
}

h1 { font-size: 2rem; letter-spacing: -0.02em; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.1rem; font-weight: 500; }

/* ── Navigation ── */
#nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-xl);
  background: var(--c-white);
  border-bottom: 1px solid rgba(0,0,0,0.06);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: 'Roboto', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--c-dark);
  text-decoration: none;
  transition: opacity 0.15s;
}

.nav-brand:hover { opacity: 0.7; }

.brand-icon { font-size: 1.4rem; }

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--c-brand);
  color: var(--c-brand-text);
  font-weight: 900;
  font-size: 1.1rem;
  border-radius: 4px;
  letter-spacing: 0;
}

.nav-tabs {
  display: flex;
  gap: var(--space-xs);
  background: var(--c-bg);
  padding: 4px;
  border-radius: var(--radius);
}

.nav-tab {
  padding: var(--space-sm) var(--space-lg);
  font-family: 'Roboto', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--c-muted);
  text-decoration: none;
  border-radius: 6px;
  transition: all 0.2s;
}

.nav-tab:hover { color: var(--c-dark); }
.nav-tab.active {
  background: var(--c-brand);
  color: var(--c-brand-text);
  box-shadow: var(--shadow-sm);
  font-weight: 700;
}

.nav-meta {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.lang-switcher {
  display: inline-flex;
  border: 1px solid var(--c-border);
  border-radius: 6px;
  overflow: hidden;
  margin-right: var(--space-sm);
}

.lang-btn {
  padding: 4px 10px;
  font-family: 'Roboto Mono', monospace;
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--c-white);
  color: var(--c-muted);
  border: none;
  cursor: pointer;
  transition: all 0.15s;
}

.lang-btn:hover { color: var(--c-dark); }
.lang-btn.active { background: var(--c-brand); color: var(--c-brand-text); }

/* ── Pills / Badges ── */
.pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 4px 12px;
  font-family: 'Roboto Mono', monospace;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 20px;
  background: var(--c-brand-pale);
  color: var(--c-brand-text);
}

.pill-purple { background: var(--c-brand); color: var(--c-brand-text); }
.pill-green { background: var(--c-green); color: white; }
.pill-red { background: var(--c-red); color: white; }

/* ── Main Content ── */
#main {
  padding: var(--space-xl);
  max-width: 1400px;
  margin: 0 auto;
}

.view { display: none; }
.view.active { display: block; }

/* ── Cards ── */
.card {
  background: var(--c-white);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-sm);
  border-top: 3px solid var(--c-brand);
}

.card.red { border-top-color: var(--c-red); }
.card.green { border-top-color: var(--c-green); }
.card.blue { border-top-color: var(--c-blue); }
.card.orange { border-top-color: var(--c-orange); }
.card.neutral { border-top-color: var(--c-muted); }

.card h3 {
  font-size: 0.9rem;
  margin-bottom: var(--space-sm);
}

.card p {
  font-size: 0.85rem;
  line-height: 1.6;
}

/* ── KPI Cards ── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-md);
}

.kpi-card {
  background: var(--c-white);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-sm);
  text-align: center;
}

.kpi-card .kpi-value {
  font-family: 'Roboto', sans-serif;
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--c-dark);
  margin: var(--space-sm) 0;
}

.kpi-card .kpi-label {
  font-size: 0.8rem;
  color: var(--c-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-family: 'Roboto Mono', monospace;
}

.kpi-card .kpi-delta {
  font-size: 0.85rem;
  font-weight: 600;
  margin-top: var(--space-xs);
}

.kpi-delta.up { color: var(--c-green); }
.kpi-delta.down { color: var(--c-red); }
.kpi-delta.neutral { color: var(--c-muted); }

/* ── Sparklines (inline SVG) ── */
.sparkline { display: inline-block; vertical-align: middle; }

/* ── Funnel ── */
.funnel {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.funnel-step {
  display: grid;
  grid-template-columns: 170px 1fr 150px;
  align-items: center;
  gap: var(--space-md);
}

.funnel-track {
  height: 36px;
  background: rgba(0, 0, 0, 0.04);
  border-radius: var(--radius);
  overflow: hidden;
}

.funnel-bar {
  height: 100%;
  background: var(--c-brand);
  border-radius: var(--radius);
  transition: width 0.6s ease;
  min-width: 40px;
  display: flex;
  align-items: center;
  padding: 0 var(--space-md);
  color: var(--c-brand-text);
  font-size: 0.8rem;
  font-weight: 700;
}

.funnel-label {
  font-size: 0.85rem;
  color: var(--c-dark);
}

.funnel-pct {
  font-size: 0.8rem;
  color: var(--c-muted);
  font-family: 'Roboto Mono', monospace;
  white-space: nowrap;
}

.funnel-drop {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.75rem;
  margin-left: var(--space-xs);
}

.funnel-drop.drop-high { background: rgba(224, 49, 49, 0.15); color: var(--c-red); }
.funnel-drop.drop-med { background: rgba(240, 140, 0, 0.15); color: var(--c-orange); }
.funnel-drop.drop-low { background: rgba(0, 0, 0, 0.06); color: var(--c-muted); }

/* ── Segment Cards ── */
.segment-card h3 {
  font-size: 1rem;
  margin-bottom: var(--space-xs);
}

.segment-share {
  font-family: 'Roboto Mono', monospace;
  font-size: 0.75rem;
  color: var(--c-muted);
  margin-bottom: var(--space-md);
}

.segment-section-label {
  font-family: 'Roboto Mono', monospace;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--c-muted);
  margin-bottom: var(--space-sm);
  border-top: 1px solid var(--c-border);
  padding-top: var(--space-sm);
}

.segment-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-sm) var(--space-md);
}

.segment-grid > div { padding: 2px 0; }

.segment-grid .kpi-label {
  font-size: 0.7rem;
  letter-spacing: 0.06em;
}

.segment-val {
  font-family: 'Roboto', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--c-dark);
  line-height: 1.2;
}

.segment-val.up { color: var(--c-green); }
.segment-val.down { color: var(--c-red); }
.segment-val.neutral { color: var(--c-dark); }

.segment-unit {
  font-size: 0.7rem;
  color: var(--c-muted);
  font-weight: 400;
  margin-left: 2px;
}

.segment-lifetime {
  font-family: 'Roboto Mono', monospace;
  font-size: 0.7rem;
  color: var(--c-muted);
  margin-top: var(--space-sm);
}

/* ── Cohort Heatmap ── */
.cohort-grid {
  display: grid;
  gap: 2px;
  font-size: 0.7rem;
  font-family: 'Roboto Mono', monospace;
}

.cohort-cell {
  padding: 6px 4px;
  text-align: center;
  border-radius: 3px;
  transition: background 0.3s;
}

.cohort-header {
  font-weight: 500;
  color: var(--c-muted);
  background: transparent;
}

/* ── Decision Cards ── */
.decision-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-md);
}

.decision-card {
  background: var(--c-white);
  border: 2px solid rgba(0,0,0,0.06);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  cursor: pointer;
  transition: all 0.2s;
}

.decision-card:hover {
  border-color: var(--c-brand);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.decision-card.selected {
  border-color: var(--c-brand);
  background: var(--c-brand-pale);
  box-shadow: 0 0 0 3px rgba(255, 207, 0, 0.3);
}

.decision-card h3 { margin-bottom: var(--space-sm); }

.decision-card .meta {
  display: flex;
  gap: var(--space-sm);
  margin-top: var(--space-md);
  flex-wrap: wrap;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-xl);
  font-family: 'Roboto', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--c-brand);
  color: var(--c-brand-text);
}
.btn-primary:hover { background: var(--c-brand-hover); color: var(--c-brand-text); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-secondary {
  background: var(--c-white);
  color: var(--c-dark);
  border: 1px solid var(--c-border);
}
.btn-secondary:hover { background: var(--c-pale); border-color: var(--c-brand); }

.btn-success { background: var(--c-green); color: white; }
.btn-danger { background: var(--c-red); color: white; }

/* ── Game UI ── */
.game-question {
  text-align: center;
  padding: var(--space-2xl);
}

.game-question h2 {
  font-size: 1.6rem;
  margin-bottom: var(--space-xl);
}

.game-options {
  display: flex;
  justify-content: center;
  gap: var(--space-md);
  flex-wrap: wrap;
}

.game-btn {
  padding: var(--space-md) var(--space-2xl);
  font-family: 'Roboto', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  border: 2px solid rgba(0,0,0,0.1);
  border-radius: var(--radius-lg);
  background: var(--c-white);
  cursor: pointer;
  transition: all 0.2s;
  min-width: 180px;
}

.game-btn:hover { border-color: var(--c-brand); transform: translateY(-2px); }
.game-btn.correct { background: var(--c-green); color: white; border-color: var(--c-green); }
.game-btn.wrong { background: var(--c-red); color: white; border-color: var(--c-red); }

.game-score {
  text-align: center;
  margin-top: var(--space-xl);
  font-family: 'Roboto Mono', monospace;
  font-size: 0.9rem;
  color: var(--c-muted);
}

.game-progress {
  width: 100%;
  height: 4px;
  background: var(--c-lavender);
  border-radius: 2px;
  margin-bottom: var(--space-xl);
}

.game-progress-bar {
  height: 100%;
  background: var(--c-brand);
  border-radius: 2px;
  transition: width 0.3s;
}

/* ── Leaderboard ── */
.leaderboard {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.leaderboard-row {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  background: var(--c-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.leaderboard-row.first {
  background: linear-gradient(135deg, var(--c-lavender), var(--c-white));
  border: 2px solid var(--c-brand);
}

.leaderboard-rank {
  font-family: 'Roboto', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--c-brand);
  min-width: 2rem;
}

.leaderboard-team {
  flex: 1;
  font-weight: 600;
}

.leaderboard-score {
  font-family: 'Roboto Mono', monospace;
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--c-dark);
}

/* ── Section Headers ── */
.section-header {
  margin-bottom: var(--space-xl);
}

.section-header h2 {
  margin-bottom: var(--space-xs);
}

.section-header .subtitle {
  font-size: 0.9rem;
  color: var(--c-muted);
}

/* ── Utility ── */
.center-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  text-align: center;
  color: var(--c-muted);
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-md); }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: var(--space-md); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-md); }

.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.ml-md { margin-left: var(--space-md); }

.text-center { text-align: center; }
.text-muted { color: var(--c-muted); }
.text-purple { color: var(--c-brand); }
.text-red { color: var(--c-red); }
.text-green { color: var(--c-green); }
.font-mono { font-family: 'Roboto Mono', monospace; }

/* ── Embed Mode (when loaded inside reveal.js iframe) ── */
body.embed-mode #nav { display: none; }
body.embed-mode #main { padding: var(--space-md); max-width: 100%; }

/* ── Dashboard Tabs ── */
.dash-tabs {
  display: inline-flex;
  gap: var(--space-xs);
  background: var(--c-white);
  padding: 4px;
  border-radius: var(--radius);
}

.dash-tab {
  padding: var(--space-sm) var(--space-lg);
  font-family: 'Roboto', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--c-muted);
  border: none;
  background: none;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s;
}

.dash-tab:hover { color: var(--c-dark); }
.dash-tab.active {
  background: var(--c-brand);
  color: var(--c-brand-text);
  font-weight: 700;
}

/* ── Scoring Table ── */
.scoring-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.scoring-table thead tr {
  background: var(--c-brand);
  color: var(--c-brand-text);
  font-family: 'Roboto', sans-serif;
  font-weight: 700;
}

.scoring-table th,
.scoring-table td {
  padding: 12px;
}

.scoring-table th { text-align: center; }
.scoring-table th:first-child { text-align: left; border-radius: var(--radius) 0 0 0; }
.scoring-table th:last-child { border-radius: 0 var(--radius) 0 0; }
.scoring-table th.col-score { width: 100px; }
.scoring-table th.col-dim { width: 80px; }

.scoring-table td { text-align: center; }
.scoring-table td:first-child { text-align: left; }

.scoring-table tr:nth-child(even) { background: var(--c-lavender); }
.scoring-table tr:nth-child(odd) { background: white; }

.scoring-table .feature-desc {
  font-size: 0.8rem;
}

.scoring-table .feature-meta {
  font-size: 0.7rem;
}

.score-input {
  width: 50px;
  text-align: center;
  padding: 6px;
  border: 1px solid var(--c-muted);
  border-radius: 4px;
  font-size: 1rem;
}

.ice-score {
  font-weight: 700;
  font-size: 1.2rem;
}

/* ── Ship / Iterate / Kill Cards ── */
.ship-card { border-top: 3px solid var(--c-green); }
.ship-card h3 { color: var(--c-green); }
.iterate-card { border-top: 3px solid var(--c-orange); }
.iterate-card h3 { color: var(--c-orange); }
.kill-card { border-top: 3px solid var(--c-red); }
.kill-card h3 { color: var(--c-red); }

/* ── Results ── */
.result-card-sig { border: 2px solid var(--c-green); }
.result-card-nonsig { border: 2px solid var(--c-muted); }
.result-pvalue { font-size: 0.8rem; }
.result-findings { font-size: 0.9rem; line-height: 1.8; }
.result-recommendation { font-weight: 600; }

/* ── Results Timeline ── */
.timeline { display: flex; gap: var(--space-md); align-items: center; }
.timeline-step { flex: 1; text-align: center; }
.timeline-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  margin: 0 auto var(--space-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-family: 'Roboto', sans-serif;
}
.timeline-circle.done {
  background: var(--c-brand);
  color: var(--c-brand-text);
  border: 2px solid var(--c-brand);
}
.timeline-circle.current {
  background: var(--c-lavender);
  color: var(--c-brand);
  border: 2px solid var(--c-brand);
}
.timeline-circle.future {
  background: rgba(0,0,0,0.05);
  color: var(--c-muted);
  border: 2px solid rgba(0,0,0,0.1);
}
.timeline-label { font-size: 0.75rem; }
.timeline-label.done { color: var(--c-dark); }
.timeline-label.pending { color: var(--c-muted); }
.timeline-decision { font-size: 0.7rem; color: var(--c-brand); margin-top: 2px; }
.timeline-connector {
  flex: 0 0 40px;
  height: 2px;
  margin-top: -20px;
}
.timeline-connector.done { background: var(--c-brand); }
.timeline-connector.pending { background: rgba(0,0,0,0.1); }

/* ── Review / Quarter Summary ── */
.review-journey {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}
.review-step {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}
.review-checklist {
  margin-top: var(--space-md);
  padding-left: var(--space-xl);
  font-size: 0.95rem;
  line-height: 2;
}

/* ── Guardrails ── */
.guardrail-label { font-size: 0.85rem; }

/* ── Game Score Badges (Home) ── */
.game-shortcut-card {
  text-decoration: none;
  text-align: center;
  cursor: pointer;
}
.game-score-badge {
  display: inline-block;
  padding: 2px 12px;
  background: var(--c-brand);
  color: var(--c-brand-text);
  border-radius: 20px;
  font-family: 'Roboto Mono', monospace;
  font-size: 0.8rem;
  font-weight: 700;
}

/* ── Decide View ── */
.decide-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  justify-content: space-between;
}
.kr-pill-bad { font-size: 0.65rem; }
.kr-pill-ok { font-size: 0.65rem; }
.kr-label { font-size: 0.85rem; }

.kr-reason {
  font-size: 0.75rem;
  color: var(--c-body);
  font-style: italic;
  margin-top: var(--space-xs);
  line-height: 1.4;
}

.kr-reason-good { color: var(--c-green); font-style: normal; }

/* ── Journey Callout (on Results page) ── */
.journey-callout {
  background: var(--c-lavender);
  border-left: 3px solid var(--c-brand);
  padding: var(--space-md) var(--space-lg);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.journey-callout-title {
  font-family: 'Roboto', sans-serif;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--c-purple-text);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-sm);
}

.journey-callout-list {
  margin: 0;
  padding-left: var(--space-lg);
  font-size: 0.9rem;
  line-height: 1.6;
}

.journey-callout-list li {
  margin-bottom: var(--space-xs);
}

/* ── Analysis (Guided Data Diagnosis) ── */
.analysis-progress {
  width: 100%;
  height: 4px;
  background: var(--c-lavender);
  border-radius: 2px;
  margin-bottom: var(--space-md);
}

.analysis-progress-bar {
  height: 100%;
  background: var(--c-brand);
  border-radius: 2px;
  transition: width 0.4s ease;
}

.analysis-step-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-md);
}

.analysis-card h3 {
  font-size: 1.15rem;
  line-height: 1.5;
  margin-bottom: var(--space-md);
}

.analysis-data {
  background: var(--c-lavender);
  border-radius: var(--radius);
  padding: var(--space-lg);
  margin: var(--space-md) 0 var(--space-lg);
}

.analysis-data .funnel-label { min-width: 170px; }

.analysis-data .cohort-row-label {
  text-align: left;
  font-size: 0.75rem;
}

.analysis-chart-caption {
  font-size: 0.75rem;
}

.analysis-table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'Roboto Mono', monospace;
}

.analysis-table th,
.analysis-table td {
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}

.analysis-table th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--c-muted);
}

.analysis-table td.cohort-w2 {
  font-weight: 600;
  color: var(--c-dark);
}

.analysis-segments {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
  background: transparent;
  padding: 0;
}

.analysis-seg-card {
  background: white;
  border-radius: var(--radius);
  padding: var(--space-md);
  box-shadow: var(--shadow-sm);
}

.analysis-seg-card .small { font-size: 0.75rem; margin-top: 4px; }

.analysis-seg-econ {
  font-family: 'Roboto Mono', monospace;
  font-size: 0.72rem;
  color: var(--c-body);
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--c-border);
  line-height: 1.5;
}

.analysis-options {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.analysis-option {
  text-align: left;
  padding: var(--space-md) var(--space-lg);
  font-family: 'Roboto', sans-serif;
  font-size: 0.95rem;
  background: white;
  border: 2px solid rgba(0,0,0,0.08);
  border-radius: var(--radius);
  color: var(--c-dark);
  cursor: pointer;
  transition: all 0.15s;
}

.analysis-option:hover:not(:disabled) {
  border-color: var(--c-brand);
  background: var(--c-lavender);
}

.analysis-option:disabled { cursor: default; }

.analysis-option.correct {
  border-color: var(--c-green);
  background: rgba(91,158,91,0.1);
  color: var(--c-dark);
}

.analysis-option.wrong {
  border-color: var(--c-red);
  background: rgba(224,49,49,0.08);
  color: var(--c-dark);
}

.analysis-option.dim { opacity: 0.5; }

.analysis-explanation {
  background: var(--c-lavender);
  border-left: 3px solid var(--c-brand);
  padding: var(--space-md) var(--space-lg);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 0.95rem;
  line-height: 1.6;
}

.analysis-explanation p { font-size: 0.95rem; }

.analysis-ul {
  margin: var(--space-sm) 0 var(--space-sm) var(--space-lg);
  line-height: 1.8;
}

/* ── Segment Trap (Simpson's paradox / guardrail breakdowns) ── */
.segment-trap-card {
  border-top: 3px solid var(--c-orange);
  background: rgba(240, 140, 0, 0.04);
}

.trap-banner {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: 'Roboto', sans-serif;
  font-size: 0.95rem;
  color: var(--c-dark);
  flex-wrap: wrap;
}

.trap-banner-inline {
  font-family: 'Roboto', sans-serif;
  font-size: 0.9rem;
  color: var(--c-dark);
}

.trap-icon {
  font-size: 1.2rem;
  color: var(--c-orange);
}

.trap-banner .small {
  font-size: 0.8rem;
  margin-left: auto;
}

.segment-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  font-family: 'Roboto Mono', monospace;
}

.segment-table th,
.segment-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.segment-table th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--c-muted);
  background: transparent;
}

.seg-row.seg-win { background: rgba(91, 158, 91, 0.08); }
.seg-row.seg-modest { background: rgba(240, 140, 0, 0.06); }
.seg-row.seg-regression { background: rgba(224, 49, 49, 0.10); }
.seg-row.seg-regression td { color: var(--c-red); font-weight: 500; }

/* ── Hypothesis Form ── */
.hypothesis-card { border-top-color: var(--c-blue); }

.hypothesis-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.hypothesis-row {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
  font-size: 0.95rem;
}

.hypothesis-row label {
  font-family: 'Roboto', sans-serif;
  font-weight: 600;
  color: var(--c-brand);
  min-width: 60px;
}

.hypothesis-row-stack {
  flex-direction: column;
  align-items: stretch;
  gap: var(--space-sm);
}

.hypothesis-row input[type="text"],
.hypothesis-row select,
.hypothesis-row textarea {
  font-family: 'Roboto', sans-serif;
  font-size: 0.95rem;
  padding: var(--space-sm) var(--space-md);
  border: 2px solid var(--c-lavender);
  border-radius: var(--radius);
  background: white;
  color: var(--c-dark);
  outline: none;
  transition: border-color 0.15s;
}

.hypothesis-row input[type="text"]:focus,
.hypothesis-row select:focus,
.hypothesis-row textarea:focus {
  border-color: var(--c-brand);
}

.hypothesis-row input[type="text"] { flex: 1; min-width: 200px; }
.hypothesis-row textarea { width: 100%; resize: vertical; font-family: 'Roboto', sans-serif; }
.hypothesis-row select { font-family: 'Roboto', sans-serif; }
.hypothesis-magnitude { width: 100px; flex: 0 0 auto !important; }

/* ── AI Hypothesis Feedback ── */
.ai-feedback-card {
  border-top: 3px solid var(--c-brand);
  background: var(--c-white);
}

.ai-loading {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) 0;
}

.ai-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--c-border);
  border-top-color: var(--c-brand);
  border-radius: 50%;
  animation: ai-spin 0.8s linear infinite;
  flex-shrink: 0;
}

@keyframes ai-spin { to { transform: rotate(360deg); } }

.ai-coach-note {
  background: var(--c-brand-pale);
  border-left: 3px solid var(--c-brand);
  padding: var(--space-md) var(--space-lg);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.ai-coach-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--c-brand-text);
  margin-bottom: var(--space-xs);
}

.ai-coach-note p:last-child {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--c-dark);
}

.ai-dimensions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}

.ai-dim {
  background: var(--c-pale);
  border-radius: var(--radius);
  padding: var(--space-md);
}

.ai-dim-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-sm);
}

.ai-dim-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--c-dark);
}

.ai-dim-score {
  font-family: 'Roboto Mono', monospace;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
}

.ai-dim-score.score-good { background: rgba(25, 180, 46, 0.12); color: var(--c-green); }
.ai-dim-score.score-mid { background: rgba(255, 87, 0, 0.12); color: var(--c-orange); }
.ai-dim-score.score-weak { background: rgba(228, 0, 50, 0.12); color: var(--c-red); }

.ai-dim-feedback {
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--c-body);
}

.ai-rewrite {
  background: var(--c-pale);
  border-radius: var(--radius);
  padding: var(--space-md) var(--space-lg);
}

.ai-rewrite-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--c-muted);
  margin-bottom: var(--space-xs);
}

.ai-rewrite-body {
  font-size: 0.95rem;
  line-height: 1.6;
  font-style: italic;
  color: var(--c-dark);
}

.ai-offline {
  border-top-color: var(--c-muted);
}

/* ── Round 3 Interpretation Gate ── */
.interpret-card {
  border-top-color: var(--c-orange);
}

.interpret-textarea {
  width: 100%;
  min-height: 120px;
  padding: var(--space-md);
  font-family: 'Roboto', sans-serif;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--c-dark);
  background: white;
  border: 2px solid var(--c-border);
  border-radius: var(--radius);
  outline: none;
  resize: vertical;
  transition: border-color 0.15s;
}

.interpret-textarea:focus {
  border-color: var(--c-brand);
}

.interpret-textarea:disabled {
  background: var(--c-pale);
  cursor: not-allowed;
}

/* ── Share (Round 4) + Facilitator View ── */
.share-card { border-top-color: var(--c-blue); }

.share-row {
  display: flex;
  gap: var(--space-md);
  align-items: stretch;
}

.share-textarea {
  flex: 1;
  min-height: 80px;
  padding: var(--space-sm) var(--space-md);
  font-family: 'Roboto Mono', monospace;
  font-size: 0.75rem;
  color: var(--c-body);
  background: var(--c-pale);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  resize: vertical;
}

.share-copied {
  margin-top: var(--space-sm);
  color: var(--c-green);
  font-size: 0.85rem;
  font-weight: 600;
}

/* Facilitator */
.fac-paste {
  width: 100%;
  padding: var(--space-md);
  font-family: 'Roboto Mono', monospace;
  font-size: 0.8rem;
  color: var(--c-body);
  background: var(--c-white);
  border: 2px solid var(--c-border);
  border-radius: var(--radius);
  resize: vertical;
  outline: none;
}

.fac-paste:focus { border-color: var(--c-brand); }

.fac-actions {
  display: flex;
  align-items: center;
}

.fac-status { font-size: 0.85rem; }

.fac-dist-row {
  display: grid;
  grid-template-columns: 1fr 2fr 40px;
  align-items: center;
  gap: var(--space-sm);
  padding: 6px 0;
  border-bottom: 1px solid var(--c-pale);
}

.fac-dist-row:last-child { border-bottom: none; }

.fac-dist-label {
  font-size: 0.85rem;
  color: var(--c-dark);
}

.fac-dist-bar-wrap {
  height: 8px;
  background: var(--c-pale);
  border-radius: 4px;
  overflow: hidden;
}

.fac-dist-bar {
  height: 100%;
  background: var(--c-brand);
  transition: width 0.4s ease;
}

.fac-dist-count {
  font-family: 'Roboto Mono', monospace;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--c-brand-text);
  text-align: right;
}

.fac-table-wrap {
  overflow-x: auto;
  background: var(--c-white);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  padding: var(--space-sm);
  box-shadow: var(--shadow-sm);
}

.fac-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  font-family: 'Roboto', sans-serif;
}

.fac-table th,
.fac-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--c-pale);
  vertical-align: top;
}

.fac-table th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--c-muted);
  font-weight: 700;
  border-bottom: 2px solid var(--c-border);
  white-space: nowrap;
}

.fac-table tr:last-child td { border-bottom: none; }

.fac-table tbody tr:hover { background: var(--c-pale); }

.fac-cell-wide { max-width: 280px; }

/* ── Facilitator live controls ── */
.fac-code-row {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.fac-code-label {
  font-family: 'Roboto', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--c-dark);
}

.fac-code-input {
  padding: var(--space-sm) var(--space-md);
  font-family: 'Roboto Mono', monospace;
  font-size: 0.9rem;
  border: 2px solid var(--c-border);
  border-radius: var(--radius);
  background: white;
  color: var(--c-dark);
  outline: none;
  min-width: 200px;
}

.fac-code-input:focus { border-color: var(--c-brand); }

.fac-share-link {
  font-size: 0.9rem;
  color: var(--c-body);
}

.fac-share-link code {
  background: var(--c-brand-pale);
  color: var(--c-brand-text);
  padding: 4px 10px;
  border-radius: 4px;
  font-family: 'Roboto Mono', monospace;
  font-size: 0.85rem;
  user-select: all;
}

.fac-paste-details summary {
  cursor: pointer;
  color: var(--c-muted);
  font-size: 0.9rem;
  padding: var(--space-sm) 0;
}

.fac-paste-details summary:hover { color: var(--c-dark); }

.fac-paste-details[open] summary {
  color: var(--c-dark);
  font-weight: 600;
}

.fac-live-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-md);
}

.fac-live-header h3 { margin: 0; }

/* ── Round control (facilitator) ── */
.fac-round-card { border-top-color: var(--c-brand); }

.fac-round-buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
}

.fac-round-btn {
  position: relative;
  padding: var(--space-md);
  background: var(--c-white);
  border: 2px solid var(--c-border);
  border-radius: var(--radius-lg);
  font-family: 'Roboto', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--c-dark);
  cursor: pointer;
  transition: all 0.15s;
  text-align: left;
}

.fac-round-btn:hover {
  border-color: var(--c-brand);
  box-shadow: var(--shadow-sm);
}

.fac-round-btn.active {
  background: var(--c-brand);
  color: var(--c-brand-text);
  border-color: var(--c-brand);
}

.fac-round-btn.active:hover { cursor: default; }

.fac-round-btn.far { opacity: 0.6; }

.fac-round-num {
  display: block;
  font-size: 1rem;
  font-weight: 700;
}

.fac-round-tag,
.fac-round-tag-next {
  display: inline-block;
  margin-top: 4px;
  padding: 2px 8px;
  border-radius: 10px;
  font-family: 'Roboto Mono', monospace;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
}

.fac-round-tag {
  background: rgba(0, 0, 0, 0.15);
  color: var(--c-brand-text);
}

.fac-round-tag-next {
  background: var(--c-brand-pale);
  color: var(--c-brand-text);
  border: 1px dashed var(--c-brand);
}

/* ── Waiting room (team side, gated on Results) ── */
.waiting-card {
  display: inline-block;
  padding: var(--space-xl) var(--space-2xl);
  background: var(--c-white);
  border: 2px dashed var(--c-brand);
  border-radius: var(--radius-lg);
  text-align: center;
}

.waiting-spinner {
  display: inline-block;
  width: 32px;
  height: 32px;
  border: 3px solid var(--c-border);
  border-top-color: var(--c-brand);
  border-radius: 50%;
  animation: waiting-spin 1s linear infinite;
  margin-bottom: var(--space-md);
}

@keyframes waiting-spin {
  to { transform: rotate(360deg); }
}

.waiting-title {
  font-family: 'Roboto', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--c-dark);
  margin-bottom: var(--space-sm);
}

.waiting-card .small { font-size: 0.85rem; }

.fac-truncate {
  display: inline-block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  cursor: help;
}

/* ── Hypothesis Recap (shown in Round 3 + Round 4) ── */
.hypothesis-recap { border-top-color: var(--c-blue); }
.hypothesis-recap p { font-size: 0.95rem; line-height: 1.6; }
.hypothesis-recap .small { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; }

.calibration-note {
  background: var(--c-pale);
  border-left: 3px solid var(--c-brand);
  padding: var(--space-md) var(--space-lg);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--c-body);
}

/* ── Counterfactual Path Comparison (Round 4) ── */
.counterfactual-wrap {
  overflow-x: auto;
  background: white;
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  box-shadow: var(--shadow-sm);
}

.counterfactual-table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'Roboto Mono', monospace;
  font-size: 0.9rem;
}

.counterfactual-table th,
.counterfactual-table td {
  padding: 12px 16px;
  text-align: center;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.counterfactual-table th:first-child,
.counterfactual-table td:first-child {
  text-align: left;
  font-family: 'Roboto', sans-serif;
}

.counterfactual-table th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--c-muted);
  font-weight: 500;
  background: var(--c-lavender);
}

.counterfactual-table th.cf-chosen,
.counterfactual-table td.cf-chosen {
  background: var(--c-brand-pale);
  color: var(--c-brand-text);
}

.counterfactual-table th.cf-chosen { color: var(--c-brand-text); border-bottom: 2px solid var(--c-brand); }

.counterfactual-table td.cf-best {
  font-weight: 700;
  color: var(--c-dark);
}

.counterfactual-table td.cf-best::after {
  content: ' ★';
  color: var(--c-orange);
  font-size: 0.8em;
}

/* ── Game Feedback Cards (Vanity / p-value) ── */
.game-feedback-card {
  background: var(--c-lavender);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  text-align: left;
  margin-top: var(--space-md);
}

.game-verdict {
  font-family: 'Roboto', sans-serif;
  font-weight: 700;
  font-size: 1rem;
}

.game-verdict.verdict-good { color: var(--c-green); }
.game-verdict.verdict-bad { color: var(--c-red); }

.game-explanation {
  font-size: 0.9rem;
  color: var(--c-body);
  line-height: 1.6;
}

.criteria-block {
  background: white;
  border-radius: var(--radius);
  padding: var(--space-md);
}

.criteria-label {
  font-family: 'Roboto', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--c-dark);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--space-sm);
}

.criteria-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.criteria-list li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  padding: 6px 0;
  font-size: 0.85rem;
  font-family: 'Roboto', sans-serif;
  line-height: 1.4;
}

.crit-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-weight: 700;
  flex-shrink: 0;
  font-size: 0.85rem;
}

.crit-yes .crit-icon { background: var(--c-green); color: white; }
.crit-no .crit-icon { background: var(--c-red); color: white; }
.crit-na .crit-icon { background: var(--c-muted); color: white; }

.crit-yes { color: var(--c-dark); }
.crit-no { color: var(--c-body); }

.btn-sm {
  padding: var(--space-xs) var(--space-lg);
  font-size: 0.85rem;
}

/* ── ICE Scoring Constraint Card ── */
.constraint-card {
  border-top: 3px solid var(--c-orange);
}

.constraint-scenarios {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
  margin-top: var(--space-md);
}

.constraint-scenario {
  background: white;
  border-radius: var(--radius);
  padding: var(--space-md);
  box-shadow: var(--shadow-sm);
}

.constraint-scenario p {
  font-size: 0.9rem;
  line-height: 1.5;
}

.constraint-scenario .small {
  font-size: 0.8rem;
  line-height: 1.5;
}

.leaderboard-team .small {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
