.tabs {
  display: flex;
  gap: 4px;
  margin-left: 4px;
}
.tabs .tab {
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--text-dim);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.tabs .tab:hover { color: var(--text); background: var(--bg-card); }
.tabs .tab.active {
  color: var(--text);
  background: var(--accent-soft);
  font-weight: 500;
}

.zoom-levels {
  display: flex;
  gap: 2px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2px;
}
.zoom-levels button {
  background: transparent;
  border: none;
  color: var(--text-dim);
  padding: 4px 10px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 11px;
  font-family: var(--mono);
  font-weight: 600;
  transition: background 0.1s, color 0.1s;
}
.zoom-levels button:hover { color: var(--text); }
.zoom-levels button.active {
  background: var(--accent);
  color: white;
}

.mm-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  height: calc(100vh - 57px);
  overflow: hidden;
}

#mm-wrap {
  position: relative;
  background: var(--bg);
  overflow: hidden;
}

[data-theme="light"] #mm-wrap {
  background: radial-gradient(circle at 30% 30%, #fbfaf6 0%, #f1ede4 100%);
}

#mm-svg {
  width: 100%;
  height: 100%;
  cursor: grab;
  display: block;
}
#mm-svg:active { cursor: grabbing; }

.mm-link {
  fill: none;
  stroke-opacity: 0.35;
  transition: stroke-opacity 0.2s, stroke-width 0.2s;
}

.mm-node {
  cursor: pointer;
  transition: opacity 0.2s;
}

.mm-node text {
  user-select: none;
  transition: font-size 0.15s, fill 0.15s;
  font-family: var(--font);
}

.mm-node circle {
  transition: r 0.15s, stroke-width 0.15s, filter 0.15s;
}

svg.has-hover .mm-link { stroke-opacity: 0.06; }
svg.has-hover .mm-node { opacity: 0.22; }

.mm-link.path-active {
  stroke-opacity: 1;
  stroke-width: 2.5 !important;
}
svg.has-hover .mm-node.path-active { opacity: 1; }
.mm-node.path-active circle {
  stroke-width: 2.5;
  filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.3));
}
.mm-node.path-active text { font-weight: 700; }

.mm-node.hover-target circle {
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.4));
}

.mm-node.search-hit circle {
  stroke: var(--accent);
  stroke-width: 3;
}

#mm-detail {
  background: var(--bg-elev);
  border-left: 1px solid var(--border);
  overflow-y: auto;
  padding: 24px;
}

#mm-detail .detail-header { margin-bottom: 16px; }

.mm-legend {
  position: fixed;
  bottom: 16px;
  left: 16px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 11px;
  color: var(--text-dim);
  box-shadow: var(--shadow);
  max-width: calc(100vw - 420px);
  z-index: 5;
}

.mm-legend .lg-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.mm-legend .lg-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.mm-legend .lg-name {
  color: var(--text);
}

.mm-legend .lg-id {
  font-family: var(--mono);
  font-weight: 700;
}

@media (max-width: 900px) {
  .mm-layout {
    grid-template-columns: 1fr;
    grid-template-rows: 60vh 1fr;
  }
  #mm-detail { border-left: none; border-top: 1px solid var(--border); }
  .mm-legend { max-width: calc(100vw - 32px); }
  .zoom-levels button { padding: 4px 6px; font-size: 10px; }
}
