*, *::before, *::after { box-sizing: border-box; }
:root {
  color-scheme: dark;
  --bg: #080b10;
  --surface: #10141b;
  --surface-2: #151a22;
  --surface-3: #1b222c;
  --line: #252d38;
  --line-bright: #364252;
  --text: #e6ebef;
  --muted: #7f8a97;
  --subtle: #525d69;
  --cyan: #62e6d3;
  --cyan-soft: rgba(98, 230, 211, .12);
  --orange: #ff9d66;
  --violet: #a995ff;
  --yellow: #e4d36d;
  --danger: #ff6b7b;
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  --sidebar: 390px;
}
html, body { width: 100%; height: 100%; overflow: hidden; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
button, input { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.topbar { height: 68px; padding: 0 18px 0 20px; display: flex; align-items: center; justify-content: space-between; background: rgba(8, 11, 16, .96); border-bottom: 1px solid var(--line); position: relative; z-index: 20; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 26px; height: 26px; border: 1px solid var(--cyan); border-radius: 50%; position: relative; box-shadow: inset 0 0 0 5px var(--bg), inset 0 0 0 6px rgba(98,230,211,.35); }
.brand-mark::before, .brand-mark::after { content: ""; position: absolute; background: var(--cyan); }
.brand-mark::before { width: 34px; height: 1px; left: -5px; top: 12px; }
.brand-mark::after { width: 1px; height: 34px; left: 12px; top: -5px; }
.brand h1 { margin: 0; font-size: 16px; line-height: 1; letter-spacing: .04em; font-weight: 750; }
.brand h1 strong { color: var(--cyan); font-weight: 750; }
.brand p { margin: 5px 0 0; font: 9px/1 var(--mono); letter-spacing: .19em; color: var(--muted); }
.dataset-summary { display: flex; align-items: center; gap: 22px; font: 10px/1 var(--mono); letter-spacing: .09em; color: var(--muted); }
.dataset-summary b { font-size: 13px; color: var(--text); margin-right: 3px; }
.live-indicator { color: var(--cyan); border: 1px solid rgba(98,230,211,.3); border-radius: 999px; padding: 5px 8px 5px 18px; position: relative; }
.live-indicator::before { content: ""; position: absolute; left: 8px; top: 50%; width: 5px; height: 5px; border-radius: 50%; transform: translateY(-50%); background: var(--cyan); box-shadow: 0 0 7px var(--cyan); }
.mobile-panel-toggle { display: none; background: var(--surface-2); border: 1px solid var(--line-bright); border-radius: 4px; padding: 7px 10px; font: 11px var(--mono); }

.workspace { height: calc(100% - 68px); display: grid; grid-template-columns: minmax(0, 1fr) var(--sidebar); }
.graph-stage { position: relative; min-width: 0; overflow: hidden; background-color: var(--bg); background-image: linear-gradient(rgba(91,108,125,.055) 1px, transparent 1px), linear-gradient(90deg, rgba(91,108,125,.055) 1px, transparent 1px); background-size: 32px 32px; }
.graph-stage::after { content: ""; pointer-events: none; position: absolute; inset: 0; background: radial-gradient(circle at 50% 44%, transparent 35%, rgba(4,6,9,.58) 120%); }
#graph-canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: grab; z-index: 1; }
#graph-canvas.dragging { cursor: grabbing; }
.graph-overlay { position: absolute; z-index: 5; }
.top-left { top: 18px; left: 18px; }
.bottom-left { left: 18px; bottom: 18px; }
.bottom-right { right: 18px; bottom: 18px; }
.search-box { width: min(360px, calc(100vw - var(--sidebar) - 56px)); height: 42px; display: flex; align-items: center; gap: 10px; background: rgba(16,20,27,.92); border: 1px solid var(--line-bright); border-radius: 5px; box-shadow: 0 10px 35px rgba(0,0,0,.28); backdrop-filter: blur(12px); padding: 0 12px; }
.search-box:focus-within { border-color: rgba(98,230,211,.65); }
.search-box svg { width: 16px; fill: none; stroke: var(--muted); stroke-width: 1.6; }
.search-box input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 13px; }
.search-box input::placeholder { color: var(--subtle); }
.search-box button { border: 0; background: transparent; color: var(--muted); font-size: 19px; cursor: pointer; }
.search-results { width: min(360px, calc(100vw - var(--sidebar) - 56px)); max-height: 250px; overflow: auto; background: rgba(16,20,27,.97); border: 1px solid var(--line-bright); border-top: 0; border-radius: 0 0 5px 5px; box-shadow: 0 16px 35px rgba(0,0,0,.4); }
.search-result { width: 100%; display: grid; grid-template-columns: 9px 1fr auto; align-items: center; gap: 10px; padding: 10px 12px; background: transparent; border: 0; border-bottom: 1px solid var(--line); text-align: left; cursor: pointer; }
.search-result:hover { background: var(--surface-3); }
.search-result:last-child { border-bottom: 0; }
.search-result .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--node-color); }
.search-result strong { display: block; font-size: 12px; font-weight: 600; }
.search-result small, .search-empty { color: var(--muted); font: 9px var(--mono); }
.search-empty { display: block; padding: 14px; }
.legend { display: flex; gap: 15px; padding: 9px 12px; border: 1px solid rgba(54,66,82,.7); background: rgba(8,11,16,.78); backdrop-filter: blur(8px); border-radius: 4px; }
.legend span { display: inline-flex; gap: 6px; align-items: center; color: var(--muted); font: 9px var(--mono); }
.shape { width: 8px; height: 8px; display: inline-block; background: var(--node-color); }
.shape.product { --node-color: var(--cyan); border-radius: 50%; }
.shape.company { --node-color: var(--orange); border-radius: 1px; }
.shape.person { --node-color: var(--violet); transform: rotate(45deg); }
.shape.vc_firm { --node-color: var(--yellow); clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.graph-tools { display: flex; align-items: center; overflow: hidden; border: 1px solid var(--line-bright); border-radius: 4px; background: rgba(16,20,27,.9); backdrop-filter: blur(8px); }
.graph-tools button, .graph-tools output { min-width: 34px; height: 34px; display: grid; place-items: center; border: 0; border-right: 1px solid var(--line); background: transparent; font: 12px var(--mono); }
.graph-tools button:hover { background: var(--surface-3); color: var(--cyan); }
.graph-tools output { width: 52px; color: var(--muted); font-size: 9px; }
.graph-tools .fit-button { padding: 0 11px; border-right: 0; width: auto; font-size: 9px; letter-spacing: .08em; }
.graph-hint { position: absolute; z-index: 4; top: 20px; right: 18px; color: var(--subtle); font: 9px var(--mono); letter-spacing: .05em; }
.loading { position: absolute; inset: 0; z-index: 10; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 15px; background: var(--bg); color: var(--muted); font: 10px var(--mono); letter-spacing: .12em; transition: opacity .25s; }
.loading.loaded { opacity: 0; pointer-events: none; }
.loading-mark { width: 34px; height: 34px; border: 1px solid var(--line-bright); border-top-color: var(--cyan); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.sidebar { min-width: 0; background: var(--surface); border-left: 1px solid var(--line); position: relative; z-index: 15; display: flex; flex-direction: column; }
.sidebar-scroll { flex: 1; min-height: 0; overflow-y: auto; scrollbar-color: var(--line-bright) transparent; }
.panel { padding: 21px 20px 23px; border-bottom: 1px solid var(--line); }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 14px; }
.eyebrow { display: block; margin-bottom: 5px; color: var(--cyan); font: 8px/1 var(--mono); letter-spacing: .14em; }
.section-head h2 { margin: 0; font-size: 14px; line-height: 1.2; letter-spacing: .03em; }
.text-button { padding: 3px 0; border: 0; background: transparent; color: var(--muted); font: 9px var(--mono); cursor: pointer; }
.text-button:hover { color: var(--cyan); }
.section-note { margin: -3px 0 15px; color: var(--muted); font-size: 10px; line-height: 1.6; }
.type-filters { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.type-filter { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 9px 10px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface-2); cursor: pointer; text-align: left; }
.type-filter:hover { border-color: var(--line-bright); }
.type-filter[aria-pressed="false"] { opacity: .38; background: transparent; }
.type-filter i { width: 7px; height: 7px; border-radius: 50%; background: var(--node-color); box-shadow: 0 0 8px color-mix(in srgb, var(--node-color) 60%, transparent); }
.type-filter span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.type-filter b { color: var(--muted); font: 9px var(--mono); }
.path-inputs { display: grid; grid-template-columns: 1fr 16px 1fr; align-items: end; gap: 7px; }
.path-inputs label { color: var(--muted); font: 8px var(--mono); letter-spacing: .08em; }
.path-inputs input { width: 100%; height: 35px; margin-top: 6px; padding: 0 9px; border: 1px solid var(--line-bright); border-radius: 3px; outline: 0; background: var(--bg); color: var(--text); font: 10px var(--mono); }
.path-inputs input:focus { border-color: var(--cyan); }
.path-inputs input::placeholder { color: var(--subtle); }
.path-arrow { padding-bottom: 9px; text-align: center; color: var(--subtle); }
.primary-button { width: 100%; margin-top: 10px; padding: 9px; border: 1px solid var(--cyan); border-radius: 3px; background: var(--cyan-soft); color: var(--cyan); font: 9px var(--mono); letter-spacing: .12em; cursor: pointer; }
.primary-button:hover { background: rgba(98,230,211,.2); }
.path-result { min-height: 37px; margin-top: 10px; padding: 10px; border-left: 2px solid var(--line-bright); background: rgba(8,11,16,.5); color: var(--muted); font-size: 10px; line-height: 1.6; }
.path-result[data-bench-path-status="ok"] { border-color: var(--cyan); }
.path-result[data-bench-path-status="invalid"], .path-result[data-bench-path-status="unreachable"] { border-color: var(--danger); color: #d7a0a6; }
.path-result[data-bench-path-status="same"] { border-color: var(--yellow); color: #c9bf80; }
.path-sequence { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; margin-top: 7px; }
.path-node { padding: 3px 5px; border: 1px solid rgba(98,230,211,.28); border-radius: 2px; background: var(--cyan-soft); color: var(--cyan); font: 8px var(--mono); cursor: pointer; }
.path-separator { color: var(--subtle); font-size: 8px; }

.empty-inspector { min-height: 90px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: var(--subtle); text-align: center; }
.empty-inspector p { margin: 0; font-size: 10px; }
.crosshair { width: 25px; height: 25px; border: 1px solid var(--line-bright); border-radius: 50%; position: relative; }
.crosshair::before, .crosshair::after { content: ""; position: absolute; background: var(--line-bright); }
.crosshair::before { width: 33px; height: 1px; top: 11px; left: -5px; }
.crosshair::after { width: 1px; height: 33px; left: 11px; top: -5px; }
.node-title { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: start; }
.node-title h3 { margin: 0; font-size: 18px; line-height: 1.25; }
.node-id { display: block; margin-top: 4px; color: var(--muted); font: 8px var(--mono); word-break: break-all; }
.node-badge { padding: 4px 6px; border-radius: 2px; border: 1px solid color-mix(in srgb, var(--node-color) 40%, transparent); color: var(--node-color); font: 8px var(--mono); text-transform: uppercase; }
.node-description { margin: 14px 0; color: #aeb7c0; font-size: 11px; line-height: 1.75; }
.node-metrics { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); }
.node-metrics div { padding: 8px; border-right: 1px solid var(--line); }
.node-metrics div:last-child { border-right: 0; }
.node-metrics b { display: block; font: 13px var(--mono); }
.node-metrics span { color: var(--muted); font-size: 8px; }
.aliases { margin-top: 12px; color: var(--muted); font-size: 9px; line-height: 1.7; }
.aliases b { color: var(--text); font-weight: 500; }
.neighbor-heading { margin: 17px 0 8px; display: flex; justify-content: space-between; color: var(--muted); font: 8px var(--mono); letter-spacing: .1em; }
.neighbor-list { max-height: 230px; overflow-y: auto; border-top: 1px solid var(--line); }
.neighbor-row { width: 100%; display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 9px 2px; border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left; cursor: pointer; }
.neighbor-row:hover strong { color: var(--cyan); }
.neighbor-row strong { display: block; font-size: 10px; font-weight: 550; }
.neighbor-row small { display: block; margin-top: 2px; color: var(--muted); font: 8px var(--mono); }
.neighbor-row em { max-width: 120px; color: var(--subtle); font: 8px var(--mono); font-style: normal; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.stats-panel h3 { display: flex; justify-content: space-between; margin: 19px 0 9px; color: var(--muted); font: 8px var(--mono); letter-spacing: .12em; }
.stats-panel h3:first-of-type { margin-top: 2px; }
.stats-panel h3 span { color: var(--subtle); }
.type-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.type-stat { padding: 9px 10px; border: 1px solid var(--line); border-radius: 3px; background: var(--surface-2); }
.type-stat span { display: block; color: var(--muted); font-size: 9px; }
.type-stat b { display: block; margin-top: 3px; color: var(--node-color); font: 16px var(--mono); }
.top-list { counter-reset: rank; border-top: 1px solid var(--line); }
.top-row { counter-increment: rank; width: 100%; display: grid; grid-template-columns: 20px 1fr auto; gap: 7px; align-items: center; padding: 8px 2px; border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left; cursor: pointer; }
.top-row::before { content: counter(rank, decimal-leading-zero); color: var(--subtle); font: 8px var(--mono); }
.top-row:hover span { color: var(--cyan); }
.top-row span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.top-row b { color: var(--muted); font: 10px var(--mono); font-weight: 400; }
.relation-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); }
.relation-stat { display: flex; justify-content: space-between; gap: 8px; padding: 7px 8px; background: var(--surface-2); }
.relation-stat span { min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--muted); font: 8px var(--mono); }
.relation-stat b { color: var(--text); font: 9px var(--mono); font-weight: 500; }
.sidebar-footer { flex: 0 0 auto; padding: 13px 20px; border-top: 1px solid var(--line-bright); background: var(--surface-2); }
.sidebar-footer button { width: 100%; padding: 8px; border: 1px solid var(--line-bright); border-radius: 3px; background: transparent; color: var(--muted); font: 9px var(--mono); letter-spacing: .08em; cursor: pointer; }
.sidebar-footer button:hover { border-color: var(--cyan); color: var(--cyan); }
.sidebar-footer button span { font-size: 13px; margin-right: 5px; }
.sidebar-footer small { display: block; margin-top: 9px; text-align: center; color: var(--subtle); font: 7px var(--mono); letter-spacing: .1em; }

@media (max-width: 900px) {
  :root { --sidebar: min(390px, 88vw); }
  .workspace { display: block; position: relative; }
  .graph-stage { width: 100%; height: 100%; }
  .sidebar { position: absolute; inset: 0 0 0 auto; width: var(--sidebar); transform: translateX(100%); transition: transform .2s ease; box-shadow: -20px 0 50px rgba(0,0,0,.45); }
  .sidebar.open { transform: translateX(0); }
  .mobile-panel-toggle { display: block; }
  .dataset-summary span:not(.live-indicator) { display: none; }
  .search-box, .search-results { width: min(360px, calc(100vw - 36px)); }
  .graph-hint { display: none; }
}
@media (max-width: 560px) {
  .topbar { height: 58px; padding: 0 12px; }
  .workspace { height: calc(100% - 58px); }
  .brand p { display: none; }
  .brand h1 { font-size: 14px; }
  .brand-mark { width: 22px; height: 22px; }
  .brand-mark::before { width: 28px; left: -4px; top: 10px; }
  .brand-mark::after { height: 28px; left: 10px; top: -4px; }
  .legend { gap: 9px; padding: 8px; }
  .legend span { font-size: 0; }
  .legend i { width: 9px; height: 9px; }
  .top-left { top: 12px; left: 12px; }
  .bottom-left { left: 12px; bottom: 12px; }
  .bottom-right { right: 12px; bottom: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
