/* ============================================================
   TACG: Trajectory-Aware Commit Gating for Diffusion Language Model Decoding
   Design System: Morandi Slate-Cyan Editorial Showcase (Lab Grade)
   Standard aligned with Concertina (https://concertina.traly.org/)
   ============================================================ */

:root {
  /* ============================================================
     Morandi Slate-Cyan Foundation Palette
     ============================================================ */
  --bg: #F2F5F5;             /* Morandi pale mist cyan-grey */
  --bg-subtle: #E8EEF0;      /* Slightly deeper mist */
  --card: #FCFDFD;           /* Crisp chalk white */
  --card-elevated: #FFFFFF;
  --ink: #1B2A30;            /* Soft deep slate-cyan (no harsh pitch-black) */
  --ink-2: #283940;          /* Secondary dark slate body */
  --raised: #22343C;
  --muted: #566870;          /* Morandi dusty slate */
  --dim: #7C8F96;            /* Morandi light slate */
  --line: #DCE3E5;          /* Delicate slate-cyan border */
  --line-strong: #C4D0D4;

  /* Primary Accent: Morandi Slate Teal / Cyan */
  --teal: #366A75;           /* Refined Morandi slate teal */
  --teal-soft: #E6EFF0;      /* Low-sat soft cyan tint */
  --teal-border: #B7CED2;
  --teal-ink: #20454D;
  --teal-hi: #8DB9BE;        /* Muted ice celadon */

  /* Morandi Contrasting Palette */
  /* 1. Dusty Terracotta / Clay */
  --clay: #B66D5B;
  --clay-soft: #F7EDE9;
  --clay-border: #E8C8C0;
  --clay-ink: #7A3C2D;
  --clay-hi: #DE9B8B;

  /* 2. Warm Ochre / Amber */
  --ochre: #B08846;
  --ochre-soft: #F7F1E5;
  --ochre-border: #E5D5B8;
  --ochre-ink: #6E511E;
  --ochre-hi: #D6B272;

  /* 3. Sage Olive Green */
  --sage: #537C6D;
  --sage-soft: #EAF2EE;
  --sage-border: #BFD7CC;
  --sage-ink: #2C4F42;
  --sage-hi: #82AFA0;

  /* 4. Slate Lavender / Dusty Blue */
  --slate: #5C748C;
  --slate-soft: #EDF2F7;
  --slate-border: #C8D5E3;
  --slate-ink: #2F445A;
  --slate-hi: #93A7BD;

  /* Hero & Dark Elements (Morandi Deep Slate Cyan) */
  --hero-bg: #121C22;
  --hero-bg-deep: #0D161B;
  --hero-card: #18252C;
  --hero-text: #F0F4F5;
  --hero-muted: #8EACB4;
  --hero-line: rgba(220, 235, 240, 0.14);
  --hero-hi: #8DB9BE;

  --code-bg: #141E24;
  --code-ink: #E2ECEE;
  --code-dim: #8EACB4;

  /* Typography & Layout Scale */
  --maxw: 1140px;
  --f-display: "Outfit", "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --f-body: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --f-ui: "Plus Jakarta Sans", "IBM Plex Sans", -apple-system, sans-serif;
  --f-mono: "Fira Code", "JetBrains Mono", ui-monospace, monospace;

  --r: 8px;
  --r-sm: 5px;
  --r-lg: 12px;
  --shadow-sm: 0 1px 3px rgba(27, 42, 48, 0.04);
  --shadow-card: 0 4px 20px rgba(27, 42, 48, 0.04);
  --shadow-hover: 0 8px 30px rgba(27, 42, 48, 0.07);
}

/* Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-padding-top: 78px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--ink-2);
  font-family: var(--f-body);
  font-size: 15px;
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a {
  color: var(--teal);
  text-decoration: none;
  transition: color 0.18s ease;
}
a:hover {
  color: var(--teal-ink);
  text-decoration: underline;
}

h1, h2, h3, h4 {
  color: var(--ink);
  line-height: 1.2;
  letter-spacing: -0.015em;
}

h1 {
  font-family: var(--f-display);
  font-size: clamp(34px, 4.2vw, 52px);
  font-weight: 500;
  color: var(--hero-text);
}
h1 em, h1 .title-brand {
  font-style: normal;
  font-weight: 700;
  color: var(--hero-hi);
  letter-spacing: -0.02em;
}

h2 {
  font-family: var(--f-display);
  font-size: clamp(26px, 3vw, 36px);
  font-weight: 500;
  margin-bottom: 12px;
}

h3 {
  font-family: var(--f-ui);
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
}

h4 {
  font-family: var(--f-ui);
  font-size: 14.5px;
  font-weight: 600;
}

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

/* ============================================================
   Sticky Navigation Bar
   ============================================================ */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(18, 28, 34, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--hero-line);
  transition: all 0.2s ease;
}

.nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 16px;
}

.nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex: none;
}
.nav-brand:hover {
  text-decoration: none;
}

.brand-badge {
  background: rgba(141, 185, 190, 0.16);
  border: 1px solid rgba(141, 185, 190, 0.4);
  color: var(--teal-hi);
  font-family: var(--f-mono);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: 0.05em;
}

.brand-text {
  font-family: var(--f-ui);
  font-size: 14.5px;
  font-weight: 600;
  color: var(--hero-text);
  letter-spacing: -0.01em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav-links::-webkit-scrollbar {
  display: none;
}

.nav-links a {
  display: block;
  color: var(--hero-muted);
  font-family: var(--f-ui);
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
  padding: 6px 12px;
  border-radius: 6px;
  text-decoration: none;
  transition: color 0.18s, background 0.18s;
}

.nav-links a:hover {
  color: var(--hero-text);
  background: rgba(255, 255, 255, 0.08);
}

/* ============================================================
   Hero Section (Dark Slate Cyan Lab Grade)
   ============================================================ */
.hero {
  position: relative;
  background: radial-gradient(circle at 85% 15%, rgba(54, 106, 117, 0.28) 0%, transparent 60%),
              radial-gradient(circle at 10% 85%, rgba(176, 136, 70, 0.12) 0%, transparent 50%),
              var(--hero-bg);
  color: var(--hero-text);
  padding: 64px 0 54px;
  border-bottom: 1px solid var(--hero-line);
  overflow: hidden;
}

.hero-content {
  position: relative;
  z-index: 5;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.venue-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--f-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ochre-hi);
  background: rgba(176, 136, 70, 0.12);
  border: 1px solid rgba(176, 136, 70, 0.32);
  padding: 4px 14px;
  border-radius: 999px;
  margin-bottom: 22px;
}

.venue-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ochre-hi);
  box-shadow: 0 0 8px rgba(214, 178, 114, 0.8);
}

.hero-title {
  max-width: 980px;
  margin: 0 auto 18px;
  line-height: 1.18;
}

.hero-title .title-brand {
  font-family: var(--f-display);
  font-weight: 700;
  color: var(--hero-hi);
  letter-spacing: -0.01em;
}

.hero-title .title-sep {
  color: var(--hero-muted);
  font-weight: 400;
  margin-right: 8px;
}

.hero-title .title-main {
  font-family: var(--f-display);
  font-weight: 400;
  color: var(--hero-text);
}

.hero-subtitle {
  font-size: 17.5px;
  line-height: 1.68;
  color: var(--hero-muted);
  max-width: 820px;
  margin: 0 auto 28px;
}

.hero-subtitle strong {
  color: var(--hero-text);
  font-weight: 600;
}

.authors-block {
  margin-bottom: 34px;
}

.author-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 14px 22px;
  font-family: var(--f-ui);
  font-size: 16px;
  color: var(--hero-text);
  margin-bottom: 8px;
}

.author-item {
  white-space: nowrap;
}

.author-item sup {
  color: var(--hero-hi);
  font-family: var(--f-mono);
  font-size: 0.75rem;
  font-weight: 600;
  margin-left: 1px;
}

.affiliations {
  font-family: var(--f-ui);
  font-size: 13.5px;
  color: var(--hero-muted);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 6px 14px;
}

.affiliations span {
  white-space: nowrap;
}

/* Call to Action Buttons */
.cta-group {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-bottom: 48px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--r);
  font-family: var(--f-ui);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn svg {
  flex-shrink: 0;
}

.btn-primary {
  background: var(--teal);
  color: #FFFFFF;
  border: 1px solid var(--teal-border);
}
.btn-primary:hover {
  background: var(--teal-ink);
  color: #FFFFFF;
  text-decoration: none;
  box-shadow: 0 4px 16px rgba(54, 106, 117, 0.4);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--hero-text);
  border: 1px solid var(--hero-line);
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.35);
  color: var(--hero-text);
  text-decoration: none;
}

.btn-accent {
  background: rgba(141, 185, 190, 0.08);
  color: var(--hero-hi);
  border: 1px solid rgba(141, 185, 190, 0.32);
}
.btn-accent:hover {
  background: rgba(141, 185, 190, 0.18);
  border-color: var(--hero-hi);
  color: #FFFFFF;
  text-decoration: none;
  box-shadow: 0 4px 16px rgba(141, 185, 190, 0.25);
}

/* ============================================================
   Headline Metrics Grid (Glassmorphism + Morandi Highlights)
   ============================================================ */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  width: 100%;
  text-align: left;
}

.metric-card {
  position: relative;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--hero-line);
  border-radius: var(--r);
  padding: 20px 22px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.metric-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.28);
}

/* Top Accent Lines */
.metric-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-top-left-radius: var(--r);
  border-top-right-radius: var(--r);
}

.metric-card.card-teal::before, .metric-card:nth-child(1)::before {
  background: var(--teal-hi);
}
.metric-card.card-ochre::before, .metric-card:nth-child(2)::before {
  background: var(--ochre-hi);
}
.metric-card.card-clay::before, .metric-card:nth-child(3)::before {
  background: var(--clay-hi);
}
.metric-card.card-sage::before, .metric-card:nth-child(4)::before {
  background: var(--sage-hi);
}

.metric-top {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-bottom: 8px;
}

.metric-value {
  font-family: var(--f-mono);
  font-size: 34px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--hero-text);
  margin-bottom: 8px;
  display: flex;
  align-items: baseline;
  gap: 2px;
}

.metric-value .num {
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.metric-value .unit {
  font-size: 19px;
  font-weight: 400;
  color: var(--hero-muted);
}

.delta-tag {
  font-family: var(--f-mono);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: 0.02em;
}

.delta-pos, .delta-teal {
  background: rgba(141, 185, 190, 0.16);
  border: 1px solid rgba(141, 185, 190, 0.4);
  color: var(--teal-hi);
}

.delta-orange, .delta-ochre {
  background: rgba(214, 178, 114, 0.16);
  border: 1px solid rgba(214, 178, 114, 0.4);
  color: var(--ochre-hi);
}

.delta-clay {
  background: rgba(222, 155, 139, 0.16);
  border: 1px solid rgba(222, 155, 139, 0.4);
  color: var(--clay-hi);
}

.delta-sage {
  background: rgba(130, 175, 160, 0.16);
  border: 1px solid rgba(130, 175, 160, 0.4);
  color: var(--sage-hi);
}

.metric-label {
  font-family: var(--f-ui);
  font-size: 14px;
  font-weight: 600;
  color: var(--hero-text);
  margin-bottom: 4px;
}

.metric-sub {
  font-family: var(--f-ui);
  font-size: 12px;
  color: var(--hero-muted);
  line-height: 1.45;
}

/* ============================================================
   Section Alternating Layout & Headers
   ============================================================ */
.section {
  padding: 68px 0;
  border-top: 1px solid var(--line);
}

.section:nth-of-type(odd) {
  background: var(--bg);
}

.section:nth-of-type(even) {
  background: #FFFFFF;
}

.section-header {
  margin-bottom: 36px;
}

.section-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--f-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 10px;
}

.section-title {
  color: var(--ink);
  line-height: 1.2;
}

.section-lead {
  font-size: 15.5px;
  color: var(--muted);
  max-width: 920px;
  line-height: 1.7;
  margin-top: 8px;
}

.section-lead strong {
  color: var(--ink);
}

/* ============================================================
   Cards & Layout Grids
   ============================================================ */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 26px 24px;
  box-shadow: var(--shadow-card);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-hover);
}

.card-subtle {
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 22px 20px;
}

.pillar-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 24px 22px;
}

.pillar-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-top-left-radius: var(--r);
  border-top-right-radius: var(--r);
}

.pillar-teal::before { background: var(--teal); }
.pillar-ochre::before { background: var(--ochre); }
.pillar-sage::before { background: var(--sage); }

.pillar-eyebrow {
  font-family: var(--f-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.pillar-teal .pillar-eyebrow { color: var(--teal); }
.pillar-ochre .pillar-eyebrow { color: var(--ochre); }
.pillar-sage .pillar-eyebrow { color: var(--sage); }

.pillar-card h4 {
  font-size: 16px;
  margin-bottom: 8px;
  color: var(--ink);
}

.pillar-card p {
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.55;
  margin-bottom: 12px;
  flex: 1;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}

.three-col {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

/* Math Blocks */
.math-block {
  background: #F5F8F8;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 14px 18px;
  margin: 14px 0;
  font-size: 0.95rem;
  overflow-x: auto;
  text-align: center;
}

/* ============================================================
   Interactive Simulator Shell (Dark Slate Console)
   ============================================================ */
.interactive-shell {
  background: var(--hero-card);
  border: 1px solid var(--hero-line);
  border-radius: var(--r);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  margin-top: 24px;
}

.shell-toolbar {
  background: rgba(18, 28, 34, 0.85);
  border-bottom: 1px solid var(--hero-line);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.toolbar-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--f-ui);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--hero-text);
}

.live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--hero-hi);
  background: rgba(141, 185, 190, 0.14);
  padding: 2px 7px;
  border-radius: 4px;
}

.live-indicator::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--hero-hi);
}

.toolbar-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ctrl-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--hero-line);
  color: var(--hero-text);
  font-family: var(--f-ui);
  font-size: 12.5px;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.18s ease;
}

.ctrl-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.3);
}

.ctrl-btn.active {
  background: var(--teal);
  border-color: var(--teal-border);
  color: #FFFFFF;
}

.ctrl-select {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--hero-line);
  color: var(--hero-text);
  font-family: var(--f-mono);
  font-size: 12.5px;
  padding: 5px 10px;
  border-radius: 5px;
  outline: none;
  cursor: pointer;
}

.shell-body {
  padding: 24px;
  color: var(--hero-text);
}

/* Simulator Context Strip */
.sim-context-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--hero-line);
  border-radius: 6px;
  padding: 10px 14px;
  margin-bottom: 20px;
  overflow-x: auto;
}

.ctx-label {
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--hero-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.token-chip {
  font-family: var(--f-mono);
  font-size: 12.5px;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--hero-text);
  white-space: nowrap;
}

.token-chip.masked {
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed rgba(255, 255, 255, 0.2);
  color: var(--hero-muted);
}

.token-chip.cand-a {
  background: rgba(222, 155, 139, 0.16);
  border: 1px solid var(--clay-hi);
  color: var(--clay-hi);
}

.token-chip.cand-b {
  background: rgba(130, 175, 160, 0.16);
  border: 1px solid var(--sage-hi);
  color: var(--sage-hi);
}

/* Candidate Comparison Cards */
.sim-candidates-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 22px;
}

.cand-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--hero-line);
  border-radius: var(--r);
  padding: 18px 20px;
}

.cand-card.highlight-hold {
  border-top: 3px solid var(--clay-hi);
}

.cand-card.highlight-pass {
  border-top: 3px solid var(--sage-hi);
}

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

.cand-title {
  font-family: var(--f-ui);
  font-size: 14.5px;
  font-weight: 600;
  color: var(--hero-text);
}

.cand-badge {
  font-family: var(--f-mono);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
}

.badge-hold {
  background: rgba(222, 155, 139, 0.18);
  color: var(--clay-hi);
  border: 1px solid rgba(222, 155, 139, 0.4);
}

.badge-commit {
  background: rgba(130, 175, 160, 0.18);
  color: var(--sage-hi);
  border: 1px solid rgba(130, 175, 160, 0.4);
}

.traj-pills {
  display: flex;
  gap: 6px;
  margin: 10px 0 14px;
}

.traj-pill {
  font-family: var(--f-mono);
  font-size: 11px;
  padding: 3px 7px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--hero-line);
  color: var(--hero-muted);
}

.traj-pill.switched {
  border-color: rgba(222, 155, 139, 0.4);
  color: var(--clay-hi);
}

.traj-pill.stable {
  border-color: rgba(130, 175, 160, 0.4);
  color: var(--sage-hi);
}

.bar-row {
  margin-bottom: 10px;
}

.bar-meta {
  display: flex;
  justify-content: space-between;
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--hero-muted);
  margin-bottom: 4px;
}

.bar-meta .val {
  color: var(--hero-text);
  font-weight: 600;
}

.bar-track {
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s ease;
}

.bar-fill.teal { background: var(--teal-hi); }
.bar-fill.clay { background: var(--clay-hi); }
.bar-fill.sage { background: var(--sage-hi); }

/* Slider Controls */
.sim-sliders {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--hero-line);
  border-radius: var(--r);
  padding: 16px 20px;
}

.slider-group label {
  display: flex;
  justify-content: space-between;
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--hero-muted);
  margin-bottom: 6px;
}

.slider-group label span.val {
  color: var(--hero-hi);
  font-weight: 600;
}

.slider-group input[type="range"] {
  width: 100%;
  accent-color: var(--teal-hi);
  cursor: pointer;
}

/* ============================================================
   Real Trace Player & Slot Matrix
   ============================================================ */
.trace-prompt-box {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--hero-line);
  border-radius: 6px;
  padding: 14px 18px;
  margin-bottom: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.prompt-text {
  font-family: var(--f-mono);
  font-size: 13px;
  color: var(--hero-text);
  max-width: 780px;
}

.eval-outcome {
  font-family: var(--f-mono);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 4px;
  background: rgba(130, 175, 160, 0.16);
  border: 1px solid rgba(130, 175, 160, 0.4);
  color: var(--sage-hi);
}

.trace-grid-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.trace-col {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--hero-line);
  border-radius: var(--r);
  padding: 16px 18px;
}

.trace-col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  font-family: var(--f-ui);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--hero-text);
}

.trace-col-header .stat-pill {
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--hero-muted);
}

.slot-matrix {
  display: grid;
  grid-template-columns: repeat(32, 1fr);
  gap: 3px;
  margin-bottom: 14px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 6px;
}

.slot-cell {
  aspect-ratio: 1;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.06);
  transition: background 0.15s ease;
}

.slot-cell.committed-past {
  background: var(--teal);
}

.slot-cell.committed-past-conf {
  background: var(--slate);
}

.slot-cell.committed-now {
  background: var(--teal-hi);
  box-shadow: 0 0 6px rgba(141, 185, 190, 0.8);
}

.slot-cell.committed-extra {
  background: var(--ochre-hi);
  box-shadow: 0 0 6px rgba(214, 178, 114, 0.8);
}

.trace-output-box {
  background: var(--code-bg);
  border: 1px solid var(--hero-line);
  border-radius: 6px;
  padding: 12px 14px;
  font-family: var(--f-mono);
  font-size: 12px;
  line-height: 1.6;
  max-height: 240px;
  overflow-y: auto;
  white-space: pre-wrap;
  color: var(--code-ink);
}

.tok-span {
  transition: all 0.2s;
}

.tok-span.now-base {
  color: var(--teal-hi);
  font-weight: 600;
  text-decoration: underline;
}

.tok-span.now-extra {
  color: var(--ochre-hi);
  font-weight: 600;
  background: rgba(214, 178, 114, 0.15);
  padding: 0 2px;
  border-radius: 2px;
}

.tok-span.mask-dot {
  color: var(--code-dim);
}

/* Telemetry Inspector */
.telemetry-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 6px;
  max-height: 180px;
  overflow-y: auto;
}

.telem-chip {
  font-family: var(--f-mono);
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--hero-line);
  color: var(--hero-muted);
}

.telem-chip.extra {
  border-color: rgba(214, 178, 114, 0.4);
  color: var(--ochre-hi);
}

.telem-chip strong {
  color: var(--hero-text);
}

/* ============================================================
   Figures & Visual Cards
   ============================================================ */
.figure-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 16px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
}

.figure-card img {
  width: 100%;
  height: auto;
  border-radius: 4px;
  display: block;
}

.figure-caption {
  font-family: var(--f-ui);
  font-size: 13px;
  color: var(--muted);
  line-height: 1.55;
  margin-top: 12px;
}

.figure-caption strong {
  color: var(--ink);
  font-weight: 600;
}

/* ============================================================
   Benchmark Results Table (Lab Grade Academic)
   ============================================================ */
.table-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.tab-btn {
  font-family: var(--f-ui);
  font-size: 13.5px;
  font-weight: 600;
  padding: 7px 16px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--muted);
  cursor: pointer;
  transition: all 0.18s ease;
}

.tab-btn:hover {
  color: var(--ink);
  border-color: var(--line-strong);
}

.tab-btn.active {
  background: var(--teal);
  border-color: var(--teal);
  color: #FFFFFF;
}

.table-wrapper {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow-x: auto;
  box-shadow: var(--shadow-card);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--f-ui);
  font-size: 13.5px;
  text-align: left;
}

thead {
  background: #1B2A30;
  color: #F0F4F5;
}

th {
  padding: 12px 16px;
  font-weight: 600;
  font-size: 12.5px;
  letter-spacing: 0.02em;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  white-space: nowrap;
}

td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-2);
  white-space: nowrap;
}

tbody tr:hover {
  background: var(--bg-subtle);
}

tbody tr.tacg-row {
  background: rgba(54, 106, 117, 0.06);
  font-weight: 600;
}

tbody tr.tacg-row td {
  color: var(--ink);
}

.gain-pill {
  font-family: var(--f-mono);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
}

.gain-pos {
  background: var(--teal-soft);
  color: var(--teal-ink);
  border: 1px solid var(--teal-border);
}

.gain-speed {
  background: var(--ochre-soft);
  color: var(--ochre-ink);
  border: 1px solid var(--ochre-border);
}

/* ============================================================
   Citation & Code Box
   ============================================================ */
.code-box {
  position: relative;
  background: var(--code-bg);
  border: 1px solid var(--hero-line);
  border-radius: var(--r);
  padding: 20px 22px;
  box-shadow: var(--shadow-card);
}

.code-box pre {
  font-family: var(--f-mono);
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--code-ink);
  overflow-x: auto;
  white-space: pre-wrap;
}

.copy-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 5px;
  border: 1px solid var(--hero-line);
  background: rgba(255, 255, 255, 0.08);
  color: var(--hero-muted);
  font-family: var(--f-ui);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
}

.copy-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  color: var(--hero-text);
  border-color: rgba(255, 255, 255, 0.35);
}

/* ============================================================
   Responsive Breakpoints
   ============================================================ */
@media (max-width: 992px) {
  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .two-col {
    grid-template-columns: 1fr;
  }
  .sim-candidates-grid {
    grid-template-columns: 1fr;
  }
  .trace-grid-pair {
    grid-template-columns: 1fr;
  }
  .three-col {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .metrics-grid {
    grid-template-columns: 1fr;
  }
  .nav-links {
    display: none;
  }
  .sim-sliders {
    grid-template-columns: 1fr;
  }
}
