.mermaid-zoomable {
  position: relative;
}

.mermaid-zoom-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  z-index: 5;
  border: none;
  border-radius: 0.375rem;
  padding: 0.35rem 0.5rem;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease-in-out, background 0.15s ease-in-out;
}

.mermaid-zoomable:hover .mermaid-zoom-btn,
.mermaid-zoom-btn:focus-visible {
  opacity: 1;
}

.mermaid-zoom-btn:hover {
  background: rgba(0, 0, 0, 0.8);
}

/* Full-page overlay for the zoomed diagram */
.mermaid-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
}

.mermaid-overlay-stage {
  width: 92vw;
  height: 88vh;
  overflow: hidden;
  background: var(--card-bg, #fff);
  border-radius: 0.5rem;
  cursor: grab;
  touch-action: none;
}

.mermaid-overlay-stage:active {
  cursor: grabbing;
}

.mermaid-overlay-stage svg {
  user-select: none;
}

.mermaid-overlay-controls {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 2001;
}

.mermaid-overlay-btn {
  width: 2.25rem;
  height: 2.25rem;
  border: none;
  border-radius: 0.375rem;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  cursor: pointer;
  font-size: 1rem;
  transition: background 0.15s ease-in-out;
}

.mermaid-overlay-btn:hover {
  background: rgba(0, 0, 0, 0.85);
}

