/* Named links between notes and names on branches (links.js) */
.xlink { fill: none; stroke: var(--text-3); stroke-width: 1.6; stroke-dasharray: 6 5; stroke-linecap: round; marker-end: url(#xlinkArrow); transition: stroke .15s, opacity .25s; }
.xlink.selected { stroke: var(--text); stroke-width: 2; }
.xlink.dimmed { opacity: .25; }
.xlink.temp { stroke: var(--accent); opacity: .7; marker-end: none; }
.xlink-arrow { fill: none; stroke: var(--text-3); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.xlink-hit { fill: none; stroke: transparent; stroke-width: 14; stroke-linecap: round; pointer-events: stroke; cursor: pointer; }

#edgeLabels { position: absolute; left: 0; top: 0; }
.link-pill {
  position: absolute; left: 0; top: 0; z-index: 2;
  translate: -50% -50%; max-width: 200px; padding: 3px 10px;
  border-radius: 999px; background: var(--surface); color: var(--text-2);
  font-size: 11.5px; font-weight: 600; line-height: 16px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--text) 14%, transparent), var(--shadow-sm, 0 1px 3px rgba(0,0,0,.08));
  cursor: pointer; user-select: none;
  transition: opacity .2s, box-shadow .15s, color .15s;
}
.link-pill.branch { color: color-mix(in srgb, var(--c) 70%, var(--text)); box-shadow: 0 0 0 1px color-mix(in srgb, var(--c) 45%, transparent), var(--shadow-sm, 0 1px 3px rgba(0,0,0,.08)); }
.link-pill:hover { color: var(--text); }
.link-pill.selected { color: var(--text); box-shadow: 0 0 0 2px var(--text); }
/* a link without a name keeps a small dot to grab */
.link-pill.empty { width: 12px; height: 12px; padding: 0; min-width: 0; }
.link-pill.dimmed { opacity: .3; }
.link-pill.editing { opacity: 0; }
.link-input {
  position: absolute; left: 0; top: 0; z-index: 7; translate: -50% -50%;
  width: 180px; height: 26px; padding: 0 10px; border-radius: 999px;
  border: 1.5px solid var(--text); background: var(--surface); color: var(--text);
  font-family: inherit; font-size: 12px; font-weight: 600; text-align: center; outline: none;
}
/* the relink handles take the middle of the branches while Alt is held */
body.link-edit .link-pill.branch { opacity: 0; pointer-events: none; }

/* picking the second note of a new link */
body.link-pick #canvas, body.link-pick .node-hit { cursor: crosshair; }
.node.link-source .node-hit { outline: 2px dashed var(--text-2); outline-offset: 6px; border-radius: 50%; }
.xlink:has(+ .xlink-hit:hover) { stroke: var(--text-2); }
