.architecture-map-frame {
  margin: 2rem 0 1rem;
  overflow-x: auto;
  border: 1px solid var(--puppets-border);
  border-radius: 20px;
  background:
    radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--puppets-accent) 12%, transparent), transparent 34%),
    var(--puppets-panel);
  box-shadow: 0 24px 70px var(--puppets-shadow);
}

.architecture-map {
  display: block;
  width: 100%;
  min-width: 900px;
  height: auto;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.map-zone {
  fill: color-mix(in srgb, var(--puppets-bg) 58%, transparent);
  stroke: var(--puppets-border);
  stroke-width: 1.5;
}

.map-zone-runtime {
  stroke: var(--puppets-accent);
}

.map-zone-kicker {
  fill: var(--puppets-accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.4px;
}

.map-zone-title {
  fill: var(--puppets-text);
  font-size: 19px;
  font-weight: 750;
}

.map-zone-note {
  fill: var(--puppets-muted);
  font-size: 11px;
}

.map-item,
.map-provider,
.map-runtime-step {
  fill: var(--puppets-panel-soft);
  stroke: var(--puppets-border);
  stroke-width: 1;
}

.map-item-state {
  fill: color-mix(in srgb, var(--puppets-accent) 7%, var(--puppets-panel-soft));
}

.map-item-title,
.map-provider-name {
  fill: var(--puppets-text);
  font-size: 14px;
  font-weight: 700;
}

.map-item-code {
  fill: var(--puppets-accent-strong);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 11px;
}

.map-item-line {
  fill: var(--puppets-muted);
  font-size: 12px;
}

.map-runtime-step {
  stroke: color-mix(in srgb, var(--puppets-accent) 50%, var(--puppets-border));
}

.map-runtime-number {
  fill: var(--puppets-accent);
  font-size: 13px;
  font-weight: 800;
  text-anchor: middle;
}

.map-runtime-label {
  fill: var(--puppets-text);
  font-size: 9.5px;
  font-weight: 700;
  text-anchor: middle;
}

.map-flow {
  fill: none;
  stroke: var(--puppets-accent);
  stroke-width: 2;
  stroke-dasharray: 5 6;
  opacity: 0.8;
}

.map-flow-secondary {
  stroke: var(--puppets-muted);
  opacity: 0.55;
}

.map-arrowhead {
  fill: var(--puppets-accent);
}

.map-particle circle {
  fill: var(--puppets-accent);
  filter: url("#architecture-glow");
}

.map-callout circle {
  fill: var(--puppets-accent);
}

.map-callout text {
  fill: #06101d;
  font-size: 11px;
  font-weight: 900;
  text-anchor: middle;
}

.architecture-map-legend {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.65rem;
  margin: 0 0 3rem;
  padding: 0;
  list-style: none;
  counter-reset: map-step;
}

.architecture-map-legend li {
  position: relative;
  padding: 0.8rem 0.75rem 0.8rem 2.35rem;
  border: 1px solid var(--puppets-border);
  border-radius: 10px;
  background: var(--puppets-panel);
  font-size: 0.76rem;
  line-height: 1.35;
  counter-increment: map-step;
}

.architecture-map-legend li::before {
  position: absolute;
  top: 0.75rem;
  left: 0.7rem;
  display: grid;
  width: 1.25rem;
  height: 1.25rem;
  place-items: center;
  border-radius: 50%;
  color: #06101d;
  background: var(--puppets-accent);
  font-size: 0.68rem;
  font-weight: 900;
  content: counter(map-step);
}

@media (max-width: 720px) {
  .architecture-map-legend {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .map-particle {
    display: none;
  }
}
