/* =============================================================================
   HolyGrail shell.css — ONE file (do not split).
   Rollback: web/_bak/shell.css.ROLLBACK.css
           + web/_bak/shell.css.20260730_131359.bak
   =============================================================================
   LAYER MAP (edit in the right section; cascade-critical tails stay late)
   ---------------------------------------------------------------------------
   0. TOC / cascade laws          (this block)
   1. TOKENS                      :root + html.dark vars, pantone --seg-* defs
   2. RESET + BASE                box model, body, type
   3. CHROME                      header, tabs, project forms, theme
   4. SURFACES (light)            tables → bid → breakdown → gantt → docks → docs
   5. DARK OVERRIDES              html.dark twin blob (exceptions not on tokens)
   3b.SCROLLBAR POLICY            after dark; only place for html.dark * + tabs kill
   6. DOCK EXTRAS                 CF balance stroke, gbar edges
   7. SEGMENT PAINT (apply)       wash/accent on rows (after dark bulk)
   8. CREW + RECRUIT
   9. TIER TEST + TIER SECURITY   security hide LAST among chrome policies
  10. PRIMITIVES (late winners)   focus ring, shared picker states, status menu
   ---------------------------------------------------------------------------
   CASCADE LAWS
   • View stack: body is a viewport-height flex column with overflow:hidden.
   The document has a small native Y-scroll range so Android Chrome can move
   its browser controls on a finger swipe outside the inner scrollers. The body
   sticks in place; views keep their own scroll roots and layout.
   Scrollbar space is RESERVED on scroll roots (scrollbar-gutter) so contents
   never shift when a scrollbar appears/disappears. Side gaps come ONLY from
   --hg-tracker-side-padding. Sticky table headers lock at top:0 inside their
   scroll root. Doc heads use 79 (header+tabs only). Prefer --hg-* when touching math.
   • Opaque sticky backgrounds — translucent washes alone let rows bleed under
     parked headers. Pattern: linear-gradient(wash), page-base-color.
   • Never re-introduce a second html.dark * { scrollbar-* } outside §3b.
   • Form chrome final look is owned by §10 (.hg-select picker). Do not restyle
     borders on .gfilters/.crew-pick/.proj-strip .proj-select in surfaces.
   • Segment colors: define --seg-accent on [data-seg] in §1; apply geometry in §7.
     A wash is ALWAYS color-mix(accent, var(--hg-<level>-op)). No alpha-hex wash
     variables exist; do not re-introduce them. No html.dark wash twins either —
     opacity vars live once on :root.
   • Tier hide (§9) uses !important; keep after layout so plain display rules
     cannot resurface restricted UI.
   • Cache-bust: bump shell.css?v= AND every js/?v= in index.html to SAME mark.
   ============================================================================= */

/* ===== 1. TOKENS ===== */

/* UI typeface, served from this origin. One variable face covers the four
   weights the type scale uses (400/500/600/700), so the whole app — and the
   landing page, which names the same family — renders without a third-party
   request. Licence: web/assets/fonts/OFL.txt. */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("assets/fonts/inter-latin-var.woff2") format("woff2");
}

:root {
  /* layout chrome (sticky math) */
  --hg-header-h: 48px;
  --hg-tabs-h: 40px;
  --hg-underline-fade: 16px;  /* active chrome-row underline (scope tabs, content tabs) fades its ends over this */
  --hg-scroll-fade: 26px;     /* right-edge range fade on a table that continues past its viewport */
  /* Floating-panel contract; theme-derived material, preset-independent geometry. */
  --hg-floating-panel-bg: color-mix(in srgb, var(--hg-surface-tabs) 70%, transparent);
  --hg-floating-panel-radius: 8px;
  --hg-floating-panel-blur: 32px;
  --hg-floating-panel-padding: 22px 24px;
  --hg-chrome-h: 88px;           /* header + tabs */
  --hg-sticky-under-chrome: 79px; /* docs: header+tabs only */
  --hg-gantt-label-w: 380px;
  --hg-week-w: 56px;
  --hg-day-w: 11.2px;

  /* cashflow theme */
  --cf-forecast-label-w: 309px; /* 35 characters at 7px, plus controls and indent */
  --cf-spend: #455a7a44;
  --cf-spend-b: #455a7a33;
  --cf-deficit: color-mix(in srgb, var(--hg-danger) 20%, transparent);
  --cf-deficit-b: color-mix(in srgb, var(--hg-danger) 40%, transparent);
  --cf-income: #27ae60;
  --cf-label: #455a7a;
  --cf-deficit-t: #c0392b;
  --cf-deficit-glow: rgba(192, 57, 43, 0.95);
  /* stronger coats for standalone plot bars (overview panels) — --cf-spend's
     15% alpha is tuned for the gantt dock's dense week grid, too faint alone */
  --cf-bar: #455a7a66;
  --cf-bar-b: #455a7a55;
  --cf-bar-deficit: color-mix(in srgb, var(--hg-danger) 32%, transparent);
  --cf-bar-deficit-b: color-mix(in srgb, var(--hg-danger) 50%, transparent);
  /* Scenario overlay rows (cashflow forecast): a selected project's lines.
     Derived from the theme accent, so a preset change drives them — never a
     hardcoded hex, never a borrow of a status token. */
  --cf-scenario-bg:  color-mix(in srgb, var(--hg-accent) 10%, transparent);
  --cf-scenario-ink: var(--hg-accent);
  --wl-quiet-overage-dot: color-mix(in srgb, var(--hg-danger) 30%, transparent);
  --wl-quiet-underload-dot: color-mix(in srgb, #e67e22 30%, transparent);
  --wl-quiet-overage-ink: var(--hg-text-ink);
  /* Plan-mode cells (cashflow forecast): explicit entries wear the accent
     pair, carried values the quieter mixed ink — same accent derivation as
     scenario rows, never a status token. */
  --cf-plan-bg:  color-mix(in srgb, var(--hg-accent) 7%, transparent);
  --cf-plan-ink: var(--hg-accent);
  --cf-plan-carried-ink: color-mix(in srgb, var(--hg-accent) 60%, var(--hg-text-ink));
  /* ── Text contrast system (step 6 — 2026-08-13) ──────────────────
     --hg-contrast is a 0–100 slider for the appearance panel. By default
     it's unset and --hg-text-ink / --hg-text-bright keep their hardcoded
     values (zero visual change). When the panel sets --hg-contrast, it
     also overrides these tokens with color-mix formulas:
       light: color-mix(in srgb, #000, var(--hg-surface-base) calc(100% - var(--hg-contrast)))
       dark:  color-mix(in srgb, #fff, var(--hg-surface-base) calc(100% - var(--hg-contrast)))
     The formula mixes text toward the surface — 0=text=surface, 100=pure
     black (light) / pure white (dark). It works in both modes because it
     always moves toward the surface base. */
  --hg-text-ink: #232324;
  --hg-text-on-accent: #ffffff;  /* white text on dark/colored buttons, toast, grand totals, selected date */

  /* ── Action/accent tokens (step 8 — 2026-08-13) ──────────────────
     Gold accent for primary actions, danger red for destructive actions,
     info blue for secondary labels. These are the brand-decorative colors
     a tenant can override. Status pill colors (st-rev, st-appr, etc.) will
     reference these as their base in step 9. */
  --hg-accent:        #df6f00;  /* accent: active tabs, tier buttons, create buttons, toast, grand totals, focus rings, calendar selection, block-btn.on */
  --hg-absence-clear: #347d52; /* no assigned-work clash; not pipeline status */
  --hg-absence-neutral: var(--hg-text-muted);
  --hg-danger:        #c0392b;  /* danger backgrounds (confirm btn, workload bar) */
  --hg-danger-ink:    #b03a2a;  /* danger text on light (delete buttons, crew-pick.un) */
  --hg-danger-hover:  #a93226;  /* danger hover bg (confirm btn hover, st-reopen bg) */
  --hg-info:          #455a7a;  /* info blue text on light (mpath, weekhdr start, cf-caret) */

  /* ── People token (2026-09-11) ──────────────────────────────────
     Crew reads on the gantt label rows (gantt-crew-read). Violet:
     the one hue no status family claims, so a name never reads as
     status (green/gold/blue-grey/red/grey) or as an action (gold
     accent, danger red). Theme-controllable like the accent family. */
  --hg-people: #6d55b0;

  /* ── Text tokens (step 4 — 2026-08-13) ──────────────────────────
     Muted/secondary/label text. Every color: that was a hardcoded
     muted hex now references one of these. Theme-controllable.
     DO NOT use these for background or border — only color. */
  --hg-text-muted:     color-mix(in srgb, #232324 25%, #9a9aa2);  /* muted text: labels, meta, hints, disabled, placeholders */
  --hg-text-dim:       color-mix(in srgb, #232324 30%, #8a93a3);  /* dim text: badges, sub-text, secondary info, drawer labels */
  --hg-text-secondary: color-mix(in srgb, #232324 40%, #6a7180);  /* secondary text: form labels, plan columns, footnotes */
  --hg-text-label:     color-mix(in srgb, #232324 35%, #7d8494);  /* header labels: table th, doc th, drawer keys, section heads */
  --hg-text-quiet:     #454850;  /* quiet text: a tab that is not the current one, beside the ink of the one that is */

  /* ── Surface tokens (step 1 — 2026-08-13) ──────────────────────────
     Five surface tiers + header/tab chrome. Every background that was a
     hardcoded hex now references one of these. A theme preset overrides
     these values too, so a browser holding no record paints them.
     DO NOT use these tokens for border-color or color — only background. */
  --hg-surface-base:    #bac5ca;  /* body, subtabs, table headers, filter bar, popovers, modals, form panels */
  --hg-surface-header:  #939ca0;  /* header strip */
  --hg-surface-tabs:    #b1bbc0;  /* tab row, flat buttons, filter selects, project select */
  --hg-surface-input:   #ffffff;  /* input backgrounds (light) */
  --hg-surface-raised:  #f4f2ea;  /* subtotal rows, stage hover, editable hover */
  --hg-surface-elevated: #f3eedd; /* editable cell hover, stage days hover (light) */

  /* ── Border tokens (step 3 — 2026-08-13) ──────────────────────────
     Five border families. Every border that was a hardcoded hex now
     references one of these. A theme preset overrides these values.
     DO NOT use these tokens for background or color — only border/outline. */
  /* The one common line. Every table grid line, panel separator, control edge
     and dock edge reads this pair, so Appearance carries ONE line control.
     The four names below are the ladder this replaced; they stay as aliases so
     no surface needs rewriting and each surface keeps its own name for why it
     draws a line. */
  --hg-hairline:        #8c9fa9;
  --hg-border-chrome:   var(--hg-hairline);
  --hg-border-control:  var(--hg-hairline);
  --hg-border-row:      var(--hg-hairline);
  --hg-border-cell:     var(--hg-hairline);
  --hg-border-hover:    #c8c8c8;  /* hover border on buttons/selects (light) */
  --hg-border-focus:    #9a9aa2;  /* focus ring on inputs/controls (light) */
  --hg-border-na:       #c5cad4;  /* gantt label column and lane tree only (light) */
  --hg-border-menu-chk: #b8bcc6;  /* menu checkbox borders (light) */
  --gantt-head-h: 42px;            /* sticky gantt header band height — label rows park against this */

  /* ── Status tokens (step 9 — 2026-08-13) ────────────────────────
     Pipeline-semantic status colors. NOT editor-controllable — these
     encode shot/task status meaning (in-progress, complete, approved,
     re-open, waiting). Each status has a bg + ink pair. */
  --st-rev-bg:    #f8e3bd;  --st-rev-ink:    #8a5300;  /* review: deep amber */
  --st-ip-bg:     #d6e4fb;  --st-ip-ink:     #1258c8;  /* in progress: strong blue */
  --st-cmpt-bg:   #e2dcfa;  --st-cmpt-ink:   #5b2ee0;  /* complete: violet */
  --st-appr-bg:   #d5f2df;  --st-appr-ink:   #0e7339;  /* approved: brightest green */
  --st-reopen-bg: #f6dcd7;  --st-reopen-ink: #a93226;  /* re-open: red */
  --st-wtg-bg:    #e3e8ee;  --st-wtg-ink:    #4e5a6b;  /* waiting: neutral grey */

  /* ── Gantt bar tokens (step 10 — 2026-08-13) ────────────────────
     Pipeline-semantic gantt bar colors. NOT editor-controllable.
     Map to status families but use distinct bar-appropriate shades. */
  --gbar-ip-bg:    #287d50;  /* in-pipeline bar (sea green; white text >= 4.5:1) */
  --gbar-wtg-bg:   #667185;  /* waiting bar (slate grey; white text >= 4.5:1) */
  --gbar-rev-bg:   #c28a31;  /* review/in-progress bar (gold) */
  --gbar-rev-ink:  #241806;  /* dark text on gold bar */
  --gbar-appr-bg:  #4a6f9c;  /* approved bar (blue) */
  --gbar-cmpt-bg:  #507b60;  /* complete bar (muted green) */
  --gbar-draft-stripe: #7f8ca0;  /* draft bar stripe alternate */
  --gbar-ip-border: #2c4038;  /* in-pipeline border (dark — unused in light, defined for symmetry) */
  --gbar-wtg-ink:  #d6d9df;  /* text on waiting bar (dark only) */
  --hg-danger-bright: #e74c3c;  /* bright danger red for spike lines, overdue markers, tags */

  /* ── Shadow tokens (step 12 — 2026-08-13) ───────────────────────
     Five shadow tiers. Theme-controllable — a tenant can tune shadow
     intensity. Each token holds the full box-shadow value. */
  --hg-shadow-ink:   rgba(15, 23, 42, 0.15);              /* sm-tier ink; dark flips it below */
  --hg-drop-share:   25%;                                /* accent share of the card drop; dark halves it */
  --hg-shadow-sm:    0 1px 3px var(--hg-shadow-ink);     /* subtle: entity body, master-totals */
  --hg-shadow-pop:   0 4px 16px rgba(0,0,0,.12);         /* popover: dropdown panels */
  --hg-shadow-menu:  0 10px 28px #17181c33;               /* menu: status menu, hg-menu, selects */
  --hg-shadow-modal: 0 16px 40px #00000088;               /* modal: dialogs, large panels */
  --hg-shadow-slide: -6px 0 24px #0002;                    /* slide: drawer edge shadow */
  /* Lift = the panel material in two layers: a cast below and a glow above, so a
     sheet reads as resting on the surface rather than painted on it. A panel that
     shares its frame with another (the cashflow sheet and the forecast plot)
     takes the halves separately, so each paints the edge that belongs to it and
     the frame they share casts nothing.
     Two scales use the pair. The colour of each half and the offset are shared.
     The weight and the reach belong to the scale, because a 32px control and a
     full sheet need different numbers to read the same. */
  --hg-lift-cast-rgb: 15 23 42;
  --hg-lift-glow-rgb: 228 228 231;
  --hg-lift-offset:   4px;

  /* Panel scale: a full sheet. */
  --hg-lift-cast-a:    .10;
  --hg-lift-glow-a:    .5;
  --hg-lift-cast-blur: 8px;
  --hg-lift-glow-blur: 12px;

  /* Control scale: the same pair on a small box, the size of a swatch or a
     header button. The alpha rises to hold the weight the smaller area loses. */
  --hg-lift-ctl-cast-a:    .13;
  --hg-lift-ctl-glow-a:    .5;
  --hg-lift-ctl-cast-blur: 8px;
  --hg-lift-ctl-glow-blur: 8px;

  /* Panel scale, built. */
  --hg-shadow-cast:  0 var(--hg-lift-offset) var(--hg-lift-cast-blur) rgb(var(--hg-lift-cast-rgb) / var(--hg-lift-cast-a));   /* soft cast below a card: open budget panels, lane cards */
  --hg-shadow-glow:  0 calc(-1 * var(--hg-lift-offset)) var(--hg-lift-glow-blur) rgb(var(--hg-lift-glow-rgb) / var(--hg-lift-glow-a));
  --hg-shadow-lift:  var(--hg-shadow-cast), var(--hg-shadow-glow);

  /* Control scale, built. Header buttons, swatches, sliders and the Mode chip
     read this pair, so every small raised control reads the same. */
  --hg-shadow-cast-ctl: 0 var(--hg-lift-offset) var(--hg-lift-ctl-cast-blur) rgb(var(--hg-lift-cast-rgb) / var(--hg-lift-ctl-cast-a));
  --hg-shadow-glow-ctl: 0 calc(-1 * var(--hg-lift-offset)) var(--hg-lift-ctl-glow-blur) rgb(var(--hg-lift-glow-rgb) / var(--hg-lift-ctl-glow-a));
  --hg-shadow-lift-ctl: var(--hg-shadow-cast-ctl), var(--hg-shadow-glow-ctl);

  /* The panel pair in filter syntax, for a surface whose shape a box-shadow
     cannot follow: a title bar with type in it. drop-shadow and box-shadow do
     not share a value, so both are built from the numbers above. */
  --hg-filter-lift:  drop-shadow(0 var(--hg-lift-offset) var(--hg-lift-cast-blur) rgb(var(--hg-lift-cast-rgb) / var(--hg-lift-cast-a))) drop-shadow(0 calc(-1 * var(--hg-lift-offset)) var(--hg-lift-glow-blur) rgb(var(--hg-lift-glow-rgb) / var(--hg-lift-glow-a)));
  /* Title-bar text and logo carry the glow half of the pair only: the halo above
     the glyphs, with no cast under them. */
  --hg-filter-text: drop-shadow(0 calc(-1 * var(--hg-lift-offset)) var(--hg-lift-glow-blur) rgb(var(--hg-lift-glow-rgb) / var(--hg-lift-glow-a)));
}

html.dark {
  --cf-spend: #8a94a626;
  --cf-spend-b: #8a94a61a;
  --cf-deficit: #a05a5a2e;
  --cf-deficit-b: #a05a5a55;
  --cf-income: #3fae6e;
  --cf-label: #6f7076;
  --cf-deficit-t: #c08a8a;
  --cf-deficit-glow: rgba(224, 96, 96, 0.95);
  --cf-bar: #8a94a64d;
  --cf-bar-b: #8a94a655;
  --cf-bar-deficit: #a05a5a4d;
  --cf-bar-deficit-b: #a05a5a66;
  /* Scenario overlay rows — same accent derivation, dark weights. 12% keeps
     the accent ink at 4.58:1 on the mixed row fill (AA at 11px). */
  --cf-scenario-bg:  color-mix(in srgb, var(--hg-accent) 12%, transparent);
  --cf-scenario-ink: var(--hg-accent);
  --wl-quiet-overage-dot: color-mix(in srgb, var(--hg-danger) 40%, transparent);
  --wl-quiet-underload-dot: color-mix(in srgb, #e67e22 40%, transparent);
  --wl-quiet-overage-ink: var(--hg-text-bright);
  /* Plan-mode cells — same accent derivation, dark weights. */
  --cf-plan-bg:  color-mix(in srgb, var(--hg-accent) 9%, transparent);
  --cf-plan-ink: var(--hg-accent);
  --cf-plan-carried-ink: color-mix(in srgb, var(--hg-accent) 60%, var(--hg-text-ink));
  /* Dark-mode bright text — hardcoded default (zero change). The contrast
     formula in :root docs explains how the panel overrides this. */
  --hg-text-bright: #ffffff;
  --hg-text-on-accent: #ffffff;

  /* ── Action/accent tokens (dark mode — step 8, 2026-08-13) ──────
     Dark values for accent/danger/info. Gold brightens to #d9a441,
     danger stays #c0392b, danger-ink is #e0655f (lighter red for dark bg),
     danger-hover stays #a93226, info brightens to #7d9cba. */
  --hg-accent:        #d9a441;  /* gold on dark (active tabs, sum-card total, delete hover, block-btn.on) */
  --hg-absence-clear: #7db892;
  --hg-absence-neutral: var(--hg-text-muted);
  --hg-danger:        #c0392b;  /* same red in both modes */
  --hg-danger-ink:    #e0655f;  /* lighter red text on dark (delete hover, seg-delete hover) */
  --hg-danger-hover:  #a93226;  /* same hover red in both modes */
  --hg-info:          #7d9cba;  /* blue on dark (linked, seg-meta, t-cost, task-add, drawer links) */
  --hg-people:        #9c86d4;  /* people violet brightens on dark (gantt-crew-read) */

  /* ── Text tokens (dark mode — step 4, 2026-08-13) ───────────────
     Same four families, dark values.
     #6f7076 = muted (headers, labels, meta, placeholders, disabled)
     #8a93a3 = dim (badges, sub-text, secondary info — same as light)
     Dark has no separate secondary/label — those light-only tiers
     are overridden here to #6f7076 so any stray light-mode ref stays muted. */
  --hg-text-muted:     color-mix(in srgb, #ffffff 40%, #6f7076);
  --hg-text-dim:       color-mix(in srgb, #ffffff 30%, #8a93a3);
  --hg-text-secondary: color-mix(in srgb, #ffffff 40%, #6f7076);
  --hg-text-label:     color-mix(in srgb, #ffffff 40%, #6f7076);
  --hg-text-quiet:     #a9a9ad;  /* quiet text (dark): unselected tabs and their kin */

  /* ── Status tokens (dark mode — step 9, 2026-08-13) ────────────
     Same status families, dark values. NOT editor-controllable. */
  --st-rev-bg:    #33260f;  --st-rev-ink:    #ffb43d;  /* review: bright amber */
  --st-ip-bg:     #16233a;  --st-ip-ink:     #63a6ff;  /* in progress: bright blue */
  --st-cmpt-bg:   #241f3d;  --st-cmpt-ink:   #b79bff;  /* complete: violet */
  --st-appr-bg:   #12301f;  --st-appr-ink:   #3fe08a;  /* approved: brightest green */
  --st-reopen-bg: #342225;  --st-reopen-ink: #c08a92;  /* re-open: dark red */
  --st-wtg-bg:    #242a30;  --st-wtg-ink:    #a8b3c2;  /* waiting: neutral grey */

  /* ── Gantt bar tokens (dark mode — step 10, 2026-08-13) ────────
     Dark values for gantt bars. IP and CMPT share a lighter green. */
  --gbar-ip-bg:    #6f9c7f;  /* in-pipeline: lighter green for dark */
  --gbar-cmpt-bg:  #87906a;  /* complete: olive, distinct from in-progress */
  --gbar-wtg-bg:   #4a4e58;  /* waiting: dark grey */
  --gbar-draft-stripe: #3e424b;  /* draft: dark stripe alternate */
  --gbar-rev-ink:  #1a1508;  /* dark text on gold buttons/bars */
  --gbar-wtg-ink:  #d6d9df;  /* text on dark waiting bar */
  --gbar-ip-border: #2c4038;  /* in-pipeline border */

  /* ── Shadow tokens (dark mode — step 12, 2026-08-13) ────────────
     Same five tiers, dark values. Deeper shadows for dark surfaces. */
  --hg-shadow-ink:   rgba(0,0,0,0.45);
  --hg-drop-share:   12.5%;
  --hg-shadow-sm:    0 1px 3px var(--hg-shadow-ink);
  --hg-shadow-pop:   0 8px 24px #00000055;
  --hg-shadow-menu:  0 10px 28px #00000099;
  --hg-shadow-modal: 0 16px 40px #00000088;
  --hg-shadow-slide: -6px 0 24px #00000066;
  /* Lift pair, dark numbers. Same structure as the light block: shared colours
     and offset, per-scale weight and reach. */
  --hg-lift-cast-rgb: 0 0 0;
  --hg-lift-glow-rgb: 228 228 231;
  --hg-lift-offset:   4px;

  /* Panel scale. */
  --hg-lift-cast-a:    .28;
  --hg-lift-glow-a:    .06;
  --hg-lift-cast-blur: 8px;
  --hg-lift-glow-blur: 12px;

  /* Control scale. */
  --hg-lift-ctl-cast-a:    .36;
  --hg-lift-ctl-glow-a:    .08;
  --hg-lift-ctl-cast-blur: 8px;
  --hg-lift-ctl-glow-blur: 12px;

  --hg-shadow-cast:  0 var(--hg-lift-offset) var(--hg-lift-cast-blur) rgb(var(--hg-lift-cast-rgb) / var(--hg-lift-cast-a));
  --hg-shadow-glow:  0 calc(-1 * var(--hg-lift-offset)) var(--hg-lift-glow-blur) rgb(var(--hg-lift-glow-rgb) / var(--hg-lift-glow-a));
  --hg-shadow-lift:  var(--hg-shadow-cast), var(--hg-shadow-glow);
  --hg-shadow-cast-ctl: 0 var(--hg-lift-offset) var(--hg-lift-ctl-cast-blur) rgb(var(--hg-lift-cast-rgb) / var(--hg-lift-ctl-cast-a));
  --hg-shadow-glow-ctl: 0 calc(-1 * var(--hg-lift-offset)) var(--hg-lift-ctl-glow-blur) rgb(var(--hg-lift-glow-rgb) / var(--hg-lift-ctl-glow-a));
  --hg-shadow-lift-ctl: var(--hg-shadow-cast-ctl), var(--hg-shadow-glow-ctl);
  --hg-filter-lift:  drop-shadow(0 var(--hg-lift-offset) var(--hg-lift-cast-blur) rgb(var(--hg-lift-cast-rgb) / var(--hg-lift-cast-a))) drop-shadow(0 calc(-1 * var(--hg-lift-offset)) var(--hg-lift-glow-blur) rgb(var(--hg-lift-glow-rgb) / var(--hg-lift-glow-a)));
  --hg-filter-text: drop-shadow(0 calc(-1 * var(--hg-lift-offset)) var(--hg-lift-glow-blur) rgb(var(--hg-lift-glow-rgb) / var(--hg-lift-glow-a)));

  /* Tracker cell input dark overrides — one place for all tracker tables.
     --hg-input-border stays transparent (inline-edit = borderless);
     visible/hover/focus borders track --hg-border-control so the whole
     input family follows the active tenant theme (warm ivory, etc.). */
  --hg-input-border: 1px solid transparent;
  --hg-input-border-visible: 1px solid var(--hg-border-control);
  /* dark field fill = halfway between raised and base (the table ground):
     boxes stay visible but stop reading as holes punched in the table */
  --hg-input-bg: color-mix(in srgb, var(--hg-surface-raised) 50%, var(--hg-surface-base));  /* the field fill — the Appearance Field pair moves this */
  --hg-input-ink: var(--hg-text-bright);  /* the field's text: the strongest tone of the mode */
  --hg-input-color: var(--hg-input-ink);
  --hg-input-border-hover: var(--hg-border-control);
  --hg-input-border-focus: var(--hg-border-control);

  /* ── Surface tokens (dark mode — step 1, 2026-08-13) ───────────────
     NEUTRAL-TEMPERATURE FALLBACK: the active tenant preset (see
     theme_presets.py) overlays its own surface family on top of these;
     these defaults exist only for surfaces the preset does not set.
     #1c2226 = base (body/drawer/gantt-labels); #2c343a = header; #20262a = tabs
     #17181b = elevated (modals, shot groups, bid subtotals, week headers)
     #1a1b1f = raised (form panels, dropdowns, inputs, tag pills, option lists)
     #1e1f23 = card (hover states, drawer threads, tier buttons)
     #24262b = hover (toast, status pills, tier badges, recruit status) */
  --hg-surface-base:     #1c2226;
  --hg-surface-header:   #2c343a;
  --hg-surface-tabs:     #20262a;
  --hg-surface-input:    #141517;
  --hg-surface-raised:   #1a1b1f;
  --hg-surface-elevated: #17181b;
  --hg-surface-card:     #1e1f23;
  --hg-surface-hover:    #24262b;

  /* ── Border tokens (dark mode — step 3, 2026-08-13) ───────────────
     Mirrors the light :root set. Same families, dark values.
     #26272b = the one common line (dark)
     #55565c = hover/focus borders (dark)
     #e4e4e7 = focus border + outline (dark — brightest tier) */
  --hg-hairline:        #091116;
  --hg-border-chrome:   var(--hg-hairline);
  --hg-border-control:  var(--hg-hairline);
  --hg-border-row:      var(--hg-hairline);
  --hg-border-cell:     var(--hg-hairline);
  --hg-border-hover:    #55565c;
  --hg-border-na:       #3a3b40;
  --hg-border-menu-chk: #55565c;
  --hg-border-focus:    #e4e4e7;
}

/* Pantone segment tokens. One mechanism only: --seg-accent drives color-mix()
   washes via the hierarchy opacity vars below. There are deliberately NO
   alpha-hex wash variables — a wash is always color-mix(accent, <level>op). */
:root {
  /* Hierarchy wash opacity: LANE > ENTITY > STAGE, all in the lane's accent. In
     dark a field on a card sits one step deeper than the row it is in (see
     --seg-field): the substrate, sunk a touch. A row's wash never changes on
     hover — hover touches the drop's soft radius only. One definition for both
     modes; no html.dark overrides for row washes. */
  --hg-lane-op: 30%;
  --hg-entity-op: 20%;
  --hg-stage-op: 10%;
  --hg-field-op: 16%;
  /* Shadow-strength ramp for the same hierarchy (lane = 100%, the base drop). */
  --hg-drop-ent-share: 70%;
  --hg-drop-stage-share: 45%;
  /* Row rail: the distance from any tree row's own left edge to its caret
     column. Lane, deliverable and stage rows all read it, so the leading gap
     is one number from the top of a lane to the last stage under it. */
  --hg-rail-inset: 10px;
  /* feather length of the shared segment accent edge (--seg-edge, defined on [data-seg]) */
   --seg-feather: 3px;
}
[data-seg="preprod"]      { --seg-accent:#e88817; }
[data-seg="characters"]   { --seg-accent:#d52a80; }
[data-seg="environments"] { --seg-accent:#2aaf57; }
[data-seg="props"]        { --seg-accent:#5939df; }
[data-seg="mocap"]        { --seg-accent:#17b0bb; }
[data-seg="shots"]        { --seg-accent:#df371a; }
[data-seg="support"]      { --seg-accent:#426da8; }
[data-seg="gold"]         { --seg-accent:#dca91c; }
[data-seg="lime"]         { --seg-accent:#90bd1b; }
[data-seg="azure"]        { --seg-accent:#1c8adc; }
[data-seg="umber"]        { --seg-accent:#b36a33; }
[data-seg="magenta"]      { --seg-accent:#dc1ccc; }
[data-seg="other"]        { --seg-accent:var(--hg-border-focus); }
/* Shared feathered accent edge. MUST be computed on [data-seg], not :root:
   a var() inside a custom property resolves against the declaring element's
   own set (:root has no --seg-accent → guaranteed-invalid → every background
   using the token silently drops to transparent). Here it recomputes per
   element with that element's slug accent (light + dark) and inherits into
   children like .hg-entity-body. */
[data-seg] { --seg-edge: linear-gradient(90deg, var(--seg-accent) 0, transparent var(--seg-feather));
  /* The lane's own horizontal rule: its accent at 30%, so a row ends on
     its own colour without a bright line cutting across the chart. */
  --seg-rule: color-mix(in srgb, var(--seg-accent) 30%, transparent);
  /* Dark's fill for an editable field on this lane's card: the row's own wash
     sunk by a thin scrim, so the field keeps the SAME lane tone, a touch deeper
     and softer than the substrate rather than a brighter patch or a neutral
     chip. A proportional scrim is what keeps the hue; mixing a cool ink in pulls
     the lane colour grey. Light keeps the app's field fill. */
  --seg-field: color-mix(in srgb, #000 var(--hg-field-op), transparent);
  /* accent drop shadow of the card stack (§7g). MUST live here, NOT on :root:
     it references var(--seg-accent), which exists only on [data-seg] elements —
     on :root the var() is guaranteed-invalid and every box-shadow consuming
     this token becomes an invalid declaration (the "hover shadow gone
     everywhere" regression). Custom properties substitute at the declaring
     element; [data-seg] is exactly the set of cards that may cast.
     The ink base is --hg-shadow-ink, which flips with the mode — ONE drop
     definition serves light and dark; there is no dark twin. The accent
     share is --hg-drop-share, also mode-flipped: dark accents are bright
     pastels, so dark halves the share (12.5%) to halve the drop's
     luminance. */
  /* Drop ink, and its strength ramp down the hierarchy: LANE > ENTITY > STAGE.
     One ink definition, thinned by alpha for the two lower levels so a stack
     reads as one cast from the lane instead of three equal bands of shadow. */
  --hg-drop-ink: color-mix(in srgb, var(--seg-accent) var(--hg-drop-share), var(--hg-shadow-ink));
  --hg-drop-ink-ent: color-mix(in srgb, var(--hg-drop-ink) var(--hg-drop-ent-share), transparent);
  --hg-drop-ink-stage: color-mix(in srgb, var(--hg-drop-ink) var(--hg-drop-stage-share), transparent);
  --hg-drop-accent: 0 1px 3px var(--hg-drop-ink);
  --hg-drop-ent: 0 1px 3px var(--hg-drop-ink-ent);
  --hg-drop-stage: 0 1px 3px var(--hg-drop-ink-stage);
  /* Hover states: identical ink and offset, 3x the soft radius. */
  --hg-drop-accent-h: 0 1px 9px var(--hg-drop-ink);
  --hg-drop-ent-h: 0 1px 9px var(--hg-drop-ink-ent);
  --hg-drop-stage-h: 0 1px 9px var(--hg-drop-ink-stage);
  /* What a lane paints. Entity and stage rows paint their own token through
     the carriers (--hg-ent-drop / --hg-stage-drop / --hg-body-drop), so each
     level keeps its strength on both surfaces, in both modes. */
  --hg-drop-now: var(--hg-drop-accent);
  /* The same lane drop, carried: identical ink and blur, further off its
     surface (drag ghost). */
  --hg-drop-accent-lift: 0 3px 6px var(--hg-drop-ink); }
html.dark [data-seg="preprod"]      { --seg-accent:#f2aa56; }
html.dark [data-seg="characters"]   { --seg-accent:#e671aa; }
html.dark [data-seg="environments"] { --seg-accent:#5bbe7d; }
html.dark [data-seg="props"]        { --seg-accent:#927af2; }
html.dark [data-seg="mocap"]        { --seg-accent:#43c7d1; }
html.dark [data-seg="shots"]        { --seg-accent:#f26b55; }
html.dark [data-seg="support"]      { --seg-accent:#8298b9; }
html.dark [data-seg="gold"]         { --seg-accent:#ffd764; }
html.dark [data-seg="lime"]         { --seg-accent:#c6f05e; }
html.dark [data-seg="azure"]        { --seg-accent:#6cc4ff; }
html.dark [data-seg="umber"]        { --seg-accent:#d9a878; }
html.dark [data-seg="magenta"]      { --seg-accent:#f272e8; }
html.dark [data-seg="other"]        { --seg-accent:#a0a1aa; }

/* ===== 2. RESET + BASE ===== */
  * { box-sizing: border-box; margin: 0; padding: 0; }
  /* Page-level scrollbars must NEVER exist: the app is a locked flex column
     (body height:100vh, overflow:hidden). Views scroll inside their own
     full-width scroll roots (bidwrap/cs-scroll/it-scroll/gantt-wrap), so a
     document scrollbar can never appear and never eat a side gap. Tracker
     scroll roots span the FULL window — their scrollbar touches the window
     edge. The 20px gutter is a sibling flex LANE around the scroller (chrome,
     like the header/tabs bands) — never scrollport padding, so it is present
     at every scroll position and contents can never enter it. */
  :root {
    --hg-tracker-side-padding: 20px;
    /* Central font definitions — the whole app inherits these. */
    --hg-font-ui: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    --hg-font-mono: ui-monospace, Consolas, "SF Mono", monospace;
    /* Type scale — the only sizes the UI should use. Weights match the
       Google Fonts faces loaded (400/500/600/700).
       --hg-type-scale multiplies every size (default 1.0). The appearance
       panel sets this to retune all type globally (0.85 compact → 1.5 large). */
    --hg-type-scale: 1.0;
    --hg-type-tiny:    calc(8px    * var(--hg-type-scale));  /* tier badge numerals */
    --hg-type-micro:   calc(9.5px  * var(--hg-type-scale));  /* badges, pills, status chips */
    --hg-type-9:       calc(9px    * var(--hg-type-scale));  /* gantt owner labels, collapse btn */
    --hg-type-small:   calc(10.5px * var(--hg-type-scale));  /* table headers, dense meta */
    --hg-type-10:      calc(10px   * var(--hg-type-scale));  /* sum-card labels, entity types, doc gen */
    --hg-type-11:      calc(11px   * var(--hg-type-scale));  /* the most common size — inputs, buttons, meta */
    --hg-type-11h:     calc(11.5px * var(--hg-type-scale));  /* entity names, mrow stg, mid-dense */
    --hg-type-base:    calc(12px   * var(--hg-type-scale));  /* default body (matches body font-size) */
    --hg-type-12h:     calc(12.5px * var(--hg-type-scale));  /* entity names (bold), rate inputs */
    --hg-type-medium:  calc(13px   * var(--hg-type-scale));  /* emphasised body, primary actions */
    --hg-type-14:      calc(14px   * var(--hg-type-scale));  /* form btns, acct toolbar */
    --hg-type-large:   calc(16px   * var(--hg-type-scale));  /* subheads, panel titles */
    --hg-type-18:      calc(18px   * var(--hg-type-scale));  /* doc h1 */
    --hg-type-display: calc(26px   * var(--hg-type-scale));  /* sum-card values, page-level titles */
    --hg-weight-normal: 400;
    --hg-weight-medium: 500;
    --hg-weight-semibold: 600;
    --hg-weight-bold: 700;
    /* Soft text shadow — applied once on body, inherited everywhere.
       Black works in both modes (light ink / bright white text). */
    --hg-text-shadow: 0 1px 3px rgba(0, 0, 0, 0.20);
    /* Tracker cell input styling — one place for all tracker tables
       (Crew, IT, Expenses, future subtabs).  UNIFIED FIELD FILL: every
       input wears --hg-input-bg permanently — idle and selected are the
       SAME colour (selection signals via border/caret only).  The
       breakdown editor's seg/entity/task label fields are the one
       exception family (dedicated coloured rules).  Dark-mode overrides
       are in the html.dark block at the top of the file. */
    --hg-input-border: 1px solid transparent;
    --hg-input-border-visible: 1px solid #d3cec2;
    --hg-input-radius: 4px;
    --hg-input-padding: 2px 5px;
    --hg-input-font-size: var(--hg-type-base);
    --hg-input-bg: #cfd7d9;   /* ONE field fill — idle = selected; the Appearance Field pair moves this */
    --hg-input-ink: var(--hg-text-ink);      /* the field's text: the strongest tone of the mode */
    --hg-input-color: var(--hg-input-ink);
    --hg-input-border-hover: #d3cec2;
    --hg-input-border-focus: #d3cec2;
  }

  /* ── Tracker cell input classes ──────────────────────────────
     Two classes own every inline-editable cell input across all
     tracker tables (Crew, IT, Expenses, future subtabs).  JS uses
     these class names instead of copy-pasted inline styles; the
     dark-mode block at the bottom of the file overrides the tokens. */
  .hg-cell-input,
  .hg-cell-input-new {
    border: var(--hg-input-border);
    border-radius: var(--hg-input-radius);
    padding: var(--hg-input-padding);
    font-size: var(--hg-input-font-size);
    font-family: var(--hg-font-ui);
    background: var(--hg-input-bg);
    color: var(--hg-input-color);
    outline: none;
  }
  .hg-cell-input-new { border: var(--hg-input-border-visible); }
  /* Flush cell editor: the table cell owns sizing, padding and fill.
     The invisible value preserves the same intrinsic size as read-only
     text; the editor itself contributes no width or row height. */
  td.hg-edit-cell { position: relative; background: var(--hg-input-bg); }
  .hg-cell-sizer { visibility: hidden; pointer-events: none; }
  input.hg-cell-input.flush,
  html.dark input.hg-cell-input.flush {
    position: absolute; inset: 0; box-sizing: border-box;
    width: 100%; height: 100%; min-width: 0;
    border: 0; border-radius: 0; padding: inherit;
    background: transparent; font: inherit; color: inherit;
    text-align: inherit; outline: none;
    appearance: textfield; -moz-appearance: textfield;
  }
  input.hg-cell-input.flush::-webkit-inner-spin-button,
  input.hg-cell-input.flush::-webkit-outer-spin-button { appearance: none; margin: 0; }
  /* Crew inputs — borderless text fields (name/role/email) + visible-border
     rate field.  All share color/font from the centralized --hg-input-* tokens.
     The rate override comes AFTER so its visible border wins the cascade. */
  #crewTable td input.cs-name,
  #crewTable td input.cs-role,
  #crewTable td input.cs-email,
  #crewTable td input.rate-input {
    border: 1px solid transparent;
    background: var(--hg-input-bg);
    color: var(--hg-input-color);
    font-size: var(--hg-input-font-size);
    font-family: var(--hg-font-ui);
    outline: none;
  }
  #crewTable td input.rate-input { border: var(--hg-input-border-visible); border-radius: 5px; padding: 3px 7px; }
  .hg-cell-input:hover,
  .hg-cell-input-new:hover,
  #crewTable td input.cs-name:hover,
  #crewTable td input.cs-role:hover,
  #crewTable td input.cs-email:hover,
  #crewTable td input.rate-input:hover { border-color: var(--hg-input-border-hover); }
  .hg-cell-input:focus,
  .hg-cell-input-new:focus,
  #crewTable td input.cs-name:focus,
  #crewTable td input.cs-role:focus,
  #crewTable td input.cs-email:focus,
  #crewTable td input.rate-input:focus {
    border-color: var(--hg-input-border-focus);
    /* fill intentionally NOT restated: --hg-input-bg is idle = selected */
  }

  /* THE GUTTER LAW (founder 2026-09-26) — two mechanisms, one definition each.
     (1) STATIC GUTTERS: protective chrome around the scroller, exactly like
     the header/tabs/filter bands — a left, right and bottom token-sized band
     built by hgLaneWrap() (tracker-width.js) around the existing *.scroll
     root. Transparent, inert, NEVER inside the scroll flow, occupied by
     NOTHING: the 20px gap around the container exists at every scroll
     position, in both axes, at rest and at the edges. No top band: no bar
     lives above a table.
     (2) FLOATING BARS: the gutter's ONE permitted occupant (the occupancy
     law's carve-out). One mechanism for both axes — .hg-bar-v, .hg-bar-h:
     real scroller strips (drag works, thumbs match the table) positioned
     absolutely in the shell, outside the scroll flow, so no scroll in
     either axis can carry them away; each carries its own intrinsic gutter,
     the token band whose outer sliver it paints — the table-side gap
     travels wherever the bar goes. A bar renders ONLY where its axis
     overflows (no bars where none are required) and may render OVER the
     static gutters when clamped. The horizontal bar sticks to the bottom of
     the table it scrolls: it hugs the table's last row while the table is
     fully visible and clamps at the view's lower boundary — never beyond
     (hgBarSync geometry math; NOT sticky — this Chromium does not re-stick
     inside the locked cell, verified in-app 2026-09-26 — and NOT native:
     a native bar only paints at its scrollport's edge and can never hug
     a table).
     All sizing comes only from --hg-tracker-side-padding — the ONLY place
     the 20px exists. The scroller cell carries no padding, owns no bar
     (overflow hidden, !important), and the table carries no margins.
     Nothing compounds. */
  .hg-laned { position: relative; }
  .hg-lane-l, .hg-lane-r {
  width: var(--hg-tracker-side-padding);
  flex: 0 0 auto;
  background: transparent;
  pointer-events: none;
  }
  .hg-lane-b {
  height: var(--hg-tracker-side-padding);
  flex: 0 0 auto;
  background: transparent;
  pointer-events: none;
  }
  /* The floating bars: absolute scroller strips over the static gutters.
     Their tracks are 1px cross-axis, sized to the table's scroll extent by
     hgBarSync so thumb and range match. A bar spans its table's edge
     exactly — it never intrudes into the perpendicular gutters: the
     horizontal bar is inset from the shell's left and right edges by the
     token (the side gutters), the vertical bar from the bottom by the
     token (the bottom gutter), so bar length = table length on that axis. */
  .hg-bar-v, .hg-bar-h {
  position: absolute;
  background: transparent;
  pointer-events: auto;
  }
  .hg-bar-v {
  top: 0; right: 0;
  bottom: var(--hg-tracker-side-padding);
  width: var(--hg-tracker-side-padding);
  overflow-y: scroll;
  scrollbar-width: thin;
  }
  .hg-bar-h {
  left: var(--hg-tracker-side-padding);
  right: var(--hg-tracker-side-padding);
  height: var(--hg-tracker-side-padding);
  overflow-x: scroll;
  scrollbar-width: thin;
  }
  .hg-bar-track { pointer-events: none; }
  /* RANGE EDGE — a table that continues past the cell's right edge says so
     with a short fade, and stops saying it at the end of the range. The mask
     lives on the CELL because that is the only box that ends where the table
     is clipped: the lane gutters and the floating bars are shell siblings,
     outside the masked box, so they keep full opacity while the table fades.
     It is a mask, not a fill, because the cell sits over the patterned page
     and only alpha lets that page read through the band. The band's WIDTH is
     the distance still off-screen, capped at the token: as the reader reaches
     the end the ramp shortens to nothing, so the last column emerges instead
     of the fade snapping off. hgScrollFadeSync (js/scroll-fade.js) writes
     --hg-ov-more and drops the attribute once nothing is left. */
  /* HAIRCOMB — a groove is a different falloff over the SAME extent, never a
     cut out. Rest rows run the quarter circle y = sqrt(1 - t*t) across the
     whole band. A groove row runs SLERP, but its quarter turn is compressed
     into 75% of the band, so it reaches zero opacity at 75% of the distance
     and holds there; the rest rows carry on to zero at the cell's edge.
     alpha = base + depth * groove, with depth = (arc - base) / (1 - base)
     because `add` composites as source-over here and weights the added term
     by what is left; that form puts the crest on the arc in both stretches.
     The selector's crest and groove are flat states with sub-pixel shoulders,
     so each pixel row sits wholly in one state and a groove row reads the
     base value rather than an average of the two.
     The width is min(--hg-scroll-fade, distance still off-screen), so the
     whole profile compresses as the reader reaches the end rather than being
     multiplied by a second ramp. */
  .hg-scroll-fade[data-hg-ov-right] {
  --hg-fade-w: min(var(--hg-scroll-fade), var(--hg-ov-more, var(--hg-scroll-fade)));
  mask-image:
    linear-gradient(to right,
    rgba(0, 0, 0, 1.000) calc(100% - var(--hg-fade-w) * 1),
    rgba(0, 0, 0, 0.991) calc(100% - var(--hg-fade-w) * 0.9375),
    rgba(0, 0, 0, 0.966) calc(100% - var(--hg-fade-w) * 0.875),
    rgba(0, 0, 0, 0.924) calc(100% - var(--hg-fade-w) * 0.8125),
    rgba(0, 0, 0, 0.866) calc(100% - var(--hg-fade-w) * 0.75),
    rgba(0, 0, 0, 0.793) calc(100% - var(--hg-fade-w) * 0.6875),
    rgba(0, 0, 0, 0.707) calc(100% - var(--hg-fade-w) * 0.625),
    rgba(0, 0, 0, 0.609) calc(100% - var(--hg-fade-w) * 0.5625),
    rgba(0, 0, 0, 0.500) calc(100% - var(--hg-fade-w) * 0.5),
    rgba(0, 0, 0, 0.383) calc(100% - var(--hg-fade-w) * 0.4375),
    rgba(0, 0, 0, 0.259) calc(100% - var(--hg-fade-w) * 0.375),
    rgba(0, 0, 0, 0.131) calc(100% - var(--hg-fade-w) * 0.3125),
    rgba(0, 0, 0, 0.000) calc(100% - var(--hg-fade-w) * 0.25),
    rgba(0, 0, 0, 0.000) calc(100% - var(--hg-fade-w) * 0.1875),
    rgba(0, 0, 0, 0.000) calc(100% - var(--hg-fade-w) * 0.125),
    rgba(0, 0, 0, 0.000) calc(100% - var(--hg-fade-w) * 0.0625),
    rgba(0, 0, 0, 0.000) calc(100% - var(--hg-fade-w) * 0)),
    repeating-linear-gradient(to bottom,
      rgba(0, 0, 0, 1) 0, rgba(0, 0, 0, 1) 1.9px,
      rgba(0, 0, 0, 0) 2.1px, rgba(0, 0, 0, 0) 3.9px,
      rgba(0, 0, 0, 1) 4px),
    linear-gradient(to right,
    rgba(0, 0, 0, 0.000) calc(100% - var(--hg-fade-w) * 1),
    rgba(0, 0, 0, 0.771) calc(100% - var(--hg-fade-w) * 0.9375),
    rgba(0, 0, 0, 0.770) calc(100% - var(--hg-fade-w) * 0.875),
    rgba(0, 0, 0, 0.767) calc(100% - var(--hg-fade-w) * 0.8125),
    rgba(0, 0, 0, 0.763) calc(100% - var(--hg-fade-w) * 0.75),
    rgba(0, 0, 0, 0.758) calc(100% - var(--hg-fade-w) * 0.6875),
    rgba(0, 0, 0, 0.751) calc(100% - var(--hg-fade-w) * 0.625),
    rgba(0, 0, 0, 0.742) calc(100% - var(--hg-fade-w) * 0.5625),
    rgba(0, 0, 0, 0.732) calc(100% - var(--hg-fade-w) * 0.5),
    rgba(0, 0, 0, 0.719) calc(100% - var(--hg-fade-w) * 0.4375),
    rgba(0, 0, 0, 0.704) calc(100% - var(--hg-fade-w) * 0.375),
    rgba(0, 0, 0, 0.685) calc(100% - var(--hg-fade-w) * 0.3125),
    rgba(0, 0, 0, 0.661) calc(100% - var(--hg-fade-w) * 0.25),
    rgba(0, 0, 0, 0.583) calc(100% - var(--hg-fade-w) * 0.1875),
    rgba(0, 0, 0, 0.484) calc(100% - var(--hg-fade-w) * 0.125),
    rgba(0, 0, 0, 0.348) calc(100% - var(--hg-fade-w) * 0.0625),
    rgba(0, 0, 0, 0.000) calc(100% - var(--hg-fade-w) * 0));
  -webkit-mask-image:
    linear-gradient(to right,
    rgba(0, 0, 0, 1.000) calc(100% - var(--hg-fade-w) * 1),
    rgba(0, 0, 0, 0.991) calc(100% - var(--hg-fade-w) * 0.9375),
    rgba(0, 0, 0, 0.966) calc(100% - var(--hg-fade-w) * 0.875),
    rgba(0, 0, 0, 0.924) calc(100% - var(--hg-fade-w) * 0.8125),
    rgba(0, 0, 0, 0.866) calc(100% - var(--hg-fade-w) * 0.75),
    rgba(0, 0, 0, 0.793) calc(100% - var(--hg-fade-w) * 0.6875),
    rgba(0, 0, 0, 0.707) calc(100% - var(--hg-fade-w) * 0.625),
    rgba(0, 0, 0, 0.609) calc(100% - var(--hg-fade-w) * 0.5625),
    rgba(0, 0, 0, 0.500) calc(100% - var(--hg-fade-w) * 0.5),
    rgba(0, 0, 0, 0.383) calc(100% - var(--hg-fade-w) * 0.4375),
    rgba(0, 0, 0, 0.259) calc(100% - var(--hg-fade-w) * 0.375),
    rgba(0, 0, 0, 0.131) calc(100% - var(--hg-fade-w) * 0.3125),
    rgba(0, 0, 0, 0.000) calc(100% - var(--hg-fade-w) * 0.25),
    rgba(0, 0, 0, 0.000) calc(100% - var(--hg-fade-w) * 0.1875),
    rgba(0, 0, 0, 0.000) calc(100% - var(--hg-fade-w) * 0.125),
    rgba(0, 0, 0, 0.000) calc(100% - var(--hg-fade-w) * 0.0625),
    rgba(0, 0, 0, 0.000) calc(100% - var(--hg-fade-w) * 0)),
    repeating-linear-gradient(to bottom,
      rgba(0, 0, 0, 1) 0, rgba(0, 0, 0, 1) 1.9px,
      rgba(0, 0, 0, 0) 2.1px, rgba(0, 0, 0, 0) 3.9px,
      rgba(0, 0, 0, 1) 4px),
    linear-gradient(to right,
    rgba(0, 0, 0, 0.000) calc(100% - var(--hg-fade-w) * 1),
    rgba(0, 0, 0, 0.771) calc(100% - var(--hg-fade-w) * 0.9375),
    rgba(0, 0, 0, 0.770) calc(100% - var(--hg-fade-w) * 0.875),
    rgba(0, 0, 0, 0.767) calc(100% - var(--hg-fade-w) * 0.8125),
    rgba(0, 0, 0, 0.763) calc(100% - var(--hg-fade-w) * 0.75),
    rgba(0, 0, 0, 0.758) calc(100% - var(--hg-fade-w) * 0.6875),
    rgba(0, 0, 0, 0.751) calc(100% - var(--hg-fade-w) * 0.625),
    rgba(0, 0, 0, 0.742) calc(100% - var(--hg-fade-w) * 0.5625),
    rgba(0, 0, 0, 0.732) calc(100% - var(--hg-fade-w) * 0.5),
    rgba(0, 0, 0, 0.719) calc(100% - var(--hg-fade-w) * 0.4375),
    rgba(0, 0, 0, 0.704) calc(100% - var(--hg-fade-w) * 0.375),
    rgba(0, 0, 0, 0.685) calc(100% - var(--hg-fade-w) * 0.3125),
    rgba(0, 0, 0, 0.661) calc(100% - var(--hg-fade-w) * 0.25),
    rgba(0, 0, 0, 0.583) calc(100% - var(--hg-fade-w) * 0.1875),
    rgba(0, 0, 0, 0.484) calc(100% - var(--hg-fade-w) * 0.125),
    rgba(0, 0, 0, 0.348) calc(100% - var(--hg-fade-w) * 0.0625),
    rgba(0, 0, 0, 0.000) calc(100% - var(--hg-fade-w) * 0));
  /* The band is drawn on the CONTENT box, never the border box. A scroll
     container's own bars live inside its border box: in the Gantt the vertical
     bar takes the right 15px and the horizontal bar the bottom 15px, so a
     border-box band would paint straight over them — the right scroll arrow
     and the thumb at the end would fade to nothing, and the reader cannot see
     where the end is. Content-box puts the band against the last column and
     clear of both bars. */
  mask-origin: content-box;
  -webkit-mask-origin: content-box;
  mask-clip: content-box;
  -webkit-mask-clip: content-box;
  mask-composite: add, intersect, add;
  }

  .hg-mid { flex: 1 1 auto; min-height: 0; display: flex; }
  /* The cell scrolls but owns NO bar. !important: the per-view root rules say
     `overflow:auto` later in the file for their un-lane'd lifetime; once
     hgLaneWrap has run, the cell contract wins — the floating bars are the
     only bars. overflow:hidden keeps programmatic scroll, kills the native
     bar mechanism. */
  .hg-cell {
  flex: 1 1 auto; min-width: 0; min-height: 0;
  overflow: hidden !important;
  scrollbar-width: none !important;
  /* Touch pan: the cell scrolls programmatically (hgPan's touch branch) and
     the browser must not claim the gesture. Same law as .gantt-wrap. */
  touch-action: none;
  }
  .bidwrap, .gantt-wrap { scrollbar-gutter: stable; }
  /* The scroll position belongs to the reader. A panel rebuild changes content
     above the viewport transiently (note fields start at one row, then grow),
     and Chrome's scroll anchoring compensates by moving the scroll — the page
     jumps while the reader is looking at it. Every scroll root in the app is
     pinned instead: no re-render, no interaction and no background refresh may
     move the view. */
  .bidwrap, .gantt-wrap, .gscroll, .cs-scroll, .it-scroll, .exp-scroll,
  .rc-scroll, .cli-inv-scroll, .cti-inv-scroll, .cf-forecast-scroll,
  .ov-realized-scroll, .lh-scroll, .cf-upcoming-scroll { overflow-anchor: none; }
  .view.on { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; overflow: hidden; }
  #v-ib .bidwrap { flex: 1 1 auto; min-height: 0; overflow: auto; }
  #v-cli .bidwrap { flex: 1 1 auto; min-height: 0; overflow: auto; }
  /* Gantt view shell: chart scrolls on its own; cashflow is a sibling dock
     at the bottom of the VIEW (window), never nested in the chart scroll.
     Filters sit ABOVE the scroll root as a plain flex band — not sticky —
     so week headers cannot park under the tabs strip past the filter row. */
  #v-tr.view.on {
    display: flex; flex-direction: column;
    flex: 1 1 auto; /* fills below the real chrome — no hardcoded 88px accounting */
    min-height: 0; overflow: hidden;
  }
  /* The root needs a real, finger-scrollable range for Android Chrome's
     collapsing browser controls. The app remains a fixed-height sticky shell:
     root scrolling does not move the gantt, docks or tracker layout. */
  html { min-height: calc(100dvh + 96px); }
  html::after { content: ""; display: block; height: 96px; pointer-events: none; }
  body {
    font-family: var(--hg-font-ui);
    font-size: var(--hg-type-base);
    color: var(--hg-text-ink); background: var(--hg-surface-base); line-height: 1.4;
    text-shadow: var(--hg-text-shadow);
      transition: background .15s, color .15s;
    -webkit-font-smoothing: antialiased;
    /* Each view retains its own scroll root. Only the outer document scrolls
       to let browser controls collapse on a native finger swipe. */
    display: flex; flex-direction: column; height: 100vh; height: 100dvh;
    overflow: hidden; position: sticky; top: 0;
  }
  /* Form controls must use the same central UI font — the UA default (Arial)
     otherwise leaks into inputs/buttons/selects. Inputs do NOT inherit
     text-shadow from body; the token is restated here so every text field,
     select and button matches its surrounding label text. */
  input, button, select, textarea {
    font-family: var(--hg-font-ui);
    text-shadow: var(--hg-text-shadow);
  }
  /* Single Hydra scales strip — cover-fitted to the window (zooms to fill,
     crops overflow on whichever axis doesn't match the image aspect). */
  body::before {
    content: ""; position: fixed; inset: 0; z-index: -1;
    background: url("assets/HydraScalesBG.jpg") center / cover no-repeat;
    filter: invert(1) grayscale(.4) brightness(1.02); opacity: .13;
    pointer-events: none;
  }
/* ===== 3. CHROME — header, tabs, project chrome ===== */
  header {
    display: flex; align-items: center; gap: 14px;
    padding: 0 20px; height: var(--hg-header-h); background: var(--hg-surface-header); border-bottom: 1px solid var(--hg-border-chrome);
    position: sticky; top: 0; z-index: 40; flex-shrink: 0;
  }
  /* Narrow: the header's right cluster (live status, undo, T1/2/3, whoami,
     dark mode, settings) drops to a second row instead of running off the
     right edge. --hg-header-h tracks the two-line height so the dropdowns
     anchored below the strip stay correct. */
  @media (max-width: 800px) {
    :root { --hg-header-h: 52px; }
    header { flex-wrap: wrap; height: auto; min-height: 48px; padding: 6px 20px; row-gap: 6px; }
    .header-right { flex-basis: 100%; margin-left: 0; justify-content: flex-end; }
  }
  header .logo { height: 22px; width: auto; flex-shrink: 0; content: url("assets/black_on_white_icon_only.png"); }
  html.dark header .logo { content: url("assets/white_on_black_icon_only.png"); }
  header .proj { font-size: var(--hg-type-medium); font-weight: 600; letter-spacing: -.01em; }
  .hg-serif { font-family: inherit; }
  .hg-mono { font-family: inherit; font-feature-settings: "tnum"; }
  .proj-strip .proj-wrap {
    display: flex; align-items: center; gap: 6px; flex-shrink: 0;
    position: relative; z-index: 2; grid-column: 1; grid-row: 1; justify-self: start;
  }
  .proj-strip .proj-select {
    font-size: var(--hg-type-medium); font-weight: 600; letter-spacing: -.01em;
    padding: 3px 8px; border: 1px solid transparent; border-radius: 4px;
    background-color: transparent; color: var(--hg-text-ink); cursor: pointer; min-width: 120px;
  }
  .proj-strip .proj-select:hover { background-color: #f0f0f0; }
  .proj-strip .proj-new-btn {
    font-size: var(--hg-type-11); font-weight: 500;
    padding: 4px 10px; border: 1px solid var(--hg-border-control); border-radius: 4px;
      background: var(--hg-surface-tabs); color: var(--hg-text-ink); cursor: pointer; white-space: nowrap;
  }
  .proj-strip .proj-new-btn:hover { border-color: var(--hg-border-hover); color: var(--hg-text-ink); }
  .proj-strip .proj-edit-btn {
    display: inline-flex; align-items: center; justify-content: center;
    font-size: var(--hg-type-medium); padding: 3px 7px; border: 1px solid transparent;
    border-radius: 4px; background: transparent; color: var(--hg-text-muted);
    cursor: pointer; line-height: 1;
  }
  .proj-strip .proj-edit-btn:hover { background: #f0f0f0; color: var(--hg-text-ink); }
  /* New project inline form. Two labelled rows: the form is the grid, so the
     label column takes the widest label and both controls start on the same
     edge. The picker's note, tree and actions span both columns. The folder
     name form shares this block: one anchor and one form vocabulary for the
     two name entries. */
  .proj-new-form.hg-floating-panel,
  .proj-folder-form.hg-floating-panel {
    display: none; position: fixed; top: calc(var(--hg-header-h) + var(--hg-tabs-h)); left: 16px; z-index: 50;
    width: max-content; min-width: 280px; max-width: calc(100vw - 32px);
    max-height: calc(100dvh - var(--hg-header-h) - var(--hg-tabs-h) - 16px); overflow: auto;
  }
  .proj-new-form.on,
  .proj-folder-form.on {
    display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 10px; align-items: center;
  }
  .proj-new-form > label,
  .proj-folder-form > label { white-space: nowrap; }
  .proj-new-form > h3,
  .proj-new-form > #projSetupSummary,
  .proj-new-form > .proj-setup-tree,
  .proj-new-form > .form-btns,
  .proj-folder-form > h3,
  .proj-folder-form > .form-btns { grid-column: 1 / -1; }
  /* The source picker keeps its natural width; the browse action sits on the
     row's right edge, under the name field's right edge. */
  .proj-source-row { display: flex; gap: 8px; align-items: center; justify-content: space-between; min-width: 0; }
  .proj-source-row .hg-select { min-width: 0; }
  .proj-source-row .hg-ctl { padding: 5px 14px; font-size: var(--hg-type-base); font-weight: 600; cursor: pointer; }
  .proj-setup-tree { max-height: min(45vh, 420px); max-width: 540px; overflow: auto; }
  .proj-setup-tree[hidden] { display: none; }
  .proj-setup-tree .proj-setup-node { margin: 5px 0 5px 14px; }
  .proj-setup-tree label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
  .proj-setup-tree input[type="checkbox"] { width: 14px; height: 14px; padding: 0; }
  #importLanesBg .modal { width: 560px; max-width: calc(100vw - 40px); max-height: calc(100dvh - 32px); overflow: auto; }
  .import-lanes-body > .hg-ctl, .import-lanes-selection .hg-ctl { padding: 6px 14px; }
  .import-lanes-source, .import-lanes-selection { display: flex; align-items: center; gap: 10px; }
  .import-lanes-source .hg-select { flex: 1; min-width: 0; }
  .import-lanes-body { display: flex; flex-direction: column; gap: 10px; }
  .import-lanes-body .hg-form-note { margin: 0; }
  .proj-setup-tree summary { cursor: pointer; }
  /* The relations editor rides the shared pinned card, the same compact
     surface as the read-only list. These rules state the card's content box
     only; the card supplies material, padding and placement. */
  .breakdown-relations-card { display: flex; flex-direction: column; gap: 8px; width: 300px; max-width: min(300px, 80vw); min-height: 0; }
  /* The tree is the card's one elastic row: when the card is capped to the
     window, the tree gives way and scrolls so the footer stays on screen. */
  .breakdown-relations-card > * { flex: 0 0 auto; min-height: 0; }
  .breakdown-relations-card .proj-setup-tree { flex: 1 1 auto; min-height: 72px; max-height: min(38vh, 300px); max-width: none; }
  .breakdown-relations-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
  /* The footer pair keeps the dialog button size; the action row above wears
     the card's action pill (.btn-new.card-task-btn). */
  .breakdown-relations-card .rel-foot .btn-ghost,
  .breakdown-relations-card .rel-foot .btn-new { padding: 4px 12px; font-size: var(--hg-type-11); }
  .breakdown-relations-actions .card-task-btn:disabled { opacity: .5; cursor: default; }
  .breakdown-relations-card .hg-form-note { margin: 0; }
  .breakdown-relations-card .rel-foot { justify-content: flex-end; }
  .breakdown-relations-open.hg-icon-btn,
  .reviewer-open.hg-icon-btn { flex: 0 0 auto; width: 22px; height: 22px; padding: 3px; contain: layout style; will-change: transform; }
  /* Gantt label rows own their paint surfaces. Do not request a permanent
     rendering layer for every relationship button inside those rows. */
  #labelsPanel .breakdown-relations-open.hg-icon-btn { will-change: auto; }
  /* A door whose item holds at least one relation wears the accent in both
     modes, hover included, so a column can be scanned for rows with
     something behind them. */
  .breakdown-relations-open.has-relations,
  .breakdown-relations-open.has-relations:hover { color: var(--hg-accent); }
  html.dark .breakdown-relations-open.has-relations,
  html.dark .breakdown-relations-open.has-relations:hover { color: var(--hg-accent); }
  /* The text a relations door sits beside: one line, ellipsized, so the door
     never leaves the row. Shared by the Gantt labels and the Board rows. */
  .has-rel-door > .rel-label-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  /* Per-surface box shape only (gap): the Gantt and the Board doors sit
     closer to the label than the Breakdown rows do. */
  .gantt-labels .g-title.has-rel-door,
  .gantt-labels .g-title.has-reviewer-door,
  .gantt-labels .g-stage.has-rel-door,
  .gantt-labels .g-stage.has-reviewer-door,
  .asset-tree.board .hg-stage > .t-stage.has-rel-door { display: flex; align-items: center; gap: 6px; min-width: 0; }
  /* Tag priority on a label line: the NAME outranks its tags, and the tags are
     WIPED, never popped. The tags sit in a strip that owns only the leftover
     width after the name and the door, so a narrowing column cuts the strip at
     its own edge: a tag slides out under the column boundary instead of
     vanishing (a tag that vanished would read as an untagged row). The name
     holds its whole width until it alone no longer fits, then it ellipsizes. */
  .gantt-labels .g-title.has-rel-door > .rel-label-text,
  .gantt-labels .g-title.has-reviewer-door > .rel-label-text,
  .gantt-labels .g-stage.has-rel-door > .rel-label-text,
  .gantt-labels .g-stage.has-reviewer-door > .rel-label-text {
    flex: 0 0 auto;                         /* the name gives no room away */
    max-width: calc(100% - 22px - 6px);     /* and leaves the door its box */
  }
  /* Two doors (relations + reviewer) each keep a 22px box and a 6px gap. */
  .gantt-labels .g-title.has-rel-door.has-reviewer-door > .rel-label-text,
  .gantt-labels .g-stage.has-rel-door.has-reviewer-door > .rel-label-text {
    max-width: calc(100% - 44px - 12px);
  }
  .gantt-labels .g-title.has-rel-door > .g-tags,
  .gantt-labels .g-title.has-reviewer-door > .g-tags,
  .gantt-labels .g-stage.has-rel-door > .g-tags,
  .gantt-labels .g-stage.has-reviewer-door > .g-tags {
    flex: 1 1 auto; min-width: 0; overflow: hidden;
    display: flex; align-items: center; gap: 6px;
  }
  /* A tag keeps its whole width inside the strip: the wipe is the strip's
     edge crossing the pill, never the pill squeezing into a chopped shape. */
  .gantt-labels .g-title.has-rel-door > .g-tags > .tag-pill,
  .gantt-labels .g-stage.has-rel-door > .g-tags > .tag-pill { flex: 0 0 auto; }
  /* Read-only relations list (Gantt and Board). It rides the shared pinned
     card, so it states only its own box: compact width, scroll past a short
     stack. Each entry is text, not a button: the crew read's underline-on-
     hover marks the click. */
  .rel-list { list-style: none; margin: 6px 0 0; padding: 0; max-width: 240px; max-height: min(40vh, 320px); overflow: auto; }
  .rel-entry {
    display: flex; align-items: baseline; gap: 8px; width: 100%;
    background: none; border: none; padding: 3px 0; margin: 0;
    font: inherit; font-size: var(--hg-type-base); color: inherit;
    text-align: left; cursor: pointer;
  }
  .rel-entry-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .rel-entry:hover .rel-entry-name { text-decoration: underline; text-underline-offset: 2px; }
  .rel-entry:focus-visible { outline: 2px solid var(--hg-accent); outline-offset: 1px; }
  .rel-entry-context { flex: 0 0 auto; color: var(--hg-text-muted); font-size: var(--hg-type-11); }
  /* The list's own action sits under it, right-aligned like the card's other
     action rows: narrow the view to this item and the entries above. */
  .breakdown-relations-card .rel-actions { display: flex; justify-content: flex-end; margin-top: 8px; }
  .breakdown-relations-card .rel-actions .btn-new { padding: 4px 12px; font-size: var(--hg-type-11); }
  /* The Related control exists in the filter bar only while a scope is on. */
  .block-btn.rel-scope[hidden] { display: none; }
  .proj-new-form label,
  .proj-folder-form label { font-size: var(--hg-type-11); color: var(--hg-text-secondary); font-weight: 600; }
  .proj-new-form input,
  .proj-folder-form input {
    font-size: var(--hg-type-medium); padding: 5px 8px; border: 1px solid var(--hg-border-control); border-radius: 4px; width: 100%;
  }
  .proj-new-form .form-btns,
  .proj-folder-form .form-btns { display: flex; gap: 8px; margin-top: 4px; }
  .proj-new-form .form-btns button,
  .proj-folder-form .form-btns button {
    font-size: var(--hg-type-base); font-weight: 600; padding: 5px 14px; border-radius: 4px; border: 1px solid var(--hg-border-control); cursor: pointer;
  }
  .proj-new-form .form-btns .create,
  .proj-folder-form .form-btns .create { background: var(--hg-accent); color: var(--hg-text-on-accent); border-color: var(--hg-accent); }
  .proj-new-form .form-btns .cancel,
  .proj-folder-form .form-btns .cancel { background: var(--hg-surface-tabs); color: var(--hg-text-secondary); }
  /* Project settings panel */
  .proj-settings-form.hg-floating-panel {
    display: none; position: fixed; top: calc(var(--hg-header-h) + var(--hg-tabs-h)); left: 60px; z-index: 50;
    gap: 8px; flex-direction: column; width: 460px; min-width: 280px;
    max-width: calc(100vw - 76px); max-height: calc(100dvh - var(--hg-header-h) - var(--hg-tabs-h) - 16px); overflow: auto;
  }
  .proj-settings-form.on { display: flex; }
  .proj-settings-form label { font-size: var(--hg-type-11); color: var(--hg-text-secondary); font-weight: 600; }
  .proj-settings-form label.proj-live-row { display: flex; align-items: center; gap: 6px; font-weight: 500; color: var(--hg-text-ink); cursor: pointer; }
  .proj-settings-form input {
    font-size: var(--hg-type-medium); padding: 5px 8px; border: 1px solid var(--hg-border-control); border-radius: 4px; width: 100%;
  }
  .proj-settings-form .form-btns { display: flex; gap: 8px; margin-top: 4px; flex-wrap: wrap; }
    .proj-settings-form .form-btns button {
      font-size: var(--hg-type-base); font-weight: 600; padding: 5px 14px; border-radius: 4px; border: 1px solid var(--hg-border-control); cursor: pointer;
    }
    .proj-settings-form .form-btns .create { background: var(--hg-accent); color: var(--hg-text-on-accent); border-color: var(--hg-accent); }
    .proj-settings-form .form-btns .dup { background: var(--hg-surface-tabs); color: var(--hg-text-ink); border-color: var(--hg-border-hover); }
    .proj-settings-form .form-btns .dup:hover { border-color: var(--hg-accent); color: var(--hg-text-ink); }
    .proj-settings-form .form-btns .dup:disabled { opacity: .55; cursor: wait; }
    .proj-settings-form .form-btns .cancel { background: var(--hg-surface-tabs); color: var(--hg-text-secondary); }
  header .meta { color: var(--hg-text-quiet); font-size: var(--hg-type-11); font-variant-numeric: tabular-nums; }
  /* Right cluster (live status, undo, T1/2/3, whoami, theme, settings). Pushed
     to the right edge as one unit; at the narrow breakpoint it drops to a
     second row instead of spilling off the right side. */
  .header-right {
    margin-left: auto; display: inline-flex; align-items: center; gap: 8px;
    flex-shrink: 0;
  }
  .agent-strip-head { font-size: var(--hg-type-11); color: var(--hg-text-quiet); display: flex; gap: 8px; align-items: center; cursor: pointer; }
  /* ===== Footer meta line (segments · plan days · mutation · build) ===== */
  /* The bottom gutter is a flex LANE of the frame and reserves its space, the
     same way the side gutters are sibling lanes around the scrollers: it is
     exactly as thick as they are wide, and every view, dock and scroll root
     ends at its top edge. Nothing but the info line may occupy it, so it is
     never an overlay — no dock row, scrollbar or panel can render inside it. */
  .hg-footer {
    flex: 0 0 auto;
    height: var(--hg-tracker-side-padding); box-sizing: border-box;
    display: flex; align-items: center; justify-content: center; gap: 14px;
    padding: 0 var(--hg-tracker-side-padding);
    background: transparent; border: none;
    font-size: var(--hg-type-11); color: var(--hg-text-muted); opacity: 0.75; font-variant-numeric: tabular-nums;
    /* One line, centred: the lane is fixed thickness, so the line box must fit
       it at every appearance type scale rather than grow past it. */
    line-height: 1;
    pointer-events: none; overflow: hidden; white-space: nowrap;
  }
  .hg-footer .meta { color: var(--hg-text-muted); font-size: var(--hg-type-11); font-variant-numeric: tabular-nums; }
  html.dark .hg-footer { background: transparent; color: var(--hg-text-muted); opacity: 0.75; }
  html.dark .hg-footer .meta { color: var(--hg-text-muted); }
  .dot { width: 6px; height: 6px; border-radius: 50%; background: #2e9e5b; display: inline-block; }
  .agent-strip-head.reconnecting { color: #d64545; }
  .agent-strip-head.reconnecting #livetxt { animation: hg-pulse 1.2s ease-in-out infinite; }
  .agent-strip-head.reconnecting .dot { background: #d64545 !important; animation: hg-pulse 1.2s ease-in-out infinite; }
  @keyframes hg-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
  html.dark .agent-strip-head.reconnecting { color: #e0655f; }
  html.dark .agent-strip-head.reconnecting .dot { background: #e0655f !important; }
  .theme-btn {
    border: 1px solid var(--hg-border-control); background: var(--hg-surface-tabs); color: var(--hg-text-ink);
      border-radius: 4px; padding: 4px 10px; font-size: var(--hg-type-11); cursor: pointer; font-weight: 500;
      flex-shrink: 0; display: inline-flex; align-items: center; gap: 5px; margin-left: 8px;
  }
  .theme-btn:hover { border-color: var(--hg-border-hover); color: var(--hg-text-ink); }
  .theme-btn .ico { font-size: var(--hg-type-medium); line-height: 1; }
  /* Title-bar lift. Every item in the header reads as raised off the bar: the
     boxed controls take the same two-layer pair as the filter-row toggles, and
     the text items and logo take the tight filter, because the pair's 8px blur
     fuzzes type at this size. Scope follows the bar; the appearance pane's own
     Mode chip is the header's control placed in the pane and carries the pair
     through its own rule. */
  header .theme-btn,
  header .tier-btn,
  header .undo-btn:not(:disabled) { box-shadow: var(--hg-shadow-lift-ctl); }
  header .logo,
  header .scope-tab,
  header .agent-strip-head,
  header .meta { filter: var(--hg-filter-text); }
  /* ===== 3a. SCOPE TABS (Company | Projects) — inline in header ===== */
  .scope-tabs {
    display: flex; align-items: stretch; gap: 14px; flex-shrink: 0;
    align-self: stretch;
  }
  .scope-tab {
    display: inline-flex; align-items: center;
    font-size: var(--hg-type-medium); font-weight: 600; color: var(--hg-text-quiet); cursor: pointer;
    border: none; border-bottom: 2px solid transparent; border-radius: 0;
    white-space: nowrap; background: transparent;
    position: relative;
    transition: color .12s, border-color .12s;
  }
  .scope-tab:hover { color: var(--hg-text-ink); }
  /* The accent underline is the shared overlay rule beside .tab in §3b, so both
     rows fade their ends identically. This rule only sets text colour. */
  .scope-tab.on { color: var(--hg-text-ink); border-bottom-color: transparent; }

  /* ===== 3b. PROJECT STRIP (proj selector + content tabs) ===== */
  /* Symmetric 1fr tracks keep the tab strip centred in the full window even
     though the selector occupies the left track — the empty right track
     balances it. Narrow windows drop the tabs to a second row (media query
     below) so they never slide under the selector or clip. */
  .proj-strip {
    display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
    padding: 0 20px; background: var(--hg-surface-tabs);
    /* Bottom edge: a hairline at half the Top shade over a soft cast, so the
       strip reads as a sheet lying on the view. The mix keeps the hairline tied
       to the Top token while letting the strip paint through, and one
       declaration serves both modes. */
    border-bottom: 1px solid color-mix(in srgb, var(--hg-surface-header) 50%, transparent);
    box-shadow: var(--hg-shadow-cast);
    flex-shrink: 0; position: relative; min-height: 40px;
  }
  .proj-strip .tabs {
    border: none; background: transparent; padding: 0; gap: 18px;
    height: 40px; grid-column: 2; grid-row: 1;
    position: static; justify-content: center; z-index: 1;
  }
  .proj-strip .tab {
    font-size: var(--hg-type-base);
  }
  /* Narrow: the selector keeps row 1 to itself and the tabs wrap into a fresh
     row — every scope (Company's six tabs included) folds instead of clipping. */
  @media (max-width: 720px) {
    .proj-strip { display: flex; flex-wrap: wrap; align-items: center; height: auto; padding: 6px 20px; }
    .proj-strip .proj-wrap { flex: 0 0 auto; }
    .proj-strip .tabs {
      flex: 1 1 100%; height: auto; min-height: 40px;
      justify-content: flex-start; flex-wrap: wrap; overflow: visible;
    }
  }
  /* Hide tabs not in the active scope */
  body[data-scope="co"] .tab.scope-proj,
  body[data-scope="co"] .tab.scope-res { display: none !important; }
  body[data-scope="proj"] .tab.scope-co,
  body[data-scope="proj"] .tab.scope-res { display: none !important; }
  body[data-scope="res"] .tab.scope-co,
  body[data-scope="res"] .tab.scope-proj { display: none !important; }
  body[data-scope="co"] .proj-strip .proj-wrap { display: none; }
  body[data-scope="res"] .proj-strip .proj-wrap { display: none; }
  .tabs {
    display: flex; align-items: stretch; gap: 22px; background: var(--hg-surface-tabs); padding: 0 20px;
    border-bottom: 1px solid var(--hg-border-chrome); position: sticky; top: 48px; z-index: 39;
    /* 40px border-box = 39 content + 1 bottom border — full integer px, no subpixel overflow */
    height: 40px; overflow-x: auto; overflow-y: hidden;
    flex-shrink: 0;
  }
  .tab {
    display: inline-flex; align-items: center;
    padding: 0; font-size: var(--hg-type-base); color: var(--hg-text-quiet); cursor: pointer;
    border: none; border-bottom: 2px solid transparent; border-radius: 0;
    white-space: nowrap; background: transparent;
    /* sit on the strip border — no negative margin (that was the +1px overflow source) */
    margin-bottom: 0;
    position: relative;
    transition: color .12s, border-color .12s;
  }
  .tab:hover { color: var(--hg-text-ink); background: transparent; }
  /* Active-row underline, shared by the scope tabs (§3a) and the content tabs.
     The 2px transparent border reserves the space; this overlay paints the accent
     with both ends faded over --hg-underline-fade so the rule does not read as cut
     off against the strip border. bottom:-2px lands it on the reserved border,
     since absolute offsets measure from the padding box. */
  .scope-tab::after, .tab::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px;
    background: linear-gradient(to right, transparent 0,
      var(--hg-accent) var(--hg-underline-fade),
      var(--hg-accent) calc(100% - var(--hg-underline-fade)), transparent 100%);
    opacity: 0; transition: opacity .12s; pointer-events: none;
  }
  .tab.on { color: var(--hg-text-ink); border-bottom-color: transparent; background: transparent; font-weight: 500; }
  .tab.on::after, .scope-tab.on::after { opacity: 1; }
  .view { display: none; }
  /* .view.on keeps its flex-column layout from the §2 rule (line ~442).
     The old '.view.on { display: block }' here silently overrode it (same
     specificity, later in file) — views laid out as block, scroll roots grew
     to content height and never overflowed: no scrollbars on any tab but
     Gantt (whose ID rule out-ranked this). Deleted 2026-09-13. */

  /* ===== 3b². FULLSCREEN CHROME TOGGLE ===== */
  /* Two buttons, one toggle (body.chrome-hidden). The IN-ROW button is
     absolutely anchored to .proj-strip's top/right edges (10px gap), out of
     the strip's grid flow so it never shifts with the tabs — the strip is
     position:relative, so it is the containing block. The FLOATING button is
     fixed to the window's top/right (10px gap) and appears only in fullscreen,
     because the strip — and its button — are hidden then.
     body.chrome-hidden hides the title bar (header) and tab row (.proj-strip);
     every view already flexes into the freed space, so no scroll math moves. */
  .chrome-toggle {
    position: absolute; top: 7px; right: 7px; z-index: 39;
    display: inline-flex; align-items: center; justify-content: center;
    width: 26px; height: 26px; padding: 0;
    border: none; border-radius: 4px;
    background: transparent; color: var(--hg-text-muted);
    cursor: pointer;
  }
  .chrome-toggle:hover { background: var(--hg-frost-hover); color: var(--hg-text-ink); }
  /* Fullscreen: the two chrome bands fold away. */
  body.chrome-hidden header,
  body.chrome-hidden .proj-strip { display: none; }
  /* The floating restore button — transparent surface, accent-coloured wire
     outline and glyph. Fixed above all chrome and content so nothing can
     overlap it, and it is the one way back out of fullscreen. */
  .chrome-toggle-float {
    position: fixed; top: 10px; right: 10px; z-index: 95;
    display: inline-flex; align-items: center; justify-content: center;
    width: 26px; height: 26px; padding: 0;
    background: transparent; border: 1px solid var(--hg-accent);
    border-radius: 4px; color: var(--hg-accent); cursor: pointer;
  }
  .chrome-toggle-float[hidden] { display: none; }
  .chrome-toggle-float:hover { background: var(--hg-accent); color: var(--hg-text-on-accent); }

  /* ===== 3b. SUB-TABS (inside Company tab) ===== */
  .subtabs {
    display: flex; align-items: stretch; gap: 18px; padding: 0 20px;
    border-bottom: 1px solid var(--hg-border-chrome); background: var(--hg-surface-base);
    height: 32px; overflow-x: auto; overflow-y: hidden; flex-shrink: 0;
  }
  .subtab {
    display: inline-flex; align-items: center;
    padding: 0; font-size: var(--hg-type-11); color: var(--hg-text-quiet); cursor: pointer;
    border: none; border-bottom: 2px solid transparent; border-radius: 0;
    white-space: nowrap; background: transparent;
    transition: color .12s, border-color .12s;
  }
  .subtab:hover { color: var(--hg-text-ink); }
  .subtab.on { color: var(--hg-text-ink); border-bottom-color: var(--hg-accent); font-weight: 500; }
  .subview { display: none; }
  .subview.on { display: block; }

  /* Centralized glass tokens. Use these, don't sprinkle literals. */
  :root {
    --hg-frost-ink: #17181c;  /* frost tint base — the ink that color-mix diffuses. Change here to retune all frost. */
    --hg-frost-bg-op: 10%;    /* sheet strength — how much of the ink the panel bodies and table bodies take */
    --hg-frost-head-op: 6%;   /* head strength — how much of the tabs shade a header band takes */
    --hg-frost-bg: color-mix(in srgb, var(--hg-frost-ink) var(--hg-frost-bg-op), transparent);
    --hg-frost-head: color-mix(in srgb, var(--hg-surface-tabs) var(--hg-frost-head-op), transparent);   /* one control: all table + panel headers */
    /* Opaque twin of the head wash: the sheet and head washes over the surface
       base. A header that must not let the page or the background skin read
       through it paints this instead of the translucent head. Both modes come
       from the mode-specific tokens below, so one declaration serves both. */
    --hg-frost-head-solid: color-mix(in srgb,
        var(--hg-surface-tabs) var(--hg-frost-head-op),
        color-mix(in srgb, var(--hg-frost-ink) var(--hg-frost-bg-op), var(--hg-surface-base)));
    --hg-frost-blur: 16px;
    --hg-frost-blur-soft: 8px;
    --hg-frost-head-shadow: 0 1px 3px rgba(15, 23, 42, 0.15);
    --hg-frost-hover: color-mix(in srgb, var(--hg-frost-head) 50%, transparent);   /* row highlight: same color as header, half opacity */
  }
  html.dark {
    --hg-frost-ink: #e4e4e7;  /* frost tint base (dark) — the light ink that color-mix diffuses over dark surfaces. */
    --hg-frost-bg-op: 4%;
    --hg-frost-head-op: 6%;
    --hg-frost-bg: color-mix(in srgb, var(--hg-frost-ink) var(--hg-frost-bg-op), transparent);
    --hg-frost-head: color-mix(in srgb, var(--hg-surface-tabs) var(--hg-frost-head-op), transparent);
    --hg-frost-head-shadow: 0 1px 3px rgba(0,0,0,0.45);
    /* text shadow twin — black at 0.20 is imperceptible on dark surfaces;
       same geometry, matched to the dark frost-head shadow strength */
    --hg-text-shadow: 0 1px 3px rgba(0,0,0,0.30);
    --hg-frost-hover: color-mix(in srgb, var(--hg-frost-head) 50%, transparent);   /* row highlight: same color as header, half opacity */
  }

  /* ===== 4. SURFACES — shared table (track + crew bones) ===== */
  table.track { width: 100%; border-collapse: separate; border-spacing: 0; background: transparent; }
  table.track th, #crewTable th {
    text-align: left; font-size: var(--hg-type-10); text-transform: uppercase; letter-spacing: .07em;
    color: var(--hg-text-label); padding: 7px 10px; border-bottom: 1px solid var(--hg-border-chrome); background: var(--hg-frost-head);
    backdrop-filter: blur(var(--hg-frost-blur)); -webkit-backdrop-filter: blur(var(--hg-frost-blur));
    position: sticky; top: 0; z-index: 34;
  }
  /* Tracker headers: ONE token. Base rule above paints every th. No thead background. */
  #v-cs #crewTable thead, :is(#v-lc, #v-eq) table.track thead, #v-ex table.track thead, #v-cliInv table.track thead, #v-ctiInv table.track thead, #v-rc table.track thead, .ov-scroll .cf-forecast-scroll table.track thead, table.track thead , .ov-scroll .cf-forecast-scroll table.track thead {
    position: static; z-index: 34;
  }
  #v-cs #crewTable th, :is(#v-lc, #v-eq) table.track th, #v-ex table.track th, #v-cliInv table.track th, #v-ctiInv table.track th, #v-rc table.track th, .ov-scroll .cf-forecast-scroll table.track th , .ov-scroll .cf-forecast-scroll table.track th {
    position: static;
    /* A static header sits on the flat view surface and never overlaps
       moving rows, so a blur behind it costs a pass and changes no pixel.
       Each cell was its own backdrop region; a repaint in one left the
       others stale and drew seams at the column edges. The wash alone
       paints the band. The Resources trackers override this below: their
       header pins and carries an opaque band. */
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  /* Resources trackers: Crew, Licences, Equipment and Recruitment keep the
     header row as the first row of the scrolling body, so it must pin to
     the table's own viewport or the labels leave the screen on the first
     scroll. The band paints the sheet and the header wash opaque over the
     page base, because the rows travel underneath it and a translucent
     wash lets their text read through the labels. */
  #v-cs #crewTable th,
  #v-rc .rc-scroll table.track th,
  :is(#v-lc, #v-eq) .it-scroll table.track th {
    position: sticky; top: 0; z-index: 34;
    background-color: var(--hg-surface-base);
    background-image: linear-gradient(var(--hg-frost-head), var(--hg-frost-head)),
                      linear-gradient(var(--hg-frost-bg), var(--hg-frost-bg));
    backdrop-filter: none; -webkit-backdrop-filter: none;
  }
  /* Keep the header outside the scrolling row surface. The tbody is the
     viewport, so rows are clipped at the header's lower edge rather than
     being painted underneath its transparent frost. */
  #v-cs #crewTable, :is(#v-lc, #v-eq) table.track, #v-ex table.track, #v-rc table.track, #v-cliInv table.track, #v-ctiInv table.track, .ov-scroll .cf-forecast-scroll table.track, table.track , .ov-scroll .cf-forecast-scroll table.track {
    display: table; width: max-content; min-width: 100%; table-layout: auto;
  }
  #v-cs #crewTable thead, :is(#v-lc, #v-eq) table.track thead, #v-ex table.track thead, #v-rc table.track thead, #v-cliInv table.track thead, #v-ctiInv table.track thead, .ov-scroll .cf-forecast-scroll table.track thead, table.track thead , .ov-scroll .cf-forecast-scroll table.track thead { display: table-header-group; }
  #v-cs #crewTable tbody, :is(#v-lc, #v-eq) table.track tbody, #v-ex table.track tbody, #v-rc table.track tbody, #v-cliInv table.track tbody, #v-ctiInv table.track tbody, .ov-scroll .cf-forecast-scroll table.track tbody, table.track tbody , .ov-scroll .cf-forecast-scroll table.track tbody { display: table-row-group; }
  #v-cs #crewTable tbody tr, :is(#v-lc, #v-eq) table.track tbody tr, #v-ex table.track tbody tr, #v-rc table.track tbody tr, #v-cliInv table.track tbody tr, #v-ctiInv table.track tbody tr, .ov-scroll .cf-forecast-scroll table.track tbody tr, table.track tbody tr , .ov-scroll .cf-forecast-scroll table.track tbody tr { display: table-row; }
  /* The table IS the frosted panel: translucent background + blur only inside
     the table bounds. The scroll root stays transparent with no blur so empty
     gutters and space below the sheet stay clear. */
  #v-cs .cs-scroll, :is(#v-lc, #v-eq) .it-scroll, #v-ex .exp-scroll, #v-cliInv .cli-inv-scroll, #v-ctiInv .cti-inv-scroll, #v-rc .rc-scroll, .ov-scroll .cf-forecast-scroll, .ov-scroll .cf-forecast-scroll { background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; }
  /* Every company sheet rests on the surface the way a panel does: the same
     cast below and glow above that `.master-totals` and the filter controls
     wear. The lift sits on the sheet's own frame — the scroll root for the
     tracker registers, the realized strip for the bank summary — so one box
     paints it and the four-pixel corner matches the corner cells. The cashflow
     frame holds two panels and casts nothing itself; its halves are painted in
     §4 under the forecast plot. */
  #v-cs .cs-scroll, :is(#v-lc, #v-eq) .it-scroll, #v-ex .exp-scroll, #v-cliInv .cli-inv-scroll, #v-ctiInv .cti-inv-scroll, #v-rc .rc-scroll,
  .ov-scroll .ov-realized-scroll.cf-split-panel {
    box-shadow: var(--hg-shadow-lift);
    border-radius: 4px;
  }
  .ov-scroll .cf-split-panel { border-radius: 4px; }
  #v-cs #crewTable, :is(#v-lc, #v-eq) table.track, #v-ex table.track, #v-cliInv table.track, #v-ctiInv table.track, #v-rc table.track, .ov-scroll .cf-forecast-scroll table.track, table.track , .ov-scroll .cf-forecast-scroll table.track { background: transparent; }
  #v-cs #crewTable tbody, :is(#v-lc, #v-eq) table.track tbody, #v-ex table.track tbody, #v-cliInv table.track tbody, #v-ctiInv table.track tbody, #v-rc table.track tbody, .ov-scroll .cf-forecast-scroll table.track tbody, table.track tbody , .ov-scroll .cf-forecast-scroll table.track tbody {
    background: var(--hg-frost-bg); background-clip: padding-box;
    backdrop-filter: blur(var(--hg-frost-blur-soft)); -webkit-backdrop-filter: blur(var(--hg-frost-blur-soft));
  }
  /* Sheet corners: border-radius is INERT on tbody in Chromium — the old
     `border-radius: 0 0 4px 4px` above never rendered (pixel-probed
     2026-09-07). The radius must sit on the corner CELLS to clip the wash.
     Top corners are the header row's th — in a real thead (static tables)
     or as the first tbody tr (factory + Crew render the header inside the
     tbody). Bottom corners are the last row's outermost cells. Geometry is
     theme-independent: one rule set serves light + dark. */
  table.track > thead th:first-child, #crewTable > thead th:first-child,
  table.track > tbody > tr:first-child > th:first-child, #crewTable > tbody > tr:first-child > th:first-child { border-top-left-radius: 4px; }
  table.track > thead th:last-child, #crewTable > thead th:last-child,
  table.track > tbody > tr:first-child > th:last-child, #crewTable > tbody > tr:first-child > th:last-child { border-top-right-radius: 4px; }
  table.track > tbody > tr:last-child > td:first-child, #crewTable > tbody > tr:last-child > td:first-child { border-bottom-left-radius: 4px; }
  table.track > tbody > tr:last-child > td:last-child, #crewTable > tbody > tr:last-child > td:last-child { border-bottom-right-radius: 4px; }
  table.track td, #crewTable td { padding: 5px 10px; border-bottom: 1px solid var(--hg-border-cell); }
  /* Row highlight: same ONE token as the header (--hg-frost-head). */
  #v-cs #crewTable tbody tr:hover td,
  :is(#v-lc, #v-eq) table.track tbody tr:hover td,
  #v-ex table.track tbody tr:hover td,
  #v-rc table.track tbody tr:hover td,
  #v-cliInv table.track tbody tr:hover td,
  #v-ctiInv table.track tbody tr:hover td,
  .ov-scroll .cf-forecast-scroll table.track tbody tr:hover td, table.track tbody tr:hover td , .ov-scroll .cf-forecast-scroll table.track tbody tr:hover td:hover td {
    background: var(--hg-frost-hover);
    /* One pass per sheet: the tbody owns the frost, so a hovered row paints
       its wash only. A second blur on each of its cells cannot change pixels
       over a surface that is already blurred, but it makes every cell its own
       raster region — then a repaint bakes some cells and leaves the rest
       stale, and the sheet bands. */
    backdrop-filter: none; -webkit-backdrop-filter: none;
  }
  .st { font-size: var(--hg-type-micro); padding: 1px 8px; border-radius: 3px; white-space: nowrap; }
  /* Crew rows: the open (expanded) person row paints the table-header
     colour (--hg-frost-head), not the hover tint — the row IS the header
     of its own panels, like a breakdown segment. */
  #v-cs #crewTable tr.cs-row.open td,
  #v-cs #crewTable tr.cs-row.open:hover td {
    background: var(--hg-frost-head);
    backdrop-filter: none; -webkit-backdrop-filter: none;
  }
  .st-ip { background: var(--st-ip-bg); color: var(--st-ip-ink); }
  .st-wtg { background: var(--st-wtg-bg); color: var(--st-wtg-ink); }
  .st-rev { background: var(--st-rev-bg); color: var(--st-rev-ink); }
  .st-cmpt { background: var(--st-cmpt-bg); color: var(--st-cmpt-ink); }
  .st-appr { background: var(--st-appr-bg); color: var(--st-appr-ink); }
  .st-reopen { background: var(--st-reopen-bg); color: var(--hg-danger-hover); }
  .linked { color: var(--hg-text-ink); font-weight: 600; cursor: pointer; }
  .linked:hover { text-decoration: underline; }
  .badge-seed { font-size: var(--hg-type-9); color: var(--hg-text-dim); }
  .shot-grp td { background: #f4f4f4; font-weight: 600; font-size: var(--hg-type-small); letter-spacing: .02em; color: #6a6a72; padding: 6px 10px; }
  .mine { outline: 2px solid #2e9e5b44; outline-offset: -2px; background: #f4faf6 !important; }

  /* ===== 4a. tracker table segment edge (vars from §1) ===== */
  /* data-seg rows get the lightest tint as a subtle left-edge + background wash */
  table.track tr[data-seg] td { background: color-mix(in srgb, var(--seg-accent) var(--hg-stage-op), transparent); border-left: 3px solid var(--seg-accent); }
  table.track tr[data-seg] td:first-child { border-left: 3px solid var(--seg-accent); }
  /* No hover wash lift on tracker rows: mouse-over is the glow only, and a
     table row has no box-shadow halo available — so hover changes nothing. */

  /* ===== 4b. bid table ===== */
  /* Full width; 20px breathing room left/right inside every scroll root so
     content never touches the scrollbar gutter or the window edge. The root
     itself fills the view so its scrollbar rides the window's right edge.
     NO top padding: sticky children (hg-lane, table headers) pin at top:0 of
     the scrollport, so a padding-top would leave them parked in an invisible
     gap below the filter bar instead of flush under it. */
  .bidwrap { width: 100%; box-sizing: border-box; padding: 0 20px 60px; }
  .summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin-bottom: 28px; border-top: 1px solid var(--hg-border-row); border-bottom: 1px solid var(--hg-border-row); }
  .sum-card { background: transparent; border: none; border-right: 1px solid var(--hg-border-row); border-radius: 0; padding: 16px 18px 14px; }
  .sum-card:last-child { border-right: none; }
  .sum-card .l { font-size: var(--hg-type-small); color: var(--hg-text-muted); letter-spacing: .02em; margin-bottom: 6px; text-transform: none; }
  .sum-card .v { font-size: var(--hg-type-display); font-weight: 600; letter-spacing: -.02em; margin-top: 0; font-variant-numeric: tabular-nums; }
  .sum-card .s { font-size: var(--hg-type-11); color: var(--hg-text-muted); margin-top: 3px; }
  .sum-card.total { background: transparent; border-color: var(--hg-border-row); }
  .sum-card.total .l, .sum-card.total .s { color: var(--hg-text-muted); }
  .sum-card.total .v { color: var(--hg-accent); }
  table.bid { width: 100%; border-collapse: collapse; background: var(--hg-surface-input); }
  table.bid .dept td { background: #f4f4f4; font-weight: 600; font-size: var(--hg-type-11); letter-spacing: .02em; color: #6a6a72; padding: 7px 10px; border-top: 1px solid var(--hg-border-row); }
  table.bid .dept td .tots { float: right; font-weight: 600; color: var(--hg-text-ink); letter-spacing: 0; }
  table.bid td { padding: 4px 10px; border-bottom: 1px solid var(--hg-hairline); }
  table.bid tr.line:hover td { background: #f6f6f6; }
  .c-name { width: 40%; } .c-stage { width: 28%; color: var(--hg-text-secondary); }
  .c-days { width: 10%; text-align: right; font-variant-numeric: tabular-nums; }
  .c-plan { width: 12%; text-align: right; font-variant-numeric: tabular-nums; color: var(--hg-text-secondary); }
  .c-src { width: 10%; text-align: right; }
  table.bid .subtotal td { background: var(--hg-surface-raised); font-weight: 600; border-top: 1px solid var(--hg-border-row); font-variant-numeric: tabular-nums; }
  table.bid .grand td { background: var(--hg-accent); color: var(--hg-text-on-accent); font-weight: 700; padding: 8px 10px; }
  .src { font-size: var(--hg-type-10); padding: 1px 7px; border-radius: 3px; }
  .src-agent { background: #e2ecf7; color: #2a5a8a; }
  .src-human { background: #eee9dc; color: #7a6f4d; }
  .src-delta { background: #f6e2d0; color: #b05a1e; }
  .delta td { background: #fdf3ec; } .delta .c-name { color: #b05a1e; }
  td.editable { cursor: text; } td.editable:hover { background: var(--hg-surface-elevated); }
  td.editing { background: #fff8e6; outline: 2px solid #d9b345; outline-offset: -2px; }
  .add-line { width: 100%; text-align: left; border: none; background: none; cursor: pointer; color: var(--hg-text-muted); font-size: var(--hg-type-11); padding: 5px 10px; border-bottom: 1px solid var(--hg-hairline); }
  .add-line:hover { color: var(--hg-text-ink); background: #faf8f0; }
  /* Toasts float ABOVE the bottom gutter: the gutter holds the info line only. */
  .toast { position: fixed; bottom: calc(var(--hg-tracker-side-padding) + 18px); left: 50%; transform: translateX(-50%); background: var(--hg-accent); color: var(--hg-text-on-accent); padding: 8px 18px; border-radius: 3px; font-size: var(--hg-type-base); display: none; z-index: 90; }

  /* ===== 4c. breakdown — hg-entity-block tree + filters + modal ===== */
  .btn-new {
  border: 1px solid color-mix(in srgb, var(--seg-accent) 45%, rgba(255,255,255,.3)); background: color-mix(in srgb, var(--seg-accent) 25%, transparent); color: var(--hg-text-ink);
  border-radius: 4px; padding: 4px 13px; font-size: var(--hg-type-small); font-weight: 500;
  letter-spacing: .03em; text-transform: uppercase; cursor: pointer;
}
.btn-new:hover { background: color-mix(in srgb, var(--seg-accent) 35%, transparent); }
.btn-new:active { box-shadow: inset 0 1px 3px #00000018; transform: translateY(1px); }
.btn-new.hg-confirm-danger { background: var(--hg-danger); border-color: var(--hg-danger); color: var(--hg-text-on-accent); }
.btn-new.hg-confirm-danger:hover { background: var(--hg-danger-hover); }
  .btn-ghost {
  border: 1px solid color-mix(in srgb, var(--seg-accent) 45%, rgba(255,255,255,.3)); background: color-mix(in srgb, var(--seg-accent) 25%, transparent);
  border-radius: 4px; padding: 4px 13px; font-size: var(--hg-type-small); font-weight: 500;
  letter-spacing: .03em; text-transform: uppercase; cursor: pointer; color: var(--hg-text-ink);
}
.btn-ghost:hover { background: color-mix(in srgb, var(--seg-accent) 35%, transparent); border-color: color-mix(in srgb, var(--seg-accent) 55%, rgba(255,255,255,.3)); color: var(--hg-text-ink); }
.btn-ghost:active { box-shadow: inset 0 1px 3px #00000018; transform: translateY(1px); }
  .seg-block { margin-bottom: 14px; }
  /* Sticky within the Breakdown panel's scroll root (.bidwrap): the open
     segment's header parks at the top while its card list scrolls — always
     reachable to roll the segment back up. Same rule as table.track th
     inside their scrollers. Gantt rows are NOT sticky (the base .hg-lane
     above is static); the gantt label pane re-declares its own parking. */
  .hg-lane {
      /* The hint track is THE compressible space: it collapses to zero before
         anything else on the line may move (founder law 2026-09-20). A floor
         here pushed meta + buttons off-window on narrow viewports. */
      display: grid; grid-template-columns: 18px auto minmax(0, 1fr) 118px auto;
      align-items: baseline; column-gap: 12px; padding: 6px 0;
      /* position: static in the GANTT chart pane — the lane-side rows must
         scroll away with the chart (the week header band is the only sticky
         thing there). The Breakdown panel's sticky parking is scoped to
         .seg-block .hg-lane below; the gantt label pane re-scopes its own. */
      position: static; z-index: auto;
      /* Opaque page base first — wash alone is translucent and list rows would bleed */
      background: var(--hg-frost-head); border: none; border-radius: 0; cursor: pointer; user-select: none;
      font-weight: 600; font-size: var(--hg-type-medium); letter-spacing: -.01em; color: var(--hg-text-ink); margin-bottom: 0;
      box-shadow: var(--hg-shadow-sm);
      /* Row paint and hover are owned by §7 (data-seg rows) — this base keeps
         the transform transition only. */
      transition: transform .25s cubic-bezier(.22,1,.36,1), filter .25s cubic-bezier(.22,1,.36,1);
    }
    .seg-block .hg-lane {
      position: sticky; top: 0; z-index: 33;
  }
  /* Row caret — ONE control for every row that opens: Breakdown lanes and
     deliverables, Board lanes and deliverables, the crew sheet. It is a fixed
     square with the glyph centred inside it, so the open-state rotate turns the
     arrow about its own centre. A bare text span centres nothing: the glyph's
     side bearing parks the ink at the left of the box, and rotating about the
     box centre swings the arrow up-left — it reads as a pivot on its tip. */
  .tw {
    display: inline-flex; align-items: center; justify-content: center;
    flex: 0 0 auto; width: 14px; height: 14px;
    color: var(--hg-text-muted); font-size: var(--hg-type-11); line-height: 1;
    transform-origin: 50% 50%;
    transition: transform .12s;
  }
    .seg-block.open > .hg-lane .tw { transform: rotate(90deg); }
    /* inline rename — shrinks to fit text content so only the actual characters
       are clickable; clicks on the surrounding header open the hg-stage. */
    .hg-lane .seg-name-input {
    min-width: 0; max-width: 200px; font: inherit; font-weight: 600; color: inherit; letter-spacing: inherit;
    background: transparent; border: 1px solid transparent; border-radius: 3px; box-sizing: border-box;
    padding: 0; margin: -1px 0 0 -5px; cursor: text;
    }
    .hg-lane .seg-name-input, .hg-lane .seg-name-input:focus, .hg-lane .seg-name-input:hover { background: transparent; }
    .hg-lane .seg-name-input:hover { border-color: #c8ccd5; }
    .hg-lane .seg-name-input:focus { border-color: #c5c9d1; outline: none; }
    /* Action clusters: ONE control (.mv-btn / .danger), ONE wrapper (.row-actions),
       ONE number (--row-actions-gap) for every distance in the cluster. */
    :root { --row-actions-gap: 5px; }
    .row-actions { display: inline-flex; gap: var(--row-actions-gap); padding-right: var(--row-actions-gap); align-self: center; }
  .mv-btn {
    border: none; background: none; cursor: pointer; font-size: var(--hg-type-base); line-height: 1;
    padding: 2px 0; color: var(--hg-text-muted);
  }
  .mv-btn:hover { color: var(--hg-text-ink); }
  html.dark .mv-btn { color: var(--hg-text-muted); }
  html.dark .mv-btn:hover { color: var(--hg-text-bright); }
  .mv-btn.danger:hover { color: var(--hg-danger-ink); }
  html.dark .mv-btn.danger:hover { color: var(--hg-danger-ink); }
  .hg-lane .seg-meta { justify-self: start; font-weight: 600; color: var(--hg-text-ink); font-variant-numeric: tabular-nums; font-size: var(--hg-type-base); letter-spacing: 0; white-space: nowrap; }
  .hg-lane .seg-hint { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 400; color: var(--hg-text-muted); font-size: var(--hg-type-11); letter-spacing: 0; justify-self: end; text-align: right; }
  .seg-body { display: none; padding-left: 16px; }
  /* Bottom "+ New" row inside each hg-stage — keeps empty lanes from being bare
     and puts the add button where new items will append. The two actions wear
     the plain .task-add link style, matching the "Add Lane" footer button. */
  .seg-new-row { padding: 8px 0 4px; display: flex; align-items: baseline; gap: 16px; }
  /* The lane's add row closes the list: the last deliverable card draws no
     bottom rule, so no hairline hangs over the add row, or into the 16px
     gutter left of the card body. */
  .seg-block .seg-body > .hg-entity-block:has(+ .seg-new-row) { border-bottom: none; }
  /* segment management footer — add button + hidden restore tray */
  /* Entity/task card wrappers (founder law 2026-09-20):
     .a-tail groups sup + days/money + actions so the cluster wraps to a second
     row as ONE unit when the entity line runs out of room (ample width is
     unchanged — the auto margin just moved from .a-owner to the tail).
     .t-ctrl groups a task row's rigid control cluster (markup in breakdown.js);
     it is a rigid right-aligned full-row box at EVERY width (two-line
     system) — no display:contents anywhere. */
  .asset-tree .hg-entity { flex-wrap: wrap; }
  .asset-tree .hg-entity .a-tail { display: inline-flex; align-items: center; gap: 10px; margin-left: auto; }
  .seg-footer { margin-top: 10px; padding-left: 30px; display: flex; flex-direction: column; gap: 6px; }
  .seg-footer-row { display: flex; align-items: baseline; width: 100%; }
  .seg-footer-left { display: inline-flex; align-items: baseline; gap: 16px; }
  .seg-hidden-toggle { border: none; background: none; cursor: pointer; color: var(--hg-text-muted); font-size: var(--hg-type-11); padding: 2px 0; }
  .seg-hidden-toggle:hover { color: var(--hg-text-ink); }
  .seg-hidden-list { display: flex; flex-direction: column; gap: 2px; padding-left: 8px; }
  .seg-hidden-row { display: flex; align-items: center; gap: 8px; font-size: var(--hg-type-base); color: #6f7076; }
  .seg-hidden-row .sw { font-size: var(--hg-type-9); }
  .seg-hidden-row .seg-restore { border: 1px solid var(--hg-border-control); background: var(--hg-surface-input); border-radius: 4px; font-size: var(--hg-type-11); padding: 1px 8px; cursor: pointer; color: var(--hg-text-ink); }
  .seg-hidden-row .seg-restore:hover { border-color: var(--hg-border-hover); color: var(--hg-text-ink); }
  .seg-hidden-row .seg-delete { border: 1px solid #e0b3ad; background: var(--hg-surface-input); border-radius: 4px; font-size: var(--hg-type-11); padding: 1px 8px; cursor: pointer; color: var(--hg-danger-hover); }
  .seg-hidden-row .seg-delete:hover { border-color: var(--hg-danger); color: var(--hg-danger); }
  .seg-block.open > .seg-body { display: block; }
  .hg-entity-block { background: transparent; border: none; border-bottom: 1px solid var(--seg-rule); border-radius: 0; margin-bottom: 0; overflow: visible; }
  .hg-entity { display: flex; align-items: center; gap: 10px; padding: 7px 0; cursor: pointer; user-select: none;
    transition: transform .25s cubic-bezier(.22,1,.36,1), filter .25s cubic-bezier(.22,1,.36,1), background .06s ease-out; }
  /* ── breakdown selection ────────────────────────────────────────────────
     The tick is the shared native checkbox (the §10 box rule owns every pixel
     of it). These rules are the hit area around the box and the row's ticked
     paint only. */
  .a-tick, .lane-tick { display: inline-flex; align-items: center; justify-content: center;
    flex: 0 0 auto; padding: 4px; margin: -4px; cursor: pointer; }
  .lane-tick { align-self: center; }
  /* A finger needs a bigger target than a pointer, and the box stays 12px. */
  @media (pointer: coarse) { .a-tick, .lane-tick { padding: 9px; margin: -9px; } }
  /* The extra track belongs to the TICK, not to the tree: only a lane head
     that carries the selection box takes the six-track line. The gantt label
     pane shares .hg-lane and keeps the base five-track line, and so does a
     tree lane head with no tick (Board), so its totals and its eye sit in the
     same tracks as everywhere else. */
  .asset-tree .hg-lane:has(.lane-tick) { grid-template-columns: 18px auto auto minmax(0, 1fr) 118px auto; }
  /* The ticked row keeps the row's own two-layer paint and only turns the wash
     up, so the selection reads as the same surface, deeper. The spine is the
     marker, not a restyle. */
  .asset-tree .hg-entity-block.ticked .hg-entity {
    --hg-entity-op: 42%;
    box-shadow: inset 3px 0 0 var(--seg-accent), var(--hg-ent-drop, 0 0 0 transparent);
  }
  .hg-entity-block.open .hg-entity .tw { transform: rotate(90deg); }
  .hg-entity .a-name { font-weight: 500; font-size: var(--hg-type-12h); }
  .hg-entity .a-name-input {
    font: inherit; font-weight: 500; font-size: var(--hg-type-12h);
    color: inherit; background: transparent; border: 1px solid transparent;
    border-radius: 4px; padding: 1px 4px; margin: -1px -4px;
    min-width: 60px; width: auto;
  }
  .hg-entity .a-name-input:hover { border-color: var(--hg-border-control); background: var(--hg-surface-input); }
  .hg-entity .a-name-input:focus { border-color: var(--hg-accent); background: var(--hg-surface-input); outline: none; }
  html.dark .hg-entity .a-name-input { color: inherit; background: transparent; border-color: transparent; }
  html.dark .hg-entity .a-name-input:hover { border-color: var(--hg-border-control); background: var(--hg-surface-raised); }
  html.dark .hg-entity .a-name-input:focus { border-color: var(--hg-border-focus); background: var(--hg-surface-raised); }
  .hg-entity .a-type { font-size: var(--hg-type-small); color: var(--hg-text-muted); background: transparent; padding: 0; border-radius: 0; }
  .hg-entity .a-owner { margin-right: 15px; display: flex; align-items: center; }
  .hg-entity .a-owner-label { font-size: var(--hg-type-10); color: var(--hg-text-muted); margin-right: 6px; }
  .hg-entity .a-days { font-weight: 600; color: var(--hg-text-ink); font-variant-numeric: tabular-nums; }
  .hg-entity-body { display: none; border-top: 1px solid var(--seg-rule); padding: 4px 10px 8px 8px; margin-left: 16px; background: var(--seg-edge), color-mix(in srgb, var(--seg-accent) var(--hg-stage-op), transparent); }
  .hg-entity-block.open .hg-entity-body {
    display: grid;
    /* THE shared column tracks: every stage row + the totals row align to these.
       The stage rows and the card-actions row are flex layouts of their own
       (two-line system, founder law 2026-09-20) and no longer subgrid into
       these tracks — the explicit template is released so the body can never
       be wider than the window; children span the single implicit column. */
    grid-template-columns: none;
    gap: 0 10px;
  }
  .hg-entity-body > * { min-width: 0; }
  /* number input spinner arrows — kill globally (Chrome/Safari/Firefox) */
  input[type=number]::-webkit-outer-spin-button,
  input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
  input[type=number] { -moz-appearance: textfield; appearance: textfield; }

  .asset-tree .hg-stage { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 4px 0 4px var(--hg-rail-inset); border-bottom: 1px solid var(--seg-rule); justify-content: flex-start; }
  /* Breakdown drag reorder: the grabbed bar lifts onto a fixed copy that
     follows the pointer, its own layout box becomes the open slot, and the
     rows it crosses slide aside to make room. */
  .bd-drag-src { visibility: hidden; }
  .bd-reflow { transition: transform .16s cubic-bezier(.22,1,.36,1); }
  /* The copy is the row itself with nothing added: no fill, no blur, no frost
     of its own. It casts NO shadow either — an invisible box would draw a
     plate edge where there is no surface. Only a painted surface keeps a
     shadow, and the lane bar throws its own a little further off. */
  .bd-drag-ghost { position: fixed; z-index: 96; pointer-events: none; margin: 0;
    visibility: visible; cursor: grabbing; background: none; box-shadow: none; }
  .bd-drag-ghost .hg-lane { box-shadow: var(--hg-drop-accent-lift); }
  body.bd-dragging, body.bd-dragging * { cursor: grabbing; }
  .crew-pick { border: 1px solid var(--hg-border-control); border-radius: 4px; font-size: var(--hg-type-11); height: 22px; box-sizing: border-box; padding: 2px 6px; background-color: var(--hg-surface-input); color: var(--hg-text-ink); width: 120px; }
  .crew-pick.un { color: var(--hg-danger-ink); border-color: #e3b8ae; background: #fdf3ec; }
  .owner-pick { border: 1px solid var(--hg-border-control); border-radius: 4px; font-size: var(--hg-type-11); height: 22px; box-sizing: border-box; padding: 2px 6px; background-color: var(--hg-surface-input); color: var(--hg-text-ink); width: 120px; }
  .owner-pick.un { color: var(--hg-text-muted); border-color: #e8e8ec; background: #fafafb; }
  .asset-tree .hg-stage .cost-model-pick { font-size: var(--hg-type-11); height: 22px; box-sizing: border-box; max-width: 96px; min-width: 0; padding: 2px 16px 2px 6px; }
  .asset-tree .hg-stage .t-model { display: flex; align-items: center; gap: 6px; min-width: 0; }
  .asset-tree .hg-stage .t-crew { display: flex; align-items: center; gap: 4px; min-width: 0; }
  .asset-tree .hg-stage .t-model-inputs { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
  .asset-tree .hg-stage .t-note { min-width: 0; align-self: start; padding-top: 1px; }
  .asset-tree .hg-stage .t-note-input { box-sizing: border-box; width: 100%; min-height: 22px; font-size: var(--hg-type-11); line-height: 1.4; border: 1px solid transparent; border-radius: 4px; padding: 2px 6px; background: var(--hg-input-bg); color: var(--hg-text-secondary); resize: none; overflow: hidden; font-family: inherit; }
  .asset-tree .hg-stage .t-note-input::placeholder { color: #c4c4cc; }
  .asset-tree .hg-stage .t-note-input:hover { border-color: var(--hg-border-control); }
  .asset-tree .hg-stage .t-note-input:focus { outline: none; border-color: var(--hg-border-focus); color: var(--hg-text-ink); }
  .asset-tree .hg-stage .t-model-inputs input { box-sizing: border-box; width: 60px; min-width: 0; height: 22px; text-align: right; font-size: var(--hg-type-11); font-weight: 500; font-variant-numeric: tabular-nums; border: 1px solid var(--hg-border-control); border-radius: 4px; padding: 2px 6px; background: var(--hg-input-bg); color: var(--hg-text-ink); -webkit-appearance: none; -moz-appearance: textfield; appearance: none; }
  .asset-tree .hg-stage .t-model-inputs input:focus { outline: none; border-color: var(--hg-border-focus); }
  .asset-tree .hg-stage .t-model-inputs input.t-cost-fixed { width: 90px; }
  /* formula model: pen (edit) icon on the dropdown row + inline input cells */
  .f-edit-pen { border: none; background: transparent; cursor: pointer; font-size: var(--hg-type-11);
    color: var(--hg-text-secondary); padding: 2px 4px; line-height: 1; border-radius: 3px; }
  .f-edit-pen:hover { background: var(--hg-surface-raised); color: var(--hg-text-ink); }
  /* formula popup editor (2-row strip) */
  .fx-strip { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 4px; margin: 10px 0 4px; }
  .fx-cell { display: inline-flex; flex-direction: column; gap: 2px; }
  /* Reusable standalone form surface; no app chrome or fixed scroll root. */
  html.hg-standalone { min-height: 100%; }
  html.hg-standalone::after { display: none; }
  .hg-standalone body {
    height: auto; min-height: 100vh; min-height: 100dvh;
    overflow: auto; position: static; padding: 24px 16px;
  }
  .hg-standalone-card {
    background: var(--hg-surface-input); color: var(--hg-text-ink);
    border: 1px solid var(--hg-border-control); border-radius: var(--hg-input-radius);
  }
  html.dark .hg-standalone-card { color: var(--hg-text-bright); }
  .hg-standalone-card h1 {
    font-size: var(--hg-type-18); font-weight: var(--hg-weight-semibold);
    line-height: 1.3;
  }
  .hg-wordmark {
    color: var(--hg-accent); font-size: var(--hg-type-large);
    font-weight: var(--hg-weight-bold); letter-spacing: -.02em;
  }
  .hg-form-label { color: var(--hg-text-ink); font-weight: var(--hg-weight-medium); }
  html.dark .hg-form-label { color: var(--hg-text-bright); }
  .hg-form-note { color: var(--hg-text-muted); line-height: 1.6; }
  .hg-form-group { border: none; min-width: 0; }
  a.hg-ctl { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }

  /* Agent authorization geometry only; paint comes from shared hg primitives.
     These serve the standalone consent page, which the server renders
     (agent_http.py); .ac-action is its box shape only. The Settings pane uses
     .block-btn. */
  .ac-auth { width: 100%; max-width: 440px; margin: auto; padding: 24px; display: grid; gap: 16px; overflow-wrap: anywhere; }
  .ac-auth .ac-form { margin: 0; gap: 8px; }
  .ac-summary { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 16px; }
  .ac-summary dd { min-width: 0; }
  .ac-projects { display: grid; gap: 8px; margin: 8px 0; }
  .ac-projects legend { margin-bottom: 8px; }
  .ac-project-row { display: flex; align-items: flex-start; gap: 10px; padding: 6px 0; cursor: pointer; }
  .ac-project-row input { flex: 0 0 auto; margin-top: 2px; }
  .ac-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
  .ac-action { min-height: 34px; padding: 7px 14px; cursor: pointer; }

  /* A bordered group inside a pane: one box that holds a record set or the
     controls that belong together. It draws the group edge only — a pane's
     records are not a surface, so the sheet shows through and no fill is
     invented. Box shape belongs to the caller. */
  .hg-group { border: 1px solid var(--hg-border-control); border-radius: 4px; padding: 10px 12px; }
  /* ONE shared input-control definition (border/bg/type/focus/hover-state) — every per-surface variant below only restates box shape (width/height/padding). Add `.hg-ctl` to the markup. */
  .hg-ctl { box-sizing: border-box; font-size: var(--hg-type-11); border: 1px solid var(--hg-border-control); border-radius: 4px; background-color: var(--hg-input-bg); color: var(--hg-input-ink); }
  input[type="time"].hg-ctl { width: 82px; min-height: 22px; padding: 1px 6px; font: inherit; }
  /* Absence controls reuse hg-ctl and the shared hg-menu/calendar engines. */
  .hg-absence-icon { width: 22px; height: 22px; padding: 2px; flex: 0 0 auto; }
  .hg-absence-icon:first-of-type { margin-left: auto; }
  .hg-absence-icon svg { width: 100%; height: 100%; display: block; }
  .hg-absence-field .hg-date { width: 132px; padding: 4px 8px; }
  .hg-absence-pending { display: flex; min-width: 0; overflow-x: auto; gap: 6px; max-width: 45%; }
  .hg-absence-pending:empty { display: none; }
  .hg-absence-pending .hg-ctl { flex: 0 0 auto; white-space: nowrap; }
  /* Reusable schedule hatch primitive; no opaque layer hides assigned effort. */
  .hg-absence-hatch { --hg-absence-ink: var(--hg-absence-neutral); position: absolute; top: 2px; bottom: 2px; padding: 0; border: 0; border-radius: 0; cursor: pointer; z-index: 2; background: repeating-linear-gradient(135deg, transparent 0 4px, color-mix(in srgb, var(--hg-absence-ink) 65%, transparent) 4px 7px); }
  .hg-absence-hatch.is-clear { --hg-absence-ink: var(--hg-absence-clear); box-shadow: inset 0 0 5px color-mix(in srgb, var(--hg-absence-clear) 40%, transparent); }
  .hg-absence-hatch.is-conflict { --hg-absence-ink: var(--hg-danger); box-shadow: inset 0 0 5px color-mix(in srgb, var(--hg-danger) 40%, transparent); }
  .hg-absence-hatch:focus-visible { outline: 1px solid var(--hg-border-focus); outline-offset: -1px; }
  .hg-ctl:focus { outline: none; border-color: var(--hg-border-focus); }
  .hg-ctl:disabled { opacity: .55; cursor: not-allowed; }
  /* Accent-filled action variant of the shared control — the same fill the
     forms give their primary action. */
  .hg-ctl.accent { background: var(--hg-accent); border-color: var(--hg-accent); color: var(--hg-text-on-accent); }
  .hg-ctl.hollow { border-color: transparent; border-radius: 3px; background: transparent; color: var(--hg-text-muted); }
  .hg-ctl.hollow:hover { border-color: var(--hg-border-control); background: var(--hg-surface-input); }
  .hg-ctl.hollow:focus { outline: none; border-color: var(--hg-border-focus); background: var(--hg-surface-input); color: var(--hg-text-ink); }
  .fx-cell input.fx-val { width: 74px; height: 24px; text-align: right;
    font-variant-numeric: tabular-nums; font-weight: 500;
    padding: 2px 6px; }
  .fx-cell input.fx-lab { width: 74px; height: 18px; font-size: var(--hg-type-tiny);
    padding: 1px 5px; }
  .fx-typerow { display: inline-flex; align-items: center; gap: 2px; }
  .fx-type { font-size: var(--hg-type-tiny); height: 16px; box-sizing: border-box; padding: 0 14px 0 5px;
    color: var(--hg-text-muted); }
  .fx-type:hover { border-color: var(--hg-border-control); background: var(--hg-surface-input); }
  .fx-cell.fx-bind .fx-type { width: 120px; }
  .fx-cell.fx-bind .fx-val { width: 120px; text-align: left; color: var(--hg-info); }
  .fx-cell.fx-bind .fx-val.un { color: var(--hg-danger-ink); }
  .fx-cell.fx-bind input.fx-lab { width: 120px; }
  .fx-op { border: 1px solid var(--hg-border-control); background: var(--hg-surface-raised); border-radius: 4px;
    height: 24px; width: 24px; box-sizing: border-box; font-size: var(--hg-type-12h); color: var(--hg-text-secondary);
    cursor: pointer; user-select: none; }
  .fx-op:hover { color: var(--hg-text-ink); background: var(--hg-surface-raised); }
  .fx-del { border: none; background: transparent; cursor: pointer; color: var(--hg-text-dim);
    font-size: var(--hg-type-11); padding: 0 2px; height: 24px; }
  .fx-del:hover { color: var(--hg-danger-ink); }
  .fx-add { border: 1px dashed var(--hg-border-control); background: transparent; border-radius: 4px;
    height: 24px; min-width: 24px; box-sizing: border-box; color: var(--hg-text-secondary); cursor: pointer;
    font-size: var(--hg-type-12h); }
  .fx-add:hover { color: var(--hg-text-ink); background: var(--hg-surface-raised); }
  .fx-result { margin-left: auto; display: inline-flex; align-items: baseline; gap: 5px;
    font-variant-numeric: tabular-nums; font-weight: 600; font-size: var(--hg-type-12h); color: var(--hg-text-bright); }
  .fx-result .fx-cur { color: var(--hg-text-dim); font-weight: 400; }
  .fx-result.fx-invalid { color: var(--hg-danger-ink); font-weight: 500; }
  .fx-bind-pattern { margin-top: 2px; }
  .fx-bind-pattern input { width: 120px; height: 18px; font-size: var(--hg-type-tiny);
    padding: 1px 5px; }
  /* The duration stepper sits on the lane-tinted card body: its two buttons keep
     an open face so the row's wash shows through, with their border mixed from
     the lane accent (the law the row's tick follows, input.hg-check-substrate).
     The duration cell between them is an editable field and wears the same fill
     as every other field on a stage row. */
  .t-spinner { display: flex; align-items: center; gap: 0; }
  .t-spinner .sp { border: 1px solid var(--seg-rule, var(--hg-border-control)); background: transparent; width: 26px; height: 22px; display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: var(--hg-type-base); color: var(--hg-text-secondary); user-select: none; }
  .t-spinner .sp:hover { background: color-mix(in srgb, var(--seg-accent, var(--hg-accent)) 14%, transparent); border-color: color-mix(in srgb, var(--seg-accent, var(--hg-accent)) 80%, var(--hg-border-focus)); color: var(--hg-text-ink); }
  .t-spinner .sp:first-child { border-radius: 4px 0 0 4px; border-right: none; }
  .t-spinner .sp:last-child { border-radius: 0 4px 4px 0; border-left: none; }
  .t-spinner .t-days { border-top: 1px solid var(--seg-rule, var(--hg-border-control)); border-bottom: 1px solid var(--seg-rule, var(--hg-border-control)); background: var(--hg-input-bg); color: var(--hg-input-color); width: 30px; height: 22px; box-sizing: border-box; text-align: center; font-size: var(--hg-type-11); line-height: 20px; padding: 0; font-variant-numeric: tabular-nums; cursor: text; }
  .t-spinner .t-days.last-bar { width: 52px; }
  .t-cost { text-align: right; font-variant-numeric: tabular-nums; color: var(--hg-text-ink); font-weight: 600; font-size: var(--hg-type-11); }
  .t-cost.t1-badge { position: relative; }
  .t-cost.t1-badge::after { content: 'T1'; position: absolute; top: -6px; right: -4px; font-size: var(--hg-type-tiny); color: var(--st-rev-ink); font-weight: 400; }
  .asset-tree .hg-stage .t-cost { display: inline-flex; align-items: center; justify-content: flex-end; gap: 6px; white-space: nowrap; min-width: 0; }
  .asset-tree .hg-stage .t-cost .t-cur { color: var(--hg-text-dim); font-weight: 400; font-size: var(--hg-type-11); }
  .asset-tree .hg-stage .t-cost input { box-sizing: border-box; width: 68px; min-width: 0; height: 22px; text-align: right; font-size: var(--hg-type-11); font-weight: 500; font-variant-numeric: tabular-nums; border: 1px solid var(--hg-border-control); border-radius: 4px; padding: 2px 6px; background: var(--hg-input-bg); color: var(--hg-text-ink); -webkit-appearance: none; -moz-appearance: textfield; appearance: none; }
  .asset-tree .hg-stage .t-cost input.t-cost-fixed { width: 90px; }
  .asset-tree .hg-stage .t-cost input:focus { outline: none; border-color: var(--hg-border-focus); }
  .asset-tree .hg-stage .t-cost .t-cost-x { color: var(--hg-text-dim); font-weight: 400; }
  /* Card-actions row: buttons = ONE rigid cluster; the totals group is the
     other rigid block (its internal spacing is deliberate); the ONLY
     flexible thing is the space between the two groups (founder law
     2026-09-20). Two-line system: same wrap behaviour as the stage rows.
     Its rule takes the card's own accent through --seg-rule, as every row
     line inside a coloured card does. */
  .card-actions-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding-top: 6px; border-top: 1px solid var(--seg-rule, var(--hg-border-row)); }
  .card-actions-row > .card-btns { display: flex; gap: 10px; align-items: center; flex: 0 0 auto; }
  /* Totals group: rigid, pushed right; its money column is pinned at the task
     rows' money offset by the invisible ghost (right edge inset = the 10px
     body padding, shared with every line). */
  .asset-cost-row { display: flex; justify-content: flex-end; align-items: center; gap: 10px; margin-left: auto; font-weight: 600; font-size: var(--hg-type-11); flex: 0 0 auto; }
  .asset-cost-row > .acr-lab { text-align: left; color: var(--hg-text-secondary); }
  .asset-cost-row > .acr-days { font-variant-numeric: tabular-nums; }
  /* Invisible twin of the task rows' action cluster: pins the totals money at
     the same distance from the row edge as the money being summed above. */
  .asset-cost-row > .acr-ghost { visibility: hidden; }

  .asset-tree .hg-stage > .t-stage { order: -2; flex: 0 1 auto; }
  .asset-tree .hg-stage > .breakdown-relations-open { order: -2; }
  .asset-tree .hg-stage > .t-tags { order: -2; flex: 0 0 auto; }
  .asset-tree .hg-stage > .t-note { order: -1; flex: 1 1 180px; min-width: 120px; }
  .hg-stage > .t-ctrl {
    /* The rigid cluster ALWAYS owns a full row: `1 1 100%` forces its own
       line (note takes row 2 when label+tags+note cannot share). Right-aligned
       inside the box, so the empty space in front of it compresses to zero
       instead of pushing the cluster off the card. No member may shrink. */
    order: 0; display: flex; flex-wrap: nowrap; align-items: center;
    justify-content: flex-end; gap: 10px; flex: 1 1 100%;
  }
  .t-ctrl > * { flex: 0 0 auto; }
  .t-ctrl > .row-actions { order: 1; }
  .master-totals { margin-top: 14px; background: transparent; border: none; border-radius: 4px; padding: 12px 14px; }
  .master-totals h3 { font-size: var(--hg-type-base); text-transform: uppercase; letter-spacing: .06em; color: var(--hg-text-label); margin: 0 0 12px; }
  /* collapsible wire panels used in Breakdown tab */
  .wire-panel {
    transition: padding .15s ease; margin-bottom: 8px; position: relative; isolation: isolate;
  }
  /* Title bars take the Top shade in light mode; dark mode keeps the Tabs shade. */
  .wire-title, .hg-floating-title {
    cursor: pointer; user-select: none;
    display: flex; justify-content: space-between; align-items: center;
    padding: 8px 12px; margin: -12px -14px 12px;
    background: var(--hg-surface-header); border-bottom: none; border-radius: 4px;
    font-weight: 600; font-size: var(--hg-type-medium); letter-spacing: -.01em; color: var(--hg-text-ink);
    box-shadow: var(--hg-shadow-sm);
    backdrop-filter: blur(var(--hg-frost-blur)); -webkit-backdrop-filter: blur(var(--hg-frost-blur));
  }
  .wire-title:hover { filter: none; color: var(--hg-text-ink); }
  /* Internal budget + Crew cost panels — frosted glass on the title bar */
  #masterTotals .wire-title,
  #crewCost .wire-title,
  #v-cli .wire-title {
    background: var(--hg-surface-header);
    backdrop-filter: blur(var(--hg-frost-blur)); -webkit-backdrop-filter: blur(var(--hg-frost-blur));
    color: var(--hg-text-ink);
  }
  /* Hover lift. A titled sheet raises its own title bar under the pointer with
     the cast below and the halo above that the panel material carries, so the
     bar reads as lifted off the sheet. One recipe serves the Breakdown wire
     panels and every popup's title bar. The pair is a token that flips with the
     mode, so the dark state needs no rule of its own. */
  #masterTotals .wire-title,
  #crewCost .wire-title,
  #v-cli .wire-title,
  .hg-floating-panel > .hg-floating-title {
    transition: transform .25s cubic-bezier(.22,1,.36,1), filter .25s cubic-bezier(.22,1,.36,1);
  }
  #masterTotals .wire-title:hover,
  #crewCost .wire-title:hover,
  #v-cli .wire-title:hover,
  .hg-floating-panel > .hg-floating-title:hover {
    transform: translateY(-2px);
    filter: var(--hg-filter-lift);
    transition: transform .06s ease-out, filter .06s ease-out;
  }
  #masterTotals .wire-title:active,
  #crewCost .wire-title:active,
  #v-cli .wire-title:active,
  .hg-floating-panel > .hg-floating-title:active {
    transform: translateY(0); filter: none;
    transition: transform .06s ease-out, filter .06s ease-out;
  }
  #masterTotals .cs-del:hover,
  #v-cli .cs-del:hover { color: var(--hg-text-ink); }
  /* Wire-panel bodies share the Financial Overview frost recipe
     (founder 2026-09-20): frost wash + soft blur on the panel itself. */
  #masterTotals,
  #crewCost,
  #v-cli .master-totals {
    background: var(--hg-frost-bg);
    backdrop-filter: blur(var(--hg-frost-blur-soft));
    -webkit-backdrop-filter: blur(var(--hg-frost-blur-soft));
  }
  /* An open budget panel floats the way its title bar does on hover: the same
     two casts, top and bottom, so the panel reads as a sheet lying over the
     tree rather than a region painted on it. A collapsed panel has no height
     to lift, so it keeps no shadow. */
  .master-totals:not(.collapsed) {
    box-shadow: var(--hg-shadow-lift);
  }
  .wire-caret { display: inline-block; transition: transform .15s ease; font-size: var(--hg-type-11); color: var(--hg-text-muted); margin-left: 8px; }
  .wire-panel.collapsed { padding: 0 14px; margin-bottom: 4px; }
  .wire-panel.collapsed .wire-title { margin: 0 -14px; padding: 8px 12px; border-bottom: none; border-radius: 4px; }
  .wire-panel.collapsed .wire-caret { transform: rotate(-90deg); }
  .wire-panel.collapsed .wire-body { display: none; }
  /* project metadata form inside wire panels */
  .meta-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 24px; }
  .meta-section { display: flex; flex-direction: column; gap: 18px; }
  .meta-row { display: flex; align-items: center; gap: 10px; font-size: var(--hg-type-base); min-height: 26px; padding: 8px 0; border-bottom: 1px solid var(--hg-hairline); }
  .meta-label { flex: 0 0 240px; color: var(--hg-text-ink); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; font-size: var(--hg-type-10); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  /* box shape only — the styling vocabulary (border/bg/color/focus) is
     .hg-ctl's; add .hg-ctl to the markup. */
  .meta-input { flex: 1 1 auto; min-width: 0; padding: 4px 8px; }
  /* Portrait reflow: stack the field label above its text field (same
     pattern as the client-budget rows). Label takes a full row; the text
     field and its remove button wrap to the next line. */
  @media (max-width: 900px) {
    .meta-row { flex-wrap: wrap; }
    .meta-label { flex: 1 1 100%; }
  }
  /* editable heading inside wire-title — BANNER exception to the unified
     fill: like the breakdown seg/entity/task rows, it's a title-bar element.
     Idle: invisible (transparent, follows the .wire-title bar it sits in).
     Selected: takes the unified field fill (--hg-input-bg). */
  .wire-heading-input {
    flex: 1 1 auto; border: 1px solid transparent; background: transparent;
    font-weight: 600; font-size: var(--hg-type-base); text-transform: uppercase; letter-spacing: .06em; color: inherit;
    padding: 2px 4px; border-radius: 4px; min-width: 0;
  }
  .wire-heading-input:hover { border-color: var(--hg-border-hover); }
  .wire-heading-input:focus {
    outline: none; border-color: var(--hg-border-hover);
    background: var(--hg-input-bg); /* selected = the unified field colour */
  }
  .wire-title-suffix { flex: 0 0 auto; font-weight: 600; font-size: var(--hg-type-medium); }
  /* textarea auto-growing field */
  .meta-textarea {
    resize: none; overflow: hidden; min-height: 22px; line-height: 1.4;
    font-family: inherit;
    margin-bottom: 12px;
  }
  /* add/remove field buttons */
  .meta-add-row {
    margin-top: 8px; font-size: var(--hg-type-11); padding: 4px 10px; opacity: .7;
  }
  .meta-add-row:hover { opacity: 1; }
  .meta-del { flex: 0 0 auto; margin-left: 4px; }
  .meta-panel-del { flex: 0 0 auto; margin-left: 2px; font-size: var(--hg-type-base); opacity: .5; }
  .meta-panel-del:hover { opacity: 1; }
  .meta-panel-reorder { flex: 0 0 auto; margin-left: 2px; font-size: var(--hg-type-base); opacity: .5; }
  .meta-panel-reorder:hover { opacity: 1; }
  .meta-panel-tpl { flex: 0 0 auto; margin-left: 2px; font-size: var(--hg-type-base); opacity: .5; }
  .meta-panel-tpl:hover { opacity: 1; }
  .meta-add-panel { margin-top: 12px; font-size: var(--hg-type-11); padding: 6px 12px; opacity: .7; }
  .meta-add-panel:hover { opacity: 1; }
  /* finance panel nested inside master-totals */
  .fp-cur-toggles { display: inline-flex; gap: 0; margin-left: 4px; }
  .cur-toggle { font-size: var(--hg-type-11); font-weight: 600; padding: 2px 7px; border: 1px solid var(--hg-border-control); border-right: none; background: var(--hg-input-bg); color: var(--hg-input-ink); cursor: pointer; line-height: 1.3; }
  .cur-toggle:first-child { border-radius: 4px 0 0 4px; }
  .cur-toggle:last-child { border-radius: 0 4px 4px 0; border-right: 1px solid var(--hg-border-control); }
  /* A hidden currency is a ghost chip: no fill, muted glyph. The visible ones
     carry the field fill so the group reads with the money fields below it. */
  .cur-toggle.inactive { background: transparent; color: var(--hg-text-muted); }
  .cur-toggle:hover { background: color-mix(in srgb, var(--hg-accent) 10%, var(--hg-input-bg)); }
  .hide-gbp .cur-gbp, .hide-usd .cur-usd, .hide-eur .cur-eur { display: none !important; }
  .fp-th-cur { font-size: var(--hg-type-base); margin-right: 4px; }
  .fp-th-rate { width: 60px; margin-top: 3px; }
  .fp-th-rate::-webkit-outer-spin-button,
  .fp-th-rate::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
  #msTable { border-collapse: separate; border-spacing: 0 0; width: 100%; }
  #msTable td { padding: 0 4px 0 0; border-bottom: none; }
  #msTable th { padding: 8px 4px 8px 0; }
  #msTable td:first-child,
  #msTable th:first-child { padding-left: 0; }
  #msTable td:nth-child(7),
  #msTable th:nth-child(7) { width: 16px; }
  /* milestone note lives on its own full-width row beneath the fields */
  #msTable tr.fp-ms-note-row td { padding: 8px 0 8px; border-bottom: 1px solid var(--hg-hairline); }
  /* consistent 8px below every milestone hairline (header + note rows) */
  #msTable tr.fp-ms-row td { padding-top: 8px; }
  /* panel head: title and currency toggles left, the milestone rounding switch
     hard right — the row is the panel's top line, so the switch stays put */
  .fp-head-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 10px; color: var(--hg-text-dim, #8a93a3); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .05em; }
  .fp-head-title { display: inline-flex; gap: 10px; align-items: center; min-width: 0; }
  /* section head for a titled block below the panel head */
  .fp-ms-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
  .fp-ms-head > span { font-size: 10px; color: var(--hg-text-dim, #8a93a3); text-transform: uppercase; letter-spacing: .05em; }
  /* the switch is a label, not a heading: sentence case, own size, right edge */
  .fp-head-row .hg-check { margin-left: auto; }
  /* the percentage is the only editable cell in a milestone row */
  .fp-ms-pct { width: 58px; text-align: right; padding: 1px 4px; }
  .fp-ms-pct.auto { color: var(--hg-text-muted); }
  /* the unit rides with its value: a % after the share, a symbol before money */
  .fp-ms-unit { margin-left: 2px; color: var(--hg-text-muted); }
  .fp-ms-none { color: var(--hg-text-dim, #8a93a3); }
  .fp-ms-note { width: 100%; box-sizing: border-box; resize: none; overflow: hidden; min-height: 22px; line-height: 1.4; font-family: inherit; padding: 4px 8px; }
  #msTable td.num { text-align: right; }
  .fp-table { width: 100%; border-collapse: collapse; font-size: var(--hg-type-base); }
  .fp-table th { text-align: left; font-weight: 600; color: var(--hg-text-label); padding: 4px 6px; border-bottom: 1px solid var(--hg-hairline); }
  .fp-table th.num { text-align: right; }
  .fp-table td { padding: 5px 6px; border-bottom: 1px solid var(--hg-hairline); }
  .fp-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
  .fp-table tr.doc-total td { font-weight: 600; border-top: 1px solid var(--hg-border-row); border-bottom: none; }
  .fp-table tr.doc-total td.num { color: var(--hg-text-ink); }
  /* ===== Stage payment panel (Stage card → Cost → payment schedule) =====
     Same table and field controls as the Client tab's Payment milestones;
     this block states size, position and layout only — the panel's material
     comes from .hg-floating-panel. */
  .hg-floating-panel.stage-pay-panel {
    display: none; position: fixed; left: 60px;
    top: calc(var(--hg-header-h) + var(--hg-tabs-h) + 24px);
    z-index: 60; width: 520px; min-width: 320px;
    max-width: calc(100vw - 76px);
    max-height: calc(100dvh - var(--hg-header-h) - var(--hg-tabs-h) - 48px);
    overflow: auto;
  }
  .hg-floating-panel.stage-pay-panel.on { display: block; }
  .stage-pay-panel .sp-context { font-size: var(--hg-type-11); color: var(--hg-text-muted); margin: 2px 0 10px; }
  .stage-pay-panel .sp-table td { padding: 8px 6px; vertical-align: middle; }
  .stage-pay-panel .sp-table tr.sp-note-row td { padding: 2px 0 10px; border-bottom: 1px solid var(--hg-hairline); }
  .stage-pay-panel .sp-empty { color: var(--hg-text-dim); padding: 10px 6px; }
  .stage-pay-panel .sp-amt { white-space: nowrap; font-variant-numeric: tabular-nums; }
  .stage-pay-panel .sp-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; }
  .stage-pay-panel .sp-total { font-size: var(--hg-type-base); color: var(--hg-text-muted); }
  .stage-pay-panel .sp-total b { color: var(--hg-text-ink); font-variant-numeric: tabular-nums; }
  /* --hg-text-ink does not flip; the total needs the bright token on dark. */
  html.dark .stage-pay-panel .sp-total b { color: var(--hg-text-bright); }
  /* The money doors and row controls wear the shared icon button; these rules
     restate size and position only. */
  .hg-icon-btn.sp-close { position: absolute; top: 12px; right: 12px; width: 24px; height: 24px; padding: 0; }
  .hg-icon-btn.sp-del { padding: 2px 6px; font-size: var(--hg-type-base); }
  .hg-icon-btn.sp-open { width: 20px; height: 20px; padding: 0; }
  /* The payment door sits on the Stage card's cost total: layout only. */
  .rowcard-cost { display: inline-flex; align-items: center; gap: 6px; }
  .sp-ico { display: block; }
  /* client budget grid: line name → note textarea → £/$/€ right-hugged
     Grid with fixed tracks so every row's columns line up exactly —
     same approach as meta-panel rows. */
  .fp-cb-grid { font-size: var(--hg-type-base); }
  .fp-cb-hdr, .fp-cb-row { display: grid; grid-template-columns: 140px 1fr 88px 88px 88px; align-items: center; gap: 10px; min-height: 26px; padding: 4px 0 8px; margin-bottom: 12px; border-bottom: 1px solid var(--hg-hairline); }
  .fp-cb-hdr { font-weight: 600; color: var(--hg-text-ink); font-size: var(--hg-type-10); text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid var(--hg-hairline); padding-bottom: 4px; }
  .fp-cb-line { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; font-size: var(--hg-type-10); }
  /* Lane expander: the shared +/- control, placed inside the lane cell so the
     amount tracks stay put. */
  .fp-cb-toggle { margin-right: 3px; }
  /* Deliverable rows: a lane's constituent lines, read as child items under
     the lane heading (same grid tracks, indented, not uppercase). */
  .fp-cb-row.fp-cb-sub .fp-cb-line { text-transform: none; letter-spacing: 0; font-weight: 400; font-size: var(--hg-type-11); color: var(--hg-text-muted); padding-left: 14px; }
  .fp-cb-row.fp-cb-sub .fp-cb-amt { color: var(--hg-text-muted); font-weight: 500; }
  .fp-cb-note-spacer { }
  /* header has no "Line" label — the spacer spans the name + note columns
     so the £/$/€ header cells still land on tracks 3/4/5 (aligned with rows). */
  .fp-cb-hdr .fp-cb-note-spacer { grid-column: 1 / 3; }
  .fp-cb-note { resize: none; overflow: hidden; min-height: 22px; line-height: 1.4; font-family: inherit; box-sizing: border-box; width: 100%; }
  .fp-cb-amt { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 6px; }
  /* vertical hairlines between amount columns */
  .fp-cb-amt.cur-gbp, .fp-cb-amt.cur-usd { border-right: 1px solid var(--hg-border-row); }
  .fp-cb-hdr .fp-cb-amt.cur-gbp, .fp-cb-hdr .fp-cb-amt.cur-usd { border-right: 1px solid var(--hg-border-row); }
  .fp-cb-row.fp-cb-total { font-weight: 600; border-top: 1px solid var(--hg-border-row); border-bottom: none; padding-top: 5px; }
  .fp-cb-row.fp-cb-total .fp-cb-amt { color: var(--hg-text-ink); }
  /* currency toggle: collapse grid tracks when a currency is hidden */
  .hide-gbp .fp-cb-hdr, .hide-gbp .fp-cb-row { grid-template-columns: 140px 1fr 88px 88px; }
  .hide-usd .fp-cb-hdr, .hide-usd .fp-cb-row { grid-template-columns: 140px 1fr 88px 88px; }
  .hide-eur .fp-cb-hdr, .hide-eur .fp-cb-row { grid-template-columns: 140px 1fr 88px 88px; }
  .hide-gbp.hide-usd .fp-cb-hdr, .hide-gbp.hide-usd .fp-cb-row { grid-template-columns: 140px 1fr 88px; }
  .hide-gbp.hide-eur .fp-cb-hdr, .hide-gbp.hide-eur .fp-cb-row { grid-template-columns: 140px 1fr 88px; }
  .hide-usd.hide-eur .fp-cb-hdr, .hide-usd.hide-eur .fp-cb-row { grid-template-columns: 140px 1fr 88px; }
  .hide-gbp.hide-usd.hide-eur .fp-cb-hdr, .hide-gbp.hide-usd.hide-eur .fp-cb-row { grid-template-columns: 140px 1fr; }
  /* Portrait reflow: stack line label → note field → prices. Line and note
     each span a full row; the price cells auto-pack the bottom row left-to-right.
     The note-spacer (header + total rows, no textarea) is hidden so those rows
     collapse to two tiers instead of leaving an empty middle band. #financePanel
     scoping out-specificities the hide-* grid-template-columns rules above
     (which cap at 0,4,0). */
  @media (max-width: 900px) {
    #financePanel .fp-cb-hdr,
    #financePanel .fp-cb-row { grid-template-columns: repeat(3, 1fr); row-gap: 4px; }
    .fp-cb-line { grid-column: 1 / -1; grid-row: 1; }
    .fp-cb-note { grid-column: 1 / -1; grid-row: 2; }
    .fp-cb-note-spacer { display: none; }
  }
  /* Internal budget = segment table; Crew cost is its own wire-panel beneath */
  .mt-seg { margin: 0 0 18px; }
  .mt-kpi b { color: var(--hg-text-ink); }
  .mt-table { width: 100%; border-collapse: collapse; font-size: var(--hg-type-base); }
  .mt-table th { text-align: left; font-weight: 600; font-size: var(--hg-type-10); text-transform: uppercase; letter-spacing: .05em; color: var(--hg-text-dim); padding: 3px 0 4px; border-bottom: 1px solid var(--hg-border-row); }
  .mt-table th.num, .mt-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
  .mt-table td { padding: 3px 0; border-bottom: 1px solid var(--hg-hairline); color: var(--hg-text-secondary); }
  .mt-table tbody tr:last-child td { border-bottom: none; }
  .mt-table td.num { font-weight: 600; color: var(--hg-text-ink); }
  .mt-table tr.mt-total td { border-top: 1px solid var(--hg-border-row); border-bottom: none; font-weight: 700; color: var(--hg-text-ink); }
  /* extra breathing room above the totals wire: 8px = 3px base td padding + 5px (margins don't apply to td) */
  .mt-table tr:has(+ tr.mt-total) td { padding-bottom: 8px; }
  /* Unassigned crew row: integrated into the worker table — muted, slightly separated. */
  .mt-table tr.mt-ua td { color: var(--hg-text-secondary); border-top: 1px dashed var(--hg-border-control); }
  .mt-rate-row {
    display: flex; justify-content: space-between; align-items: center;
    gap: 10px; padding: 8px 0 2px; margin-top: 4px;
    font-size: var(--hg-type-11); color: var(--hg-text-secondary); font-weight: 500;
  }
  .mt-rate-row label { color: var(--hg-text-secondary); font-weight: 500; cursor: text; }
  .mt-rate-input {
    display: inline-flex; align-items: center; gap: 2px;
    font-variant-numeric: tabular-nums; font-weight: 600; color: var(--hg-text-ink);
  }
  /* Editable fields in both money panels are the shared boxed control
     (.hg-ctl — border, fill, focus), the same field the Client panel's rate
     fields use. These variants restate box shape only. */
  .mt-rate-input input,
  .mt-table input.mt-seg-markup { text-align: right; padding: 0 4px; }
  .mt-rate-input input[type="number"],
  .mt-table input.mt-seg-markup[type="number"] { -moz-appearance: textfield; }
  /* Compact fields: no spin buttons, as on the Client panel's rate fields. */
  .mt-rate-input input::-webkit-outer-spin-button,
  .mt-rate-input input::-webkit-inner-spin-button,
  .mt-table input.mt-seg-markup::-webkit-outer-spin-button,
  .mt-table input.mt-seg-markup::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
  .mt-rate-input input { width: 64px; }
  /* Breakdown cost panel scope row — geometry only. The two controls are the
     shared underline controls (.hg-multi-select / .hg-select) the filter bars
     use, and the label type matches those bars; no surface of its own. */
  #crewCost .mt-scope {
    display: flex; align-items: center; flex-wrap: wrap;
    gap: 8px 16px; padding: 0 0 8px;
    font-size: var(--hg-type-11); color: var(--hg-text-secondary);
  }
  #crewCost .mt-scope > span { display: inline-flex; align-items: center; gap: 6px; }
  .mt-table input.mt-seg-markup { width: 52px; }
  /* Bid-vs-actual delta cells in master totals (red over / green under) */
  .mt-table td.mt-delta.over { color: var(--hg-danger-ink); }
  .mt-table td.mt-delta.under { color: var(--st-ip-ink); }
  /* Segment expander column: +/− button, then indented per-entity rows */
  .mt-table td.mt-exp { width: 20px; padding-right: 4px; white-space: nowrap; }
  .mt-seg-toggle {
    border: none; background: transparent; cursor: pointer;
    padding: 0 2px; font-size: 12px; line-height: 1;
    color: var(--hg-text-dim); font-variant-numeric: tabular-nums;
  }
  .mt-seg-toggle:hover { color: var(--hg-text-ink); }
  .mt-table tr.mt-ent td { color: var(--hg-text-muted); font-weight: 400; padding-left: 4px; }
  .mt-table tr.mt-ent td.num { font-weight: 500; color: var(--hg-text-muted); }
  /* Performance strip — divider + margin metrics below the two tables */
  .mt-perf { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--hg-border-row); }
  .mt-perf-title { font-size: var(--hg-type-10); text-transform: uppercase; letter-spacing: .05em; color: var(--hg-text-dim); margin-bottom: 8px; }
  .mt-perf-strip { display: flex; gap: 28px; flex-wrap: wrap; }
  .mt-perf-item { display: flex; flex-direction: column; gap: 2px; }
  .mt-perf-label { font-size: var(--hg-type-11); color: var(--hg-text-secondary); }
  .mt-perf-val { font-size: var(--hg-type-medium); font-weight: 700; color: var(--hg-text-ink); font-variant-numeric: tabular-nums; }
  .mt-perf-val.neg { color: var(--hg-danger-ink); }
  .mt-perf-val.pos { color: var(--st-ip-ink); }
  /* The stage the card's action band follows draws no rule of its own: the
     card's foot is one area with its buttons, closed by the block's bottom
     edge, so no line separates the last stage from them. */
  .asset-tree .hg-stage:last-child,
  .asset-tree .hg-stage:has(+ .card-actions-row) { border: none; }

  .asset-tree .hg-stage .t-stage { font-size: var(--hg-type-base); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
  .asset-tree .hg-stage .t-tags { display: flex; align-items: center; gap: 3px; min-width: 0; overflow: hidden; }
  .asset-tree .hg-stage .t-stage-input { box-sizing: border-box; width: 100%; height: 22px; font-size: var(--hg-type-base); border: 1px solid transparent; border-radius: 4px; padding: 2px 6px; background: var(--hg-input-bg); color: var(--hg-text-ink); }
  .hg-stage .t-stage-input:hover { border-color: var(--hg-border-control); }
  .hg-stage .t-stage-input:focus { outline: none; border-color: var(--hg-border-focus); }
  .hg-stage .t-days { text-align: right; font-variant-numeric: tabular-nums; cursor: text; border-radius: 4px; padding: 1px 5px; }
  .hg-stage .t-days:hover { background: var(--hg-surface-elevated); }
  /* The stepper's middle cell opens with its buttons, so it takes the accent
     wash instead of the raised hover a lone duration span wears. */
  .hg-stage .t-spinner .t-days:hover { background: color-mix(in srgb, var(--seg-accent, var(--hg-accent)) 14%, transparent); }

  .task-add { border: none; background: none; color: var(--hg-text-muted); font-size: var(--hg-type-11); cursor: pointer; padding: 5px 0 2px; }
  .task-add:hover { color: var(--hg-text-ink); }
  /* A text button with nothing to do yet stays in place and reads as inert. */
  .task-add:disabled { opacity: .45; cursor: default; }
  .task-add:disabled:hover { color: var(--hg-text-muted); }
  /* Card-level action buttons (+ add stage / load preset / save preset / schedule):
     same dark-pill style as .btn-new, but ~25% smaller
     to fit inside hg-entity-block cards. */
  .card-task-btn { font-size: var(--hg-type-tiny); padding: 2px 8px; margin-left: 0; background: color-mix(in srgb, var(--seg-accent, var(--hg-accent)) 25%, transparent); border: 1px solid color-mix(in srgb, var(--seg-accent, var(--hg-accent)) 45%, rgba(255,255,255,.3)); color: var(--hg-text-ink); }
  .card-task-btn:hover { background: color-mix(in srgb, var(--seg-accent, var(--hg-accent)) 35%, transparent); }
  /* New-task schedule macro: reuse the real Gantt classes, only constrain height.
     Themed on the shared popup law (rule 47): every surface paints the tabs
     token, no HydraSkin texture, controls wear the shared input tokens.
     Sibling-pane split (the gantt's contract): the labels column is a fixed
     sibling and the timeline is the ONLY scroller, so the horizontal scrollbar
     sits under the ruler — never under the stages column. */
  .na-gantt-wrap { display:flex; margin-top:12px; border:1px solid var(--hg-border-control); border-radius:4px; background:var(--hg-pop-stage, var(--hg-surface-tabs)); overflow:hidden; position:relative; }
  #naModal .modal { position:relative; overflow:hidden; }
  #naModal .modal > * { position:relative; z-index:1; }
  .na-gantt-wrap .gantt-labels { width:170px; flex-shrink:0; display:flex; flex-direction:column; box-shadow:none; border-right:1px solid var(--hg-border-control); background:transparent; }
  .na-gantt-wrap .gantt-timeline { flex:1; min-width:0; overflow-x:auto; overflow-y:hidden; background:transparent; }
  .na-gantt-wrap .na-lane-body { position:relative; min-width:max-content; background:transparent; padding-bottom:34px; }
  .na-gantt-wrap .lane { display:flex; position:relative; height:30px; border-bottom:1px solid var(--hg-border-cell); box-sizing:border-box; background:var(--hg-frost-bg); backdrop-filter:blur(var(--hg-frost-blur-soft)); -webkit-backdrop-filter:blur(var(--hg-frost-blur-soft)); overflow:hidden; }
  .na-gantt-wrap .lane .cells { display:flex; flex:0 0 auto; height:100%; }
  .na-gantt-wrap .lane .cell { height:100%; }
  .na-gantt-wrap .na-row { height:30px; background:var(--hg-frost-bg); border-bottom:1px solid var(--hg-border-cell); box-sizing:border-box; display:flex; align-items:center; gap:6px; }
  /* Header + track paint the SAME frost language as every tracker table:
     --hg-frost-head for the head band (one control for all table/panel heads),
     --hg-frost-bg for the row sheet. No elevation/hover token, no bespoke hex. */
  .na-gantt-wrap .gantt-labels .labels-head { height: var(--gantt-head-h); flex:0 0 auto; position:relative; z-index:6; background:var(--hg-frost-head); border-bottom:1px solid var(--hg-border-chrome); backdrop-filter:blur(var(--hg-frost-blur)); -webkit-backdrop-filter:blur(var(--hg-frost-blur)); }
  /* Stage rows are static — the editor modal grows with its rows, so there is
     no vertical scroll; the timeline scrolls horizontally only. */
  .na-gantt-wrap .weekhdr { background:var(--hg-frost-head); border-bottom-color:var(--hg-border-chrome); backdrop-filter:blur(var(--hg-frost-blur)); -webkit-backdrop-filter:blur(var(--hg-frost-blur)); }
  .na-gantt-wrap .gantt-labels > .task-add { display:block; width:100%; text-align:left; padding:0 16px; height:34px; box-sizing:border-box; border:none; border-top:1px solid var(--hg-border-control); background:transparent; color:var(--hg-text-muted); font-size: var(--hg-type-11); cursor:pointer; flex:0 0 auto; }
  .na-gantt-wrap .gantt-labels > .task-add:hover { color: var(--hg-text-ink); }
  /* Editable inputs inside hg-stage for the macro: stage name, days.
     UNIFIED FILL: idle = selected = --hg-input-bg (border is the affordance). */
  .na-gantt-wrap .na-row input.na-stage { flex:1; min-width:0; border:1px solid transparent; border-radius:3px; padding:2px 4px; font-size: var(--hg-type-11h); font-weight:500; color:var(--hg-input-ink); background:var(--hg-input-bg); }
  .na-gantt-wrap .na-row input.na-stage:hover, .na-gantt-wrap .na-row input.na-stage:focus { border-color:var(--hg-border-control); outline:none; }
  .na-gantt-wrap .na-row input.na-num { width:42px; border:1px solid transparent; border-radius:3px; padding:2px 3px; font-size: var(--hg-type-11); font-weight:500; color:var(--hg-input-ink); background:var(--hg-input-bg); text-align:center; }
  .na-gantt-wrap .na-row input.na-num:hover, .na-gantt-wrap .na-row input.na-num:focus { border-color:var(--hg-border-control); outline:none; }
  .na-gantt-wrap .na-row .na-rm { border:none; background:none; color:var(--hg-text-muted); cursor:pointer; font-size: var(--hg-type-14); padding:2px 4px; flex-shrink:0; }
  .na-gantt-wrap .na-row .na-rm:hover { color:var(--hg-danger-ink); }
  /* The bar menu's offset box holds a fractional day figure ("5.0833"); the
     shared .hg-menu-num width is sized for a whole weekday span. Box shape
     only — the control keeps its own paint. */
  .hg-menu-num.na-offset-num { width:78px; }
  .footnote { margin-top: 18px; font-size: var(--hg-type-base); color: var(--hg-text-secondary); line-height: 1.6; }
  .footnote b { color: var(--hg-text-ink); }
  .rec-cycle-options { max-height: 32vh; overflow: auto; margin: 12px 0; }
  .rec-cycle-option { display: grid; grid-template-columns: 20px minmax(0, 1fr) minmax(0, 1fr); gap: 8px; align-items: start; padding: 5px 0; }
  #recurringDialogBg { z-index: 86; }
  #hgConfirmBg { z-index: 87; }

  .modal-bg { position: fixed; inset: 0; background: transparent; z-index: 85; display: none; align-items: center; justify-content: center; }
  .modal-bg.open { display: flex; }
  .modal, .hg-floating-panel { position: relative; background: var(--hg-frost-bg); border-radius: var(--hg-floating-panel-radius); padding: var(--hg-floating-panel-padding); width: 460px;
    backdrop-filter: blur(var(--hg-frost-blur)); -webkit-backdrop-filter: blur(var(--hg-frost-blur));
    box-shadow: var(--hg-shadow-modal); }
  /* A panel opts into resizing with data-hg-resize; the shared helper adds this
     corner grip. Paint and cursor only — the size rule is the panel's own. */
  .hg-resize-grip {
    position: absolute; right: 5px; bottom: 5px; width: 12px; height: 12px;
    border-right: 1px solid var(--hg-text-muted);
    border-bottom: 1px solid var(--hg-text-muted);
    border-bottom-right-radius: 3px;
    opacity: .5; cursor: nwse-resize; touch-action: none;
  }
  .hg-resize-grip:hover { opacity: .85; }
  .modal h3 { margin-bottom: 14px; cursor: move; user-select: none; touch-action: none; }
  /* Popups shrink-wrap to content, capped at the viewport — the script never sets px. */
  .modal.fit { width: max-content; max-width: 94vw; min-width: 420px; }
  .mpath { font-family: var(--hg-font-mono); font-size: var(--hg-type-11); color: var(--hg-info); background: #f0f3f8; border-radius: 4px; padding: 7px 10px; margin: 8px 0; min-height: 16px; }
  .mfoot { display: flex; gap: 10px; margin-top: 12px; }
  /* Optional checkbox line in the shared confirm modal (layout only — the
     native checkbox itself is styled once in the primitives section). */
  #hgConfirmBody .hg-confirm-toggle {
    display: flex; align-items: center; gap: 8px; margin-top: 12px;
    font-size: var(--hg-type-12h); color: var(--hg-text-ink); cursor: pointer;
  }
  /* Legacy .na-item card styles removed — schedule macro now uses real Gantt .hg-stage */

  /* ===== 4d. gantt shell + bars ===== */
  .gbar {
    position: absolute; top: 6px; height: 18px; border-radius: 3px; cursor: grab;
    user-select: none; -webkit-user-select: none;
    display: flex; align-items: center; padding: 0 6px; font-size: var(--hg-type-10); font-weight: 600;
    color: var(--hg-text-on-accent); white-space: nowrap; overflow: visible; max-width: 100%;
    box-sizing: border-box; z-index: 1;
    /* Raised bar: soft light top, soft shade bottom, visible drop shadow. */
    box-shadow: inset 0 2px 5px rgba(255,255,255,.15),
                inset 0 -3px 7px rgba(0,0,0,.09),
                0 2px 7px rgba(15,23,42,.38);
    /* 70% opaque — NO backdrop blur: Chromium's backdrop-filter blurs the
       grid lines underneath the bar, smearing the day/week seams the chart
       depends on. Opacity alone reads as frost without touching the grid. */
    opacity: 0.7;
  }
  /* Assignment text and status fills must retain their tested contrast. Parent
     envelopes keep the softer shared-bar opacity above. */
  .gbar[data-assignment] { opacity: 1; }
  /* Ghosted weekend stretch inside a bar: the bar's own translucent hole
     across the open Sat/Sun columns — one assignment with a gap, never two
     bars. Same shape as the bar, translucent fill, no new chrome. */
  .gbar .gbar-ghost {
    position: absolute; top: 0; bottom: 0; z-index: 0;
    background: rgba(255, 255, 255, 0.28);
    border-radius: 0;
    pointer-events: none;
  }
  /* Counted weekend whose columns are closed: the bar paints shorter than
     the days it counts, so the collapse point carries a broken-axis mark —
     two thin slanted strokes through the bar (the chart convention for
     compressed time). Graphics, never glyphs: text here collided with the
     bar's own duration label and read as part of the number. The strokes
     ride the bar's own ink, so every status fill keeps contrast in both
     modes — no colour override needed. */
  .gbar .gbar-seam {
    position: absolute; top: -3px; bottom: -3px; width: 12px;
    margin-left: -6px; z-index: 2; pointer-events: none;
    opacity: 0.5;
  }
  .gbar .gbar-seam::before,
  .gbar .gbar-seam::after {
    content: ''; position: absolute; top: 0; bottom: 0; left: 50%; width: 1.5px;
    background: currentColor; transform-origin: 50% 50%;
  }
  .gbar .gbar-seam::before { transform: translateX(-3.5px) skewX(-14deg); }
  .gbar .gbar-seam::after { transform: translateX(3.5px) skewX(-14deg); }
  .gbar .gbar-txt {
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    min-width: 0; flex: 0 1 auto;
    position: relative; z-index: 1;
  }
  /* Dependency paths paint inside a clipped chart viewport. The SVG viewBox
     carries the content coordinates; the layer never takes the timeline size. */
  #ganttLinkViewport { position: absolute; overflow: hidden; contain: paint; pointer-events: none; z-index: 55; }
  /* Milestone + today vertical spikes must layer above every track and bar. */
  #ganttBody .ms-spike, #ganttBody #spikeLine { z-index: 50 !important; }
  #ganttBody .ms-spike { opacity: 0.5; }
  /* The today spike is a live clock line: its minute step glides over the
     ~30s interval, so the crawl reads as a continuous sweep rather than a
     jump. Only `transform` is animated. `left` is a LAYOUT property: animating
     it re-rasterises the strip the line crosses for the whole glide, and that
     strip runs through the label column, whose pane frost re-samples the page.
     The line is positioned once per tick with `left` (instant) and the glide
     is carried by `translateX` on the compositor — same look, no repaint. */
  #ganttBody #spikeLine { transition: transform 30s linear; }
  /* Cashflow dock milestone markers share the Gantt spike colour + transparency. */
  #cfTrack .cf-ms-marker {
    position: absolute; top: 0; bottom: 0; width: 2px;
    background: #26415e88; z-index: 10; pointer-events: none;
  }
  .gbar.ip { background: var(--gbar-ip-bg); } .gbar.wtg { background: var(--gbar-wtg-bg); }
  .gbar.rev { background: var(--gbar-rev-bg); color: var(--gbar-rev-ink); } .gbar.appr { background: var(--gbar-appr-bg); } .gbar.cmpt { background: var(--gbar-cmpt-bg); } .gbar.reopen { background: var(--hg-danger); }
  .gbar:focus-visible, .gbar.gbar-touch-ready { outline: 2px solid var(--hg-border-focus); outline-offset: 2px; }
  .gbar.draft { background: repeating-linear-gradient(45deg,var(--gbar-wtg-bg),var(--gbar-wtg-bg) 5px,var(--gbar-draft-stripe) 5px,var(--gbar-draft-stripe) 10px); }
  .gbar.grp { height: 22px; top: 3px; font-size: var(--hg-type-11); border-radius: 4px; }
  .gbar.grp.gbar-dragging { transform: translateY(2px); }
  /* Expanded parent bars stay visible as ghost tools — translucent fill +
     dashed outline so they read as containers, not tasks. Edges stay
     hit-testable (same .gedge). Collapsed parents keep the solid rollup. */
  .gbar.parent-open {
    background: color-mix(in srgb, var(--gbar-wtg-bg) 16%, transparent);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--gbar-appr-bg) 45%, transparent),
                inset 0 2px 5px rgba(255,255,255,.10),
                0 1px 4px rgba(15,23,42,.18);
    color: #3a4150;
  }
  /* Crew heat on the chart: a bar that takes part in an over-capacity week
     (or day) pulses with the SAME keyframes as the Crew dock's cell, so the
     two surfaces report one condition in one language. A bar is quiet only
     when every overloaded member on it has chosen quiet warnings: the ring
     stays, the motion does not. */
  .gbar.crew-overload {
    animation: wl-overload-pulse 1.6s ease-in-out infinite;
    will-change: box-shadow, filter;
    z-index: 2;
  }
  .gbar.crew-overload-quiet {
    box-shadow:
      inset 0 0 0 1px rgba(192, 57, 43, 0.55),
      0 0 6px rgba(192, 57, 43, 0.35);
  }
  @media (prefers-reduced-motion: reduce) {
    .gbar.crew-overload {
      animation: none;
      box-shadow:
        inset 0 0 0 1px rgba(192, 57, 43, 0.7),
        0 0 8px rgba(192, 57, 43, 0.55);
    }
  }
  /* A parent rollup above an overloaded bar carries the warning inside its
     own body, so a folded track still reports the problem. The triangle is a
     locator, never a control: presses pass through to the bar and its edges.
     It sits to the LEFT of the 10px right-edge stretch handle, with a clear
     gap, so the handle's own hover and hit area stay untouched. */
  .gbar.has-crew-warn { padding-right: 24px; }
  .gbar .gbar-warn {
    position: absolute; right: 14px; top: 50%;
    transform: translateY(-50%);
    font-size: 11px; line-height: 1; font-weight: 700;
    color: #a02820; pointer-events: none; z-index: 2;
    animation: gbar-warn-pulse 1.6s ease-in-out infinite;
    text-shadow: 0 0 4px rgba(192, 57, 43, 0.45);
  }
  html.dark .gbar .gbar-warn {
    color: #f08a80;
    text-shadow: 0 0 5px rgba(224, 80, 70, 0.55);
  }
  @keyframes gbar-warn-pulse {
    0%, 100% { opacity: .55; transform: translateY(-50%) scale(.9); }
    50% { opacity: 1; transform: translateY(-50%) scale(1.12); }
  }
  @media (prefers-reduced-motion: reduce) {
    .gbar .gbar-warn { animation: none; opacity: 1; }
  }
  /* Bid-vs-actual: overdue against bid — red right edge pulse.
     Keeps the base bevel + drop shadow (box-shadow is a single property —
     an override must restate them or the bevel vanishes). */
  .gbar.overdue-bid {
    box-shadow: inset 0 2px 5px rgba(255,255,255,.15),
                inset 0 -3px 7px rgba(0,0,0,.09),
                inset -4px 0 0 0 var(--hg-danger-bright),
                0 2px 7px rgba(15,23,42,.38);
  }
  /* Unstaffed bar: compact (!) mark after the text — a flag prompting
     inspection (crew truth on the bar popup / RMB menu), not a status. */
  .gbar.gbar-openmark .gbar-txt::after {
    content: " (!)";
    color: var(--hg-danger-bright);
    font-weight: 700;
  }
  /* View filter bar. Every view scrolls inside its own root (overflow:auto on
     .bidwrap / .it-scroll / .cs-scroll / .gantt-wrap), so the bar sits static
     above that root — never sticky against the page chrome. */
  .gfilters { display: flex; gap: 10px; align-items: center; justify-content: center; padding: 5px 16px 8px; border-bottom: none; font-size: var(--hg-type-11); color: var(--hg-text-secondary); flex-wrap: wrap; position: static; flex-shrink: 0; z-index: 10; background: transparent;
    /* Own compositing layer: the button row sits above the gantt's
       backdrop-filter surface with no isolation boundary between them, so
       every .block-btn:hover border/color change expanded damage into the
       frost's blur pass and could re-bake stale row pixels (the banding /
       glowy-box ghosts). A promoted layer paints the bar in isolation and
       its damage stops at its own bounds. Menus/tooltips escape via
       document.body attach, so no contain: paint is set here. */
    contain: layout style;
    will-change: transform; }
  .gfilters select, .gfilters input { border: none; border-radius: 4px; padding: 2px 7px; font-size: var(--hg-type-11); background-color: var(--hg-surface-tabs); }
  .gfilters input { width: 90px; }
  /* Gantt filter band: two independent rows. Filters and buttons never
     share a line, so resizing the window wraps each row on its own and
     neither row's overflow pushes the other around. */
  .gfilters.gantt-filters {
    flex-direction: column;
    gap: 4px;
    justify-content: flex-start;
    align-items: stretch;
    padding: 5px 16px 8px;
  }
  .gfilters.gantt-filters .gf-fields,
  .gfilters.gantt-filters .gf-actions {
    display: flex;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    /* Keep child hover paint in separate layers from the filter band.
       Transform promotion leaves the Gantt's page-background blur input
       accessible; a backdrop root on the Gantt would cut that input off. */
    contain: layout style;
    will-change: transform;
  }
  .gfilters.gantt-filters :is(.hg-multi-select, .hg-filter-input, .block-btn) {
    contain: layout style;
    will-change: transform;
  }
  .gfilters.gantt-filters .gf-fields { gap: 10px; justify-content: center; }
  .gfilters.gantt-filters .gf-actions { gap: 10px; justify-content: center; }
  /* Project cog settings popup: owns its geometry over the shared .hg-menu
     rule (same specificity, later in the file — its max-width would clip the
     two-column rows). Compound selector wins without touching shared popup
     or .hg-ctl styling. Preferred ~360px, capped at the viewport minus
     gutter; narrow viewports stack label and control. Geometry only. */
  .hg-menu.gantt-settings-menu {
    min-width: 0;
    width: 360px;
    max-width: calc(100vw - 24px);
    max-height: min(70vh, 520px);
    overflow-y: auto;
    padding-bottom: 6px;
  }
  .gantt-setting-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, auto); align-items: center; gap: 12px; padding: 4px 10px; }
  .gantt-setting-row > span { color: var(--hg-text-secondary); font-size: var(--hg-type-11); }
  .gantt-setting-row .hg-ctl { min-width: 0; width: 100%; box-sizing: border-box; }
  /* Working-hours row: two compact whole-hour text fields (no minutes,
     no native picker chrome) with an arrow separator. Geometry only —
     the fields wear .hg-ctl. */
  .gantt-time-row { display: flex; align-items: center; gap: 6px; }
  .gantt-time-row .gantt-time-input { width: 34px; min-height: 22px; padding: 1px 4px; flex: 0 0 auto; text-align: center; font-variant-numeric: tabular-nums; }
  .gantt-time-sep { color: var(--hg-text-muted); font-size: var(--hg-type-11); flex: 0 0 auto; }
  @media (max-width: 420px) {
    .gantt-setting-row { grid-template-columns: 1fr; }
  }

  /* Receipt drop zone — frosted glass band above the expenses table.
     Same token language as table headers / wire-panels: translucent
     fill + backdrop blur, no opaque beige block. */
  .receipt-drop-zone {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 16px; margin: var(--hg-tracker-side-padding) calc(var(--hg-tracker-side-padding) + 10px);
    border: 1px dashed color-mix(in srgb, var(--hg-text-ink) 35%, transparent);
    border-radius: 6px;
    background: var(--hg-frost-bg); background-clip: padding-box;
    backdrop-filter: blur(var(--hg-frost-blur-soft)); -webkit-backdrop-filter: blur(var(--hg-frost-blur-soft));
    cursor: pointer; flex-shrink: 0;
    transition: background 0.15s, border-color 0.15s, transform 0.15s;
    font-size: var(--hg-type-base); color: var(--hg-text-ink);
    box-shadow: var(--hg-frost-head-shadow);
  }
  .receipt-drop-zone:hover {
    background: var(--hg-frost-head);
    border-color: color-mix(in srgb, var(--hg-text-ink) 55%, transparent);
  }
  .receipt-drop-zone.drag-over {
    background: color-mix(in srgb, #5a8fcf 15%, transparent);
    border-color: #5a8fcf;
    transform: translateY(-1px);
  }
  .receipt-drop-zone.uploading { opacity: 0.65; pointer-events: none; }
  .receipt-drop-zone.has-pending {
    border-style: solid;
    border-color: color-mix(in srgb, #5a8fcf 60%, transparent);
    background: color-mix(in srgb, #5a8fcf 8%, transparent);
  }
  .receipt-drop-clear {
    margin-left: auto; flex-shrink: 0; cursor: pointer;
    border: none; background: transparent;
    font-size: var(--hg-type-base); color: var(--hg-text-ink); opacity: 0.6; padding: 2px 6px;
  }
  .receipt-drop-clear:hover { opacity: 1; }
  .receipt-drop-icon { font-size: var(--hg-type-18); flex-shrink: 0; }
  .receipt-drop-text { color: var(--hg-text-ink); line-height: 1.35; }
  .receipt-drop-hint { font-size: var(--hg-type-10); color: var(--hg-text-ink); opacity: 0.65; margin-left: auto; white-space: nowrap; }
  .receipt-drop-spinner {
    display: inline-block; width: 14px; height: 14px; flex-shrink: 0;
    border: 2px solid var(--hg-text-ink); border-top-color: transparent;
    border-radius: 50%; animation: spin 0.8s linear infinite;
  }
  @keyframes spin { to { transform: rotate(360deg); } }
  .receipt-link { cursor: pointer; font-size: var(--hg-type-14); text-decoration: none; color: inherit; }
  .receipt-link:hover { opacity: 0.7; }
  /* Pending-receipt flash on the add-row: draws the eye to the pre-filled
     row after a scan. Animation removes itself (no lingering highlight). */
  .cv-add-row-flash {
    animation: cv-add-row-flash 2.2s ease-out;
  }
  @keyframes cv-add-row-flash {
    0% { background: color-mix(in srgb, #5a8fcf 22%, transparent); }
    60% { background: color-mix(in srgb, #5a8fcf 22%, transparent); }
    100% { background: transparent; }
  }
  /* View stacking rules live in §2 (body flex column): .view.on flex-fills below
     the chrome, whatever its real height; scroll roots size by flex, not by
     hardcoded 100vh subtractions that drifted when the chrome changed. */
  /* Gantt filter band is the reference look — an opaque static band above the
     scroll root. Light-side band colour is the shared .gfilters base; the only
     gantt-specific rule is that it must NOT scroll with the chart (flex-shrink:0). */
  #v-tr .gantt-shell {
    flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; overflow: hidden;
    /* The whole gantt stack — chart AND docks — floats 20px off the window
       edges, and the gutter lives OUTSIDE the scrollports so scrollable
       overflow can never eat it: at narrow widths the tracks stay inset even
       with content running long. The shell now spans the window and every
       child carries the inset itself, so the gutter is INSIDE the shell and
       the floating bars can be drawn in it, out to the window edge. Same
       boxes for the children as when the shell held the margin. */
    margin: 0;
    position: relative;
  }
  #v-tr .gantt-shell > *:not(.hg-bar-v):not(.hg-bar-h) {
    margin: 0 var(--hg-tracker-side-padding);
  }
  /* GUTTER BARS — the chart and the dock own no native bar (the cell
     contract, applied here by hand), so both panes measure the same viewport
     and week cells stay X-aligned. The horizontal strip stops at the table's
     right edge and never enters the gutter; the vertical strip lives in the
     gutter. */
  #v-tr .gantt-wrap,
  #v-tr .wl-scroll { scrollbar-width: none; }
  #v-tr .gantt-wrap::-webkit-scrollbar,
  #v-tr .wl-scroll::-webkit-scrollbar { width: 0 !important; height: 0 !important; display: none !important; }
  .gantt-bar-v {
    top: 0; bottom: 0;
    right: calc(-1 * var(--hg-tracker-side-padding));
    width: var(--hg-tracker-side-padding);
    overflow-y: scroll;
    scrollbar-width: thin;
  }
  .gantt-bar-h {
    /* Stops at the table's own right edge: the horizontal scroller stays OUT
       of the gutter. The vertical strip keeps its place in the gutter. */
    right: 0;
    bottom: 0;
    height: var(--hg-tracker-side-padding);
    overflow-x: scroll;
    scrollbar-width: thin;
  }
  /* The chart's strip rides 5px clear of the row's bottom edge: the movable
     label/chart divisor grips down there and sits over the strip's left end,
     so dragging it from that side never reaches the bar. The dock's strip
     keeps bottom: 0 — it has no divisor. */
  .gantt-body > .gantt-bar-h { bottom: 5px; }
  /* 48 header + 40 tabs + gfilters — remaining height is gantt-wrap */
  /* Sibling panes: labels | chart. The labels column is a normal flex child
     whose box simply ends at the divisor; the chart scroller starts there.
     Nothing overlaps, so nothing is clipped — the frost in both panes samples
     the page normally. */
  .gantt-body {
    display: flex; flex: 1 1 auto; min-height: 0; min-width: 0;
    align-items: stretch;
    /* Anchors the scroll-hint pill (absolute child): its bottom edge is the
       dock's top edge, the band the pill floats in. As a dock child the pill
       stretched the dock's layer bounds over the boundary row — a sibling
       child here cannot. */
    position: relative;
    /* No backdrop root here: both panes must sample the page background.
       Scope hover paint at its source, not by blocking the frost input. */
  }
  .gantt-wrap {
    display: flex; overflow: auto; position: relative; flex: 1 1 auto; min-height: 0;
    align-items: flex-start;
    /* Prevent browser touch gestures (page pinch-zoom, touch panning) from
       hijacking our custom touch handlers. We handle 1-finger scroll, 2-finger
       pinch-zoom and 2-finger pan ourselves in wireGanttTouch(). */
    touch-action: none;
    /* Gutter comes from #v-tr .gantt-shell's 20px margin — no padding here.
       Padding inside a scrollport gets eaten by scrollable overflow when the
       horizontal scrollbar appears, which is exactly the bug this avoids. */
  }
  .gantt-labels {
    width: var(--hg-gantt-label-w, 380px); flex-shrink: 0; position: relative; z-index: 2;
    border-right: 1px solid var(--hg-border-na);
    display: flex; flex-direction: column; min-height: 0;
    box-shadow: 4px 0 10px #00000014;
    /* Own compositing layer (same reasoning as .gfilters/.weekhdr): the
       labels pane is a plain flex column, so its frosted rows share the root
       surface with the docks below. Every dock hover repaint (titlebar wash,
       row hovers) damages that surface and re-runs the pane's blur passes
       mid-update — the labels-only banding ghost. The chart pane is immune
       because #gscroll is a scroll container: Chromium composites it, exactly
       the isolation this rule gives the labels pane. */
    contain: layout style;
    will-change: transform;
    /* z-index 2 (set above): the divisor grab strip (::before, right: -4px)
       straddles the panes below the ruler and stays clickable over the chart
       pane; the shadow keeps the divisor affordance. */
  }
  /* Label/header column: translucent + own blur on the whole column — it
     frosts anything that would otherwise slide under it, but as SIBLING panes
     nothing actually crosses the divisor: this frost exists for the rows
     inside the column and to keep the glass look identical to the old
     sticky-column design. */
  #labelsPanel {
    /* Same touch controller as the chart: no independent native Y scroll. */
    touch-action: none;
    background: var(--hg-frost-bg);
    backdrop-filter: blur(var(--hg-frost-blur));
    -webkit-backdrop-filter: blur(var(--hg-frost-blur));
  }
  html:not(.dark) #labelsPanel {
    background: color-mix(in srgb, var(--hg-frost-ink) 4%, transparent);
  }
  /* All scrollable label rows: their own scrollport below the 42px head.
     #gscroll (the chart pane) owns the shared scroll state; this port mirrors
     its scrollTop on every scroll (ganttSyncLabelScroll), so the label rows
     stay locked to the chart rows while each pane's box truly ends at its
     own edge. */
  #labelsPanel .labels-rows {
    /* Real scroll container, bars hidden. A native scroller is composited:
       the scrollTop mirror (ganttSyncLabelScroll) then translates the layer
       instead of re-rasterising every frosted row per chart scroll frame —
       the same isolation the chart gets from #gscroll being a native
       scroller. The old scripted overflow:hidden scroll repainted the whole
       frosted subtree each frame: the labels-only banding bake. */
    overflow-x: hidden;
    overflow-y: scroll;
    scrollbar-width: none;
    flex: 1 1 auto;
    min-height: 0;
  }
  #labelsPanel .labels-rows::-webkit-scrollbar { display: none; width: 0; height: 0; }
  /* Segment label parking (breakdown model): each segment's rows live in a
     .labels-block; its .hg-lane label sticks at the band's bottom edge (42px)
     while its own rows scroll beneath it — always reachable to collapse.
     Only UNROLLED segments park (aria-expanded="true") — collapsed ones have
     no rows to scroll and stay in flow. The next segment's label pushes the
     parked one away. Translucent + blur, never opaque. */
  #labelsPanel .labels-block {
    position: relative;
  }
  #labelsPanel .labels-block > .hg-lane[aria-expanded="true"] {
    position: sticky; top: 0; z-index: 3;
    backdrop-filter: blur(var(--hg-frost-blur));
    -webkit-backdrop-filter: blur(var(--hg-frost-blur));
  }
  /* Draggable divisor between the labels column and the tracks.
     Attached to the labels column's own right edge via ::after — the labels
     column is sticky and full-height, so the grab strip spans the whole
     boundary (a standalone element inside the scroll wrap would be clipped to
     the wrap's short viewport). It takes no flow space (no gap). The 2px line
     sits centered in an 8px grab strip; wireGanttDivider toggles .div-near
     when the pointer is within 8px of the seam from EITHER side. :hover
     covers the whole panel, not the seam — never bring it back. */
  .gantt-labels::after {
    content: ''; position: absolute; top: 0; bottom: 0; right: -4px; width: 8px;
    cursor: col-resize; user-select: none; z-index: 8;
    background: linear-gradient(to right,
      transparent 3px, #c5cad4 3px, #c5cad4 5px, transparent 5px);
    transition: background .12s ease;
  }
  .gantt-labels.div-near::after { background: linear-gradient(to right,
      transparent 3px, #7a8494 3px, #7a8494 5px, transparent 5px); }
  html.dark .gantt-labels::after { background: linear-gradient(to right,
      transparent 3px, #3a3b40 3px, #3a3b40 5px, transparent 5px); }
  html.dark .gantt-labels.div-near::after { background: linear-gradient(to right,
      transparent 3px, #8a8b92 3px, #8a8b92 5px, transparent 5px); }
  /* The main ruler owns clicks on the chart side of the divider. Keep the
     full-height line, but put its resize hit area below the date header so
     a weekend wire at the viewport edge is not covered by the resize grip. */
  #labelsPanel::after { pointer-events: none; }
  #labelsPanel::before {
    content: ''; position: absolute; top: var(--gantt-head-h); bottom: 0;
    right: -4px; width: 8px; cursor: col-resize; user-select: none; z-index: 8;
  }
  .gantt-labels .labels-head { height: var(--gantt-head-h); background: transparent; border-bottom: 1px solid var(--hg-border-na); position: relative; top: 0; z-index: 7; flex-shrink: 0;
    box-shadow: inset 0 2px 4px rgba(255,255,255,.14),
                inset 0 -2px 5px rgba(15,23,42,.02);
    /* Match the week header's layer without creating a backdrop root. */
    contain: layout style;
    will-change: transform;
    /* Translucent, frosted by the column's own blur (same as the rows) —
       the head never needs to hide anything: it sits in its own sibling
       pane above the rows' scrollport, and nothing scrolls behind it. */
  }
  /* Founder (in-app comment): the plan band and the week header paint the
     Tabs colour, so the gantt's head reads as one strip with the tab row.
     ID-scoped: the new-asset modal's mini-gantt keeps its own wash. The
     token flips with theme + presets, so one rule serves both modes. */
  #labelsPanel .labels-head { background: var(--hg-surface-tabs); }
  .hg-gantt-plan-head { height: 100%; display: flex; align-items: center; gap: 10px; padding: 2px 10px; box-sizing: border-box; overflow: hidden; }
  .hg-gantt-plan-field, .hg-gantt-plan-tail { display: flex; flex-direction: column; min-width: 0; color: var(--hg-text-quiet); font-size: var(--hg-type-9); line-height: 1.15; white-space: nowrap; }
  .hg-gantt-plan-field { flex: 0 0 104px; }
  .hg-gantt-plan-tail { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; }
  .hg-gantt-plan-label { color: var(--hg-text-quiet); text-transform: uppercase; letter-spacing: .04em; }
  .hg-gantt-plan-val { display: flex; align-items: center; height: 22px; font-size: var(--hg-type-10); }
  .hg-gantt-plan-field .hg-date { width: 104px; height: 22px; padding: 1px 5px; font-size: var(--hg-type-10); }
  /* The settings cog sits on the plan band's right edge, at the head of the
     chart. Placement and box only: the button keeps the shared .block-btn
     paint it wears in the filter row. */
  .hg-gantt-plan-head .hg-gantt-cog {
    flex: 0 0 auto; margin-left: auto; width: 26px; height: 24px; padding: 0;
    contain: layout style; will-change: transform;
  }
  /* Gantt label column = the Breakdown tree's type treatment at 80% size
     (the column is space-constrained) and the SAME ink tokens — never
     bespoke hexes or sizes here. */
  .gantt-labels .hg-entity {
    display: flex; align-items: center; gap: 6px; background: transparent; padding: 0 8px 0 8px; margin-left: 8px;
    font-weight: 500; font-size: calc(var(--hg-type-12h) * 0.8); letter-spacing: 0; color: var(--hg-text-ink);
    border-bottom: 1px solid var(--seg-rule); height: 30px; box-sizing: border-box; overflow: hidden;
  }
  .gantt-labels .hg-entity .g-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .gantt-labels .hg-entity .gantt-owner-host { display: flex; align-items: center; flex-shrink: 0; margin-right: 10px; }
  .gantt-labels .hg-entity .gantt-owner-host .a-owner-label { font-size: var(--hg-type-9); color: var(--hg-text-muted); margin-right: 4px; }
  /* The sup trigger's hit area is its text. A fixed box would leave dead
     space either side of the label that opens the picker while the pointer
     sits nowhere near the word; the row itself owns the rest of the line. */
  .gantt-labels .hg-entity .gantt-owner-host .owner-pick { font-size: var(--hg-type-10); width: auto; height: 20px; padding: 0 2px; }
  .gantt-labels .hg-entity .days { margin-left: auto; flex-shrink: 0; font-weight: 600; color: var(--hg-text-ink); letter-spacing: 0; font-variant-numeric: tabular-nums; font-size: var(--hg-type-10); }
  .gantt-labels .hg-stage {
    display: flex; align-items: center; gap: 6px; padding: 0 8px 0 16px; margin-left: 16px; border-bottom: 1px solid var(--seg-rule);
    height: 30px; box-sizing: border-box; background: transparent; overflow: hidden;
  }
  /* A stage row opens its row card on a left click. The pointer marks the row
     as clickable — the same cue the segment and group rows carry. The crew
     slot inside the row keeps its own context-menu cursor. */
  .gantt-labels .hg-stage[data-task] { cursor: pointer; }
  /* The stage name underlines whenever the pointer sits on the part of the row
     that opens the card — the whole line except the crew slot and the (!)
     mark, which own their own menus. */
  .gantt-labels .hg-stage[data-task]:hover:not(:has(.who:hover, .gantt-openmark:hover, .breakdown-relations-open:hover, .reviewer-open:hover)) .g-stage {
    text-decoration: underline; text-underline-offset: 2px;
  }
  .gantt-labels .hg-stage .g-stage {
    flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    color: var(--hg-text-ink); font-size: calc(var(--hg-type-base) * 0.8); font-weight: 400;
  }
  .gantt-labels .hg-stage .who { flex-shrink: 0; color: var(--hg-text-secondary); font-size: var(--hg-type-10); max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  /* The crew read is people data — the whole slot paints with --hg-people
     (violet: the one hue no status or action family claims). Names and the
     (!) are row-editing triggers (RMB swap / RMB bulk-assign): context-menu
     cursor + a subtle underline on the names marks the affordance without
     reading as a status change. */
  .gantt-labels .hg-stage .who.gantt-crew-read { color: var(--hg-people); cursor: context-menu; }
  .gantt-labels .hg-stage .who.gantt-crew-read .gantt-crew-name:hover,
  .gantt-labels .hg-stage .who.gantt-crew-read .gantt-crew-more:hover { text-decoration: underline; text-underline-offset: 2px; }
  /* "+N" — the way to crew beyond the three shown in the slot. Reads as a
     link: pointer cursor + hover underline, LMB activates (list menu). */
  .gantt-labels .hg-stage .who.gantt-crew-read .gantt-crew-more { margin-left: 4px; font-weight: 600; cursor: pointer; }
  /* The row (!) sits OUTSIDE the ellipsized names slot as its own flex
     child of .hg-stage, so clipping can never hide it (or its click target).
     It is a link-shaped control: danger red (the unstaffed family), pointer
     cursor, underline on hover — LMB opens the bulk-assign picker. */
  .gantt-labels .hg-stage > .gantt-openmark { flex-shrink: 0; margin-left: 4px; color: var(--hg-danger-bright); font-weight: 700; cursor: pointer; }
  .gantt-labels .hg-stage > .gantt-openmark:hover { text-decoration: underline; text-underline-offset: 2px; }
  /* Menu headings ("Re-assign Sergio to:") use the shared .hg-menu-head
     structure (title + subtitle) — same as the multi-select menu. */
  /* Row-level unstaffed flag: the same (!) the bars carry — the label area
     shows the staffing gap too (after the names when only some bars are
     unstaffed, alone when all of them are). Styled above: it is a link-
     shaped control (danger red, pointer, hover underline, LMB). */
  /* Same law for the entity owner: an assigned owner is a person's name.
     Unassigned (.un) stays muted — it's a placeholder, not a person. */
  .gantt-labels .hg-entity .owner-pick:not(.un) { color: var(--hg-people); }
  /* Unassigned sup: no field fill — light twin of the html.dark rule
     (placeholder law: assigned sups are flat chrome, so the placeholder
     must be too; .owner-pick.un's base fill would read as a punched-in box). */
  .gantt-labels .hg-entity .owner-pick.un { background: transparent; }
  /* Sup has no hairline at all — assigned and unassigned alike, both modes
     (founder 2026-09-20). Un-scoped: beats every owner-pick border rule,
     including the dark ones, on specificity. */
  .gantt-labels .hg-entity .owner-pick { border-bottom: none; }
  /* Hover = link affordance, same pattern as the crew read names:
     underline on hover marks the clickable element (founder 2026-09-20). */
  .gantt-labels .hg-entity .owner-pick:hover { text-decoration: underline; text-underline-offset: 2px; }
  /* The native scroller owns only the unpainted full-size ruler. The bounded
     paint viewport owns row paint; the chart's wash and frost sit on a static
     pane behind the scroller (#ganttFrost, sized by ganttLayoutFrost). The
     pane never moves with scroll, so its blur is not recomputed per scroll
     step, and the range-fade mask on #gscroll cannot cut its backdrop. */
  #gscroll { background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; }
  .gantt-paint-viewport { position: absolute; overflow: clip; contain: paint; z-index: 1; }
  .gantt-label-ghost-viewport { position: absolute; overflow: clip; contain: paint; pointer-events: none; z-index: 6; }
  .gantt-frost {
    /* z 0 and earlier in DOM order than #gscroll: the pane always paints
       BELOW the chart. The range-fade mask makes #gscroll a stacking
       context, so the chart cannot rely on its inner z-indexes to rise
       over a sibling pane; a pane above z 0 would cover the rows. */
    position: absolute; pointer-events: none; z-index: 0;
    background: color-mix(in srgb, var(--hg-frost-ink) 4%, transparent);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
  }
  #ganttPaintWorld { position: relative; }
  .gantt-timeline { flex: 1; min-width: 0; position: relative; z-index: 1; overflow: visible; }
  /* Only the bounded chart/header boxes own stacking layers. The full-size
     main timeline is a layout ruler, not a drawing surface. */
  #timelinePanel { z-index: auto; }
  /* z 70 — above every chart overlay (ms/today spikes z 2, #linkLayer z 55,
     #ganttSplitLine z 60). The old clip used to cut all of #ganttBody at the
     band edge; with sibling panes there is no clip, so paint order alone
     keeps the band off-limits: no full-height overlay may cross it. */
  .gantt-timeline .weekhdr { position: sticky; top: 0; z-index: 70; }
  #ganttBody { position: relative; }
  /* Faint scroll hint — absolutely positioned inside .gantt-body, floating
     in the band just above the body's bottom edge (the crew dock's top
     edge), so it overlays the chart's bottom-right corner. Outside #gscroll,
     so it never scrolls out of view; it moves naturally with the body's
     edge when docks expand/collapse. Sibling of the panes, NOT a dock
     child — see the rule below. pointer-events:none so it never blocks. */
  .gantt-scroll-hint {
    position: absolute;
    right: 8px;
    bottom: 14px; /* pill bottom sits 14px above the body's bottom edge;
                     with its ~18px height that reproduces the original band
                     (14–32px above the dock's top) exactly */
    z-index: 10;
    pointer-events: none;
    user-select: none;
    font-size: var(--hg-type-10);
    font-weight: 400;
    letter-spacing: .02em;
    color: #8a93a380;
    background: rgba(255,255,255,.72);
    padding: 2px 8px;
    border-radius: 4px;
    /* No backdrop-filter: the hint floats OVER the gantt viewport's bottom
       corner, so its frost re-sampled live content on every chart scroll and
       every dock repaint — the last stale-bake source. A flat translucent
       pill reads identically over the busy chart corner. */
    /* Lives in .gantt-body, NOT inside the dock: as a dock child the pill
       escaped 32px above the dock's box, and a composited layer's bounds
       are the union of its descendants — so the dock's frost-sampling
       region reached the labels row nearest the boundary and every dock
       repaint re-ran that frost over the row (the boundary-row banding).
       Promoting the pill could not shrink the parent's bounds; only moving
       it out of the subtree does. Own layer kept: its static paint stays
       out of the chart's scroll churn. */
    contain: layout style;
    will-change: transform;
    white-space: nowrap;
  }
  /* Touch devices show different instructions (pinch/2-finger instead of Alt/MMB).
     We show/hide via (pointer: coarse) media query so the right hint appears
     automatically on touch displays without JS detection. */
  .gantt-scroll-hint .hint-mouse { display: inline; }
  .gantt-scroll-hint .hint-touch { display: none; }
  @media (pointer: coarse) {
    .gantt-scroll-hint .hint-mouse { display: none; }
    .gantt-scroll-hint .hint-touch { display: inline; }
  }
  /* ===== 4e. workload dock (sibling above cashflow; worker × week day grid) =====
       Share week X-scale with Gantt. Horizontal scroll synced in js/workload.js.
       ONE scroller: each worker is name+cells on the SAME row (sticky name).
       Body height = min(all rows, half window − title) via --wl-body-h. */
    .workload-dock {
      flex-shrink: 0; box-sizing: border-box;
      display: flex; flex-direction: column;
      height: calc(28px + var(--wl-body-h, 156px)); /* title + body */
      border-top: 2px solid var(--hg-accent);
      background: var(--hg-frost-bg);
      backdrop-filter: blur(var(--hg-frost-blur-soft)); -webkit-backdrop-filter: blur(var(--hg-frost-blur-soft));
      position: relative; z-index: 9;
      /* overflow visible: the wl-body has its own overflow:hidden to clip
         its content. (The scroll hint no longer lives inside this dock —
         it is a .gantt-body child, so nothing escapes the dock's box.) */
      overflow: visible;
      transition: height .22s ease;
      /* Own compositing layer (same reasoning as .gfilters/.weekhdr): the
         dock paints into the root surface the labels frost samples behind
         it — every hover wash and scroll-synced repaint re-runs the labels'
         blur passes mid-update: the labels-only banding. Its damage now
         stops at its own layer bounds. contain: layout style omits paint
         containment on purpose: overflow stays visible so the scroll hint
         still renders above the dock. */
      contain: layout style;
      will-change: transform;
      /* Gutter inherited from #v-tr .gantt-shell's margin — the dock bar
         sits flush inside the shell so its scroll viewport width matches
         the chart's exactly and week cells stay X-aligned. */
    }
    /* The dock's top edge is the seam with the chart AND its drag handle: the
       pointer grabs it to choose how many crew rows the heatmap shows. The
       grab strip is a ::before that reaches past the 2px accent border to 6px
       above the box (an absolute box measures from the padding box), so the
       pointer over the seam still targets the dock; the border is the visible
       line. Same shape as the label divider's strip. */
    .workload-dock::before {
      content: ''; position: absolute; left: 0; right: 0; top: -8px; height: 10px;
      z-index: 10; cursor: row-resize;
      background: transparent;
      transition: background .12s ease;
    }
    .workload-dock.dock-near::before,
    .workload-dock.is-resizing::before {
      background: color-mix(in srgb, var(--hg-accent) 22%, transparent);
    }
    /* A live drag sets the height every frame — the expand/collapse ease would
       trail the pointer. */
    .workload-dock.is-resizing,
    .workload-dock.is-resizing .wl-body {
      transition: none;
    }
    .workload-dock.is-collapsed {
      height: 28px;
    }
    .workload-dock .wl-titlebar {
      flex-shrink: 0; height: 28px; box-sizing: border-box;
      display: flex; align-items: center; gap: 8px;
      padding: 0 12px;
      /* Opaque: the dock header must not let the page or the background skin
         read through it (the sheet and head washes over the surface base). An
         opaque fill makes the blur pointless, so it goes with it. */
      background: var(--hg-frost-head-solid);
      border-bottom: 1px solid var(--hg-hairline);
      cursor: pointer; user-select: none;
      color: #5a3d2e; font-size: var(--hg-type-11); font-weight: 600;
      letter-spacing: .03em;
      /* Own layer: its hover wash must repaint without re-rasterising the
         dock's frost below it (same law as .gfilters/.weekhdr). */
      contain: layout style;
      will-change: transform;
    }
    .workload-dock .wl-titlebar:hover {
      background: color-mix(in srgb, var(--hg-accent) 10%, var(--hg-frost-head-solid));
    }
    .workload-dock .wl-titlebar:focus-visible {
      outline: 2px solid #b07050; outline-offset: -2px;
    }
    /* Focus toggle: box shape only — the paint is .block-btn's own. A 20px
       square rests with 4px of the 28px title bar above and below it; the
       shared 27px box filled the row edge to edge. */
    .workload-dock .wl-focus-btn {
      flex: 0 0 auto; width: 20px; height: 20px; padding: 0;
      display: inline-flex; align-items: center; justify-content: center;
    }
    .workload-dock .wl-caret {
      display: inline-block; font-size: var(--hg-type-10);
      line-height: 1; color: #7a5a48;
      transition: transform .22s ease;
    }
    .workload-dock.is-collapsed .wl-caret {
      transform: rotate(-90deg);
    }

    .workload-dock .wl-titlebar-meta {
      margin-left: auto; font-weight: 600; color: #6a5548;
      font-variant-numeric: tabular-nums; letter-spacing: 0;
    }
    .workload-dock .wl-titlebar-meta.is-warn {
      color: var(--hg-danger);
    }
    .workload-dock .wl-body {
      flex: 0 0 auto;
      height: var(--wl-body-h, 156px); box-sizing: border-box;
      display: flex; min-height: 0;
      overflow: hidden;
      transition: height .22s ease;
      /* Own layer: worker-row hover washes and the over-capacity heat pulse
         repaint every frame inside the dock — their damage must stop here
         and never re-rasterise the dock's frost, whose input is the gantt
         row above the boundary (the banding bake). */
      contain: layout style;
      will-change: transform;
      /* Gutter comes from .workload-dock's 20px margin — no body padding,
         so the dock scroll viewport width matches .gantt-wrap's exactly
         and week cells stay X-aligned at every scrollLeft. */
    }
    .workload-dock.is-collapsed .wl-body {
      height: 0;
    }
    /* Sibling panes: names column | cells scroller — the same shape as the
       gantt's labels | chart. The names pane's box ends AT the divisor and
       the scroller starts there, so heat can never render across it. */
    .workload-dock .wl-names {
      flex: 0 0 auto;
      width: var(--hg-gantt-label-w, 380px); box-sizing: border-box;
      border-right: 1px solid var(--hg-hairline);
      display: flex; flex-direction: column;
      min-height: 0; overflow: hidden;
    }
    /* Mirror scrollport — scrollTop is driven by wlSyncNamesScroll (never
       scrolls natively; overflow:hidden still allows programmatic scrollTop). */
    .workload-dock .wl-name-rows {
      flex: 1 1 auto; min-height: 0;
      overflow: hidden;
    }
    /* Cells scroller: X mirrored from Gantt, Y for long crew lists
       (the names pane mirrors that Y via wlSyncNamesScroll). */
    .workload-dock .wl-scroll {
      flex: 1; min-width: 0;
      overflow: auto;
      position: relative;
      scrollbar-width: thin;
    }
    #workloadPanel {
      position: relative; min-width: 100%;
      height: var(--wl-track-h, 156px);
      background: transparent;
    }
    #wlTrack {
      position: relative; width: 100%; height: 100%;
      display: flex; flex-direction: column;
    }
    /* Focus toggle (founder correction 2026-10-07): while ON, the rows not
       in the dock selection are hidden. The toggle itself paints .on on the
       button. A row is hidden only while Focus is ON. */
    .workload-dock .wl-worker-row.wl-hid { display: none; }

    /* Each worker: a names-pane row and a cells-pane row, one per pane —
       paired for hover so either side lights both (wireWorkloadHoverSync). */
    .workload-dock .wl-worker-row {
      display: flex; flex-direction: row; align-items: stretch;
      height: 26px; flex-shrink: 0; box-sizing: border-box;
      border-bottom: 1px solid var(--hg-border-cell);
      cursor: pointer; user-select: none;
    }
    .workload-dock .wl-worker-row:hover .wl-name,
    .workload-dock .wl-worker-row.hover-pair .wl-name {
      background: var(--hg-surface-header);
    }
    .workload-dock .wl-worker-row:hover .wl-cells,
    .workload-dock .wl-worker-row.hover-pair .wl-cells {
      background: color-mix(in srgb, var(--hg-surface-header) 40%, transparent);
    }
    .workload-dock .wl-worker-row:focus-visible {
      outline: 2px solid #b07050; outline-offset: -2px;
    }
    .workload-dock .wl-worker-row.is-active .wl-name {
      background: var(--hg-surface-tabs);
      color: var(--hg-text-ink);
      font-weight: 700;
      box-shadow: inset 3px 0 0 var(--hg-accent);
    }
    .workload-dock .wl-worker-row.is-active .wl-cells {
      background: color-mix(in srgb, var(--hg-surface-tabs) 40%, transparent);
    }
    .workload-dock .wl-worker-row.is-active .wl-cell:not(.is-overload):not(.is-underutilized) {
      background: color-mix(in srgb, var(--hg-surface-tabs) 60%, transparent);
    }
    .workload-dock .wl-name {
      flex: 1 1 auto; min-width: 0;
      display: flex; align-items: center;
      padding: 0 12px 0 16px;
      /* Transparent so the dock body's frost shows through, matching the
         sheet/cell area exactly. The divisor is the .wl-names pane's
         border-right — the name itself carries no chrome. */
      background: transparent;
      font-size: var(--hg-type-11h); font-weight: 500; color: #3c322c;
      white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    }
    .workload-dock .wl-name-empty {
      color: #8a7364; font-weight: 500; font-style: italic;
      cursor: default;
    }
    .workload-dock .wl-name.has-absence-actions { padding-right: 2px; }
    .workload-dock .wl-name-text {
      overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    }
    .workload-dock .wl-cells {
      position: relative; flex: 0 0 auto;
      height: 26px; box-sizing: border-box;
      background: transparent;
    }
    .workload-dock .wl-cell {
      position: absolute; top: 0; bottom: 0;
      box-sizing: border-box;
      border-left: 1px solid var(--hg-border-cell);
      display: flex; align-items: center; justify-content: center;
      font-size: var(--hg-type-small); font-weight: 600;
      font-variant-numeric: tabular-nums;
      color: #5a5048;
      background: transparent;
    }
    .workload-dock .wl-cell.has-load {
      background: #d9e4f244;
      color: #2f3b4d;
    }
    /* Over capacity (>5 workdays in the week column) */
    .workload-dock .wl-cell.is-overload {
      background: color-mix(in srgb, var(--hg-danger) 20%, transparent);
      color: #a02820;
      border-left-color: color-mix(in srgb, var(--hg-danger) 40%, transparent);
      font-weight: 700;
      animation: wl-overload-pulse 1.6s ease-in-out infinite;
      will-change: box-shadow, filter;
      z-index: 1;
    }
    @keyframes wl-overload-pulse {
      0%, 100% {
        box-shadow:
          inset 0 0 0 1px rgba(192, 57, 43, 0.35),
          0 0 4px rgba(192, 57, 43, 0.35),
          0 0 10px rgba(192, 57, 43, 0.2);
        filter: brightness(1);
      }
      50% {
        box-shadow:
          inset 0 0 0 1px rgba(192, 57, 43, 0.85),
          0 0 8px rgba(192, 57, 43, 0.85),
          0 0 18px rgba(192, 57, 43, 0.55),
          0 0 28px rgba(224, 80, 70, 0.35);
        filter: brightness(1.15);
      }
    }
    @media (prefers-reduced-motion: reduce) {
      .workload-dock .wl-cell.is-overload {
        animation: none;
        box-shadow:
          inset 0 0 0 1px rgba(192, 57, 43, 0.7),
          0 0 8px rgba(192, 57, 43, 0.55);
      }
    }

    /* Quiet capacity warnings retain the load signal without motion or elevation. */
    .workload-dock .wl-cell.is-underutilized.is-underutilized-quiet {
      --wl-quiet-dot: var(--wl-quiet-underload-dot);
    }
    .workload-dock .wl-cell.is-overload.is-overload-quiet,
    html.dark .workload-dock .wl-cell.is-overload.is-overload-quiet,
    .workload-dock .wl-cell.is-underutilized.is-underutilized-quiet,
    html.dark .workload-dock .wl-cell.is-underutilized.is-underutilized-quiet {
      background: radial-gradient(circle, var(--wl-quiet-dot, var(--wl-quiet-overage-dot)) 1.25px, transparent 1.25px) 0 0 / 6px 6px;
      color: var(--wl-quiet-overage-ink);
      border-left-color: var(--hg-border-cell);
      font-weight: 600;
      animation: none;
      box-shadow: none;
      filter: none;
      will-change: auto;
      z-index: auto;
    }

    /* Underutilized — idle capacity between tasks (gap weeks) */
    .workload-dock .wl-cell.is-underutilized {
      background: color-mix(in srgb, #e67e22 12%, transparent);
      color: #b3620a;
      border-left-color: color-mix(in srgb, #e67e22 30%, transparent);
      font-weight: 500;
      animation: wl-underutil-pulse 2s ease-in-out infinite;
      will-change: box-shadow, filter;
      z-index: 1;
    }
    @keyframes wl-underutil-pulse {
      0%, 100% {
        box-shadow:
          inset 0 0 0 1px rgba(230, 126, 34, 0.2),
          0 0 3px rgba(230, 126, 34, 0.15);
        filter: brightness(1);
      }
      50% {
        box-shadow:
          inset 0 0 0 1px rgba(230, 126, 34, 0.55),
          0 0 6px rgba(230, 126, 34, 0.5),
          0 0 14px rgba(230, 126, 34, 0.3);
        filter: brightness(1.08);
      }
    }
    @media (prefers-reduced-motion: reduce) {
      .workload-dock .wl-cell.is-underutilized {
        animation: none;
        box-shadow:
          inset 0 0 0 1px rgba(230, 126, 34, 0.45),
          0 0 6px rgba(230, 126, 34, 0.35);
      }
    }

    /* ── crew-dock mode toggle — underline style matching .tab ── */
    .workload-dock .wl-mode-pill {
      display: inline-flex; align-items: stretch; gap: 14px;
      height: 100%;
    }
    .workload-dock .wl-mode-btn {
      appearance: none; border: 0; background: transparent; cursor: pointer;
      padding: 0; font-size: var(--hg-type-11); font-weight: 500; color: #8a7364;
      letter-spacing: .02em; font-family: inherit;
      border-bottom: 2px solid transparent;
      height: 100%; box-sizing: border-box;
    }
    .workload-dock .wl-mode-btn:hover { color: #5a3d2e; }
    .workload-dock .wl-mode-btn.is-active {
      color: #5a3d2e; border-bottom-color: #5a3d2e; font-weight: 600;
    }
    .workload-dock .wl-mode-btn:focus-visible {
      outline: 2px solid #b07050; outline-offset: -2px;
    }
    html.dark .workload-dock .wl-mode-btn { color: #7a6558; }
    html.dark .workload-dock .wl-mode-btn:hover { color: #d2c4b8; }
    html.dark .workload-dock .wl-mode-btn.is-active {
      color: #d2c4b8; border-bottom-color: #d2c4b8;
    }

    /* ── continuous license bars (Licenses mode) ───────────────────────── */
    .workload-dock .wl-lic-cells { overflow: hidden; }
    .workload-dock .wl-lic-bar {
      position: absolute; height: 8px; box-sizing: border-box;
      border-radius: 3px;
      background: var(--lic-hue, #4a7ab5);
      color: var(--hg-text-on-accent); font-size: var(--hg-type-9); font-weight: 600; line-height: 8px;
      padding: 0 5px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
      pointer-events: auto; cursor: default;
      z-index: 1;
    }
    .workload-dock .wl-lic-bar.is-contended {
      background: var(--hg-danger);
      animation: wl-overload-pulse 1.6s ease-in-out infinite;
      z-index: 2;
    }
    html.dark .workload-dock .wl-lic-bar { color: var(--hg-text-bright); }
    .workload-dock .wl-name-lic-sub {
      font-size: var(--hg-type-10); color: #8a7364; font-weight: 400;
      margin-left: 8px; letter-spacing: 0;
      overflow: hidden; text-overflow: ellipsis;
    }
    html.dark .workload-dock .wl-name-lic-sub { color: #7a6558; }
    @media (prefers-reduced-motion: reduce) {
      .workload-dock .wl-lic-bar.is-contended { animation: none; }
    }

    /* ── crew-sheet: seats panel + window dates ────────────────────────── */
    .cs-win-cell {
      white-space: nowrap; font-size: var(--hg-type-11);
    }
    .cs-win-cell input[type="date"] {
      border: 1px solid transparent; border-radius: 4px;
      padding: 2px 5px; font-size: var(--hg-type-11); width: 118px;
      background: var(--hg-input-bg); color: inherit; font-family: inherit;
    }
    .cs-win-cell input[type="date"]:focus {
      border-color: var(--hg-border-focus); outline: none;
      /* fill NOT restated — unified: idle = selected */
    }
    html.dark .cs-win-cell input[type="date"]:focus {
      border-color: var(--hg-border-control); color: var(--hg-text-bright);
      /* fill NOT restated — unified: idle = selected */
    }
    .cs-win-arrow { color: var(--hg-text-dim); margin: 0 2px; }
    /* Crew row caret — the shared .tw control; only the cursor differs, because
       the whole crew row is the click target. */
    #crewTable tr.cs-row .tw { cursor: default; }
    #crewTable tr.cs-row.open .tw { transform: rotate(90deg); }

    .cs-lic-del {
      border: none; background: none; color: inherit; cursor: pointer;
      font-size: var(--hg-type-base); padding: 0 4px; line-height: 1;
    }
    .cs-lic-del:hover { color: var(--hg-danger-ink); }
    /* Engagement panel (person's projects). One column template per list is
       inherited by the header band and by every row, so a cell can never
       drift from its label. Every cell is a clipping box: a value that runs
       out of room ends in an ellipsis instead of crossing the column edge. */
    .cs-eng-list {
      --cs-eng-cols: minmax(0, 1.6fr) 120px 110px 14px 110px 24px;
      /* The panel fills the width the table gives it and never asks for more:
         without this, a long project name would widen a max-content table. */
      contain: inline-size;
    }
    .cs-eng-list.cs-eng-t1 {
      --cs-eng-cols: minmax(0, 1.6fr) 120px 110px 14px 110px 70px 70px
                     minmax(0, 1.1fr) minmax(0, 1.1fr) 24px;
    }
    .cs-eng-row {
      display: grid; grid-template-columns: var(--cs-eng-cols);
      align-items: center; gap: 10px;
      font-size: var(--hg-type-11); padding: 3px 0; border-bottom: 1px dotted var(--hg-hairline);
    }
    .cs-eng-row:last-child { border-bottom: 0; }
    .cs-eng-row > * {
      min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    }
    .cs-eng-row .cs-eng-input { display: block; width: 100%; max-width: 100%; }
    .cs-eng-row .cs-lic-arrow { text-align: center; }
    .cs-eng-row .cs-eng-del { width: 100%; }
    .cs-eng-head {
      border-bottom: 1px solid var(--hg-border-chrome);
      padding: 2px 0 4px;
    }
    .cs-eng-hd {
      font-size: var(--hg-type-10); text-transform: uppercase;
      letter-spacing: .05em; font-weight: 700; color: var(--hg-text-label);
      white-space: nowrap;
    }
    .cs-eng-proj { font-size: var(--hg-type-base); font-weight: 600; color: inherit; }
    /* A finished assignment recedes: the project, its window and its seats
       read as past work while every field stays editable. */
    .cs-eng-row.past .cs-eng-proj,
    .cs-eng-row.past .cs-eng-input { color: var(--hg-text-muted); }
    .cs-eng-row.past .cs-eng-input {
      border-color: var(--hg-border-row); background: transparent;
    }
    /* Engagement unit: dashed seam under the crew row; 10px page-coloured
       gaps set the expanded unit apart from its neighbours - above the
       expanded row and below its panel. */
    #v-cs #crewTable tr.cs-row.open > td {
      border-top: 10px solid var(--hg-surface-base);
    }
    #v-cs #crewTable tr.cs-eng-panel.open + tr.cs-row.open > td { border-top: 0; }
    #v-cs #crewTable tr.cs-eng-panel > td {
      background: transparent; border-top: 1px dashed var(--hg-border-control);
      border-bottom: 10px solid var(--hg-surface-base);
    }
    .cs-eng-empty { color: var(--hg-text-dim); font-size: var(--hg-type-11); padding: 4px 0; }
    .cs-eng-row .cs-eng-input {
      font-size: var(--hg-type-11); padding: 3px 6px;
      border: 1px solid var(--hg-border-control); border-radius: 4px;
      background: var(--hg-input-bg); color: var(--hg-text-ink); font-family: inherit;
    }
    .cs-eng-row .cs-eng-input:focus { outline: none; border-color: var(--hg-accent); }

    /* Force CrewSheet centered in the window.
    .view.on is a flex column; the .doc child centers via its own auto margins. */
    /* Crew is a standalone top-level view (between Client and Breakdown).
       The shared .view.on rule already gives it the flex-column locked stack;
       only the scroll root + actions below it need view-level sizing. */
    #v-cs .cs-scroll {
      flex: 1 1 auto; max-height: none; min-height: 0;
      overflow: auto; padding: 0; box-sizing: border-box;
    }
    #v-cs #crewTable {
      width: max-content;
      table-layout: auto;
      border-collapse: separate; border-spacing: 0;
      margin: 0 auto;
    }
    /* Natural state: intrinsic auto columns, centered. The shared controller
       switches all trackers to .hg-tracker-compressed only below this width. */
    #v-cs #crewTable, :is(#v-lc, #v-eq) table.track, #v-ex table.track, #v-cliInv table.track, #v-ctiInv table.track , #v-rc table.track { display: table; width: max-content; min-width: 0; table-layout: auto; margin: 0 auto; }
    /* One-line header law (founder 2026-09-26): tracker headers never wrap.
       The allocator floors every column at its header label on one line
       (hgHeaderMinWidths in tracker-width.js), so a header is always at
       least as wide as its own label — nowrap only guards sub-pixel
       rounding, never truncates a label. */
    #v-ex table.track th, :is(#v-lc, #v-eq) table.track th, #v-cliInv table.track th, #v-ctiInv table.track th, #v-rc table.track th { white-space: nowrap; }
    #v-cs #crewTable.hg-tracker-compressed, :is(#v-lc, #v-eq) .it-scroll table.track.hg-tracker-compressed, #v-ex .exp-scroll table.track.hg-tracker-compressed, #v-cliInv .cli-inv-scroll table.track.hg-tracker-compressed, #v-ctiInv .cti-inv-scroll table.track.hg-tracker-compressed , #v-rc .rc-scroll table.track.hg-tracker-compressed, .ov-scroll .cf-forecast-scroll table.track.hg-tracker-compressed table.track.hg-tracker-compressed { width: 100%; table-layout: fixed; }
    #v-cs #crewTable.hg-tracker-compressed td, #v-cs #crewTable.hg-tracker-compressed th,
    :is(#v-lc, #v-eq) table.track.hg-tracker-compressed td, :is(#v-lc, #v-eq) table.track.hg-tracker-compressed th,
    #v-ex table.track.hg-tracker-compressed td, #v-ex table.track.hg-tracker-compressed th,
    #v-cliInv .cli-inv-scroll table.track.hg-tracker-compressed td, #v-cliInv .cli-inv-scroll table.track.hg-tracker-compressed th,
    #v-ctiInv .cti-inv-scroll table.track.hg-tracker-compressed td, #v-ctiInv .cti-inv-scroll table.track.hg-tracker-compressed th.hg-tracker-compressed td.hg-tracker-compressed th, .ov-scroll .cf-forecast-scroll table.track.hg-tracker-compressed td{ overflow: hidden; }
    #v-cs #crewTable.hg-tracker-compressed input, #v-cs #crewTable.hg-tracker-compressed button,
    :is(#v-lc, #v-eq) table.track.hg-tracker-compressed input, :is(#v-lc, #v-eq) table.track.hg-tracker-compressed button,
    #v-ex table.track.hg-tracker-compressed input, #v-ex table.track.hg-tracker-compressed button,
    #v-cliInv .cli-inv-scroll table.track.hg-tracker-compressed input, #v-cliInv .cli-inv-scroll table.track.hg-tracker-compressed button,
    #v-ctiInv .cti-inv-scroll table.track.hg-tracker-compressed input, #v-ctiInv .cti-inv-scroll table.track.hg-tracker-compressed button.hg-tracker-compressed input.hg-tracker-compressed button, .ov-scroll .cf-forecast-scroll table.track.hg-tracker-compressed input{ min-width: 0; max-width: none; }
    /* Expenses + IT only: factory inline style="width:NNpx" must yield to the
       colgroup under table-layout:fixed. Checkboxes/radios are EXCLUDED so
       Pick never stretches. Delete (cv-del) is a bare button with no fixed
       width — width:100% is fine (centred glyph in a 34px cell). */
    #v-ex .exp-scroll table.track.hg-tracker-compressed input:not([type="checkbox"]):not([type="radio"]),
    #v-ex .exp-scroll table.track.hg-tracker-compressed button,
    :is(#v-lc, #v-eq) .it-scroll table.track.hg-tracker-compressed input:not([type="checkbox"]):not([type="radio"]),
    :is(#v-lc, #v-eq) .it-scroll table.track.hg-tracker-compressed button table.track.hg-tracker-compressed input:not([type="checkbox"]):not([type="radio"]) table.track.hg-tracker-compressed button { width: 100% !important; box-sizing: border-box; }
    #v-ex .exp-scroll table.track.hg-tracker-compressed td > span,
    :is(#v-lc, #v-eq) .it-scroll table.track.hg-tracker-compressed td > span,
    #v-cliInv .cli-inv-scroll table.track.hg-tracker-compressed td > span,
    #v-ctiInv .cti-inv-scroll table.track.hg-tracker-compressed td > span,
    #v-rc .rc-scroll table.track.hg-tracker-compressed td > span table.track.hg-tracker-compressed td > span {
      display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    }
    /* Client Inv / Contractor Inv: same inline-width
       override as Expenses/IT. These have NO checkbox columns — only
       text inputs, selects/date buttons, and the delete ✕ / + add button. */
    #v-cliInv .cli-inv-scroll table.track.hg-tracker-compressed input,
    #v-cliInv .cli-inv-scroll table.track.hg-tracker-compressed button,
    #v-ctiInv .cti-inv-scroll table.track.hg-tracker-compressed input,
    #v-ctiInv .cti-inv-scroll table.track.hg-tracker-compressed button,
    #v-rc .rc-scroll table.track.hg-tracker-compressed input,
    #v-rc .rc-scroll table.track.hg-tracker-compressed button { width: 100% !important; box-sizing: border-box; }
    /* Delete / add glyphs stay intrinsic in their narrow chrome cell. */
    #v-ex .exp-scroll table.track.hg-tracker-compressed button.cv-del,
    :is(#v-lc, #v-eq) .it-scroll table.track.hg-tracker-compressed button.cv-del,
    #v-cliInv .cli-inv-scroll table.track.hg-tracker-compressed button.cv-del,
    #v-ctiInv .cti-inv-scroll table.track.hg-tracker-compressed button.cv-del,
    #v-rc .rc-scroll table.track.hg-tracker-compressed button.cv-del,
    #v-ex .exp-scroll table.track.hg-tracker-compressed button.cv-add-btn,
    #v-cliInv .cli-inv-scroll table.track.hg-tracker-compressed button.cv-add-btn,
    #v-ctiInv .cti-inv-scroll table.track.hg-tracker-compressed button.cv-add-btn,
    #v-rc .rc-scroll table.track.hg-tracker-compressed button.cv-add-btn table.track.hg-tracker-compressed button.cv-del,
    /* Recruitment skill tag pills are buttons — keep them intrinsic so the
       width:100% rule above doesn't stretch each pill across the cell. */
    #v-rc .rc-scroll table.track.hg-tracker-compressed button.a-tag,
    #v-rc .rc-scroll table.track.hg-tracker-compressed button.rc-skill-pill {
      width: auto !important;
      min-width: 0 !important;
      max-width: none !important;
      display: inline-block;
    }
    /* Chrome columns: checkbox stays the global 12×12 control (never
       width:auto — that overrode the 12px rule and collapsed it under
       min-width:0). Delete glyph stays intrinsic too. */
    :is(#v-lc, #v-eq) .it-scroll table.track.hg-tracker-compressed input.it-pick,
    :is(#v-lc, #v-eq) .it-scroll table.track.hg-tracker-compressed input[type="checkbox"] {
      width: 12px !important;
      height: 12px !important;
      min-width: 12px !important;
      max-width: 12px !important;
      display: block;
      margin: 0 auto;
    }
    #v-ex .exp-scroll table.track.hg-tracker-compressed button.cv-del,
    :is(#v-lc, #v-eq) .it-scroll table.track.hg-tracker-compressed button.cv-del table.track.hg-tracker-compressed button.cv-del {
      width: auto !important;
      min-width: 0 !important;
      display: inline-block;
    }
    /* IT Tracker header is outside the tbody scroll viewport. */
    :is(#v-lc, #v-eq).view.on { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; overflow: hidden; }
    :is(#v-lc, #v-eq) .it-scroll { flex: 1 1 auto; min-height: 0; overflow: auto; margin: 0; padding: 0; box-sizing: border-box; }
    /* Licenses tab: the holdings table takes ALL the space the heatmap dock
       leaves (flex: 1 1 auto); the dock sizes to its content and caps at
       half the tab. */
    /* ── License heatmap (dock-idiom, axes swapped: rows = kinds) ──
       The ruler IS the gantt's weekhdr band (ganttHeaderHtml + the unified
       grid overlay), living inside the scroller as a sticky band — the
       gantt's own mechanism, so horizontal scrolling carries it with the
       track and the day/week/month tiers + hour/minute marks behave
       exactly like the gantt's. The names pane is the dock's sibling
       contract (divisor at --hg-gantt-label-w, scrollTop mirror,
       horizontal-scrollbar reserve). */
    /* The heatmap is a FIXED DOCK (founder 2026-09-30): it lives OUTSIDE
       the .it-scroll cell, a sibling of the lane shell, so no amount of
       table scrolling can push it off the bottom — the table scrolls above
       it and the dock's own .lh-scroll scrolls its timeline independently.
       The old sticky-in-cell design scrolled the dock away with the table:
       sticky does not re-stick inside the locked cell in this Chromium
       (verified in-app 2026-09-26), and the dock vanished off-screen as
       the table scrolled. max-height: 50% of the tab keeps the dock from
       consuming more than half the view; the side/bottom insets keep the
       lane gutter vocabulary. */
    :is(#licenseHeatmap, #equipmentHeatmap) { flex: 0 0 auto; max-height: 50%; min-height: 0; display: flex; flex-direction: column; overflow: hidden; margin: 0 var(--hg-tracker-side-padding) var(--hg-tracker-side-padding); padding: 0; border-top: 1px solid var(--hg-hairline); box-sizing: border-box; background: var(--hg-surface-base); }
    :is(#licenseHeatmap, #equipmentHeatmap) .lh-empty { padding: 18px 0; text-align: center; font-size: 12px; color: var(--hg-text-dim, #8a93a3); }
    :is(#licenseHeatmap, #equipmentHeatmap) .lh-body { flex: 1 1 auto; min-height: 0; display: flex; }
    :is(#licenseHeatmap, #equipmentHeatmap) .lh-names { flex: 0 0 auto; box-sizing: border-box; border-right: 1px solid var(--hg-hairline); display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
    /* Twin of the ruler: the labels pane's 42px head band in the header
       surface colour (the gantt's .labels-head contract) — rows below it
       align with the track under the sticky ruler. */
    :is(#licenseHeatmap, #equipmentHeatmap) .lh-names-head { flex: 0 0 auto; height: var(--gantt-head-h, 42px); background: var(--hg-surface-header); border-bottom: 1px solid var(--hg-hairline); box-sizing: border-box; }
    /* Mirror scrollport — scrollTop driven by _lhRefresh (the gantt
       labels-rows / dock wlNameRows contract: never scrolls natively,
       overflow:hidden still allows programmatic scrollTop). */
    :is(#licenseHeatmap, #equipmentHeatmap) .lh-names-port { flex: 1 1 auto; min-height: 0; overflow: hidden; }
    :is(#licenseHeatmap, #equipmentHeatmap) .lh-name { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; padding: 0 12px; border-bottom: 1px solid var(--hg-hairline); box-sizing: border-box; }
    :is(#licenseHeatmap, #equipmentHeatmap) .lh-name-t { font-size: 12px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    :is(#licenseHeatmap, #equipmentHeatmap) .lh-name-p { font-size: 10px; color: var(--hg-text-dim, #8a93a3); flex: 0 0 auto; }
    :is(#licenseHeatmap, #equipmentHeatmap) .lh-scroll { flex: 1 1 auto; min-width: 0; overflow: auto; position: relative; box-sizing: border-box; scrollbar-width: thin; }
    /* The heatmap's own head band keeps the Top shade; it is not the main
       gantt ruler (the heatmap's band is the same .weekhdr chrome without
       the ID, so #weekhdr's Tabs rule does not reach it). */
    :is(#licenseHeatmap, #equipmentHeatmap) .lh-hdr { background: var(--hg-surface-header); }
    :is(#licenseHeatmap, #equipmentHeatmap) .lh-track { position: relative; }
    :is(#licenseHeatmap, #equipmentHeatmap) .lh-row { position: absolute; left: 0; right: 0; }
    /* Dock cell idiom: the cell owns its left seam (the standard cell
       hairline), the ruler above carries the gantt's own overlay lines. */
    :is(#licenseHeatmap, #equipmentHeatmap) .lh-cell { position: absolute; top: 0; bottom: 0; display: flex; align-items: center; justify-content: center; font-size: var(--hg-type-small); font-weight: 600; font-variant-numeric: tabular-nums; box-sizing: border-box; border-left: 1px solid var(--hg-border-cell); color: #5a5048; background: transparent; }
    :is(#licenseHeatmap, #equipmentHeatmap) .lh-cell.has-load { background: #d9e4f244; color: #2f3b4d; cursor: pointer; }
    :is(#licenseHeatmap, #equipmentHeatmap) .lh-cell.is-over {
      background: color-mix(in srgb, var(--hg-danger) 20%, transparent);
      color: #a02820;
      border-left-color: color-mix(in srgb, var(--hg-danger) 40%, transparent);
      font-weight: 700;
      animation: wl-overload-pulse 1.6s ease-in-out infinite;
      will-change: box-shadow, filter;
      z-index: 1;
    }
    html.dark :is(#licenseHeatmap, #equipmentHeatmap) .lh-cell { border-left-color: var(--hg-border-cell); color: #8a7a6e; }
    html.dark :is(#licenseHeatmap, #equipmentHeatmap) .lh-cell.has-load { background: #3a455a33; color: #c2c8d4; }
    html.dark :is(#licenseHeatmap, #equipmentHeatmap) .lh-cell.is-over {
      background: #a05a5a2e; color: #c08a8a; border-left-color: #a05a5a55;
    }
    html.dark :is(#licenseHeatmap, #equipmentHeatmap) .lh-names { border-right-color: var(--hg-hairline); }
    /* Cell popup crew — the label crew-read language (people-violet);
       projects row stays ink (context text, not a people control). */
    .hg-tip-interactive .hg-tip-field dd .lh-pop-crew,
    .hg-tooltip .lh-pop-crew { color: var(--hg-people); }
    /* IT uses the same natural and compressed geometry as Crew above. */
    :is(#v-lc, #v-eq) .it-scroll table.track table.track { width: max-content; min-width: 0; table-layout: auto; margin: 0 auto; }
    :is(#v-lc, #v-eq) .it-scroll table.track th table.track th { position: static; z-index: auto; }
    :is(#v-lc, #v-eq) .it-scroll table.track th table.track th { position: static !important; top: auto; z-index: auto; }
    /* Expenses — same geometry as IT Tracker (see docs/company-subtab-pattern.md). */
    #v-ex.view.on { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; overflow: hidden; }
    #v-ex .exp-scroll { flex: 1 1 auto; min-height: 0; overflow: auto; margin: 0; padding: 0; box-sizing: border-box; }
    #v-ex .exp-scroll table.track { width: max-content; min-width: 0; table-layout: auto; margin: 0 auto; }
    #v-ex .exp-scroll table.track th { position: static; z-index: auto; }
    #v-ex .exp-scroll table.track th { position: static !important; top: auto; z-index: auto; }
    /* Register surface laws (mirror era): the Xero deep link is an accent
       control (founder 2026-10-09) — the one clickable-out affordance on a
       provider row, so it reads as an action, not chrome. */
    #v-ex .exp-xero-link { color: var(--hg-accent); text-decoration: none; }
    #v-ex .exp-xero-link:hover { text-decoration: underline; }
    html.dark #v-ex .exp-xero-link { color: var(--hg-accent); }
    /* An inherited tag renders in the accent (founder 2026-10-09): it
       reads as a value the series produced, distinct at a glance from a
       hand-set tag (full ink) and an empty one (muted ghost). Both modes
       carry the rule — --hg-accent is theme-controlled. */
    #v-ex .hg-select.inherited { color: var(--hg-accent); }
    html.dark #v-ex .hg-select.inherited { color: var(--hg-accent); }
    /* Client Invoices — same geometry as IT Tracker. */
    #v-cliInv.view.on { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; overflow: hidden; }
    #v-cliInv .cli-inv-scroll { flex: 1 1 auto; min-height: 0; overflow: auto; margin: 0; padding: 0; box-sizing: border-box; }
    #v-cliInv .cli-inv-scroll table.track { width: max-content; min-width: 0; table-layout: auto; margin: 0 auto; }
    #v-cliInv .cli-inv-scroll table.track th { position: static; z-index: auto; }
    #v-cliInv .cli-inv-scroll table.track th { position: static !important; top: auto; z-index: auto; }
    /* Contractor Invoices — same geometry as IT Tracker. */
    #v-ctiInv.view.on { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; overflow: hidden; }
    #v-ctiInv .cti-inv-scroll { flex: 1 1 auto; min-height: 0; overflow: auto; margin: 0; padding: 0; box-sizing: border-box; }
    #v-ctiInv .cti-inv-scroll table.track { width: max-content; min-width: 0; table-layout: auto; margin: 0 auto; }
    #v-ctiInv .cti-inv-scroll table.track th { position: static; z-index: auto; }
    #v-ctiInv .cti-inv-scroll table.track th { position: static !important; top: auto; z-index: auto; }
    /* Recruitment — same geometry as other Company trackers. */
    #v-rc.view.on { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; overflow: hidden; }
    #v-rc .rc-scroll { flex: 1 1 auto; min-height: 0; overflow: auto; margin: 0; padding: 0; box-sizing: border-box; }
    #v-rc .rc-scroll table.track { width: max-content; min-width: 0; table-layout: auto; margin: 0 auto; }
    /* Tag pill cells in the recruitment table */
    .rc-tag-cell { display: flex; flex-wrap: wrap; gap: 3px; align-items: center; }
    .rc-tag-cell .a-tag { font-size: var(--hg-type-10); padding: 1px 6px; }
    /* Email/website cells: the value stays an inline editor; the ↗ link opens
       the address. Same accent clickable-out law as the Expenses Xero link. */
    .rc-link-cell { display: flex; align-items: center; gap: 3px; }
    #v-rc .rc-open-link { color: var(--hg-accent); text-decoration: none; }
    #v-rc .rc-open-link:hover { text-decoration: underline; }
    html.dark #v-rc .rc-open-link { color: var(--hg-accent); }
    /* Actions bar sits under the table outside the scroll root — left edge
       aligned with the scroll root's 20px padding so it reads as part of the
       table's left margin, not the window edge. Crew and Recruitment both
       create records through one, so the strip is one surface. */
    :is(#v-cs, #v-rc) .cs-actions { flex-shrink: 0; margin: 0 0 16px; padding: 0 var(--hg-tracker-side-padding); }
    /* Recruitment's create form: one label column and one control column, so
       every field starts on the same edge. Box shape and layout only — the
       floating panel supplies the material. */
    .hg-floating-panel.rc-add-panel {
      width: 520px; max-width: calc(100vw - 40px); max-height: calc(100dvh - 40px); overflow: auto;
    }
    .rc-add-form { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 10px 14px; align-items: center; }
    .rc-add-form > label { white-space: nowrap; }
    .rc-add-form .hg-inp, .rc-add-form .hg-select { width: 100%; box-sizing: border-box; }
    .rc-add-form > .rc-add-foot { grid-column: 1 / -1; justify-content: flex-end; margin: 4px 0 0; }

    html.dark .cs-eng-row { border-bottom-color: var(--hg-hairline); }
    html.dark #v-cs #crewTable tr.cs-eng-panel > td {
      background: transparent;
    }
    /* Crew + IT inline-edit inputs — color is now centralized via
       .hg-cell-input + --hg-input-* tokens. These ID selectors only
       remain for the .cs-win-cell date inputs that don't have the class. */

    html.dark .cs-win-cell input[type="date"] { color: var(--hg-text-bright); }

    /* IT Tracker — dark-mode non-input bits only (inputs are centralized) */
    html.dark #itTable .it-add-row { border-top-color: var(--hg-border-chrome); }
    html.dark #itTable .it-del { color: var(--hg-text-muted); }
    html.dark #itTable .it-del:hover { color: #c08a8a; }
    html.dark #itTable .it-summary { border-top-color: var(--hg-border-chrome); }
    /* Expenses — dark-mode non-input bits only (inputs are centralized) */
    html.dark #expTable .cv-add-row { border-top-color: var(--hg-border-chrome); }
    html.dark #expTable .cv-del { color: var(--hg-text-muted); }
    html.dark #expTable .cv-del:hover { color: #c08a8a; }

  /* ===== 4f. cashflow dock (sibling of chart; pins to bottom of #v-tr) =====
     Share only the week X-scale with the Gantt. Horizontal scroll is synced
     in js/cashflow.js so milestone markers + weekly bars line up.
     Geometry (matches js/cashflow.js): BAR_AREA_H 92 + LABEL_STRIP_H 96 = 188 body.
          Title bar (28) sits above body; click toggles .is-collapsed → body slides away. */
       .cashflow-dock {
       flex-shrink: 0; box-sizing: border-box;
       display: flex; flex-direction: column;
       height: 216px; /* 28 title + 188 body */
       border-top: 2px solid var(--hg-accent);
       background: var(--hg-frost-bg);
       backdrop-filter: blur(var(--hg-frost-blur-soft)); -webkit-backdrop-filter: blur(var(--hg-frost-blur-soft));
       position: relative; z-index: 8;
       overflow: hidden;
       transition: height .22s ease;
       /* Own compositing layer (same reasoning as .workload-dock): hover
          washes and scroll-synced repaints here painted into the root
          surface the labels frost samples — the labels-only banding bake. */
       contain: layout style;
       will-change: transform;
       /* Gutter inherited from #v-tr .gantt-shell's margin — the dock bar
          sits flush inside the shell so its scroll viewport width matches
          the chart's exactly and week cells stay X-aligned. */
        }
  .cashflow-dock.is-collapsed {
    height: 28px; /* title bar only */
  }
  .cashflow-dock .cf-titlebar {
    flex-shrink: 0; height: 28px; box-sizing: border-box;
    display: flex; align-items: center; gap: 8px;
    padding: 0 12px;
    /* Opaque: same band as the crew dock's title bar. */
    background: var(--hg-frost-head-solid);
    border-bottom: 1px solid var(--hg-hairline);
    cursor: pointer; user-select: none;
    color: #26415e; font-size: var(--hg-type-11); font-weight: 600;
    letter-spacing: .03em;
    /* Own layer: hover wash repaints without re-rasterising the dock frost
       (same law as .wl-titlebar). */
    contain: layout style;
    will-change: transform;
  }
  .cashflow-dock .cf-titlebar:hover {
    background: color-mix(in srgb, var(--hg-accent) 10%, var(--hg-frost-head-solid));
  }
  .cashflow-dock .cf-titlebar:focus-visible {
    outline: 2px solid #4a7ab5; outline-offset: -2px;
  }
  .cashflow-dock .cf-caret {
    display: inline-block; font-size: var(--hg-type-10);
    line-height: 1; color: #5a6578;
    transition: transform .22s ease;
  }
  .cashflow-dock.is-collapsed .cf-caret {
    transform: rotate(-90deg); /* points right when body is tucked away */
  }
  .cashflow-dock .cf-titlebar-label { font-weight: 700; }
    .cashflow-dock .cf-titlebar-sub {
      font-weight: 500; color: var(--hg-text-secondary); letter-spacing: 0;
    }
    /* Title-bar meta — totals inline, right (mirrors .wl-titlebar-meta).
         Only the cashflow-deficit fragment (.cf-meta-bit.is-warn) is red. */
      .cashflow-dock .cf-titlebar-meta {
        margin-left: auto; font-weight: 600; color: var(--hg-info);
        font-variant-numeric: tabular-nums; letter-spacing: 0;
        font-size: var(--hg-type-11); min-width: 0;
        overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
        max-width: min(62vw, 720px);
      }
      .cashflow-dock .cf-titlebar-meta .cf-meta-sep {
        font-weight: 500; color: inherit; opacity: .7;
      }
      .cashflow-dock .cf-titlebar-meta .cf-meta-bit.is-warn {
        color: var(--cf-deficit-t, var(--hg-danger));
        font-weight: 700;
      }
      .cashflow-dock .cf-body {
  flex: 0 0 auto;
  height: 188px; box-sizing: border-box;
  display: flex; min-height: 0;
  overflow: hidden;
  transition: height .22s ease;
  /* Own layer: the deficit stroke pulses (will-change: filter) every frame
     inside this body — its damage must stop here and never re-rasterise the
     dock's frost (same law as .wl-body). */
  contain: layout style;
  will-change: transform;
  /* Gutter comes from .cashflow-dock's 20px margin — no body padding,
     so the dock scroll viewport width matches .gantt-wrap's exactly
     and week cells stay X-aligned at every scrollLeft. */
    }
  .cashflow-dock.is-collapsed .cf-body {
    height: 0;
  }
  .cashflow-dock .cf-label {
    width: var(--hg-gantt-label-w, 380px); flex-shrink: 0; box-sizing: border-box;
    border-right: 1px solid var(--hg-hairline); background: transparent;
    padding: 0; font-size: var(--hg-type-base); color: var(--hg-text-label);
    display: flex; align-items: stretch;
  }
  .cashflow-dock .cf-label-inner {
      flex: 1; display: flex; flex-direction: column;
      height: 100%; min-height: 0; padding: 0 12px; box-sizing: border-box;
      position: relative;
    }
    /* Top block = plot band (92px) — legend only; totals moved to title meta */
    .cashflow-dock .cf-label-top {
      height: 92px; flex-shrink: 0; box-sizing: border-box;
      display: flex; flex-direction: column; justify-content: center; gap: 6px;
      padding: 0;
    }
  .cashflow-dock .cf-label-title {
    font-size: var(--hg-type-11); color: #26415e; font-weight: 600; letter-spacing: .02em;
  }
  .cashflow-dock .cf-label-leg { font-size: var(--hg-type-11); color: var(--cf-label); }
  /* Bottom strip = four 24px value rows — must match track LABEL_STRIP_H */
  .cashflow-dock .cf-label-strip {
    height: 96px; flex-shrink: 0; box-sizing: border-box;
    display: flex; flex-direction: column; justify-content: flex-start;
    margin: 0; padding: 0; border-top: 0;
  }
  .cashflow-dock .cf-label-strip .cf-label-leg {
    height: 24px; line-height: 24px; box-sizing: border-box;
    font-size: var(--hg-type-11);
  }
  .cashflow-dock .cf-dot.income { color: var(--cf-income); }
  .cashflow-dock .cf-dot.deficit { color: var(--cf-deficit-t); }
  .cashflow-dock .cf-scroll {
    flex: 1; min-width: 0; overflow-x: auto; overflow-y: hidden;
    position: relative;
    scrollbar-width: none;
  }
  .cashflow-dock .cf-scroll::-webkit-scrollbar { display: none; height: 0; }
  #cashflowPanel {
  position: relative; height: 188px; box-sizing: border-box;
  background: transparent; min-width: 100%;
    }
  #cfTrack { position: absolute; inset: 0; overflow: hidden; }
  /* Founder (in-app comment): the week header paints the Tabs colour — the
     same surface as the tab row (the labels-head carries the twin rule).
     ID-scoped to the main gantt so the new-asset modal's mini-gantt keeps
     its own wash. */
  #weekhdr { background: var(--hg-surface-tabs); }
  .gantt-header-viewport {
    position: sticky; top: 0; left: 0; z-index: 70;
    overflow: clip; contain: layout style paint; will-change: transform;
  }
  #weekhdr { position: relative; top: auto; will-change: auto; }
  .weekhdr { display: flex; background: var(--hg-surface-base); border-bottom: 1px solid var(--hg-border-chrome); position: sticky; top: 0; z-index: 5; height: 42px; box-sizing: border-box;
    /* Groove — same recessed band as the tracks: light pools at the top
       edge, shade sits at the bottom. Matches the header rows' bevel. */
    box-shadow: inset 0 2px 4px rgba(255,255,255,.14),
                inset 0 -2px 5px rgba(15,23,42,.02);
    /* Own compositing layer (same reasoning as .gfilters): sweeping the cursor
       across the date cells toggles the week-divisor strip + chevron on every
       seam crossing — raster churn in this band re-runs the timeline's shared
       render pass and could bake stale pixels into the frosted rows below
       (the full-height column ghost). The band is opaque, so promoting it
       changes nothing visually; its damage now stays in its own layer. */
    contain: layout style;
    will-change: transform;
  }
  .weekhdr .w {
          /* Fixed week column — driven by --hg-week-w (set by zoom handler).
             flex grow would stretch columns while bars stay on px math → misalignment. */
          flex: 0 0 var(--hg-week-w);
          width: var(--hg-week-w);
          min-width: var(--hg-week-w);
          max-width: var(--hg-week-w);
          box-sizing: border-box;
          text-align: center;
          font-size: var(--hg-type-9);
          color: var(--hg-text-quiet);
          padding: 0;
          border-left: 1px solid rgba(138, 147, 163, 0.5);
          line-height: 1;
          /* Text never spills out of a header cell, whatever the zoom tier
             writes into it — labels tier with zoom in gantt.js; this is the
             hard stop if anything ever outgrows its column. */
          white-space: nowrap;
          overflow: hidden;
          display: flex;
          flex-direction: column;
          justify-content: center;
          position: relative; /* anchors the week-divisor ::after strip */
        }
  .weekhdr .w .start,
  .weekhdr .w .end { display: block; height: 14px; line-height: 14px; overflow: hidden; }
  /* ALL heavy header text takes the theme accent (founder 2026-09-21):
     --hg-accent flips with the mode (near-black light / gold dark), so
     no dark twin is needed — heavy is accent in both. */
  .weekhdr .w .start { font-weight: 600; color: var(--hg-accent); }
  .weekhdr .w .end { color: var(--hg-text-quiet); }
  /* Week-divisor affordance: the boundary between two week headers is the
     show/hide target for that week's Sat+Sun columns. The hit strip extends
     8px to either side of the wire (wireGanttWeekDivisor matches it).
     The highlight fires only while the pointer is actually IN the strip —
     JS toggles .divisor-in-range on mousemove, because the strip is
     narrower than the cell and CSS :hover cannot see the boundary.
     Each adjacent cell paints its half of the highlight and its own chevron,
     so the right-hand cue stays visible when the left cell is clipped.
     The chevron is drawn INSIDE the 8px strip, so the cue a person aims at
     is the target that answers the click. A cue painted beyond the strip
     vanishes as the pointer moves onto it and the click lands on the inert
     cell.
     Closed week: » opens Sat+Sun. Open week: « folds them. */
  .weekhdr.divisor-in-range { cursor: pointer; }
  .weekhdr .w::after,
  .weekhdr .d.wk-end::after,
  .weekhdr .d.divisor-in-range-next::after {
    content: ''; position: absolute; top: 0; bottom: 0; right: 0; width: 8px;
    cursor: pointer; user-select: none; z-index: 2;
  }
  .weekhdr .w.divisor-in-range::after,
  .weekhdr .d.wk-end.divisor-in-range::after {
    background: linear-gradient(to right,
      transparent 0px, var(--hg-accent) 6px, var(--hg-accent) 8px);
  }
  .weekhdr .w::before,
  .weekhdr .d.wk-end::before,
  .weekhdr .d.divisor-in-range-next::before {
    content: '»'; position: absolute; top: 50%; right: 1px; z-index: 2;
    transform: translateY(-50%);
    font-size: 10px; line-height: 1; font-weight: 700;
    /* No opacity fade: an animated opacity promotes the pseudo-element and
       paints intermediate frames into the header band mid-sweep — the stale-bake
       window for the column ghost below the band. One atomic toggle instead. */
    color: var(--hg-accent); opacity: 0;
    pointer-events: none;
  }
  .weekhdr .w.divisor-in-range::before,
  .weekhdr .d.wk-end.divisor-in-range::before { opacity: 1; }
  /* An OPEN week's seam folds its Sat+Sun away — chevron points left. */
  .weekhdr .w.open-week::before,
  .weekhdr .d.wk-end.open-week::before { content: '«'; }
  html.dark .weekhdr .w.divisor-in-range::after,
  html.dark .weekhdr .d.wk-end.divisor-in-range::after {
    background: linear-gradient(to right,
      transparent 0px, var(--hg-accent) 6px, var(--hg-accent) 8px);
  }
  .weekhdr .divisor-in-range-next::after {
    left: 0; right: auto;
    background: linear-gradient(to left,
      transparent 0px, var(--hg-accent) 6px, var(--hg-accent) 8px);
  }
  .weekhdr .w.divisor-in-range-next::before,
  .weekhdr .d.divisor-in-range-next::before {
    left: 1px; right: auto; content: '»'; opacity: 1;
  }
  .weekhdr .open-week.divisor-in-range + .divisor-in-range-next::before { content: '«'; }
  /* Day tier (zoom column >= 24px per day): one day-cell per workday column.
     A week holds 5; the day cell is 1/5 of the week width so bars/header
     stay aligned by the same --hg-week-w token. Weekdays name their day
     above the date number. Cell BORDERS are gone at the main gantt — the
     unified grid overlay draws every line once (founder 2026-09-21);
     #weekhdr .w / #weekhdr .d carry no border of their own. */
  .weekhdr .d {
    flex: 0 0 calc(var(--hg-week-w) / 5);
    width: calc(var(--hg-week-w) / 5);
    min-width: calc(var(--hg-week-w) / 5);
    max-width: calc(var(--hg-week-w) / 5);
    box-sizing: border-box;
    text-align: center;
    font-size: var(--hg-type-9);
    color: var(--hg-text-dim);
    padding: 0;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative; /* anchors the week-divisor ::after strip */
  }
  /* The day tier's week seam (Mon|Sun boundary) — solid, full weight, so
     the weekend boundary always outranks the dashed day lines. Drawn by
     the unified grid overlay's .gg-week (founder 2026-09-21); the cell
     itself paints no line. */
  .weekhdr .d.wknd {
    color: var(--hg-text-muted);
  }
  /* Month tier (annual / multi-month): one cell per calendar month over
     the week columns. Inner week seams keep the calendar readable — the
     cell spans several weeks and carries no weekend affordance. */
  .weekhdr .m {
    flex-grow: 0; flex-shrink: 0;
    box-sizing: border-box; text-align: center;
    font-size: var(--hg-type-9); color: var(--hg-text-dim);
    padding: 0; border-left: 1px solid rgba(138, 147, 163, 0.5);
    line-height: 1; white-space: nowrap; overflow: hidden;
    display: flex; flex-direction: column; justify-content: center;
    position: relative;
  }
  .weekhdr .m .start { display: block; height: 14px; line-height: 14px; font-weight: 600; color: var(--hg-accent); }
  /* Merged tier (founder 2026-09-21): one cell per civil day from the day
     header down to single minutes — TWO 14px rows (day label + marks) in
     the SAME 42px band at every width, so alignment never shifts between
     zoom steps. Hour labels '12h' sit at their true hour position; minute
     marks '30m' at their true minute position. */
  .weekhdr .d .hg-ms-day {
    display: block; text-align: center; height: 14px;
    line-height: 14px; overflow: hidden;
    font-weight: 600; color: var(--hg-accent);
  }
  .weekhdr .d .hg-ms-dayn {
    display: block; text-align: center; height: 14px;
    line-height: 14px; overflow: hidden;
    color: var(--hg-text-dim);
  }
  .weekhdr .d .hg-ms-hrmarks { position: relative; display: block; height: 14px; }
  .weekhdr .d .hg-hrmark,
  .weekhdr .d .hg-minlab {
    position: absolute; top: 50%; transform: translate(-50%, -50%);
    line-height: 1; color: var(--hg-text-dim);
    pointer-events: none;
  }
  /* Hour marks stay LIGHT at the day+hour stage (secondary ink). They
     turn HEAVY and take THE accent ONLY when the tier also shows minutes
     — the weight's whole purpose is contrast against the smaller unit
     (founder 2026-09-21). --hg-accent flips with the theme (near-black
     light / gold dark); the html.dark twin raises specificity above the
     dark muted hour rule. The builder flags minute stages with
     .hg-with-min on the day cell. */
  .weekhdr .d.hg-with-min .hg-hrmark,
  html.dark .weekhdr .d.hg-with-min .hg-hrmark { font-weight: 600; color: var(--hg-accent); }
  /* Bounded header materialization: hidden offscreen days collapse into one
     placeholder of the exact combined width — the flex total, and therefore
     every bar's alignment, is identical to the full materialization. */
  .weekhdr .hg-header-gap { flex-grow: 0; flex-shrink: 0; box-sizing: border-box; }
  /* Lane strip windowing (phase 2): offscreen week columns collapse into
     one width-exact placeholder per side — flex totals, bar alignment and
     camera math stay identical to the full strip. */
  .hg-lane-gap { flex-grow: 0; flex-shrink: 0; box-sizing: border-box; }
  /* One body grid paints over row washes and under bars. The unpainted
     host spans the content so sticky Y positioning follows native scroll;
     its child is only viewport-height and horizontally windowed. */
  #ganttGridHost { position: absolute; inset: 0; pointer-events: none; }
  #ganttGridLayer {
    position: sticky; left: auto; right: auto; bottom: auto;
    z-index: 0; will-change: transform;
  }
  .gg-lines {
    position: absolute; top: 0; bottom: 0; left: 0; right: 0; pointer-events: none;
    /* Both vector-strip palettes remain available. CSS selects the matching
       image on a mode switch; header lines use the same palette. */
    --gg-strip-week-light: rgba(138, 147, 163, 0.5);
    --gg-strip-day-light: rgba(154, 163, 176, 0.5);
    --gg-strip-hour-light: rgba(154, 163, 176, 0.5);
    --gg-strip-min-light: rgba(154, 163, 176, 0.5);
    --gg-strip-week-dark: rgba(0, 0, 0, 0.25);
    --gg-strip-day-dark: rgba(0, 0, 0, 0.25);
    --gg-strip-hour-dark: rgba(0, 0, 0, 0.25);
    --gg-strip-min-dark: rgba(0, 0, 0, 0.25);
    --gg-line-week: var(--gg-strip-week-light);
    --gg-line-day: var(--gg-strip-day-light);
    --gg-line-hour: var(--gg-strip-hour-light);
    --gg-line-min: var(--gg-strip-min-light);
    --gg-grid-strip: var(--gg-grid-strip-light, none);
  }
  html.dark .gg-lines {
    /* 25% black: the line marks the day without cutting the surface. */
    --gg-line-week: var(--gg-strip-week-dark);
    --gg-line-day: var(--gg-strip-day-dark);
    --gg-line-hour: var(--gg-strip-hour-dark);
    --gg-line-min: var(--gg-strip-min-dark);
    --gg-grid-strip: var(--gg-grid-strip-dark, none);
  }
  /* The header mount is inserted as the band's FIRST child — a z-index
     lifts it above the positioned cells; lane rows need none (DOM order
     alone puts the layer under the cells/bars). */
  .weekhdr .gg-lines { z-index: 1; }
  .gg-lines > div { position: absolute; top: 0; bottom: 0; width: 1px; }
  .gg-week,
  .gg-day-solid,
  .gg-hour-solid { background: var(--gg-line-week); }
  .gg-day {
    background-image: linear-gradient(to bottom, var(--gg-line-day) 50%, transparent 50%);
    background-size: 1px 6px; background-repeat: repeat-y;
  }
  .gg-hour {
    background-image: linear-gradient(to bottom, var(--gg-line-hour) 50%, transparent 50%);
    background-size: 1px 6px; background-repeat: repeat-y;
  }
  .gg-min {
    background-image: linear-gradient(to bottom, var(--gg-line-min) 50%, transparent 50%);
    background-size: 1px 6px; background-repeat: repeat-y;
  }
  /* The overlay owns the main gantt's lane lines now — the cell
     gradients/borders would sit pixel-identical beneath it. The modal
     mini-gantt (.na-gantt-wrap) keeps the base .cell rule. */
  #lanes .cells .cell { background-image: none; border-left: none; }
  html.dark #lanes .cells .cell { background-image: none; }
  /* The week tier's header cells too — the overlay's .gg-week replaces
     the cell border at the identical x. (#naWeekhdr keeps the base rule.) */
  #weekhdr .w { border-left: none; }
  .gscroll { overflow: auto; }
  #lanes .hg-stage { display: flex; border-bottom: 1px solid var(--seg-rule); height: 30px; box-sizing: border-box; position: relative; background: var(--hg-surface-input); overflow: visible; }
  #lanes .hg-stage .cells,
  #lanes .hg-entity .cells,
  #lanes .hg-lane.lane-side .cells {
    display: flex;
    flex: 0 0 auto; /* grow to sum of fixed 56px week cells — don't stretch columns */
    position: relative;
    overflow: hidden;
    min-width: 0;
  }
  /* Week column = solid left border on .cell (and .weekhdr .w).
       Day ticks = 4 dashed verticals at exact workday edges (W/5 × {1,2,3,4}):
       Mon·Tue · Tue·Wed · Wed·Thu · Thu·Fri. Pixel positions lock to bar scale;
       % of a flex-grown cell would drift from header + bar geometry.
       Opacity 50% — orientation only, not chrome.
       Open-week cells (weekend shown) hide the day ticks — their column is
       7 day-columns wide and the uniform W/5 positions would misplace; the
       weekend tint carries the read until the seam marker task. */
    .cell {
      flex: 0 0 var(--hg-week-w);
      width: var(--hg-week-w);
      min-width: var(--hg-week-w);
      max-width: var(--hg-week-w);
      box-sizing: border-box;
      border-left: 1px solid rgba(138, 147, 163, 0.5);
      background-color: transparent;
      background-image:
        linear-gradient(to bottom, rgba(154, 163, 176, 0.5) 50%, transparent 50%),
        linear-gradient(to bottom, rgba(154, 163, 176, 0.5) 50%, transparent 50%),
        linear-gradient(to bottom, rgba(154, 163, 176, 0.5) 50%, transparent 50%),
        linear-gradient(to bottom, rgba(154, 163, 176, 0.5) 50%, transparent 50%);
      background-size: 1px 6px, 1px 6px, 1px 6px, 1px 6px;
      /* W/5 × {1,2,3,4} — left edge of each 1px tick, scales with --hg-week-w */
      background-position:
        calc(var(--hg-week-w) / 5 * 1) 0,
        calc(var(--hg-week-w) / 5 * 2) 0,
        calc(var(--hg-week-w) / 5 * 3) 0,
        calc(var(--hg-week-w) / 5 * 4) 0;
      background-repeat: repeat-y;
    }
  /* Open-week lane cell (weekend columns visible): the weekend divs are
     now pure TINT washes behind the bars (the unified grid overlay owns
     every line, founder 2026-09-21). The day lines themselves come from
     .gg-day/.gg-day-solid. */
  .cell.open-week {
    position: relative;
    background-image: none;
  }
  .cell.open-week .wk-grid {
    position: absolute; top: 0; bottom: 0;
    box-sizing: border-box;
    background-color: transparent;
  }
  .cell.open-week .wk-grid.wknd {
    background-color: color-mix(in srgb, var(--hg-accent) 5%, transparent);
  }
  /* Lane-side partners of segment/group headers host the collapsed roll-up bar
     on the SAME 30px row — never a second spacer. position:relative for .gbar. */
  #labelsPanel .hg-entity {
    display: flex; align-items: center; gap: 8px; background: var(--hg-surface-base);
    padding: 0 8px; font-weight: 500; font-size: calc(var(--hg-type-12h) * 0.8); letter-spacing: 0;
    border-bottom: 1px solid var(--seg-rule); height: 30px; box-sizing: border-box; overflow: hidden;
    position: relative;
    backdrop-filter: blur(var(--hg-frost-blur)); -webkit-backdrop-filter: blur(var(--hg-frost-blur));
  }
  #lanes .hg-entity {
    display: flex; align-items: center; gap: 8px; background: #e9ecf1;
    padding: 0 8px; font-weight: 700; font-size: var(--hg-type-11); letter-spacing: .06em;
    border-bottom: 1px solid var(--seg-rule); height: 30px; box-sizing: border-box; overflow: hidden;
    position: relative;
  }
  /* Labels-side text is set by .gantt-labels .hg-entity (visible).
     Lanes-side band must keep transparent text because it hosts bars, not labels. */
  #lanes .hg-entity { color: transparent; }
  #lanes .hg-entity .days { margin-left: auto; font-weight: 600; color: transparent; }
  #lanes .hg-entity .cells { display: flex; flex: 0 0 auto; position: relative; overflow: hidden; min-width: 0; height: 100%; }
  #labelsPanel .hg-lane {
    display: flex; align-items: center; gap: 6px; background: var(--hg-surface-base); padding: 0 8px;
    font-weight: 600; font-size: var(--hg-type-medium); letter-spacing: -.01em; color: var(--hg-text-ink);
    border-bottom: 1px solid var(--seg-rule); height: 30px; box-sizing: border-box; overflow: hidden;
    /* Inter-lane padding: gap above every segment header except the first
       in each panel, so lanes read as separate bands without altering the
       spacing between stage tracks or between a track and its segment. */
    margin-top: 10px;
    backdrop-filter: blur(var(--hg-frost-blur)); -webkit-backdrop-filter: blur(var(--hg-frost-blur));
  }
  #lanes .hg-lane {
    display: flex; align-items: center; gap: 6px; background: #dfe4ec; padding: 0 8px;
    font-weight: 600; font-size: var(--hg-type-medium); letter-spacing: -.01em; color: var(--hg-text-ink);
    border-bottom: 1px solid var(--seg-rule); height: 30px; box-sizing: border-box; overflow: hidden;
    /* Inter-lane padding: gap above every segment header except the first
       in each panel, so lanes read as separate bands without altering the
       spacing between stage tracks or between a track and its segment. */
    margin-top: 10px;
  }
  /* Zero the gap on the first segment in each panel so there's no void
     between the sticky header strip and the first hg-stage. (Label side:
     rows live inside .labels-rows > .labels-block, so neither the head+lane
     sibling rule nor the wrapper's first-child rule applies — target the
     first lane in the FIRST block instead.) */
  #labelsPanel .labels-head + .hg-lane,
  #labelsPanel .labels-rows > .labels-block:first-child > .hg-lane,
  #lanes > .gantt-row-ph + .hg-lane,
  #lanes > .hg-lane:first-child { margin-top: 0; }
  #labelsPanel .hg-lane > span:first-child { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #labelsPanel .hg-lane .days { margin-left: auto; flex-shrink: 0; font-weight: 600; color: var(--hg-text-ink); font-variant-numeric: tabular-nums; letter-spacing: 0; font-size: var(--hg-type-10); }
  #labelsPanel .hg-lane .days.days-over { color: var(--hg-danger); }
  #labelsPanel .hg-lane .days.days-under { color: #2d7a4f; }
  /* Segment policy chips on the lane row (ganttSegmentPolicyChips):
     calendar/clock SVG icon for the scheduling model, 5d/7d for the weekend
     cadence. Muted ink; the words live in the RMB menu + chip titles.
     The lanes-side twin renders identical markup but stays invisible so
     both columns keep matching row layout. */
  #labelsPanel .hg-lane .seg-policy { display: flex; align-items: center; flex-shrink: 0; gap: 4px; color: var(--hg-text-muted); font-variant-numeric: tabular-nums; }
  #labelsPanel .hg-lane .seg-policy-glyph { display: inline-flex; align-items: center; }
  #labelsPanel .hg-lane .seg-policy-glyph svg { display: block; width: 13px; height: 13px; }
  #labelsPanel .hg-lane .seg-policy-days { font-size: var(--hg-type-10); font-weight: 600; letter-spacing: 0; }
  #lanes .hg-lane .seg-policy { display: none; }
  #lanes .hg-lane.lane-side {
    color: transparent; padding: 0; position: relative; overflow: hidden;
  }
  #lanes .hg-lane.lane-side .days { color: transparent; }
  #lanes .hg-lane.lane-side .cells { display: flex; flex: 0 0 auto; position: relative; overflow: hidden; min-width: 0; height: 100%; }
      .collapse-btn { border: 1px solid #c0c6d2; background: linear-gradient(#ffffff, #f3f4f7); border-radius: 3px; font-size: var(--hg-type-9); padding: 0 6px; cursor: pointer; color: #5b6272; box-shadow: inset 0 1px 0 #ffffff; flex-shrink: 0; }
  .collapse-btn:hover { background: #eef0f4; }
  /* Segment/group headers: whole label row toggles expand (chevron removed). */
  .gantt-labels .gantt-toggle-row { cursor: pointer; user-select: none; }
  /* No `filter` here: these rows carry backdrop-filter, and animating filter
     forces a compositing-layer rebuild — the hover flash. A translucent
     overlay tint reads the same and paints without the rebuild. */
  .gantt-labels .gantt-toggle-row:hover { background-image: linear-gradient(rgba(15,23,42,.015), rgba(15,23,42,.015)); }
  .gantt-labels .gantt-toggle-row:focus-visible { outline: 2px solid var(--gbar-appr-bg); outline-offset: -2px; }
  /* Filter-row toggles wear the panel lift at 1.3x ink: a cast below and a halo
     above, the same two-layer pair every floating sheet reads, one step heavier
     so the row sits over the band instead of being painted on it. */
  .block-btn { border: 1px solid var(--hg-border-control); background: var(--hg-surface-tabs); color: var(--hg-text-ink); border-radius: 4px; font-size: var(--hg-type-11); font-weight: 500; padding: 4px 10px; cursor: pointer; box-shadow: var(--hg-shadow-lift-ctl); }
  .block-btn.on { background: var(--hg-accent); border-color: var(--hg-accent); color: var(--hg-text-on-accent); }
  .block-btn:hover { border-color: var(--hg-border-hover); color: var(--hg-text-ink); }
  /* A link acting as a button needs the button box: an inline <a> loses its
     padded height and underlines its label. */
  a.block-btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
  .block-btn.on:hover { background: #1f2026; color: var(--hg-text-on-accent); }
  /* ===== 4g. money/doc views ===== */
  .doc {
    max-width: 820px; margin: 0 auto; padding: 28px 34px;
    margin-top: 16px; margin-bottom: 40px;
    background: transparent; border: none;
  }
  .doc h1 { font-size: var(--hg-type-18); margin-bottom: 2px; }
  .doc .docsub { color: var(--hg-text-secondary); font-size: var(--hg-type-11); margin-bottom: 18px; }
  .doc table { width: 100%; border-collapse: collapse; background: transparent; }
  .doc td, .doc th { padding: 6px 8px; border-bottom: 1px solid var(--hg-border-cell); font-size: var(--hg-type-base); }
  .doc th { text-align: left; font-size: var(--hg-type-10); text-transform: uppercase; letter-spacing: .06em; color: var(--hg-text-label); border-bottom: 2px solid var(--hg-hairline); position: sticky; top: 79px; z-index: 34; background: var(--hg-surface-input); padding-bottom: 10px; }
  .doc .num { text-align: right; font-variant-numeric: tabular-nums; }
  .doc .doc-total td { font-weight: 700; border-top: 2px solid var(--hg-accent); }
  .doc .gen { font-size: var(--hg-type-10); color: var(--hg-text-dim); margin-top: 14px; }

  /* ===== 4h. drawer ===== */
  .drawer { position: fixed; right: 0; top: 0; bottom: 0; width: 360px; background: var(--hg-surface-input); border-left: 1px solid var(--hg-hairline); box-shadow: var(--hg-shadow-slide); z-index: 80; padding: 20px; display: none; overflow-y: auto; }
  .drawer.open { display: block; }
  .drawer h2 { font-size: var(--hg-type-large); margin-bottom: 4px; }
  .drawer .kv { display: grid; grid-template-columns: 100px 1fr; gap: 6px 10px; margin-top: 14px; font-size: var(--hg-type-base); }
  .drawer .kv .k { color: var(--hg-text-label); }
  .drawer .x { position: absolute; top: 12px; right: 14px; cursor: pointer; color: var(--hg-text-dim); font-size: var(--hg-type-large); }
  .drawer .thread { margin-top: 14px; padding: 10px; background: #f6f7f9; border-radius: 7px; font-size: var(--hg-type-11h); color: #4a5262; }
  .drawer h4 { margin-top: 16px; font-size: var(--hg-type-11); text-transform: uppercase; letter-spacing: .06em; color: var(--hg-text-dim); }
  .drawer ul { margin: 6px 0 0 16px; font-size: var(--hg-type-base); }
/* ===== 5. DARK OVERRIDES — hairline structure, near-black ===== */
  html.dark body { color: var(--hg-text-bright); background: var(--hg-surface-base); }
  html.dark body::before { filter: none; opacity: .14; }
  html.dark header { background: var(--hg-surface-header); border-bottom-color: var(--hg-border-chrome); }
  html.dark .proj-settings-form label.proj-live-row { color: var(--hg-text-bright); }
  html.dark .proj-new-form input, html.dark .proj-settings-form input { background: var(--hg-surface-base); border-color: var(--hg-border-control); color: var(--hg-text-bright); }
  html.dark .proj-new-form input:focus, html.dark .proj-settings-form input:focus { border-color: #8a8c92; outline: none; }
  html.dark .proj-new-form .form-btns .create, html.dark .proj-settings-form .form-btns .create { background: var(--hg-accent); border-color: var(--hg-accent); color: var(--gbar-rev-ink); }
    html.dark .proj-new-form .form-btns .create:hover, html.dark .proj-settings-form .form-btns .create:hover { background: #e2b155; }
    html.dark .proj-settings-form .form-btns .dup { background: transparent; color: #c8c8ce; border-color: var(--hg-border-control); }
    html.dark .proj-settings-form .form-btns .dup:hover { border-color: #8a8c92; color: var(--hg-text-bright); }
    html.dark .proj-new-form .form-btns .cancel, html.dark .proj-settings-form .form-btns .cancel { background: transparent; color: var(--hg-text-muted); border-color: var(--hg-border-control); }
  html.dark header .meta { color: var(--hg-text-quiet); }
  html.dark .agent-strip-head { color: var(--hg-text-quiet); }
  html.dark .dot { background: #3fae6e; }
  html.dark .theme-btn { background: transparent; border-color: var(--hg-border-control); color: #b8b9be; }
  html.dark .theme-btn:hover { border-color: var(--hg-border-hover); color: var(--hg-text-bright); }
  html.dark .scope-tab { color: var(--hg-text-quiet); }
  html.dark .scope-tab:hover { color: var(--hg-text-bright); }
  html.dark .scope-tab.on { color: var(--hg-text-bright); }
  html.dark .proj-strip { background: var(--hg-surface-tabs); }
  html.dark .proj-strip .proj-select { color: var(--hg-text-bright); }
  html.dark .proj-strip .proj-select:hover { background-color: var(--hg-surface-card); }
  html.dark .proj-strip .proj-new-btn { background: transparent; border-color: var(--hg-border-control); color: #b8b9be; }
  html.dark .proj-strip .proj-new-btn:hover { border-color: var(--hg-border-hover); color: var(--hg-text-bright); }
  html.dark .proj-strip .proj-edit-btn { color: var(--hg-text-muted); }
  html.dark .proj-strip .proj-edit-btn:hover { background: var(--hg-surface-card); color: #b8b9be; }
  html.dark .tabs { background: var(--hg-surface-tabs); border-bottom-color: var(--hg-border-chrome); }
  html.dark .tab { color: var(--hg-text-quiet); }
  html.dark .tab:hover { color: var(--hg-text-bright); background: transparent; }
  html.dark .tab.on { color: var(--hg-text-bright); }
  html.dark .subtabs { background: var(--hg-surface-tabs); border-bottom-color: var(--hg-border-chrome); }
  html.dark .subtab { color: var(--hg-text-quiet); }
  html.dark .subtab:hover { color: var(--hg-text-bright); }
  html.dark .subtab.on { color: var(--hg-text-bright); border-bottom-color: var(--hg-accent); }
  html.dark table.track { background: transparent; }
  html.dark table.track th, html.dark #crewTable th { border-bottom-color: var(--hg-border-chrome); background: var(--hg-frost-head); color: var(--hg-text-muted); }
  html.dark table.track td, html.dark #crewTable td { border-bottom-color: var(--hg-border-cell); }
  /* Dark row highlight: same ONE token as the header (--hg-frost-head). */
  html.dark #v-cs #crewTable tbody tr:hover td,
  html.dark :is(#v-lc, #v-eq) table.track tbody tr:hover td,
  html.dark #v-ex table.track tbody tr:hover td,
  html.dark #v-rc table.track tbody tr:hover td,
  html.dark #v-cliInv table.track tbody tr:hover td,
  html.dark #v-ctiInv table.track tbody tr:hover td,
  html.dark .ov-scroll .cf-forecast-scroll table.track tbody tr:hover td, html.dark table.track tbody tr:hover td , html.dark .ov-scroll .cf-forecast-scroll table.track tbody tr:hover td {
    background: var(--hg-frost-hover);
    backdrop-filter: none; -webkit-backdrop-filter: none;
  }
  /* Dark tracker headers: same ONE token — base rule above paints all th. No scoped override. */
  html.dark #v-cs #crewTable, html.dark :is(#v-lc, #v-eq) table.track, html.dark #v-ex table.track, html.dark #v-cliInv table.track, html.dark #v-ctiInv table.track, html.dark #v-rc table.track, html.dark .ov-scroll .cf-forecast-scroll table.track, html.dark table.track , .ov-scroll .cf-forecast-scroll table.track
  html.dark #v-cs #crewTable tbody, html.dark :is(#v-lc, #v-eq) table.track tbody, html.dark #v-ex table.track tbody, html.dark #v-cliInv table.track tbody, html.dark #v-ctiInv table.track tbody, html.dark #v-rc table.track tbody, html.dark .ov-scroll .cf-forecast-scroll table.track tbody, html.dark table.track tbody , .ov-scroll .cf-forecast-scroll table.track tbody
    background: var(--hg-frost-bg); background-clip: padding-box;
    backdrop-filter: blur(var(--hg-frost-blur-soft)); -webkit-backdrop-filter: blur(var(--hg-frost-blur-soft));
  }
  /* Dark mode: same corner geometry as light — radius lives on the corner
     cells (tbody radius is inert in Chromium), so only the wash token is
     restated here. The light-section corner rules are theme-independent. */
  html.dark #v-cs .cs-scroll, html.dark :is(#v-lc, #v-eq) .it-scroll, html.dark #v-ex .exp-scroll, html.dark #v-cliInv .cli-inv-scroll, html.dark #v-ctiInv .cti-inv-scroll, html.dark #v-rc .rc-scroll, html.dark .ov-scroll .cf-forecast-scroll, html.dark , .ov-scroll .cf-forecast-scroll
  /* A menu row WEARS the status colour as ink; it is not a pill. In light the
     row's own paint already wins, so without this exclusion dark alone fills
     every Status row and the two modes read as different surfaces. */
  html.dark .st-ip:not(.hg-menu-item):not(.status-menu-item) { background: var(--st-ip-bg); color: var(--st-ip-ink); }
  html.dark .st-wtg:not(.hg-menu-item):not(.status-menu-item) { background: var(--hg-surface-hover); color: #8b8c92; }
  html.dark .st-rev:not(.hg-menu-item):not(.status-menu-item) { background: var(--st-rev-bg); color: var(--st-rev-ink); }
  html.dark .st-cmpt:not(.hg-menu-item):not(.status-menu-item) { background: var(--st-cmpt-bg); color: var(--st-cmpt-ink); }
  html.dark .st-appr:not(.hg-menu-item):not(.status-menu-item) { background: var(--st-appr-bg); color: var(--st-appr-ink); }
  html.dark .st-reopen:not(.hg-menu-item):not(.status-menu-item) { background: var(--st-reopen-bg); color: var(--st-reopen-ink); }
  html.dark select.st-select.st-ip { background-color: var(--st-ip-bg); color: var(--st-ip-ink); }
  html.dark select.st-select.st-wtg { background-color: var(--hg-surface-hover); color: #8b8c92; }
  html.dark select.st-select.st-rev { background-color: var(--st-rev-bg); color: var(--st-rev-ink); }
  html.dark select.st-select.st-cmpt { background-color: var(--st-cmpt-bg); color: var(--st-cmpt-ink); }
  html.dark select.st-select.st-appr { background-color: var(--st-appr-bg); color: var(--st-appr-ink); }
  html.dark select.st-select.st-reopen { background-color: var(--st-reopen-bg); color: var(--st-reopen-ink); }
  html.dark select.st-select option { background-color: var(--hg-surface-raised); color: var(--hg-text-bright); }
  html.dark .linked { color: var(--hg-info); }
  html.dark .shot-grp td { background: var(--hg-surface-elevated); color: var(--hg-text-muted); }
  html.dark .mine { outline-color: #3fae6e44; background: #1a2420 !important; }
  html.dark .summary { border-top-color: var(--hg-border-chrome); border-bottom-color: var(--hg-border-chrome); }
  html.dark .sum-card { border-right-color: var(--hg-border-chrome); }
  html.dark .sum-card .l { color: var(--hg-text-muted); }
  html.dark .sum-card .s { color: var(--hg-text-muted); }
  html.dark .sum-card.total { border-color: var(--hg-border-chrome); }
  html.dark .sum-card.total .l, html.dark .sum-card.total .s { color: var(--hg-text-muted); }
  html.dark .sum-card.total .v { color: var(--hg-accent); }
  html.dark table.bid { background: transparent; }
  html.dark table.bid .dept td { background: var(--hg-surface-elevated); color: var(--hg-text-muted); border-top-color: var(--hg-border-chrome); }
  html.dark table.bid .dept td .tots { color: var(--hg-info); }
  html.dark table.bid td { border-bottom-color: var(--hg-border-cell); }
  html.dark table.bid tr.line:hover td { background: var(--hg-surface-raised); }
  html.dark table.bid .subtotal td { background: transparent; border-top-color: var(--hg-border-chrome); }
  html.dark table.bid .grand td { background: var(--hg-surface-elevated); color: var(--hg-text-bright); }
  /* Source and tier chips own their colours; they are not status pills. */
  html.dark .src-agent { background: #1e2a38; color: #8fb4dc; }
  html.dark .src-human { background: #2b2820; color: #b3a882; }
  html.dark .src-delta { background: #33241a; color: #d9935f; }
  html.dark .delta td { background: #231d12; }
  html.dark .delta .c-name { color: var(--st-rev-ink); }
  html.dark td.editable:hover { background: #231d12; }
  html.dark td.editing { background: #2c2414; outline-color: var(--st-rev-ink); }
  html.dark .add-line { color: var(--hg-text-muted); border-bottom-color: var(--hg-border-cell); }
  html.dark .add-line:hover { color: var(--hg-info); background: var(--hg-surface-raised); }
  html.dark .toast { background: var(--hg-surface-hover); box-shadow: var(--hg-shadow-pop); color: var(--hg-text-bright); }
  html.dark .gfilters select, html.dark .gfilters input,
  html.dark .crew-pick,
  html.dark select, html.dark input[type="text"], html.dark input[type="number"] {
    background-color: var(--hg-surface-raised); border-color: var(--hg-border-control); color: var(--hg-text-bright);
  }
  html.dark select:focus, html.dark input[type="text"]:focus, html.dark input[type="number"]:focus { border-color: var(--hg-border-focus); outline: none; }
  /* Centralized tracker cell inputs keep their --hg-input-* token look in dark
     mode. This re-assert must sit AFTER the generic fallback above — the base
     rule ties it on specificity and wins by position. Any new shared
     cell-input class must be added to this selector list too. */
  html.dark input.hg-cell-input,
  html.dark input.hg-cell-input-new {
    background: var(--hg-input-bg); border: var(--hg-input-border); color: var(--hg-input-color);
  }
  html.dark input.hg-cell-input-new { border: var(--hg-input-border-visible); }
  html.dark input.hg-cell-input:hover,
  html.dark input.hg-cell-input-new:hover { border-color: var(--hg-input-border-hover); }
  html.dark input.hg-cell-input:focus,
  html.dark input.hg-cell-input-new:focus {
    border-color: var(--hg-input-border-focus); outline: none;
    /* fill intentionally NOT restated: --hg-input-bg is idle = selected */
  }
  /* .hg-ctl (boxed form control): border/bg/type tokens flip automatically;
     only the text token needs a dark twin (--hg-text-ink does NOT flip).
     Scoped to input/textarea so .hg-ctl.hollow buttons keep their muted ink.
     bg/border re-asserts tie the generic fallback above on specificity and
     win by position; :focus re-assert restores the §10 focus border. */
  html.dark input.hg-ctl, html.dark textarea.hg-ctl {
    background-color: var(--hg-input-bg); border-color: var(--hg-border-control); color: var(--hg-input-ink);
  }
  html.dark input.hg-ctl:focus, html.dark textarea.hg-ctl:focus { border-color: var(--hg-border-focus); outline: none; }
  /* Underline controls (.hg-inp / .tbl-inp): the fallback also paints these
     opaque — pin only the background; border/color nuances stay with the
     html.dark .hg-inp / .tbl-inp rules further down. */
  html.dark input.hg-inp, html.dark input.tbl-inp,
  html.dark textarea.hg-inp, html.dark textarea.tbl-inp { background-color: var(--hg-input-bg); }
  html.dark .btn-new { border: 1px solid color-mix(in srgb, var(--seg-accent) 45%, rgba(255,255,255,.3)); background: color-mix(in srgb, var(--seg-accent) 25%, transparent); color: var(--hg-text-bright); box-shadow: none; }
  html.dark .btn-new:hover { background: color-mix(in srgb, var(--seg-accent) 35%, transparent); }
  html.dark .btn-new.hg-confirm-danger { background: var(--hg-danger); border-color: var(--hg-danger); color: var(--hg-text-bright); }
  html.dark .btn-new.hg-confirm-danger:hover { background: var(--hg-danger-hover); }
  html.dark .btn-ghost { background: transparent; border-color: var(--hg-border-control); color: #b8b9be; box-shadow: none; }
  html.dark .btn-ghost:hover { border-color: var(--hg-border-hover); color: var(--hg-text-bright); }
  html.dark .hg-lane {
    border-bottom-color: var(--hg-border-control); color: var(--hg-text-bright);
    background: var(--hg-frost-head);
  }
  html.dark .hg-lane .seg-meta { color: var(--hg-info); }
  html.dark .hg-lane .seg-hint { color: var(--hg-text-muted); }
  html.dark .hg-lane .seg-name-input,
  html.dark .hg-lane .seg-name-input:hover,
  html.dark .hg-lane .seg-name-input:focus { background: transparent; color: inherit; border-color: transparent; }
  html.dark .hg-lane .seg-name-input:hover { border-color: var(--hg-border-control); }
  html.dark .hg-lane .seg-name-input:focus { border-color: var(--hg-border-hover); }
  html.dark .seg-hidden-toggle { color: var(--hg-text-muted); }
  html.dark .seg-hidden-toggle:hover { color: var(--hg-text-bright); }
  html.dark .seg-hidden-row { color: var(--hg-border-focus); }
  html.dark .seg-hidden-row .seg-restore { background: transparent; border-color: var(--hg-border-control); color: #b8b9be; }
  html.dark .seg-hidden-row .seg-restore:hover { border-color: var(--hg-border-hover); color: var(--hg-text-bright); }
  html.dark .seg-hidden-row .seg-delete { background: transparent; border-color: #5a3330; color: #d08a82; }
  html.dark .seg-hidden-row .seg-delete:hover { border-color: var(--hg-danger); color: #e0655f; }
  /* Hover does not touch background at all — the rest rule keeps the feathered
     accent edge, and this rule can no longer outrank it into a bare wash. */
  html.dark .hg-entity .a-type { color: var(--hg-text-muted); background: transparent; }
  html.dark .hg-entity .a-days { color: var(--hg-info); }
  html.dark .t-cost { color: var(--hg-info); }
  html.dark .asset-tree .hg-stage .t-cost input { border-color: var(--hg-border-control); color: var(--hg-text-bright); height: 22px; }
  html.dark .asset-tree .hg-stage .t-cost input:focus { border-color: var(--hg-border-hover); }
  html.dark .asset-tree .hg-stage .t-cost .t-cur { color: var(--hg-text-muted); }
  html.dark .asset-tree .hg-stage .t-model-inputs input { border-color: var(--hg-border-control); color: var(--hg-text-bright); height: 22px; }
  html.dark .asset-tree .hg-stage .t-model-inputs input:focus { border-color: var(--hg-border-hover); }
  html.dark .asset-tree .hg-stage .t-note-input { color: #9aa0ab; }
  html.dark .asset-tree .hg-stage .t-note-input::placeholder { color: #3f4046; }
  html.dark .asset-tree .hg-stage .t-note-input:hover { border-color: var(--hg-border-control); }
  html.dark .asset-tree .hg-stage .t-note-input:focus { border-color: var(--hg-border-hover); color: var(--hg-text-bright); }
  /* The stepper's hairline is --seg-rule in both modes, as every coloured row
     line is, so dark restates the ink only. */
  html.dark .t-spinner .sp { color: var(--hg-text-muted); }
  html.dark .t-spinner .sp:hover { background: color-mix(in srgb, var(--seg-accent, var(--hg-accent)) 18%, transparent); border-color: color-mix(in srgb, var(--seg-accent, var(--hg-accent)) 85%, var(--hg-border-focus)); color: var(--hg-text-bright); }
  html.dark .asset-tree .hg-stage .t-cost .t-cost-x { color: var(--hg-text-muted); }
  html.dark .asset-cost-row { border-top-color: var(--hg-border-chrome); }
  html.dark .master-totals h3 { color: var(--hg-text-muted); }
  html.dark .fp-table th { color: var(--hg-text-muted); border-bottom-color: var(--hg-hairline); }
  html.dark .fp-table td { border-bottom-color: var(--hg-border-cell); }
  html.dark #msTable tr.fp-ms-note-row td { border-bottom-color: var(--hg-hairline); }
  html.dark .fp-table tr.doc-total td { border-top-color: var(--hg-border-chrome); }
  html.dark .fp-table tr.doc-total td.num { color: var(--hg-text-bright); }
  html.dark .fp-cb-hdr { color: var(--hg-text-muted); border-bottom-color: var(--hg-hairline); }
  html.dark .fp-cb-row { border-bottom-color: var(--hg-hairline); }
  html.dark .fp-cb-row.fp-cb-total { border-top-color: var(--hg-border-chrome); }
  html.dark .fp-cb-row.fp-cb-total .fp-cb-amt { color: var(--hg-text-bright); }
  html.dark .fp-cb-hdr { color: var(--hg-text-bright); border-bottom-color: var(--hg-hairline); }
  html.dark .fp-cb-line { color: var(--hg-text-bright); }
  html.dark .fp-cb-amt.cur-gbp, html.dark .fp-cb-amt.cur-usd { border-right-color: var(--hg-border-chrome); }
  html.dark .fp-cb-hdr .fp-cb-amt.cur-gbp, html.dark .fp-cb-hdr .fp-cb-amt.cur-usd { border-right-color: var(--hg-border-chrome); }
  html.dark .mt-kpi b { color: var(--hg-info); }
  html.dark .mt-table th { border-bottom-color: var(--hg-border-chrome); color: var(--hg-text-muted); }
  html.dark .mt-table td { border-bottom-color: var(--hg-hairline); color: var(--hg-text-dim); }
  html.dark .mt-table td.num { color: var(--hg-text-bright); }
  html.dark .mt-table tr.mt-total td { border-top-color: var(--hg-border-chrome); color: var(--hg-text-bright); }
  html.dark .mt-table tr.mt-ua td { border-top-color: var(--hg-border-chrome); color: var(--hg-text-dim); }
  html.dark .mt-table td.mt-delta.over { color: var(--hg-danger-bright); }
  html.dark .mt-table td.mt-delta.under { color: var(--st-ip-ink); }
  html.dark .mt-table tr.mt-ent td { color: var(--hg-text-dim); }
  html.dark .mt-table tr.mt-ent td.num { color: var(--hg-text-dim); }
  html.dark .fp-cb-row.fp-cb-sub .fp-cb-line,
  html.dark .fp-cb-row.fp-cb-sub .fp-cb-amt { color: var(--hg-text-dim); }
  html.dark .mt-perf { border-top-color: var(--hg-border-chrome); }
  html.dark .mt-perf-val { color: var(--hg-text-bright); }
  html.dark .mt-perf-label { color: var(--hg-text-dim); }
  html.dark .mt-perf-val.neg { color: var(--hg-danger-bright); }
  html.dark .mt-perf-val.pos { color: var(--st-ip-ink); }
  html.dark .wire-panel { margin-bottom: 8px; }
  html.dark .wire-panel.collapsed { margin-bottom: 4px; }
  /* Both modes paint the Top shade on panel title bars, so the bar reads as one
     band across the app in either theme. */
  html.dark .wire-title, html.dark .hg-floating-title { background: var(--hg-surface-header); border-bottom-color: transparent; color: var(--hg-text-bright); box-shadow: var(--hg-shadow-sm); backdrop-filter: blur(var(--hg-frost-blur)); -webkit-backdrop-filter: blur(var(--hg-frost-blur)); }
  html.dark .wire-title:hover, html.dark .hg-floating-title:hover { color: var(--hg-text-bright); }
  /* Internal budget + Crew cost panels — frosted glass, the same Top shade */
  html.dark #masterTotals .wire-title,
  html.dark #crewCost .wire-title,
  html.dark #v-cli .wire-title {
    background: var(--hg-surface-header);
    color: var(--hg-text-bright);
  }
  html.dark #masterTotals,
  html.dark #crewCost,
  html.dark #v-cli .master-totals {
    background: var(--hg-frost-bg);
  }
  html.dark .master-totals:not(.collapsed) {
    box-shadow: var(--hg-shadow-lift);
  }
  html.dark .wire-heading-input { color: var(--hg-text-bright); }
  html.dark .wire-heading-input:hover { border-color: var(--hg-border-control); }
  html.dark .wire-heading-input:focus { border-color: var(--hg-border-hover); background: var(--hg-input-bg); }
  html.dark .meta-label { color: var(--hg-text-bright); }
  html.dark .meta-row { border-bottom-color: var(--hg-hairline); }
  html.dark .hg-prompt-input { border-color: var(--hg-border-control); background: var(--hg-surface-raised); color: var(--hg-text-bright); }
  html.dark .wire-caret { color: var(--hg-border-focus); }
  html.dark #masterTotals .wire-caret,
  html.dark #v-cli .wire-caret { color: #b0b1b8; }
  html.dark #masterTotals .cs-del,
  html.dark #v-cli .cs-del { color: #8a8b92; }
  html.dark #masterTotals .cs-del:hover,
  html.dark #v-cli .cs-del:hover { color: var(--hg-text-bright); }
  html.dark #masterTotals .meta-panel-reorder,
  html.dark #masterTotals .meta-panel-tpl,
  html.dark #v-cli .meta-panel-reorder,
  html.dark #v-cli .meta-panel-tpl { opacity: .7; }
  html.dark .mt-rate-row { color: var(--hg-text-muted); }
  html.dark .mt-rate-row label { color: var(--hg-text-muted); }
  html.dark .footnote { color: var(--hg-text-muted); }
  html.dark .footnote b { color: var(--hg-text-bright); }
  html.dark #hgConfirmBody { color: #a6a7ad; }
html.dark .modal-bg { background: transparent; }
  html.dark .modal, html.dark .hg-floating-panel { background: var(--hg-frost-bg); border-color: var(--hg-border-control); color: var(--hg-text-bright); box-shadow: var(--hg-shadow-modal); }
  html.dark .modal h3 { color: var(--hg-text-bright); }
  html.dark .na-gantt-wrap { border-color:var(--hg-border-control); }
  html.dark .na-gantt-wrap .gantt-labels { background:transparent; }
  html.dark .na-gantt-wrap .na-lane-body { background:transparent; }
  html.dark .na-gantt-wrap .na-row { background:var(--hg-frost-bg); border-bottom-color:var(--hg-border-cell); }
  html.dark .na-gantt-wrap .cell { border-left-color: rgba(0, 0, 0, 0.25); }
  html.dark .na-gantt-wrap .na-row input.na-stage, html.dark .na-gantt-wrap .na-row input.na-num { color:var(--hg-input-ink); }
  html.dark .na-gantt-wrap .na-row input.na-stage:hover, html.dark .na-gantt-wrap .na-row input.na-stage:focus,
  html.dark .na-gantt-wrap .na-row input.na-num:hover, html.dark .na-gantt-wrap .na-row input.na-num:focus { border-color:var(--hg-border-control); }
  html.dark .na-gantt-wrap .na-row .na-rm { color:var(--hg-text-muted); }
  html.dark .na-gantt-wrap .na-row .na-rm:hover { color:var(--st-reopen-ink); }
  html.dark .na-gantt-wrap .gantt-labels > .task-add { background:transparent; border-top-color:var(--hg-border-control); color:var(--hg-info); }
  html.dark .na-gantt-wrap .gantt-labels > .task-add:hover { color: var(--hg-text-bright); }
  html.dark .na-gantt-wrap .gantt-labels .labels-head { background:var(--hg-frost-head); border-bottom-color:var(--hg-border-chrome); backdrop-filter:blur(var(--hg-frost-blur)); -webkit-backdrop-filter:blur(var(--hg-frost-blur)); }
  html.dark .na-gantt-wrap .weekhdr { background:var(--hg-frost-head); border-bottom-color:var(--hg-border-chrome); backdrop-filter:blur(var(--hg-frost-blur)); -webkit-backdrop-filter:blur(var(--hg-frost-blur)); }
  /* Card-level action buttons now use .btn-new .card-task-btn (dark pill),
     so they inherit html.dark .btn-new. The plain .task-add class is still
     used by the seg-footer "Add Lane" and the new-task modal "+ add stage". */
  html.dark .task-add { color: var(--hg-info); }
  html.dark .task-add:hover { color: var(--hg-text-bright); }
  /* A field on a lane-tinted card in dark: the substrate's own wash sunk by the
     scrim in --seg-field, so the field is a touch darker and softer than the row
     while keeping its lane tone. The plain field fill sits below the lane wash in
     dark and reads as a hole, while light already paints above that wash, so
     light keeps the app field fill. */
  html.dark .asset-tree .hg-stage .t-note-input,
  html.dark .asset-tree .hg-stage .t-model-inputs input,
  html.dark .asset-tree .hg-stage .t-cost input,
  html.dark .t-spinner .t-days { background: var(--seg-field); }
  html.dark .asset-tree .hg-stage .t-stage-input { background: var(--seg-field); color: var(--hg-text-bright); border-color: transparent; }
  html.dark .asset-tree .hg-stage .t-stage-input:hover { border-color: var(--hg-border-control); }
  html.dark .asset-tree .hg-stage .t-stage-input:focus { border-color: var(--hg-border-hover); }
  html.dark .gfilters { background: transparent; border-bottom-color: transparent; color: var(--hg-text-muted); }
  /* Receipt drop zone dark-mode: text/border brighten to the same tokens
     as .wire-title (--hg-text-bright) so the strip is legible on the
     near-black surface. Frost fill + blur stay from the shared rule. */
  html.dark .receipt-drop-zone { color: var(--hg-text-bright); border-color: color-mix(in srgb, #8a93a3 45%, transparent); }
  html.dark .receipt-drop-zone:hover { background: var(--hg-frost-head); border-color: color-mix(in srgb, #8a93a3 70%, transparent); }
  html.dark .receipt-drop-text { color: var(--hg-text-bright); }
  html.dark .receipt-drop-hint { color: var(--hg-text-dim); opacity: 1; }
  html.dark .receipt-drop-spinner { border-color: var(--hg-text-bright); border-top-color: transparent; }
  html.dark .receipt-drop-clear { color: var(--hg-text-bright); }
  html.dark .receipt-drop-zone.drag-over { background: color-mix(in srgb, #5a8fcf 18%, transparent); border-color: #7db3e8; }
  html.dark .receipt-drop-zone.has-pending { border-color: color-mix(in srgb, #7db3e8 70%, transparent); background: color-mix(in srgb, #5a8fcf 12%, transparent); }
  html.dark .gbar.ip { background: var(--gbar-ip-bg); color: #141517; }
  html.dark .gbar.wtg { background: var(--gbar-wtg-bg); color: var(--gbar-wtg-ink); }
  html.dark .gbar.appr { background: #6d87a3; color: #141517; }
  html.dark .gbar.cmpt { background: var(--gbar-cmpt-bg); color: #141517; }
  html.dark .gbar.reopen { background: #a0767d; color: #141517; }
  html.dark .gbar.draft {
    background: repeating-linear-gradient(45deg,var(--gbar-wtg-bg),var(--gbar-wtg-bg) 6px,var(--gbar-draft-stripe) 6px,var(--gbar-draft-stripe) 12px);
    color: var(--gbar-wtg-ink);
  }
  html.dark .gbar.rev { background: #b5986a; color: #141517; }
  html.dark .gbar .gbar-ghost { background: rgba(0, 0, 0, 0.32); }
  html.dark .gbar.parent-open {
    background: color-mix(in srgb, var(--gbar-wtg-bg) 22%, transparent);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, #6d87a3 50%, transparent),
                inset 0 2px 5px rgba(255,255,255,.06),
                0 1px 4px rgba(0,0,0,.35);
    color: #b9bec7;
  }
  html.dark .gantt-scroll-hint { color: #6f707680; background: rgba(20,21,23,.72); }
  html.dark .gantt-labels { background: var(--hg-surface-base); border-right-color: var(--hg-border-chrome); box-shadow: none; }
  html.dark .gantt-labels .labels-head { background: var(--hg-surface-elevated); border-bottom-color: var(--hg-border-chrome);
    box-shadow: inset 0 2px 4px rgba(255,255,255,.01),
                inset 0 -2px 5px rgba(0,0,0,.09);
  }
  html.dark .gantt-labels .hg-entity { color: var(--hg-text-bright); }
  html.dark .gantt-labels .hg-entity .days { color: var(--st-ip-ink); }
  html.dark .gantt-labels .hg-stage .g-stage { color: var(--hg-text-bright); }
  html.dark .gantt-labels .hg-stage .who { color: var(--hg-text-muted); }
  html.dark .gantt-labels .hg-stage .who.gantt-crew-read { color: var(--hg-people); cursor: context-menu; }
  html.dark .gantt-labels .hg-stage .who.gantt-crew-read .gantt-crew-name:hover,
  html.dark .gantt-labels .hg-stage .who.gantt-crew-read .gantt-crew-more:hover { text-decoration: underline; text-underline-offset: 2px; }
  html.dark .gantt-labels .hg-stage .who.gantt-crew-read .gantt-crew-more { margin-left: 4px; font-weight: 600; cursor: pointer; }
  html.dark .gantt-labels .hg-stage > .gantt-openmark { flex-shrink: 0; margin-left: 4px; color: var(--hg-danger-bright); font-weight: 700; cursor: pointer; }
  html.dark .gantt-labels .hg-stage > .gantt-openmark:hover { text-decoration: underline; text-underline-offset: 2px; }
  html.dark .gantt-labels .hg-entity .owner-pick:not(.un) { color: var(--hg-people); }
  /* Placeholder sup shows no field box — the raised fill reads as an empty
     input punched into the row. Unassigned = bare muted text, same chrome
     as assigned minus the person colour. */
  html.dark .gantt-labels .hg-entity .owner-pick.un { background: transparent; }
  /* Hover link affordance, dark twin of the light .owner-pick:hover rule. */
  html.dark .gantt-labels .hg-entity .owner-pick:hover { text-decoration: underline; text-underline-offset: 2px; }
  html.dark .workload-dock {
    background: var(--hg-frost-bg);
    border-top-color: #000;
  }
    html.dark .workload-dock .wl-titlebar {
      border-bottom-color: var(--hg-hairline); color: #c4a090;
    }
    html.dark .workload-dock .wl-titlebar:hover {
      background: color-mix(in srgb, #e4e4e7 10%, var(--hg-frost-head-solid));
    }
    html.dark .workload-dock .wl-caret { color: #9a7a68; }

    html.dark .workload-dock .wl-titlebar-meta { color: #a89080; }
    html.dark .workload-dock .wl-titlebar-meta.is-warn { color: #c08a8a; }
    html.dark #workloadPanel { background: transparent; }
    html.dark .workload-dock .wl-worker-row { border-bottom-color: var(--hg-border-cell); }
    html.dark .workload-dock .wl-worker-row:hover .wl-name,
    html.dark .workload-dock .wl-worker-row.hover-pair .wl-name {
      background: var(--hg-surface-header);
    }
    html.dark .workload-dock .wl-worker-row:hover .wl-cells,
    html.dark .workload-dock .wl-worker-row.hover-pair .wl-cells {
      background: color-mix(in srgb, var(--hg-surface-header) 40%, transparent);
    }
    html.dark .workload-dock .wl-names { border-right-color: var(--hg-hairline); }
    html.dark .workload-dock .wl-name {
      background: transparent; color: #d2c4b8;
    }
    html.dark .workload-dock .wl-worker-row.is-active .wl-name {
      background: var(--hg-surface-tabs); color: var(--hg-text-bright);
      box-shadow: inset 3px 0 0 var(--hg-accent);
    }
    html.dark .workload-dock .wl-worker-row.is-active .wl-cells { background: color-mix(in srgb, var(--hg-surface-tabs) 40%, transparent); }
    html.dark .workload-dock .wl-worker-row.is-active .wl-cell:not(.is-overload):not(.is-underutilized) {
      background: color-mix(in srgb, var(--hg-surface-tabs) 60%, transparent);
    }
    html.dark .workload-dock .wl-name-empty { color: #7a6558; }
    html.dark .workload-dock .wl-cells { background: transparent; }
    html.dark .workload-dock .wl-cell { border-left-color: var(--hg-border-cell); color: #8a7a6e; }
    html.dark .workload-dock .wl-cell.has-load { background: #3a455a33; color: #c2c8d4; }
    html.dark .workload-dock .wl-cell.is-overload {
      background: #a05a5a2e; color: #c08a8a; border-left-color: #a05a5a55;
    }
    html.dark .workload-dock .wl-cell.is-underutilized {
      background: #8a5a202e; color: #c8a878; border-left-color: #8a5a2055;
    }
  html.dark .cashflow-dock {
    background: var(--hg-frost-bg);
    border-top-color: #000;
  }
  html.dark .cashflow-dock .cf-titlebar {
    border-bottom-color: var(--hg-hairline); color: var(--st-ip-ink);
  }
  html.dark .cashflow-dock .cf-titlebar:hover {
    background: color-mix(in srgb, #e4e4e7 10%, var(--hg-frost-head-solid));
  }
  html.dark .cashflow-dock .cf-caret { color: #6f987e; }
  html.dark .cashflow-dock .cf-titlebar-sub { color: #6a7a70; }
    html.dark .cashflow-dock .cf-titlebar-meta { color: var(--st-ip-ink); }
      html.dark .cashflow-dock .cf-titlebar-meta .cf-meta-bit.is-warn {
        color: var(--cf-deficit-t, #c08a8a);
      }
    html.dark .cashflow-dock .cf-label { background: transparent; border-right-color: var(--hg-hairline); color: var(--st-ip-ink); }
    html.dark .cashflow-dock .cf-label-title { color: var(--st-ip-ink); }
    html.dark #cashflowPanel { background: transparent; }
  html.dark .weekhdr { background: var(--hg-surface-elevated); border-bottom-color: var(--hg-border-chrome);
    box-shadow: inset 0 2px 4px rgba(255,255,255,.01),
                inset 0 -2px 5px rgba(0,0,0,.09);
  }
  html.dark .weekhdr .w, html.dark .weekhdr .m { border-left-color: rgba(0, 0, 0, 0.25); color: var(--hg-text-quiet); }
    html.dark .weekhdr .w .end { color: var(--hg-text-quiet); }
    html.dark .weekhdr .m .hg-week-seam { background: rgba(0, 0, 0, 0.35); }
    html.dark .weekhdr .d .hg-ms-dayn,
    html.dark .weekhdr .d .hg-hrmark,
    html.dark .weekhdr .d .hg-minlab { color: var(--hg-text-muted); }
    html.dark .cell {
        border-left-color: rgba(0, 0, 0, 0.25);
        background-image:
          linear-gradient(to bottom, rgba(0, 0, 0, 0.25) 50%, transparent 50%),
          linear-gradient(to bottom, rgba(0, 0, 0, 0.25) 50%, transparent 50%),
          linear-gradient(to bottom, rgba(0, 0, 0, 0.25) 50%, transparent 50%),
          linear-gradient(to bottom, rgba(0, 0, 0, 0.25) 50%, transparent 50%);
        background-size: 1px 6px, 1px 6px, 1px 6px, 1px 6px;
        background-position:
          calc(var(--hg-week-w) / 5 * 1) 0,
          calc(var(--hg-week-w) / 5 * 2) 0,
          calc(var(--hg-week-w) / 5 * 3) 0,
          calc(var(--hg-week-w) / 5 * 4) 0;
        background-repeat: repeat-y;
      }
    /* Open-week cell, dark twin: same per-day tick pattern, darker hairline
       colour (the tick gradient rides the same .wk-grid rule; only the
       gradient colour needs the dark override). */
    html.dark .cell.open-week {
        background-image: none;
      }
    html.dark .cell.open-week .wk-grid.wknd {
        background-color: color-mix(in srgb, var(--hg-accent) 7%, transparent);
      }
  html.dark #labelsPanel .hg-lane, html.dark #lanes .hg-lane { color: var(--hg-text-bright); }
  html.dark #labelsPanel .hg-lane .days { color: var(--st-ip-ink); }
  html.dark #labelsPanel .hg-lane .days.days-over { color: var(--hg-danger-bright); }
  html.dark #labelsPanel .hg-lane .days.days-under { color: var(--st-ip-ink); }
  html.dark .collapse-btn { background: transparent; border-color: var(--hg-border-control); color: var(--hg-text-muted); box-shadow: none; }
  html.dark .collapse-btn:hover { border-color: var(--hg-border-hover); color: var(--hg-text-bright); }
  html.dark .gantt-labels .gantt-toggle-row:hover { background-image: linear-gradient(rgba(255,255,255,.05), rgba(255,255,255,.05)); }
  html.dark .block-btn { background: transparent; border-color: var(--hg-border-control); color: #b8b9be; }
  html.dark .block-btn.on { background: var(--hg-accent); border-color: var(--hg-accent); color: var(--gbar-rev-ink); }
  html.dark .block-btn:hover { border-color: var(--hg-border-hover); color: var(--hg-text-bright); }
  html.dark .block-btn.on:hover { background: #e2b155; color: var(--gbar-rev-ink); }
  html.dark .doc { background: transparent; border-color: var(--hg-border-chrome); }
  html.dark .doc .docsub { color: var(--hg-text-muted); }
  html.dark .doc td, html.dark .doc th { border-bottom-color: var(--hg-border-cell); }
  html.dark .doc th { color: var(--hg-text-muted); border-bottom-color: var(--hg-border-chrome); position: sticky; top: 79px; z-index: 34; background: var(--hg-surface-base); }
  html.dark table.track th, html.dark #crewTable th { background: var(--hg-frost-head); }
  html.dark .doc .doc-total td { border-top-color: var(--hg-border-control); }
  html.dark .doc .gen { color: var(--hg-text-muted); }
  html.dark .drawer { background: var(--hg-surface-base); border-left-color: var(--hg-border-chrome); box-shadow: var(--hg-shadow-slide); }
  html.dark .drawer .kv .k { color: var(--hg-text-muted); }
  html.dark .drawer .x { color: var(--hg-text-muted); }
  html.dark .drawer .thread { background: var(--hg-surface-card); color: #a8a9ae; }
  html.dark .drawer h4 { color: var(--hg-text-muted); }
  html.dark .drawer .evi, html.dark .drawer a { color: var(--hg-info); }
    html.dark #spikeLine { background: #a05a5a !important; box-shadow: 0 0 0 1px #17181b !important; }
  html.dark .crew-pick.un { color: var(--st-reopen-ink); border-color: var(--st-reopen-bg); background: #241a1c; }
  html.dark .owner-pick { border-color: var(--hg-border-control); background-color: transparent; color: var(--hg-text-bright); }
  html.dark .owner-pick.un { color: var(--hg-text-muted); border-color: #2a2b30; background: var(--hg-surface-raised); }
  html.dark #viewHint { color: var(--hg-text-muted) !important; }

/* ===== 3b. SCROLLBAR POLICY (chrome) =====
   Order is mandatory:
   1) hide scrollbars on .tabs (light + dark)
   2) optionally enable thin scrollbars on html.dark *
   3) re-hide .tabs with !important so step 2 cannot win
   Do NOT add another html.dark * scrollbar rule elsewhere. */
.tabs,
html.dark .tabs { scrollbar-width: none; }
.tabs::-webkit-scrollbar,
html.dark .tabs::-webkit-scrollbar { display: none; width: 0; height: 0; }

/* Scrollbar thumb: the Appearance Top pair (--hg-surface-header), in both modes.
   The track stays transparent in WebKit and Firefox. Every scrollbar therefore
   follows the Top colour of the preset or the hand-picked pair. */
* { scrollbar-color: var(--hg-surface-header) transparent; }
::-webkit-scrollbar-track { background: transparent; }

html.dark * { scrollbar-width: thin; scrollbar-color: var(--hg-surface-header) transparent; }
html.dark ::-webkit-scrollbar { width: 10px; height: 10px; }
html.dark ::-webkit-scrollbar-track { background: transparent; }
html.dark ::-webkit-scrollbar-thumb { background: var(--hg-surface-header); border-radius: 4px; border: 2px solid transparent; }
html.dark ::-webkit-scrollbar-thumb:hover { background: color-mix(in srgb, var(--hg-surface-header) 88%, #fff); }

/* A bounded list that must show where it continues. The native bar cannot
   be relied on: a composited scroller — the settings modal is one — gets
   Chromium's overlay bars, which paint only while scrolling and leave the
   reserved gutter empty at rest. So the native bar is hidden and the range
   is drawn instead (js/scroll-bar.js), in the same hairline vocabulary as
   the rest of the chrome. */
.hg-scroll { overflow-y: auto; scrollbar-width: none; }
.hg-scroll::-webkit-scrollbar { display: none; width: 0; height: 0; }
.hg-vscroll { position: relative; }
.hg-scrollbar {
  position: absolute; right: 3px; width: 5px; border-radius: 3px;
  background: color-mix(in srgb, var(--hg-surface-header) 90%, transparent);
  pointer-events: none;
}
.hg-scrollbar[hidden] { display: none; }

html.dark .tabs { scrollbar-width: none !important; }
html.dark .tabs::-webkit-scrollbar { display: none !important; width: 0 !important; height: 0 !important; }

/* ===== 6. DOCK EXTRAS — CF balance stroke + gbar resize edges ===== */
/* Continuous SVG cash-balance stroke (replaces day-tile staircase) */
#cfTrack .cf-bal-svg { display: block; }
#cfTrack .cf-bal-path {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
#cfTrack .cf-bal-path.cf-bal-surplus {
  stroke: var(--cf-income);
  filter: drop-shadow(0 0 3px color-mix(in srgb, var(--cf-income) 70%, transparent));
}
#cfTrack .cf-bal-path.cf-bal-deficit {
  stroke: var(--cf-deficit-t);
  animation: cf-deficit-pulse 1.6s ease-in-out infinite;
  will-change: filter;
}
/* Red (underwater) stroke: pulsating red glow via SVG-friendly drop-shadow */
@keyframes cf-deficit-pulse {
  0%, 100% {
    filter:
      drop-shadow(0 0 2px var(--cf-deficit-glow))
      drop-shadow(0 0 6px color-mix(in srgb, var(--cf-deficit-glow) 55%, transparent))
      brightness(1);
  }
  50% {
    filter:
      drop-shadow(0 0 4px var(--cf-deficit-glow))
      drop-shadow(0 0 12px var(--cf-deficit-glow))
      drop-shadow(0 0 22px color-mix(in srgb, var(--cf-deficit-glow) 75%, transparent))
      brightness(1.2);
  }
}
@media (prefers-reduced-motion: reduce) {
  #cfTrack .cf-bal-path.cf-bal-deficit {
    animation: none;
    filter:
      drop-shadow(0 0 4px var(--cf-deficit-glow))
      drop-shadow(0 0 12px color-mix(in srgb, var(--cf-deficit-glow) 60%, transparent));
  }
}
.gbar { position: absolute; } /* ensure edges position relative to bar */
  /* Stage payment badge on the stage's gantt row: the day the money pays.
     Click opens the payment panel, drag along the track re-dates it. Material
     comes from .hg-icon-btn.bordered; this block states size and position. */
  #lanes .hg-icon-btn.gpay-mark {
    position: absolute; z-index: 6; transform: translateX(-50%);
    width: 16px; height: 16px; padding: 0; border-radius: 50%;
    font-size: var(--hg-type-10); font-weight: 700;
    cursor: ew-resize; touch-action: none;
  }
  #lanes .hg-icon-btn.gpay-mark:hover,
  #lanes .hg-icon-btn.gpay-mark.is-dragging { z-index: 8; }
.gbar .gedge {
  position: absolute; top: 0; bottom: 0; width: 10px; cursor: ew-resize; z-index: 3;
  background: transparent;
}
.gbar .gedge[data-edge="l"] { left: 0; border-radius: 3px 0 0 3px; }
.gbar .gedge[data-edge="r"] { right: 0; border-radius: 0 3px 3px 0; }
.gbar .gedge:hover { background: #ffffff55; }
.gbar[data-seg], .gbar[data-task], .gbar[data-grp] { cursor: grab; }
.gbar-dragging { transform: translateY(1px); transition: transform .06s ease-out; }

/* ── Dependency link plugs ─────────────────────────────── */
/* Plugs are full discs sized to the bar's own thickness and parked entirely
   OUTSIDE the bar end (right/left: 100%), so they cap the end without
   fighting the .gedge resize handles that sit inside the bar. The bar row
   has overflow:visible to allow this (the .cells grid inside still clips its
   own week grid). A bar hovered near either end goes .plug-live: its plugs
   appear and strobe until the pointer leaves, so the link handle announces
   itself instead of waiting to be discovered. */
.gbar .gplug {
  position: absolute; top: 0; bottom: 0; width: auto; aspect-ratio: 1;
  border-radius: 50%; z-index: 60;
  background: var(--hg-surface-raised);
  border: 1.5px solid var(--hg-accent);
  opacity: 0; transition: opacity .1s ease; cursor: crosshair; pointer-events: auto;
}
.gbar .gplug-start { right: 100%; }
.gbar .gplug-end { left: 100%; }
/* Linking bars is Tier 1 and 2 work. Below that the disc still marks the
   linked end but offers no drag or detach gesture. */
.gbar .gplug-locked { cursor: default; }
.gbar .gplug:hover {
  border-color: var(--hg-accent);
  box-shadow: 0 0 4px var(--hg-accent);
}
/* A bar is its own stacking context (z-index 1), so a bar that starts beside
   it paints over the space its plugs park in. While live, the bar rides above
   its siblings on the row: its discs stay visible and hittable next to a
   neighbour, however little room is left between the two ends. */
.gbar.plug-live { z-index: 62; }
.gbar.plug-live .gplug {
  opacity: 1;
  animation: gplug-strobe 1.1s ease-in-out infinite;
}
@keyframes gplug-strobe {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--hg-accent) 0%, transparent); }
  50% { box-shadow: 0 0 9px 1px var(--hg-accent); }
}
/* Whole-bar link target. The drop point inside the bar carries no meaning —
   the source plug already fixes the roles — so the bar lights up as one
   target and no plug has to be hit. */
.gbar.drop-target {
  outline: 2px solid var(--hg-accent);
  outline-offset: 2px;
}

/* A bar chosen for a multi-bar move. The ring wears the shared accent, so it
   reads on every status fill in both modes; the bar lifts one step so a
   neighbour on the same row cannot paint over its edge. The band is the
   pointer's own rectangle over empty track space. */
.gbar.gsel {
  outline: 2px solid var(--hg-accent);
  outline-offset: 2px;
  z-index: 2;
}
.gsel-band {
  position: absolute; z-index: 56; pointer-events: none;
  border: 1px solid var(--hg-accent);
  background: color-mix(in srgb, var(--hg-accent) 12%, transparent);
  border-radius: 2px;
}

/* (assignment + copy icon removed 2026-09-09 — Copy bar lives in the RMB menu) */

/* ── Dependency link SVG overlay ───────────────────────── */
#linkLayer { pointer-events: none; }
#linkLayer path { pointer-events: stroke; }

/* ── Cross-deliverable link stubs ───────────────────────── */
/* A link inside a deliverable keeps its curve. A link that leaves that
   deliverable row, in the same lane or another, is stated by one short dashed
   stub per bar END, with a 5px circle at the free end. The stub is a span
   INSIDE the bar: the row's own transform and wipe carry it, so a fold cannot
   leave it behind and no per-frame sync exists. It starts at the bar edge and
   runs 35px outward; the plug (a disc as wide as its bar is tall) paints over
   its first 18px, so plug and stub stay separately pickable. Parent bars have
   no plugs and carry the bare stub. The circle carries the predecessor's
   status: filled when every link on that stub has a complete/approved
   predecessor, hollow when one is still open; links into a collapsed
   deliverable are muted. Hover draws the curves, a click opens the connected
   deliverables and centres the first one. */
#lanes .gbar .gdep-stub {
  position: absolute; top: 50%; height: 10px; margin-top: -5px; width: 35px;
  z-index: 5; cursor: pointer;
  color: var(--hg-accent);
  background-image: repeating-linear-gradient(to right,
    currentColor 0 3px, transparent 3px 6px);
  background-size: 6px 1.5px;
  background-repeat: repeat-x;
  background-position: 0 50%;
}
#lanes .gbar .gdep-stub-start { right: 100%; }
#lanes .gbar .gdep-stub-end { left: 100%; }
/* A deliverable or lane bar has no plug to clear, so its stub is half the
   length of an assignment bar's stub: the whole run is past the bar edge. */
#lanes .gbar .gdep-stub.bare { width: 17.5px; }
#lanes .gbar .gdep-stub::after {
  content: ''; position: absolute; top: 50%; margin-top: -2.5px;
  width: 5px; height: 5px; border-radius: 50%;
  background: currentColor;
}
#lanes .gbar .gdep-stub-start::after { left: 0; }
#lanes .gbar .gdep-stub-end::after { right: 0; }
#lanes .gbar .gdep-stub.hollow::after {
  background: transparent;
  box-shadow: inset 0 0 0 1.5px currentColor;
}
#lanes .gbar .gdep-stub.muted { color: var(--hg-text-muted); }
#lanes .gbar .gdep-stub:hover { background-size: 6px 2.5px; }
#linkLayer .gdep-wires path { pointer-events: none; }

/* A hovered over-capacity heat cell points at the parent triangles that own
   its bars: one dashed curve in the dependency language. The layer is
   body-level because the crew dock and the chart are separate scroll ports,
   and it never takes a press (the cell stays the hit target). */
#wlCellLinkLayer {
  position: fixed; inset: 0; width: 100vw; height: 100vh;
  pointer-events: none; z-index: 160; overflow: visible;
}
#wlCellLinkLayer path {
  fill: none; stroke: var(--hg-danger); stroke-width: 2;
  stroke-dasharray: 6 4; stroke-linecap: round; opacity: .5;
}

/* The bar that a stub click just brought into view: one quiet ring, then it
   fades, so the arrival has a subject without becoming a second selection. */
#lanes .gbar.link-arrive {
  outline: 2px solid var(--hg-accent);
  outline-offset: 3px;
}

/* ── Dependency overlap hatching ───────────────────────── */
/* Same 45deg hatching pattern as the draft/review bar, but as a semi-transparent
   overlay so the bar's own status colour shows through. Indicates where a
   predecessor and successor overlap in time — dependencies are flexible, this
   just signals where it's happening. */
.gbar-dep-overlap {
  background: repeating-linear-gradient(45deg,
    transparent, transparent 4px,
    color-mix(in srgb, var(--hg-accent) 35%, transparent) 4px,
    color-mix(in srgb, var(--hg-accent) 35%, transparent) 8px);
}

/* ── Cascade toggle button ─────────────────────────────── */
 .gf-btn.gfCascade.on { background: var(--hg-accent); color: var(--hg-text-on-accent); }
/* ── Time filter button: label + down-caret (hold-to-cycle affordance) ── */
 .gf-time { display: inline-flex; align-items: center; gap: 4px;
   touch-action: none; -webkit-user-select: none; user-select: none;
   -webkit-touch-callout: none; }
 .gf-time-caret { font-size: 10px; line-height: 1; opacity: .75; margin-right: -2px; }
 .gf-time-caret { pointer-events: none; }
/* ── Time filter menu: the option under the drag pointer lights up in the
   ON colour (same fill as block-btn.on) — the release target, never a
   hover wash. Dark twin flips the text to the dark ink like every pressed
   control (dark accent is gold; white text fails contrast). The engine's
   own .current dot stays for the already-active mode. ── */
 .gf-time-menu .hg-menu-item.sel { background: var(--hg-accent); color: var(--hg-text-on-accent); }
 .gf-time-menu .hg-menu-item.sel.current::after { background: currentColor; }
 /* The drag pointer paints .sel; the engine's :hover wash must not compete —
    scoped to non-selected rows so the accent highlight always wins. */
 .gf-time-menu .hg-menu-item:not(.sel):hover { background: transparent; }
 html.dark .gf-time-menu .hg-menu-item.sel { color: var(--gbar-rev-ink); }
/* ── Gantt home button: icon-only, vertically centered ─── */
 .gf-home { display: inline-flex; align-items: center; justify-content: center; padding: 4px 6px; vertical-align: middle; }
 .gf-home svg { display: block; }
/* ===== 7. SEGMENT PAINT (apply) — geometry after dark bulk ===== */
/* Hierarchy semantics: LANE (.hg-lane) > ENTITY (.hg-entity) > STAGE (.hg-stage).
   Same (bevel × shadow × accent-width) contract as the pre-refactor rules; the
   only deltas are (a) hardcoded 17/8% become the shared --hg-<level>-op vars in
   :root (lane 30, entity 20, stage 10), (b) alpha-hex --seg-wash* are gone —
   the same paint is expressed as color-mix(accent, level-op). Dark twins exist
   ONLY where the pre-refactor CSS had them: bevels are mode-dependent
   (white .14/.02 light vs .01/.09 dark), so they must not be unified away.
   Lane-side partners (.lane-side in #lanes) share their labels-row partner's
   level; they MUST NOT get a real border-left (shifts .cells 3px and desyncs
   the week grid) — the accent edge is inset box-shadow there. */
/* Breakdown lane header — sticky, wash layered ON the opaque page base so
   rows cannot bleed under the parked header. The pane carries the frost; a
   frosted row samples its neighbours as backdrop. */
.hg-lane[data-seg] {
  border-bottom-color: transparent;
  box-shadow: var(--hg-drop-now), var(--hg-shadow-cast);
  padding-left: 10px;
  background: var(--seg-edge),
              color-mix(in srgb, var(--seg-accent) var(--hg-lane-op), var(--hg-surface-base));
}
.seg-block.open > .hg-lane[data-seg] {
  border-bottom-color: transparent;
  box-shadow: inset 0 -2px 4px rgba(255,255,255,.14),
              inset 0 2px 5px rgba(15,23,42,.02),
              var(--hg-drop-now), var(--hg-shadow-cast);
  padding-left: 10px;
  background: var(--seg-edge),
              color-mix(in srgb, var(--seg-accent) var(--hg-lane-op), var(--hg-surface-base));
}
/* Cards cast and wash, the pane frosts. A frosted card re-blurs its flush
   neighbours whenever their paint changes, and the wash composites twice in
   that pass. */
.hg-entity-block[data-seg] .hg-entity {
  padding-left: 8px;
  background: var(--seg-edge),
              color-mix(in srgb, var(--seg-accent) var(--hg-entity-op), transparent);
  /* Entity drop: ALWAYS on (breakdown tree). The §7g prohibition is
     card-ONTO-card only; a downward cast from a same-height neighbour reads
     through the translucent wash as bg separation. */
  box-shadow: var(--hg-ent-drop, 0 0 0 transparent);
}
/* THE tree frost. One pane pass sits behind both trees, so the rows keep their
   translucent washes over a blurred page and no row samples a neighbour. A
   per-row frost cannot survive a hover cast: the cast enters the next row's
   backdrop input, the block re-rasters, and the wash composites twice in that
   pass — a warm band over the neighbours, live while the pointer is on the
   row. The drag copies and their hosts are excluded: they are fixed copies
   pinned to the pointer, and a filtered ancestor would become their containing
   block. */
.asset-tree:not(.bd-drag-ghost):not(.bd-card-ghost-host) {
  backdrop-filter: blur(var(--hg-frost-blur-soft));
  -webkit-backdrop-filter: blur(var(--hg-frost-blur-soft));
}
/* Row rail (Breakdown tree + Board): the caret column starts the SAME distance
   from each row's own left edge, at every level, so the leading gap reads as one
   line down the tree. The Gantt label pane keeps its own row geometry — its
   lane rows carry a 3px accent border the trees do not. */
.asset-tree .hg-lane[data-seg],
.asset-tree .hg-entity-block[data-seg] .hg-entity { padding-left: var(--hg-rail-inset); }
html .hg-stage[data-seg] { background: transparent; }
/* Gantt lanes panel: label rows carry border-left accents; lane-side partners
   share the same wash level. GROOVE BEVELS ARE OFF (founder 2026-10-02): at
   flush 30px seams the inset pair read as a shadow cast onto the neighbour
   below. Bands now paint wash + §7g drop only; hover softens that drop (§7c).
   The breakdown tree keeps its bevels — different surface, approved look. */
#labelsPanel .hg-lane[data-seg] {
                        border-left: 3px solid transparent;
                        background: var(--seg-edge),
                                    color-mix(in srgb, var(--seg-accent) var(--hg-lane-op), var(--hg-surface-base));
                        /* gradient must anchor at the true edge: default padding-box
                           origin starts the fade inside the 3px transparent border */
                        background-origin: border-box;
                        backdrop-filter: blur(var(--hg-frost-blur)); -webkit-backdrop-filter: blur(var(--hg-frost-blur));
                        box-shadow: none;
                        /* No `filter` in the transition list: these rows carry
                           backdrop-filter, and an animated filter rebuilds the
                           compositing layer (f606b10). */
                        transition: transform .25s cubic-bezier(.22,1,.36,1); }
#lanes .hg-lane.lane-side[data-seg] {
  border-left: none;
  padding-left: 0;
  box-shadow: none;
  background: color-mix(in srgb, var(--seg-accent) var(--hg-lane-op), transparent);
}
#labelsPanel .hg-entity[data-seg] {
  background: var(--seg-edge),
              color-mix(in srgb, var(--seg-accent) var(--hg-entity-op), var(--hg-surface-base));
  backdrop-filter: blur(var(--hg-frost-blur)); -webkit-backdrop-filter: blur(var(--hg-frost-blur));
  /* No `filter` transition: backdrop-filtered rows (f606b10). */
}
#lanes .hg-entity.lane-side[data-seg] {
  padding-left: 0;
  box-shadow: none;
  background: color-mix(in srgb, var(--seg-accent) var(--hg-entity-op), transparent);
}
#labelsPanel .hg-stage[data-seg] {
  background: var(--seg-edge),
              color-mix(in srgb, var(--seg-accent) var(--hg-stage-op), var(--hg-surface-base));
  backdrop-filter: blur(var(--hg-frost-blur-soft)); -webkit-backdrop-filter: blur(var(--hg-frost-blur-soft));
}

#lanes .hg-stage.lane-side[data-seg] {
  padding-left: 0;
  box-shadow: var(--hg-stage-drop, 0 0 0 transparent);
  background: color-mix(in srgb, var(--seg-accent) var(--hg-stage-op), transparent);
}

/* Dark twins: same paint, darker groove (bevels are mode-dependent); the
   §7g drop carriers ride along — dark mode casts the same drops. */
html.dark #lanes .hg-lane.lane-side[data-seg] {
  background: color-mix(in srgb, var(--seg-accent) var(--hg-lane-op), transparent);
  box-shadow: var(--hg-drop-now);
}
html.dark #labelsPanel .hg-lane[data-seg] {
  background: var(--seg-edge),
              color-mix(in srgb, var(--seg-accent) var(--hg-lane-op), var(--hg-surface-base));
  background-origin: border-box; /* shorthand above resets origin — re-assert */
  box-shadow: var(--hg-drop-now);
}
html.dark #labelsPanel .hg-entity[data-seg] {
  background: var(--seg-edge),
              color-mix(in srgb, var(--seg-accent) var(--hg-entity-op), var(--hg-surface-base));
  box-shadow: var(--hg-ent-drop, 0 0 0 transparent);
}
html.dark #lanes .hg-entity.lane-side[data-seg] {
  background: color-mix(in srgb, var(--seg-accent) var(--hg-entity-op), transparent);
  box-shadow: var(--hg-ent-drop, 0 0 0 transparent);
}
html.dark #labelsPanel .hg-stage[data-seg] {
  background: var(--seg-edge),
              color-mix(in srgb, var(--seg-accent) var(--hg-stage-op), var(--hg-surface-base));
  box-shadow: var(--hg-stage-drop, 0 0 0 transparent);
}
html.dark #lanes .hg-stage.lane-side[data-seg] {
  background: color-mix(in srgb, var(--seg-accent) var(--hg-stage-op), transparent);
  box-shadow: var(--hg-stage-drop, 0 0 0 transparent);
}
/* DEPRESSED (expanded) toggle rows — bevel REVERSED to a groove.
   Groove rules restate the FULL box-shadow list (a bare groove here would
   also erase the §7g conditional drop), so the stacking-order drop rides
   along: open entity rows keep casting onto their task rows below. */
#labelsPanel .hg-lane[data-seg][aria-expanded="true"],
#lanes .hg-lane.lane-side[data-seg][aria-expanded="true"] {
  box-shadow: var(--hg-drop-now);
}
#labelsPanel .hg-entity[data-seg][aria-expanded="true"] {
  box-shadow: var(--hg-ent-drop, 0 0 0 transparent);
}
#lanes .hg-entity.lane-side[data-seg][aria-expanded="true"] {
  box-shadow: var(--hg-ent-drop, 0 0 0 transparent);
}
html.dark #labelsPanel .hg-lane[data-seg][aria-expanded="true"],
html.dark #lanes .hg-lane.lane-side[data-seg][aria-expanded="true"] {
  box-shadow: var(--hg-drop-now);
}
html.dark #labelsPanel .hg-entity[data-seg][aria-expanded="true"] {
  box-shadow: var(--hg-ent-drop, 0 0 0 transparent);
}
html.dark #lanes .hg-entity.lane-side[data-seg][aria-expanded="true"] {
  box-shadow: var(--hg-ent-drop, 0 0 0 transparent);
}

html.dark .hg-lane[data-seg] {
  border-bottom-color: var(--hg-border-control);
  background: var(--seg-edge),
              color-mix(in srgb, var(--seg-accent) var(--hg-lane-op), var(--hg-surface-base));
  box-shadow: inset 0 2px 4px rgba(255,255,255,.01),
              inset 0 -2px 5px rgba(0,0,0,.09),
              var(--hg-drop-now), var(--hg-shadow-cast);
}
html.dark .seg-block.open > .hg-lane[data-seg] {
  border-bottom-color: var(--hg-border-control);
  background: var(--seg-edge),
              color-mix(in srgb, var(--seg-accent) var(--hg-lane-op), var(--hg-surface-base));
  box-shadow: inset 0 -2px 4px rgba(255,255,255,.01),
              inset 0 2px 5px rgba(0,0,0,.09),
              var(--hg-drop-now), var(--hg-shadow-cast);
}
/* Dark entity twin mirrors the light entity: it reads the same §7g carrier
   drop at rest (the ink flips with the mode). Hover glow is the shared
   breakdown rule below. */
html.dark .hg-entity-block[data-seg] .hg-entity { box-shadow: var(--hg-ent-drop, 0 0 0 transparent); }
/* ===== 7b. Breakdown corner exposure ===== */
/* Rounding is per-corner EXPOSURE (founder rule 2026-09-19): a corner is
   rounded only where the outer silhouette turns; a corner shared with a flush
   neighbour stays square and needs nothing. Concave fillet patches were
   prototyped at the two indent-step junctions and REJECTED — the founder
   prefers the clean square seam (decision 2026-09-19; geometry preserved in
   hg-ui-surface-techniques → concave-junction-fillets.md if ever wanted).
   Gantt label/track twins are out of scope. */

/* Segment header: TL/TR exposed; BL overhangs the indented entity list;
   BR shared with the flush-right entity run. Collapsed = all four exposed. */
.seg-block.open > .hg-lane[data-seg] { border-radius: 3px 3px 0 3px; }
.seg-block:not(.open) > .hg-lane[data-seg] { border-radius: 3px; }

/* Entity: flush under the lane (top corners shared → square; BR square —
   body/next entity continues flush right). Longhand rules so exposure states
   COMPOSE: open card → BL overhangs its own body; last card (`.seg-new-row`
   always trails in .seg-body, so :last-child never matches an entity — use
   :nth-last-child(2)) → bottom pair exposed; card following an OPEN card →
   TL exposed in the 16px notch (nothing flush above that corner). */
.seg-block.open > .seg-body > .hg-entity-block > .hg-entity { border-radius: 0; position: relative; }
.seg-block.open > .seg-body > .hg-entity-block.open > .hg-entity { border-bottom-left-radius: 3px; }
.seg-block.open > .seg-body > .hg-entity-block:nth-last-child(2) > .hg-entity { border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; }
.seg-block.open > .seg-body > .hg-entity-block.open + .hg-entity-block > .hg-entity { border-top-left-radius: 3px; }

/* Stage body: top shared with its own header; bottom corners shared with the
   next entity when one follows → square. Only the LAST open card's body ends
   the silhouette → its bottom pair rounds. */
.seg-block.open > .seg-body > .hg-entity-block.open > .hg-entity-body { border-radius: 0; position: relative; box-shadow: var(--hg-body-drop, 0 0 0 transparent); }
.seg-block.open > .seg-body > .hg-entity-block.open:nth-last-child(2) > .hg-entity-body { border-radius: 0 0 3px 3px; }

/* ===== 7c. Hover softens the drop — the ONLY hover effect ===== */
/* Hover never swaps the shadow out. A row that casts at rest keeps exactly
   that cast, with the soft radius tripled (--hg-drop-accent -> -h); offset,
   ink and any bevels stay as they are. Hover does NOT obey the §7g
   same-height law: the rest carriers decide which rows cast when the pointer
   is elsewhere, but a hovered or paired row always casts, so feedback never
   depends on position in the stack (a mid-run deliverable reacts like the
   last one, and like every card in the breakdown tree). That is why the -h
   twins are assigned to the level carriers here, not only swapped through
   --hg-drop-now: a row with no rest carrier has nothing to soften. The row
   itself may or may not carry data-seg (the breakdown entity card takes it
   from its .hg-entity-block), so both the own-attribute and the
   inherited-container form are matched. Instant flip: no box-shadow
   transition is declared — animated box-shadow on frosted rows is the
   banding-ghost window (f606b10). */
:is(.hg-lane, .hg-entity, .hg-stage)[data-seg]:hover,
:is(.hg-lane, .hg-entity, .hg-stage)[data-seg].hover-pair,
[data-seg] :is(.hg-lane, .hg-entity, .hg-stage):hover,
[data-seg] :is(.hg-lane, .hg-entity, .hg-stage).hover-pair {
  --hg-drop-now: var(--hg-drop-accent-h);
  /* The two level carriers are !important on purpose: the rest carriers are
     positional, and some carry an ID (1,3,0) or five classes (0,5,0). A state
     that must beat every one of them — and must also paint on rows that cast
     nothing at rest — cannot rely on source order. */
  --hg-ent-drop: var(--hg-drop-ent-h) !important;
  --hg-stage-drop: var(--hg-drop-stage-h) !important;
}

/* ===== 7d. Gantt label corner exposure (mirror of §7b) ===== */
/* The same per-corner exposure rule applied to the gantt label rows (founder
   2026-09-19). Ladder: lane x=0 (3px transparent accent border), entity 8px,
   stage 16px; every row flush right; blocks stack with no margins. Fillet
   patches are NOT used here (rejected on breakdown): the concave notch at a
   first-entity/stage top-left stays a clean square seam. The collapsed
   segment reads as a standalone card — all four corners round, mirroring the
   breakdown's approved collapsed pill. */
#labelsPanel .labels-block > .hg-lane[data-seg] { border-radius: 3px; }
#labelsPanel .labels-block > .hg-lane[data-seg][aria-expanded="true"] { border-radius: 3px 3px 0 3px; }
/* Group rows: TL under the lane is the notch (square); right edge flush with
   lane above and siblings (square). BL rounds while its own stage rows hang
   exposed beneath (stage indent 16 > entity 8); an entity that FOLLOWS stage
   rows sits exposed in the 8–16px strip beside them → its TL rounds. */
#labelsPanel .labels-block > .hg-entity { border-radius: 0; }
#labelsPanel .labels-block > .hg-entity[aria-expanded="true"] { border-bottom-left-radius: 3px; }
#labelsPanel .labels-block > .hg-stage + .hg-entity { border-top-left-radius: 3px; }
/* Stage rows are interior run — always square. Only the very last row of the
   whole list ends the silhouette → bottom pair rounds. */
#labelsPanel .labels-block > .hg-stage { border-radius: 0; }
/* EVERY block ends exposed: the next segment's lane carries margin-top:10px
   (inter-lane padding), so the last row of EACH block — entity or task — has
   bg below and rounds its bottom pair. Longhands so this composes with the
   notch/overhang rules above (a last-row entity can also be a notch TL). */
#labelsPanel .labels-block > :last-child:not(.hg-lane) {
  border-bottom-left-radius: 3px;
  border-bottom-right-radius: 3px;
}

/* ===== 7g. Card stack shadows — stacking-order model (founder 2026-09-19) ===== */
/* Seg casts on entities + bg. Entity casts on its own tasks + bg — never on
   the next entity (same height). Task casts on bg only — never on a same-run
   task or the next entity (same height). The drop ink is written once and
   thinned for the two lower levels (--hg-drop-ink -> -ent 70% -> -stage 45%),
   so a stack reads as one cast from the lane rather than three equal bands;
   WHERE each level may wear it is decided by position:
   entities wear it always (breakdown tree — the cast falls through the next
   card's translucent wash to the bg; the prohibition is only card-ONTO-card,
   and at same height a downward cast never paints on the neighbour's face);
   task
   bodies wear it only when they END the stack (no next entity — but if the
   LAST entity is open, its body is the stack end and the next-entity case
   never arises); task rows (gantt) wear it only at a run's end. Same-level
   adjacency never casts. Dark mode: SAME contract — the ink flips with the
   mode via --hg-shadow-ink, and the dark rest/hover twins read these same
   carriers (the light-only drop contract is rejected). */
/* WHERE each level may wear the drop (custom-prop carriers; the consumers
   above/below read --hg-ent-drop / --hg-body-drop / --hg-stage-drop):
   - Entity: casts always in the breakdown tree (closed mid-run card's drop
     reads through the next card's wash as bg separation, not card-on-card).
   - Task surface (breakdown body, gantt stage rows): casts ONLY when bg is
     below — the stack's end (last-open body / block-last row). A task
     followed by a same-level task or by the next entity casts nothing.
   - Seg lanes cast unconditionally (they are the top of the stack). */
.seg-block.open > .seg-body > .hg-entity-block > .hg-entity { --hg-ent-drop: var(--hg-drop-ent); }
.seg-block.open > .seg-body > .hg-entity-block.open:nth-last-child(2) > .hg-entity-body { --hg-body-drop: var(--hg-drop-stage); }
#labelsPanel .labels-block > .hg-entity[data-seg][aria-expanded="true"],
#labelsPanel .labels-block > .hg-entity[data-seg]:last-child { --hg-ent-drop: var(--hg-drop-ent); }
#labelsPanel .labels-block > .hg-stage:last-child { --hg-stage-drop: var(--hg-drop-stage); }
#lanes .hg-entity.lane-side[data-seg][aria-expanded="true"],
#lanes .hg-entity.lane-side[data-seg]:has(+ .hg-lane.lane-side[data-seg]),
#lanes .hg-entity.lane-side[data-seg]:last-child { --hg-ent-drop: var(--hg-drop-ent); }
#lanes .hg-stage.lane-side[data-seg]:last-child { --hg-stage-drop: var(--hg-drop-stage); }
#lanes .hg-stage.lane-side[data-seg]:has(+ .hg-lane.lane-side[data-seg]) { --hg-stage-drop: var(--hg-drop-stage); }
/* Gantt label rows: light rest gains the accent drop the breakdown
   lane/entity cast. Hover keeps that exact cast and triples its soft radius
   (§7c swaps --hg-drop-now for -h), so no bevel or halo is introduced and
   nothing reads as a cast onto a flush neighbour. The swap is instant by
   construction — no box-shadow transition is declared, and animated
   box-shadow on frosted rows is the banding-ghost window (f606b10).
   .hover-pair rides the same §7c rule: the synced track side softens too. */
#labelsPanel .labels-block > .hg-lane[data-seg] {
  box-shadow: var(--hg-drop-now);
}
#labelsPanel .labels-block > .hg-lane[data-seg][aria-expanded="true"] {
  box-shadow: var(--hg-drop-now);
}
#labelsPanel .labels-block > .hg-entity[data-seg] {
  box-shadow: var(--hg-ent-drop, 0 0 0 transparent);
}
#labelsPanel .labels-block > .hg-stage[data-seg] {
  box-shadow: var(--hg-stage-drop, 0 0 0 transparent);
}

/* ===== 7f. Track-side colored cards — same rules (founder 2026-09-19) ===== */
/* The #lanes colored bands mirror their label-side partners. Corners: the
   LEFT end continues into the labels column — square, always; only the far
   END of a track rounds. Washes differ per level (lane 30 / entity 20 /
   stage 10), so every level boundary is a card edge; same-wash rows that
   stack (multi-task stage runs) share their right-edge corners → square,
   only the run's first TR / last BR round (per-corner exposure, transposed
   to horizontal). Shadows: light rest gains the breakdown accent drop on
   lane + entity bands; hover keeps that cast and triples its soft radius
   (§7c), so there is no halo, no bevel and no transition — frosted rows must
   never re-bake mid-toggle (f606b10). Dark rest/hover contracts mirror light:
   same carriers, same swap. Hover adds the level carriers itself (§7c), so
   every band reacts, not only the ones that already cast at rest. */
#lanes .hg-lane.lane-side[data-seg] { border-radius: 0 3px 3px 0; }
#lanes .hg-entity.lane-side[data-seg] { border-radius: 0 3px 3px 0; }
#lanes .hg-stage.lane-side[data-seg] { border-radius: 0; }
#lanes .hg-stage.lane-side[data-seg]:not(:has(+ .hg-stage.lane-side[data-seg])) { border-bottom-right-radius: 3px; }

/* Rows must not form stacking contexts: the shared grid paints after their
   washes at z 0, while their bars remain above it at z 1. */
#lanes .hg-stage.lane-side[data-seg],
#lanes .hg-entity.lane-side[data-seg],
#lanes .hg-lane.lane-side[data-seg] { position: relative; z-index: auto; }

#lanes .hg-lane.lane-side[data-seg] {
  box-shadow: var(--hg-drop-now);
}
#lanes .hg-lane.lane-side[data-seg][aria-expanded="true"] {
  box-shadow: var(--hg-drop-now);
}
#lanes .hg-entity.lane-side[data-seg] {
  box-shadow: var(--hg-ent-drop, 0 0 0 transparent);
}
#lanes .hg-entity.lane-side[data-seg][aria-expanded="true"] {
  box-shadow: var(--hg-ent-drop, 0 0 0 transparent);
}
/* ===== 7h. Roll-animation frost suppression — RETIRED ===== */
/* The .unrolling experiment (suspend backdrop-filter on animating rows) did
   not cure the gantt roll jank; the founder pulled the whole gantt roll
   feature (2026-09-19). Kept as a head: if height-animating frosted rows is
   ever revisited, the frost cost class is the thing to beat. */
/* .unrolling { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; } */

/* ===== 7i. Gantt row reveal — the tail sweeps, contents never move ===== */
/* The height roll was pulled for jank; the per-row clip wipe was wrong (it
   wiped each revealed row and snapped the next group). Founder model: ONE
   contiguous tail — everything from the NEXT row down — translates as a
   block and does the wipe; the revealed rows never move. OPEN: the tail
   starts pulled up over the expanded contents (translateY(-H)) and slides to
   0, uncovering them; CLOSE is the reverse, rebuild after. Transform only —
   no height, no layout, both panes identical. .groll-move lifts the tail
   above the static rows while sweeping so covered rows don't poke through. */
.groll-move { will-change: transform; z-index: 6 !important; }
/* Boost z only where the row has no position of its own: track rows already
   carry position:relative (§7f ladder) and label lanes are sticky when parked
   — overriding `position` would break the sticky parking mid-sweep. */
#labelsPanel .labels-block > .hg-entity.groll-move,
#labelsPanel .labels-block > .hg-stage.groll-move { position: relative; }
.groll-move .gbar, .groll-move .gedge { pointer-events: none; }
/* Parent-bar morph: the clicked bar crossfades between its two DESIGNED
   states — solid rollup (.gbar.grp) and ghost container (.parent-open) — by
   transitioning the properties that actually differ (bg/shadow/ink). JS
   toggles .parent-open inside .groll-morph's transition window; the class is
   removed after, so the stylesheet's resting law is untouched. */
.groll-morph { transition: background-color .22s cubic-bezier(.22,1,.36,1), box-shadow .22s cubic-bezier(.22,1,.36,1), color .22s cubic-bezier(.22,1,.36,1); }

.flag { margin-bottom: 10px; }
/* ===== 8. CREW + RECRUIT ===== */
.cs-actions { display: flex; gap: 10px; margin-top: 12px; }
.cs-login-lab { display:inline-flex; align-items:center; gap:6px; font-size: var(--hg-type-11); color:var(--hg-text-secondary); cursor:pointer; user-select:none; }
.cs-login-lab input { margin:0; }
.cs-login-txt { min-width:22px; }

.tier-badge {
  font-size: var(--hg-type-micro); padding: 1px 8px; border-radius: 3px; white-space: nowrap;
  font-weight: 600; letter-spacing: .03em;
}
.tier-badge.tier-1 { background: #e2ecf7; color: #2a5a8a; }
.tier-badge.tier-2 { background: var(--st-ip-bg); color: var(--st-ip-ink); }
.tier-badge.tier-3 { background: var(--st-rev-bg); color: var(--st-rev-ink); }
.cs-empty { color: var(--hg-text-dim); font-size: var(--hg-type-11); }

.cs-del {
  border: none; background: none; cursor: pointer;
  font-size: var(--hg-type-medium); padding: 2px 6px;
}
.cs-del:hover { color: var(--hg-danger-ink); }

/* recruitment picker */
.recruit-card {
  border: 1px solid var(--hg-border-row); border-radius: 4px; padding: 10px 12px; margin-bottom: 8px;
  display: flex; flex-direction: column; gap: 4px;
}
.recruit-card .rc-head { display: flex; align-items: center; gap: 8px; font-size: var(--hg-type-medium); }
.recruit-card .rc-skills { font-size: var(--hg-type-11); color: var(--hg-text-secondary); }
.recruit-card .rc-meta { font-size: var(--hg-type-11); color: var(--hg-text-dim); display: flex; gap: 6px; align-items: center; }
.recruit-card .rc-pick { align-self: flex-start; margin-top: 4px; }
.recruit-rating {
  font-size: var(--hg-type-micro); padding: 1px 6px; border-radius: 3px;
  background: var(--st-rev-bg); color: var(--st-rev-ink); font-weight: 600;
}
.recruit-nda {
  font-size: var(--hg-type-micro); padding: 1px 6px; border-radius: 3px;
  background: var(--st-ip-bg); color: var(--st-ip-ink); font-weight: 600;
}
.recruit-status {
  font-size: var(--hg-type-micro); padding: 1px 6px; border-radius: 3px;
  background: var(--st-wtg-bg); color: var(--st-wtg-ink); font-weight: 600;
}

/* recruitment picker — same glass recipe as the Internal Budget panel:
   no overlay dim, panel = app frost tokens, table crisp on top. */
#recruitModal.modal-bg { background: transparent; }
html.dark #recruitModal.modal-bg { background: transparent; }
#recruitModal .modal {
  --hg-frost-blur: 32px;
  --hg-frost-blur-soft: 16px;
  background: var(--hg-frost-bg);
  backdrop-filter: blur(var(--hg-frost-blur)); -webkit-backdrop-filter: blur(var(--hg-frost-blur));
  box-shadow: var(--hg-shadow-modal);
}
html.dark #recruitModal .modal {
  background: var(--hg-frost-bg);
  box-shadow: var(--hg-shadow-modal);
}
#recruitList table.track {
  display: table; width: max-content; min-width: 100%; table-layout: auto;
  background: transparent;
}
#recruitList table.track thead { display: table-header-group; }
#recruitList table.track th {
  text-align: left; font-size: var(--hg-type-10); text-transform: uppercase; letter-spacing: .07em;
  color: var(--hg-text-label); padding: 7px 10px; border-bottom: 1px solid var(--hg-border-chrome);
  background: var(--hg-frost-head);
  position: static;
}
#recruitList table.track tbody {
  display: table-row-group;
  background: transparent;
}
#recruitList table.track td { padding: 5px 10px; border-bottom: 1px solid var(--hg-border-cell); }
#recruitList table.track tbody tr:hover td {
  background: var(--hg-frost-hover);
}
/* row selection — accent-driven so the appearance panel controls it */
.rc-pick-row { cursor: default; }
.rc-pick-sel td {
  background: color-mix(in srgb, var(--hg-accent) 12%, transparent) !important;
}
/* dark mode — identical to standard table dark overrides */
html.dark #recruitList table.track th { border-bottom-color: var(--hg-border-chrome); color: var(--hg-text-muted); }
html.dark #recruitList table.track td { border-bottom-color: var(--hg-border-cell); }
html.dark .rc-pick-sel td {
  background: color-mix(in srgb, var(--hg-accent) 15%, transparent) !important;
}

/* dark mode for crew additions */
html.dark .tier-badge.tier-1 { background: #1e2a38; color: #8fb4dc; }
html.dark .tier-badge.tier-2 { background: var(--st-ip-bg); color: var(--st-ip-ink); }
html.dark .tier-badge.tier-3 { background: var(--st-rev-bg); color: var(--st-rev-ink); }

html.dark .cs-del { color: var(--hg-text-muted); }
html.dark .cs-del:hover { color: var(--st-reopen-ink); }
html.dark .recruit-card { background: var(--hg-surface-elevated); border-color: var(--hg-border-chrome); }
html.dark .recruit-card .rc-skills { color: var(--hg-text-muted); }
html.dark .recruit-card .rc-meta { color: var(--hg-text-muted); }
html.dark .recruit-rating { background: var(--st-rev-bg); color: var(--st-rev-ink); }
html.dark .recruit-nda { background: var(--st-ip-bg); color: var(--st-ip-ink); }
html.dark .recruit-status { background: var(--hg-surface-hover); color: #8b8c92; }
/* crew/IT inline-edit dark states now owned in §4e (crew/IT dark block) */
#crewTable .cs-invite { font-size: var(--hg-type-11); padding: 2px 8px; white-space: nowrap; }
#crewTable .cs-invite:disabled { opacity: 0.45; cursor: not-allowed; }

/* ===== APPEARANCE PANEL + SETTINGS COG PANEL ===== */
/*  Follows the same modal convention as the crew/recruitment modals:
    .modal-bg overlay + .modal frost panel are inherited from the global
    rules. Only appearance-specific controls (sections, sliders, color
    pickers, preset swatches, textarea) are styled here. All colors use
    the existing token system so light/dark both work automatically. */
/* The main Settings panel shares the modal material and title style.
   Keep its fixed editor workspace and section rail. */
#settingsModal {
  width: min(860px, calc(100vw - 48px));
  height: min(580px, calc(100vh - 96px));
  display: flex; flex-direction: column;
}
/* Close (✕) button — top-right of the panel, distinct from Save */
/* The appearance panel's close button wears the shared icon button; this rule
   states position only. */
.ap-close { position: absolute; top: 10px; right: 12px; }
.ap-section { margin-bottom: 16px; }
/* Preset and Mode are the two global choices, so they share one row: the
   palette takes the width, the mode chip sits at its right. Box shape only. */
.ap-top-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  column-gap: 16px;
  align-items: start;
  padding-bottom: 16px;
}
.ap-top-row > .ap-section { margin-bottom: 0; }
/* The Mode chip is the shared action control placed in the pane: the moon glyph
   sits beside its label and the chip reads at the swatch height beside it. Box
   shape only; paint is .block-btn's own. */
.ap-mode-block .block-btn { display: inline-flex; align-items: center; gap: 5px; }
.ap-mode-block .block-btn .ico { font-size: var(--hg-type-medium); line-height: 1; }

/* The pane is one aligned sheet: the three colour peers share a row, the Panel
   wash follows on its own full-width line because its two strengths need the
   room, a two-up row holds a pair of slider or option blocks, and the way back
   closes the sheet. Every band is closed by a rule, and the rule sits on the
   band rather than on each block inside it, so it spans the pane unbroken
   across the column gaps. Columns collapse with the pane. Box shape only:
   paint comes from the shared controls. */
.ap-edit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr));
  gap: 18px 20px;
  padding: 16px 0;
  border-top: 1px solid var(--hg-border-row);
}
.ap-edit-grid > .ap-section { min-width: 0; margin-bottom: 0; }
/* A pair of blocks side by side: each needs half a readable pane, so a narrow
   pane stacks them instead of squeezing both. */
.ap-edit-grid.ap-rows { grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
/* Text size and text contrast each measure one thing, so they take a line of
   their own with a rule between them rather than sharing one. */
.ap-edit-grid.ap-text-rows { grid-template-columns: minmax(0, 1fr); gap: 0; }
.ap-edit-grid.ap-text-rows > .ap-section + .ap-section {
  margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--hg-border-row);
}
/* A rule inside a pair matrix spans every column of it, so the light and dark
   halves stay inside one table. */
.ap-pairs-rule { grid-column: 1 / -1; border-top: 1px solid var(--hg-border-row); margin: 8px 0 2px; }
/* The Panel block is its own band, under the rules that the peer row and the
   option rows carry. */
.ap-panel { padding: 16px 0; margin-bottom: 0; border-top: 1px solid var(--hg-border-row); }
/* The way back closes the pane on its own line, behind the last rule. */
.ap-foot { align-items: center; margin: 0; padding-top: 14px; border-top: 1px solid var(--hg-border-row); }
.ap-label {
  display: block; font-size: var(--hg-type-11); font-weight: 600;
  text-transform: uppercase; letter-spacing: .05em;
  color: var(--hg-text-ink); margin-bottom: 8px;
}
html.dark .ap-label { color: var(--hg-text-bright); }
.ap-hint {
  display: block; font-size: var(--hg-type-10); color: var(--hg-text-muted);
  margin-top: 4px; line-height: 1.4;
}

/* Presets read as a table: four chips to a row at every pane width, and every
   chip reserves the swatch column, so the labels start on one line whether or
   not the chip carries a preview. */
.ap-preset-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px 8px;
}
.ap-preset-btn {
  display: grid; grid-template-columns: 32px minmax(0, 1fr); align-items: center;
  column-gap: 8px;
  border: none; border-radius: 6px;
  padding: 5px 8px; cursor: pointer; background: transparent;
  font-size: var(--hg-type-11); font-weight: 500; color: var(--hg-text-ink);
  transition: color .15s;
  text-align: left;
}
.ap-preset-btn:hover { color: var(--hg-text-ink); }
html.dark .ap-preset-btn { color: var(--hg-text-bright); }
html.dark .ap-preset-btn:hover { color: var(--hg-text-bright); }
.ap-preset-btn.on {
  color: var(--hg-accent); font-weight: 600;
}
html.dark .ap-preset-btn.on { color: var(--hg-accent); }
/* A swatch shows a colour, so the pane's colour editors and the preset previews
   wear one box: the colour fills the whole box, with no edge and no inner
   margin, and both sets take the title-bar pair so they read raised off the
   pane the way the header controls do. */
.ap-color-pick, .ap-preset-swatch {
  box-sizing: border-box;
  width: 32px; height: 32px;
  border: 0;
  border-radius: 4px;
  box-shadow: var(--hg-shadow-lift-ctl);
}
.ap-preset-swatch {
  display: inline-block; flex: 0 0 auto; justify-self: start;
}
/* The Default chip previews no palette. It keeps the swatch slot without
   drawing a box, so its label starts where every other label starts. */
.ap-preset-swatch.blank { box-shadow: none; background: transparent; }

/* Accent colour pickers */
.ap-accent-row { display: flex; align-items: center; gap: 8px; }
/* The native colour input brings its own padding and its own swatch edge; both
   are dropped, so the chosen colour fills the same box as a preset preview. */
.ap-color-pick {
  -webkit-appearance: none; appearance: none;
  cursor: pointer; padding: 0; background: transparent;
}
.ap-color-pick::-webkit-color-swatch-wrapper { padding: 0; }
.ap-color-pick::-webkit-color-swatch { border: 0; border-radius: 4px; }
.ap-color-pick::-moz-color-swatch { border: 0; border-radius: 4px; }
.ap-color-lab {
  font-size: var(--hg-type-11); color: var(--hg-text-secondary);
}
html.dark .ap-color-lab { color: var(--hg-text-muted); }
/* Sliders — styled range inputs using accent token. The track and its grab
   handle wear the same two-layer pair as the swatches above them, so the row
   reads raised off the pane rather than painted on it. */
.ap-slider {
  width: 100%; height: 4px; -webkit-appearance: none; appearance: none;
  background: var(--hg-text-secondary); border-radius: 2px; outline: none;
  margin: 6px 0;
  box-shadow: var(--hg-shadow-lift-ctl);
}
html.dark .ap-slider { background: var(--hg-text-dim); }
.ap-slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 16px; height: 16px;
  border-radius: 50%; background: var(--hg-accent); cursor: pointer;
  border: 2px solid var(--hg-surface-base);
  box-shadow: var(--hg-shadow-lift-ctl);
}
.ap-slider::-moz-range-thumb {
  width: 16px; height: 16px; border-radius: 50%; background: var(--hg-accent);
  cursor: pointer; border: 2px solid var(--hg-surface-base);
  box-shadow: var(--hg-shadow-lift-ctl);
}
html.dark .ap-slider::-webkit-slider-thumb { border-color: var(--hg-surface-base); }
html.dark .ap-slider::-moz-range-thumb { border-color: var(--hg-surface-base); }
.ap-slider-val {
  font-size: var(--hg-type-10); font-weight: 600; color: var(--hg-text-ink);
}
html.dark .ap-slider-val { color: var(--hg-text-bright); }

/* Colour-pair tables keep Light and Dark aligned and show a colour as a
   swatch, never as hex. One template serves every pair table: the label column
   is a fixed width, so the swatches stand on the same two columns in every
   block. A swatch's way back is its own right-click menu, so no row carries a
   button beside it. */
.ap-pairs {
  display: grid;
  grid-template-columns: 44px 32px 32px;
  align-items: center;
  column-gap: 8px;
  row-gap: 6px;
}
.ap-col-head {
  text-align: center;
  font-size: var(--hg-type-10); font-weight: 600;
  color: var(--hg-text-label);
}
.ap-pairs .ap-color-pick { justify-self: center; }
.ap-row-lab {
  font-size: var(--hg-type-11); color: var(--hg-text-secondary);
}
html.dark .ap-row-lab { color: var(--hg-text-muted); }

/* The Panel block lays its tint pair over its two strengths, and the strengths
   sit in a Light/Dark matrix that mirrors the swatch grid above them. The
   section keeps the same column width as Accent, Text and Base, so the four read
   as peers. Box shape only: paint comes from the shared controls. */
/* The panel block is one grid: the tint pair and the two strengths share the
   Light/Dark columns, so the swatches and the sliders line up under one pair of
   heads and the block stays as short as the swatch grid beside it. Box shape
   only: paint comes from the shared controls. */
.ap-panel-body .ap-pairs {
  grid-template-columns: minmax(72px, max-content) minmax(0, 1fr) minmax(0, 1fr);
  max-width: 640px;
}
/* Each mode's swatch and slider start on the column's left edge, so a strength
   reads as one column with its head above it rather than a swatch floating in
   the middle of a long track. */
.ap-panel-body .ap-pairs .ap-color-pick { justify-self: start; }
.ap-panel-body .ap-col-head { text-align: left; }
.ap-op { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 6px; align-items: center; }
.ap-op .ap-slider { width: 100%; }

/* Background image row */
.ap-bg-row { display: flex; align-items: center; gap: 8px; }
.ap-bg-url { font-size: var(--hg-type-11); }

/* Settings cog shell — rail + content panes. The rail (.hg-rail) is the
   shared vertical section list, defined in §10 PRIMITIVES; these rules
   are the settings modal's own structure. */
.stg-shell { display: flex; flex: 1; min-height: 0; }
.stg-body { flex: 1; min-width: 0; overflow-y: auto; padding: 2px 4px 2px 0; }
.stg-section { display: none; }
.stg-section.on { display: block; }
/* A section or rail entry above the viewer's tier is removed, not disabled.
   The rail item's own display rule beats the UA [hidden] rule, so both carry
   an explicit one. */
.stg-section[hidden] { display: none; }
.hg-rail-item[hidden] { display: none; }
/* A settings pane holds several blocks; a rule between them states where one
   ends and the next begins. The last block carries none, so a pane never ends
   on a bare rule, and a block hidden above a lower tier leaves no stray line. */
.stg-section > .ap-section {
  padding-bottom: 18px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--hg-border-row);
}
.stg-section > .ap-section:last-child {
  padding-bottom: 0;
  margin-bottom: 0;
  border-bottom: 0;
}
/* A block's own sub-heading, one type step below .ap-label: it names a part of
   the block, not a new section. */
.ap-sub-label {
  display: block;
  font-size: var(--hg-type-10);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--hg-text-muted);
  margin: 14px 0 6px;
}
/* The one-time app-creation note in the Notifications block: operator text,
   shown only to a tier 1 reader while the platform has no Slack app. */
.ntf-setup {
  margin-top: 8px;
  font-size: var(--hg-type-10);
  color: var(--hg-text-muted);
  line-height: 1.45;
}
.ntf-setup[hidden] { display: none; }
.ntf-setup-steps { margin: 6px 0 0 16px; padding: 0; display: grid; gap: 4px; }
.ntf-setup code { font-size: inherit; }
/* Notifications block: layout only. Paint comes from .hg-inp, .block-btn, .stg-* */
.ntf-row { margin-top: 8px; }
.ntf-inline-label { margin-bottom: 0; }
.ntf-tz { width: 220px; }
.ntf-kind { margin-top: 10px; }
.ntf-lead-head { margin-top: 10px; }
.ntf-lead-list { margin-top: 4px; }
.ntf-lead-row { display: flex; align-items: center; gap: 8px; padding: 2px 0; }
.ntf-lead-empty { padding: 0; }
.ntf-add-row { display: flex; align-items: center; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.ntf-num { width: 64px; }
/* The unit control is the shared .hg-select picker, so its open list is the
   app's own menu. */
.ntf-unit { width: auto; }
.ntf-actions { margin-top: 12px; }
/* The install actions sit beside the connection line. Layout only: the two
   buttons wear the shared .block-btn action, and the wrapper's own [hidden]
   rule is what toggles which of them shows. */
.ntf-conn-actions { display: inline-flex; align-items: center; gap: 6px; margin-left: 8px; }
.ntf-conn-actions[hidden] { display: none; }
/* Connect and Disconnect swap places as the installation appears and goes; the
   [hidden] attribute must win over any later display rule on the shared buttons. */
.ntf-conn-actions .block-btn[hidden] { display: none; }
/* Hydra Reviewer pairings: layout only. Paint comes from .stg-*, .block-btn. */
.rvw-pair { padding: 6px 0; }
.rvw-hook { overflow-wrap: anywhere; }
.rvw-input { flex: 1 1 auto; min-width: 0; max-width: 320px; }
/* Connections reuse Settings text and shared controls; only layout lives here. */
.ac-form { display: grid; gap: 10px; margin: 16px 0; }
.ac-form .ap-section { margin-bottom: 0; }
.ac-field { width: 100%; min-width: 0; padding: 5px 8px; }
.ac-list { margin-top: 12px; overflow-wrap: anywhere; max-height: 260px; }
/* The list heading and its Refresh share one centred row above the box. */
.ac-list-head { margin-bottom: 8px; }
.ac-list-head .ap-label { margin-bottom: 0; }
/* The opener sits clear of the hint above it. */
.ac-api-actions { display: flex; gap: 8px; margin-top: 8px; }
/* The AI assistant guide: layout only. Paint comes from .block-btn, .hg-ctl,
   .ap-* and .stg-*, so the block never grows a second control vocabulary. */
.ac-guide-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.ac-guide-actions .block-btn[hidden] { display: none; }
.ac-guide { display: grid; gap: 12px; margin-top: 12px; }
.ac-guide[hidden] { display: none; }
.ac-address-block { display: grid; gap: 6px; }
.ac-address-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.ac-address-row .ac-field { flex: 1 1 260px; width: auto; }
.ac-copy-status { margin: 0; }
.ac-copy-status:empty { display: none; }
/* An available service needs no line of its own: the guide below is the
   confirmation, so the status paragraph closes up rather than holding space. */
.ac-guide-status:empty { display: none; }
.ac-guide-steps { margin: 0 0 0 18px; padding: 0; display: grid; gap: 6px; line-height: 1.5; }
.ac-guide-steps > li > .ac-address-block,
.ac-guide-steps > li > .ac-guide-shots { margin-top: 6px; }
.ac-guide-thumbs { display: flex; flex-wrap: wrap; gap: 8px; }
.ac-guide-thumb { display: block; height: 64px; width: auto; max-width: 100%; cursor: zoom-in; }
.ac-guide-thumb[aria-expanded="true"] { cursor: zoom-out; }
.ac-guide-shot-pane { display: grid; gap: 8px; margin-top: 8px; }
.ac-guide-shot-pane[hidden] { display: none; }
.ac-guide-shot { display: block; max-width: 100%; height: auto; }
/* The step's provider link starts its own line at the width of its label. */
.ac-guide-steps > li > .block-btn { display: flex; width: fit-content; margin-top: 6px; line-height: normal; }
.stg-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.stg-invite-input { flex: 1 1 auto; min-width: 0; max-width: 320px; }
.stg-kv { display: flex; align-items: baseline; gap: 10px; padding: 4px 0; font-size: var(--hg-type-11h); }
.stg-kv > span:first-child { flex: 0 0 140px; color: var(--hg-text-secondary); }
.stg-val { color: var(--hg-text-ink); }
.stg-empty { font-size: var(--hg-type-11); color: var(--hg-text-muted); padding: 6px 0; line-height: 1.5; }
.stg-badge { flex: 0 0 auto; font-size: var(--hg-type-tiny); padding: 1px 5px; border: 1px solid var(--hg-border-control); border-radius: 3px; color: var(--hg-text-muted); text-transform: uppercase; letter-spacing: .03em; }

/* Activity list: one row per ledger entry. The columns live on the list, not
   on each row, so a name or project takes only the width it needs and the
   action record gets the rest. Rows are display:contents boxes; the cell
   padding keeps each row's divider unbroken. */
.act-list { display: grid; grid-template-columns: max-content max-content minmax(0, 2fr) max-content; margin-top: 8px; }
/* The search box reads the whole ledger, so it sits above the list as the
   block's one control. It wears the app's search presentation — the word
   "search" before a narrow field, as every filter bar does — on the shared
   settings field. The "Show more" row is a flex row, so its [hidden]
   companion is required; the attribute alone loses to that display. */
.act-search { margin-top: 8px; }
.act-search .hg-inp { width: 140px; }
.act-more { margin-top: 8px; }
.act-more[hidden] { display: none; }
.act-row { display: contents; }
.act-row > * {
  min-width: 0; padding: 5px 8px;
  border-top: 1px solid var(--hg-border-row);
  font-size: var(--hg-type-11h);
}
.act-row:first-child > * { border-top: 0; }
.act-row > :first-child { padding-left: 0; }
.act-row > :last-child { padding-right: 0; }
.act-when, .act-who, .act-where {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: var(--hg-type-11); color: var(--hg-text-muted);
}
.act-who { max-width: 140px; }
.act-where { max-width: 180px; }
.act-what { display: flex; gap: 6px; align-items: baseline; text-align: start; }
/* The action keeps its words on one line; the target wraps rather than
   ellipsising, because the target name is the payload of the row. */
.act-what > .stg-val { flex: 0 0 auto; white-space: nowrap; }
.act-target {
  min-width: 0; overflow-wrap: anywhere; line-height: 1.35;
  font-size: var(--hg-type-11); color: var(--hg-text-muted);
}

/* ===== CLIENT PDF EXPORT ===== */
/* Export row above the Client panels — one action, right-aligned. */
/* Export row above the Client panels — one action, right-aligned.
   14px above and below matches the panels' own rhythm: consecutive
   wire-panels sit 14px apart (collapsed max of 8px margin-bottom and
   14px margin-top), so the row reads as a member of the stack. */
.cli-export-row { display: flex; align-items: center; justify-content: flex-end; margin: 14px 0; }
/* Export modal — reuses .modal-bg/.modal/.mfoot chrome; only structure here. */
.ex-body { display: flex; flex-direction: column; gap: 8px; }
.ex-brand-field { display: flex; flex-direction: column; gap: 4px; }
.ex-brand-field .hg-ctl { width: 100%; min-width: 0; padding: 5px 8px; }
.ex-brand-actions { display: flex; justify-content: flex-end; }
#cliExportModal { max-height: calc(100vh - 48px); overflow-y: auto; }
.ex-cur { display: flex; align-items: center; gap: 8px; }
.ex-lab { font-size: var(--hg-type-11h); color: var(--hg-text-secondary); }
html.dark .ex-lab { color: var(--hg-text-muted); }
.ex-hint { font-size: var(--hg-type-tiny); color: var(--hg-text-muted); }
.ex-file { font-size: var(--hg-type-11); color: var(--hg-text-muted); font-family: var(--hg-font-mono, monospace); }
.ex-lab2 { font-size: var(--hg-type-11h); color: var(--hg-text-secondary); margin-top: 4px; }
html.dark .ex-lab2 { color: var(--hg-text-muted); }
.ex-list { display: flex; flex-direction: column; max-height: 260px; overflow-y: auto; }
.ex-item { display: flex; align-items: center; gap: 8px; padding: 4px 2px; font-size: var(--hg-type-11); color: var(--hg-text-ink); cursor: pointer; border-bottom: 1px solid var(--hg-hairline); }
.ex-item:last-child { border-bottom: none; }
.ex-item input[type="checkbox"] { accent-color: var(--hg-accent); }
.ex-item.ex-sub { padding-left: 22px; color: var(--hg-text-secondary); }
html.dark .ex-item { color: var(--hg-text-bright); }
/* Branding logo slot — shared upload control used by the export dialog. */
.hg-logo-slot { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 6px 10px; border: 1px dashed var(--hg-border-control); border-radius: 6px; cursor: pointer; }
.hg-logo-slot img { max-height: 40px; max-width: 160px; }
.hg-logo-slot .ap-hint { margin: 0; }
/* Export modal's logo row: slot grows, hint sits under the currency row */
.ex-logo { display: flex; align-items: center; gap: 8px; }
.ex-logo .hg-logo-slot { flex: 0 0 auto; }
html.dark .stg-kv > span:first-child { color: var(--hg-text-muted); }
html.dark .stg-val { color: var(--hg-text-bright); }
html.dark .stg-badge { border-color: var(--hg-border-control); color: #8a8b90; }

.cf-section-head td {
  font-size: var(--hg-type-10); font-weight: 600; text-transform: uppercase;
  letter-spacing: .05em; color: var(--hg-text-dim); padding: 8px 6px 4px;
  border-bottom: 1px solid var(--hg-hairline);
}
.cf-section-total td {
  font-weight: 600; border-top: 1px solid var(--hg-hairline); color: var(--hg-text-ink);
  padding-bottom: 12px;
}
.cf-grand-total td {
  font-weight: 700; border-top: 2px solid var(--hg-hairline); border-bottom: none;
  color: var(--hg-text-ink); font-size: var(--hg-type-medium);
  padding-bottom: 12px;
}
.cf-row-balance td {
  font-weight: 600; padding: 6px 6px; border-top: 1px solid var(--hg-hairline);
}
.cf-balance { font-variant-numeric: tabular-nums; }
.cf-balance-neg { color: var(--hg-danger); }
.cf-balance-empty { border: none !important; background: transparent !important; }
.cf-label { white-space: nowrap; font-size: var(--hg-type-11); }
.cf-line-label { white-space: nowrap; font-size: var(--hg-type-base); }
/* The source column and the fixed lane share one content-independent width. */
#cfForecastTable tr:not(.cf-forecast-title-row):not(.cv-add-row) > :first-child {
  width: var(--cf-forecast-label-w) !important;
  min-width: var(--cf-forecast-label-w);
  max-width: var(--cf-forecast-label-w);
}
.cf-label-text {
  display: inline-block; max-width: calc(var(--cf-forecast-label-w) - 64px);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom;
}
.cf-row-total { font-variant-numeric: tabular-nums; font-weight: 600; }
.cf-del-cell { text-align: center; padding: 2px 4px; }

/* dark mode */
html.dark .acct-cf-wrap { border-top-color: var(--hg-border-chrome); }
/* Dark mode hairlines wear the same token as the Bank Summary's row grid
   (--hg-border-cell) so both tables read identically in any theme; the
   TOTAL line keeps its own chrome twin, matching the bank's TOTAL. */
html.dark .cf-section-head td { color: var(--hg-text-muted); border-bottom-color: var(--hg-border-cell); }
html.dark .cf-section-total td { border-top-color: var(--hg-border-cell); color: var(--hg-text-bright); }
html.dark .cf-grand-total td { border-top-color: var(--hg-border-chrome); color: var(--hg-text-bright); }
html.dark .cf-row-balance td { border-top-color: var(--hg-border-cell); }
html.dark .cf-balance-neg { color: var(--hg-danger-bright); }
html.dark .cf-forecast-scroll { background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; }

/* scenario selector + derived/scenario row styling */
/* Head bar for Financial Overview: period controls in one aligned
   strip — SAME gaps as the regular
   filter rows (.gfilters law): 5px above, 8px below, flush at the
   view top (the container's top padding is 0; the head is the
   first row). */
.acct-cf-head {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  justify-content: center;
  padding: 5px 16px 8px;
  /* Own compositing layer, the .gfilters law: this strip sits directly on the
     bank sheet's frost, whose blur reads the band above it, so every control
     repaint must stop at its own bounds instead of expanding damage into the
     sheet's pass. Menus and hints mount on document.body, so no paint
     containment is set here. */
  contain: layout style;
  will-change: transform;
}
.acct-cf-head > button { contain: layout style; will-change: transform; }
.acct-cf-head .acct-cf-spacer { flex: 0 0 22px; }
.acct-cf-head .acct-mode-btn {
  appearance: none; border: none; background: transparent; cursor: pointer;
  padding: 0 6px; font-size: var(--hg-type-base); color: var(--hg-text-muted);
}
.acct-cf-head .acct-mode-btn:hover { color: var(--hg-accent); }
.acct-cf-spacer { flex: 1; }
.acct-cf-scen-lbl { font-size: var(--hg-type-10); text-transform: uppercase; letter-spacing: .05em; color: var(--hg-text-dim); }
.cf-derived-row td { color: var(--hg-text-secondary); }
.cf-group-toggle { padding: 0 4px; margin-right: 4px; }
.cf-group-label { cursor: pointer; }
.cf-group-open > td > .cf-label-text,
.cf-group-open > td > .cf-value-text,
.cf-group-open > td > .cf-plan-edit { opacity: .5; }
#cfForecastLabels .cf-detail-row .cf-line-label,
#cfForecastTable .cf-detail-row .cf-line-label { padding-left: 26px; }
.cf-detail-content { display: inline-block; }
.cf-detail-row td > .cf-detail-content,
.cf-detail-row td > .cf-plan-edit,
.cf-detail-row td > button { transform: translateX(15px); }
.cf-derived-cell { font-variant-numeric: tabular-nums; font-size: var(--hg-type-11); }
.cf-scenario-row td { color: var(--cf-scenario-ink); background: var(--cf-scenario-bg); }
html.dark .cf-derived-row td { color: var(--hg-text-muted); }
html.dark .cf-derived-cell { color: var(--hg-text-muted); }
html.dark .cf-scenario-row td { color: var(--cf-scenario-ink); background: var(--cf-scenario-bg); }
/* Explicit and carried plan values retain their saved-plan marks.
   Children covered by a parent override are reference-only in both themes. */
td.cf-plan-exp { background: var(--cf-plan-bg); }
td.cf-plan-exp input { color: var(--cf-plan-ink); }
td.cf-plan-carried input { color: var(--cf-plan-carried-ink); }
html.dark td.cf-plan-exp { background: var(--cf-plan-bg); }
html.dark td.cf-plan-exp input { color: var(--cf-plan-ink); }
html.dark td.cf-plan-carried input { color: var(--cf-plan-carried-ink); }
td.cf-plan-ghost,
html.dark td.cf-plan-ghost { background: transparent; }
td.cf-plan-ghost input,
html.dark td.cf-plan-ghost input { color: var(--hg-text-muted); opacity: .45; cursor: default; }

/* ===== 9. TIER TEST + TIER SECURITY ===== */
/* The three buttons are the control: no frame of their own, so they sit
   directly on the strip behind them. */
.tier-test {
  display: inline-flex; gap: 2px; margin-left: 8px;
}
.tier-btn {
  border: none; background: var(--hg-surface-tabs); cursor: pointer;
  font-size: var(--hg-type-10); font-weight: 500; padding: 2px 8px;
  border-radius: 3px; color: var(--hg-text-muted); transition: all .15s;
  font-variant-numeric: tabular-nums;
}
.tier-btn:hover { color: var(--hg-text-ink); background: var(--hg-surface-tabs); }
.tier-btn.on { background: var(--hg-accent); color: var(--hg-text-on-accent); }
.tier-btn.on:hover { background: var(--hg-accent); }

/* tier-test dark */
html.dark .tier-btn { color: var(--hg-text-muted); background: var(--hg-surface-card); }
html.dark .tier-btn:hover { color: #b8b9be; background: var(--hg-surface-card); }
html.dark .tier-btn.on { background: var(--hg-accent); color: var(--gbar-rev-ink); }

/* ===== 10. UNDO / REDO STRIP ===== */
.undo-strip {
  display: inline-flex; gap: 2px; margin-left: 8px;
}
.undo-btn {
  border: none; background: var(--hg-surface-tabs); cursor: pointer;
  font-size: var(--hg-type-11); font-weight: 500; padding: 2px 8px; line-height: 1.2;
  border-radius: 3px; color: var(--hg-text-ink); transition: all .15s;
  font-variant-numeric: tabular-nums; min-width: 32px;
}
.undo-btn:hover:not(:disabled) { background: color-mix(in srgb, var(--hg-surface-tabs) 88%, var(--hg-text-ink)); }
.undo-btn:disabled { color: var(--hg-text-muted); background: transparent; cursor: default; }

html.dark .undo-btn { color: #b8b9be; background: var(--hg-surface-card); }
html.dark .undo-btn:hover:not(:disabled) { background: var(--hg-surface-hover); }
html.dark .undo-btn:disabled { color: var(--hg-text-muted); background: transparent; }
html.dark .tier-btn.on:hover { background: var(--hg-accent); }
/* tier-based visibility (security) — keep late */
/* t1-only: visible only at T1 (Founder). Hidden at T2 and T3. */
[data-tier="2"] .t1-only,
[data-tier="3"] .t1-only { display: none !important; }

/* t2-only: visible at T1 and T2. Hidden at T3. */
[data-tier="3"] .t2-only { display: none !important; }
/* ===== 10. PRIMITIVES (late winners) — focus, select hairline, status menu ===== */
/* ONE shared icon-button definition (frame, colour, hover, dark) — every local
   rule below only restates SIZE and POSITION. Add `.hg-icon-btn` to the markup;
   `.bordered` gives the visible pill the money doors wear. */
.hg-icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  box-sizing: border-box; padding: 4px 6px;
  background: transparent; border: 1px solid transparent; border-radius: 4px;
  color: var(--hg-text-muted); font-size: var(--hg-type-medium); line-height: 1;
  cursor: pointer; user-select: none;
}
.hg-selection-count { color: var(--hg-accent); }
.hg-icon-btn:hover { color: var(--hg-text-ink); background: var(--hg-frost-hover); }
.hg-icon-btn.bordered {
  background: var(--hg-surface-tabs); border-color: var(--hg-border-control);
  color: var(--hg-text-ink);
}
.hg-icon-btn.bordered:hover {
  border-color: var(--hg-accent); background: var(--hg-surface-tabs);
}
html.dark .hg-icon-btn { color: var(--hg-text-muted); }
html.dark .hg-icon-btn:hover { color: var(--hg-text-bright); background: var(--hg-frost-hover); }
html.dark .hg-icon-btn.bordered { color: var(--hg-text-bright); }
html.dark .hg-icon-btn.bordered:hover {
  border-color: var(--hg-accent); background: var(--hg-surface-tabs);
} 
/* Floating panels: one opt-in class, one title class. Local rules own only
   size, placement and content layout; overlay/dismissal policy stays with the caller. */
.hg-floating-panel {
  --hg-frost-bg: var(--hg-floating-panel-bg);
  --hg-frost-blur: var(--hg-floating-panel-blur);
}
.hg-floating-panel > .hg-floating-title { margin-bottom: 14px; cursor: move; user-select: none; touch-action: none; }
/* Lane-coloured popup. The panel carries data-seg (the lane's colour slot), so
   the slot's accent — personal palettes included — resolves on the panel
   itself: a body-level overlay cannot inherit it from the row that opened it.
   The colours are the TREE'S OWN ramp, step for step: the title bar is a lane,
   the sheet a deliverable, the table a stage, and the fields wear the stage
   fields. Local panel rules still own size and placement only. */
.hg-floating-panel[data-seg],
.hg-menu[data-seg],
.hg-tooltip[data-seg],
.hg-cal[data-seg] {
  --hg-pop-lane:   color-mix(in srgb, var(--seg-accent) var(--hg-lane-op), var(--hg-surface-base));
  --hg-pop-entity: color-mix(in srgb, var(--seg-accent) var(--hg-entity-op), var(--hg-surface-base));
  --hg-pop-stage:  color-mix(in srgb, var(--seg-accent) var(--hg-stage-op), var(--hg-surface-base));
  /* The lift is the lane too: a depth shadow darkened by its own accent, so
     the colour reads as light filtered through the panel rather than a neutral
     drop behind it. Two parts: the wide cast, then a close contact shadow.
     Small popups take the tighter pair, so a menu never wears a panel's cast. */
  --hg-pop-shadow:
    0 16px 40px color-mix(in srgb, var(--seg-accent) 30%, rgb(0 0 0 / 0.34)),
    0 2px 8px  color-mix(in srgb, var(--seg-accent) 22%, rgb(0 0 0 / 0.20));
  --hg-pop-shadow-sm:
    0 10px 24px color-mix(in srgb, var(--seg-accent) 26%, rgb(0 0 0 / 0.30)),
    0 1px 4px  color-mix(in srgb, var(--seg-accent) 20%, rgb(0 0 0 / 0.18));
}
/* In dark the ground is near black, so a colour at depth alpha turns into a
   glow. The dark lifts keep a black base and let the accent warm it only. */
html.dark .hg-floating-panel[data-seg],
html.dark .hg-menu[data-seg],
html.dark .hg-tooltip[data-seg],
html.dark .hg-cal[data-seg] {
  --hg-pop-shadow:
    0 16px 40px color-mix(in srgb, var(--seg-accent) 12%, rgb(0 0 0 / 0.58)),
    0 2px 8px  color-mix(in srgb, var(--seg-accent) 10%, rgb(0 0 0 / 0.40));
  --hg-pop-shadow-sm:
    0 10px 24px color-mix(in srgb, var(--seg-accent) 10%, rgb(0 0 0 / 0.52)),
    0 1px 4px  color-mix(in srgb, var(--seg-accent) 9%, rgb(0 0 0 / 0.36));
}
/* The schedule editor's frost surfaces are blue-grey by default, which reads
   as uncoloured on a lane panel. In dark the stage rows and the two header
   bars take the stage step, so the table is the same warm family as the sheet
   above it. Light keeps its approved look. */
html.dark .hg-floating-panel[data-seg] .na-gantt-wrap .na-row,
html.dark .hg-floating-panel[data-seg] .na-gantt-wrap .labels-head,
html.dark .hg-floating-panel[data-seg] .na-gantt-wrap .weekhdr {
  background: var(--hg-pop-stage);
}
/* Every lane popup casts its lane: panels wide, menus, cards and calendars
   tight. Non-lane popups keep the app's neutral lift. The dark twin is spelled
   out because the dark surface rules carry an element in their selector. */
.hg-floating-panel[data-seg],
html.dark .hg-floating-panel[data-seg] { box-shadow: var(--hg-pop-shadow); }
.hg-menu[data-seg][role="menu"],
.hg-tooltip[data-seg],
.hg-cal[data-seg],
html.dark .hg-menu[data-seg][role="menu"],
html.dark .hg-tooltip[data-seg],
html.dark .hg-cal[data-seg] { box-shadow: var(--hg-pop-shadow-sm); }
.modal.hg-floating-panel[data-seg],
.hg-floating-panel[data-seg]:not(.modal) { background: var(--hg-pop-entity); }
.hg-floating-panel[data-seg] > .hg-floating-title { background: var(--hg-pop-lane); }
/* The table and its rows take the stage step; the rows add nothing, so the
   stage colour is what the person reads, exactly as a stage row does. */
.hg-floating-panel[data-seg] .na-row,
.hg-floating-panel[data-seg] .na-gantt-wrap .lane { background: transparent; }
/* Fields wear the stage-field pattern: the field fill in light, the row's own
   tint sunk by the field scrim in dark (never the neutral app input on a lane). */
html.dark .hg-floating-panel[data-seg] .na-row input.na-stage,
html.dark .hg-floating-panel[data-seg] .na-row input.na-num { background: var(--seg-field); color: var(--hg-text-bright); }
/* A text-entry dialog summoned from a lane is a field on the same ramp. */
.hg-floating-panel[data-seg] .hg-prompt-input { background: var(--hg-input-bg); color: var(--hg-input-ink); }
html.dark .hg-floating-panel[data-seg] .hg-prompt-input { background: var(--seg-field); color: var(--hg-text-bright); }
/* The muted note token is tuned for grey sheets; on a lane sheet it drops to
   unusable contrast, so the note takes the sheet's ink instead. */
.hg-floating-panel[data-seg] .hg-form-note { color: var(--hg-text-ink); }
/* A menu is a popup too. It has no title bar, so it wears the deliverable step
   of the lane that summoned it and reads as a slice of the card, not as app
   chrome. Hover and the current row sink by the field scrim, as a row does.
   Menus live on <body>; the attribute travels with the menu, so the lane
   tokens resolve there. [role="menu"] outranks the dark-mode surface rule. */
.hg-menu[data-seg][role="menu"] { background: var(--hg-pop-entity); }
.hg-menu[data-seg][role="menu"] .hg-menu-item:hover,
.hg-menu[data-seg][role="menu"] .hg-menu-item.current,
.hg-menu[data-seg][role="menu"] .hg-menu-item[aria-expanded="true"],
.hg-menu[data-seg][role="menu"] .hg-preset-name:hover,
.hg-menu[data-seg][role="menu"] .hg-preset-del:hover { background: var(--seg-field); }
.hg-menu[data-seg][role="menu"] .hg-preset-del:hover { color: var(--hg-text-ink); }
/* A menu head is the menu's title bar: the lane step, as on a panel. */
.hg-menu[data-seg][role="menu"] .hg-menu-head { background: var(--hg-pop-lane); }
/* A field in a lane menu is a field on the same ramp. */
/* Every control in a lane flyout is a field on the same ramp: the date and
   number boxes, the weekend taps and the note box wear one paint, so a row of
   them can never read as half styled. The pressed tap keeps the accent. */
.hg-menu[data-seg][role="menu"] .hg-menu-num,
.hg-menu[data-seg][role="menu"] .hg-inp,
.hg-menu[data-seg][role="menu"] .hg-menu-search,
.hg-menu[data-seg][role="menu"] .hg-date,
.hg-menu[data-seg][role="menu"] .hg-menu-tap:not(.pressed),
.hg-menu[data-seg][role="menu"] .hg-menu-note-box { background: var(--hg-input-bg); color: var(--hg-input-ink); }
html.dark .hg-menu[data-seg][role="menu"] .hg-menu-num,
html.dark .hg-menu[data-seg][role="menu"] .hg-inp,
html.dark .hg-menu[data-seg][role="menu"] .hg-menu-search,
html.dark .hg-menu[data-seg][role="menu"] .hg-date,
html.dark .hg-menu[data-seg][role="menu"] .hg-menu-tap:not(.pressed),
html.dark .hg-menu[data-seg][role="menu"] .hg-menu-note-box { background: var(--seg-field); color: var(--hg-text-bright); }
/* The relations card is a panel too: its bar is the lane and the card is the
   deliverable step, so the door's lane stays visible while the card is open. */
.hg-tooltip[data-seg] { background: var(--hg-pop-entity); }
.hg-tooltip[data-seg] .hg-form-note { color: var(--hg-text-ink); }
/* The relations card uses the floating-panel title recipe at the tip card's
   scale: inset by the card padding so the sheet frames it, a 4px radius, one
   12px/600 line and the same soft lift. The bar is the lane. */
.hg-tip-bar {
  display: flex; align-items: center; gap: 6px; min-width: 0;
  padding: 8px 10px; margin: 0 0 6px; border-radius: 4px;
  background: var(--hg-pop-lane, var(--hg-surface-header));
  font-weight: 600; font-size: var(--hg-type-medium); letter-spacing: -.01em;
  color: var(--hg-text-ink);
  box-shadow: var(--hg-shadow-sm);
}
.hg-tip-bar-k { white-space: nowrap; }
.hg-tip-bar-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
html.dark .hg-tip-bar { color: var(--hg-text-bright); }
/* The editor's ruler scrollbar carries the lane, not the app's Top grey. */
.hg-floating-panel[data-seg] .na-gantt-wrap .gantt-timeline { scrollbar-color: var(--hg-pop-lane) transparent; }
.hg-floating-panel[data-seg] .na-gantt-wrap .gantt-timeline::-webkit-scrollbar-thumb { background: var(--hg-pop-lane); border-radius: 4px; }
   OWNED HERE: select/input/crew-pick/proj-select final chrome. Surfaces must not
   re-assert boxed borders on these. */
/* focus ring — buttons/selects/tabs only. Text inputs use the hairline
   underline focus (see .gfilters input:focus, .hg-inp:focus, etc.); a boxed
   ring on text boxes is not part of the design language. */
button:focus-visible, select:focus-visible, .tab:focus-visible {
  outline: none;
  box-shadow: 0 0 0 1px var(--hg-accent), 0 0 0 3px color-mix(in srgb, var(--hg-accent) 20%, transparent);
}
html.dark button:focus-visible, html.dark select:focus-visible, html.dark .tab:focus-visible {
  box-shadow: 0 0 0 1px #8fa9c4, 0 0 0 3px #8fa9c433;
}
/* .hg-rail — vertical section list (shared primitive, first used by the
   Settings cog). One item active at a time; the active item carries the
   accent edge — the vertical reading of the subtab underline. */
.hg-rail {
  display: flex; flex-direction: column; gap: 2px;
  width: 210px; flex: 0 0 auto;
  padding-right: 12px; margin-right: 12px;
  border-right: 1px solid var(--hg-border-chrome);
  overflow-y: auto;
}
.hg-rail-item {
  display: flex; align-items: center; gap: 8px;
  width: 100%; text-align: left;
  border: none; border-left: 2px solid transparent;
  background: transparent; padding: 8px 10px;
  font-size: var(--hg-type-12h); color: var(--hg-text-secondary);
  cursor: pointer; white-space: nowrap;
  transition: color .12s, border-color .12s;
}
.hg-rail-item:hover { color: var(--hg-text-ink); background: var(--hg-frost-hover); }
.hg-rail-item.on { color: var(--hg-text-ink); border-left-color: var(--hg-accent); font-weight: 500; }
html.dark .hg-rail { border-right-color: var(--hg-border-chrome); }
html.dark .hg-rail-item { color: var(--hg-text-muted); }
html.dark .hg-rail-item:hover { color: var(--hg-text-bright); }
html.dark .hg-rail-item.on { color: var(--hg-text-bright); border-left-color: var(--hg-accent); }

/* project picker in proj-strip: transparent, hairline on hover */
.proj-strip .proj-select {
  border: none; border-bottom: 1px solid transparent; border-radius: 0;
  padding: 3px 20px 3px 2px; background-color: transparent;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='6' viewBox='0 0 8 6'%3E%3Cpath d='M1 1.5l3 3 3-3' fill='none' stroke='%239a9aa2' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 6px center;
}
.proj-strip .proj-select:hover { background-color: transparent; border-bottom-color: var(--hg-border-focus); }
html.dark .proj-strip .proj-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='6' viewBox='0 0 8 6'%3E%3Cpath d='M1 1.5l3 3 3-3' fill='none' stroke='%236f7076' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); border-bottom-color: transparent;
}
html.dark .proj-strip .proj-select:hover { background-color: transparent; border-bottom-color: #6f7076; }

/* crew pick: match the same flat look */
.crew-pick {
  border: none; border-bottom: 1px solid var(--hg-border-control); border-radius: 0;
  background-color: transparent; padding: 1px 16px 1px 2px;
}
html.dark .crew-pick { border-bottom-color: var(--hg-border-control); background-color: transparent; }
html.dark .crew-pick.un { border-bottom-color: var(--st-reopen-bg); }

/* owner pick: same flat chrome */
.owner-pick {
  border: none; border-bottom: 1px solid var(--hg-border-control); border-radius: 0;
  background-color: transparent; padding: 1px 16px 1px 2px;
}
html.dark .owner-pick { border-bottom-color: var(--hg-border-control); background-color: transparent; }
html.dark .owner-pick.un { border-bottom-color: #2a2b30; }

/* text inputs: same hairline treatment */
.gfilters input, .mrow input {
  border: none; border-bottom: 1px solid var(--hg-border-control); border-radius: 0;
  background-color: transparent; padding: 3px 2px; font-size: var(--hg-type-11h);
}
.gfilters input:focus, .mrow input:focus { outline: none; border-bottom-color: var(--hg-accent); box-shadow: none; }
html.dark .gfilters input, html.dark .mrow input {
  border-bottom-color: var(--hg-border-control); background-color: transparent; color: var(--hg-text-bright);
}
html.dark .gfilters input:focus, html.dark .mrow input:focus { border-bottom-color: var(--hg-border-focus); }
/* custom status menu — replaces native selects */
button.st-select {
  appearance: none; -webkit-appearance: none;
  display: inline-flex; align-items: center; gap: 5px;
  font: inherit; font-size: var(--hg-type-micro); line-height: 15px; white-space: nowrap;
  padding: 1px 6px 1px 8px; border: 0; border-radius: 3px;
  cursor: pointer; color: inherit; background-image: none;
}
button.st-select:hover { filter: brightness(.97); }
button.st-select:focus-visible { outline: 1px solid currentColor; outline-offset: 2px; box-shadow: none; }
button.st-select:disabled { cursor: wait; opacity: .7; }
.st-chevron { width: 0; height: 0; border-left: 3px solid transparent; border-right: 3px solid transparent; border-top: 4px solid currentColor; opacity: .48; flex: 0 0 auto; }
button.st-select.st-ip { background-color: var(--st-ip-bg); color: var(--st-ip-ink); }
button.st-select.st-wtg { background-color: var(--st-wtg-bg); color: var(--st-wtg-ink); }
button.st-select.st-rev { background-color: var(--st-rev-bg); color: var(--st-rev-ink); }
button.st-select.st-cmpt { background-color: var(--st-cmpt-bg); color: var(--st-cmpt-ink); }
button.st-select.st-appr { background-color: var(--st-appr-bg); color: var(--st-appr-ink); }
button.st-select.st-reopen { background-color: var(--st-reopen-bg); color: var(--hg-danger-hover); }
.status-menu {
  position: fixed; z-index: 100; width: 132px; padding: 4px;
  background: var(--hg-surface-tabs); border: 1px solid var(--hg-hairline); border-radius: 4px;
  box-shadow: var(--hg-shadow-menu);
}
.status-menu-item {
  display: flex; width: 100%; border: 0; border-radius: 3px; padding: 5px 8px;
  background: transparent; color: var(--hg-text-ink); text-align: left; font: 500 11px/1.2 "Inter", sans-serif; cursor: pointer;
}
.status-menu-item:hover, .status-menu-item.current { background: #f0f0f0; }
.status-menu-item.current::after { content: ""; width: 4px; height: 4px; margin: auto 0 auto auto; border-radius: 50%; background: currentColor; }
.status-menu-item.st-ip { color: var(--st-ip-ink); }
.status-menu-item.st-wtg { color: var(--st-wtg-ink); }
.status-menu-item.st-rev { color: var(--st-rev-ink); }
.status-menu-item.st-cmpt { color: var(--st-cmpt-ink); }
.status-menu-item.st-appr { color: var(--st-appr-ink); }
.status-menu-item.st-reopen { color: var(--hg-danger-hover); }
html.dark button.st-select.st-ip { background-color: var(--st-ip-bg); color: var(--st-ip-ink); }
html.dark button.st-select.st-wtg { background-color: var(--hg-surface-hover); color: #b4b5bb; }
html.dark button.st-select.st-rev { background-color: var(--st-rev-bg); color: var(--st-rev-ink); }
html.dark button.st-select.st-cmpt { background-color: var(--st-cmpt-bg); color: var(--st-cmpt-ink); }
html.dark button.st-select.st-appr { background-color: var(--st-appr-bg); color: var(--st-appr-ink); }
html.dark button.st-select.st-reopen { background-color: var(--st-reopen-bg); color: var(--st-reopen-ink); }
html.dark .status-menu { background: var(--hg-surface-tabs); border-color: var(--hg-border-control); box-shadow: var(--hg-shadow-menu); }
html.dark .status-menu-item { color: #c2c3c8; }
html.dark .status-menu-item:hover, html.dark .status-menu-item.current { background: #26272b; }
html.dark .status-menu-item.st-ip { color: var(--st-ip-ink); }
html.dark .status-menu-item.st-wtg { color: #b4b5bb; }
html.dark .status-menu-item.st-rev { color: var(--st-rev-ink); }
html.dark .status-menu-item.st-cmpt { color: var(--st-cmpt-ink); }
html.dark .status-menu-item.st-appr { color: var(--st-appr-ink); }
html.dark .status-menu-item.st-reopen { color: var(--st-reopen-ink); }

/* ===== shared popover dropdown (hgSelect / hgSelectMulti) ===== */
.hg-select, .hg-multi-select {
  -webkit-appearance: none; -moz-appearance: none; appearance: none;
  display: inline-flex; align-items: center; gap: 6px;
  background-color: transparent; background-image: none;
  border: none; border-bottom: 1px solid var(--hg-border-control); border-radius: 0;
  padding: 3px 20px 3px 2px; font: inherit; font-size: var(--hg-type-11h);
  color: var(--hg-text-ink); cursor: pointer; white-space: nowrap;
}
.hg-select:not(.un), .hg-multi-select:not(.un) { font-weight: 500; }
/* Shared accent-ink variant for an explicit action trigger. */
.hg-select.accent { color: var(--hg-accent); }
.hg-select:hover, .hg-multi-select:hover { border-bottom-color: var(--hg-border-focus); }
.hg-select:focus-visible, .hg-multi-select:focus-visible {
  outline: none; border-bottom-color: var(--hg-accent);
}
.hg-select.un, .hg-multi-select.un { color: var(--hg-text-muted); }
/* Caret variant: a picker in a labelled row states that it opens a list. The
   glyph is the control's own, so a surface never draws its own arrow. */
.hg-select.chev, .hg-multi-select.chev { padding-right: 2px; gap: 5px; }
.hg-select.chev::after, .hg-multi-select.chev::after {
  content: "\25BE";
  font-size: var(--hg-type-tiny);
  line-height: 1;
  color: var(--hg-text-muted);
}
/* A picker the person cannot open (a field waiting on a restore point, a
   pending feature) reads as an inactive control, not as missing text. */
.hg-select:disabled, .hg-multi-select:disabled { opacity: .55; cursor: not-allowed; }
/* First-column row labels must match IT Tracker / Crew: --hg-text-ink,
   base font size, weight 600 — even when the cell is a select trigger. */
#v-cliInv #cliInvTable td:first-child .hg-select,
#v-ctiInv #conInvTable td:first-child .hg-select {
  font-size: var(--hg-type-base);
  font-weight: 600;
  color: var(--hg-text-ink);
}
#v-cliInv #cliInvTable td:first-child .hg-select.un,
#v-ctiInv #conInvTable td:first-child .hg-select.un {
  color: var(--hg-text-ink);
}
html.dark #v-cliInv #cliInvTable td:first-child .hg-select,
html.dark #v-ctiInv #conInvTable td:first-child .hg-select {
  color: var(--hg-text-bright);
}
html.dark #v-cliInv #cliInvTable td:first-child .hg-select.un,
html.dark #v-ctiInv #conInvTable td:first-child .hg-select.un {
  color: var(--hg-text-bright);
}
/* First-column row labels in the remaining tracker tables must match IT
   Tracker / Crew: weight 600 (color + font already inherit the shared
   .hg-cell-input tokens — ink/bright + Inter 12px). */
#v-ex #expTable td .hg-cell-input[data-field="vendor"],
#v-rc #rcTable td:first-child .hg-cell-input {
  font-weight: 600;
}
/* per-option color on the trigger (optional, from option.cls) */
.hg-select.st-ip, .hg-multi-select.st-ip { background-color: var(--st-ip-bg); color: var(--st-ip-ink); }
.hg-select.st-wtg, .hg-multi-select.st-wtg { background-color: var(--st-wtg-bg); color: var(--st-wtg-ink); }
.hg-select.st-rev, .hg-multi-select.st-rev { background-color: var(--st-rev-bg); color: var(--st-rev-ink); }
.hg-select.st-cmpt, .hg-multi-select.st-cmpt,
.hg-select.st-appr, .hg-multi-select.st-appr { background-color: var(--st-appr-bg); color: var(--st-appr-ink); }
.hg-select.st-reopen, .hg-multi-select.st-reopen { background-color: var(--st-reopen-bg); color: var(--hg-danger-hover); }

.hg-menu {
  position: fixed; z-index: 210; min-width: 140px; max-width: 260px;
  max-height: 260px; overflow-y: auto; padding: 4px;
  background: var(--hg-surface-tabs); border: 1px solid var(--hg-border-control); border-radius: 4px;
  box-shadow: var(--hg-shadow-menu);
}
/* Shared colour editor: hg-menu owns the themed panel; hg-ctl owns controls.
   Spectrum colours are canvas content, not panel or control chrome. */
.hg-menu.hg-colour-picker {
  width: min(240px, calc(100vw - 32px));
  min-width: 0; max-width: none;
  max-height: calc(100vh - 24px);
  padding: 10px; display: grid; gap: 10px;
}
.hg-colour-area { display: block; width: 100%; height: 140px; touch-action: none; cursor: crosshair; }
.hg-colour-hue, .hg-colour-sat, .hg-colour-lum { display: block; width: 100%; margin: 6px 0 0; }
.hg-colour-channels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.hg-colour-channels input { display: block; width: 100%; min-width: 0; padding: 4px; margin-top: 4px; }
.hg-colour-sample { width: 100%; padding: 6px 8px; }
.hg-colour-message:empty { display: none; }

.hg-menu-item {
  display: flex; width: 100%; align-items: center; gap: 8px;
  border: 0; border-radius: 3px; padding: 5px 8px;
  background: transparent; color: var(--hg-text-ink); text-align: left;
  font: 500 11.5px/1.2 "Inter", sans-serif; cursor: pointer; white-space: nowrap;
}
/* The row under the pointer, the current row, and the row whose flyout is
   open share one tint. It mixes two surface tokens that exist in both themes:
   --seg-accent is defined only on [data-seg] elements, and a menu is placed on
   <body>, so a segment-keyed mix resolves to nothing there. */
.hg-menu-item:hover, .hg-menu-item.current, .hg-menu-item[aria-expanded="true"] {
  background: color-mix(in srgb, var(--hg-surface-header) 25%, var(--hg-surface-tabs));
}
.hg-menu-head {
  position: sticky; top: -4px; z-index: 1; margin: -4px -4px 4px;
  padding: 8px 12px; background: var(--hg-surface-header);
  border-bottom: 1px solid var(--hg-border-row);
}
.hg-menu-title { color: var(--hg-text-ink); font-size: var(--hg-type-base); font-weight: 650; }
.hg-menu-subtitle { margin-top: 2px; color: var(--hg-text-muted); font-size: var(--hg-type-small); font-variant-numeric: tabular-nums; }
/* Search row of both menu kinds (single select and multi select): .hg-menu owns
   the popup surface and .hg-ctl owns the input's paint vocabulary (tokens flip
   per mode), so this rule restates box shape only. */
.hg-menu-head .hg-menu-search { width: 100%; box-sizing: border-box; padding: 4px 8px; }
/* Multi-select menu head: the clear-all action and, on a list long enough to
   scroll, the search box share one row. This rule states box shape only —
   .hg-menu-item paints the action row and .hg-ctl the input. */
.hg-menu-bar { display: flex; align-items: center; gap: 6px; }
.hg-menu-head > :not(.hg-menu-bar) + .hg-menu-bar { margin-top: 4px; }
.hg-menu-bar > .hg-menu-item { flex: 0 0 auto; width: auto; padding: 4px 8px; }
.hg-menu-bar .hg-menu-search { flex: 1 1 auto; min-width: 0; width: auto; }
/* The clear-all row is an action, not an option: it carries no checkbox
   swatch, because it holds no state of its own. */
.hg-menu-multi .hg-menu-item.hg-menu-action::before { content: none; }

.hg-menu-form-row { display: flex; align-items: center; gap: 8px; padding: 5px 8px; }
.hg-menu-form-row > :last-child { margin-left: auto; min-width: 0; }
/* A menu action that carries a number keeps the menu row's paint on its
   label and the shared control's on its field, so this rule states box shape
   only: the label stops claiming the whole row, the field takes a narrow
   centred box. The label starts on the same edge as every other row's. */
.hg-menu-form-row > .hg-menu-item { flex: 0 0 auto; width: auto; padding-left: 0; padding-right: 4px; }
.hg-menu-num { width: 58px; padding: 3px 6px; text-align: center; font-variant-numeric: tabular-nums; }
.hg-menu-note { padding: 4px 8px; }
.hg-menu-note:empty { display: none; }
.hg-menu-item.current::after {
  content: ""; width: 4px; height: 4px; margin: auto 0 auto auto;
  border-radius: 50%; background: currentColor; flex-shrink: 0;
}
/* A row that opens a flyout, and the read value a row carries. The chevron
   marks the one-level-down rows; the detail column states the field's current
   value (date, span, crew, cost) on the label's own row so a menu can show
   truth, not just verbs. */
.hg-menu-chev {
  width: 5px; height: 5px; margin-left: auto; flex: 0 0 auto;
  border-right: 1.5px solid currentColor; border-top: 1.5px solid currentColor;
  transform: rotate(45deg); opacity: .5;
}
.hg-menu-detail {
  margin-left: auto; min-width: 0; padding-left: 12px;
  color: var(--hg-text-muted); overflow: hidden; text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}
/* A flyout is the same panel one level down. It takes its own height budget,
   so a field list is never clipped to the root menu's cap. */
.hg-menu.hg-menu-sub {
  min-width: 190px; max-width: 300px;
  max-height: min(440px, calc(100vh - 24px));
}
/* A row that owns a control instead of a verb: .hg-menu paints the panel and
   .hg-ctl paints the field, so this rule states box shape only. */
.hg-menu-field { display: flex; align-items: flex-start; gap: 8px; padding: 5px 8px 7px; }
.hg-menu-field > .hg-menu-field-label {
  flex: 0 0 auto; padding-top: 4px; color: var(--hg-text-ink);
  font: 500 11.5px/1.2 "Inter", sans-serif;
}
/* Dark twin, adjacent so the pair can never drift: the panel is dark, so the
   label flips to bright like .hg-menu-title — ink on dark is unreadable. */
html.dark .hg-menu-field-label { color: var(--hg-text-bright); }
.hg-menu-field > .hg-menu-note-box { flex: 1 1 auto; min-width: 0; resize: none; }
/* A field row's controls sit side by side (a date and its clock, a number and
   its unit) and hug the row's right edge. Box shape only — .hg-date and
   .hg-ctl own the paint. */
.hg-menu-field > :not(.hg-menu-field-label) { margin-left: auto; }
.hg-menu-stack { display: flex; align-items: center; gap: 5px; min-width: 0; }
.hg-menu-date { width: 96px; height: 22px; padding: 1px 6px; font-size: var(--hg-type-10); justify-content: center; flex: 0 0 auto; }
.hg-menu-time { width: 76px; padding: 1px 4px; flex: 0 0 auto; }
.hg-menu-unit { color: var(--hg-text-muted); font-size: var(--hg-type-small); }
.hg-menu-multi .hg-menu-item::before {
  content: ""; width: 11px; height: 11px; flex-shrink: 0;
  border: 1px solid var(--hg-border-menu-chk); border-radius: 3px; background: var(--hg-surface-input);
}
.hg-menu-multi .hg-menu-item.checked::before {
  background-color: var(--hg-accent); border-color: var(--hg-accent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='9' height='7' viewBox='0 0 9 7'%3E%3Cpath d='M1 3.5l2.5 2.5L8 1' fill='none' stroke='%23fff' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: center; background-size: 9px 7px;
}
/* Partial membership: the person is on some of the set, not all of it. The
   open face keeps the box readable in both themes; the accent dash carries
   the state without claiming a tick. */
.hg-menu-multi .hg-menu-item.mixed::before,
html.dark .hg-menu-multi .hg-menu-item.mixed::before {
  border-color: var(--hg-accent);
  background-image: linear-gradient(var(--hg-accent), var(--hg-accent));
  background-repeat: no-repeat; background-position: center; background-size: 7px 2px;
}
/* per-option color inside the menu (from option.cls) */
.hg-menu-item.st-ip { color: var(--st-ip-ink); }
.hg-menu-item.st-wtg { color: var(--st-wtg-ink); }
.hg-menu-item.st-rev { color: var(--st-rev-ink); }
/* separator + new-project button in picker dropdown */
.hg-menu-sep { height: 1px; margin: 4px 2px; background: var(--hg-hairline); }
.hg-menu-new { color: var(--hg-text-muted); font-weight: 600; }
.hg-menu-new:hover { color: var(--hg-text-ink); }
/* Project picker organisation: one folder level over the project list.
   Folder rows, child indent and the drop affordances restate box shape
   only — .hg-menu paints the panel, .hg-menu-item paints every row, and
   .hg-menu-chev is the shared toggle mark turned to face down. */
.hg-org-folder .hg-menu-chev { order: -1; margin: 0 6px 0 0; }
.hg-org-folder[aria-expanded="true"] .hg-menu-chev { transform: rotate(135deg); }
/* A folder's contents step 20px below their folder's name (measured from
   the name, not the row edge). Box shape only — .hg-menu-item paints the
   row. */
.hg-org-child { padding-left: 41px; }
/* The in-place folder rename: the shared field in the row's slot. Box shape
   only — .hg-ctl paints the field. */
.hg-org-rename {
  width: calc(100% - 8px); margin: 2px 4px;
  padding: 4px 8px;
}
.hg-org-drop-in { outline: 1px solid var(--hg-accent); outline-offset: -1px; }
.hg-org-drop-line {
  position: absolute; left: 6px; right: 6px; height: 2px;
  border-radius: 1px; background: var(--hg-accent); pointer-events: none;
}
/* The carried copy hangs on a body-level host that paints nothing, so no
   filtered ancestor becomes its containing block. The copy is the row
   itself: no fill, no blur, no shadow, and pointer-events none so it can
   never wear the row's hover tint. */
.hg-org-drag-host { pointer-events: none; }
.hg-org-drag-copy {
  position: fixed; z-index: 400; pointer-events: none;
  background: transparent; box-shadow: none;
}
/* The project picker's menu carries the whole organised list: its box takes
   20% more width and twice the shared height budget. Box shape only —
   .hg-menu paints the panel. */
.hg-org-menu {
  max-width: 312px;
  max-height: min(520px, calc(100vh - 24px));
}
/* section heading inside a menu (e.g. Scheduling / Weekends on the segment
   label-row RMB menu) — a plain muted label row, not a menu item */
.hg-menu-label {
  padding: 6px 8px 2px; color: var(--hg-text-muted);
  font: 600 10px/1.3 "Inter", sans-serif; text-transform: uppercase;
  letter-spacing: .04em; user-select: none;
}
.hg-menu-item:disabled,
.hg-menu-item:disabled:hover {
  color: var(--hg-text-muted); opacity: .55; cursor: default;
  background: transparent;
}

/* ── Themed tooltip card (gantt bars + dependency wires) ── */
.hg-tooltip {
  position: fixed; z-index: 200; min-width: 120px; max-width: 340px;
  padding: 8px 10px;
  background: var(--hg-surface-tabs);
  border: 1px solid color-mix(in srgb, var(--seg-accent) 35%, var(--hg-border-control));
  border-radius: 6px;
  box-shadow: var(--hg-shadow-menu);
  font: 500 11.5px/1.4 "Inter", sans-serif;
  color: var(--hg-text-ink);
  pointer-events: none;
  /* Own compositing layer (same reasoning as .gfilters): a fixed z-200 card
     sharing the gantt's surface means every show/move/hide re-runs the
     frost's blur pass over wherever it sits, dragging already-blurred
     pixels with it — the glowy clipped box. Promoted, its damage is its own. */
  contain: layout style;
  will-change: transform;
}
.hg-tip-title { font-weight: 600; color: var(--hg-text-ink); }
.hg-tip-body { margin-top: 4px; color: var(--hg-text-secondary); }
.hg-tip-kicker {
  margin-bottom: 2px; color: var(--hg-text-muted); font-size: var(--hg-type-9);
  font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
}
.hg-tip-context { margin-top: 2px; color: var(--hg-text-secondary); font-size: var(--hg-type-small); }
.hg-tip-grid {
  display: grid; gap: 4px; margin: 8px -10px 0; padding: 8px 10px 0;
  border-top: 1px solid var(--hg-border-row);
}
.hg-tip-row { display: grid; grid-template-columns: 62px minmax(0, 1fr); gap: 10px; margin: 0; }
.hg-tip-row dt { color: var(--hg-text-muted); font-size: var(--hg-type-small); font-weight: 600; }
.hg-tip-row dd { min-width: 0; margin: 0; color: var(--hg-text-ink); overflow-wrap: anywhere; }
.hg-tip-label { color: var(--hg-text-muted); font-size: var(--hg-type-small); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.hg-tip-note, .hg-tip-alert { margin: 8px -10px -8px; padding: 8px 10px; border-top: 1px solid var(--hg-border-row); }
.hg-tip-alert { color: var(--hg-danger-hover); font-weight: 600; }
.hg-tip-arrow { color: var(--hg-accent); font-weight: 700; margin: 2px 0; }
/* Tooltip text flips in dark mode (ink does NOT flip) — use bright there */
html.dark .hg-tooltip { color: var(--hg-text-bright); }
html.dark .hg-tip-title { color: var(--hg-text-bright); }
html.dark .hg-tip-body { color: var(--hg-text-bright); }
html.dark .hg-tip-context, html.dark .hg-tip-row dd { color: var(--hg-text-bright); }
/* Pinned card (LMB on a task label): same card, anchored below the row and
   static — it does not follow the cursor until dismissed. */
.hg-tooltip-pinned { min-width: 200px; }
/* A pinned card with more content than the window is capped by hgTipFit() at
   the top edge and wears this class. The column keeps the card's own footer
   in place: the content that can give way shrinks and scrolls, not the whole
   card, so Save never sits below the window. */
.hg-tooltip-pinned.hg-tip-capped { display: flex; flex-direction: column; overflow-y: auto; }
.hg-tooltip-pinned.hg-tip-capped > * { min-height: 0; }
/* The pinned row card edits live data (crew names): it stops pointer events
   and its spawned menus are dismissed as part of it. */
.hg-tooltip.hg-tip-interactive { pointer-events: auto; max-width: 320px; }
.hg-tip-interactive .hg-tip-field dd,
.assignment-chooser .hg-tip-field dd {
  display: flex; align-items: center; gap: 5px; min-width: 0;
}
/* Menu tap control: one pressable value inside a menu panel. The segment RMB
   policy pairs and the bar's weekend toggles are its users, so it is defined
   once here — a pressed button is the stored truth, not a hover state. */
.hg-menu-tap {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--hg-border-control); border-radius: 4px;
  background: var(--hg-input-bg); color: var(--hg-input-ink);
  font: 600 11px/1.2 "Inter", sans-serif; padding: 3px 8px; cursor: pointer;
  max-width: 190px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.hg-menu-tap:not(:disabled):hover { border-color: var(--hg-border-focus); }
.hg-menu-tap.pressed {
  background: var(--hg-accent); border-color: var(--hg-accent); color: var(--hg-text-on-accent);
}
/* Dark twin, adjacent so the pair can never drift (rule 45): dark accent is
   gold — white text on it fails contrast; pressed controls flip to the dark
   ink, exactly like block-btn.on / tier-btn.on. */
html.dark .hg-menu-tap.pressed { color: var(--gbar-rev-ink); }
/* A run of tap controls on one menu row (the weekend dates): wrap, never
   overflow the panel. */
.hg-menu-toggles { display: flex; flex-wrap: wrap; gap: 4px; }
/* Segment RMB policy toggles: the two-button pair itself. */
.hg-menu-seg-policy .hg-seg-toggle {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px 6px;
}
.hg-menu-seg-policy .hg-seg-toggle .hg-menu-tap {
  display: flex; justify-content: center; max-width: none;
}
.hg-menu-seg-policy .hg-seg-toggle .hg-menu-tap:disabled { opacity: .45; cursor: default; }
/* Row card (task label popup): each bar row's dd is [status text]
   [crew names][days]. Names paint people-violet (rule 39) and underline on
   hover when clickable; done bars keep violet names without the pointer.
   Unstaffed is placeholder text, never a control. Days stay read text,
   pushed to the right edge. The Breakdown split-stage menu shows the SAME
   bar rows, so both hosts carry one crew-read vocabulary. */
.hg-tip-interactive .hg-tip-field dd .rowcard-status,
.assignment-chooser .hg-tip-field dd .rowcard-status { white-space: nowrap; }
.hg-tip-interactive .hg-tip-field dd .rowcard-crew-name,
.assignment-chooser .hg-tip-field dd .rowcard-crew-name { color: var(--hg-people); }
.hg-tip-interactive .hg-tip-field dd .rowcard-crew-name[data-assignment],
.assignment-chooser .hg-tip-field dd .rowcard-crew-name[data-assignment] { cursor: pointer; }
.hg-tip-interactive .hg-tip-field dd .rowcard-crew-name[data-assignment]:hover,
.assignment-chooser .hg-tip-field dd .rowcard-crew-name[data-assignment]:hover { text-decoration: underline; text-underline-offset: 2px; }
.hg-tip-interactive .hg-tip-field dd .rowcard-unstaffed,
.assignment-chooser .hg-tip-field dd .rowcard-unstaffed { color: var(--hg-text-muted); cursor: pointer; }
.hg-tip-interactive .hg-tip-field dd .rowcard-unstaffed:hover,
.assignment-chooser .hg-tip-field dd .rowcard-unstaffed:hover { text-decoration: underline; text-underline-offset: 2px; }
.hg-tip-interactive .hg-tip-field dd .rowcard-days,
.assignment-chooser .hg-tip-field dd .rowcard-days {
  color: var(--hg-text-muted); font: 500 11px/1.2 "Inter", sans-serif;
  white-space: nowrap; margin-left: auto; flex-shrink: 0;
}
.hg-menu-item.st-cmpt { color: var(--st-cmpt-ink); }
.hg-menu-item.st-appr { color: var(--st-appr-ink); }
/* A destructive menu row (Clear assignment, remove) reads in the danger ink
   at every nesting level; the status class above is the same red family. */
.hg-menu-item.st-reopen, .hg-menu-item.danger { color: var(--hg-danger-hover); }

/* Split-stage bar menu (Breakdown): one .assignment-choice per bar, and the
   row inside is the Gantt row card's own hg-tip-row. This block states layout
   only; .hg-menu paints the surface and .hg-tip-row owns the columns. */
.assignment-chooser { min-width: 360px; max-width: min(520px, calc(100vw - 16px)); }
.assignment-choice { padding: 7px 8px; border-bottom: 1px solid var(--hg-border-row); }
.assignment-choice:last-child { border-bottom: 0; }
.assignment-choice .hg-tip-row { grid-template-columns: 58px minmax(0, 1fr); gap: 8px; }

/* Preset picker menu — rows with name + ✕ delete */
.hg-menu-presets .hg-preset-row {
  display: flex; align-items: center; gap: 2px;
  border-radius: 3px; padding: 0;
}
.hg-menu-presets .hg-preset-name {
  flex: 1; border: 0; background: transparent; text-align: left;
  padding: 5px 8px; color: var(--hg-text-ink);
  font: 500 11.5px/1.2 "Inter", sans-serif; cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  border-radius: 3px;
}
.hg-menu-presets .hg-preset-name:hover { background: color-mix(in srgb, var(--seg-accent) 25%, var(--hg-surface-header)); }
.hg-menu-presets .hg-preset-del {
  border: 0; background: transparent; cursor: pointer;
  color: var(--hg-text-ink); font-size: var(--hg-type-base); padding: 2px 6px;
  border-radius: 3px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
}
.hg-menu-presets .hg-preset-del:hover { background: var(--hg-surface-raised); }
/* "new preset…" separator in save-preset menu */
.hg-menu-presets .hg-preset-newopt {
  border-top: 1px solid var(--hg-border-control); margin-top: 2px; padding-top: 7px;
  color: var(--hg-text-muted);
}
.hg-menu-presets .hg-preset-newopt:hover { color: var(--hg-text-ink); }
html.dark .hg-select, html.dark .hg-multi-select {
  border-bottom-color: var(--hg-border-control); color: var(--hg-text-bright);
}
html.dark .hg-select.accent { color: var(--hg-accent); }
html.dark .hg-select:hover, html.dark .hg-multi-select:hover { border-bottom-color: #6f7076; }
html.dark .hg-select.un, html.dark .hg-multi-select.un { color: var(--hg-text-muted); }
html.dark .hg-select.st-ip, html.dark .hg-multi-select.st-ip { background-color: var(--st-ip-bg); color: var(--st-ip-ink); }
html.dark .hg-select.st-wtg, html.dark .hg-multi-select.st-wtg { background-color: var(--hg-surface-hover); color: #b4b5bb; }
html.dark .hg-select.st-rev, html.dark .hg-multi-select.st-rev { background-color: var(--st-rev-bg); color: var(--st-rev-ink); }
html.dark .hg-select.st-cmpt, html.dark .hg-multi-select.st-cmpt,
html.dark .hg-select.st-appr, html.dark .hg-multi-select.st-appr { background-color: var(--st-appr-bg); color: var(--st-appr-ink); }
html.dark .hg-select.st-reopen, html.dark .hg-multi-select.st-reopen { background-color: var(--st-reopen-bg); color: var(--st-reopen-ink); }
html.dark .hg-menu { background: var(--hg-surface-tabs); box-shadow: var(--hg-shadow-menu); }
html.dark .hg-menu-head { background: var(--hg-surface-header); border-bottom-color: var(--hg-border-row); }
html.dark .hg-menu-title { color: var(--hg-text-bright); }
html.dark .hg-menu-item { color: #c2c3c8; }
html.dark .hg-menu-new { color: var(--hg-text-muted); }
html.dark .hg-menu-new:hover { color: var(--hg-text-bright); }
html.dark .hg-menu-multi .hg-menu-item::before {
  border-color: var(--hg-border-hover); background: var(--hg-surface-raised);
}
html.dark .hg-menu-multi .hg-menu-item.checked::before {
  background-color: var(--hg-accent); border-color: var(--hg-accent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='9' height='7' viewBox='0 0 9 7'%3E%3Cpath d='M1 3.5l2.5 2.5L8 1' fill='none' stroke='%23515255' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: center; background-size: 9px 7px;
}
html.dark .hg-menu-item.st-ip { color: var(--st-ip-ink); }
html.dark .hg-menu-item.st-wtg { color: #b4b5bb; }
html.dark .hg-menu-item.st-rev { color: var(--st-rev-ink); }
html.dark .hg-menu-item.st-cmpt { color: var(--st-cmpt-ink); }
html.dark .hg-menu-item.st-appr { color: var(--st-appr-ink); }
html.dark .hg-menu-item.st-reopen, html.dark .hg-menu-item.danger { color: var(--st-reopen-ink); }

/* dark: preset picker rows */
html.dark .hg-menu-presets .hg-preset-name { color: #c2c3c8; }
html.dark .hg-menu-presets .hg-preset-name:hover { background: #26272b; }
html.dark .hg-menu-presets .hg-preset-del { color: var(--hg-text-bright); }

/* Tag multiselect menu on hg-entity-block cards — reuses .hg-menu-presets row chrome */
.hg-tag-toggle::before { content: ""; display: inline-block; width: 10px; color: var(--hg-text-muted); }
.hg-tag-toggle.on::before { content: "✓"; color: var(--hg-text-ink); }
/* Tag actions inherit the shared, always-visible monochrome menu control. */
.hg-tag-empty { padding: 7px 10px; font-size: var(--hg-type-11); color: var(--hg-text-muted); }
.tag-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.hg-tag-addrow { border-top: 1px solid color-mix(in srgb, var(--seg-accent) 30%, rgba(255,255,255,.3)); padding: 5px 6px; display: flex; align-items: center; gap: 6px; }
.hg-tag-addrow .hg-tag-newlabel { font-size: var(--hg-type-11h); color: var(--hg-text-muted, #8a93a3); flex-shrink: 0; user-select: none; }
.hg-tag-addrow .hg-tag-new { flex: 1; min-width: 0; box-sizing: border-box; font-size: var(--hg-type-11h); }
.hg-tag-cliprow { border-top: 1px solid color-mix(in srgb, var(--seg-accent) 30%, rgba(255,255,255,.3)); padding: 5px 6px; display: flex; gap: 6px; align-items: center; }
/* The pair wears the card's action pill (.btn-new.card-task-btn); this row
   owns layout and the inert state only. */
.hg-tag-cliprow .hg-tag-copy, .hg-tag-cliprow .hg-tag-paste { flex: 0 0 auto; }
.hg-tag-cliprow .hg-tag-paste.un { color: var(--hg-text-muted); cursor: default; }
.a-tag, .tag-pill, .t-tag { font-size: var(--hg-type-small); border: 1px solid color-mix(in srgb, var(--seg-accent) 45%, rgba(255,255,255,.3)); border-radius: 4px; padding: 1px 4px; background: color-mix(in srgb, var(--seg-accent) 20%, transparent); color: var(--hg-text-ink); cursor: pointer; outline: none; white-space: nowrap; }
.a-tag:hover, .tag-pill:hover, .t-tag:hover { border-color: color-mix(in srgb, var(--seg-accent) 65%, rgba(255,255,255,.3)); background: color-mix(in srgb, var(--seg-accent) 30%, transparent); }
.a-tag.un, .tag-pill.un, .t-tag.un { color: var(--hg-text-muted); background: color-mix(in srgb, var(--seg-accent) 10%, transparent); }
html.dark .a-tag, html.dark .tag-pill, html.dark .t-tag { background: var(--hg-surface-raised); border-color: var(--hg-border-control); color: #8a8b90; }
html.dark .a-tag:hover, html.dark .tag-pill:hover, html.dark .t-tag:hover { border-color: var(--hg-border-hover); }
html.dark .a-tag.un, html.dark .tag-pill.un, html.dark .t-tag.un { color: #55565c; background: color-mix(in srgb, var(--seg-accent) 10%, transparent); }
/* Tag colour palette — one class per slot, saturated so tags stand out from
   the washed hg-stage tints. The slot is laid out over the project's tag
   surfaces in dom.js (tagSlot): one name keeps one colour, and tags shown on
   the same surface never share one. Dark mode gets its own deep set. */
.a-tag.tag-0, .tag-pill.tag-0, .t-tag.tag-0 { background:#d3dbbd; border-color:#becb9a; color:#3c4620; }
.a-tag.tag-1, .tag-pill.tag-1, .t-tag.tag-1 { background:#e8b0e8; border-color:#e184e1; color:#531353; }
.a-tag.tag-2, .tag-pill.tag-2, .t-tag.tag-2 { background:#b0e8b0; border-color:#84e184; color:#135313; }
.a-tag.tag-3, .tag-pill.tag-3, .t-tag.tag-3 { background:#ccd2ea; border-color:#8f9dd6; color:#18234e; }
.a-tag.tag-4, .tag-pill.tag-4, .t-tag.tag-4 { background:#b0e8e8; border-color:#84e1e1; color:#135353; }
.a-tag.tag-5, .tag-pill.tag-5, .t-tag.tag-5 { background:#e8b0b0; border-color:#e18484; color:#531313; }
.a-tag.tag-6, .tag-pill.tag-6, .t-tag.tag-6 { background:#b0b0e8; border-color:#8484e1; color:#131353; }
.a-tag.tag-7, .tag-pill.tag-7, .t-tag.tag-7 { background:#ecebe9; border-color:#b9b5ac; color:#38352e; }
.a-tag.tag-8, .tag-pill.tag-8, .t-tag.tag-8 { background:#efc8dd; border-color:#e184b6; color:#531335; }
.a-tag.tag-9, .tag-pill.tag-9, .t-tag.tag-9 { background:#e8e8b0; border-color:#e1e184; color:#535313; }
.a-tag.tag-10, .tag-pill.tag-10, .t-tag.tag-10 { background:#d5bfe8; border-color:#b58bda; color:#351551; }
.a-tag.tag-11, .tag-pill.tag-11, .t-tag.tag-11 { background:#e4c7b4; border-color:#daaa8b; color:#512d15; }
.a-tag.tag-12, .tag-pill.tag-12, .t-tag.tag-12 { background:#bdd5db; border-color:#9ac1cb; color:#203e46; }
.a-tag.tag-13, .tag-pill.tag-13, .t-tag.tag-13 { background:#e8b0d2; border-color:#e184bc; color:#53133a; }
.a-tag.tag-14, .tag-pill.tag-14, .t-tag.tag-14 { background:#b4e4c7; border-color:#8bdaaa; color:#15512d; }
.a-tag.tag-15, .tag-pill.tag-15, .t-tag.tag-15 { background:#b0bfe8; border-color:#849de1; color:#132453; }
html.dark .a-tag.tag-0, html.dark .tag-pill.tag-0, html.dark .t-tag.tag-0 { background:#d9a13b; border-color:#a87b27; color:#1c1202; }
html.dark .a-tag.tag-1, html.dark .tag-pill.tag-1, html.dark .t-tag.tag-1 { background:#d15f9e; border-color:#a8477d; color:#220614; }
html.dark .a-tag.tag-2, html.dark .tag-pill.tag-2, html.dark .t-tag.tag-2 { background:#3f9d63; border-color:#2e7c4b; color:#07150c; }
html.dark .a-tag.tag-3, html.dark .tag-pill.tag-3, html.dark .t-tag.tag-3 { background:#7d5fd4; border-color:#6248ad; color:#150b30; }
html.dark .a-tag.tag-4, html.dark .tag-pill.tag-4, html.dark .t-tag.tag-4 { background:#2aa3b3; border-color:#1f828f; color:#031c20; }
html.dark .a-tag.tag-5, html.dark .tag-pill.tag-5, html.dark .t-tag.tag-5 { background:#d96a47; border-color:#b05233; color:#2a0c02; }
html.dark .a-tag.tag-6, html.dark .tag-pill.tag-6, html.dark .t-tag.tag-6 { background:#4d74ad; border-color:#3a5a8a; color:#081426; }
html.dark .a-tag.tag-7, html.dark .tag-pill.tag-7, html.dark .t-tag.tag-7 { background:#70757f; border-color:#565b64; color:#101216; }
html.dark .a-tag.tag-8, html.dark .tag-pill.tag-8, html.dark .t-tag.tag-8 { background:#d14b43; border-color:#a63a33; color:#1c0503; }
html.dark .a-tag.tag-9, html.dark .tag-pill.tag-9, html.dark .t-tag.tag-9 { background:#8dab39; border-color:#718a2e; color:#161f05; }
html.dark .a-tag.tag-10, html.dark .tag-pill.tag-10, html.dark .t-tag.tag-10 { background:#5f63c6; border-color:#4b4fa1; color:#0b0d2a; }
html.dark .a-tag.tag-11, html.dark .tag-pill.tag-11, html.dark .t-tag.tag-11 { background:#b17e43; border-color:#8e6432; color:#291807; }
html.dark .a-tag.tag-12, html.dark .tag-pill.tag-12, html.dark .t-tag.tag-12 { background:#4ea8c3; border-color:#3d869c; color:#041c24; }
html.dark .a-tag.tag-13, html.dark .tag-pill.tag-13, html.dark .t-tag.tag-13 { background:#bb63b2; border-color:#964f8e; color:#280a24; }
html.dark .a-tag.tag-14, html.dark .tag-pill.tag-14, html.dark .t-tag.tag-14 { background:#489a80; border-color:#377a66; color:#051a12; }
html.dark .a-tag.tag-15, html.dark .tag-pill.tag-15, html.dark .t-tag.tag-15 { background:#717c88; border-color:#59626d; color:#0e1216; }
/* Menu row dots mirror the pill colours */
.tag-dot-0 { background:#d3dbbd; } .tag-dot-1 { background:#e8b0e8; }
.tag-dot-2 { background:#b0e8b0; } .tag-dot-3 { background:#ccd2ea; }
.tag-dot-4 { background:#b0e8e8; } .tag-dot-5 { background:#e8b0b0; }
.tag-dot-6 { background:#b0b0e8; } .tag-dot-7 { background:#ecebe9; }
.tag-dot-8 { background:#efc8dd; } .tag-dot-9 { background:#e8e8b0; }
.tag-dot-10 { background:#d5bfe8; } .tag-dot-11 { background:#e4c7b4; }
.tag-dot-12 { background:#bdd5db; } .tag-dot-13 { background:#e8b0d2; }
.tag-dot-14 { background:#b4e4c7; } .tag-dot-15 { background:#b0bfe8; }
html.dark .tag-dot-0 { background:#d9a13b; } html.dark .tag-dot-1 { background:#d15f9e; }
html.dark .tag-dot-2 { background:#3f9d63; } html.dark .tag-dot-3 { background:#7d5fd4; }
html.dark .tag-dot-4 { background:#2aa3b3; } html.dark .tag-dot-5 { background:#d96a47; }
html.dark .tag-dot-6 { background:#4d74ad; } html.dark .tag-dot-7 { background:#70757f; }
html.dark .tag-dot-8 { background:#d14b43; } html.dark .tag-dot-9 { background:#8dab39; }
html.dark .tag-dot-10 { background:#5f63c6; } html.dark .tag-dot-11 { background:#b17e43; }
html.dark .tag-dot-12 { background:#4ea8c3; } html.dark .tag-dot-13 { background:#bb63b2; }
html.dark .tag-dot-14 { background:#489a80; } html.dark .tag-dot-15 { background:#717c88; }
/* Stage tags carry the SAME palette as deliverable tags: a tag's colour is the
   tag's name, so one name must paint one colour whichever strip it sits in. */


html.dark .hg-tag-toggle::before { color: #55565c; }
html.dark .hg-tag-toggle.on::before { color: var(--hg-text-bright); }

html.dark .hg-tag-addrow { border-top-color: var(--hg-border-chrome); }
html.dark .hg-tag-cliprow { border-top-color: var(--hg-border-chrome); }
html.dark .hg-tag-cliprow .hg-tag-paste.un { color: #55565c; }
html.dark .hg-menu-presets .hg-preset-del:hover { color: var(--st-reopen-ink); }
html.dark .hg-menu-presets .hg-preset-newopt {
  border-top-color: var(--hg-border-control); color: #6f7076;
}
html.dark .hg-menu-presets .hg-preset-newopt:hover { color: var(--hg-text-bright); }

/* ===== date picker (hgDate) =====
   Matches the hgSelect popover language: monochromatic, hairline, flat.
   The trigger is a button (`.hg-date`) showing the ISO date or a placeholder;
   the popover is a small calendar grid anchored below it. */
.hg-date {
  -webkit-appearance: none; -moz-appearance: none; appearance: none;
  display: inline-flex; align-items: center; gap: 6px;
  background-color: transparent; background-image: none;
  border: 1px solid var(--hg-border-control); border-radius: 4px;
  padding: 3px 8px; font: inherit; font-size: var(--hg-type-11h);
  color: var(--hg-text-ink); cursor: pointer; white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.hg-date:not(.un) { font-weight: 500; }
.hg-date:hover { border-color: var(--hg-border-focus); }
.hg-date:focus-visible { outline: none; border-color: var(--hg-accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--hg-accent) 20%, transparent); }
.hg-date.un { color: var(--hg-text-muted); font-weight: 400; }
/* in table rows / tight cells */
.cs-win-cell .hg-date, .fp-ms-date.hg-date {
  font-size: var(--hg-type-11); padding: 2px 6px;
}

.hg-cal {
  position: fixed; z-index: 210; width: 202px;
  background: var(--hg-surface-tabs); border: 1px solid var(--hg-hairline); border-radius: 4px;
  box-shadow: var(--hg-shadow-menu); padding: 6px;
  user-select: none; overflow: hidden;
}
.hg-cal-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 4px; margin-bottom: 4px;
}
.hg-cal-title {
  font: 600 11.5px "Inter", sans-serif; color: var(--hg-text-ink); text-align: center; flex: 1;
}
.hg-cal-nav {
  width: 22px; height: 20px; flex-shrink: 0;
  border: 1px solid var(--hg-border-control); border-radius: 3px;
  background: var(--hg-surface-tabs); color: var(--hg-text-ink); font: 500 13px/1 "Inter", sans-serif;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
}
.hg-cal-nav:hover { background: #f0f0f0; border-color: var(--hg-border-focus); }
.hg-cal-dow {
  display: grid; grid-template-columns: repeat(7, 1fr);
  margin-bottom: 2px;
}
.hg-cal-dow span {
  font: 500 9px "Inter", sans-serif; color: var(--hg-text-muted); text-align: center;
  text-transform: uppercase; letter-spacing: .02em; padding: 2px 0;
}
.hg-cal-row { display: grid; grid-template-columns: repeat(7, 1fr); }
.hg-cal-d {
  display: inline-flex; align-items: center; justify-content: center;
  width: 100%; height: 22px; border: 0; border-radius: 3px;
  background: transparent; color: var(--hg-text-ink);
  font: 500 10.5px/1 "Inter", sans-serif; cursor: pointer; padding: 0;
}
.hg-cal-d:hover { background: #eef0f2; }
.hg-cal-d.today { box-shadow: inset 0 0 0 1px var(--hg-border-focus); }
.hg-cal-d.sel { background: var(--hg-accent); color: var(--hg-text-on-accent); }
.hg-cal-d.sel:hover { background: var(--hg-accent); }
.hg-cal-clear {
  display: block; width: 100%; margin-top: 6px; padding: 4px 0;
  border: 1px solid var(--hg-border-control); border-radius: 3px;
  background: var(--hg-surface-tabs); color: var(--hg-text-secondary); font: 500 11px "Inter", sans-serif;
  cursor: pointer; text-align: center;
}
.hg-cal-clear:hover { background: #f0f0f0; border-color: var(--hg-border-focus); color: var(--hg-text-ink); }
html.dark .hg-date {
  border-color: var(--hg-border-control); color: var(--hg-text-bright);
}
html.dark .hg-date:not(.un) { color: var(--hg-text-bright); }
html.dark .hg-date:hover { border-color: #6f7076; }
html.dark .hg-date:focus-visible { border-color: #8fa9c4; box-shadow: 0 0 0 2px #8fa9c433; }
html.dark .hg-date.un { color: var(--hg-text-muted); }
html.dark .hg-cal {
  background: var(--hg-surface-tabs); border-color: var(--hg-border-control); box-shadow: var(--hg-shadow-menu);
}
html.dark .hg-cal-title { color: #c2c3c8; }
html.dark .hg-cal-nav { border-color: var(--hg-border-control); color: #c2c3c8; background: var(--hg-surface-tabs); }
html.dark .hg-cal-nav:hover { background: #26272b; border-color: #6f7076; }
html.dark .hg-cal-dow span { color: var(--hg-text-muted); }
html.dark .hg-cal-d { color: #c2c3c8; }
html.dark .hg-cal-d:hover { background: #26272b; }
html.dark .hg-cal-clear { border-color: var(--hg-border-control); background: var(--hg-surface-tabs); color: var(--hg-border-focus); }
html.dark .hg-cal-clear:hover { background: #26272b; border-color: #6f7076; color: var(--hg-text-bright); }
html.dark .hg-cal-d.today { box-shadow: inset 0 0 0 1px #6f7076; }
html.dark .hg-cal-d.sel { background: #e4e4e7; color: var(--hg-text-ink); }
html.dark .hg-cal-d.sel:hover { background: #e4e4e7; }
/* A calendar opened from a lane surface is a popup on the same ramp: the head
   is the lane, the sheet the deliverable step, the controls the field fill.
   It follows the calendar base so the lane wins without a specificity fight. */
.hg-cal[data-seg] { background: var(--hg-pop-entity); }
.hg-cal[data-seg] .hg-cal-head {
  background: var(--hg-pop-lane); border-radius: 4px; padding: 2px 4px;
}
.hg-cal[data-seg] .hg-cal-nav,
.hg-cal[data-seg] .hg-cal-clear {
  background: var(--seg-field); border-color: var(--hg-border-control); color: var(--hg-text-ink);
}
.hg-cal[data-seg] .hg-cal-d:hover,
.hg-cal[data-seg] .hg-cal-nav:hover,
.hg-cal[data-seg] .hg-cal-clear:hover { background: var(--seg-field); color: var(--hg-text-ink); }
html.dark .hg-cal[data-seg] { background: var(--hg-pop-entity); }
html.dark .hg-cal[data-seg] .hg-cal-d,
html.dark .hg-cal[data-seg] .hg-cal-title { color: var(--hg-text-bright); }
html.dark .hg-cal[data-seg] .hg-cal-nav,
html.dark .hg-cal[data-seg] .hg-cal-clear { background: var(--seg-field); color: var(--hg-text-bright); }
html.dark .hg-cal[data-seg] .hg-cal-d:hover,
html.dark .hg-cal[data-seg] .hg-cal-nav:hover,
html.dark .hg-cal[data-seg] .hg-cal-clear:hover { background: var(--seg-field); color: var(--hg-text-bright); }

/* ── Danger zone (project settings footer) ──────────────────────── */
/* Separated from the Save/Duplicate row on purpose: deleting the project
   is not an edit, it discards other people's work. It should never sit next to
   an everyday button. */
.danger-zone {
  margin-top: 14px; padding-top: 12px; border-top: 1px dashed #e0b4ae;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.dz-lab {
  font-size: var(--hg-type-10); font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--hg-danger-ink);
}
.dz-btn {
  background: var(--hg-surface-input); color: var(--hg-danger-ink); border: 1px solid #e0b4ae;
  border-radius: 4px; padding: 5px 10px; font-size: var(--hg-type-base); cursor: pointer;
}
/* ===== 14. UNIFIED FORM PRIMITIVES (text inputs + checkboxes) =====
   One look for every text/numeric field and every native checkbox.
   Text fields use the flat hairline treatment; checkboxes mirror the
   hgSelectMulti menu tick (11px box, SVG tick, same light/dark palette).
   Inline-editable table cells stay transparent via .tbl-inp (transparent
   border until hover/focus), but share the same focus + dark colours. */
.hg-inp, .tbl-inp {
  -webkit-appearance: none; appearance: none;
  border: none; border-bottom: 1px solid var(--hg-border-control); border-radius: 0;
  background-color: transparent; background-image: none;
  padding: 3px 2px; font: inherit; font-size: var(--hg-type-11h);
  color: var(--hg-input-ink); outline: none;
}
.hg-inp[type="number"] { -moz-appearance: textfield; }
.hg-inp::-webkit-outer-spin-button, .hg-inp::-webkit-inner-spin-button,
.tbl-inp::-webkit-outer-spin-button, .tbl-inp::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.tbl-inp { border-bottom-color: transparent; width: 100%; box-sizing: border-box; font-size: var(--hg-type-base); }
.tbl-inp:hover { border-bottom-color: var(--hg-border-control); }
.hg-inp:focus { border-bottom-color: var(--hg-accent); }
.tbl-inp:focus { border-bottom-color: var(--hg-accent); }
.hg-inp::placeholder, .tbl-inp::placeholder, input::placeholder, textarea::placeholder { color: var(--hg-text-muted); opacity: 1; }
.hg-inp:disabled, .tbl-inp:disabled { opacity: .5; cursor: default; }
html.dark .hg-inp, html.dark .tbl-inp { border-bottom-color: var(--hg-border-control); color: var(--hg-input-ink); }
html.dark .tbl-inp { border-bottom-color: transparent; }
html.dark .tbl-inp:hover { border-bottom-color: var(--hg-border-control); }
html.dark .hg-inp:focus { border-bottom-color: var(--hg-border-focus); }
html.dark .tbl-inp:focus { border-bottom-color: var(--hg-border-focus); }
html.dark input::placeholder, html.dark textarea::placeholder { color: var(--hg-text-muted); opacity: 1; }

/* native checkbox restyle — mirrors .hg-menu-multi .hg-menu-item[.checked]::before */
input[type="checkbox"] {
  -webkit-appearance: none; appearance: none;
  width: 12px; height: 12px; flex-shrink: 0; margin: 0; padding: 0;
  border: 1px solid var(--hg-border-menu-chk); border-radius: 3px; background-color: var(--hg-surface-input);
  cursor: pointer; position: relative; vertical-align: -1px;
}
input[type="checkbox"]:hover { border-color: var(--hg-border-focus); }
input[type="checkbox"]:checked {
  background-color: var(--hg-accent); border-color: var(--hg-accent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='9' height='7' viewBox='0 0 9 7'%3E%3Cpath d='M1 3.5l2.5 2.5L8 1' fill='none' stroke='%23fff' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: center; background-size: 9px 7px;
}
input[type="checkbox"]:focus-visible { outline: 1px solid var(--hg-accent); outline-offset: 1px; }
input[type="checkbox"]:disabled { opacity: .45; cursor: default; }
html.dark input[type="checkbox"] { border-color: var(--hg-border-hover); background-color: var(--hg-surface-raised); }
html.dark input[type="checkbox"]:hover { border-color: var(--hg-text-muted); }
html.dark input[type="checkbox"]:checked {
  background-color: var(--hg-accent); border-color: var(--hg-accent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='9' height='7' viewBox='0 0 9 7'%3E%3Cpath d='M1 3.5l2.5 2.5L8 1' fill='none' stroke='%23515255' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: center; background-size: 9px 7px;
}
html.dark input[type="checkbox"]:focus-visible { outline-color: var(--hg-border-focus); }

/* A checkbox that sits ON a coloured substrate (a lane row, a tinted card) keeps
   the shared box and glyph, with the face left open so the row's own wash shows
   through instead of a white chip pasted on it. The border takes the lane's
   accent. Checked states the accent fill as everywhere else, so the two rules
   below restate the base checked face at higher specificity. */
input[type="checkbox"].hg-check-substrate {
  background-color: transparent;
  border-color: color-mix(in srgb, var(--seg-accent, var(--hg-accent)) 55%, var(--hg-border-control));
}
input[type="checkbox"].hg-check-substrate:hover {
  border-color: color-mix(in srgb, var(--seg-accent, var(--hg-accent)) 80%, var(--hg-border-focus));
}
input[type="checkbox"].hg-check-substrate:checked {
  background-color: var(--hg-accent); border-color: var(--hg-accent);
}
html.dark input[type="checkbox"].hg-check-substrate {
  background-color: transparent;
  border-color: color-mix(in srgb, var(--seg-accent, var(--hg-accent)) 60%, var(--hg-border-hover));
}
html.dark input[type="checkbox"].hg-check-substrate:checked {
  background-color: var(--hg-accent); border-color: var(--hg-accent);
}

/* The label row that carries a checkbox: box paint stays the shared checkbox
   rule above; this is the one label treatment (gap, sentence case, size).
   Per-surface placement (a right edge in a head row) is a variant, not a
   second control. */
.hg-check {
  display: inline-flex; align-items: center; gap: 6px;
  white-space: nowrap; font-size: var(--hg-type-11); font-weight: 400;
  text-transform: none; letter-spacing: 0;
  color: var(--hg-text-muted); cursor: pointer;
}

/* boxed finance fields get the dark treatment via .hg-ctl's token vocabulary */
.a-name-input::placeholder { color: var(--hg-text-muted); }

.dz-btn:hover { background: #fdecea; border-color: var(--hg-danger); }
.dz-note { font-size: var(--hg-type-11); color: var(--hg-text-label); flex: 1 1 100%; }
html.dark .danger-zone { border-top-color: #6b3b34; }
html.dark .dz-btn { background: #1f2026; color: #e8736a; border-color: #6b3b34; }

/* ===== BOOK OVERVIEW TAB (v-ov) =====
   Realized-money dashboard. Shares the Accounting/Cashflow vocabulary;
   new surfaces only restate box shape. */

/* The host owns the top section's gutters (founder 2026-10-04: the lane
   refactor zeroed this padding and destroyed them). The health strip, bank
   summary and realized plot are not laned surfaces — the host-padding
   form is the law for them. Everything from the forecast strip down stays
   flush with the window edge like every other view's tables: the forecast
   strip's LANE SHELL (hgLaneWrap re-parents the root into a .hg-laned
   shell — the shell is the direct child of this host, so the negation
   targets it, never the root class), and the upcoming panel negate the
   host padding on both sides. */
.ov-scroll {
  flex: 1 1 auto; min-height: 0; overflow-y: auto;
  padding: 0 var(--hg-tracker-side-padding) 24px;
  box-sizing: border-box;
}
.ov-scroll > .hg-laned, .cf-upcoming {
  margin-left: calc(var(--hg-tracker-side-padding) * -1);
  margin-right: calc(var(--hg-tracker-side-padding) * -1);
}

/* ── record health ── */
/* Healthy state renders nothing (in-app review) — only the issues
   toggle and its list exist here. */
.ov-health { margin: 0 0 14px; }
/* The healthy book renders no strip, so the empty block must not hold its gap
   either: the sheet then starts flush under the head row, on the same edge the
   Recruitment sheet sits on under its filter row. */
.ov-health:empty { display: none; }
.ov-health-toggle {
  font-size: var(--hg-type-11); color: var(--hg-warn-ink, #8a6d1a);
  background: none; border: none; padding: 4px 0; cursor: pointer;
  text-decoration: underline; text-underline-offset: 3px;
}
.ov-issue-list {
  margin: 4px 0 0; padding: 6px 10px; border: 1px solid var(--hg-border-row);
  border-radius: 4px; background: var(--hg-frost-bg);
  backdrop-filter: blur(var(--hg-frost-blur-soft));
  -webkit-backdrop-filter: blur(var(--hg-frost-blur-soft));
}
.ov-issue { font-size: var(--hg-type-11); color: var(--hg-text-muted); padding: 2px 0; }

/* ── unreconciled spend dock (Expenses tab) ──
   A fixed bottom dock below the register (same idiom as the crew / cashflow /
   license-heatmap docks): the register's .exp-scroll is flex:1 1 auto, so it
   absorbs all free space and pins the dock to the view's bottom. The dock's
   own .exp-scroll scrolls independently; the title bar collapses the body.
   Side insets use --hg-tracker-side-padding (lane gutter vocabulary), and the
   nested .exp-scroll is still lane-wrapped by hgLaneWrap for its gutters. */
.exp-unrec-dock {
  flex-shrink: 0; box-sizing: border-box;
  display: flex; flex-direction: column;
  border-top: 2px solid var(--hg-warn-ink, #8a6d1a);
  background: var(--hg-frost-bg);
  backdrop-filter: blur(var(--hg-frost-blur-soft)); -webkit-backdrop-filter: blur(var(--hg-frost-blur-soft));
  margin: 0;
  overflow: hidden;
  /* Own layer: row hover washes repaint without re-rasterising the frost
     below it (same law as the cashflow dock). */
  contain: layout style;
  will-change: transform;
}
.exp-unrec-dock .eu-titlebar {
  flex-shrink: 0; height: 28px; box-sizing: border-box;
  display: flex; align-items: center; gap: 8px;
  padding: 0 12px;
  background: var(--hg-frost-head);
  backdrop-filter: blur(var(--hg-frost-blur)); -webkit-backdrop-filter: blur(var(--hg-frost-blur));
  border-bottom: 1px solid var(--hg-hairline);
  cursor: pointer; user-select: none;
  color: var(--hg-warn-ink, #8a6d1a); font-size: var(--hg-type-11); font-weight: 600;
  letter-spacing: .03em;
  contain: layout style;
  will-change: transform;
}
.exp-unrec-dock .eu-titlebar:hover {
  background: color-mix(in srgb, var(--hg-warn-ink, #8a6d1a) 10%, transparent);
}
.exp-unrec-dock .eu-titlebar:focus-visible {
  outline: 2px solid var(--hg-warn-ink, #8a6d1a); outline-offset: -2px;
}
.exp-unrec-dock .eu-caret {
  display: inline-block; font-size: var(--hg-type-10);
  line-height: 1; color: var(--hg-warn-ink, #8a6d1a);
  transition: transform .22s ease;
}
.exp-unrec-dock.is-collapsed .eu-caret { transform: rotate(-90deg); }
.exp-unrec-dock .eu-titlebar-label { font-weight: 600; }
/* The body clips and animates its max-height; the max-height ALSO lives on the
   nested .exp-scroll so hgLaneWrap copies it onto the lane shell — that shell
   cap is what makes the locked cell scroll its own overflow instead of the
   body clipping the table. */
.exp-unrec-dock .eu-body {
  max-height: var(--eu-body-h, 260px);
  overflow: hidden;
  transition: max-height .22s ease;
}
.exp-unrec-dock .exp-scroll { max-height: var(--eu-body-h, 260px); }
/* The unreconciled table spans the dock's full width (three columns stretch
   across), unlike the register above which stays content-fit and centred. */
#v-ex .exp-unrec-dock .exp-scroll table.track { width: 100%; margin: 0; }
.exp-unrec-dock.is-collapsed .eu-body { max-height: 0; }

/* dark mode */
html.dark .exp-unrec-dock {
  background: var(--hg-frost-bg);
  border-top-color: #8a5a20;
}
html.dark .exp-unrec-dock .eu-titlebar {
  background: var(--hg-frost-head);
  border-bottom-color: #3a2e2a; color: #c8a878;
}
html.dark .exp-unrec-dock .eu-titlebar:hover {
  background: color-mix(in srgb, #e4e4e7 10%, transparent);
}
html.dark .exp-unrec-dock .eu-caret { color: #c8a878; }

/* ── bank-side dock (second stacking dock, same family) ── */
/* Inside the docks the lane chrome keeps its SIDE gutters but the
   bottom band is dead space — the dock's own 2px border is the bottom
   edge (founder: gutters only apply to the sides). The vertical
   floating bar therefore spans the full height with no bottom
   inset. */
.exp-unrec-dock .hg-lane-b { display: none; }
.exp-unrec-dock .hg-bar-v { bottom: 0; }
/* Gantt-dock law: an expandable body's height lives on a CSS custom
   property set at the dock root, never a per-surface max-height
   override — an ID-weighted override would outrank the class-based
   .is-collapsed rule and the dock could never shelve. Stacking is
   flush like the gantt docks: no dock margins, the family's 2px
   border-top separates each dock, bodies carry no padding — tables
   sit flush full width; only text (block titles, notes) keeps the
   titlebar's 12px side inset. */
.exp-unrec-dock { --eu-body-h: 260px; }
#expBankDock { --eu-body-h: 320px; }
.eb-block { padding: 0; }
.eb-block + .eb-block { border-top: 1px solid var(--hg-hairline); }
.eb-block-title {
  font-size: var(--hg-type-11); font-weight: 600;
  color: var(--hg-text-secondary);
  padding: 8px 12px 2px; letter-spacing: .02em;
}
.eb-block table.track { width: 100%; margin: 0; }
.eb-note {
  font-size: var(--hg-type-11); color: var(--hg-text-muted);
  padding: 4px 12px 8px;
}
.stg-xero-actions { display: flex; gap: 8px; padding: 8px 0 0; }
/* The bank summary table sits in the realized cash strip. That strip owns
   the shared horizontal lane; this wrapper does not add a second scroller. */
.ov-bank-summary { margin: 0; }
.ov-bank-invite {
  flex: 1 1 100%;
  display: flex; align-items: center; gap: 10px;
  font-size: var(--hg-type-11); color: var(--hg-text-muted);
  padding: 4px 2px 10px;
}
.ov-bs-empty { color: var(--hg-text-muted); }
html.dark .eb-block + .eb-block { border-top-color: #3a2e2a; }

/* ── unreconciled spend panel ── */
.ov-unrec {
  border: 1px solid var(--hg-border-row); border-radius: 6px;
  background: var(--hg-frost-bg); padding: 8px 12px 10px;
  margin: 0 0 14px;
  backdrop-filter: blur(var(--hg-frost-blur-soft));
  -webkit-backdrop-filter: blur(var(--hg-frost-blur-soft));
}
.ov-unrec-count {
  font-size: var(--hg-type-11); font-weight: 600; color: var(--hg-warn-ink, #8a6d1a);
  padding: 2px 0 4px;
}
html.dark .ov-unrec { border-color: var(--hg-border-chrome); }

/* ── cashflow forecast strip (beneath the realized record) ──
   The title row is a real header row inside the line-item table so the
   whole forecast reads as one surface — mirrors the realized plot's
   titlebar (label + meta + controls) sitting on its own content. */
table.track .cf-forecast-title-row th {
  text-transform: none; letter-spacing: 0; font-weight: 600;
  font-size: var(--hg-type-11); color: #26415e;
  padding: 0;
  background: var(--hg-frost-head);
  border-bottom: 1px solid var(--hg-hairline);
}
/* Forecast month headers wear the provisional stripe — the same 45deg
   vocabulary as draft gantt bars and the absence hatch — so the projected
   region reads apart from realized history. background-image only: the
   frost head color still comes from the shared th rule above. */
.ov-scroll .cf-forecast-scroll table.track th.num.cf-future,
.ov-scroll .cf-forecast-scroll table.track th.cf-header-tail.cf-future {
  background-image: repeating-linear-gradient(45deg,
    transparent 0 5px,
    color-mix(in srgb, var(--gbar-draft-stripe) 30%, transparent) 5px 11px);
}
html.dark .ov-scroll .cf-forecast-scroll table.track th.num.cf-future,
html.dark .ov-scroll .cf-forecast-scroll table.track th.cf-header-tail.cf-future {
  background-image: repeating-linear-gradient(45deg,
    transparent 0 5px,
    color-mix(in srgb, var(--gbar-draft-stripe) 50%, transparent) 5px 11px);
}
/* Month columns carry the hairline on every month cell, including the
   first — so the label column gets its right-side line too. Light warm,
   dark cell, matching the Bank Summary's grid. */
.ov-scroll .cf-forecast-scroll table.track .num {
  border-left: 1px solid var(--hg-hairline);
}
html.dark .ov-scroll .cf-forecast-scroll table.track .num {
  border-left-color: var(--hg-border-cell);
}
/* The Bank Summary joins the same hairline family: warm horizontals and
   month verticals in light, the cell token in dark. */
.ov-bank-summary table.track td {
  border-bottom-color: var(--hg-hairline);
}
html.dark .ov-bank-summary table.track td {
  border-bottom-color: var(--hg-border-cell);
}
.ov-bank-summary table.track .num {
  border-left: 1px solid var(--hg-hairline);
}
html.dark .ov-bank-summary table.track .num {
  border-left-color: var(--hg-border-cell);
}
/* Every horizontal row hairline in the forecast table joins the same
   family — this out-ranks the generic table.track td grid rule, whose
   --hg-border-cell paints ordinary rows and (via the same cascade win)
   the section heads. */
.ov-scroll .cf-forecast-scroll table.track td {
  border-bottom-color: var(--hg-hairline);
}
html.dark .ov-scroll .cf-forecast-scroll table.track td {
  border-bottom-color: var(--hg-border-cell);
}
/* Physical sibling lanes: no part of the data scrollport is behind glass labels. */
.ov-scroll .cf-split-panel {
  display: flex; position: relative; width: 100%; min-width: 0;
  flex: 1 1 auto; overflow: hidden !important;
}
.ov-scroll .cf-split-panel > .cf-split-data {
  flex: 1 1 auto; min-width: 0; width: 0; overflow: hidden !important;
}
.cf-fixed-labels {
  position: relative; flex: 0 0 var(--cf-fixed-width); width: var(--cf-fixed-width);
  min-width: 0; overflow: hidden; display: grid; align-content: start;
  background: transparent; border: 0; margin: 0;
}
.cf-fixed-labels > .cf-fixed-table,
.cf-fixed-labels > .cf-label-pane { grid-area: 1 / 1; }
.cf-fixed-labels > table.track.cf-fixed-table {
  width: 100%; min-width: 0; table-layout: fixed;
}
.cf-split-data > .cf-split-content,
.cf-split-data .cf-split-content {
  margin-left: calc(-1 * var(--cf-fixed-width));
  min-width: calc(100% + var(--cf-fixed-width));
}
.cf-split-placeholder { visibility: hidden !important; pointer-events: none; }
.cf-split-panel > table.track.cf-fixed-chrome {
  position: absolute; left: 0; width: 100%; min-width: 0;
  z-index: 36; background: transparent; table-layout: fixed;
}
.cf-split-panel > .cf-fixed-chrome-glass,
.cf-split-panel > #ovBankTitlePane {
  position: absolute; top: 0; left: 0;
}
.cf-fixed-labels > .cf-fixed-plot {
  position: absolute; left: 0; width: 100%; margin: 0; min-width: 0;
  border-radius: 4px 0 0 4px;
}
.cf-fixed-plot > .cfp-body { height: 100%; }
/* One sticky glass pane sits above the sliding months and below the
   transparent labels. It shares the plot label's tint and blur recipe.
   The table remains the sole source of row and column geometry. */
.cf-table-surface { display: grid; width: max-content; min-width: 100%; }
/* Round the painted glass layers, not an ancestor clip. An ancestor
   clip-path changes the backdrop root and therefore the approved frost. */
.cf-table-surface,
.cf-forecast-plot.ov-plot-panel { border-radius: 4px; }
#cfTitlePane, #ovBankTitlePane { border-radius: 4px 4px 0 0; }
#cfAddPane { border-radius: 0 0 4px 4px; }
#ovBankLabelPane { border-bottom-left-radius: 4px; }
#ovBankBodyPane { border-bottom-right-radius: 4px; }
.cf-glass-pane::before { border-radius: inherit; }
.cf-forecast-plot .cfp-label { border-radius: 4px 0 0 4px; }
.cf-table-surface > table,
.cf-table-surface > .cf-glass-pane { grid-area: 1 / 1; }
/* Old glass heights must not stretch the table while a group collapses. */
.cf-table-surface > table { align-self: start; }
.cf-glass-pane {
  position: relative; z-index: 1; align-self: start; justify-self: start;
  width: 0; height: 0; pointer-events: none;
  background: var(--hg-frost-bg);
  backdrop-filter: blur(var(--hg-frost-blur-soft));
  -webkit-backdrop-filter: blur(var(--hg-frost-blur-soft));
  box-sizing: border-box;
}
.cf-label-pane {
  position: sticky; left: 0;
  border-right: 1px solid var(--hg-hairline);
}
/* Same two-layer composition as .ov-plot-panel > .cfp-label: a soft
   translucent base, then the header tint and blur over that base. */
.cf-glass-pane::before {
  content: ''; position: absolute; inset: 0;
  background: var(--hg-frost-head);
  backdrop-filter: blur(var(--hg-frost-blur));
  -webkit-backdrop-filter: blur(var(--hg-frost-blur));
}
html.dark .cf-label-pane { border-right-color: var(--hg-border-cell); }
/* Table bodies stay transparent so the body pane is the only wash. */
.ov-scroll .cf-forecast-scroll table.track tbody,
.ov-bank-summary table.track tbody { background: transparent; }
/* One soft glass surface covers each numeric body, behind the grid. */
.cf-body-pane {
  position: relative; z-index: 0; align-self: start; justify-self: start;
  width: 0; height: 0; pointer-events: none; box-sizing: border-box;
  background: var(--hg-frost-bg);
  backdrop-filter: blur(var(--hg-frost-blur-soft));
  -webkit-backdrop-filter: blur(var(--hg-frost-blur-soft));
}
.cf-table-surface > .cf-body-pane { grid-area: 1 / 1; }
/* The table body must not enclose the independent glass filters. */
.ov-scroll .cf-forecast-scroll table.track tbody,
.ov-bank-summary table.track tbody {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
/* No cell owns a backdrop filter. Hover may keep its tint, but it must
   not create another filtered rectangle over the continuous body. */
.ov-scroll .cf-forecast-scroll table.track tbody td:not(:first-child),
.ov-scroll .cf-forecast-scroll table.track tbody tr:hover td:not(:first-child),
.ov-bank-summary table.track tbody td:not(:first-child),
.ov-bank-summary table.track tbody tr:hover td:not(:first-child) {
  position: relative; z-index: 0;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
/* ID scope also beats the shared html.dark hover rule. */
#cfForecastLabels tbody tr:hover td,
#ovBankLabels tbody tr:hover td,
#cfForecastTable tbody tr:hover td,
#ovBankTable tbody tr:hover td {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
#cfForecastLabels tbody tr:hover td:first-child,
#ovBankLabels tbody tr:hover td:first-child,
#cfForecastTable tbody tr:hover td:first-child,
#ovBankTable tbody tr:hover td:first-child,
#cfForecastTable tbody tr.cv-add-row:hover td {
  background: transparent;
}
/* Label text and separators sit above the single glass pane. Explicit
   hover rules prevent the shared row highlight from adding cell blur. */
.ov-scroll .cf-forecast-scroll table.track tr:not(.cf-forecast-title-row) > th:first-child,
.ov-scroll .cf-forecast-scroll table.track tbody td:first-child,
.ov-scroll .cf-forecast-scroll table.track tbody tr:hover td:first-child {
  position: sticky; left: 0; z-index: 2;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-right: none;
}
/* The forecast seam belongs to the single sticky glass pane. Suppress
   the first month's border-left so that edge is not painted twice. */
.ov-scroll .cf-forecast-scroll table.track tr:not(.cf-forecast-title-row) > th:nth-child(2),
.ov-scroll .cf-forecast-scroll table.track tbody td:nth-child(2) {
  border-left: none;
}
/* ── the title rows and the Bank Summary join the sticky frost family ──
   The Cashflow and Bank Summary title rows (label + controls) pin with
   their label columns so the controls stay reachable while the months
   slide. A sticky element can only travel inside its containing block:
   the title th is a full-width colspan cell with almost no travel, so
   the pin belongs to the NARROW bar inside it. z 36: the bank's other
   ths are sticky-top at 34, and the title band must keep masking them
   in the vertical pass. */
/* Foreground cells do not add tint or blur over the shared glass bands.
   Keep background-image on future month headers for their draft stripes. */
.ov-scroll .cf-forecast-scroll table.track .cf-forecast-title-row th,
.ov-bank-summary table.track .cf-forecast-title-row th {
  position: relative; z-index: 36;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
/* The split chrome band is the FACE of the title glass, never a second glass.
   Both scopes above stop at the source table, and the split moves the cell out
   to the frame, so the moved cell would keep the shared title wash and paint a
   square rectangle that erases the pane's rounded top corners and doubles the
   band's tint. It owns no paint: #cfTitlePane / #ovBankTitlePane carry the one
   coat and the corners. Its bottom hairline still belongs to the cell. */
.cf-split-panel > table.track.cf-fixed-chrome > tr > th {
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.ov-scroll .cf-forecast-scroll table.track th.num,
.ov-scroll .cf-forecast-scroll table.track th.cf-header-tail,
.ov-scroll .cf-forecast-scroll table.track tr.cv-add-row > td,
.ov-scroll .cf-forecast-scroll table.track tbody tr.cv-add-row:hover > td {
  position: relative; z-index: 2;
  background-color: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  /* The add row is the sheet's last row, so the sheet ends on the add pane's
     rounded bottom edge. The base cell border sat three pixels below that pane
     and painted a line hanging in the gap between the sheet and the plot. */
  border-bottom: none;
}
/* Bank column headers use the same continuous glass as cashflow headers. */
.ov-bank-summary table.track tr:not(.cf-forecast-title-row) > th.num {
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
#ovBankHeaderPane { position: sticky; top: 0; z-index: 33; }
#ovBankLabelPane { z-index: 34; }
#ovBankTitlePane { z-index: 35; }
/* Retain the Bank Summary title's vertical pin while its glass follows. */
#ovBankTitlePane,
.ov-bank-summary table.track .cf-forecast-title-row th {
  position: sticky; top: 0;
}
table.track .cf-forecast-title-row .cf-forecast-bar {
  position: sticky; left: 0; width: fit-content;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
/* The add row's controls pin the same way: the colspan cell is nearly
   as wide as the row (no sticky travel), so the inline wrapper inside
   carries the pin. left 10 = the shared cell padding, so the pinned
   controls keep their unscrolled inset. */
.cv-add-row td .cv-add-pin {
  position: sticky; left: 10px; display: inline-block;
}
/* The Bank Summary's label column: same treatment as the cashflow's —
   sticky, the headers' frost (tint + blur), one hairline seam — and the
   same width (--ov-label-col-w, set by the plot render from the measured
   cashflow label column), so the two tables read as one surface. Account
   names wrap inside the aligned gutter instead of overflowing it.
   z 35: above the sticky-top month headers (34) so the corner holds
   both scrolls. */
.ov-bank-summary table.track tr:not(.cf-forecast-title-row) > th:first-child {
  position: sticky; left: 0; z-index: 35;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-right: none;
}
.ov-bank-summary table.track tbody td:first-child,
.ov-bank-summary table.track tbody tr:hover td:first-child {
  position: sticky; left: 0; z-index: 35;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-right: none;
}
.ov-bank-summary table.track tr:not(.cf-forecast-title-row) > th:first-child,
.ov-bank-summary table.track tbody td:first-child {
  width: var(--ov-label-col-w, auto);
}
html.dark .ov-bank-summary table.track tr:not(.cf-forecast-title-row) > th:first-child,
html.dark .ov-bank-summary table.track tbody td:first-child {
  border-right-color: var(--hg-border-cell);
}
.ov-bank-summary table.track tr:not(.cf-forecast-title-row) > th:nth-child(2),
.ov-bank-summary table.track tbody td:nth-child(2) {
  border-left: none;
}
/* ── labels: no row grid, only total/balance separators ──
   Transparent top borders keep the labels aligned with the month cells.
   Overlay bars paint those separators above the translucent frost. */
.ov-scroll .cf-forecast-scroll table.track tbody td:first-child,
.ov-bank-summary table.track tbody td:first-child {
  border-bottom: none;
}
.ov-scroll .cf-forecast-scroll table.track tr.cf-section-total > td:first-child,
.ov-scroll .cf-forecast-scroll table.track tr.cf-row-balance > td:first-child,
.ov-scroll .cf-forecast-scroll table.track tr.cf-grand-total > td:first-child,
.ov-bank-summary table.track tr.cf-grand-total > td:first-child {
  border-top-color: transparent;
}
.ov-scroll .cf-forecast-scroll table.track tr.cf-section-total > td:first-child::before,
.ov-scroll .cf-forecast-scroll table.track tr.cf-row-balance > td:first-child::before,
.ov-scroll .cf-forecast-scroll table.track tr.cf-grand-total > td:first-child::before,
.ov-bank-summary table.track tr.cf-grand-total > td:first-child::before {
  content: ''; position: absolute; top: -1px; left: 0; right: 0; height: 1px;
  background: var(--hg-hairline);
  pointer-events: none;
}
html.dark .ov-scroll .cf-forecast-scroll table.track tr.cf-section-total > td:first-child::before,
html.dark .ov-scroll .cf-forecast-scroll table.track tr.cf-row-balance > td:first-child::before {
  background: var(--hg-border-cell);
}
.ov-scroll .cf-forecast-scroll table.track tr.cf-grand-total > td:first-child::before,
.ov-bank-summary table.track tr.cf-grand-total > td:first-child::before {
  top: -2px; height: 2px;
}
html.dark .ov-scroll .cf-forecast-scroll table.track tr.cf-grand-total > td:first-child::before,
html.dark .ov-bank-summary table.track tr.cf-grand-total > td:first-child::before {
  background: var(--hg-border-chrome);
}
.ov-bank-summary table.track .cf-line-label { white-space: normal; }
.cf-forecast-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 6px 12px;
}
.cf-forecast-controls {
  display: flex; align-items: center; gap: 5px;
  flex: 0 0 auto; flex-wrap: wrap; min-width: 0;
}
/* The title row lives inside the wide line-item table; the lane shell cell
   clips with overflow hidden (no horizontal scroll), so a right-aligned
   cluster would sit past the visible frame edge. The pin is sticky to the
   scrollport: at wide frames it rests at the bar's right edge (its natural
   slot), at narrow frames it stays inside the visible window. */
.cf-forecast-pin {
  display: flex; align-items: center; gap: 13px;
  position: sticky; right: 12px; margin-left: auto;
}
.cf-forecast-title { flex: 0 0 auto; font-weight: 700; font-size: var(--hg-type-11); color: inherit; }
.cf-forecast-sub { font-size: var(--hg-type-11); color: var(--hg-text-dim); }
.cf-forecast-spacer { flex: 1; }
.cf-forecast-lbl { font-size: var(--hg-type-10); text-transform: uppercase; letter-spacing: .05em; color: var(--hg-text-dim); }

/* ── Upcoming payments table (proposal §2) ──
   Beneath the forecast: the projection's crew-by-crew detail. Same track
   family as the forecast table (frost th, tabular nums). */
.cf-upcoming { margin: 18px 0 0; }
.cf-upcoming-head {
  display: flex; align-items: baseline; gap: 10px; padding: 0 12px 4px;
}
.cf-upcoming-title {
  font-size: var(--hg-type-10); font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; color: var(--hg-text-dim);
}
.cf-upcoming-sub { font-size: var(--hg-type-11); color: var(--hg-text-muted); }
.cf-upcoming-scroll { max-height: 360px; overflow: auto; }
.cf-upcoming-scroll table.track { min-width: 100%; }
.cf-upcoming-scroll table.track th,
.cf-upcoming-scroll table.track td { padding: 4px 10px; }
.cf-upcoming-period td {
  border-top: 1px solid var(--hg-border-row); font-weight: 600;
  color: var(--hg-text-ink); font-size: var(--hg-type-11);
}
.cf-upcoming-period .cf-up-total { font-variant-numeric: tabular-nums; }
.cf-upcoming-row td { font-size: var(--hg-type-base); color: var(--hg-text-ink); }
.cf-upcoming-row .num, .cf-upcoming-period .num { font-variant-numeric: tabular-nums; }
.cf-up-paydate { white-space: nowrap; }
html.dark .cf-upcoming-period td { border-top-color: var(--hg-border-chrome); color: var(--hg-text-bright); }
html.dark .cf-upcoming-row td { color: var(--hg-text-bright); }

/* ── Pay pattern editor popover (proposal §1) ──
   A small editor over the shared popup surface (--hg-surface-tabs, the
   locked popup law): rows of inline labels + shared pickers. */
.cf-pay-pattern-ed { min-width: 250px; padding: 8px 10px; }
.cf-pay-pattern-ed .hg-menu-label { margin-bottom: 6px; }
.cf-pay-row {
  display: flex; align-items: center; gap: 6px;
  font-size: var(--hg-type-base); color: var(--hg-text-ink);
  padding: 2px 0;
}
html.dark .cf-pay-row { color: var(--hg-text-bright); }
.cf-pay-pattern-ed .hg-date, .cf-pay-pattern-ed .hg-select { margin: 4px 0; }
.cf-pay-actions {
  display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px;
  border-top: 1px solid var(--hg-border-row);
  padding-top: 8px;
}
/* the forecast table scrolls within the strip; never bleed past the right margin */
.ov-scroll .cf-forecast-scroll { margin-top: 0; flex: 1 1 auto; min-height: 0; overflow: auto; padding: 0; box-sizing: border-box; }
.ov-empty { font-size: var(--hg-type-11); color: var(--hg-text-muted); padding: 4px 0; }
/* dock-style plot panels (js/cashflow-forecast-plot.js)
   Same anatomy as the gantt cashflow dock: title bar with meta, framed plot
   band with a baseline, label strip inside. Tokens flip in dark mode. */
.ov-plot-panel {
  border: 1px solid var(--hg-border-row); border-radius: 6px;
  background: var(--hg-frost-bg);
  backdrop-filter: blur(var(--hg-frost-blur-soft));
  -webkit-backdrop-filter: blur(var(--hg-frost-blur-soft));
  overflow: hidden; box-sizing: border-box; min-width: 0;
}
.ov-plot-titlebar {
  display: flex; align-items: baseline; gap: 10px;
  padding: 6px 12px 5px; box-sizing: border-box;
  background: var(--hg-frost-head);
  border-bottom: 1px solid var(--hg-border-row);
}
.ov-plot-title { font-size: var(--hg-type-11); font-weight: 700; color: var(--hg-text-secondary); }
.ov-plot-sub { font-size: var(--hg-type-10); color: var(--hg-text-dim); }
.ov-plot-meta {
  margin-left: auto; font-size: var(--hg-type-10); font-weight: 600;
  color: var(--hg-info); font-variant-numeric: tabular-nums;
}
.ov-plot-band {
  position: relative; box-sizing: border-box;
  border-bottom: 1px solid var(--hg-border-row);  /* the baseline bars sit on */
  background:
    linear-gradient(to right, var(--hg-border-row) 0, var(--hg-border-row) 1px, transparent 1px) 0 0 / max(1px, var(--hg-plot-grid, 56px)) 100%,
    transparent;
}
.ov-plot-strip { position: relative; box-sizing: border-box; }
/* ── cashflow plot: the gantt cashflow dock, ported 1:1 (js/cashflow-forecast-plot.js)
   Geometry matches the dock: band 92 + 3×24 label rows = 164. No title row —
   the panel reads as a continuation of the cashflow table above it. */
.cfp-body {
  display: flex; min-height: 0; height: 164px; box-sizing: border-box; overflow: hidden;
}
.cfp-label {
  width: 150px; flex-shrink: 0; box-sizing: border-box;
  border-right: 1px solid var(--hg-hairline); background: transparent;
  font-size: var(--hg-type-base); color: var(--hg-text-label);
  display: flex; align-items: stretch;
}
.cfp-label-inner {
  flex: 1; display: flex; flex-direction: column;
  height: 100%; min-height: 0; padding: 0 12px; box-sizing: border-box;
}
.cfp-label-top {
  flex-shrink: 0; box-sizing: border-box;
  display: flex; flex-direction: column; justify-content: center; gap: 6px;
}
.cfp-label-leg { font-size: var(--hg-type-11); color: var(--cf-label); }
.cfp-dot.income { color: var(--cf-income); }
.cfp-dot.deficit { color: var(--cf-deficit-t); }
.cfp-label-strip {
  flex-shrink: 0; box-sizing: border-box;
  display: flex; flex-direction: column; justify-content: flex-start;
}
.cfp-strip-leg {
  height: 24px; line-height: 24px; box-sizing: border-box;
  font-size: var(--hg-type-11); color: var(--cf-label);
}
.cfp-scroll {
  flex: 1; min-width: 0; overflow-x: auto; overflow-y: hidden;
  position: relative; scrollbar-width: none;
}
.cfp-scroll::-webkit-scrollbar { display: none; height: 0; }
.cfp-panel { position: relative; box-sizing: border-box; background: transparent; min-width: 100%; }
html.dark .cfp-titlebar {
  background: var(--hg-frost-head);
  border-bottom-color: var(--hg-border-chrome); color: var(--hg-text-secondary);
}
html.dark .cfp-titlebar-sub { color: var(--hg-text-dim); }
html.dark .cfp-titlebar-meta .cfp-meta-bit.is-warn { color: var(--cf-deficit-t, #c08a8a); }
html.dark .cfp-label { border-right-color: var(--hg-border-chrome); color: var(--hg-text-secondary); }
/* plotline strokes (balance paths share the dock's .cf-bal-path vocabulary —
   those rules are scoped to #cfTrack, so this panel restates the strokes) */
.cf-zero-axis {
  position: absolute; left: 0; width: 100%; height: 1px;
  background: var(--cf-label); opacity: .35; z-index: 2; pointer-events: none;
}
.cf-fp-svg { position: absolute; overflow: hidden; z-index: 3; pointer-events: none; display: block; }
.cf-fp-svg .cf-spent-path {
  fill: none; stroke: #9aa4b8; stroke-width: 1.5; stroke-dasharray: 4 3;
  stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke;
}
html.dark .cf-fp-svg .cf-spent-path { stroke: #6f7888; }
.cf-fp-svg .cf-bal-path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.cf-fp-svg .cf-bal-path.cf-bal-surplus {
  stroke: var(--cf-income); stroke-width: 2.5;
  filter: drop-shadow(0 0 3px color-mix(in srgb, var(--cf-income) 70%, transparent));
}
.cf-fp-svg .cf-bal-path.cf-bal-deficit {
  stroke: var(--cf-deficit-t); stroke-width: 2.5;
  animation: cf-deficit-pulse 1.6s ease-in-out infinite;
  will-change: filter;
}
@media (prefers-reduced-motion: reduce) {
  .cf-fp-svg .cf-bal-path.cf-bal-deficit {
    animation: none;
    filter: drop-shadow(0 0 4px var(--cf-deficit-glow));
  }
}
/* weekly cost bars under the forecast table — X-measured from the table.
   The sheet and the plot share one scroll frame but are two panels, so each
   paints its own lift edge: the sheet's cast leaves its bottom pane, its glow
   leaves its title pane, and the plot wears the pair itself. The frame they
   share casts nothing, so the gutter between them reads like the one between
   the bank and cashflow panels. */
.cf-forecast-plot { margin: 20px 0 12px; border: 0; overflow: visible; box-shadow: var(--hg-shadow-lift); }
#cfTitlePane { box-shadow: var(--hg-shadow-glow); }
#cfAddPane { box-shadow: var(--hg-shadow-cast); }
/* The dock panel is a continuation of the table surface: its BODY aligns
   with the table's scrollable content (LINE ITEM gutter + month columns),
   so the plot band spans exactly the table's first-to-last column edges
   and pans in lockstep. Titlebar stays viewport-fixed. */
.cf-forecast-plot .cfp-body { display: flex; align-items: stretch; overflow: visible; }
/* One strip scrolls both table and plot. The plot legend is one sticky,
   translucent frosted surface. Its body remains overflow-visible so the
   legend anchors to the shared strip. */
.cf-forecast-plot .cfp-label {
  position: sticky; left: 0; z-index: 5;
  background: var(--hg-frost-head);
  backdrop-filter: blur(var(--hg-frost-blur));
  -webkit-backdrop-filter: blur(var(--hg-frost-blur));
  border-right: 1px solid var(--hg-hairline);
}
html.dark .cf-forecast-plot .cfp-label {
  border-right-color: var(--hg-border-cell);
}
/* The track pane spills into the strip's scroll — no inner scroller. */
.cf-forecast-plot .cfp-scroll { flex: 1 1 auto; min-width: 0; overflow: visible; }
/* the band width is set in JS (union of month columns); the dock's
   min-width:100% would stretch it past the last month column */
.cf-forecast-plot .cfp-panel { min-width: 0; }
/* The plot's month ground: forecast months wear the same provisional
   draft stripe the table's future month headers carry, and the month
   boundaries draw the table's hairline family — light warm, dark cell. */
.cfp-future-bg {
  background: repeating-linear-gradient(45deg,
    transparent 0 5px,
    color-mix(in srgb, var(--gbar-draft-stripe) 30%, transparent) 5px 11px);
}
html.dark .cfp-future-bg {
  background: repeating-linear-gradient(45deg,
    transparent 0 5px,
    color-mix(in srgb, var(--gbar-draft-stripe) 50%, transparent) 5px 11px);
}
.cfp-month-hair { width: 1px; background: var(--hg-hairline); }
html.dark .cfp-month-hair { background: var(--hg-border-cell); }
/* weekly realized-cost bars over the selected overview period */
/* the merged plot sits flush under the cashflow table inside its strip; no extra margins */
html.dark .ov-plot-panel { border-color: var(--hg-border-chrome); }
html.dark .ov-plot-band { border-bottom-color: var(--hg-border-chrome); }

/* dark mode */
html.dark .ov-issue-list { border-color: var(--hg-border-chrome); }
html.dark .dz-btn:hover { background: #3a2320; }

/* ===== 16. BOARD — five status strips over the Breakdown tree ===== */
/* The Board renders the SAME tree the Breakdown view renders: .seg-block,
   .hg-lane, .hg-entity-block, .hg-entity, .hg-entity-body and .hg-stage all
   come from the Breakdown block above, so every surface inside a band is
   inherited rather than restated. The rules below only split a deliverable
   body into five strips and label them once at the top. */

#v-bd .bidwrap { flex: 1 1 auto; min-height: 0; overflow: auto; }

/* One head for the whole board, sticky in the board's scroll root. Its insets
   reproduce a strip column's position inside a band: .bidwrap padding 20px,
   .seg-body padding-left 16px, .hg-entity-body margin-left 16px and
   padding-left 8px = 40px from the content edge, with 10px on the right from
   .hg-entity-body's padding-right. Change either side and change both. */
.bd-head {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0 10px; padding: 6px 10px 6px 40px;
  position: sticky; top: 0; z-index: 34;
  /* The same material a tracker table header wears. A table's header is two
     layers: the tbody paints the frost-bg sheet (4% ink) and the th paints the
     head wash (6% of the tabs shade) over it. The board has no tbody, so the
     head paints both here, bottom layer first. A single 6% wash over the page
     is what made the band nearly vanish. No drop shadow: the table header has
     none. */
  background-color: var(--hg-frost-bg);
  background-image: linear-gradient(var(--hg-frost-head), var(--hg-frost-head));
  backdrop-filter: blur(var(--hg-frost-blur));
  -webkit-backdrop-filter: blur(var(--hg-frost-blur));
  border-bottom: 1px solid var(--hg-border-chrome);
}
.bd-head-cell { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.bd-head-name { font-size: var(--hg-type-10); text-transform: uppercase; letter-spacing: .06em; color: var(--hg-text-label); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bd-head-n { font-size: var(--hg-type-10); color: var(--hg-text-muted); font-variant-numeric: tabular-nums; }
.bd-head-p { font-size: var(--hg-type-10); color: var(--hg-text-ink); font-variant-numeric: tabular-nums; font-weight: 600; }
/* --hg-text-ink does not flip; the share must, or it disappears on the dark head. */
html.dark .bd-head-p { color: var(--hg-text-bright); }

/* Status split: five shares in column order. A status with cards wears its own
   status colour; a zero share keeps its slot in plain muted ink, so the eye
   reads the coloured ones as the work and the sequence stays unbroken. */
.bd-split { display: inline-flex; align-items: center; gap: 4px; margin-left: 8px; vertical-align: middle; }
.bd-split b { font-size: var(--hg-type-10); font-weight: 600; font-variant-numeric: tabular-nums;
  padding: 1px 4px; border-radius: 3px; color: var(--hg-text-muted);
  border: 1px solid var(--hg-border-row); background: transparent; }
/* A share chip keeps the resting outline in every status; only its NUMBER
   wears the status colour. A filled status pair painted the chip too dark in
   dark mode and too light in light mode, and the percentage is the value that
   must carry the status. The view id outranks the dark status overrides, so a
   waiting share wears the same grey as its column name. */
#v-bd .bd-split b.st-wtg  { background: transparent; color: var(--st-wtg-ink); }
#v-bd .bd-split b.st-ip   { background: transparent; color: var(--st-ip-ink); }
#v-bd .bd-split b.st-rev  { background: transparent; color: var(--st-rev-ink); }
#v-bd .bd-split b.st-cmpt { background: transparent; color: var(--st-cmpt-ink); }
#v-bd .bd-split b.st-appr { background: transparent; color: var(--st-appr-ink); }

/* The open deliverable body is already a grid; the board names its five
   tracks, so every band's columns line up down the whole page. The band
   itself carries NO surface on the board: a card is the only painted thing,
   so empty columns show the page and never a strip of colour. */
.asset-tree.board .hg-entity-block.open > .hg-entity-body {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0 10px;
  background: transparent;
  border-top: none;
}
/* Lane heads park under the column head, not over it: their sticky top is the
   head's measured height (--bd-head-h, written by boardPaintHead), so a lane
   row can never ride up across the status row. The head also outranks them, so
   even a rounding difference cannot paint a lane over it. */
#v-bd .seg-block .hg-lane { top: var(--bd-head-h, 32px); z-index: 32; }
/* A deliverable row parks under its own lane row, which is itself parked under
   the column head: the three bands stack and never paint over each other, so an
   open deliverable can be folded away without scrolling back up to it. The
   offset is the head's measured height plus the lane row's (--bd-lane-h, also
   written by boardPaintHead). A closed deliverable's block is only as tall as
   its row, so it has no room to travel and never clamps; the lane above always
   outranks it, so a rounding difference cannot paint one over the other. */
/* An icon in an action cluster: the glyph is centred in the shared .mv-btn
   box and does not add baseline space. Colour and hover stay with .mv-btn, so
   an eye reads the same in the Breakdown lane row and on the Board. */
.row-actions > .mv-btn { display: inline-flex; align-items: center; }
.row-actions > .mv-btn > svg { display: block; }
/* The hidden-lanes tray is a direct child of the board tree, where the
   Breakdown keeps it inside a lane body. It takes the tree's left edge and hugs
   its own text rather than stretching a button across the whole board. */
#boardTree .seg-footer { align-items: flex-start; }
#v-bd .hg-entity-block.open > .hg-entity {
  position: sticky;
  top: calc(var(--bd-head-h, 32px) + var(--bd-lane-h, 30px));
  z-index: 30;
}
/* The lane row's hint cell carries the card count and the five shares; the
   Breakdown rule ellipsizes that cell, which would eat the shares. */
#v-bd .seg-hint { overflow: visible; white-space: normal; display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 2px 0; }
/* Both rows end with the same trailing cluster, so their five shares sit on
   one vertical line. The lane's cluster is measured, not assumed: boardPaintHead
   writes --bd-lane-tail (meta + gaps + whatever the action cluster holds), and
   the deliverable's day slot is that width less the 12px row gap and its own
   10px right inset. Adding or removing a lane control therefore moves both
   blocks together and the shares never drift apart. */
.asset-tree.board .hg-entity { gap: 12px; }
.asset-tree.board .hg-entity > .bd-split { margin-left: auto; }
.asset-tree.board .hg-entity > .a-tail { margin-left: 0; width: calc(var(--bd-lane-tail, 147px) - 22px); justify-content: flex-end; }

.bd-col { display: flex; flex-direction: column; min-width: 0; }
/* The column edges are permanent: a dashed hairline in the cards' own colour
   and opacity, so the five strips read as columns whether or not a card sits
   in them. No drop state, no wireframe. */
.bd-col + .bd-col {
  border-left: 1px dashed color-mix(in srgb, var(--seg-accent) var(--hg-lane-op), transparent);
}

/* Every open deliverable names its five strips in ONE band across the grid:
   the top head scrolls out of view with the lanes, so a column cannot rely on
   it to say what its cards mean. The band carries the lane's own stage tint,
   because the names describe this deliverable's stage level, not the page.
   Each name wears the status ink the Gantt uses, and the top head names take
   the same five rules, so the two surfaces cannot disagree about what a
   status looks like. */
.bd-band {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0 10px;
  margin-bottom: 8px;
  background: var(--seg-edge),
              color-mix(in srgb, var(--seg-accent) var(--hg-stage-op), transparent);
}
.bd-col-head {
  /* The band's left edge carries the lane's 3px accent, and a column's left
     edge carries the dashed divider, so the name starts where the card's own
     title starts: 10px inside its column, never on the line. */
  padding: 3px 6px 5px 10px;
  font-size: var(--hg-type-10);
  text-transform: uppercase;
  letter-spacing: .06em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--hg-text-label);
}
.bd-col-head[data-status="waiting"]     { color: var(--st-wtg-ink); }
.bd-col-head[data-status="in_progress"] { color: var(--st-ip-ink); }
.bd-col-head[data-status="review"]      { color: var(--st-rev-ink); }
.bd-col-head[data-status="complete"]    { color: var(--st-cmpt-ink); }
.bd-col-head[data-status="approved"]    { color: var(--st-appr-ink); }
.bd-head-cell[data-status="waiting"]     > .bd-head-name { color: var(--st-wtg-ink); }
.bd-head-cell[data-status="in_progress"] > .bd-head-name { color: var(--st-ip-ink); }
.bd-head-cell[data-status="review"]      > .bd-head-name { color: var(--st-rev-ink); }
.bd-head-cell[data-status="complete"]    > .bd-head-name { color: var(--st-cmpt-ink); }
.bd-head-cell[data-status="approved"]    > .bd-head-name { color: var(--st-appr-ink); }

/* A card is a .hg-stage row re-proportioned into a column object. The PAINT is
   the Breakdown row's own: the lane edge gradient over the lane accent at the
   stage level, blurred exactly as the deliverable row above it is. Only the
   proportions change: a gap under each card, a taller box, a shared corner.
   The band itself carries none of it, so empty columns show the page. */
.asset-tree.board .hg-entity-block[data-seg] {
  backdrop-filter: none; -webkit-backdrop-filter: none;
}
.asset-tree.board .hg-entity-block > .hg-entity {
  backdrop-filter: blur(var(--hg-frost-blur-soft));
  -webkit-backdrop-filter: blur(var(--hg-frost-blur-soft));
  /* The card columns stop 10px short of the band's edge; the day total takes
     the same inset, so the number never lands on the edge and never clips. */
  padding-right: 10px;
}
.asset-tree.board .hg-stage {
  flex-direction: column; flex-wrap: nowrap; align-items: stretch;
  gap: 3px; padding: 9px 10px; margin: 0 0 8px;
  min-height: 152px;
  border: none; border-radius: 3px;
  /* A task card takes the same soft cast the lane cards carry, so a column
     reads as cards lying over the band rather than shapes painted into it. */
  box-shadow: var(--hg-shadow-cast);
  background: var(--seg-edge),
              color-mix(in srgb, var(--seg-accent) var(--hg-stage-op), transparent);
  backdrop-filter: blur(var(--hg-frost-blur-soft));
  -webkit-backdrop-filter: blur(var(--hg-frost-blur-soft));
  cursor: grab;
  /* The drag owns the horizontal axis and nothing else. Without this the
     browser claims the whole gesture as a pan and cancels the pointer after
     a few pixels, so a finger could never cross a column. pan-y keeps native
     vertical scrolling on the card, which is what a vertical gesture means
     here anyway. */
  touch-action: pan-y;
  /* A long press on a card must not raise a text selection or the iOS
     callout menu in the middle of a drag. */
  -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none;
}
.asset-tree.board .hg-stage[data-done] { opacity: .62; }
.asset-tree.board .hg-stage > .t-stage { order: -3; flex: 0 0 auto; white-space: normal; overflow: visible; }
.asset-tree.board .hg-stage > .t-tags { order: -2; flex: 0 0 auto; }
.asset-tree.board .hg-stage > .t-note { order: -1; flex: 1 1 auto; min-width: 0; }
/* The cluster is a rigid right-aligned line in a full-width Breakdown row.
   A card is a column: the cluster wraps, hugs the card's left edge, and sits
   at the bottom so every card's footer shares one baseline. */
.asset-tree.board .hg-stage > .t-ctrl {
  order: 0; margin-top: auto; flex: 0 0 auto; flex-wrap: wrap;
  justify-content: flex-start; gap: 4px 8px;
}
.asset-tree.board .hg-stage .bd-ord { margin-left: 6px; font-size: var(--hg-type-10); color: var(--hg-text-muted); }
/* The note is what the height is for: four lines, then a clip. */
.asset-tree.board .hg-stage .bd-note {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4;
  overflow: hidden;
  font-size: var(--hg-type-11); line-height: 1.4; color: var(--hg-text-muted);
}
.asset-tree.board .hg-stage .bd-crew { font-size: var(--hg-type-10); color: var(--hg-people); }
.asset-tree.board .hg-stage .bd-crew.un { color: var(--hg-text-muted); }
/* A card is a column, so the bar's dates can be wider than the card. The span
   takes the line's width and breaks between the two dates and before the day
   count, instead of pushing past the card's edge. */
.asset-tree.board .hg-stage .t-days {
  cursor: default;
  flex: 0 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
}
.asset-tree.board .hg-stage .t-days:hover { background: transparent; }

/* The carried card is the card itself, lifted: same fill, same border, plus
   the accent drop. It keeps the pointer's grab point so the card does not
   jump into the hand. */
.bd-card-ghost {
  position: fixed; z-index: 96; pointer-events: none; margin: 0;
  box-shadow: var(--hg-drop-accent-lift); cursor: grabbing;
}
/* The carried card hangs off this body-level host, which wears the board's own
   scope so the card keeps its paint and paints nothing itself. The copy is
   fixed, so a filtered ancestor would become its containing block and carry it
   by that ancestor's corner instead of the pointer. */
.bd-card-ghost-host {
  position: fixed; left: 0; top: 0; width: 0; height: 0;
  pointer-events: none;
}
body.bd-dragging, body.bd-dragging * { cursor: grabbing; }
