/* ═══════════════════════════════════════════════════════════════
   BuildOrbit Design System v2 — Light Theme
   Single source of truth. No inline styles allowed.
   ═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=DM+Mono:wght@400;500&display=swap');

/* ── 1. Design Tokens ──────────────────────────────────────────── */
:root {
  /* Background */
  --bg: #F8F9FA;
  --surface: #FFFFFF;
  --surface-2: #F1F5F9;
  --surface-3: #FFFFFF;
  --bg-surface: #FFFFFF;
  --bg-card: #FFFFFF;
  --bg-primary: #F8F9FA;

  /* Text */
  --text: #1A202C;
  --text-primary: #1A202C;
  --text-muted: #4A5568;
  --text-secondary: #4A5568;
  --text-dim: #94A3B8;

  /* Accent (blue) — CTAs and active states ONLY */
  --accent: #0EA5E9;
  --accent-dim: rgba(14, 165, 233, 0.08);
  --accent-border: rgba(14, 165, 233, 0.25);
  --accent-hover: #0284C7;

  /* Semantic */
  --success: #10B981;
  --success-dim: rgba(16, 185, 129, 0.08);
  --error: #EF4444;
  --error-dim: rgba(239, 68, 68, 0.08);
  --warning: #F59E0B;
  --warning-dim: rgba(245, 158, 11, 0.08);

  /* Borders */
  --border: #E5E7EB;
  --border-focus: #CBD5E1;
  --border-glow: #E5E7EB;

  /* Cards */
  --card: #FFFFFF;
  --card-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
  --card-shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.08);

  /* Disabled */
  --disabled: rgba(209, 213, 219, 0.5);

  /* Phase colors — monochromatic blue */
  --phase-intent-gate: rgba(14, 165, 233, 0.06);
  --phase-plan: rgba(14, 165, 233, 0.13);
  --phase-scaffold: rgba(14, 165, 233, 0.22);
  --phase-code: rgba(14, 165, 233, 0.35);
  --phase-save: rgba(14, 165, 233, 0.52);
  --phase-verify: rgba(14, 165, 233, 0.72);
  --phase-deploy: #0EA5E9;

  /* Agent colors */
  --planner: rgba(14, 165, 233, 0.7);
  --planner-dim: rgba(14, 165, 233, 0.08);
  --builder: #10B981;
  --builder-dim: rgba(16, 185, 129, 0.08);
  --qa: #F59E0B;
  --qa-dim: rgba(245, 158, 11, 0.08);
  --ops: #8B5CF6;
  --ops-dim: rgba(139, 92, 246, 0.08);

  /* Layout */
  --history-w: 320px;

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
}

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

html, body {
  height: 100%;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.6;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

img { max-width: 100%; }

/* ── 3. Typography — Better hierarchy and spacing ───────────────── */
h1, h2, h3, h4, h5, h6 {
  color: var(--text);
  line-height: 1.4;
  letter-spacing: -0.01em;
  margin-top: 0;
  margin-bottom: 0.75em;
}

h1 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 1em;
  line-height: 1.3;
}

h2 {
  font-size: 20px;
  font-weight: 600;
  margin-top: 1.5em;
  margin-bottom: 0.75em;
}

h3 {
  font-size: 16px;
  font-weight: 600;
  margin-top: 1.25em;
  margin-bottom: 0.5em;
}

h4 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 0.5em;
}

p {
  margin-bottom: 1em;
  line-height: 1.65;
}

.mono { font-family: 'DM Mono', monospace; }

.caption, .meta, .text-caption {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-dim);
  line-height: 1.5;
}

/* ── 4. Buttons ────────────────────────────────────────────────── */
button, .btn, [class*="btn"] {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  font-weight: 600;
  min-height: 44px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s ease;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0 1.25rem;
  min-width: 80px;
}

button:disabled, .btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Primary button */
.btn-primary,
.run-pipeline-btn,
.start-build-btn,
.cta-btn,
.nav-cta,
.new-run-btn,
#run-btn,
.modal-run-btn,
.price-cta {
  background: var(--accent);
  color: #FFFFFF;
  border: none;
  padding: 0 1.5rem;
  min-height: 44px;
  font-weight: 600;
  letter-spacing: -0.01em;
  box-shadow: 0 1px 3px rgba(14, 165, 233, 0.2);
}

.btn-primary:hover,
.run-pipeline-btn:hover,
.start-build-btn:hover,
.cta-btn:hover,
.nav-cta:hover,
.new-run-btn:hover,
#run-btn:hover,
.modal-run-btn:hover,
.price-cta:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.25);
}

/* Secondary button */
.btn-secondary {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent-border);
  padding: 0 1.25rem;
  min-height: 44px;
}

.btn-secondary:hover {
  background: var(--accent-dim);
  border-color: var(--accent);
}

/* Ghost button */
.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 0 1rem;
  min-height: 44px;
}

.btn-ghost:hover {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--border-focus);
}

/* Danger button */
.btn-danger,
.delete-confirm-btn {
  background: var(--error);
  color: #FFFFFF;
  border: none;
  min-height: 44px;
}

.btn-danger:hover,
.delete-confirm-btn:hover {
  background: #DC2626;
}

/* ── 5. Forms & Inputs ─────────────────────────────────────────── */
input, textarea, select {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 100%;
}

input:focus, textarea:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

input::placeholder, textarea::placeholder {
  color: var(--text-dim);
}

textarea {
  resize: vertical;
  min-height: 120px;
  line-height: 1.6;
}

label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.375rem;
}

/* ── 6. Cards ──────────────────────────────────────────────────── */
.card,
.project-card,
.status-card,
.agent-card,
.health-card,
.econ-stat-card,
.constraint-card,
.econ-section,
.qa-issue-card,
.prop-card,
.pos-card,
.price-card,
.plan-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--card-shadow);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.card:hover,
.project-card:hover,
.agent-card:hover,
.prop-card:hover {
  border-color: var(--border-focus);
  box-shadow: var(--card-shadow-hover);
}

/* ── 7. Navigation — Top Nav (Dashboard) ───────────────────────── */
.topnav {
  height: 56px;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  z-index: 100;
  flex-shrink: 0;
}

.topnav-left {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.topnav-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Logo */
.logo {
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--text);
}

.logo:hover { color: var(--text); }

.logo-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  animation: pulse-dot 2s ease-in-out infinite;
  flex-shrink: 0;
}

.nav-divider {
  width: 1px;
  height: 20px;
  background: var(--border);
}

.nav-title {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
}

.queue-badge {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  padding: 0.3rem 0.65rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.queue-badge .q-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--text-dim);
}

.queue-badge.active .q-dot {
  background: var(--accent);
  animation: pulse-dot 1s ease-in-out infinite;
}

/* Navigation links */
.nav-link {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.nav-link:hover { color: var(--text); }

.nav-back {
  font-size: 14px;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.nav-back:hover { color: var(--accent); }

.nav-action-link {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.15s;
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.nav-action-link:hover {
  color: var(--accent);
  border-color: var(--accent-border);
}

/* ── 8. Navigation — Landing Page ──────────────────────────────── */
.page-landing nav,
nav.landing-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  height: 60px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.nav-tag {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid var(--accent-border);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  letter-spacing: 0.03em;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.5rem 1.1rem;
  background: var(--accent);
  color: #FFFFFF;
  font-weight: 600;
  font-size: 14px;
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: all 0.2s;
  min-height: 40px;
}

.nav-cta:hover {
  background: var(--accent-hover);
  color: #FFFFFF;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.25);
}

/* ── 9. Dashboard Layout ───────────────────────────────────────── */
.page-dashboard body,
body.page-dashboard {
  display: flex;
  flex-direction: column;
}

.layout {
  display: flex;
  flex: 1;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

/* Sidebar — Run History */
.run-history {
  width: var(--history-w);
  min-width: var(--history-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.run-history-header {
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.run-history-header h2 {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-muted);
  font-family: 'DM Mono', monospace;
}

.run-count {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  color: var(--text-dim);
  background: var(--surface-2);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}

.runs-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem;
}

/* Run items */
.run-item {
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  border: 1px solid transparent;
  margin-bottom: 0.375rem;
  transition: all 0.2s;
  background: transparent;
}

.run-item:hover {
  background: var(--surface-2);
  border-color: var(--border);
}

.run-item.selected,
.run-item.active {
  background: var(--accent-dim);
  border-color: var(--accent-border);
  box-shadow: inset 3px 0 0 var(--accent);
}

.run-item-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.run-prompt-text {
  font-size: 13px;
  color: var(--text);
  line-height: 1.4;
  flex: 1;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.run-status-badge {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}

.run-status-badge.running {
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid var(--accent-border);
  animation: badge-pulse 1.5s ease-in-out infinite;
}

.run-status-badge.completed {
  color: var(--success);
  background: var(--success-dim);
}

.run-status-badge.failed {
  color: var(--error);
  background: var(--error-dim);
}

.run-status-badge.queued {
  color: var(--text-muted);
  background: var(--surface-2);
}

.run-status-badge.paused {
  color: var(--warning);
  background: var(--warning-dim);
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.run-deploy-badge {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}

.run-deploy-badge.deployed {
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid var(--accent-border);
}

.run-deploy-badge.none { display: none; }

/* Constraint badges */
.intent-badge {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  white-space: nowrap;
  flex-shrink: 0;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--text-muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.violation-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  font-size: 11px;
  flex-shrink: 0;
}

.violation-dot.clean { background: var(--accent-dim); color: var(--accent); }
.violation-dot.violations { background: var(--warning-dim); color: var(--warning); }
.violation-dot.hard-fail { background: var(--error-dim); color: var(--error); }

.run-item-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.run-time {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  color: var(--text-dim);
}

.run-phases-mini {
  display: flex;
  gap: 2px;
  align-items: center;
}

.phase-pip {
  width: 18px;
  height: 4px;
  border-radius: 2px;
  background: var(--border);
  transition: all 0.3s;
}

.phase-pip.done { background: var(--accent); }
.phase-pip.running { background: var(--accent); animation: pip-pulse 1s ease-in-out infinite; }
.phase-pip.failed { background: var(--error); }

.run-id-label {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  color: var(--text-dim);
}

.empty-runs {
  padding: 2rem 1.25rem;
  text-align: center;
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.6;
}

.empty-runs span {
  display: block;
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

/* Run delete button */
.run-delete-btn {
  opacity: 0.45;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-dim);
  padding: 3px 5px;
  border-radius: 5px;
  font-size: 12px;
  line-height: 1;
  flex-shrink: 0;
  transition: opacity 0.15s, color 0.15s, background 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: auto;
  min-width: auto;
}

.run-item:hover .run-delete-btn { opacity: 1; }
.run-delete-btn:hover { color: var(--error); background: var(--error-dim); }

/* Delete confirm modal */
.delete-confirm-modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  width: 100%;
  max-width: 400px;
  margin: 1rem;
  animation: slideUp 0.25s ease;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
}

.delete-confirm-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.3px;
  margin-bottom: 0.6rem;
}

.delete-confirm-desc {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 1.5rem;
}

.delete-confirm-actions {
  display: flex;
  gap: 0.65rem;
  justify-content: flex-end;
}

.delete-cancel-btn {
  padding: 0.5rem 1.25rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  transition: all 0.15s;
  min-height: 44px;
}

.delete-cancel-btn:hover {
  color: var(--text);
  border-color: var(--border-focus);
}

/* ── 10. Main Panel & Tabs ─────────────────────────────────────── */
.main-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg);
}

.panel-tabs {
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  height: 44px;
  flex-shrink: 0;
  gap: 0;
}

.panel-tab {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 0 1rem;
  height: 44px;
  display: flex;
  align-items: center;
  cursor: pointer;
  color: var(--text-dim);
  border-bottom: 2px solid transparent;
  border: none;
  background: transparent;
  transition: all 0.2s;
  white-space: nowrap;
  min-height: auto;
  min-width: auto;
}

.panel-tab:hover { color: var(--text-muted); }

.panel-tab.active {
  color: var(--accent);
  border-bottom: 2px solid var(--accent);
}

.panel-tab .tab-badge {
  margin-left: 0.4rem;
  background: var(--error-dim);
  color: var(--error);
  border-radius: 4px;
  padding: 0.05rem 0.35rem;
  font-size: 11px;
}

.panel-tab .tab-badge.green {
  background: var(--accent-dim);
  color: var(--accent);
}

.panel-tabs-spacer { flex: 1; }

.panel-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Retry button */
.retry-btn {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  padding: 0.3rem 0.75rem;
  background: transparent;
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
  display: none;
  min-height: auto;
  min-width: auto;
}

.retry-btn:hover { background: var(--warning-dim); }
.retry-btn.show { display: flex; align-items: center; gap: 0.35rem; }

/* Intervention buttons */
.intv-btn {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  padding: 0.3rem 0.75rem;
  background: transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
  display: none;
  align-items: center;
  gap: 0.35rem;
  min-height: auto;
  min-width: auto;
}

.intv-btn.show { display: flex; }
.intv-btn-pause { color: var(--warning); border: 1px solid rgba(245, 158, 11, 0.3); }
.intv-btn-pause:hover { background: var(--warning-dim); }
.intv-btn-resume { color: var(--accent); border: 1px solid var(--accent-border); }
.intv-btn-resume:hover { background: var(--accent-dim); }
.intv-btn-inject { color: var(--text-muted); border: 1px solid var(--border); }
.intv-btn-inject:hover { background: var(--surface-2); color: var(--text); }
.intv-btn-override { color: var(--text-muted); border: 1px solid var(--border); }
.intv-btn-override:hover { background: var(--surface-2); color: var(--text); }

/* Dashboard paused banner */
.dash-paused-banner {
  display: none;
  padding: 0.75rem 1rem;
  background: var(--warning-dim);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: var(--radius-md);
  font-size: 13px;
  color: var(--warning);
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.dash-paused-banner.show { display: flex; }

.dash-paused-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--warning);
  box-shadow: 0 0 6px var(--warning);
  animation: badge-pulse 1.2s ease-in-out infinite;
  flex-shrink: 0;
}

/* Intervention panels */
.dash-intv-panel {
  display: none;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  margin-bottom: 0.75rem;
}

.dash-intv-panel.show { display: block; }
.dash-intv-panel.inject-mode { background: var(--surface-2); border: 1px solid var(--border); }
.dash-intv-panel.override-mode { background: var(--surface-2); border: 1px solid var(--border); }

.dash-intv-label {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.5rem;
  color: var(--text-muted);
}

.dash-intv-row { display: flex; gap: 0.5rem; }

.dash-intv-input {
  flex: 1;
  padding: 0.5rem 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  outline: none;
}

.dash-intv-input:focus { border-color: var(--accent); }

.dash-intv-send,
.dash-override-send {
  padding: 0.5rem 1rem;
  background: var(--accent);
  border: none;
  border-radius: var(--radius-sm);
  color: #FFFFFF;
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  min-height: auto;
  min-width: auto;
}

.dash-intv-send:hover,
.dash-override-send:hover {
  background: var(--accent-hover);
}

.dash-intv-send:disabled { opacity: 0.4; cursor: not-allowed; }

.dash-override-agents { display: flex; gap: 0.35rem; flex-wrap: wrap; margin-bottom: 0.5rem; }

.dash-override-agent {
  padding: 0.3rem 0.6rem;
  border-radius: 5px;
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  transition: all 0.2s;
  min-height: auto;
  min-width: auto;
}

.dash-override-agent:hover,
.dash-override-agent.sel,
.dash-override-agent.selected {
  background: var(--accent-dim);
  border-color: var(--accent-border);
  color: var(--accent);
}

.dash-override-textarea {
  flex: 1;
  padding: 0.5rem 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  outline: none;
  min-height: 50px;
  resize: vertical;
}

/* Panel content */
.panel-content {
  flex: 1;
  overflow: hidden;
  position: relative;
  padding: 1.5rem 1.75rem 2rem;
}

.tab-panel {
  display: none;
  height: 100%;
  overflow-y: auto;
  padding: 1.75rem;
}

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

/* No selection state */
.no-selection {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-dim);
  text-align: center;
  gap: 0.75rem;
  padding: 4rem 2rem;
}

.no-selection .icon { font-size: 2.5rem; opacity: 0.4; }
.no-selection h3 { font-size: 16px; color: var(--text-muted); }
.no-selection p { font-size: 14px; color: var(--text-dim); max-width: 320px; }

/* Section headings */
.section-heading {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  font-weight: 600;
  margin-bottom: 0.75rem;
  margin-top: 1.5rem;
}

/* ── 11. Terminal ──────────────────────────────────────────────── */
.terminal {
  background: #1E293B;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.terminal-header {
  background: #1E293B;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.5rem 1rem;
}

.terminal-body,
.term-content {
  padding: 1rem 1.25rem;
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  line-height: 1.8;
  color: #CBD5E1;
  background: #1E293B;
}

.term-tab {
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-dim);
  background: transparent;
  border: none;
  transition: all 0.15s;
  cursor: pointer;
  min-height: auto;
  min-width: auto;
}

.term-tab:hover { color: var(--text-muted); background: var(--surface-2); }
.term-tab.active { color: var(--accent); background: var(--accent-dim); }

/* ── 11b. Completed Banner ────────────────────────────────────── */
.completed-banner {
  display: none;
  padding: 1.5rem;
  text-align: center;
  border-radius: var(--radius-lg);
  background: var(--surface-2);
  border: 1px solid var(--border);
  margin-top: 1rem;
}
.completed-banner.show { display: block; }
/* Success: green — only shown when ALL checks pass */
.completed-banner.success {
  background: rgba(16, 185, 129, 0.12);
  border-color: var(--success);
  border-width: 2px;
}
.completed-banner.success h3 { color: #059669; }
/* Warning: amber — some checks failed */
.completed-banner.warning {
  background: rgba(245, 158, 11, 0.12);
  border-color: var(--warning);
  border-width: 2px;
}
.completed-banner.warning h3 { color: #D97706; }
.completed-banner.warning p  { color: #92400E; }
/* Error: red — all checks failed */
.completed-banner.error {
  background: rgba(239, 68, 68, 0.12);
  border-color: var(--error);
  border-width: 2px;
}
.completed-banner.error h3 { color: #DC2626; }
.completed-banner.error p  { color: #991B1B; }

/* Failed checks list inside the banner */
.banner-failed-checks {
  margin-top: 0.75rem;
  padding: 0.75rem 1rem;
  background: rgba(0, 0, 0, 0.04);
  border-radius: var(--radius-md);
  text-align: left;
  display: inline-block;
  min-width: 260px;
  max-width: 480px;
}
.failed-check-item {
  font-size: 13px;
  padding: 0.25rem 0;
  color: var(--error);
  line-height: 1.4;
}
.failed-check-item::before {
  content: "\2717  ";
  font-weight: 600;
}
.completed-banner.warning .failed-check-item { color: #B45309; }
.completed-banner.error .failed-check-item   { color: #DC2626; }

/* ── 12. Agent Cards ───────────────────────────────────────────── */
.agents-row {
  display: grid;
  gap: 16px;
}

.agent-card {
  padding: 16px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
}

.agent-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.agent-stage {
  font-size: 12px;
  color: var(--text-dim);
  font-family: 'DM Mono', monospace;
}

.agent-indicator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

/* ── 13. Economics / Stats ─────────────────────────────────────── */
.econ-stats-row {
  gap: 16px;
}

.econ-stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
}

.econ-stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text);
}

.econ-stat-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
}

/* Cost bars */
.cost-bar-fill {
  border-radius: 4px;
  background: var(--accent);
}

.cost-bar-track {
  background: var(--surface-2);
  border-radius: 4px;
  overflow: hidden;
}

.cost-trend-bar {
  border-radius: 3px;
  min-width: 8px;
}

.cost-trend-bar.running { background: var(--accent-dim); color: var(--accent); }
.cost-trend-bar.complete { background: var(--success-dim); color: var(--success); }
.cost-trend-bar.failed { background: var(--error-dim); color: var(--error); }

/* Budget bar */
.budget-track {
  background: var(--surface-2);
  border-radius: 4px;
  overflow: hidden;
}

.budget-fill {
  background: var(--accent);
  border-radius: 4px;
}

/* ── 14. Phase Progress Bar ────────────────────────────────────── */
.phase-bar-step {
  transition: all 0.3s ease;
}

.phase-bar-step[data-status="active"] .p-dot,
.phase-bar-step[data-status="running"] .p-dot {
  background: var(--accent);
  box-shadow: 0 0 8px rgba(14, 165, 233, 0.5);
}

.phase-bar-step[data-status="complete"] .p-dot,
.phase-bar-step[data-status="completed"] .p-dot {
  background: var(--success);
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.4);
}

.p-connector {
  background: var(--border);
}

/* ── 15. Constraint Health ─────────────────────────────────────── */
.constraint-health-bar {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
}

.chp {
  font-size: 11px;
  padding: 0.2rem 0.5rem;
  background: var(--surface-2);
  border-radius: 4px;
  color: var(--text-muted);
}

.chp-count {
  color: var(--accent);
  font-weight: 600;
}

/* ── 16. Badges ────────────────────────────────────────────────── */
.badge-running, .status-running {
  background: var(--accent-dim);
  color: var(--accent);
}

.badge-complete, .status-complete,
.badge-success, .status-success {
  background: var(--success-dim);
  color: var(--success);
}

.badge-queued, .status-queued,
.badge-pending, .status-pending,
.badge-idle, .status-idle {
  background: var(--surface-2);
  color: var(--text-muted);
}

.badge-failed, .status-failed,
.badge-error, .status-error {
  background: var(--error-dim);
  color: var(--error);
}

/* Tab badges */
.tab-badge {
  background: var(--accent);
  color: #FFFFFF;
  border-radius: 10px;
  padding: 0.1rem 0.5rem;
  font-size: 11px;
  font-weight: 700;
  min-width: 1.25rem;
  text-align: center;
}

/* ── 17. Modals ────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-overlay.show,
.modal-overlay.active {
  display: flex;
}

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 32px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
  max-width: 540px;
  width: 100%;
  margin: 1rem;
  animation: slideUp 0.25s ease;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.modal-header h2 {
  font-size: 20px;
  font-weight: 700;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 18px;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: var(--radius-sm);
  transition: all 0.15s;
  min-height: auto;
  min-width: auto;
}

.modal-close:hover {
  color: var(--text);
  background: var(--surface-2);
}

.modal textarea,
.modal input,
#modal-prompt {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  padding: 0.75rem 1rem;
  font-size: 14px;
}

.modal textarea:focus,
.modal input:focus,
#modal-prompt:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
  outline: none;
}

/* ── 18. Toast ─────────────────────────────────────────────────── */
.toast {
  border-radius: var(--radius-md);
  padding: 0.75rem 1.25rem;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

/* ── 19. Analytics Stats Bar ───────────────────────────────────── */
.analytics-bar {
  height: 36px;
  min-height: 36px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  padding: 0 1.5rem;
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  color: var(--text-dim);
  flex-shrink: 0;
}

/* ── 20. Plan/Credits Badge ────────────────────────────────────── */
.plan-credits-badge {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--text-dim);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.25rem 0.55rem;
  white-space: nowrap;
}

.upgrade-link {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #FFFFFF;
  background: var(--accent);
  border-radius: var(--radius-sm);
  padding: 0.25rem 0.65rem;
  text-decoration: none;
  transition: opacity 0.15s;
}

.upgrade-link:hover { opacity: 0.85; color: #FFFFFF; }

.manage-sub-link {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--text-dim);
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.25rem 0.55rem;
  transition: color 0.15s;
}

.manage-sub-link:hover { color: var(--accent); }

/* ═══════════════════════════════════════════════════════════════
   PAGE-SPECIFIC STYLES
   ═══════════════════════════════════════════════════════════════ */

/* ── 21. Landing Page ──────────────────────────────────────────── */
.page-landing {
  display: block;
}

.page-landing body,
body.page-landing {
  background: var(--bg);
}

/* Hero */
.hero {
  max-width: 860px;
  margin: 0 auto;
  padding: 5rem 2rem 4rem;
  text-align: center;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid var(--accent-border);
  padding: 0.35rem 0.9rem;
  border-radius: 100px;
  margin-bottom: 2rem;
}

.hero-eyebrow::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse-dot 2s ease-in-out infinite;
}

.hero h1 {
  font-size: clamp(2.4rem, 5vw, 3.2rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.03em;
  color: var(--text);
  margin: 0 0 1.5rem;
}

.hero h1 em {
  font-style: normal;
  color: var(--accent);
}

.hero-sub {
  font-size: 1.1rem;
  line-height: 1.65;
  color: var(--text-muted);
  max-width: 620px;
  margin: 0 auto 2.5rem;
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.cta-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.85rem 2rem;
  background: var(--accent);
  color: #FFFFFF;
  font-weight: 700;
  font-size: 16px;
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: all 0.2s;
  min-height: 44px;
}

.cta-primary:hover {
  background: var(--accent-hover);
  color: #FFFFFF;
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(14, 165, 233, 0.3);
}

.cta-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.85rem 1.75rem;
  background: transparent;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: all 0.2s;
  min-height: 44px;
}

.cta-secondary:hover {
  border-color: var(--border-focus);
  color: var(--text);
  background: var(--surface-2);
}

/* Pipeline visualization */
.pipeline-viz {
  max-width: 900px;
  margin: 0 auto 5rem;
  padding: 0 2rem;
}

.pipeline-track {
  display: flex;
  align-items: stretch;
  gap: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--card-shadow);
}

.pipeline-phase {
  flex: 1;
  padding: 1.2rem 0.75rem;
  text-align: center;
  border-right: 1px solid var(--border);
  position: relative;
  transition: background 0.2s;
}

.pipeline-phase:last-child { border-right: none; }
.pipeline-phase:hover { background: var(--accent-dim); }

.phase-num {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--text-dim);
  margin-bottom: 0.4rem;
  letter-spacing: 0.05em;
}

.phase-name {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.pipeline-phase.p1 .phase-name { color: rgba(14, 165, 233, 0.5); }
.pipeline-phase.p2 .phase-name { color: rgba(14, 165, 233, 0.62); }
.pipeline-phase.p3 .phase-name { color: rgba(14, 165, 233, 0.74); }
.pipeline-phase.p4 .phase-name { color: rgba(14, 165, 233, 0.86); }
.pipeline-phase.p5 .phase-name { color: rgba(14, 165, 233, 0.94); }
.pipeline-phase.p6 .phase-name { color: var(--accent); }

.pipeline-caption {
  text-align: center;
  margin-top: 1rem;
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.04em;
}

/* Sections */
.section {
  max-width: 1080px;
  margin: 0 auto;
  padding: 5rem 2rem;
}

.section-label {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: 1rem;
}

.section-title {
  font-size: clamp(1.75rem, 3.5vw, 2.2rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.2;
  color: var(--text);
  margin: 0 0 1rem;
}

.section-sub {
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text-muted);
  max-width: 560px;
}

/* Value props */
.props-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 3rem;
}

.prop-card {
  padding: 24px;
}

.prop-card:hover {
  border-color: var(--accent-border);
}

.prop-icon {
  width: 40px;
  height: 40px;
  background: var(--accent-dim);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  margin-bottom: 1.25rem;
}

.prop-label {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.prop-card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 0 0 0.75rem;
}

.prop-card p {
  font-size: 14px;
  line-height: 1.65;
  color: var(--text-muted);
  margin: 0;
}

/* Pipeline deep dive */
.pipeline-section {
  background: var(--surface-2);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.pipeline-steps {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: 3rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface);
}

.pipeline-step {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  padding: 1.5rem 1.75rem;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}

.pipeline-step:last-child { border-bottom: none; }
.pipeline-step:hover { background: var(--accent-dim); }

.step-badge {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  font-weight: 500;
  margin-top: 2px;
}

.step-s1 { background: rgba(14, 165, 233, 0.08); color: rgba(14, 165, 233, 0.6); border: 1px solid rgba(14, 165, 233, 0.15); }
.step-s2 { background: rgba(14, 165, 233, 0.12); color: rgba(14, 165, 233, 0.72); border: 1px solid rgba(14, 165, 233, 0.2); }
.step-s3 { background: rgba(14, 165, 233, 0.18); color: rgba(14, 165, 233, 0.84); border: 1px solid rgba(14, 165, 233, 0.25); }
.step-s4 { background: rgba(14, 165, 233, 0.25); color: rgba(14, 165, 233, 0.92); border: 1px solid rgba(14, 165, 233, 0.3); }
.step-s5 { background: rgba(14, 165, 233, 0.35); color: var(--accent); border: 1px solid rgba(14, 165, 233, 0.4); }
.step-s6 { background: rgba(14, 165, 233, 0.5); color: #FFFFFF; border: 1px solid var(--accent); }

.step-body h4 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.step-phase-tag {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid var(--accent-border);
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
}

.step-body p {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-muted);
  margin: 0;
}

/* Positioning cards */
.positioning-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 3rem;
}

.pos-card {
  padding: 24px;
}

.pos-vs {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  margin-bottom: 0.75rem;
}

.pos-card h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 0.6rem;
}

.pos-card p {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-muted);
  margin: 0;
}

.pos-card.highlight {
  background: var(--accent-dim);
  border-color: var(--accent-border);
}

.pos-card.highlight h3 { color: var(--accent); }

/* Audit block */
.audit-block {
  margin-top: 3rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  display: flex;
  align-items: flex-start;
  gap: 2rem;
  box-shadow: var(--card-shadow);
}

.audit-left { flex: 1; }

.audit-left h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 0.75rem;
}

.audit-left p {
  font-size: 14px;
  line-height: 1.65;
  color: var(--text-muted);
  margin: 0 0 1.5rem;
}

.audit-checks {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.audit-check {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 14px;
  color: var(--text-muted);
}

.audit-check::before {
  content: '\2713';
  color: var(--accent);
  font-weight: 700;
  font-size: 14px;
}

.audit-right { flex-shrink: 0; width: 280px; }

.trace-mock {
  background: #1E293B;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  line-height: 1.8;
}

.trace-line {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #64748B;
}

.trace-line.active { color: var(--accent); }
.trace-line.done { color: var(--success); }

.trace-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
  background: currentColor;
}

/* Industries strip */
.industries-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-top: 2rem;
}

.industry-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius-sm);
}

/* Landing pricing section */
.pricing-section {
  max-width: 680px;
  margin: 0 auto;
  padding: 5rem 2rem;
  text-align: center;
}

.price-card {
  border-color: var(--accent-border);
  padding: 40px;
  margin-top: 2.5rem;
  box-shadow: 0 4px 24px rgba(14, 165, 233, 0.08);
}

.price-amount {
  font-size: 3rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--text);
  line-height: 1;
  margin-bottom: 0.25rem;
}

.price-amount span {
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--text-muted);
  vertical-align: super;
  letter-spacing: 0;
}

.price-period {
  font-size: 14px;
  color: var(--text-dim);
  margin-bottom: 1.75rem;
}

.price-features {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  text-align: left;
  margin-bottom: 2rem;
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
}

.price-feature {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 14px;
  color: var(--text-muted);
}

.price-feature::before {
  content: '\2192';
  color: var(--accent);
  font-weight: 700;
  flex-shrink: 0;
}

.price-cta {
  display: block;
  width: 100%;
  padding: 1rem;
  text-align: center;
  text-decoration: none;
}

.price-note {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 1rem;
}

/* Closing CTA */
.closing {
  text-align: center;
  padding: 5rem 2rem 6rem;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}

.closing h2 {
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
  margin: 0 0 1rem;
}

.closing p {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 480px;
  margin: 0 auto 2.5rem;
  line-height: 1.65;
}

/* Divider */
.section-divider {
  height: 1px;
  background: var(--border);
}

/* ── Demo Section ───────────────────────────────────────────── */
.demo-section {
  max-width: 960px;
  margin: 0 auto;
  padding: 3rem 2rem 4rem;
  text-align: center;
}

.demo-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--success);
  background: var(--success-dim);
  border: 1px solid rgba(16, 185, 129, 0.2);
  padding: 0.35rem 0.9rem;
  border-radius: 100px;
  margin-bottom: 1.5rem;
}

.demo-live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  animation: pulse-dot 2s ease-in-out infinite;
}

.demo-headline {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
  margin: 0 0 1rem;
}

.demo-sub {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 480px;
  margin: 0 auto 2.5rem;
  line-height: 1.6;
}

/* Player chrome */
.demo-player {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.07), 0 1px 4px rgba(0, 0, 0, 0.04);
  text-align: left;
}

.demo-chrome {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}

.demo-chrome-dots {
  display: flex;
  gap: 5px;
  flex-shrink: 0;
}
.demo-chrome-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border);
}
.demo-chrome-dots span:nth-child(1) { background: #FF5F57; }
.demo-chrome-dots span:nth-child(2) { background: #FFBD2E; }
.demo-chrome-dots span:nth-child(3) { background: #28C840; }

.demo-chrome-url {
  flex: 1;
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--text-dim);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.3rem 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  letter-spacing: -0.01em;
  max-width: 320px;
  margin: 0 auto;
}
.demo-chrome-lock { font-size: 10px; }

.demo-chrome-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.demo-restart-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-dim);
  width: 28px;
  height: 28px;
  min-height: 28px;
  min-width: 28px;
  border-radius: var(--radius-sm);
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}
.demo-restart-btn:hover {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border-focus);
}

/* Screen */
.demo-screen {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 380px;
}

.demo-left {
  padding: 1.5rem;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.demo-prompt-area {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  min-height: 72px;
}

.demo-prompt-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  margin-bottom: 0.4rem;
}

.demo-prompt-text {
  font-size: 13px;
  color: var(--text);
  line-height: 1.55;
  min-height: 20px;
}

.demo-cursor {
  display: inline-block;
  width: 2px;
  color: var(--accent);
  font-weight: 300;
  animation: blink-cursor 0.9s step-end infinite;
}

@keyframes blink-cursor {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* Phase log */
.demo-phase-log {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.demo-phase-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.5rem;
  border-radius: var(--radius-sm);
  transition: background 0.2s ease;
}
.demo-phase-row--running {
  background: var(--accent-dim);
}
.demo-phase-row--done {
  background: var(--success-dim);
}

.demo-phase-num {
  font-size: 10px;
  color: var(--text-dim);
  min-width: 18px;
}

.demo-phase-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.demo-phase-dot--running {
  background: var(--accent);
  animation: pulse-dot 1.2s ease-in-out infinite;
}
.demo-phase-dot--done {
  background: var(--success);
}

.demo-phase-name {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text);
  flex: 1;
  text-transform: uppercase;
}

.demo-phase-state {
  font-size: 10px;
  color: var(--text-dim);
}

/* Right output panel */
.demo-right {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  overflow: hidden;
}

.demo-output-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.demo-output-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
}

.demo-status-badge {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  padding: 0.2rem 0.6rem;
  border-radius: 100px;
  background: var(--surface-2);
  color: var(--text-dim);
  border: 1px solid var(--border);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.demo-status-badge--running {
  background: var(--accent-dim);
  color: var(--accent);
  border-color: var(--accent-border);
}
.demo-status-badge--complete {
  background: var(--success-dim);
  color: var(--success);
  border-color: rgba(16, 185, 129, 0.2);
}

.demo-output-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  overflow: hidden;
}

.demo-output-idle {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 200px;
  gap: 0.75rem;
  color: var(--text-dim);
}
.demo-idle-icon {
  font-size: 28px;
  opacity: 0.4;
}
.demo-idle-text {
  font-size: 12px;
  font-family: 'DM Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Output item types */
.demo-output-badge {
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.06em;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-sm);
  display: inline-block;
  margin-bottom: 0.25rem;
}
.demo-output-badge--success {
  background: var(--success-dim);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.demo-output-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 12px;
  padding: 0.15rem 0;
}
.demo-output-key {
  font-size: 10px;
  color: var(--text-dim);
  min-width: 80px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.demo-output-val {
  color: var(--text);
}

.demo-output-task {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 12px;
  color: var(--text-muted);
  padding: 0.2rem 0;
}
.demo-output-task.done {
  color: var(--text-dim);
  text-decoration: line-through;
}
.demo-task-check {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--success);
  min-width: 16px;
}
.demo-output-task.done .demo-task-check { color: var(--success); }

.demo-output-file {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 12px;
  padding: 0.15rem 0;
  color: var(--text);
}
.demo-file-icon { font-size: 11px; }

.demo-output-code {
  background: #1a1f2e;
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  overflow: hidden;
  flex: 1;
}
.demo-code-line {
  font-size: 11px;
  color: #8fa1b3;
  line-height: 1.7;
  white-space: nowrap;
}
.demo-code-line:first-child { color: #c9d1d9; }
.demo-code-line:nth-child(2) { color: #79c0ff; }
.demo-code-line:nth-child(3) { color: #ffa657; }

.demo-save-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  margin-bottom: 0.25rem;
}
.demo-save-version {
  font-family: 'DM Mono', monospace;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
}
.demo-save-meta {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 0.2rem;
}

.demo-verify-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 12px;
  color: var(--text);
  padding: 0.15rem 0;
}
.demo-verify-check {
  color: var(--success);
  font-weight: 700;
  font-size: 13px;
  min-width: 16px;
}

.demo-complete-badge {
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--success);
  background: var(--success-dim);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.75rem;
  text-align: center;
  margin-top: 0.5rem;
}

/* Progress bar */
.demo-progress-bar {
  height: 3px;
  background: var(--surface-2);
  border-top: 1px solid var(--border);
}
.demo-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--success));
  width: 0%;
  transition: width 0.4s ease;
}

/* CTA row below demo */
.demo-cta-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}

/* Responsive demo */
@media (max-width: 640px) {
  .demo-section { padding: 2.5rem 1.25rem 3rem; }
  .demo-screen {
    grid-template-columns: 1fr;
    min-height: auto;
  }
  .demo-left {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .demo-chrome-url { display: none; }
}

/* Footer */
footer {
  padding: 2rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-pipeline {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.04em;
}

.footer-pipeline .arrow { color: var(--accent); opacity: 0.5; }

footer p {
  font-size: 12px;
  color: var(--text-dim);
  margin: 0;
}

/* ── Structured Site Footer ─────────────────────────────── */
.site-footer {
  background: #0f1117;
  border-top: 1px solid #1e2433;
  padding: 4rem 2rem 0;
}

.footer-inner {
  max-width: 1140px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 3rem;
  padding-bottom: 3rem;
}

/* Brand */
.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.01em;
}

.footer-logo-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

.footer-tagline {
  font-size: 13px;
  line-height: 1.6;
  color: #64748b;
  margin: 0;
}

/* Link columns */
.footer-links {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.footer-col-heading {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #94a3b8;
  margin-bottom: 0.25rem;
}

.footer-link {
  font-size: 13px;
  color: #64748b;
  text-decoration: none;
  transition: color 0.2s ease;
  line-height: 1.4;
}

.footer-link:hover {
  color: #e2e8f0;
}

/* Bottom bar */
.footer-bottom {
  max-width: 1140px;
  margin: 0 auto;
  padding: 1.25rem 0;
  border-top: 1px solid #1e2433;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.footer-bottom-left {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.footer-pipeline-mono {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: #64748b;
  letter-spacing: 0.04em;
}

.footer-arrow {
  color: var(--accent);
  opacity: 0.4;
  font-size: 11px;
}

.footer-copy {
  font-size: 12px;
  color: #475569;
}

/* Responsive */
@media (max-width: 768px) {
  .site-footer {
    padding: 3rem 1.5rem 0;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .footer-links {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .footer-bottom-left {
    flex-wrap: wrap;
    gap: 0.3rem;
  }
}

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

/* ── 22. Auth Pages (signup.html) ──────────────────────────────── */
body.page-auth,
.page-auth {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  overflow: hidden;
  background: var(--bg);
}

.terminal-wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 600px;
  padding: 0 1.5rem;
}

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 3rem;
}

.version-tag {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 1px;
}

.prompt-block {
  margin-bottom: 1rem;
}

.prompt-label {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
  letter-spacing: 0.5px;
}

.prompt-label .accent { color: var(--accent); }

.input-container {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input-container:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.prompt-prefix {
  font-family: 'DM Mono', monospace;
  font-size: 14px;
  color: var(--accent);
  padding: 0 0 0 1.1rem;
  white-space: nowrap;
  user-select: none;
  flex-shrink: 0;
}

.input-field {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: 'DM Mono', monospace;
  font-size: 14px;
  color: var(--text);
  padding: 1rem 1rem 1rem 0.5rem;
  caret-color: var(--accent);
  width: auto;
}

.input-field::placeholder { color: var(--text-dim); }

.enter-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.9rem 1.5rem;
  background: var(--accent);
  color: #FFFFFF;
  font-family: 'DM Mono', monospace;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 16px rgba(14, 165, 233, 0.2);
  min-height: 44px;
}

.enter-btn:hover:not(:disabled) {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 24px rgba(14, 165, 233, 0.3);
}

.enter-btn:active:not(:disabled) {
  transform: scale(0.985);
}

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

.enter-btn .spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #FFFFFF;
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
  flex-shrink: 0;
}

.enter-btn .enter-hint {
  font-size: 10px;
  opacity: 0.5;
  letter-spacing: 0;
  font-weight: 400;
  text-transform: none;
}

.error-box {
  background: var(--error-dim);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: var(--radius-md);
  padding: 0.7rem 1rem;
  font-size: 13px;
  color: var(--error);
  margin-bottom: 1rem;
  display: none;
  font-family: 'DM Mono', monospace;
}

.mode-toggle {
  text-align: center;
  margin-top: 1.25rem;
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  color: var(--text-dim);
}

.mode-toggle a {
  color: var(--accent);
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.15s;
}

.mode-toggle a:hover { opacity: 0.8; }

.magic-link-fallback {
  text-align: center;
  margin-top: 0.75rem;
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--text-dim);
}

.magic-link-fallback a {
  color: var(--text-muted);
  text-decoration: none;
  cursor: pointer;
  transition: color 0.15s;
}

.magic-link-fallback a:hover { color: var(--accent); }

.field-hint {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 0.35rem;
  padding-left: 0.2rem;
}

/* Confirmation state */
.confirm-state { display: none; }

.confirm-block {
  text-align: center;
  padding: 2rem 0;
}

.confirm-icon {
  width: 52px;
  height: 52px;
  background: var(--accent-dim);
  border: 1px solid var(--accent-border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
}

.confirm-icon svg {
  width: 22px;
  height: 22px;
  stroke: var(--accent);
  fill: none;
  stroke-width: 2;
}

.confirm-heading {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.4px;
  margin-bottom: 0.5rem;
}

.confirm-text {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 0.25rem;
}

.confirm-email {
  color: var(--accent);
  font-weight: 600;
  font-family: 'DM Mono', monospace;
}

.confirm-sub {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 1.5rem;
  margin-top: 0.4rem;
}

.resend-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 14px;
  padding: 0.55rem 1.25rem;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
  width: 100%;
  min-height: 44px;
}

.resend-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

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

.resend-note {
  font-size: 12px;
  color: var(--text-dim);
  font-family: 'DM Mono', monospace;
  margin-top: 0.75rem;
  min-height: 1.2em;
}

/* Challenge box */
.challenge-box {
  display: none;
  background: var(--error-dim);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: var(--radius-md);
  padding: 1rem 1.2rem;
  margin-bottom: 1rem;
}

.challenge-box .challenge-label {
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.challenge-box .challenge-input {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: 'DM Mono', monospace;
  font-size: 14px;
  padding: 0.5rem 0.75rem;
  width: 100%;
  outline: none;
}

.challenge-box .challenge-input:focus { border-color: var(--accent); }

.note {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.5px;
  white-space: nowrap;
}

/* ── 23. Run / New Task Page ───────────────────────────────────── */
.page-run nav,
.page-new-task nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  height: 60px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.page-run main,
.page-new-task main {
  max-width: 780px;
  margin: 0 auto;
  padding: 3rem 2rem 4rem;
}

.page-run #input-section h1,
.page-new-task h1 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.subtitle {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 2rem;
}

.input-wrapper {
  margin-bottom: 1rem;
}

.input-wrapper textarea,
#prompt {
  width: 100%;
  min-height: 160px;
  padding: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  resize: vertical;
}

.input-wrapper textarea:focus,
#prompt:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

/* Advanced config inputs */
.adv-config-input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.adv-config-input:focus { border-color: var(--accent); }

/* Budget/context details */
details {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-top: 0.75rem;
}

details summary {
  padding: 0.75rem 1rem;
  cursor: pointer;
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
  background: var(--surface);
}

details summary::-webkit-details-marker { display: none; }

details > div {
  padding: 0.85rem 1rem;
  background: var(--surface);
  border-top: 1px solid var(--border);
}

/* ── 24. Trace / Build History Page ────────────────────────────── */
.page-trace,
.page-history {
  background: var(--bg);
}

/* ── Trace: Run Picker ─────────────────────────────────────────── */
#run-picker {
  max-width: 720px;
  margin: 0 auto;
  padding: 2.5rem 2rem;
}

#run-picker h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.25rem;
}

#run-picker > p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.intent-filter-bar {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.intent-filter-btn {
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}

.intent-filter-btn:hover {
  border-color: var(--accent-border);
  color: var(--accent);
}

.intent-filter-btn.active {
  background: var(--accent-dim);
  border-color: var(--accent-border);
  color: var(--accent);
}

.run-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.page-trace .run-item,
.page-history .run-item {
  display: block;
  text-decoration: none;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  transition: all 0.15s;
}

.page-trace .run-item:hover,
.page-history .run-item:hover {
  border-color: var(--accent-border);
  box-shadow: var(--card-shadow-hover);
}

.run-item-prompt {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 0.4rem;
  line-height: 1.4;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.page-trace .run-item-meta,
.page-history .run-item-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  font-size: 0.75rem;
  color: var(--text-dim);
}

/* Status badges */
.badge {
  font-family: 'DM Mono', monospace;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.15rem 0.45rem;
  border-radius: 3px;
  white-space: nowrap;
}

.badge-completed {
  background: var(--success-dim);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.badge-failed {
  background: var(--error-dim);
  color: var(--error);
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.badge-running,
.badge-in_progress {
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid var(--accent-border);
}

.badge-paused,
.badge-pending {
  background: var(--surface-2);
  color: var(--text-dim);
  border: 1px solid var(--border);
}

/* ── Trace: Two-Pane Layout ────────────────────────────────────── */
#trace-view {
  display: grid;
  grid-template-columns: 340px 1fr;
  height: calc(100vh - 52px);
  overflow: hidden;
}

.timeline-sidebar {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
  background: var(--surface);
  overflow: hidden;
}

.sidebar-header {
  padding: 1.25rem 1rem 0;
  flex-shrink: 0;
}

.sidebar-header h2 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.75rem;
}

.run-info {
  margin-bottom: 0.75rem;
}

.page-trace .run-prompt {
  font-family: 'DM Mono', monospace;
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.5;
  padding: 0.5rem 0.65rem;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  margin-bottom: 0.5rem;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.run-stats {
  display: flex;
  gap: 1rem;
  font-size: 0.75rem;
  color: var(--text-dim);
}

.run-stats strong {
  color: var(--text);
  font-weight: 600;
}

/* Tabs */
.timeline-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-top: 0.5rem;
}

.timeline-tabs .tab {
  flex: 1;
  padding: 0.5rem 0;
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-dim);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
}

.timeline-tabs .tab:hover {
  color: var(--text-muted);
}

.timeline-tabs .tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* Scrollable timeline */
.timeline-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem;
}

#timeline {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

/* ── Trace: Timeline Steps ─────────────────────────────────────── */
.timeline-step {
  display: flex;
  gap: 0.65rem;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s;
  border: 1px solid transparent;
}

.timeline-step:hover {
  background: var(--surface-2);
}

.timeline-step.active {
  background: var(--accent-dim);
  border-color: var(--accent-border);
}

.step-dot {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'DM Mono', monospace;
  font-size: 0.65rem;
  font-weight: 600;
  border: 1px solid;
}

.step-body {
  flex: 1;
  min-width: 0;
}

.step-agent {
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.3;
}

.step-stage {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.3;
}

.step-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.3rem;
}

.step-summary {
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-top: 0.25rem;
  line-height: 1.4;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* ── Trace: Meta Chips ─────────────────────────────────────────── */
.meta-chip {
  font-family: 'DM Mono', monospace;
  font-size: 0.65rem;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  white-space: nowrap;
}

.chip-latency {
  background: var(--surface-2);
  color: var(--text-muted);
}

.chip-cost {
  background: rgba(16, 185, 129, 0.08);
  color: var(--success);
}

.chip-tokens {
  background: rgba(139, 92, 246, 0.08);
  color: #8B5CF6;
}

/* ── Trace: Detail Panel ───────────────────────────────────────── */
.detail-panel {
  overflow-y: auto;
  padding: 1.5rem;
  background: var(--bg);
}

.detail-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-dim);
  text-align: center;
  gap: 0.75rem;
}

.detail-empty svg {
  opacity: 0.4;
}

.detail-empty p {
  font-size: 0.85rem;
  line-height: 1.5;
}

/* Detail header */
.detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.detail-header-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.agent-badge {
  font-family: 'DM Mono', monospace;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
  border: 1px solid;
}

.detail-stage-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.detail-badges {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

/* ── Trace: Summary Grid ───────────────────────────────────────── */
.summary-grid {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.summary-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
}

.summary-card-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  margin-bottom: 0.25rem;
}

.summary-card-value {
  font-family: 'DM Mono', monospace;
  font-weight: 600;
  color: var(--text);
}

/* ── Trace: Collapsible Sections ───────────────────────────────── */
.page-trace .section,
.page-history .section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 0.75rem;
  overflow: hidden;
}

.page-trace .section-header,
.page-history .section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  cursor: pointer;
  transition: background 0.15s;
}

.page-trace .section-header:hover,
.page-history .section-header:hover {
  background: var(--surface-2);
}

.page-trace .section-title,
.page-history .section-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  /* Reset landing page section-title overrides */
  letter-spacing: normal;
  line-height: 1.4;
  margin: 0;
}

.section-icon {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  flex-shrink: 0;
}

.page-trace .section-body,
.page-history .section-body {
  display: none;
  padding: 0 1rem 1rem;
}

.page-trace .section.open .section-body,
.page-history .section.open .section-body {
  display: block;
}

.chevron {
  font-size: 0.75rem;
  color: var(--text-dim);
  transition: transform 0.2s;
}

.page-trace .section.open .chevron,
.page-history .section.open .chevron {
  transform: rotate(180deg);
}

/* ── Trace: Code & JSON Views ──────────────────────────────────── */
.page-trace .code-block,
.page-history .code-block {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent-border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  margin: 0.5rem 0 0;
  font-family: 'DM Mono', monospace;
  font-size: 0.75rem;
  line-height: 1.65;
  color: var(--text-muted);
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 400px;
  overflow-y: auto;
}

.json-view {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  font-family: 'DM Mono', monospace;
  font-size: 0.72rem;
  line-height: 1.6;
  color: var(--text-muted);
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 350px;
  overflow-y: auto;
}

/* ── Trace: Diff List ──────────────────────────────────────────── */
.diff-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.diff-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.5rem 0.65rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  line-height: 1.4;
}

.diff-item.info {
  background: var(--surface-2);
  color: var(--text-muted);
}

.diff-item.added {
  background: rgba(16, 185, 129, 0.06);
  border-left: 3px solid var(--success);
}

.diff-item.passed {
  background: rgba(16, 185, 129, 0.06);
  color: var(--success);
}

.diff-item.failed {
  background: rgba(239, 68, 68, 0.06);
  color: var(--error);
}

.diff-item.error {
  background: rgba(239, 68, 68, 0.06);
  color: var(--error);
}

.diff-item.warning {
  background: rgba(245, 158, 11, 0.06);
  color: var(--warning);
}

.diff-icon {
  flex-shrink: 0;
  width: 18px;
  text-align: center;
  font-weight: 600;
}

.diff-label {
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  flex-shrink: 0;
}

.diff-value {
  color: var(--text-muted);
  flex: 1;
  min-width: 0;
  word-break: break-word;
}

/* ── Trace: File Tabs (Code stage) ─────────────────────────────── */
.file-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  margin-bottom: 0.5rem;
}

.file-tab {
  padding: 0.45rem 0.85rem;
  font-family: 'DM Mono', monospace;
  font-size: 0.72rem;
  color: var(--text-dim);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: all 0.15s;
}

.file-tab:hover {
  color: var(--text-muted);
  background: var(--surface-2);
}

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

.file-content {
  display: none;
}

.file-content.active {
  display: block;
}

/* ── Trace: Responsive ─────────────────────────────────────────── */
@media (max-width: 768px) {
  #trace-view {
    grid-template-columns: 1fr;
    height: auto;
  }

  .timeline-sidebar {
    border-right: none;
    border-bottom: 1px solid var(--border);
    max-height: 50vh;
  }

  .detail-panel {
    min-height: 50vh;
  }

  #run-picker {
    padding: 1.5rem 1rem;
  }

  .intent-filter-bar {
    gap: 0.35rem;
  }
}

/* ── 25. DAG Page ──────────────────────────────────────────────── */
.page-dag {
  background: var(--bg);
}

/* ── DAG: Decision Trace Node Styles ───────────────────────────── */
.phase-group { margin-bottom: 1.5rem; }
.phase-group.collapsed .phase-body { display: none; }
.phase-group.collapsed .phase-toggle { transform: rotate(-90deg); }

.phase-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  border-radius: var(--radius-md);
  transition: background 0.15s;
}
.phase-header:hover { background: var(--surface); }

.phase-header-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.phase-header .phase-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.phase-header .phase-name {
  font-weight: 600;
  font-size: 13px;
}

.phase-count {
  font-size: 11px;
  color: var(--text-dim);
}

.phase-toggle {
  font-size: 12px;
  color: var(--text-dim);
  transition: transform 0.2s;
}

.phase-body { padding-left: 1rem; }

.phase-connector {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.25rem 0;
}
.phase-connector-line {
  width: 1px; height: 16px;
  background: var(--border);
}
.phase-connector-arrow {
  width: 0; height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid var(--border);
}

.node-wrapper {
  margin-bottom: 0.75rem;
}

.node-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem;
  box-shadow: var(--card-shadow);
}

.node-header {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.node-phase-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.15rem 0.5rem;
  border: 1px solid;
  border-radius: 12px;
  width: fit-content;
}

.node-phase-badge .badge-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.node-decision-type {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
}

.node-chosen-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin-top: 0.25rem;
}

.node-chosen-value {
  font-size: 12px;
  color: var(--text-muted);
  word-break: break-word;
}

.node-terminal-badge {
  margin-top: 0.35rem;
  font-size: 10px;
  color: var(--accent);
  font-weight: 500;
}

/* Constraint refs chips */
.node-constraints {
  margin-top: 0.625rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

.constraints-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin-bottom: 0.35rem;
}

.constraint-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.constraint-chip {
  display: inline-block;
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  padding: 0.15rem 0.55rem;
  background: var(--accent-dim);
  border: 1px solid var(--accent-border);
  border-radius: 20px;
  color: var(--accent);
  letter-spacing: 0.03em;
  white-space: nowrap;
}

/* Alternatives section */
.node-alternatives {
  margin-top: 0.5rem;
  border-top: 1px solid var(--border);
  padding-top: 0.5rem;
}

.alternatives-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem 0;
  color: var(--text-muted);
  font-size: 12px;
}
.alternatives-toggle:hover { color: var(--text); }

.alternatives-toggle-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.alt-count-chip {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  padding: 0.1rem 0.45rem;
  background: var(--surface-2);
  border-radius: 10px;
  color: var(--text-dim);
}

.alternatives-chevron {
  font-size: 11px;
  transition: transform 0.2s;
}

.alternatives-body { display: none; }
.alternatives-open .alternatives-body { display: block; }
.alternatives-open .alternatives-chevron { transform: rotate(180deg); }

.alternative-item {
  display: flex;
  gap: 0.5rem;
  padding: 0.35rem 0;
  font-size: 12px;
  color: var(--text-muted);
}

.alt-icon {
  flex-shrink: 0;
  color: var(--text-dim);
  font-size: 11px;
}

.alt-value { color: var(--text); }
.alt-rejection {
  color: var(--text-dim);
  font-size: 11px;
  margin-top: 0.15rem;
}

.no-alternatives {
  font-size: 12px;
  color: var(--text-dim);
  font-style: italic;
  padding: 0.25rem 0;
}

/* DAG misc */
.run-summary {
  padding: 1.5rem;
  margin-bottom: 1rem;
}

.run-summary-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.run-id-chip {
  font-size: 11px;
  padding: 0.15rem 0.55rem;
  background: var(--surface-2);
  border-radius: 10px;
  color: var(--text-dim);
}

.run-summary-prompt {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

.run-summary-meta {
  display: flex;
  gap: 1.25rem;
  margin-top: 0.5rem;
  font-size: 12px;
  color: var(--text-dim);
}

.run-summary-meta strong {
  color: var(--text);
  font-weight: 600;
}

.empty-dag {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-dim);
}

.empty-dag svg { margin: 0 auto 1rem; display: block; }

#warning-banner {
  display: none;
  padding: 0.75rem 1rem;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-md);
  color: var(--warning, #f59e0b);
  font-size: 13px;
  margin: 1rem 1.5rem 0;
}

/* ── 26. Settings Page ─────────────────────────────────────────── */
.page-settings {
  background: var(--bg);
}

.settings-container {
  max-width: 640px;
  margin: 0 auto;
  padding: 3rem 2rem;
}

.settings-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 16px;
  box-shadow: var(--card-shadow);
}

/* ── 27. Pricing Page (standalone) ─────────────────────────────── */
.page-pricing {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

.pricing-wrap {
  max-width: 480px;
  width: 100%;
  text-align: center;
}

.pricing-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  margin-bottom: 3rem;
  text-decoration: none;
}

.pricing-logo span {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
}

.badge {
  display: inline-block;
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid var(--accent-border);
  border-radius: 20px;
  padding: 0.2rem 0.75rem;
  margin-bottom: 1.25rem;
}

.plan-card {
  padding: 32px;
  text-align: left;
}

.plan-price {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.plan-price span {
  font-size: 1rem;
  font-weight: 400;
  color: var(--text-dim);
}

.plan-desc {
  color: var(--text-dim);
  font-size: 14px;
  margin: 0 0 1.5rem;
}

.plan-features {
  list-style: none;
  padding: 0;
  margin: 0 0 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.plan-features li {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 14px;
  color: var(--text);
}

.plan-features li .check {
  color: var(--accent);
  font-size: 16px;
  flex-shrink: 0;
}

.trial-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 1.5rem;
}

.trial-row .dot {
  width: 7px;
  height: 7px;
  background: var(--text-dim);
  border-radius: 50%;
  flex-shrink: 0;
}

.cta-note {
  text-align: center;
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 0.75rem;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 2.5rem;
  font-size: 12px;
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.15s;
}

.back-link:hover { color: var(--accent); }

/* ── 28. Verify Error Page ─────────────────────────────────────── */
.page-verify-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.error-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  max-width: 480px;
  width: 100%;
  text-align: center;
  box-shadow: var(--card-shadow);
}

/* ── 29. Upgrade Modal ─────────────────────────────────────────── */
.upgrade-modal-price {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.upgrade-modal-price span {
  font-size: 1rem;
  font-weight: 400;
  color: var(--text-dim);
}

.upgrade-feature-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.upgrade-feature-list li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 14px;
  color: var(--text);
}

.upgrade-feature-list li .check-icon {
  color: var(--accent);
  font-size: 16px;
}

.upgrade-checkout-btn {
  width: 100%;
  padding: 0.75rem;
  background: var(--accent);
  border: none;
  border-radius: var(--radius-md);
  color: #FFFFFF;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
  min-height: 44px;
}

.upgrade-checkout-btn:hover { background: var(--accent-hover); }

/* ═══════════════════════════════════════════════════════════════
   UTILITIES
   ═══════════════════════════════════════════════════════════════ */

/* Flex utilities */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-sm { gap: 0.5rem; }
.gap-md { gap: 1rem; }
.gap-lg { gap: 1.5rem; }

/* Text utilities */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-accent { color: var(--accent); }
.text-muted { color: var(--text-muted); }
.text-dim { color: var(--text-dim); }
.text-error { color: var(--error); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.font-mono { font-family: 'DM Mono', monospace; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }

/* Spacing */
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.p-0 { padding: 0; }
.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }

/* ═══════════════════════════════════════════════════════════════
   SCROLLBARS
   ═══════════════════════════════════════════════════════════════ */

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-focus); }

.runs-list::-webkit-scrollbar { width: 4px; }
.runs-list::-webkit-scrollbar-track { background: transparent; }
.runs-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* ═══════════════════════════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════════════════════════ */

@keyframes pulse-dot {
  0%, 100% { opacity: 1; box-shadow: 0 0 8px var(--accent); }
  50% { opacity: 0.5; box-shadow: 0 0 4px var(--accent); }
}

@keyframes badge-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

@keyframes pip-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

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

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* ── 30. Run Page — Pipeline Execution View ────────────────────── */

/* Input section footer */
.input-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1.5rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.input-hint {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  color: var(--text-dim);
  letter-spacing: 0.02em;
}

#run-btn .arrow {
  transition: transform 0.2s;
}

#run-btn:hover .arrow {
  transform: translateX(3px);
}

/* Mini pipeline preview (idle / empty state) */
.pipeline-preview-block {
  margin-top: 2.5rem;
  padding: 1.5rem 1.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--card-shadow);
}

.pipeline-preview-label {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  margin-bottom: 1.25rem;
}

.pipeline-preview-phases {
  display: flex;
  align-items: center;
  gap: 0;
  overflow-x: auto;
}

.pp-phase {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.375rem;
  min-width: 72px;
  flex: 1;
}

.pp-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--success);
  border: 2px solid var(--success);
  box-shadow: 0 0 0 3px var(--success-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

.pp-name {
  font-size: 10px;
  font-weight: 500;
  color: var(--success);
  text-align: center;
  white-space: nowrap;
}

.pp-connector {
  flex: 1;
  height: 2px;
  background: var(--success);
  margin-bottom: 18px;
  min-width: 16px;
  opacity: 0.5;
}

.pipeline-preview-caption {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 1.25rem;
  text-align: center;
}

/* Pipeline run prompt */
.run-prompt {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
}

.run-prompt .label {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  flex-shrink: 0;
  padding-top: 2px;
}

.run-prompt .text {
  font-size: 14px;
  color: var(--text);
  line-height: 1.5;
  flex: 1;
  min-width: 0;
}

/* Intent badge bar */
.intent-badge-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.intent-class-badge {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  padding: 0.2rem 0.65rem;
  background: var(--accent-dim);
  border: 1px solid var(--accent-border);
  border-radius: 20px;
  color: var(--accent);
  letter-spacing: 0.03em;
}

.intent-label {
  font-size: 12px;
  color: var(--text-dim);
}

/* Intervention bar */
.intervention-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 0;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.ctrl-btn {
  font-size: 13px;
  font-weight: 500;
  padding: 0 0.875rem;
  min-height: 36px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
  min-width: auto;
}

.ctrl-btn:hover { background: var(--surface-2); color: var(--text); }
.ctrl-btn-pause:hover { border-color: var(--warning); color: var(--warning); }
.ctrl-btn-resume {
  border-color: var(--success);
  color: var(--success);
  background: var(--success-dim);
}
.ctrl-btn-resume:hover { background: rgba(16,185,129,0.15); }
.ctrl-btn-inject:hover { border-color: var(--accent); color: var(--accent); }
.ctrl-btn-override:hover { border-color: var(--accent); color: var(--accent); }

.intervention-status {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  color: var(--text-dim);
  margin-left: auto;
}

/* Paused banner */
.paused-banner {
  display: none;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--warning-dim);
  border: 1px solid rgba(245,158,11,0.3);
  border-radius: var(--radius-md);
  font-size: 13px;
  color: #92400E;
  margin-bottom: 1rem;
}

.paused-banner.show { display: flex; }

/* Connection-lost banner — shown when SSE stream drops */
.connection-lost-banner {
  display: none;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245,158,11,0.35);
  border-radius: var(--radius-md);
  font-size: 13px;
  color: #92400E;
  margin-bottom: 1rem;
}
.connection-lost-banner.show { display: flex; }
.connection-lost-banner .conn-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #D97706;
  flex-shrink: 0;
  animation: badge-pulse 1.2s ease-in-out infinite;
}
.connection-lost-banner .conn-text { flex: 1; }
.connection-lost-banner .conn-btn {
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(245,158,11,0.15);
  border: 1px solid rgba(245,158,11,0.4);
  border-radius: 6px;
  color: #92400E;
  cursor: pointer;
  white-space: nowrap;
  transition: background 150ms;
}
.connection-lost-banner .conn-btn:hover {
  background: rgba(245,158,11,0.25);
}

.paused-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--warning);
  flex-shrink: 0;
  animation: badge-pulse 1.2s ease-in-out infinite;
}

/* Inject / Override panels */
.inject-panel,
.override-panel {
  display: none;
  padding: 1rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
}

.inject-panel.show,
.override-panel.show { display: block; }

.inject-panel-label,
.override-panel-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.inject-row {
  display: flex;
  gap: 0.5rem;
}

.inject-input {
  flex: 1;
  padding: 0.5rem 0.75rem;
  font-size: 13px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  outline: none;
  width: auto;
}

.inject-input:focus { border-color: var(--accent); }

.inject-send-btn,
.override-send-btn {
  padding: 0 1rem;
  min-height: 38px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  min-width: auto;
}

.inject-send-btn:hover,
.override-send-btn:hover { background: var(--accent-hover); }

.inject-log {
  margin-top: 0.5rem;
  font-size: 12px;
  color: var(--text-dim);
  font-family: 'DM Mono', monospace;
}

.override-agents {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.override-agent-btn {
  padding: 0 0.875rem;
  min-height: 34px;
  font-size: 12px;
  font-weight: 500;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  min-width: auto;
}

.override-agent-btn:hover { border-color: var(--accent); color: var(--accent); }
.override-agent-btn.selected { background: var(--accent-dim); border-color: var(--accent); color: var(--accent); }

.override-prompt-row {
  display: flex;
  gap: 0.5rem;
}

.override-prompt-input {
  flex: 1;
  min-height: 80px;
  padding: 0.75rem;
  font-size: 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  resize: vertical;
  width: auto;
}

.override-prompt-input:focus { border-color: var(--accent); }

/* ── Phase Progress Tracker ─────────────────────────────────────── */
.phase-tracker {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 1.5rem;
  padding: 1.25rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow-x: auto;
}

.phase-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.375rem;
  cursor: pointer;
  transition: opacity 0.2s;
  min-width: 72px;
  flex: 1;
  position: relative;
}

.phase-indicator:hover { opacity: 0.85; }

.phase-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 2px solid var(--border);
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Pending: subtle grey */
.phase-indicator[data-status="pending"] .phase-dot {
  background: var(--surface-2);
  border-color: var(--border);
}

/* Running: blue pulse */
.phase-indicator[data-status="running"] .phase-dot {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 0 5px var(--accent-dim);
  animation: phase-running-pulse 1.5s ease-in-out infinite;
}

/* Completed: green checkmark */
.phase-indicator[data-status="completed"] .phase-dot {
  background: var(--success);
  border-color: var(--success);
  box-shadow: 0 0 0 3px var(--success-dim);
}

.phase-indicator[data-status="completed"] .phase-dot::after {
  content: '✓';
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}

/* Failed: red X */
.phase-indicator[data-status="failed"] .phase-dot {
  background: var(--error);
  border-color: var(--error);
  box-shadow: 0 0 0 3px var(--error-dim);
}

.phase-indicator[data-status="failed"] .phase-dot::after {
  content: '✗';
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}

.phase-indicator .phase-name {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text-dim);
  text-align: center;
  white-space: nowrap;
  line-height: 1.3;
}

.phase-indicator[data-status="running"] .phase-name {
  color: var(--accent);
  font-weight: 600;
}

.phase-indicator[data-status="completed"] .phase-name {
  color: var(--success);
}

.phase-indicator[data-status="failed"] .phase-name {
  color: var(--error);
}

/* Phase connector */
.phase-connector {
  flex: 1;
  height: 2px;
  background: var(--border);
  margin: 0 4px;
  margin-bottom: 18px;
  transition: background 0.3s ease;
  min-width: 16px;
  flex-shrink: 1;
}

.phase-connector.lit {
  background: var(--success);
}

@keyframes phase-running-pulse {
  0%, 100% { box-shadow: 0 0 0 5px var(--accent-dim); }
  50% { box-shadow: 0 0 0 10px rgba(14,165,233,0.05); }
}

/* Phase number inside dot — visible when pending/running, hidden when completed/failed */
.phase-num {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-dim);
  line-height: 1;
  transition: opacity 0.2s;
}

.phase-indicator[data-status="running"] .phase-num {
  color: #fff;
  opacity: 1;
}

.phase-indicator[data-status="completed"] .phase-num,
.phase-indicator[data-status="failed"] .phase-num {
  display: none;
}

/* Phase timing — shown below phase name when phase completes */
.phase-time {
  font-size: 10px;
  color: var(--success);
  font-weight: 500;
  display: none;
  text-align: center;
  margin-top: 1px;
}

.phase-indicator[data-status="failed"] .phase-time {
  color: var(--error);
}

/* Phase stepper header — canonical 6-phase display */
.phase-stepper-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.phase-stepper-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* View Full Trace button bar */
.trace-btn-bar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 1rem;
}

.view-trace-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 1rem;
  background: var(--surface);
  border: 1.5px solid var(--accent);
  border-radius: var(--radius-md);
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.15s ease;
  cursor: pointer;
}

.view-trace-btn:hover {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 8px rgba(14,165,233,0.25);
}

.view-trace-btn.dimmed {
  opacity: 0.45;
  pointer-events: none;
  border-color: var(--border);
  color: var(--text-dim);
}

/* Live cost bar */
.live-cost-bar {
  padding: 0.75rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
}

.live-cost-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.25rem;
}

.live-cost-label {
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-family: 'DM Mono', monospace;
}

.live-cost-value {
  font-family: 'DM Mono', monospace;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
}

.live-budget-track {
  height: 4px;
  background: var(--surface-2);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 0.375rem;
}

.live-budget-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.3s ease;
}

.live-budget-hint {
  font-size: 11px;
  color: var(--text-dim);
  font-family: 'DM Mono', monospace;
  margin-top: 0.25rem;
}

/* ── Split Layout ──────────────────────────────────────────────── */
.preview-split {
  display: flex;
  gap: 0;
  min-height: 500px;
  align-items: stretch;
}

.terminal-wrapper {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.resize-handle {
  width: 6px;
  background: var(--border);
  cursor: col-resize;
  flex-shrink: 0;
  margin: 0 2px;
  border-radius: 3px;
  display: none;
  transition: background 0.15s;
}

.preview-split.has-preview .resize-handle {
  display: block;
}

.resize-handle:hover { background: var(--accent); }

.preview-panel {
  display: none;
  flex-direction: column;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  flex: 0 0 45%;
}

.preview-split.has-preview .preview-panel {
  display: flex;
}

.preview-split.has-preview .terminal-wrapper {
  flex: 0 0 55%;
}

.preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.875rem;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.preview-toolbar-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.preview-toolbar-actions {
  display: flex;
  gap: 0.375rem;
}

.preview-btn {
  font-size: 12px;
  font-weight: 500;
  padding: 0 0.625rem;
  min-height: 28px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  min-width: auto;
}

.preview-btn:hover { background: var(--surface); color: var(--text); }

.preview-iframe-container {
  flex: 1;
  position: relative;
  overflow: hidden;
  min-height: 400px;
}

.preview-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  color: var(--text-dim);
}

.preview-empty-icon {
  font-size: 2.5rem;
  opacity: 0.35;
}

.preview-empty-text {
  font-size: 14px;
  color: var(--text-dim);
  text-align: center;
  max-width: 200px;
  line-height: 1.5;
}

.preview-iframe-container iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: none;
}

@keyframes previewPulse {
  0%   { box-shadow: 0 0 0 0 rgba(14,165,233,0.4); }
  70%  { box-shadow: 0 0 0 10px rgba(14,165,233,0); }
  100% { box-shadow: none; }
}

.preview-pulse {
  animation: previewPulse 0.8s ease-out;
}

/* ── Terminal Tabs & Status ─────────────────────────────────────── */
.terminal-header {
  padding: 0.5rem 0.875rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.terminal-tabs {
  display: flex;
  gap: 0.2rem;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
}

.terminal-tab {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.35rem 0.75rem;
  min-height: 28px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: rgba(148,163,184,0.7);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  min-width: auto;
}

.terminal-tab:hover {
  color: #CBD5E1;
  background: rgba(255,255,255,0.06);
}

.terminal-tab.active {
  color: var(--accent);
  background: rgba(14,165,233,0.15);
}

.terminal-status {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: rgba(148,163,184,0.7);
  white-space: nowrap;
  flex-shrink: 0;
  padding: 0 0.375rem;
}

.terminal-status .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(148,163,184,0.4);
}

.terminal-status.running .dot {
  background: var(--accent);
  animation: pulse-dot 1.2s ease-in-out infinite;
}

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

/* ── Terminal Body Improvements ─────────────────────────────────── */
.terminal-body,
.term-content {
  padding: 1.75rem 2rem;
  font-size: 14px;
  line-height: 1.75;
  min-height: 360px;
  overflow-y: auto;
  max-height: 560px;
}

.terminal-cursor {
  display: inline-block;
  width: 8px;
  height: 14px;
  background: var(--accent);
  animation: blink 1s step-end infinite;
  vertical-align: text-bottom;
  margin-left: 2px;
  opacity: 0.9;
}

/* Terminal markdown content */
.code-block {
  background: rgba(0,0,0,0.25);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  margin: 0.5rem 0;
  font-size: 12px;
  line-height: 1.6;
  overflow-x: auto;
  border-left: 3px solid var(--accent-border);
  white-space: pre;
}

.inline-code {
  background: rgba(0,0,0,0.2);
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  font-size: 0.9em;
}

.md-h2 {
  font-size: 15px;
  font-weight: 700;
  color: #E2E8F0;
  margin: 1rem 0 0.375rem;
  display: block;
}

.md-h3 {
  font-size: 13px;
  font-weight: 600;
  color: #CBD5E1;
  margin: 0.75rem 0 0.25rem;
  display: block;
}

.check-pass {
  display: block;
  color: var(--success);
  font-weight: 500;
}

.check-fail {
  display: block;
  color: var(--error);
  font-weight: 500;
}

/* Error banner */
.error-banner {
  display: none;
  padding: 1rem 1.25rem;
  background: var(--error-dim);
  border: 1px solid rgba(239,68,68,0.3);
  border-radius: var(--radius-md);
  color: var(--error);
  font-size: 14px;
  line-height: 1.5;
}

.error-banner.show { display: block; }

/* Completed actions */
.completed-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1.25rem;
  flex-wrap: wrap;
}

.btn-view-trace {
  font-size: 13px;
  font-weight: 500;
  padding: 0 1rem;
  min-height: 36px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  transition: all 0.15s;
}

.btn-view-trace:hover {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border-focus);
}

.btn-edit-code {
  font-size: 13px;
  font-weight: 500;
  padding: 0 1rem;
  min-height: 36px;
  background: var(--success-dim);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: var(--radius-md);
  color: var(--success);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  transition: all 0.15s;
}

.btn-edit-code:hover {
  background: rgba(16, 185, 129, 0.12);
  border-color: var(--success);
  color: var(--success);
}

.btn-deploy-now {
  font-size: 13px;
  font-weight: 600;
  padding: 0 1.25rem;
  min-height: 36px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  min-width: auto;
  transition: all 0.15s;
}

.btn-deploy-now:hover { background: var(--accent-hover); }

/* ── Export Run Report ──────────────────────────────────────────────────── */
.export-dropdown-wrapper {
  position: relative;
  display: inline-flex;
}

.btn-export-report {
  font-size: 13px;
  font-weight: 500;
  padding: 0 1rem;
  min-height: 36px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  transition: all 0.15s;
  white-space: nowrap;
}

.btn-export-report:hover {
  background: var(--surface);
  border-color: var(--border-focus);
  color: var(--text);
}

.export-chevron {
  font-size: 10px;
  opacity: 0.6;
  margin-left: 2px;
}

.export-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 220px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  z-index: 200;
  overflow: hidden;
}

.export-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  text-decoration: none;
  color: var(--text);
  transition: background 0.12s;
  border-bottom: 1px solid var(--border);
}

.export-option:last-child { border-bottom: none; }

.export-option:hover { background: var(--surface-2); }

.export-option-icon {
  font-size: 18px;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.export-option-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.export-option-label strong {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.export-option-desc {
  font-size: 11px;
  color: var(--text-dim);
}
/* ── End Export ─────────────────────────────────────────────────────────── */

.onboarding-credit-nudge {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 0.75rem;
}

.accent-strong {
  color: var(--accent);
}

/* Deploy panel */
.deploy-panel {
  padding: 1.5rem 1.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-top: 0.75rem;
}

.deploy-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.deploy-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(20,184,166,0.15);
  border: 1.5px solid #14b8a6;
  flex-shrink: 0;
}

.deploy-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  flex: 1;
}

.deploy-status-label {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  color: var(--text-dim);
}

.deploy-progress-steps {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.deploy-step {
  font-size: 14px;
  color: var(--text-dim);
  padding: 0.375rem 0;
  transition: color 0.2s;
}

.deploy-step[data-status="running"] {
  color: var(--accent);
  font-weight: 500;
}

.deploy-step[data-status="done"] {
  color: var(--success);
  font-weight: 500;
}

.deploy-url-block {
  padding: 1rem 1.25rem;
  background: var(--success-dim);
  border: 1px solid rgba(16,185,129,0.2);
  border-radius: var(--radius-md);
  margin-top: 0.75rem;
}

.deploy-url-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--success);
  margin-bottom: 0.375rem;
}

.deploy-live-url {
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  color: var(--success);
  word-break: break-all;
  text-decoration: none;
}

.deploy-live-url:hover { text-decoration: underline; }

.deploy-history-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  margin: 1rem 0 0.5rem;
}

.deploy-history-list {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

/* ── Verify Checklist ───────────────────────────────────────────── */
.verify-report {
  margin-top: 1.25rem;
  padding: 1.25rem 1.5rem;
  background: rgba(255,255,255,0.04);
  border-radius: var(--radius-md);
  border: 1px solid rgba(255,255,255,0.06);
}

.verify-report-title {
  font-size: 12px;
  font-weight: 600;
  color: #94A3B8;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.verify-report-grid {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.verify-section-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #64748B;
  margin: 0.875rem 0 0.25rem;
}

.verify-section-divider {
  border: none;
  border-top: 1px solid rgba(255,255,255,0.06);
  margin: 0.5rem 0;
}

.verify-check-card {
  padding: 0.625rem 0.875rem;
  background: rgba(255,255,255,0.04);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,0.06);
  cursor: pointer;
  transition: background 0.15s;
}

.verify-check-card:hover { background: rgba(255,255,255,0.07); }
.verify-check-card.passed { border-color: rgba(16,185,129,0.2); }
.verify-check-card.failed { border-color: rgba(239,68,68,0.2); }

.verify-check-header {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.verify-check-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

.verify-check-dot.pass {
  background: rgba(16,185,129,0.2);
  color: var(--success);
}

.verify-check-dot.fail {
  background: rgba(239,68,68,0.2);
  color: var(--error);
}

.verify-check-dot.warn {
  background: rgba(245,158,11,0.2);
  color: var(--warning);
}

.verify-check-name {
  flex: 1;
  font-size: 13px;
  color: #CBD5E1;
  line-height: 1.4;
}

.verify-check-status {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: #64748B;
  flex-shrink: 0;
  white-space: nowrap;
}

.verify-check-card.passed .verify-check-status { color: var(--success); }
.verify-check-card.failed .verify-check-status { color: var(--error); }

.verify-check-expand-hint {
  font-size: 16px;
  color: #475569;
  flex-shrink: 0;
  transition: transform 0.2s;
}

.verify-check-card[data-expanded="true"] .verify-check-expand-hint {
  transform: rotate(90deg);
}

.verify-check-details {
  display: none;
  padding: 0.75rem 0.375rem 0;
  border-top: 1px solid rgba(255,255,255,0.06);
  margin-top: 0.5rem;
}

.verify-check-card[data-expanded="true"] .verify-check-details { display: block; }

.verify-check-reasoning,
.verify-check-alternative {
  margin-bottom: 0.5rem;
}

.verify-check-reasoning-label,
.verify-check-alternative-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #475569;
  margin-bottom: 0.25rem;
}

.verify-check-reasoning-text,
.verify-check-alternative-text {
  font-size: 12px;
  color: #94A3B8;
  line-height: 1.5;
}

.verify-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255,255,255,0.06);
  font-size: 12px;
  color: #64748B;
}

.verify-summary-badge {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  padding: 0.2rem 0.625rem;
  border-radius: 10px;
}

.verify-summary-badge.all-pass { background: rgba(16,185,129,0.2); color: var(--success); }
.verify-summary-badge.partial  { background: rgba(245,158,11,0.2);  color: var(--warning); }
.verify-summary-badge.failed   { background: rgba(239,68,68,0.2);   color: var(--error);   }

/* ── Verify Fix Buttons ─────────────────────────────────────────── */

/* Fix button on individual failed checks */
.verify-fix-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.6rem;
  background: rgba(239,68,68,0.12);
  border: 1px solid rgba(239,68,68,0.3);
  border-radius: 6px;
  color: #F87171;
  font-size: 11px;
  font-family: 'DM Mono', monospace;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  margin-left: 0.5rem;
}

.verify-fix-btn:hover {
  background: rgba(239,68,68,0.22);
  border-color: rgba(239,68,68,0.5);
  color: #FCA5A5;
}

.verify-fix-btn:disabled,
.verify-fix-btn.fixing {
  opacity: 0.55;
  cursor: not-allowed;
  background: rgba(148,163,184,0.12);
  border-color: rgba(148,163,184,0.2);
  color: #94A3B8;
}

/* Spins the wrench icon during fix */
.verify-fix-btn.fixing .fix-icon {
  display: inline-block;
  animation: fix-spin 0.8s linear infinite;
}

@keyframes fix-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* Passed state after successful fix */
.verify-check-card.fixing {
  border-color: rgba(245,158,11,0.3);
  background: rgba(245,158,11,0.05);
}

/* Fix All button (summary row) */
.verify-fix-all-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.75rem;
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.25);
  border-radius: 8px;
  color: #F87171;
  font-size: 11px;
  font-family: 'DM Mono', monospace;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.verify-fix-all-btn:hover {
  background: rgba(239,68,68,0.18);
  border-color: rgba(239,68,68,0.4);
}

.verify-fix-all-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* "manual review needed" exhausted badge */
.verify-check-manual-needed {
  font-size: 11px;
  color: #F59E0B;
  font-family: 'DM Mono', monospace;
  margin-left: 0.5rem;
  white-space: nowrap;
}

/* Fix result message inside expanded details */
.verify-fix-result {
  font-size: 12px;
  padding: 0.375rem 0.5rem;
  border-radius: 5px;
  margin-top: 0.5rem;
}

.verify-fix-result.success {
  background: rgba(16,185,129,0.1);
  color: #6EE7B7;
  border: 1px solid rgba(16,185,129,0.2);
}

.verify-fix-result.fail {
  background: rgba(239,68,68,0.08);
  color: #FCA5A5;
  border: 1px solid rgba(239,68,68,0.15);
}

/* ── Copilot Panel ──────────────────────────────────────────────── */
.copilot-fab {
  position: fixed;
  bottom: 1.75rem;
  right: 1.75rem;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 1.25rem;
  min-height: 44px;
  background: var(--text);
  color: #fff;
  border: none;
  border-radius: 22px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  transition: all 0.2s;
  min-width: auto;
}

.copilot-fab:hover {
  background: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(14,165,233,0.25);
}

.copilot-fab.active { background: var(--accent); }

.copilot-fab-icon { font-size: 16px; }

.copilot-panel {
  position: fixed;
  bottom: 5.5rem;
  right: 1.75rem;
  z-index: 200;
  width: 380px;
  max-width: calc(100vw - 3rem);
  max-height: 520px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: 0 8px 40px rgba(0,0,0,0.12);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(12px) scale(0.97);
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}

.copilot-panel.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

.copilot-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.copilot-header-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.copilot-header-sub {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 2px;
}

.copilot-close-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 16px;
  cursor: pointer;
  padding: 0.25rem;
  min-height: auto;
  min-width: auto;
  border-radius: var(--radius-sm);
  line-height: 1;
}

.copilot-close-btn:hover { color: var(--text); background: var(--surface-2); }

.copilot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.copilot-welcome p {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 0.875rem;
}

.copilot-chips {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.copilot-chips button {
  text-align: left;
  font-size: 12px;
  font-weight: 400;
  padding: 0.5rem 0.75rem;
  min-height: auto;
  min-width: auto;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
  justify-content: flex-start;
}

.copilot-chips button:hover {
  background: var(--accent-dim);
  border-color: var(--accent-border);
  color: var(--accent);
}

.copilot-msg {
  font-size: 13px;
  line-height: 1.55;
  padding: 0.625rem 0.875rem;
  border-radius: var(--radius-md);
  max-width: 100%;
}

.copilot-msg-user {
  background: var(--accent-dim);
  border: 1px solid var(--accent-border);
  color: var(--text);
  align-self: flex-end;
  max-width: 85%;
}

.copilot-msg-assistant {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
}

.copilot-msg-system {
  font-size: 12px;
  color: var(--text-dim);
  text-align: center;
  background: none;
  border: none;
  padding: 0.25rem 0;
}

.copilot-msg.loading {
  color: var(--text-dim);
  font-style: italic;
}

.copilot-input-area {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.copilot-input {
  flex: 1;
  padding: 0.5rem 0.75rem;
  font-size: 13px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  outline: none;
  width: auto;
  min-height: auto;
}

.copilot-input:focus { border-color: var(--accent); }

.copilot-send-btn {
  width: 34px;
  height: 34px;
  min-height: auto;
  min-width: auto;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
  padding: 0;
}

.copilot-send-btn:hover { background: var(--accent-hover); }

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */

/* Landing page responsive */
@media (max-width: 768px) {
  .page-landing nav,
  nav.landing-nav {
    padding: 0 1rem;
  }

  .nav-tag { display: none; }

  .hero { padding: 4rem 1.25rem 3.5rem; }
  .hero h1 { font-size: 2.2rem; }
  .hero-sub { font-size: 1rem; }

  .pipeline-viz { padding: 0 1.25rem; margin-bottom: 3rem; }
  .pipeline-track { flex-wrap: wrap; }
  .pipeline-phase { flex: 1 0 30%; border-bottom: 1px solid var(--border); }

  .section { padding: 3.5rem 1.25rem; }
  .props-grid { grid-template-columns: 1fr; gap: 12px; }
  .positioning-grid { grid-template-columns: 1fr; gap: 12px; }

  .audit-block { flex-direction: column; }
  .audit-right { width: 100%; }

  .pricing-section { padding: 3.5rem 1.25rem; }
  .price-card { padding: 24px; }

  .closing { padding: 3.5rem 1.25rem 4rem; }

  footer { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
  .footer-pipeline { flex-wrap: wrap; }

  .pipeline-steps { gap: 0; }
  .pipeline-step { gap: 1rem; padding: 1.25rem; }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 1.85rem; }
  .hero-actions { flex-direction: column; width: 100%; }
  .cta-primary, .cta-secondary { width: 100%; justify-content: center; }
}

/* Dashboard responsive */
@media (max-width: 768px) {
  .topnav {
    height: 48px;
    min-height: 48px;
    padding: 0 0.75rem 0 3rem;
    gap: 0.5rem;
  }

  .topnav-left {
    gap: 0.5rem;
    min-width: 0;
    overflow: hidden;
  }

  .logo { font-size: 0.9rem; }
  .nav-divider, .nav-title { display: none; }

  .topnav-right {
    gap: 0.4rem;
    flex-shrink: 0;
  }

  .queue-badge { display: none; }

  .run-pipeline-btn {
    font-size: 13px;
    padding: 0 0.875rem;
    min-height: 36px;
    border-radius: var(--radius-md);
    white-space: nowrap;
  }

  .layout {
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
  }

  .run-history { display: none; }

  .main-panel {
    width: 100%;
    min-width: 0;
  }

  .panel-tabs {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
    padding: 0.375rem;
    gap: 0.125rem;
    scrollbar-width: none;
  }

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

  .panel-tab {
    flex-shrink: 0;
    padding: 0.375rem 0.625rem;
    font-size: 11px;
    white-space: nowrap;
  }

  .panel-actions { display: none; }

  .panel-content { padding: 0.75rem 1rem 1.5rem; }

  .agents-row { grid-template-columns: 1fr 1fr; gap: 8px; }
  .agent-card { padding: 12px; }

  .health-grid, .econ-stats-row { grid-template-columns: 1fr 1fr; gap: 8px; }
  .econ-stat-card { padding: 14px; }
  .econ-stat-value { font-size: 1.25rem; }

  .terminal-body, .term-content {
    font-size: 12px;
    padding: 0.75rem 0.875rem;
    line-height: 1.7;
  }

  .modal {
    width: calc(100vw - 2rem);
    max-height: 85vh;
    overflow-y: auto;
    margin: 1rem;
    padding: 24px;
  }

  .section-heading {
    font-size: 11px;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
  }

  .no-selection { padding: 2.5rem 1.5rem; }
  .no-selection .icon { font-size: 2rem; }
  .no-selection h3 { font-size: 16px; }
  .no-selection p { font-size: 13px; }

  .dash-intv-panel { padding: 0.75rem; margin-bottom: 0.5rem; }
}

@media (max-width: 480px) {
  .topnav { padding: 0 0.5rem 0 2.75rem; }
  .logo { font-size: 0.85rem; }

  .run-pipeline-btn {
    font-size: 12px;
    padding: 0 0.625rem;
    min-height: 32px;
  }

  .agents-row { grid-template-columns: 1fr; }
  .health-grid, .econ-stats-row { grid-template-columns: 1fr; }

  .panel-content { padding: 0.625rem 0.75rem 1.25rem; }
  .panel-tab { font-size: 10px; padding: 0.3rem 0.5rem; }
}

/* Auth page responsive */
@media (max-width: 600px) {
  .terminal-wrap { padding: 0 1.25rem; }
  .prompt-prefix { display: none; }
  .input-field { padding-left: 1.1rem; }
}

/* Run/new-task responsive */
@media (max-width: 768px) {
  .page-run nav,
  .page-new-task nav {
    padding: 0 1rem;
    height: 48px;
  }

  .page-run main,
  .page-new-task main {
    padding: 2rem 1.25rem 3rem;
  }
}

/* ── Self-Healing Loop UI ──────────────────────────────────────────────── */

/* Status badge shown during retry */
#self-heal-status {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.9rem;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 0.75rem;
  border: 1px solid transparent;
}

#self-heal-status.self-heal-retrying {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.3);
  color: #92400e;
}

#self-heal-status.self-heal-success {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.3);
  color: #065f46;
}

#self-heal-status.self-heal-failed {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.25);
  color: #991b1b;
}

/* "Fixed on retry" badge in the verify summary row */
.verify-summary-badge.self-heal-badge {
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #065f46;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-size: 11px;
}

/* Diagnosis block shown after all retries exhausted */
.self-heal-diagnoses {
  margin-top: 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.self-heal-diagnoses-title {
  background: rgba(239, 68, 68, 0.08);
  border-bottom: 1px solid var(--border);
  padding: 0.5rem 0.875rem;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.self-heal-diag-item {
  padding: 0.75rem 0.875rem;
  border-bottom: 1px solid var(--border);
}

.self-heal-diag-item:last-child {
  border-bottom: none;
}

.self-heal-diag-attempt {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 0.35rem;
}

.self-heal-diag-text {
  font-size: 12px;
  color: var(--text);
  line-height: 1.6;
  white-space: pre-wrap;
}

/* ═══════════════════════════════════════════════════════════════
   Animated Clouds + Glassmorphism
   BuildOrbit UI Enhancement — Refinement
   ═══════════════════════════════════════════════════════════════ */

/* ── Animated Cloud Background ──────────────────────────────── */

.cloud-bg {
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(165deg, #EEF2FF 0%, #F0F4FF 35%, #F8FAFC 70%, #F1F5F9 100%);
}

/* Slow drifting cloud shapes */
.cloud-bg::before,
.cloud-bg::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(255,255,255,0.85) 0%, rgba(226,232,255,0.4) 50%, transparent 70%);
  filter: blur(40px);
}

.cloud-bg::before {
  width: 60vw;
  height: 40vh;
  top: -5%;
  left: -10%;
  animation: cloud-drift-a 28s ease-in-out infinite;
  opacity: 0.7;
}

.cloud-bg::after {
  width: 45vw;
  height: 30vh;
  bottom: 5%;
  right: -8%;
  animation: cloud-drift-b 34s ease-in-out infinite;
  opacity: 0.55;
}

.cloud-layer-1 {
  position: absolute;
  width: 35vw;
  height: 25vh;
  top: 20%;
  right: 15%;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(220,235,255,0.6) 0%, transparent 65%);
  filter: blur(50px);
  animation: cloud-drift-c 22s ease-in-out infinite;
  opacity: 0.5;
}

.cloud-layer-2 {
  position: absolute;
  width: 50vw;
  height: 20vh;
  bottom: 25%;
  left: 20%;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(235,240,255,0.55) 0%, transparent 60%);
  filter: blur(35px);
  animation: cloud-drift-d 30s ease-in-out infinite;
  opacity: 0.45;
}

.cloud-layer-3 {
  position: absolute;
  width: 25vw;
  height: 18vh;
  top: 55%;
  left: 60%;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(240,245,255,0.5) 0%, transparent 55%);
  filter: blur(28px);
  animation: cloud-drift-e 25s ease-in-out infinite;
  opacity: 0.4;
}

.cloud-layer-4 {
  position: absolute;
  width: 40vw;
  height: 15vh;
  top: 8%;
  right: 30%;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(255,255,255,0.7) 0%, transparent 50%);
  filter: blur(45px);
  animation: cloud-drift-f 38s ease-in-out infinite;
  opacity: 0.35;
}

/* Cloud drift animations */
@keyframes cloud-drift-a {
  0%   { transform: translate(0, 0) scale(1); }
  25%  { transform: translate(4%, 3%) scale(1.03); }
  50%  { transform: translate(2%, -2%) scale(0.97); }
  75%  { transform: translate(-3%, 2%) scale(1.02); }
  100% { transform: translate(0, 0) scale(1); }
}

@keyframes cloud-drift-b {
  0%   { transform: translate(0, 0) scale(1); }
  30%  { transform: translate(-4%, -3%) scale(1.04); }
  60%  { transform: translate(3%, 2%) scale(0.96); }
  100% { transform: translate(0, 0) scale(1); }
}

@keyframes cloud-drift-c {
  0%   { transform: translate(0, 0); opacity: 0.5; }
  40%  { transform: translate(-5%, 4%) scale(1.05); opacity: 0.65; }
  70%  { transform: translate(3%, -3%) scale(0.95); opacity: 0.4; }
  100% { transform: translate(0, 0); opacity: 0.5; }
}

@keyframes cloud-drift-d {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(6%, -4%) scale(1.06); }
  100% { transform: translate(0, 0) scale(1); }
}

@keyframes cloud-drift-e {
  0%   { transform: translate(0, 0) rotate(0deg); }
  35%  { transform: translate(-4%, -2%) rotate(-3deg); }
  65%  { transform: translate(5%, 3%) rotate(2deg); }
  100% { transform: translate(0, 0) rotate(0deg); }
}

@keyframes cloud-drift-f {
  0%   { transform: translate(0, 0); }
  45%  { transform: translate(-3%, 5%) scale(1.04); }
  100% { transform: translate(0, 0); }
}

/* Apply cloud bg to dashboard page */
body.page-dashboard,
body.page-run,
body.page-new-task {
  position: relative;
}

/* Dashboard main content sits above clouds */
body.page-dashboard .layout,
body.page-dashboard .topnav,
body.page-dashboard .modal-overlay {
  position: relative;
  z-index: 10;
}

/* ── Glassmorphism Panels ───────────────────────────────────── */

/* Primary glass panel — frosted glass look */
.glass-panel {
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow:
    0 4px 24px rgba(14, 165, 233, 0.06),
    0 1px 4px rgba(0, 0, 0, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  border-radius: var(--radius-lg);
}

/* Secondary glass — lighter, more transparent */
.glass-subtle {
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(10px) saturate(160%);
  -webkit-backdrop-filter: blur(10px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.45);
  box-shadow:
    0 2px 16px rgba(14, 165, 233, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
  border-radius: var(--radius-md);
}

/* Glass card — depth layer */
.glass-card {
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(20px) saturate(200%);
  -webkit-backdrop-filter: blur(20px) saturate(200%);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow:
    0 8px 32px rgba(14, 165, 233, 0.08),
    0 2px 8px rgba(0, 0, 0, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  border-radius: var(--radius-xl);
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.glass-card:hover {
  box-shadow:
    0 12px 40px rgba(14, 165, 233, 0.12),
    0 4px 12px rgba(0, 0, 0, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
  transform: translateY(-1px);
}

/* Glass modal — enhanced for modals */
.glass-modal {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(24px) saturate(200%);
  -webkit-backdrop-filter: blur(24px) saturate(200%);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow:
    0 20px 60px rgba(14, 165, 233, 0.12),
    0 4px 16px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 1);
  border-radius: var(--radius-xl);
}

/* Glass sidebar */
.glass-sidebar {
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(14px) saturate(170%);
  -webkit-backdrop-filter: blur(14px) saturate(170%);
  border-right: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: 2px 0 20px rgba(14, 165, 233, 0.05);
}

/* Inner glass sections */
.glass-section {
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: var(--radius-md);
}

/* Glass button */
.glass-btn {
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 1px 4px rgba(14, 165, 233, 0.08);
  transition: all 0.2s ease;
}

.glass-btn:hover {
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 2px 8px rgba(14, 165, 233, 0.12);
}

/* Depth layer — adds a dark/light layered feel to containers */
.depth-layer {
  position: relative;
}

.depth-layer::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255,255,255,0.3) 0%, transparent 50%);
  pointer-events: none;
  z-index: 1;
}

/* ── Apply Glassmorphism to Dashboard ─────────────────────── */

/* Dashboard: panel and section elements */
body.page-dashboard .main-panel {
  background: transparent;
}

body.page-dashboard .panel-tabs {
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.5);
}

body.page-dashboard .run-history {
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(14px) saturate(180%);
  -webkit-backdrop-filter: blur(14px) saturate(180%);
  border-right: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: 2px 0 20px rgba(14, 165, 233, 0.06);
}

body.page-dashboard .run-history-header {
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.5);
}

/* Glass upgrade modal */
body.page-dashboard .modal {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(24px) saturate(200%);
  -webkit-backdrop-filter: blur(24px) saturate(200%);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow:
    0 20px 60px rgba(14, 165, 233, 0.14),
    0 4px 16px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 1);
}

body.page-dashboard .modal-overlay {
  background: rgba(15, 23, 42, 0.3);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/* Phase section glass styling */
body.page-dashboard .phase-section {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: var(--radius-lg);
  box-shadow: 0 2px 12px rgba(14, 165, 233, 0.05);
}

/* Run item glass */
body.page-dashboard .run-item {
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  transition: all 0.2s ease;
}

body.page-dashboard .run-item:hover {
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 2px 12px rgba(14, 165, 233, 0.08);
}

/* Top nav glass */
body.page-dashboard .topnav {
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 1px 0 rgba(14, 165, 233, 0.06);
}

/* Tab panels with glass */
body.page-dashboard .tab-panel {
  background: transparent;
}

/* Live log / terminal area glass */
body.page-dashboard .live-log {
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-lg);
}

/* Tab content area glass */
body.page-dashboard .panel-content {
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

/* ── Run Page Glass ─────────────────────────────────────────── */

body.page-run .topnav {
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.6);
}

body.page-run .run-step {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: var(--radius-lg);
}

/* ── New Task Page Glass ───────────────────────────────────── */

body.page-new-task .topnav {
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.6);
}

/* ═══════════════════════════════════════════════════════════════
   ANIMATED CLOUD BACKGROUND + ENHANCED GLASSMORPHISM
   CSS-only floating cloud layers with 3 drift speeds
   ═══════════════════════════════════════════════════════════════ */

/* ── Cloud Background Base ────────────────────────────────────── */
html, body {
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #E0F2FE 0%, #F0F9FF 50%, #E0F4FE 100%);
  z-index: -1000;
  pointer-events: none;
}

/* ── Cloud Layer 1 (Slow drift) ─────────────────────────────── */
body::after {
  content: '';
  position: fixed;
  top: -10%;
  left: 0;
  width: 200%;
  height: 60%;
  background:
    radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.8) 0%, transparent 50%),
    radial-gradient(circle at 80% 30%, rgba(255, 255, 255, 0.6) 0%, transparent 50%),
    radial-gradient(circle at 40% 80%, rgba(255, 255, 255, 0.7) 0%, transparent 50%);
  background-size: 400px 300px, 500px 350px, 450px 280px;
  background-position: 0% 0%, 100% 0%, 50% 50%;
  animation: driftSlow 120s linear infinite;
  z-index: -999;
  pointer-events: none;
  filter: blur(40px);
}

/* ── Cloud Layer 2 (Medium drift) ───────────────────────────── */
@keyframes driftMedium {
  0% {
    background-position: 0% 0%, 0% 50%, 0% 100%;
  }
  50% {
    background-position: -50% 0%, -50% 50%, -50% 100%;
  }
  100% {
    background-position: -100% 0%, -100% 50%, -100% 100%;
  }
}

/* Sidebar cloud layer */
.sidebar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(circle at 30% 20%, rgba(220, 240, 255, 0.3) 0%, transparent 50%),
    radial-gradient(circle at 70% 70%, rgba(200, 230, 255, 0.25) 0%, transparent 50%);
  background-size: 300px 300px, 350px 350px;
  animation: driftMedium 90s linear infinite;
  z-index: -10;
  pointer-events: none;
  filter: blur(30px);
  border-radius: inherit;
}

/* ── Cloud Layer 3 (Fast drift) ────────────────────────────── */
@keyframes driftFast {
  0% {
    background-position: 0% 0%, 0% 100%;
  }
  50% {
    background-position: -30% 0%, -30% 100%;
  }
  100% {
    background-position: -60% 0%, -60% 100%;
  }
}

/* Card cloud layer */
.card::before,
.panel::before,
.widget::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(circle at 25% 75%, rgba(240, 248, 255, 0.4) 0%, transparent 50%),
    radial-gradient(circle at 75% 25%, rgba(230, 245, 255, 0.35) 0%, transparent 50%);
  background-size: 280px 280px, 320px 320px;
  animation: driftFast 60s linear infinite;
  z-index: -5;
  pointer-events: none;
  filter: blur(25px);
  border-radius: inherit;
}

/* ── Keyframe Animations ───────────────────────────────────── */
@keyframes driftSlow {
  0% {
    background-position: 0% 0%, 100% 0%, 50% 50%;
  }
  50% {
    background-position: -100% 0%, 0% 0%, -50% 50%;
  }
  100% {
    background-position: -200% 0%, -100% 0%, -150% 50%;
  }
}

/* ── Enhanced Glassmorphism Panels ──────────────────────────── */

/* Primary panels */
.card,
.panel,
.widget,
.modal-content,
.dropdown,
.tooltip,
.notification {
  background: rgba(255, 255, 255, 0.1) !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 8px 32px rgba(0, 0, 0, 0.06) !important;
  position: relative;
}

/* Sidebar glassmorphism */
.sidebar {
  background: rgba(255, 255, 255, 0.08) !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  border-right: 1px solid rgba(255, 255, 255, 0.15) !important;
  position: relative;
}

/* Topnav glassmorphism */
.topnav,
nav {
  background: rgba(255, 255, 255, 0.12) !important;
  backdrop-filter: blur(12px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(12px) saturate(180%) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18) !important;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.05) !important;
}

/* Modal overlay */
.modal-overlay {
  background: rgba(0, 0, 0, 0.3) !important;
  backdrop-filter: blur(4px) !important;
  -webkit-backdrop-filter: blur(4px) !important;
}

/* Button glassmorphism (subtle) */
button,
a.button,
input[type="submit"],
input[type="button"] {
  background: rgba(255, 255, 255, 0.15) !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  border: 1px solid rgba(255, 255, 255, 0.25) !important;
  transition: all 0.3s ease;
}

button:hover,
a.button:hover,
input[type="submit"]:hover,
input[type="button"]:hover {
  background: rgba(255, 255, 255, 0.2) !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1) !important;
  transform: translateY(-2px);
}

/* Input fields glassmorphism */
input,
textarea,
select {
  background: rgba(255, 255, 255, 0.08) !important;
  backdrop-filter: blur(6px) !important;
  -webkit-backdrop-filter: blur(6px) !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  color: var(--text) !important;
}

input:focus,
textarea:focus,
select:focus {
  background: rgba(255, 255, 255, 0.12) !important;
  border-color: rgba(14, 165, 233, 0.4) !important;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1) !important;
}

/* ── Cloud Animation Sync ──────────────────────────────────── */
@media (prefers-reduced-motion: no-preference) {
  body::after,
  .sidebar::before,
  .card::before,
  .panel::before,
  .widget::before {
    animation-timing-function: linear;
  }
}

/* ═══════════════════════════════════════════════════════════════
   Glassmorphism Phase Cards — Run Page Redesign
   Progressive reveal: waiting → running → complete/failed
   ═══════════════════════════════════════════════════════════════ */

/* ── Glass Prompt Header ─────────────────────────────────────── */
.glass-prompt-header {
  display: flex;
  align-items: baseline;
  gap: 0.875rem;
  padding: 1.125rem 1.5rem;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: var(--radius-lg);
  box-shadow:
    0 4px 24px rgba(14, 165, 233, 0.07),
    0 1px 4px rgba(0, 0, 0, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.85);
  margin-bottom: 1.5rem;
  position: relative;
  z-index: 10;
}

.glass-prompt-label {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  flex-shrink: 0;
  padding-top: 1px;
}

.glass-prompt-text {
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.5;
  flex: 1;
  min-width: 0;
  word-break: break-word;
}

.glass-prompt-cursor {
  display: inline-block;
  font-size: 15px;
  font-weight: 300;
  color: var(--accent);
  animation: glass-cursor-blink 1s step-end infinite;
  margin-left: 1px;
  opacity: 1;
}

.glass-prompt-cursor.static {
  animation: glass-cursor-blink 1.4s step-end infinite;
}

@keyframes glass-cursor-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* ── Phase Cards Container ───────────────────────────────────── */
.glass-phases {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  margin-bottom: 1.5rem;
  position: relative;
  z-index: 10;
}

/* ── Individual Phase Card ───────────────────────────────────── */
.glass-phase-card {
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-lg);
  box-shadow:
    0 2px 12px rgba(14, 165, 233, 0.04),
    0 1px 3px rgba(0, 0, 0, 0.03),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
  transition:
    background 0.35s ease,
    box-shadow 0.35s ease,
    border-color 0.35s ease,
    transform 0.25s ease;
  overflow: hidden;
  position: relative;
}

/* Waiting state — dimmed */
.glass-phase-card[data-status="waiting"] {
  opacity: 0.55;
  background: rgba(248, 250, 252, 0.45);
  border-color: rgba(226, 232, 240, 0.5);
}

/* Running state — glowing blue */
.glass-phase-card[data-status="running"] {
  opacity: 1;
  background: rgba(255, 255, 255, 0.82);
  border-color: rgba(14, 165, 233, 0.35);
  box-shadow:
    0 0 0 1px rgba(14, 165, 233, 0.2),
    0 6px 28px rgba(14, 165, 233, 0.14),
    0 2px 8px rgba(14, 165, 233, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
  animation: glass-card-pulse 2.4s ease-in-out infinite;
}

/* Completed state — green accent */
.glass-phase-card[data-status="completed"] {
  opacity: 1;
  background: rgba(255, 255, 255, 0.78);
  border-color: rgba(16, 185, 129, 0.3);
  box-shadow:
    0 0 0 1px rgba(16, 185, 129, 0.15),
    0 4px 20px rgba(16, 185, 129, 0.08),
    0 1px 4px rgba(0, 0, 0, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

/* Failed state — red accent */
.glass-phase-card[data-status="failed"] {
  opacity: 1;
  background: rgba(255, 255, 255, 0.78);
  border-color: rgba(239, 68, 68, 0.3);
  box-shadow:
    0 0 0 1px rgba(239, 68, 68, 0.15),
    0 4px 20px rgba(239, 68, 68, 0.08),
    0 1px 4px rgba(0, 0, 0, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

@keyframes glass-card-pulse {
  0%, 100% {
    box-shadow:
      0 0 0 1px rgba(14, 165, 233, 0.2),
      0 6px 28px rgba(14, 165, 233, 0.14),
      0 2px 8px rgba(14, 165, 233, 0.08),
      inset 0 1px 0 rgba(255, 255, 255, 0.95);
  }
  50% {
    box-shadow:
      0 0 0 3px rgba(14, 165, 233, 0.12),
      0 8px 36px rgba(14, 165, 233, 0.22),
      0 2px 8px rgba(14, 165, 233, 0.1),
      inset 0 1px 0 rgba(255, 255, 255, 0.95);
  }
}

/* Inner glow — decorative accent */
.gpc-glow {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: transparent;
  transition: background 0.35s ease;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  pointer-events: none;
}

.glass-phase-card[data-status="running"] .gpc-glow {
  background: linear-gradient(90deg, transparent, rgba(14, 165, 233, 0.6), transparent);
  animation: gpc-glow-sweep 2s linear infinite;
}

.glass-phase-card[data-status="completed"] .gpc-glow {
  background: linear-gradient(90deg, transparent, rgba(16, 185, 129, 0.5), transparent);
}

.glass-phase-card[data-status="failed"] .gpc-glow {
  background: linear-gradient(90deg, transparent, rgba(239, 68, 68, 0.5), transparent);
}

@keyframes gpc-glow-sweep {
  0% { background-position: -200% 0; opacity: 0.6; }
  50% { opacity: 1; }
  100% { background-position: 200% 0; opacity: 0.6; }
}

/* ── Card Header ─────────────────────────────────────────────── */
.gpc-header {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.875rem 1.25rem;
}

.gpc-num {
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  min-width: 20px;
  flex-shrink: 0;
  transition: color 0.3s ease;
}

.glass-phase-card[data-status="running"] .gpc-num {
  color: var(--accent);
}
.glass-phase-card[data-status="completed"] .gpc-num {
  color: var(--success);
}
.glass-phase-card[data-status="failed"] .gpc-num {
  color: var(--error);
}

.gpc-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  flex: 1;
  transition: color 0.3s ease;
  letter-spacing: -0.01em;
}

.glass-phase-card[data-status="running"] .gpc-name {
  color: var(--text);
}
.glass-phase-card[data-status="completed"] .gpc-name,
.glass-phase-card[data-status="failed"] .gpc-name {
  color: var(--text);
}

/* Status badge — right side of header */
.gpc-status-badge {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  flex-shrink: 0;
}

.gpc-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--border);
  flex-shrink: 0;
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

.glass-phase-card[data-status="running"] .gpc-dot {
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.2);
  animation: gpc-dot-pulse 1.4s ease-in-out infinite;
}

.glass-phase-card[data-status="completed"] .gpc-dot {
  background: var(--success);
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

.glass-phase-card[data-status="failed"] .gpc-dot {
  background: var(--error);
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
}

@keyframes gpc-dot-pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.2); }
  50% { box-shadow: 0 0 0 6px rgba(14, 165, 233, 0.06); }
}

.gpc-status-text {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  transition: color 0.3s ease;
}

.glass-phase-card[data-status="running"] .gpc-status-text {
  color: var(--accent);
}
.glass-phase-card[data-status="completed"] .gpc-status-text {
  color: var(--success);
}
.glass-phase-card[data-status="failed"] .gpc-status-text {
  color: var(--error);
}

/* ── Card Body — only visible when expanded ──────────────────── */
.gpc-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), padding 0.3s ease;
  padding: 0 1.25rem;
}

.glass-phase-card.expanded .gpc-body {
  max-height: 200px;
  padding: 0 1.25rem 1rem;
}

.gpc-desc {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.55;
  margin-bottom: 0.5rem;
}

.glass-phase-card[data-status="completed"] .gpc-desc,
.glass-phase-card[data-status="running"] .gpc-desc {
  color: var(--text-muted);
}

.gpc-content {
  min-height: 0;
}

.gpc-elapsed {
  font-size: 11px;
  letter-spacing: 0.04em;
  margin-top: 0.25rem;
}

.glass-phase-card[data-status="completed"] .gpc-elapsed {
  color: var(--success);
}
.glass-phase-card[data-status="failed"] .gpc-elapsed {
  color: var(--error);
}

/* ── Z-index fix: run page content above cloud layers ────────── */
body.page-run #pipeline-section,
body.page-run #input-section,
body.page-run nav {
  position: relative;
  z-index: 10;
}

/* ── Trial upgrade banner (dashboard, shown at 3+ builds) ─────── */
.trial-upgrade-banner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  background: rgba(56,189,248,0.06);
  border: 1px solid rgba(56,189,248,0.2);
  border-radius: 12px;
  padding: 16px 20px;
  margin: 0 0 20px;
  position: relative; z-index: 1;
}
.tub-left { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.tub-icon { font-size: 20px; flex-shrink: 0; }
.tub-title { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 3px; }
.tub-sub { font-size: 12px; color: var(--text-muted); }
.tub-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.tub-cta {
  display: inline-block; padding: 8px 16px; border-radius: 8px;
  background: var(--accent); color: #060a14;
  font-size: 13px; font-weight: 700; font-family: 'Space Grotesk', sans-serif;
  text-decoration: none; transition: background 0.15s, box-shadow 0.15s;
  box-shadow: 0 0 14px rgba(56,189,248,0.25); white-space: nowrap;
}
.tub-cta:hover { background: var(--accent-hover); box-shadow: 0 0 22px rgba(56,189,248,0.4); }
.tub-dismiss {
  background: transparent; border: none; color: var(--text-dim);
  font-size: 14px; cursor: pointer; padding: 4px; transition: color 0.15s;
}
.tub-dismiss:hover { color: var(--text-muted); }

/* ── Promo Banner ─────────────────────────────────────────────────────────── */
.promo-banner {
  position: sticky; top: 0; z-index: 1000;
  background: linear-gradient(90deg, #0f172a 0%, #0c1a2e 100%);
  border-bottom: 1px solid rgba(56,189,248,0.25);
}
.promo-banner-inner {
  max-width: 1100px; margin: 0 auto;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 24px; flex-wrap: wrap;
}
.promo-banner-badge {
  font-size: 10px; font-family: 'Space Mono', monospace;
  font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: #060a14; background: var(--accent);
  border-radius: 4px; padding: 2px 8px; flex-shrink: 0;
}
.promo-banner-text {
  font-size: 14px; color: var(--text-muted); flex: 1; min-width: 0;
}
.promo-banner-text strong { color: var(--text); }
.promo-banner-cta {
  font-size: 13px; font-weight: 700; color: var(--accent);
  text-decoration: none; white-space: nowrap;
  border: 1px solid rgba(56,189,248,0.35); border-radius: 6px;
  padding: 5px 14px; transition: background 0.15s, color 0.15s;
}
.promo-banner-cta:hover { background: rgba(56,189,248,0.1); }
.promo-banner-close {
  background: transparent; border: none; color: var(--text-dim);
  font-size: 18px; line-height: 1; cursor: pointer; padding: 2px 6px;
  margin-left: 4px; flex-shrink: 0; transition: color 0.15s;
}
.promo-banner-close:hover { color: var(--text-muted); }
