.map-card {
  position: fixed;
  inset: 0;
  overflow: hidden;
  border: 0;
  background: #101216;
}

.map-controls {
  position: fixed;
  left: 50%;
  bottom: 18px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
  max-width: calc(100vw - 40px);
  overflow: visible;
  gap: 8px;
  transform: translateX(-50%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: rgba(28, 30, 35, 0.92);
  padding: 8px;
  backdrop-filter: blur(18px);
}

.map-control-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  gap: 7px;
  min-width: 40px;
  min-height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  padding: 8px 12px;
  font-size: 0.78rem;
  font-weight: 560;
  cursor: pointer;
  white-space: nowrap;
}

.simulator-controls,
.incident-strip {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 6px;
  white-space: nowrap;
}

.simulator-controls {
  order: 1;
  --active-index: 0;
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(82px, 1fr));
  gap: 0;
  min-height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  padding: 2px;
}

.simulator-controls::before {
  content: "";
  position: absolute;
  top: 2px;
  bottom: 2px;
  left: 2px;
  z-index: 0;
  width: calc((100% - 4px) / 3);
  border-radius: 999px;
  background: rgba(182, 147, 75, 0.24);
  transform: translateX(calc(var(--active-index) * 100%));
  transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

.control-separator {
  order: 2;
  flex: 0 0 auto;
  width: 1px;
  height: 30px;
  margin: 0 4px;
  background: rgba(255, 255, 255, 0.16);
}

.incident-strip {
  order: 3;
}

.sim-mode-button,
.incident-chip,
.clear-incidents-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  gap: 7px;
  min-height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  padding: 8px 12px;
  font-size: 0.78rem;
  font-weight: 520;
  cursor: pointer;
  white-space: nowrap;
}

.sim-mode-button {
  position: relative;
  z-index: 1;
  min-height: 30px;
  border: 0;
  background: transparent;
  padding: 7px 11px;
}

.sim-mode-button.active {
  background: transparent;
  color: #fff;
}

.incident-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-color: rgba(226, 81, 81, 0.45);
  background: rgba(226, 81, 81, 0.18);
}

.incident-chip span {
  color: rgba(255, 255, 255, 0.62);
}

.clear-incidents-button {
  color: rgba(255, 255, 255, 0.74);
}

.sim-hint {
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.76rem;
  padding: 0 4px;
}

.button-icon,
.button-icon svg {
  width: 16px;
  height: 16px;
}

.button-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.button-icon svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#resilienceMap {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
}

.edge {
  fill: none;
  stroke-width: 1.5;
  opacity: 0.78;
  transition:
    opacity 240ms ease,
    stroke-width 180ms ease;
}

.edge.highlighted {
  stroke-width: 2.4;
}

.edge.dimmed {
  opacity: 0.16;
}

.edge-connector {
  fill: rgba(125, 132, 145, 0.95);
  stroke: none;
  pointer-events: none;
  transition: opacity 240ms ease;
}

.edge-connector.highlighted {
  fill: var(--gold);
}

.edge-connector.dimmed {
  opacity: 0.18;
}

.edge-connector.risk-green {
  fill: var(--green);
}

.edge-connector.risk-orange {
  fill: var(--orange);
}

.edge-connector.risk-red {
  fill: var(--red);
}

.edge-connector.risk-gray {
  fill: var(--gray);
}

.map-control-button {
  order: 4;
}

.grid-line {
  stroke: rgba(255, 255, 255, 0.085);
  stroke-width: 1;
}

.node {
  cursor: grab;
  outline: none;
  touch-action: none;
  user-select: none;
  transition: opacity 240ms ease, filter 240ms ease;
}

.dragging-node,
.dragging-node .node {
  cursor: grabbing;
}

.panning-map,
.panning-map #resilienceMap {
  cursor: grabbing;
}

.node-box {
  fill: rgba(31, 33, 38, 0.96);
  stroke: rgba(255, 255, 255, 0.12);
  stroke-width: 1.2;
  transition:
    fill 240ms ease,
    stroke 240ms ease;
}

.node.focused .node-box {
  fill: rgba(55, 58, 66, 0.98);
}

.node.dimmed {
  opacity: 0.22;
  filter: saturate(0.55);
}

.node.incident-selected.red .node-box {
  fill: rgba(226, 81, 81, 0.92);
  stroke: rgba(226, 81, 81, 1);
  stroke-width: 1.2;
}

.node.incident-selected.orange .node-box {
  fill: rgba(255, 159, 28, 0.9);
  stroke: rgba(255, 159, 28, 1);
  stroke-width: 1.2;
}

.node.incident-affected.red .node-box {
  stroke: rgba(226, 81, 81, 1);
  stroke-width: 1.8;
}

.node.incident-affected.orange .node-box {
  stroke: rgba(255, 159, 28, 1);
  stroke-width: 1.8;
}

.node.incident-selected .node-dot {
  fill: rgba(255, 255, 255, 0.78);
}

.node.incident-selected .node-label,
.node.incident-selected .node-type {
  fill: #fff;
}

.node.focused .node-label,
.node.related .node-label {
  fill: var(--ink);
}

.node.focused .node-type,
.node.related .node-type {
  fill: var(--muted);
}

.node.green .node-dot {
  fill: var(--green);
}

.node.orange .node-dot {
  fill: var(--orange);
}

.node.red .node-dot {
  fill: var(--red);
}

.node.gray .node-dot {
  fill: var(--gray);
}

.node-label {
  fill: var(--ink);
  font-size: 14px;
  font-weight: 560;
}

.node-type {
  fill: var(--muted);
  font-size: 10px;
  font-weight: 560;
  letter-spacing: 0.04em;
}
