/* ── Architecture Explorer — Visual Overhaul ── */

:root {
  --navy:    #1A0E5C;
  --primary: #6D28D9;
  --pri-lt:  #EDE9FE;
  --pri-dk:  #5B21B6;
  --green:   #059669;
  --green-lt:#D1FAE5;
  --blue:    #0369A1;
  --blue-lt: #DBEAFE;
  --amber:   #B45309;
  --amber-lt:#FEF3C7;
  --slate:   #475569;
  --slate-lt:#F1F5F9;
  --text:    #111827;
  --text-2:  #374151;
  --text-3:  #6B7280;
  --muted:   #9CA3AF;
  --bg:      #F5F5FA;
  --card:    #FFFFFF;
  --border:  #E5E7EB;
  --border-2:#D1D5DB;
  --r:       10px;
  --r-lg:    14px;
  --r-sm:    6px;
  --mono:    "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; }
body {
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--bg); color: var(--text);
  line-height: 1.5; -webkit-font-smoothing: antialiased;
  display: flex; flex-direction: column;
}

/* ── Topbar ── */
.topbar {
  height: 48px; background: var(--navy); display: flex; align-items: center;
  padding: 0 20px; gap: 12px; flex-shrink: 0; z-index: 100;
}
.topbar-back { color: rgba(255,255,255,0.55); font-size: 13px; text-decoration: none; transition: color 0.15s; }
.topbar-back:hover { color: #fff; }
.topbar-sep { color: rgba(255,255,255,0.2); }
.topbar-title { color: #fff; font-size: 14px; font-weight: 600; letter-spacing: -0.2px; }
.topbar-badge {
  font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 9999px;
  background: rgba(255,255,255,0.12); color: rgba(255,255,255,0.75); margin-left: auto;
}

.main { flex: 1; display: flex; flex-direction: column; min-height: 0; }

/* ── Tabs ── */
.tabs {
  display: flex; align-items: stretch; border-bottom: 1px solid var(--border);
  padding: 0 4px; background: #FAFAFA; overflow-x: auto; scrollbar-width: none; flex-shrink: 0;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  display: flex; align-items: center; gap: 7px;
  padding: 11px 16px; font-size: 12.5px; font-weight: 500;
  color: var(--text-3); background: none; border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer; white-space: nowrap; transition: color 0.15s, border-color 0.15s;
}
.tab:hover { color: var(--text-2); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.tab svg { width: 14px; height: 14px; flex-shrink: 0; }

/* ── Panels ── */
.panel { display: none; flex: 1; min-height: 0; overflow-y: auto; }
.panel.active { display: block; }

/* ── Popover ── */
.popover {
  position: fixed; z-index: 300;
  width: 380px; max-height: calc(100vh - 72px);
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: 0 12px 40px rgba(0,0,0,0.14), 0 2px 8px rgba(0,0,0,0.06);
  display: flex; flex-direction: column; overflow: hidden;
  opacity: 0; pointer-events: none;
  transform: translateY(6px) scale(0.97);
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.popover.open { opacity: 1; pointer-events: auto; transform: translateY(0) scale(1); }

.pop-hdr {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-bottom: 1px solid var(--border); flex-shrink: 0; background: var(--bg);
}
.pop-hdr h3 { flex: 1; font-size: 14px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pop-close {
  width: 24px; height: 24px; border-radius: 5px; border: none;
  background: none; color: var(--text-3); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; transition: background 0.15s; flex-shrink: 0;
}
.pop-close:hover { background: var(--border); }
.pop-body { overflow-y: auto; padding: 14px 16px; max-height: 400px; }
.pop-body p { font-size: 12.5px; color: var(--text-2); line-height: 1.55; margin-bottom: 12px; }
.pop-section { margin-bottom: 14px; }
.pop-section-label { font-size: 9px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.pop-props { display: flex; flex-direction: column; gap: 4px; }
.pop-prop { display: flex; align-items: baseline; gap: 8px; font-size: 11.5px; padding: 3px 0; border-bottom: 1px solid var(--border); }
.pop-prop:last-child { border-bottom: none; }
.pop-prop-key { color: var(--text-3); font-weight: 600; min-width: 100px; flex-shrink: 0; }
.pop-prop-val { color: var(--text); font-weight: 500; }
.pop-prop-val code { font-family: var(--mono); font-size: 10.5px; background: var(--bg); padding: 1px 5px; border-radius: 3px; }
.pop-link { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: var(--primary); text-decoration: none; transition: color 0.15s; margin-top: 4px; }
.pop-link:hover { color: var(--pri-dk); }
.pop-badge { display: inline-flex; font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 20px; background: var(--pri-lt); color: var(--pri-dk); }

/* ── Shared loading ── */
.placeholder {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; color: var(--muted); font-size: 13px; padding: 60px 20px;
}
.spinner {
  width: 18px; height: 18px; border: 2px solid var(--border);
  border-top-color: var(--primary); border-radius: 50%; animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ═══════════════════════════════════════════════════════════════════════════
   TAB 1: System Architecture — interactive layered DOM
   ═══════════════════════════════════════════════════════════════════════════ */

.arch-wrap { padding: 24px; max-width: 1100px; margin: 0 auto; }
.arch-layer {
  margin-bottom: 2px; border-radius: var(--r-lg); padding: 16px 20px;
}
.arch-layer-hdr {
  display: flex; align-items: center; gap: 10px; margin-bottom: 12px;
}
.arch-layer-label {
  font-size: 10px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
}
.arch-layer-count {
  font-size: 11px; font-weight: 600; font-family: var(--mono); margin-left: auto;
}
.arch-nodes { display: flex; gap: 8px; flex-wrap: wrap; }
.arch-node {
  padding: 10px 14px; border-radius: var(--r);
  border: 1px solid var(--border); background: var(--card);
  cursor: pointer; transition: border-color 0.12s, box-shadow 0.12s;
  min-width: 120px; flex: 1;
}
.arch-node:hover { border-color: var(--border-2); box-shadow: 0 2px 8px rgba(0,0,0,0.04); }
.arch-node.active { border-color: var(--primary); background: var(--pri-lt); }
.arch-node-icon { font-size: 16px; margin-bottom: 4px; }
.arch-node-name { font-size: 12px; font-weight: 700; color: var(--text); }
.arch-node-sub { font-size: 10px; color: var(--text-3); }
.arch-node-stat { font-size: 13px; font-weight: 800; font-family: var(--mono); margin-top: 2px; }
.arch-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.arch-pill {
  padding: 4px 12px; border-radius: 20px; font-size: 11px; font-weight: 600;
  border: 1px solid var(--border); background: var(--card);
  cursor: pointer; transition: border-color 0.12s;
  display: flex; align-items: center; gap: 6px;
}
.arch-pill:hover { border-color: var(--border-2); }
.arch-pill.active { border-color: var(--primary); background: var(--pri-lt); }
.arch-pill-count { font-family: var(--mono); font-size: 10px; color: var(--muted); }
.arch-flow { display: flex; justify-content: center; padding: 4px 0; }
.arch-flow-dots { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.arch-flow-dot { width: 3px; height: 3px; border-radius: 50%; background: var(--border-2); }
.arch-svc-split { margin-top: 10px; }
.arch-svc-label {
  font-size: 9px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-3); margin-bottom: 6px; opacity: 0.7;
}
/* Drilldown detail panel */
.arch-detail {
  margin: 4px 0 8px; background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r-lg); animation: archSlideIn 0.2s ease-out;
}
@keyframes archSlideIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}
.arch-detail-hdr {
  padding: 14px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
}
.arch-detail-back {
  background: none; border: 1px solid var(--border-2); border-radius: var(--r-sm);
  padding: 4px 10px; cursor: pointer; font-size: 14px; color: var(--text-2);
  transition: background 0.12s;
}
.arch-detail-back:hover { background: var(--bg); }
.arch-detail-title { font-size: 15px; font-weight: 800; color: var(--text); }
.arch-detail-badge {
  font-size: 10px; font-weight: 600; padding: 2px 8px; border-radius: 4px;
  text-transform: uppercase; letter-spacing: 0.05em;
}
.arch-detail-body { padding: 16px 20px; }
.arch-detail-desc { font-size: 13px; color: var(--text-2); line-height: 1.6; margin-bottom: 14px; }
.arch-detail-props {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px;
}
.arch-detail-prop {
  padding: 10px 12px; background: var(--bg); border-radius: var(--r-sm); border: 1px solid var(--border);
}
.arch-detail-prop-key { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-bottom: 2px; }
.arch-detail-prop-val { font-size: 13px; font-weight: 600; color: var(--text); }
.arch-detail-link {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 600; color: var(--primary);
  text-decoration: none; margin-top: 12px; transition: color 0.12s;
}
.arch-detail-link:hover { color: var(--pri-dk); }
/* Legacy SVG support */
.arch-svg { width: 100%; height: auto; display: block; }
.arch-svg .node { cursor: pointer; }
.arch-svg .node:hover .node-bg { filter: brightness(0.93); stroke-width: 2.5; }
.arch-svg .node text { pointer-events: none; }

/* ═══════════════════════════════════════════════════════════════════════════
   TAB 2: Data Pipelines — vertical waterfall with stats
   ═══════════════════════════════════════════════════════════════════════════ */

.pipe-hero {
  display: grid; grid-template-columns: 1fr 1fr; gap: 24px;
  padding: 24px; max-width: 1200px; margin: 0 auto;
}
@media (max-width: 900px) { .pipe-hero { grid-template-columns: 1fr; } }

.pipe-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--r-lg);
  overflow: hidden; transition: box-shadow 0.2s;
}
.pipe-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,0.06); }

.pipe-card-hdr {
  padding: 16px 20px; display: flex; align-items: center; gap: 12px;
  border-bottom: 1px solid var(--border);
}
.pipe-card-icon {
  width: 40px; height: 40px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.pipe-card-title { font-size: 15px; font-weight: 700; color: var(--text); }
.pipe-card-sub { font-size: 11px; color: var(--text-3); }

.pipe-stats {
  display: flex; gap: 0; border-bottom: 1px solid var(--border);
}
.pipe-stat {
  flex: 1; padding: 10px 14px; text-align: center;
  border-right: 1px solid var(--border);
}
.pipe-stat:last-child { border-right: none; }
.pipe-stat-val {
  font-size: 18px; font-weight: 800; font-family: var(--mono);
}
.pipe-stat-label { font-size: 9px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3); }

.pipe-phases {
  padding: 16px 20px; display: flex; flex-direction: column; gap: 0;
  position: relative;
}
/* Vertical timeline line */
.pipe-phases::before {
  content: ''; position: absolute; left: 30px; top: 24px; bottom: 24px;
  width: 2px; border-radius: 1px;
  background: var(--pipe-color, var(--border));
  opacity: 0.25;
}

.pipe-phase {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 6px 0; cursor: pointer; position: relative; z-index: 1;
}
.pipe-phase:hover .pipe-phase-body { background: var(--bg); }

.pipe-phase-dot {
  width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 9px; font-weight: 800; color: #fff;
  margin-top: 1px; line-height: 1;
}

.pipe-phase-body {
  flex: 1; padding: 4px 8px; border-radius: 6px; transition: background 0.12s;
}
.pipe-phase-name { font-size: 12px; font-weight: 600; color: var(--text); }
.pipe-phase-desc { font-size: 10.5px; color: var(--text-3); }

.pipe-card-footer {
  padding: 10px 20px; background: var(--bg); border-top: 1px solid var(--border);
  font-size: 11px; color: var(--text-3); display: flex; align-items: center; gap: 6px;
}
.pipe-card-footer code {
  font-family: var(--mono); font-size: 10px; background: var(--card);
  padding: 2px 6px; border-radius: 4px; border: 1px solid var(--border);
}

/* ═══════════════════════════════════════════════════════════════════════════
   TAB 3: Tool Catalog — categorized mosaic
   ═══════════════════════════════════════════════════════════════════════════ */

.tools-wrap { padding: 20px 24px; max-width: 1200px; margin: 0 auto; }

.tool-search-row { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.tool-search-wrap { position: relative; flex: 1; min-width: 200px; }
.tool-search-wrap svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--muted); pointer-events: none; }
.tool-search {
  width: 100%; padding: 9px 12px 9px 34px; font-family: inherit; font-size: 13px;
  border: 1.5px solid var(--border); border-radius: var(--r-sm);
  background: var(--card); color: var(--text); outline: none; transition: border-color 0.15s;
}
.tool-search:focus { border-color: var(--primary); }
.tool-count { font-size: 12px; color: var(--muted); font-weight: 500; }

.cat-pills { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.cat-pill {
  padding: 4px 11px; font-size: 11px; font-weight: 600;
  border: 1.5px solid var(--border); border-radius: 20px;
  background: #fff; color: var(--text-3); cursor: pointer; transition: all 0.15s;
}
.cat-pill:hover { border-color: var(--primary); color: var(--primary); }
.cat-pill.active { background: var(--pri-lt); border-color: var(--primary); color: var(--pri-dk); }

.tool-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px;
}
.tool-card {
  padding: 10px 12px; background: var(--card);
  border: 1px solid var(--border); border-radius: var(--r);
  cursor: pointer; transition: border-color 0.15s, box-shadow 0.15s;
  border-left: 3px solid var(--border);
}
.tool-card:hover { border-color: var(--primary); border-left-color: var(--primary); box-shadow: 0 2px 8px rgba(109,40,217,0.08); }
.tool-card-name { font-family: var(--mono); font-size: 11.5px; font-weight: 700; color: var(--pri-dk); margin-bottom: 2px; }
.tool-card-desc {
  font-size: 11px; color: var(--text-3); line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.tool-card-meta { display: flex; gap: 6px; margin-top: 5px; }
.tool-card-badge { font-size: 10px; font-weight: 600; padding: 2px 8px; border-radius: 8px; background: var(--bg); color: var(--text-2); }

/* ═══════════════════════════════════════════════════════════════════════════
   TAB 4: Knowledge Graph — radial SVG
   ═══════════════════════════════════════════════════════════════════════════ */

.kg-legend {
  display: flex; gap: 14px; flex-wrap: wrap; padding: 16px 24px 8px;
  align-items: center;
}
.kg-legend-item {
  font-size: 11px; font-weight: 600; display: flex; align-items: center; gap: 4px;
}
.kg-legend-dot { width: 8px; height: 8px; border-radius: 50%; }
.kg-legend-note { font-size: 11px; color: var(--muted); margin-left: auto; }
.kg-wrap { padding: 0 24px 24px; overflow-x: auto; }

/* Active node highlight */
.arch-svg .node.kg-active .node-bg { stroke-width: 3; filter: brightness(0.9); }
.arch-svg .node.kg-active { filter: drop-shadow(0 0 8px rgba(26,14,92,0.3)); }

/* Drilldown panel */
.kg-drilldown {
  margin: 0 24px 24px;
  background: #FAFAFA;
  border: 1px solid #E5E7EB;
  border-radius: 10px;
  animation: kgSlideIn 0.25s ease-out;
}
@keyframes kgSlideIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
.kg-dd-loading {
  padding: 24px;
  text-align: center;
  color: #6B7280;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.kg-dd-loading .spinner { width: 18px; height: 18px; }
.kg-dd-header {
  padding: 14px 20px;
  border-bottom: 1px solid #E5E7EB;
}
.kg-dd-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.kg-dd-back {
  background: none;
  border: 1px solid #D1D5DB;
  border-radius: 6px;
  padding: 4px 10px;
  cursor: pointer;
  font-size: 14px;
  color: #374151;
  transition: background 0.15s;
}
.kg-dd-back:hover { background: #F3F4F6; }
.kg-dd-sab {
  font-size: 16px;
  font-weight: 800;
  font-family: var(--mono), monospace;
}
.kg-dd-domain {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6B7280;
  background: #F3F4F6;
  padding: 2px 8px;
  border-radius: 4px;
}
.kg-dd-stats {
  font-size: 12px;
  color: #6B7280;
}
.kg-dd-browse {
  margin-left: auto;
  font-size: 12px;
  font-weight: 600;
  color: #4F46E5;
  text-decoration: none;
}
.kg-dd-browse:hover { text-decoration: underline; }
.kg-dd-meta {
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.kg-dd-official {
  font-size: 12px;
  color: #4B5563;
}
.kg-dd-version, .kg-dd-release {
  font-size: 11px;
  font-family: var(--mono), monospace;
  color: #9CA3AF;
  background: #F3F4F6;
  padding: 1px 6px;
  border-radius: 3px;
}
.kg-dd-badge {
  font-size: 10px;
  font-weight: 700;
  border: 1px solid;
  padding: 1px 8px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.kg-dd-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}
.kg-dd-columns.kg-dd-3col {
  grid-template-columns: 1fr 1fr 1fr;
}
.kg-dd-col {
  padding: 14px 20px;
  border-right: 1px solid #E5E7EB;
}
.kg-dd-col:last-child {
  border-right: none;
}
.kg-dd-col-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6B7280;
  margin: 0 0 10px;
}
.kg-dd-list {
  max-height: 360px;
  overflow-y: auto;
}
.kg-dd-empty {
  font-size: 12px;
  color: #9CA3AF;
  font-style: italic;
  margin: 0;
}
.kg-dd-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border-radius: 5px;
  font-size: 12px;
  transition: background 0.1s;
}
.kg-dd-root {
  cursor: pointer;
}
.kg-dd-root:hover { background: #F3F4F6; }
.kg-dd-code {
  font-family: var(--mono), monospace;
  font-weight: 700;
  font-size: 11px;
  min-width: 60px;
}
.kg-dd-desc {
  flex: 1;
  color: #374151;
  min-width: 0;
  word-break: break-word;
}
.kg-dd-expand {
  font-size: 10px;
  color: #9CA3AF;
  margin-left: auto;
  flex-shrink: 0;
}
.kg-dd-children {
  margin-left: 24px;
  padding: 4px 0;
  border-left: 2px solid #E5E7EB;
}
.kg-dd-child {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 8px 3px 12px;
  font-size: 11px;
  text-decoration: none;
  color: inherit;
  border-radius: 4px;
  transition: background 0.1s;
}
.kg-dd-child:hover { background: #EEF2FF; }
.kg-dd-child-loading, .kg-dd-child-empty {
  padding: 4px 12px;
  font-size: 11px;
  color: #9CA3AF;
}
.kg-dd-sty {
  gap: 6px;
}
.kg-dd-sty-name {
  flex: 1;
  color: #374151;
  min-width: 0;
  word-break: break-word;
}
.kg-dd-sty-tui {
  font-family: var(--mono), monospace;
  font-size: 10px;
  color: #9CA3AF;
}
.kg-dd-sty-count {
  font-family: var(--mono), monospace;
  font-size: 11px;
  color: #6B7280;
  font-weight: 600;
  min-width: 40px;
  text-align: right;
}
.kg-dd-tty-row {
  gap: 6px;
}
.kg-dd-tty-code {
  font-family: var(--mono), monospace;
  font-size: 11px;
  font-weight: 700;
  color: inherit;
  min-width: 40px;
}
.kg-dd-tty-name {
  flex: 1;
  color: #374151;
  font-size: 11px;
  min-width: 0;
  word-break: break-word;
}

/* ═══════════════════════════════════════════════════════════════════════════
   TAB 5: Intelligence Stack — stepped funnel cards
   ═══════════════════════════════════════════════════════════════════════════ */

.intel-wrap { padding: 24px; max-width: 1100px; margin: 0 auto; display: flex; flex-direction: column; gap: 28px; }

.intel-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--r-lg);
  overflow: hidden;
}
.intel-card-hdr {
  padding: 14px 20px; display: flex; align-items: center; gap: 12px;
}
.intel-card-icon {
  width: 36px; height: 36px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0;
}
.intel-card-title { font-size: 15px; font-weight: 700; color: var(--text); }
.intel-card-sub { font-size: 11px; color: var(--text-3); }

.intel-steps {
  display: flex; align-items: stretch; overflow-x: auto; padding: 0 12px 16px;
  gap: 0;
}
.intel-steps::-webkit-scrollbar { height: 3px; }
.intel-steps::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 2px; }

.intel-step {
  display: flex; flex-direction: column; align-items: center;
  padding: 12px 10px 8px; min-width: 100px; cursor: pointer;
  border-radius: var(--r); transition: background 0.12s;
  text-align: center; flex-shrink: 0; position: relative;
}
.intel-step:hover { background: var(--bg); }

.intel-step-num {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800; color: #fff; margin-bottom: 6px;
}
.intel-step-label { font-size: 11px; font-weight: 600; color: var(--text); line-height: 1.3; }
.intel-step-sub { font-size: 9px; color: var(--text-3); margin-top: 2px; }

/* Connecting arrow between steps */
.intel-step-arrow {
  display: flex; align-items: center; justify-content: center;
  width: 24px; flex-shrink: 0; color: var(--slate); font-size: 16px; font-weight: 600;
  align-self: center; padding-bottom: 16px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   TAB 6: Agent Runtime — visual flow
   ═══════════════════════════════════════════════════════════════════════════ */

.agent-wrap { padding: 24px; max-width: 1100px; margin: 0 auto; }

.agent-section { margin-bottom: 28px; }
.agent-section-title { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.agent-section-sub { font-size: 12px; color: var(--text-3); margin-bottom: 14px; }

.agent-providers { display: flex; gap: 10px; flex-wrap: wrap; }
.agent-provider {
  padding: 12px 16px; border: 1.5px solid var(--border); border-radius: var(--r);
  background: var(--card); cursor: pointer; transition: all 0.15s;
  display: flex; align-items: center; gap: 10px; min-width: 140px;
}
.agent-provider:hover { border-color: var(--primary); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.06); }
.agent-provider-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.agent-provider-name { font-size: 13px; font-weight: 600; color: var(--text); }
.agent-provider-models { font-size: 10px; color: var(--text-3); }

/* Agent loop: reuse intel-steps pattern */
.agent-loop {
  display: flex; align-items: stretch; overflow-x: auto; gap: 0;
  padding: 8px 0 16px;
}
.agent-loop-step {
  display: flex; flex-direction: column; align-items: center;
  padding: 16px 14px 12px; min-width: 120px; cursor: pointer;
  border-radius: var(--r); transition: background 0.12s;
  text-align: center; flex-shrink: 0; background: var(--card);
  border: 1px solid var(--border);
}
.agent-loop-step:hover { border-color: var(--primary); background: var(--pri-lt); }
.agent-loop-step-num {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--navy); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800; margin-bottom: 8px;
}
.agent-loop-step-label { font-size: 12px; font-weight: 600; color: var(--text); }
.agent-loop-step-sub { font-size: 10px; color: var(--text-3); margin-top: 2px; }
.agent-loop-arrow {
  display: flex; align-items: center; justify-content: center;
  width: 28px; flex-shrink: 0; font-size: 18px; color: var(--slate);
  align-self: center; font-weight: 600;
}
.agent-loop-back {
  text-align: center; margin: -4px 0 12px;
  font-size: 12px; color: var(--text-3); font-style: italic;
}

.agent-features {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px;
}
.agent-feature {
  padding: 14px 16px; background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r); cursor: pointer; transition: border-color 0.15s;
  border-left: 3px solid var(--primary);
}
.agent-feature:hover { border-color: var(--primary); }
.agent-feature-title { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.agent-feature-desc { font-size: 11px; color: var(--text-3); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
