/* Interactive diagram viewer */
.dg-tool-page {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 8rem);
  background: #e8eaed;
}

.dg-viewer-shell {
  position: relative;
  flex: 1;
  min-height: 420px;
  overflow: hidden;
}

.dg-canvas-host {
  position: absolute;
  inset: 0;
  touch-action: none;
  overflow: hidden;
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.7), transparent 40%),
    linear-gradient(135deg, #eef1f4, #e2e6eb);
}

.dg-world {
  position: absolute;
  left: 0;
  top: 0;
}

.dg-world img {
  box-shadow: 0 0.5rem 1.5rem rgba(15, 23, 42, 0.12);
  background: #fff;
}

.dg-callout {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: min(360px, calc(100% - 2rem));
  max-height: calc(100% - 2rem);
  overflow: auto;
  background: #fff;
  border: 1px solid #d0d5dd;
  border-radius: 0.5rem;
  box-shadow: 0 0.5rem 1.5rem rgba(15, 23, 42, 0.12);
  padding: 1rem;
  z-index: 5;
}

.dg-callout-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.dg-callout-body :is(p, ul, ol) {
  margin-bottom: 0.5rem;
}

.dg-callout-body a.reference {
  font-size: 0.85em;
}

.dg-zoom-controls {
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  z-index: 4;
}

.dg-zoom-controls .btn {
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  line-height: 1;
  font-size: 1.15rem;
}

.dg-a11y-list {
  position: absolute;
  left: 1rem;
  bottom: 1rem;
  z-index: 4;
  max-width: min(280px, calc(100% - 5rem));
}

.dg-hotspot-list {
  margin-top: 0.35rem;
  max-height: 40vh;
  overflow: auto;
}

.dg-hotspot-marker {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
}

.dg-hotspot-marker.info { background: #0372ff; }
.dg-hotspot-marker.critical { background: #d92e24; }
.dg-hotspot-marker.best { background: #1a7f37; }
.dg-hotspot-marker.link { background: #6941c6; }

@media (prefers-reduced-motion: reduce) {
  .dg-viewer-shell * {
    transition: none !important;
    animation: none !important;
  }
}
