/* HookAudit — Modern Security Workspace (Clean Light Theme)
 * Inspired by ui-ux-pro-max: High-legibility light theme, Bento Workspace, Zero Hardcoded Colors.
 * WCAG AAA compliant contrast. Responsive 320-1920px.
 * Zero external fonts/CDNs. 100% offline.
 */

/* ═══════════════════════════════════════════
   1. DESIGN TOKENS (Modern Clean Light Theme)
   ═══════════════════════════════════════════ */
:root {
  /* Surfaces */
  --bg: #f8fafc;
  --bg-subtle: #f1f5f9;
  --surface: #ffffff;
  --surface-subtle: #f8fafc;
  --surface-raised: #ffffff;
  --surface-inset: #f1f5f9;

  /* Ink / Text */
  --ink: #0f172a;
  --ink-secondary: #334155;
  --ink-muted: #64748b;
  --ink-faint: #94a3b8;

  /* Borders */
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --border-focus: #2563eb;

  /* Semantics */
  --success: #16a34a;
  --success-bg: #dcfce7;
  --success-border: #86efac;

  --warning: #d97706;
  --warning-bg: #fef3c7;
  --warning-border: #fde68a;

  --danger: #dc2626;
  --danger-bg: #fee2e2;
  --danger-border: #fca5a5;

  --info: #0284c7;
  --info-bg: #e0f2fe;
  --info-border: #7dd3fc;

  --purple: #9333ea;
  --purple-bg: #f3e8ff;
  --purple-border: #d8b4fe;

  /* Focus */
  --focus: #2563eb;
  --focus-ring: rgba(37, 99, 235, 0.25);

  /* Terminal */
  --terminal-bg: #0f172a;
  --terminal-ink: #f8fafc;
  --terminal-muted: #94a3b8;
  --terminal-border: #1e293b;
  --terminal-prompt: #38bdf8;

  /* Graph */
  --graph-bg: #ffffff;
  --graph-node-config: #ffffff;
  --graph-node-trigger: #0f172a;
  --graph-node-command: #f8fafc;
  --graph-node-script: #e0f2fe;
  --graph-node-file: #f8fafc;
  --graph-node-cap-default: #f8fafc;
  --graph-node-cap-network: #fef3c7;
  --graph-node-cap-process: #e0f2fe;
  --graph-node-cap-obf: #fee2e2;
  --graph-node-cap-cross: #ffedd5;
  --graph-node-cap-dynamic: #f3e8ff;
  --graph-stroke-default: #cbd5e1;
  --graph-stroke-trigger: #0f172a;
  --graph-stroke-script: #0284c7;
  --graph-stroke-cap: #64748b;
  --graph-edge-default: #94a3b8;
  --graph-edge-high: #dc2626;
  --graph-edge-network: #d97706;
  --graph-edge-diag: #64748b;

  /* Typography */
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", "JetBrains Mono", monospace;

  /* Spacing */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;
  --sp-10: 40px;
  --sp-12: 48px;

  /* Radii */
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 16px;
  --r-pill: 999px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.12);
  --shadow-glow: 0 0 16px rgba(37, 99, 235, 0.15);

  /* Transitions */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --duration: 150ms;
}

/* ═══════════════════════════════════════════
   2. RESET & BASE
   ═══════════════════════════════════════════ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  overflow-y: auto;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

a {
  color: var(--focus);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

table {
  border-collapse: collapse;
  width: 100%;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
  z-index: 9999;
}
.skip-link:focus {
  left: var(--sp-3);
  top: var(--sp-3);
  width: auto;
  height: auto;
  background: var(--surface);
  border: 2px solid var(--focus);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-sm);
  color: var(--ink);
  font-weight: 600;
  box-shadow: var(--shadow-md);
}

.shell {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--sp-4);
}

/* ═══════════════════════════════════════════
   3. APP HEADER (Top 60px Sticky Bar)
   ═══════════════════════════════════════════ */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  height: 60px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  cursor: pointer;
}

.brand-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--r-md);
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #ffffff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 13px;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.brand-text h1 {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 0;
  line-height: 1.1;
  color: var(--ink);
}

.brand-text p {
  font-size: 11px;
  color: var(--ink-muted);
  margin: 1px 0 0;
  line-height: 1;
}

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

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

/* Decision Status Pill in Header */
.header-decision-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  padding: 4px 12px;
  border-radius: var(--r-pill);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid var(--border);
  transition: all var(--duration) var(--ease);
}
.decision-pass {
  background: var(--success-bg);
  color: var(--success);
  border-color: var(--success-border);
}
.decision-review {
  background: var(--warning-bg);
  color: var(--warning);
  border-color: var(--warning-border);
}
.decision-block {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: var(--danger-border);
}

/* ═══════════════════════════════════════════
   4. WELCOME & INTRODUCTION HERO SECTION
   ═══════════════════════════════════════════ */
.intro-section {
  background: linear-gradient(180deg, #ffffff 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--border);
  padding: var(--sp-8) 0 var(--sp-6);
}

.intro-hero {
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}

.intro-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--r-pill);
  background: var(--info-bg);
  border: 1px solid var(--info-border);
  color: var(--info);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: var(--sp-3);
}

.intro-title {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1.25;
  margin-bottom: var(--sp-3);
}

.intro-subtitle {
  font-size: 14px;
  color: var(--ink-secondary);
  line-height: 1.6;
  max-width: 760px;
  margin: 0 auto var(--sp-5);
}

.intro-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-3);
  flex-wrap: wrap;
  margin-bottom: var(--sp-6);
}

/* 3 Quickstart Cards */
.quickstart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--sp-3);
  margin-top: var(--sp-4);
}

.quickstart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-4);
  text-align: left;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  transition: all var(--duration) var(--ease);
}
.quickstart-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}

.quickstart-num {
  width: 28px;
  height: 28px;
  border-radius: var(--r-md);
  background: var(--info-bg);
  border: 1px solid var(--info-border);
  color: var(--info);
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-weight: 800;
  font-size: 12px;
}
.quickstart-card h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}
.quickstart-card p {
  font-size: 12px;
  color: var(--ink-secondary);
  line-height: 1.5;
}

/* ═══════════════════════════════════════════
   5. BENTO 3-PANE WORKSPACE LAYOUT
   ═══════════════════════════════════════════ */
.workspace-wrapper {
  padding: var(--sp-6) 0 var(--sp-10);
}

.workspace-shell {
  display: grid;
  grid-template-columns: 290px 1fr 340px;
  gap: var(--sp-4);
  align-items: start;
}

/* 5A. Left Sidebar */
.sidebar-left {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.sidebar-section {
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--border);
}

.sidebar-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-muted);
  margin-bottom: var(--sp-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Repository Selector List */
.repo-nav-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.repo-nav-card {
  text-align: left;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--sp-3);
  cursor: pointer;
  width: 100%;
  transition: all var(--duration) var(--ease);
  color: var(--ink);
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.repo-nav-card:hover {
  background: #ffffff;
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}
.repo-nav-card.is-active {
  background: #ffffff;
  border-color: var(--focus);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15), var(--shadow-sm);
}
.repo-nav-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-1);
}
.repo-nav-name {
  font-weight: 700;
  font-size: 13px;
  color: var(--ink);
}
.repo-nav-desc {
  font-size: 11px;
  color: var(--ink-muted);
  line-height: 1.4;
}

/* Custom Folder Dropzone */
.repo-dropzone {
  border: 2px dashed var(--border-strong);
  border-radius: var(--r-md);
  padding: var(--sp-3);
  text-align: center;
  cursor: pointer;
  background: var(--bg);
  transition: all var(--duration) var(--ease);
  margin-top: var(--sp-2);
}
.repo-dropzone:hover, .repo-dropzone.is-dragover {
  border-color: var(--focus);
  background: var(--info-bg);
  box-shadow: var(--shadow-glow);
}
.dropzone-icon {
  font-size: 22px;
  margin-bottom: 2px;
  color: var(--focus);
}
.dropzone-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
}
.dropzone-sub {
  font-size: 11px;
  color: var(--ink-muted);
  margin-top: 2px;
}

/* Surface Tree in Sidebar */
.surface-nav-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-height: 240px;
  overflow-y: auto;
}
.surface-nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  border-radius: var(--r-sm);
  font-family: var(--mono);
  font-size: 11px;
  background: var(--surface-subtle);
  border: 1px solid transparent;
  cursor: pointer;
  color: var(--ink-secondary);
}
.surface-nav-item:hover {
  background: #ffffff;
  border-color: var(--border);
  color: var(--ink);
}
.surface-nav-item.is-active {
  border-color: var(--info-border);
  background: var(--info-bg);
  color: var(--info);
  font-weight: 600;
}

/* 5B. Center Canvas */
.main-canvas {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 640px;
}

/* Canvas Header Tabs */
.canvas-header-bar {
  background: var(--surface-subtle);
  border-bottom: 1px solid var(--border);
  padding: 0 var(--sp-4);
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.canvas-tabs {
  display: flex;
  gap: var(--sp-1);
}

.canvas-tab {
  appearance: none;
  background: none;
  border: none;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-muted);
  cursor: pointer;
  border-radius: var(--r-sm);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all var(--duration) var(--ease);
}
.canvas-tab:hover {
  color: var(--ink);
  background: var(--surface);
}
.canvas-tab.is-active {
  color: var(--focus);
  background: #ffffff;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}

.canvas-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

/* Canvas Viewport */
.canvas-viewport {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
}

.canvas-view-pane {
  flex: 1;
  display: none;
}
.canvas-view-pane.is-active {
  display: flex;
  flex-direction: column;
}

/* Pan-Zoom Topology Viewport */
.topology-viewport {
  flex: 1;
  min-height: 480px;
  position: relative;
  overflow: hidden;
  background: #ffffff;
  cursor: grab;
}
.topology-viewport:active {
  cursor: grabbing;
}

.topology-canvas-content {
  transform-origin: 0 0;
  position: absolute;
  top: 0;
  left: 0;
}

/* Floating Zoom Controls */
.zoom-controls {
  position: absolute;
  bottom: var(--sp-4);
  right: var(--sp-4);
  display: flex;
  align-items: center;
  gap: 4px;
  background: #ffffff;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  padding: 4px;
  box-shadow: var(--shadow-md);
  z-index: 50;
}
.zoom-btn {
  appearance: none;
  background: transparent;
  border: none;
  color: var(--ink-secondary);
  width: 28px;
  height: 28px;
  border-radius: var(--r-sm);
  display: grid;
  place-items: center;
  cursor: pointer;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 14px;
}
.zoom-btn:hover {
  background: var(--bg-subtle);
  color: var(--ink);
}
.zoom-level-text {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-muted);
  padding: 0 6px;
  min-width: 44px;
  text-align: center;
}

/* Floating Filter Overlay */
.graph-filter-overlay {
  position: absolute;
  top: var(--sp-3);
  left: var(--sp-3);
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-pill);
  padding: 4px 10px;
  box-shadow: var(--shadow-sm);
  z-index: 40;
}

/* 5C. Right Inspector Drawer */
.inspector-right {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.inspector-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: var(--surface-subtle);
  height: 44px;
}
.inspector-tab {
  flex: 1;
  appearance: none;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
  cursor: pointer;
  transition: all var(--duration) var(--ease);
}
.inspector-tab:hover {
  color: var(--ink);
}
.inspector-tab.is-active {
  color: var(--focus);
  border-bottom-color: var(--focus);
  background: var(--surface);
}

.inspector-body {
  padding: var(--sp-4);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  max-height: 600px;
  overflow-y: auto;
}

/* ═══════════════════════════════════════════
   6. VISUAL INLINE CODE DIFF VIEWER
   ═══════════════════════════════════════════ */
.diff-container {
  padding: var(--sp-4);
}

.diff-file-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  margin-bottom: var(--sp-4);
  box-shadow: var(--shadow-sm);
}

.diff-file-header {
  padding: 8px 12px;
  background: var(--surface-subtle);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 12px;
}

.diff-lines {
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.6;
  background: #ffffff;
}

.diff-row {
  display: flex;
  padding: 2px 0;
}
.diff-row-add {
  background: #dcfce7;
  color: #15803d;
}
.diff-row-del {
  background: #fee2e2;
  color: #b91c1c;
}
.diff-row-ctx {
  color: var(--ink-secondary);
}

.diff-ln {
  width: 44px;
  padding-right: 12px;
  text-align: right;
  color: var(--ink-faint);
  user-select: none;
  flex-shrink: 0;
}

.diff-sign {
  width: 20px;
  text-align: center;
  font-weight: 700;
  user-select: none;
  flex-shrink: 0;
}

.diff-text {
  flex: 1;
  white-space: pre-wrap;
  word-break: break-all;
}

/* ═══════════════════════════════════════════
   7. INTERACTIVE TERMINAL SIMULATOR
   ═══════════════════════════════════════════ */
.terminal-interactive {
  display: flex;
  flex-direction: column;
  background: var(--terminal-bg);
  border-radius: 0 0 var(--r-lg) var(--r-lg);
  overflow: hidden;
  height: 560px;
}

.terminal-scroll {
  flex: 1;
  overflow-y: auto;
  padding: var(--sp-3);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.6;
  color: var(--terminal-ink);
}

.terminal-input-bar {
  display: flex;
  align-items: center;
  border-top: 1px solid var(--terminal-border);
  padding: 8px 12px;
  background: #090d16;
}

.terminal-prompt-sym {
  color: var(--terminal-prompt);
  font-family: var(--mono);
  font-weight: 700;
  font-size: 13px;
  margin-right: 8px;
}

.terminal-input-field {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #f8fafc;
  font-family: var(--mono);
  font-size: 12px;
}

.terminal-quick-chips {
  display: flex;
  gap: 4px;
  padding: 6px 12px;
  background: #090d16;
  border-top: 1px solid var(--terminal-border);
  overflow-x: auto;
}
.terminal-chip {
  appearance: none;
  background: #1e293b;
  border: 1px solid var(--terminal-border);
  color: #94a3b8;
  font-family: var(--mono);
  font-size: 10px;
  padding: 2px 6px;
  border-radius: var(--r-sm);
  cursor: pointer;
  white-space: nowrap;
}
.terminal-chip:hover {
  color: #ffffff;
  background: #334155;
}

.terminal-line {
  margin-bottom: var(--sp-1);
}
.terminal-line .prompt {
  color: #38bdf8;
  font-weight: 700;
}
.terminal-line .cmd {
  color: #f8fafc;
}
.terminal-line .out {
  color: #cbd5e1;
  white-space: pre-wrap;
}

/* ═══════════════════════════════════════════
   8. BUTTONS, BADGES & CARDS
   ═══════════════════════════════════════════ */
.btn {
  appearance: none;
  font: inherit;
  font-weight: 600;
  font-size: 13px;
  padding: 7px 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
  transition: all var(--duration) var(--ease);
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
}
.btn:hover {
  background: var(--bg-subtle);
  border-color: #94a3b8;
}
.btn:active {
  transform: translateY(1px);
}
.btn-primary {
  background: #2563eb;
  color: #ffffff;
  border-color: #1d4ed8;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}
.btn-primary:hover {
  background: #1d4ed8;
  border-color: #1e40af;
}
.btn-subtle {
  background: var(--surface-subtle);
  color: var(--ink-secondary);
  border-color: var(--border);
}
.btn-subtle:hover {
  background: #ffffff;
  color: var(--ink);
}
.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--ink-muted);
  box-shadow: none;
}
.btn-ghost:hover {
  background: var(--surface-subtle);
  color: var(--ink);
}
.btn-sm {
  font-size: 12px;
  padding: 4px 10px;
}

.badge {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
  background: var(--surface-subtle);
  color: var(--ink-muted);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.badge-success, .badge--pass { background: var(--success-bg); color: var(--success); border-color: var(--success-border); }
.badge-warning, .badge--high { background: var(--warning-bg); color: var(--warning); border-color: var(--warning-border); }
.badge-danger, .badge--critical { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-border); }
.badge-info, .badge--medium { background: var(--info-bg); color: var(--info); border-color: var(--info-border); }
.badge--low { background: var(--surface-subtle); color: var(--ink-muted); border-color: var(--border); }

/* Capability Chips */
.cap-chip {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.02em;
  padding: 3px 8px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
  background: var(--surface-subtle);
  color: var(--ink-secondary);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: all var(--duration) var(--ease);
}
.cap-chip:hover {
  border-color: var(--border-strong);
  background: #ffffff;
}
.cap-chip--net     { color: #b45309; background: #fef3c7; border-color: #fde68a; }
.cap-chip--process { color: #0369a1; background: #e0f2fe; border-color: #bae6fd; }
.cap-chip--cross   { color: #c2410c; background: #ffedd5; border-color: #fed7aa; }
.cap-chip--obf     { color: #b91c1c; background: #fee2e2; border-color: #fca5a5; }
.cap-chip--dynamic { color: #7e22ce; background: #f3e8ff; border-color: #e9d5ff; }
.cap-chip--p0      { color: var(--ink-muted); background: var(--surface-subtle); border-color: var(--border); }
.cap-chips { display: flex; flex-wrap: wrap; gap: 4px; }

/* Dashboard Metric Cards */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: var(--sp-2);
  margin-bottom: var(--sp-3);
}
.dash-card {
  appearance: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--sp-3);
  text-align: left;
  cursor: pointer;
  transition: all var(--duration) var(--ease);
  display: flex;
  flex-direction: column;
  gap: 2px;
  box-shadow: var(--shadow-sm);
}
.dash-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}
.dash-label {
  font-size: 11px;
  color: var(--ink-muted);
  font-weight: 600;
}
.dash-value {
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.1;
}
.dash-value--alert { color: var(--warning); }
.dash-value--critical { color: var(--danger); }
.dash-value--ok { color: var(--success); }
.dash-foot {
  font-size: 10px;
  color: var(--ink-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-hint, .dash-trace { display: none; }

/* Graph SVG */
.graph-svg {
  display: block;
  user-select: none;
}
.graph-node {
  cursor: pointer;
}
.graph-node rect {
  transition: stroke 0.15s, stroke-width 0.15s;
}
.graph-node:hover rect {
  stroke-width: 2.2px !important;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.1));
}
.graph-node.is-selected rect {
  stroke: var(--focus) !important;
  stroke-width: 2.8px !important;
  filter: drop-shadow(0 2px 8px rgba(37,99,235,0.25));
}

/* Evidence Toolbar & Tables */
.evidence-toolbar {
  display: flex;
  gap: var(--sp-2);
  padding: var(--sp-3);
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  margin-bottom: var(--sp-3);
  flex-wrap: wrap;
}
.evidence-filter input, .evidence-filter select {
  font-size: 12px;
  padding: 6px 10px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border-strong);
  background: #ffffff;
  color: var(--ink);
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
}
th {
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-muted);
  background: var(--surface-subtle);
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1;
}
td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  color: var(--ink-secondary);
  font-size: 12px;
}
tr:hover td {
  background: var(--surface-subtle);
  color: var(--ink);
}
.mono-cell {
  font-family: var(--mono);
}

/* File Viewer */
.file-viewer {
  background: var(--terminal-bg);
  color: var(--terminal-ink);
  border-radius: var(--r-md);
  padding: var(--sp-3);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.6;
  overflow: auto;
}
.file-viewer pre {
  margin: 0;
  white-space: pre-wrap;
}

/* Story section */
.how-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--sp-3);
  padding: var(--sp-2) 0;
}
.how-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-4);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  box-shadow: var(--shadow-sm);
}
.how-num {
  width: 28px;
  height: 28px;
  border-radius: var(--r-md);
  background: var(--info-bg);
  border: 1px solid var(--info-border);
  color: var(--info);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 12px;
  font-family: var(--mono);
}
.how-card h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}
.how-story {
  font-size: 12px;
  color: var(--ink-secondary);
  line-height: 1.5;
}
.how-example {
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 6px 8px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-muted);
}

/* ═══════════════════════════════════════════
   ENHANCED INTERACTIVE GUIDED TOUR SPOTLIGHT
   ═══════════════════════════════════════════ */
.tour-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
}

/* 4 Curtains around the target: ZERO overlay over target = 100% sharp, 0% blur */
.tour-curtain {
  position: fixed;
  background: rgba(15, 23, 42, 0.52);
  backdrop-filter: blur(2px);
  pointer-events: auto;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 9999;
}

/* Glowing blue border around the crystal-clear target hole */
.tour-spotlight-border {
  position: fixed;
  border-radius: var(--r-md);
  border: 2px solid var(--focus);
  box-shadow: 0 0 24px rgba(37, 99, 235, 0.6), inset 0 0 12px rgba(37, 99, 235, 0.15);
  pointer-events: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 10000;
}

/* Floating Tour Popover Card */
.tour-popover-card {
  position: fixed;
  background: #ffffff;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-lg);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(0, 0, 0, 0.05);
  z-index: 10001;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: top 0.25s cubic-bezier(0.4, 0, 0.2, 1), left 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  animation: tourPopIn 0.2s ease-out;
  pointer-events: auto !important;
  cursor: default;
}

.tour-popover-card button,
.tour-popover-card a,
.tour-popover-card input {
  pointer-events: auto !important;
  cursor: pointer !important;
}

@keyframes tourPopIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(4px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.tour-popover-header {
  padding: 12px 16px;
  background: var(--surface-subtle);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tour-close-btn {
  appearance: none;
  background: transparent;
  border: none;
  font-size: 18px;
  line-height: 1;
  color: var(--ink-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--r-sm);
}
.tour-close-btn:hover {
  color: var(--ink);
  background: var(--border);
}

.tour-popover-body {
  padding: 16px;
}

.tour-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 8px;
}
.tour-dot {
  width: 7px;
  height: 7px;
  border-radius: var(--r-pill);
  background: var(--border-strong);
  transition: all 0.2s ease;
}
.tour-dot.is-active {
  width: 18px;
  background: var(--focus);
}

.tour-popover-footer {
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  background: var(--surface-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.empty {
  padding: var(--sp-6);
  text-align: center;
  color: var(--ink-muted);
  font-size: 13px;
}

/* Responsive */
@media (max-width: 1100px) {
  .workspace-shell {
    grid-template-columns: 270px 1fr;
  }
  .inspector-right {
    grid-column: span 2;
  }
}
@media (max-width: 768px) {
  .workspace-shell {
    grid-template-columns: 1fr;
  }
  .inspector-right {
    grid-column: span 1;
  }
  .intro-title {
    font-size: 24px;
  }
}

.hidden { display: none !important; }
