.contact-graph-toggle.active,
.graph-mini-btn.active {
  border-color: rgba(96, 165, 250, 0.85);
  background: rgba(37, 99, 235, 0.16);
  color: #dbeafe;
}

.contact-graph-panel {
  position: relative;
  min-height: 360px;
  margin: 8px 12px 14px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 16px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 48%, rgba(30, 64, 175, 0.10), transparent 42%),
    rgba(8, 15, 29, 0.72);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.015);
}

.contact-graph-panel.fullscreen {
  position: fixed;
  inset: 18px;
  z-index: 1200;
  min-height: 0;
  margin: 0;
  border-radius: 20px;
  background:
    radial-gradient(circle at 50% 48%, rgba(30, 64, 175, 0.14), transparent 38%),
    #08111f;
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.58);
}

.contact-graph-toolbar {
  position: relative;
  z-index: 2;
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px 7px 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(11, 20, 36, 0.78);
  backdrop-filter: blur(8px);
}

.contact-graph-toolbar > div:first-child {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.contact-graph-toolbar strong {
  color: #e5edf8;
  font-size: 12px;
  font-weight: 700;
}

.contact-graph-toolbar small {
  color: #8190a7;
  font-size: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contact-graph-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
}

.graph-mini-btn {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(148, 163, 184, 0.19);
  border-radius: 9px;
  background: rgba(17, 29, 48, 0.76);
  color: #aab7cb;
  cursor: pointer;
  font-size: 13px;
}

.graph-mini-btn:hover {
  color: #f8fafc;
  border-color: rgba(96, 165, 250, 0.52);
  background: rgba(30, 64, 175, 0.18);
}

.contact-graph-stage {
  position: relative;
  height: 360px;
  min-height: 330px;
}

.contact-graph-panel.fullscreen .contact-graph-stage {
  height: calc(100% - 50px);
}

.contact-graph-canvas,
#contactGraphCanvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

#contactGraphCanvas:active {
  cursor: grabbing;
}

.contact-graph-hint {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 8px;
  padding: 5px 8px;
  border-radius: 8px;
  color: rgba(203, 213, 225, 0.72);
  background: rgba(5, 11, 22, 0.56);
  font-size: 9px;
  line-height: 1.3;
  text-align: center;
  pointer-events: none;
  backdrop-filter: blur(5px);
}

@media (max-width: 720px) {
  .contact-graph-panel {
    min-height: 300px;
    margin-inline: 8px;
  }

  .contact-graph-stage {
    height: 310px;
    min-height: 285px;
  }

  .contact-graph-panel.fullscreen {
    inset: 8px;
  }

  .contact-graph-toolbar small {
    max-width: 170px;
  }
}
