/* ---------- arrows (section 22) ----------
   Ink on the canvas, in its order as every object is (Bring to front, Send to back; Axio, 2026-11-06: a shape sent
   back lay over the arrows still, which were all drawn under everything): a line with a slim notched dart for a head and a dot for a tail, in the ink of
   the second weight or the colour it was given. The dot that draws one is a ring with a point in it, the same mark. */
.obj.arrow {
  --ar: var(--k-a, var(--ink-2));
  background: none; border: 0; border-radius: 0; box-shadow: none; overflow: visible; pointer-events: none;
}
.obj.arrow:focus-within { box-shadow: none; }
.obj.arrow.sel { outline: none; }
.obj.arrow > svg { position: absolute; left: 0; top: 0; overflow: visible; }
.obj.arrow.ar-none > svg { display: none; }
.ar-hit { fill: none; stroke: transparent; stroke-width: 14px; stroke-linecap: round; vector-effect: non-scaling-stroke; pointer-events: stroke; cursor: pointer; }
.ar-hl { fill: none; stroke: transparent; stroke-linecap: round; transition: stroke 140ms ease-out; }
.ar-ln { fill: none; stroke: var(--ar); stroke-linecap: round; stroke-linejoin: round; }
.ar-hd { fill: var(--ar); stroke: var(--ar); stroke-width: .6px; stroke-linejoin: round; }
@media (hover: hover) { .obj.arrow:not(.sel):hover .ar-hl { stroke: color-mix(in srgb, var(--ar) 9%, transparent); } }
.obj.arrow.sel .ar-hl { stroke: color-mix(in srgb, var(--ar) 15%, transparent); }
body.linking .ar-hit, body.bending .ar-hit { pointer-events: none; }
body.linking, body.linking * { cursor: crosshair !important; }
body.bending, body.bending * { cursor: grabbing !important; }
/* its label: words at the line's middle, level whichever way it goes, in its ink; the line stops short of them all
   round, a hole in it (--lw by --lh: the label's size and its gap, arrows.js), so what is behind shows through */
.obj.arrow > .ar-lb {
  position: absolute; left: var(--mx); top: var(--my); translate: -50% -50%; width: max-content; max-width: 220px; min-width: 1ch;
  font: 500 14px/18px var(--f-ui); letter-spacing: -.004em; color: var(--ar); text-align: center; white-space: pre-wrap; overflow-wrap: anywhere;
  pointer-events: auto; cursor: pointer; outline: none;
}
.obj.arrow:not([data-label]) > .ar-lb:not(:focus) { opacity: 0; pointer-events: none; }
.obj.arrow > .ar-lb:focus { cursor: text; }
.obj.arrow:not([data-tml]):is([data-label], :has(> .ar-lb:focus)) > svg {
  -webkit-mask-image: linear-gradient(#000 0 0), linear-gradient(#000 0 0);
  -webkit-mask-repeat: repeat, no-repeat;
  -webkit-mask-position: 0 0, calc(var(--mx) - var(--lw, 0px) / 2) calc(var(--my) - var(--lh, 0px) / 2);
  -webkit-mask-size: auto, var(--lw, 0px) var(--lh, 0px);
  -webkit-mask-composite: xor;
  mask-image: linear-gradient(#000 0 0), linear-gradient(#000 0 0);
  mask-repeat: repeat, no-repeat;
  mask-position: 0 0, calc(var(--mx) - var(--lw, 0px) / 2) calc(var(--my) - var(--lh, 0px) / 2);
  mask-size: auto, var(--lw, 0px) var(--lh, 0px);
  mask-composite: exclude;
}
/* what a dragged end would hold on to */
.obj.lk-hot { outline: 1.5px solid var(--sel); outline-offset: 5px; }
.obj.header.lk-hot { outline-offset: 4px; }
.obj.board[data-view="icon"].lk-hot { outline: none; }
.obj.board[data-view="icon"].lk-hot > .binner { outline: 1.5px solid var(--sel); outline-offset: 5px; }

/* It comes quietly: a moment after the pointer arrives (a pass on the way elsewhere never shows it), fading in from
   just smaller, no overshoot, in the canvas's own greys; it fills only under the pointer. */
#ldot {
  position: absolute; left: 0; top: 0; z-index: 3; width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50%;
  display: grid; place-items: center; cursor: crosshair; touch-action: none;
  transition: opacity 200ms ease-out 90ms, scale 260ms cubic-bezier(.2, .8, .2, 1) 90ms, visibility 0s;
}
#ldot::before, #ldot::after { content: ""; grid-area: 1 / 1; border-radius: 50%; box-sizing: border-box; }
#ldot::before {
  width: 10px; height: 10px; border: 1.25px solid var(--ink-3); background: var(--surface);
  transition: background-color 140ms ease-out, border-color 140ms ease-out, scale 160ms ease-out;
}
#ldot::after { width: 2.5px; height: 2.5px; background: var(--ink-3); transition: background-color 140ms ease-out; }
@media (hover: hover) {
  #ldot:hover::before { background: var(--ink); border-color: var(--ink); scale: 1.2; }
  #ldot:hover::after { background: var(--surface); }
}
#ldot.off { opacity: 0; scale: .8; visibility: hidden; pointer-events: none; transition: opacity 120ms ease-in, scale 120ms ease-in, visibility 0s linear 120ms; }
body.moving #ldot, body.drawing #ldot, body.sizing #ldot, body.marking #ldot, body.panning #ldot, body.dv #ldot, body.linking #ldot, body.bending #ldot { opacity: 0; pointer-events: none; }

/* the selected arrow's ends (rings) and middle (a diamond, filled once it bends) */
#akn { position: absolute; left: 0; top: 0; z-index: 3; pointer-events: none; }
#akn > i { position: absolute; left: 0; top: 0; width: 24px; height: 24px; margin: -12px 0 0 -12px; display: grid; place-items: center; pointer-events: auto; cursor: grab; touch-action: none; }
#akn > i::before {
  content: ""; width: 10px; height: 10px; box-sizing: border-box; border-radius: 50%;
  border: 1.5px solid var(--sel); background: var(--surface); box-shadow: 0 1px 2px var(--drop-2);
  transition: background-color 120ms ease-out, border-color 120ms ease-out, scale 160ms ease-out;
}
#akn > i.km::before { width: 8px; height: 8px; border-radius: 1.5px; rotate: 45deg; }
#akn > i.km.bent::before { background: var(--sel); }
@media (hover: hover) { #akn > i:hover::before { background: var(--ink); border-color: var(--ink); scale: 1.2; } }
body.moving #akn, body.linking #akn, body.marking #akn, body.panning #akn, body.dv #akn { opacity: 0; pointer-events: none; }
body.moving #akn > i, body.linking #akn > i { pointer-events: none; }

/* the Line card */
.ip-o svg.ln { width: 30px; height: 12px; }
.ip-o svg.ln * { stroke-width: 1.6; }
.ip-o svg .f { fill: currentColor; stroke: none; }

