.d3-architecture {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  aspect-ratio: 1100 / 830;
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  transition: background 0.3s ease;
  user-select: none;
  -webkit-user-select: none;
}

.d3-architecture svg {
  display: block;
  width: 100%;
  height: 100%;
}

[data-theme="dark"] .d3-architecture {
  background: #0a0a0f;
  box-shadow: 0 0 40px rgba(6, 182, 212, 0.06),
              0 0 80px rgba(99, 102, 241, 0.04);
}

[data-theme="light"] .d3-architecture {
  background: #f0f2f5;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06),
              0 4px 24px rgba(0, 0, 0, 0.04);
}

.d3-architecture .arch-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  pointer-events: none;
  transition: opacity 0.5s ease;
  font-size: 13px;
  font-family: ui-monospace, monospace;
}

[data-theme="dark"] .d3-architecture .arch-loading {
  color: #64748b;
  background: #0a0a0f;
}

[data-theme="light"] .d3-architecture .arch-loading {
  color: #64748b;
  background: #f0f2f5;
}

.d3-architecture.arch-ready .arch-loading {
  opacity: 0;
}

.d3-architecture noscript div {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  font-size: 14px;
}

[data-theme="dark"] .d3-architecture noscript div {
  background: #0a0a0f;
  color: #64748b;
}

[data-theme="light"] .d3-architecture noscript div {
  background: #f0f2f5;
  color: #64748b;
}

.d3-architecture svg {
  cursor: grab;
}

.d3-architecture svg:active {
  cursor: grabbing;
}

/* Zone dashed "march" border animation */
@keyframes arch-zone-march {
  to {
    stroke-dashoffset: 22;
  }
}

.d3-architecture .arch-zone {
  animation: arch-zone-march 1.6s linear infinite;
}

/* Node hover transitions */
.d3-architecture .arch-node {
  transition: opacity 0.15s ease;
}

.d3-architecture .arch-node .node-bg {
  transition: stroke-width 0.15s ease, filter 0.15s ease;
}

.d3-architecture .arch-node:hover .node-bg {
  stroke-width: 2;
  filter: drop-shadow(0 0 5px rgba(56, 189, 248, 0.25));
}

.d3-architecture .arch-link {
  transition: opacity 0.15s ease, stroke-width 0.15s ease;
}
