/* ============================================
   FlowPilot — Case Study (Layer 2)
   Nav · Sidebar · Progress · Chapters · Sources
   ============================================ */

/* ═══════════════════════════════════════════
   NAV (slim, context-marked)
   ═══════════════════════════════════════════ */

.cs-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.cs-nav__inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-padding);
  height: var(--nav-height-mobile);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

@media (min-width: 1024px) {
  .cs-nav__inner {
    height: var(--nav-height);
  }
}

.cs-nav__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-0);
  flex-shrink: 1;
  min-width: 0;
}

.cs-nav__logo {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

@media (min-width: 1024px) {
  .cs-nav__logo {
    width: 36px;
    height: 36px;
  }
}

.cs-nav__wordmark {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 18px;
  color: var(--text-0);
  letter-spacing: -0.01em;
}

.cs-nav__divider {
  color: var(--text-2);
  font-size: 18px;
  font-weight: 300;
  margin: 0 2px;
}

.cs-nav__context {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 16px;
  color: var(--text-1);
  letter-spacing: -0.005em;
}

@media (max-width: 540px) {
  .cs-nav__divider,
  .cs-nav__context {
    display: none;
  }
}

.cs-nav__product-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-1);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  transition: all var(--duration-base) var(--ease-out);
  white-space: nowrap;
}

.cs-nav__product-link:hover {
  color: var(--text-0);
  border-color: var(--brand-400);
  background: var(--brand-glow-soft);
}

@media (min-width: 1024px) {
  .cs-nav__product-link {
    font-size: 14px;
    padding: 10px 16px;
  }
}

/* ═══════════════════════════════════════════
   READING PROGRESS BAR (mobile only)
   ═══════════════════════════════════════════ */

.cs-progress {
  position: sticky;
  top: var(--nav-height-mobile);
  z-index: 49;
  height: 2px;
  background: var(--bg-1);
  width: 100%;
}

.cs-progress__bar {
  height: 100%;
  width: 0%;
  background: var(--gradient-hero);
  transition: width 80ms linear;
}

@media (min-width: 1024px) {
  .cs-progress {
    display: none;
  }
}

/* ═══════════════════════════════════════════
   LAYOUT (sidebar + content grid)
   ═══════════════════════════════════════════ */

.cs-layout {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-padding);
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}

@media (min-width: 1024px) {
  .cs-layout {
    grid-template-columns: 240px 1fr;
    gap: 64px;
    padding: 0 32px;
  }
}

@media (min-width: 1280px) {
  .cs-layout {
    grid-template-columns: 260px 1fr;
    gap: 80px;
    padding: 0 var(--container-padding);
  }
}

/* ═══════════════════════════════════════════
   SIDEBAR (desktop only)
   ═══════════════════════════════════════════ */

.cs-sidebar {
  display: none;
}

@media (min-width: 1024px) {
  .cs-sidebar {
    display: block;
    position: sticky;
    top: calc(var(--nav-height) + 32px);
    align-self: start;
    max-height: calc(100vh - var(--nav-height) - 64px);
    overflow-y: auto;
    padding: 32px 0;
  }
}

.cs-sidebar__nav {
  display: flex;
  flex-direction: column;
}

.cs-sidebar__label {
  display: block;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-2);
  margin-bottom: 16px;
  padding-left: 12px;
}

.cs-sidebar__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cs-sidebar__link {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 10px 12px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-2);
  border-radius: var(--radius-md);
  border-left: 2px solid transparent;
  transition: all var(--duration-base) var(--ease-out);
  line-height: 1.4;
}

.cs-sidebar__link:hover {
  color: var(--text-1);
  background: var(--bg-1);
}

.cs-sidebar__link.is-active {
  color: var(--brand-300);
  background: var(--brand-glow-soft);
  border-left-color: var(--brand-500);
  font-weight: 600;
}

.cs-sidebar__num {
  font-family: "JetBrains Mono", "Geist Mono", ui-monospace, monospace;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-2);
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.cs-sidebar__link.is-active .cs-sidebar__num {
  color: var(--brand-300);
}

.cs-sidebar__divider {
  height: 1px;
  background: var(--border);
  margin: 16px 12px;
}

.cs-sidebar__link--secondary {
  font-size: 13px;
  color: var(--text-2);
}

.cs-sidebar__link--secondary .cs-sidebar__num {
  color: var(--brand-400);
}

/* ═══════════════════════════════════════════
   ARTICLE CONTENT
   ═══════════════════════════════════════════ */

.cs-content {
  padding: 32px 0 96px;
  min-width: 0;  /* allow grid item to shrink */
}

@media (min-width: 1024px) {
  .cs-content {
    padding: 64px 0 160px;
  }
}

/* ─── Hero ─── */
.cs-hero {
  max-width: 760px;
  margin: 0 0 32px;
}

@media (min-width: 1024px) {
  .cs-hero {
    margin-bottom: 40px;
  }
}

.cs-hero__eyebrow {
  margin-bottom: 20px;
}

.cs-hero__title {
  font-family: var(--font-display);
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--text-0);
  margin-bottom: 24px;
}

.cs-hero__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-2);
  margin-bottom: 16px;
}

.cs-hero__meta-sep {
  color: var(--text-2);
  opacity: 0.6;
}

/* ═══════════════════════════════════════════
   HERO PITCH (replaces old subhead)
   ═══════════════════════════════════════════ */

.cs-hero__pitch {
  font-size: clamp(17px, 1.8vw, 19px);
  line-height: 1.6;
  color: var(--text-1);
  margin-bottom: 28px;
  max-width: 660px;
  font-family: var(--font-body);
}

@media (min-width: 1024px) {
  .cs-hero__pitch {
    font-size: 19px;
    margin-bottom: 32px;
  }
}

/* ═══════════════════════════════════════════
   HERO VISUAL ANCHOR (Layer 3 product screenshot)
   ═══════════════════════════════════════════ */

.cs-hero-visual {
  margin: 0 0 32px;
  position: relative;
}

@media (min-width: 1024px) {
  .cs-hero-visual {
    margin: 0 0 40px;
  }
}

.cs-hero-visual__link {
  display: block;
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid var(--border-strong);
  background: var(--bg-1);
  transition: all var(--duration-base) var(--ease-out);
}

.cs-hero-visual__link::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--gradient-hero);
  opacity: 0;
  z-index: 1;
  pointer-events: none;
  mix-blend-mode: overlay;
  transition: opacity var(--duration-base) var(--ease-out);
}

.cs-hero-visual__link:hover {
  border-color: var(--brand-400);
  box-shadow: 0 30px 60px -30px var(--brand-glow);
  transform: translateY(-2px);
}

.cs-hero-visual__link:hover::before {
  opacity: 0.08;
}

.cs-hero-visual__img {
  display: block;
  width: 100%;
  height: auto;
}

.cs-hero-visual__caption {
  position: absolute;
  bottom: 16px;
  right: 20px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-1);
  letter-spacing: 0.01em;
  transition: all var(--duration-base) var(--ease-out);
}

.cs-hero-visual__link:hover .cs-hero-visual__caption {
  color: var(--brand-300);
  border-color: var(--brand-400);
  background: rgba(120, 64, 232, 0.12);
}

@media (min-width: 1024px) {
  .cs-hero-visual__caption {
    bottom: 20px;
    right: 24px;
    padding: 10px 16px;
    font-size: 13px;
  }
}

/* ═══════════════════════════════════════════
   HERO STATS · 4 mini punch cards
   ═══════════════════════════════════════════ */

.cs-hero-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin: 0 0 56px;
  padding-bottom: 56px;
  border-bottom: 1px solid var(--border);
}

@media (min-width: 640px) {
  .cs-hero-stats {
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
  }
}

@media (min-width: 1024px) {
  .cs-hero-stats {
    margin-bottom: 80px;
    padding-bottom: 80px;
    gap: 16px;
  }
}

.cs-hero-stat {
  padding: 16px 18px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

@media (min-width: 1024px) {
  .cs-hero-stat {
    padding: 18px 20px;
  }
}

.cs-hero-stat__value {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(135deg, var(--brand-400), var(--brand-300));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

@media (min-width: 1024px) {
  .cs-hero-stat__value {
    font-size: 28px;
  }
}

.cs-hero-stat__label {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text-2);
  text-transform: uppercase;
}

@media (min-width: 1024px) {
  .cs-hero-stat__label {
    font-size: 12px;
  }
}

/* ─── Article ─── */
.cs-article {
  max-width: 720px;
}

/* ─── Chapter ─── */
.cs-chapter {
  padding: 56px 0;
  scroll-margin-top: calc(var(--nav-height) + 24px);
  border-top: 1px solid var(--border);
}

.cs-chapter:first-child {
  border-top: none;
  padding-top: 0;
}

@media (min-width: 1024px) {
  .cs-chapter {
    padding: 80px 0;
  }
}

.cs-chapter__header {
  margin-bottom: 32px;
}

.cs-chapter__num {
  display: inline-block;
  font-family: "JetBrains Mono", "Geist Mono", ui-monospace, monospace;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand-300);
  margin-bottom: 14px;
}

.cs-chapter__title {
  font-family: var(--font-display);
  font-size: clamp(28px, 3.6vw, 40px);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.015em;
  color: var(--text-0);
  margin-bottom: 16px;
}

.cs-chapter__lede {
  font-size: 17px;
  line-height: 1.6;
  color: var(--text-1);
  font-weight: 400;
  max-width: 640px;
}

@media (min-width: 1024px) {
  .cs-chapter__lede {
    font-size: 18px;
  }
}

.cs-chapter__body {
  font-size: 16px;
  line-height: 1.75;
  color: var(--text-1);
}

.cs-chapter__body p {
  margin-bottom: 1.4em;
}

.cs-chapter__body h3 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  color: var(--text-0);
  margin-top: 2em;
  margin-bottom: 0.6em;
  letter-spacing: -0.01em;
}

.cs-chapter__body h4 {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  color: var(--text-0);
  margin-top: 1.6em;
  margin-bottom: 0.4em;
}

.cs-chapter__body em {
  color: var(--text-0);
  font-style: italic;
}

.cs-chapter__body strong {
  color: var(--text-0);
  font-weight: 600;
}

.cs-chapter__body ul,
.cs-chapter__body ol {
  margin: 0 0 1.4em 0;
  padding-left: 24px;
}

.cs-chapter__body li {
  margin-bottom: 0.6em;
}

.cs-chapter__body code {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.88em;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 6px;
  color: var(--brand-300);
}

/* ─── Pull quote (for highlighted reasoning) ─── */
.cs-chapter__body blockquote {
  margin: 2em 0;
  padding: 16px 24px;
  border-left: 3px solid var(--brand-500);
  background: var(--bg-1);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-style: italic;
  color: var(--text-0);
}

/* ═══════════════════════════════════════════
   INLINE SOURCE NOTE (D-14)
   Used directly under data-citing paragraphs.
   ═══════════════════════════════════════════ */

.cs-source {
  display: block;
  font-size: 13px;
  font-style: italic;
  color: var(--text-2);
  margin-top: -0.8em;
  margin-bottom: 1.4em;
  padding-left: 16px;
  border-left: 2px solid var(--border);
  letter-spacing: 0.01em;
}

.cs-source a {
  color: var(--text-1);
  text-decoration: underline;
  text-decoration-color: var(--text-2);
  text-underline-offset: 2px;
  transition: color var(--duration-base) var(--ease-out);
}

.cs-source a:hover {
  color: var(--brand-300);
  text-decoration-color: var(--brand-300);
}

.cs-source-num {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  color: var(--brand-400);
  margin-right: 6px;
  font-style: normal;
  font-weight: 500;
}

/* ═══════════════════════════════════════════
   STUB STATE (placeholder text in unfilled chapters)
   ═══════════════════════════════════════════ */

.cs-stub {
  padding: 16px 20px;
  background: var(--bg-1);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.6;
}

.cs-stub em {
  color: var(--brand-300);
  font-style: normal;
  font-weight: 500;
}

/* ═══════════════════════════════════════════
   REFERENCES SECTION
   ═══════════════════════════════════════════ */

.cs-references {
  margin-top: 96px;
  padding-top: 64px;
  border-top: 1px solid var(--border);
  scroll-margin-top: calc(var(--nav-height) + 24px);
}

.cs-references__inner {
  max-width: 720px;
}

.cs-references__title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  color: var(--text-0);
  letter-spacing: -0.01em;
  margin-bottom: 12px;
}

.cs-references__note {
  font-size: 14px;
  color: var(--text-2);
  font-style: italic;
  margin-bottom: 32px;
  max-width: 600px;
}

.cs-references__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  counter-reset: ref-counter;
}

.cs-references__list > li {
  position: relative;
  padding: 12px 16px 12px 48px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-1);
  counter-increment: ref-counter;
}

.cs-references__list > li:not(.cs-stub)::before {
  content: counter(ref-counter, decimal-leading-zero);
  position: absolute;
  left: 16px;
  top: 12px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  font-weight: 600;
  color: var(--brand-400);
  letter-spacing: 0.04em;
}

.cs-references__list a {
  color: var(--brand-300);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: var(--brand-glow-soft);
  transition: text-decoration-color var(--duration-base) var(--ease-out);
}

.cs-references__list a:hover {
  text-decoration-color: var(--brand-300);
}

.cs-references__list .cs-stub {
  background: transparent;
  padding-left: 16px;
}

/* ═══════════════════════════════════════════
   REDUCED MOTION
   ═══════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
  .cs-progress__bar {
    transition: none;
  }
  .cs-sidebar__link {
    transition: none;
  }
}

/* ═══════════════════════════════════════════
   ARGUMENT GRID (Chapter 01 thesis cards)
   ═══════════════════════════════════════════ */

.cs-arg-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin: 24px 0 32px;
}

@media (min-width: 760px) {
  .cs-arg-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
  }
}

.cs-arg-card {
  display: flex;
  flex-direction: column;
  padding: 20px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
  transition: border-color var(--duration-base) var(--ease-out);
}

.cs-arg-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient-hero);
  opacity: 0.5;
}

.cs-arg-card:hover {
  border-color: var(--border-strong);
}

.cs-arg-card__num {
  display: block;
  font-family: "JetBrains Mono", "Geist Mono", ui-monospace, monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand-300);
  margin-bottom: 12px;
}

.cs-arg-card__title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-0);
  letter-spacing: -0.01em;
  margin: 0 0 10px;
}

.cs-arg-card__body {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-1);
  margin: 0;
  flex: 1;
}

/* ═══════════════════════════════════════════
   CHAPTER UTILITIES (h3 + closer + inline link)
   ═══════════════════════════════════════════ */

.cs-chapter__h3 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  color: var(--text-0);
  letter-spacing: -0.01em;
  margin-top: 2.4em;
  margin-bottom: 0.8em;
}

@media (min-width: 1024px) {
  .cs-chapter__h3 {
    font-size: 22px;
  }
}

.cs-chapter__closer {
  margin-top: 1.8em !important;
  padding-top: 1.4em;
  border-top: 1px solid var(--border);
  color: var(--text-1);
  font-size: 15px;
  line-height: 1.7;
}

.cs-inline-link {
  color: var(--brand-300);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: var(--brand-glow-soft);
  transition: text-decoration-color var(--duration-base) var(--ease-out);
}

.cs-inline-link:hover {
  text-decoration-color: var(--brand-300);
}

/* ═══════════════════════════════════════════
   POSITIONING MAP (Chapter 02)
   ═══════════════════════════════════════════ */

.cs-positioning {
  margin: 32px 0;
  padding: 24px 20px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
}

@media (min-width: 768px) {
  .cs-positioning {
    margin: 40px 0;
    padding: 32px;
  }
}

.cs-positioning__title {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-2);
  margin-bottom: 20px;
  text-align: center;
}

.cs-positioning__svg {
  display: block;
  width: 100%;
  height: auto;
  max-width: 600px;
  margin: 0 auto;
}

/* SVG text styles */
.cs-pm-quadrant {
  font-family: "JetBrains Mono", "Geist Mono", ui-monospace, monospace;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  fill: var(--text-2);
  opacity: 0.55;
}

.cs-pm-axis {
  font-family: "JetBrains Mono", "Geist Mono", ui-monospace, monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  fill: var(--text-2);
}

.cs-pm-dot {
  fill: var(--text-1);
  stroke: var(--bg-0);
  stroke-width: 2;
  transition: fill 0.2s ease, r 0.2s ease;
}

.cs-pm-dot:hover {
  fill: var(--brand-300);
  r: 7;
}

.cs-pm-label {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  fill: var(--text-1);
}

.cs-pm-gap-label {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  fill: var(--brand-300);
}

.cs-pm-gap-sub {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  fill: var(--brand-300);
  opacity: 0.85;
}

.cs-positioning__source {
  font-size: 12px;
  font-style: italic;
  color: var(--text-2);
  text-align: center;
  margin-top: 16px;
  margin-bottom: 0;
}

/* ═══════════════════════════════════════════
   COMPARISON TABLE (Chapter 02)
   ═══════════════════════════════════════════ */

.cs-compare {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1px;
  margin: 24px 0;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

@media (min-width: 768px) {
  .cs-compare {
    grid-template-columns: 1.4fr 1.1fr 1.1fr 0.9fr 1fr;
    margin: 32px 0;
  }
}

.cs-compare__row {
  display: contents;
}

.cs-compare__cell {
  background: var(--bg-1);
  padding: 12px 14px;
  font-size: 13px;
  color: var(--text-1);
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 52px;
  flex-wrap: wrap;
}

@media (min-width: 768px) {
  .cs-compare__cell {
    padding: 14px 16px;
    min-height: 56px;
  }
}

/* Header row */
.cs-compare__row--head .cs-compare__cell {
  background: var(--bg-2);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-0);
  letter-spacing: -0.005em;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 2px;
  text-align: left;
}

.cs-compare__sub {
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 400;
  color: var(--text-2);
  letter-spacing: 0.02em;
  text-transform: none;
}

.cs-compare__row--head .cs-compare__cell--ours {
  color: var(--brand-300);
}

@media (max-width: 767px) {
  .cs-compare__row--head {
    display: none;
  }
}

/* Label cells (first column on desktop, header rows on mobile) */
.cs-compare__cell--label {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--text-0);
  font-size: 14px;
  background: var(--bg-2);
}

@media (max-width: 767px) {
  .cs-compare__cell--label {
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-2);
    min-height: 0;
    padding: 10px 14px;
    background: var(--bg-2);
  }

  .cs-compare__cell:not(.cs-compare__cell--label):not(.cs-compare__cell--ours)::before {
    font-size: 10px;
    font-weight: 500;
    color: var(--text-2);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-right: auto;
    flex: 1;
  }
  .cs-compare__row > .cs-compare__cell:nth-child(2)::before { content: "AI Chat"; }
  .cs-compare__row > .cs-compare__cell:nth-child(3)::before { content: "Rule-based"; }
  .cs-compare__row > .cs-compare__cell:nth-child(4)::before { content: "Lindy AI"; }
}

/* FlowPilot column highlight */
.cs-compare__cell--ours {
  background: linear-gradient(180deg, rgba(120, 64, 232, 0.10), rgba(224, 80, 168, 0.05));
  color: var(--text-0);
  position: relative;
}

@media (min-width: 768px) {
  .cs-compare__row--head .cs-compare__cell--ours::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gradient-hero);
  }
}

/* State icons */
.cs-compare__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  flex-shrink: 0;
}

[data-state="yes"] .cs-compare__icon {
  background: var(--brand-glow-soft);
  color: var(--brand-300);
  border: 1px solid var(--border-lit);
}

[data-state="no"] .cs-compare__icon {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-2);
  border: 1px solid var(--border);
}

[data-state="partial"] .cs-compare__icon {
  background: rgba(120, 64, 232, 0.06);
  color: var(--text-2);
  border: 1px solid var(--border);
}

.cs-compare__cell--ours[data-state="yes"] .cs-compare__icon {
  background: var(--brand-500);
  color: #fff;
  border-color: var(--brand-500);
  box-shadow: 0 0 12px var(--brand-glow-soft);
}

.cs-compare__note {
  font-size: 12px;
  color: var(--text-2);
  font-style: italic;
}

/* Pricing row */
.cs-compare__row--price .cs-compare__cell {
  background: var(--bg-2);
}

.cs-compare__row--price .cs-compare__cell--ours {
  background: linear-gradient(180deg, rgba(120, 64, 232, 0.14), rgba(224, 80, 168, 0.08));
}

.cs-compare__price {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--text-0);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.cs-compare__row--price .cs-compare__cell--ours .cs-compare__price {
  background: linear-gradient(135deg, var(--brand-400), var(--brand-300));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.cs-compare__per {
  font-size: 12px;
  color: var(--text-2);
  font-weight: 400;
}

/* ═══════════════════════════════════════════
   PERSONA DECISION MATRIX (Chapter 03)
   ═══════════════════════════════════════════ */

.cs-matrix {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1px;
  margin: 28px 0 32px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

@media (min-width: 768px) {
  .cs-matrix {
    grid-template-columns: 1.4fr 1fr 1fr 1fr 1fr;
    margin: 32px 0 40px;
  }
}

.cs-matrix__row {
  display: contents;
}

.cs-matrix__cell {
  background: var(--bg-1);
  padding: 12px 14px;
  font-size: 13px;
  color: var(--text-1);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  text-align: center;
}

@media (min-width: 768px) {
  .cs-matrix__cell {
    padding: 14px 12px;
    min-height: 64px;
  }
}

/* Header row */
/* Header row */
.cs-matrix__row--head .cs-matrix__cell {
  background: var(--bg-2);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-0);
  letter-spacing: -0.005em;
  line-height: 1.25;
  text-align: center;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  padding-top: 16px;
  padding-bottom: 16px;
}

@media (min-width: 768px) {
  .cs-matrix__row--head .cs-matrix__cell {
    font-size: 14px;
    gap: 5px;
    padding-top: 18px;
    padding-bottom: 18px;
  }
}

.cs-matrix__sub {
  display: block;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-2);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-top: 2px;
}

.cs-matrix__row--head .cs-matrix__cell--ours {
  color: var(--brand-300);
}

@media (max-width: 767px) {
  .cs-matrix__row--head {
    display: none;
  }
}

/* Label cells */
.cs-matrix__cell--label {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--text-0);
  font-size: 13px;
  background: var(--bg-2);
  justify-content: flex-start;
  text-align: left;
}

@media (max-width: 767px) {
  .cs-matrix__cell--label {
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-2);
    min-height: 0;
    padding: 10px 14px;
  }

  .cs-matrix__cell:not(.cs-matrix__cell--label):not(.cs-matrix__cell--ours)::before {
    font-size: 10px;
    font-weight: 500;
    color: var(--text-2);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-right: auto;
    flex: 1;
    text-align: left;
  }
  .cs-matrix__row > .cs-matrix__cell:nth-child(2)::before { content: "Ops"; }
  .cs-matrix__row > .cs-matrix__cell:nth-child(3)::before { content: "Consultant"; }
  .cs-matrix__row > .cs-matrix__cell:nth-child(4)::before { content: "Enterprise"; }
}

/* FlowPilot column highlight */
.cs-matrix__cell--ours {
  background: linear-gradient(180deg, rgba(120, 64, 232, 0.10), rgba(224, 80, 168, 0.05));
  position: relative;
}

@media (min-width: 768px) {
  .cs-matrix__row--head .cs-matrix__cell--ours::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gradient-hero);
  }
}

/* Score dots */
.cs-matrix__dots {
  font-family: "JetBrains Mono", "Geist Mono", ui-monospace, monospace;
  font-size: 22px;
  font-weight: 400;
  line-height: 1;
  display: inline-block;
}

[data-score="high"] .cs-matrix__dots {
  color: var(--brand-300);
}

[data-score="mid"] .cs-matrix__dots {
  color: var(--text-1);
}

[data-score="low"] .cs-matrix__dots {
  color: var(--text-2);
  opacity: 0.6;
}

.cs-matrix__cell--ours[data-score="high"] .cs-matrix__dots {
  color: var(--brand-300);
  text-shadow: 0 0 8px var(--brand-glow-soft);
}

/* ═══════════════════════════════════════════
   SCREENSHOT FIGURE (reusable for all chapters)
   ═══════════════════════════════════════════ */

.cs-screenshot {
  margin: 32px 0;
}

@media (min-width: 1024px) {
  .cs-screenshot {
    margin: 40px 0;
  }
}

.cs-screenshot__link {
  display: block;
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-1);
  transition: all var(--duration-base) var(--ease-out);
}

.cs-screenshot__link:hover {
  border-color: var(--brand-400);
  box-shadow: 0 24px 48px -28px var(--brand-glow);
  transform: translateY(-2px);
}

.cs-screenshot__img {
  display: block;
  width: 100%;
  height: auto;
}

.cs-screenshot__caption {
  position: absolute;
  bottom: 14px;
  right: 16px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-1);
  letter-spacing: 0.01em;
  transition: all var(--duration-base) var(--ease-out);
}

.cs-screenshot__link:hover .cs-screenshot__caption {
  color: var(--brand-300);
  border-color: var(--brand-400);
  background: rgba(120, 64, 232, 0.12);
}

@media (min-width: 1024px) {
  .cs-screenshot__caption {
    bottom: 16px;
    right: 20px;
    padding: 8px 14px;
    font-size: 12px;
  }
}

.cs-screenshot__figcap {
  font-size: 13px;
  color: var(--text-2);
  font-style: italic;
  margin-top: 14px;
  text-align: center;
  line-height: 1.5;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}

/* ═══════════════════════════════════════════
   SCOPE TRIAGE · 3-column Yes/No/Deferred (Chapter 04)
   ═══════════════════════════════════════════ */

.cs-scope {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto;
  gap: 12px;
  margin: 28px 0 32px;
}

@media (min-width: 768px) {
  .cs-scope {
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: auto auto auto auto auto;  /* head + 4 items */
    gap: 14px;
    margin: 32px 0 36px;
  }
}

/* ─── Column ─── */
/* ─── Column · uses subgrid for cross-column row alignment ─── */
.cs-scope-col {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color var(--duration-base) var(--ease-out);
  display: flex;
  flex-direction: column;
}

.cs-scope-col:hover {
  border-color: var(--border-strong);
}

@media (min-width: 768px) {
  .cs-scope-col {
    display: grid;
    grid-template-rows: subgrid;
    grid-row: span 5;
    gap: 0;
  }
}

/* ─── Column variants (color coding) ─── */
.cs-scope-col--in {
  border-color: var(--border-lit);
  background:
    linear-gradient(180deg, rgba(120, 64, 232, 0.06), transparent 40%),
    var(--bg-1);
}



.cs-scope-col--later {
  background:
    linear-gradient(180deg, rgba(120, 64, 232, 0.04), transparent 40%),
    var(--bg-1);
}

/* ─── Column header ─── */
.cs-scope-col__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}

@media (min-width: 1024px) {
  .cs-scope-col__head {
    padding: 18px 20px;
  }
}

.cs-scope-col__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  flex-shrink: 0;
}

.cs-scope-col--in .cs-scope-col__icon {
  background: var(--brand-500);
  color: #fff;
  box-shadow: 0 0 12px var(--brand-glow-soft);
}

.cs-scope-col--out .cs-scope-col__icon {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-2);
  border: 1px solid var(--border);
}

.cs-scope-col--later .cs-scope-col__icon {
  background: var(--brand-glow-soft);
  color: var(--brand-300);
  border: 1px solid var(--border-lit);
  font-size: 14px;
}

.cs-scope-col__label {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-0);
  letter-spacing: -0.005em;
  flex: 1;
}

.cs-scope-col__sub {
  font-family: "JetBrains Mono", "Geist Mono", ui-monospace, monospace;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-2);
}

.cs-scope-col--in .cs-scope-col__sub {
  color: var(--brand-300);
}

.cs-scope-col--later .cs-scope-col__sub {
  color: var(--brand-300);
}

/* ─── Column list · contents lets li participate in subgrid ─── */
.cs-scope-col__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
}

@media (min-width: 768px) {
  .cs-scope-col__list {
    display: contents;
  }
}

.cs-scope-col__list li {
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

@media (min-width: 1024px) {
  .cs-scope-col__list li {
    padding: 14px 20px;
  }
}

.cs-scope-col__list li:last-child {
  border-bottom: none;
}

.cs-scope-col__title {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-0);
  line-height: 1.4;
}

.cs-scope-col__hint {
  font-family: "JetBrains Mono", "Geist Mono", ui-monospace, monospace;
  font-size: 11px;
  color: var(--text-2);
  letter-spacing: 0.04em;
}

.cs-scope-col--later .cs-scope-col__hint {
  color: var(--brand-300);
  font-weight: 500;
}

.cs-scope-col__reason {
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-2);
  font-style: italic;
  margin-top: 2px;
}

/* ═══════════════════════════════════════════
   DECISION CARDS (Chapter 05)
   ═══════════════════════════════════════════ */

.cs-decisions {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 28px 0 32px;
}

@media (min-width: 1024px) {
  .cs-decisions {
    gap: 16px;
    margin: 32px 0 36px;
  }
}

/* ─── Decision card ─── */
.cs-decision {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color var(--duration-base) var(--ease-out);
}

.cs-decision:hover {
  border-color: var(--border-strong);
}

/* ─── Card header ─── */
.cs-decision__head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-2);
}

@media (min-width: 1024px) {
  .cs-decision__head {
    padding: 18px 24px;
  }
}

.cs-decision__num {
  font-family: "JetBrains Mono", "Geist Mono", ui-monospace, monospace;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--brand-300);
  flex-shrink: 0;
}

.cs-decision__topic {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  color: var(--text-0);
  letter-spacing: -0.01em;
  margin: 0;
  line-height: 1.3;
}

@media (min-width: 1024px) {
  .cs-decision__topic {
    font-size: 18px;
  }
}

/* ─── Decision rows (considered + why) ─── */
.cs-decision__row {
  padding: 16px 20px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

@media (min-width: 768px) {
  .cs-decision__row {
    grid-template-columns: 110px 1fr;
    gap: 16px;
    padding: 18px 24px;
    align-items: start;
  }
}

.cs-decision__row--considered {
  border-bottom: 1px solid var(--border);
}

.cs-decision__label {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-2);
  padding-top: 4px;
}

/* ─── Considered options list ─── */
.cs-decision__options {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cs-decision__options li {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  padding: 6px 12px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text-1);
  line-height: 1.4;
  position: relative;
}

.cs-decision__options li.is-chosen {
  background: linear-gradient(180deg, rgba(120, 64, 232, 0.12), rgba(224, 80, 168, 0.06));
  border-color: var(--brand-400);
  color: var(--text-0);
  font-weight: 500;
}

.cs-decision__tag {
  display: inline-block;
  padding: 2px 8px;
  font-family: "JetBrains Mono", "Geist Mono", ui-monospace, monospace;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-2);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 4px;
  margin-left: auto;
}

.cs-decision__tag--chosen {
  color: var(--brand-300);
  background: var(--brand-glow-soft);
  border-color: var(--border-lit);
}

/* ─── Why this reason ─── */
.cs-decision__reason {
  font-size: 14px;
  line-height: 1.65;
  color: var(--text-1);
  margin: 0;
  padding-top: 4px;
}

.cs-decision__reason em {
  color: var(--text-0);
  font-style: italic;
  font-weight: 500;
}

/* ═══════════════════════════════════════════
   MODEL ROUTING TABLE (Chapter 06)
   ═══════════════════════════════════════════ */

.cs-routing {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1px;
  margin: 24px 0;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

@media (min-width: 768px) {
  .cs-routing {
    grid-template-columns: 50px 1.4fr 1.1fr 2.2fr;
  }
}

.cs-routing__row {
  display: contents;
}

.cs-routing__cell {
  background: var(--bg-1);
  padding: 12px 14px;
  font-size: 13px;
  color: var(--text-1);
  display: flex;
  align-items: center;
  min-height: 48px;
  line-height: 1.45;
}

@media (min-width: 768px) {
  .cs-routing__cell {
    padding: 14px 16px;
    font-size: 14px;
  }
}

.cs-routing__row--head .cs-routing__cell {
  background: var(--bg-2);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

@media (max-width: 767px) {
  .cs-routing__row--head { display: none; }
  .cs-routing__cell--num { display: none; }
}

.cs-routing__cell--num {
  font-family: "JetBrains Mono", "Geist Mono", ui-monospace, monospace;
  font-size: 12px;
  font-weight: 500;
  color: var(--brand-300);
  letter-spacing: 0.04em;
  background: var(--bg-2);
  justify-content: center;
}

.cs-routing__cell code {
  font-family: "JetBrains Mono", "Geist Mono", ui-monospace, monospace;
  font-size: 12px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 8px;
  color: var(--brand-300);
}

/* ═══════════════════════════════════════════
   COST BREAKDOWN TABLE (Chapter 06)
   ═══════════════════════════════════════════ */

.cs-cost {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 0.8fr;
  gap: 1px;
  margin: 24px 0 12px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.cs-cost__row {
  display: contents;
}

.cs-cost__cell {
  background: var(--bg-1);
  padding: 11px 14px;
  font-size: 13px;
  color: var(--text-1);
  display: flex;
  align-items: center;
  min-height: 44px;
}

.cs-cost__row--head .cs-cost__cell {
  background: var(--bg-2);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.cs-cost__cell--label {
  background: var(--bg-2);
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--text-0);
  font-size: 13px;
}

.cs-cost__cell--money {
  font-family: "JetBrains Mono", "Geist Mono", ui-monospace, monospace;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-0);
  font-variant-numeric: tabular-nums;
  justify-content: flex-end;
}

/* Total row */
.cs-cost__row--total .cs-cost__cell {
  background: linear-gradient(180deg, rgba(120, 64, 232, 0.12), rgba(224, 80, 168, 0.06));
  border-top: 1px solid var(--border-lit);
}

.cs-cost__row--total .cs-cost__cell--label {
  color: var(--brand-300);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 11px;
}

.cs-cost__cell--total {
  font-family: var(--font-display);
  font-size: 18px !important;
  font-weight: 600;
  background: linear-gradient(135deg, var(--brand-400), var(--brand-300)) text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.01em;
}

@media (max-width: 640px) {
  .cs-cost {
    grid-template-columns: 1.2fr 0.8fr;
    font-size: 12px;
  }

  .cs-cost__row--head { display: none; }

  .cs-cost__cell {
    font-size: 12px;
    padding: 8px 12px;
    min-height: 36px;
  }

  .cs-cost__row > .cs-cost__cell:nth-child(2),
  .cs-cost__row > .cs-cost__cell:nth-child(3) {
    display: none;
  }

  .cs-cost__cell--money {
    font-size: 13px;
  }
}

/* ═══════════════════════════════════════════
   FAILURE FALLBACK FLOW (Chapter 06)
   ═══════════════════════════════════════════ */

.cs-fallback {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 24px 0;
  align-items: stretch;
}

.cs-fallback__layer {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 20px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: border-color var(--duration-base) var(--ease-out);
}

.cs-fallback__layer:hover {
  border-color: var(--border-strong);
}

.cs-fallback__layer--human {
  background: linear-gradient(180deg, rgba(120, 64, 232, 0.08), rgba(224, 80, 168, 0.03));
  border-color: var(--border-lit);
}

.cs-fallback__num {
  font-family: "JetBrains Mono", "Geist Mono", ui-monospace, monospace;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--brand-300);
  padding: 4px 10px;
  background: var(--brand-glow-soft);
  border: 1px solid var(--border-lit);
  border-radius: 4px;
  flex-shrink: 0;
  min-width: 36px;
  text-align: center;
}

.cs-fallback__body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cs-fallback__name {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-0);
  letter-spacing: -0.005em;
}

.cs-fallback__detail {
  font-size: 13px;
  color: var(--text-1);
  line-height: 1.55;
}

.cs-fallback__arrow {
  text-align: center;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 16px;
  color: var(--text-2);
  line-height: 1;
  user-select: none;
}

/* ═══════════════════════════════════════════
   ROADMAP TIMELINE (Chapter 07)
   ═══════════════════════════════════════════ */

.cs-roadmap {
  margin: 28px 0 32px;
}

@media (min-width: 1024px) {
  .cs-roadmap {
    margin: 32px 0 36px;
  }
}

/* ─── Timeline track (desktop only) ─── */
.cs-roadmap__track {
  display: none;
}

@media (min-width: 768px) {
  .cs-roadmap__track {
    display: block;
    position: relative;
    height: 12px;
    margin: 0 auto 18px;
    padding: 0 12px;
  }
}

.cs-roadmap__line {
  position: absolute;
  top: 50%;
  left: 12px;
  right: 12px;
  height: 2px;
  background: linear-gradient(90deg,
    var(--brand-500) 0%,
    var(--brand-400) 50%,
    var(--accent-pink) 100%);
  transform: translateY(-50%);
  border-radius: 2px;
  opacity: 0.5;
}

.cs-roadmap__node {
  position: absolute;
  top: 50%;
  left: var(--pos);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--bg-0);
  border: 2px solid var(--brand-400);
  transform: translate(-50%, -50%);
  box-shadow: 0 0 12px var(--brand-glow-soft);
}

/* ─── Stages grid ─── */
.cs-roadmap__stages {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 768px) {
  .cs-roadmap__stages {
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: auto auto auto auto auto;
    gap: 14px;
  }
}

/* ─── Stage card · uses subgrid for row alignment across cards ─── */
.cs-roadmap-stage {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color var(--duration-base) var(--ease-out);
  display: flex;
  flex-direction: column;
}

@media (min-width: 768px) {
  .cs-roadmap__stages {
    grid-template-rows: auto;
  }

  .cs-roadmap-stage {
    display: grid;
    grid-template-rows: subgrid;
    grid-row: span 5;
    gap: 0;
  }
}

.cs-roadmap-stage:hover {
  border-color: var(--border-strong);
}

.cs-roadmap-stage__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-2);
}

.cs-roadmap-stage__phase {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--brand-300);
  letter-spacing: -0.01em;
}

.cs-roadmap-stage__time {
  font-family: "JetBrains Mono", "Geist Mono", ui-monospace, monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text-2);
}

/* ─── Stage rows ─── */
.cs-roadmap-stage__row {
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cs-roadmap-stage__row:last-child {
  border-bottom: none;
}

.cs-roadmap-stage__label {
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-2);
}

.cs-roadmap-stage__value {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-1);
}

/* ─── Kill row · highlighted ─── */
.cs-roadmap-stage__row--kill {
  background: linear-gradient(180deg, rgba(120, 64, 232, 0.08), transparent);
}

.cs-roadmap-stage__row--kill .cs-roadmap-stage__label {
  color: var(--brand-300);
}

.cs-roadmap-stage__row--kill .cs-roadmap-stage__value {
  color: var(--text-0);
  font-family: "JetBrains Mono", "Geist Mono", ui-monospace, monospace;
  font-size: 12px;
  letter-spacing: 0.01em;
}

/* ═══════════════════════════════════════════
   HONEST LIMITS · 3-column with subgrid alignment (Chapter 08)
   ═══════════════════════════════════════════ */

.cs-limits {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto;
  gap: 12px;
  margin: 28px 0 32px;
}

@media (min-width: 768px) {
  .cs-limits {
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: auto auto auto auto auto;  /* head + 4 items */
    gap: 14px;
    margin: 32px 0 36px;
  }
}

/* ─── Column · uses subgrid for cross-column row alignment ─── */
.cs-limits-col {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color var(--duration-base) var(--ease-out);
  display: flex;
  flex-direction: column;
}

.cs-limits-col:hover {
  border-color: var(--border-strong);
}

@media (min-width: 768px) {
  .cs-limits-col {
    display: grid;
    grid-template-rows: subgrid;
    grid-row: span 5;
    gap: 0;
  }
}

/* ─── Column variants (color coding) ─── */
.cs-limits-col--validated {
  border-color: var(--border-lit);
  background:
    linear-gradient(180deg, rgba(120, 64, 232, 0.06), transparent 40%),
    var(--bg-1);
}

/* unvalidated · default neutral, no special treatment */

.cs-limits-col--risk {
  background:
    linear-gradient(180deg, rgba(180, 140, 80, 0.06), transparent 40%),
    var(--bg-1);
}

/* ─── Column header ─── */
.cs-limits-col__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}

@media (min-width: 1024px) {
  .cs-limits-col__head {
    padding: 18px 20px;
  }
}

.cs-limits-col__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  flex-shrink: 0;
}

.cs-limits-col--validated .cs-limits-col__icon {
  background: var(--brand-500);
  color: #fff;
  box-shadow: 0 0 12px var(--brand-glow-soft);
}

.cs-limits-col--unvalidated .cs-limits-col__icon {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-1);
  border: 1px solid var(--border);
}

.cs-limits-col--risk .cs-limits-col__icon {
  background: rgba(180, 140, 80, 0.12);
  color: rgb(220, 190, 130);
  border: 1px solid rgba(180, 140, 80, 0.3);
}

.cs-limits-col__label {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-0);
  letter-spacing: -0.005em;
  flex: 1;
}

/* ─── List items · use subgrid for inner alignment too ─── */
.cs-limits-col__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
}

@media (min-width: 768px) {
  .cs-limits-col__list {
    display: contents;  /* let li participate in column subgrid */
  }
}

.cs-limits-col__list li {
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

@media (min-width: 1024px) {
  .cs-limits-col__list li {
    padding: 14px 20px;
  }
}

.cs-limits-col__list li:last-child {
  border-bottom: none;
}

.cs-limits-col__title {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-0);
  line-height: 1.4;
}

.cs-limits-col__detail {
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-2);
  font-style: italic;
  margin-top: 2px;
}

/* ═══════════════════════════════════════════
   REFERENCES — group headings & disclaimer
   ═══════════════════════════════════════════ */

.cs-references__group {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-0);
  letter-spacing: -0.005em;
  margin-top: 32px;
  margin-bottom: 14px;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
}

.cs-references__group:first-of-type {
  margin-top: 24px;
}

.cs-references__cited {
  font-family: "JetBrains Mono", "Geist Mono", ui-monospace, monospace;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--brand-300);
  background: var(--brand-glow-soft);
  border: 1px solid var(--border-lit);
  border-radius: 4px;
  padding: 3px 8px;
}

.cs-references__disclaimer {
  margin-top: 40px;
  padding: 16px 18px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-2);
  font-style: italic;
}