/* ============================================================
   Multi-Agent Collaboration System — Theme & Styles
   ============================================================ */

/* ----- CSS Variables (Light) ----- */
:root {
  --bg: #f4f6fb;
  --bg-card: rgba(255,255,255,0.92);
  --bg-card-solid: #ffffff;
  --bg-soft: #f8faff;
  --border: rgba(210, 220, 235, 0.7);
  --border-strong: #d0dcee;
  --text: #102a43;
  --text-secondary: #5a6f8c;
  --text-muted: #8899b4;
  --accent: #2d6cdf;
  --accent-soft: rgba(45, 108, 223, 0.08);
  --accent-glow: rgba(45, 108, 223, 0.2);
  --green: #30b86e;
  --green-soft: rgba(48, 184, 110, 0.12);
  --gold: #f1b955;
  --gold-soft: rgba(241, 185, 85, 0.12);
  --red: #e05050;
  --purple: #8b5cf6;
  --shadow-sm: 0 2px 8px rgba(16, 42, 67, 0.06);
  --shadow-md: 0 8px 30px rgba(16, 42, 67, 0.08);
  --shadow-lg: 0 20px 60px rgba(16, 42, 67, 0.1);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ----- Dark Theme ----- */
[data-theme="dark"] {
  --bg: #0b1120;
  --bg-card: rgba(20, 30, 55, 0.92);
  --bg-card-solid: #141e37;
  --bg-soft: #19233e;
  --border: rgba(60, 80, 120, 0.5);
  --border-strong: #3a5078;
  --text: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent: #60a5fa;
  --accent-soft: rgba(96, 165, 250, 0.1);
  --accent-glow: rgba(96, 165, 250, 0.15);
  --green: #4ade80;
  --gold: #fbbf24;
  --red: #f87171;
  --purple: #a78bfa;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.4);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', 'Noto Sans SC', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  transition: background var(--transition), color var(--transition);
}

a {
  color: inherit;
}

/* ============================================================ */
/* Particle Background Canvas                                    */
/* ============================================================ */
#bg-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.5;
}
[data-theme="dark"] #bg-canvas { opacity: 0.3; }

/* ============================================================ */
/* Theme Toggle                                                  */
/* ============================================================ */
.theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 100;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
}
.theme-toggle:hover {
  transform: scale(1.1);
  box-shadow: var(--shadow-md);
}
.theme-toggle .icon-sun,
.theme-toggle .icon-moon { position: absolute; transition: 0.3s; }
[data-theme="dark"] .theme-toggle .icon-sun { opacity: 1; transform: rotate(0); }
[data-theme="dark"] .theme-toggle .icon-moon { opacity: 0; transform: rotate(90deg); }
.theme-toggle .icon-sun { opacity: 0; transform: rotate(-90deg); }
.theme-toggle .icon-moon { opacity: 1; transform: rotate(0); }

/* ============================================================ */
/* Page Shell                                                   */
/* ============================================================ */
.page-shell {
  position: relative;
  z-index: 1;
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 60px;
}

.site-footer {
  margin-top: 24px;
  padding: 18px 20px 0;
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  font-size: 13px;
  line-height: 1.8;
  color: var(--text-muted);
}

.site-footer__inner a {
  text-decoration: none;
}

.site-footer__inner a:hover {
  color: var(--accent);
}

.site-footer__sep {
  opacity: 0.55;
}

/* ============================================================ */
/* HERO Section                                                 */
/* ============================================================ */
.hero {
  text-align: center;
  padding: 60px 40px 48px;
  margin-bottom: 24px;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
  transition: background var(--transition);
}
.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 30% 40%, var(--accent-soft), transparent 60%),
              radial-gradient(circle at 70% 60%, var(--green-soft), transparent 50%);
  opacity: 0.6;
  pointer-events: none;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-bottom: 24px;
  position: relative;
}
.badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse-dot 2s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 var(--green-soft); }
  50% { opacity: 0.8; box-shadow: 0 0 0 8px transparent; }
}

.hero-title {
  position: relative;
  margin-bottom: 20px;
}
.hero-title-line {
  display: block;
  font-size: clamp(44px, 7vw, 76px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.04em;
  color: var(--text);
}
.hero-title-line.accent {
  background: linear-gradient(135deg, var(--accent), var(--purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Typewriter */
.hero-typewriter {
  position: relative;
  font-size: clamp(18px, 2vw, 24px);
  color: var(--text-secondary);
  min-height: 2em;
  margin-bottom: 32px;
}
.typewriter-cursor {
  display: inline-block;
  color: var(--accent);
  animation: blink 0.8s step-end infinite;
  font-weight: 300;
}
@keyframes blink {
  50% { opacity: 0; }
}

/* Hero Metrics (animated counters) */
.hero-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  max-width: 640px;
  margin: 0 auto 32px;
  position: relative;
}
.hm-item {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 12px;
  transition: all var(--transition);
}
.hm-item:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.hm-item strong {
  display: block;
  font-size: 32px;
  font-weight: 800;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.hm-item span {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
  font-weight: 500;
}

/* Hero Buttons */
.hero-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  position: relative;
}

/* ============================================================ */
/* Shared Button Styles                                          */
/* ============================================================ */
.btn-primary, .btn-secondary, .btn-ghost, .btn-mini {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  cursor: pointer;
  font-weight: 600;
  font-size: 15px;
  padding: 14px 24px;
  border-radius: 999px;
  transition: all var(--transition);
  font-family: inherit;
}
.btn-primary {
  background: var(--accent);
  color: white;
  box-shadow: 0 8px 24px var(--accent-glow);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px var(--accent-glow);
}
.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}
.btn-secondary {
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  background: var(--accent);
  color: white;
  transform: translateY(-2px);
}
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-ghost:hover {
  background: var(--bg-soft);
  color: var(--text);
  transform: translateY(-2px);
}
.btn-mini {
  padding: 8px 16px;
  font-size: 13px;
  background: var(--bg-soft);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-mini:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

/* ============================================================ */
/* Top Navigation                                                */
/* ============================================================ */
.top-nav {
  display: flex;
  gap: 6px;
  padding: 8px 16px;
  margin-bottom: 24px;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
}
.nav-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition);
  font-family: inherit;
}
.nav-chip:hover {
  background: var(--accent-soft);
  color: var(--accent);
}
.nav-chip.active {
  background: var(--accent);
  color: white;
  box-shadow: 0 4px 16px var(--accent-glow);
}
.nav-icon { font-size: 16px; }

/* ============================================================ */
/* Panel (Sections)                                             */
/* ============================================================ */
.panel {
  display: none;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 32px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-md);
  animation: fadeUp 0.4s ease;
}
.panel.active { display: block; }

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

.section-header {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 28px;
}
.section-number {
  font-size: 48px;
  font-weight: 900;
  line-height: 1;
  color: var(--border-strong);
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}
.section-kicker {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}
.section-header h2 {
  font-size: clamp(22px, 3vw, 32px);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
}
.gradient-text {
  background: linear-gradient(135deg, var(--accent), var(--purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ============================================================ */
/* Live Chat Layout                                              */
/* ============================================================ */
.live-layout {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 20px;
  align-items: start;
}

/* Chat Card */
.chat-card {
  background: var(--bg-card-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.chat-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.chat-head-left, .chat-head-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.status-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text-muted);
}
.status-indicator.online { background: var(--green); box-shadow: 0 0 0 4px var(--green-soft); }
.status-indicator.offline { background: var(--text-muted); }
#backend-status {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}
.conv-badge {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

/* Prompt Chips */
.chat-prompts {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.prompt-chip {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
}
.prompt-chip:hover {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: transparent;
}

/* Chat Log (messages area) */
.chat-log {
  min-height: 300px;
  max-height: 460px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 4px;
  margin-bottom: 14px;
  scroll-behavior: smooth;
}
.chat-log::-webkit-scrollbar { width: 4px; }
.chat-log::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }

.msg {
  display: flex;
  gap: 12px;
  animation: msgIn 0.3s ease;
}
@keyframes msgIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.msg-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  font-weight: 700;
}
.msg.user .msg-avatar { background: var(--accent-soft); color: var(--accent); }
.msg.assistant .msg-avatar { background: var(--green-soft); color: var(--green); }
.msg.system .msg-avatar { background: var(--gold-soft); color: var(--gold); }

.msg-body {
  flex: 1;
  min-width: 0;
}
.msg-body .msg-role {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.msg-body p {
  line-height: 1.7;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}
.msg-body .msg-stream-cursor {
  display: inline-block;
  width: 2px;
  height: 1.1em;
  background: var(--accent);
  margin-left: 1px;
  animation: streamBlink 0.6s step-end infinite;
  vertical-align: text-bottom;
}
@keyframes streamBlink {
  50% { opacity: 0; }
}

/* Chat Form */
.chat-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.chat-form-row {
  display: flex;
  gap: 10px;
  align-items: end;
}
.chat-form-row .btn-primary { flex-shrink: 0; }
.chat-select-group {
  display: flex;
  gap: 8px;
  flex: 1;
}
.chat-select-group select {
  flex: 1;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
}
.chat-form textarea {
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  line-height: 1.5;
  transition: border-color var(--transition);
}
.chat-form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.chat-form textarea::placeholder { color: var(--text-muted); }

/* ============================================================ */
/* Billing Panel (right side of chat)                            */
/* ============================================================ */
.billing-panel {
  background: var(--bg-card-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: var(--shadow-sm);
}
.bp-section { }
.bp-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.bp-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}
.bp-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.bp-item {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}
.bp-item span {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 4px;
}
.bp-item strong {
  display: block;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.bp-number.number-animate {
  transition: color 0.3s;
}
.bp-number.number-animate.changed {
  color: var(--accent);
}

.bp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.bp-table td {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.bp-table td:first-child { color: var(--text-muted); width: 50%; }
.bp-table td:last-child { color: var(--text); font-weight: 600; text-align: right; }

/* Billing mini chart */
.bp-chart {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 50px;
  margin-top: 4px;
}
.bp-chart-bar {
  flex: 1;
  border-radius: 4px 4px 0 0;
  background: linear-gradient(to top, var(--accent), var(--purple));
  opacity: 0.6;
  transition: height 0.6s ease;
  min-height: 4px;
}

/* ============================================================ */
/* Architecture Section                                          */
/* ============================================================ */
.arch-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 20px;
  align-items: start;
}
.arch-steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.arch-step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-card-solid);
  color: var(--text-secondary);
  cursor: pointer;
  text-align: left;
  font-size: 14px;
  font-weight: 500;
  transition: all var(--transition);
  font-family: inherit;
}
.arch-step:hover { border-color: var(--accent); }
.arch-step.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  box-shadow: 0 8px 24px var(--accent-glow);
}
.arch-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  background: var(--accent-soft);
  color: var(--accent);
  flex-shrink: 0;
}
.arch-step.active .arch-num {
  background: rgba(255,255,255,0.2);
  color: white;
}

.arch-detail {
  background: var(--bg-card-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  min-height: 200px;
}
.arch-panel { display: none; }
.arch-panel.active { display: block; animation: fadeUp 0.3s ease; }
.arch-panel h3 { font-size: 20px; margin-bottom: 12px; }
.arch-panel p { color: var(--text-secondary); line-height: 1.7; margin-bottom: 14px; }
.arch-panel ul { padding-left: 18px; color: var(--text-secondary); line-height: 1.9; }

/* ============================================================ */
/* Multi-Agent Section ⭐                                        */
/* ============================================================ */
.agents-layout {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 20px;
  align-items: start;
}
.agents-left { display: flex; flex-direction: column; gap: 16px; }
.agents-config-card {
  background: var(--bg-card-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.agents-config-card h3 {
  font-size: 18px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.ag-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}
.ag-form-row select, .ag-form-row input {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
}
.agents-config-card textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  resize: vertical;
  margin-bottom: 10px;
}
.agents-config-card .btn-primary { width: 100%; justify-content: center; }

/* Agent list */
.agent-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  min-height: 40px;
}
.agent-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 500;
  animation: chipIn 0.3s ease;
}
@keyframes chipIn {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.agent-chip .agent-type {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent);
  color: white;
  font-weight: 600;
}
.agent-chip .agent-remove {
  cursor: pointer;
  opacity: 0.5;
  font-size: 14px;
  transition: opacity 0.2s;
  background: none;
  border: none;
  color: var(--text);
  font-family: inherit;
}
.agent-chip .agent-remove:hover { opacity: 1; }

.muted { color: var(--text-muted); font-style: italic; font-size: 13px; }

/* Strategy Selector */
.strategy-selector {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}
.strategy-option {
  padding: 14px 10px;
  border-radius: var(--radius-md);
  border: 2px solid var(--border);
  background: var(--bg-soft);
  cursor: pointer;
  text-align: center;
  transition: all var(--transition);
  font-family: inherit;
}
.strategy-option:hover { border-color: var(--accent); }
.strategy-option.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.strategy-icon {
  font-size: 24px;
  display: block;
  margin-bottom: 4px;
}
.strategy-option strong {
  display: block;
  font-size: 13px;
  color: var(--text);
}
.strategy-option small {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

#collab-input {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  resize: vertical;
  margin-bottom: 8px;
}

.debate-options {
  margin-bottom: 8px;
}
.debate-options label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}
.debate-options input {
  width: 60px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text);
  font-family: inherit;
  text-align: center;
}

/* Collab Progress Bar */
.collab-progress {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.cp-bar {
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
}
.cp-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--purple));
  width: 0%;
  transition: width 0.4s ease;
}
#cp-label { font-size: 12px; color: var(--text-muted); white-space: nowrap; }

/* Agent Canvas */
.agent-canvas-wrapper {
  position: relative;
  background: var(--bg-card-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 16px;
}
.agent-canvas-wrapper canvas {
  width: 100%;
  height: 380px;
  display: block;
}
.agent-canvas-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

/* Agent Results */
.agent-results {
  background: var(--bg-card-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.agent-results h3 {
  font-size: 16px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.badge {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}
.result-card {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 8px;
  animation: fadeUp 0.3s ease;
}
.result-card .rc-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.result-card .rc-name {
  font-weight: 700;
  font-size: 14px;
}
.result-card .rc-cost {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}
.result-card .rc-status {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
}
.result-card .rc-status.ok { background: var(--green); }
.result-card .rc-status.fail { background: var(--red); }
.result-card .rc-text {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  max-height: 60px;
  overflow: hidden;
}
.result-summary {
  margin-top: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: var(--accent-soft);
  font-size: 13px;
  line-height: 1.6;
}
.result-summary strong { color: var(--accent); }

/* ============================================================ */
/* Simulator Section                                             */
/* ============================================================ */
.sim-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 20px;
  align-items: start;
}
.sim-controls {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.sim-controls label {
  display: grid;
  gap: 8px;
  font-weight: 600;
  font-size: 14px;
}
.sim-controls select {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text);
  font-family: inherit;
  cursor: pointer;
}
.sim-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.sim-tags span {
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
}
.sim-formula {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
}
.sim-formula-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.sim-formula code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
  word-break: break-all;
}

/* Sim Timeline */
.sim-timeline {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sim-tl-step {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-soft);
  font-size: 13px;
  transition: all 0.3s;
  cursor: default;
}
.sim-tl-step.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: translateX(4px);
}
.sim-tl-step strong {
  display: block;
  color: var(--text);
  margin-bottom: 2px;
}
.sim-tl-step p {
  color: var(--text-muted);
  font-size: 12px;
  margin: 0;
}

/* Sim Visual */
.sim-visual {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.sim-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.sim-metrics article {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
}
.sim-metrics span {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 4px;
  font-weight: 500;
}
.sim-metrics strong {
  display: block;
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.sim-chart {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
}
.sim-chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  font-weight: 600;
  font-size: 14px;
}
.hit-tag {
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: var(--green-soft);
  color: var(--green);
}
.sim-bar-wrapper { margin-bottom: 10px; }
.sim-stacked-bar {
  display: flex;
  height: 28px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--border);
}
.sim-bar-seg {
  height: 100%;
  transition: width 0.5s ease;
}
.seg-uncached { background: var(--accent); }
.seg-cached { background: var(--green); }
.seg-creation { background: var(--gold); }

.sim-bar-legend {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-muted);
}
.sim-bar-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.sim-bar-legend i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.sim-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.sim-table td {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.sim-table td:first-child { color: var(--text-muted); width: 50%; }
.sim-table td:last-child { color: var(--text); font-weight: 500; text-align: right; }

/* ============================================================ */
/* Credits Section                                               */
/* ============================================================ */
.credits-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.credits-slider-card, .credits-display-card {
  background: var(--bg-card-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}
.credits-slider-card label {
  font-weight: 700;
  font-size: 16px;
  display: block;
  margin-bottom: 14px;
}
.credits-slider-card input[type="range"] {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: var(--border);
  -webkit-appearance: none;
  appearance: none;
  outline: none;
}
.credits-slider-card input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 2px 8px var(--accent-glow);
}
.credit-big-number {
  font-size: 56px;
  font-weight: 900;
  color: var(--accent);
  margin: 16px 0;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.credit-formula {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--text-muted);
}

.credit-meter {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}
.credit-meter-item {
  flex: 1;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
}
.credit-meter-item span {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
  font-weight: 500;
}
.credit-meter-item strong {
  font-size: 28px;
  font-weight: 800;
}
.credit-meter-item.highlight {
  background: var(--accent-soft);
  border-color: var(--accent);
}
.credit-meter-item.highlight strong { color: var(--accent); }

.credit-tiers {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.ct-tier {
  padding: 16px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-soft);
  text-align: center;
  transition: all var(--transition);
  cursor: default;
}
.ct-tier.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px var(--accent-glow);
}
.ct-tier span {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.ct-tier strong {
  font-size: 28px;
  font-weight: 800;
  color: var(--accent);
}

/* ============================================================ */
/* Budget Section                                                */
/* ============================================================ */
.budget-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.budget-card {
  background: var(--bg-card-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.budget-card h3 {
  font-size: 18px;
  margin-bottom: 14px;
}
.budget-set-row {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}
.budget-set-row input {
  flex: 1;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
}
.budget-set-row .btn-primary { flex-shrink: 0; }

.budget-meter {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-bottom: 10px;
}
.bm-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
}
.bm-state {
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}
.bm-state.Normal { background: var(--green-soft); color: var(--green); }
.bm-state.Warning { background: var(--gold-soft); color: var(--gold); }
.bm-state.Exceeded { background: rgba(224, 80, 80, 0.12); color: var(--red); }

.bm-bar {
  height: 8px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
  margin-bottom: 6px;
}
.bm-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.5s ease;
}
.bm-fill.normal { background: var(--accent); }
.bm-fill.warning { background: var(--gold); }
.bm-fill.exceeded { background: var(--red); }

.bm-detail {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
}

#predict-display { margin-bottom: 12px; }
.predict-result {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
}
.pred-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.pred-row:last-child { border-bottom: none; }
.pred-row span { color: var(--text-muted); }
.pred-row strong { color: var(--text); }

.predict-chart {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 60px;
  margin-top: 10px;
}
.pred-bar {
  flex: 1;
  border-radius: 3px 3px 0 0;
  background: var(--accent);
  opacity: 0.5;
  transition: height 0.4s ease;
  min-height: 3px;
}

.budget-report-card {
  margin-top: 16px;
  background: var(--bg-card-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.report-row {
  display: flex;
  gap: 10px;
  align-items: center;
}
.report-row input, .report-row select {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
}
.report-row input { flex: 1; }
#report-output {
  margin-top: 14px;
  padding: 14px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  line-height: 1.6;
  max-height: 300px;
  overflow: auto;
  white-space: pre-wrap;
  color: var(--text);
}

/* ============================================================ */
/* Presentation / Highlights                                     */
/* ============================================================ */
.pres-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}
.pres-card {
  background: var(--bg-card-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}
.pres-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}
.pres-card::after {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-soft), transparent 70%);
}
.pres-icon {
  font-size: 36px;
  font-weight: 900;
  margin-bottom: 12px;
  color: var(--icon-color, var(--accent));
  line-height: 1;
}
.pres-card h3 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 10px;
}
.pres-card p {
  color: var(--text-secondary);
  line-height: 1.7;
  font-size: 14px;
}
.pres-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}
.pres-tags span {
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
}

/* Design Patterns Bar Chart */
.pres-design-patterns {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.dp-bar {
  height: 38px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--purple));
  display: flex;
  align-items: center;
  padding: 0 18px;
  transition: width 1s ease;
  animation: dpGrow 0.8s ease-out forwards;
  opacity: 0;
  width: 0;
}
@keyframes dpGrow {
  to { opacity: 1; }
}
.dp-bar span {
  font-size: 13px;
  font-weight: 600;
  color: white;
  white-space: nowrap;
}
.dp-bar:nth-child(1) { animation-delay: 0s; }
.dp-bar:nth-child(2) { animation-delay: 0.1s; }
.dp-bar:nth-child(3) { animation-delay: 0.2s; }
.dp-bar:nth-child(4) { animation-delay: 0.3s; }
.dp-bar:nth-child(5) { animation-delay: 0.4s; }
.dp-bar:nth-child(6) { animation-delay: 0.5s; animation-delay: 0.5s; }
.dp-bar:nth-child(7) { animation-delay: 0.6s; }
.dp-bar:nth-child(8) { animation-delay: 0.7s; }
.dp-bar:nth-child(9) { animation-delay: 0.8s; }

/* ============================================================ */
/* Responsive                                                    */
/* ============================================================ */
@media (max-width: 1024px) {
  .live-layout,
  .agents-layout,
  .sim-layout,
  .arch-layout {
    grid-template-columns: 1fr;
  }
  .credits-layout,
  .budget-layout {
    grid-template-columns: 1fr;
  }
  .pres-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .hero-metrics { grid-template-columns: repeat(2, 1fr); }
  .pres-grid { grid-template-columns: 1fr; }
  .sim-metrics { grid-template-columns: repeat(2, 1fr); }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions button { justify-content: center; }
  .section-header { flex-direction: column; gap: 8px; }
  .section-number { font-size: 32px; }
  .top-nav { border-radius: var(--radius-lg); padding: 8px 12px; }
  .nav-chip { padding: 8px 12px; font-size: 13px; }
  .chat-form-row { flex-direction: column; }
  .chat-select-group { width: 100%; }
  .chat-form-row .btn-primary { width: 100%; justify-content: center; }
  .bp-grid { grid-template-columns: 1fr 1fr; }
  .report-row { flex-wrap: wrap; }
  .report-row input { width: 100%; }
  .strategy-selector { grid-template-columns: 1fr; }
  .credit-tiers { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .page-shell { width: calc(100% - 16px); padding-top: 20px; }
  .panel { padding: 20px; }
  .hero { padding: 32px 20px; }
  .hero-metrics { grid-template-columns: repeat(2, 1fr); }
  .hm-item strong { font-size: 24px; }
}

}

/* ============================================================ */
/* C++ OOP Design Section                                        */
/* ============================================================ */
.cpp-intro-box {
  background: linear-gradient(135deg, var(--accent-soft), var(--green-soft));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  margin-bottom: 32px;
}
.cpp-intro-box h3 {
  font-size: 22px;
  margin-bottom: 12px;
  color: var(--text);
}
.cpp-intro-box p {
  line-height: 1.8;
  color: var(--text-secondary);
  font-size: 15px;
}

.cpp-section-title {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 32px 0 20px;
}
.cpp-num {
  font-size: 32px;
  font-weight: 900;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.cpp-section-title h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}

.cpp-interface-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.cpp-card {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  transition: all var(--transition);
}
.cpp-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
}

.cpp-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.cpp-icon {
  font-size: 28px;
}
.cpp-card h4 {
  font-size: 18px;
  color: var(--text);
}

.cpp-card-body p {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-bottom: 10px;
}
.cpp-card-body p strong {
  color: var(--text);
  font-weight: 600;
}

.cpp-method {
  display: block;
  padding: 10px 14px;
  background: var(--bg-card-solid);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--text);
  margin: 10px 0;
  line-height: 1.5;
}

.cpp-derived-list {
  list-style: none;
  padding: 0;
  margin: 10px 0;
}
.cpp-derived-list li {
  padding: 6px 12px;
  background: var(--bg-card-solid);
  border-radius: var(--radius-sm);
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.cpp-derived-list li:before {
  content: '├─';
  margin-right: 8px;
  color: var(--accent);
}

.cpp-principle {
  font-size: 13px;
  background: var(--accent-soft);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  margin-top: 10px;
  color: var(--accent);
  font-weight: 500;
}

.cpp-relationship-box {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 32px;
}

.cpp-rel-item {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
}

.cpp-rel-type {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--accent);
  color: white;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 12px;
}

.cpp-rel-item p {
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.cpp-code-block {
  display: block;
  padding: 14px 18px;
  background: var(--bg-card-solid);
  border-left: 3px solid var(--green);
  border-radius: var(--radius-sm);
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text);
  white-space: pre-wrap;
  margin: 10px 0;
}

.cpp-list {
  padding-left: 24px;
  color: var(--text-secondary);
  line-height: 1.9;
  margin: 10px 0;
}
.cpp-list li {
  margin-bottom: 6px;
}
.cpp-list li code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  padding: 2px 6px;
  background: var(--accent-soft);
  border-radius: 4px;
  color: var(--accent);
}

.cpp-pattern-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 32px;
}

.cpp-pattern-card {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
  transition: all var(--transition);
}
.cpp-pattern-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.pattern-badge {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 10px;
}
.pattern-badge.strategy { background: var(--accent-soft); color: var(--accent); }
.pattern-badge.template { background: var(--green-soft); color: var(--green); }
.pattern-badge.factory { background: var(--gold-soft); color: var(--gold); }
.pattern-badge.observer { background: rgba(139, 92, 246, 0.12); color: var(--purple); }
.pattern-badge.facade { background: rgba(239, 68, 68, 0.12); color: var(--red); }
.pattern-badge.visitor { background: rgba(14, 165, 233, 0.12); color: #0ea5e9; }

.cpp-pattern-card h4 {
  font-size: 16px;
  margin-bottom: 10px;
  color: var(--text);
}
.cpp-pattern-card p {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-secondary);
}

.cpp-inline {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  padding: 2px 8px;
  background: var(--bg-card-solid);
  border-radius: 4px;
  color: var(--accent);
  margin-top: 8px;
  display: inline-block;
}

.cpp-integration-layout {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.cpp-integration-card {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
}

.cpp-integration-card h4 {
  font-size: 17px;
  margin-bottom: 12px;
  color: var(--text);
}

.cpp-note {
  font-size: 13px;
  background: var(--green-soft);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  margin-top: 10px;
  color: var(--green);
  font-weight: 500;
}

.cpp-function-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.cpp-func-card {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
}

.cpp-func-card h4 {
  font-size: 16px;
  margin-bottom: 12px;
  color: var(--text);
}

.cpp-func-card ol {
  padding-left: 20px;
  color: var(--text-secondary);
  line-height: 1.8;
  margin: 10px 0;
}

.cpp-advantages-box {
  background: linear-gradient(135deg, var(--accent-soft), var(--purple) 40%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-top: 32px;
}

.cpp-advantages-box h3 {
  font-size: 24px;
  margin-bottom: 20px;
  text-align: center;
  color: var(--text);
}

.cpp-adv-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.cpp-adv-item {
  background: var(--bg-card-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
  text-align: center;
}

.cpp-adv-icon {
  font-size: 36px;
  display: block;
  margin-bottom: 12px;
}

.cpp-adv-item h4 {
  font-size: 16px;
  margin-bottom: 10px;
  color: var(--text);
}

.cpp-adv-item p {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-secondary);
}

/* ============================================================ */
/* Presentation / Skill Tree Section                             */
/* ============================================================ */
.skill-tree-intro {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  margin-bottom: 28px;
  font-size: 15px;
  line-height: 1.8;
  color: var(--text-secondary);
}

.skill-categories {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-bottom: 32px;
}

.skill-category {
  background: var(--bg-soft);
  border: 2px solid var(--category-color, var(--border));
  border-radius: var(--radius-lg);
  padding: 0;
  overflow: hidden;
  transition: all var(--transition);
}
.skill-category:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.skill-category-header {
  background: var(--category-color, var(--accent));
  color: white;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.skill-category-icon {
  font-size: 36px;
  line-height: 1;
}

.skill-category-header h3 {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 4px;
}

.skill-category-subtitle {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  opacity: 0.9;
}

.skill-items {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.skill-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.skill-icon {
  font-size: 20px;
  color: var(--category-color, var(--accent));
  flex-shrink: 0;
  margin-top: 2px;
}

.skill-content h4 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.5;
  margin-bottom: 8px;
}

.skill-example, .skill-example-title {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-secondary);
}

.skill-example code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  padding: 2px 6px;
  background: var(--bg-card-solid);
  border-radius: 4px;
  color: var(--accent);
}

.skill-patterns-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 14px;
}

.skill-pattern-badge {
  background: var(--bg-card-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  text-align: center;
  transition: all var(--transition);
}
.skill-pattern-badge:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.skill-pattern-badge strong {
  display: block;
  font-size: 14px;
  color: var(--text);
  margin-bottom: 4px;
}

.skill-pattern-badge span {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
}

.tech-highlights-summary {
  background: linear-gradient(135deg, var(--accent-soft), var(--green-soft));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 32px;
}

.tech-highlights-summary h3 {
  font-size: 24px;
  text-align: center;
  margin-bottom: 24px;
  color: var(--text);
}

.tech-highlights-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
}

.tech-hl-card {
  background: var(--bg-card-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 14px;
  text-align: center;
  transition: all var(--transition);
}
.tech-hl-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.tech-hl-number {
  font-size: 32px;
  font-weight: 900;
  color: var(--accent);
  margin-bottom: 6px;
  font-variant-numeric: tabular-nums;
}

.tech-hl-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}

.comparison-section {
  margin-top: 32px;
}

.comparison-section h3 {
  font-size: 22px;
  margin-bottom: 20px;
  text-align: center;
  color: var(--text);
}

.comparison-table-wrapper {
  overflow-x: auto;
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  background: var(--bg-soft);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.comparison-table thead {
  background: var(--accent);
  color: white;
}

.comparison-table th, .comparison-table td {
  padding: 14px 18px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.comparison-table th {
  font-weight: 700;
  font-size: 15px;
}

.comparison-table tbody tr:hover {
  background: var(--accent-soft);
}

.comparison-table td strong {
  color: var(--text);
  font-weight: 600;
}

.oop-win {
  background: var(--green-soft);
  color: var(--green) !important;
  font-weight: 600;
}

/* ============================================================ */
/* Responsive Design                                             */
/* ============================================================ */
@media (max-width: 768px) {
  .cpp-interface-grid,
  .cpp-pattern-grid,
  .cpp-integration-layout,
  .cpp-function-grid,
  .cpp-adv-grid,
  .tech-highlights-grid {
    grid-template-columns: 1fr;
  }
  
  .skill-patterns-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .comparison-table {
    font-size: 12px;
  }
  
  .comparison-table th,
  .comparison-table td {
    padding: 10px 12px;
  }
}
