/* ═══════════════════════════════════════════════════════════════════════════
   SOC Analyst Deep Agent — Dashboard Stylesheet
   Palette: deep navy base, cyan/indigo accents, crimson/emerald for verdicts
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  --bg-0: #0a0f1e;
  --bg-1: #0f172a;
  --bg-2: #172033;
  --bg-3: #1e293b;
  --bg-deep: #0b1220;
  --bg-card: #0f172a;
  --bg-input: #0b1220;
  --bg-tooltip: #0f172a;
  --border: #243049;
  --border-soft: #1c2740;
  --text-0: #f1f5f9;
  --text-1: #cbd5e1;
  --text-2: #94a3b8;
  --text-3: #64748b;

  --cyan: #22d3ee;
  --cyan-d: #0891b2;
  --indigo: #818cf8;
  --indigo-d: #6366f1;
  --violet: #a78bfa;
  --emerald: #10b981;
  --emerald-l: #34d399;
  --crimson: #ef4444;
  --crimson-l: #f87171;
  --amber: #f59e0b;

  --shadow-lg: 0 20px 40px -20px rgba(0, 0, 0, 0.6), 0 8px 18px -10px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 8px 20px -8px rgba(0, 0, 0, 0.5);
  --radius: 14px;
  --radius-sm: 8px;
}


/* Brand subtitle chip */
.brand-sub {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
  margin-left: 6px;
  opacity: 0.85;
}

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

html, body {
  background: var(--bg-0);
  color: var(--text-0);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  line-height: 1.55;
  min-height: 100vh;
}

body {
  background:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(129, 140, 248, 0.12), transparent 70%),
    radial-gradient(ellipse 60% 40% at 90% 10%, rgba(34, 211, 238, 0.08), transparent 70%),
    var(--bg-0);
}

code, pre, .mono { font-family: 'JetBrains Mono', 'Consolas', monospace; }

/* ═══════════════════════ HEADER ═══════════════════════ */
.site-header {
  background:
    linear-gradient(135deg, rgba(129, 140, 248, 0.15) 0%, rgba(34, 211, 238, 0.08) 50%, rgba(167, 139, 250, 0.12) 100%),
    linear-gradient(180deg, #0f172a 0%, #0a0f1e 100%);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(10px);
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 28px 32px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

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

.brand-mark {
  display: grid; place-items: center;
  width: 64px; height: 64px;
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.15), rgba(129, 140, 248, 0.2));
  border: 1px solid rgba(34, 211, 238, 0.3);
  border-radius: 14px;
  box-shadow: 0 0 24px rgba(34, 211, 238, 0.15), inset 0 1px 0 rgba(255,255,255,0.08);
}

.brand-text h1 {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand-text .accent {
  background: linear-gradient(90deg, var(--cyan), var(--indigo), var(--violet));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand-text .subtitle {
  font-size: 12.5px;
  color: var(--text-2);
  margin-top: 3px;
  font-weight: 500;
}

.header-meta {
  display: flex; flex-direction: column; gap: 6px; align-items: flex-end;
}

.tag {
  display: inline-block;
  padding: 5px 12px;
  background: rgba(129, 140, 248, 0.12);
  color: var(--indigo);
  border: 1px solid rgba(129, 140, 248, 0.3);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.tag-alt {
  background: rgba(34, 211, 238, 0.1);
  color: var(--cyan);
  border-color: rgba(34, 211, 238, 0.3);
}

/* Header strip */
.header-strip {
  max-width: 1400px;
  margin: 0 auto;
  padding: 12px 32px 22px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}

.strip-item {
  display: flex; flex-direction: column; gap: 2px;
  padding: 10px 14px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border);
  border-radius: 10px;
  backdrop-filter: blur(4px);
}

.strip-k {
  font-size: 10.5px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.strip-v {
  font-size: 13.5px;
  color: var(--text-0);
  font-weight: 700;
}
.strip-v.highlight {
  background: linear-gradient(90deg, var(--emerald-l), var(--cyan));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ═══════════════════════ MAIN TABS ═══════════════════════ */
.main-tabs {
  max-width: 1400px;
  margin: 24px auto 0;
  padding: 0 32px;
  display: flex;
  gap: 6px;
  border-bottom: 1px solid var(--border);
}
.main-tab {
  background: transparent;
  border: none;
  color: var(--text-dim, #94a3b8);
  font: 600 14px/1 'Inter', sans-serif;
  letter-spacing: 0.02em;
  padding: 14px 22px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.main-tab:hover {
  color: #e2e8f0;
}
.main-tab.active {
  color: #22d3ee;
  border-bottom-color: #22d3ee;
}
.main-panel { display: none; }
.main-panel.active { display: block; }

/* ═══════════════════════ MAIN GRID ═══════════════════════ */
.grid {
  max-width: 1400px;
  margin: 28px auto;
  padding: 0 32px;
  display: grid;
  grid-template-columns: 1.05fr 1.15fr;
  gap: 24px;
}
.grid.grid-single {
  grid-template-columns: 1fr;
}

/* ═══════════════════════ ABOUT PANEL ═══════════════════════ */
.about-body {
  color: #cbd5e1;
  font: 400 15px/1.65 'Inter', sans-serif;
}
.about-body h3 {
  color: #22d3ee;
  font: 700 14px/1 'Inter', sans-serif;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 22px 0 10px;
}
.about-body p { margin: 0 0 12px; }
.about-body code {
  background: rgba(34, 211, 238, 0.08);
  border: 1px solid rgba(34, 211, 238, 0.22);
  border-radius: 4px;
  padding: 1px 6px;
  font: 500 13px/1 'JetBrains Mono', monospace;
  color: #67e8f9;
}
.about-list {
  margin: 0 0 12px;
  padding-left: 20px;
}
.about-list li { margin-bottom: 6px; }
.about-footnote {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  color: #94a3b8;
  font-size: 13px;
}

/* ═══════════════════════ INPUT HELPER (under textarea) ═══════════════════════ */
.input-helper {
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.4);
}
.input-helper-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.json-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font: 600 12px/1 'Inter', sans-serif;
}
.json-status .js-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #475569;
  box-shadow: 0 0 0 2px rgba(71, 85, 105, 0.2);
  flex-shrink: 0;
}
.json-status-empty .js-text { color: #94a3b8; }
.json-status-empty .js-dot  { background: #475569; }
.json-status-ok    .js-text { color: #86efac; }
.json-status-ok    .js-dot  { background: #22c55e; box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.25); }
.json-status-error .js-text { color: #fca5a5; }
.json-status-error .js-dot  { background: #ef4444; box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.25); }

.input-helper-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}
.example-picker {
  background: #0b1220;
  color: #cbd5e1;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  font: 500 12px/1 'Inter', sans-serif;
  cursor: pointer;
}
.example-picker:focus {
  outline: none;
  border-color: #22d3ee;
}

.field-checklist {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: center;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.fc-label {
  color: #94a3b8;
  font: 600 11px/1 'Inter', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.fc-item {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #64748b;
  font: 500 12px/1 'JetBrains Mono', monospace;
  transition: color 0.15s ease;
}
.fc-item .fc-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #475569;
  flex-shrink: 0;
}
.fc-item.fc-present {
  color: #86efac;
}
.fc-item.fc-present .fc-dot {
  background: #22c55e;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2);
}

/* ═══════════════════════ REPORTS PANEL ═══════════════════════ */
.gen-desc {
  color: #94a3b8;
  font: 400 13px/1.55 'Inter', sans-serif;
  margin: 0 0 16px;
}
.gen-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 14px;
}
.gen-option {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
  background: rgba(15, 23, 42, 0.4);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.gen-option:hover {
  border-color: rgba(34, 211, 238, 0.35);
  transform: translateY(-1px);
}
.gen-option-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.gen-option-head h3 {
  color: #e2e8f0;
  font: 700 15px/1 'Inter', sans-serif;
  margin: 0;
}
.gen-badge {
  padding: 3px 10px;
  border-radius: 4px;
  font: 700 10px/1 'Inter', sans-serif;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  flex-shrink: 0;
}
.gen-badge-summary {
  color: #bae6fd;
  background: rgba(14, 165, 233, 0.15);
  border: 1px solid rgba(14, 165, 233, 0.4);
}
.gen-badge-full {
  color: #ddd6fe;
  background: rgba(129, 140, 248, 0.15);
  border: 1px solid rgba(129, 140, 248, 0.4);
}
.gen-option-list {
  margin: 0;
  padding-left: 18px;
  color: #cbd5e1;
  font: 400 13px/1.6 'Inter', sans-serif;
}
.gen-option button {
  align-self: flex-start;
  margin-top: 4px;
}
.gen-option button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.gen-hint {
  color: #94a3b8;
  font: 500 12px/1.4 'Inter', sans-serif;
  margin: 0;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.report-actions {
  display: flex;
  gap: 8px;
}
.report-actions {
  display: flex;
  gap: 8px;
}
.reports-empty {
  color: #94a3b8;
  font: 400 14px/1.5 'Inter', sans-serif;
  text-align: center;
  padding: 32px 8px;
}
.reports-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
}
.reports-list.hidden { display: none; }
.report-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.4);
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.report-row:hover {
  border-color: rgba(34, 211, 238, 0.35);
  transform: translateX(2px);
}
.report-row-main { min-width: 0; flex: 1; }
.report-id {
  color: #e2e8f0;
  font: 600 14px/1.2 'JetBrains Mono', monospace;
  margin-bottom: 6px;
}
.report-meta {
  display: flex;
  gap: 14px;
  color: #94a3b8;
  font: 500 12px/1 'Inter', sans-serif;
}
.report-verdict {
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.report-verdict.malicious {
  color: #fecaca;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
}
.report-verdict.benign {
  color: #bbf7d0;
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.35);
}
.report-row-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.reports-preview-wrap {
  border-top: 1px solid var(--border);
  padding-top: 16px;
}
.reports-preview-wrap.hidden { display: none; }
.reports-preview-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 10px;
}
.reports-preview-head h3 {
  color: #22d3ee;
  font: 700 13px/1 'Inter', sans-serif;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin: 0;
}
.preview-name {
  color: #64748b;
  font: 500 11px/1 'JetBrains Mono', monospace;
}
.reports-preview {
  max-height: 560px;
  overflow: auto;
  padding: 14px 16px;
  background: #0b1220;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: #cbd5e1;
  font: 500 12px/1.55 'JetBrains Mono', monospace;
  white-space: pre;
}

/* ═══════════════════════ RISK THRESHOLD CARD ═══════════════════════ */
.mal-text { color: #f87171; }
.ben-text { color: #4ade80; }

.threshold-desc {
  color: #94a3b8;
  font: 400 13px/1.55 'Inter', sans-serif;
  margin: 0 0 14px;
}
.threshold-slider-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.threshold-end {
  font: 600 12px/1 'JetBrains Mono', monospace;
  flex-shrink: 0;
}
#threshold-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(90deg, #22c55e 0%, #eab308 50%, #ef4444 100%);
  outline: none;
  cursor: pointer;
}
#threshold-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #e2e8f0;
  border: 2px solid #22d3ee;
  box-shadow: 0 0 0 2px rgba(34, 211, 238, 0.25);
  cursor: pointer;
  transition: transform 0.1s ease;
}
#threshold-slider::-webkit-slider-thumb:hover { transform: scale(1.15); }
#threshold-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #e2e8f0;
  border: 2px solid #22d3ee;
  cursor: pointer;
}
.threshold-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 12px;
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.tm {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: center;
}
.tm span {
  font: 500 11px/1 'Inter', sans-serif;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.tm b {
  font: 700 16px/1 'JetBrains Mono', monospace;
  color: #e2e8f0;
}
.threshold-pr {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.threshold-pr.hidden { display: none; }
.threshold-pr h3 {
  color: #22d3ee;
  font: 700 12px/1 'Inter', sans-serif;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin: 0 0 10px;
}
.pr-hint {
  color: #64748b;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  font-size: 11px;
}
.pr-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.pr-kv {
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.pr-kv span {
  font: 500 10px/1 'Inter', sans-serif;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.pr-kv b {
  font: 700 14px/1 'JetBrains Mono', monospace;
  color: #e2e8f0;
}

/* ═══════════════════════ TOP SIGNALS CARD ═══════════════════════ */
.signals-card .signals-empty {
  color: #94a3b8;
  font: 400 14px/1.5 'Inter', sans-serif;
  text-align: center;
  padding: 24px 8px;
}
.signals-list {
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.signals-list.hidden { display: none; }
.signal-row {
  border: 1px solid var(--border);
  border-left-width: 3px;
  border-radius: 10px;
  padding: 10px 14px 12px;
  background: rgba(15, 23, 42, 0.4);
  transition: transform 0.15s ease;
}
.signal-row:hover { transform: translateX(2px); }
.signal-row.malicious { border-left-color: #ef4444; }
.signal-row.benign    { border-left-color: #22c55e; }
.signal-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.signal-sign {
  font: 700 16px/1 'JetBrains Mono', monospace;
  width: 18px;
  text-align: center;
  flex-shrink: 0;
}
.signal-row.malicious .signal-sign { color: #ef4444; }
.signal-row.benign    .signal-sign { color: #22c55e; }
.signal-label {
  flex: 1;
  color: #e2e8f0;
  font: 500 14px/1.35 'Inter', sans-serif;
}
.signal-score {
  font: 600 13px/1 'JetBrains Mono', monospace;
  padding: 3px 8px;
  border-radius: 6px;
  flex-shrink: 0;
}
.signal-row.malicious .signal-score {
  color: #fecaca;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
}
.signal-row.benign .signal-score {
  color: #bbf7d0;
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.35);
}
.signal-bar {
  margin-top: 8px;
  height: 4px;
  border-radius: 2px;
  background: rgba(148, 163, 184, 0.15);
  overflow: hidden;
}
.signal-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.35s ease;
}
.signal-row.malicious .signal-bar-fill {
  background: linear-gradient(90deg, #f87171, #ef4444);
}
.signal-row.benign .signal-bar-fill {
  background: linear-gradient(90deg, #4ade80, #22c55e);
}

.col-left, .col-right {
  display: flex; flex-direction: column; gap: 20px;
}

/* ═══════════════════════ CARDS ═══════════════════════ */
.card {
  background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow-md);
}

.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-soft);
  gap: 10px;
}

.card-header h2 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-0);
  letter-spacing: -0.01em;
}

.card-actions {
  display: flex; gap: 10px; margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-soft);
}

/* Pills */
.pill {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.pill-green { background: rgba(16, 185, 129, 0.15); color: var(--emerald-l); border: 1px solid rgba(16, 185, 129, 0.3); }
.pill-muted { background: rgba(148, 163, 184, 0.12); color: var(--text-2); border: 1px solid var(--border); }

/* ═══════════════════════ MODEL CARDS ═══════════════════════ */
.model-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.model-card {
  position: relative;
  display: block;
  background: rgba(10, 15, 30, 0.5);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.model-card:hover {
  border-color: rgba(34, 211, 238, 0.4);
  background: rgba(10, 15, 30, 0.8);
}
.model-card.selected {
  border-color: var(--cyan);
  background: linear-gradient(180deg, rgba(34, 211, 238, 0.12), rgba(34, 211, 238, 0.03));
  box-shadow: 0 0 0 1px rgba(34, 211, 238, 0.2), 0 0 24px rgba(34, 211, 238, 0.15);
}
.model-card input { position: absolute; opacity: 0; pointer-events: none; }

.model-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 8px;
  gap: 8px;
}

.model-label {
  font-size: 13.5px; font-weight: 700;
  color: var(--text-0);
}

.model-badge {
  font-size: 9.5px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: 0.05em;
}
.badge-primary { background: rgba(16, 185, 129, 0.2); color: var(--emerald-l); border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-secondary { background: rgba(245, 158, 11, 0.15); color: var(--amber); border: 1px solid rgba(245, 158, 11, 0.3); }

.model-stats {
  display: flex; flex-wrap: wrap; gap: 10px;
  font-size: 11px;
  color: var(--text-2);
  margin-bottom: 6px;
}
.model-stats b { color: var(--text-0); font-weight: 600; }

.model-note {
  font-size: 11px;
  color: var(--text-3);
  line-height: 1.45;
}

/* ═══════════════════════ INPUT TABS ═══════════════════════ */
.tabs { display: flex; gap: 4px; }

.tab {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-2);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.tab:hover { color: var(--text-0); border-color: rgba(34, 211, 238, 0.4); }
.tab.active {
  background: rgba(34, 211, 238, 0.15);
  color: var(--cyan);
  border-color: var(--cyan);
}

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

textarea#alert-json {
  width: 100%;
  min-height: 240px;
  background: var(--bg-0);
  color: var(--text-0);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  line-height: 1.65;
  resize: vertical;
}
textarea#alert-json:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.1); }

/* Sample selector */
.sample-controls {
  display: flex; gap: 8px; margin-bottom: 10px;
}
.sample-controls input, .sample-controls select {
  background: var(--bg-0);
  color: var(--text-0);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12px;
  font-family: inherit;
}
.sample-controls input { flex: 1; }

.sample-list {
  max-height: 240px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-0);
}
.sample-row {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-soft);
  cursor: pointer;
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px;
  transition: background 0.1s;
}
.sample-row:last-child { border-bottom: none; }
.sample-row:hover { background: rgba(34, 211, 238, 0.06); }
.sample-row.selected { background: rgba(34, 211, 238, 0.14); border-left: 3px solid var(--cyan); }
.sample-id { font-family: 'JetBrains Mono', monospace; font-weight: 600; color: var(--cyan); }
.sample-evt { color: var(--text-1); }
.sample-label {
  font-size: 10px; font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
}
.sample-label.Malicious { background: rgba(239, 68, 68, 0.15); color: var(--crimson-l); }
.sample-label.Benign { background: rgba(16, 185, 129, 0.15); color: var(--emerald-l); }

/* Batch */
.batch-drop {
  padding: 16px;
  background: var(--bg-0);
  border: 1px dashed var(--border);
  border-radius: 10px;
  display: flex; flex-direction: column; gap: 10px;
}
.batch-drop p { color: var(--text-2); font-size: 12px; }
.batch-drop code { background: var(--bg-3); padding: 1px 6px; border-radius: 4px; color: var(--cyan); font-size: 11px; }
.batch-drop input[type="file"] {
  background: var(--bg-1);
  color: var(--text-1);
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
}

.batch-results {
  margin-top: 12px;
  max-height: 300px;
  overflow-y: auto;
}
.batch-row {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-soft);
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px;
}
.batch-row:last-child { border: none; }

/* ═══════════════════════ BUTTONS ═══════════════════════ */
.btn {
  padding: 9px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-3);
  color: var(--text-0);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.btn:hover { border-color: var(--cyan); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(135deg, var(--cyan), var(--indigo-d));
  border-color: var(--cyan);
  color: #0a0f1e;
  box-shadow: 0 4px 20px -4px rgba(34, 211, 238, 0.5);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 24px -4px rgba(34, 211, 238, 0.7); }

.btn-lg { padding: 12px 22px; font-size: 13.5px; }
.btn-sm { padding: 6px 12px; font-size: 11px; }
.btn-ghost { background: transparent; }
.btn-icon { font-size: 14px; }

/* ═══════════════════════ VERDICT CARD ═══════════════════════ */
.verdict-card { min-height: 280px; }

.verdict-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 40px 20px;
  color: var(--text-3);
  text-align: center;
  gap: 12px;
}
.verdict-empty p { font-size: 13px; }

.verdict-full.hidden, .verdict-empty.hidden { display: none; }

.verdict-badge-row {
  display: flex; align-items: center; gap: 20px;
  margin-bottom: 20px;
}

.verdict-badge {
  font-size: 22px;
  font-weight: 800;
  padding: 14px 28px;
  border-radius: 12px;
  letter-spacing: 0.02em;
  min-width: 180px;
  text-align: center;
}
.verdict-badge.malicious {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(239, 68, 68, 0.1));
  color: var(--crimson-l);
  border: 1.5px solid rgba(239, 68, 68, 0.5);
  box-shadow: 0 0 32px rgba(239, 68, 68, 0.25), inset 0 1px 0 rgba(255,255,255,0.05);
  text-shadow: 0 0 12px rgba(239, 68, 68, 0.5);
}
.verdict-badge.benign {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(16, 185, 129, 0.1));
  color: var(--emerald-l);
  border: 1.5px solid rgba(16, 185, 129, 0.5);
  box-shadow: 0 0 32px rgba(16, 185, 129, 0.25), inset 0 1px 0 rgba(255,255,255,0.05);
  text-shadow: 0 0 12px rgba(16, 185, 129, 0.5);
}

.verdict-badge-stack {
  display: flex; flex-direction: column; gap: 10px; align-items: center;
}

.severity-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  font: 700 11px/1 'Inter', sans-serif;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: 1px solid transparent;
}
.severity-badge[hidden] { display: none; }
.severity-badge .sev-dot {
  width: 8px; height: 8px; border-radius: 50%;
}
.severity-badge.sev-high {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.45);
  color: var(--crimson-l);
}
.severity-badge.sev-high .sev-dot {
  background: #ef4444;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.7);
}
.severity-badge.sev-med {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.45);
  color: #fcd34d;
}
.severity-badge.sev-med .sev-dot {
  background: #f59e0b;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.7);
}
.severity-badge.sev-low {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.45);
  color: var(--emerald-l);
}
.severity-badge.sev-low .sev-dot {
  background: #10b981;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.7);
}

.verdict-confidence {
  flex: 1;
  display: flex; flex-direction: column; gap: 6px;
}
.meter-row {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-top: 4px;
}
.meter-caption {
  font: 600 10px/1 'Inter', sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
}
.gauge-track {
  height: 10px;
  background: var(--bg-0);
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
}
.gauge-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--emerald), var(--cyan), var(--crimson));
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.risk-track {
  height: 10px;
  background: var(--bg-0);
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
}
.risk-fill {
  height: 100%;
  width: 0%;
  background: #10b981;
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1), background 0.3s ease;
}
.risk-fill.sev-high { background: #ef4444; box-shadow: 0 0 12px rgba(239, 68, 68, 0.4); }
.risk-fill.sev-med  { background: #f59e0b; box-shadow: 0 0 12px rgba(245, 158, 11, 0.4); }
.risk-fill.sev-low  { background: #10b981; box-shadow: 0 0 12px rgba(16, 185, 129, 0.4); }
.gauge-value {
  font-size: 16px;
  font-weight: 800;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-0);
}

.verdict-meta {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 16px;
  padding: 12px;
  background: var(--bg-0);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.vm {
  display: flex; flex-direction: column; gap: 2px;
  text-align: center;
}
.vm span {
  font-size: 10px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}
.vm b {
  font-size: 13px;
  color: var(--text-0);
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
}

.verdict-reasoning {
  padding: 14px;
  background: var(--bg-0);
  border: 1px solid var(--border);
  border-radius: 10px;
  border-left: 3px solid var(--cyan);
}
.verdict-reasoning h3 {
  font-size: 11px;
  color: var(--cyan);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
  font-weight: 700;
}
.verdict-reasoning p {
  font-size: 12.5px;
  color: var(--text-1);
  line-height: 1.65;
}

/* ═══════════════════════ NEW HERO LAYOUT + CHIPS + COLLAPSIBLE REASONING ═══════════════════════ */

/* Tab icon + card-title icon */
.tab-ico {
  width: 15px; height: 15px;
  vertical-align: -3px;
  margin-right: 6px;
}
.card-ico {
  width: 18px; height: 18px;
  vertical-align: -4px;
  margin-right: 8px;
  color: var(--cyan);
}
.main-tab { display: inline-flex; align-items: center; gap: 2px; }

/* Verdict hero (big badge + severity badge, centered) */
.verdict-hero {
  display: flex; flex-direction: column; align-items: center;
  gap: 14px;
  padding: 24px 16px 22px;
  margin-bottom: 22px;
  background: radial-gradient(ellipse at center, rgba(34, 211, 238, 0.04), transparent 70%);
  border-bottom: 1px solid var(--border);
}
.verdict-hero .verdict-badge {
  font-size: 30px;
  padding: 18px 40px;
  min-width: 240px;
  letter-spacing: 0.04em;
}
.verdict-hero .severity-badge {
  font-size: 12px;
  padding: 7px 16px;
}
.severity-badge .sev-ico {
  width: 13px; height: 13px;
}

/* Stacked meters with clear separation */
.meters {
  display: flex; flex-direction: column; gap: 16px;
  margin-bottom: 22px;
}
.meter { display: flex; flex-direction: column; gap: 6px; }

/* Spacing lift on meta + reasoning */
.verdict-meta {
  margin-bottom: 22px;
}

/* Collapsible reasoning summary (on verdict card) */
.reasoning-summary {
  padding: 16px;
  background: var(--bg-0);
  border: 1px solid var(--border);
  border-radius: 10px;
  border-left: 3px solid var(--cyan);
}
.rs-head {
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 10px;
}
.rs-head h3 {
  font-size: 11px;
  color: var(--cyan);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  margin: 0;
}
.rs-ico {
  width: 14px; height: 14px;
  color: var(--cyan);
}
.rs-text {
  font-size: 12.5px;
  color: var(--text-1);
  line-height: 1.65;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 10px;
}
.rs-cta {
  display: inline-flex; align-items: center;
  font-weight: 600;
  color: var(--cyan);
  padding: 4px 0;
}
.rs-cta:hover { color: var(--text-0); text-decoration: underline; }

/* Overview grid: mix of full-width hero cards + 2-column bottom row */
.grid-overview {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 20px;
}
.ov-hero-card, .ov-exec-card, .ov-tiles-card { grid-column: 1 / -1; }
@media (max-width: 980px) {
  .grid-overview { grid-template-columns: 1fr; }
}

/* ─── Hero verdict card ─── */
.ov-hero-wrap {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 32px;
  padding: 14px 8px 6px;
}
.ov-hero-wrap.hidden { display: none; }
.ov-hero-badges {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.ov-hero-badges .verdict-badge {
  font-size: 28px;
  padding: 16px 36px;
  min-width: 220px;
}
.ov-hero-badges .severity-badge {
  font-size: 12px;
  padding: 7px 16px;
}
.ov-hero-meters {
  display: flex; flex-direction: column; gap: 18px;
}
@media (max-width: 720px) {
  .ov-hero-wrap { grid-template-columns: 1fr; gap: 20px; }
  .ov-hero-badges .verdict-badge { min-width: 0; font-size: 24px; padding: 14px 28px; }
}

/* ─── Executive summary card (reuses assess-wrap styling) ─── */
.ov-exec-wrap {
  display: flex; align-items: center; gap: 18px;
  padding: 18px 22px;
  background: var(--bg-0);
  border: 1px solid var(--border);
  border-radius: 12px;
  border-left: 4px solid var(--cyan);
}
.ov-exec-wrap.hidden { display: none; }
.ov-exec-wrap.verdict-benign    { border-left-color: #10b981; }
.ov-exec-wrap.verdict-malicious { border-left-color: #ef4444; }
.ov-exec-wrap .assess-icon { flex-shrink: 0; width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; border-radius: 50%; }
.ov-exec-wrap .assess-icon svg { width: 28px; height: 28px; }
.ov-exec-wrap.verdict-benign    .assess-icon { background: rgba(16, 185, 129, 0.12); color: #10b981; box-shadow: 0 0 22px rgba(16, 185, 129, 0.22); }
.ov-exec-wrap.verdict-malicious .assess-icon { background: rgba(239, 68, 68, 0.12); color: #ef4444; box-shadow: 0 0 22px rgba(239, 68, 68, 0.26); }
.ov-exec-wrap .assess-text {
  font: 500 14.5px/1.6 'Inter', sans-serif;
  color: var(--text-1);
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  word-break: normal;
  overflow-wrap: break-word;
  -webkit-line-clamp: initial;
}
.assess-text {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  overflow-wrap: break-word;
  -webkit-line-clamp: initial;
}

/* ─── Alert identity tiles ─── */
.ov-tile-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  padding: 8px 4px 4px;
}
.ov-tile-grid.hidden { display: none; }
.ov-tile {
  padding: 12px 14px;
  background: var(--bg-0);
  border: 1px solid var(--border);
  border-radius: 10px;
  display: flex; flex-direction: column; gap: 6px;
  transition: border-color 0.15s ease;
}
.ov-tile:hover { border-color: rgba(34, 211, 238, 0.35); }
.ov-tile-label {
  font: 700 10px/1 'Inter', sans-serif;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.ov-tile b {
  font: 700 13px/1.25 'JetBrains Mono', monospace;
  color: var(--text-0);
  word-break: break-all;
}
@media (max-width: 900px) { .ov-tile-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .ov-tile-grid { grid-template-columns: 1fr; } }

/* Signal chips (color-coded by contribution magnitude, direction) */
.chips-list {
  display: flex; flex-wrap: wrap; gap: 10px;
  padding: 4px 2px;
}
.chips-list.hidden { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  border-radius: 18px;
  font: 600 12px/1.35 'Inter', sans-serif;
  border: 1px solid var(--border);
  background: var(--bg-0);
  color: var(--text-1);
  white-space: normal;
  max-width: 100%;
  transition: transform 0.15s ease;
}
.chip-label {
  overflow-wrap: break-word;
  word-break: normal;
}
.chip:hover { transform: translateY(-1px); }
.chip .chip-sign {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 800;
  opacity: 0.85;
}
.chip .chip-score {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
}
/* Impact tiers — high (red), med (amber), low (gray) */
.chip.impact-high {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.45);
  color: var(--crimson-l);
  box-shadow: 0 0 14px rgba(239, 68, 68, 0.12);
}
.chip.impact-high .chip-score { background: rgba(239, 68, 68, 0.18); }
.chip.impact-med {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.45);
  color: #fcd34d;
}
.chip.impact-med .chip-score { background: rgba(245, 158, 11, 0.18); }
.chip.impact-low {
  background: var(--bg-0);
  border-color: var(--border);
  color: var(--text-2);
}
/* Direction aware: benign-positive signals get emerald tint on any tier */
.chip.dir-benign.impact-high {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.45);
  color: var(--emerald-l);
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.12);
}
.chip.dir-benign.impact-high .chip-score { background: rgba(16, 185, 129, 0.18); }
.chip.dir-benign.impact-med {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.35);
  color: var(--emerald-l);
}

/* Signals legend — explains + / − / color coding */
.signals-legend {
  margin-top: 14px;
  padding: 12px 14px;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid var(--border);
  border-radius: 10px;
  display: flex; flex-direction: column; gap: 8px;
  font: 500 11.5px/1.4 'Inter', sans-serif;
  color: var(--text-2);
}
.sl-group { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
.sl-item  { display: inline-flex; align-items: center; gap: 6px; }
.sl-item b {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 800;
  font-size: 13px;
  color: var(--text-0);
  padding: 0 4px;
}
.sl-dot {
  display: inline-block;
  width: 12px; height: 12px;
  border-radius: 50%;
  border: 1px solid transparent;
}
.sl-dot.sl-high { background: #dc2626; border-color: rgba(239,68,68,0.6); box-shadow: 0 0 8px rgba(239,68,68,0.3); }
.sl-dot.sl-med  { background: #f59e0b; border-color: rgba(245,158,11,0.6); box-shadow: 0 0 8px rgba(245,158,11,0.3); }
.sl-dot.sl-low  { background: #64748b; border-color: rgba(100,116,139,0.6); }
.sl-hint {
  font-size: 11px;
  color: var(--text-3);
  font-style: italic;
  padding-top: 4px;
  border-top: 1px dashed var(--border);
}

/* Full reasoning on Analysis tab */
.reasoning-empty { padding: 24px; color: var(--text-3); text-align: center; font-size: 13px; }
.reasoning-full {
  padding: 18px 20px;
  background: var(--bg-0);
  border: 1px solid var(--border);
  border-radius: 10px;
  border-left: 3px solid var(--cyan);
  font-size: 13.5px;
  color: var(--text-1);
  line-height: 1.75;
  white-space: pre-wrap;
}
.reasoning-full.hidden { display: none; }

/* ═══════════════════════ VISUALIZATION TAB ═══════════════════════ */
.grid-viz {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.viz-gauge-card  { grid-column: 1 / 2; }
.viz-donut-card  { grid-column: 2 / 3; }
.viz-flow-card   { grid-column: 1 / -1; }
.viz-bars-card   { grid-column: 1 / -1; }
.viz-assess-card { grid-column: 1 / -1; }
@media (max-width: 1100px) {
  .grid-viz { grid-template-columns: 1fr; }
  .viz-gauge-card, .viz-donut-card, .viz-flow-card, .viz-bars-card, .viz-assess-card { grid-column: auto; }
}

.viz-empty {
  padding: 28px 20px;
  color: var(--text-3);
  text-align: center;
  font-size: 13px;
}
.hidden { display: none; }

/* ── Risk Gauge ── */
.gauge-wrap {
  display: flex; flex-direction: column; align-items: center;
  padding: 10px 8px 18px;
  position: relative;
}
.risk-gauge { width: 100%; max-width: 360px; height: auto; display: block; margin: 0 auto; }

/* Big number + caption are now inside the SVG (reliable positioning) */
.gauge-pct-svg {
  font: 800 36px/1 'JetBrains Mono', monospace;
  fill: #f1f5f9;
  letter-spacing: -0.02em;
  paint-order: stroke;
  filter: drop-shadow(0 0 10px rgba(34, 211, 238, 0.18));
}
.gauge-caption-svg {
  font: 700 10px/1 'Inter', sans-serif;
  fill: #64748b;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.gauge-severity {
  margin-top: 18px;
  padding: 8px 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  font: 800 18px/1 'Inter', sans-serif;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.gauge-severity.sev-high {
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.5);
  box-shadow: 0 0 22px rgba(239, 68, 68, 0.15);
  text-shadow: 0 0 14px rgba(239, 68, 68, 0.45);
}
.gauge-severity.sev-med {
  color: #fcd34d;
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.5);
  box-shadow: 0 0 22px rgba(245, 158, 11, 0.12);
  text-shadow: 0 0 14px rgba(245, 158, 11, 0.4);
}
.gauge-severity.sev-low {
  color: #6ee7b7;
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.5);
  box-shadow: 0 0 22px rgba(16, 185, 129, 0.1);
  text-shadow: 0 0 14px rgba(16, 185, 129, 0.35);
}
.gauge-tagline {
  margin-top: 14px;
  max-width: 320px;
  text-align: center;
  font: 500 12.5px/1.55 'Inter', sans-serif;
  color: var(--text-2);
}

.gauge-legend {
  display: flex; gap: 14px; flex-wrap: wrap;
  justify-content: center;
  margin-top: 18px;
  font: 600 10px/1 'Inter', sans-serif;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.gl-item { display: inline-flex; align-items: center; gap: 5px; }
.gl-dot  { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }

/* ── Signal Distribution Donut ── */
.donut-wrap {
  display: flex; align-items: center; gap: 24px;
  padding: 20px 12px;
  flex-wrap: wrap;
  justify-content: center;
}
.donut-svg { width: 280px; height: 280px; flex-shrink: 0; }
.donut-svg circle[stroke-width] { filter: drop-shadow(0 0 6px currentColor); }
.donut-segment {
  transition: stroke-dashoffset 0.8s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.15s ease;
}
.donut-segment:hover { opacity: 0.85; }
.donut-legend {
  list-style: none;
  margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 8px;
  flex: 1 1 140px;
  min-width: 140px;
  max-width: 220px;
  font: 500 12px/1.3 'Inter', sans-serif;
}
.donut-legend li {
  display: grid;
  grid-template-columns: 12px 1fr auto;
  gap: 8px;
  align-items: center;
  color: var(--text-1);
  padding: 4px 0;
}
.donut-legend .dl-swatch {
  width: 12px; height: 12px;
  border-radius: 3px;
}
.donut-legend .dl-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.donut-legend .dl-pct {
  font: 700 11px/1 'JetBrains Mono', monospace;
  color: var(--text-3);
}

/* ── Attack Flow ── */
.flow-wrap {
  display: flex; align-items: stretch; gap: 6px;
  padding: 10px 6px;
  flex-wrap: wrap;
  justify-content: center;
}
.flow-node {
  flex: 0 1 110px;
  min-width: 100px;
  max-width: 130px;
  padding: 10px 8px;
  background: var(--bg-0);
  border: 1px solid var(--border);
  border-radius: 10px;
  text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.flow-node:hover { box-shadow: 0 0 16px rgba(34, 211, 238, 0.18); }
.flow-src { border-left: 3px solid var(--cyan); }
.flow-dst { border-left: 3px solid #818cf8; }
.flow-evt { border-left: 3px solid var(--crimson-l); box-shadow: 0 0 18px rgba(239, 68, 68, 0.1); }
.flow-icon svg { width: 20px; height: 20px; color: var(--text-2); }
.flow-src .flow-icon svg { color: var(--cyan); }
.flow-dst .flow-icon svg { color: #818cf8; }
.flow-evt .flow-icon svg { color: var(--crimson-l); }
.flow-label {
  font: 700 10px/1 'Inter', sans-serif;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.flow-value {
  font: 700 12px/1.2 'JetBrains Mono', monospace;
  color: var(--text-0);
  word-break: break-all;
}
.flow-sub {
  font: 500 10px/1.3 'Inter', sans-serif;
  color: var(--text-3);
}
.flow-arrow {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-width: 44px;
  gap: 4px;
}
.flow-arrow svg { width: 100%; height: 16px; }
.flow-arrow-label {
  font: 700 8px/1 'Inter', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--cyan);
  padding: 3px 6px;
  background: rgba(34, 211, 238, 0.08);
  border: 1px solid rgba(34, 211, 238, 0.25);
  border-radius: 999px;
  white-space: nowrap;
}
@media (max-width: 560px) {
  .flow-wrap { flex-direction: column; }
  .flow-arrow { transform: none; min-height: 30px; }
  .flow-arrow svg { transform: rotate(90deg); }
}

/* Flow node tooltip — no transform (sub-pixel-safe), explicit pixel width */
.flow-node { position: relative; cursor: help; }
.flow-node[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  margin-left: -130px;
  width: 260px;
  padding: 10px 14px;
  background: #0b1220;
  border: 1px solid #334155;
  border-radius: 8px;
  color: #f8fafc;
  font: 600 12px/1.5 'Inter', sans-serif;
  text-align: center;
  white-space: normal;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
  z-index: 10;
  pointer-events: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
.flow-node[data-tooltip]:hover::before {
  content: "";
  position: absolute;
  bottom: calc(100% + 2px);
  left: 50%; transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--border);
  z-index: 10;
}

/* ── Signal Contribution Bars ── */
.bars-wrap {
  display: flex; flex-direction: column; gap: 10px;
  padding: 8px 4px 4px;
}
.bar-row {
  display: grid;
  grid-template-columns: minmax(120px, 1.5fr) 3fr minmax(70px, auto);
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
  position: relative;
  cursor: help;
}
.bar-row:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(34, 211, 238, 0.3);
}
.bar-row[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 14px; bottom: calc(100% + 6px);
  padding: 10px 14px;
  background: #0b1220;
  border: 1px solid #334155;
  border-radius: 8px;
  color: #f8fafc;
  font: 600 12px/1.5 'Inter', sans-serif;
  white-space: nowrap;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
  z-index: 5;
  pointer-events: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Top-contributing signal — stronger visual emphasis */
.bar-row.top-signal {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(34, 211, 238, 0.3);
  box-shadow: inset 0 0 0 1px rgba(34, 211, 238, 0.1);
}
.bar-row.top-signal .bar-label { color: var(--text-0); font-weight: 700; }
.bar-row.top-signal .bar-value { color: var(--cyan); }
.bar-row.top-signal .bar-fill { filter: brightness(1.12) saturate(1.15); }

.bar-label {
  font: 600 12px/1.2 'Inter', sans-serif;
  color: var(--text-1);
}
.bar-track {
  position: relative;
  height: 14px;
  background: var(--bg-0);
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
/* Stronger, more vivid severity colors */
.bar-fill.impact-high { background: #dc2626; box-shadow: 0 0 14px rgba(220, 38, 38, 0.4); }
.bar-fill.impact-med  { background: #f59e0b; box-shadow: 0 0 12px rgba(245, 158, 11, 0.3); }
.bar-fill.impact-low  { background: #64748b; }
.bar-fill.dir-benign.impact-high { background: #10b981; box-shadow: 0 0 14px rgba(16, 185, 129, 0.4); }
.bar-fill.dir-benign.impact-med  { background: #10b981; box-shadow: 0 0 10px rgba(16, 185, 129, 0.25); }

.bar-value {
  font: 700 12px/1 'JetBrains Mono', monospace;
  color: var(--text-0);
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
}
.bar-pct {
  font: 600 10px/1 'Inter', sans-serif;
  color: var(--text-3);
  letter-spacing: 0.04em;
}

/* ─── Final Assessment card ─── */
.assess-wrap {
  display: flex; align-items: center; gap: 16px;
  padding: 18px 20px;
  background: var(--bg-0);
  border: 1px solid var(--border);
  border-radius: 12px;
  border-left: 4px solid var(--cyan);
}
.assess-wrap.hidden { display: none; }
.assess-wrap.verdict-benign { border-left-color: #10b981; }
.assess-wrap.verdict-malicious { border-left-color: #ef4444; }
.assess-icon {
  flex-shrink: 0;
  width: 46px; height: 46px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
}
.assess-icon svg { width: 26px; height: 26px; }
.verdict-benign .assess-icon {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.2);
}
.verdict-malicious .assess-icon {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.25);
}
.assess-text {
  font: 500 14px/1.6 'Inter', sans-serif;
  color: var(--text-1);
  margin: 0;
}

/* ═══════════════════════ MITRE ATT&CK MATRIX ═══════════════════════ */
.mitre-head-right { display: inline-flex; gap: 10px; align-items: center; }
.mitre-hit-count {
  font: 600 11px/1 'Inter', sans-serif;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.mitre-matrix-wrap {
  padding: 4px 2px 10px;
}
.mitre-matrix-wrap.hidden { display: none; }
.mitre-matrix {
  display: grid;
  grid-template-columns: repeat(14, minmax(78px, 1fr));
  gap: 3px;
  padding: 4px;
  overflow-x: auto;
  scrollbar-width: thin;
}
.mitre-matrix::-webkit-scrollbar { height: 8px; }
.mitre-matrix::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
@media (max-width: 1280px) {
  .mitre-matrix { grid-template-columns: repeat(14, 78px); }
}

.mx-col {
  display: flex; flex-direction: column; gap: 3px;
  min-width: 0;
}
.mx-head {
  padding: 8px 6px;
  background: #0b1220;
  border: 1px solid var(--border);
  border-radius: 6px;
  font: 700 9.5px/1.15 'Inter', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-2);
  text-align: center;
  min-height: 50px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  border-bottom: 2px solid transparent;
}
.mx-head-label { line-height: 1.15; }
.mx-head-count {
  font: 700 10px/1 'JetBrains Mono', monospace;
  color: var(--text-3);
  letter-spacing: 0;
  padding: 2px 6px;
  border-radius: 10px;
  background: rgba(71, 85, 105, 0.22);
}
.mx-col.has-hits .mx-head-count {
  color: var(--text-0);
  background: rgba(34, 211, 238, 0.18);
  box-shadow: 0 0 8px rgba(34, 211, 238, 0.2);
}
/* Per-tactic hit-count colors match the cell glow */
.mx-col[data-tactic="execution"].has-hits          .mx-head-count { background: rgba(59,130,246,0.22);  box-shadow: 0 0 8px rgba(59,130,246,0.25); }
.mx-col[data-tactic="credential-access"].has-hits  .mx-head-count { background: rgba(239,68,68,0.22);   box-shadow: 0 0 8px rgba(239,68,68,0.25); }
.mx-col[data-tactic="persistence"].has-hits        .mx-head-count { background: rgba(139,92,246,0.22);  box-shadow: 0 0 8px rgba(139,92,246,0.25); }
.mx-col[data-tactic="initial-access"].has-hits     .mx-head-count { background: rgba(249,115,22,0.22);  box-shadow: 0 0 8px rgba(249,115,22,0.25); }
.mx-col[data-tactic="privilege-escalation"].has-hits .mx-head-count { background: rgba(236,72,153,0.22); box-shadow: 0 0 8px rgba(236,72,153,0.25); }
.mx-col[data-tactic="discovery"].has-hits          .mx-head-count { background: rgba(6,182,212,0.22);   box-shadow: 0 0 8px rgba(6,182,212,0.25); }
.mx-col[data-tactic="lateral-movement"].has-hits   .mx-head-count { background: rgba(99,102,241,0.22);  box-shadow: 0 0 8px rgba(99,102,241,0.25); }
.mx-col[data-tactic="collection"].has-hits         .mx-head-count { background: rgba(234,179,8,0.22);   box-shadow: 0 0 8px rgba(234,179,8,0.25); }
.mx-col[data-tactic="command-and-control"].has-hits .mx-head-count { background: rgba(217,70,239,0.22); box-shadow: 0 0 8px rgba(217,70,239,0.25); }
.mx-col[data-tactic="exfiltration"].has-hits       .mx-head-count { background: rgba(244,63,94,0.22);   box-shadow: 0 0 8px rgba(244,63,94,0.25); }
.mx-col[data-tactic="impact"].has-hits             .mx-head-count { background: rgba(220,38,38,0.28);   box-shadow: 0 0 10px rgba(220,38,38,0.3); }
.mx-col[data-tactic="defense-evasion"].has-hits    .mx-head-count { background: rgba(20,184,166,0.22);  box-shadow: 0 0 8px rgba(20,184,166,0.25); }

/* Filler cells — preserve column height without visual noise */
.mx-cell.mx-filler {
  visibility: hidden;
  pointer-events: none;
}
.mx-cell {
  position: relative;
  padding: 8px 6px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(71, 85, 105, 0.3);
  border-radius: 6px;
  text-align: center;
  min-height: 48px;
  cursor: help;
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
  display: flex; flex-direction: column; gap: 2px; justify-content: center;
}
.mx-cell:hover { border-color: rgba(34, 211, 238, 0.55); background: rgba(34, 211, 238, 0.04); }
.mx-cell .mx-id {
  font: 700 10px/1 'JetBrains Mono', monospace;
  color: var(--text-3);
  letter-spacing: 0.02em;
}
.mx-cell .mx-name {
  font: 500 9.5px/1.15 'Inter', sans-serif;
  color: var(--text-3);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* Matched cells — highlighted by tactic family color */
.mx-cell.hit {
  background: rgba(34, 211, 238, 0.12);
  border-color: rgba(34, 211, 238, 0.6);
  box-shadow: 0 0 14px rgba(34, 211, 238, 0.18);
}
.mx-cell.hit .mx-id   { color: var(--text-0); }
.mx-cell.hit .mx-name { color: var(--text-1); font-weight: 600; }

/* Tactic-family tinting for hits (overrides default cyan) */
.mx-col[data-tactic="execution"] .mx-cell.hit          { background: rgba(59,130,246,0.15); border-color: rgba(59,130,246,0.6); box-shadow: 0 0 14px rgba(59,130,246,0.22); }
.mx-col[data-tactic="execution"] .mx-head              { border-bottom-color: #3b82f6; }
.mx-col[data-tactic="credential-access"] .mx-cell.hit  { background: rgba(239,68,68,0.14); border-color: rgba(239,68,68,0.6); box-shadow: 0 0 14px rgba(239,68,68,0.22); }
.mx-col[data-tactic="credential-access"] .mx-head      { border-bottom-color: #ef4444; }
.mx-col[data-tactic="persistence"] .mx-cell.hit        { background: rgba(139,92,246,0.14); border-color: rgba(139,92,246,0.6); box-shadow: 0 0 14px rgba(139,92,246,0.22); }
.mx-col[data-tactic="persistence"] .mx-head            { border-bottom-color: #8b5cf6; }
.mx-col[data-tactic="initial-access"] .mx-cell.hit     { background: rgba(249,115,22,0.14); border-color: rgba(249,115,22,0.6); box-shadow: 0 0 14px rgba(249,115,22,0.22); }
.mx-col[data-tactic="initial-access"] .mx-head         { border-bottom-color: #f97316; }
.mx-col[data-tactic="privilege-escalation"] .mx-cell.hit { background: rgba(236,72,153,0.14); border-color: rgba(236,72,153,0.6); box-shadow: 0 0 14px rgba(236,72,153,0.22); }
.mx-col[data-tactic="privilege-escalation"] .mx-head   { border-bottom-color: #ec4899; }
.mx-col[data-tactic="discovery"] .mx-cell.hit          { background: rgba(6,182,212,0.14); border-color: rgba(6,182,212,0.6); box-shadow: 0 0 14px rgba(6,182,212,0.22); }
.mx-col[data-tactic="discovery"] .mx-head              { border-bottom-color: #06b6d4; }
.mx-col[data-tactic="lateral-movement"] .mx-cell.hit   { background: rgba(99,102,241,0.14); border-color: rgba(99,102,241,0.6); box-shadow: 0 0 14px rgba(99,102,241,0.22); }
.mx-col[data-tactic="lateral-movement"] .mx-head       { border-bottom-color: #6366f1; }
.mx-col[data-tactic="collection"] .mx-cell.hit         { background: rgba(234,179,8,0.14); border-color: rgba(234,179,8,0.6); box-shadow: 0 0 14px rgba(234,179,8,0.22); }
.mx-col[data-tactic="collection"] .mx-head             { border-bottom-color: #eab308; }
.mx-col[data-tactic="command-and-control"] .mx-cell.hit { background: rgba(217,70,239,0.14); border-color: rgba(217,70,239,0.6); box-shadow: 0 0 14px rgba(217,70,239,0.22); }
.mx-col[data-tactic="command-and-control"] .mx-head    { border-bottom-color: #d946ef; }
.mx-col[data-tactic="exfiltration"] .mx-cell.hit       { background: rgba(244,63,94,0.14); border-color: rgba(244,63,94,0.6); box-shadow: 0 0 14px rgba(244,63,94,0.22); }
.mx-col[data-tactic="exfiltration"] .mx-head           { border-bottom-color: #f43f5e; }
.mx-col[data-tactic="impact"] .mx-cell.hit             { background: rgba(220,38,38,0.18); border-color: rgba(220,38,38,0.7); box-shadow: 0 0 16px rgba(220,38,38,0.28); }
.mx-col[data-tactic="impact"] .mx-head                 { border-bottom-color: #dc2626; }
.mx-col[data-tactic="defense-evasion"] .mx-cell.hit    { background: rgba(20,184,166,0.14); border-color: rgba(20,184,166,0.6); box-shadow: 0 0 14px rgba(20,184,166,0.22); }
.mx-col[data-tactic="defense-evasion"] .mx-head        { border-bottom-color: #14b8a6; }
.mx-col[data-tactic="reconnaissance"] .mx-cell.hit     { background: rgba(100,116,139,0.22); border-color: rgba(100,116,139,0.7); box-shadow: 0 0 14px rgba(100,116,139,0.28); }
.mx-col[data-tactic="reconnaissance"] .mx-head         { border-bottom-color: #64748b; }
.mx-col[data-tactic="resource-development"] .mx-head   { border-bottom-color: #7dd3fc; }

/* Hover tooltip on cells — no transform (sub-pixel-safe), explicit pixel width */
.mx-cell[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  margin-left: -140px;          /* half of width, negative → center without transform */
  width: 280px;
  padding: 10px 14px;
  background: #0b1220;
  border: 1px solid #334155;
  border-radius: 8px;
  color: #f8fafc;
  font: 600 12px/1.5 'Inter', sans-serif;
  text-align: left;
  white-space: normal;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.55);
  z-index: 20;
  pointer-events: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Kill-chain narrative above matrix */
.kill-chain {
  display: flex; align-items: center; flex-wrap: wrap;
  gap: 10px;
  padding: 14px 14px;
  margin: 4px 4px 14px;
  background: linear-gradient(90deg, rgba(15, 23, 42, 0.7), rgba(15, 23, 42, 0.3));
  border: 1px solid var(--border);
  border-left: 3px solid var(--cyan);
  border-radius: 10px;
}
.kill-chain.hidden { display: none; }
.kc-label {
  font: 700 10px/1 'Inter', sans-serif;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-right: 6px;
}
.kc-pill {
  display: inline-flex; align-items: center;
  padding: 7px 14px;
  border-radius: 999px;
  font: 700 11px/1 'Inter', sans-serif;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: 1px solid transparent;
  transition: transform 0.15s ease;
}
.kc-pill:hover { transform: translateY(-1px); }
.kc-arrow {
  display: inline-flex; align-items: center;
  color: var(--text-3);
}
.kc-arrow svg { width: 18px; height: 14px; }

/* Per-tactic pill coloring */
.kc-pill.tactic-reconnaissance       { background: rgba(100,116,139,0.18); color: #cbd5e1; border-color: rgba(100,116,139,0.5); }
.kc-pill.tactic-resource-development { background: rgba(125,211,252,0.14); color: #bae6fd; border-color: rgba(125,211,252,0.45); }
.kc-pill.tactic-initial-access       { background: rgba(249,115,22,0.16); color: #fdba74; border-color: rgba(249,115,22,0.5); box-shadow: 0 0 10px rgba(249,115,22,0.2); }
.kc-pill.tactic-execution            { background: rgba(59,130,246,0.16); color: #93c5fd; border-color: rgba(59,130,246,0.5); box-shadow: 0 0 10px rgba(59,130,246,0.2); }
.kc-pill.tactic-persistence          { background: rgba(139,92,246,0.16); color: #c4b5fd; border-color: rgba(139,92,246,0.5); box-shadow: 0 0 10px rgba(139,92,246,0.2); }
.kc-pill.tactic-privilege-escalation { background: rgba(236,72,153,0.16); color: #f9a8d4; border-color: rgba(236,72,153,0.5); box-shadow: 0 0 10px rgba(236,72,153,0.2); }
.kc-pill.tactic-defense-evasion      { background: rgba(20,184,166,0.16); color: #5eead4; border-color: rgba(20,184,166,0.5); box-shadow: 0 0 10px rgba(20,184,166,0.2); }
.kc-pill.tactic-credential-access    { background: rgba(239,68,68,0.16); color: #fca5a5; border-color: rgba(239,68,68,0.5); box-shadow: 0 0 10px rgba(239,68,68,0.2); }
.kc-pill.tactic-discovery            { background: rgba(6,182,212,0.16); color: #67e8f9; border-color: rgba(6,182,212,0.5); box-shadow: 0 0 10px rgba(6,182,212,0.2); }
.kc-pill.tactic-lateral-movement     { background: rgba(99,102,241,0.16); color: #a5b4fc; border-color: rgba(99,102,241,0.5); box-shadow: 0 0 10px rgba(99,102,241,0.2); }
.kc-pill.tactic-collection           { background: rgba(234,179,8,0.16); color: #fde047; border-color: rgba(234,179,8,0.5); box-shadow: 0 0 10px rgba(234,179,8,0.2); }
.kc-pill.tactic-command-and-control  { background: rgba(217,70,239,0.16); color: #f0abfc; border-color: rgba(217,70,239,0.5); box-shadow: 0 0 10px rgba(217,70,239,0.2); }
.kc-pill.tactic-exfiltration         { background: rgba(244,63,94,0.16); color: #fda4af; border-color: rgba(244,63,94,0.5); box-shadow: 0 0 10px rgba(244,63,94,0.2); }
.kc-pill.tactic-impact               { background: rgba(220,38,38,0.20); color: #fca5a5; border-color: rgba(220,38,38,0.6); box-shadow: 0 0 12px rgba(220,38,38,0.28); }

/* Legend below matrix */
.mitre-legend {
  margin: 12px 4px 0;
  font: 500 11px/1 'Inter', sans-serif;
  color: var(--text-3);
  display: flex; align-items: center; gap: 10px;
  flex-wrap: wrap;
}
.ml-swatch {
  display: inline-block;
  width: 14px; height: 14px;
  border-radius: 3px;
  margin-right: 4px;
  margin-left: 10px;
  vertical-align: -3px;
}
.ml-swatch.ml-hit  { background: rgba(34,211,238,0.3); border: 1px solid rgba(34,211,238,0.6); box-shadow: 0 0 8px rgba(34,211,238,0.25); }
.ml-swatch.ml-miss { background: rgba(15,23,42,0.6); border: 1px solid rgba(71,85,105,0.3); }

.mitre-list, .mitre-list.hidden { display: none; } /* legacy, keep hidden */

/* ═══════════════════════ ABOUT TAB ═══════════════════════ */

/* Intro paragraph */
.about-intro {
  margin: 6px 0 22px;
  font: 500 14px/1.65 'Inter', sans-serif;
  color: var(--text-1);
  max-width: 840px;
}
.about-intro code {
  background: rgba(34, 211, 238, 0.08);
  color: var(--cyan);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 12px;
}

/* Hero stats strip */
.about-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  padding: 4px 2px;
}
.about-stat {
  padding: 18px 18px;
  background: var(--bg-0);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex; flex-direction: column; gap: 8px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.about-stat:hover { border-color: rgba(34, 211, 238, 0.35); }
.as-ico {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
}
.as-ico svg { width: 22px; height: 22px; }
.as-ico-emerald { background: rgba(16, 185, 129, 0.12); color: #10b981; }
.as-ico-cyan    { background: rgba(34, 211, 238, 0.12); color: var(--cyan); }
.as-ico-amber   { background: rgba(245, 158, 11, 0.12); color: #f59e0b; }
.as-ico-indigo  { background: rgba(99, 102, 241, 0.14); color: #a5b4fc; }
.as-num {
  font: 800 30px/1 'JetBrains Mono', monospace;
  color: var(--text-0);
  letter-spacing: -0.02em;
}
.as-num .as-denom {
  font-size: 16px;
  color: var(--text-3);
  font-weight: 700;
  margin-left: 2px;
}
.as-caption {
  font: 500 11.5px/1.45 'Inter', sans-serif;
  color: var(--text-3);
}
@media (max-width: 900px) { .about-stats { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .about-stats { grid-template-columns: 1fr; } }

/* Architecture diagram */
.arch-flow {
  padding: 20px 8px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.arch-node {
  padding: 14px 18px;
  background: var(--bg-0);
  border: 1px solid var(--border);
  border-left: 3px solid var(--cyan);
  border-radius: 10px;
  min-width: 240px;
  max-width: 460px;
  text-align: center;
  transition: border-left-color 0.15s ease, box-shadow 0.15s ease;
}
.arch-node:hover { box-shadow: 0 0 20px rgba(34, 211, 238, 0.12); }
.arch-node-label {
  font: 700 9px/1 'Inter', sans-serif;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 6px;
}
.arch-node-title {
  font: 700 15px/1.2 'Inter', sans-serif;
  color: var(--text-0);
  margin-bottom: 4px;
}
.arch-node-sub {
  font: 500 11.5px/1.4 'Inter', sans-serif;
  color: var(--text-3);
}
.arch-node-sub code {
  font-size: 11px;
  background: rgba(34, 211, 238, 0.08);
  color: var(--cyan);
  padding: 1px 5px;
  border-radius: 4px;
}
.arch-input  { border-left-color: #7dd3fc; }
.arch-lead   { border-left-color: var(--cyan); background: linear-gradient(90deg, rgba(34, 211, 238, 0.04), var(--bg-0)); }
.arch-risk   { border-left-color: #8b5cf6; }
.arch-output { border-left-color: #10b981; background: linear-gradient(90deg, rgba(16, 185, 129, 0.04), var(--bg-0)); }

.arch-arrow {
  display: block;
  width: 24px; height: 48px;
  margin: 0 auto;
}
.arch-arrow svg { width: 100%; height: 100%; }

/* Fan-out arrows (lead → 3 subagents, and back) */
.arch-fan {
  width: 100%;
  max-width: 820px;
  height: 40px;
}
.arch-fan svg { width: 100%; height: 100%; display: block; }

.arch-subagents {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  width: 100%;
  max-width: 820px;
}
.arch-subagent { text-align: left; min-width: 0; max-width: none; }
.arch-sub-net   { border-left-color: #3b82f6; }
.arch-sub-log   { border-left-color: #f59e0b; }
.arch-sub-intel { border-left-color: #ef4444; }
.arch-tool-list {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
  display: flex; flex-direction: column; gap: 4px;
}
.arch-tool-list li {
  font: 500 11px/1.4 'Inter', sans-serif;
  color: var(--text-2);
  padding: 3px 8px;
  background: rgba(15, 23, 42, 0.5);
  border-radius: 6px;
}
.arch-tool-list code {
  font-family: 'JetBrains Mono', monospace;
  color: var(--cyan);
  font-size: 11px;
}
@media (max-width: 720px) {
  .arch-subagents { grid-template-columns: 1fr; }
  .arch-fan { display: none; }
}

/* Model comparison cards */
.model-compare {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  padding: 4px 2px;
}
.mc-card {
  padding: 20px;
  background: var(--bg-0);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex; flex-direction: column; gap: 12px;
  transition: border-color 0.15s ease;
}
.mc-primary   { border-left: 4px solid var(--cyan); }
.mc-secondary { border-left: 4px solid #64748b; }
.mc-card:hover { border-color: rgba(34, 211, 238, 0.3); }
.mc-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.mc-name { font: 800 17px/1 'Inter', sans-serif; color: var(--text-0); }
.mc-badge {
  font: 700 9.5px/1 'Inter', sans-serif;
  padding: 5px 10px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border: 1px solid transparent;
}
.mc-badge-primary   { background: rgba(34, 211, 238, 0.14); color: var(--cyan); border-color: rgba(34, 211, 238, 0.45); }
.mc-badge-secondary { background: rgba(100, 116, 139, 0.2); color: #cbd5e1; border-color: rgba(100, 116, 139, 0.5); }
.mc-model-id {
  font: 500 11.5px/1 'JetBrains Mono', monospace;
  color: var(--text-3);
}
.mc-model-id code { font-family: inherit; color: var(--text-2); }
.mc-metrics {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  padding: 10px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.mc-metric {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 4px 0;
  font: 500 12px/1.3 'Inter', sans-serif;
}
.mc-metric span { color: var(--text-3); }
.mc-metric b {
  color: var(--text-0);
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
}
.mc-note {
  font: 500 12px/1.5 'Inter', sans-serif;
  color: var(--text-2);
  margin: 0;
  font-style: italic;
}
@media (max-width: 720px) { .model-compare { grid-template-columns: 1fr; } }

/* Meta card: tech stack + datasets + credits */
.about-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  padding: 4px 2px 20px;
}
@media (max-width: 820px) { .about-meta-grid { grid-template-columns: 1fr; gap: 24px; } }
.about-h3 {
  font: 700 11px/1 'Inter', sans-serif;
  color: var(--cyan);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin: 0 0 12px;
}

.tech-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.tech-pill {
  padding: 6px 12px;
  border-radius: 999px;
  font: 600 11.5px/1 'Inter', sans-serif;
  border: 1px solid transparent;
  color: var(--text-1);
  background: rgba(15, 23, 42, 0.5);
  border-color: var(--border);
}
.tp-py  { color: #93c5fd; border-color: rgba(59, 130, 246, 0.4);  background: rgba(59, 130, 246, 0.08); }
.tp-lc  { color: #c4b5fd; border-color: rgba(139, 92, 246, 0.4);  background: rgba(139, 92, 246, 0.08); }
.tp-or  { color: #fdba74; border-color: rgba(249, 115, 22, 0.4);  background: rgba(249, 115, 22, 0.08); }
.tp-ai  { color: #6ee7b7; border-color: rgba(16, 185, 129, 0.4);  background: rgba(16, 185, 129, 0.08); }
.tp-fl  { color: #fcd34d; border-color: rgba(245, 158, 11, 0.4);  background: rgba(245, 158, 11, 0.08); }
.tp-db  { color: #67e8f9; border-color: rgba(6, 182, 212, 0.4);   background: rgba(6, 182, 212, 0.08); }
.tp-js  { color: #f9a8d4; border-color: rgba(236, 72, 153, 0.4);  background: rgba(236, 72, 153, 0.08); }
.tp-svg { color: #a5b4fc; border-color: rgba(99, 102, 241, 0.4);  background: rgba(99, 102, 241, 0.08); }

.ds-table {
  width: 100%;
  border-collapse: collapse;
  font: 500 12px/1.4 'Inter', sans-serif;
}
.ds-table thead th {
  padding: 8px 10px;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid var(--border);
  color: var(--text-3);
  font: 700 10.5px/1 'Inter', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-align: left;
}
.ds-table tbody td {
  padding: 10px;
  border: 1px solid var(--border);
  color: var(--text-1);
}
.ds-table tbody tr:nth-child(even) td { background: rgba(15, 23, 42, 0.25); }

.about-credits {
  margin-top: 18px;
  padding: 14px 16px;
  background: linear-gradient(90deg, rgba(34, 211, 238, 0.04), rgba(15, 23, 42, 0.3));
  border: 1px solid var(--border);
  border-left: 3px solid var(--cyan);
  border-radius: 10px;
  text-align: center;
}
.credits-line {
  font: 700 13px/1.5 'Inter', sans-serif;
  color: var(--text-0);
}
.credits-line b { color: var(--cyan); }
.credits-sub { font-weight: 500; color: var(--text-2); font-size: 12.5px; }

/* ═══════════════════════ SESSION TIMELINE ═══════════════════════ */
.viz-timeline-card { grid-column: 1 / -1; }
.timeline-wrap { padding: 12px 6px 4px; }
.timeline-wrap.hidden { display: none; }
.timeline-svg {
  width: 100%;
  height: 260px;
  background: rgba(15, 23, 42, 0.3);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.timeline-dot { cursor: pointer; transition: r 0.15s ease, filter 0.15s ease; }
.timeline-dot:hover { filter: drop-shadow(0 0 10px currentColor); }
.timeline-dot.dot-mal { fill: #ef4444; color: #ef4444; stroke: #dc2626; stroke-width: 1.5; }
.timeline-dot.dot-ben { fill: #10b981; color: #10b981; stroke: #059669; stroke-width: 1.5; }
.timeline-dot.dot-err { fill: #94a3b8; color: #94a3b8; stroke: #64748b; stroke-width: 1.5; }
.timeline-grid-line { stroke: var(--border); stroke-width: 0.8; stroke-dasharray: 3 4; opacity: 0.5; }
.timeline-axis-label { font: 600 10px/1 'JetBrains Mono', monospace; fill: var(--text-3); }
.timeline-legend {
  display: flex; flex-wrap: wrap; gap: 16px; align-items: center;
  margin-top: 12px;
  padding: 10px 14px;
  font: 500 11.5px/1 'Inter', sans-serif;
  color: var(--text-2);
  background: rgba(15, 23, 42, 0.3);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.tl-item { display: inline-flex; align-items: center; gap: 6px; }
.tl-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.tl-dot-mal { background: #ef4444; box-shadow: 0 0 6px rgba(239, 68, 68, 0.6); }
.tl-dot-ben { background: #10b981; box-shadow: 0 0 6px rgba(16, 185, 129, 0.5); }
.tl-dot-err { background: #94a3b8; }
.tl-hint { margin-left: auto; font-style: italic; font-size: 10.5px; color: var(--text-3); }

.tl-tooltip {
  position: fixed;
  padding: 10px 14px;
  background: #0b1220;
  border: 1px solid #334155;
  border-radius: 8px;
  color: #f8fafc;
  font: 600 11px/1.5 'Inter', sans-serif;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.55);
  pointer-events: none;
  z-index: 50;
  max-width: 280px;
  opacity: 0;
  transition: opacity 0.12s ease;
}
.tl-tooltip.visible { opacity: 1; }
.tl-tooltip .tt-head { font-weight: 800; color: var(--cyan); margin-bottom: 4px; }
.tl-tooltip .tt-line { color: var(--text-2); font-weight: 500; }

/* ═══════════════════════ RISK SCORE CASCADE ═══════════════════════ */
.viz-cascade-card { grid-column: 1 / -1; }
.cascade-wrap { display: flex; flex-direction: column; gap: 6px; padding: 8px 4px; }
.cascade-wrap.hidden { display: none; }
.cascade-row {
  display: grid;
  grid-template-columns: minmax(140px, 1.4fr) 3fr minmax(110px, auto);
  align-items: center;
  gap: 14px;
  padding: 8px 10px;
  border-radius: 8px;
  transition: background 0.15s ease;
}
.cascade-row:hover { background: rgba(255, 255, 255, 0.03); }
.cascade-label {
  font: 600 12.5px/1.3 'Inter', sans-serif;
  color: var(--text-1);
  display: flex; align-items: center; gap: 6px;
}
.cascade-label .cl-prefix {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 800;
  font-size: 13px;
  width: 16px;
  text-align: center;
}
.cascade-row.c-baseline .cl-prefix { color: var(--text-3); }
.cascade-row.c-add      .cl-prefix { color: var(--crimson-l); }
.cascade-row.c-sub      .cl-prefix { color: var(--emerald-l); }
.cascade-row.c-final    .cl-prefix { color: var(--cyan); }

.cascade-chart {
  position: relative;
  height: 22px;
  background: var(--bg-0);
  border: 1px solid var(--border);
  border-radius: 11px;
  overflow: hidden;
}
.cascade-running {
  position: absolute; left: 0; top: 0; bottom: 0;
  background: rgba(100, 116, 139, 0.3);
  border-right: 1px solid var(--border);
  transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.cascade-delta {
  position: absolute; top: 0; bottom: 0;
  transition: left 0.5s cubic-bezier(0.22, 1, 0.36, 1), width 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.cascade-row.c-add    .cascade-delta { background: rgba(220, 38, 38, 0.55); box-shadow: 0 0 8px rgba(220, 38, 38, 0.4); }
.cascade-row.c-sub    .cascade-delta { background: rgba(16, 185, 129, 0.55); box-shadow: 0 0 8px rgba(16, 185, 129, 0.4); }
.cascade-row.c-final  .cascade-running { background: rgba(34, 211, 238, 0.35); box-shadow: 0 0 12px rgba(34, 211, 238, 0.25); }
.cascade-row.c-baseline .cascade-running { background: rgba(100, 116, 139, 0.4); }

.cascade-value { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-family: 'JetBrains Mono', monospace; }
.cv-total { font: 800 13px/1 'JetBrains Mono', monospace; color: var(--text-0); }
.cv-delta { font: 600 10.5px/1 'JetBrains Mono', monospace; color: var(--text-3); }
.cascade-row.c-add .cv-delta { color: var(--crimson-l); }
.cascade-row.c-sub .cv-delta { color: var(--emerald-l); }

.cascade-row.c-final {
  margin-top: 6px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
}
.cascade-row.c-final .cascade-label { font-weight: 800; color: var(--text-0); }
.cascade-row.c-final .cv-total { color: var(--cyan); font-size: 15px; }

/* ═══════════════════════ HISTORY DATA TABLE ═══════════════════════ */
.history-card .card-header { align-items: center; }
.hist-head-right { display: inline-flex; gap: 8px; align-items: center; }

.hist-toolbar {
  display: flex; flex-wrap: wrap;
  gap: 10px;
  margin: 10px 0 14px;
  padding: 12px 14px;
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.hist-search-wrap {
  position: relative;
  flex: 1 1 260px;
  min-width: 220px;
}
.hist-search-ico {
  position: absolute;
  left: 12px; top: 50%;
  transform: translateY(-50%);
  width: 15px; height: 15px;
  color: var(--text-3);
  pointer-events: none;
}
.hist-search {
  width: 100%;
  padding: 9px 10px 9px 36px;
  background: #0b1220;
  color: var(--text-0);
  border: 1px solid var(--border);
  border-radius: 8px;
  font: 500 13px/1 'Inter', sans-serif;
}
.hist-search:focus { outline: none; border-color: var(--cyan); }
.hist-filter {
  background: #0b1220;
  color: var(--text-1);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 10px;
  font: 600 12px/1 'Inter', sans-serif;
  cursor: pointer;
  min-width: 140px;
}
.hist-filter:focus { outline: none; border-color: var(--cyan); }

.hist-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.3);
}
.hist-table {
  width: 100%;
  border-collapse: collapse;
  font: 500 12.5px/1.4 'Inter', sans-serif;
}
.hist-table thead th {
  position: sticky; top: 0;
  padding: 11px 12px;
  background: #0b1220;
  color: var(--text-3);
  font: 700 10.5px/1 'Inter', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-align: left;
  border-bottom: 1px solid var(--border);
  user-select: none;
  white-space: nowrap;
}
.hist-table thead th.num { text-align: right; }
.hist-table thead th.sortable { cursor: pointer; transition: color 0.12s ease; }
.hist-table thead th.sortable:hover { color: var(--text-0); }
.hist-table thead th.sortable.active { color: var(--cyan); }
.sort-ind { margin-left: 4px; opacity: 0.5; }
.sort-ind::after { content: ""; }
.sortable.active.asc  .sort-ind::after { content: " ▲"; opacity: 1; }
.sortable.active.desc .sort-ind::after { content: " ▼"; opacity: 1; }

.hist-table tbody tr {
  transition: background 0.12s ease;
  cursor: pointer;
}
.hist-table tbody tr:hover { background: rgba(34, 211, 238, 0.05); }
.hist-table tbody tr.row-malicious { border-left: 3px solid rgba(239, 68, 68, 0.6); }
.hist-table tbody tr.row-benign    { border-left: 3px solid rgba(16, 185, 129, 0.5); }
.hist-table tbody tr.row-error     { border-left: 3px solid rgba(100, 116, 139, 0.5); }

.hist-table tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(71, 85, 105, 0.15);
  vertical-align: middle;
  color: var(--text-1);
}
.hist-table tbody td.num { text-align: right; font-family: 'JetBrains Mono', monospace; font-weight: 600; }
.hist-table tbody td.mono { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--text-0); }
.hist-table tbody tr:last-child td { border-bottom: none; }

/* Verdict pill inside a table cell */
.hist-v {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font: 700 11px/1 'Inter', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border: 1px solid transparent;
}
.hist-v .hist-v-dot { width: 7px; height: 7px; border-radius: 50%; }
.hist-v.v-malicious { background: rgba(239,68,68,0.12); color: #fca5a5; border-color: rgba(239,68,68,0.45); }
.hist-v.v-malicious .hist-v-dot { background: #ef4444; box-shadow: 0 0 6px rgba(239,68,68,0.6); }
.hist-v.v-benign    { background: rgba(16,185,129,0.12); color: #6ee7b7; border-color: rgba(16,185,129,0.45); }
.hist-v.v-benign    .hist-v-dot { background: #10b981; box-shadow: 0 0 6px rgba(16,185,129,0.55); }
.hist-v.v-error     { background: rgba(100,116,139,0.18); color: #cbd5e1; border-color: rgba(100,116,139,0.5); }
.hist-v.v-error     .hist-v-dot { background: #94a3b8; }

/* Expanded detail row */
.hist-detail-row td {
  padding: 0;
  background: rgba(34, 211, 238, 0.04);
  border-top: 1px solid rgba(34, 211, 238, 0.2);
  border-bottom: 1px solid rgba(34, 211, 238, 0.2);
  cursor: default;
}
.hist-detail-inner {
  padding: 14px 18px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px 22px;
  font: 500 12px/1.55 'Inter', sans-serif;
  color: var(--text-1);
}
.hist-detail-inner b { color: var(--text-3); text-transform: uppercase; letter-spacing: 0.06em; font-size: 10px; font-weight: 700; align-self: start; padding-top: 2px; }
.hist-detail-inner p { margin: 0; }

/* Compact density mode */
.hist-table.compact thead th { padding: 8px 10px; }
.hist-table.compact tbody td { padding: 6px 10px; font-size: 12px; }
.hist-table.compact .hist-v { padding: 2px 8px; font-size: 10px; }

/* Footer */
.hist-footer {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 10px;
  padding: 0 4px;
  font: 500 11px/1 'Inter', sans-serif;
  color: var(--text-3);
}
.hist-hint { font-style: italic; }
.hist-placeholder td { padding: 24px 14px; text-align: center; color: var(--text-3); }

/* Time cell — relative time on top, absolute on hover via title */
.hist-time {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text-2);
  white-space: nowrap;
}

/* ═══════════════════════ BATCH ALERT NAVIGATOR ═══════════════════════ */
.alert-nav {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  margin-bottom: 20px;
  background: linear-gradient(90deg, rgba(34, 211, 238, 0.06), rgba(15, 23, 42, 0.4));
  border: 1px solid var(--border);
  border-left: 3px solid var(--cyan);
  border-radius: 10px;
  grid-column: 1 / -1;
}
.alert-nav.hidden { display: none; }
.an-btn {
  background: #0b1220;
  color: var(--text-1);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 10px;
  font: 600 12px/1 'Inter', sans-serif;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 36px;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.an-btn:hover:not(:disabled) {
  background: rgba(34, 211, 238, 0.08);
  border-color: rgba(34, 211, 238, 0.45);
  color: var(--text-0);
}
.an-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.an-btn svg { width: 14px; height: 14px; }
.an-info {
  display: flex; align-items: center; gap: 10px;
  flex: 1 1 auto;
  min-width: 0;
}
.an-label {
  font: 700 10px/1 'Inter', sans-serif;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
}
.an-select {
  flex: 1 1 auto;
  min-width: 180px;
  max-width: 360px;
  background: #0b1220;
  color: var(--text-0);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 10px;
  font: 600 12px/1 'JetBrains Mono', monospace;
  cursor: pointer;
}
.an-select:focus { outline: none; border-color: var(--cyan); }
.an-counter {
  font: 700 11px/1 'JetBrains Mono', monospace;
  color: var(--text-2);
  padding: 6px 10px;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid var(--border);
  border-radius: 8px;
  white-space: nowrap;
}

.mitre-row {
  display: grid;
  grid-template-columns: minmax(160px, auto) auto 1fr;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  background: var(--bg-0);
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.mitre-row:hover {
  transform: translateX(2px);
  border-color: rgba(34, 211, 238, 0.3);
}

.mitre-tactic {
  display: inline-flex; align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  font: 700 10px/1 'Inter', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border: 1px solid transparent;
  white-space: nowrap;
}
/* Color-coded tactic badges */
.tactic-execution          { background: rgba(59, 130, 246, 0.14); color: #93c5fd; border-color: rgba(59, 130, 246, 0.45); }
.tactic-credential-access  { background: rgba(239, 68, 68, 0.14); color: #fca5a5; border-color: rgba(239, 68, 68, 0.45); }
.tactic-persistence        { background: rgba(139, 92, 246, 0.14); color: #c4b5fd; border-color: rgba(139, 92, 246, 0.45); }
.tactic-initial-access     { background: rgba(249, 115, 22, 0.14); color: #fdba74; border-color: rgba(249, 115, 22, 0.45); }
.tactic-privilege-escalation { background: rgba(236, 72, 153, 0.14); color: #f9a8d4; border-color: rgba(236, 72, 153, 0.45); }
.tactic-discovery          { background: rgba(6, 182, 212, 0.14); color: #67e8f9; border-color: rgba(6, 182, 212, 0.45); }
.tactic-lateral-movement   { background: rgba(99, 102, 241, 0.14); color: #a5b4fc; border-color: rgba(99, 102, 241, 0.45); }
.tactic-collection         { background: rgba(234, 179, 8, 0.14); color: #fde047; border-color: rgba(234, 179, 8, 0.45); }
.tactic-command-and-control { background: rgba(217, 70, 239, 0.14); color: #f0abfc; border-color: rgba(217, 70, 239, 0.45); }
.tactic-exfiltration       { background: rgba(244, 63, 94, 0.14); color: #fda4af; border-color: rgba(244, 63, 94, 0.45); }
.tactic-impact             { background: rgba(220, 38, 38, 0.16); color: #fca5a5; border-color: rgba(220, 38, 38, 0.55); }
.tactic-defense-evasion    { background: rgba(20, 184, 166, 0.14); color: #5eead4; border-color: rgba(20, 184, 166, 0.45); }
.tactic-reconnaissance     { background: rgba(100, 116, 139, 0.18); color: #cbd5e1; border-color: rgba(100, 116, 139, 0.5); }

.mitre-arrow {
  color: var(--text-3);
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
}
.mitre-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.mitre-head { display: flex; align-items: baseline; gap: 10px; }
.mitre-id {
  font: 700 13px/1 'JetBrains Mono', monospace;
  color: var(--cyan);
  letter-spacing: 0.02em;
}
.mitre-name {
  font: 600 13px/1.3 'Inter', sans-serif;
  color: var(--text-0);
}
.mitre-desc {
  font: 400 12px/1.5 'Inter', sans-serif;
  color: var(--text-2);
}

/* Confidence pill variants */
.pill.conf-high  { background: rgba(16, 185, 129, 0.14); color: #6ee7b7; border: 1px solid rgba(16, 185, 129, 0.45); }
.pill.conf-heur  { background: rgba(100, 116, 139, 0.18); color: #cbd5e1; border: 1px solid rgba(100, 116, 139, 0.5); }
.pill.conf-none  { background: rgba(71, 85, 105, 0.18); color: var(--text-3); border: 1px solid var(--border); }

@media (max-width: 640px) {
  .mitre-row { grid-template-columns: 1fr; gap: 8px; }
  .mitre-arrow { display: none; }
}

/* ═══════════════════════ TRACE ═══════════════════════ */
.trace-card .trace {
  max-height: 420px;
  overflow-y: auto;
  padding: 4px 2px;
}

.trace-empty {
  color: var(--text-3);
  font-style: italic;
  text-align: center;
  padding: 30px 10px;
  font-size: 12.5px;
}

.trace-step {
  display: flex; gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px dashed var(--border-soft);
  animation: slideIn 0.3s ease;
}
.trace-step:last-child { border-bottom: none; }
@keyframes slideIn { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: none; } }

.trace-icon {
  min-width: 28px; height: 28px;
  display: grid; place-items: center;
  background: rgba(34, 211, 238, 0.12);
  color: var(--cyan);
  border: 1px solid rgba(34, 211, 238, 0.3);
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
}
.trace-step.tool .trace-icon { background: rgba(167, 139, 250, 0.12); color: var(--violet); border-color: rgba(167, 139, 250, 0.3); }
.trace-step.ai .trace-icon { background: rgba(34, 211, 238, 0.12); color: var(--cyan); }
.trace-step.human .trace-icon { background: rgba(129, 140, 248, 0.12); color: var(--indigo); border-color: rgba(129, 140, 248, 0.3); }

.trace-body { flex: 1; min-width: 0; }
.trace-head {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 11px;
  margin-bottom: 4px;
}
.trace-type {
  font-weight: 700;
  color: var(--text-0);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.trace-num { color: var(--text-3); font-family: 'JetBrains Mono', monospace; }
.trace-content {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  color: var(--text-2);
  word-break: break-word;
  white-space: pre-wrap;
  max-height: 160px;
  overflow-y: auto;
  padding: 6px 10px;
  background: var(--bg-0);
  border: 1px solid var(--border-soft);
  border-radius: 6px;
}

/* ═══════════════════════ HISTORY ═══════════════════════ */
.history-table {
  max-height: 340px;
  overflow-y: auto;
}
.history-row {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-soft);
  display: grid;
  grid-template-columns: 110px 1fr 90px 50px;
  gap: 10px;
  align-items: center;
  font-size: 11.5px;
}
.history-row:last-child { border: none; }
.hist-id { font-family: 'JetBrains Mono', monospace; color: var(--cyan); font-weight: 600; }
.hist-evt { color: var(--text-1); }
.hist-verdict {
  text-align: center;
  font-weight: 700;
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 4px;
}
.hist-verdict.Malicious { background: rgba(239, 68, 68, 0.15); color: var(--crimson-l); }
.hist-verdict.Benign { background: rgba(16, 185, 129, 0.15); color: var(--emerald-l); }
.hist-conf { text-align: right; color: var(--text-2); font-family: 'JetBrains Mono', monospace; }

/* ═══════════════════════ BENCHMARK ═══════════════════════ */
.benchmark-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.bench-card {
  padding: 16px;
  background: var(--bg-0);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.bench-card.primary { border-color: rgba(16, 185, 129, 0.4); box-shadow: 0 0 20px rgba(16, 185, 129, 0.08); }
.bench-card.secondary { border-color: rgba(245, 158, 11, 0.3); }

.bench-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 10px;
}
.bench-name { font-size: 13px; font-weight: 700; color: var(--text-0); }
.bench-score { font-size: 20px; font-weight: 800; color: var(--emerald-l); font-family: 'JetBrains Mono', monospace; }
.bench-card.secondary .bench-score { color: var(--amber); }

/* Bench card subline: model id + architecture */
.bench-sub {
  display: flex; justify-content: space-between; align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--border);
  font-size: 10.5px;
}
.bench-sub code {
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.bench-arch {
  font: 700 9.5px/1 'Inter', sans-serif;
  color: var(--cyan);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 3px 7px;
  background: rgba(34, 211, 238, 0.08);
  border: 1px solid rgba(34, 211, 238, 0.35);
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Dataset description under the benchmark card header */
.bench-desc {
  margin: -4px 0 16px;
  padding: 10px 14px;
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid var(--border);
  border-left: 3px solid var(--cyan);
  border-radius: 8px;
  font: 500 12.5px/1.5 'Inter', sans-serif;
  color: var(--text-2);
}

.bench-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 12px;
  font-size: 11px;
}
.bench-metrics span { color: var(--text-3); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; }
.bench-metrics b { color: var(--text-0); font-family: 'JetBrains Mono', monospace; }

/* ═══════════════════════ FOOTER ═══════════════════════ */
.site-footer {
  max-width: 1400px;
  margin: 40px auto 30px;
  padding: 24px 32px;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-3);
}
.site-footer p { font-size: 11.5px; margin-bottom: 6px; }
.site-footer .small { font-size: 10.5px; color: var(--text-3); max-width: 720px; margin: 6px auto 0; }
.site-footer code { color: var(--cyan); }

/* ═══════════════════════ OVERLAY WITH PROGRESS STEPS ═══════════════════════ */
.overlay {
  position: fixed; inset: 0;
  background: rgba(10, 15, 30, 0.88);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
  padding: 20px;
}
.overlay.hidden { display: none; }
.overlay-panel {
  background: linear-gradient(180deg, #0f172a, #0b1220);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px 26px;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.55), 0 0 30px rgba(34, 211, 238, 0.1);
}
.overlay-head {
  display: flex; align-items: center; gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 18px;
}
.overlay-head .spinner { width: 32px; height: 32px; flex-shrink: 0; }
.overlay-title { display: flex; flex-direction: column; gap: 4px; flex: 1 1 auto; min-width: 0; }
.overlay-msg {
  font: 700 14.5px/1.2 'Inter', sans-serif;
  color: var(--text-0);
}
.overlay-elapsed {
  font: 600 11px/1 'JetBrains Mono', monospace;
  color: var(--text-3);
}

.progress-steps {
  list-style: none;
  margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 4px;
}
.ps-step {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 12px;
  align-items: start;
  padding: 9px 4px;
  border-radius: 8px;
  transition: background 0.2s ease;
}
.ps-step .ps-ico {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: transparent;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: all 0.3s ease;
  position: relative;
}
.ps-step .ps-label {
  font: 600 13px/1.35 'Inter', sans-serif;
  color: var(--text-3);
  transition: color 0.25s ease;
}
.ps-step .ps-hint {
  grid-column: 2;
  font: 500 11px/1.45 'Inter', sans-serif;
  color: var(--text-3);
  opacity: 0.6;
  margin-top: 2px;
  display: none;
}

/* States: pending (default), active, done */
.ps-step.active {
  background: rgba(34, 211, 238, 0.06);
}
.ps-step.active .ps-ico {
  border-color: var(--cyan);
  box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.18), 0 0 14px rgba(34, 211, 238, 0.3);
}
.ps-step.active .ps-ico::after {
  content: "";
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--cyan);
  animation: pulse 1.2s ease-in-out infinite;
}
.ps-step.active .ps-label { color: var(--text-0); }
.ps-step.active .ps-hint  { display: block; opacity: 1; color: var(--text-2); }

.ps-step.done .ps-ico {
  background: var(--cyan);
  border-color: var(--cyan);
}
.ps-step.done .ps-ico::after {
  content: "";
  width: 10px; height: 6px;
  border-left: 2px solid #0b1220;
  border-bottom: 2px solid #0b1220;
  transform: rotate(-45deg) translate(1px, -2px);
}
.ps-step.done .ps-label { color: var(--text-2); }

@keyframes pulse {
  0%, 100% { transform: scale(1);   opacity: 1;   }
  50%      { transform: scale(1.4); opacity: 0.4; }
}

.overlay-hint {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px dashed var(--border);
  font: 500 11.5px/1.4 'Inter', sans-serif;
  color: var(--text-3);
  text-align: center;
  font-style: italic;
}
.overlay-hint.overrun { color: #fcd34d; font-style: normal; }

.spinner {
  width: 48px; height: 48px;
  border: 3px solid rgba(34, 211, 238, 0.2);
  border-top-color: var(--cyan);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Keyboard shortcut hint next to Analyze button */
.kbd-hint {
  margin-left: auto;
  display: inline-flex; align-items: center; gap: 4px;
  font: 500 10.5px/1 'Inter', sans-serif;
  color: var(--text-3);
}
.kbd-hint kbd {
  padding: 3px 6px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 4px;
  font: 700 10px/1 'JetBrains Mono', monospace;
  color: var(--text-1);
}

.hidden { display: none !important; }

/* Scrollbars */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-0); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-3); }

/* ═══════════════════════ BATCH RESULT ROWS (clickable) ═══════════════════════ */
.batch-results { border-top: 1px solid var(--border-soft); padding-top: 12px; }
.batch-summary {
  color: var(--cyan); font-size: 12px; margin-bottom: 10px;
  display: flex; justify-content: space-between; align-items: center;
}
.batch-summary b { color: var(--text-0); }

.batch-row {
  padding: 10px 14px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  margin-bottom: 6px;
  display: grid;
  grid-template-columns: 120px 1fr 90px 60px auto;
  gap: 10px;
  align-items: center;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.12s ease;
  background: rgba(10, 15, 30, 0.4);
}
.batch-row:hover {
  border-color: var(--cyan);
  background: rgba(34, 211, 238, 0.06);
  transform: translateX(2px);
}
.batch-row .br-id { font-family: 'JetBrains Mono', monospace; color: var(--cyan); font-weight: 600; }
.batch-row .br-evt { color: var(--text-1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.batch-row .br-verdict {
  text-align: center; font-weight: 700; font-size: 10px;
  padding: 3px 8px; border-radius: 4px;
}
.batch-row .br-verdict.Malicious { background: rgba(239, 68, 68, 0.15); color: var(--crimson-l); }
.batch-row .br-verdict.Benign   { background: rgba(16, 185, 129, 0.15); color: var(--emerald-l); }
.batch-row .br-verdict.ERROR    { background: rgba(148, 163, 184, 0.15); color: var(--text-2); }
.batch-row .br-conf { text-align: right; color: var(--text-2); font-family: 'JetBrains Mono', monospace; }
.batch-row .br-arrow { color: var(--text-3); font-size: 14px; }
.batch-row:hover .br-arrow { color: var(--cyan); }

/* ═══════════════════════ DETAIL MODAL ═══════════════════════ */
.modal {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
}
.modal.hidden { display: none; }

.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(5, 10, 22, 0.85);
  backdrop-filter: blur(8px);
}

.modal-panel {
  position: relative;
  width: min(960px, 94vw);
  max-height: 92vh;
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
  border: 1px solid var(--cyan);
  border-radius: 16px;
  box-shadow: 0 30px 80px -20px rgba(0,0,0,0.8), 0 0 40px rgba(34, 211, 238, 0.15);
  overflow: hidden;
  animation: modalIn 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}

.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px 26px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(34, 211, 238, 0.08), transparent);
}
.modal-title { display: flex; flex-direction: column; gap: 2px; }
.modal-kicker {
  font-size: 10.5px;
  color: var(--cyan);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}
.modal-title h2 {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-0);
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: -0.01em;
}

.modal-close {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-2);
  width: 36px; height: 36px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.15s;
}
.modal-close:hover {
  color: var(--crimson-l);
  border-color: var(--crimson);
  background: rgba(239, 68, 68, 0.08);
}

.modal-body {
  padding: 22px 26px;
  overflow-y: auto;
  flex: 1;
}

.dm-section { margin-bottom: 22px; }
.dm-section:last-child { margin-bottom: 0; }

.dm-h3 {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-soft);
}
.dm-h3-accent {
  background: linear-gradient(90deg, var(--cyan), var(--indigo));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.dm-h3-hint {
  font-size: 10.5px;
  color: var(--text-3);
  text-transform: none;
  font-weight: 500;
}

.dm-hero {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 20px;
  background: var(--bg-0);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.dm-confidence { flex: 1; display: flex; flex-direction: column; gap: 6px; }

.dm-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.dm-kv {
  padding: 10px 12px;
  background: var(--bg-0);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex; flex-direction: column; gap: 3px;
}
.dm-kv span {
  font-size: 10px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}
.dm-kv b {
  font-size: 12px;
  color: var(--text-0);
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.dm-raw, .dm-json {
  background: var(--bg-0);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--text-1);
  max-height: 240px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.dm-why {
  background: linear-gradient(180deg, rgba(34, 211, 238, 0.06), rgba(129, 140, 248, 0.03));
  border: 1px solid rgba(34, 211, 238, 0.3);
  border-radius: 12px;
  padding: 18px 22px;
}
.dm-why .dm-h3 { border-bottom-color: rgba(34, 211, 238, 0.2); }
.dm-reasoning {
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--text-0);
}

.dm-trace {
  max-height: 320px;
  overflow-y: auto;
  background: var(--bg-0);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px;
}
.dm-trace .trace-step { padding: 10px 12px; border-bottom: 1px dashed var(--border-soft); }
.dm-trace .trace-step:last-child { border-bottom: none; }
.dm-trace .trace-empty { color: var(--text-3); font-style: italic; padding: 20px; text-align: center; font-size: 12px; }

.modal-footer {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 26px;
  border-top: 1px solid var(--border);
  background: rgba(10, 15, 30, 0.5);
}
.dm-position { color: var(--text-2); font-size: 11.5px; font-family: 'JetBrains Mono', monospace; }

/* Responsive */
@media (max-width: 1100px) {
  .grid { grid-template-columns: 1fr; }
  .header-strip { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .header-inner { padding: 20px 18px 14px; }
  .grid, .header-strip { padding: 0 18px; }
  .model-grid, .bench-metrics, .benchmark-grid, .verdict-meta { grid-template-columns: 1fr; }
  .verdict-badge-row { flex-direction: column; align-items: stretch; }
  .dm-grid { grid-template-columns: repeat(2, 1fr); }
  .batch-row { grid-template-columns: 100px 1fr 70px 50px auto; }
}
