/* ============================================================================
   DATACENDIA — Shared Demo Platform CSS
   Mimics the real Cortex UI (React + Tailwind) for marketing demos
   ============================================================================ */

/* Reset & Base */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 15px; }
body {
  background: #09090b;
  color: #e4e4e7;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
  height: 100vh;
}

/* ---- Platform Header Bar ---- */
.platform-header {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 48px;
  padding: 0 16px;
  background: #18181b;
  border-bottom: 1px solid #27272a;
  flex-shrink: 0;
  z-index: 100;
}
.platform-header .ph-logo {
  font-family: 'Cormorant Garamond', 'Inter', serif;
  font-weight: 600;
  font-size: 0.95rem;
  color: #C9A227;
  letter-spacing: 0.12em;
  flex-shrink: 0;
}
.platform-header .ph-divider {
  width: 1px;
  height: 20px;
  background: #3f3f46;
}
.platform-header .ph-nav {
  display: flex;
  align-items: center;
  gap: 2px;
}
.platform-header .ph-nav-item {
  padding: 6px 12px;
  font-size: 0.78rem;
  font-weight: 500;
  color: #a1a1aa;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
  border: none;
  background: none;
  font-family: inherit;
}
.platform-header .ph-nav-item:hover { color: #e4e4e7; background: #27272a; }
.platform-header .ph-nav-item.active { color: #fff; background: #3f3f46; }
.platform-header .ph-breadcrumb {
  font-size: 0.78rem;
  color: #71717a;
}
.platform-header .ph-breadcrumb span { color: #e4e4e7; font-weight: 500; }
.platform-header .ph-spacer { flex: 1; }
.platform-header .ph-demo-badge {
  padding: 3px 10px;
  background: linear-gradient(135deg, rgba(34,197,94,0.15), rgba(16,185,129,0.15));
  color: #10b981;
  border-radius: 20px;
  font-size: 0.6rem;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  letter-spacing: 0.05em;
  border: 1px solid rgba(16,185,129,0.2);
}
.platform-header .ph-user {
  display: flex;
  align-items: center;
  gap: 8px;
}
.platform-header .ph-notif {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.15s;
  position: relative;
}
.platform-header .ph-notif:hover { background: #27272a; }
.platform-header .ph-notif-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 6px;
  height: 6px;
  background: #ef4444;
  border-radius: 50%;
  border: 1.5px solid #18181b;
}
.platform-header .ph-avatar {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
}
.platform-header .ph-back {
  color: #71717a;
  text-decoration: none;
  font-size: 0.72rem;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: color 0.15s;
  margin-left: 8px;
}
.platform-header .ph-back:hover { color: #C9A227; }

/* ---- App Layout ---- */
.app-layout {
  display: flex;
  height: calc(100vh - 48px);
  overflow: hidden;
}

/* ---- Sidebar ---- */
.sidebar {
  width: 272px;
  background: #18181b;
  border-right: 1px solid #27272a;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow-y: auto;
  overflow-x: hidden;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: #3f3f46; border-radius: 4px; }

.sb-section {
  padding: 14px 14px;
  border-bottom: 1px solid #27272a;
}
.sb-label {
  font-size: 0.6rem;
  font-weight: 600;
  color: #71717a;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 10px;
}

/* Sidebar Nav Items */
.sb-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 0.78rem;
  color: #a1a1aa;
  cursor: pointer;
  transition: all 0.15s;
  margin-bottom: 2px;
  text-decoration: none;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
}
.sb-nav-item:hover { color: #e4e4e7; background: #27272a; }
.sb-nav-item.active { color: #fff; background: #3f3f46; }
.sb-nav-item .sb-icon { font-size: 1rem; width: 20px; text-align: center; }
.sb-nav-item .sb-badge {
  margin-left: auto;
  font-size: 0.55rem;
  padding: 1px 6px;
  border-radius: 10px;
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
}

/* Sidebar Mode Card */
.sb-mode {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: linear-gradient(135deg, rgba(99,102,241,0.08), rgba(139,92,246,0.06));
  border: 1px solid rgba(99,102,241,0.2);
  border-radius: 10px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: all 0.2s;
}
.sb-mode:hover { border-color: rgba(99,102,241,0.4); }
.sb-mode-emoji { font-size: 1.2rem; }
.sb-mode-name { font-size: 0.8rem; font-weight: 600; color: #fff; }
.sb-mode-desc { font-size: 0.62rem; color: #a1a1aa; font-style: italic; }

/* Sidebar Agent Grid */
.agent-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.agent-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  background: #27272a;
  border: 1px solid #3f3f46;
  border-radius: 8px;
  font-size: 0.7rem;
  cursor: default;
  transition: all 0.2s;
  position: relative;
}
.agent-chip.active { border-color: #6366f1; background: rgba(99,102,241,0.08); }
.agent-chip.done { border-color: #22c55e; background: rgba(34,197,94,0.06); }
.agent-chip.streaming {
  border-color: #22c55e;
  box-shadow: 0 0 12px rgba(34,197,94,0.15), inset 0 0 8px rgba(34,197,94,0.05);
}
.agent-circle {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.55rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  position: relative;
}
.agent-circle .status-dot {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 2px solid #18181b;
}
.agent-chip-name {
  color: #d4d4d8;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.agent-chip .check { color: #22c55e; font-size: 0.65rem; margin-left: auto; }

/* Sidebar Phase List */
.phase-list { display: flex; flex-direction: column; gap: 4px; }
.phase-item { display: flex; align-items: center; gap: 10px; font-size: 0.75rem; padding: 4px 0; }
.phase-dot {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  font-weight: 700;
  flex-shrink: 0;
  transition: all 0.3s;
}
.phase-dot.done { background: #22c55e; color: #fff; }
.phase-dot.active { background: #6366f1; color: #fff; box-shadow: 0 0 10px rgba(99,102,241,0.3); }
.phase-dot.pending { background: #3f3f46; color: #71717a; }
.phase-name { color: #a1a1aa; transition: all 0.2s; }
.phase-name.active { font-weight: 600; color: #fff; }

/* Sidebar Action Buttons */
.sb-action {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  background: none;
  border: none;
  color: #a1a1aa;
  font-size: 0.75rem;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.15s;
  width: 100%;
  text-align: left;
  font-family: inherit;
}
.sb-action:hover { background: #27272a; color: #e4e4e7; }
.sb-action.danger { color: #ef4444; }
.sb-action.danger:hover { background: rgba(239,68,68,0.08); }

/* ---- Main Panel ---- */
.main-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #09090b;
}

/* Main Header */
.main-header {
  padding: 12px 20px;
  border-bottom: 1px solid #27272a;
  background: #18181b;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.main-header h1 {
  font-size: 0.95rem;
  font-weight: 600;
  color: #fafafa;
}
.main-header .header-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

/* ---- Badges ---- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 0.62rem;
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.02em;
}
.badge-mode { background: rgba(249,115,22,0.12); color: #fb923c; border: 1px solid rgba(249,115,22,0.2); }
.badge-live { background: rgba(34,197,94,0.12); color: #22c55e; border: 1px solid rgba(34,197,94,0.2); }
.badge-live .dot {
  width: 6px; height: 6px; background: #22c55e; border-radius: 50%;
  animation: livePulse 2s ease-in-out infinite;
}
.badge-conf { border: 1px solid transparent; }
.badge-info { background: rgba(99,102,241,0.12); color: #818cf8; border: 1px solid rgba(99,102,241,0.2); }
.badge-warn { background: rgba(234,179,8,0.12); color: #facc15; border: 1px solid rgba(234,179,8,0.2); }
.badge-danger { background: rgba(239,68,68,0.12); color: #f87171; border: 1px solid rgba(239,68,68,0.2); }
.badge-success { background: rgba(34,197,94,0.12); color: #4ade80; border: 1px solid rgba(34,197,94,0.2); }

/* ---- Agent Progress Bar ---- */
.agent-progress {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 20px;
  background: rgba(24,24,27,0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid #27272a;
  flex-wrap: wrap;
  flex-shrink: 0;
}
.agent-progress-label {
  font-size: 0.62rem;
  color: #71717a;
  font-weight: 500;
  margin-right: 4px;
}
.ap-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 0.62rem;
  font-weight: 500;
  transition: all 0.3s;
  cursor: default;
}
.ap-chip.pending { background: #27272a; color: #71717a; }
.ap-chip.streaming { background: rgba(34,197,94,0.12); color: #22c55e; }
.ap-chip.done { background: #27272a; color: #d4d4d8; }
.ap-circle {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.45rem;
  font-weight: 700;
  color: #fff;
}
.ap-chip .ap-check { color: #22c55e; font-size: 0.55rem; }
.ap-chip .ap-dot {
  width: 5px; height: 5px; background: #22c55e; border-radius: 50%;
  animation: livePulse 1.5s infinite;
}

/* ---- Controls Bar ---- */
.controls-bar {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  background: #0f0f12;
  border-bottom: 1px solid #27272a;
  flex-shrink: 0;
}
.ctrl-btn {
  padding: 8px 20px;
  border: 1px solid #3f3f46;
  border-radius: 8px;
  background: #27272a;
  color: #e4e4e7;
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 500;
}
.ctrl-btn:hover { border-color: #6366f1; color: #a5b4fc; background: #3f3f46; }
.ctrl-btn.primary {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  border-color: #6366f1;
  color: #fff;
  box-shadow: 0 2px 8px rgba(99,102,241,0.25);
}
.ctrl-btn.primary:hover { background: linear-gradient(135deg, #4f46e5, #4338ca); }
.ctrl-btn:disabled { opacity: 0.35; cursor: not-allowed; }

/* ---- Content Area ---- */
.content-area {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
}
.content-area::-webkit-scrollbar { width: 6px; }
.content-area::-webkit-scrollbar-track { background: transparent; }
.content-area::-webkit-scrollbar-thumb { background: #3f3f46; border-radius: 6px; }

/* ---- Chat / Deliberation Feed ---- */
.chat-area {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.chat-area::-webkit-scrollbar { width: 6px; }
.chat-area::-webkit-scrollbar-track { background: transparent; }
.chat-area::-webkit-scrollbar-thumb { background: #3f3f46; border-radius: 6px; }

/* User Question */
.user-question {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}
.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: #fff;
  flex-shrink: 0;
}
.user-bubble {
  flex: 1;
  background: linear-gradient(135deg, rgba(99,102,241,0.1), rgba(139,92,246,0.08));
  border: 1px solid rgba(99,102,241,0.2);
  border-radius: 14px 14px 14px 4px;
  padding: 14px 18px;
}
.user-bubble p { font-size: 0.88rem; color: #fff; font-weight: 500; line-height: 1.6; }

/* Phase Divider */
.phase-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0 14px;
}
.phase-divider .line { flex: 1; height: 1px; background: #27272a; }
.phase-divider .pill {
  padding: 4px 16px;
  border-radius: 20px;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Agent Message */
.msg {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 8px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.4s, transform 0.4s;
}
.msg.visible { opacity: 1; transform: translateY(0); }
.msg-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  position: relative;
}
.msg-avatar .online-dot {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 2px solid #09090b;
}
.msg-body { flex: 1; min-width: 0; }
.msg-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
  flex-wrap: wrap;
}
.msg-name { font-size: 0.82rem; font-weight: 600; color: #fafafa; }
.msg-role {
  font-size: 0.58rem;
  color: #a1a1aa;
  background: #27272a;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 500;
}
.msg-time { font-size: 0.55rem; color: #52525b; font-family: 'JetBrains Mono', monospace; }
.msg-streaming {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.62rem;
  color: #22c55e;
  margin-left: auto;
}
.msg-streaming .bounce {
  width: 4px;
  height: 4px;
  background: #22c55e;
  border-radius: 50%;
  animation: bounce 1s infinite;
}
.msg-streaming .bounce:nth-child(2) { animation-delay: 0.15s; }
.msg-streaming .bounce:nth-child(3) { animation-delay: 0.3s; }
.msg-bubble {
  border-radius: 12px 12px 12px 4px;
  padding: 14px 18px;
  background: #1c1c1f;
  border: 1px solid #27272a;
  font-size: 0.82rem;
  color: #d4d4d8;
  line-height: 1.7;
  max-width: 95%;
  position: relative;
  transition: all 0.3s;
}
.msg-bubble.streaming {
  background: rgba(34,197,94,0.06);
  border: 1px solid rgba(34,197,94,0.2);
}
.msg-bubble p { margin-bottom: 8px; }
.msg-bubble p:last-child { margin-bottom: 0; }
.msg-bubble strong { color: #fafafa; }

/* Message Footer */
.msg-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(255,255,255,0.04);
}
.msg-footer-left { display: flex; align-items: center; gap: 10px; }
.msg-duration { font-size: 0.6rem; color: #52525b; font-family: 'JetBrains Mono', monospace; }
.msg-reactions { display: flex; gap: 2px; }
.msg-reactions button {
  padding: 3px 8px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: 0.72rem;
  cursor: pointer;
  opacity: 0.35;
  transition: all 0.2s;
}
.msg-reactions button:hover { opacity: 1; background: #27272a; border-color: #3f3f46; }
.msg-reactions button.reacted { opacity: 1; background: #27272a; border-color: #3f3f46; }
.msg-read { font-size: 0.55rem; color: #52525b; margin-top: 3px; margin-left: 48px; }

/* Dissent */
.dissent-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding: 6px 14px;
  background: rgba(239,68,68,0.08);
  border: 1px solid rgba(239,68,68,0.25);
  border-radius: 8px;
  font-size: 0.65rem;
  color: #f87171;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 500;
}

/* Cross-Examination */
.cx-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 20px 0 10px;
}
.cx-label span:first-child { font-size: 1rem; }
.cx-label span:last-child {
  font-size: 0.62rem;
  font-weight: 600;
  color: #eab308;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.msg-bubble.cx-challenge {
  background: rgba(234,179,8,0.05);
  border: 1px solid rgba(234,179,8,0.2);
  border-left: 3px solid #eab308;
}
.msg-bubble.cx-rebuttal {
  background: rgba(6,182,212,0.05);
  border: 1px solid rgba(6,182,212,0.2);
  border-left: 3px solid #06b6d4;
}
.msg.cx-rebuttal-msg { margin-left: 24px; }

/* Synthesis */
.synthesis-msg {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #27272a;
}
.synth-avatar {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, #6366f1, #22c55e);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  box-shadow: 0 0 16px rgba(99,102,241,0.3);
}
.msg-bubble.synth {
  background: linear-gradient(135deg, rgba(99,102,241,0.08), rgba(34,197,94,0.05));
  border: 1px solid rgba(99,102,241,0.2);
  border-left: 4px solid #6366f1;
}

/* ---- Document / Export Actions ---- */
.doc-actions {
  display: flex;
  gap: 8px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #27272a;
  flex-wrap: wrap;
}
.doc-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  font-family: 'Inter', sans-serif;
}
.doc-btn.primary {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #fff;
  box-shadow: 0 2px 8px rgba(99,102,241,0.2);
}
.doc-btn.primary:hover { background: linear-gradient(135deg, #4f46e5, #4338ca); }
.doc-btn.secondary { background: #27272a; color: #d4d4d8; border: 1px solid #3f3f46; }
.doc-btn.secondary:hover { background: #3f3f46; border-color: #52525b; }
.doc-btn.success {
  background: linear-gradient(135deg, #22c55e, #059669);
  color: #fff;
  box-shadow: 0 2px 8px rgba(34,197,94,0.2);
}
.doc-btn.success:hover { background: linear-gradient(135deg, #16a34a, #047857); }
.doc-btn.gold {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  box-shadow: 0 2px 8px rgba(245,158,11,0.2);
}
.doc-btn.gold:hover { background: linear-gradient(135deg, #d97706, #b45309); }

/* ---- Section Cards (for DNA, etc.) ---- */
.section-card {
  background: #18181b;
  border: 1px solid #27272a;
  border-radius: 12px;
  margin-bottom: 12px;
  overflow: hidden;
  transition: border-color 0.2s;
}
.section-card:hover { border-color: #3f3f46; }
.section-header {
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: background 0.15s;
}
.section-header:hover { background: rgba(255,255,255,0.02); }
.section-icon { font-size: 1.1rem; }
.section-title { font-size: 0.82rem; font-weight: 600; flex: 1; color: #fafafa; }
.section-badge {
  font-size: 0.6rem;
  font-family: 'JetBrains Mono', monospace;
  padding: 2px 8px;
  border-radius: 4px;
}
.section-body {
  padding: 0 18px;
  max-height: 0;
  overflow: hidden;
  transition: all 0.3s ease;
}
.section-card.open .section-body {
  max-height: 2000px;
  padding: 0 18px 18px;
}

/* Field Rows */
.field-row { display: flex; gap: 16px; margin-bottom: 10px; flex-wrap: wrap; }
.field { flex: 1; min-width: 120px; }
.field-label {
  font-size: 0.55rem;
  color: #71717a;
  font-family: 'JetBrains Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}
.field-value { font-size: 0.8rem; color: #e4e4e7; }
.field-value.mono { font-family: 'JetBrains Mono', monospace; font-size: 0.72rem; }
.field-value.hash {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.58rem;
  color: #a1a1aa;
  word-break: break-all;
  background: #09090b;
  padding: 8px;
  border-radius: 6px;
  border: 1px solid #27272a;
}

/* ---- Demo CTA ---- */
.demo-cta {
  text-align: center;
  margin: 24px 0;
  padding: 36px;
  background: linear-gradient(135deg, rgba(99,102,241,0.06), rgba(139,92,246,0.04));
  border: 1px solid rgba(99,102,241,0.2);
  border-radius: 14px;
}
.demo-cta h3 {
  font-size: 1.1rem;
  font-weight: 400;
  color: #fafafa;
  margin-bottom: 6px;
}
.demo-cta p {
  font-size: 0.8rem;
  color: #71717a;
  margin-bottom: 18px;
}
.demo-cta a {
  display: inline-block;
  padding: 10px 28px;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  border-radius: 8px;
  color: #fff;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.82rem;
  transition: all 0.2s;
  box-shadow: 0 2px 12px rgba(99,102,241,0.3);
}
.demo-cta a:hover { background: linear-gradient(135deg, #4f46e5, #4338ca); transform: translateY(-1px); }

/* ---- Misc Components ---- */

/* Stat Card Grid */
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stat-card {
  padding: 12px;
  background: #27272a;
  border-radius: 10px;
  text-align: center;
  border: 1px solid #3f3f46;
}
.stat-val {
  font-size: 1.2rem;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  color: #fafafa;
}
.stat-label {
  font-size: 0.55rem;
  color: #71717a;
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Integrity / Verification Panel */
.integrity-card {
  padding: 14px;
  background: linear-gradient(135deg, rgba(34,197,94,0.06), rgba(6,182,212,0.04));
  border: 1px solid rgba(34,197,94,0.2);
  border-radius: 12px;
  text-align: center;
}
.integrity-icon { font-size: 1.5rem; margin-bottom: 6px; }
.integrity-status { font-size: 0.78rem; font-weight: 700; color: #22c55e; }
.integrity-detail { font-size: 0.55rem; color: #71717a; margin-top: 4px; }

/* Merkle Hash Display */
.merkle-mini {
  margin-top: 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.5rem;
  color: #71717a;
  word-break: break-all;
  background: #09090b;
  padding: 10px;
  border-radius: 8px;
  text-align: left;
  border: 1px solid #27272a;
}
.merkle-mini .root { color: #22c55e; font-weight: 600; }

/* Tab Button (for mode selectors, scenario picks) */
.tab-btn {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 14px;
  border: 1px solid #3f3f46;
  border-radius: 10px;
  background: #27272a;
  color: #a1a1aa;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Inter', sans-serif;
  margin-bottom: 4px;
}
.tab-btn:hover { border-color: #6366f1; color: #d4d4d8; }
.tab-btn.active { border-color: #6366f1; color: #a5b4fc; background: rgba(99,102,241,0.08); }
.tab-btn .tab-title { font-weight: 600; color: inherit; }
.tab-btn .tab-meta { font-size: 0.6rem; color: #71717a; margin-top: 3px; }

/* Run / Action Button */
.run-btn {
  width: 100%;
  padding: 10px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  color: #fff;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.run-btn:hover { opacity: 0.9; transform: translateY(-1px); }
.run-btn:disabled { opacity: 0.35; cursor: not-allowed; transform: none; }

/* Export Button List */
.export-btn {
  padding: 10px 12px;
  border: 1px solid #3f3f46;
  border-radius: 8px;
  background: #27272a;
  color: #d4d4d8;
  font-size: 0.72rem;
  cursor: pointer;
  text-align: left;
  font-family: 'Inter', sans-serif;
  transition: all 0.2s;
  display: block;
  width: 100%;
  margin-bottom: 4px;
}
.export-btn:hover { border-color: #6366f1; background: rgba(99,102,241,0.06); }
.export-btn span { font-size: 0.55rem; color: #71717a; display: block; margin-top: 2px; }

/* Verify Button */
.verify-btn {
  padding: 8px 18px;
  background: linear-gradient(135deg, #22c55e, #059669);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(34,197,94,0.25);
}
.verify-btn:hover { background: linear-gradient(135deg, #16a34a, #047857); }

/* ---- Animations ---- */
@keyframes livePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}
@keyframes bounce {
  0%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-5px); }
}
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---- Backstory & Briefing ---- */
.backstory {
  background: linear-gradient(135deg, rgba(6,182,212,0.06), rgba(59,130,246,0.04));
  border: 1px solid rgba(6,182,212,0.15);
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 20px;
}
.backstory h3 {
  font-size: 0.9rem;
  font-weight: 600;
  color: #06b6d4;
  margin: 0 0 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.backstory p {
  font-size: 0.82rem;
  color: #9ca3af;
  line-height: 1.7;
  margin: 0 0 6px;
}
.backstory strong { color: #e5e5e5; }
.backstory .bs-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(6,182,212,0.1);
  font-size: 0.7rem;
  color: #6b7280;
}
.backstory .bs-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}
.briefing {
  background: linear-gradient(135deg, rgba(34,197,94,0.06), rgba(6,182,212,0.04));
  border: 1px solid rgba(34,197,94,0.2);
  border-radius: 14px;
  padding: 20px;
  margin-top: 20px;
}
.briefing h3 {
  font-size: 0.9rem;
  font-weight: 600;
  color: #22c55e;
  margin: 0 0 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.briefing p {
  font-size: 0.82rem;
  color: #9ca3af;
  line-height: 1.7;
  margin: 0 0 6px;
}
.briefing strong { color: #e5e5e5; }
.briefing ul {
  margin: 8px 0;
  padding-left: 18px;
  font-size: 0.82rem;
  color: #9ca3af;
  line-height: 1.8;
}
.briefing li { margin-bottom: 2px; }
.briefing .bf-footer {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(34,197,94,0.1);
  font-size: 0.7rem;
  color: #6b7280;
  font-family: 'JetBrains Mono', monospace;
}

/* ---- Mobile Sidebar Toggle ---- */
.sidebar-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  background: #27272a;
  border-radius: 8px;
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
  z-index: 200;
}
.sidebar-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: #a1a1aa;
  border-radius: 1px;
  transition: all 0.25s;
  position: absolute;
}
.sidebar-toggle span:nth-child(1) { transform: translateY(-5px); }
.sidebar-toggle span:nth-child(2) { transform: translateY(0); }
.sidebar-toggle span:nth-child(3) { transform: translateY(5px); }
.sidebar-toggle.open span:nth-child(1) { transform: rotate(45deg); }
.sidebar-toggle.open span:nth-child(2) { opacity: 0; }
.sidebar-toggle.open span:nth-child(3) { transform: rotate(-45deg); }

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 149;
  backdrop-filter: blur(2px);
}
.sidebar-overlay.visible { display: block; }

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .sidebar-toggle { display: flex; }
  .sidebar {
    position: fixed;
    top: 48px;
    left: 0;
    bottom: 0;
    width: 280px;
    z-index: 150;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: none;
  }
  .sidebar.mobile-open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0,0,0,0.5);
  }
  .app-layout { flex-direction: column; }
  .agent-progress { overflow-x: auto; flex-wrap: nowrap; }
  .platform-header .ph-nav { display: none; }
}
