* { box-sizing: border-box; }
:root {
  --bg: #f7f8fa;
  --panel: #ffffff;
  --line: #d9dde5;
  --text: #1f2937;
  --muted: #6b7280;
  --accent: #1f78b4;
}
html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.topbar {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.topbar h1 {
  margin: 0 0 4px;
  font-size: 1.5rem;
}
.topbar p {
  margin: 0;
  color: var(--muted);
}
.meta {
  min-width: 220px;
  color: var(--muted);
  font-size: 0.95rem;
}
.layout {
  display: grid;
  grid-template-columns: 320px 1fr 360px;
  gap: 16px;
  padding: 16px;
  min-height: calc(100vh - 88px);
}
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  overflow: auto;
}
.controls label {
  display: block;
  font-weight: 600;
  margin: 14px 0 6px;
}
.controls input[type="text"], .controls select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 0.96rem;
  background: #fff;
}
.row {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}
.check {
  font-weight: 500 !important;
  color: var(--text);
}
.legend {
  margin-top: 18px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
.legendItem {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.94rem;
}
.swatch {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  flex: 0 0 12px;
}
.graphWrap {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: auto;
  min-height: 820px;
}
#graphSvg {
  width: 100%;
  min-height: 820px;
  display: block;
  background: #fff;
}
.edge {
  stroke: #c9cdd4;
  stroke-width: 1;
  stroke-opacity: 0.55;
}
.edge.highlight {
  stroke: #6b7280;
  stroke-opacity: 0.95;
  stroke-width: 1.8;
}
.node {
  cursor: pointer;
  transition: opacity 120ms ease;
}
.node.hidden {
  opacity: 0.08;
}
.nodeCircle {
  stroke: #fff;
  stroke-width: 1;
}
.nodeCircle.support {
  fill: #e9ecef;
  stroke: #aeb4bc;
}
.nodeCircle.selected {
  stroke: #111827;
  stroke-width: 2.2;
}
.nodeLabel {
  font-size: 9.5px;
  fill: #223;
  pointer-events: none;
}
.nodeLabel.hidden {
  display: none;
}
.details h2, .controls h2 {
  margin-top: 0;
}
.empty {
  color: var(--muted);
}
.card {
  display: grid;
  gap: 14px;
}
.kpiGrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.kpi {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: #fafafa;
}
.kpi .label {
  font-size: 0.8rem;
  color: var(--muted);
}
.kpi .value {
  font-size: 1rem;
  font-weight: 700;
  margin-top: 4px;
}
.tagRow {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tag {
  border-radius: 999px;
  padding: 6px 10px;
  background: #f2f5f9;
  font-size: 0.84rem;
  color: #334155;
}
.listBlock ul {
  margin: 8px 0 0 18px;
  padding: 0;
}
.listBlock li {
  margin: 4px 0;
}
.hint {
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
  color: var(--muted);
  font-size: 0.93rem;
}
@media (max-width: 1400px) {
  .layout {
    grid-template-columns: 300px 1fr;
  }
  .details {
    grid-column: 1 / -1;
  }
}
@media (max-width: 980px) {
  .layout {
    grid-template-columns: 1fr;
  }
  .graphWrap {
    order: -1;
  }
}
