:root {
  --bg-primary: #F8FAFC;
  --bg-secondary: #FFFFFF;
  --bg-tertiary: #F0F9FF;
  --bg-hover: #E0F2FE;
  --border: #E2E8F0;
  --border-hover: #CBD5E1;
  --text-primary: #0F172A;
  --text-secondary: #64748B;
  --text-muted: #94A3B8;
  --accent: #0077B6;
  --accent-light: #0EA5E9;
  --accent-dark: #075985;
  --accent-glow: rgba(0, 119, 182, 0.2);
  --secondary-accent: #14B8A6;
  --success: #10B981;
  --warning: #F59E0B;
  --danger: #EF4444;
  --node-code: #6c5ce7;
  --node-rationale: #00cec9;
  --node-doc: #fdcb6e;
  --node-test: #fd79a8;
  --node-default: #636e72;
  --edge-color: #3d4059;
  --sidebar-width: 500px;
  --radius: 8px;
  --radius-lg: 12px;
  --radius-pill: 9999px;
  --shadow-card: 0 4px 20px rgba(0, 119, 182, 0.06);
  --shadow-hover: 0 4px 12px -4px rgba(0,0,0,0.08), 0 1px 4px -1px rgba(0,0,0,0.04);
  --graph-bg: #F8FAFC;
  --graph-grid: rgba(0, 119, 182, 0.06);
}

[data-theme="dark"] {
  --bg-primary: #0F172A;
  --bg-secondary: #1E293B;
  --bg-tertiary: #1E293B;
  --bg-hover: #334155;
  --border: #334155;
  --border-hover: #475569;
  --text-primary: #F1F5F9;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;
  --accent: #38BDF8;
  --accent-light: #7DD3FC;
  --accent-dark: #0EA5E9;
  --accent-glow: rgba(56, 189, 248, 0.2);
  --secondary-accent: #2DD4BF;
  --success: #10B981;
  --warning: #F59E0B;
  --danger: #EF4444;
  --shadow-card: 0 4px 20px rgba(0,0,0,0.3);
  --shadow-hover: 0 4px 12px -4px rgba(0,0,0,0.3);
}

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

html, body {
  height: 100%;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  height: 100%;
  overflow: hidden;
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#app {
  display: flex;
  height: 100%;
}

/* ── Sidebar ── */
#sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 0;
  box-shadow: var(--shadow-card);
}

.sidebar-header {
  padding: 20px 20px 12px;
  border-bottom: 1px solid var(--border);
}

.sidebar-header h1 {
  font-size: 20px;
  font-weight: 700;
  background: linear-gradient(135deg, #0077B6, #14B8A6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

/* ── Status bar ── */
.status-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  font-size: 12px;
  border-bottom: 1px solid var(--border);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-ok .status-dot { background: var(--success); box-shadow: 0 0 6px var(--success); }
.status-ok { color: var(--success); font-weight: 500; }
.status-connecting .status-dot { background: var(--warning); animation: pulse 1.5s infinite; }
.status-connecting { color: var(--warning); }
.status-error .status-dot { background: var(--danger); }
.status-error { color: var(--danger); }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ── Panels ── */
.panel {
  padding: 12px 20px;
}

.panel-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 6px;
}

.panel-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 12px;
  line-height: 1.5;
}

input[type="text"],
input[type="number"],
select {
  width: 100%;
  padding: 8px 12px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  margin-bottom: 10px;
  -webkit-appearance: none;
  appearance: none;
}

select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748B' d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
}

select option {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

input:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* ── Tabs ── */
.tabs {
  display: flex;
  padding: 4px 16px;
  gap: 2px;
  border-bottom: 1px solid var(--border);
}

.tab {
  flex: 1;
  padding: 8px 4px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  border-radius: 6px 6px 0 0;
  transition: all 0.2s;
}

.tab:hover { color: var(--text-primary); background: var(--bg-hover); }
.tab.active { color: var(--accent); border-bottom: 2px solid var(--accent); font-weight: 600; }

.tab-panel {
  display: none;
  padding: 16px 20px;
}

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

/* ── Buttons ── */
.btn-primary {
  width: 100%;
  padding: 10px 16px;
  background: linear-gradient(135deg, #0077B6, #14B8A6);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 4px;
}

.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); box-shadow: var(--shadow-hover); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* ── Info panel ── */
.info-panel {
  padding: 20px 24px;
  border-top: 1px solid var(--border);
  flex: 1;
  overflow-y: auto;
}

.info-panel h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--accent-dark);
  margin-bottom: 14px;
  line-height: 1.4;
}

.info-panel .info-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
}

.info-row .label { color: var(--text-secondary); }
.info-row .value { color: var(--text-primary); font-weight: 500; }

.info-panel .node-list {
  list-style: none;
  padding: 0;
  margin-top: 14px;
}

.node-list li {
  padding: 14px 16px;
  font-size: 16px;
  border-radius: var(--radius);
  margin-bottom: 6px;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  justify-content: space-between;
  border: 1px solid transparent;
}

.node-list li:hover { background: var(--bg-hover); border-color: var(--border); }
.node-list .node-id { color: var(--text-primary); font-family: monospace; font-size: 15px; }
.node-list .node-degree { color: var(--text-muted); font-size: 14px; }

/* ── Stats ── */
.graph-stats {
  padding: 14px 20px;
  font-size: 14px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
}

.stats-sep { color: var(--border); }

/* ── Graph area (STAYS DARK) ── */
#graph-container {
  flex: 1;
  position: relative;
  background: var(--graph-bg);
  background-image:
    radial-gradient(circle at 1px 1px, var(--graph-grid) 1px, transparent 0);
  background-size: 40px 40px;
}

#cy {
  width: 100%;
  height: 100%;
}

/* ── Welcome ── */
.welcome {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: var(--text-secondary);
}

.welcome h2 {
  font-size: 24px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.welcome p { font-size: 14px; margin-bottom: 6px; }
.welcome .hint { font-size: 12px; color: var(--text-muted); }
.welcome .hint strong { color: var(--accent); }

/* ── Loading ── */
#loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: var(--text-secondary);
  font-size: 13px;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Tooltip ── */
.tooltip {
  position: absolute;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 12px;
  max-width: 320px;
  pointer-events: none;
  z-index: 100;
  box-shadow: var(--shadow-card);
  color: var(--text-primary);
}

.tooltip .tt-title {
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 4px;
  font-family: monospace;
  font-size: 12px;
}

.tooltip .tt-row {
  display: flex;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 11px;
}

.tooltip .tt-row span:first-child { color: var(--text-muted); min-width: 60px; }

/* ── Legend ── */
.legend {
  position: absolute;
  bottom: 16px;
  right: 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 11px;
  box-shadow: var(--shadow-card);
}

.legend-title {
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-size: 10px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 0;
  color: var(--text-primary);
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── Explore status ── */
.explore-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 12px;
  color: var(--text-secondary);
}
.explore-icon { font-size: 16px; }

/* ── Path selector ── */
.path-selector {
  padding: 12px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 10px;
}
.path-step {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
}
.step-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}
.step-label {
  font-size: 12px;
  color: var(--text-secondary);
}
.path-arrow {
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
  padding: 2px 0;
}

/* ── Secondary button ── */
.btn-secondary {
  width: 100%;
  padding: 8px 16px;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 6px;
}
.btn-secondary:hover { background: var(--bg-hover); color: var(--text-primary); border-color: var(--border-hover); }

/* ── Autocomplete ── */
.autocomplete-wrap { position: relative; }
.ac-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  max-height: 200px;
  overflow-y: auto;
  z-index: 200;
  box-shadow: var(--shadow-hover);
}
.ac-item {
  padding: 6px 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}
.ac-item:last-child { border-bottom: none; }
.ac-item:hover, .ac-item.ac-active { background: var(--bg-hover); }
.ac-item-label {
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 500;
}
.ac-item-meta {
  color: var(--text-muted);
  font-size: 10px;
  font-family: monospace;
}
.panel-hint {
  font-size: 10px;
  color: var(--text-muted);
  margin: -4px 0 8px;
  font-style: italic;
}

/* ── Back button ── */
.btn-back {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  color: var(--accent);
  padding: 6px 12px;
  border-radius: var(--radius);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
}
.btn-back:hover { background: var(--bg-hover); border-color: var(--accent); }

/* ── Connection detail panel ── */
.connection-header {
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.connection-reason {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 6px 0 8px;
}
.connection-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
}
.connection-meta-row {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
}
.connection-meta-row .meta-value {
  color: var(--text-secondary);
  font-weight: 500;
}
.connection-strength {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 8px 0;
}
.strength-bar {
  flex: 1;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}
.strength-fill {
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), var(--secondary-accent));
  transition: width 0.3s ease;
}
.strength-label {
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
}

.symbol-group {
  margin-bottom: 10px;
}
.symbol-group-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
  padding: 6px 0;
}
.symbol-group-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.symbol-group-count {
  margin-left: auto;
  font-weight: 400;
  color: var(--text-muted);
  font-size: 13px;
}
.symbol-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px 6px 18px;
  font-size: 14px;
  font-family: monospace;
  color: var(--text-primary);
  border-radius: 4px;
  margin-bottom: 2px;
}
.symbol-item:hover {
  background: var(--bg-hover);
}

/* ── Enhanced tooltip for connections ── */
.tt-reason {
  font-size: 10px;
  color: var(--text-secondary);
  margin: 4px 0;
  line-height: 1.4;
}
.tt-symbols-preview {
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px solid var(--border);
}
.tt-symbol-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 6px;
  background: var(--bg-tertiary);
  border-radius: 3px;
  font-size: 10px;
  font-family: monospace;
  color: var(--text-secondary);
  margin: 2px 2px 0 0;
}
.tt-symbol-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}
.tt-meta {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px solid var(--border);
}
.tt-breakdown {
  display: flex;
  gap: 6px;
  margin-top: 3px;
  flex-wrap: wrap;
}
.tt-breakdown-item {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  color: var(--text-muted);
}

/* ── Intelligence tab buttons ── */
.understand-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 4px;
}
.btn-intel {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-intel:hover {
  background: var(--bg-hover);
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: var(--shadow-hover);
}
.intel-icon { font-size: 16px; }
.understand-divider {
  height: 1px;
  background: var(--border);
  margin: 8px 0;
}
.understand-features {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.feat-chip {
  padding: 4px 8px;
  background: rgba(0, 119, 182, 0.08);
  border: 1px solid rgba(0, 119, 182, 0.2);
  border-radius: var(--radius-pill);
  font-size: 10px;
  color: var(--accent);
}

/* ── Smart search toggle ── */
.search-mode-toggle {
  margin: -4px 0 8px;
}
.toggle-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-muted);
  cursor: pointer;
}
.toggle-label input[type="checkbox"] {
  width: auto;
  margin: 0;
  accent-color: var(--accent);
}
.toggle-text { user-select: none; }

/* ── Intelligence info panel sections ── */
.intel-section {
  margin-bottom: 18px;
}
.intel-section-title {
  font-size: 15px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--accent-dark);
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(0, 119, 182, 0.15);
}
.intel-text {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 8px;
}
.intel-highlight {
  background: rgba(0, 119, 182, 0.05);
  border-left: 3px solid var(--accent);
  padding: 12px 16px;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin-bottom: 12px;
}
.intel-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 500;
  margin: 2px 3px 0 0;
}
.intel-tag.risk-low    { background: rgba(16,185,129,0.1); color: var(--success); border: 1px solid rgba(16,185,129,0.25); }
.intel-tag.risk-medium { background: rgba(245,158,11,0.1); color: var(--warning); border: 1px solid rgba(245,158,11,0.25); }
.intel-tag.risk-high   { background: rgba(239,68,68,0.1); color: var(--danger); border: 1px solid rgba(239,68,68,0.25); }
.intel-tag.risk-critical { background: rgba(239,68,68,0.15); color: #DC2626; border: 1px solid rgba(220,38,38,0.3); }
.intel-tag.layer       { background: rgba(0,119,182,0.08); color: var(--accent); border: 1px solid rgba(0,119,182,0.2); }
.intel-tag.domain      { background: rgba(20,184,166,0.08); color: var(--secondary-accent); border: 1px solid rgba(20,184,166,0.2); }

.intel-deps {
  list-style: none;
  padding: 0;
  margin: 0;
}
.intel-deps li {
  padding: 8px 10px;
  font-size: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: var(--radius);
  margin-bottom: 2px;
  cursor: pointer;
}
.intel-deps li:hover { background: var(--bg-hover); }
.intel-dep-label { color: var(--text-primary); font-family: monospace; font-size: 13px; }
.intel-dep-rel { color: var(--text-muted); font-size: 12px; font-style: italic; }

.intel-flow-step {
  display: flex;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}
.intel-flow-step:last-child { border-bottom: none; }
.intel-flow-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  flex-shrink: 0;
}
.intel-flow-body { flex: 1; }
.intel-flow-label { font-size: 12px; color: var(--text-primary); font-weight: 500; }
.intel-flow-desc { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

.intel-quick-tip {
  display: flex;
  gap: 6px;
  padding: 6px 8px;
  background: var(--bg-tertiary);
  border-radius: var(--radius);
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 4px;
  line-height: 1.4;
}
.intel-quick-tip::before {
  content: "→";
  color: var(--accent);
  flex-shrink: 0;
}

/* ── Smart search results ── */
.smart-result {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 6px;
  cursor: pointer;
  transition: all 0.15s;
}
.smart-result:hover {
  background: var(--bg-hover);
  border-color: var(--accent);
  box-shadow: var(--shadow-hover);
}
.smart-result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}
.smart-result-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
}
.smart-result-score {
  font-size: 10px;
  color: var(--text-muted);
}
.smart-result-meta {
  font-size: 10px;
  color: var(--text-muted);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.smart-result-reason {
  font-size: 10px;
  color: var(--accent);
  margin-top: 3px;
}

/* ── Intel Modal (full-screen overlay for Understand results) ── */
.intel-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.intel-modal-content {
  width: 90vw;
  max-width: 900px;
  max-height: 85vh;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 80px rgba(0,0,0,0.15);
}

.intel-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 32px 16px;
  border-bottom: 1px solid var(--border);
}

.intel-modal-header h2 {
  font-size: 22px;
  font-weight: 600;
  color: var(--accent-dark);
}

.intel-modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 32px;
  cursor: pointer;
  padding: 4px 12px;
  border-radius: 8px;
  transition: all 0.15s;
}
.intel-modal-close:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.intel-modal-body {
  padding: 28px 32px;
  overflow-y: auto;
  flex: 1;
  font-size: 15px;
  line-height: 1.8;
  color: var(--text-primary);
}

.intel-modal-body .intel-section {
  margin-bottom: 24px;
}

.intel-modal-body .intel-section-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--accent-dark);
  margin-bottom: 10px;
}

.intel-modal-body .intel-highlight {
  background: var(--bg-tertiary);
  border-left: 3px solid var(--accent);
  padding: 16px 20px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  font-size: 15px;
  line-height: 1.8;
}

.intel-modal-body .intel-deps {
  list-style: none;
  padding: 0;
}

.intel-modal-body .intel-deps li {
  padding: 10px 14px;
  margin-bottom: 6px;
  background: var(--bg-tertiary);
  border-radius: var(--radius);
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: background 0.15s;
}

.intel-modal-body .intel-deps li:hover {
  background: var(--bg-hover);
}

.intel-modal-body .intel-quick-tip {
  padding: 10px 16px;
  background: var(--bg-tertiary);
  border-radius: var(--radius);
  margin-bottom: 6px;
  font-size: 14px;
}

/* ── Utilities ── */
.hidden { display: none !important; }

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

/* ── Embedded / iframe mode ── */
html.embedded, body.embedded {
  height: 100%;
  overflow: hidden;
}
body.embedded #app {
  height: 100%;
}
body.embedded #graph-container {
  min-height: 0;
  flex: 1;
}
body.embedded #sidebar {
  width: 340px;
  min-width: 340px;
}
body.embedded .sidebar-header {
  padding: 12px 16px 8px;
}
body.embedded .sidebar-header h1 {
  font-size: 16px;
}
body.embedded .subtitle {
  font-size: 10px;
}
body.embedded .status-bar {
  padding: 5px 16px;
  font-size: 11px;
}
body.embedded .panel {
  padding: 8px 16px;
}
body.embedded .tabs {
  padding: 0 16px;
}
body.embedded .tab-panel {
  padding: 10px 16px;
}
body.embedded .info-panel {
  padding: 10px 16px;
}
body.embedded .graph-stats {
  padding: 6px 16px;
  font-size: 11px;
}
body.embedded .intel-modal-content {
  width: 92%;
  max-height: 88vh;
}
