:is(.enterprise-map, .industrial-flow) {
  --map-ink: #17294a;
  --map-muted: #4a5e80;
  --map-blue: #2b57ba;
  --map-signal: #2c6cdb;
  --map-line: #527ac2;
  --map-rule: #a8b9d6;
}
.enterprise-map {
  --map-warn: #945221;
  position: relative;
  width: 100%;
  min-width: 0;
  margin: 0;
  color: var(--map-ink);
}
.enterprise-map [hidden] { display: none; }
.map-story {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.map-caption {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 5px 12px;
  min-height: 48px;
  padding: 0 1.5% 4px;
}
.map-caption > div { display: grid; }
.map-phase { grid-area: 1 / 1; visibility: hidden; }
.enterprise-map[data-level=network] [data-phase="0"],
.enterprise-map[data-level=workflow] [data-phase="1"],
.enterprise-map[data-level=agent] [data-phase="2"] { visibility: visible; }
.map-phase .eyebrow { color: var(--map-blue); }
.map-title { margin-top: 4px; font-size: clamp(15px, 1.5vw, 21px); font-weight: 640; line-height: 1.2; letter-spacing: -.025em; }
.map-example { color: var(--map-muted); font: 10px/1.3 var(--mono); text-align: right; }

.map-board {
  position: relative;
  width: 100%;
  aspect-ratio: 640 / 338;
  min-height: 250px;
  overflow: hidden;
  isolation: isolate;
}
.map-board::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 51% 51%, #d5e7ff86 1%, #dce9ff40 42%, transparent 72%);
  pointer-events: none;
}
.map-scene { position: absolute; inset: 0; opacity: 0; }
.enterprise-map[data-motion] .map-scene {
  transition: transform .72s cubic-bezier(.22,.72,.22,1), opacity .42s ease;
}
.map-network { transform: scale(2.2); transform-origin: 24% 68%; }
.map-workflow { transform: scale(.78); transform-origin: 24% 66%; }
.map-agent-view { transform: scale(.83); transform-origin: 24% 66%; }
.enterprise-map[data-level=agent] .map-workflow { transform: scale(1.7); }
.enterprise-map[data-level=network] .map-network,
.enterprise-map[data-level=workflow] .map-workflow,
.enterprise-map[data-level=agent] .map-agent-view { opacity: 1; transform: none; }
.map-wires { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }

.map-network-rings, .map-network-grid, .map-network-bus path {
  fill: none;
  stroke: var(--map-line);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}
.map-network-rings { opacity: .25; }
.map-network-grid { opacity: .15; }
.map-network-bus path { opacity: .62; }
.map-network-bus .map-network-stream { stroke: var(--map-signal); stroke-dasharray: 3 24; stroke-width: 1.6; }
.enterprise-map[data-motion] .map-network-stream { animation: map-network-sync 2.7s ease-out both; animation-play-state: paused; }
.enterprise-map[data-running] .map-network-stream { animation-play-state: running; }
@keyframes map-network-sync {
  from { stroke-dashoffset: 130; opacity: .1; }
  to { stroke-dashoffset: 0; opacity: .8; }
}
.map-constellation polygon { fill: url(#map-blue-glass); fill-opacity: .78; stroke: #4f77b5; stroke-width: .9; vector-effect: non-scaling-stroke; }
.map-constellation path:not(.map-network-edge) { fill: none; stroke: #4575be; stroke-width: .7; stroke-opacity: .55; }
.map-network-edge { fill: #76a2e8; fill-opacity: .53; stroke: #4a74bf; stroke-opacity: .62; stroke-width: .75; }
.map-network-dot { fill: #5279be; opacity: .77; }
.map-network-beacon { fill: #2456b7; }
.map-constellation[data-constellation="2"] polygon { fill-opacity: 1; stroke: #2b5fc9; }
.map-constellation[data-constellation="2"] .map-network-beacon { fill: #163c94; }
.map-network-core path { fill: #aac8f6; stroke: #476db6; stroke-width: 1; }
.map-network-core path:first-child { fill: #d3e6ff; }
.map-network-core path:last-child { fill: none; stroke: #2d58b1; }
.map-network-label, .map-sources, .map-backbone {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  max-width: 27%;
  color: var(--map-muted);
  font: 10px/1.25 var(--mono);
  text-align: center;
}
.map-network-label { top: 61%; }
.map-sources { top: 7%; white-space: nowrap; }
.map-backbone { top: 52.2%; }
.map-branch {
  position: absolute;
  top: var(--branch-y);
  left: var(--branch-x);
  transform: translate(-50%, -50%);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 3px 6px;
  width: 30%;
  padding: 4px 3px;
  border-bottom: 1px solid #7999cd88;
  color: var(--map-ink);
  font-size: 12px;
  font-weight: 640;
  line-height: 1.2;
}
.map-branch strong { color: var(--map-blue); font: 10px/1.2 var(--mono); white-space: nowrap; }

.map-base { fill: url(#map-pins); }
.map-circuit { fill: none; stroke: #7696c6; stroke-opacity: .27; stroke-width: 1; vector-effect: non-scaling-stroke; }
.map-slab path { stroke: #547ebc; stroke-width: 1; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.map-slab-top { fill: #c9e0ff; }
.map-slab-left { fill: #80a9ea; }
.map-slab-right { fill: #a5c6f5; }
.map-slab-base .map-slab-top { fill: #e0edff; }
.map-slab-base .map-slab-left { fill: #9bbced; }
.map-slab-base .map-slab-right { fill: #bbd5f8; }
.map-slab-middle .map-slab-top { fill: #d5e7ff; }
.map-match-chip .map-slab-upper .map-slab-left { fill: #5686d7; }
.map-match-chip .map-slab-upper .map-slab-right { fill: #86aef1; }
.map-chip-mark { fill: none; stroke: #305bae; stroke-width: 1.2; vector-effect: non-scaling-stroke; }
.map-chip-signal { fill: none; stroke: #6488c4; stroke-width: 1; stroke-dasharray: 2 3; }
.map-guide, .map-trace { fill: none; stroke-width: 1.4; vector-effect: non-scaling-stroke; }
.map-guide { stroke: #7997c4; stroke-dasharray: 2 4; opacity: .65; }
.map-trace { stroke: var(--map-signal); }
.enterprise-map[data-motion] .map-trace { stroke-dasharray: 1; }
.map-packet-halo { fill: #a8ccff; opacity: .65; }
.map-packet-symbol { fill: #e9f4ff; stroke: var(--map-signal); stroke-width: 1.2; vector-effect: non-scaling-stroke; }
.enterprise-map[data-scenario=standard] :is([data-mode=mismatch], .map-end-mismatch),
.enterprise-map[data-scenario=mismatch] .map-end-standard { display: none; }
.enterprise-map[data-scenario=mismatch] [data-mode=standard] .map-trace { visibility: hidden; }
[data-mode=mismatch] :is(.map-trace, .map-packet-symbol) { stroke: var(--map-warn); }
.map-groups { position: absolute; inset: 0; }
.map-group { position: absolute; top: 10.7%; left: 3.125%; width: 32.8%; }
.map-group:nth-child(even) { left: 64.06%; }
.map-group:nth-child(2) { top: 16.5%; }
.map-group:nth-child(3) { top: 51.5%; }
.map-group:nth-child(4) { top: 59.45%; }
.map-team { height: 5.8%; min-height: 16px; margin-bottom: 2px; color: var(--map-muted); font: 10px/1.2 var(--mono); }
.map-group ol { display: grid; gap: 3px; }
.map-group ol > li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 4px 6px;
  min-height: clamp(24px, 2.6vw, 34px);
  padding: 2px 6px;
  border-bottom: 1px solid #8aa5d6a6;
  background: linear-gradient(90deg, #e8f1ffc7, #eaf1ff3d);
  font-size: 12px;
  font-weight: 620;
  line-height: 1.15;
}
.map-group:nth-child(3) ol > li:first-child { border-bottom-color: var(--map-blue); background: #d7e7fd; }
.map-agent-name { min-width: 0; }
.map-agent-target { color: var(--map-blue); font: 10px/1.1 var(--mono); white-space: nowrap; }
.map-destination {
  position: absolute;
  bottom: 3%;
  left: 50%;
  transform: translateX(-50%);
  color: var(--map-blue);
  font: 10px/1.25 var(--mono);
  text-align: center;
}
.map-end-mismatch { color: var(--map-warn); }

.map-match-drawing-mobile { display: none; }
.map-match-guides, .map-match-input-wire, .map-match-review-wire, .map-match-ports {
  fill: none;
  stroke: var(--map-line);
  stroke-width: 1.1;
  vector-effect: non-scaling-stroke;
}
.map-match-guides { stroke-opacity: .22; }
.map-match-input-wire { stroke: var(--map-signal); }
.map-match-review-wire { stroke: var(--map-warn); stroke-dasharray: 3 3; }
.map-match-ports { stroke: var(--map-blue); stroke-width: 1.6; }
.map-match-documents {
  position: absolute;
  top: 13%;
  left: 3%;
  width: 29%;
  height: 48%;
  display: grid;
  grid-template-rows: repeat(3, minmax(0, 1fr));
}
.map-match-documents li {
  align-self: center;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 4px 8px;
  min-width: 0;
  padding: 5px 6px;
  border-bottom: 1px solid #8ba6d0;
  background: linear-gradient(90deg, #e0eeffbd, #e2efff2b);
}
.map-match-documents li > div { display: grid; gap: 2px; }
.map-match-document { font-size: 12px; font-weight: 650; line-height: 1.15; }
.map-match-ref { color: var(--map-muted); font: 10px/1.2 var(--mono); }
.map-match-documents li > strong { color: var(--map-blue); font: 650 16px/1.1 var(--mono); }
.enterprise-map:not([data-match-step=read]) .map-match-documents li:nth-child(2) { border-bottom-color: var(--map-warn); }
.enterprise-map:not([data-match-step=read]) .map-match-documents li:nth-child(2) > strong { color: var(--map-warn); }
.map-match-label {
  position: absolute;
  top: 49%;
  left: 50%;
  max-width: 27%;
  transform: translateX(-50%);
  color: var(--map-blue);
  font: 11px/1.25 var(--mono);
  text-align: center;
}
.map-match-result {
  position: absolute;
  top: 33%;
  left: 68%;
  right: 3%;
  display: grid;
  justify-items: start;
  gap: 3px;
  padding: 5px 7px 6px;
  border-left: 1px solid #ba834b;
  color: var(--map-warn);
  background: linear-gradient(90deg, #f8e9d473, transparent);
}
.map-match-result > strong { font-size: 14px; line-height: 1.2; }
.map-match-result > span { font: 650 18px/1.2 var(--mono); }
.map-match-result p { color: var(--map-ink); font-size: 12px; line-height: 1.26; }
.map-match-comparison {
  position: absolute;
  right: 3%;
  bottom: 7%;
  left: 3%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 0;
}
.map-match-comparison > div { border-top: 1px solid var(--map-rule); padding-top: 5px; }
.map-match-comparison dt { color: var(--map-muted); font: 10px/1.3 var(--mono); }
.map-match-comparison dd { margin: 3px 0 0; color: var(--map-ink); font: 650 clamp(12px, 1.2vw, 17px)/1.25 var(--mono); }
.enterprise-map[data-motion] :is(.map-match-input-wire, .map-match-review-wire, .map-match-result, .map-match-comparison) { transition: opacity .38s ease; }
.enterprise-map[data-match-step=read] :is(.map-match-comparison, .map-match-review-wire, .map-match-result),
.enterprise-map[data-match-step=compare] :is(.map-match-review-wire, .map-match-result) { opacity: .22; }

.map-outcome {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 30px;
  align-items: start;
  gap: 4px 14px;
  min-height: 37px;
  margin: 0 1.5%;
  padding-top: 8px;
  border-top: 1px solid var(--map-rule);
}
.map-outcome > div { display: flex; align-items: baseline; flex-wrap: wrap; gap: 3px 8px; }
.map-outcome span { color: var(--map-muted); font-size: 11px; }
.map-outcome strong { color: var(--map-blue); font: 650 13px/1.3 var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.map-outcome .map-metric-agent { visibility: hidden; }
.enterprise-map[data-level=agent] .map-outcome .map-metric-agent { visibility: visible; }
.map-pause {
  display: grid;
  place-items: center;
  grid-column: 3;
  grid-row: 1;
  min-width: 30px;
  min-height: 30px;
  margin: -6px 0 -6px auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--map-muted);
  cursor: pointer;
}
.map-pause:hover { color: var(--map-blue); }
.map-pause > span { width: 8px; height: 10px; border-inline: 2px solid currentColor; }
.enterprise-map[data-paused] .map-pause > span {
  width: 0;
  height: 0;
  border: 5px solid transparent;
  border-left: 8px solid currentColor;
  border-right: 0;
}

@media (max-width: 570px) {
  .map-caption { align-items: start; min-height: 57px; }
  .map-example { max-width: 88px; }
  .map-branch { display: grid; gap: 2px; font-size: 11px; }
  .map-network-label, .map-sources, .map-backbone { font-size: 9px; }
  .map-group ol > li { padding-inline: 3px; font-size: 10px; }
  .map-agent-target { font-size: 9px; }
  .map-outcome { grid-template-columns: minmax(0, 1fr) 44px; min-height: 63px; }
  .map-outcome .map-metric-agent { grid-column: 1; }
  .map-pause { grid-column: 2; grid-row: 1 / 3; }
}
@media (max-width: 470px) {
  .map-match-drawing { display: none; }
  .map-match-drawing-mobile { display: block; }
  .map-match-documents {
    top: 4%;
    left: 3%;
    right: 3%;
    width: auto;
    height: 22.5%;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: 1fr;
    gap: 5px;
  }
  .map-match-documents li { align-self: stretch; flex-direction: column; align-items: start; gap: 1px; padding: 3px 4px; }
  .map-match-documents li > div { gap: 1px; }
  .map-match-document { font-size: 10px; }
  .map-match-ref { font-size: 9px; }
  .map-match-documents li > strong { font-size: 13px; }
  .map-match-label { top: 48%; left: 75%; max-width: 24%; font-size: 9px; }
  .map-match-result {
    top: 65.5%;
    right: 3%;
    left: 3%;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1px 6px;
    padding: 2px 5px 3px;
  }
  .map-match-result > strong { font-size: 11px; }
  .map-match-result > span { font-size: 13px; }
  .map-match-result p { grid-column: 1 / -1; font-size: 10px; line-height: 1.13; }
  .map-match-comparison { bottom: 2%; gap: 7px; }
  .map-match-comparison > div { padding-top: 3px; }
  .map-match-comparison dt { font-size: 9px; }
  .map-match-comparison dd { margin-top: 2px; font-size: 11px; }
}
@media (pointer: coarse) {
  .map-pause { min-width: 44px; min-height: 44px; }
}
