/* ── CANVAS ── */
#canvas {
  flex: 1; position: relative; overflow: hidden;
  background:
    radial-gradient(ellipse 70% 60% at 15% 85%, rgba(123,104,238,0.04) 0%, transparent 65%),
    radial-gradient(ellipse 50% 50% at 82% 18%, rgba(62,207,142,0.03) 0%, transparent 65%),
    var(--bg);
  cursor: default;
}

/* dot grid */
#canvas::before {
  content: '';
  position: absolute; inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 26px 26px;
  pointer-events: none; z-index: 0;
}

/* Transformable layer — all notes, zones, edges live here */
#viewport {
  position: absolute; top: 0; left: 0;
  width: 100%; height: 100%;
  transform-origin: 0 0;
  overflow: visible;
}

#svg-layer {
  position: absolute; top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none; z-index: 2;
  overflow: visible;
}
#svg-layer.linking { pointer-events: all; cursor: crosshair; }

/* Multi-select rubber-band box (lives inside viewport — canvas coords) */
#selection-box {
  position: absolute; z-index: 5;
  border: 1px solid var(--accent-border);
  background: var(--accent-soft);
  border-radius: 3px;
  pointer-events: none;
  display: none;
}
#selection-box.visible { display: block; }

/* ── MINIMAP ── */
#minimap {
  position: absolute; bottom: 16px; right: 16px;
  width: 160px; height: 110px;
  border-radius: 8px;
  background: rgba(11,12,14,0.72);
  border: 1px solid rgba(255,255,255,0.09);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  cursor: pointer;
  z-index: 100;
  transition: opacity 0.2s;
}
#minimap:hover { opacity: 0.9; }
html.light #minimap {
  background: rgba(244,245,248,0.82);
  border-color: rgba(0,0,0,0.1);
}

/* ── ANIMATIONS ── */
@keyframes noteIn {
  from { opacity: 0; transform: scale(0.9) translateY(8px); }
  to   { opacity: 1; transform: scale(1)   translateY(0);   }
}
.note-enter { animation: noteIn 0.2s cubic-bezier(0.34,1.4,0.64,1) forwards; }
