/* =============================================================================
   AI Dev Organization — Design System
   Inspired by OpenAI Platform Docs
   ============================================================================= */

/* --- Design Tokens --- */
:root {
  /* Brand Colors */
  --accent: #10B981;
  --accent-light: #D1FAE5;
  --accent-dark: #065F46;

  /* Semantic Colors */
  --blue: #3B82F6; --blue-light: #DBEAFE; --blue-dark: #1E40AF; --blue-bg: #EFF6FF;
  --green: #10B981; --green-light: #D1FAE5; --green-dark: #065F46; --green-bg: #ECFDF5;
  --orange: #F59E0B; --orange-light: #FEF3C7; --orange-dark: #92400E; --orange-bg: #FFFBEB;
  --red: #EF4444; --red-light: #FEE2E2; --red-dark: #991B1B; --red-bg: #FEF2F2;
  --purple: #8B5CF6; --purple-light: #EDE9FE; --purple-dark: #5B21B6; --purple-bg: #F5F3FF;
  --teal: #14B8A6; --teal-light: #CCFBF1; --teal-dark: #115E59; --teal-bg: #F0FDFA;
  --pink: #EC4899; --pink-light: #FCE7F3; --pink-dark: #9D174D; --pink-bg: #FDF2F8;
  --yellow: #EAB308; --yellow-light: #FEF9C3; --yellow-dark: #713F12; --yellow-bg: #FEFCE8;

  /* Neutrals */
  --gray-50: #F9FAFB;
  --gray-100: #F3F4F6;
  --gray-200: #E5E7EB;
  --gray-300: #D1D5DB;
  --gray-400: #9CA3AF;
  --gray-500: #6B7280;
  --gray-600: #4B5563;
  --gray-700: #374151;
  --gray-800: #1F2937;
  --gray-900: #111827;
  --gray-950: #030712;

  /* Surfaces */
  --bg-primary: #FFFFFF;
  --bg-secondary: #F9FAFB;
  --bg-tertiary: #F3F4F6;
  --bg-page: #F8FAFC;
  --bg-sidebar: #FAFAFA;
  --bg-code: #1E1E2E;

  /* Text */
  --text-primary: #111827;
  --text-secondary: #4B5563;
  --text-tertiary: #9CA3AF;
  --text-inverse: #FFFFFF;
  --text-link: #2563EB;
  --text-link-hover: #1D4ED8;

  /* Borders */
  --border-primary: #E5E7EB;
  --border-secondary: #F3F4F6;
  --border-focus: #3B82F6;

  /* Typography */
  --font-sans: -apple-system, BlinkMacSystemFont, 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', 'Segoe UI', sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Cascadia Code', Consolas, monospace;

  --text-xs: 0.75rem;    /* 12px */
  --text-sm: 0.8125rem;  /* 13px */
  --text-base: 0.875rem; /* 14px */
  --text-md: 0.9375rem;  /* 15px */
  --text-lg: 1.125rem;   /* 18px */
  --text-xl: 1.25rem;    /* 20px */
  --text-2xl: 1.5rem;    /* 24px */
  --text-3xl: 1.875rem;  /* 30px */
  --text-4xl: 2.25rem;   /* 36px */

  --leading-tight: 1.3;
  --leading-normal: 1.6;
  --leading-relaxed: 1.8;

  /* Spacing */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;

  /* Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-lg: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-xl: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);

  /* Layout */
  --sidebar-width: 280px;
  --content-max: 860px;
  --page-max: 1400px;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
}

/* --- Dark Mode --- */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-primary: #111827;
    --bg-secondary: #1F2937;
    --bg-tertiary: #374151;
    --bg-page: #0F172A;
    --bg-sidebar: #111827;
    --bg-code: #0D1117;
    --text-primary: #F9FAFB;
    --text-secondary: #D1D5DB;
    --text-tertiary: #6B7280;
    --text-inverse: #111827;
    --text-link: #60A5FA;
    --text-link-hover: #93BBFD;
    --border-primary: #374151;
    --border-secondary: #1F2937;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
    --shadow-md: 0 1px 3px rgba(0,0,0,0.4);
    --shadow-lg: 0 4px 6px rgba(0,0,0,0.5);
  }
}

/* --- Reset & Base --- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-sans);
  background: var(--bg-page);
  color: var(--text-primary);
  line-height: var(--leading-normal);
  font-size: var(--text-base);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--text-link); text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: var(--text-link-hover); text-decoration: underline; }
img { max-width: 100%; height: auto; }

/* --- Layout: Sidebar + Content --- */
.page-layout {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  min-height: 100vh;
}

/* --- Sidebar --- */
.sidebar {
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-primary);
  padding: var(--space-6) 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  scrollbar-width: thin;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 2px; }
.sidebar-header {
  padding: 0 var(--space-6) var(--space-6);
  border-bottom: 1px solid var(--border-primary);
  margin-bottom: var(--space-4);
}
.sidebar-logo {
  font-size: var(--text-md);
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  text-decoration: none;
}
.sidebar-logo:hover { text-decoration: none; color: var(--text-primary); }
.sidebar-logo .logo-icon {
  width: 24px; height: 24px;
  background: var(--accent);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 800; font-size: var(--text-xs);
}

.nav-section { padding: var(--space-2) var(--space-4); }
.nav-section-title {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
  padding: var(--space-2) var(--space-3);
  margin-bottom: var(--space-1);
}
.nav-link {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 6px var(--space-3);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  text-decoration: none;
  margin: 1px 0;
}
.nav-link:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  text-decoration: none;
}
.nav-link.active {
  background: var(--accent-light);
  color: var(--accent-dark);
  font-weight: 600;
}
.nav-link .nav-icon { font-size: var(--text-base); width: 20px; text-align: center; flex-shrink: 0; }
.nav-divider { height: 1px; background: var(--border-primary); margin: var(--space-3) var(--space-6); }

/* --- Main Content --- */
.main-content {
  padding: var(--space-10) var(--space-12);
  max-width: calc(var(--content-max) + var(--space-12) * 2);
}

/* --- Breadcrumb --- */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  margin-bottom: var(--space-6);
}
.breadcrumb a { color: var(--text-tertiary); }
.breadcrumb a:hover { color: var(--text-primary); }
.breadcrumb .sep { font-size: var(--text-xs); }

/* --- Page Header --- */
.page-header { margin-bottom: var(--space-10); }
.page-header h1 {
  font-size: var(--text-3xl);
  font-weight: 700;
  color: var(--text-primary);
  line-height: var(--leading-tight);
  margin-bottom: var(--space-3);
}
.page-header .lead {
  font-size: var(--text-md);
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
  max-width: 640px;
}

/* --- Typography --- */
h2 {
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--text-primary);
  margin: var(--space-12) 0 var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border-primary);
}
h3 {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--text-primary);
  margin: var(--space-8) 0 var(--space-3);
}
h4 {
  font-size: var(--text-md);
  font-weight: 600;
  color: var(--text-primary);
  margin: var(--space-6) 0 var(--space-2);
}
p { margin-bottom: var(--space-4); color: var(--text-secondary); }
strong { color: var(--text-primary); font-weight: 600; }
ul, ol { margin: var(--space-2) 0 var(--space-4) var(--space-6); color: var(--text-secondary); }
li { margin-bottom: var(--space-1); }
li::marker { color: var(--text-tertiary); }
hr { border: none; border-top: 1px solid var(--border-primary); margin: var(--space-8) 0; }
code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--bg-tertiary);
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
}

/* --- Callout Boxes --- */
.callout {
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
  margin: var(--space-4) 0;
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
  display: flex;
  gap: var(--space-3);
}
.callout .callout-icon { font-size: var(--text-lg); flex-shrink: 0; line-height: 1.4; }
.callout .callout-content { flex: 1; }
.callout .callout-title { font-weight: 700; margin-bottom: var(--space-1); }
.callout p { margin-bottom: var(--space-2); }
.callout p:last-child { margin-bottom: 0; }

.callout.info { background: var(--blue-bg); border: 1px solid var(--blue-light); color: var(--blue-dark); }
.callout.success { background: var(--green-bg); border: 1px solid var(--green-light); color: var(--green-dark); }
.callout.warning { background: var(--orange-bg); border: 1px solid var(--orange-light); color: var(--orange-dark); }
.callout.danger { background: var(--red-bg); border: 1px solid var(--red-light); color: var(--red-dark); }
.callout.tip { background: var(--purple-bg); border: 1px solid var(--purple-light); color: var(--purple-dark); }

/* --- Cards --- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-4);
  margin: var(--space-4) 0;
}
.card {
  background: var(--bg-primary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  transition: all var(--transition-normal);
}
.card:hover { box-shadow: var(--shadow-lg); border-color: var(--border-focus); }
.card-header { display: flex; align-items: center; gap: var(--space-3); margin-bottom: var(--space-3); }
.card-icon {
  width: 40px; height: 40px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: var(--text-lg);
  flex-shrink: 0;
}
.card h4 { margin: 0; font-size: var(--text-md); }
.card p { font-size: var(--text-sm); color: var(--text-secondary); margin-bottom: 0; }
.card .card-meta { font-size: var(--text-xs); color: var(--text-tertiary); margin-top: var(--space-3); }

/* Card color variants */
.card.blue { border-left: 3px solid var(--blue); }
.card.green { border-left: 3px solid var(--green); }
.card.orange { border-left: 3px solid var(--orange); }
.card.red { border-left: 3px solid var(--red); }
.card.purple { border-left: 3px solid var(--purple); }
.card.teal { border-left: 3px solid var(--teal); }
.card.pink { border-left: 3px solid var(--pink); }
.card.yellow { border-left: 3px solid var(--yellow); }

/* --- Landing Cards (for index page) --- */
.landing-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  transition: all var(--transition-normal);
  text-decoration: none;
  display: block;
  color: inherit;
}
.landing-card:hover {
  box-shadow: var(--shadow-lg);
  border-color: var(--accent);
  text-decoration: none;
  transform: translateY(-2px);
}
.landing-card .card-icon { margin-bottom: var(--space-3); }
.landing-card h3 {
  margin: 0 0 var(--space-2);
  font-size: var(--text-md);
  color: var(--text-primary);
}
.landing-card p { font-size: var(--text-sm); color: var(--text-secondary); margin: 0; }

/* --- Badges --- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  white-space: nowrap;
  gap: 4px;
}
.badge.blue { background: var(--blue-light); color: var(--blue-dark); }
.badge.green { background: var(--green-light); color: var(--green-dark); }
.badge.orange { background: var(--orange-light); color: var(--orange-dark); }
.badge.red { background: var(--red-light); color: var(--red-dark); }
.badge.purple { background: var(--purple-light); color: var(--purple-dark); }
.badge.teal { background: var(--teal-light); color: var(--teal-dark); }
.badge.pink { background: var(--pink-light); color: var(--pink-dark); }
.badge.yellow { background: var(--yellow-light); color: var(--yellow-dark); }
.badge.gray { background: var(--gray-100); color: var(--gray-700); }

/* --- Tables --- */
.table-wrapper { overflow-x: auto; margin: var(--space-4) 0; border-radius: var(--radius-lg); border: 1px solid var(--border-primary); }
table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
thead th {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-weight: 600;
  padding: var(--space-3) var(--space-4);
  text-align: left;
  border-bottom: 1px solid var(--border-primary);
  position: sticky;
  top: 0;
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-secondary);
  color: var(--text-secondary);
  vertical-align: top;
}
tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--gray-50); }

/* --- Code Blocks --- */
.code-block {
  background: var(--bg-code);
  border-radius: var(--radius-lg);
  margin: var(--space-4) 0;
  overflow: hidden;
}
.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-2) var(--space-4);
  background: rgba(255,255,255,0.05);
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.code-lang {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: rgba(255,255,255,0.5);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.code-body {
  padding: var(--space-4);
  overflow-x: auto;
}
.code-body pre {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: #E2E8F0;
  line-height: 1.7;
  white-space: pre;
}
.code-body .comment { color: #6B7280; }
.code-body .keyword { color: #C084FC; }
.code-body .string { color: #86EFAC; }
.code-body .type { color: #67E8F9; }

/* --- File Tree --- */
.file-tree {
  background: var(--bg-code);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  margin: var(--space-4) 0;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: #E2E8F0;
  line-height: 2;
  overflow-x: auto;
}
.file-tree .dir { color: var(--blue); font-weight: 600; }
.file-tree .file { color: var(--green); }
.file-tree .desc { color: var(--gray-400); font-style: italic; font-family: var(--font-sans); }

/* --- Organization Chart Nodes --- */
.org-chart { text-align: center; padding: var(--space-6) 0; }
.org-node {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  text-align: center;
  min-width: 120px;
  transition: transform var(--transition-fast);
}
.org-node:hover { transform: translateY(-2px); }
.org-node .name { font-weight: 800; font-size: var(--text-md); margin-bottom: 2px; }
.org-node .model { font-size: var(--text-xs); opacity: 0.7; }
.org-node .desc { font-size: 0.7rem; margin-top: 3px; max-width: 130px; line-height: var(--leading-tight); }

/* --- Connector Lines --- */
.v-connector { display: flex; justify-content: center; flex-direction: column; align-items: center; }
.v-line { width: 2px; height: 20px; background: var(--gray-300); }
.v-arrow { width: 0; height: 0; border-left: 6px solid transparent; border-right: 6px solid transparent; border-top: 8px solid var(--gray-300); }

/* --- Flow Steps --- */
.flow { display: flex; flex-wrap: wrap; gap: 0; align-items: stretch; justify-content: center; padding: var(--space-4) 0; }
.flow-step {
  display: flex; flex-direction: column; align-items: center; min-width: 110px;
}
.flow-step .num {
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: var(--text-sm); color: #fff;
  margin-bottom: var(--space-2);
  box-shadow: var(--shadow-md);
}
.flow-step .label { font-size: var(--text-sm); font-weight: 600; text-align: center; max-width: 100px; }
.flow-step .actor { font-size: var(--text-xs); color: var(--text-tertiary); margin-top: 2px; }
.flow-step .status {
  font-size: 0.65rem; color: #fff;
  background: var(--gray-700); padding: 2px 8px;
  border-radius: var(--radius-full); margin-top: var(--space-1);
  font-family: var(--font-mono);
}
.flow-arrow { display: flex; align-items: center; font-size: 1.4rem; color: var(--gray-300); padding: 0 var(--space-1); margin-top: -16px; }

/* --- Section Labels --- */
.section-label {
  display: inline-block;
  padding: var(--space-1) var(--space-4);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.03em;
  margin-bottom: var(--space-3);
}
.section-label.blue { background: var(--blue); color: white; }
.section-label.green { background: var(--green); color: white; }
.section-label.orange { background: var(--orange); color: white; }
.section-label.red { background: var(--red); color: white; }
.section-label.purple { background: var(--purple); color: white; }
.section-label.teal { background: var(--teal); color: white; }
.section-label.pink { background: var(--pink); color: white; }
.section-label.gray { background: var(--gray-600); color: white; }

/* --- Diagram Container --- */
.diagram {
  background: var(--bg-primary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  margin: var(--space-6) 0;
  overflow-x: auto;
}

/* --- Flow Grid (instruction flow) --- */
.flow-grid { display: grid; grid-template-columns: 180px 1fr; gap: 0; }
.flow-phase {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-secondary);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
}
.flow-content {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-secondary);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}
.flow-box {
  padding: 5px 12px;
  border-radius: var(--radius-md);
  font-size: var(--text-xs);
  font-weight: 600;
  white-space: nowrap;
}
.flow-box.blue { background: var(--blue-light); color: var(--blue-dark); }
.flow-box.green { background: var(--green-light); color: var(--green-dark); }
.flow-box.orange { background: var(--orange-light); color: var(--orange-dark); }
.flow-box.purple { background: var(--purple-light); color: var(--purple-dark); }
.flow-box.red { background: var(--red-light); color: var(--red-dark); }
.flow-box.teal { background: var(--teal-light); color: var(--teal-dark); }
.flow-box.pink { background: var(--pink-light); color: var(--pink-dark); }
.flow-box.yellow { background: var(--yellow-light); color: var(--yellow-dark); }
.flow-box.gray { background: var(--gray-100); color: var(--gray-700); }
.flow-label { font-size: var(--text-xs); color: var(--text-tertiary); font-style: italic; }
.flow-sep { color: var(--gray-300); font-size: var(--text-lg); }

/* --- Lifecycle Timeline --- */
.timeline { margin: var(--space-6) 0; }
.timeline-item {
  display: flex;
  gap: var(--space-5);
  position: relative;
  padding-bottom: var(--space-6);
}
.timeline-item:last-child { padding-bottom: 0; }
.timeline-marker {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  width: 24px;
}
.timeline-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  border: 3px solid var(--accent);
  background: var(--bg-primary);
  z-index: 1;
  flex-shrink: 0;
}
.timeline-line { width: 2px; flex: 1; background: var(--border-primary); margin-top: 2px; }
.timeline-item:last-child .timeline-line { display: none; }
.timeline-body { flex: 1; padding-top: 0; }
.timeline-title { font-weight: 600; font-size: var(--text-sm); margin-bottom: var(--space-1); }
.timeline-desc { font-size: var(--text-sm); color: var(--text-secondary); }

/* --- Checklist --- */
.checklist { list-style: none; margin: var(--space-3) 0; padding: 0; }
.checklist li {
  padding: var(--space-2) 0 var(--space-2) 28px;
  position: relative;
  font-size: var(--text-sm);
  color: var(--text-secondary);
}
.checklist li::before {
  content: '';
  position: absolute;
  left: 0; top: 10px;
  width: 16px; height: 16px;
  border: 2px solid var(--gray-300);
  border-radius: var(--radius-sm);
}
.checklist li.critical::before { border-color: var(--red); background: var(--red-light); }

/* --- Stats Row --- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: var(--space-4); margin: var(--space-4) 0; }
.stat {
  text-align: center;
  padding: var(--space-5);
  background: var(--bg-primary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
}
.stat .stat-value { font-size: var(--text-3xl); font-weight: 800; color: var(--text-primary); }
.stat .stat-label { font-size: var(--text-xs); color: var(--text-tertiary); margin-top: var(--space-1); text-transform: uppercase; letter-spacing: 0.05em; }

/* --- Two Column Layout --- */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-6); }

/* --- Architecture Boxes --- */
.arch-row { display: flex; gap: var(--space-4); margin: var(--space-3) 0; flex-wrap: wrap; justify-content: center; }
.arch-box {
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
  text-align: center;
  min-width: 180px; flex: 1; max-width: 280px;
}
.arch-box .title { font-weight: 700; font-size: var(--text-md); margin-bottom: var(--space-1); }
.arch-box .desc { font-size: var(--text-xs); opacity: 0.85; }
.arch-box.blue { background: var(--blue-light); color: var(--blue-dark); border: 2px solid var(--blue); }
.arch-box.green { background: var(--green-light); color: var(--green-dark); border: 2px solid var(--green); }
.arch-box.orange { background: var(--orange-light); color: var(--orange-dark); border: 2px solid var(--orange); }
.arch-box.purple { background: var(--purple-light); color: var(--purple-dark); border: 2px solid var(--purple); }
.arch-box.red { background: var(--red-light); color: var(--red-dark); border: 2px solid var(--red); }
.arch-box.teal { background: var(--teal-light); color: var(--teal-dark); border: 2px solid var(--teal); }
.arch-box.pink { background: var(--pink-light); color: var(--pink-dark); border: 2px solid var(--pink); }
.arch-box.gray { background: var(--gray-100); color: var(--gray-700); border: 2px solid var(--gray-300); }

.arrow-down { text-align: center; font-size: 1.4rem; color: var(--gray-300); margin: var(--space-1) 0; }
.arrow-label { text-align: center; font-size: var(--text-xs); color: var(--text-tertiary); margin: -4px 0 4px; }

/* --- Collapsible Sections --- */
details { margin: var(--space-3) 0; }
details > summary {
  cursor: pointer;
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--text-primary);
  padding: var(--space-3) var(--space-4);
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  list-style: none;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  transition: background var(--transition-fast);
}
details > summary:hover { background: var(--bg-tertiary); }
details > summary::before { content: '\25B6'; font-size: var(--text-xs); transition: transform var(--transition-fast); }
details[open] > summary::before { transform: rotate(90deg); }
details > .details-content { padding: var(--space-4) var(--space-5); border: 1px solid var(--border-primary); border-top: none; border-radius: 0 0 var(--radius-md) var(--radius-md); }

/* --- Responsive --- */
@media (max-width: 900px) {
  .page-layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .main-content { padding: var(--space-6) var(--space-4); }
  .two-col { grid-template-columns: 1fr; }
  .flow-grid { grid-template-columns: 1fr; }
  .flow-phase { border-bottom: none; padding-bottom: 0; }
}

/* --- Landing Page Specific --- */
.landing-hero {
  text-align: center;
  padding: var(--space-16) var(--space-6);
  max-width: 800px;
  margin: 0 auto;
}
.landing-hero h1 {
  font-size: var(--text-4xl);
  font-weight: 800;
  line-height: var(--leading-tight);
  margin-bottom: var(--space-4);
}
.landing-hero .lead {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto var(--space-8);
  line-height: var(--leading-relaxed);
}
.landing-stats {
  display: flex;
  justify-content: center;
  gap: var(--space-10);
  margin: var(--space-8) 0;
}
.landing-stat .value { font-size: var(--text-3xl); font-weight: 800; color: var(--accent); }
.landing-stat .label { font-size: var(--text-sm); color: var(--text-tertiary); }
.landing-sections {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 var(--space-6) var(--space-16);
}
.landing-section-title {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
  margin-bottom: var(--space-4);
  padding-left: var(--space-1);
}
