/* Selection: a graphite ring just outside the object, closing in on it as it is picked and opening away as it is let
   go (.obj). Editing (the halo) and selection are separate states. */
.obj.sel { outline: 1.25px solid var(--sel); outline-offset: 4px; }
.obj.header.sel { outline-offset: 4px; }
/* On the canvas the ring is four focus marks (#selx, section 10): corner marks just outside each selected object close in
   on it as it is picked, as a camera's marks close on what it focuses on (the gesture lock's marks, .lockbox, are
   their louder kin), and open away as it is let go. The four are alike (Axio, 2026-10-16: "the corners should all
   look the same"), as an object resizes from any of them (section 16); one object selected, the one under the pointer
   or in the hand grows and darkens. A column resizes by its sides alone and a card in a column by its foot: a bar on
   the middle of each such edge marks it. */
@property --fx-o { syntax: "<length>"; inherits: true; initial-value: 5px; }
#objs .obj.sel { outline-color: transparent; }
#selx { position: absolute; left: 0; top: 0; z-index: 2; pointer-events: none; }
.fx {
  position: absolute; left: 0; top: 0; --fx-o: 5px; --fx-a: 12px; --fx-t: 1.5px;
  transition: --fx-o 240ms cubic-bezier(.2, .8, .2, 1), opacity 180ms ease-out;
}
.fx.away { --fx-o: 11px; opacity: 0; transition: --fx-o 160ms ease-in, opacity 140ms ease-in; }
.fx > i {
  position: absolute; width: var(--fx-a); height: var(--fx-a); box-sizing: border-box; border: 0 solid var(--sel);
  transition: border-color 140ms ease-out, width 160ms cubic-bezier(.2, .8, .2, 1), height 160ms cubic-bezier(.2, .8, .2, 1), opacity 140ms ease-out;
}
.fx.ld > i:nth-child(2) { opacity: 0; }      /* the arrow dot (#ldot) is on that corner: a board's, a card in a column's */
.fx > i:nth-child(1) { left: calc(-1 * var(--fx-o)); top: calc(-1 * var(--fx-o)); border-width: var(--fx-t) 0 0 var(--fx-t); border-top-left-radius: 3px; }
.fx > i:nth-child(2) { right: calc(-1 * var(--fx-o)); top: calc(-1 * var(--fx-o)); border-width: var(--fx-t) var(--fx-t) 0 0; border-top-right-radius: 3px; }
.fx > i:nth-child(3) { left: calc(-1 * var(--fx-o)); bottom: calc(-1 * var(--fx-o)); border-width: 0 0 var(--fx-t) var(--fx-t); border-bottom-left-radius: 3px; }
.fx > i:nth-child(4) { right: calc(-1 * var(--fx-o)); bottom: calc(-1 * var(--fx-o)); border-width: 0 var(--fx-t) var(--fx-t) 0; border-bottom-right-radius: 3px; }
/* The corner or the edge under the pointer, or in the hand (data-h, fxHot). */
.fx[data-h="lt"] > i:nth-child(1), .fx[data-h="rt"] > i:nth-child(2), .fx[data-h="lb"] > i:nth-child(3), .fx[data-h="rb"] > i:nth-child(4) {
  border-color: var(--ink); width: calc(var(--fx-a) + 4px); height: calc(var(--fx-a) + 4px);
}
/* The bars: the right side's (first) and the left's (second) on a column, the foot's (first) on a card in a column. */
.fx > b { display: none; position: absolute; border-radius: 1.5px; background: var(--sel); transition: background-color 140ms ease-out; }
.fx[data-g="lr"] > b { display: block; width: 3.5px; height: 16px; top: calc(50% - 8px); }
.fx[data-g="lr"] > b:nth-of-type(1) { right: calc(-1 * var(--fx-o)); }
.fx[data-g="lr"] > b:nth-of-type(2) { left: calc(-1 * var(--fx-o)); }
.fx[data-g="b"] > b:nth-of-type(1) { display: block; width: 16px; height: 3.5px; bottom: calc(-1 * var(--fx-o)); left: calc(50% - 8px); }
.fx[data-h="r"] > b:nth-of-type(1), .fx[data-h="l"] > b:nth-of-type(2), .fx[data-h="b"] > b:nth-of-type(1) { background: var(--ink); }
/* One object picked: its address under its bottom left mark (fxAt, section 25), where its top left corner is as
   (X, Y, Z) in the axes' units, Z in the depth colour; above, a board has its Icon or Card switch. It comes and goes
   with the marks. */
.fx > .fx-at {
  position: absolute; left: calc(-1 * var(--fx-o)); top: calc(100% + var(--fx-o) + 5px);
  font: 500 9.5px/12px var(--f-mono); letter-spacing: .03em; color: var(--ink-3); white-space: pre; font-variant-numeric: tabular-nums;
}
.fx-at .z { color: var(--z); }
/* The selection's extent on the axes (extSync): a 2px stretch of the line, centred on it, an end stop either side. It
   lies in the axes' own plane, under the objects (#selext sits between #depthBg and #world): where a card covers the
   line, it covers the stretch too. */
#selext { position: absolute; left: 0; top: 0; z-index: 0; pointer-events: none; }
#selext > .ext { position: absolute; left: 0; top: 0; width: 2px; height: 2px; background: var(--sel); opacity: 0; transition: opacity 160ms ease-out; }
#selext > .ext.on { opacity: calc(var(--ext-a, 1) * .8); transition-duration: 220ms; }
#selext > .ex { margin-top: -1px; }
#selext > .ey { margin-left: -1px; }
#selext > .ext::before, #selext > .ext::after { content: ""; position: absolute; background: var(--sel); }
#selext > .ex::before, #selext > .ex::after { top: -2.5px; width: 1px; height: 7px; }
#selext > .ex::before { left: 0; } #selext > .ex::after { right: 0; }
#selext > .ey::before, #selext > .ey::after { left: -2.5px; width: 7px; height: 1px; }
#selext > .ey::before { top: 0; } #selext > .ey::after { bottom: 0; }
body.dv #selext > .ext { opacity: 0; }
@media (prefers-reduced-motion: reduce) { .fx, .fx.away { transition: none; } }
/* In the hand, the lift and the shadow say which sheets are carried; the ring fades back in once a sheet lies flat
   (an outline drawn on a tilted, settling sheet would stair-step and wobble). */
.obj.sel.held, .obj.sel.paper { outline-color: transparent; }
/* Paper: while dragged an object lifts and casts a soft shadow. --lk (0…1) is written every frame by the spring in
   section 11; at 0 the shadow has no size, so a sheet near the ground casts a small, dark one and a lifted sheet a wide, soft one. */
.obj.paper {
  will-change: transform; transition: outline-color 160ms ease-out;
  box-shadow: var(--shadow-rest),
    0 0 0 calc(var(--lk, 0) * 1px) var(--rim),                      /* on a dark canvas a lifted sheet catches a little light */
    0 calc(var(--lk, 0) * 18px) calc(var(--lk, 0) * 34px) calc(var(--lk, 0) * -6px) var(--drop-1),
    0 calc(var(--lk, 0) * 4px) calc(var(--lk, 0) * 10px) 0 var(--drop-2);
}
.obj.header.paper { box-shadow: none; filter: drop-shadow(0 calc(var(--lk, 0) * 9px) calc(var(--lk, 0) * 7px) var(--drop-1)); }
.obj.image.paper {          /* a picture's shadow follows its alpha, as a header's follows its letters */
  box-shadow: none;
  filter: drop-shadow(0 0 calc(var(--lk, 0) * 1px) var(--rim)) drop-shadow(0 calc(var(--lk, 0) * 12px) calc(var(--lk, 0) * 11px) var(--drop-1))
          drop-shadow(0 calc(var(--lk, 0) * 3px) calc(var(--lk, 0) * 3px) var(--drop-2));
}
.obj.upload.paper { background-color: var(--surface); }
/* A carried object paints above the objects beside it until it has settled; one in a column lifts its column with it. */
.obj.held, .cstack > .obj.paper, .obj.column:has(> .cstack > .paper) { z-index: 1; }

/* The selection box */
#marq, #mapMarq {   /* a dashed hairline, as on a drawing, its corners marked as a selection's are (#selx) */
  position: absolute; left: 0; top: 0; box-sizing: border-box; border-radius: 2px; pointer-events: none;
  border: 1px dashed color-mix(in srgb, var(--ink) 48%, transparent);
  --mq: linear-gradient(var(--sel) 0 0);
  background: var(--mq) 0 0 / 10px 1.5px, var(--mq) 0 0 / 1.5px 10px, var(--mq) 100% 0 / 10px 1.5px, var(--mq) 100% 0 / 1.5px 10px,
              var(--mq) 0 100% / 10px 1.5px, var(--mq) 0 100% / 1.5px 10px, var(--mq) 100% 100% / 10px 1.5px, var(--mq) 100% 100% / 1.5px 10px,
              color-mix(in srgb, var(--ink) 4%, transparent);
  background-repeat: no-repeat; background-origin: border-box;
}

/* The line a drop lined up on (section 12, lineShow), for a moment: in the camera's layer, one screen pixel at any zoom
   (--k), ticked at both ends as a dimension on a drawing is; solid along edges, a centre line through middles. */
.aline {
  --al: color-mix(in srgb, var(--ink) 58%, transparent); --px: calc(1px / var(--k, 1));
  position: absolute; pointer-events: none; background: var(--al);
  animation: aline 900ms cubic-bezier(.2, .8, .2, 1) both;
}
.aline.ay { height: var(--px); translate: 0 -50%; }
.aline.ax { width: var(--px); translate: -50% 0; }
.aline::before, .aline::after { content: ""; position: absolute; background: var(--al); }
.aline.ay::before, .aline.ay::after { top: calc(var(--px) * -3); width: var(--px); height: calc(var(--px) * 7); }
.aline.ay::before { left: 0; }
.aline.ay::after { right: 0; }
.aline.ax::before, .aline.ax::after { left: calc(var(--px) * -3); width: calc(var(--px) * 7); height: var(--px); }
.aline.ax::before { top: 0; }
.aline.ax::after { bottom: 0; }
.aline.mid.ay { background: repeating-linear-gradient(90deg, var(--al) 0 calc(var(--px) * 12), transparent 0 calc(var(--px) * 15),
                                                      var(--al) 0 calc(var(--px) * 17), transparent 0 calc(var(--px) * 20)); }
.aline.mid.ax { background: repeating-linear-gradient(180deg, var(--al) 0 calc(var(--px) * 12), transparent 0 calc(var(--px) * 15),
                                                      var(--al) 0 calc(var(--px) * 17), transparent 0 calc(var(--px) * 20)); }
@keyframes aline { 0% { opacity: 0; } 12% { opacity: 1; } 55% { opacity: 1; } 100% { opacity: 0; } }

