.docs-body {
  min-height: 100vh;
  color: var(--text-strong);
}

.docs-shell {
  position: relative;
  z-index: 2;
  width: min(1240px, calc(100vw - 2rem));
  margin: 0 auto;
  padding: 2rem 0 7rem;
}

.docs-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 1.5rem;
  padding: 2rem;
  margin-bottom: 1.5rem;
  background:
    radial-gradient(circle at top right, rgba(34, 197, 94, 0.18), transparent 28%),
    radial-gradient(circle at bottom left, rgba(99, 102, 241, 0.18), transparent 34%),
    linear-gradient(180deg, rgba(10, 12, 24, 0.92), rgba(7, 9, 18, 0.84));
}

.docs-pill,
.docs-kicker,
.docs-stat-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.72rem;
  font-weight: 800;
  color: #9cb8ff;
}

.docs-hero h1,
.docs-section h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(2.2rem, 4vw, 4rem);
  line-height: 0.98;
  margin: 0.75rem 0 1rem;
  color: #f8fbff;
}

.docs-section h2 {
  font-size: clamp(1.65rem, 2.8vw, 2.5rem);
}

.docs-hero-subtitle,
.docs-section-copy p,
.docs-story-step p,
.docs-card p,
.docs-outcome-card p,
.docs-stat-card p,
.docs-contrast-card p {
  color: var(--text-muted);
  line-height: 1.7;
}

.docs-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 1.5rem;
}

.docs-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  padding: 0.95rem 1.15rem;
  border-radius: 1rem;
  font-weight: 700;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.docs-btn:hover {
  transform: translateY(-1px);
}

.docs-btn-primary {
  color: white;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.92), rgba(168, 85, 247, 0.9));
  box-shadow: 0 20px 40px rgba(99, 102, 241, 0.22);
}

.docs-btn-secondary {
  color: #d7def5;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.04);
}

.docs-hero-meta {
  display: grid;
  gap: 1rem;
}

.docs-contrast {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.docs-contrast-card {
  padding: 1.5rem;
}

.docs-contrast-card h2,
.docs-big-claim h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(1.9rem, 4vw, 3.25rem);
  line-height: 1.02;
  margin: 0.7rem 0 1rem;
}

.docs-contrast-card-negative {
  background:
    radial-gradient(circle at top right, rgba(251, 113, 133, 0.18), transparent 24%),
    linear-gradient(180deg, rgba(18, 11, 22, 0.96), rgba(10, 9, 18, 0.88));
}

.docs-contrast-card-positive {
  background:
    radial-gradient(circle at top right, rgba(34, 197, 94, 0.18), transparent 24%),
    linear-gradient(180deg, rgba(9, 18, 23, 0.96), rgba(8, 10, 18, 0.88));
}

.docs-bullet-list {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--text-muted);
  display: grid;
  gap: 0.85rem;
  line-height: 1.65;
}

.docs-big-claim {
  margin-bottom: 2rem;
  padding: 2rem;
  text-align: center;
  background:
    radial-gradient(circle at top center, rgba(99, 102, 241, 0.22), transparent 30%),
    radial-gradient(circle at bottom center, rgba(20, 184, 166, 0.15), transparent 34%),
    linear-gradient(180deg, rgba(12, 15, 28, 0.98), rgba(7, 9, 18, 0.88));
}

.docs-big-claim p:last-child {
  max-width: 48rem;
  margin: 0 auto;
  color: var(--text-muted);
  line-height: 1.8;
}

.docs-stat-card,
.docs-card,
.docs-outcome-card,
.docs-service-panel {
  padding: 1.25rem;
}

.docs-stat-card strong {
  display: block;
  margin: 0.45rem 0 0.6rem;
  font-size: 1.15rem;
  color: #ffffff;
}

.docs-grid,
.docs-outcome-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.6rem;
}

.docs-story-band {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.docs-story-step {
  position: relative;
  overflow: hidden;
  padding: 1.4rem;
  background:
    radial-gradient(circle at top right, rgba(99, 102, 241, 0.12), transparent 24%),
    linear-gradient(180deg, rgba(11, 14, 28, 0.96), rgba(8, 10, 19, 0.88));
}

.docs-story-step-number {
  display: inline-flex;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.82rem;
  font-weight: 800;
  color: #9cb8ff;
  letter-spacing: 0.14em;
  margin-bottom: 0.9rem;
}

.docs-story-step h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.35rem;
  line-height: 1.06;
  margin: 0 0 0.7rem;
}

.docs-card h2,
.docs-outcome-card h3 {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0 0 0.85rem;
  color: #ffffff;
  font-size: 1.1rem;
  font-weight: 800;
}

.docs-card i,
.docs-outcome-card i {
  color: #8b5cf6;
}

.docs-section {
  margin-bottom: 3.4rem;
}

.docs-section-copy {
  max-width: 56rem;
  margin-bottom: 1rem;
  position: sticky;
  top: 4.5rem;
}

.docs-section-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.78fr) minmax(0, 1.22fr);
  gap: 1.25rem;
  align-items: start;
  min-height: min(80vh, 920px);
}

.docs-section-layout-reverse {
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
}

.docs-section-layout-stack {
  grid-template-columns: 1fr;
  min-height: auto;
}

.docs-section-layout-stack .docs-section-copy {
  position: static;
  max-width: 60rem;
  margin-bottom: 1.25rem;
}

.docs-section-layout-stack .docs-mermaid-frame {
  width: 100%;
}

.docs-story-note {
  margin-top: 1.2rem;
  padding: 1rem 1.05rem;
  background:
    radial-gradient(circle at top left, rgba(20, 184, 166, 0.12), transparent 28%),
    linear-gradient(180deg, rgba(10, 13, 24, 0.94), rgba(8, 10, 18, 0.84));
}

.docs-story-note strong {
  display: block;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #8ee4cf;
  margin-bottom: 0.55rem;
}

.docs-story-note p {
  margin: 0;
}

.docs-mermaid-frame {
  overflow: hidden;
  padding: 0;
}

.docs-mermaid-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 1rem 1.15rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  color: #f8fbff;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.03);
}

.docs-mermaid-toolbar-right,
.docs-zoom-controls {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.docs-mermaid-hint {
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
}

.docs-zoom-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.15rem;
  height: 2.15rem;
  padding: 0 0.7rem;
  border-radius: 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.05);
  color: #eef2ff;
  font-size: 0.8rem;
  font-weight: 800;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.docs-zoom-btn:hover {
  transform: translateY(-1px);
  background: rgba(99, 102, 241, 0.14);
  border-color: rgba(99, 102, 241, 0.34);
}

.docs-mermaid-canvas {
  --docs-zoom: 1;
  --docs-pan-x: 0px;
  --docs-pan-y: 0px;
  padding: 1.5rem;
  overflow-x: auto;
  overflow-y: hidden;
  cursor: grab;
  touch-action: none;
  background:
    radial-gradient(circle at top left, rgba(99, 102, 241, 0.14), transparent 26%),
    linear-gradient(180deg, rgba(10, 12, 24, 0.88), rgba(8, 10, 18, 0.88));
}

.docs-mermaid-canvas.is-dragging {
  cursor: grabbing;
}

.docs-mermaid-canvas.is-dragging svg {
  transition: none;
}

.docs-mermaid-canvas svg {
  display: block;
  max-width: none;
  height: auto;
  min-width: 980px;
  transform-origin: top left;
  transform: translate(var(--docs-pan-x), var(--docs-pan-y)) scale(var(--docs-zoom));
  transition: transform 0.22s ease;
  will-change: transform;
}

#workflowDiagram svg {
  min-width: 1220px;
}

.docs-mermaid-error {
  color: #fda4af;
  font-weight: 600;
}

.docs-service-panel {
  background:
    radial-gradient(circle at top right, rgba(45, 212, 191, 0.14), transparent 20%),
    linear-gradient(180deg, rgba(10, 12, 24, 0.9), rgba(8, 10, 18, 0.84));
}

.docs-service-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.9rem;
}

.docs-service-pill {
  padding: 1rem;
  border-radius: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
}

.docs-service-pill strong {
  display: block;
  color: white;
  margin-bottom: 0.35rem;
}

.docs-service-pill span {
  display: block;
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.docs-empty-state {
  color: var(--text-muted);
  font-style: italic;
}

.docs-reveal {
  opacity: 0;
  transform: translateY(36px) scale(0.985);
  filter: blur(10px);
  transition:
    opacity 0.7s ease,
    transform 0.9s cubic-bezier(0.22, 1, 0.36, 1),
    filter 0.7s ease;
}

.docs-reveal.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  filter: blur(0);
}

@media (max-width: 980px) {
  .docs-shell {
    width: min(100vw - 1rem, 100%);
    padding-top: 1rem;
  }

  .docs-hero,
  .docs-contrast,
  .docs-story-band,
  .docs-grid,
  .docs-outcome-grid,
  .docs-section-layout,
  .docs-section-layout-reverse {
    grid-template-columns: 1fr;
  }

  .docs-hero {
    padding: 1.35rem;
  }

  .docs-big-claim,
  .docs-contrast-card {
    padding: 1.35rem;
  }

  .docs-section-copy {
    position: static;
  }

  .docs-section-layout {
    min-height: auto;
  }

  .docs-mermaid-toolbar {
    flex-direction: column;
    align-items: flex-start;
  }

   .docs-mermaid-toolbar-right {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .docs-mermaid-canvas svg {
    min-width: 760px;
  }
}
