/* ============================================================================
   canvas.css — the sandbox: a pannable, zoomable dot-grid plane holding the
   plan's modules (HTML cards) and the links between them (SVG curves), in
   Ant Design's components: each module an Ant card with an avatar in its role's
   colour, each link label a tag, the floating toolbars compact button groups.
   Geometry constants (card size, port positions) are mirrored in
   app/canvas.js as NODE_W / NODE_H (GEOM in sim/plan.js); change both together.
   ============================================================================ */

.workbench {
    position: relative;
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

/* The plan builder: the module library across the top (library.css), the
   canvas, and the net worth scrubber under it, each the full width. The
   inspector (inspector.css) shares the canvas's cell and floats over its
   right side. */
.builder {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    grid-template-columns: minmax(0, 1fr);
}
.builder > .library  { grid-row: 1; }
.builder > .stage,
.builder > .inspector { grid-row: 2; grid-column: 1; }
.builder > .scrubber { grid-row: 3; }

.stage {
    position: relative;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    background-color: var(--canvas-bg);
    background-image: radial-gradient(circle, var(--canvas-dot) 1.1px, transparent 1.6px);
    background-size: var(--grid, 24px) var(--grid, 24px);
    background-position: var(--grid-x, 0) var(--grid-y, 0);
    cursor: default;
    outline: none;
    touch-action: none;
    /* A drag on the plane selects modules, never text: a native text
       selection here would turn the next press into a drag of the page. */
    user-select: none;
    -webkit-user-select: none;
}
.stage.is-panning { cursor: grabbing; }
.stage.is-space { cursor: grab; }
.marquee {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 4;
    pointer-events: none;
    border: var(--line-width) solid var(--color-primary);
    border-radius: var(--border-radius-sm);
    background: color-mix(in srgb, var(--color-primary) 10%, transparent);
}
.stage.is-drop-target { box-shadow: inset 0 0 0 2px var(--color-primary); }

.canvas-world {
    position: absolute;
    left: 0;
    top: 0;
    width: 0;
    height: 0;
    transform-origin: 0 0;
    /* No will-change: it pins the raster scale, so zooming stretches a bitmap and blurs. */
}

.canvas-links {
    position: absolute;
    left: 0;
    top: 0;
    width: 1px;
    height: 1px;
    overflow: visible;
    pointer-events: none;
}

/* ── Links ──────────────────────────────────────────────────────────────── */
/* Every link is the same light blue, whatever it carries; the port it leaves
   from wears its module's role colour. */
.link-path {
    fill: none;
    stroke: var(--link-line);
    stroke-width: 2.5px;
    stroke-linecap: round;
    stroke-opacity: 0.55;
    transition: stroke-opacity var(--motion-duration-mid);
}
.link-hit {
    fill: none;
    stroke: transparent;
    stroke-width: 16px;
    pointer-events: stroke;
    cursor: pointer;
}
/* Money moving: round dots in the link's own colour, wider than the line and
   at full strength over its softer stroke, running along the curve from
   source to target, one every 24px. */
.link-flow {
    fill: none;
    stroke: var(--link-line);
    stroke-linecap: round;
    stroke-width: 4.5px;
    stroke-dasharray: 0.1 23.9;
    animation: link-flow 1.1s linear infinite;
    pointer-events: none;
}
@keyframes link-flow { to { stroke-dashoffset: -24; } }
:root[data-motion="off"] .link-flow { display: none; }
.stage.flow-limited .link-flow:not(.is-related) { display: none; }
.link-flow.is-idle,
.link-flow.is-dim { display: none; }
.link.is-idle .link-path { stroke-dasharray: 4 6; stroke-opacity: 0.5; }
.link:hover .link-path { stroke-opacity: 1; }
/* A link being inspected (selected, or touching the selected module) is thicker. */
/* Its stroke stays soft too, so its running dots show over it. */
.link.is-active .link-path { stroke-width: 4.5px; stroke-opacity: 0.5; stroke: var(--color-primary); }
.link-flow.is-active { stroke: var(--color-primary); stroke-width: 7px; }
.link.is-dim .link-path { stroke-opacity: 0.18; }
/* A flow whose end is being dragged off its module: only a faint trace of
   where it was stays, while the ghost shows where it is going. */
.link.is-moving .link-path { stroke-opacity: 0.18; stroke-dasharray: 4 6; }
.link-flow.is-moving,
.link-label.is-moving { visibility: hidden; }

.link-label[hidden] { display: none; }

.link-ghost {
    fill: none;
    stroke: var(--color-primary);
    stroke-width: 2;
    stroke-dasharray: 6 6;
    stroke-linecap: round;
}

/* ── Link labels: tags ──────────────────────────────────────────────────── */
.canvas-labels { position: absolute; left: 0; top: 0; }

.link-label {
    position: absolute;
    left: 0;
    top: 0;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 22px;
    padding: 0 7px;
    border: var(--line-width) solid var(--color-border);
    border-radius: var(--border-radius-sm);
    background: var(--color-bg-container);
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
    line-height: 20px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    cursor: pointer;
    transform: translate(-50%, -50%);
    transition: border-color var(--motion-duration-mid), color var(--motion-duration-mid), box-shadow var(--motion-duration-mid);
}
.link-label::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--link-line);
}
/* The rule beside a link's dollars ('(20%)') reads as secondary to them. */
.link-rule { color: var(--color-text-tertiary); }
.link-rule[hidden] { display: none; }
.link-label:hover { border-color: var(--color-primary-hover); color: var(--color-text); }
.link-label.is-selected { border-color: var(--color-primary); color: var(--color-primary-text); box-shadow: 0 0 0 2px var(--control-outline); }
.link-label.is-short { border-color: var(--color-warning-border); background: var(--color-warning-bg); color: var(--color-warning-text); }
.link-label.is-dim { opacity: 0.3; }
.link-label:focus-visible { outline: 4px solid var(--color-primary-border); outline-offset: 1px; }

/* A link's tag holds one half; a two-way link's holds two, one for each
   direction, each led by an arrow along the line. */
.link-half { display: inline-flex; align-items: center; gap: 5px; }
.link-half[hidden] { display: none; }
.link-arrow { display: none; }

/* ── Two-way links ──────────────────────────────────────────────────────── */
/* One purple line that turns around: its dots run toward the target until
   it turns, then back toward the source. Its tag has a half per direction,
   and the half running at the scrubbed month is filled. */
.link.is-twoway .link-path,
.link.is-twoway.is-active .link-path { stroke: var(--link-twoway); stroke-opacity: 0.75; }
.link-flow.is-twoway,
.link-flow.is-twoway.is-active { stroke: var(--link-twoway); }
.link-flow.is-back { animation-direction: reverse; }
.link-label.is-twoway {
    gap: 0;
    padding: 0;
    overflow: hidden;
    border-color: color-mix(in srgb, var(--link-twoway) 55%, var(--color-border));
}
.link-label.is-twoway::before { display: none; }
.link-label.is-twoway .link-half { height: 100%; padding: 0 7px; color: var(--color-text-tertiary); }
.link-label.is-twoway .link-half + .link-half { border-left: var(--line-width) solid color-mix(in srgb, var(--link-twoway) 35%, var(--color-border)); }
.link-label.is-twoway .link-half.is-live { background: color-mix(in srgb, var(--link-twoway) 14%, var(--color-bg-container)); color: var(--color-text); }
.link-label.is-twoway .link-arrow { display: inline; color: var(--link-twoway); font-weight: 700; }
.link-label.is-twoway.is-selected { border-color: var(--link-twoway); box-shadow: 0 0 0 2px color-mix(in srgb, var(--link-twoway) 25%, transparent); }

/* ── Module cards ───────────────────────────────────────────────────────────
   The cards keep their own design, from before the Ant Design conversion: a
   fill and edge tinted with the module's role colour, its category in that
   colour above its name, and a black (white on dark) edge when selected. */
:root { --node-tint: 17%; --node-edge: 38%; --node-active-ring: #1c1a16; }
html[data-theme="dark"] { --node-tint: 14%; --node-edge: 30%; --node-active-ring: #fcf8f0; }

.node {
    position: absolute;
    left: 0;
    top: 0;
    width: 220px;
    height: 140px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px 16px;
    /* The card is tinted with its category's colour (--tile, from [data-role]),
       with a hairline edge in the same hue. */
    background: color-mix(in srgb, var(--tile, var(--role-none)) var(--node-tint), var(--color-bg-container));
    border: var(--line-width) solid color-mix(in srgb, var(--tile, var(--role-none)) var(--node-edge), var(--color-bg-container));
    border-radius: var(--border-radius-lg);   /* 8px, as Ant cards are */
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 2px 8px rgba(0, 0, 0, 0.06);
    color: var(--color-text);
    cursor: grab;
    user-select: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
    /* A stacking context of its own, so the card's ports and flag stay above it. */
    isolation: isolate;
}
/* Hover lifts the border well past the resting one. */
.node:hover { border-color: color-mix(in srgb, var(--node-active-ring) 55%, transparent); }
/* Selected: the border itself turns to the active colour (white in dark mode)
   and thickens. The extra width is an inset shadow, so the card's size and its
   content do not move. */
.node:focus-visible { outline: none; }
.node:focus-visible,
.node.is-selected {
    border-color: var(--node-active-ring);
    box-shadow: inset 0 0 0 2px var(--node-active-ring), 0 1px 2px rgba(0, 0, 0, 0.06), 0 2px 8px rgba(0, 0, 0, 0.06);
}
.node.is-selected { z-index: 2; }
.node.is-dragging { cursor: grabbing; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22); z-index: 3; }
.node.is-selected.is-dragging { box-shadow: inset 0 0 0 2px var(--node-active-ring), 0 4px 14px rgba(0, 0, 0, 0.22); }
.node.is-dim { opacity: 0.35; }
.node.is-target { border-color: var(--color-primary); box-shadow: 0 0 0 4px var(--control-outline), 0 1px 2px rgba(0, 0, 0, 0.06); }

/* A large, faint copy of the module's icon, cut off by the card's corner. It
   has a layer of its own because the card cannot clip: its ports and flag
   sit outside its edge. */
.node-wm {
    position: absolute;
    inset: 0;
    overflow: hidden;
    border-radius: inherit;
    color: var(--tile);
    pointer-events: none;
}
.node-wm .icon {
    position: absolute;
    right: -22px;
    bottom: -30px;
    width: 128px;
    height: 128px;
    opacity: 0.13;
}

.node-cat {
    position: relative;
    display: flex;
    align-items: center;
    min-width: 0;
    color: var(--tile);
    font-size: 12px;
    font-weight: var(--font-weight-strong);
    letter-spacing: 0.02em;
}
.node-cat-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.node-titles {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    margin-top: 6px;
}
.node-name {
    overflow: hidden;
    color: var(--color-text);
    font-size: 18px;
    font-weight: var(--font-weight-strong);
    letter-spacing: -0.02em;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.node-meta {
    overflow: hidden;
    color: var(--color-text-tertiary);
    font-size: 11px;
    font-weight: var(--font-weight-strong);
    letter-spacing: 0.04em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.node-figure {
    position: relative;
    display: flex;
    align-items: baseline;
    gap: 6px;
    min-width: 0;
    margin-top: auto;
}
.node-value {
    overflow: hidden;
    font-size: 1.25rem;
    font-weight: var(--font-weight-strong);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
    line-height: 1;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.node-value.is-negative { color: var(--color-error-text); }
.node-unit {
    color: var(--color-text-tertiary);
    font-size: 11px;
    font-weight: var(--font-weight-strong);
    white-space: nowrap;
}
.node-delta {
    margin-left: auto;
    font-size: 11px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.node-delta.is-up { color: var(--color-success-text); }
.node-delta.is-down { color: var(--color-error-text); }

/* Where the module's money goes: one segment per link in its target's colour,
   grey for what lands in Unassigned. Accounts and debts show progress
   instead. Spending and income have none: they carry no balance to fill. */
.node-bar {
    display: flex;
    gap: 2px;
    height: 6px;
    border-radius: 3px;
    position: relative;
    background: color-mix(in srgb, var(--color-text) 6%, transparent);
    overflow: hidden;
}
/* A segment for a module takes its role colour from [data-role] (ui.css);
   the other three are not roles. */
.node[data-role="expense"] .node-bar,
.node[data-role="source"] .node-bar { display: none; }
.node-bar > span { min-width: 2px; height: 100%; border-radius: 2px; background: var(--tile); }
.node-bar > span[data-role="none"]   { --tile: var(--role-none); opacity: 0.45; }
.node-bar > span[data-role="growth"] { --tile: var(--color-success); }
/* A debt's bar: what is still owed in red, what has been paid off in green. */
.node-bar > span[data-role="owed"]   { --tile: var(--color-error); }

/* The badge on a card's corner: a warning flag, or a check once a debt is paid off. */
.node-flag,
.node-check {
    position: absolute;
    top: -8px;
    right: -8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    box-shadow: 0 0 0 2px var(--canvas-bg);
}
.node-flag .icon,
.node-check .icon { width: 12px; height: 12px; }
/* A flag wears its issue's colour from the inspector's callout (.issue in
   inspector.css): gold for a warning, blue for a notice, grey for information. */
.node-flag { background: var(--color-warning); color: #1c0a00; }
.node-flag--notice { background: var(--color-info); color: #fff; }
.node-flag--info {
    background: var(--color-bg-container);
    color: var(--color-text-tertiary);
    box-shadow: inset 0 0 0 1px var(--color-border), 0 0 0 2px var(--canvas-bg);
}
.node-check { background: #22a64a; color: #fff; }

/* ── Ports ──────────────────────────────────────────────────────────────── */
/* A dot on every side, in the module's own colour. Links leave and land on the
   sides that face each other. A module that sends money on starts a link from
   any of its dots (--out); the rest only receive (--in). What a link carries
   (a card's purchases, a loan's proceeds...) is chosen on the link, not by
   which dot it leaves. */
.node-port {
    position: absolute;
    top: 50%;
    width: 14px;
    height: 14px;
    margin-top: -7px;
    border: 2px solid var(--tile);
    border-radius: 50%;
    background: var(--color-bg-container);
    transition: transform 0.12s ease, background-color 0.12s ease, opacity 0.12s ease;
}
/* A dot on each side, centred on its edge. */
.node-port[data-side="l"] { left: -8px; }
.node-port[data-side="r"] { right: -8px; }
.node-port[data-side="t"],
.node-port[data-side="b"] { left: 50%; margin: 0 0 0 -7px; }
.node-port[data-side="t"] { top: -8px; }
.node-port[data-side="b"] { top: auto; bottom: -8px; }
.node-port--out { cursor: crosshair; }
/* A port is an empty outline until a link is attached, then it fills. */
.node-port.is-linked { background: var(--tile); }
/* A dot with no link is hidden, and cannot be grabbed, until its module is
   selected or a link is being drawn or moved. */
.node-port:not(.is-linked) { opacity: 0; pointer-events: none; }
.node.is-selected .node-port,
.is-linking .node-port { opacity: 1; pointer-events: auto; }
.node-port--out::after {
    /* A bigger invisible hit area than the visible dot. */
    content: '';
    position: absolute;
    inset: -8px;
    border-radius: 50%;
}
.node:hover .node-port,
.node.is-selected .node-port { transform: scale(1.15); }
.node-port--out:hover { transform: scale(1.35); }
.node.is-target .node-port { background: var(--color-primary); border-color: var(--color-primary); transform: scale(1.4); }

/* A debt's input port is where a payment link lands. */
.node[data-role="debt"] .node-port--in { cursor: pointer; }
.node[data-role="debt"] .node-port--in::after { content: ''; position: absolute; inset: -6px; border-radius: 50%; }

/* The grips on the selected flow's two ends. */
.link-handle {
    position: absolute;
    width: 16px;
    height: 16px;
    box-sizing: border-box;
    border: 3px solid var(--color-primary);
    border-radius: 50%;
    background: var(--color-bg-container);
    box-shadow: 0 0 0 4px var(--control-outline);
    transform: translate(-50%, -50%);
    cursor: grab;
    pointer-events: auto;
    z-index: 6;
}
.link-handle[hidden] { display: none; }
.is-linking .link-handle { cursor: grabbing; }

/* ── Floating toolbars over the canvas: Ant's compact button groups ─────── */
.island {
    position: absolute;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: var(--space-8);
}
.island .button-group { box-shadow: var(--box-shadow-tertiary); border-radius: var(--border-radius); }
.island .button-icon {
    background: var(--color-bg-container);
    border-color: var(--color-border);
    color: var(--color-text);
}
.island .button-icon:not(:disabled):hover { background: var(--color-bg-container); border-color: var(--color-primary-hover); color: var(--color-primary-hover); }
.island .button-icon:not(:disabled):active { border-color: var(--color-primary-active); color: var(--color-primary-active); }
.island .button-icon[aria-pressed="true"] { background: var(--color-primary-bg); border-color: var(--color-primary); color: var(--color-primary); }
.island .button-icon:disabled { background: var(--color-bg-container); color: var(--color-text-disabled); }

.island--tools  { left: var(--space-16); top: var(--space-16); }
.island--zoom   { left: var(--space-16); bottom: var(--space-16); }
/* The month the cards show, while scrubbing: a processing tag. */
.island--time {
    left: 50%;
    top: var(--space-16);
    transform: translateX(-50%);
    gap: 6px;
    height: 28px;
    padding: 0 10px;
    background: var(--color-info-bg);
    border: var(--line-width) solid var(--color-info-border);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow-tertiary);
    color: var(--color-info-text);
    font-size: var(--font-size);
    font-variant-numeric: tabular-nums;
    pointer-events: none;
}
.island--time .icon { width: 14px; height: 14px; }
/* The person's age that month, to the right of the date. */
.island-age {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 4px;
    padding-left: 10px;
    border-left: var(--line-width) solid var(--color-info-border);
    align-self: stretch;
}

.zoom-level {
    min-width: 58px;
    height: var(--control-height);
    padding: 0 var(--space-8);
    border: var(--line-width) solid var(--color-border);
    background: var(--color-bg-container);
    color: var(--color-text);
    font-size: var(--font-size);
    font-variant-numeric: tabular-nums;
    text-align: center;
    cursor: pointer;
    transition: border-color var(--motion-duration-mid), color var(--motion-duration-mid);
}
.zoom-level:hover { border-color: var(--color-primary-hover); color: var(--color-primary-hover); }
.zoom-level:focus-visible { outline: 4px solid var(--color-primary-border); outline-offset: 1px; }

/* ── Empty plan ─────────────────────────────────────────────────────────── */
.empty-state-close {
    position: absolute;
    top: var(--space-12);
    right: var(--space-12);
}
.canvas-empty {
    position: absolute;
    inset: 0;
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}
.canvas-empty .empty-state {
    position: relative;
    pointer-events: auto;
    background: var(--color-bg-container);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--box-shadow);
}

@media (prefers-reduced-motion: reduce) {
    .link-flow { animation: none; display: none; }
    .node, .node-port, .link-path, .link-label, .scrub-pin::after { transition: none; }
}

/* ── Net worth scrubber (scrubber.js) ────────────────────────────────────────
   The slim bar under the canvas: the plan's net worth over its run, drawn
   small in the brand blue, with pins where its issues start and its debts are
   paid off. Moving along it scrubs the plan; the cards follow. Above the
   canvas and the inspector, so a pin's tip can rise over them. */
.scrubber {
    position: relative;
    z-index: 7;
    display: flex;
    align-items: center;
    gap: var(--space-24);
    height: 56px;
    flex-shrink: 0;
    padding: 0 var(--space-16);
    background: var(--color-bg-container);
    border-top: var(--line-width) solid var(--color-border-secondary);
}

/* The track, with the pins laid over it. */
.scrub-lane {
    position: relative;
    display: flex;
    flex: 1;
    min-width: 0;
    align-self: stretch;
}
.scrub-track {
    position: relative;
    flex: 1;
    min-width: 0;
    align-self: stretch;
    cursor: crosshair;
    touch-action: none;
    border-radius: var(--border-radius-sm);
    outline: none;
}
.scrub-track:focus-visible { box-shadow: 0 0 0 2px var(--color-primary-border); }
/* The plot leaves the bottom strip to the start and end dates. */
.scrub-plot { position: absolute; inset: var(--space-8) 0 18px; }
.scrub-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.scrub-area { fill: color-mix(in srgb, var(--color-primary) 10%, transparent); stroke: none; }
.scrub-line { fill: none; stroke: var(--color-primary); stroke-width: 1.5; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.scrub-zero { stroke: var(--color-border); stroke-width: 1; stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
.scrub-cursor {
    position: absolute;
    top: -4px;
    bottom: -4px;
    width: 1px;
    background: var(--color-text-tertiary);
    opacity: 0;
    pointer-events: none;
}
.scrubber.is-scrubbing .scrub-cursor { opacity: 1; }
.scrub-dot {
    position: absolute;
    width: 10px;
    height: 10px;
    border: 2px solid var(--color-bg-container);
    border-radius: 50%;
    background: var(--color-primary);
    transform: translate(-50%, -50%);
    pointer-events: none;
}
.scrub-dot.is-negative { background: var(--color-error); }
.scrub-edge {
    position: absolute;
    bottom: 2px;
    color: var(--color-text-tertiary);
    font-size: var(--font-size-sm);
    line-height: 1;
    font-variant-numeric: tabular-nums;
    pointer-events: none;
}
.scrub-edge--start { left: 0; }
.scrub-edge--end { right: 0; }

/* An issue's pin: a stem the plot's height, headed by a dot in the colour of
   its worst issue. The button is wider than the stem, to be easy to point at. */
.scrub-pins { position: absolute; inset: var(--space-8) 0 18px; pointer-events: none; }
.scrub-pin {
    --pin: var(--color-warning);
    position: absolute;
    top: -4px;
    bottom: 0;
    width: 16px;
    padding: 0;
    border: 0;
    background: transparent;
    transform: translateX(-50%);
    cursor: pointer;
    pointer-events: auto;
}
.scrub-pin[data-level="notice"] { --pin: var(--color-info); }
.scrub-pin[data-level="info"] { --pin: var(--color-text-tertiary); }
/* A month that holds only payoffs: green, as a paid-off card's check. */
.scrub-pin[data-level="done"] { --pin: var(--color-success); }
.scrub-pin::before {
    content: '';
    position: absolute;
    top: 4px;
    bottom: 0;
    left: 50%;
    width: 1px;
    background: var(--pin);
    opacity: 0.6;
}
.scrub-pin::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    width: 10px;
    height: 10px;
    border: 2px solid var(--color-bg-container);
    border-radius: 50%;
    background: var(--pin);
    transform: translateX(-50%);
    transition: transform var(--motion-duration-mid);
}
.scrub-pin:hover::after,
.scrub-pin:focus-visible::after { transform: translateX(-50%) scale(1.3); }
.scrub-pin:focus-visible { outline: none; }
.scrub-pin:focus-visible::after { box-shadow: 0 0 0 2px var(--color-primary-border); }

/* A pin's issues, risen over the canvas above it: Ant's Popover. */
.scrub-tip {
    position: absolute;
    bottom: calc(100% + var(--space-8));
    width: max-content;
    max-width: 320px;
    padding: var(--space-12);
    background: var(--color-bg-elevated);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--box-shadow-secondary);
    color: var(--color-text);
    font-size: var(--font-size);
    transform: translateX(-50%);
    pointer-events: none;
}
.scrub-tip[hidden] { display: none; }
.scrub-tip-row { display: flex; gap: var(--space-8); margin: 0; }
.scrub-tip-row + .scrub-tip-row { margin-top: var(--space-8); }
.scrub-tip-row .icon { width: 16px; height: 16px; margin-top: 3px; color: var(--color-warning); }
.scrub-tip-row[data-level="notice"] .icon { color: var(--color-info); }
.scrub-tip-row[data-level="info"] .icon { color: var(--color-text-tertiary); }
.scrub-tip-row[data-level="done"] .icon { color: var(--color-success); }
/* The plan's length, at the bar's right end. */
.scrub-length {
    display: flex;
    align-items: center;
    gap: var(--space-12);
    flex: none;
}
