:root {
  /* ========================================================================
     SURFACE & ELEVATION HIERARCHY
     ======================================================================== */
  --bg-canvas: #070a12;               /* Root workspace backdrop (Void) */
  --bg-pane: #0c111d;                 /* Structural container & toolbars */
  --bg-card: #111827;                 /* Standard requirement / question card */
  --bg-card-hover: #161f33;           /* Interactive card hover state */
  --bg-card-focus: #141e36;           /* Guided Focus active card elevation */
  --bg-input: #070a12;                /* High-contrast inset input field background */
  --bg-input-focus: #090e1a;          /* Active input field focus surface */
  --bg-overlay: rgba(3, 7, 18, 0.82); /* Modal backdrop with blur */

  /* ========================================================================
     HAIRLINE STRUCTURAL BORDERS
     ======================================================================== */
  --border-subtle: #1e293b;           /* Default 1px structural datum line */
  --border-muted: #334155;            /* Hovered card & boundary rule */
  --border-focus: #3b82f6;            /* Luminous focus perimeter */
  --border-focus-ring: rgba(59, 130, 246, 0.35); /* Outer glow focus aura */

  /* ========================================================================
     HIGH-CONTRAST TYPOGRAPHIC TOKENS
     ======================================================================== */
  --text-primary: #f8fafc;            /* Headers, prominent titles, active text */
  --text-secondary: #94a3b8;          /* Body copy, descriptive helper notes */
  --text-muted: #64748b;              /* Micro tags, timestamps, disabled items */
  --text-placeholder: #475569;        /* Input placeholders */

  /* ========================================================================
     CHROMATIC STATUS & SIGNAL TOKENS
     ======================================================================== */
  --accent-primary: #3b82f6;          /* Action blue */
  --accent-primary-hover: #2563eb;    /* Action blue hover */
  --accent-primary-glow: rgba(59, 130, 246, 0.22);
  --accent-emerald: #10b981;          /* Verification pass & readiness */
  --accent-emerald-bg: rgba(16, 185, 129, 0.12);
  --accent-emerald-border: rgba(16, 185, 129, 0.35);
  --accent-amber: #f59e0b;            /* Scope blocker & suspect warning */
  --accent-amber-bg: rgba(245, 158, 11, 0.14);
  --accent-amber-border: rgba(245, 158, 11, 0.45);
  --accent-rose: #f43f5e;             /* Critical violation / rejection */
  --accent-rose-bg: rgba(244, 63, 94, 0.14);
  --accent-rose-border: rgba(244, 63, 94, 0.35);
  --accent-violet: #8b5cf6;           /* Persona & EARS classification */
  --accent-violet-bg: rgba(139, 92, 246, 0.14);
  --accent-violet-border: rgba(139, 92, 246, 0.35);

  /* ========================================================================
     TYPOGRAPHY & SPACING SCALE
     ======================================================================== */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace;

  --font-size-xs: 11px;
  --font-size-sm: 12.5px;
  --font-size-base: 14px;
  --font-size-md: 15px;
  --font-size-lg: 16px;
  --font-size-xl: 18px;

  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 10px;
  --radius-full: 9999px;

  --touch-target-min: 40px;           /* Ergonomic interactive touch target floor */
}

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

body {
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.5;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.mono {
  font-family: var(--font-mono);
}

.text-xs { font-size: 11px; }
.text-sm { font-size: 12.5px; }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.mb-3 { margin-bottom: 10px; }
.w-full { width: 100%; }

/* ==========================================================================
   TOP COMMAND HEADER
   ========================================================================== */
.topbar {
  height: 56px;
  background: var(--bg-pane);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  flex-shrink: 0;
  gap: 16px;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 13px;
  color: #fff;
}

.brand-title {
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -0.01em;
}

.brand-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  margin-left: 4px;
}

.brand-subtitle {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* 5-Stage Pipeline Stepper */
.stage-stepper {
  display: flex;
  align-items: center;
  gap: 6px;
}

.step-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--bg-canvas);
  border: 1px solid var(--border-subtle);
  transition: all 0.15s ease;
}

.step-pill.active {
  color: var(--text-primary);
  border-color: var(--accent-primary);
  background: rgba(59, 130, 246, 0.14);
}

.step-pill.completed {
  color: var(--accent-emerald);
  border-color: rgba(16, 185, 129, 0.35);
}

.step-num {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  display: inline-grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 10px;
}

.step-divider {
  width: 12px;
  height: 1px;
  background: var(--border-subtle);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.readiness-widget {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-canvas);
  border: 1px solid var(--border-subtle);
  padding: 5px 10px;
  border-radius: 6px;
}

.readiness-label {
  font-size: 11px;
  color: var(--text-secondary);
}

.readiness-bar-track {
  width: 68px;
  height: 6px;
  background: #1e293b;
  border-radius: 99px;
  overflow: hidden;
}

.readiness-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #10b981);
  transition: width 0.3s ease;
}

.readiness-value {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-emerald);
}

/* Layout Mode Switcher */
.layout-switcher {
  display: flex;
  align-items: center;
  background: var(--bg-canvas);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 2px;
  gap: 2px;
}

.layout-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  min-height: 32px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.layout-toggle-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.layout-toggle-btn.active {
  background: #1e293b;
  color: #60a5fa;
  font-weight: 600;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.35);
}

.layout-icon {
  font-size: 13px;
  line-height: 1;
}

/* ==========================================================================
   STAGE CONTEXT & NEXT-ACTION BANNER
   ========================================================================== */
.stage-banner {
  background: var(--bg-pane);
  border-bottom: 1px solid var(--border-subtle);
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-shrink: 0;
  z-index: 10;
  transition: all 0.2s ease;
}

.stage-banner-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.stage-banner-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: rgba(59, 130, 246, 0.14);
  border: 1px solid rgba(59, 130, 246, 0.35);
  color: #60a5fa;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.stage-banner-badge.badge-stage-2 {
  background: var(--accent-amber-bg);
  border-color: var(--accent-amber-border);
  color: #fbbf24;
}

.stage-banner-badge.badge-stage-3 {
  background: var(--accent-violet-bg);
  border-color: var(--accent-violet-border);
  color: #c4b5fd;
}

.stage-banner-badge.badge-stage-4 {
  background: var(--accent-emerald-bg);
  border-color: var(--accent-emerald-border);
  color: #34d399;
}

.stage-banner-badge.badge-stage-5 {
  background: rgba(59, 130, 246, 0.18);
  border-color: rgba(59, 130, 246, 0.45);
  color: #93c5fd;
}

.stage-banner-badge.badge-stage-6 {
  background: rgba(16, 185, 129, 0.18);
  border-color: rgba(16, 185, 129, 0.45);
  color: #6ee7b7;
}

.stage-banner-text-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stage-banner-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}

.stage-banner-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.3;
}

.stage-banner-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.readiness-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-canvas);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 5px 10px;
}

.progress-bar-sm {
  width: 72px;
  height: 6px;
  background: #1e293b;
  border-radius: 99px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #10b981);
  transition: width 0.3s ease;
}

.btn-sm {
  padding: 6px 14px;
  font-size: 12px;
  min-height: 34px;
}

/* ==========================================================================
   ADAPTIVE DUAL-MODE WORKSPACE LAYOUT
   ========================================================================== */
.workspace-grid {
  flex: 1;
  display: grid;
  overflow: hidden;
  transition: all 0.2s ease;
}

/* 3-Pane Architect / Split Mode */
.workspace-grid.mode-split,
.workspace-grid:not(.mode-guided-focus) {
  grid-template-columns: 380px 1fr 420px;
}

/* Guided Focus Mode - Stages 1 & 2 / Business Objectives */
.workspace-grid.mode-guided-focus.mode-guided-stage12 {
  display: grid;
  grid-template-columns: minmax(600px, 740px) minmax(360px, 420px);
  justify-content: center;
  gap: 24px;
  padding: 16px 24px;
  overflow-y: auto;
  background: var(--bg-canvas);
}

.workspace-grid.mode-guided-focus.mode-guided-stage12 .pane-left {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  height: auto;
  min-height: 100%;
  background: var(--bg-pane);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

.workspace-grid.mode-guided-focus.mode-guided-stage12 .pane-center {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  height: auto;
  min-height: 100%;
  background: var(--bg-pane);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

.workspace-grid.mode-guided-focus.mode-guided-stage12 .pane-right {
  display: none !important;
}

/* Guided Focus Mode - Stages 3, 4, 5, 6 */
.workspace-grid.mode-guided-focus.mode-guided-stage3456 {
  grid-template-columns: 300px 1fr 460px;
  gap: 0;
  padding: 0;
}

.workspace-grid.mode-guided-focus.mode-guided-stage3456 .pane-left {
  border-right: 1px solid var(--border-subtle);
}

.workspace-grid.mode-guided-focus.mode-guided-stage3456 .pane-center {
  background: var(--bg-canvas);
}

.workspace-grid.mode-guided-focus.mode-guided-stage3456 .pane-right {
  border-left: 1px solid var(--border-subtle);
  display: flex !important;
}

.pane {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background: var(--bg-pane);
}

.pane-left {
  border-right: 1px solid var(--border-subtle);
}

.pane-center {
  background: var(--bg-canvas);
}

.pane-right {
  border-left: 1px solid var(--border-subtle);
}

.pane-header {
  height: 44px;
  padding: 0 14px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  background: var(--bg-pane);
}

.pane-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pane-title {
  font-size: 13px;
  font-weight: 600;
}

.pane-tabs {
  display: flex;
  gap: 4px;
  height: 100%;
  align-items: center;
}

.pane-tab {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}

.pane-tab:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}

.pane-tab.active {
  color: var(--text-primary);
  background: rgba(59, 130, 246, 0.14);
  border: 1px solid rgba(59, 130, 246, 0.35);
}

.pane-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pane-footer-actions {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
}

/* ==========================================================================
   CARDS, BADGES, AND FORM CONTROLS
   ========================================================================== */
.section-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 12px;
}

.section-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.section-eyebrow {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: #60a5fa;
}

.badge {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  background: #1e293b;
  color: var(--text-secondary);
}

.badge-pass {
  background: var(--accent-emerald-bg);
  color: var(--accent-emerald);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-warn, .badge-suspect {
  background: var(--accent-amber-bg);
  color: var(--accent-amber);
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.badge-danger {
  background: var(--accent-rose-bg);
  color: var(--accent-rose);
  border: 1px solid rgba(244, 63, 94, 0.35);
}

.badge-ears {
  background: rgba(139, 92, 246, 0.15);
  color: #c4b5fd;
  border: 1px solid rgba(139, 92, 246, 0.35);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
}

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

.btn-xs {
  padding: 4px 8px;
  font-size: 11px;
}

.btn-primary {
  background: var(--accent-primary);
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-primary-hover);
}

.btn-secondary {
  background: #1e293b;
  color: var(--text-primary);
  border-color: #334155;
}

.btn-secondary:hover:not(:disabled) {
  background: #334155;
}

.btn-success {
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.4);
}

.btn-success:hover:not(:disabled) {
  background: rgba(16, 185, 129, 0.28);
}

.btn-amber {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.45);
}

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

.btn-ghost:hover:not(:disabled), .btn-ghost.active {
  color: var(--text-primary);
  background: #1e293b;
}

.input-text, .input-textarea, .input-select {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  border-radius: 6px;
  padding: 7px 10px;
  font-family: var(--font-sans);
  font-size: 12.5px;
}

.input-text:focus, .input-textarea:focus, .input-select:focus {
  outline: none;
  border-color: var(--border-focus);
}

/* ==========================================================================
   STAGE 1 DISCOVERY CARDS & OPTION PILLS
   ========================================================================== */
.questions-stack, .stack-list, .fr-cards-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.question-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--accent-primary);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.question-card:hover, .question-card.active-focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 1px #3b82f6, 0 0 24px -2px rgba(59, 130, 246, 0.22);
}

.question-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.question-title {
  font-size: 15.5px;
  font-weight: 600;
  color: #f8fafc;
  line-height: 1.45;
}

.question-why {
  font-size: 13px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Dimension Badges with Semantic Visual Archetype */
.badge-dim-persona {
  background: rgba(139, 92, 246, 0.15);
  color: #c4b5fd;
  border: 1px solid rgba(139, 92, 246, 0.4);
}

.badge-dim-kpi {
  background: rgba(14, 165, 233, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(14, 165, 233, 0.4);
}

.badge-dim-workflow {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.badge-dim-non_goal {
  background: rgba(244, 63, 94, 0.15);
  color: #fda4af;
  border: 1px solid rgba(244, 63, 94, 0.4);
}

.badge-dim-constraint {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.option-pills {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.option-chip {
  min-height: 42px;
  padding: 10px 14px;
  font-size: 13.5px;
  border-radius: var(--radius-md);
  background: var(--bg-pane);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
  width: 100%;
}

.option-chip:hover {
  border-color: var(--border-muted);
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}

.option-chip.selected {
  background: #161f33;
  border: 2px solid var(--accent-primary);
  color: #ffffff;
  font-weight: 500;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

.chip-content {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chip-indicator {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid #475569;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 11px;
  transition: all 0.15s ease;
}

.option-chip.selected .chip-indicator {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #ffffff;
  font-weight: 700;
}

.chip-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  color: #60a5fa;
  font-weight: 600;
}

.discovery-answer-input {
  width: 100%;
  min-height: 80px;
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.5;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-input);
  color: var(--text-primary);
  transition: all 0.15s ease;
  resize: vertical;
  font-family: var(--font-sans);
}

.discovery-answer-input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 1px var(--accent-primary);
  background: var(--bg-input-focus);
}

.missing-dims-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

/* ==========================================================================
   STAGE 2 SCOPE GATE & SEGMENTED STATUS SELECTOR
   ========================================================================== */
.scope-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.scope-card.is-blocker {
  border-left: 4px solid var(--accent-rose);
}

.scope-card.is-approved {
  border-left: 4px solid var(--accent-emerald);
}

.segmented-control {
  display: inline-flex;
  background: var(--bg-canvas);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 2px;
  gap: 2px;
}

.seg-btn {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  padding: 6px 12px;
  min-height: 34px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.seg-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.seg-btn.active-pending {
  background: var(--accent-amber-bg);
  color: #fbbf24;
  border: 1px solid var(--accent-amber);
  font-weight: 700;
}

.seg-btn.active-approved {
  background: var(--accent-emerald-bg);
  color: #34d399;
  border: 1px solid var(--accent-emerald);
  font-weight: 700;
}

.seg-btn.active-rejected {
  background: var(--accent-rose-bg);
  color: #fda4af;
  border: 1px solid var(--accent-rose);
  font-weight: 700;
}

.asm-note-input {
  width: 100%;
  padding: 10px 12px;
  font-size: 13.5px;
  line-height: 1.45;
  border-radius: var(--radius-md);
  min-height: 52px;
  resize: vertical;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-family: var(--font-sans);
}

.asm-note-input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 1px var(--accent-primary);
  background: var(--bg-input-focus);
}

/* ==========================================================================
   UPSTREAM BUSINESS OBJECTIVE (BO) CARDS
   ========================================================================== */
.bo-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bo-title-input {
  font-size: 14px;
  padding: 10px 12px;
  font-weight: 600;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
}

.bo-stmt-input {
  font-size: 14px;
  line-height: 1.5;
  padding: 10px 12px;
  min-height: 72px;
  resize: vertical;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-sans);
}

.bo-kpi-input {
  font-size: 14px;
  font-family: var(--font-mono);
  color: #10b981;
  font-weight: 600;
  padding: 10px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

/* ==========================================================================
   CENTER PANE: EARS REQUIREMENT CARDS & 5-STATE MATRIX
   ========================================================================== */
.fr-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: border-color 0.2s ease;
}

.fr-card.is-suspect {
  border-color: var(--accent-amber);
  box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.25);
}

.fr-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.fr-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.suspect-banner {
  background: var(--accent-amber-bg);
  border: 1px solid rgba(245, 158, 11, 0.45);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #fde68a;
  font-size: 12px;
}

.ears-statement-box {
  background: var(--bg-input);
  border-left: 4px solid var(--accent-primary);
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.6;
}

.states-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 8px;
}

.state-cell {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 80px;
}

.state-cell-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: #60a5fa;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.state-cell-text {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.gherkin-box {
  background: #090d16;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  line-height: 1.55;
}

.gherkin-kw {
  color: #38bdf8;
  font-weight: 600;
  font-family: var(--font-mono);
}

/* ==========================================================================
   RIGHT PANE: RED/GREEN INCOSE DIFF CARDS & TRACEABILITY TABLE
   ========================================================================== */
.lint-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.diff-block-red {
  background: rgba(244, 63, 94, 0.1);
  border-left: 3px solid var(--accent-rose);
  padding: 8px 10px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: #fda4af;
}

.diff-block-green {
  background: rgba(16, 185, 129, 0.1);
  border-left: 3px solid var(--accent-emerald);
  padding: 8px 10px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: #6ee7b7;
}

.trace-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.5px;
}

.trace-table th, .trace-table td {
  padding: 8px 6px;
  border-bottom: 1px solid var(--border-subtle);
  text-align: left;
}

.trace-table th {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  color: var(--text-muted);
}

.architecture-drawer {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 12px;
}

.mermaid-canvas {
  background: var(--bg-input);
  border-radius: 6px;
  padding: 12px;
  overflow-x: auto;
  display: flex;
  justify-content: center;
}

/* Artifact Toggle Row (Stage 5 Spec Kit & Stage 6 SDD Artifact Previews) */
.artifact-toggle-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 10px;
}

.artifact-toggle-row .btn {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 4px;
  background: var(--bg-canvas);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  transition: all 0.15s ease;
  white-space: nowrap;
}

.artifact-toggle-row .btn:hover:not(:disabled) {
  color: var(--text-primary);
  border-color: #334155;
  background: var(--bg-card-hover);
}

.artifact-toggle-row .btn.active {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
  border-color: var(--accent-primary);
  font-weight: 600;
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.3);
}

.code-preview {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 12px;
  font-size: 11.5px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  color: #cbd5e1;
  max-height: calc(100vh - 220px);
  overflow-y: auto;
}

/* Modal & Toast */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(3, 7, 18, 0.78);
  backdrop-filter: blur(4px);
  display: grid;
  place-items: center;
  z-index: 100;
}

.modal-backdrop[hidden] {
  display: none !important;
}

.modal-card {
  width: 780px;
  max-width: 94vw;
  background: var(--bg-card);
  border: 1px solid #334155;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.75);
}

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

.modal-footer {
  padding: 18px 28px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.modal-body {
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-body .input-text {
  padding: 12px 14px;
  font-size: 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-input);
}

.modal-body .input-textarea {
  padding: 14px 16px;
  font-size: 14px;
  line-height: 1.6;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-input);
  min-height: 200px;
  resize: vertical;
}

.modal-formatting-tips {
  margin-top: 6px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(51, 65, 85, 0.6);
  border-radius: var(--radius-md);
  padding: 10px 14px;
}

.tip-header {
  font-size: 11.5px;
  font-weight: 600;
  color: #93c5fd;
  margin-bottom: 6px;
  display: block;
}

.tip-tags {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.tip-tag {
  font-size: 11.5px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.tip-tag strong {
  color: #f8fafc;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-group label {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-secondary);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.btn-icon {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 18px;
  cursor: pointer;
}

.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-secondary);
}

.empty-icon {
  font-size: 28px;
  margin-bottom: 8px;
  color: var(--accent-primary);
}

.toast-container {
  position: fixed;
  bottom: 16px;
  right: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 200;
}

.toast {
  background: #1e293b;
  border: 1px solid #334155;
  border-left: 4px solid var(--accent-primary);
  color: var(--text-primary);
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.45);
}

.toast.toast-warn { border-left-color: var(--accent-amber); }
.toast.toast-success { border-left-color: var(--accent-emerald); }
.toast.toast-error { border-left-color: var(--accent-rose); }

/* ==========================================================================
   RESPONSIVE ERGONOMICS & BREAKPOINTS
   ========================================================================== */
@media (max-width: 1180px) {
  .workspace-grid.mode-split,
  .workspace-grid:not(.mode-guided-focus) {
    grid-template-columns: 320px 1fr 360px;
  }

  .workspace-grid.mode-guided-focus.mode-guided-stage12 {
    grid-template-columns: 1fr;
    max-width: 800px;
    margin: 0 auto;
    padding: 16px;
  }

  .workspace-grid.mode-guided-focus.mode-guided-stage12 .pane-center {
    display: none;
  }

  .workspace-grid.mode-guided-focus.mode-guided-stage3456 {
    grid-template-columns: 260px 1fr 360px;
  }
}

@media (max-width: 860px) {
  body {
    overflow-y: auto;
    height: auto;
    min-height: 100vh;
  }

  .topbar {
    height: auto;
    padding: 10px 14px;
    flex-wrap: wrap;
    gap: 10px;
  }

  .stage-stepper {
    overflow-x: auto;
    width: 100%;
    padding-bottom: 4px;
  }

  .workspace-grid.mode-split,
  .workspace-grid:not(.mode-guided-focus),
  .workspace-grid.mode-guided-focus.mode-guided-stage3456 {
    display: flex;
    flex-direction: column;
    height: auto;
  }

  .pane {
    height: auto;
    min-height: 400px;
  }

  .modal-formatting-tips .tip-tags {
    grid-template-columns: 1fr;
  }
}
