:root {
  --bg: #090d16;
  --surface: #111827;
  --surface-2: #1a2234;
  --border: #253047;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --critical: #ef4444;
  --high: #f97316;
  --medium: #eab308;
  --low: #38bdf8;
  --pass: #22c55e;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, sans-serif;
  line-height: 1.5;
}

.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }

.topbar {
  border-bottom: 1px solid var(--border);
  background: rgba(17, 24, 39, 0.85);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand { display: flex; align-items: center; gap: 0.75rem; }
.brand-shield {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: linear-gradient(135deg, #2563eb, #06b6d4);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
}
.brand-name { font-weight: 700; font-size: 1.05rem; display: block; line-height: 1.1; }
.brand-tag { font-size: 0.75rem; color: var(--muted); }

.container { max-width: 1320px; margin: 0 auto; padding: 1.5rem; }

.hero-card {
  background: linear-gradient(180deg, #131c2e 0%, #0f1624 100%);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.75rem;
  margin-bottom: 1.5rem;
}

.hero-card h1 { margin: 0 0 0.5rem; font-size: 1.65rem; letter-spacing: -0.02em; }
.hero-sub { margin: 0 0 1.25rem; color: var(--muted); max-width: 780px; }
.hero-sub code { color: #cbd5e1; background: var(--surface-2); padding: 0.1rem 0.35rem; border-radius: 4px; }

.audit-form { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.audit-form input {
  flex: 1 1 380px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-family: var(--mono);
  font-size: 0.9rem;
}
.audit-form input:focus { outline: 2px solid var(--primary); border-color: transparent; }

.btn {
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0.7rem 1.15rem;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.15s ease, opacity 0.15s ease;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); }
.btn-secondary { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.btn-secondary:hover:not(:disabled) { background: #243049; }
.btn-ghost { background: transparent; color: var(--muted); border-color: var(--border); }
.btn-sm { padding: 0.4rem 0.75rem; font-size: 0.8rem; }

.preset-row { display: flex; align-items: center; gap: 0.6rem; margin-top: 1rem; flex-wrap: wrap; }
.preset-label { font-size: 0.8rem; color: var(--muted); }
.pill {
  border-radius: 9999px;
  padding: 0.35rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
}
.pill-clean:hover { border-color: var(--pass); color: #86efac; }
.pill-trap:hover { border-color: var(--critical); color: #fca5a5; }

.status-banner {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 1.25rem;
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.35);
  color: #bfdbfe;
  font-size: 0.9rem;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 1.25rem;
  align-items: start;
}
@media (max-width: 1024px) {
  .workspace-grid { grid-template-columns: 1fr; }
}

.main-results { display: flex; flex-direction: column; gap: 1.25rem; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}
.card-header h3 { margin: 0; font-size: 1rem; }

.summary-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 1.25rem;
}
@media (max-width: 760px) {
  .summary-grid { grid-template-columns: 1fr; }
}

.score-card { display: flex; align-items: center; gap: 1.25rem; }
.gauge-wrap { position: relative; width: 112px; height: 112px; flex-shrink: 0; }
.score-gauge { width: 100%; height: 100%; transform: rotate(-90deg); }
.gauge-bg { fill: none; stroke: var(--surface-2); stroke-width: 10; }
.gauge-arc { fill: none; stroke: var(--pass); stroke-width: 10; stroke-linecap: round; transition: stroke-dashoffset 0.4s ease, stroke 0.3s ease; }
.gauge-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.score-value { font-size: 1.65rem; font-weight: 800; line-height: 1; }
.score-max { font-size: 0.72rem; color: var(--muted); }

.score-meta h2 { margin: 0.4rem 0 0.2rem; font-size: 1.15rem; }
.score-meta p { margin: 0; font-size: 0.8rem; word-break: break-all; }
.score-badges { display: flex; gap: 0.5rem; align-items: center; }

.grade-badge, .conformance-badge, .pin-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.hash-box {
  display: block;
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 0.55rem 0.75rem;
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 0.75rem;
  word-break: break-all;
  margin-bottom: 0.75rem;
  color: #93c5fd;
}
.pin-actions { display: flex; gap: 0.5rem; }

.legend { display: flex; gap: 0.85rem; font-size: 0.78rem; color: var(--muted); }
.legend-item { display: inline-flex; align-items: center; gap: 0.35rem; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.dot-pass { background: var(--pass); }
.dot-medium { background: var(--medium); }
.dot-high { background: var(--high); }
.dot-critical { background: var(--critical); }

.svg-stage {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
#topology-svg { width: 100%; height: auto; display: block; }

.findings-header { flex-wrap: wrap; }
.filter-bar { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.filter-btn {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 6px;
  padding: 0.3rem 0.65rem;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}
.filter-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.findings-list { display: flex; flex-direction: column; gap: 0.65rem; }
.finding-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-left-width: 4px;
  border-radius: 8px;
  padding: 0.8rem 1rem;
}
.finding-item.sev-critical { border-left-color: var(--critical); }
.finding-item.sev-high { border-left-color: var(--high); }
.finding-item.sev-medium { border-left-color: var(--medium); }
.finding-item.sev-low { border-left-color: var(--low); }
.finding-item.sev-pass { border-left-color: var(--pass); }

.finding-top { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.finding-title { font-weight: 600; font-size: 0.92rem; }
.sev-pill {
  text-transform: uppercase;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  letter-spacing: 0.04em;
}
.sev-pill.critical { background: rgba(239,68,68,0.18); color: #fca5a5; }
.sev-pill.high { background: rgba(249,115,22,0.18); color: #fdba74; }
.sev-pill.medium { background: rgba(234,179,8,0.18); color: #fde047; }
.sev-pill.low { background: rgba(56,189,248,0.18); color: #7dd3fc; }
.sev-pill.pass { background: rgba(34,197,94,0.18); color: #86efac; }

.finding-cat { font-size: 0.75rem; color: var(--muted); margin-top: 0.2rem; }
.finding-details { margin-top: 0.5rem; font-size: 0.82rem; color: #cbd5e1; }
.finding-details summary { cursor: pointer; color: var(--muted); font-size: 0.78rem; }
.finding-evidence {
  margin-top: 0.4rem;
  background: var(--surface);
  padding: 0.5rem 0.65rem;
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 0.76rem;
  word-break: break-word;
}
.finding-remediation { margin-top: 0.4rem; color: #93c5fd; }

.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 1.5rem; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.7); }
.modal-panel {
  position: relative;
  width: min(740px, 100%);
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
}
.patch-code {
  flex: 1;
  overflow: auto;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: #a7f3d0;
}
.modal-footer { margin-top: 0.9rem; display: flex; justify-content: flex-end; }

/* Phase 3: Embedded Open Agentic Web runtime dark-mode styling */
.pill-self:hover { border-color: var(--primary); color: #93c5fd; }

#agent-app {
  --ns-font: Inter, system-ui, sans-serif;
  --ns-bg: #0b101b;
  --ns-fg: #f1f5f9;
  --ns-primary: #2563eb;
  --ns-accent: #3b82f6;
  --ns-border: #253047;
  --ns-panelbg: #111827;
  --ns-msgbg: #1a2234;
  --ns-muted: #94a3b8;
  margin-top: 0.75rem;
}

#agent-app.ns-composed-app [data-ns-slot="chat"] {
  height: 540px;
}

#agent-app .ns-chat { background: var(--ns-bg); }
#agent-app .assistant-settings { margin: 0.5rem 0; font-size: 0.85rem; color: var(--muted); }
#agent-app .assistant-settings summary { cursor: pointer; }
#agent-app .ns-msg { overflow-wrap: break-word; }
#agent-app .ns-consent { background: #1e293b; border-color: #eab308; }
#agent-app .ns-consent-actions { flex-wrap: wrap; }
#agent-app .ns-consent-actions button { white-space: nowrap; }

.assistant-review {
  background: var(--surface);
  color: var(--text);
  max-width: 600px;
  width: 90%;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
}
.assistant-review dl { display: grid; grid-template-columns: fit-content(35%) 1fr; gap: 6px 16px; margin: 12px 0; }
.assistant-review dt { font-weight: 600; color: var(--muted); }
.assistant-review dd { margin: 0; overflow-wrap: anywhere; font-family: var(--mono); font-size: 0.82rem; }
.assistant-review button { margin-right: 8px; padding: 0.5rem 1rem; border-radius: 8px; font-weight: 600; cursor: pointer; background: var(--primary); color: #fff; border: none; }
.assistant-review .assistant-decline { background: transparent; color: var(--muted); border: 1px solid var(--border); }

/* Phase 4: Export, Badge Toast, and Rug-Pull Simulation UI */
.topbar-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.btn-danger-outline {
  background: rgba(239, 68, 68, 0.12);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.45);
}
.btn-danger-outline:hover { background: rgba(239, 68, 68, 0.22); }
.pin-actions { flex-wrap: wrap; }

.rugpull-banner {
  padding: 0.9rem 1.1rem;
  border-radius: 10px;
  margin-bottom: 1.25rem;
  background: rgba(239, 68, 68, 0.14);
  border: 1px solid rgba(239, 68, 68, 0.55);
  color: #fecaca;
  font-size: 0.88rem;
}
.rugpull-banner strong { color: #fca5a5; display: block; margin-bottom: 0.25rem; }
.rugpull-banner code { font-family: var(--mono); font-size: 0.78rem; background: rgba(0,0,0,0.3); padding: 0.1rem 0.35rem; border-radius: 4px; }

.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 60;
  background: #1e293b;
  color: #f1f5f9;
  border: 1px solid var(--primary);
  padding: 0.65rem 1rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.45);
}

/* Phase 5 (v2): Supply-Chain Crawl Depth, OWASP Pill Bar, and Multi-Hop Badges */
.depth-select {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.7rem 0.8rem;
  border-radius: 8px;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
}
.pill-supply:hover { border-color: var(--medium); color: #fde047; }

.supply-chain-scores {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.45rem;
  font-size: 0.76rem;
}
.sc-chip {
  padding: 0.15rem 0.5rem;
  border-radius: 5px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-weight: 600;
}
.sc-chip.warn {
  background: rgba(239, 68, 68, 0.16);
  border-color: rgba(239, 68, 68, 0.45);
  color: #fca5a5;
}

.owasp-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.9rem;
}
.owasp-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 9999px;
  padding: 0.25rem 0.7rem;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
}
.owasp-pill.has-risk { color: #fca5a5; border-color: rgba(239, 68, 68, 0.45); }
.owasp-pill.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.owasp-tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  background: var(--surface-2);
  color: #93c5fd;
  margin-right: 0.45rem;
}

/* Phase 6 (v2 - Sprint 3): Active Red-Team Sandbox */
.redteam-header { flex-wrap: wrap; }
.redteam-title-wrap { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.redteam-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.redteam-drawer {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.9rem;
  margin-bottom: 1rem;
}
.drawer-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}
@media (max-width: 760px) {
  .drawer-fields { grid-template-columns: 1fr; }
}
.drawer-fields label { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.75rem; color: var(--muted); }
.drawer-fields input {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.45rem 0.65rem;
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 0.8rem;
}
.drawer-actions { display: flex; gap: 0.5rem; margin-top: 0.75rem; }

.redteam-matrix { display: flex; flex-direction: column; gap: 0.5rem; }
.probe-row {
  background: var(--bg);
  border: 1px solid var(--border);
  border-left-width: 4px;
  border-radius: 8px;
  padding: 0.65rem 0.9rem;
}
.probe-row.resilient { border-left-color: var(--pass); }
.probe-row.compromised { border-left-color: var(--critical); }
.probe-top { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.probe-id { font-family: var(--mono); font-weight: 700; font-size: 0.8rem; color: #cbd5e1; margin-right: 0.45rem; }
.probe-title { font-weight: 600; font-size: 0.88rem; }
.probe-status {
  font-size: 0.7rem;
  font-weight: 800;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  text-transform: uppercase;
}
.probe-status.resilient { background: rgba(34,197,94,0.18); color: #86efac; }
.probe-status.compromised { background: rgba(239,68,68,0.18); color: #fca5a5; }

/* Phase 8 (v3 - Sprint 6): X-Ray, Red/Green Patch Workbench, & Side-by-Side Compare */
.xray-textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 0.65rem 0.8rem;
  font-family: var(--mono);
  font-size: 0.82rem;
  margin-bottom: 0.75rem;
}
.xray-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.9rem; }
@media (max-width: 760px) { .xray-grid { grid-template-columns: 1fr; } }
.xray-box { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 0.75rem; }
.xray-box-title { font-size: 0.75rem; font-weight: 700; color: var(--muted); margin-bottom: 0.45rem; text-transform: uppercase; }
.xray-preview { font-size: 0.78rem; white-space: pre-wrap; word-break: break-word; line-height: 1.45; }
.xray-hidden-tail { background: rgba(239, 68, 68, 0.28); color: #fecaca; border-radius: 3px; padding: 0 2px; }

.tab-bar { display: flex; gap: 0.5rem; margin-bottom: 0.75rem; }
.diff-view {
  flex: 1;
  overflow: auto;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.6rem 0;
  font-family: var(--mono);
  font-size: 0.76rem;
  max-height: 55vh;
}
.diff-line { padding: 0.1rem 0.85rem; white-space: pre-wrap; word-break: break-word; }
.diff-line.add { background: rgba(34, 197, 94, 0.16); color: #86efac; }
.diff-line.del { background: rgba(239, 68, 68, 0.16); color: #fca5a5; }
.diff-line.same { color: #94a3b8; }

.compare-form { display: flex; gap: 0.65rem; flex-wrap: wrap; margin-bottom: 1rem; }
.compare-form input {
  flex: 1 1 260px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  font-family: var(--mono);
  font-size: 0.82rem;
}
.compare-table { width: 100%; border-collapse: collapse; font-size: 0.84rem; }
.compare-table th, .compare-table td {
  border-bottom: 1px solid var(--border);
  padding: 0.55rem 0.75rem;
  text-align: left;
}
.compare-table th { color: var(--muted); font-weight: 600; }

/* Phase 10 (v4 - Sprint 10): Security Drift & MITRE ATLAS x OWASP Threat Matrix */
.drift-row { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; }
.drift-sparkline {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.35rem 0.5rem;
  flex-shrink: 0;
}

.threat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}
@media (max-width: 1100px) { .threat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .threat-grid { grid-template-columns: 1fr; } }

.threat-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-top-width: 3px;
  border-radius: 8px;
  padding: 0.7rem 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.threat-card.defended { border-top-color: var(--pass); }
.threat-card.warning { border-top-color: var(--medium); }
.threat-card.exposed { border-top-color: var(--critical); }
.threat-card-top { display: flex; justify-content: space-between; align-items: center; gap: 0.4rem; }
.threat-ids { font-family: var(--mono); font-size: 0.68rem; color: #93c5fd; }
.threat-title { font-weight: 600; font-size: 0.82rem; line-height: 1.3; }
.threat-summary { font-size: 0.74rem; color: var(--muted); }

/* Phase 12 (v4 - Sprint 12): Runtime Dark-Mode Contrast Overrides */
#agent-app .ns-agents,
#agent-app .ns-anode,
#agent-app .ns-settings-body,
#agent-app .ns-mact {
  background: #161d2e !important;
  color: #f1f5f9 !important;
  border: 1px solid #2a354d !important;
}
#agent-app .ns-anode strong,
#agent-app .ns-anode span,
#agent-app .ns-agents h3 {
  color: #f1f5f9 !important;
}
#agent-app .ns-anode small,
#agent-app .ns-anode .ns-arole {
  color: #94a3b8 !important;
}
#agent-app select,
#agent-app input,
#agent-app textarea {
  background: #0b101b !important;
  color: #f1f5f9 !important;
  border: 1px solid #2a354d !important;
}
#agent-app .ns-devtoggle:not(.on) {
  background: #161d2e !important;
  color: #cbd5e1 !important;
  border-color: #2a354d !important;
}

/* Phase 14 (v5 - Sprint 14): MCP, Tool Schema & Token-Budget Analysis */
.mcp-stats-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}
@media (max-width: 760px) { .mcp-stats-row { grid-template-columns: 1fr; } }
.mcp-stat-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.65rem 0.85rem;
}
.mcp-stat-label { font-size: 0.72rem; color: var(--muted); text-transform: uppercase; font-weight: 700; }
.mcp-stat-val { font-size: 1rem; font-weight: 700; margin-top: 0.2rem; font-family: var(--mono); }
.mcp-agent-bars { display: flex; flex-direction: column; gap: 0.45rem; }
.token-bar-row { display: grid; grid-template-columns: 180px 1fr 90px; align-items: center; gap: 0.75rem; font-size: 0.78rem; }
.token-bar-track { height: 8px; background: var(--bg); border: 1px solid var(--border); border-radius: 9999px; overflow: hidden; }
.token-bar-fill { height: 100%; background: var(--primary); border-radius: 9999px; }

/* Phase 17 (v6 - Sprint 17): Top Navbar Dropdown & 4-Axis Security Posture */
.dropdown-wrap { position: relative; }
.dropdown-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 220px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.35rem;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  gap: 2px;
  z-index: 40;
}
.dropdown-item {
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  color: var(--text);
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
}
.dropdown-item:hover:not(:disabled) { background: var(--surface-2); }
.dropdown-item:disabled { opacity: 0.45; cursor: not-allowed; }

.posture-grid {
  display: grid;
  grid-template-columns: 294px minmax(0, 1fr);
  gap: 1.25rem;
  align-items: center;
}
@media (max-width: 760px) { .posture-grid { grid-template-columns: 1fr; } }
.posture-radar-wrap {
  display: grid;
  place-items: center;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.25rem;
}
.posture-bars-wrap { display: flex; flex-direction: column; gap: 0.75rem; }
.posture-bar-item { display: flex; flex-direction: column; gap: 0.3rem; }
.posture-bar-head { display: flex; justify-content: space-between; font-size: 0.82rem; font-weight: 600; }

/* Sprint 18: Information-Flow Taint & Lethal Trifecta */
.taint-axes-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}
.taint-axis-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.65rem;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--muted);
}
.taint-axis-badge.active {
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(239, 68, 68, 0.45);
  color: #fca5a5;
}
.taint-axis-badge.active.warn {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.4);
  color: #fcd34d;
}
.taint-paths-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.6rem;
}
.taint-path-card {
  background: rgba(127, 29, 29, 0.22);
  border: 1px solid rgba(239, 68, 68, 0.4);
  border-radius: 8px;
  padding: 0.6rem 0.75rem;
}
.taint-chain {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.3rem;
}
.taint-node-chip {
  font-family: ui-monospace, monospace;
  font-size: 0.76rem;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(248, 113, 113, 0.4);
  color: #fecaca;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
}
.taint-arrow {
  color: #f87171;
  font-weight: 700;
  font-size: 0.82rem;
}

/* Sprint 19: Multi-Turn Crescendo Fuzzer */
.fuzzer-mutation-bars {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
  margin-bottom: 0.85rem;
}
@media (max-width: 720px) { .fuzzer-mutation-bars { grid-template-columns: 1fr; } }
.fuzzer-mut-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.55rem 0.7rem;
}
.fuzzer-mut-head {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}
.fuzzer-mut-track {
  height: 6px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.16);
  overflow: hidden;
}
.fuzzer-mut-fill {
  height: 100%;
  border-radius: 999px;
}
.fuzzer-runs-table {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.fuzzer-turn-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 0.45rem;
}
.fuzzer-turn-item {
  font-family: ui-monospace, monospace;
  font-size: 0.76rem;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.4rem 0.55rem;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Sprint 20: RFC 6962 Merkle Tree Transparency Log */
.merkle-root-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}
.merkle-proof-banner {
  border-radius: 8px;
  padding: 0.6rem 0.75rem;
  margin-bottom: 0.65rem;
  font-size: 0.82rem;
  border: 1px solid var(--border);
  background: var(--bg);
}
.merkle-proof-banner.valid {
  border-color: rgba(34, 197, 94, 0.45);
  background: rgba(20, 83, 45, 0.25);
  color: #bbf7d0;
}
.merkle-proof-banner.invalid {
  border-color: rgba(239, 68, 68, 0.5);
  background: rgba(127, 29, 29, 0.28);
  color: #fecaca;
}
.merkle-entries-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.merkle-entry-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 0.7rem;
  font-size: 0.82rem;
}
.merkle-entry-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

/* Sprint 21: Formal Model Checker */
.formal-invariants-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.formal-inv-row {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.6rem 0.75rem;
}
.formal-inv-row.proven { border-left: 3px solid #22c55e; }
.formal-inv-row.refuted { border-left: 3px solid #ef4444; }
.formal-inv-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.45rem;
}
.formal-formula {
  display: block;
  margin-top: 0.3rem;
  font-family: ui-monospace, monospace;
  font-size: 0.76rem;
  color: #93c5fd;
}
.formal-witness-list {
  margin: 0.4rem 0 0 1.1rem;
  padding: 0;
  font-family: ui-monospace, monospace;
  font-size: 0.76rem;
  color: #fecaca;
}

/* Sprint 23: 4-Tab Enterprise Security Console */
.workspace-tabs {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding: 0.55rem 0.65rem;
  margin-bottom: 1rem;
  background: rgba(11, 16, 32, 0.94);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.workspace-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.48rem 0.85rem;
  border-radius: 7px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.workspace-tab:hover {
  color: var(--text);
  background: var(--surface-2);
}
.workspace-tab.active {
  color: #f8fafc;
  background: var(--surface-2);
  border-color: rgba(96, 165, 250, 0.5);
  box-shadow: inset 0 -2px 0 #60a5fa;
}
.tab-pill {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.16);
  color: #cbd5e1;
}
.tab-pill.ok {
  background: rgba(34, 197, 94, 0.16);
  color: #86efac;
}
.tab-pill.danger {
  background: rgba(239, 68, 68, 0.18);
  color: #fca5a5;
}
.workspace-tabpanel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.workspace-tabpanel.hidden {
  display: none;
}

/* Sprint 25: 1-Click 60s Judge Tour */
.pill-tour {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.25), rgba(168, 85, 247, 0.25));
  border-color: rgba(96, 165, 250, 0.65);
  color: #e0f2fe;
  font-weight: 700;
}
.pill-tour:hover {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.4), rgba(168, 85, 247, 0.4));
}
.judge-tour-bar {
  position: fixed;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  width: min(920px, calc(100vw - 2rem));
  z-index: 60;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 1.1rem;
  background: rgba(15, 23, 42, 0.97);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(96, 165, 250, 0.55);
  border-radius: 12px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.55);
}
.judge-tour-bar.hidden {
  display: none;
}
.judge-tour-info {
  flex: 1 1 380px;
}
.judge-tour-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.judge-tour-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
