/* ACP Spike Report: Styles */
/* Design tokens from design-tokens.json */

/* ============================================
   CSS CUSTOM PROPERTIES (Design Tokens)
   ============================================ */

:root {
  /* Typography */
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'SF Mono', 'Cascadia Code', 'Fira Code', Consolas, 'Liberation Mono', Menlo, monospace;

  --size-xs: 0.6875rem;
  --size-sm: 0.8125rem;
  --size-base: 0.875rem;
  --size-md: 1rem;
  --size-lg: 1.125rem;
  --size-xl: 1.25rem;
  --size-2xl: 1.5rem;
  --size-3xl: 2rem;

  --line-height-tight: 1.25;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.75;

  --weight-normal: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;

  --letter-spacing-tight: -0.025em;
  --letter-spacing-normal: 0;
  --letter-spacing-wide: 0.05em;

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

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

  /* Transitions */
  --transition-fast: 120ms ease;
  --transition-normal: 200ms ease;
  --transition-slow: 300ms ease;
  --transition-spring: 400ms cubic-bezier(0.16, 1, 0.3, 1);

  /* Z-index */
  --z-dropdown: 10;
  --z-sticky: 20;
  --z-overlay: 30;
  --z-modal: 40;

  /* Sidebar */
  --sidebar-width: 260px;

  /* Component sizes */
  --btn-height-sm: 28px;
  --btn-height-md: 36px;
  --badge-height: 22px;
}

/* Dark theme (default) */
[data-theme="dark"], :root {
  --bg-primary: #0a0a0b;
  --bg-secondary: #111113;
  --bg-tertiary: #1a1a1e;
  --bg-elevated: #1e1e22;
  --bg-hover: #252529;
  --bg-active: #2a2a2f;
  --bg-input: #161618;
  --bg-code: #0d0d0f;

  --border-primary: #2a2a2f;
  --border-secondary: #222226;
  --border-subtle: #1a1a1e;
  --border-focus: #3b82f6;

  --text-primary: #f5f5f5;
  --text-secondary: #a1a1aa;
  --text-muted: #52525b;
  --text-inverse: #0a0a0b;
  --text-link: #60a5fa;

  --accent-blue: #3b82f6;
  --accent-blue-hover: #2563eb;
  --accent-blue-muted: rgba(59, 130, 246, 0.15);
  --accent-green: #22c55e;
  --accent-green-hover: #16a34a;
  --accent-green-muted: rgba(34, 197, 94, 0.15);
  --accent-amber: #f59e0b;
  --accent-amber-hover: #d97706;
  --accent-amber-muted: rgba(245, 158, 11, 0.15);
  --accent-red: #ef4444;
  --accent-red-hover: #dc2626;
  --accent-red-muted: rgba(239, 68, 68, 0.15);
  --accent-purple: #a855f7;
  --accent-purple-muted: rgba(168, 85, 247, 0.15);
  --accent-gray: #71717a;
  --accent-gray-muted: rgba(113, 113, 122, 0.15);

  --status-idle: #71717a;
  --status-working: #3b82f6;
  --status-success: #22c55e;
  --status-warning: #f59e0b;
  --status-error: #ef4444;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.6);
  --shadow-glow-blue: 0 0 20px rgba(59, 130, 246, 0.15);

  --btn-primary-bg: #3b82f6;
  --btn-primary-text: #ffffff;
  --btn-primary-hover: #2563eb;
  --btn-secondary-bg: #1e1e22;
  --btn-secondary-text: #f5f5f5;
  --btn-secondary-border: #2a2a2f;
  --btn-secondary-hover: #252529;
  --btn-ghost-bg: transparent;
  --btn-ghost-text: #a1a1aa;
  --btn-ghost-hover: #1e1e22;

  --card-bg: #111113;
  --card-border: #2a2a2f;

  --table-header-bg: #0a0a0b;
  --table-row-hover: #1a1a1e;
  --table-border: #1a1a1e;

  --badge-blue-bg: rgba(59, 130, 246, 0.15);
  --badge-blue-text: #60a5fa;
  --badge-green-bg: rgba(34, 197, 94, 0.15);
  --badge-green-text: #4ade80;
  --badge-amber-bg: rgba(245, 158, 11, 0.15);
  --badge-amber-text: #fbbf24;
  --badge-red-bg: rgba(239, 68, 68, 0.15);
  --badge-red-text: #f87171;
  --badge-gray-bg: rgba(113, 113, 122, 0.15);
  --badge-gray-text: #a1a1aa;
  --badge-purple-bg: rgba(168, 85, 247, 0.15);
  --badge-purple-text: #c084fc;

  --progress-track: #1a1a1e;
  --progress-fill: #3b82f6;
}

/* Light theme */
[data-theme="light"] {
  --bg-primary: #ffffff;
  --bg-secondary: #f9fafb;
  --bg-tertiary: #f3f4f6;
  --bg-elevated: #ffffff;
  --bg-hover: #f3f4f6;
  --bg-active: #e5e7eb;
  --bg-input: #ffffff;
  --bg-code: #f9fafb;

  --border-primary: #e5e7eb;
  --border-secondary: #d1d5db;
  --border-subtle: #f3f4f6;
  --border-focus: #3b82f6;

  --text-primary: #111827;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  --text-inverse: #ffffff;
  --text-link: #2563eb;

  --accent-blue: #3b82f6;
  --accent-blue-hover: #2563eb;
  --accent-blue-muted: rgba(59, 130, 246, 0.10);
  --accent-green: #16a34a;
  --accent-green-hover: #15803d;
  --accent-green-muted: rgba(22, 163, 74, 0.10);
  --accent-amber: #d97706;
  --accent-amber-hover: #b45309;
  --accent-amber-muted: rgba(217, 119, 6, 0.10);
  --accent-red: #dc2626;
  --accent-red-hover: #b91c1c;
  --accent-red-muted: rgba(220, 38, 38, 0.10);
  --accent-purple: #9333ea;
  --accent-purple-muted: rgba(147, 51, 234, 0.10);
  --accent-gray: #6b7280;
  --accent-gray-muted: rgba(107, 114, 128, 0.10);

  --status-idle: #9ca3af;
  --status-working: #3b82f6;
  --status-success: #16a34a;
  --status-warning: #d97706;
  --status-error: #dc2626;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
  --shadow-glow-blue: 0 0 20px rgba(59, 130, 246, 0.08);

  --btn-primary-bg: #3b82f6;
  --btn-primary-text: #ffffff;
  --btn-primary-hover: #2563eb;
  --btn-secondary-bg: #ffffff;
  --btn-secondary-text: #111827;
  --btn-secondary-border: #e5e7eb;
  --btn-secondary-hover: #f3f4f6;
  --btn-ghost-bg: transparent;
  --btn-ghost-text: #6b7280;
  --btn-ghost-hover: #f3f4f6;

  --card-bg: #ffffff;
  --card-border: #e5e7eb;

  --table-header-bg: #f9fafb;
  --table-row-hover: #f9fafb;
  --table-border: #f3f4f6;

  --badge-blue-bg: rgba(59, 130, 246, 0.10);
  --badge-blue-text: #2563eb;
  --badge-green-bg: rgba(22, 163, 74, 0.10);
  --badge-green-text: #16a34a;
  --badge-amber-bg: rgba(217, 119, 6, 0.10);
  --badge-amber-text: #d97706;
  --badge-red-bg: rgba(220, 38, 38, 0.10);
  --badge-red-text: #dc2626;
  --badge-gray-bg: rgba(107, 114, 128, 0.10);
  --badge-gray-text: #6b7280;
  --badge-purple-bg: rgba(147, 51, 234, 0.10);
  --badge-purple-text: #9333ea;

  --progress-track: #e5e7eb;
  --progress-fill: #3b82f6;
}

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes status-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes slide-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slide-in-left {
  from { transform: translateX(-100%); }
  to { transform: translateX(0); }
}

/* ============================================
   RESET & BASE
   ============================================ */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  font-family: var(--font-sans);
  font-size: var(--size-base);
  line-height: var(--line-height-normal);
  color: var(--text-primary);
  background-color: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

a {
  color: var(--text-link);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ============================================
   LAYOUT
   ============================================ */

.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ============================================
   SIDEBAR
   ============================================ */

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--bg-primary);
  border-right: 1px solid var(--border-subtle);
  padding: var(--sp-4) var(--sp-3);
  display: flex;
  flex-direction: column;
  z-index: var(--z-sticky);
  overflow-y: auto;
  transition: transform var(--transition-spring), background-color var(--transition-normal), border-color var(--transition-normal);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-3);
  margin-bottom: var(--sp-6);
}

.sidebar-logo-icon {
  width: 28px;
  height: 28px;
  background: var(--accent-blue);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: var(--weight-bold);
  font-size: var(--size-sm);
  flex-shrink: 0;
}

.sidebar-logo-text {
  font-size: var(--size-md);
  font-weight: var(--weight-bold);
  color: var(--text-primary);
  letter-spacing: var(--letter-spacing-tight);
}

.sidebar-label {
  font-size: var(--size-xs);
  font-weight: var(--weight-semibold);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: var(--letter-spacing-wide);
  padding: var(--sp-4) var(--sp-3) var(--sp-2);
}

.sidebar-nav {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 0 var(--sp-3);
  height: 32px;
  border-radius: 6px;
  font-size: var(--size-sm);
  color: var(--text-secondary);
  text-decoration: none;
  transition: background-color var(--transition-fast), color var(--transition-fast);
  cursor: pointer;
}

.sidebar-nav a:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  text-decoration: none;
}

.sidebar-nav a.active {
  background: var(--accent-blue-muted);
  color: var(--accent-blue);
}

.sidebar-nav .nav-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.7;
}

.sidebar-nav a.active .nav-icon {
  opacity: 1;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: var(--sp-4);
  border-top: 1px solid var(--border-subtle);
}

.sidebar-footer-text {
  font-size: var(--size-xs);
  color: var(--text-muted);
  padding: var(--sp-2) var(--sp-3);
  line-height: var(--line-height-relaxed);
}

/* Overlay for mobile sidebar */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: calc(var(--z-sticky) - 1);
}

/* ============================================
   HEADER
   ============================================ */

.header {
  position: sticky;
  top: 0;
  height: 56px;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--sp-6);
  z-index: var(--z-sticky);
  transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

.header-left {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.hamburger {
  display: none;
  width: 36px;
  height: 36px;
  border: none;
  background: none;
  cursor: pointer;
  padding: var(--sp-2);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  transition: background-color var(--transition-fast);
}

.hamburger:hover {
  background: var(--bg-hover);
}

.hamburger svg {
  width: 20px;
  height: 20px;
}

.header-title {
  font-size: var(--size-sm);
  font-weight: var(--weight-medium);
  color: var(--text-secondary);
}

.header-right {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.theme-toggle {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border-primary);
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: background-color var(--transition-fast), color var(--transition-fast), border-color var(--transition-normal);
}

.theme-toggle:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
}

/* ============================================
   MAIN CONTENT
   ============================================ */

.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-width: 0;
}

.content-area {
  max-width: 900px;
  margin: 0 auto;
  padding: var(--sp-10) var(--sp-6) var(--sp-20);
}

/* ============================================
   SECTIONS
   ============================================ */

.section {
  margin-bottom: var(--sp-16);
  animation: slide-in var(--transition-slow) ease;
}

.section-header {
  margin-bottom: var(--sp-8);
}

.section-header h2 {
  font-size: var(--size-3xl);
  font-weight: var(--weight-bold);
  color: var(--text-primary);
  letter-spacing: var(--letter-spacing-tight);
  margin-bottom: var(--sp-3);
}

.section-header .section-subtitle {
  font-size: var(--size-md);
  color: var(--text-secondary);
  line-height: var(--line-height-relaxed);
}

.section-anchor {
  color: var(--text-muted);
  text-decoration: none;
  margin-left: var(--sp-2);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.section-header:hover .section-anchor {
  opacity: 1;
}

.subsection {
  margin-bottom: var(--sp-10);
}

.subsection h3 {
  font-size: var(--size-xl);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  margin-bottom: var(--sp-4);
}

.subsection h4 {
  font-size: var(--size-md);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  margin-bottom: var(--sp-3);
}

/* ============================================
   TYPOGRAPHY IN CONTENT
   ============================================ */

.prose {
  color: var(--text-secondary);
  line-height: var(--line-height-relaxed);
  font-size: var(--size-base);
}

.prose p {
  margin-bottom: var(--sp-4);
}

.prose strong {
  color: var(--text-primary);
  font-weight: var(--weight-semibold);
}

.prose ul, .prose ol {
  margin-bottom: var(--sp-4);
  padding-left: var(--sp-6);
}

.prose li {
  margin-bottom: var(--sp-2);
}

.prose code {
  font-family: var(--font-mono);
  font-size: var(--size-sm);
  background: var(--bg-tertiary);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  color: var(--accent-blue);
}

.prose pre {
  background: var(--bg-code);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  padding: var(--sp-4);
  margin-bottom: var(--sp-4);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: var(--size-sm);
  line-height: var(--line-height-relaxed);
  color: var(--text-primary);
}

/* ============================================
   SO WHAT BOX (Callout)
   ============================================ */

.so-what-box {
  background: var(--accent-blue-muted);
  border: 1px solid var(--accent-blue);
  border-radius: var(--radius-lg);
  padding: var(--sp-6);
  margin: var(--sp-8) 0;
  position: relative;
}

.so-what-box::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent-blue);
  border-radius: var(--radius-full) 0 0 var(--radius-full);
}

.so-what-label {
  font-size: var(--size-xs);
  font-weight: var(--weight-bold);
  color: var(--accent-blue);
  text-transform: uppercase;
  letter-spacing: var(--letter-spacing-wide);
  margin-bottom: var(--sp-3);
}

.so-what-box .prose {
  color: var(--text-primary);
  font-size: var(--size-sm);
}

.so-what-box .prose p:last-child {
  margin-bottom: 0;
}

/* ============================================
   INTRO / HERO
   ============================================ */

.hero {
  padding: var(--sp-12) 0 var(--sp-10);
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: var(--sp-12);
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-1) var(--sp-3);
  background: var(--accent-blue-muted);
  color: var(--accent-blue);
  font-size: var(--size-xs);
  font-weight: var(--weight-semibold);
  border-radius: var(--radius-full);
  margin-bottom: var(--sp-6);
  text-transform: uppercase;
  letter-spacing: var(--letter-spacing-wide);
}

.hero-badge .dot {
  width: 6px;
  height: 6px;
  background: var(--accent-blue);
  border-radius: var(--radius-full);
  animation: status-pulse 2s ease-in-out infinite;
}

.hero h1 {
  font-size: 2.5rem;
  font-weight: var(--weight-bold);
  letter-spacing: var(--letter-spacing-tight);
  color: var(--text-primary);
  line-height: var(--line-height-tight);
  margin-bottom: var(--sp-4);
}

.hero .hero-subtitle {
  font-size: var(--size-lg);
  color: var(--text-secondary);
  line-height: var(--line-height-relaxed);
  max-width: 700px;
}

/* ============================================
   STAT CARDS
   ============================================ */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-4);
  margin-bottom: var(--sp-8);
}

.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: var(--sp-5);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), background-color var(--transition-normal), border-color var(--transition-normal);
}

.stat-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.stat-label {
  font-size: var(--size-xs);
  font-weight: var(--weight-semibold);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: var(--letter-spacing-wide);
  margin-bottom: var(--sp-2);
}

.stat-value {
  font-size: var(--size-2xl);
  font-weight: var(--weight-bold);
  color: var(--text-primary);
}

.stat-trend {
  font-size: var(--size-xs);
  color: var(--accent-green);
  margin-top: var(--sp-1);
}

/* ============================================
   TABLES
   ============================================ */

.table-wrapper {
  overflow-x: auto;
  margin-bottom: var(--sp-6);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--size-sm);
}

thead th {
  background: var(--table-header-bg);
  font-size: var(--size-xs);
  font-weight: var(--weight-semibold);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: var(--letter-spacing-wide);
  text-align: left;
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--table-border);
  white-space: nowrap;
}

tbody td {
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--table-border);
  color: var(--text-secondary);
  vertical-align: top;
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr:hover {
  background: var(--table-row-hover);
}

tbody td strong {
  color: var(--text-primary);
}

/* ============================================
   FILTER BUTTONS
   ============================================ */

.filter-bar {
  display: flex;
  gap: var(--sp-2);
  flex-wrap: wrap;
  margin-bottom: var(--sp-6);
}

.filter-btn {
  height: var(--btn-height-sm);
  padding: 0 var(--sp-3);
  background: var(--btn-secondary-bg);
  color: var(--btn-secondary-text);
  border: 1px solid var(--btn-secondary-border);
  border-radius: var(--radius-md);
  font-size: var(--size-sm);
  font-weight: var(--weight-medium);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: var(--font-sans);
  white-space: nowrap;
}

.filter-btn:hover {
  background: var(--btn-secondary-hover);
}

.filter-btn.active {
  background: var(--accent-blue);
  color: #fff;
  border-color: var(--accent-blue);
}

/* ============================================
   CARDS GRID (Market)
   ============================================ */

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--sp-4);
}

.competitor-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: var(--sp-5);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), background-color var(--transition-normal), border-color var(--transition-normal);
}

.competitor-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.competitor-card.hidden {
  display: none;
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--sp-3);
}

.card-name {
  font-size: var(--size-md);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
}

.card-body {
  margin-bottom: var(--sp-3);
}

.card-features {
  font-size: var(--size-sm);
  color: var(--text-secondary);
  line-height: var(--line-height-relaxed);
  margin-bottom: var(--sp-3);
}

.card-limitations {
  font-size: var(--size-xs);
  color: var(--text-muted);
  line-height: var(--line-height-normal);
}

.card-limitations::before {
  content: 'Limitation: ';
  color: var(--accent-amber);
  font-weight: var(--weight-medium);
}

.card-footer {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-wrap: wrap;
}

/* ============================================
   BADGES
   ============================================ */

.badge {
  display: inline-flex;
  align-items: center;
  height: var(--badge-height);
  padding: 0 var(--sp-2);
  font-size: var(--size-xs);
  font-weight: var(--weight-medium);
  border-radius: var(--radius-full);
  letter-spacing: 0.025em;
  white-space: nowrap;
}

.badge-blue { background: var(--badge-blue-bg); color: var(--badge-blue-text); }
.badge-green { background: var(--badge-green-bg); color: var(--badge-green-text); }
.badge-amber { background: var(--badge-amber-bg); color: var(--badge-amber-text); }
.badge-red { background: var(--badge-red-bg); color: var(--badge-red-text); }
.badge-gray { background: var(--badge-gray-bg); color: var(--badge-gray-text); }
.badge-purple { background: var(--badge-purple-bg); color: var(--badge-purple-text); }

/* ============================================
   TABS
   ============================================ */

.tabs {
  margin-bottom: var(--sp-6);
}

.tab-list {
  display: flex;
  gap: var(--sp-1);
  border-bottom: 1px solid var(--border-primary);
  margin-bottom: var(--sp-6);
  overflow-x: auto;
}

.tab-btn {
  padding: var(--sp-3) var(--sp-4);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  font-size: var(--size-sm);
  font-weight: var(--weight-medium);
  cursor: pointer;
  white-space: nowrap;
  transition: color var(--transition-fast), border-color var(--transition-fast);
  font-family: var(--font-sans);
}

.tab-btn:hover {
  color: var(--text-primary);
}

.tab-btn.active {
  color: var(--accent-blue);
  border-bottom-color: var(--accent-blue);
}

.tab-panel {
  display: none;
  animation: fade-in var(--transition-normal);
}

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

/* ============================================
   WIREFRAME DISPLAY
   ============================================ */

.wireframe-container {
  background: var(--bg-code);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  padding: var(--sp-5);
  overflow-x: auto;
  margin-bottom: var(--sp-4);
}

.wireframe-container pre {
  font-family: var(--font-mono);
  font-size: var(--size-xs);
  line-height: 1.4;
  color: var(--text-secondary);
  margin: 0;
  background: none;
  border: none;
  padding: 0;
  white-space: pre;
}

.wireframe-specs {
  margin-top: var(--sp-4);
}

/* ============================================
   COLLAPSIBLE SECTIONS
   ============================================ */

.collapsible {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  margin-bottom: var(--sp-3);
  overflow: hidden;
  transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

.collapsible-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-4) var(--sp-5);
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  color: var(--text-primary);
  font-size: var(--size-base);
  font-weight: var(--weight-semibold);
  font-family: var(--font-sans);
  transition: background-color var(--transition-fast);
}

.collapsible-trigger:hover {
  background: var(--bg-hover);
}

.collapsible-icon {
  width: 20px;
  height: 20px;
  color: var(--text-muted);
  transition: transform var(--transition-normal);
  flex-shrink: 0;
}

.collapsible.open .collapsible-icon {
  transform: rotate(180deg);
}

.collapsible-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-slow);
}

.collapsible.open .collapsible-content {
  max-height: 2000px;
}

.collapsible-body {
  padding: 0 var(--sp-5) var(--sp-5);
}

.collapsible-subtitle {
  font-size: var(--size-sm);
  color: var(--text-secondary);
  margin-left: var(--sp-2);
  font-weight: var(--weight-normal);
}

/* ============================================
   MOCKUP SCREENS
   ============================================ */

.mockup-screen {
  background: var(--bg-secondary);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: var(--sp-6);
}

.mockup-titlebar {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-4);
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-primary);
}

.mockup-dot {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
}

.mockup-dot.red { background: #ff5f57; }
.mockup-dot.yellow { background: #febc2e; }
.mockup-dot.green { background: #28c840; }

.mockup-title {
  font-size: var(--size-xs);
  color: var(--text-muted);
  margin-left: var(--sp-2);
  font-weight: var(--weight-medium);
}

.mockup-body {
  padding: var(--sp-5);
}

/* Dashboard mockup internals */
.mock-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-3);
  margin-bottom: var(--sp-5);
}

.mock-stat {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  padding: var(--sp-3);
}

.mock-stat-label {
  font-size: var(--size-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: var(--letter-spacing-wide);
  margin-bottom: var(--sp-1);
}

.mock-stat-value {
  font-size: var(--size-xl);
  font-weight: var(--weight-bold);
  color: var(--text-primary);
}

.mock-agents-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-3);
  margin-bottom: var(--sp-5);
}

.mock-agent-card {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  padding: var(--sp-3);
}

.mock-agent-header {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-bottom: var(--sp-2);
}

.mock-agent-avatar {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--size-xs);
  font-weight: var(--weight-bold);
  color: #fff;
  flex-shrink: 0;
}

.mock-agent-name {
  font-size: var(--size-sm);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
}

.mock-agent-status {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  font-size: var(--size-xs);
  color: var(--text-secondary);
  margin-bottom: var(--sp-1);
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

.status-dot.working {
  background: var(--status-working);
  animation: status-pulse 2s ease-in-out infinite;
}

.status-dot.idle {
  background: var(--status-idle);
}

.status-dot.success {
  background: var(--status-success);
}

.status-dot.error {
  background: var(--status-error);
}

.status-dot.offline {
  background: var(--status-idle);
  opacity: 0.4;
}

.mock-agent-task {
  font-size: var(--size-xs);
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mock-progress {
  width: 100%;
  height: 4px;
  background: var(--progress-track);
  border-radius: var(--radius-full);
  margin-top: var(--sp-2);
  overflow: hidden;
}

.mock-progress-fill {
  height: 100%;
  background: var(--progress-fill);
  border-radius: var(--radius-full);
  transition: width var(--transition-slow);
}

/* Task feed in mockup */
.mock-task-list {
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.mock-task-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-3) var(--sp-4);
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-primary);
}

.mock-task-header-label {
  font-size: var(--size-xs);
  font-weight: var(--weight-semibold);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: var(--letter-spacing-wide);
}

.mock-task-link {
  font-size: var(--size-xs);
  color: var(--text-link);
}

.mock-task-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--border-subtle);
  font-size: var(--size-sm);
}

.mock-task-row:last-child {
  border-bottom: none;
}

.mock-task-id {
  font-family: var(--font-mono);
  font-size: var(--size-xs);
  color: var(--text-muted);
  flex-shrink: 0;
}

.mock-task-title {
  flex: 1;
  color: var(--text-primary);
  font-weight: var(--weight-medium);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mock-task-agent {
  font-size: var(--size-xs);
  color: var(--text-secondary);
  flex-shrink: 0;
}

.mock-task-progress {
  width: 80px;
  flex-shrink: 0;
}

/* Live output mockup */
.mock-terminal {
  background: var(--bg-code);
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: var(--size-xs);
  line-height: 1.6;
  overflow: hidden;
}

.mock-terminal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-2) var(--sp-3);
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-primary);
}

.mock-terminal-title {
  font-size: var(--size-xs);
  color: var(--text-muted);
  font-weight: var(--weight-medium);
}

.mock-terminal-controls {
  display: flex;
  gap: var(--sp-2);
}

.mock-terminal-controls span {
  font-size: var(--size-xs);
  color: var(--text-muted);
  cursor: default;
}

.mock-terminal-body {
  padding: var(--sp-3);
  max-height: 300px;
  overflow-y: auto;
}

.log-line {
  display: flex;
  gap: var(--sp-3);
  padding: 2px 0;
}

.log-time {
  color: var(--text-muted);
  flex-shrink: 0;
}

.log-level {
  flex-shrink: 0;
  width: 40px;
  font-weight: var(--weight-medium);
}

.log-level.info { color: var(--text-secondary); }
.log-level.warn { color: var(--accent-amber); }
.log-level.error { color: var(--accent-red); font-weight: var(--weight-semibold); }
.log-level.debug { color: var(--text-muted); }

.log-agent {
  color: var(--text-link);
  flex-shrink: 0;
}

.log-msg {
  color: var(--text-primary);
}

/* ============================================
   DESIGN SYSTEM SHOWCASE
   ============================================ */

.design-showcase {
  margin-top: var(--sp-8);
}

.showcase-section {
  margin-bottom: var(--sp-8);
}

.showcase-section h4 {
  font-size: var(--size-md);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  margin-bottom: var(--sp-4);
}

.color-swatches {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: var(--sp-3);
}

.color-swatch {
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--card-border);
}

.swatch-color {
  height: 48px;
}

.swatch-info {
  padding: var(--sp-2) var(--sp-3);
  background: var(--card-bg);
}

.swatch-name {
  font-size: var(--size-xs);
  font-weight: var(--weight-medium);
  color: var(--text-primary);
}

.swatch-value {
  font-size: var(--size-xs);
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.type-sample {
  margin-bottom: var(--sp-3);
  padding: var(--sp-3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  display: flex;
  align-items: baseline;
  gap: var(--sp-4);
}

.type-meta {
  font-size: var(--size-xs);
  color: var(--text-muted);
  font-family: var(--font-mono);
  flex-shrink: 0;
  min-width: 100px;
}

.component-examples {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  align-items: center;
}

/* Buttons in showcase */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: var(--btn-height-md);
  padding: 0 var(--sp-4);
  font-size: var(--size-sm);
  font-weight: var(--weight-medium);
  font-family: var(--font-sans);
  border-radius: var(--radius-md);
  cursor: pointer;
  border: none;
  transition: all var(--transition-fast);
  gap: var(--sp-2);
  white-space: nowrap;
}

.btn-primary {
  background: var(--btn-primary-bg);
  color: var(--btn-primary-text);
}
.btn-primary:hover { background: var(--btn-primary-hover); }

.btn-secondary {
  background: var(--btn-secondary-bg);
  color: var(--btn-secondary-text);
  border: 1px solid var(--btn-secondary-border);
}
.btn-secondary:hover { background: var(--btn-secondary-hover); }

.btn-ghost {
  background: var(--btn-ghost-bg);
  color: var(--btn-ghost-text);
}
.btn-ghost:hover { background: var(--btn-ghost-hover); }

/* ============================================
   JOURNEY TABLE
   ============================================ */

.journey-table {
  font-size: var(--size-sm);
}

.journey-table td:first-child {
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  white-space: nowrap;
}

/* ============================================
   PROTOCOL STACK
   ============================================ */

.protocol-stack {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-3);
  padding: var(--sp-6);
  background: var(--bg-secondary);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  margin: var(--sp-6) 0;
  font-family: var(--font-mono);
  font-size: var(--size-sm);
  flex-wrap: wrap;
}

.protocol-node {
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--radius-md);
  font-weight: var(--weight-semibold);
}

.protocol-node.ide {
  background: var(--accent-purple-muted);
  color: var(--accent-purple);
}

.protocol-node.agent {
  background: var(--accent-blue-muted);
  color: var(--accent-blue);
}

.protocol-node.tools {
  background: var(--accent-green-muted);
  color: var(--accent-green);
}

.protocol-arrow {
  color: var(--text-muted);
  font-weight: var(--weight-medium);
}

/* ============================================
   RECOMMENDATIONS
   ============================================ */

.rec-list {
  counter-reset: rec;
}

.rec-item {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: var(--sp-5) var(--sp-5) var(--sp-5) var(--sp-10);
  margin-bottom: var(--sp-4);
  position: relative;
  counter-increment: rec;
  transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

.rec-item::before {
  content: counter(rec);
  position: absolute;
  left: var(--sp-4);
  top: var(--sp-5);
  width: 24px;
  height: 24px;
  background: var(--accent-blue-muted);
  color: var(--accent-blue);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--size-xs);
  font-weight: var(--weight-bold);
}

.rec-item h4 {
  font-size: var(--size-base);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  margin-bottom: var(--sp-2);
}

.rec-item p {
  font-size: var(--size-sm);
  color: var(--text-secondary);
  line-height: var(--line-height-relaxed);
}

/* ============================================
   UX PATTERN COMPARISON
   ============================================ */

.pattern-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-4);
  margin-bottom: var(--sp-6);
}

.pattern-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: var(--sp-5);
  transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

.pattern-card h4 {
  font-size: var(--size-md);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  margin-bottom: var(--sp-1);
}

.pattern-card .pattern-examples {
  font-size: var(--size-xs);
  color: var(--text-muted);
  margin-bottom: var(--sp-3);
}

.pattern-card .pattern-strengths,
.pattern-card .pattern-weaknesses {
  font-size: var(--size-sm);
  color: var(--text-secondary);
  line-height: var(--line-height-relaxed);
  margin-bottom: var(--sp-2);
}

.pattern-card .pattern-strengths strong {
  color: var(--accent-green);
}

.pattern-card .pattern-weaknesses strong {
  color: var(--accent-amber);
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 1024px) {
  .mock-stats-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .pattern-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }

  .sidebar-overlay.active {
    display: block;
  }

  .hamburger {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .main-content {
    margin-left: 0;
  }

  .content-area {
    padding: var(--sp-6) var(--sp-4) var(--sp-16);
  }

  .hero h1 {
    font-size: var(--size-2xl);
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .cards-grid {
    grid-template-columns: 1fr;
  }

  .mock-stats-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .mock-agents-grid {
    grid-template-columns: 1fr;
  }

  .protocol-stack {
    flex-direction: column;
  }

  .section-header h2 {
    font-size: var(--size-2xl);
  }

  .tab-list {
    gap: 0;
  }

  .tab-btn {
    padding: var(--sp-2) var(--sp-3);
    font-size: var(--size-xs);
  }

  .color-swatches {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .mock-stats-row {
    grid-template-columns: 1fr;
  }

  .color-swatches {
    grid-template-columns: repeat(2, 1fr);
  }
}
