/* The sync map: graph-paper canvas viewport + node registry */
.map-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 16px;
  align-items: stretch;
}

.map-viewport {
  display: flex;
  flex-direction: column;
  padding: 12px;
  min-width: 0;
  background: var(--paper);
  border: 2px solid var(--pencil);
  border-radius: var(--radius-m);
}

.map-canvas {
  width: 100%;
  height: 440px;
  border-radius: var(--radius-s);
  border: 1.5px solid var(--rule);
  background:
    repeating-linear-gradient(0deg, var(--grid) 0 1px, transparent 1px 22px),
    repeating-linear-gradient(90deg, var(--grid) 0 1px, transparent 1px 22px),
    var(--paper);
  touch-action: manipulation;
}

.map-legend {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  padding: 12px 6px 2px;
  font-family: var(--font-hand);
  font-size: 15px;
  color: var(--pencil);
}

.map-legend span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.map-legend .dot {
  width: 10px;
  height: 10px;
  display: inline-block;
  border: 1.5px solid var(--ink);
  border-radius: 2px;
}

.dot-hub {
  background: var(--highlight);
  border-radius: 50%;
}

.dot-node {
  background: var(--paper);
}

.dot-delta {
  width: 14px;
  height: 3px;
  border: 0;
  background: repeating-linear-gradient(
    90deg,
    var(--accent) 0 4px,
    transparent 4px 8px
  );
}

.dot-converge {
  background: var(--accent);
  border-radius: 50%;
  width: 8px;
  height: 8px;
}

/* Node registry (right panel) */
.node-registry {
  background: var(--paper);
  border: 2px solid var(--pencil);
  border-radius: var(--radius-m);
  padding: 18px;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.registry-title {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 12px;
}

.registry-head,
.registry-row {
  display: grid;
  grid-template-columns: 1.1fr 1.2fr 0.9fr;
  gap: 10px;
  align-items: center;
}

.registry-head {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--pencil);
  padding: 0 8px 10px;
  border-bottom: 2px solid var(--ink);
}

.registry-body {
  display: flex;
  flex-direction: column;
}

.registry-row {
  padding: 10px 8px;
  border-bottom: 1.5px dashed var(--rule);
  font-family: var(--font-hand);
  font-size: 16px;
  color: var(--pencil);
  transition: background var(--dur-fast) var(--ease-out);
}

.registry-row:last-child {
  border-bottom: 0;
}

.registry-row:hover {
  background: var(--paper-tint);
}

.registry-row .rr-name {
  color: var(--ink);
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.registry-row .rr-gpu {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rr-load {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--pencil);
}

.rr-bar {
  width: 44px;
  height: 7px;
  border-radius: 3px;
  background: var(--paper-tint);
  border: 1.5px solid var(--pencil);
  position: relative;
  overflow: hidden;
  display: inline-block;
}

.rr-bar::after {
  content: "";
  position: absolute;
  inset: 0;
  width: var(--load, 0%);
  background: repeating-linear-gradient(
    -45deg,
    var(--accent) 0 3px,
    transparent 3px 6px
  );
  transition: width 0.9s var(--ease-out);
}

.rr-load.is-hot {
  color: var(--accent);
}

.rr-load.is-hot .rr-bar {
  border-color: var(--accent);
}

/* ============ RESPONSIVE ============ */
@media (max-width: 900px) {
  .map-grid {
    grid-template-columns: 1fr;
  }

  .map-canvas {
    height: 380px;
  }
}

@media (max-width: 640px) {
  .map-canvas {
    height: 300px;
  }

  .registry-head,
  .registry-row {
    grid-template-columns: 1fr 1fr;
  }

  .registry-head span:nth-child(2),
  .registry-row .rr-gpu {
    display: none;
  }
}
