/* MeshBuddy — Live Mesh Topology Graph panel (tactical glass). */

.mb-topo-panel {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 640;
  width: 300px;
  max-width: calc(100vw - 24px);
  padding: 10px 12px 8px;
  border: 1px solid rgba(120, 210, 160, 0.22);
  border-radius: 12px;
  color: #dff7e6;
  font: 13px/1.35 system-ui, -apple-system, "Segoe UI", sans-serif;
  background-color: rgba(9, 13, 11, 0.52);
  -webkit-backdrop-filter: blur(12px) saturate(135%);
  backdrop-filter: blur(12px) saturate(135%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 10px 28px rgba(0, 0, 0, .38);
}
.mb-topo-panel.is-hidden { display: none; }

.mb-topo-head {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 8px;
}
.mb-topo-title {
  font-size: 13px;
  letter-spacing: .3px;
  color: #eafff2;
  flex: 0 0 auto;
}
.mb-topo-conn {
  margin-left: auto;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .5px;
  opacity: .75;
}
.mb-topo-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #6b7d72;
  box-shadow: 0 0 6px rgba(70, 224, 107, .0);
  flex: 0 0 auto;
}
.mb-topo-dot[data-state="connected"] { background: #46e06b; box-shadow: 0 0 8px rgba(70, 224, 107, .7); }
.mb-topo-dot[data-state="reconnecting"] { background: #f0c24b; box-shadow: 0 0 8px rgba(240, 194, 75, .6); }
.mb-topo-dot[data-state="error"] { background: #f0655f; box-shadow: 0 0 8px rgba(240, 101, 95, .6); }

.mb-topo-x {
  appearance: none;
  border: 0;
  background: transparent;
  color: #cfe9d8;
  font-size: 17px;
  line-height: 1;
  padding: 0 2px;
  cursor: pointer;
  opacity: .7;
}
.mb-topo-x:hover { opacity: 1; }

.mb-topo-modes {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}
.mb-topo-mode,
.mb-topo-clear {
  appearance: none;
  cursor: pointer;
  border: 1px solid rgba(120, 210, 160, 0.28);
  border-radius: 8px;
  background: rgba(70, 224, 107, 0.06);
  color: #d7f3e0;
  font-size: 12px;
  padding: 5px 10px;
  letter-spacing: .3px;
}
.mb-topo-mode:hover,
.mb-topo-clear:hover { background: rgba(70, 224, 107, 0.14); }
.mb-topo-mode.is-active {
  background: rgba(70, 224, 107, 0.22);
  border-color: rgba(70, 224, 107, 0.55);
  color: #eafff2;
  box-shadow: 0 0 10px rgba(70, 224, 107, .25);
}
.mb-topo-clear { margin-left: auto; }

.mb-topo-stats {
  display: flex;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 12px;
  color: #b7d9c3;
}
.mb-topo-stats b { color: #eafff2; font-weight: 700; }

.mb-topo-canvas-wrap {
  display: none;
  margin-bottom: 8px;
  border: 1px solid rgba(120, 210, 160, 0.16);
  border-radius: 10px;
  background:
    radial-gradient(120% 120% at 50% 0%, rgba(70, 224, 107, .06), rgba(0, 0, 0, 0) 60%),
    rgba(4, 8, 6, 0.55);
  overflow: hidden;
}
.mb-topo-canvas {
  display: block;
  width: 100%;
  height: 240px;
}

.mb-topo-note {
  font-size: 10.5px;
  line-height: 1.3;
  color: #7fa891;
  opacity: .85;
}

/* Active state for the toolbar toggle button */
#topologyTopToggle.active {
  background: rgba(70, 224, 107, 0.22);
  border-color: rgba(70, 224, 107, 0.55);
  color: #eafff2;
}

@media (max-width: 560px) {
  .mb-topo-panel { width: calc(100vw - 24px); right: 12px; bottom: 76px; }
}
