/* ============================================================
   Concord SOC — Unified Design System & Stylesheet
   Clinical, information-dense, modern aesthetic.
   ============================================================ */

/* ── Design Tokens ─────────────────────────────────────────── */
:root {
  /* Surfaces */
  --bg-base:           #F8F9FA;
  --bg-surface:        #FFFFFF;
  --bg-subtle:         #F1F3F5;
  --bg-hover:          #EBEDF0;

  /* Borders */
  --border:            #E2E5E9;
  --border-strong:     #C4C9D0;

  /* Text */
  --text-primary:      #111827;
  --text-secondary:    #6B7280;
  --text-muted:        #9CA3AF;
  --text-on-accent:    #FFFFFF;

  /* Brand — ONE accent color */
  --accent:            #0F4C5C;
  --accent-hover:      #0A3A47;
  --accent-light:      #E6F2F4;
  --accent-border:     #A8D5DC;

  /* Semantic — text/border ONLY, never as large background fills */
  --success:           #16A34A;
  --success-bg:        #F0FDF4;
  --success-border:    #BBF7D0;
  --warning:           #D97706;
  --warning-bg:        #FFFBEB;
  --warning-border:    #FDE68A;
  --danger:            #DC2626;
  --danger-bg:         #FEF2F2;
  --danger-border:     #FECACA;
  --info:              #2563EB;
  --info-bg:           #EFF6FF;
  --info-border:       #BFDBFE;

  /* Severity colors */
  --critical-text:     #991B1B;
  --high-text:         #92400E;

  /* Agent colors — for left-border and dot indicators ONLY */
  --agent-triage:      #6366F1;
  --agent-forensics:   #0891B2;
  --agent-containment: #059669;
  --agent-comms:       #D97706;
  --agent-human:       #7C3AED;
  --agent-rca:         #0F4C5C;

  /* Overlay color */
  --overlay-bg:        rgba(0, 0, 0, 0.35);

  /* Typography */
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", monospace;

  /* Type scale */
  --text-2xs:   10px;
  --text-xs:    11px;
  --text-sm:    13px;
  --text-base:  15px;
  --text-lg:    17px;
  --text-xl:    20px;
  --text-2xl:   26px;
  --text-3xl:   36px;
  --text-4xl:   48px;

  /* Spacing — 8px grid only */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  20px;
  --space-6:  24px;
  --space-8:  32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;

  /* Shape */
  --radius-sm: 4px;
  --radius:    6px;
  --radius-lg: 8px;   /* MAXIMUM anywhere */

  /* Shadows — used sparingly */
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.06);
  --shadow-sm: 0 1px 4px rgba(0,0,0,0.08);
}

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

body {
  font-family: var(--font-sans);
  color: var(--text-primary);
  background: var(--bg-base);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ── Typography & Elements ─────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ── Button System (Part 3) ─────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 8px var(--space-4);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 500;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 150ms, border-color 150ms, opacity 150ms;
  white-space: nowrap;
  line-height: 1;
  text-decoration: none;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; pointer-events: none; }

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

.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-primary);
  border-color: var(--border);
}
.btn-secondary:hover:not(:disabled) { background: var(--bg-subtle); }

.btn-success {
  background: var(--bg-surface);
  color: var(--success);
  border-color: var(--success-border);
}
.btn-success:hover:not(:disabled) { background: var(--success-bg); }

.btn-warning {
  background: var(--bg-surface);
  color: var(--warning);
  border-color: var(--warning-border);
}
.btn-warning:hover:not(:disabled) { background: var(--warning-bg); }

.btn-sm {
  padding: 4px var(--space-3);
  font-size: var(--text-xs);
}

/* ── Severity Badges ────────────────────────────────────────── */
.severity {
  font-size: var(--text-xs);
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid;
  display: inline-block;
  line-height: 1.2;
}
.severity.critical {
  color: var(--critical-text);
  background: var(--danger-bg);
  border-color: var(--danger-border);
}
.severity.high {
  color: var(--high-text);
  background: var(--warning-bg);
  border-color: var(--warning-border);
}
.severity.medium {
  color: var(--info);
  background: var(--info-bg);
  border-color: var(--info-border);
}
.severity.low {
  color: var(--success);
  background: var(--success-bg);
  border-color: var(--success-border);
}

/* ── LANDING PAGE STYLES ────────────────────────────────────── */
.landing-body {
  background: var(--bg-base);
  min-height: 100vh;
}

.landing-nav {
  height: 56px;
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-6);
}

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

.nav-brand {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--text-primary);
}

.nav-badge {
  font-size: var(--text-xs);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 2px 6px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.landing-hero {
  max-width: 680px;
  margin: 0 auto;
  padding: 80px 24px 64px;
  text-align: center;
}

.hero-kicker {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--agent-forensics);
  letter-spacing: 0.08em;
  margin-bottom: var(--space-4);
  text-transform: uppercase;
}

.hero-title {
  font-size: var(--text-4xl);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin-bottom: var(--space-5);
}

.hero-lead {
  font-size: 18px;
  color: var(--text-secondary);
  line-height: 1.65;
  max-width: 560px;
  margin: 0 auto var(--space-8);
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: var(--space-3);
}

.status-strip {
  background: var(--bg-subtle);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 12px 24px;
}

.status-strip-content {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  display: inline-block;
}

.status-sep {
  color: var(--text-muted);
}

.how-it-works {
  padding: 64px var(--space-6);
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
}

.section-title {
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.section-subtitle {
  font-size: var(--text-base);
  color: var(--text-secondary);
  margin-bottom: var(--space-10);
}

.agent-flow-container {
  overflow-x: auto;
  padding-bottom: var(--space-4);
  margin-bottom: var(--space-8);
}

.agent-flow-row {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  min-width: 100%;
}

.how-card {
  min-width: 140px;
  max-width: 170px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-4) var(--space-3);
  text-align: left;
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  height: 180px;
}

.how-card-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-bottom: var(--space-2);
}

.how-card-name {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.how-card-divider {
  height: 1px;
  background: var(--border);
  margin-bottom: var(--space-2);
}

.how-card-desc {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.5;
  flex: 1;
}

.how-card-model {
  font-size: var(--text-2xs);
  font-family: var(--font-mono);
  color: var(--text-muted);
  margin-top: var(--space-2);
}

.flow-arrow {
  font-size: var(--text-lg);
  color: var(--text-muted);
  user-select: none;
}

.gate-callout {
  border: 1px solid var(--accent-border);
  background: var(--accent-light);
  border-radius: var(--radius);
  padding: 16px 20px;
  max-width: 640px;
  margin: 24px auto 0;
  text-align: left;
}

.gate-callout-header {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.08em;
  margin-bottom: var(--space-2);
}

.gate-callout-body {
  font-size: 14px;
  color: var(--accent);
  line-height: 1.6;
}

.three-pillars {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
  padding: 48px var(--space-6);
}

.pillars-container {
  max-width: 1000px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--space-8);
}

.pillar-col {
  padding: 0 var(--space-2);
}

.pillars-container > .pillar-col:not(:last-child) {
  border-right: 1px solid var(--border);
}

.pillar-title {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.pillar-body {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.65;
}

.stats-bar {
  background: var(--accent);
  color: var(--text-on-accent);
  padding: 28px 24px;
}

.stats-container {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.stat-item {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
}

.stat-num {
  font-size: 22px;
  font-weight: 700;
}

.stat-label {
  font-size: var(--text-sm);
  opacity: 0.85;
}

.stat-sep {
  opacity: 0.4;
}

.demo-scenarios {
  padding: 64px var(--space-6);
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
}

.scenarios-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--space-6);
  margin-top: var(--space-6);
}

.scenario-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  background: var(--bg-surface);
  text-align: left;
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  height: 240px;
  transition: border-color 150ms;
}

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

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

.scenario-title {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text-primary);
}

.scenario-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
  flex: 1;
  margin-bottom: var(--space-5);
}

.scenario-btn {
  width: 100%;
}

.landing-footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  padding: 24px;
  text-align: center;
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.landing-footer a {
  color: var(--accent);
}
.landing-footer a:hover {
  text-decoration: underline;
}

/* ── DASHBOARD LAYOUT (Part 5.1) ────────────────────────────── */
body.dashboard-body {
  overflow: hidden;
  background: var(--bg-base);
  height: 100vh;
}

.app-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

.topbar {
  height: 52px;
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 var(--space-6);
  gap: var(--space-4);
  flex-shrink: 0;
}

.topbar-brand {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--text-primary);
}

.topbar-badge {
  font-size: var(--text-xs);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 2px 6px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.topbar-divider {
  width: 1px;
  height: 18px;
  background: var(--border);
  flex-shrink: 0;
}

.topbar-incident {
  font-size: var(--text-xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.live-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  flex-shrink: 0;
}

.live-dot.closed {
  background: var(--text-muted);
}

.sla-timer {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
}

.incident-banner {
  height: 44px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 var(--space-6);
  gap: var(--space-4);
  flex-shrink: 0;
}

.incident-banner-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
}

.incident-banner-key {
  color: var(--text-muted);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.incident-banner-val {
  color: var(--text-primary);
  font-weight: 500;
}

.banner-sep {
  width: 1px;
  height: 14px;
  background: var(--border-strong);
  flex-shrink: 0;
}

.main-body {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.sidebar-left {
  width: 260px;
  flex-shrink: 0;
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding: var(--space-6) var(--space-4);
  display: flex;
  flex-direction: column;
}

.feed-panel {
  flex: 1;
  min-width: 0;
  background: var(--bg-base);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.sidebar-right {
  width: 320px;
  flex-shrink: 0;
  background: var(--bg-surface);
  border-left: 1px solid var(--border);
  overflow-y: auto;
  padding: var(--space-6) var(--space-4);
}

/* ── Timeline Section (Part 5.4) ───────────────────────────── */
.sidebar-section-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: var(--space-4);
}

.timeline {
  display: flex;
  flex-direction: column;
}

.timeline-item {
  display: flex;
  gap: var(--space-3);
  padding-bottom: var(--space-5);
  position: relative;
}

.timeline-item:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 9px;
  top: 20px;
  bottom: 0;
  width: 1px;
  background: var(--border);
}

.timeline-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
}
.timeline-dot.pending  { border: 2px solid var(--border); background: var(--bg-surface); }
.timeline-dot.active   { border: 2px solid var(--accent); background: var(--accent-light); }
.timeline-dot.active::after {
  content: ''; width: 8px; height: 8px;
  border-radius: 50%; background: var(--accent);
}
.timeline-dot.complete { background: var(--accent); border: 2px solid var(--accent); }
.timeline-dot.complete::after { content: '✓'; font-size: 10px; color: white; font-weight: 700; }

.timeline-phase {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}
.timeline-phase.pending {
  color: var(--text-muted);
}

.timeline-content {
  flex: 1;
}

.timeline-elapsed {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}
.timeline-elapsed.active {
  color: var(--accent);
  font-style: italic;
}

.revision-history-list {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: var(--space-2);
}

/* ── Feed Panel & Messages (Part 5.5) ──────────────────────── */
.feed-header {
  position: sticky;
  top: 0;
  background: var(--bg-base);
  border-bottom: 1px solid var(--border);
  padding: 0 var(--space-6);
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 10;
  flex-shrink: 0;
}

.feed-header-title {
  font-size: var(--text-base);
  font-weight: 600;
}

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

.message-count-badge {
  font-size: var(--text-xs);
  font-weight: 600;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.export-row {
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
}

.gate-block .sidebar-section-title {
  margin-bottom: var(--space-3);
}

.message-row {
  border-bottom: 1px solid var(--border);
  padding: var(--space-4) var(--space-6);
  display: flex;
  gap: var(--space-3);
  transition: background 150ms;
}
.message-row:hover { background: var(--bg-hover); }
.message-row:nth-child(even) { background: var(--bg-subtle); }
.message-row:nth-child(even):hover { background: var(--bg-hover); }

.msg-border {
  width: 3px;
  border-radius: 2px;
  flex-shrink: 0;
  align-self: stretch;
}
.msg-border.triage      { background: var(--agent-triage); }
.msg-border.forensics   { background: var(--agent-forensics); }
.msg-border.containment { background: var(--agent-containment); }
.msg-border.comms       { background: var(--agent-comms); }
.msg-border.human       { background: var(--agent-human); }
.msg-border.rca         { background: var(--agent-rca); }

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

.msg-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: var(--space-2);
}

.msg-agent {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.msg-agent.triage      { color: var(--agent-triage); }
.msg-agent.forensics   { color: var(--agent-forensics); }
.msg-agent.containment { color: var(--agent-containment); }
.msg-agent.comms       { color: var(--agent-comms); }
.msg-agent.human       { color: var(--agent-human); }
.msg-agent.rca         { color: var(--agent-rca); }

.msg-time {
  font-size: 11px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.msg-text {
  font-size: 14px;
  color: var(--text-primary);
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
}

.msg-code {
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-left: 3px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: var(--space-3) var(--space-4);
  display: block;
  margin-top: var(--space-3);
  line-height: 1.7;
  overflow-x: auto;
  color: var(--text-primary);
}

.gate-row {
  padding: var(--space-3) var(--space-6);
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-size: 13px;
  color: var(--text-secondary);
}
.gate-row.open { color: var(--accent); }

.feed-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--text-muted);
  padding: var(--space-12) 0;
}

@keyframes row-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.6; }
}
.message-row.loading { animation: row-pulse 1.5s ease-in-out infinite; }

/* ── Specialists Section (Part 5.6) ────────────────────────── */
.agent-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-2);
  background: var(--bg-surface);
  box-shadow: var(--shadow-xs);
}

.agent-card-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.agent-dot-name {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.agent-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.agent-dot.triage      { background: var(--agent-triage); }
.agent-dot.forensics   { background: var(--agent-forensics); }
.agent-dot.containment { background: var(--agent-containment); }
.agent-dot.comms       { background: var(--agent-comms); }
.agent-dot.rca         { background: var(--agent-rca); }

.agent-name-text {
  font-size: 13px;
  font-weight: 600;
}

.agent-model-text {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  margin-top: 3px;
}

.status-badge {
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
}
.status-badge.dormant  { color: var(--text-muted);  background: var(--bg-subtle); }
.status-badge.active   { color: var(--info);         background: var(--info-bg); }
.status-badge.complete { color: var(--success);      background: var(--success-bg); }
.status-badge.error    { color: var(--danger);       background: var(--danger-bg); }

.gate-block {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-4);
  margin-top: var(--space-4);
  background: var(--bg-surface);
}

.gate-check {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
}
.gate-check.met   { color: var(--success); }
.gate-check.unmet { color: var(--text-muted); }

.gate-status {
  font-size: 13px;
  font-weight: 500;
  padding-top: var(--space-3);
  border-top: 1px solid var(--border);
  margin-top: var(--space-2);
}
.gate-status.locked { color: var(--text-secondary); }
.gate-status.open   { color: var(--accent); }

.action-card {
  border: 1px solid var(--warning-border);
  border-radius: var(--radius);
  background: var(--warning-bg);
  padding: var(--space-4);
  margin-top: var(--space-4);
  display: none;
}
.action-card.visible {
  display: block;
}

.action-card-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--warning);
  margin-bottom: var(--space-3);
}

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

.revise-input {
  margin-top: var(--space-3);
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-2) var(--space-3);
  font-family: var(--font-sans);
  font-size: 13px;
  resize: vertical;
  min-height: 72px;
  background: var(--bg-surface);
  display: none;
}
.revise-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.action-revision-buttons {
  display: flex;
  gap: var(--space-2);
  justify-content: flex-end;
  margin-top: var(--space-2);
}

/* ── Alert Drawer (Part 5.7) ───────────────────────────────── */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay-bg);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms;
}
.drawer-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 420px;
  background: var(--bg-surface);
  border-left: 1px solid var(--border-strong);
  z-index: 201;
  padding: var(--space-6);
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 220ms cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}
.drawer.open {
  transform: translateX(0);
}

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

.drawer-title {
  font-size: var(--text-lg);
  font-weight: 700;
}

.drawer-close {
  background: none;
  border: none;
  font-size: var(--text-lg);
  color: var(--text-muted);
  cursor: pointer;
}
.drawer-close:hover {
  color: var(--text-primary);
}

.field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.field-label {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.field-input, .field-textarea {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-2) var(--space-3);
  font-family: var(--font-sans);
  font-size: 13px;
  background: var(--bg-surface);
  color: var(--text-primary);
  width: 100%;
}
.field-input:focus, .field-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.field-textarea {
  resize: vertical;
  min-height: 80px;
}

.scenario-chips {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.scenario-chip {
  padding: var(--space-1) var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-surface);
  font-size: var(--text-xs);
  font-weight: 500;
  cursor: pointer;
}
.scenario-chip:hover {
  background: var(--bg-subtle);
}
.scenario-chip.selected {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--accent);
}

.download-success-msg {
  font-size: 12px;
  color: var(--success);
  margin-left: var(--space-2);
}

/* ── Incident Selector on Left Sidebar ────────────────────── */
.incident-selector {
  margin-bottom: var(--space-6);
}

.incident-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.incident-list-item {
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: var(--text-sm);
  color: var(--text-secondary);
  border: 1px solid transparent;
}
.incident-list-item:hover {
  background: var(--bg-hover);
}
.incident-list-item.active {
  background: var(--accent-light);
  border-color: var(--accent-border);
  color: var(--accent);
  font-weight: 600;
}

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

.incident-list-state {
  font-size: var(--text-2xs);
  text-transform: uppercase;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}
.incident-list-state.open {
  background: var(--info-bg);
  color: var(--info);
}
.incident-list-state.closed {
  background: var(--success-bg);
  color: var(--success);
}
.incident-list-state.pending_approval {
  background: var(--warning-bg);
  color: var(--warning);
}

/* ── Scrollbars ────────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}
