.channel-map {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  padding: 16px;
  background: var(--scrim);
  backdrop-filter: blur(12px) saturate(1.15);
  -webkit-backdrop-filter: blur(12px) saturate(1.15);
  animation: fade-in var(--dur) var(--ease);
}

.map-sheet {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-radius: var(--r-xl);
  padding: 16px 16px 14px;
  animation: sheet-in var(--dur-sheet) var(--spring);
}

.map-head,
.map-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.map-head { align-items: center; }

.map-title-block { min-width: 0; flex: 1; }

.map-head h2 { margin: 0; }

.map-toolbar { margin: 14px 0 12px; }

.map-toolbar form {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  flex: 1;
  align-items: center;
}

.map-toolbar input { min-width: 160px; flex: 1; }

.map-toolbar select { width: auto; min-width: 140px; }

.map-body {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr minmax(260px, 320px);
  gap: 12px;
}

.map-canvas-wrap {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  gap: 8px;
}

.map-canvas {
  position: relative;
  flex: 1;
  min-height: 360px;
  border-radius: 20px;
  background:
    radial-gradient(circle at 50% 40%, rgba(12, 110, 102, 0.08), transparent 46%),
    #e7eef2;
  box-shadow: inset 0 0 0 1px var(--separator);
  overflow: hidden;
}

.map-wires { position: absolute; inset: 0; width: 100%; height: 100%; }

.wire-hit {
  fill: none;
  stroke: transparent;
  stroke-width: 16;
  pointer-events: stroke;
  cursor: pointer;
}

.wire-vis {
  fill: none;
  stroke: rgba(12, 110, 102, 0.75);
  stroke-width: 1.75;
  pointer-events: none;
}

.wire-vis.is-selected { stroke: var(--gold); stroke-width: 2.25; }

.map-node {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 128px;
  min-height: 60px;
  border-radius: var(--r-pill);
  border: 0;
  background: radial-gradient(circle at 32% 28%, #f7fffc, #b7e6df 42%, #2f746c 82%);
  color: #08211f;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  text-align: center;
  cursor: grab;
  box-shadow: var(--shadow-node);
}

.map-node span {
  font-size: var(--text-caption);
  letter-spacing: -0.006em;
  opacity: 0.72;
}

.map-node strong {
  font-size: var(--text-footnote);
  font-weight: 700;
  letter-spacing: -0.014em;
}

.map-node.is-selected { box-shadow: var(--shadow-node), 0 0 0 2px var(--accent-bright); }

.map-node.is-source { box-shadow: var(--shadow-node), 0 0 0 2px var(--accent); }

.map-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--label-secondary);
  font-size: var(--text-subhead);
  padding: 24px;
  text-align: center;
}

.map-inspector {
  display: flex;
  gap: 8px;
  align-items: end;
  flex-wrap: wrap;
}

.map-inspector label { flex: 1; min-width: 140px; }

.people-pane {
  overflow: auto;
  padding: 14px;
  border-radius: 20px;
  background: var(--field);
  box-shadow: inset 0 0 0 1px var(--separator);
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.22) transparent;
}

.people-pane h3 {
  margin: 16px 0 8px;
  font-size: var(--text-footnote);
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--label-secondary);
}

.lead-form,
.person-card { display: flex; flex-direction: column; gap: 8px; }

.person-card {
  padding: 12px;
  margin-bottom: 8px;
  border-radius: 14px;
  background: var(--surface);
}

.person-card header {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.mini-chip {
  font-size: var(--text-caption);
  padding: 2px 8px;
  border-radius: var(--r-pill);
  background: var(--accent-deep);
  color: var(--accent);
  font-weight: 600;
}

@media (max-width: 900px) {
  .channel-map { padding: 8px; }
  .map-sheet { border-radius: 20px; }
  .map-body { grid-template-columns: 1fr; overflow: auto; }
  .map-canvas { min-height: 320px; }
}

@media (prefers-reduced-motion: reduce) {
  .channel-map,
  .map-sheet { animation-name: fade-in; }
}
