/* ---------- gesture preview: blueprint ghosts ---------- */
.ghost, .edge, .foot { position: absolute; left: 0; top: 0; box-sizing: border-box; border-radius: var(--r); pointer-events: none; }
.ghost {
  overflow: hidden; opacity: 0;
  background: color-mix(in srgb, var(--tc) var(--g-fill), transparent);
  --ink-g: color-mix(in srgb, var(--tc) var(--g-ink), transparent);
  --sk: color-mix(in srgb, var(--tc) var(--g-skel), transparent);
}
.edge { border: 1.5px solid var(--tc); transition: --tc 140ms linear; }
.edge.neutral { --tc: var(--ink-3); background: color-mix(in srgb, var(--tc) 10%, transparent); }
.foot { border: 1px dashed color-mix(in srgb, var(--tc) 60%, transparent); transition: --tc 140ms linear; }
.foot[data-type="header"] { border-color: color-mix(in srgb, var(--tc) 45%, transparent); }

/* the bars are the Text ghost's only structure, so they carry more ink than other skeletons (>= 2:1 on the fill) */
.g-text .sk { position: absolute; left: 15px; height: 8px; width: calc((100% - 28px) * .92); border-radius: 3px; background: color-mix(in srgb, var(--tc) var(--g-skel-tx), transparent); }
.g-text .sk.last { width: calc((100% - 28px) * .58); }
.g-column .gtitle { position: absolute; left: 15px; top: 16px; height: 8px; width: 40%; max-width: 150px; border-radius: 3px; background: var(--sk); }
.g-column .gwell { position: absolute; left: 9px; right: 9px; top: 41px; bottom: 9px; border: 1px dashed var(--ink-g); border-radius: 3px; }
/* Board: it lands as its icon, so that is what shows, whole, where it will stand (iconGhost): its tile and the glyph a new
   board has (--bic, style.js), its name and what it holds under it, all at the canvas's scale (--k). No edge round it. */
.ghost.g-board { overflow: visible; background: none; border-radius: 0; }
.g-board .gtile {
  position: absolute; left: 50%; top: calc(var(--k, 1) * 5px); translate: -50% 0;
  width: calc(var(--k, 1) * 88px); height: calc(var(--k, 1) * 88px); border-radius: calc(var(--k, 1) * 15px);
  background: color-mix(in srgb, var(--tc) var(--g-fill), transparent); box-shadow: inset 0 0 0 1.5px var(--tc);
}
.g-board .gtile::after {
  content: ""; position: absolute; inset: calc(var(--k, 1) * 27px); background: var(--ink-g);
  -webkit-mask: var(--bic) center / contain no-repeat; mask: var(--bic) center / contain no-repeat;
}
.g-board .gname, .g-board .gcount { position: absolute; left: 50%; translate: -50% -50%; border-radius: 3px; background: var(--sk); }
.g-board .gname { top: calc(var(--k, 1) * 111px); width: calc(var(--k, 1) * 92px); height: max(3px, calc(var(--k, 1) * 8px)); }
.g-board .gcount { top: calc(var(--k, 1) * 130.5px); width: calc(var(--k, 1) * 38px); height: max(2px, calc(var(--k, 1) * 5px)); }
.g-table .ghead { position: absolute; left: 0; right: 0; top: 0; height: calc(100% / var(--rows, 7)); background: color-mix(in srgb, var(--tc) 18%, transparent); }
.g-table .ggrid {
  position: absolute; inset: 0;
  background-image: linear-gradient(to left, var(--ink-g) 1px, transparent 1px), linear-gradient(to top, var(--ink-g) 1px, transparent 1px);
  background-size: calc(100% / var(--cols, 3)) calc(100% / var(--rows, 7)); background-position: 0 0;
}
/* To-do: its title and its rows where the list's will be (TD: 46px down, 36px each), at the canvas's scale (--k), so the rows
   seen while drawing are the rows it lands with, at any zoom */
.g-todo .gtitle { position: absolute; left: calc(var(--k, 1) * 15px); top: calc(var(--k, 1) * 20.5px); height: max(3px, calc(var(--k, 1) * 8px)); width: 42%; border-radius: 3px; background: var(--sk); }
.g-todo .gi { position: absolute; left: calc(var(--k, 1) * 15px); right: calc(var(--k, 1) * 15px); height: calc(var(--k, 1) * 36px); display: flex; align-items: center; gap: calc(var(--k, 1) * 10px); }
.g-todo .gi i { flex: none; width: calc(var(--k, 1) * 14px); height: calc(var(--k, 1) * 14px); border-radius: calc(var(--k, 1) * 3px); box-shadow: inset 0 0 0 1.5px var(--ink-g); }
.g-todo .gi b { height: max(2px, calc(var(--k, 1) * 6px)); width: 68%; border-radius: 3px; background: var(--sk); }
.g-todo .gi:nth-child(3n) b { width: 50%; }
.g-todo .gi:nth-child(3n+1) b { width: 60%; }
.ghost.g-header { background: transparent; display: flex; align-items: flex-end; }
.g-header::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--tc); }
.g-header .ghd {
  padding: 0 2px 8px; white-space: nowrap; color: color-mix(in srgb, var(--tc) 75%, transparent);
  font: 500 var(--fs, 34px)/1.1 var(--f-display); letter-spacing: -.015em; font-optical-sizing: auto;
}
/* Upload: no rectangle, a big plus that grows with the drag, captioned beneath. */
.ghost.g-upload { overflow: visible; background: none; }
.g-upload svg { display: block; width: 100%; height: 100%; overflow: visible; }
.g-upload path { fill: color-mix(in srgb, var(--tc) 10%, transparent); stroke: var(--tc); stroke-width: 1.5px; stroke-linejoin: round; }
.g-upload .gcap { position: absolute; left: 50%; top: calc(100% + 12px); translate: -50% 0; margin: 0; text-align: center; white-space: nowrap; color: var(--tc); }
.g-upload .gcap b { display: block; font: 500 15px/20px var(--f-ui); }
.g-upload .gcap span { display: block; font: 400 12px/16px var(--f-ui); color: color-mix(in srgb, var(--tc) 70%, transparent); }
/* Timer: no card, as the timer has none: its rings where the loop went round, the pin, the time it starts with. */
.ghost.g-timer { container-type: size; overflow: visible; background: none; }
.g-timer svg { position: absolute; left: 0; top: 0; width: 100cqh; height: 100cqh; overflow: visible; }
.g-timer circle { fill: var(--tc); }
.g-timer circle.gr { fill: color-mix(in srgb, var(--tc) 6%, transparent); stroke: var(--tc); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.g-timer circle.gr + circle.gr { fill: none; stroke-width: 1; }
.g-timer .gread { position: absolute; left: 98cqh; top: 50%; translate: 0 -50%; padding: 0 1cqh; font: 700 31cqh/1.08 var(--f-mono); letter-spacing: -.055em; color: var(--ink-g); white-space: nowrap; }
.g-timer .gread small { padding-left: .5cqh; font: 600 11cqh/1 var(--f-mono); letter-spacing: -.02em; }
/* Out of the guide (section 5b). A timeline, drawn to its length (gdLine): its line and head, and its stages' dots and
   stems, as a new one has them. The AI box: its line, the mark where its logo is, a bar where its words will be. */
.ghost.g-timeline { overflow: visible; background: none; border-radius: 0; }
.g-timeline svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; fill: none; stroke: var(--tc); stroke-width: 1.5px; stroke-linecap: round; stroke-linejoin: round; }
.g-timeline .st { stroke: var(--ink-g); stroke-width: 1px; }
.g-timeline circle { fill: color-mix(in srgb, var(--tc) var(--g-fill), var(--canvas)); }
.ghost.g-ai { border-radius: 8px; }
.g-ai svg { position: absolute; left: 12px; top: 50%; width: 18px; height: 18px; translate: 0 -50%; color: var(--ink-g); }
.g-ai .sk { position: absolute; left: 42px; top: 50%; width: 46%; height: 8px; translate: 0 -50%; border-radius: 3px; background: var(--sk); }
/* A loop on its way to a timer: the hand's path, dotted. */
.trail, .trail svg { position: absolute; left: 0; top: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.trail path { fill: none; stroke: var(--tc); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 0 7; }
/* Held in one type, the gesture locks to it: corner brackets close on the ghost and a ring goes out from it. */
.lockbox { position: absolute; left: 0; top: 0; pointer-events: none; }
.lockbox i { position: absolute; width: 12px; height: 12px; box-sizing: border-box; border: 0 solid var(--tc); }
.lockbox i:nth-child(1) { left: 0; top: 0; border-width: 2px 0 0 2px; border-top-left-radius: 3px; }
.lockbox i:nth-child(2) { right: 0; top: 0; border-width: 2px 2px 0 0; border-top-right-radius: 3px; }
.lockbox i:nth-child(3) { left: 0; bottom: 0; border-width: 0 0 2px 2px; border-bottom-left-radius: 3px; }
.lockbox i:nth-child(4) { right: 0; bottom: 0; border-width: 0 2px 2px 0; border-bottom-right-radius: 3px; }
.lockping { position: absolute; left: 0; top: 0; box-sizing: border-box; border-radius: calc(var(--r) + 3px); border: 1.5px solid var(--tc); pointer-events: none; }

/* Files dragged in from outside: a dashed frame round the canvas and a chip at the pointer. */
#canvas.dropping::after {
  content: ""; position: absolute; z-index: 2; pointer-events: none; border-radius: 5px;
  inset: calc(env(safe-area-inset-top, 0px) + 8px) calc(env(safe-area-inset-right, 0px) + 8px) calc(env(safe-area-inset-bottom, 0px) + 8px) calc(env(safe-area-inset-left, 0px) + 8px);
  border: 1.5px dashed color-mix(in srgb, var(--ink) 30%, transparent);
}
#dropcue { position: fixed; left: 0; top: 0; z-index: 25; pointer-events: none; }
#dropcue .chip { width: max-content; translate: 14px -50%; }

/* ---------- HUD: anchor, cancel mark, label ---------- */
#hud { position: fixed; inset: 0; z-index: 20; pointer-events: none; }
#hud.abort { opacity: 0; transition: opacity 120ms ease-in; }
#hud > div { position: absolute; left: 0; top: 0; }
.dot, .cmark { opacity: 0; }
/* The anchor is the mark (section 25): a dot on a hairline cross, which opens out from it as the press begins. */
.dot { width: 5px; height: 5px; margin: -2.5px 0 0 -2.5px; }
.dot::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--ink); box-shadow: 0 0 0 1.5px var(--canvas); }
.dot::before {
  content: ""; position: absolute; left: -8px; top: -8px; width: 21px; height: 21px; opacity: 0; scale: .3;
  background: linear-gradient(var(--ink-3), var(--ink-3)) center / 100% 1px no-repeat, linear-gradient(var(--ink-3), var(--ink-3)) center / 1px 100% no-repeat;
}
#hud.on .dot { opacity: 1; }
#hud.on .dot::before { opacity: .8; scale: 1; transition: scale 300ms cubic-bezier(.2, 1.5, .4, 1), opacity 120ms ease-out; }
#hud.on.cx .dot, #hud.on.up .dot { opacity: 0; }
#hud.on.up .dot { transition: opacity 80ms ease-out; }    /* Upload: nothing hangs from the anchor, and it would sit in the caption */
#hud.done .dot { opacity: 0; transition: opacity 120ms ease-out; }
.cmark {
  width: 20px; height: 20px; margin: -10px 0 0 -10px; box-sizing: border-box; border-radius: 50%;
  display: grid; place-items: center; background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--ink-2); color: var(--ink-2);
  transition: opacity 100ms ease-out;
}
#hud.on.cx .cmark { opacity: 1; }
.lab { will-change: transform; }
.lab-in { width: max-content; translate: 14px -50%; }
.chip-probe { position: absolute; left: 0; top: 0; visibility: hidden; font: 500 10.5px/11px var(--f-mono); letter-spacing: .07em; text-transform: uppercase; white-space: pre; }
.chip-probe span { display: block; width: max-content; }
.chip {
  position: relative; overflow: hidden; box-sizing: border-box; height: 21px; padding: 5px 7px; border-radius: 2px;
  font: 500 10.5px/11px var(--f-mono); letter-spacing: .07em; text-transform: uppercase; white-space: nowrap;
  background: var(--tc); color: var(--on-tc); transition: --tc 140ms linear;
}
.chip .t { display: inline-block; vertical-align: top; }
.edge.snap, .foot.snap, .chip.snap { transition: none; }
.chip .t.out { position: absolute; left: 7px; top: 5px; }
.chip.neutral, .chip.cancel { background: var(--surface); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--rule-2); }
.chip.neutral .n { color: var(--ink); }
.chip.neutral .d, .chip .t.out.was-neutral .d { margin-left: 8px; }
.chip.receipt { background: var(--surface); color: var(--tc); box-shadow: inset 0 0 0 1px var(--tc); }
.chip.loop, .chip.ai, .chip.timeline { background: var(--surface); color: var(--tc); box-shadow: inset 0 0 0 1px var(--tc); }
.chip .lk { display: none; width: 8px; height: 10px; margin: .5px 5px 0 0; vertical-align: top; }
.chip .t.lkd .lk { display: inline-block; }
.chip .lk svg { display: block; width: 8px; height: 10px; }
.chip .hold { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: currentColor; opacity: .55; transform: scaleX(0); transform-origin: 0 50%; pointer-events: none; }

.sr { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
/* A file input filling the press it is in, unseen, so the hand presses the input itself and the picker opens on any
   phone: Add's Picture, an upload tile's face, the menu's Upload files… and Open file…, a board's cover card. Its
   press is position: relative. */
.pick-in { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; border: 0; opacity: 0; font-size: 16px; cursor: inherit; }
.pick-in::file-selector-button { cursor: inherit; }
#sa {
  position: fixed; left: 0; top: 0; visibility: hidden; pointer-events: none;
  padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
}

