/* ==========================================================================
   VendorForge AI - Design System & Modern Responsive UI
   Built according to agency-ui-designer & agency-frontend-developer standards:
   - Light Theme by Default (Clean, Crisp, Apple/Stripe-grade Visual Polish)
   - Dark Theme toggle support ([data-theme="dark"])
   - Design Token Scale (4px/8px rhythm, fluid typography, WCAG AA contrast)
   - Mobile-First & Ultrawide Responsive Grid Framework (320px to 2560px+)
   - Glassmorphic Surfaces, Ambient Lighting & Micro-Interactions
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design Token System (Light Theme by Default)
   -------------------------------------------------------------------------- */
:root,
[data-theme="light"] {
  /* Brand Emerald Palette (Primary) */
  --color-primary-50: #ecfdf5;
  --color-primary-100: #d1fae5;
  --color-primary-200: #a7f3d0;
  --color-primary-300: #6ee7b7;
  --color-primary-400: #34d399;
  --color-primary-500: #10b981;
  --color-primary-600: #059669;
  --color-primary-700: #047857;
  --color-primary-800: #065f46;
  --color-primary-900: #064e3b;

  /* Slate & Neutral Palette (Secondary) */
  --color-secondary-50: #f8fafc;
  --color-secondary-100: #f1f5f9;
  --color-secondary-200: #e2e8f0;
  --color-secondary-300: #cbd5e1;
  --color-secondary-400: #94a3b8;
  --color-secondary-500: #64748b;
  --color-secondary-600: #475569;
  --color-secondary-700: #334155;
  --color-secondary-800: #1e293b;
  --color-secondary-900: #0f172a;
  --color-secondary-950: #020617;

  /* Ecosystem Partner Colors (Saturated for Light Mode Contrast) */
  --color-cyan-400: #0284c7;  /* High contrast Sky 600 */
  --color-cyan-500: #0369a1;  /* Google Gemma 2 */
  --color-violet-400: #7c3aed; /* Mastra Agent Framework */
  --color-violet-500: #6d28d9;
  --color-amber-400: #d97706; /* Sentry Observability */
  --color-amber-500: #b45309;
  --color-rose-400: #e11d48;
  --color-rose-500: #be123c;

  /* Semantic UI Feedback */
  --color-success: #059669;
  --color-warning: #d97706;
  --color-error: #dc2626;
  --color-info: #0284c7;

  /* Light Theme Surfaces & Backgrounds */
  --bg-base: #f8fafc;
  --bg-surface: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.92);
  --bg-card-hover: #ffffff;
  --bg-elevated: #f1f5f9;
  --bg-input: #ffffff;
  --bg-input-focus: #ffffff;

  /* Light Theme Borders */
  --border-subtle: rgba(15, 23, 42, 0.08);
  --border-medium: rgba(15, 23, 42, 0.16);
  --border-strong: rgba(15, 23, 42, 0.28);
  --border-glow: rgba(16, 185, 129, 0.35);

  /* Light Theme Typography (WCAG AA Compliant >= 4.5:1 on light) */
  --text-primary: #0f172a;    /* Slate 900 */
  --text-secondary: #334155;  /* Slate 700 */
  --text-muted: #64748b;      /* Slate 500 (4.6:1 contrast) */
  --text-accent: #0284c7;     /* Sky 600 */
  --text-emerald: #047857;    /* Emerald 700 */

  /* Typography Fonts */
  --font-family-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-family-display: 'Outfit', var(--font-family-primary);
  --font-family-mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;

  /* Typography Scale */
  --font-size-xs: 0.75rem;    /* 12px */
  --font-size-sm: 0.875rem;   /* 14px */
  --font-size-base: 1rem;     /* 16px */
  --font-size-lg: 1.125rem;   /* 18px */
  --font-size-xl: 1.25rem;    /* 20px */
  --font-size-2xl: 1.5rem;    /* 24px */
  --font-size-3xl: 1.875rem;  /* 30px */
  --font-size-4xl: 2.25rem;   /* 36px */
  --font-size-5xl: 3rem;      /* 48px */

  /* Spacing Scale (4px / 8px system) */
  --space-0-5: 0.125rem; /* 2px */
  --space-1: 0.25rem;    /* 4px */
  --space-2: 0.5rem;     /* 8px */
  --space-3: 0.75rem;    /* 12px */
  --space-4: 1rem;       /* 16px */
  --space-5: 1.25rem;    /* 20px */
  --space-6: 1.5rem;     /* 24px */
  --space-8: 2rem;       /* 32px */
  --space-10: 2.5rem;    /* 40px */
  --space-12: 3rem;      /* 48px */
  --space-16: 4rem;      /* 64px */

  /* Border Radii */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Light Theme Shadow & Depth */
  --shadow-sm: 0 1px 3px 0 rgba(15, 23, 42, 0.06), 0 1px 2px -1px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 16px -2px rgba(15, 23, 42, 0.08), 0 2px 6px -1px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 12px 28px -4px rgba(15, 23, 42, 0.12), 0 4px 10px -2px rgba(15, 23, 42, 0.06);
  --shadow-glow: 0 0 24px rgba(16, 185, 129, 0.18);
  --shadow-glow-cyan: 0 0 24px rgba(2, 132, 199, 0.2);

  /* Transition Speeds */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Accessibility Touch Minimum */
  --touch-target-min: 44px;

  /* Ambient Glow Colors (Subtle Pastels in Light Mode) */
  --ambient-glow-1: radial-gradient(circle, rgba(16, 185, 129, 0.14) 0%, transparent 70%);
  --ambient-glow-2: radial-gradient(circle, rgba(14, 165, 233, 0.14) 0%, transparent 70%);
  --ambient-glow-3: radial-gradient(circle, rgba(139, 92, 246, 0.1) 0%, transparent 70%);
  --header-bg: rgba(255, 255, 255, 0.94);
  --footer-bg: #ffffff;
  --code-bg: #f8fafc;
  --hero-gradient: linear-gradient(135deg, #059669 0%, #0284c7 50%, #7c3aed 100%);
  --btn-primary-text: #ffffff;
  --btn-primary-bg: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

/* --------------------------------------------------------------------------
   Dark Theme Token Overrides ([data-theme="dark"])
   -------------------------------------------------------------------------- */
[data-theme="dark"] {
  --color-cyan-400: #22d3ee;
  --color-cyan-500: #06b6d4;
  --color-violet-400: #a78bfa;
  --color-violet-500: #8b5cf6;
  --color-amber-400: #fbbf24;
  --color-amber-500: #f59e0b;

  --bg-base: #06080e;
  --bg-surface: #0c101c;
  --bg-card: rgba(16, 22, 38, 0.75);
  --bg-card-hover: rgba(23, 32, 54, 0.9);
  --bg-elevated: #161e31;
  --bg-input: rgba(10, 14, 26, 0.85);
  --bg-input-focus: rgba(14, 20, 36, 0.98);

  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-medium: rgba(255, 255, 255, 0.16);
  --border-strong: rgba(255, 255, 255, 0.28);
  --border-glow: rgba(16, 185, 129, 0.4);

  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --text-accent: #38bdf8;
  --text-emerald: #34d399;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 4px 14px -2px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 14px 32px -4px rgba(0, 0, 0, 0.65);
  --shadow-glow: 0 0 24px rgba(16, 185, 129, 0.22);
  --shadow-glow-cyan: 0 0 24px rgba(6, 182, 212, 0.25);

  --ambient-glow-1: radial-gradient(circle, #059669 0%, transparent 70%);
  --ambient-glow-2: radial-gradient(circle, #2563eb 0%, transparent 70%);
  --ambient-glow-3: radial-gradient(circle, #7c3aed 0%, transparent 70%);
  --header-bg: rgba(6, 8, 14, 0.92);
  --footer-bg: rgba(6, 8, 14, 0.95);
  --code-bg: rgba(0, 0, 0, 0.35);
  --hero-gradient: linear-gradient(135deg, #34d399 0%, #38bdf8 50%, #a78bfa 100%);
  --btn-primary-text: #06080e;
  --btn-primary-bg: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

/* --------------------------------------------------------------------------
   2. Reset, Box Model & Base Elements
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-family-primary);
  background-color: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  width: 100%;
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

/* Global Focus Rings (WCAG AA) */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--color-primary-500);
  outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   3. Ambient Decorative Glows
   -------------------------------------------------------------------------- */
.ambient-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(140px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.6;
  transition: background var(--transition-slow);
}

.glow-1 {
  width: 550px;
  height: 550px;
  top: -100px;
  left: -100px;
  background: var(--ambient-glow-1);
}

.glow-2 {
  width: 650px;
  height: 650px;
  top: 30%;
  right: -150px;
  background: var(--ambient-glow-2);
}

.glow-3 {
  width: 500px;
  height: 500px;
  bottom: 0;
  left: 20%;
  background: var(--ambient-glow-3);
}

/* --------------------------------------------------------------------------
   4. Glassmorphic Surface Cards
   -------------------------------------------------------------------------- */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  position: relative;
  z-index: 1;
  transition: border-color var(--transition-normal), box-shadow var(--transition-normal), background var(--transition-normal);
}

.glass-card:hover {
  border-color: var(--border-medium);
  box-shadow: var(--shadow-lg);
}

/* --------------------------------------------------------------------------
   5. App Header & Global Navigation
   -------------------------------------------------------------------------- */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  padding: var(--space-3) var(--space-4);
  width: 100%;
  transition: background var(--transition-normal), border-color var(--transition-normal);
}

.header-container {
  width: 100%;
  max-width: 1360px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
}

.brand-logo {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #10b981 0%, #06b6d4 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
  flex-shrink: 0;
}

.brand-info {
  min-width: 0;
}

.brand-title {
  font-family: var(--font-family-display);
  font-size: var(--font-size-xl);
  font-weight: 800;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  white-space: nowrap;
  color: var(--text-primary);
}

.brand-badge {
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  background: rgba(16, 185, 129, 0.15);
  color: var(--color-primary-600);
  border: 1px solid rgba(16, 185, 129, 0.3);
  font-weight: 700;
  letter-spacing: 0.05em;
}

[data-theme="dark"] .brand-badge {
  color: var(--color-primary-400);
  background: rgba(16, 185, 129, 0.2);
}

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

.header-badges {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  justify-content: flex-end;
}

.tech-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: var(--font-size-xs);
  font-weight: 600;
  padding: 0.3rem 0.7rem;
  border-radius: var(--radius-full);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.badge-gemma .badge-dot { background-color: var(--color-cyan-400); box-shadow: 0 0 6px var(--color-cyan-400); }
.badge-tabpfn .badge-dot { background-color: var(--color-primary-500); box-shadow: 0 0 6px var(--color-primary-500); }
.badge-mastra .badge-dot { background-color: var(--color-violet-400); box-shadow: 0 0 6px var(--color-violet-400); }
.badge-sentry .badge-dot { background-color: var(--color-amber-400); box-shadow: 0 0 6px var(--color-amber-400); }

/* Theme Toggle Button */
.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-weight: 600;
  border-radius: var(--radius-full);
  padding: 0.35rem 0.85rem;
  cursor: pointer;
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
}

.theme-toggle-btn:hover {
  background: var(--bg-elevated);
  border-color: var(--color-primary-500);
  transform: translateY(-1px);
}

/* --------------------------------------------------------------------------
   6. Main Content Container (Fluid & Ultrawide Optimized)
   -------------------------------------------------------------------------- */
.main-container {
  width: 100%;
  max-width: 1360px;
  margin: 0 auto;
  padding: var(--space-6) var(--space-4) var(--space-12);
  position: relative;
  z-index: 10;
}

/* --------------------------------------------------------------------------
   7. Hero Section & Metrics Strip
   -------------------------------------------------------------------------- */
.hero-section {
  text-align: center;
  margin-bottom: var(--space-10);
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  flex-wrap: wrap;
  justify-content: center;
}

.pill-badge {
  font-size: var(--font-size-xs);
  font-weight: 700;
  background: rgba(245, 158, 11, 0.12);
  color: #b45309;
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
}

[data-theme="dark"] .pill-badge {
  background: rgba(245, 158, 11, 0.15);
  color: #fcd34d;
}

.pill-stat {
  font-size: var(--font-size-xs);
  font-weight: 600;
  color: var(--color-primary-600);
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.28);
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
}

[data-theme="dark"] .pill-stat {
  color: var(--color-primary-400);
  background: rgba(16, 185, 129, 0.12);
}

.hero-title {
  font-family: var(--font-family-display);
  font-size: clamp(2rem, 4.2vw, 3.8rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  max-width: 980px;
  margin: 0 auto var(--space-4);
  word-break: break-word;
  color: var(--text-primary);
}

.gradient-text {
  background: var(--hero-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-desc {
  font-size: clamp(0.95rem, 1.4vw, 1.18rem);
  color: var(--text-secondary);
  max-width: 740px;
  margin: 0 auto var(--space-8);
  line-height: 1.6;
}

/* Metrics Strip (Responsive Grid) */
.metrics-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: center;
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: var(--space-4) var(--space-6);
  gap: var(--space-4);
  box-shadow: var(--shadow-sm);
  max-width: 980px;
  margin: 0 auto;
}

.metric-card {
  text-align: center;
  min-width: 0;
}

.metric-val {
  font-family: var(--font-family-display);
  font-size: clamp(1.25rem, 2vw, 1.65rem);
  font-weight: 800;
  color: var(--color-primary-600);
  line-height: 1.2;
}

[data-theme="dark"] .metric-val {
  color: var(--color-primary-400);
}

.metric-label {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  font-weight: 500;
  margin-top: var(--space-1);
  word-break: break-word;
}

.metric-divider {
  display: none;
}

/* --------------------------------------------------------------------------
   8. Main Workspace Grid (2 Columns Desktop, 1 Column Mobile)
   -------------------------------------------------------------------------- */
.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-6);
  margin-bottom: var(--space-10);
  align-items: start;
}

/* Panels */
.intake-panel,
.output-panel {
  padding: var(--space-6);
  min-width: 0; /* CRITICAL: Prevents any grid child overflow clipping */
  overflow: hidden;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
  flex-wrap: wrap;
}

.panel-title-wrap {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
  flex: 1 1 auto;
}

.step-num {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-full);
  background: var(--color-primary-500);
  color: #ffffff;
  font-weight: 800;
  font-size: var(--font-size-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.35);
}

.panel-header h2 {
  font-family: var(--font-family-display);
  font-size: clamp(1.05rem, 1.5vw, 1.25rem);
  font-weight: 700;
  line-height: 1.3;
  word-break: break-word;
  color: var(--text-primary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  flex-shrink: 0;
}

.badge-subtle {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  background: var(--bg-elevated);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  border: 1px solid var(--border-subtle);
}

/* --------------------------------------------------------------------------
   9. Presets Grid & Cards
   -------------------------------------------------------------------------- */
.presets-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
  margin-top: var(--space-2);
}

.preset-card {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: left;
  min-width: 0;
  min-height: 68px;
  box-shadow: var(--shadow-sm);
}

.preset-card:hover {
  background: var(--bg-elevated);
  border-color: var(--color-primary-500);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.preset-card.active {
  background: var(--color-primary-50);
  border-color: var(--color-primary-500);
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.25);
}

[data-theme="dark"] .preset-card.active {
  background: rgba(16, 185, 129, 0.12);
}

.preset-thumb {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
  background: var(--color-secondary-200);
  border: 1px solid var(--border-subtle);
}

.preset-details {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.preset-name {
  font-size: var(--font-size-xs);
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-primary);
}

.preset-meta {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.preset-price-tag {
  font-size: var(--font-size-xs);
  font-weight: 700;
  color: var(--color-primary-600);
  margin-top: 0.15rem;
}

[data-theme="dark"] .preset-price-tag {
  color: var(--color-primary-400);
}

/* --------------------------------------------------------------------------
   10. Form Layouts & Inputs
   -------------------------------------------------------------------------- */
.divider-with-text {
  display: flex;
  align-items: center;
  text-align: center;
  margin: var(--space-6) 0 var(--space-4);
}

.divider-with-text::before,
.divider-with-text::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border-subtle);
}

.divider-with-text span {
  padding: 0 var(--space-3);
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 700;
  letter-spacing: 0.1em;
}

.item-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.form-row {
  display: flex;
  gap: var(--space-4);
}

.form-row > * {
  min-width: 0;
}

.flex-1 { flex: 1 1 0; }
.flex-2 { flex: 2 1 0; }

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.form-label {
  font-size: var(--font-size-xs);
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-1);
}

.label-hint {
  font-weight: 400;
  color: var(--text-muted);
  font-size: 0.72rem;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  background: var(--bg-input);
  border: 1px solid var(--border-medium);
  color: var(--text-primary);
  font-family: var(--font-family-primary);
  font-size: var(--font-size-sm);
  line-height: 1.5;
  transition: all var(--transition-fast);
  min-height: var(--touch-target-min);
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--color-primary-500);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.22);
  background: var(--bg-input-focus);
}

.form-textarea {
  min-height: 76px;
  resize: vertical;
}

.input-with-prefix {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.input-with-prefix .prefix {
  position: absolute;
  left: var(--space-3);
  color: var(--text-muted);
  font-weight: 700;
  pointer-events: none;
}

.input-with-prefix input {
  padding-left: 1.85rem;
}

/* TabPFN Ledger Box */
.tabpfn-ledger-box {
  background: rgba(16, 185, 129, 0.06);
  border: 1px dashed rgba(16, 185, 129, 0.45);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  margin: var(--space-2) 0;
}

.ledger-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
  flex-wrap: wrap;
}

.ledger-title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--font-size-sm);
  color: var(--text-primary);
}

.badge-tabpfn-sm {
  font-size: 0.68rem;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  background: rgba(16, 185, 129, 0.18);
  color: var(--color-primary-700);
  font-weight: 700;
}

[data-theme="dark"] .badge-tabpfn-sm {
  color: var(--color-primary-400);
}

.ledger-desc {
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: var(--space-3);
}

.ledger-desc .highlight {
  color: var(--color-primary-700);
  font-weight: 600;
}

[data-theme="dark"] .ledger-desc .highlight {
  color: var(--color-primary-400);
}

.ledger-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.hidden-file-input {
  display: none;
}

.file-label {
  cursor: pointer;
}

.csv-status-text {
  font-size: var(--font-size-xs);
  margin-top: var(--space-2);
  color: var(--color-primary-600);
  font-weight: 600;
  word-break: break-word;
}

/* --------------------------------------------------------------------------
   11. Buttons & Interactive Elements
   -------------------------------------------------------------------------- */
.btn-primary {
  background: var(--btn-primary-bg);
  color: var(--btn-primary-text);
  border: none;
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-5);
  font-family: var(--font-family-primary);
  font-weight: 700;
  font-size: var(--font-size-base);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.35);
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
  min-height: 52px;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(16, 185, 129, 0.45);
  background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
}

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

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-subtext {
  font-size: 0.72rem;
  font-weight: 500;
  opacity: 0.9;
}

.btn-block { width: 100%; }

.btn-sm {
  font-size: var(--font-size-xs);
  font-weight: 600;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  transition: all var(--transition-fast);
  text-decoration: none;
  min-height: 36px;
  white-space: nowrap;
}

.btn-outline {
  background: var(--bg-surface);
  border-color: var(--border-medium);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

.btn-outline:hover {
  background: var(--bg-elevated);
  border-color: var(--color-primary-500);
  color: var(--color-primary-600);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

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

.btn-ghost:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* --------------------------------------------------------------------------
   12. Agent Pipeline Stepper (Fully Responsive)
   -------------------------------------------------------------------------- */
.agent-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-5);
  min-width: 0;
  box-shadow: var(--shadow-sm);
}

.stepper-step {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
  flex: 1 1 0;
}

.step-bubble {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  background: var(--color-secondary-200);
  color: var(--text-muted);
  font-size: var(--font-size-xs);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-normal);
  flex-shrink: 0;
}

[data-theme="dark"] .step-bubble {
  background: var(--color-secondary-800);
}

.stepper-step.active .step-bubble {
  background: var(--color-cyan-500);
  color: #ffffff;
  box-shadow: 0 0 12px var(--color-cyan-500);
  animation: pulse-bubble 1.5s infinite;
}

.stepper-step.completed .step-bubble {
  background: var(--color-primary-500);
  color: #ffffff;
}

@keyframes pulse-bubble {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

.step-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.step-label {
  font-size: var(--font-size-xs);
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.step-status {
  font-size: 0.68rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stepper-step.active .step-status {
  color: var(--color-cyan-400);
  font-weight: 600;
}

.stepper-step.completed .step-status {
  color: var(--color-primary-600);
  font-weight: 600;
}

[data-theme="dark"] .stepper-step.completed .step-status {
  color: var(--color-primary-400);
}

.stepper-line {
  width: 20px;
  min-width: 8px;
  height: 2px;
  background: var(--border-medium);
  flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   13. Output Tabs Navigation
   -------------------------------------------------------------------------- */
.output-tabs {
  display: flex;
  gap: var(--space-2);
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: var(--space-5);
  overflow-x: auto;
  padding-bottom: var(--space-2);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; /* Clean modern tab bar without ugly scrollbar track */
  -ms-overflow-style: none;
}

.output-tabs::-webkit-scrollbar {
  display: none;
}

.tab-btn {
  background: transparent;
  border: 1px solid transparent;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  font-family: var(--font-family-primary);
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  min-height: var(--touch-target-min);
}

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

.tab-btn.active {
  color: var(--color-primary-700);
  background: var(--color-primary-50);
  border-color: rgba(16, 185, 129, 0.35);
  font-weight: 700;
}

[data-theme="dark"] .tab-btn.active {
  color: var(--color-primary-400);
  background: rgba(16, 185, 129, 0.12);
}

.tab-pane {
  display: none;
  animation: fadeIn 0.25s ease;
  min-width: 0;
}

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

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

/* Empty State */
.empty-state {
  text-align: center;
  padding: var(--space-10) var(--space-4);
  color: var(--text-muted);
}

.empty-icon {
  font-size: 2.8rem;
  margin-bottom: var(--space-3);
}

.empty-state h3 {
  font-family: var(--font-family-display);
  font-size: var(--font-size-lg);
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.empty-state p {
  font-size: var(--font-size-sm);
  max-width: 440px;
  margin: 0 auto;
  line-height: 1.5;
  color: var(--text-secondary);
}

/* --------------------------------------------------------------------------
   14. TabPFN Pricing View & Economic Metrics
   -------------------------------------------------------------------------- */
.pricing-kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}

.kpi-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-3);
  text-align: center;
  position: relative;
  overflow: hidden;
  min-width: 0;
  transition: all var(--transition-normal);
  box-shadow: var(--shadow-sm);
}

.kpi-card.highlight {
  border-color: var(--color-primary-500);
  background: linear-gradient(180deg, var(--color-primary-50) 0%, var(--bg-surface) 100%);
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.16);
}

[data-theme="dark"] .kpi-card.highlight {
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.14) 0%, rgba(12, 16, 28, 0.95) 100%);
  box-shadow: var(--shadow-glow);
}

.kpi-badge {
  font-size: var(--font-size-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-primary-600);
  margin-bottom: var(--space-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

[data-theme="dark"] .kpi-badge {
  color: var(--color-primary-400);
}

.kpi-price {
  font-family: var(--font-family-display);
  font-size: clamp(1.4rem, 2.2vw, 2.1rem);
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.1;
  word-break: break-word;
}

.kpi-card.highlight .kpi-price {
  color: var(--color-primary-600);
}

[data-theme="dark"] .kpi-card.highlight .kpi-price {
  color: var(--color-primary-400);
}

.kpi-label {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  margin-top: var(--space-2);
  line-height: 1.35;
}

.economics-breakdown {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-5);
  margin-bottom: var(--space-5);
}

.econ-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--border-subtle);
  font-size: var(--font-size-sm);
  flex-wrap: wrap;
}

.econ-row:last-child {
  border-bottom: none;
  font-weight: 700;
  color: var(--color-primary-700);
}

[data-theme="dark"] .econ-row:last-child {
  color: var(--color-primary-400);
}

.econ-row > span:first-child {
  color: var(--text-secondary);
}

.econ-row > strong,
.econ-row > span:last-child {
  text-align: right;
  word-break: break-word;
  color: var(--text-primary);
}

.econ-row:last-child > strong,
.econ-row:last-child > span:last-child {
  color: var(--color-primary-700);
}

[data-theme="dark"] .econ-row:last-child > strong,
[data-theme="dark"] .econ-row:last-child > span:last-child {
  color: var(--color-primary-400);
}

.velocity-bar-wrap {
  margin-top: var(--space-4);
}

.velocity-bar-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--font-size-xs);
  margin-bottom: var(--space-2);
  color: var(--text-secondary);
  flex-wrap: wrap;
}

.progress-bar-bg {
  width: 100%;
  height: 10px;
  background: var(--color-secondary-200);
  border-radius: var(--radius-full);
  overflow: hidden;
}

[data-theme="dark"] .progress-bar-bg {
  background: var(--color-secondary-800);
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #06b6d4);
  border-radius: var(--radius-full);
  transition: width 0.6s ease;
}

.anomaly-alert {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  font-size: var(--font-size-xs);
  color: #b45309;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-4);
}

[data-theme="dark"] .anomaly-alert {
  color: #fcd34d;
}

/* --------------------------------------------------------------------------
   15. Multi-Channel Listing Views (Etsy, eBay, Social)
   -------------------------------------------------------------------------- */
.listing-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-5);
  min-width: 0;
  box-shadow: var(--shadow-sm);
}

.listing-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
  flex-wrap: wrap;
}

.channel-tag {
  font-size: var(--font-size-xs);
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.tag-etsy { background: #ea580c; color: #fff; }
.tag-ebay { background: #0284c7; color: #fff; }
.tag-social { background: #c026d3; color: #fff; }

.copy-field-btn {
  font-size: var(--font-size-xs);
  color: var(--text-accent);
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  min-height: 28px;
}

.copy-field-btn:hover {
  background: var(--bg-elevated);
  border-color: var(--color-cyan-400);
}

.field-label {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin: var(--space-4) 0 var(--space-2);
}

.title-display {
  font-family: var(--font-family-display);
  font-size: var(--font-size-base);
  font-weight: 700;
  color: var(--text-primary);
  background: var(--code-bg);
  padding: var(--space-3);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-medium);
  word-break: break-word;
}

.char-counter {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  text-align: right;
  margin-top: var(--space-1);
}

.tags-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

.tag-bubble {
  background: var(--color-primary-50);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  color: var(--color-primary-700);
  padding: 0.2rem 0.65rem;
  font-family: var(--font-family-mono);
  word-break: break-word;
}

[data-theme="dark"] .tag-bubble {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border-subtle);
  color: var(--color-cyan-400);
}

.content-block {
  background: var(--code-bg);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  padding: var(--space-4);
  font-size: var(--font-size-sm);
  line-height: 1.6;
  white-space: pre-line;
  color: var(--text-secondary);
  max-height: 320px;
  overflow-y: auto;
  word-break: break-word;
}

.tips-box {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: var(--radius-md);
  padding: var(--space-4);
  margin-top: var(--space-5);
}

[data-theme="dark"] .tips-box {
  background: rgba(56, 189, 248, 0.05);
  border-color: rgba(56, 189, 248, 0.2);
}

.tips-box h4 {
  font-size: var(--font-size-sm);
  color: #0369a1;
  margin-bottom: var(--space-2);
}

[data-theme="dark"] .tips-box h4 {
  color: var(--text-accent);
}

.tips-box ul {
  padding-left: var(--space-5);
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
}

.tips-box li + li {
  margin-top: var(--space-1);
}

/* --------------------------------------------------------------------------
   16. Audio Player View (ElevenLabs)
   -------------------------------------------------------------------------- */
.audio-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.audio-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
  flex-wrap: wrap;
}

.audio-script-box {
  background: var(--code-bg);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  padding: var(--space-4);
  font-style: italic;
  font-size: var(--font-size-sm);
  color: var(--text-primary);
  line-height: 1.6;
  margin-bottom: var(--space-5);
  text-align: left;
  word-break: break-word;
}

.audio-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

/* --------------------------------------------------------------------------
   17. Sentry Telemetry Timeline
   -------------------------------------------------------------------------- */
.telemetry-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  flex-wrap: wrap;
}

.traces-timeline {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.trace-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  min-width: 0;
  box-shadow: var(--shadow-sm);
}

.trace-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--border-subtle);
  flex-wrap: wrap;
}

.trace-id {
  font-family: var(--font-family-mono);
  font-size: var(--font-size-xs);
  color: #b45309;
}

[data-theme="dark"] .trace-id {
  color: var(--color-amber-400);
}

.trace-duration {
  font-size: var(--font-size-xs);
  font-weight: 700;
  color: var(--color-primary-600);
}

[data-theme="dark"] .trace-duration {
  color: var(--color-primary-400);
}

.spans-tree {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.span-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  font-size: var(--font-size-xs);
  padding: 0.4rem 0.6rem;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  font-family: var(--font-family-mono);
  flex-wrap: wrap;
}

.span-type-badge {
  font-size: 0.65rem;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
}

.type-llm { background: rgba(2, 132, 199, 0.15); color: #0369a1; }
.type-ml { background: rgba(16, 185, 129, 0.15); color: #047857; }
.type-tool { background: rgba(245, 158, 11, 0.15); color: #b45309; }
.type-db { background: rgba(124, 58, 237, 0.15); color: #6d28d9; }

/* --------------------------------------------------------------------------
   18. Why Open Innovation Matters Section (Judges Showcase)
   -------------------------------------------------------------------------- */
.open-innovation-section {
  padding: var(--space-8);
  margin-bottom: var(--space-10);
}

.section-badge {
  font-size: var(--font-size-xs);
  font-weight: 800;
  color: var(--color-primary-600);
  letter-spacing: 0.12em;
  margin-bottom: var(--space-2);
}

[data-theme="dark"] .section-badge {
  color: var(--color-cyan-400);
}

.open-innovation-section h2 {
  font-family: var(--font-family-display);
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  font-weight: 800;
  margin-bottom: var(--space-2);
  word-break: break-word;
  color: var(--text-primary);
}

.section-lead {
  color: var(--text-secondary);
  max-width: 820px;
  font-size: var(--font-size-base);
  margin-bottom: var(--space-6);
  line-height: 1.6;
}

.value-props-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-5);
}

.prop-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  transition: all var(--transition-fast);
  min-width: 0;
  box-shadow: var(--shadow-sm);
}

.prop-card:hover {
  border-color: var(--border-medium);
  background: var(--bg-surface);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.prop-icon {
  font-size: 1.8rem;
  margin-bottom: var(--space-3);
}

.prop-card h3 {
  font-family: var(--font-family-display);
  font-size: var(--font-size-base);
  font-weight: 700;
  margin-bottom: var(--space-2);
  color: var(--text-primary);
}

.prop-card p {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  line-height: 1.55;
}

/* --------------------------------------------------------------------------
   19. First User Testimonial Section
   -------------------------------------------------------------------------- */
.first-user-section {
  padding: var(--space-8);
  margin-bottom: var(--space-10);
  border-left: 4px solid var(--color-primary-500);
  background: var(--bg-surface);
}

.quote-stars {
  color: #f59e0b;
  font-size: 1.2rem;
  margin-bottom: var(--space-2);
}

.user-quote {
  font-size: clamp(0.95rem, 1.4vw, 1.15rem);
  font-style: italic;
  color: var(--text-primary);
  line-height: 1.6;
  margin-bottom: var(--space-5);
}

.quote-author {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.author-avatar {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, #10b981, #06b6d4);
  color: #ffffff;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.3);
}

.author-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.author-meta strong {
  font-size: var(--font-size-sm);
  color: var(--text-primary);
}

.author-meta span {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

.author-badge {
  margin-left: auto;
  font-size: var(--font-size-xs);
  font-weight: 700;
  color: var(--color-primary-700);
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  padding: 0.3rem 0.85rem;
  border-radius: var(--radius-full);
}

[data-theme="dark"] .author-badge {
  color: var(--color-primary-400);
}

/* --------------------------------------------------------------------------
   20. Modal & Overlays
   -------------------------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
}

.modal-overlay.hidden {
  display: none;
}

.modal-content {
  width: 100%;
  max-width: 900px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  padding: var(--space-6);
  min-width: 0;
  background: var(--bg-surface);
  box-shadow: var(--shadow-lg);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border-subtle);
}

.btn-close {
  background: transparent;
  border: none;
  font-size: 1.6rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
  padding: 0 var(--space-2);
}

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

.modal-body {
  overflow-y: auto;
  flex: 1;
  min-width: 0;
}

.csv-table-wrapper {
  margin-top: var(--space-4);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  overflow-x: auto;
}

.csv-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-size-xs);
  font-family: var(--font-family-mono);
  min-width: 600px;
}

.csv-table th,
.csv-table td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
  text-align: left;
}

.csv-table th {
  background: var(--bg-elevated);
  color: var(--color-primary-700);
}

[data-theme="dark"] .csv-table th {
  color: var(--color-primary-400);
}

/* Toast Notifications */
.toast-notification {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #10b981;
  color: #ffffff;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: var(--font-size-sm);
  box-shadow: var(--shadow-lg);
  z-index: 2000;
  animation: slideUp 0.3s ease;
  max-width: calc(100vw - 48px);
  word-break: break-word;
}

.toast-notification.hidden {
  display: none;
}

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

/* --------------------------------------------------------------------------
   21. Footer
   -------------------------------------------------------------------------- */
.app-footer {
  border-top: 1px solid var(--border-subtle);
  background: var(--footer-bg);
  padding: var(--space-8) var(--space-4);
  text-align: center;
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
}

.footer-sub {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  margin-top: var(--space-2);
}

/* --------------------------------------------------------------------------
   22. Comprehensive Responsive Breakpoints (Mobile, Tablet, Desktop, Ultrawide)
   -------------------------------------------------------------------------- */

/* Small Devices / Phones (< 640px) */
@media (max-width: 639px) {
  .main-container {
    padding: var(--space-4) var(--space-3) var(--space-8);
  }

  .header-container {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-2);
  }

  .header-badges {
    width: 100%;
    overflow-x: auto;
    padding-bottom: var(--space-1);
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
  }

  .metrics-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-3);
    padding: var(--space-3);
  }

  .intake-panel,
  .output-panel {
    padding: var(--space-4) var(--space-3);
  }

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

  .form-row {
    flex-direction: column;
    gap: var(--space-3);
  }

  .form-row .flex-1,
  .form-row .flex-2 {
    width: 100%;
    flex: none;
  }

  .pricing-kpi-grid {
    grid-template-columns: 1fr;
  }

  .agent-stepper {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-2);
  }

  .stepper-line {
    display: none;
  }

  .stepper-step {
    background: var(--bg-elevated);
    padding: var(--space-2);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
  }

  .value-props-grid {
    grid-template-columns: 1fr;
  }

  .open-innovation-section,
  .first-user-section {
    padding: var(--space-5) var(--space-4);
  }

  .author-badge {
    margin-left: 0;
    width: 100%;
    text-align: center;
  }
}

/* Tablet Devices (640px to 1023px) */
@media (min-width: 640px) and (max-width: 1023px) {
  .main-container {
    padding: var(--space-6) var(--space-5) var(--space-10);
  }

  .metrics-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: var(--space-4);
  }

  .agent-stepper {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-3);
  }

  .stepper-line {
    display: none;
  }

  .stepper-step {
    background: var(--bg-elevated);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
  }

  .form-row {
    flex-direction: column;
    gap: var(--space-3);
  }

  .pricing-kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .value-props-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Desktop Viewports (1024px to 1439px) */
@media (min-width: 1024px) {
  .workspace-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
    gap: var(--space-6);
  }
}

/* Large Screens & High-Resolution Displays (1440px to 1919px) */
@media (min-width: 1440px) {
  .main-container {
    max-width: 1480px;
    padding-left: var(--space-6);
    padding-right: var(--space-6);
  }

  .header-container {
    max-width: 1480px;
  }

  .workspace-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr);
    gap: var(--space-8);
  }

  .metrics-strip {
    max-width: 1100px;
  }
}

/* Ultrawide 1440p / 2560px+ Displays (Matches user's exact 2560x1305 viewport!) */
@media (min-width: 1920px) {
  .main-container {
    max-width: 1720px;
    padding: var(--space-8) var(--space-8) var(--space-16);
  }

  .header-container {
    max-width: 1720px;
    padding-left: var(--space-6);
    padding-right: var(--space-6);
  }

  .workspace-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
    gap: var(--space-8);
  }

  .intake-panel,
  .output-panel {
    padding: var(--space-8);
  }

  .metrics-strip {
    max-width: 1200px;
    padding: var(--space-5) var(--space-8);
  }

  .metric-val {
    font-size: 1.85rem;
  }

  .hero-title {
    max-width: 1100px;
  }

  .hero-desc {
    max-width: 860px;
    font-size: 1.25rem;
  }
}
