/* ==========================================================================
   Aivo SDK - Modern Developer Documentation Design System
   Inspired by Jetpack, Kotlinlang, Stripe Docs, and Tailwind UI
   ========================================================================== */

:root {
  /* Brand Palettes */
  --brand-primary: #6366f1;
  --brand-primary-hover: #4f46e5;
  --brand-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #d946ef 100%);
  --brand-glow: rgba(99, 102, 241, 0.25);
  
  /* Dark Theme (Default) */
  --bg-app: #0b0f19;
  --bg-surface: #111827;
  --bg-surface-elevated: #1f2937;
  --bg-glass: rgba(17, 24, 39, 0.75);
  --border-subtle: #1e293b;
  --border-medium: #334155;
  --border-highlight: rgba(99, 102, 241, 0.4);
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --text-accent: #a5b4fc;

  /* Code Syntax Theme */
  --code-bg: #090d16;
  --code-border: #1e293b;
  --syn-keyword: #f43f5e;
  --syn-string: #34d399;
  --syn-type: #38bdf8;
  --syn-func: #fbbf24;
  --syn-comment: #64748b;
  --syn-property: #c084fc;

  /* Badges & Accents */
  --color-success: #10b981;
  --color-success-bg: rgba(16, 185, 129, 0.12);
  --color-warning: #f59e0b;
  --color-warning-bg: rgba(245, 158, 11, 0.12);
  --color-danger: #ef4444;
  --color-info: #0ea5e9;

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', Menlo, Monaco, Consolas, monospace;

  /* Layout Dimensions */
  --header-height: 64px;
  --sidebar-width: 290px;
  --toc-width: 240px;
  --max-content-width: 900px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --shadow-card: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.2);
  --shadow-glow: 0 0 30px -5px rgba(99, 102, 241, 0.2);
  --transition-fast: 0.18s ease;
  --transition-normal: 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] {
  --bg-app: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #f1f5f9;
  --bg-glass: rgba(255, 255, 255, 0.82);
  --border-subtle: #e2e8f0;
  --border-medium: #cbd5e1;
  --border-highlight: rgba(99, 102, 241, 0.3);
  
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #94a3b8;
  --text-accent: #4f46e5;

  --code-bg: #0f172a;
  --code-border: #e2e8f0;
  --shadow-card: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
  --shadow-glow: 0 0 30px -5px rgba(99, 102, 241, 0.15);
}

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

html {
  font-family: var(--font-sans);
  font-size: 15px;
  color: var(--text-main);
  background-color: var(--bg-app);
  scroll-behavior: smooth;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-app);
  overflow-x: hidden;
}

/* Glass Header */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  transition: border-color var(--transition-fast);
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.brand-icon {
  width: 32px;
  height: 32px;
  background: var(--brand-gradient);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 1.1rem;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}

.brand-logo-img {
  width: 34px;
  height: 34px;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
  transition: transform var(--transition-fast);
}

.brand-logo:hover .brand-logo-img {
  transform: scale(1.06);
}

.hero-banner-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.hero-logo-card {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-logo-img {
  width: 140px;
  height: 140px;
  object-fit: cover;
  border-radius: var(--radius-xl);
  box-shadow: 0 20px 40px -10px rgba(99, 102, 241, 0.35), 0 0 50px rgba(99, 102, 241, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.12);
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.hero-logo-img:hover {
  transform: translateY(-4px) scale(1.03);
  box-shadow: 0 25px 50px -10px rgba(99, 102, 241, 0.5), 0 0 60px rgba(99, 102, 241, 0.3);
}

@media (max-width: 768px) {
  .hero-banner-content {
    flex-direction: column-reverse;
    align-items: flex-start;
  }
  .hero-logo-img {
    width: 90px;
    height: 90px;
  }
}

.version-badge {
  font-size: 0.75rem;
  padding: 0.2rem 0.55rem;
  background: var(--color-success-bg);
  color: var(--color-success);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 999px;
  font-weight: 600;
  font-family: var(--font-mono);
}

/* Viewport Audience Switcher */
.audience-tabs {
  display: flex;
  background: var(--bg-surface-elevated);
  padding: 0.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  gap: 0.25rem;
}

.audience-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 0.4rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.audience-tab:hover {
  color: var(--text-main);
}

.audience-tab.active {
  background: var(--brand-primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Search Bar Trigger */
.search-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  min-width: 220px;
}

.search-btn:hover {
  border-color: var(--border-medium);
  color: var(--text-main);
  background: var(--bg-surface);
}

.search-btn kbd {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  color: var(--text-dim);
}

.theme-toggle-btn, .github-link {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition-fast);
}

.theme-toggle-btn:hover, .github-link:hover {
  border-color: var(--border-medium);
  color: var(--text-main);
  background: var(--bg-surface-elevated);
}

.menu-toggle-btn {
  display: none;
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

/* Main Layout */
.layout-container {
  display: flex;
  flex: 1;
  max-width: 1600px;
  margin: 0 auto;
  width: 100%;
}

/* Left Sidebar */
.docs-sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  border-right: 1px solid var(--border-subtle);
  height: calc(100vh - var(--header-height));
  position: sticky;
  top: var(--header-height);
  overflow-y: auto;
  padding: 1.5rem 1rem 3rem 1.5rem;
}

.docs-sidebar::-webkit-scrollbar {
  width: 4px;
}
.docs-sidebar::-webkit-scrollbar-thumb {
  background: var(--border-subtle);
  border-radius: 4px;
}

.sidebar-nav-group {
  margin-bottom: 1.75rem;
}

.sidebar-heading {
  font-size: 0.72rem;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin-bottom: 0.6rem;
  padding-left: 0.75rem;
}

.sidebar-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.75rem;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.88rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  border-left: 2px solid transparent;
}

.sidebar-link:hover {
  color: var(--text-main);
  background: var(--bg-surface-elevated);
}

.sidebar-link.active {
  color: var(--text-accent);
  background: rgba(99, 102, 241, 0.08);
  font-weight: 600;
  border-left-color: var(--brand-primary);
}

.sidebar-link .link-icon {
  font-size: 1rem;
  opacity: 0.85;
}

/* Main Content Area */
.docs-main {
  flex: 1;
  min-width: 0;
  padding: 2.5rem 3rem 5rem 3rem;
  max-width: var(--max-content-width);
  margin: 0 auto;
}

/* Right Table of Contents */
.docs-toc {
  width: var(--toc-width);
  flex-shrink: 0;
  height: calc(100vh - var(--header-height));
  position: sticky;
  top: var(--header-height);
  overflow-y: auto;
  padding: 2.5rem 1.5rem 3rem 1rem;
}

.toc-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--text-dim);
  margin-bottom: 0.75rem;
}

.toc-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  border-left: 1px solid var(--border-subtle);
}

.toc-link {
  display: block;
  font-size: 0.82rem;
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.2rem 0 0.2rem 0.85rem;
  transition: all var(--transition-fast);
  border-left: 2px solid transparent;
  margin-left: -1px;
}

.toc-link:hover {
  color: var(--text-main);
}

.toc-link.active {
  color: var(--brand-primary);
  border-left-color: var(--brand-primary);
  font-weight: 600;
}

/* Hero Section */
.hero-banner {
  margin-bottom: 3rem;
  padding: 2.5rem;
  background: linear-gradient(180deg, rgba(99, 102, 241, 0.08) 0%, rgba(15, 23, 42, 0) 100%);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-subtle);
  position: relative;
  overflow: hidden;
}

.hero-banner::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, var(--brand-glow) 0%, transparent 70%);
  pointer-events: none;
}

.hero-tagline {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--brand-primary);
  background: rgba(99, 102, 241, 0.1);
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  margin-bottom: 1rem;
}

.hero-title {
  font-size: 2.75rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, #ffffff 30%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

[data-theme="light"] .hero-title {
  background: linear-gradient(135deg, #0f172a 30%, #475569 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-description {
  font-size: 1.15rem;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 650px;
  margin-bottom: 1.75rem;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--brand-primary);
  color: #fff;
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  text-decoration: none;
  font-size: 0.95rem;
  transition: all var(--transition-fast);
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover {
  background: var(--brand-primary-hover);
  transform: translateY(-1px);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-medium);
  color: var(--text-main);
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  text-decoration: none;
  font-size: 0.95rem;
  transition: all var(--transition-fast);
}

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

/* Typography Inside Docs */
.doc-section {
  margin-bottom: 4rem;
  scroll-margin-top: calc(var(--header-height) + 2rem);
}

.doc-section h2 {
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.doc-section h3 {
  font-size: 1.35rem;
  font-weight: 600;
  margin: 1.75rem 0 0.75rem 0;
  color: var(--text-main);
}

.doc-section p {
  line-height: 1.7;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.doc-section ul, .doc-section ol {
  margin-left: 1.5rem;
  margin-bottom: 1.25rem;
  color: var(--text-muted);
  line-height: 1.7;
}

.doc-section li {
  margin-bottom: 0.4rem;
}

/* Interactive Configurator / Playground */
.playground-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  margin: 2rem 0;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  position: relative;
  overflow: hidden;
  transition: border-color var(--transition-normal), box-shadow var(--transition-normal);
}

.playground-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--brand-primary), #10b981, #f59e0b, var(--brand-primary));
  background-size: 200% 100%;
  animation: shimmerBorder 6s linear infinite;
}

@keyframes shimmerBorder {
  0% { background-position: 0% 0%; }
  100% { background-position: 200% 0%; }
}

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

.playground-title {
  font-weight: 700;
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-main);
}

.pulse-icon {
  display: inline-block;
  color: #f59e0b;
  animation: pulseGlow 2s ease-in-out infinite;
}

@keyframes pulseGlow {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 2px rgba(245, 158, 11, 0.4)); }
  50% { transform: scale(1.15); filter: drop-shadow(0 0 6px rgba(245, 158, 11, 0.8)); }
}

/* 1-Click Presets Toolbar */
.playground-presets {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.preset-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-dim);
  margin-right: 0.2rem;
}

.preset-chip {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.preset-chip:hover {
  color: var(--text-main);
  border-color: var(--border-medium);
  transform: translateY(-1px);
}

.preset-chip.active {
  background: rgba(99, 102, 241, 0.15);
  border-color: var(--brand-primary);
  color: var(--text-accent);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.25);
}

.live-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.75rem;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-success);
  display: inline-block;
  animation: liveDotPulse 1.8s infinite;
}

@keyframes liveDotPulse {
  0% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1.1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.playground-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.control-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.full-width-control {
  grid-column: 1 / -1;
}

.control-item label {
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-dim);
}

/* Provider Pill Group */
.provider-pill-group {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.provider-pill {
  flex: 1;
  min-width: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.55rem 0.85rem;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.provider-pill:hover {
  color: var(--text-main);
  border-color: var(--border-medium);
  transform: translateY(-1px);
}

.provider-pill.active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.18), rgba(99, 102, 241, 0.08));
  border-color: var(--brand-primary);
  color: #fff;
  box-shadow: 0 2px 12px rgba(99, 102, 241, 0.3);
}

.pill-icon {
  font-size: 1.05rem;
}

/* Custom Select Container */
.select-container {
  position: relative;
  display: flex;
  align-items: center;
}

.select-container select {
  width: 100%;
  appearance: none;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 0.6rem 2.25rem 0.6rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.86rem;
  font-family: inherit;
  outline: none;
  cursor: pointer;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.select-container select:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.select-chevron {
  position: absolute;
  right: 0.75rem;
  pointer-events: none;
  color: var(--text-dim);
}

/* Capability Switch Cards */
.feature-switch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
}

.switch-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  user-select: none;
  transition: all var(--transition-fast);
  position: relative;
}

.switch-card:hover {
  border-color: var(--border-medium);
  transform: translateY(-1px);
}

.switch-card input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-indicator {
  width: 36px;
  height: 20px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  position: relative;
  flex-shrink: 0;
  transition: all 0.25s ease;
}

.switch-indicator::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #cbd5e1;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.switch-card input:checked + .switch-indicator {
  background: var(--brand-primary);
  box-shadow: 0 0 8px rgba(99, 102, 241, 0.5);
}

.switch-card input:checked + .switch-indicator::before {
  transform: translateX(16px);
  background: #fff;
}

.switch-card:has(input:checked) {
  border-color: rgba(99, 102, 241, 0.45);
  background: rgba(99, 102, 241, 0.06);
}

.switch-meta {
  display: flex;
  flex-direction: column;
}

.switch-title {
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--text-main);
}

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

/* Live Code Meta */
.live-code-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.meta-tag {
  font-size: 0.68rem;
  font-family: var(--font-mono);
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  background: rgba(99, 102, 241, 0.15);
  color: var(--text-accent);
}

/* Code block flash pulse animation upon update */
@keyframes codeRecompileFlash {
  0% {
    box-shadow: 0 0 0 2px var(--brand-primary), 0 0 20px rgba(99, 102, 241, 0.4);
    opacity: 0.75;
  }
  100% {
    box-shadow: var(--shadow-card);
    opacity: 1;
  }
}

.code-regenerating {
  animation: codeRecompileFlash 0.45s ease-out;
}

/* Feature Grid Cards */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
  margin: 1.75rem 0;
}

.feature-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  transition: all var(--transition-normal);
  display: flex;
  flex-direction: column;
}

.feature-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-highlight);
  box-shadow: var(--shadow-card);
}

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

.feature-card-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--text-main);
}

.feature-card-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Code Snippet Blocks */
.code-block {
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  border-radius: var(--radius-md);
  margin: 1.5rem 0;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 1rem;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--border-subtle);
}

.code-tabs {
  display: flex;
  gap: 0.25rem;
}

.code-tab {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 0.8rem;
  font-weight: 600;
  font-family: var(--font-mono);
  padding: 0.3rem 0.7rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.code-tab.active {
  color: var(--text-main);
  background: var(--bg-surface-elevated);
}

.copy-btn {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-dim);
  font-size: 0.75rem;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  transition: all var(--transition-fast);
}

.copy-btn:hover {
  background: var(--bg-surface-elevated);
  color: var(--text-main);
  border-color: var(--border-medium);
}

.copy-btn.copied {
  color: var(--color-success);
  border-color: var(--color-success);
}

pre {
  padding: 1.25rem 1.25rem;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.86rem;
  line-height: 1.65;
  color: #e2e8f0;
}

/* Alert Callouts */
.callout {
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  margin: 1.5rem 0;
  border-left: 4px solid;
  display: flex;
  gap: 0.85rem;
  background: var(--bg-surface);
}

.callout-tip {
  border-left-color: var(--color-success);
  background: var(--color-success-bg);
}

.callout-info {
  border-left-color: var(--brand-primary);
  background: rgba(99, 102, 241, 0.08);
}

.callout-warning {
  border-left-color: var(--color-warning);
  background: var(--color-warning-bg);
}

.callout-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.callout-content {
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text-main);
}

/* Search Modal */
.search-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 15vh;
}

.search-modal-backdrop.open {
  display: flex;
}

.search-modal {
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 600px;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  animation: modalSlide 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalSlide {
  from { opacity: 0; transform: translateY(-12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.search-input-wrapper {
  display: flex;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
  gap: 0.75rem;
}

.search-modal-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-main);
  font-size: 1.1rem;
  outline: none;
  font-family: inherit;
}

.search-results-list {
  max-height: 380px;
  overflow-y: auto;
  padding: 0.5rem;
  list-style: none;
}

.search-result-item {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  transition: background var(--transition-fast);
}

.search-result-item:hover, .search-result-item.selected {
  background: var(--bg-surface-elevated);
}

.search-result-title {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text-main);
}

.search-result-category {
  font-size: 0.75rem;
  color: var(--text-accent);
  text-transform: uppercase;
  font-weight: 600;
}

/* Architecture Matrix Table */
.data-table-wrapper {
  overflow-x: auto;
  margin: 1.5rem 0;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

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

.data-table th {
  background: var(--bg-surface-elevated);
  padding: 0.75rem 1rem;
  font-weight: 600;
  color: var(--text-main);
  border-bottom: 1px solid var(--border-subtle);
}

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

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

/* Footer */
.docs-footer {
  border-top: 1px solid var(--border-subtle);
  padding: 2.5rem 2rem;
  background: var(--bg-surface);
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-dim);
}

.docs-footer a {
  color: var(--brand-primary);
  text-decoration: none;
}

/* Responsive Media Queries */
@media (max-width: 1120px) {
  .docs-toc {
    display: none;
  }
  .docs-main {
    padding: 2rem 2rem 4rem 2rem;
  }
}

@media (max-width: 840px) {
  .menu-toggle-btn {
    display: flex;
  }
  .search-btn {
    min-width: unset;
  }
  .search-btn span {
    display: none;
  }
  .docs-sidebar {
    position: fixed;
    top: var(--header-height);
    left: -100%;
    z-index: 90;
    background: var(--bg-surface);
    transition: left var(--transition-normal);
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.4);
    height: calc(100vh - var(--header-height));
  }
  .docs-sidebar.open {
    left: 0;
  }
  .docs-main {
    padding: 1.5rem 1rem 3rem 1rem;
  }
  .hero-title {
    font-size: 2rem;
  }
}

/* ==========================================================================
   IDE Window Controls & Code Aesthetics
   ========================================================================== */
.window-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-right: 0.75rem;
}

.window-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.window-dot.dot-red { background: #ff5f56; }
.window-dot.dot-yellow { background: #ffbd2e; }
.window-dot.dot-green { background: #27c93f; }

/* Enhanced Prism IDE Syntax Styling */
code[class*="language-"], pre[class*="language-"] {
  font-family: var(--font-mono) !important;
  font-size: 0.88rem !important;
  line-height: 1.7 !important;
  direction: ltr;
  text-align: left;
  white-space: pre;
  word-spacing: normal;
  word-break: normal;
  tab-size: 4;
  hyphens: none;
  background: transparent !important;
}

.token.comment, .token.prolog, .token.doctype, .token.cdata {
  color: #768390 !important;
  font-style: italic;
}

.token.punctuation {
  color: #cdd9e5 !important;
}

.token.property, .token.tag, .token.boolean, .token.number, .token.constant, .token.symbol, .token.deleted {
  color: #6cb6ff !important;
}

.token.selector, .token.attr-name, .token.string, .token.char, .token.builtin, .token.inserted {
  color: #8ddb8c !important;
}

.token.operator, .token.entity, .token.url, .language-css .token.string, .style .token.string {
  color: #f69d50 !important;
}

.token.atrule, .token.attr-value, .token.keyword {
  color: #f47067 !important;
  font-weight: 600;
}

.token.function, .token.class-name {
  color: #dcbdfb !important;
  font-weight: 500;
}

.token.regex, .token.important, .token.variable {
  color: #ff9b5e !important;
}

/* Copy button silky smooth animation */
.copy-btn {
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 500;
}

.copy-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.copy-btn.copied {
  background: rgba(16, 185, 129, 0.15) !important;
  color: var(--color-success) !important;
  border-color: var(--color-success) !important;
  transform: scale(1.05);
}

/* Visual Architecture Flowcharts & Diagrams */
.architecture-diagram-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  margin: 2rem 0;
  box-shadow: var(--shadow-card);
}

.diagram-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
}

.diagram-title {
  font-size: 1.05rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-main);
}

.flow-step-grid {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.flow-node-row {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.flow-node {
  flex: 1;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  transition: all var(--transition-normal);
  position: relative;
}

.flow-node:hover {
  border-color: var(--brand-primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.2);
}

.flow-node-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-family: var(--font-mono);
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  background: rgba(99, 102, 241, 0.15);
  color: var(--text-accent);
  margin-bottom: 0.4rem;
}

.flow-node-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-main);
  margin-bottom: 0.25rem;
}

.flow-node-desc {
  font-size: 0.83rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.flow-arrow-down {
  display: flex;
  justify-content: center;
  color: var(--brand-primary);
  opacity: 0.8;
  margin: -0.5rem 0;
}

/* Hero Section Audience Fade Transition */
.hero-banner {
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.hero-banner.switching {
  opacity: 0.35;
  transform: scale(0.995);
}

/* ==========================================================================
   Page-wide Smooth Animations & Micro-interactions
   ========================================================================== */

/* Scroll-triggered reveal */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.65s cubic-bezier(0.16, 1, 0.3, 1), transform 0.65s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.reveal-on-scroll.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Floating animation for workflow arrows */
@keyframes floatArrowDown {
  0%, 100% {
    transform: translateY(0);
    opacity: 0.8;
  }
  50% {
    transform: translateY(5px);
    opacity: 1;
    filter: drop-shadow(0 4px 6px rgba(99, 102, 241, 0.4));
  }
}

.flow-arrow-down svg {
  animation: floatArrowDown 2.4s ease-in-out infinite;
}

/* Window controls micro-interactions */
.window-dot {
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.2s ease;
}

.window-dot:hover {
  transform: scale(1.3);
  filter: brightness(1.2);
}

/* Sidebar active link smooth indicator */
.sidebar-link {
  position: relative;
  transition: all 0.22s ease;
}

.sidebar-link:hover {
  transform: translateX(3px);
}

.sidebar-link.active {
  color: var(--text-accent);
  background: rgba(99, 102, 241, 0.12);
  border-left: 3px solid var(--brand-primary);
  box-shadow: inset 0 0 12px rgba(99, 102, 241, 0.08);
  font-weight: 600;
  transform: translateX(4px);
}

/* Primary buttons hover bounce and glow */
.btn-primary {
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  transition: all 0.25s ease;
}

.btn-secondary:hover {
  transform: translateY(-2px);
  border-color: var(--border-medium);
  background: var(--bg-surface-elevated);
}

/* Search bar pulse highlight on focus */
.search-btn:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
}

/* Architecture diagrams interactive card glow */
.architecture-diagram-card {
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.architecture-diagram-card:hover {
  border-color: rgba(99, 102, 241, 0.35);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28), 0 0 16px rgba(99, 102, 241, 0.1);
}

/* Hero card logo subtle hover float */
.hero-logo-img {
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease;
}

.hero-logo-img:hover {
  transform: scale(1.05) rotate(-1deg);
  box-shadow: 0 12px 30px rgba(99, 102, 241, 0.25);
}

/* ==========================================================================
   Modern Target Platform Selector (Step 2: Add Dependencies)
   ========================================================================== */
.platform-selector-container {
  margin: 1.5rem 0 2rem 0;
}

.platform-selector-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.platform-card-btn {
  background: var(--bg-surface);
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.15rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  cursor: pointer;
  text-align: left;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
  width: 100%;
}

.platform-card-btn:hover {
  border-color: var(--border-highlight);
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}

.platform-card-btn.active {
  border-color: var(--brand-primary);
  background: rgba(99, 102, 241, 0.08);
  box-shadow: 0 0 0 1px var(--brand-primary), 0 8px 24px rgba(99, 102, 241, 0.18);
}

.platform-card-btn.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--brand-gradient);
}

.platform-icon-box {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  flex-shrink: 0;
  transition: transform var(--transition-fast);
}

.platform-card-btn:hover .platform-icon-box {
  transform: scale(1.08);
}

.platform-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex: 1;
  min-width: 0;
}

.platform-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.platform-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
}

.platform-badge {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  font-family: var(--font-mono);
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
  white-space: nowrap;
}

.platform-badge.badge-kmp {
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
  border-color: rgba(99, 102, 241, 0.35);
}

.platform-badge.badge-jvm {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.35);
}

.platform-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.platform-panel {
  display: none;
  animation: platformFadeIn 0.28s ease-out;
}

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

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

.panel-header-banner {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.15rem 1.4rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.panel-header-main h4 {
  margin: 0 0 0.3rem 0;
  font-size: 1.1rem;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.panel-header-main p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.panel-meta-tags {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  align-items: center;
}

.panel-meta-tag {
  font-size: 0.72rem;
  font-family: var(--font-mono);
  padding: 0.2rem 0.6rem;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
}

.panel-meta-tag.highlight {
  color: var(--brand-primary);
  border-color: rgba(99, 102, 241, 0.4);
  background: rgba(99, 102, 241, 0.1);
}

/* ==========================================================================
   Narrative Interactive Lifecycle Steps (Step-by-Step Code Walkthrough)
   ========================================================================== */
.flow-timeline {
  display: flex;
  flex-direction: column;
  gap: 2.25rem;
  margin: 2rem 0;
  position: relative;
}

.flow-step-block {
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  padding: 1.75rem 2rem;
  position: relative;
  transition: all var(--transition-normal);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.flow-step-block:hover {
  border-color: rgba(99, 102, 241, 0.45);
  box-shadow: 0 8px 30px rgba(99, 102, 241, 0.12), 0 4px 20px rgba(0, 0, 0, 0.3);
}

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

.flow-step-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.15);
  color: var(--text-accent);
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.flow-step-badge.turn-user {
  background: rgba(6, 182, 212, 0.15);
  color: #67e8f9;
  border-color: rgba(6, 182, 212, 0.35);
}

.flow-step-badge.turn-model {
  background: rgba(16, 185, 129, 0.15);
  color: #6ee7b7;
  border-color: rgba(16, 185, 129, 0.35);
}

.flow-step-badge.turn-tool {
  background: rgba(245, 158, 11, 0.15);
  color: #fde68a;
  border-color: rgba(245, 158, 11, 0.35);
}

.flow-step-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0.3rem 0 0.75rem 0;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.flow-step-explanation {
  font-size: 0.93rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 1.25rem;
}

.flow-step-connector {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: -1.25rem 0;
  position: relative;
  z-index: 2;
}

.flow-connector-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-surface-elevated);
  border: 2px solid var(--brand-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand-primary);
  box-shadow: 0 0 16px rgba(99, 102, 241, 0.4);
}

/* Step 2 In-Step Pipeline Transformation Connector */
.schema-transform-connector {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin: 1.25rem 0;
  position: relative;
}

.schema-transform-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-medium), transparent);
}

.schema-transform-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  color: var(--text-muted);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-medium);
  padding: 0.45rem 1.1rem;
  border-radius: 999px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  letter-spacing: 0.01em;
}

.schema-transform-pill code {
  font-size: 0.78rem;
  color: #fde68a;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.25);
  padding: 0.12rem 0.4rem;
  border-radius: 4px;
}

/* Architecture Call Graph & Ownership Hierarchy */
.call-hierarchy-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  padding: 1.75rem 2rem;
  margin: 2rem 0;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
  position: relative;
  overflow: hidden;
}

.call-hierarchy-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #67e8f9, #818cf8, #f59e0b, #10b981);
}

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

.call-hierarchy-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.call-chain-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.call-chain-column {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.call-chain-col-header {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.col-presentation {
  background: rgba(6, 182, 212, 0.12);
  color: #67e8f9;
  border: 1px solid rgba(6, 182, 212, 0.3);
}

.col-orchestration {
  background: rgba(99, 102, 241, 0.12);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.col-domain {
  background: rgba(245, 158, 11, 0.12);
  color: #fde68a;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.col-external {
  background: rgba(16, 185, 129, 0.12);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.call-chain-node {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 1rem 1.15rem;
  position: relative;
  transition: all var(--transition-normal);
}

.call-chain-node:hover {
  border-color: var(--brand-primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.call-chain-node-title {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.call-chain-node-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.call-chain-rel-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  font-family: var(--font-mono);
  padding: 0.18rem 0.5rem;
  border-radius: 4px;
  margin-top: 0.6rem;
  font-weight: 600;
}

.rel-injected {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.rel-calls {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.rel-streams {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.call-matrix-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  margin-top: 1rem;
}

.call-matrix-table th {
  background: var(--bg-surface-elevated);
  padding: 0.65rem 0.85rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-align: left;
  border: 1px solid var(--border-medium);
  color: var(--text-accent);
}

.call-matrix-table td {
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--border-medium);
  color: var(--text-muted);
  line-height: 1.45;
}

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

