    /* ============================================================
       V25 — IBM PLEX TYPE STACK (+ DATUM families)
       Loaded once. Used by warm-light/warm-dark themes (and any
       future theme that opts in via the --font-* tokens).
       SELF-HOSTED since 2026-07-02 (health-check Phase 2): the six
       families formerly @imported from fonts.googleapis.com now live
       in /fonts/vendored (latin + latin-ext woff2, SIL OFL), declared
       by /fonts/vendored-fonts.css. Zero external fetches on load.
       ============================================================ */
    @import url("../fonts/vendored-fonts.css");

    /* ============================================================
       ROUTED GOTHIC — bundled drafting face (NOT a CDN font)
       Darren Embry, SIL Open Font License v1.1 (see /fonts/OFL.txt).
       Traced from a Leroy lettering stencil — the genuine drafting-
       template lineage. Used by the 2D-mode noteBox 'Routed Gothic'
       lettering styles (js/97 NB_STYLES). Three cuts, each shipped as
       a single normal/normal face under its own family name so the
       canvas drawer can select it by family alone:
         Regular · Wide (extended) · Half-Italic (gentle lean).
       Files live in /fonts; url() is relative to THIS stylesheet (css/).
       ============================================================ */
    @font-face {
      font-family: "Routed Gothic";
      src: url("../fonts/routed-gothic.ttf") format("truetype");
      font-weight: normal; font-style: normal; font-display: swap;
    }
    @font-face {
      font-family: "Routed Gothic Wide";
      src: url("../fonts/routed-gothic-wide.ttf") format("truetype");
      font-weight: normal; font-style: normal; font-display: swap;
    }
    @font-face {
      font-family: "Routed Gothic Half Italic";
      src: url("../fonts/routed-gothic-half-italic.ttf") format("truetype");
      font-weight: normal; font-style: normal; font-display: swap;
    }

    /* ============================================================
       SAIRA CONDENSED — vendored drafting-text face (NOT a CDN font)
       Steve Matteson, SIL Open Font License v1.1. Latin subset of
       Google Fonts 'Saira Condensed' v12, weights 400 and 500 only,
       fetched as woff2 and stored locally for offline use. Used by the
       2D-mode Text-section entities (Callout / Text box / Plain text /
       Detail title / Section title / Section mark). Canvas selects it
       by family name: 'Saira Condensed'. url() is relative to THIS
       stylesheet (css/), so it points up into /lib.
       ============================================================ */
    @font-face {
      font-family: "Saira Condensed";
      src: url("../lib/saira-condensed-400.woff2") format("woff2");
      font-weight: 400; font-style: normal; font-display: swap;
    }
    @font-face {
      font-family: "Saira Condensed";
      src: url("../lib/saira-condensed-500.woff2") format("woff2");
      font-weight: 500; font-style: normal; font-display: swap;
    }

    * { box-sizing: border-box; margin: 0; padding: 0; }

    /* ============================================================
       V25 STRUCTURAL TOKENS (theme-agnostic)
       Type families, type ramp, spacing, radii, layout heights,
       motion. Available to every theme so newly written rules can
       reference them without theme branching. Existing rules keep
       working because they reference the per-theme color tokens.
       ============================================================ */
    :root {
      /* Type families */
      --font-sans:  "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
      --font-mono:  "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
      --font-serif: "IBM Plex Serif", ui-serif, Georgia, serif;

      /* Type ramp */
      --fs-2xs: 10px; --fs-xs: 11px; --fs-sm: 12px; --fs-md: 13px;
      --fs-lg:  14px; --fs-xl: 16px; --fs-2xl: 20px; --fs-3xl: 28px;

      /* Tracking */
      --tracking-tight: -0.012em;
      --tracking-wide:   0.04em;
      --tracking-caps:   0.08em;

      /* Spacing scale (4-px base, 12 steps) */
      --sp-1:2px; --sp-2:4px; --sp-3:6px; --sp-4:8px; --sp-5:10px;
      --sp-6:12px; --sp-7:14px; --sp-8:16px; --sp-10:20px; --sp-12:24px; --sp-16:32px;

      /* Radii */
      --r-0: 0; --r-1: 3px; --r-2: 5px; --r-3: 7px; --r-4: 10px; --r-pill: 999px;

      /* properties-panel-polish (2026-06-21) — theme-agnostic.
         --font-display: Josefin Sans for headings/eyebrows ONLY (never body),
         falling back to the sans stack. --shadow-plate: a hard, un-blurred
         offset "plate" shadow for the floating options ribbon; a translucent
         black reads correctly on both light and dark theme surfaces. */
      --font-display: "Josefin Sans", var(--font-sans);
      --shadow-plate: 3px 3px 0 0 rgba(0, 0, 0, 0.18);

      /* Layout heights / widths */
      /* V25-layout-overhaul — top bar trimmed from 44 → 38 for the
         thinner header in Dan's sketch. */
      --bar-h: 38px; --rail-row-h: 28px; --status-h: 28px;
      /* V25-c — palette widened from 172 → 196 so the 2-col tiles fit
         "360UB 50.7" / "100x50x5" labels cleanly without ellipsis. */
      --tile-size: 56px; --rail-w: 192px; --palette-w: 196px;

      /* Motion */
      --t-fast: 100ms; --t-base: 160ms;
      --ease-out: cubic-bezier(.22, .61, .36, 1);

      /* V25 — paper/ink pair (theme-agnostic).
         --paper is the cream sheet color, used in both warm-light and
         warm-dark themes (the sheet always represents real paper).
         --paper-ink is the warm graphite that sits on it. Used for tiles,
         sheet content, anything on --paper so it doesn't disappear into
         cream-on-cream in dark mode where --text becomes cream. */
      --paper-ink:      #2A241F;
      --paper-ink-mute: #6E665A;
    }

    /* ============================================================
       V21 + V25 DESIGN SYSTEM — THEME TOKENS
       Five themes:
         · WARM LIGHT (V25 default)  — paper-cream + coral accent
         · WARM DARK  (V25)          — warm charcoal sibling
         · CLASSIC    (V21)          — white sheet / black ink
         · DARK       (V21)          — neutral charcoal IDE
         · BT                        — Bligh Tanner brand red

       Each theme defines BOTH the new V21 semantic tokens (--surface,
       --text, --accent, etc.) AND aliases for the legacy V20 token
       names (--bg, --ink, --mute, etc.) so existing CSS rules inherit
       the new palette without a full sweep. Canvas-rendering tokens
       (--entity-color, --cut-color, etc.) drive the drawing engine
       and must be defined in every theme. */

    /* WARM LIGHT — V25 default. Paper-cream surfaces, warm graphite
       ink, single coral accent. Borders-first, almost no shadows. */
    body.theme-warm-light {
      /* V25 surface ramp */
      --paper:        #FCFAF6;
      --surface:      #F2EBDD;
      --surface-cool: #E6E2D8;
      --surface-2:    #F8F2E5;
      --surface-3:    #EDE5D2;
      --surface-4:    #E4DBC4;

      /* Borders (three weights doing the structural work) */
      --border:        #E0D6BF;
      --border-2:      #C9BD9E;
      --border-strong: #A89A78;

      /* Ink ramp (warm graphite, no #000) */
      --text:        #2A241F;
      --text-mute:   #6E665A;
      --text-subtle: #9A9079;
      --text-faint:  #BFB59A;

      /* Coral / terracotta accent (single hue, multiple roles) */
      --accent:       oklch(0.62 0.13 35);
      --accent-hover: oklch(0.58 0.14 35);
      --accent-press: oklch(0.52 0.14 35);
      --accent-bg:    oklch(0.62 0.13 35 / 0.10);
      --accent-bg-2:  oklch(0.62 0.13 35 / 0.18);
      --accent-brd:   oklch(0.62 0.13 35 / 0.40);
      --accent-ink:   #FCFAF6;

      /* Semantic colors (share the warm chroma family) */
      --warn:    oklch(0.68 0.13 70);
      --danger:  oklch(0.55 0.16 27);
      --success: oklch(0.58 0.10 145);
      --info:    oklch(0.58 0.08 240);
      --focus-ring: oklch(0.62 0.13 35 / 0.45);

      /* DATUM canonical ladder (additive — richer paper/ink/accent vocabulary
         for the refinement layer; existing rules are untouched). */
      --paper-0: #FDFBF7;  --paper-1: #F7F1E3;  --paper-2: #EEE6D4;  --paper-3: #E0D3B2;
      --ink-1: #2A241F;    --ink-2: #4A3526;    --ink-3: #6E665A;    --ink-4: #9A9079;  --ink-5: #BFB59A;
      --red-chop: #BE4234; --red-deep: #8F2E25; --red-wash: #EBD2C2;
      --blueprint: oklch(0.56 0.045 248);  --olive: oklch(0.585 0.040 128);
      --ochre:     oklch(0.70 0.055 73);    --plum:  oklch(0.42 0.030 345);
      --warn-bg:    oklch(0.68 0.13 70  / 0.13);  --danger-bg:  oklch(0.55 0.16 27  / 0.11);
      --success-bg: oklch(0.58 0.10 145 / 0.12);  --info-bg:    oklch(0.58 0.08 240 / 0.12);
      /* FLW print-plate signature — warm sepia offset, kept subtle. */
      --shadow-plate: 3px 3px 0 0 color-mix(in oklab, var(--ink-2) 13%, transparent);

      /* Hover / active surfaces */
      --hover-bg:   rgba(42, 36, 31, 0.04);
      --hover-bg-2: rgba(42, 36, 31, 0.07);
      --active-bg:  var(--accent-bg);
      --active-brd: var(--accent-brd);
      --scrollbar:  rgba(42, 36, 31, 0.22);
      --selected-color: var(--accent);
      /* GLT notch-mode glow — warm honey amber, deliberately a different hue
         from --selected-color (terracotta, hue 35) so "armed for cutting"
         never reads as "selected". */
      --notch-glow: oklch(0.70 0.14 72);

      /* V25 — modal veil (theme-aware overlay scrim) */
      --modal-veil: rgba(42, 36, 31, 0.28);

      /* Elevation — borders-first */
      --shadow-hairline: inset 0 0 0 1px var(--border);
      --shadow-sm: 0 1px 0 rgba(42,36,31,0.04);
      --shadow-md: 0 1px 0 rgba(42,36,31,0.04),
                   0 6px 18px -8px rgba(42,36,31,0.14),
                   0 2px 6px -2px rgba(42,36,31,0.08);
      --shadow-lg: 0 1px 0 rgba(42,36,31,0.04),
                   0 12px 32px -12px rgba(42,36,31,0.18),
                   0 2px 6px -2px rgba(42,36,31,0.10);
      --shadow-pop: var(--shadow-lg);

      /* Legacy V20 aliases (kept so existing rules inherit warmly) */
      --bg:  var(--surface);
      --bg2: var(--surface-2);
      --bg3: var(--surface-3);
      --brd: var(--border);
      --brd-subtle: var(--border);
      --ink:  var(--text);
      --mute: var(--text-mute);
      --detail-boundary: var(--accent-soft, var(--accent));
      --inputBg: var(--surface-2);

      /* Canvas engine tokens — drive drawing output */
      --workspace-bg: var(--surface);
      --sheet-bg:     var(--paper);
      --sheet-border: #B8AC8E;
      /* V25 — sheet drop-shadow read by canvas drawSheet() via getComputedStyle.
         Canvas can only paint a single shadow layer (vs CSS's stacking), so
         we tune one warm soft shadow. Comma-separated list = canvas reads
         the first comma-separated token for color. */
      --sheet-shadow: rgba(42, 36, 31, 0.16);
      --grid-major:   rgba(42,36,31,0.10);
      --grid-minor:   rgba(42,36,31,0.04);
      --entity-color: #2A241F;
      --epoxy-color:  #a09080;
      --cut-color:    oklch(0.55 0.16 27);
      --hid-color:    rgba(42,36,31,0.30);
      /* V25-c — view-key accents toned down to share the warm chroma family.
         Section-A keeps the cool side of the wheel (slightly muted teal),
         Plan-B keeps the warm side (muted ochre). Both at ~0.04 chroma so
         they read as differentiation, not as colored interruption. */
      --section-a-accent: oklch(0.50 0.04 210);
      --plan-b-accent:    oklch(0.55 0.05 75);
      --cl-color:     oklch(0.55 0.16 27 / 0.45);
      --proj-line:    rgba(42,36,31,0.12);
      --crosshair-color: rgba(42,36,31,0.16);
      --crosshair-text:  rgba(42,36,31,0.55);
    }

    /* WARM DARK — V25 sibling. Same accent family on a warm charcoal
       surface. Sheet stays paper-cream so prints feel right. */
    body.theme-warm-dark {
      --paper:        #ECE6D7;
      --surface:      #1B1916;
      --surface-cool: #1F1E1B;
      --surface-2:    #232019;
      --surface-3:    #2B2820;
      --surface-4:    #35312A;

      --border:        #3A352C;
      --border-2:      #4A4438;
      --border-strong: #5E5746;

      --text:        #EFE7D5;
      --text-mute:   #B5AC97;
      --text-subtle: #877F6C;
      --text-faint:  #5C5447;

      --accent:       oklch(0.72 0.13 35);
      --accent-hover: oklch(0.78 0.13 35);
      --accent-press: oklch(0.68 0.13 35);
      --accent-bg:    oklch(0.72 0.13 35 / 0.14);
      --accent-bg-2:  oklch(0.72 0.13 35 / 0.22);
      --accent-brd:   oklch(0.72 0.13 35 / 0.50);
      --accent-ink:   #1B1916;

      --warn:    oklch(0.74 0.13 70);
      --danger:  oklch(0.65 0.17 27);
      --success: oklch(0.70 0.10 145);
      --info:    oklch(0.70 0.08 240);
      --focus-ring: oklch(0.72 0.13 35 / 0.50);

      /* DATUM canonical ladder (additive) — warm-dark "lamp-lit drafting table". */
      --paper-0: #232019;  --paper-1: #1B1916;  --paper-2: #2B2820;  --paper-3: #35312A;
      --ink-1: #EFE7D5;    --ink-2: #D8CFB9;    --ink-3: #B5AC97;    --ink-4: #877F6C;  --ink-5: #5C5447;
      --red-chop: #D2604F; --red-deep: #B5483A; --red-wash: #3A2A22;
      --blueprint: oklch(0.72 0.050 248);  --olive: oklch(0.74 0.045 128);
      --ochre:     oklch(0.78 0.060 73);    --plum:  oklch(0.74 0.040 345);
      --warn-bg:    oklch(0.74 0.13 70  / 0.16);  --danger-bg:  oklch(0.65 0.17 27  / 0.16);
      --success-bg: oklch(0.70 0.10 145 / 0.16);  --info-bg:    oklch(0.70 0.08 240 / 0.16);
      --shadow-plate: 3px 3px 0 0 rgba(0,0,0,0.40);

      --hover-bg:   rgba(239,231,213,0.05);
      --hover-bg-2: rgba(239,231,213,0.09);
      --active-bg:  var(--accent-bg);
      --active-brd: var(--accent-brd);
      --scrollbar:  rgba(239,231,213,0.22);
      --selected-color: var(--accent);
      --notch-glow: oklch(0.72 0.14 74);   /* GLT notch glow (amber ≠ terracotta selection) */

      /* V25 — darker modal veil for dark mode (deeper black scrim) */
      --modal-veil: rgba(0, 0, 0, 0.55);

      --shadow-hairline: inset 0 0 0 1px var(--border);
      --shadow-sm: 0 1px 0 rgba(0,0,0,0.30);
      --shadow-md: 0 1px 0 rgba(0,0,0,0.30),
                   0 6px 18px -8px rgba(0,0,0,0.45);
      --shadow-lg: 0 1px 0 rgba(0,0,0,0.30),
                   0 14px 36px -14px rgba(0,0,0,0.55),
                   0 2px 6px -2px rgba(0,0,0,0.35);
      --shadow-pop: var(--shadow-lg);

      --bg:  var(--surface);
      --bg2: var(--surface-2);
      --bg3: var(--surface-3);
      --brd: var(--border);
      --brd-subtle: var(--border);
      --ink:  var(--text);
      --mute: var(--text-mute);
      --detail-boundary: var(--accent-soft, var(--accent));
      --inputBg: var(--surface-3);

      --workspace-bg: var(--surface);
      --sheet-bg:     var(--paper);
      --sheet-border: #5E5746;
      --sheet-shadow: rgba(0, 0, 0, 0.55);
      --grid-major:   rgba(42,36,31,0.18);
      --grid-minor:   rgba(42,36,31,0.08);
      --entity-color: #2A241F;
      --epoxy-color:  #7a7a7a;
      --cut-color:    oklch(0.65 0.17 27);
      --hid-color:    rgba(42,36,31,0.45);
      /* V25-c — match warm-light: low-chroma warm-friendly view accents. */
      --section-a-accent: oklch(0.55 0.04 210);
      --plan-b-accent:    oklch(0.60 0.05 75);
      --cl-color:     oklch(0.65 0.17 27 / 0.55);
      --proj-line:    rgba(42,36,31,0.18);
      --crosshair-color: rgba(239,231,213,0.20);
      --crosshair-text:  rgba(239,231,213,0.62);
    }

    /* CLASSIC B&W — V21 alternate. White sheet, black ink, grey UI chrome. */
    body.theme-classic {
      /* Semantic V21 tokens */
      --surface:     #FAFAFA;
      --surface-2:   #FFFFFF;
      --surface-3:   #F2F2F2;
      --border:      #E0E0E0;
      --border-2:    #CCCCCC;
      --text:        #1A1A1A;
      --text-mute:   #666666;
      --text-subtle: #9A9A9A;
      --accent:      #2A6FC0;
      --accent-bg:   rgba(42,111,192,0.10);
      --accent-brd:  rgba(42,111,192,0.40);
      --warn:        #D97706;
      --danger:      #C83232;
      --success:     #16A34A;
      --focus-ring:  rgba(42,111,192,0.35);
      --shadow-sm:   0 1px 2px rgba(0,0,0,0.06), 0 0 1px rgba(0,0,0,0.08);
      --shadow-md:   0 4px 12px rgba(0,0,0,0.10), 0 0 1px rgba(0,0,0,0.08);
      --shadow-lg:   0 12px 32px rgba(0,0,0,0.15);

      /* Legacy V20 token aliases — so existing CSS rules keep working */
      --bg: var(--surface);
      --bg2: var(--surface-2);
      --bg3: var(--surface-3);
      --brd: var(--border);
      --brd-subtle: var(--border);
      --ink: var(--text);
      --mute: var(--text-mute);
      --detail-boundary: var(--accent-soft, var(--accent));
      --inputBg: var(--surface-2);
      --hover-bg: rgba(0,0,0,0.04);
      --active-bg: var(--accent-bg);
      --active-brd: var(--accent-brd);
      --scrollbar: rgba(0,0,0,0.15);
      --selected-color: var(--accent);
      --notch-glow: #D9852A;   /* GLT notch glow (amber ≠ blue selection) */

      /* Canvas engine tokens (drive drawing output) */
      --workspace-bg: #D6D6D6;
      --sheet-bg: #FFFFFF;
      --sheet-border: #999999;
      --sheet-shadow: rgba(0, 0, 0, 0.15);
      --grid-major: rgba(0,0,0,0.10); --grid-minor: rgba(0,0,0,0.04);
      --entity-color: #000000;
      --epoxy-color: #8090a0;
      --cut-color: #C83232; --hid-color: rgba(0,0,0,0.30);
      --section-a-accent: #008080; --plan-b-accent: #B8860B;
      --cl-color: rgba(200,0,0,0.45);
      --proj-line: rgba(0,0,0,0.12);
      --crosshair-color: rgba(0,0,0,0.15);
      --crosshair-text: rgba(0,0,0,0.5);
    }

    /* DARK — neutral charcoal IDE look. Sheet stays off-white (paper). */
    body.theme-dark {
      --surface:     #1A1D22;
      --surface-2:   #22262D;
      --surface-3:   #2A2F37;
      --border:      #2E3640;
      --border-2:    #3E4650;
      --text:        #EAEAEA;
      --text-mute:   #9AA0A8;
      --text-subtle: #6A7079;
      --accent:      #4A9EFF;
      --accent-bg:   rgba(74,158,255,0.15);
      --accent-brd:  rgba(74,158,255,0.50);
      --warn:        #F59E0B;
      --danger:      #F87171;
      --success:     #4ADE80;
      --focus-ring:  rgba(74,158,255,0.45);
      --shadow-sm:   0 1px 2px rgba(0,0,0,0.35), 0 0 0 1px rgba(0,0,0,0.20);
      --shadow-md:   0 4px 12px rgba(0,0,0,0.35);
      --shadow-lg:   0 12px 32px rgba(0,0,0,0.55);

      /* Legacy aliases */
      --bg: var(--surface);
      --bg2: var(--surface-2);
      --bg3: var(--surface-3);
      --brd: var(--border);
      --brd-subtle: var(--border);
      --ink: var(--text);
      --mute: var(--text-mute);
      --detail-boundary: var(--accent-soft, var(--accent));
      --inputBg: var(--surface-3);
      --hover-bg: rgba(255,255,255,0.06);
      --active-bg: var(--accent-bg);
      --active-brd: var(--accent-brd);
      --scrollbar: rgba(255,255,255,0.15);
      --selected-color: var(--accent);
      --notch-glow: #D9852A;   /* GLT notch glow (amber ≠ blue selection); sheet is off-white */

      /* Canvas engine — workspace dark, sheet off-white (paper), ink dark on paper */
      --workspace-bg: #0F1115;
      --sheet-bg: #ECEBE6;
      --sheet-border: #2E3640;
      --sheet-shadow: rgba(0, 0, 0, 0.55);
      --grid-major: rgba(0,0,0,0.10); --grid-minor: rgba(0,0,0,0.04);
      --entity-color: #1A1A1A;
      --epoxy-color: #606060;
      --cut-color: #C83232; --hid-color: rgba(0,0,0,0.35);
      --section-a-accent: #008080; --plan-b-accent: #8B6508;
      --cl-color: rgba(200,0,0,0.50);
      --proj-line: rgba(0,0,0,0.15);
      --crosshair-color: rgba(255,255,255,0.18);
      --crosshair-text: rgba(255,255,255,0.6);
    }

    /* BT — Bligh Tanner brand red. Retained from V20 default but opt-in. */
    body.theme-bt {
      --surface:     #7B1818;
      --surface-2:   #5A1212;
      --surface-3:   #6B1515;
      --border:      #9A3030;
      --border-2:    #A84040;
      --text:        #FFFFFF;
      --text-mute:   #FFCCCC;
      --text-subtle: #DD9999;
      --accent:      #4A9EFF;
      --accent-bg:   rgba(74,158,255,0.15);
      --accent-brd:  rgba(74,158,255,0.50);
      --warn:        #FBBF24;
      --danger:      #FCA5A5;
      --success:     #86EFAC;
      --focus-ring:  rgba(74,158,255,0.45);
      --shadow-sm:   0 1px 2px rgba(0,0,0,0.35);
      --shadow-md:   0 4px 12px rgba(0,0,0,0.35);
      --shadow-lg:   0 12px 32px rgba(0,0,0,0.55);

      /* Legacy aliases */
      --bg: var(--surface);
      --bg2: var(--surface-2);
      --bg3: var(--surface-3);
      --brd: var(--border);
      --brd-subtle: #8A2525;
      --ink: var(--text);
      --mute: var(--text-mute);
      --detail-boundary: var(--accent-soft, var(--accent));
      --inputBg: var(--surface-3);
      --hover-bg: rgba(255,255,255,0.08);
      --active-bg: var(--accent-bg);
      --active-brd: var(--accent-brd);
      --scrollbar: rgba(255,255,255,0.15);
      --selected-color: var(--accent);
      --notch-glow: #F2B05A;   /* GLT notch glow — light amber, pops on the dark-red sheet */

      /* Canvas engine — V20 brand palette */
      --workspace-bg: #4A0E0E;
      --sheet-bg: #5A1212;
      --sheet-border: #9A3030;
      --sheet-shadow: rgba(0, 0, 0, 0.55);
      --grid-major: rgba(255,255,255,0.06); --grid-minor: rgba(255,255,255,0.025);
      --entity-color: #FFFFFF;
      --epoxy-color: #909090;
      --cut-color: #FF6B6B; --hid-color: rgba(255,255,255,0.30);
      --section-a-accent: #4ECDC4; --plan-b-accent: #FFE66D;
      --cl-color: rgba(255,120,120,0.4);
      --proj-line: rgba(255,255,255,0.10);
      --crosshair-color: rgba(255,255,255,0.2);
      --crosshair-text: rgba(255,255,255,0.6);
    }

    body {
      /* V25 — Plex Sans is the UI face. Existing rules inherit unless they
         set font-family explicitly; legacy "system-ui" inline styles still
         resolve fine, they just won't be Plex until each region is refit. */
      font-family: var(--font-sans);
      font-size: var(--fs-md);
      background: var(--bg); color: var(--ink);
      height: 100vh; display: flex; flex-direction: column; overflow: hidden;
      font-feature-settings: "ss01", "cv05", "cv11";
      -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
    }

    /* V25 — Plex Mono for number fields and any opt-in .mono target.
       `tnum` keeps tabular figures aligned in coord readouts. */
    input[type="number"], .mono { font-family: var(--font-mono); font-feature-settings: "tnum"; }

    /* V25 — Plex Serif helper. Used sparingly: brand wordmark, modal H1,
       view labels, sheet number. Italic variant matches the Workshop-ledger
       title-block treatment. */
    .v25-serif       { font-family: var(--font-serif); }
    .v25-serif-italic{ font-family: var(--font-serif); font-style: italic; }

    /* ========== V21 DESIGN-SYSTEM CHROME PRIMITIVES ========== */
    /* All shell chrome reads from the V21 semantic tokens. Written once here
       and reused by the top bar, sheet tabs, mode switcher, palette tiles,
       inspector panel, status bar, dropdowns, chord overlay, etc. */

    /* ---- Icons (V21.11 professional stroke language) ---- */
    /* Primary stroke 1.25px on a 20×20 viewBox. Per-element stroke-width
       attributes override for secondary detail (0.9) or accent (1.5). */
    .icon { width: 20px; height: 20px; display: inline-block; flex-shrink: 0;
            fill: none; stroke: currentColor; stroke-width: 1.25;
            stroke-linecap: round; stroke-linejoin: round; }
    .icon-sm { width: 14px; height: 14px; stroke-width: 1.4; }
    .icon-lg { width: 28px; height: 28px; stroke-width: 1.25; }
    .icon-xl { width: 36px; height: 36px; stroke-width: 1.1; }
    .icon-fill { fill: currentColor; stroke: none; }

    /* ---- Top bar (V25 — drafting bench) ---- */
    .top-bar {
      display: flex; align-items: stretch;
      height: var(--bar-h); flex-shrink: 0;
      background: var(--surface-2);
      border-bottom: 1px solid var(--border);
      padding: 0 12px;
      gap: 12px;
      user-select: none;
    }
    /* Brand block: serif "SD" mark · vertical divider · name + version stack.
       Existing classes kept (.top-bar__brand, .logo-mark) so JS hooks survive;
       new descendants .brand__div / .brand__name / .brand__ver are additive. */
    .top-bar__brand {
      display: flex; align-items: center; gap: 10px;
      padding: 0 12px 0 2px;
      color: var(--text); white-space: nowrap;
      border-right: 1px solid var(--border);
      margin-right: 0;
    }
    .top-bar__brand .logo-mark {
      width: auto; height: auto; padding: 0;
      background: transparent; color: var(--text);
      font-family: var(--font-serif); font-weight: 600;
      font-size: 18px; letter-spacing: var(--tracking-tight);
      border-radius: 0;
    }
    .top-bar__brand .brand__div { width: 1px; height: 24px; background: var(--border); }
    .top-bar__brand .brand__txt { display: flex; flex-direction: column; line-height: 1.1; }
    .top-bar__brand .brand__name {
      font-size: var(--fs-sm); font-weight: 500;
      letter-spacing: var(--tracking-tight);
      color: var(--text);
    }
    .top-bar__brand .brand__ver {
      font-family: var(--font-mono); font-size: 9px;
      color: var(--text-subtle); letter-spacing: var(--tracking-wide);
      text-transform: uppercase; line-height: 1.2; margin-top: 2px;
    }
    .top-bar__spacer { flex: 1; }
    .top-bar__actions { display: flex; align-items: center; gap: 4px; }

    /* ---- Sheet tabs (V25 — warmed up, coral lid on active) ----
       Chrome-style multi-tab strip kept; restyled so the active tab reads
       as the doc-chip the design proposes (paper background, hairline
       border, coral underline) while preserving the multi-sheet workflow. */
    .sheet-tabs {
      display: flex; align-items: flex-end;
      gap: 2px; min-width: 0; overflow-x: auto;
      padding-top: 8px;
    }
    .sheet-tabs::-webkit-scrollbar { height: 4px; }
    .sheet-tabs::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 2px; }
    .sheet-tab {
      display: flex; align-items: center; gap: 10px;
      height: 30px; padding: 0 12px;
      background: var(--surface-3);
      border: 1px solid var(--border);
      border-bottom: none;
      border-top-left-radius: var(--r-2); border-top-right-radius: var(--r-2);
      font-size: var(--fs-sm); color: var(--text-mute);
      white-space: nowrap; max-width: 220px;
      cursor: pointer; position: relative;
      transition: background var(--t-fast), color var(--t-fast);
    }
    .sheet-tab:hover { background: var(--surface-2); color: var(--text); }
    .sheet-tab.active {
      background: var(--paper, var(--surface-2));
      color: var(--text);
      border-color: var(--border);
      z-index: 1;
    }
    /* Active-tab "lid" — covers the bottom border, then a coral underline above it */
    .sheet-tab.active::after {
      content: ""; position: absolute; left: -1px; right: -1px; bottom: -1px;
      height: 2px; background: var(--paper, var(--surface-2));
    }
    /* V25-c — bumped from 2px to 3px and full-width so the active-tab lid
       reads cleanly across the tab top (was almost invisible at 2px inset). */
    .sheet-tab.active::before {
      content: ""; position: absolute; left: 0; right: 0; top: 0;
      height: 3px; background: var(--accent);
      border-radius: var(--r-1) var(--r-1) 0 0;
    }
    .sheet-tab .sheet-tab__title {
      overflow: hidden; text-overflow: ellipsis; max-width: 130px;
      letter-spacing: var(--tracking-tight);
    }
    .sheet-tab .sheet-tab__dno {
      font-family: var(--font-mono); font-size: 10px; font-weight: 600;
      color: var(--text-subtle); letter-spacing: var(--tracking-wide);
      text-transform: uppercase;
    }
    .sheet-tab.active .sheet-tab__dno { color: var(--accent); }
    .sheet-tab .sheet-tab__close {
      width: 16px; height: 16px; display: grid; place-items: center;
      border-radius: var(--r-1); color: var(--text-subtle); font-size: 11px;
      opacity: 0; transition: opacity var(--t-fast), background var(--t-fast), color var(--t-fast);
    }
    .sheet-tab:hover .sheet-tab__close,
    .sheet-tab.active .sheet-tab__close { opacity: 1; }
    .sheet-tab__close:hover { background: var(--danger); color: var(--accent-ink, #fff); }
    .sheet-tab__add {
      display: grid; place-items: center; width: 28px; height: 30px;
      background: transparent; border: 1px solid transparent; border-bottom: none;
      border-top-left-radius: var(--r-2); border-top-right-radius: var(--r-2);
      color: var(--text-mute); cursor: pointer; font-size: 16px; line-height: 1;
      align-self: flex-end;
    }
    .sheet-tab__add:hover { background: var(--hover-bg); color: var(--text); }

    /* ---- File tabs (multi-file-workspace) ----
       Browser-style tabs in the top bar: one per OPEN FILE (a project / page set).
       Distinct from .sheet-tabs (pages live in the left rail now). Mirrors the
       .sheet-tab visual language so it themes across all five palettes. */
    .file-tabs {
      display: flex; align-items: center; gap: 2px;
      min-width: 0; overflow-x: auto; flex: 0 1 auto;
      margin-left: 10px;
    }
    .file-tabs::-webkit-scrollbar { height: 4px; }
    .file-tabs::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 2px; }
    .file-tab {
      display: flex; align-items: center; gap: 8px;
      height: 28px; padding: 0 10px;
      background: var(--surface-3);
      border: 1px solid var(--border);
      border-radius: var(--r-2);
      font-size: var(--fs-sm); color: var(--text-mute);
      white-space: nowrap; max-width: 200px;
      cursor: pointer; position: relative;
      transition: background var(--t-fast), color var(--t-fast);
    }
    .file-tab:hover { background: var(--surface-2); color: var(--text); }
    .file-tab.active {
      background: var(--paper, var(--surface-2));
      color: var(--text);
      border-color: var(--accent);
      z-index: 1;
    }
    .file-tab__name {
      overflow: hidden; text-overflow: ellipsis; max-width: 150px;
      letter-spacing: var(--tracking-tight);
    }
    /* unsaved-to-disk indicator (dot before the name) */
    .file-tab__dot {
      width: 6px; height: 6px; flex: 0 0 auto;
      border-radius: 50%; background: var(--accent);
    }
    .file-tab__close {
      width: 16px; height: 16px; display: grid; place-items: center;
      border-radius: var(--r-1); color: var(--text-subtle); font-size: 12px; line-height: 1;
      opacity: 0; transition: opacity var(--t-fast), background var(--t-fast), color var(--t-fast);
    }
    .file-tab:hover .file-tab__close,
    .file-tab.active .file-tab__close { opacity: 1; }
    .file-tab__close:hover { background: var(--danger); color: var(--accent-ink, #fff); }
    .file-tab__add {
      display: grid; place-items: center; width: 26px; height: 28px; flex: 0 0 auto;
      background: transparent; border: 1px solid transparent;
      border-radius: var(--r-2);
      color: var(--text-mute); cursor: pointer; font-size: 17px; line-height: 1;
      margin-left: 2px;
    }
    .file-tab__add:hover { background: var(--hover-bg); color: var(--text); }

    /* ---- New-file landing overlay (multi-file-workspace) ----
       Centred over the drawing area when the active file has zero pages. */
    .file-landing {
      position: absolute; inset: 0; z-index: 40;
      display: grid; place-items: center;
      background: var(--surface, #ece7df);
    }
    .file-landing__card {
      display: flex; flex-direction: column; align-items: center; gap: 6px;
      padding: 40px 56px;
      background: var(--surface-2); border: 1px solid var(--border);
      border-radius: var(--r-3, 10px);
      box-shadow: var(--shadow-2, 0 8px 30px rgba(0,0,0,0.10));
      text-align: center;
    }
    .file-landing__title {
      font-size: var(--fs-lg, 17px); font-weight: 600; color: var(--text);
      letter-spacing: var(--tracking-tight);
    }
    .file-landing__sub {
      font-size: var(--fs-sm); color: var(--text-mute); margin-bottom: 14px;
    }
    .file-landing__actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
    .file-landing__btn {
      padding: 9px 16px; border-radius: var(--r-2);
      border: 1px solid var(--border); background: var(--surface-3);
      color: var(--text); font-size: var(--fs-sm); cursor: pointer;
      transition: background var(--t-fast), border-color var(--t-fast);
    }
    .file-landing__btn:hover { background: var(--hover-bg); border-color: var(--accent); }
    .file-landing__btn--primary {
      background: var(--accent); color: var(--accent-ink, #fff); border-color: var(--accent);
    }
    .file-landing__btn--primary:hover { filter: brightness(1.05); background: var(--accent); }
    .file-landing__btn--soon { opacity: 0.55; }

    /* ---- Mode switcher (V25 — segmented, mono caps) ----
       Holds the Model / Draw / Annotate tabs. Restyled to match the design's
       .seg pill: smaller, mono-caps labels, paper-on-active. */
    .mode-switcher {
      display: inline-flex; align-self: center;
      background: var(--surface-3);
      border: 1px solid var(--border);
      border-radius: var(--r-2); padding: 2px;
      height: 28px;
    }
    .mode-seg {
      display: flex; align-items: center; gap: 6px;
      padding: 0 12px; border-radius: var(--r-1); cursor: pointer;
      font-family: var(--font-mono); font-size: 11px; font-weight: 500;
      color: var(--text-mute);
      border: none; background: transparent;
      transition: background var(--t-fast), color var(--t-fast), box-shadow var(--t-fast);
      letter-spacing: var(--tracking-wide);
      text-transform: uppercase;
    }
    .mode-seg:hover { color: var(--text); }
    .mode-seg.active {
      background: var(--surface);
      color: var(--text);
      box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--border);
    }
    .mode-seg .icon { width: 14px; height: 14px; }

    /* ---- V25 Sheet-mode (3D | 2D) switcher — sits left of the .mode-switcher.
       Same .seg treatment, but active state uses the coral fill so the
       global drawing-mode toggle reads as a "primary" choice. */
    /* .tb-style-switcher (title-block style: Sketch | Bottom | Right) reuses
       the exact sheet-mode treatment so it reads as a sibling of the 2D/3D
       toggle it sits beside. */
    .sheet-mode-switcher, .tb-style-switcher {
      display: inline-flex; align-self: center;
      background: var(--surface-3);
      border: 1px solid var(--border);
      border-radius: var(--r-2); padding: 2px;
      height: 28px;
      margin-right: 4px;
    }
    .sheet-mode-seg, .tb-style-seg {
      display: flex; align-items: center; justify-content: center;
      min-width: 36px; padding: 0 10px; border-radius: var(--r-1); cursor: pointer;
      font-family: var(--font-mono); font-size: 11px; font-weight: 600;
      color: var(--text-mute);
      border: none; background: transparent;
      transition: background var(--t-fast), color var(--t-fast), box-shadow var(--t-fast);
      letter-spacing: var(--tracking-wide);
      text-transform: uppercase;
    }
    .sheet-mode-seg:hover, .tb-style-seg:hover { color: var(--text); }
    .sheet-mode-seg.active, .tb-style-seg.active {
      background: var(--surface);
      color: var(--text);
      box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--accent-brd);
    }
    /* When the active sheet is in 2D mode, hide the Model/Draw/Annotate tabs
       since the 2D palette has its own structure. */
    body.sheet-2d #modeSwitcher { display: none; }
    body.sheet-2d .sheet-mode-seg.active {
      /* Subtle "calm" feedback when 2D is the active mode (no chrome alarm) */
      box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--success);
    }
    /* title-block-styles — sub-headers inside the Edit Title Block dialog. */
    .tb-dlg-group {
      font: 600 11px var(--font-mono, monospace);
      letter-spacing: var(--tracking-wide, .06em); text-transform: uppercase;
      color: var(--text-mute); margin: 6px 0 1px;
      border-bottom: 1px solid var(--border); padding-bottom: 3px;
    }

    /* V25 — 2D-mode palette extras (compact tile rows for materials etc.) */
    .palette-group__hint {
      font-size: 10px; color: var(--text-mute);
      padding: 0 6px 4px; line-height: 1.3;
    }

    /* ---- Top-bar tool cluster (V25 — Snap / Ortho / Grid as icon toggles).
       Same hover/active treatment as .icon-btn but presented as a tighter
       contiguous cluster with .tools wrapper. Existing IDs (#sbSnap,
       #sbOrtho, #sbGrid) preserved on the elements themselves so legacy
       click handlers still fire. */
    .tools { display: inline-flex; align-items: center; gap: 2px; }
    .tool {
      width: 28px; height: 28px;
      display: grid; place-items: center;
      background: transparent; border: 1px solid transparent;
      border-radius: var(--r-1);
      color: var(--text-mute); cursor: pointer;
      padding: 0;
      transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
    }
    .tool:hover { background: var(--hover-bg); color: var(--text); }
    .tool.active {
      background: var(--accent-bg);
      border-color: var(--accent-brd);
      color: var(--accent-press, var(--accent));
    }
    .tool .icon { width: 16px; height: 16px; }
    .tool svg { width: 16px; height: 16px; fill: none; stroke: currentColor;
                stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

    /* ---- Icon-button (V25 — quieter 28×28, hairline radius) ----
       Used in top-bar actions and inside dialogs. Borders only on active /
       hover states; no shadow. */
    .icon-btn {
      display: inline-grid; place-items: center;
      width: 28px; height: 28px;
      background: transparent; border: 1px solid transparent;
      border-radius: var(--r-1); color: var(--text-mute);
      cursor: pointer; padding: 0;
      transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
    }
    .icon-btn:hover { background: var(--hover-bg); color: var(--text); border-color: transparent; }
    .icon-btn.active {
      background: var(--accent-bg); color: var(--accent-press, var(--accent));
      border-color: var(--accent-brd);
    }
    .icon-btn .icon { width: 16px; height: 16px; }

    /* ---- Trace paper overlay ----
       The TRACE button's active state is canary (hardcoded, not a theme
       token — canary is canary in every theme), matching the yellow paper
       it lays down. The #traceBar options panel mirrors the inline
       #v25OptionsBar styling (built in js/72) but lives in CSS so it can
       be themed and so its range slider picks up the accent. */
    .trace-btn.active { background: #f6e27e; border-color: #e6cb56; color: #6b5712; }
    .trace-btn.active:hover { background: #f6e27e; border-color: #e6cb56; color: #6b5712; }
    #traceBar {
      position: absolute; top: 8px; left: 50%; transform: translateX(-50%);
      background: var(--surface-2); color: var(--text);
      border: 1px solid var(--border); border-radius: 8px;
      padding: 6px 10px; font: 12px var(--font-sans, system-ui);
      display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
      z-index: 51; box-shadow: var(--shadow-pop, 0 2px 8px rgba(0,0,0,.1));
      max-width: 90%;
    }
    #traceBar input[type=range] { accent-color: var(--accent); cursor: pointer; }
    #traceBar input[type=range]:focus-visible {
      outline: 2px solid var(--accent-brd); outline-offset: 2px; border-radius: 4px;
    }

    /* ---- V25 orientation row ----
       Icon buttons in the 2D-mode quick-options bar, one per standard
       orientation of the active member type. Replaces the Aspect + PFC
       Open-face dropdowns. Resting state sits flat on the bar (--surface-2);
       active reuses the accent treatment shared by .icon-btn / .tile. The
       glyph tints via currentColor (.icon stroke). */
    .v25-orient-btn {
      display: inline-grid; place-items: center;
      width: 30px; height: 26px;
      background: transparent; border: 1px solid var(--border);
      border-radius: var(--r-1); color: var(--text-mute);
      cursor: pointer; padding: 0;
      transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
    }
    .v25-orient-btn:hover { background: var(--surface-3); color: var(--text); }
    .v25-orient-btn.active {
      background: var(--accent-bg); color: var(--accent-press, var(--accent));
      border-color: var(--accent-brd);
    }
    .v25-orient-btn .icon { width: 18px; height: 18px; }

    /* ---- V25 horizontal menu strip (File / Edit / View) ---- */
    .menubar { display: inline-flex; align-items: center; gap: 0; }
    .menubar__item {
      background: transparent; border: 0;
      padding: 6px 9px;
      font-family: var(--font-sans); font-size: var(--fs-sm); font-weight: 400;
      color: var(--text-mute);
      border-radius: var(--r-1);
      cursor: pointer;
      transition: background var(--t-fast), color var(--t-fast);
      letter-spacing: var(--tracking-tight);
    }
    .menubar__item:hover { background: var(--hover-bg); color: var(--text); }
    .menubar__item.open  { background: var(--hover-bg-2, var(--hover-bg)); color: var(--text); }
    @media (max-width: 1280px) {
      .menubar__item { padding: 6px 6px; font-size: var(--fs-xs); }
    }
    @media (max-width: 1100px) {
      .menubar { display: none; }
    }

    /* ---- Dropdown menu (anchored under menubar items / context menus) ---- */
    .menu {
      position: absolute; z-index: 1500;
      min-width: 200px;
      background: var(--surface-2);
      border: 1px solid var(--border);
      border-radius: var(--r-3);
      box-shadow: var(--shadow-pop, var(--shadow-md));
      padding: 6px;
      display: none;
    }
    .menu.open { display: block; }
    .menu-item {
      display: flex; align-items: center; gap: 10px;
      padding: 6px 10px; border-radius: var(--r-1);
      font-family: var(--font-sans); font-size: var(--fs-sm); color: var(--text);
      cursor: pointer; white-space: nowrap;
      letter-spacing: var(--tracking-tight);
    }
    .menu-item:hover { background: var(--accent-bg); color: var(--accent-press, var(--accent)); }
    .menu-item .icon { width: 14px; height: 14px; opacity: 0.8; }
    .menu-item .shortcut {
      margin-left: auto; font-size: var(--fs-2xs);
      color: var(--text-subtle);
      font-family: var(--font-mono); letter-spacing: var(--tracking-wide);
    }
    .menu-sep { height: 1px; background: var(--border); margin: 4px -2px; }
    /* V25-layout-overhaul — disabled placeholder items.
       Visually faded; the menubar click handler short-circuits on them so
       the menu stays open and nothing fires. */
    .menu-item.disabled {
      opacity: 0.42;
      cursor: default;
    }
    .menu-item.disabled:hover {
      background: transparent;
      color: var(--text);
    }
    .menu-item.disabled .shortcut {
      font-style: italic;
    }
    .menu-heading {
      padding: 6px 10px 2px;
      font-family: var(--font-mono); font-size: 9px;
      color: var(--text-subtle); text-transform: uppercase;
      letter-spacing: var(--tracking-caps);
    }

    /* ---- Right palette shell (V25 — design's drafting-pegboard) ----
       Lives on the right edge of the workspace. Surface-2 panel, hairline
       left border, vertical stack of groups divided by hairlines. Tiles
       sit on paper-cream with a glyph + mono shortcut hint. */
    .palette {
      flex-shrink: 0;
      background: var(--surface-2);
      border-left: 1px solid var(--border);
      display: flex; flex-direction: column;
      overflow-y: auto; user-select: none;
      min-height: 0;
    }
    .palette::-webkit-scrollbar { width: 6px; }
    .palette::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 3px; }

    .palette-group { padding: 8px 10px; }
    .palette-group + .palette-group { border-top: 1px solid var(--border); margin-top: 0; padding-top: 8px; }
    .palette-group__title {
      font-family: var(--font-mono); font-size: 9px; font-weight: 500;
      letter-spacing: var(--tracking-caps); text-transform: uppercase;
      color: var(--text-subtle);
      padding: 0 2px 6px;
    }
    .palette-grid {
      display: grid; grid-template-columns: repeat(2, 1fr);
      gap: 4px;
    }

    /* ---- Tile (V25 — paper-on-panel) ----
       Two-column grid in the 172 px palette gives tiles ~70 px wide. Glyph
       (~28 px), label below (sans), optional shortcut hint (top-right mono).
       Active = accent-bg wash + accent-brd hairline + accent-press text.
       Hover = quiet border-color shift, no shadow. */
    .tile {
      position: relative;
      display: flex; flex-direction: column;
      align-items: center; justify-content: center;
      gap: 2px;
      min-height: 56px; padding: 6px 6px 5px;
      background: var(--paper, var(--surface));
      border: 1px solid var(--border);
      border-radius: var(--r-1);
      cursor: pointer;
      transition: background var(--t-fast), border-color var(--t-fast),
                  color var(--t-fast), transform 0.04s;
      /* V25-d — --paper-ink (warm graphite) instead of --text, so the
         tile glyph stays dark on cream paper in BOTH light and dark
         modes (--text becomes cream in dark, which would vanish here). */
      color: var(--paper-ink);
      overflow: hidden;
    }
    .tile:hover {
      border-color: var(--border-2);
      background: var(--paper, var(--surface));
      box-shadow: none;
    }
    .tile:active { transform: scale(0.97); }
    .tile.active {
      background: var(--accent-bg);
      border-color: var(--accent-brd);
      color: var(--accent-press, var(--accent));
      box-shadow: none;
    }
    .tile__icon {
      flex: 1; display: grid; place-items: center; width: 100%;
      color: inherit; min-height: 0;
    }
    .tile.active .tile__icon { color: var(--accent-press, var(--accent)); }
    /* V25-c — glyph bumped from 24 → 28 to match the design's drafting
       pegboard scale; gives the icon room to breathe in the 56-px tile. */
    .tile__icon .icon { width: 28px; height: 28px; stroke-width: 1.25; }
    /* text-preview icons (Detail title / Section title) render a literal
       miniature of what the tool draws, so they need a wider, shorter box. */
    .tile__icon .icon.icon-tpv { width: 50px; height: 28px; stroke-width: 1; }
    .tile.has-sub { min-height: 64px; }
    .tile__label {
      /* V25-c — flex container for {text + optional chev}. Text-overflow
         lives on the INNER text span (see the > span:first-child rule below)
         because text-overflow:ellipsis only fires on the element with the
         overflowing inline content. The previous version put it on this
         flex container, which then clipped centered text on BOTH sides.
         V25-d — --paper-ink so labels stay dark on cream paper in dark mode. */
      font-family: var(--font-mono); font-size: var(--fs-2xs); font-weight: 500;
      color: var(--paper-ink);
      line-height: 1;
      max-width: 100%; min-width: 0;
      display: flex; align-items: center; gap: 2px; justify-content: center;
      padding-top: 2px;
      letter-spacing: -0.01em;
    }
    /* The text span (first child) — shrinks with ellipsis. */
    .tile__label > span:first-child {
      flex: 0 1 auto; min-width: 0;
      overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
      text-align: center;
    }
    /* The picker chevron (when present) — never shrink. */
    .tile__label > .tile__chev { flex: 0 0 auto; }
    .tile.active .tile__label { color: var(--accent-press, var(--accent)); font-weight: 600; }
    /* Optional mono shortcut hint pinned to top-right of a tile (renderer can
       opt in by setting a .tile__hint child). Inert if absent. */
    .tile__hint {
      position: absolute; top: 4px; right: 5px;
      font-family: var(--font-mono); font-size: 9px;
      color: var(--text-faint, var(--text-subtle));
      letter-spacing: var(--tracking-wide);
      pointer-events: none;
    }
    .tile__chev {
      font-size: 7px; opacity: 0.55;
      padding: 1px 2px; margin-right: -2px;
      border-radius: 2px; cursor: pointer;
    }
    .tile__chev:hover { background: var(--hover-bg-2, rgba(0,0,0,0.10)); opacity: 1; }
    .tile.placeholder { opacity: 0.38; cursor: help; }
    .tile.placeholder:hover {
      opacity: 0.55; border-color: var(--border); background: var(--surface-3);
      box-shadow: none;
    }
    .tile__soon {
      position: absolute; bottom: 1px; right: 1px;
      font-size: 7px; font-weight: 700; letter-spacing: 0.03em;
      padding: 0 3px; border-radius: 2px; line-height: 1.3;
      background: var(--text-mute); color: var(--surface-2);
    }

    /* ---- Favourites strip (V25 — quiet pinned-tools row) ----
       Sits above the regular palette groups. 4-column grid of small tiles
       (paper-cream, hairline border) with a coral corner clip when pinned. */
    .favourites {
      display: grid; grid-template-columns: repeat(4, 1fr);
      gap: 4px; padding: 4px 0 0;
    }
    .fav-tile {
      position: relative;
      display: grid; place-items: center;
      height: 32px; border-radius: var(--r-1);
      background: var(--paper, var(--surface));
      border: 1px solid var(--border);
      cursor: pointer;
      /* V25-d — paper-ink so favourite glyphs stay readable in dark mode. */
      color: var(--paper-ink);
      transition: background var(--t-fast), border-color var(--t-fast);
    }
    .fav-tile:hover { background: var(--accent-bg); border-color: var(--accent-brd); }
    .fav-tile .icon { width: 16px; height: 16px; }
    .fav-tile__label { display: none; }
    .fav-tile.pinned::after {
      content: ""; position: absolute; top: 1px; right: 1px;
      width: 0; height: 0; border-style: solid;
      border-width: 0 4px 4px 0;
      border-color: transparent var(--accent) transparent transparent;
    }

    /* ---- Inspector panel (V21.10 compact) ---- */
    .inspector {
      flex-shrink: 0; width: 260px;
      background: var(--surface);
      border-left: 1px solid var(--border);
      display: flex; flex-direction: column;
      overflow-y: auto; user-select: none;
    }
    .inspector::-webkit-scrollbar { width: 6px; }
    .inspector::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 3px; }
    .insp-section { padding: 7px 10px; }
    .insp-section + .insp-section { border-top: 1px solid var(--border); }
    .insp-title {
      font-size: 9px; font-weight: 700; letter-spacing: 0.08em;
      text-transform: uppercase; color: var(--text-subtle);
      margin-bottom: 5px;
    }
    .insp-header {
      padding: 9px 10px 7px;
      border-bottom: 1px solid var(--border);
      background: var(--surface-2);
    }
    .insp-header .insp-eyebrow {
      font-size: 9px; color: var(--text-subtle);
      text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 1px;
    }
    .insp-header .insp-h1 {
      font-size: 13px; font-weight: 600; color: var(--text); letter-spacing: -0.01em;
    }
    .insp-field { display: flex; flex-direction: column; gap: 2px; margin-bottom: 5px; }
    .insp-field > label {
      font-size: 9.5px; color: var(--text-mute); font-weight: 500;
    }
    .insp-field > input, .insp-field > select, .insp-field > textarea {
      width: 100%; min-width: 0;
      padding: 3px 6px; font-size: 11.5px;
      background: var(--surface-2); color: var(--text);
      border: 1px solid var(--border); border-radius: 4px;
      height: 24px;
    }
    .insp-field > textarea { height: auto; min-height: 44px; resize: vertical; }
    .insp-field > input:focus, .insp-field > select:focus, .insp-field > textarea:focus {
      outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px var(--focus-ring);
    }
    /* Read-only property fields (e.g. v2 plate material / geometry) read as
       locked, not editable — muted fill + no focus ring. */
    .insp-field > input[readonly] {
      background: var(--surface-3); color: var(--text-mute); cursor: default;
    }
    .insp-field > input[readonly]:focus {
      border-color: var(--border); box-shadow: none;
    }
    .insp-row { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
    .insp-row.triple { grid-template-columns: 1.6fr 0.8fr 1fr; }
    .insp-row .insp-field { margin-bottom: 0; }
    .insp-btn {
      display: inline-flex; align-items: center; gap: 6px;
      padding: 6px 10px; font-size: 11px;
      background: var(--surface-2); color: var(--text);
      border: 1px solid var(--border); border-radius: 5px;
      cursor: pointer; font-weight: 500;
    }
    .insp-btn:hover { background: var(--accent-bg); border-color: var(--accent-brd); color: var(--accent); }
    .insp-btn.danger:hover { background: var(--danger); border-color: var(--danger); color: var(--accent-ink, #fff); }
    .insp-btn.primary {
      background: var(--accent); color: var(--accent-ink, #fff); border-color: var(--accent-press, var(--accent));
    }
    .insp-btn.primary:hover { background: var(--accent-hover, var(--accent)); }

    /* ---- Status bar (V25 — mono masthead) ----
       28px tall, surface-2, hairline top border. Mono caps for the small
       labels, tabular-figure mono for values. Selects in the bar drop the
       boxy chrome and read as inline data. The right-side .sb-flex still
       holds the count chips and tool indicator (preserved). */
    .status-bar {
      display: flex; align-items: center;
      height: var(--status-h); flex-shrink: 0;
      background: var(--surface-2);
      border-top: 1px solid var(--border);
      padding: 0 14px;
      gap: 18px;
      font-size: var(--fs-xs); color: var(--text-mute);
      font-family: var(--font-mono);
      user-select: none;
    }
    .status-bar .sb-group { display: flex; align-items: center; gap: 8px; }
    .status-bar .sb-divider { width: 1px; height: 12px; background: var(--border); }
    .status-bar .sb-coord { font-family: var(--font-mono); font-size: var(--fs-xs); }
    .status-bar .sb-coord span {
      margin-right: 2px; color: var(--text-subtle);
      letter-spacing: var(--tracking-caps);
    }
    .status-bar .sb-coord span[id] { color: var(--text); margin-right: 6px; letter-spacing: 0; }
    /* Inline selects (Scale / Grid / Nudge) — read as data, not as chrome. */
    .status-bar select {
      background: transparent; color: var(--text);
      border: 1px solid var(--border);
      border-radius: var(--r-1); height: 20px;
      font: 500 var(--fs-xs)/1 var(--font-mono);
      padding: 0 4px;
      letter-spacing: var(--tracking-wide);
    }
    .status-bar select:hover { border-color: var(--border-2); }
    .status-bar label > span {
      color: var(--text-subtle); font-size: 9px;
      letter-spacing: var(--tracking-caps); text-transform: uppercase;
    }
    .status-bar .sb-flex { margin-left: auto; display: flex; align-items: center; gap: 10px; }
    /* Page navigator (‹ N / total ›) — multi-file-workspace. Click arrows to step
       pages; mirrors Shift+scroll. Sits left of the right-aligned status chips. */
    .status-bar .sb-pagenav { gap: 3px; }
    .sb-pagenav__btn {
      display: grid; place-items: center;
      width: 18px; height: 18px; padding: 0;
      border: 1px solid var(--border); border-radius: var(--r-1);
      background: var(--surface-3); color: var(--text);
      font-size: 13px; line-height: 1; cursor: pointer;
      transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
    }
    .sb-pagenav__btn:hover:not(:disabled) { background: var(--hover-bg); border-color: var(--accent); color: var(--accent); }
    .sb-pagenav__btn:disabled { opacity: 0.35; cursor: default; }
    .sb-pagenav__label {
      min-width: 46px; text-align: center;
      font-family: var(--font-mono); font-size: 9px; font-weight: 600;
      color: var(--text); letter-spacing: var(--tracking-wide);
    }
    /* Status chips (statusTool, count chips, statusScale) — still semantically
       chips but now as quiet mono pills aligned to the design vocabulary. */
    .status-bar .sb-chip {
      padding: 2px 8px; border-radius: var(--r-pill);
      font-family: var(--font-mono); font-size: 9px; font-weight: 500;
      background: var(--surface-3); color: var(--text);
      letter-spacing: var(--tracking-wide); text-transform: uppercase;
      border: 1px solid var(--border);
    }
    /* Saved-state group — green dot + mono timestamp. .sb-group--ok class
       is used by the design's status-bar variant; we adopt it here as an
       additive class for the new save-indicator group. */
    .status-bar .sb-group--ok .sb-dot {
      width: 6px; height: 6px; border-radius: 50%;
      background: var(--success);
      display: inline-block;
    }
    .status-bar .sb-group--ok .sb-val { color: var(--success); }

    /* ---- Size-picker dropdown ---- */
    .picker {
      position: absolute; z-index: 1600;
      width: 280px; max-height: 360px;
      background: var(--surface-2);
      border: 1px solid var(--border);
      border-radius: 8px;
      box-shadow: var(--shadow-md);
      display: none; flex-direction: column;
      overflow: hidden;
    }
    .picker.open { display: flex; }
    .picker__search {
      width: 100%; padding: 8px 10px;
      background: var(--surface-2); color: var(--text);
      border: none; border-bottom: 1px solid var(--border);
      font-size: 12px; outline: none;
    }
    .picker__list { flex: 1; overflow-y: auto; padding: 4px 0; }
    .picker__list::-webkit-scrollbar { width: 6px; }
    .picker__list::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 3px; }
    .picker__series {
      padding: 6px 12px 2px; font-size: 10px; font-weight: 600;
      color: var(--text-subtle); text-transform: uppercase; letter-spacing: 0.08em;
    }
    .picker__item {
      display: flex; align-items: center; gap: 8px;
      padding: 6px 14px; font-size: 12px;
      color: var(--text); cursor: pointer;
    }
    .picker__item:hover, .picker__item.focus { background: var(--accent-bg); color: var(--accent); }
    .picker__item .star { color: var(--warn); font-size: 10px; margin-left: auto; }
    /* "More sizes" expander — reveals the rarely-used small-size tail in place. */
    .picker__more {
      display: flex; align-items: center; justify-content: center; gap: 6px;
      margin: 4px 10px 6px; padding: 6px 10px;
      font-size: 11px; font-weight: 600; letter-spacing: 0.02em;
      color: var(--accent); cursor: pointer;
      border: 1px dashed var(--border-2); border-radius: 6px;
    }
    .picker__more:hover { background: var(--accent-bg); }

    /* ---- Chord overlay (keyboard chord prompt) ---- */
    .chord-overlay {
      position: fixed; z-index: 1800;
      top: 50%; left: 50%; transform: translate(-50%, -50%);
      background: var(--surface-2);
      border: 1px solid var(--border);
      border-radius: 10px;
      box-shadow: var(--shadow-lg);
      padding: 12px 16px; min-width: 280px;
      display: none; color: var(--text);
    }
    .chord-overlay.open { display: block; }
    .chord-overlay h3 {
      font-size: 11px; font-weight: 600; letter-spacing: 0.1em;
      text-transform: uppercase; color: var(--text-subtle);
      margin-bottom: 10px;
    }
    .chord-row {
      display: flex; align-items: center; gap: 10px;
      padding: 4px 2px; font-size: 12px;
    }
    .chord-row kbd {
      display: inline-grid; place-items: center;
      min-width: 20px; padding: 2px 6px;
      background: var(--surface-3); border: 1px solid var(--border);
      border-radius: 4px; font-size: 11px; font-weight: 700;
      font-family: var(--font-mono);
    }
    .chord-row.soon { opacity: 0.5; }
    .chord-overlay .chord-hint {
      margin-top: 10px; padding-top: 8px;
      border-top: 1px solid var(--border);
      font-size: 10px; color: var(--text-subtle);
    }

    /* ---- Placeholder popover ---- */
    .soon-popover {
      position: absolute; z-index: 1700;
      background: var(--surface-2); border: 1px solid var(--border);
      border-radius: 8px; box-shadow: var(--shadow-md);
      padding: 12px 14px; max-width: 260px;
      display: none;
    }
    .soon-popover.open { display: block; }
    .soon-popover h4 {
      font-size: 12px; font-weight: 600; color: var(--text);
      margin-bottom: 4px;
    }
    .soon-popover p {
      font-size: 11px; color: var(--text-mute); line-height: 1.5;
    }
    .soon-popover .version-tag {
      display: inline-block; margin-top: 8px;
      padding: 2px 6px; border-radius: 3px;
      background: var(--accent-bg); color: var(--accent);
      font-size: 10px; font-weight: 600;
    }

    /* ========== TOOLBAR ========== */
    .toolbar {
      padding: 0 8px; background: var(--bg2);
      border-bottom: 1px solid var(--brd);
      display: flex; align-items: center; flex-shrink: 0; height: 36px;
      gap: 2px; user-select: none;
    }
    .toolbar-title {
      font-size: 11px; font-weight: 600; color: var(--mute);
      padding: 0 8px 0 4px; white-space: nowrap; letter-spacing: -0.01em;
    }
    .toolbar-group { display: flex; gap: 1px; align-items: center; }
    .tool-btn {
      font-size: 10px; padding: 4px 7px; border: 1px solid transparent;
      border-radius: 4px; background: transparent; color: var(--ink);
      cursor: pointer; font-weight: 500; min-width: 26px; text-align: center;
      transition: all 0.1s; line-height: 1.2;
    }
    .tool-btn:hover { background: var(--hover-bg); border-color: var(--brd-subtle); }
    .tool-btn.active { background: var(--active-bg); border-color: var(--active-brd); color: var(--selected-color); }
    .toolbar-sep { width: 1px; height: 16px; background: var(--brd); margin: 0 4px; flex-shrink: 0; }
    .toolbar-label { font-size: 9px; color: var(--mute); margin-right: 2px; }
    select, input[type="number"], input[type="text"] {
      font-size: 10px; padding: 2px 4px; border: 1px solid var(--brd);
      border-radius: 3px; background: var(--inputBg); color: var(--ink); min-width: 48px;
      height: 22px;
    }
    select:focus, input:focus { outline: none; border-color: var(--selected-color); }
    #themeBtn {
      font-size: 9px; padding: 3px 8px; border: 1px solid var(--brd);
      border-radius: 3px; background: transparent; color: var(--mute);
      cursor: pointer; margin-left: auto; white-space: nowrap;
    }
    #themeBtn:hover { background: var(--hover-bg); color: var(--ink); }

    /* ========== MAIN LAYOUT (V25 — rail | handle | canvas | palette) ==========
       Per the V25 design, the tile palette moved from left-of-canvas to
       right-of-canvas. HTML order changes correspondingly (palette is now
       after #canvas-container). The right Inspector aside is still hidden;
       its content is reparented into the rail's Settings tab on init.
       Rail width is the CSS variable --bb-rail-w (drag handle resizes it). */
    .main {
      display: grid;
      /* V25-layout-overhaul — palette column removed; tools live in the rail Draw tab. */
      grid-template-columns: var(--bb-rail-w, 280px) 6px 1fr;
      flex: 1; min-height: 0;
    }
    .main.bb-rail-collapsed { grid-template-columns: 0 6px 1fr; }
    .main.bb-rail-collapsed .bb-rail { display: none; }
    .main.inspector-collapsed { /* legacy class kept so existing toggles don't error */ }
    /* Hide only the original right-side aside placement (direct child of .main).
       After reparentInspectorIntoSettings() moves #inspectorRoot into the rail
       Settings tab, it's no longer a direct child and therefore stays visible. */
    .main > .inspector { display: none !important; }
    /* V25-layout-overhaul — right palette hidden; #paletteRoot/#paletteGroups
       remain in DOM (legacy renderers still call into them). */
    .main .palette { display: none !important; }

    /* V25-layout-overhaul — Draw rail tab uses a 4-column tile grid that
       reuses the .palette-grid / .tile / .palette-group__title styles for
       visual consistency with the legacy palette. Scrolls if it overflows. */
    .bb-rail__panel.bb-draw { padding: 0; overflow-y: auto; }
    .bb-rail__panel.bb-draw::-webkit-scrollbar { width: 6px; }
    .bb-rail__panel.bb-draw::-webkit-scrollbar-thumb {
      background: var(--border-2); border-radius: 3px;
    }
    .bb-rail__panel.bb-draw .palette-group { padding: 8px 10px; }
    .bb-rail__panel.bb-draw .palette-group + .palette-group {
      border-top: 1px solid var(--border); margin-top: 0; padding-top: 8px;
    }
    .bb-rail__panel.bb-draw .palette-grid {
      grid-template-columns: repeat(4, 1fr);
      gap: 4px;
    }
    /* ===== Toolbox refresh (slider-row rebuild) — three global sliders
       (Density / Size / Text), collapsible families and pointer-drag reorder.
       Tile sizing is calc()+clamp() off the scalar vars --bb-D / --bb-S / --bb-T
       (set by JS on #bbDrawHost) plus a per-family --bb-m, so the sliders update
       everything live with no re-render. Replaces the old fixed density-slider +
       per-family JS sizing. ===== */

    /* Host seeds the scalar vars and derives the density-driven spacing via a CSS
       lerp (loose @ D=0 → tight @ D=1). JS overrides --bb-D/--bb-S/--bb-T inline. */
    #bbDrawHost {
      position: relative;                  /* anchor for the absolute drag dropbar */
      --bb-S: 1; --bb-T: 1; --bb-D: .5;
      --bb-gap:     calc(5px  + (2px  - 5px ) * var(--bb-D, .5));   /* grid gap   5→2 */
      --bb-tilepad: calc(7px  + (3px  - 7px ) * var(--bb-D, .5));   /* tile pad   7→3 */
      --bb-fampad:  calc(10px + (6px  - 10px) * var(--bb-D, .5));   /* family pad 10→6 */
      --bb-hdrpad:  calc(6px  + (2px  - 6px ) * var(--bb-D, .5));   /* header pad 6→2 */
      --bb-secmrg:  calc(4px  + (1px  - 4px ) * var(--bb-D, .5));   /* section mgn 4→1 */
      --bb-colx:    calc(8px  + (-8px - 8px ) * var(--bb-D, .5));   /* colw extra +8→-8 */
    }

    /* --- ADJUST drawer: a thin sticky header that reveals the 3 sliders --- */
    .bb-adjust {
      position: sticky; top: 0; z-index: 3;
      background: var(--surface-2);
      border-bottom: 1px solid var(--border);
    }
    .bb-adjust__hdr {
      display: flex; align-items: center; justify-content: center; gap: 5px;
      width: 100%; padding: 3px 10px; cursor: pointer;
      background: transparent; border: 0;
      font-family: var(--font-mono); font-size: 8px; line-height: 1;
      letter-spacing: var(--tracking-caps); text-transform: uppercase;
      color: var(--text-subtle); user-select: none;
      transition: color .15s ease;
    }
    .bb-adjust__hdr:hover { color: var(--text); }
    .bb-adjust__chev { font-size: 7px; opacity: .65; transition: transform .2s ease; }
    .bb-adjust.is-closed .bb-adjust__chev { transform: rotate(-90deg); }   /* ▾ → ▸ when closed */
    /* Body — same grid-rows 1fr↔0fr animation as a family body (no JS height read). */
    .bb-adjust__body {
      display: grid; grid-template-rows: 1fr;
      transition: grid-template-rows .2s cubic-bezier(.4, 0, .2, 1);
    }
    .bb-adjust__inner { overflow: hidden; min-height: 0; }
    .bb-adjust.is-closed .bb-adjust__body { grid-template-rows: 0fr; }

    /* --- The 3-slider row (Density · Size · Text) — lives inside the ADJUST drawer --- */
    .bb-draw__bar {
      display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 9px;
      padding: 2px 10px 7px;
    }
    .bb-sl { display: flex; flex-direction: column; align-items: stretch; gap: 2px; min-width: 0; }
    .bb-sl__lbl {
      font-family: var(--font-mono); font-size: 8px; line-height: 1;
      letter-spacing: var(--tracking-caps); text-transform: uppercase;
      color: var(--text-subtle); text-align: center; user-select: none;
    }
    /* Custom track groove + thumb (appearance:none, so accent-color can't apply — we
       draw a visible --border-2 groove and an --accent thumb with a surface ring that
       keeps it legible on every theme; no progress-fill needed for a display control). */
    .bb-sl__rng {
      -webkit-appearance: none; appearance: none;
      width: 100%; min-width: 0; height: 14px; margin: 1px 0 0;
      background: transparent; cursor: pointer;
    }
    .bb-sl__rng::-webkit-slider-runnable-track {
      height: 3px; border-radius: 2px; background: var(--border-2);
    }
    .bb-sl__rng::-webkit-slider-thumb {
      -webkit-appearance: none; appearance: none;
      width: 11px; height: 11px; border-radius: 50%; margin-top: -4px;
      background: var(--accent);
      border: 2px solid var(--surface-2);
      box-shadow: 0 0 0 1px var(--border-2);
    }
    .bb-sl__rng::-moz-range-track {
      height: 3px; border-radius: 2px; background: var(--border-2);
    }
    .bb-sl__rng::-moz-range-thumb {
      width: 11px; height: 11px; border-radius: 50%;
      background: var(--accent); border: 2px solid var(--surface-2);
      box-shadow: 0 0 0 1px var(--border-2);
    }
    .bb-sl__rng:active::-webkit-slider-thumb { cursor: grabbing; }
    .bb-sl__rng:focus-visible { outline: none; }
    .bb-sl__rng:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 2px var(--accent); }
    .bb-sl__rng:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 2px var(--accent); }

    /* --- Family block --- */
    .bb-fam { position: relative; }
    .bb-rail__panel.bb-draw .bb-fam { padding: var(--bb-fampad, 8px) 10px; --bb-m: 1; }
    .bb-fam + .bb-fam { border-top: 1px solid var(--border); }

    /* Derived per-tile sizing (scoped so it can never leak onto a .bb-fam elsewhere). */
    .bb-rail__panel.bb-draw .bb-fam {
      --bb-icon: clamp(12px, calc(24px * var(--bb-S, 1) * var(--bb-m, 1)), 54px);
      --bb-lbl:  clamp(8px,  calc(9px  * var(--bb-T, 1)), 13px);
      --bb-th:   clamp(30px, calc(var(--bb-icon) + var(--bb-lbl) * 1.08 * 2 + var(--bb-tilepad, 5px) * 2 + 6px), 88px);
      --bb-colw: clamp(44px, calc(var(--bb-icon) + 30px + var(--bb-colx, 0px)), 120px);
    }

    /* --- Header: grip | checkbox | № | title | SIZE --- */
    .bb-rail__panel.bb-draw .bb-fam__hdr {
      display: flex; align-items: center; gap: 6px;
      padding: 0 2px var(--bb-hdrpad, 6px);
      user-select: none;
    }
    /* Grip = the ONLY drag origin. Pure-CSS dot grid (radial-gradient) — no font
       glyph dependency, follows currentColor through every theme. */
    .bb-fam__grip {
      flex: 0 0 auto; position: relative; width: 8px; height: 12px; align-self: center;
      cursor: grab; touch-action: none; color: var(--text-subtle);
      background-image: radial-gradient(currentColor 1px, transparent 1.5px);
      background-size: 4px 4px; background-position: 0 0;
    }
    /* Transparent hit-target overlay → a reliable ~24px-tall grab zone for trackpad/touch.
       Biased LEFT (into the rail edge) so it never overlaps the adjacent checkbox. */
    .bb-fam__grip::before { content: ""; position: absolute; inset: -6px -2px -6px -9px; }
    .bb-fam__grip:hover  { color: var(--text); }
    .bb-fam__grip:active { cursor: grabbing; }
    /* Collapse checkbox — small box, tick contrasts the accent fill on every theme. */
    .bb-fam__chk {
      flex: 0 0 auto; position: relative; width: 11px; height: 11px; padding: 0; cursor: pointer;
      background: transparent; border: 1px solid var(--border-2); border-radius: 2px;
      transition: background .15s ease, border-color .15s ease;
    }
    .bb-fam__chk::before { content: ""; position: absolute; inset: -6px -1px; }  /* ≥24px hit-target */
    /* Checked = soft, faded tint (not a loud solid-accent block) with a muted-accent
       tick — reads clearly as "on" without feeling abrupt. Uses the per-theme accent
       tint tokens, falling back gracefully on themes that define fewer of them. */
    .bb-fam__chk[aria-checked="true"] {
      background: var(--accent-bg-2, var(--accent-bg));
      border-color: var(--accent-brd, var(--accent));
    }
    .bb-fam__chk[aria-checked="true"]::after {
      content: ""; position: absolute; left: 3px; top: 0.5px;
      width: 3px; height: 6px; transform: rotate(40deg);
      border: solid var(--accent-press, var(--accent)); border-width: 0 1.5px 1.5px 0;
      opacity: .8;   /* gently fade the tick so the whole control feels subtle */
    }
    .bb-fam__num {
      font-family: var(--font-mono); font-size: 8px;
      color: var(--accent); flex-shrink: 0;
    }
    .bb-fam__title {
      font-family: var(--font-mono); font-size: 9.5px; font-weight: 500;
      letter-spacing: var(--tracking-caps); text-transform: uppercase;
      color: var(--text-subtle); flex: 1; cursor: pointer;
      white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    }
    .bb-fam.is-collapsed .bb-fam__title { color: var(--text-faint, var(--text-subtle)); }
    .bb-rail__panel.bb-draw .bb-fam.is-collapsed .bb-fam__hdr { padding-bottom: 0; }
    .bb-fam__sizebtn {
      margin-left: auto;
      font-family: var(--font-mono); font-size: 8px;
      color: var(--text-subtle);
      background: transparent; border: 1px solid var(--border);
      border-radius: var(--r-1); padding: 1px 5px; cursor: pointer;
    }
    .bb-fam__sizebtn:hover { border-color: var(--border-2); }

    /* --- Per-family SIZE popover (outside the collapsible body) --- */
    .bb-fam__size { display: flex; align-items: center; gap: 6px; padding: 3px 2px 5px; }
    .bb-fam__size .bb-fam__size-lbl {
      font-family: var(--font-mono); font-size: 8px;
      letter-spacing: var(--tracking-caps); text-transform: uppercase;
      color: var(--text-faint, var(--text-subtle)); flex-shrink: 0;
    }
    .bb-fam__size .bb-fam__size-range { flex: 1; min-width: 0; accent-color: var(--accent); }

    /* --- Collapsible body — animate grid-template-rows 1fr↔0fr (no JS height read) --- */
    .bb-fam__body {
      display: grid; grid-template-rows: 1fr;
      transition: grid-template-rows .2s cubic-bezier(.4, 0, .2, 1);
    }
    .bb-fam__bodyinner { overflow: hidden; min-height: 0; margin: 0; }
    .bb-fam.is-collapsed .bb-fam__body { grid-template-rows: 0fr; }

    /* --- Drag-reorder visuals --- */
    .bb-fam--dragging { opacity: .55; }
    .bb-fam__dropbar {
      position: absolute; left: 8px; right: 8px; height: 2px;
      background: var(--accent); border-radius: 1px;
      pointer-events: none; z-index: 4; display: none;
    }

    /* --- Tile grid + sizing --- */
    .bb-rail__panel.bb-draw .bb-fam__grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(var(--bb-colw, 56px), 1fr));
      gap: var(--bb-gap, 4px);
    }
    .bb-rail__panel.bb-draw .bb-sec { margin-bottom: var(--bb-secmrg, 2px); }
    .bb-sec__label {
      font-family: var(--font-mono); font-size: 8px; font-weight: 500;
      letter-spacing: var(--tracking-caps); text-transform: uppercase;
      color: var(--text-faint, var(--text-subtle));
      padding: 1px 2px 3px;
    }

    /* Var-driven tile sizing scoped to the draw tab. */
    .bb-rail__panel.bb-draw .tile.bb-tool {
      min-height: var(--bb-th, 54px);
      padding: var(--bb-tilepad, 6px) 4px;
      gap: 2px;
    }
    /* Defeat the global .tile.has-sub{min-height:64px} so Size/Density reach every family. */
    .bb-rail__panel.bb-draw .tile.bb-tool.has-sub { min-height: var(--bb-th, 54px); }
    .bb-rail__panel.bb-draw .tile.bb-tool .tile__icon .icon,
    .bb-rail__panel.bb-draw .tile.bb-tool .tile__icon canvas {
      width: var(--bb-icon, 28px); height: var(--bb-icon, 28px);
    }
    /* Label fix — never clip, wrap on whole words, never below 8px. */
    .bb-rail__panel.bb-draw .tile.bb-tool .tile__label {
      font-size: var(--bb-lbl, 9px);
      white-space: normal; line-height: 1.08;
      text-transform: uppercase; text-align: center; max-width: 100%;
    }
    .bb-rail__panel.bb-draw .tile.bb-tool .tile__label > span:first-child {
      white-space: normal; overflow: visible; text-overflow: clip;
      word-break: keep-all; overflow-wrap: break-word;
    }
    /* Size-picker chevron scales with the Text slider so sized tiles stay balanced. */
    .bb-rail__panel.bb-draw .tile.bb-tool .tile__chev {
      font-size: clamp(7px, calc(7px * var(--bb-T, 1)), 11px);
    }
    /* "soon" badge → top-right on Draw-tab tiles (the shortcut-hint slot is
       unused here) so it never overlaps the now-always-rendered wrapping label. */
    .bb-rail__panel.bb-draw .tile.bb-tool.placeholder .tile__soon {
      top: 2px; right: 3px; bottom: auto; left: auto;
    }

    /* ---- Left rail (V25 — Pages / Layers / Settings) ----
       Surface-2 panel, hairline borders, mono-caps tabs with a coral
       underline on the active tab. Tabs and panels keep their existing
       data-bbtab / data-bbpanel attribute hooks; CSS is what changes. */
    .bb-rail {
      background: var(--surface-2);
      border-right: 1px solid var(--border);
      display: flex; flex-direction: column;
      min-width: 0; min-height: 0;
      overflow: hidden;
    }
    .bb-rail__tabs {
      display: flex; flex-shrink: 0;
      border-bottom: 1px solid var(--border);
      background: var(--surface-2);
    }
    .bb-rail__tab {
      flex: 1; padding: 9px 0;
      font-family: var(--font-mono); font-size: 10px;
      letter-spacing: var(--tracking-caps); text-transform: uppercase;
      color: var(--text-mute);
      text-align: center;
      cursor: pointer;
      background: transparent;
      border: 0; border-bottom: 1.5px solid transparent;
      user-select: none;
      transition: color var(--t-fast), border-color var(--t-fast);
    }
    .bb-rail__tab:hover { color: var(--text); }
    .bb-rail__tab.active {
      color: var(--text);
      border-bottom-color: var(--accent);
      box-shadow: none;
    }
    .bb-rail__panels { flex: 1; overflow: hidden; position: relative; }
    .bb-rail__panel {
      position: absolute; inset: 0;
      overflow-y: auto; overflow-x: hidden;
      padding: 10px 12px;
      display: none;
    }
    .bb-rail__panel.active { display: block; }
    .bb-rail__section-title {
      font-family: var(--font-mono); font-size: 9px;
      color: var(--text-subtle);
      letter-spacing: var(--tracking-caps); text-transform: uppercase;
      margin: 6px 0 8px;
    }

    /* Pages list — the page-preview cards are styled by the .bb-page-grid /
       .bb-page-thumb* block below (multi-file-workspace polish Item 2b). The old
       single-column .bb-page-card text-row rules were removed when renderPagesTab
       moved to the 2-column thumbnail grid (they were orphaned — the renderer no
       longer emits any bb-page-card* class). */
    .bb-page-actions {
      display: flex; gap: 6px; padding: 4px 0 10px;
      border-bottom: 1px solid var(--border); margin-bottom: 10px;
    }
    .bb-page-actions button {
      flex: 1; padding: 5px 10px;
      font-family: var(--font-sans); font-size: var(--fs-xs);
      background: var(--surface);
      border: 1px solid var(--border); border-radius: var(--r-1);
      color: var(--text); cursor: pointer;
      transition: background var(--t-fast), border-color var(--t-fast);
    }
    .bb-page-actions button:hover {
      background: var(--surface-3); border-color: var(--border-2);
    }

    /* multi-file-workspace polish (Item 2b) — 2-column thumbnail grid.
       Replaces the old single-column .bb-page-card text rows with compact
       page-preview cards (thumbnail box + number badge + size tag). Thumbnails
       come from js/85 via window.pageThumbRequest; cards are placeholder-first
       and fill in progressively. Themes across all 5 palettes via the tokens. */
    .bb-page-grid {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 8px;
      align-content: start;
    }
    .bb-page-thumb {
      position: relative;
      display: flex; flex-direction: column;
      padding: 4px;
      background: var(--surface-2);
      border: 1px solid var(--border);
      border-radius: var(--r-2);
      cursor: pointer;
      transition: background var(--t-fast), border-color var(--t-fast), box-shadow var(--t-fast);
    }
    .bb-page-thumb:hover {
      background: var(--surface-3);
      border-color: var(--border-2);
    }
    .bb-page-thumb.active {
      border-color: var(--accent);
      box-shadow: 0 0 0 1px var(--accent), 0 1px 4px rgba(0,0,0,0.18);
      background: var(--accent-bg);
    }
    /* Preview box — aspect set inline (page.size w/h) so portrait vs landscape
       reads before the bitmap lands; default A1-ish landscape fallback. */
    .bb-page-thumb__box {
      position: relative;
      width: 100%;
      aspect-ratio: 841 / 594;
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: var(--r-1);
      overflow: hidden;
      display: flex; align-items: center; justify-content: center;
    }
    .bb-page-thumb__img {
      display: block;
      width: 100%; height: 100%;
      object-fit: contain;
    }
    /* Faint page-number shown until the thumbnail fills in. Hidden once a real
       preview is attached (box gets .has-thumb). */
    .bb-page-thumb__ph {
      font-family: var(--font-mono); font-size: var(--fs-md);
      color: var(--text-faint);
      letter-spacing: var(--tracking-wide);
      pointer-events: none;
    }
    .bb-page-thumb__box.has-thumb .bb-page-thumb__ph { display: none; }
    /* Footer — page-number badge + optional size tag. */
    .bb-page-thumb__foot {
      display: flex; align-items: center; justify-content: space-between;
      gap: 4px; padding: 4px 2px 1px;
    }
    .bb-page-thumb__num {
      font-family: var(--font-mono); font-size: 10px; font-weight: 600;
      color: var(--text-mute);
      min-width: 14px; height: 14px;
      display: inline-flex; align-items: center; justify-content: center;
      padding: 0 4px;
      background: var(--surface-3);
      border-radius: var(--r-1);
      letter-spacing: var(--tracking-wide);
    }
    .bb-page-thumb.active .bb-page-thumb__num {
      color: var(--accent-ink, #fff);
      background: var(--accent);
    }
    .bb-page-thumb__tag {
      font-family: var(--font-mono); font-size: 9px;
      color: var(--text-subtle);
      letter-spacing: var(--tracking-wide); text-transform: uppercase;
      overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    }
    .bb-page-thumb__close {
      position: absolute; right: 2px; top: 2px;
      width: 16px; height: 16px;
      font-size: 13px; line-height: 1;
      display: inline-flex; align-items: center; justify-content: center;
      color: var(--text-subtle);
      background: var(--surface-2); border: 1px solid var(--border);
      border-radius: var(--r-1);
      cursor: pointer; padding: 0;
      opacity: 0; transition: opacity var(--t-fast), color var(--t-fast), border-color var(--t-fast);
    }
    .bb-page-thumb:hover .bb-page-thumb__close,
    .bb-page-thumb.active .bb-page-thumb__close { opacity: 1; }
    .bb-page-thumb__close:hover { color: var(--danger); border-color: var(--danger); }

    /* project-drawing — the pinned Project Drawing (model) page reads distinctly:
       a dashed accent frame + a faint accent wash so it's clearly the special
       "everything lives here" canvas, not just another sheet. Token-based → all
       five themes inherit. */
    .bb-page-thumb--model {
      border-style: dashed;
      border-color: var(--accent-brd, var(--accent));
      background: var(--accent-bg);
    }
    .bb-page-thumb--model .bb-page-thumb__box {
      background: repeating-linear-gradient(
        var(--surface), var(--surface) 7px, var(--surface-2) 7px, var(--surface-2) 8px);
    }
    .bb-page-thumb--model .bb-page-thumb__tag {
      color: var(--accent); font-size: 12px; font-weight: 700;
    }

    /* project-drawing — the Detail index/navigator, under the page grid. */
    .bb-details { margin-top: 12px; }
    .bb-details__head {
      font-family: var(--font-mono); font-size: 10px; font-weight: 600;
      letter-spacing: var(--tracking-wide); text-transform: uppercase;
      color: var(--text-mute); padding: 0 2px 6px;
      border-top: 1px solid var(--border); padding-top: 10px;
    }
    .bb-details__empty {
      font-size: var(--fs-sm); color: var(--text-faint);
      line-height: 1.4; padding: 2px 2px 4px;
    }
    .bb-details__search {
      width: 100%; box-sizing: border-box; margin: 0 0 6px;
      padding: 5px 8px; font-size: var(--fs-sm);
      color: var(--text); background: var(--surface);
      border: 1px solid var(--border); border-radius: var(--r-1);
    }
    .bb-details__search:focus { outline: none; border-color: var(--accent); }
    .bb-details__list { display: flex; flex-direction: column; gap: 4px; }
    .bb-details__row {
      display: flex; align-items: center; gap: 8px;
      padding: 4px; border-radius: var(--r-1); cursor: pointer;
      border: 1px solid transparent;
      transition: background var(--t-fast), border-color var(--t-fast);
    }
    .bb-details__row:hover { background: var(--surface-3); border-color: var(--border-2); }
    .bb-details__thumb {
      width: 48px; height: 36px; flex: 0 0 auto;
      background: var(--surface); border: 1px solid var(--border);
      border-radius: var(--r-1); overflow: hidden;
      display: flex; align-items: center; justify-content: center;
    }
    .bb-details__thumbimg { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
    .bb-details__meta { min-width: 0; flex: 1 1 auto; }
    .bb-details__name {
      font-size: var(--fs-sm); font-weight: 600; color: var(--text);
      overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    }
    .bb-details__sub {
      display: flex; align-items: center; gap: 5px;
      font-size: 10px; color: var(--text-subtle); margin-top: 1px;
    }
    .bb-details__dot {
      width: 7px; height: 7px; border-radius: 50%;
      background: var(--text-faint); flex: 0 0 auto;
    }
    .bb-details__dot--unassigned { background: var(--text-faint); }
    .bb-details__dot--placed { background: var(--accent); }
    .bb-details__dot--issued { background: #2e9e5b; }
    .bb-details__dot--differs { background: #d08400; }

    /* Layers list — design's .layer row spec.
       Existing renderer emits inline style.cssText; the V25 renderer drops
       that line so this CSS rule applies. Rows are checkbox + label today;
       structure can grow into vis/lock/swatch later without CSS changes. */
    .layer-row {
      display: flex; align-items: center; gap: 8px;
      padding: 4px 6px;
      border-radius: var(--r-1);
      cursor: pointer;
      color: var(--text);
      font-size: var(--fs-sm);
      transition: background var(--t-fast);
    }
    .layer-row:hover { background: var(--hover-bg); }
    .layer-row.active,
    .layer-row.layer--on {
      background: var(--accent-bg);
      box-shadow: inset 2px 0 0 var(--accent);
    }
    .layer-row input[type="checkbox"] { cursor: pointer; }
    .layer-row label {
      font-family: var(--font-mono); font-size: 11px;
      letter-spacing: var(--tracking-wide);
      flex: 1; cursor: pointer;
      overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    }
    .rail-empty {
      font-family: var(--font-mono); font-size: 10px;
      color: var(--text-subtle);
      letter-spacing: var(--tracking-wide);
      padding: 12px 6px; text-align: center;
    }

    /* Settings tab — re-uses the inspector content moved here on init.
       Inspector header stays, but borders inherit the warm token palette. */
    .bb-rail__panel.bb-settings .insp-header {
      padding: 0 0 10px; border-bottom: 1px solid var(--border);
      margin-bottom: 10px; background: transparent;
    }
    .bb-rail__panel.bb-settings .insp-header .insp-eyebrow {
      font-family: var(--font-mono); font-size: 9px;
      letter-spacing: var(--tracking-caps); text-transform: uppercase;
      color: var(--text-subtle);
    }
    .bb-rail__panel.bb-settings .insp-header .insp-h1 {
      font-family: var(--font-serif); font-weight: 500;
      font-size: var(--fs-2xl);
      letter-spacing: var(--tracking-tight);
      color: var(--text);
    }

    /* ---- Drag-resize handle (V25 — quieter, warm hover) ---- */
    .bb-rail-handle {
      width: 6px; cursor: ew-resize;
      background: var(--surface-2);
      border-right: 1px solid var(--border);
      transition: background var(--t-fast);
    }
    .bb-rail-handle:hover, .bb-rail-handle.dragging {
      background: var(--accent-bg);
      border-right-color: var(--accent-brd);
    }
    .bb-rail-handle.collapsed-edge {
      width: 14px; cursor: ew-resize;
      background: var(--surface-2);
      border-right: 1px solid var(--border);
      display: flex; align-items: center; justify-content: center;
    }
    .bb-rail-handle.collapsed-edge::after {
      content: '›'; font-family: var(--font-mono); font-size: 14px;
      color: var(--text-mute);
    }

    /* Library sidebar */
    #libraryPanel-wrap {
      background: var(--bg2); border-right: 1px solid var(--brd);
      display: flex; flex-direction: column; min-height: 0; overflow: hidden;
    }
    .panel-header {
      padding: 6px 8px; border-bottom: 1px solid var(--brd);
      font-size: 9px; font-weight: 600; color: var(--mute);
      letter-spacing: 0.06em; text-transform: uppercase; flex-shrink: 0;
    }
    .panel-body { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 4px; }

    /* Canvas container (V25 — fallback bg = workspace-bg so any moment
       between the page paint and the first canvas render reads as the
       drafting workspace, not blank white). */
    #canvas-container {
      position: relative; overflow: hidden; cursor: crosshair;
      background: var(--workspace-bg);
    }
    #canvas-container canvas { display: block; width: 100%; height: 100%; }
    #canvas-container.pan-cursor { cursor: grab; }
    #canvas-container.grabbing { cursor: grabbing; }

    /* V25 — mode-aware workspace tint.
       Per design: 2D = warm paper-cream surface, 3D = cooler stone-grey.
       V2 toggles body.sheet-2d when the active sheet is in 2D mode, so we
       override --workspace-bg (and the canvas-container fallback) when the
       active sheet is in 3D mode (i.e. NOT .sheet-2d). Scoped to warm
       themes only — classic/dark/bt keep their existing workspace fill. */
    body.theme-warm-light:not(.sheet-2d),
    body.theme-warm-dark:not(.sheet-2d) {
      --workspace-bg: var(--surface-cool);
    }

    /* Library items */
    .lib-title {
      font-size: 8px; font-weight: 700; color: var(--mute); text-transform: uppercase;
      margin: 6px 0 3px 2px; letter-spacing: 0.05em;
    }
    .lib-item {
      font-size: 10px; padding: 3px 5px; margin-bottom: 0;
      background: transparent; border: 1px solid transparent;
      border-radius: 3px; cursor: pointer; white-space: nowrap;
      overflow: hidden; text-overflow: ellipsis; line-height: 1.4;
    }
    .lib-item:hover { background: var(--hover-bg); }
    .library-section { margin-bottom: 4px; }

    /* V20 command palette + keyboard help */
    kbd {
      display: inline-block; padding: 1px 5px; margin: 0 2px;
      background: var(--bg3); border: 1px solid var(--brd);
      border-radius: 3px; font: 11px ui-monospace, Menlo, monospace;
      min-width: 16px; text-align: center;
    }
    .cmd-row { padding: 8px 14px; cursor: pointer; font: 13px system-ui; color: var(--ink); display:flex; justify-content:space-between; align-items:center; gap:10px; }
    .cmd-row:hover, .cmd-row.focus { background: var(--active-bg); }
    .cmd-row .cmd-label { flex:1; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
    .cmd-row .cmd-cat { font-size:10px; opacity:0.55; flex-shrink:0; }
    .layer-row { display:flex; align-items:center; gap:6px; padding:3px 0; }
    .layer-row input[type=checkbox] { margin:0; cursor:pointer; }
    .layer-row label { cursor:pointer; flex:1; }

    /* ========== PROPERTIES (floating overlay) ========== */
    #propsPanel {
      position: absolute; bottom: 6px; right: 6px; z-index: 10;
      width: 180px; background: var(--bg2); border: 1px solid var(--brd);
      border-radius: 6px; box-shadow: 0 2px 12px rgba(0,0,0,0.3);
      font-size: 10px; display: none;
      max-height: 50%; overflow-y: auto;
    }
    #propsPanel.visible { display: block; }
    #propsPanel .panel-header { padding: 5px 8px; font-size: 8px; }
    .prop-row { padding: 3px 8px; }
    .prop-label { font-size: 7.5px; font-weight: 600; color: var(--mute); text-transform: uppercase; margin-bottom: 1px; letter-spacing: 0.04em; }
    .prop-value { padding: 2px 4px; background: rgba(128,128,128,0.1); border-radius: 2px; color: var(--ink); font-size: 10px; }
    .prop-input-group { display: flex; gap: 2px; }
    .prop-input-group input { flex: 1; font-size: 9px; padding: 2px 4px; height: 20px; }

    /* ========== STATUS BAR ========== */
    .status-bar {
      padding: 2px 10px; background: var(--bg2); border-top: 1px solid var(--brd);
      display: flex; gap: 14px; align-items: center; font-size: 9px; color: var(--mute);
      flex-shrink: 0; height: 22px; user-select: none;
    }
    .status-item { display: flex; gap: 3px; align-items: center; }
    .status-value { color: var(--ink); font-weight: 600; font-family: var(--font-mono); font-size: 9px; }

    /* Scrollbars */
    ::-webkit-scrollbar { width: 5px; height: 5px; }
    ::-webkit-scrollbar-track { background: transparent; }
    ::-webkit-scrollbar-thumb { background: var(--scrollbar); border-radius: 3px; }

    /* ---- Dialogs (V25 — drafting modal aesthetic) ----
       Existing class names preserved (.dialog-overlay, .dialog, .dialog-title,
       .dialog-body, .dialog-buttons, .dialog-btn) so all show/hide handlers
       and Place/Save/Cancel button bindings keep working. CSS shape matches
       the design's modal pattern: warm overlay veil, surface-2 panel, serif
       H1, mono caps subtitle, hairline-border inputs, accent primary button. */
    .dialog-overlay {
      position: fixed; inset: 0;
      /* V25 — theme-aware veil. Warm-light: subtle warm graphite. Dark
         themes: lift to a thin black scrim so the modal still pops. */
      background: var(--modal-veil, rgba(42, 36, 31, 0.28));
      backdrop-filter: blur(2px);
      -webkit-backdrop-filter: blur(2px);
      display: none; align-items: center; justify-content: center;
      z-index: 9999;
    }
    .dialog-overlay.visible { display: flex; }
    .dialog {
      background: var(--surface-2);
      border: 1px solid var(--border);
      border-radius: var(--r-4);
      box-shadow: var(--shadow-pop, var(--shadow-lg));
      padding: 18px 20px;
      min-width: 320px;
      max-width: calc(100vw - 48px);
      max-height: calc(100vh - 60px);
      color: var(--text);
      overflow: hidden;
      display: flex; flex-direction: column;
    }
    .dialog-title {
      font-family: var(--font-serif); font-weight: 500;
      font-size: var(--fs-2xl); letter-spacing: var(--tracking-tight);
      color: var(--text);
      margin-bottom: 4px;
      padding-bottom: 12px;
      border-bottom: 1px solid var(--border);
    }
    /* Optional secondary header line — opt-in via .dialog-sub on a span next
       to .dialog-title (mono caps, subtle). Existing dialogs that don't use
       this stay styled as-is. */
    .dialog-sub {
      font-family: var(--font-mono); font-size: var(--fs-xs);
      color: var(--text-subtle); letter-spacing: var(--tracking-wide);
      text-transform: uppercase;
    }
    .dialog-body {
      font-size: var(--fs-sm); color: var(--text);
      padding: 14px 0;
      flex: 1; overflow-y: auto;
    }
    .dialog-buttons {
      display: flex; gap: 8px; justify-content: flex-end;
      padding-top: 12px;
      border-top: 1px solid var(--border);
    }
    .dialog-btn {
      height: 28px; padding: 0 14px;
      border: 1px solid var(--border);
      background: var(--surface);
      color: var(--text);
      border-radius: var(--r-2);
      cursor: pointer;
      font-family: var(--font-sans); font-size: var(--fs-sm); font-weight: 500;
      transition: background var(--t-fast), border-color var(--t-fast);
    }
    .dialog-btn:hover { background: var(--surface-3); border-color: var(--border-2); }
    .dialog-btn.primary {
      background: var(--accent);
      border-color: var(--accent-press, var(--accent));
      color: var(--accent-ink, #fff);
    }
    .dialog-btn.primary:hover {
      background: var(--accent-hover, var(--accent));
      border-color: var(--accent-press, var(--accent));
    }
    /* Form inputs and labels inside dialogs — paper-on-panel inputs, mono
       caps labels (the design's .field + .finput pattern adapted to V2's
       existing markup which uses bare <label>{text}: <input> /></label>). */
    .dialog label,
    .plate-dialog label {
      display: block; margin-bottom: 8px;
      font-family: var(--font-mono); font-size: var(--fs-xs);
      color: var(--text-mute); letter-spacing: var(--tracking-wide);
    }
    .plate-dialog input { width: 80px; }
    .dialog input:not([type="checkbox"]):not([type="radio"]),
    .dialog select,
    .dialog textarea,
    .plate-dialog input,
    .plate-dialog select {
      height: 26px; padding: 0 8px;
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: var(--r-1);
      color: var(--text);
      font-family: var(--font-mono); font-size: var(--fs-xs);
    }
    .dialog textarea { height: auto; min-height: 60px; padding: 6px 8px; resize: vertical; }
    .dialog input:focus, .dialog select:focus, .dialog textarea:focus,
    .plate-dialog input:focus, .plate-dialog select:focus {
      outline: none;
      border-color: var(--accent-brd, var(--accent));
      box-shadow: 0 0 0 2px var(--focus-ring);
    }

    /* ============================================================
       SPELL-CHECK (note text) — js/80 engine + js/81 UI.
       Live red-squiggle overlay, right-click fix menu, sweep panel.
       ============================================================ */
    /* Backdrop mirrored exactly behind #nbEditorTA. Its text is transparent;
       only the wavy underline under a flagged word is painted, showing through
       the (transparent) textarea beneath the live glyphs. */
    .sp-backdrop {
      position: absolute;
      margin: 0;
      z-index: 59;                 /* directly behind the textarea (z-index 60) */
      overflow: hidden;
      pointer-events: none;
      color: transparent;
      background: transparent;
      white-space: pre-wrap;
      word-break: normal;
      overflow-wrap: break-word;
      -webkit-user-select: none;
      user-select: none;
    }
    .sp-bad {
      color: transparent;
      text-decoration: underline;
      text-decoration-style: wavy;
      text-decoration-color: #e23b2e;
      text-decoration-skip-ink: none;
      -webkit-text-decoration: underline wavy #e23b2e;
      text-underline-offset: 2px;
    }

    /* Right-click fix menu (mirrors the .menu idiom). */
    .sp-menu {
      position: fixed;
      z-index: 2200;
      min-width: 180px; max-width: 280px;
      padding: 4px;
      background: var(--surface-2, var(--surface, #fff));
      border: 1px solid var(--border, #ccc);
      border-radius: 8px;
      box-shadow: var(--shadow-pop, 0 8px 24px rgba(0,0,0,0.25));
      font-size: 12px;
      color: var(--text, #222);
    }
    .sp-menu-item {
      padding: 5px 10px;
      border-radius: 5px;
      cursor: pointer;
      white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    }
    .sp-menu-item:hover { background: var(--accent-bg, rgba(0,0,0,0.06)); color: var(--accent-press, var(--accent, #06c)); }
    .sp-menu-item.sp-strong { font-weight: 600; }
    .sp-menu-item.sp-disabled { color: var(--text-subtle, #999); cursor: default; }
    .sp-menu-item.sp-disabled:hover { background: transparent; color: var(--text-subtle, #999); }
    .sp-menu-sep { height: 1px; background: var(--border, #ccc); margin: 4px 2px; }

    /* Document-sweep results panel (right side). */
    .sp-panel {
      position: fixed;
      top: 64px; right: 14px;
      width: 320px; max-height: 72vh;
      display: flex; flex-direction: column;
      z-index: 1400;
      background: var(--surface, #fff);
      border: 1px solid var(--border, #ccc);
      border-radius: 10px;
      box-shadow: var(--shadow-pop, 0 10px 30px rgba(0,0,0,0.3));
      font-size: 12px; color: var(--text, #222);
      overflow: hidden;
    }
    .sp-panel-head {
      display: flex; align-items: center; justify-content: space-between;
      padding: 9px 12px;
      border-bottom: 1px solid var(--border, #ccc);
      background: var(--surface-3, var(--surface-2, var(--surface)));
    }
    .sp-panel-title { font-weight: 600; }
    .sp-panel-x {
      border: none; background: transparent; cursor: pointer;
      font-size: 16px; line-height: 1; color: var(--text-mute, #777); padding: 0 2px;
    }
    .sp-panel-x:hover { color: var(--text, #222); }
    .sp-panel-body { overflow-y: auto; padding: 6px; }
    .sp-panel-empty { padding: 18px 10px; text-align: center; color: var(--text-mute, #777); }
    .sp-hit {
      padding: 8px; border-radius: 7px; margin-bottom: 6px;
      background: var(--surface-2, var(--surface)); border: 1px solid var(--border, #ddd);
    }
    .sp-hit-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
    .sp-hit-word { font-weight: 600; color: #e23b2e; }
    .sp-hit-meta { font-size: 10px; color: var(--text-subtle, #999); white-space: nowrap; }
    .sp-hit-ctx { margin: 3px 0 6px; color: var(--text-mute, #666); font-family: var(--font-mono, ui-monospace, monospace); font-size: 11px; }
    .sp-hit-acts { display: flex; flex-wrap: wrap; gap: 4px; }
    .sp-btn {
      padding: 3px 8px; border-radius: 5px; cursor: pointer; font-size: 11px;
      border: 1px solid var(--border-2, var(--border, #ccc));
      background: var(--surface-3, var(--surface)); color: var(--text, #222);
    }
    .sp-btn:hover { border-color: var(--accent, #06c); }
    .sp-btn-fix { background: var(--accent-bg, rgba(0,0,0,0.05)); border-color: var(--accent-brd, var(--accent)); color: var(--accent-press, var(--accent)); font-weight: 600; }
    .sp-btn-mute { color: var(--text-mute, #777); }

    /* ============================================================
       PRINT PREVIEW (44b-print-preview.js, 2026-06-13)
       WYSIWYG print dialog. Top-bar .print-btn + .pp-* dialog. All
       colours/typography via theme tokens so the five themes inherit.
       ============================================================ */

    /* ---- Top-bar Print button — sibling of the tb-style / sheet-mode
       switchers (same height, mono uppercase) but a single accent-leaning
       action rather than a segmented choice. */
    .print-btn {
      display: inline-flex; align-items: center; gap: 6px; align-self: center;
      height: 28px; padding: 0 12px; margin-right: 8px;
      background: var(--surface-3);
      border: 1px solid var(--border);
      border-radius: var(--r-2);
      color: var(--text-mute); cursor: pointer;
      font-family: var(--font-mono); font-size: 11px; font-weight: 600;
      letter-spacing: var(--tracking-wide); text-transform: uppercase;
      transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
    }
    .print-btn:hover {
      background: var(--accent-bg); color: var(--accent-press, var(--accent));
      border-color: var(--accent-brd);
    }
    /* generic top-bar toggle "on" state (snap / ortho / grid): accent tint + accent
       ink, all token-driven. */
    .print-btn.active {
      background: var(--active-bg, var(--accent-bg));
      color: var(--accent);
      border-color: var(--active-brd, var(--accent-brd));
    }
    .print-btn .icon { width: 15px; height: 15px; }

    /* ---- Overlay + dialog shell ---- */
    .pp-overlay {
      position: fixed; inset: 0; z-index: 3000;
      background: var(--modal-veil, rgba(0,0,0,0.35));
      display: flex; align-items: center; justify-content: center;
      padding: 28px;
    }
    .pp-overlay[hidden] { display: none; }
    .pp-dialog {
      display: flex; flex-direction: column;
      width: min(1480px, 100%); height: min(920px, 100%);
      background: var(--surface);
      border: 1px solid var(--border-2);
      border-radius: var(--r-3, 10px);
      box-shadow: var(--shadow-pop, var(--shadow-lg));
      overflow: hidden;
    }

    /* ---- Header ---- */
    .pp-head {
      display: flex; align-items: center; justify-content: space-between;
      padding: 12px 16px;
      border-bottom: 1px solid var(--border);
      background: var(--surface-2);
    }
    .pp-head__title { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
    .pp-head__name {
      font-family: var(--font-mono); font-size: 12px; font-weight: 600;
      letter-spacing: var(--tracking-wide); text-transform: uppercase;
      color: var(--text);
    }
    .pp-head__sub {
      font-family: var(--font-sans); font-size: var(--fs-sm); color: var(--text-mute);
      white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    }

    /* ---- Body: stage (left) + options (right) ---- */
    .pp-body { display: flex; flex: 1; min-height: 0; }
    .pp-stagecol { display: flex; flex-direction: column; flex: 1; min-width: 0; }
    .pp-stagebar {
      display: flex; align-items: center; justify-content: space-between;
      padding: 8px 14px;
      border-bottom: 1px solid var(--border);
      background: var(--surface-2);
    }
    .pp-pagenav, .pp-zoom { display: inline-flex; align-items: center; gap: 4px; }
    .pp-navbtn {
      display: inline-grid; place-items: center;
      min-width: 26px; height: 26px; padding: 0 6px;
      background: transparent; border: 1px solid var(--border);
      border-radius: var(--r-1); color: var(--text-mute); cursor: pointer;
      font-family: var(--font-mono); font-size: 13px; line-height: 1;
      transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
    }
    .pp-navbtn--wide { font-size: 10px; letter-spacing: var(--tracking-wide); text-transform: uppercase; }
    .pp-navbtn:hover:not(:disabled) { background: var(--hover-bg); color: var(--text); }
    .pp-navbtn:disabled { opacity: 0.35; cursor: default; }
    .pp-pagelabel, .pp-zoomlabel {
      font-family: var(--font-mono); font-size: 11px; color: var(--text-mute);
      min-width: 48px; text-align: center;
    }
    .pp-zoomlabel {
      background: transparent; border: none; cursor: pointer; padding: 0 4px; height: 26px;
    }
    .pp-zoomlabel:hover { color: var(--text); }

    /* The paper sits on a recessed drafting-desk surface so the white print
       sheet reads as the unambiguous subject. */
    .pp-stage {
      position: relative; flex: 1; min-height: 0;
      overflow: auto;
      background: var(--surface-cool, var(--surface-3));
      box-shadow: inset 0 1px 4px rgba(0,0,0,0.06);
      display: flex;
    }
    .pp-paper { margin: auto; padding: 24px; display: flex; }
    .pp-canvas {
      display: block;
      background: #fff;
      box-shadow: 0 1px 0 rgba(0,0,0,0.05), 0 14px 40px -12px rgba(0,0,0,0.35);
      border-radius: 1px;
    }
    .pp-loading {
      position: absolute; top: 14px; left: 50%; transform: translateX(-50%);
      padding: 5px 14px;
      background: var(--surface-2); border: 1px solid var(--border);
      border-radius: 999px;
      font-family: var(--font-mono); font-size: 11px; color: var(--text-mute);
      box-shadow: var(--shadow-md);
      pointer-events: none;
    }
    .pp-error {
      margin: auto; padding: 16px 22px;
      font-family: var(--font-mono); font-size: 12px; color: var(--danger);
      background: var(--surface-2); border: 1px solid var(--border);
      border-radius: var(--r-2);
    }

    /* ---- Options panel ---- */
    .pp-side {
      width: 264px; flex: none;
      border-left: 1px solid var(--border);
      background: var(--surface-2);
      overflow-y: auto;
      padding: 14px 16px;
      display: flex; flex-direction: column; gap: 16px;
    }
    .pp-sec { display: flex; flex-direction: column; gap: 7px; }
    .pp-sec__title {
      font: 600 11px var(--font-mono, monospace);
      letter-spacing: var(--tracking-wide, .06em); text-transform: uppercase;
      color: var(--text-mute);
      border-bottom: 1px solid var(--border); padding-bottom: 4px;
    }
    .pp-info {
      display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
      font-size: var(--fs-sm);
    }
    .pp-info span { color: var(--text-subtle); }
    .pp-info b {
      font-weight: 500; color: var(--text); text-align: right;
      font-family: var(--font-mono); font-size: 11px;
    }
    .pp-seggroup {
      display: flex;
      background: var(--surface-3);
      border: 1px solid var(--border);
      border-radius: var(--r-2); padding: 2px;
    }
    .pp-seg {
      flex: 1;
      display: flex; align-items: center; justify-content: center;
      height: 24px; padding: 0 8px;
      border: none; background: transparent; border-radius: var(--r-1);
      font-family: var(--font-mono); font-size: 10.5px; font-weight: 600;
      letter-spacing: 0.02em;
      color: var(--text-mute); cursor: pointer; white-space: nowrap;
      transition: background var(--t-fast), color var(--t-fast), box-shadow var(--t-fast);
    }
    .pp-seg:hover:not(:disabled) { color: var(--text); }
    .pp-seg.active {
      background: var(--surface);
      color: var(--text);
      box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--accent-brd);
    }
    .pp-seg:disabled { opacity: 0.4; cursor: default; }
    .pp-fieldlabel {
      font-size: var(--fs-xs, 11px); color: var(--text-subtle); margin-top: 2px;
    }
    .pp-input {
      height: 28px; padding: 0 9px;
      background: var(--inputBg, var(--surface-3));
      border: 1px solid var(--border-2);
      border-radius: var(--r-1);
      font-family: var(--font-mono); font-size: 11.5px; color: var(--text);
      outline: none;
      transition: border-color var(--t-fast), box-shadow var(--t-fast);
    }
    .pp-input:focus { border-color: var(--accent-brd); box-shadow: 0 0 0 2px var(--focus-ring); }
    .pp-hint { font-size: 10.5px; color: var(--text-subtle); line-height: 1.4; }

    /* ---- Footer ---- */
    .pp-foot {
      display: flex; align-items: center; justify-content: space-between; gap: 14px;
      padding: 12px 16px;
      border-top: 1px solid var(--border);
      background: var(--surface-2);
    }
    .pp-foot__note {
      font-family: var(--font-mono); font-size: 10.5px;
      letter-spacing: 0.03em; color: var(--text-subtle);
    }
    .pp-foot__actions { display: inline-flex; align-items: center; gap: 8px; }
    .pp-btn {
      height: 30px; padding: 0 16px;
      background: var(--surface-3);
      border: 1px solid var(--border-2);
      border-radius: var(--r-2);
      font-family: var(--font-mono); font-size: 11px; font-weight: 600;
      letter-spacing: var(--tracking-wide); text-transform: uppercase;
      color: var(--text); cursor: pointer;
      transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
    }
    .pp-btn:hover:not(:disabled) { border-color: var(--accent-brd); color: var(--accent-press, var(--accent)); }
    .pp-btn:disabled { opacity: 0.55; cursor: default; }
    .pp-btn--primary {
      background: var(--accent); border-color: var(--accent);
      color: var(--accent-ink, #fff);
    }
    .pp-btn--primary:hover:not(:disabled) {
      background: var(--accent-hover, var(--accent)); border-color: var(--accent-hover, var(--accent));
      color: var(--accent-ink, #fff);
    }
    /* Narrow screens — keep the dialog usable on a 13" laptop. */
    @media (max-width: 1100px) {
      .pp-side { width: 230px; }
      .print-btn span { display: none; }
      .print-btn { padding: 0 8px; }
    }

    /* ============================================================
       DATUM REFINEMENT LAYER  (2026-06-27)
       Interface-only polish over the warm DATUM palette. Appended
       last so it overrides earlier rules by cascade; `!important`
       is used ONLY to defeat hardcoded inline styles (the legacy
       options ribbon builds controls with inline style strings).
       No tool logic, no sketch templates, no canvas-engine tokens
       are touched. Scope: brand wordmark, toolbox family headers,
       the per-tool options ribbon, app-wide slider/control language.
       ============================================================ */

    /* ---- Brand wordmark — StructuralSketch, top-left, restrained ---- */
    .top-bar__brand { gap: 8px; padding-left: 4px; align-items: center; }
    /* The Daniel McCarron Design grid-mark (a Frank Lloyd Wright / Mondrian
       cartouche) is the brand logo now — it replaces the earlier flat chop.
       Sized to sit quietly beside the wordmark. */
    .top-bar__brand::before { content: none; }
    .brand__logo {
      flex: 0 0 auto; width: 22px; height: 22px;
      object-fit: contain; display: block;
      user-select: none; -webkit-user-drag: none;
    }
    .brand__name {
      font-family: var(--font-sans); font-size: 13.5px; line-height: 1;
      letter-spacing: -0.005em; white-space: nowrap;
      display: inline-flex; align-items: baseline;
    }
    .brand__name-a { color: var(--text); font-weight: 600; }
    .brand__name-b { color: var(--text); font-weight: 400; opacity: 0.78; }

    /* ---- Toolbox family headers — a clean drafting "datum" row ----
       Replaces the old circled tick with a quiet pill switch that reads
       instantly as show / hide, plus a hover-revealed grip + SIZE so the
       resting row stays calm. All CSS-driven off the existing
       role=checkbox [aria-checked] the JS already maintains. */
    .bb-rail__panel.bb-draw .bb-fam__hdr {
      gap: 8px; border-radius: var(--r-1);
      padding-left: 5px; padding-right: 4px; margin: 0 -3px;
      transition: background var(--t-fast) var(--ease-out);
    }
    .bb-rail__panel.bb-draw .bb-fam__hdr:hover { background: var(--hover-bg); }

    /* grip — quiet at rest, firms up when the row is hovered */
    .bb-fam__grip { color: var(--text-faint, var(--text-subtle)); opacity: 0.5;
      transition: opacity var(--t-fast), color var(--t-fast); }
    .bb-rail__panel.bb-draw .bb-fam__hdr:hover .bb-fam__grip { opacity: 1; color: var(--text-subtle); }

    /* the visibility toggle — a small, faded hairline pill. Deliberately quiet
       at rest (the row title carries the eye); it firms up only when its row is
       hovered, so a screen full of families reads as calm. */
    .bb-rail__panel.bb-draw .bb-fam__chk {
      width: 17px; height: 10px; border-radius: var(--r-pill);
      border: 1px solid var(--border-2); background: var(--surface-3);
      opacity: 0.55;
      transition: background var(--t-fast) var(--ease-out), border-color var(--t-fast) var(--ease-out), opacity var(--t-fast);
    }
    .bb-rail__panel.bb-draw .bb-fam__chk::after {
      content: ""; position: absolute; top: 50%; left: 2px; right: auto;
      transform: translateY(-50%);
      width: 6px; height: 6px; border-radius: 50%; border: 0;
      background: var(--text-faint, var(--text-subtle));
      transition: left var(--t-base) var(--ease-out), right var(--t-base) var(--ease-out),
                  background var(--t-fast) var(--ease-out);
    }
    .bb-rail__panel.bb-draw .bb-fam__chk[aria-checked="true"] {
      background: var(--accent-bg); border-color: var(--accent-bg);
    }
    .bb-rail__panel.bb-draw .bb-fam__chk[aria-checked="true"]::after {
      left: auto; right: 2px; background: var(--accent-brd, var(--accent));
    }
    /* On row hover the toggle becomes fully opaque + its "on" knob deepens to the
       true accent, so the interactive affordance is obvious only when reached for. */
    .bb-rail__panel.bb-draw .bb-fam__hdr:hover .bb-fam__chk { opacity: 1; }
    .bb-rail__panel.bb-draw .bb-fam__hdr:hover .bb-fam__chk[aria-checked="true"]::after,
    .bb-rail__panel.bb-draw .bb-fam__chk:hover[aria-checked="true"]::after { background: var(--accent); }
    .bb-rail__panel.bb-draw .bb-fam__chk:hover { border-color: var(--accent-brd); }
    .bb-rail__panel.bb-draw .bb-fam__chk:focus-visible {
      outline: none; opacity: 1; box-shadow: 0 0 0 2px var(--focus-ring);
    }

    /* index number (terracotta datum) + title */
    .bb-fam__num { font-size: 8.5px; color: var(--accent); opacity: 0.85; letter-spacing: 0.02em; }
    .bb-fam__title { color: var(--text-mute); font-size: 10px; letter-spacing: var(--tracking-caps); }
    .bb-fam.is-collapsed .bb-fam__hdr { opacity: 0.78; }

    /* SIZE — recedes until the row is hovered */
    .bb-fam__sizebtn {
      color: var(--text-faint, var(--text-subtle)); border-color: transparent;
      opacity: 0.7; letter-spacing: var(--tracking-caps);
      transition: opacity var(--t-fast), color var(--t-fast), border-color var(--t-fast);
    }
    .bb-rail__panel.bb-draw .bb-fam__hdr:hover .bb-fam__sizebtn { opacity: 1; border-color: var(--border); }
    .bb-fam__sizebtn:hover { color: var(--accent); border-color: var(--accent-brd); }

    /* ====================================================================
       DATUM SLIDER INSTRUMENT — "open rail" (2026-06-27, rev B)
       Per the "2D detailing sliders redesign" handoff, variant A. js/74a wraps
       every <input type=range> in a single thin row:
          ‹  ──grooved + ticked rule · red chop──  ›
       No box: bare chevrons flank a long thin rail with a small square "chop"
       thumb. Drag the chop, click the rail to jump, key it, OR click a chevron
       at each end to step. The rail FLEXES to fill its row everywhere except
       the horizontal ribbons (js/74a keeps the input's width there) — that
       length is what stops it looking cramped. The native input stays the live
       value source and is hidden inside .sl-inst. Tokens fall back so the
       non-DATUM themes stay coherent. Chrome only — exported values untouched. */
    .sl-inst {
      --sl-accent: var(--accent);
      --sl-thumb:  var(--red-chop, var(--accent));
      --sl-h: 22px;
      --sl-groove: 4px;
      --sl-thumb-sz: 15px;
      --sl-thumb-r: 50%;       /* clean round knob (was a 2.5px square "chop") */
      --sl-cap-w: 11px;        /* quiet step-arrows (was 14px — "too big") */
      --sl-inset: 8px;         /* rail end padding; mirrored as INSET in js/74a */
      display: inline-flex; align-items: center; gap: 4px; vertical-align: middle;
      box-sizing: border-box; height: var(--sl-h); min-width: 0;
    }
    .sl-inst.is-disabled { opacity: 0.5; }

    /* the live native input — kept in the DOM, hidden from view */
    .sl-inst > input[type=range] {
      position: absolute; width: 1px; height: 1px; margin: 0; padding: 0;
      opacity: 0; pointer-events: none; clip: rect(0 0 0 0); overflow: hidden;
    }

    /* step chevrons — the clickable arrowheads at each end (no box, no divider) */
    .sl-inst__cap {
      flex: 0 0 var(--sl-cap-w); width: var(--sl-cap-w);
      display: inline-flex; align-items: center; justify-content: center;
      padding: 0; border: 0; background: transparent; cursor: pointer;
      color: var(--text-mute); -webkit-user-select: none; user-select: none;
      border-radius: var(--r-1);
      transition: color var(--t-fast) var(--ease-out);
    }
    .sl-inst__cap svg { width: 10px; height: 10px; display: block; pointer-events: none; }
    .sl-inst__cap:hover:not(:disabled) { color: var(--sl-accent); }
    .sl-inst__cap:active:not(:disabled) { color: var(--accent-press, var(--sl-accent)); }
    .sl-inst__cap:disabled { color: var(--text-faint, var(--text-mute)); cursor: default; opacity: 0.45; }
    .sl-inst__cap:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 0; }

    /* the rail — drag / click / keyboard target */
    .sl-inst__rail { position: relative; flex: 1 1 auto; align-self: stretch; min-width: 24px; cursor: pointer; touch-action: none; }
    .sl-inst__rail:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 1px; border-radius: var(--r-1); }
    .sl-inst__groove {
      position: absolute; left: var(--sl-inset); right: var(--sl-inset); top: 50%; height: var(--sl-groove);
      transform: translateY(-50%); border-radius: var(--r-pill);
      background:
        repeating-linear-gradient(to right, var(--border-2) 0 1px, transparent 1px 10%),
        var(--surface-3);
      box-shadow: inset 0 0 0 1px var(--border);
    }
    .sl-inst__fill {
      position: absolute; left: var(--sl-inset); top: 50%; height: var(--sl-groove);
      transform: translateY(-50%); border-radius: var(--r-pill);
      background: var(--sl-accent); pointer-events: none;
      width: calc((100% - var(--sl-inset) * 2) * var(--p, 0));
    }
    .sl-inst__thumb {
      position: absolute; top: 50%; left: calc(var(--sl-inset) + (100% - var(--sl-inset) * 2) * var(--p, 0));
      width: var(--sl-thumb-sz); height: var(--sl-thumb-sz);
      transform: translate(-50%, -50%);
      background: var(--sl-thumb); border-radius: var(--sl-thumb-r);
      box-shadow: 0 0 0 2px var(--paper-0, var(--surface-2)), var(--shadow-sm);
      transition: transform var(--t-base) var(--ease-out), box-shadow var(--t-base) var(--ease-out);
      pointer-events: none;
    }
    .sl-inst__rail:hover .sl-inst__thumb,
    .sl-inst.is-drag .sl-inst__thumb {
      transform: translate(-50%, -50%) scale(1.15);
      box-shadow: 0 0 0 2.5px var(--paper-0, var(--surface-2)), var(--shadow-pop, var(--shadow-md));
    }
    .sl-inst.is-disabled .sl-inst__rail { cursor: default; }
    .sl-inst.is-disabled .sl-inst__thumb { background: var(--text-subtle, var(--text-mute)); }

    /* BB-rail toolbox 3-up (Density · Size · Text) is dense — tighten the gap. */
    .bb-draw__bar .sl-inst { --sl-cap-w: 10px; gap: 2px; }
    .bb-draw__bar .sl-inst__cap svg { width: 9px; height: 9px; }

    /* Inspector (SETTINGS panel) slider rows — LABEL ON TOP (2026-06-28).
       The fixed ~104px label column starved the rail in the narrow ~250px
       panel (the "much too narrow" complaint). Stacking the label above the
       rail hands the open rail the panel's FULL width — the concept-card
       layout. :has(.sl-inst) out-specifies the js/71-injected
       .ins-row{flex-direction:row} / .ins-row>label{flex:0 0 104px}, so no
       js/71 <style> edit is needed and ONLY slider rows stack (number / select
       / colour / stepper rows stay horizontal). */
    .ins-row:has(.sl-inst) { flex-direction: column; align-items: stretch; gap: 4px; min-height: 0; }
    .ins-row:has(.sl-inst) > label {
      flex: none; align-self: flex-start; min-width: 0; max-width: 100%;
      overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
      text-transform: uppercase; letter-spacing: 0.1em;
      font-size: 10px; color: var(--text-mute); margin: 0 0 1px;
    }
    .ins-row:has(.sl-inst) .sl-inst { flex: 1 1 auto; width: 100%; }

    /* Value readout under the rail — min · VALUE · max, the concept's centred
       bold-accent current value flanked by muted end stops. Painted live by
       js/74a paint() straight off the native input (the single value source),
       so drag / keys / arrows all keep it in sync. Inspector range fields emit
       the .sl-readout markup (js/71); the ribbon + toolbox keep their own
       legacy badge, so this rule simply doesn't apply there. */
    .sl-readout {
      display: flex; align-items: baseline; justify-content: space-between;
      gap: 8px; margin-top: 1px;
      font: 10px var(--font-mono, ui-monospace, monospace);
    }
    .sl-readout__min, .sl-readout__max { flex: 0 0 auto; color: var(--text-mute); }
    .sl-readout__max { text-align: right; }
    .sl-readout__val {
      flex: 1 1 auto; text-align: center; font-weight: 600; font-size: 11px;
      color: var(--accent); font-variant-numeric: tabular-nums;
    }

    /* Fallback for any range input the enhancer hasn't reached yet (JS off /
       mid-build): keep the prior quiet native look so nothing renders broken. */
    input[type=range]:not([data-sl-on]) {
      -webkit-appearance: none; appearance: none;
      height: 14px; background: transparent; cursor: pointer; accent-color: var(--accent);
    }
    input[type=range]:not([data-sl-on])::-webkit-slider-runnable-track { height: 3px; border-radius: 2px; background: var(--border-2); }
    input[type=range]:not([data-sl-on])::-webkit-slider-thumb {
      -webkit-appearance: none; appearance: none;
      width: 12px; height: 12px; border-radius: 50%; margin-top: -4.5px;
      background: var(--accent); border: 2px solid var(--surface-2); box-shadow: 0 0 0 1px var(--border-2);
    }
    input[type=range]:not([data-sl-on])::-moz-range-track { height: 3px; border-radius: 2px; background: var(--border-2); }
    input[type=range]:not([data-sl-on])::-moz-range-thumb {
      width: 12px; height: 12px; border-radius: 50%;
      background: var(--accent); border: 2px solid var(--surface-2); box-shadow: 0 0 0 1px var(--border-2);
    }
    /* Native checkboxes — recolour the tick to the accent everywhere (options
       ribbon, dialogs, layer lists) so no stray browser-blue remains anywhere. */
    input[type=checkbox] { accent-color: var(--accent); }

    /* ---- Per-tool options ribbon (#v25OptionsBar) + Trace bar ----
       The ribbon is built in js/72 with hardcoded inline styles, so the
       cosmetic rules below carry `!important` to win the cascade. Only
       presentation is overridden — every id/handler/width is untouched,
       so tool behaviour is unchanged. */
    #v25OptionsBar {
      border-radius: var(--r-3) !important;
      padding: 7px 12px !important;
      gap: 10px !important;
      border: 1px solid var(--border-2) !important;
      box-shadow: var(--shadow-md), var(--shadow-plate) !important;
    }
    /* Unify the three ad-hoc button styles into one quiet control. */
    #v25OptionsBar button, #traceBar button {
      font-family: var(--font-sans) !important;
      font-size: var(--fs-xs) !important; font-weight: 500 !important;
      padding: 3px 9px !important; min-height: 24px !important;
      border-radius: var(--r-1) !important;
      border: 1px solid var(--border) !important;
      background: var(--surface-2) !important; color: var(--text) !important;
      cursor: pointer !important;
      transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast) !important;
    }
    #v25OptionsBar button:hover, #traceBar button:hover {
      background: var(--accent-bg) !important;
      border-color: var(--accent-brd) !important;
      color: var(--accent-press, var(--accent)) !important;
    }
    /* Selects / number / text fields — the inline rules set only width,
       so these (no !important) layer on cleanly. */
    #v25OptionsBar select,
    #v25OptionsBar input[type=number],
    #v25OptionsBar input[type=text] {
      height: 24px; padding: 0 7px;
      border: 1px solid var(--border); border-radius: var(--r-1);
      background: var(--surface-2); color: var(--text);
      font-family: var(--font-sans); font-size: var(--fs-sm);
    }
    #v25OptionsBar input[type=number] { font-family: var(--font-mono); }
    #v25OptionsBar select:hover, #v25OptionsBar input:hover { border-color: var(--border-2); }
    #v25OptionsBar select:focus, #v25OptionsBar input:focus {
      outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px var(--focus-ring);
    }
    /* Colour swatches — give the bare picker a hairline + radius. */
    #v25OptionsBar input[type=color] { border: 1px solid var(--border-2); border-radius: var(--r-1); }
    /* Field labels: normalise size (keep their muted colour). Numeric
       readouts (id'd spans) go mono+tabular WITHOUT touching colour, so
       the live amber/green validation colours set in JS still win. */
    #v25OptionsBar label > span, #traceBar label > span { font-size: var(--fs-xs) !important; }
    #v25OptionsBar span[id] { font-family: var(--font-mono) !important; font-variant-numeric: tabular-nums; }

    /* ---- Inspector + dialog control consistency (light polish) ---- */
    .insp-field > input, .insp-field > select, .insp-field > textarea,
    .dialog input, .dialog select, .dialog textarea { border-radius: var(--r-1); }
    .insp-btn, .dialog-btn { border-radius: var(--r-1); }

    /* ---- Layers tab — onto the warm palette ----
       Was left on a generic browser checkbox (bright blue) + a bland row. Recolour
       the native tick to the terracotta accent and give the rows the same calm
       hover language as the rest of the rail. Targets BOTH the BB-rail Layers list
       (#bbLayersList) and the legacy floating panel (#layerPanelList). Appended
       last so it wins over the two earlier .layer-row blocks. */
    .bb-rail__panel.bb-layers { padding-top: 6px; }
    .bb-rail__panel.bb-layers .bb-rail__section-title { margin: 2px 0 8px; }
    #bbLayersList .layer-row, #layerPanelList .layer-row {
      display: flex; align-items: center; gap: 9px;
      padding: 4px 8px; margin: 0 -4px;
      border-radius: var(--r-1); cursor: pointer;
      transition: background var(--t-fast) var(--ease-out);
    }
    #bbLayersList .layer-row:hover, #layerPanelList .layer-row:hover { background: var(--hover-bg); }
    #bbLayersList .layer-row input[type="checkbox"],
    #layerPanelList .layer-row input[type="checkbox"] {
      width: 14px; height: 14px; margin: 0; flex: 0 0 auto;
      accent-color: var(--accent); cursor: pointer;
    }
    #bbLayersList .layer-row label, #layerPanelList .layer-row label {
      flex: 1; min-width: 0; cursor: pointer;
      font-family: var(--font-mono); font-size: 11px;
      letter-spacing: var(--tracking-wide); color: var(--text);
      overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    }

    /* ====================================================================
       SLIDER + DROPDOWN REDESIGN — ribbon length & dropdown text-fit
       (2026-06-28). Companion to the .sl-inst token bumps above. Two asks:
       (a) ribbon sliders read as cramped (~78px) — stack the label on top so
       the rail gets the field's full column width; (b) dropdown option text
       (e.g. the CLT "NX 7-220 (40/30/30/20/30/30/40)") clips its box — clamp
       width + ellipsis so the selected label never spills. !important here is
       LEGAL: it only defeats the hardcoded inline styles the js/72 ribbon
       builders emit (style='display:flex…' on labels, style='width:Npx' on
       controls) — exactly the sanctioned case in the DATUM-layer header.
       ==================================================================== */

    /* (a) Ribbon + trace slider FIELDS go label-on-top. Scoped to :has(.sl-inst)
       so ONLY slider fields stack — selects, numbers, buttons stay inline (no
       runaway ribbon height). The label's first <span> becomes a quiet caps
       title; the .sl-inst wrapper (inline width:Npx pinned by js/74a) is freed
       to fill the column; the id'd value badge centres under the rail. */
    #v25OptionsBar label:has(.sl-inst),
    #traceBar label:has(.sl-inst) {
      flex-direction: column !important; align-items: stretch !important;
      gap: 3px !important; width: 138px;
    }
    #v25OptionsBar label:has(.sl-inst) > span:first-child,
    #traceBar label:has(.sl-inst) > span:first-child {
      align-self: flex-start;
      font-size: var(--fs-xs) !important;
      text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-mute);
    }
    #v25OptionsBar label:has(.sl-inst) .sl-inst,
    #traceBar label:has(.sl-inst) .sl-inst {
      width: auto !important; flex: 1 1 auto;
    }
    /* The live value badge (a trailing id'd <span>) — centre it under the rail.
       Colour is left to the JS (some readouts set live amber/green validation
       tints), so only layout is touched here. */
    #v25OptionsBar label:has(.sl-inst) > span[id],
    #traceBar label:has(.sl-inst) > span[id] {
      align-self: center; min-width: 0 !important; text-align: center;
    }

    /* (b) Ribbon + trace SELECTS — never clip the selected option text. The
       hardcoded inline width:Npx is overridden so a long catalogue label grows
       to a sane cap then ellipses; the ribbon's existing flex-wrap absorbs the
       width instead of the box clipping mid-string. */
    #v25OptionsBar select, #traceBar select {
      width: auto !important; max-width: 220px !important; min-width: 56px;
      flex: 0 1 auto;
      white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
      padding-right: 22px;
    }

    /* Inspector / SETTINGS-panel selects are already full-width of their cell;
       just stop the closed-state label (e.g. a long CLT layup) spilling past
       the box edge. The open list still shows the full text. */
    .insp-field > select, .ins-row select {
      white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
      padding-right: 22px;
    }

    /* BB-rail "Reo defaults" Mesh Ø — the one slider that lives OUTSIDE both the
       ribbon and the inspector row, so neither label-on-top rule reaches it.
       Give it the same treatment (full panel width here, since it sits in the
       wide SETTINGS panel) so EVERY slider in the app reads consistently. */
    #bbReoDefaults label:has(.sl-inst) {
      flex-direction: column; align-items: stretch !important; gap: 3px !important;
    }
    #bbReoDefaults label:has(.sl-inst) > span:first-child {
      min-width: 0 !important; align-self: flex-start;
      text-transform: uppercase; letter-spacing: 0.06em;
      font-size: 10px; color: var(--text-mute);
    }
    #bbReoDefaults label:has(.sl-inst) .sl-inst { width: auto !important; flex: 1 1 auto; }
    #bbReoDefaults label:has(.sl-inst) > span[id] {
      align-self: center; min-width: 0 !important; text-align: center;
    }

    /* ============================================================
       home-library — top-level screen router + Home shell (Phase 2)
       Appended after the DATUM layer so it wins the cascade. All colour
       comes from theme tokens, so the five themes themselves correctly.
       ============================================================ */

    /* Router containers: flex-column siblings of #mainLayout, below the 38px
       top bar. setScreen() (js/95b) shows exactly one of #mainLayout /
       .app-screen at a time by toggling .screen--hidden. */
    .app-screen {
      flex: 1 1 auto; min-height: 0;
      overflow: auto;
      background: var(--surface); color: var(--text);
      font-family: var(--font-sans);
    }
    .screen--hidden { display: none !important; }

    /* The brand/logo also routes Home now — make it read as clickable. */
    .top-bar__brand { cursor: pointer; }

    /* Phase-2 placeholder shown on the (otherwise empty) library screens. */
    .home-stub {
      max-width: 640px; margin: 0 auto;
      padding: clamp(40px, 10vh, 120px) 24px;
      display: flex; flex-direction: column; align-items: flex-start; gap: 10px;
    }
    .home-stub__eyebrow {
      font-size: var(--fs-xs); letter-spacing: .14em; text-transform: uppercase;
      color: var(--text-mute);
    }
    .home-stub__title { margin: 0; font-size: var(--fs-3xl); font-weight: 600; color: var(--text); }
    .home-stub__lede { margin: 0 0 8px; color: var(--text-mute); font-size: var(--fs-md); }
    .home-stub__cta {
      appearance: none;
      border: 1px solid var(--border-strong, var(--border));
      background: var(--surface-2); color: var(--text);
      padding: 9px 16px; border-radius: var(--r-2);
      font-family: var(--font-sans); font-size: var(--fs-sm); font-weight: 500;
      cursor: pointer; transition: border-color .12s, color .12s;
    }
    .home-stub__cta:hover { border-color: var(--accent); color: var(--accent); }

    /* ============================================================
       home-redesign — DATUM v4 shell (2026-06-29)
       The Home / All-Details / Projects shell adopts the editorial DATUM v4
       finish: Newsreader serif headlines, JetBrains Mono tracked labels, the
       double-rule signature, corner markers, one clay note per quadrant.
       Fonts are RE-POINTED inside the shell containers ONLY, so #mainLayout
       (the drawing tool, IBM Plex everywhere) is untouched. Every colour is a
       theme token (5 themes) or a DATUM-only token WITH a legacy fallback.
       ============================================================ */

    /* Shell-scoped fonts + v4-only tokens. These cascade to every descendant
       that already references var(--font-serif)/var(--font-mono); --font-sans
       stays IBM Plex Sans (the repo body font). The added scaled tokens are
       declared here so they inherit per-theme without touching :root. */
    #homeScreen, #allDetailsScreen, #projectScreen {
      --font-serif: "Newsreader", ui-serif, Georgia, "Times New Roman", serif;
      --font-mono:  "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
      /* tracking ladder (repo lacks --track-*) */
      --track-tight: -0.018em;
      --track-wide:   0.06em;
      --track-caps:   0.12em;
      --track-letter: 0.26em;
      /* editorial display sizes (repo --fs-* tops out at 28px) */
      --fs-display:  clamp(30px, 3.6vw, 46px);
      --fs-quadt:    23px;   /* quadrant serif title */
      /* line-heights + a soft pop shadow */
      --leading-tight: 1.08;
      --leading-body:  1.55;
      --shadow-pop: var(--shadow-md, 0 6px 18px -8px rgba(0,0,0,.18));
    }

    /* Serif display text gets optical sizing. */
    #homeScreen .hq__title, #homeScreen .hm__h1,
    #allDetailsScreen .alld__title, #projectScreen .proj__title,
    #projectScreen .proj-hdr__name {
      font-optical-sizing: auto;
    }

    /* ---- shared v4 ornaments ---- */
    /* The double rule — 1px top + 1px bottom, the masthead signature. */
    .v4-rule2 {
      height: 4px; margin: 0; border: 0;
      border-top: 1px solid var(--border-strong, var(--border));
      border-bottom: 1px solid var(--border-strong, var(--border));
    }
    /* Short clay rule under display titles. */
    .v4-clayrule { height: 0; width: 46px; margin: 0; border: 0; border-top: 2px solid var(--accent); }

    /* =========================================================
       HOME — the 2×2 quadrant page (#homeScreen .hm)
       ========================================================= */
    .hm { max-width: 1320px; margin: 0 auto; padding: 30px 36px 80px; }

    /* --- slim masthead above the grid --- */
    .hm__mast { margin-bottom: 26px; }
    .hm__eyebrow {
      font-family: var(--font-mono); font-size: var(--fs-2xs);
      text-transform: uppercase; letter-spacing: var(--track-letter); font-weight: 500;
      color: var(--text-mute); margin-bottom: 14px; display: flex; align-items: center; gap: 9px;
    }
    .hm__eyebrow .v4-dot { color: var(--accent); font-weight: 600; }
    .hm__h1 {
      margin: 0; font-family: var(--font-serif); font-weight: 400;
      font-size: var(--fs-display); line-height: var(--leading-tight);
      letter-spacing: var(--track-tight); color: var(--text); text-wrap: balance; max-width: 22ch;
    }
    .hm__h1 em { font-style: italic; color: var(--accent); }
    .hm__lede {
      margin: 16px 0 0; max-width: 60ch; font-family: var(--font-sans);
      font-size: var(--fs-lg); line-height: var(--leading-body); color: var(--text-mute);
    }
    .hm__stat {
      margin: 16px 0 18px; display: flex; flex-wrap: wrap; gap: 8px 18px;
      font-family: var(--font-mono); font-size: var(--fs-2xs); letter-spacing: var(--track-wide);
      text-transform: uppercase; color: var(--text-subtle, var(--text-mute));
    }
    .hm__stat b { color: var(--text); font-weight: 600; }
    .hm__stat .v4-dot { color: var(--accent); }

    /* --- the 2×2 grid --- */
    .hm__grid {
      display: grid;
      grid-template-columns: minmax(330px, 1fr) 1.25fr;
      gap: 1px; background: var(--border);
      border: 1px solid var(--border); border-radius: var(--r-4, 10px); overflow: hidden;
    }
    @media (max-width: 1040px) { .hm__grid { grid-template-columns: 1fr; } }

    /* a quadrant card */
    .hq {
      background: var(--paper-0, var(--surface-2)); color: var(--text);
      padding: 22px 24px 24px; display: flex; flex-direction: column; min-width: 0;
    }
    /* quadrant header row: corner marker + serif title + expand + filling rule */
    .hq__head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 4px; }
    .hq__corner {
      font-family: var(--font-mono); font-size: var(--fs-xs); font-weight: 500;
      letter-spacing: var(--track-wide); color: var(--accent); white-space: nowrap; flex: none;
    }
    .hq__title {
      margin: 0; font-family: var(--font-serif); font-weight: 500;
      font-size: var(--fs-quadt); line-height: var(--leading-tight);
      letter-spacing: var(--track-tight); color: var(--text); white-space: nowrap; flex: none;
    }
    .hq__rule { flex: 1 1 auto; height: 1px; background: var(--border); align-self: center; }
    .hq__expand {
      appearance: none; background: none; border: 0; cursor: pointer; flex: none;
      font-family: var(--font-mono); font-size: var(--fs-2xs); font-weight: 500;
      text-transform: uppercase; letter-spacing: var(--track-wide);
      color: var(--text-mute); padding: 2px 0; position: relative;
      transition: color var(--t-fast, 120ms) var(--ease-out, ease);
    }
    .hq__expand:hover { color: var(--text); box-shadow: inset 0 -2px 0 0 var(--accent); }
    /* the short clay rule sits under the header row in each quadrant */
    .hq__clay { width: 40px; height: 0; border: 0; border-top: 2px solid var(--accent); margin: 0 0 16px; }
    .hq__body { flex: 1 1 auto; min-width: 0; }
    .hq__empty {
      color: var(--text-mute); font-family: var(--font-sans);
      font-size: var(--fs-md); line-height: 1.55; padding: 6px 0;
    }

    /* === ↖ 01 START === */
    .hq--start .hq__lede {
      margin: 0 0 20px; max-width: 38ch; font-family: var(--font-sans);
      font-size: var(--fs-md); line-height: var(--leading-body); color: var(--text-mute);
    }
    .hq--start .hq__actions { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
    /* primary clay button (the one saturated note in this quadrant) */
    .hm-btn {
      appearance: none; cursor: pointer; display: inline-flex; align-items: center; gap: 8px;
      font-family: var(--font-sans); font-weight: 500; font-size: var(--fs-md); letter-spacing: .005em;
      border-radius: var(--r-2); border: 1px solid transparent; line-height: 1;
      transition: background var(--t-base, 160ms) var(--ease-out, ease),
                  border-color var(--t-base, 160ms) var(--ease-out, ease),
                  box-shadow var(--t-base, 160ms) var(--ease-out, ease), transform var(--t-fast, 100ms);
    }
    .hm-btn:active:not(:disabled) { transform: translateY(1px); }
    .hm-btn:disabled { opacity: .5; cursor: default; }
    .hm-btn--primary {
      background: var(--accent); color: var(--accent-ink, #fff); border-color: var(--accent);
      padding: 13px 24px; font-size: var(--fs-lg); box-shadow: var(--shadow-sm, 0 1px 2px rgba(0,0,0,.05));
    }
    .hm-btn--primary:hover:not(:disabled) { background: var(--accent-hover, var(--accent)); border-color: var(--accent-hover, var(--accent)); box-shadow: var(--shadow-pop); }
    .hm-btn--ghost {
      background: var(--surface-2); color: var(--text); border-color: var(--border-2, var(--border));
      padding: 11px 20px;
    }
    .hm-btn--ghost:hover:not(:disabled) { border-color: var(--border-strong, var(--accent)); box-shadow: var(--shadow-sm, 0 1px 2px rgba(0,0,0,.05)); }
    /* quiet tertiary text-link (Import .sdproj) */
    .hm-link {
      appearance: none; background: none; border: 0; cursor: pointer; padding: 2px 0; margin-top: 2px;
      font-family: var(--font-mono); font-size: var(--fs-2xs); font-weight: 500;
      text-transform: uppercase; letter-spacing: var(--track-wide); color: var(--text-subtle, var(--text-mute));
      position: relative;
    }
    .hm-link:hover { color: var(--text); box-shadow: inset 0 -2px 0 0 var(--accent); }
    .hm-link:disabled { opacity: .5; cursor: default; }

    /* === ↗ 02 PROJECTS table === */
    .hq-pt { display: flex; flex-direction: column; }
    .hq-pt__row {
      appearance: none; text-align: left; cursor: pointer; width: 100%;
      display: grid; grid-template-columns: minmax(0, 1.6fr) auto; gap: 14px; align-items: center;
      padding: 11px 6px; border: 0; border-bottom: 1px solid var(--border); background: transparent;
      transition: background var(--t-fast, 120ms) var(--ease-out, ease);
    }
    .hq-pt__row:hover { background: var(--accent-bg, color-mix(in srgb, var(--text) 6%, transparent)); }
    .hq-pt__row--unfiled .hq-pt__name { font-style: italic; color: var(--text-mute); }
    .hq-pt__main { display: flex; align-items: baseline; gap: 9px; min-width: 0; }
    .hq-pt__dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); align-self: center; }
    .hq-pt__name { font-family: var(--font-serif); font-size: var(--fs-xl); font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
    .hq-pt__num { font-family: var(--font-mono); font-size: var(--fs-2xs); letter-spacing: var(--track-wide); color: var(--text-mute); flex: none; }
    .hq-pt__counts { font-family: var(--font-mono); font-size: var(--fs-2xs); letter-spacing: var(--track-wide); text-transform: uppercase; color: var(--text-subtle, var(--text-mute)); white-space: nowrap; }
    /* the [details · sketches · markups] mini-previews */
    .hq-pt__previews { display: flex; gap: 12px; align-items: center; justify-self: end; }
    .hq-pt__pv { display: flex; align-items: center; gap: 4px; }
    .hq-pt__pvl { font-family: var(--font-mono); font-size: 8px; letter-spacing: var(--track-wide); text-transform: uppercase; color: var(--text-faint, var(--text-mute)); writing-mode: vertical-rl; transform: rotate(180deg); }
    .hq-pt__thumbs { display: flex; }
    .hq-pt__th {
      width: 30px; height: 22px; border: 1px solid var(--border); border-radius: var(--r-1, 3px);
      background: var(--paper, var(--surface-3)); margin-left: -7px; overflow: hidden; display: grid; place-items: center;
      box-shadow: var(--shadow-sm, 0 1px 2px rgba(0,0,0,.05));
    }
    .hq-pt__th:first-child { margin-left: 0; }
    .hq-pt__th img { width: 100%; height: 100%; object-fit: cover; display: block; }
    .hq-pt__th--empty { background: var(--surface-3, var(--surface)); }
    .hq-pt__more { font-family: var(--font-mono); font-size: var(--fs-2xs); color: var(--text-faint, var(--text-mute)); align-self: center; }
    /* inline + New project form */
    .hq-pt__newbar { margin-top: 12px; }
    .hq-pt__newbtn {
      appearance: none; background: none; border: 0; cursor: pointer; padding: 4px 0;
      font-family: var(--font-mono); font-size: var(--fs-2xs); font-weight: 500;
      text-transform: uppercase; letter-spacing: var(--track-wide); color: var(--text-mute);
    }
    .hq-pt__newbtn:hover { color: var(--accent); box-shadow: inset 0 -2px 0 0 var(--accent); }
    .hq-pt__newform { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; align-items: center; }
    .hq-input {
      height: 32px; padding: 0 10px; border: 1px solid var(--border-2, var(--border)); border-radius: var(--r-2);
      background: var(--surface-2); color: var(--text); font: var(--fs-sm)/1 var(--font-sans, system-ui);
    }
    .hq-input:focus { outline: none; border-color: var(--accent-brd, var(--accent)); box-shadow: 0 0 0 3px var(--focus-ring, transparent); }
    .hq-input--name { flex: 1 1 160px; min-width: 120px; }
    .hq-input--num { width: 120px; font-family: var(--font-mono); }
    .hq-pt__create {
      height: 32px; padding: 0 16px; border: 1px solid var(--accent); border-radius: var(--r-2);
      background: var(--accent); color: var(--accent-ink, #fff); font: 500 var(--fs-sm)/1 var(--font-sans, system-ui); cursor: pointer;
    }
    .hq-pt__create:hover { background: var(--accent-hover, var(--accent)); }
    .hq-pt__cancel {
      height: 32px; padding: 0 12px; border: 1px solid var(--border); border-radius: var(--r-2);
      background: transparent; color: var(--text-mute); font: var(--fs-sm)/1 var(--font-sans, system-ui); cursor: pointer;
    }
    .hq-pt__cancel:hover { border-color: var(--accent); color: var(--accent); }

    /* === ↙ 03 RECENT — horizontal-scroll cards === */
    .hq-rec { display: flex; gap: 14px; overflow-x: auto; padding: 2px 2px 10px; }
    .hm-card {
      appearance: none; text-align: left; cursor: pointer; padding: 0; flex: 0 0 188px;
      display: flex; flex-direction: column;
      background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-3, 8px);
      overflow: hidden; color: var(--text);
      transition: border-color var(--t-base, 160ms) var(--ease-out, ease),
                  box-shadow var(--t-base, 160ms) var(--ease-out, ease), transform var(--t-base, 160ms);
    }
    .hm-card:hover { border-color: var(--border-2, var(--accent)); box-shadow: var(--shadow-pop); transform: translateY(-2px); }
    .hm-card__fig { aspect-ratio: 1.414 / 1; background: var(--paper, var(--surface-2)); display: grid; place-items: center; overflow: hidden; }
    .hm-card__fig--empty { background: var(--surface-3, var(--surface)); }
    .hm-card__img { width: 100%; height: 100%; object-fit: contain; display: block; }
    .hm-card__ph { font-family: var(--font-mono); font-size: var(--fs-2xs); letter-spacing: var(--track-wide); text-transform: uppercase; color: var(--text-faint, var(--text-mute)); }
    .hm-card__body { padding: 9px 11px 11px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
    .hm-card__num { font-family: var(--font-mono); font-size: var(--fs-2xs); letter-spacing: var(--track-wide); color: var(--text-mute); }
    .hm-card__title { font-family: var(--font-serif); font-size: var(--fs-lg); font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .hm-card__meta { font-family: var(--font-mono); font-size: var(--fs-2xs); letter-spacing: var(--track-wide); text-transform: uppercase; color: var(--text-subtle, var(--text-mute)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .hm-card__meta .v4-unf { color: var(--accent); }

    /* === ↘ 04 ALL DETAILS — filter bar + contact-sheet tiles === */
    .hq-ad__filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
    .hq-ad__search {
      flex: 1 1 160px; min-width: 130px; height: 32px; padding: 0 10px;
      border: 1px solid var(--border-2, var(--border)); border-radius: var(--r-2);
      background: var(--surface-2); color: var(--text); font: var(--fs-sm) var(--font-sans, system-ui);
    }
    .hq-ad__search:focus { outline: none; border-color: var(--accent-brd, var(--accent)); box-shadow: 0 0 0 3px var(--focus-ring, transparent); }
    .hq-ad__sel {
      height: 32px; padding: 0 8px; border: 1px solid var(--border-2, var(--border)); border-radius: var(--r-2);
      background: var(--surface-2); color: var(--text); font: var(--fs-sm) var(--font-sans, system-ui); max-width: 180px;
    }
    .hq-ad__sel:focus { outline: none; border-color: var(--accent); }
    .hq-ad__chips { display: flex; flex-wrap: wrap; gap: 6px; }
    .hq-ad__chip {
      appearance: none; cursor: pointer; border: 1px solid var(--border-2, var(--border));
      background: var(--surface-2); color: var(--text-mute); border-radius: var(--r-pill, 999px);
      padding: 5px 12px; font-family: var(--font-mono); font-size: var(--fs-2xs);
      text-transform: uppercase; letter-spacing: var(--track-wide); white-space: nowrap;
    }
    .hq-ad__chip:hover { border-color: var(--accent-brd, var(--accent)); color: var(--text); }
    .hq-ad__chip--on { background: var(--accent); color: var(--accent-ink, #fff); border-color: var(--accent); }
    .hq-ad__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
    .hm-tile {
      appearance: none; text-align: left; cursor: pointer; padding: 0;
      display: flex; flex-direction: column;
      background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-2, 6px);
      overflow: hidden; color: var(--text);
      transition: border-color var(--t-base, 160ms) var(--ease-out, ease),
                  box-shadow var(--t-base, 160ms) var(--ease-out, ease), transform var(--t-base, 160ms);
    }
    .hm-tile:hover { border-color: var(--border-2, var(--accent)); box-shadow: var(--shadow-pop); transform: translateY(-2px); }
    .hm-tile__fig { aspect-ratio: 1.414 / 1; background: var(--paper, var(--surface-2)); display: grid; place-items: center; overflow: hidden; }
    .hm-tile__fig--empty { background: var(--surface-3, var(--surface)); }
    .hm-tile__img { width: 100%; height: 100%; object-fit: contain; display: block; }
    .hm-tile__ph { font-family: var(--font-mono); font-size: var(--fs-2xs); letter-spacing: var(--track-wide); text-transform: uppercase; color: var(--text-faint, var(--text-mute)); }
    .hm-tile__body { padding: 7px 9px 9px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
    .hm-tile__title { font-family: var(--font-serif); font-size: var(--fs-md); font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .hm-tile__tag { font-family: var(--font-mono); font-size: var(--fs-2xs); letter-spacing: var(--track-wide); text-transform: uppercase; color: var(--text-subtle, var(--text-mute)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .hm-tile__tag .v4-unf { color: var(--accent); }

    /* a small inline target-picker popover (Upload PDF / Move-to) */
    .hm-pop {
      position: fixed; z-index: 200; min-width: 180px; max-height: 60vh; overflow: auto;
      background: var(--paper-0, var(--surface-2)); border: 1px solid var(--border-strong, var(--border));
      border-radius: var(--r-3, 8px); box-shadow: var(--shadow-overlay, 0 18px 48px -12px rgba(0,0,0,.28)); padding: 6px;
    }
    .hm-pop__t {
      font-family: var(--font-mono); font-size: var(--fs-2xs); letter-spacing: var(--track-wide);
      text-transform: uppercase; color: var(--text-mute); padding: 6px 8px 8px;
    }
    .hm-pop__b {
      appearance: none; display: block; width: 100%; text-align: left; cursor: pointer;
      background: transparent; border: 0; border-radius: var(--r-1, 4px); padding: 8px 10px;
      font-family: var(--font-sans); font-size: var(--fs-sm); color: var(--text);
    }
    .hm-pop__b:hover { background: var(--accent-bg, color-mix(in srgb, var(--text) 7%, transparent)); }
    .hm-pop__b--unf { font-style: italic; color: var(--text-mute); }

    /* ============================================================
       home-redesign v2 — the STACKED one-page workspace (2026-06-30)
       Replaces the 2×2 quadrant (#homeScreen .hm / .hm__grid / .hq* above are now
       unused — kept until the P5 dead-CSS sweep). Same DATUM v4 tokens + fonts
       (inherited from the shell scope) and the .hm-btn* / .hm-link atoms above.
       Every colour is a theme token or a DATUM token WITH a legacy fallback.
       ============================================================ */
    .hm-stack { max-width: 1400px; margin: 0 auto; padding: 24px 32px 90px; display: flex; flex-direction: column; gap: 30px; }

    /* 1. top strip (quick actions) */
    .hm-strip { display: flex; align-items: center; justify-content: space-between; gap: 20px 28px; flex-wrap: wrap;
                padding-bottom: 18px; border-bottom: 1px solid var(--border-strong, var(--border)); }
    .hm-strip__brand { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
    .hm-strip__eyebrow { font-family: var(--font-mono); font-size: var(--fs-2xs); text-transform: uppercase;
                         letter-spacing: var(--track-letter); font-weight: 500; color: var(--text-mute); }
    .hm-strip__h1 { margin: 0; font-family: var(--font-serif); font-weight: 400; font-size: clamp(22px, 2.4vw, 30px);
                    line-height: 1.05; letter-spacing: var(--track-tight); color: var(--text); }
    .hm-strip__h1 em { font-style: italic; color: var(--accent); }
    .hm-strip__actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

    /* shared section header */
    .hm-sec { display: flex; flex-direction: column; }
    .hm-sec__head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 14px; flex-wrap: wrap; }
    .hm-sec__title { font-family: var(--font-serif); font-weight: 500; font-size: var(--fs-quadt); letter-spacing: var(--track-tight);
                     color: var(--text); white-space: nowrap; flex: none; }
    .hm-sec__rule { flex: 1 1 60px; height: 1px; background: var(--border); align-self: center; min-width: 24px; }
    .hm-sec__more { appearance: none; background: none; border: 0; cursor: pointer; flex: none;
                    font-family: var(--font-mono); font-size: var(--fs-2xs); font-weight: 500; text-transform: uppercase;
                    letter-spacing: var(--track-wide); color: var(--text-mute); padding: 2px 0; }
    .hm-sec__more:hover { color: var(--text); box-shadow: inset 0 -2px 0 0 var(--accent); }
    .hm-sec__newproj { flex: none; }

    .hm-empty { color: var(--text-mute); font-family: var(--font-sans); font-size: var(--fs-md); line-height: 1.55; padding: 8px 2px; }

    /* 2. recent ribbon — a narrow band; "More" wraps it into rows */
    .hm-ribbon { display: flex; gap: 12px; overflow-x: auto; padding: 2px 2px 10px; scrollbar-width: thin; }
    .hm-ribbon--all { flex-wrap: wrap; overflow-x: visible; }
    .hm-ribbon__tile { appearance: none; cursor: pointer; padding: 0; flex: 0 0 124px; width: 124px;
                       display: flex; flex-direction: column; background: var(--surface-2); border: 1px solid var(--border);
                       border-radius: var(--r-2, 6px); overflow: hidden; color: var(--text);
                       transition: border-color .14s, box-shadow .14s, transform .14s; }
    .hm-ribbon__tile:hover { border-color: var(--border-2, var(--accent)); box-shadow: var(--shadow-pop); transform: translateY(-2px); }
    .hm-ribbon__fig { aspect-ratio: 1.414 / 1; background: var(--paper, var(--surface-2)); display: grid; place-items: center; overflow: hidden; }
    .hm-ribbon__fig--empty, .hm-ribbon__fig--pdf { background: var(--surface-3, var(--surface)); }
    .hm-ribbon__img { width: 100%; height: 100%; object-fit: contain; display: block; }
    .hm-ribbon__ph { font-family: var(--font-mono); font-size: var(--fs-2xs); letter-spacing: var(--track-wide); color: var(--text-faint, var(--text-mute)); }
    .hm-ribbon__cap { padding: 6px 8px 8px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
    .hm-ribbon__lbl { font-family: var(--font-mono); font-size: var(--fs-2xs); letter-spacing: var(--track-wide); color: var(--text);
                      white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .hm-ribbon__sub { font-family: var(--font-sans); font-size: var(--fs-2xs); color: var(--text-subtle, var(--text-mute));
                      white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

    /* 3. project cards — large horizontal cards */
    .hm-projects { display: flex; flex-direction: column; gap: 18px; }
    .hm-pcard { border: 1px solid var(--border); border-radius: var(--r-4, 10px); background: var(--surface-2);
                padding: 18px 20px; display: flex; flex-direction: column; gap: 16px; }
    .hm-pcard--unfiled { background: var(--surface-3, var(--surface)); border-style: dashed; }
    .hm-pcard__head { display: flex; align-items: flex-start; gap: 16px; }
    .hm-pcard__titlewrap { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1 1 auto; }
    .hm-pcard__name { font-family: var(--font-serif); font-weight: 600; font-size: var(--fs-2xl, 24px); letter-spacing: var(--track-tight);
                      color: var(--text); line-height: 1.1; }
    .hm-pcard--unfiled .hm-pcard__name { font-style: italic; font-weight: 500; color: var(--text-mute); }
    .hm-pcard__info { font-family: var(--font-mono); font-size: var(--fs-2xs); letter-spacing: var(--track-wide); text-transform: uppercase;
                      color: var(--text-subtle, var(--text-mute)); }
    .hm-pcard__open { flex: none; align-self: flex-start; appearance: none; background: transparent; border: 1px solid var(--border);
                      color: var(--text-mute); border-radius: var(--r-1, 4px); padding: 6px 13px; cursor: pointer; margin-top: 4px;
                      font-family: var(--font-mono); font-size: var(--fs-2xs); text-transform: uppercase; letter-spacing: var(--track-wide); }
    .hm-pcard__open:hover { border-color: var(--accent); color: var(--accent); }
    /* Row reads: identity · all-details montage · sketches · markups */
    .hm-pcard__body { display: grid; grid-template-columns: minmax(160px, 210px) minmax(120px, 150px) minmax(0, 1fr) minmax(0, 320px);
                      gap: 28px; align-items: start; justify-content: start; }
    @media (max-width: 1080px) { .hm-pcard__body { grid-template-columns: 1fr; gap: 18px; } }
    .hm-pcard__col--id { gap: 6px; }

    /* ALL-DETAILS column: a 2×2 thumb montage + an "N details →" link into the
       project-scoped contact sheet (Phase-4 renderer). */
    .hm-pcard__col--alld { gap: 8px; }
    .hm-pcard__alld { appearance: none; cursor: pointer; padding: 0; width: 100%; aspect-ratio: 1 / 1; position: relative;
                      background: var(--paper, var(--surface)); border: 1px solid var(--border); border-radius: var(--r-2, 6px);
                      overflow: hidden; display: block; transition: border-color .14s, box-shadow .14s; }
    .hm-pcard__alld:hover { border-color: var(--accent-brd, var(--accent)); box-shadow: var(--shadow-pop); }
    .hm-pcard__alld--empty { display: grid; place-items: center; }
    .hm-pcard__alld-ph { font-family: var(--font-mono); font-size: var(--fs-2xs); letter-spacing: var(--track-wide); text-transform: uppercase; color: var(--text-faint, var(--text-mute)); }
    .hm-pcard__alldgrid { position: absolute; inset: 0; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 1px; background: var(--border); }
    .hm-pcard__alldcell { background: var(--surface-2); overflow: hidden; display: grid; place-items: center; }
    .hm-pcard__alldcell--empty { background: var(--surface-3, var(--surface)); }
    .hm-pcard__alldimg { width: 100%; height: 100%; object-fit: contain; display: block; }
    .hm-pcard__alldlink { align-self: flex-start; appearance: none; background: none; border: 0; cursor: pointer; padding: 4px 0;
                          font-family: var(--font-mono); font-size: var(--fs-2xs); text-transform: uppercase; letter-spacing: var(--track-wide); color: var(--text-mute); }
    .hm-pcard__alldlink:hover { color: var(--accent); box-shadow: inset 0 -2px 0 0 var(--accent); }
    .hm-pcard__col--id .hm-pcard__info--addr { text-transform: none; letter-spacing: var(--track-normal, normal);
                      font-family: var(--font-sans); font-size: var(--fs-xs); color: var(--text-mute); }

    .hm-pcard__col { min-width: 0; display: flex; flex-direction: column; gap: 10px; }
    .hm-pcard__coltitle { font-family: var(--font-mono); font-size: var(--fs-2xs); font-weight: 600; text-transform: uppercase;
                          letter-spacing: var(--track-caps); color: var(--text); }
    .hm-pcard__colhead { display: flex; align-items: center; gap: 8px; }
    .hm-pcard__colhead .hm-pcard__coltitle { flex: 1 1 auto; }
    .hm-pcard__coladd { appearance: none; background: transparent; border: 1px solid var(--border); color: var(--text); cursor: pointer;
                        border-radius: var(--r-1, 4px); padding: 3px 9px; font-size: var(--fs-2xs); font-family: var(--font-sans, system-ui); white-space: nowrap; }
    .hm-pcard__coladd:hover { border-color: var(--accent); color: var(--accent); }

    .hm-pcard__list { display: flex; flex-direction: column; gap: 7px; }
    .hm-pcard__empty { color: var(--text-mute); font-size: var(--fs-2xs); padding: 4px 2px; }
    .hm-pcard__showall { align-self: flex-start; appearance: none; background: none; border: 0; cursor: pointer; padding: 4px 0; margin-top: 2px;
                         font-family: var(--font-mono); font-size: var(--fs-2xs); text-transform: uppercase; letter-spacing: var(--track-wide); color: var(--text-mute); }
    .hm-pcard__showall:hover { color: var(--accent); box-shadow: inset 0 -2px 0 0 var(--accent); }

    .hm-pcard__skrow { display: flex; align-items: center; gap: 7px; padding: 4px 6px; background: var(--surface, var(--surface-2));
                       border: 1px solid var(--border); border-radius: var(--r-2, 6px); transition: border-color .12s, opacity .12s; }
    .hm-pcard__skrow:hover { border-color: var(--accent-brd, var(--accent)); }
    .hm-pcard__skrow--drag { opacity: .45; }
    .hm-pcard__skrow--over { border-color: var(--accent); box-shadow: 0 -2px 0 0 var(--accent) inset; }
    .hm-pcard__grip { cursor: grab; color: var(--text-faint, var(--text-mute)); font-size: 12px; line-height: 1; user-select: none; flex: none; }
    .hm-pcard__skopen { appearance: none; cursor: pointer; flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 8px;
                        background: transparent; border: 0; padding: 0; text-align: left; color: var(--text); }
    .hm-pcard__skfig { flex: 0 0 auto; width: 76px; height: 54px; border: 1px solid var(--border); border-radius: var(--r-1, 4px);
                       background: var(--paper, var(--surface-2)); overflow: hidden; display: grid; place-items: center; }
    .hm-pcard__skfig--empty { background: var(--surface-3, var(--surface)); }
    .hm-pcard__skimg { width: 100%; height: 100%; object-fit: contain; display: block; }
    .hm-pcard__skinfo { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1 1 auto; }
    .hm-pcard__sknum { font-family: var(--font-mono, monospace); font-size: var(--fs-2xs); color: var(--text-mute); }
    .hm-pcard__sktitle { font-size: var(--fs-sm); font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .hm-pcard__skedit { font-size: var(--fs-sm); height: 22px; padding: 0 6px; border: 1px solid var(--accent); border-radius: var(--r-1, 3px);
                        background: var(--surface-2); color: var(--text); min-width: 0; width: 100%; font-family: var(--font-sans, system-ui); }
    .hm-pcard__skedit:focus { outline: none; }
    /* actions stay out of the way until the row is hovered/focused — keeps the compact list clean */
    .hm-pcard__skacts { display: flex; align-items: center; gap: 1px; flex: 0 0 auto; opacity: 0; transition: opacity .12s; }
    .hm-pcard__skrow:hover .hm-pcard__skacts,
    .hm-pcard__skrow:focus-within .hm-pcard__skacts { opacity: 1; }
    .hm-pcard__skact { background: transparent; border: 1px solid transparent; color: var(--text-mute); cursor: pointer; border-radius: var(--r-1, 4px);
                       padding: 2px 5px; font-size: var(--fs-2xs); font-family: var(--font-sans, system-ui); white-space: nowrap; }
    .hm-pcard__skact:hover { border-color: var(--border); color: var(--text); }
    .hm-pcard__skact--del:hover { border-color: var(--danger, #c0392b); color: var(--danger, #c0392b); }

    .hm-pcard__mkgroup { font-family: var(--font-mono); font-size: var(--fs-2xs); letter-spacing: var(--track-wide); text-transform: uppercase;
                         color: var(--text-mute); margin-top: 4px; }
    .hm-pcard__mkrow { display: flex; align-items: center; gap: 7px; padding: 4px 6px; background: var(--surface, var(--surface-2));
                       border: 1px solid var(--border); border-radius: var(--r-2, 6px); }
    .hm-pcard__mkrow:hover { border-color: var(--accent-brd, var(--accent)); }
    .hm-pcard__mkmain { display: flex; align-items: center; gap: 8px; flex: 1 1 auto; min-width: 0; }
    .hm-pcard__mkfig { flex: 0 0 auto; width: 76px; height: 54px; border: 1px solid var(--border); border-radius: var(--r-1, 3px);
                       background: var(--paper, var(--surface-2)); overflow: hidden; display: grid; place-items: center; }
    .hm-pcard__mkfig--empty { background: var(--surface-3, var(--surface)); }
    .hm-pcard__mkimg { width: 100%; height: 100%; object-fit: cover; display: block; }
    .hm-pcard__mkph { font-size: var(--fs-2xs); color: var(--text-faint, var(--text-mute)); letter-spacing: .04em; }
    .hm-pcard__mkname { flex: 1 1 auto; min-width: 0; font-size: var(--fs-xs); color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .hm-pcard__mkacts { display: flex; align-items: center; gap: 1px; flex: 0 0 auto; opacity: 0; transition: opacity .12s; }
    .hm-pcard__mkrow:hover .hm-pcard__mkacts,
    .hm-pcard__mkrow:focus-within .hm-pcard__mkacts { opacity: 1; }

    /* inline + New project (in the Projects section header) */
    .hm-newproj__btn { appearance: none; background: none; border: 0; cursor: pointer; padding: 4px 0;
                       font-family: var(--font-mono); font-size: var(--fs-2xs); font-weight: 500; text-transform: uppercase; letter-spacing: var(--track-wide); color: var(--text-mute); }
    .hm-newproj__btn:hover { color: var(--accent); box-shadow: inset 0 -2px 0 0 var(--accent); }
    .hm-newproj__form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
    .hm-input { height: 32px; padding: 0 10px; border: 1px solid var(--border-2, var(--border)); border-radius: var(--r-2);
                background: var(--surface-2); color: var(--text); font: var(--fs-sm)/1 var(--font-sans, system-ui); }
    .hm-input:focus { outline: none; border-color: var(--accent-brd, var(--accent)); box-shadow: 0 0 0 3px var(--focus-ring, transparent); }
    .hm-input--name { width: 180px; } .hm-input--num { width: 130px; font-family: var(--font-mono); } .hm-input--addr { width: 200px; }
    .hm-newproj__create { height: 32px; padding: 0 16px; border: 1px solid var(--accent); border-radius: var(--r-2); background: var(--accent);
                          color: var(--accent-ink, #fff); font: 500 var(--fs-sm)/1 var(--font-sans, system-ui); cursor: pointer; }
    .hm-newproj__create:hover { background: var(--accent-hover, var(--accent)); }
    .hm-newproj__create:disabled { opacity: .55; cursor: default; }
    .hm-newproj__cancel { height: 32px; padding: 0 12px; border: 1px solid var(--border); border-radius: var(--r-2); background: transparent;
                          color: var(--text-mute); font: var(--fs-sm)/1 var(--font-sans, system-ui); cursor: pointer; }
    .hm-newproj__cancel:hover { border-color: var(--accent); color: var(--accent); }

    /* 4. the all-details wall (the "pokemon-card" contact sheet) */
    .hm-wall__filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
    .hm-wall__search { flex: 1 1 240px; min-width: 180px; height: 34px; padding: 0 11px; border: 1px solid var(--border-2, var(--border));
                       border-radius: var(--r-2, 6px); background: var(--surface-2); color: var(--text); font: var(--fs-sm) var(--font-sans, system-ui); }
    .hm-wall__search:focus { outline: none; border-color: var(--accent-brd, var(--accent)); box-shadow: 0 0 0 3px var(--focus-ring, transparent); }
    .hm-wall__sel { height: 34px; padding: 0 10px; border: 1px solid var(--border-2, var(--border)); border-radius: var(--r-2, 6px);
                    background: var(--surface-2); color: var(--text); font: var(--fs-sm) var(--font-sans, system-ui); max-width: 200px; }
    .hm-wall__sel:focus { outline: none; border-color: var(--accent); }
    .hm-wall__grid { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 12px; }
    @media (max-width: 1200px) { .hm-wall__grid { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
    @media (max-width: 900px)  { .hm-wall__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
    @media (max-width: 560px)  { .hm-wall__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
    .hm-wall__foot { margin-top: 16px; display: flex; justify-content: center; }
    .hm-wall__showall { appearance: none; background: var(--surface-2); border: 1px solid var(--border-2, var(--border)); cursor: pointer;
                        border-radius: var(--r-2, 6px); padding: 9px 20px; font-family: var(--font-mono); font-size: var(--fs-2xs);
                        text-transform: uppercase; letter-spacing: var(--track-wide); color: var(--text); }
    .hm-wall__showall:hover { border-color: var(--accent); color: var(--accent); }
    .hm-wall__count { font-family: var(--font-mono); font-size: var(--fs-2xs); text-transform: uppercase; letter-spacing: var(--track-wide); color: var(--text-mute); }
    .hm-wall__card { appearance: none; text-align: left; cursor: pointer; padding: 0; display: flex; flex-direction: column;
                     background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-2, 6px); overflow: hidden; color: var(--text);
                     transition: border-color .14s, box-shadow .14s, transform .14s; }
    .hm-wall__card:hover { border-color: var(--border-2, var(--accent)); box-shadow: var(--shadow-pop); transform: translateY(-2px); }
    .hm-wall__fig { aspect-ratio: 1.414 / 1; background: var(--paper, var(--surface-2)); display: grid; place-items: center; overflow: hidden; }
    .hm-wall__fig--empty { background: var(--surface-3, var(--surface)); }
    .hm-wall__img { width: 100%; height: 100%; object-fit: contain; display: block; }
    .hm-wall__ph { font-family: var(--font-mono); font-size: var(--fs-2xs); letter-spacing: var(--track-wide); color: var(--text-faint, var(--text-mute)); }
    .hm-wall__cap { padding: 7px 9px 9px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
    .hm-wall__captitle { font-family: var(--font-serif); font-size: var(--fs-sm); font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .hm-wall__capmeta { font-family: var(--font-mono); font-size: var(--fs-2xs); letter-spacing: var(--track-wide); text-transform: uppercase; color: var(--text-subtle, var(--text-mute)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

    /* shared target-picker popover (js/95g LibWidgets.popover) — mirrors .hm-pop */
    .lw-pop { position: fixed; z-index: 200; min-width: 180px; max-height: 60vh; overflow: auto; background: var(--paper-0, var(--surface-2));
              border: 1px solid var(--border-strong, var(--border)); border-radius: var(--r-3, 8px);
              box-shadow: var(--shadow-overlay, 0 18px 48px -12px rgba(0,0,0,.28)); padding: 6px; }
    .lw-pop__t { font-family: var(--font-mono); font-size: var(--fs-2xs); letter-spacing: var(--track-wide); text-transform: uppercase; color: var(--text-mute); padding: 6px 8px 8px; }
    .lw-pop__b { appearance: none; display: block; width: 100%; text-align: left; cursor: pointer; background: transparent; border: 0;
                 border-radius: var(--r-1, 4px); padding: 8px 10px; font-family: var(--font-sans); font-size: var(--fs-sm); color: var(--text); }
    .lw-pop__b:hover { background: var(--accent-bg, color-mix(in srgb, var(--text) 7%, transparent)); }
    .lw-pop__b--unf { font-style: italic; color: var(--text-mute); }
    .lw-pop__b--danger { color: var(--danger, #c0392b); }

    /* ---- home-library — the All Details page (#allDetailsScreen), DATUM v4 ----
       Library-wide contact sheet: search + Project/Engineer/Category/Sort filters
       + adjustable columns. The "massive ALL DETAILS infinite page" (Expand
       target). Serif/mono inherit from the shell scope above. Double-rule header,
       corner-marker eyebrow, contact-sheet tile density, clay accents. */
    .alld { max-width: 1440px; margin: 0 auto; padding: 30px 36px 90px; }
    .alld__eyebrow {
      font-family: var(--font-mono); font-size: var(--fs-2xs);
      letter-spacing: var(--track-letter); text-transform: uppercase; font-weight: 500;
      color: var(--text-mute); display: flex; align-items: center; gap: 9px; margin-bottom: 14px;
    }
    .alld__eyebrow .v4-dot { color: var(--accent); font-weight: 600; }
    .alld__titlerow { display: flex; align-items: baseline; gap: 14px; margin-top: 2px; }
    .alld__title {
      margin: 0; font-family: var(--font-serif); font-weight: 400;
      font-size: var(--fs-display); line-height: var(--leading-tight); letter-spacing: var(--track-tight); color: var(--text);
    }
    .alld__title em { font-style: italic; color: var(--accent); }
    .alld__count { font-family: var(--font-mono); font-size: var(--fs-xs); letter-spacing: var(--track-wide); text-transform: uppercase; color: var(--text-mute); }
    .alld__back {
      margin-left: auto; align-self: center; background: transparent; border: 0; color: var(--text-mute);
      font-family: var(--font-mono); font-size: var(--fs-2xs); font-weight: 500; text-transform: uppercase; letter-spacing: var(--track-wide);
      padding: 4px 0; cursor: pointer; position: relative;
    }
    .alld__back:hover { color: var(--text); box-shadow: inset 0 -2px 0 0 var(--accent); }
    /* short clay rule + double rule below the title row */
    .alld__titlerow + .alld__clay { width: 46px; height: 0; border: 0; border-top: 2px solid var(--accent); margin: 16px 0 0; }
    .alld__rule2 { height: 4px; margin: 16px 0 0; border: 0; border-top: 1px solid var(--border-strong, var(--border)); border-bottom: 1px solid var(--border-strong, var(--border)); }

    .alld__controls { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px; margin: 22px 0 12px; }
    .alld__field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
    .alld__field--grow { flex: 1 1 260px; }
    .alld__field-l { font-family: var(--font-mono); font-size: var(--fs-2xs); letter-spacing: var(--track-caps); text-transform: uppercase; color: var(--text-subtle, var(--text-mute)); }
    .alld__search, .alld__select {
      height: 34px; padding: 0 11px; border: 1px solid var(--border-2, var(--border)); border-radius: var(--r-2, 6px);
      background: var(--surface-2); color: var(--text); font: var(--fs-sm) var(--font-sans, system-ui); min-width: 140px;
    }
    .alld__field--grow .alld__search { width: 100%; }
    .alld__search:focus, .alld__select:focus { outline: none; border-color: var(--accent-brd, var(--accent)); box-shadow: 0 0 0 3px var(--focus-ring, transparent); }

    .alld__chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 18px; }
    .alld-chip { border: 1px solid var(--border-2, var(--border)); background: var(--surface-2); color: var(--text-mute);
                 border-radius: var(--r-pill, 999px); padding: 5px 12px; font-family: var(--font-mono); font-size: var(--fs-2xs);
                 text-transform: uppercase; letter-spacing: var(--track-wide); cursor: pointer; white-space: nowrap; }
    .alld-chip:hover { border-color: var(--accent-brd, var(--accent)); color: var(--text); }
    .alld-chip--on { background: var(--accent); color: var(--accent-ink, #fff); border-color: var(--accent); }
    .alld__chips-empty { font-family: var(--font-mono); font-size: var(--fs-2xs); letter-spacing: var(--track-wide); text-transform: uppercase; color: var(--text-mute); padding: 4px 2px; }

    .alld__empty { color: var(--text-mute); font-family: var(--font-sans); font-size: var(--fs-md); padding: 28px 2px; }

    /* ---- home-library Phase 4 — the inspector detail-categories editor (js/95e) ----
       Mounted into the placement inspector's .ins-cats host; removable chips + a
       datalist-backed add control. Sits inside the (dark-ish) inspector panel. */
    .cats-ed { display: flex; flex-direction: column; gap: 6px; width: 100%; }
    .cats-ed__chips { display: flex; flex-wrap: wrap; gap: 4px; }
    .cats-ed__none { font-size: 11px; color: var(--text-mute); }
    .cats-ed__chip { display: inline-flex; align-items: center; gap: 4px; background: var(--surface-3, var(--surface));
                     border: 1px solid var(--border); border-radius: 3px; padding: 1px 4px 1px 7px; font-size: 11px; color: var(--text); }
    .cats-ed__x { border: 0; background: transparent; color: var(--text-mute); cursor: pointer; font-size: 13px; line-height: 1; padding: 0 2px; }
    .cats-ed__x:hover { color: var(--danger, #c0392b); }
    .cats-ed__add { display: flex; gap: 6px; }
    .cats-ed__input { flex: 1; min-width: 0; height: 22px; padding: 0 8px; border: 1px solid var(--border);
                      border-radius: var(--r-1, 3px); background: var(--surface-2); color: var(--text); font: 12px var(--font-sans, system-ui); }
    .cats-ed__btn { padding: 0 10px; border: 1px solid var(--border); background: var(--surface-3); color: var(--text);
                    border-radius: var(--r-1, 3px); cursor: pointer; font: 11px var(--font-sans, system-ui); }
    .cats-ed__btn:hover { background: var(--accent, #c0392b); color: var(--accent-ink, #fff); border-color: transparent; }

    /* ---- home-library Phase 5 — the Projects screen (#projectScreen) ----
       Two views share the container: the projects INDEX (list + Unfiled bucket +
       New Project) and a per-project view (editable header + Details / Sketches /
       Markups columns). Token-driven (5 themes); same fallback ladder as
       .home*/.alld* so the legacy classic/dark/bt themes still read cleanly. */
    .proj { max-width: 1440px; margin: 0 auto; padding: 30px 36px 90px; }
    .proj__head { display: flex; flex-direction: column; gap: 2px; }
    .proj__eyebrow {
      font-family: var(--font-mono); font-size: var(--fs-2xs);
      letter-spacing: var(--track-letter); text-transform: uppercase; font-weight: 500; color: var(--text-mute);
      display: flex; align-items: center; gap: 9px; margin-bottom: 12px;
    }
    .proj__eyebrow .v4-dot { color: var(--accent); font-weight: 600; }
    .proj__titlerow { display: flex; align-items: center; gap: 14px; margin-top: 2px; }
    .proj__title { margin: 0; font-family: var(--font-serif); font-weight: 400; font-size: var(--fs-display); line-height: var(--leading-tight); letter-spacing: var(--track-tight); color: var(--text); }
    .proj__count { font-family: var(--font-mono); font-size: var(--fs-xs); letter-spacing: var(--track-wide); text-transform: uppercase; color: var(--text-mute); }
    .proj__clay { width: 46px; height: 0; border: 0; border-top: 2px solid var(--accent); margin: 16px 0 0; }
    .proj__rule2 { height: 4px; margin: 16px 0 0; border: 0; border-top: 1px solid var(--border-strong, var(--border)); border-bottom: 1px solid var(--border-strong, var(--border)); }
    .proj__spacer { flex: 1 1 auto; }
    .proj__new, .proj__back {
      background: transparent; border: 1px solid var(--border); color: var(--text-mute);
      border-radius: var(--r-1, 4px); padding: 6px 13px; font-size: var(--fs-sm); cursor: pointer;
      font-family: var(--font-sans, system-ui);
    }
    .proj__new:hover, .proj__back:hover { border-color: var(--accent); color: var(--accent); }
    .proj__new { color: var(--text); }
    .proj__import { color: var(--text-mute); }   /* secondary to + New Project */

    /* New Project form */
    .proj-new { margin: 14px 0 4px; }
    .proj-new__form {
      display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px;
      background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-2, 6px); padding: 14px 16px;
    }
    .proj-new__fieldwrap { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
    .proj-new__fieldwrap--grow { flex: 1 1 240px; }
    .proj-new__fieldl { font-size: var(--fs-2xs); letter-spacing: .1em; text-transform: uppercase; color: var(--text-mute); }
    .proj-new__input {
      height: 30px; padding: 0 9px; border: 1px solid var(--border); border-radius: var(--r-1, 4px);
      background: var(--surface); color: var(--text); font: var(--fs-sm) var(--font-sans, system-ui); min-width: 160px;
    }
    .proj-new__fieldwrap--grow .proj-new__input { width: 100%; }
    .proj-new__input:focus { outline: none; border-color: var(--accent); }
    .proj-new__actions { display: flex; gap: 8px; }
    .proj-new__create {
      height: 30px; padding: 0 16px; border: 1px solid var(--accent); border-radius: var(--r-1, 4px);
      background: var(--accent); color: var(--accent-ink, #fff); font: 600 var(--fs-sm) var(--font-sans, system-ui); cursor: pointer;
    }
    .proj-new__create:hover { filter: brightness(1.06); }
    .proj-new__create:disabled { opacity: .55; cursor: default; filter: none; }
    .proj-new__cancel {
      height: 30px; padding: 0 13px; border: 1px solid var(--border); border-radius: var(--r-1, 4px);
      background: transparent; color: var(--text-mute); font: var(--fs-sm) var(--font-sans, system-ui); cursor: pointer;
    }
    .proj-new__cancel:hover { border-color: var(--accent); color: var(--accent); }

    /* The index list of projects + Unfiled */
    .proj-idx { display: flex; flex-direction: column; margin-top: 18px; }
    .proj-idx__row {
      appearance: none; text-align: left; cursor: pointer; width: 100%;
      display: grid; grid-template-columns: 2fr auto auto 20px; gap: 16px; align-items: baseline;
      padding: 13px 10px; border: 0; border-bottom: 1px solid var(--border); background: transparent;
      transition: background var(--t-fast, 120ms) var(--ease-out, ease);
    }
    .proj-idx__row:hover { background: var(--accent-bg, color-mix(in srgb, var(--text) 7%, transparent)); }
    .proj-idx__row--unfiled .proj-idx__name { font-style: italic; color: var(--text-mute); }
    .proj-idx__main { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
    .proj-idx__name { font-family: var(--font-serif); font-size: var(--fs-xl); font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .proj-idx__num { font-family: var(--font-mono, monospace); font-size: var(--fs-xs); color: var(--text-mute); }
    .proj-idx__count { font-family: var(--font-mono, monospace); font-size: var(--fs-xs); color: var(--text-subtle, var(--text-mute)); white-space: nowrap; }
    .proj-idx__go { color: var(--text-faint, var(--text-mute)); font-size: var(--fs-lg); text-align: center; }
    .proj-idx__hint { padding: 13px 10px; font-size: var(--fs-sm); color: var(--text-mute); font-style: italic; }
    /* maintenance footer (reindex) */
    .proj-idx__foot { margin-top: 22px; padding-top: 12px; border-top: 1px solid var(--border); }
    .proj-idx__maint {
      appearance: none; background: none; border: 0; cursor: pointer;
      color: var(--text-mute); font-family: var(--font-sans, system-ui); font-size: var(--fs-xs);
      padding: 4px 2px; border-radius: var(--r-1, 4px);
    }
    .proj-idx__maint:hover { color: var(--accent); text-decoration: underline; }

    /* Per-project header */
    .proj-hdr { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
    .proj-hdr__name, .proj-hdr__num {
      height: 34px; padding: 0 10px; border: 1px solid transparent; border-radius: var(--r-1, 4px);
      background: transparent; color: var(--text); font-family: var(--font-sans, system-ui);
    }
    .proj-hdr__name { font-family: var(--font-serif); font-size: var(--fs-3xl); font-weight: 400; letter-spacing: var(--track-tight); min-width: 220px; }
    .proj-hdr__num { font-size: var(--fs-md); font-family: var(--font-mono, monospace); color: var(--text-mute); min-width: 130px; }
    .proj-hdr__name:hover, .proj-hdr__num:hover { border-color: var(--border); }
    .proj-hdr__name:focus, .proj-hdr__num:focus { outline: none; border-color: var(--accent); background: var(--surface-2); }
    .proj-hdr__hint { font-size: var(--fs-sm); color: var(--text-mute); }
    .proj-hdr__del {
      margin-left: 6px; background: transparent; border: 1px solid var(--border); color: var(--text-mute);
      border-radius: var(--r-1, 4px); padding: 6px 12px; font-size: var(--fs-sm); cursor: pointer;
    }
    .proj-hdr__del:hover { border-color: var(--danger, #c0392b); color: var(--danger, #c0392b); }

    /* The three columns */
    .proj-cols {
      display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1.3fr) minmax(0, 1fr);
      gap: 24px; align-items: start; margin-top: 22px;
    }
    .proj-cols--unfiled { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); }
    @media (max-width: 980px) { .proj-cols, .proj-cols--unfiled { grid-template-columns: 1fr; } }
    .proj-col { min-width: 0; }
    .proj-col__head {
      display: flex; align-items: center; gap: 10px; margin-bottom: 12px;
      padding-bottom: 6px; border-bottom: 1px solid var(--border);
    }
    .proj-col__title { font-family: var(--font-mono); font-size: var(--fs-xs); font-weight: 600; text-transform: uppercase; letter-spacing: var(--track-caps); color: var(--text); }
    .proj-col__action { margin-left: auto; display: flex; align-items: center; gap: 6px; }
    .proj-col__act {
      background: transparent; border: 1px solid var(--border); color: var(--text); cursor: pointer;
      border-radius: var(--r-1, 4px); padding: 4px 10px; font-size: var(--fs-xs); font-family: var(--font-sans, system-ui); white-space: nowrap;
    }
    .proj-col__act:hover { border-color: var(--accent); color: var(--accent); }
    .proj-col__body { display: flex; flex-direction: column; gap: 10px; }
    .proj-col__empty { color: var(--text-mute); font-size: var(--fs-sm); padding: 8px 2px; line-height: 1.5; }

    /* Details grid (a tight 2-up scroll) */
    .proj-det { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .proj-det__card {
      appearance: none; text-align: left; cursor: pointer; padding: 0;
      display: flex; flex-direction: column;
      background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-2, 6px); overflow: hidden; color: var(--text);
      transition: border-color var(--t-fast, 120ms), box-shadow var(--t-fast, 120ms);
    }
    .proj-det__card:hover { border-color: var(--accent-brd, var(--accent)); box-shadow: var(--shadow-md, 0 6px 18px -8px rgba(0,0,0,.18)); }
    .proj-det__fig { aspect-ratio: 1.414 / 1; background: var(--paper, var(--surface-2)); display: grid; place-items: center; overflow: hidden; }
    .proj-det__fig--empty { background: var(--surface-3, var(--surface)); }
    .proj-det__img { width: 100%; height: 100%; object-fit: contain; display: block; }
    .proj-det__ph { font-size: var(--fs-2xs); color: var(--text-faint, var(--text-mute)); letter-spacing: .04em; }
    .proj-det__cap { padding: 6px 8px 4px; font-family: var(--font-serif); font-size: var(--fs-sm); font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .proj-det__tags { display: flex; flex-wrap: wrap; gap: 3px; padding: 0 8px 8px; }
    .proj-det__tag { font-size: var(--fs-2xs); color: var(--text-subtle, var(--text-mute)); background: var(--surface-3, var(--surface)); border-radius: 3px; padding: 1px 5px; white-space: nowrap; }

    /* Sketches list (draggable rows) */
    .proj-sk { display: flex; flex-direction: column; gap: 8px; }
    .proj-sk__row {
      display: flex; align-items: center; gap: 8px; padding: 7px 8px;
      background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-2, 6px);
      transition: border-color var(--t-fast, 120ms), box-shadow var(--t-fast, 120ms), opacity var(--t-fast, 120ms);
    }
    .proj-sk__row:hover { border-color: var(--accent-brd, var(--accent)); }
    .proj-sk__row--drag { opacity: .45; }
    .proj-sk__row--over { border-color: var(--accent); box-shadow: 0 -2px 0 0 var(--accent) inset; }
    .proj-sk__grip { cursor: grab; color: var(--text-faint, var(--text-mute)); font-size: 14px; line-height: 1; user-select: none; }
    .proj-sk__open {
      appearance: none; cursor: pointer; flex: 1 1 auto; min-width: 0;
      display: flex; align-items: center; gap: 9px; background: transparent; border: 0; padding: 0; text-align: left; color: var(--text);
    }
    .proj-sk__fig {
      flex: 0 0 auto; width: 46px; height: 33px; border: 1px solid var(--border); border-radius: var(--r-1, 4px);
      background: var(--paper, var(--surface-2)); overflow: hidden; display: grid; place-items: center;
    }
    .proj-sk__fig--empty { background: var(--surface-3, var(--surface)); }
    .proj-sk__img { width: 100%; height: 100%; object-fit: contain; display: block; }
    .proj-sk__info { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
    .proj-sk__num { font-family: var(--font-mono, monospace); font-size: var(--fs-2xs); color: var(--text-mute); }
    .proj-sk__title { font-size: var(--fs-sm); font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .proj-sk__acts { display: flex; align-items: center; gap: 4px; flex: 0 0 auto; }
    .proj-sk__act {
      background: transparent; border: 1px solid transparent; color: var(--text-mute); cursor: pointer;
      border-radius: var(--r-1, 4px); padding: 3px 7px; font-size: var(--fs-2xs); font-family: var(--font-sans, system-ui);
    }
    .proj-sk__act:hover { border-color: var(--border); color: var(--text); }
    .proj-sk__act--del:hover { border-color: var(--danger, #c0392b); color: var(--danger, #c0392b); }
    .proj-sk__move {
      height: 24px; border: 1px solid transparent; border-radius: var(--r-1, 4px);
      background: transparent; color: var(--text-mute); font-size: var(--fs-2xs); font-family: var(--font-sans, system-ui); cursor: pointer; max-width: 90px;
    }
    .proj-sk__move:hover { border-color: var(--border); color: var(--text); }
    .proj-sk__move:focus { outline: none; border-color: var(--accent); }

    /* Markups column */
    .proj-mk__grp {
      height: 26px; border: 1px solid var(--border); border-radius: var(--r-1, 4px);
      background: var(--surface-2); color: var(--text); font-size: var(--fs-2xs); font-family: var(--font-sans, system-ui);
    }
    .proj-mk__group { display: flex; flex-direction: column; gap: 6px; }
    .proj-mk__grouptitle { font-size: var(--fs-2xs); letter-spacing: .08em; text-transform: uppercase; color: var(--text-mute); margin-top: 4px; }
    /* markups-become-pages (Phase 6) — the markup row is now a click-to-open button
       (blank-reset so the flex layout + token colours apply), double-click renames. */
    .proj-mk__row {
      display: flex; align-items: center; gap: 9px; padding: 6px 8px;
      width: 100%; text-align: left; font-family: inherit; cursor: pointer;
      background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-2, 6px);
    }
    .proj-mk__row:hover { border-color: var(--accent); }
    .proj-mk__fig {
      flex: 0 0 auto; width: 34px; height: 44px; border: 1px solid var(--border); border-radius: var(--r-1, 3px);
      background: var(--paper, var(--surface-2)); overflow: hidden; display: grid; place-items: center;
    }
    .proj-mk__fig--empty { background: var(--surface-3, var(--surface)); }
    .proj-mk__img { width: 100%; height: 100%; object-fit: cover; display: block; }
    .proj-mk__ph { font-size: var(--fs-2xs); color: var(--text-faint, var(--text-mute)); letter-spacing: .04em; }
    .proj-mk__meta { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
    .proj-mk__name { min-width: 0; font-size: var(--fs-xs); color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .proj-mk__sub { min-width: 0; font-size: var(--fs-2xs); color: var(--text-mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .proj-mk__x { flex: 0 0 auto; border: 0; background: transparent; color: var(--text-mute); cursor: pointer; font-size: 15px; line-height: 1; padding: 0 4px; }
    .proj-mk__x:hover { color: var(--danger, #c0392b); }
    /* faded "coming soon" action (Import Photos) */
    .proj-col__act--soon { opacity: .45; cursor: not-allowed; }
    .proj-col__act--soon:hover { border-color: var(--border); color: inherit; }

    /* =====================================================================
       home-library Phase 4 redesign — the ALL DETAILS CONTACT SHEET
       (#allDetailsScreen + the per-project Details column). A WHITE detail
       page on the creme app surround, a dense grid of ~square cells, captioned
       Detail-N · source · date · drawn-by, with a per-card Properties popover.
       The same .csheet grid is mounted globally (js/95c) AND scoped to one
       project (js/95d → LibContactSheet.buildGrid). Token-driven across all 5
       themes; the contact-page tokens carry legacy fallbacks so classic / dark /
       bt / hicon read cleanly. Appended after the DATUM layer so it wins.
       ===================================================================== */

    /* contact-sheet tokens — the WHITE page + the creme surround. --paper-0 is
       the brightest sheet white in warm-light/dark; --surface is the creme app
       bg. Fallbacks keep the page lighter than the surround on every theme. */
    #homeScreen, #allDetailsScreen, #projectScreen {   /* homeScreen added 2026-07-05: the Home wall renders gallery cards too */
      --csheet-page:    var(--paper-0, var(--paper, #ffffff));
      --csheet-surround:var(--surface);
      --csheet-cell:    var(--paper, var(--surface-2));
      --csheet-ink:     var(--paper-ink, var(--text));
      --csheet-ink-mute:var(--paper-ink-mute, var(--text-mute));
      --csheet-line:    var(--border, rgba(0,0,0,.12));
    }

    /* the white page host on the All-Details screen (mounted by js/95c) */
    .alld__sheet {
      margin-top: 12px;
      background: var(--csheet-page);
      border: 1px solid var(--csheet-line);
      border-radius: var(--r-3, 8px);
      box-shadow: var(--shadow-md, 0 8px 28px -14px rgba(0,0,0,.28));
      padding: 22px 22px 30px;
      min-height: 280px;
    }

    /* the dense square grid — auto-fill so cells stay ~square and wrap downward;
       ~20 across on a wide page via a small min cell. Project column = narrower,
       so its CSS-grid simply fits fewer per row. */
    .csheet { width: 100%; }
    .csheet__grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(116px, 1fr));
      gap: 12px;
      align-content: start;
    }
    /* per-project Details column — tighter cells (the column is narrow) */
    .proj-col--details .csheet__grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }

    .csheet-card {
      position: relative; display: flex; flex-direction: column; text-align: left;
      background: var(--csheet-cell); color: var(--csheet-ink);
      border: 1px solid var(--csheet-line); border-radius: var(--r-2, 6px);
      overflow: hidden; cursor: pointer; padding: 0;
      transition: border-color var(--t-base, 160ms) var(--ease-out, ease),
                  box-shadow var(--t-base, 160ms) var(--ease-out, ease),
                  transform var(--t-base, 160ms);
    }
    .csheet-card:hover { border-color: var(--accent-brd, var(--accent)); box-shadow: var(--shadow-pop); transform: translateY(-2px); }
    .csheet-card:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus-ring, color-mix(in srgb, var(--accent) 40%, transparent)); }
    .csheet-card--flash { animation: csheetFlash 2.2s var(--ease-out, ease-out) 1; }
    @keyframes csheetFlash { 0% { box-shadow: 0 0 0 3px var(--accent); } 100% { box-shadow: 0 0 0 0 transparent; } }

    /* the ~square preview */
    .csheet-card__fig {
      aspect-ratio: 1 / 1; background: var(--csheet-page);
      display: grid; place-items: center; overflow: hidden;
      border-bottom: 1px solid var(--csheet-line);
    }
    .csheet-card__fig--empty { background: var(--surface-3, var(--surface)); }
    .csheet-card__img { width: 100%; height: 100%; object-fit: contain; display: block; }
    .csheet-card__ph { font-family: var(--font-mono); font-size: 8px; letter-spacing: var(--track-wide); text-transform: uppercase; color: var(--text-faint, var(--text-mute)); }

    .csheet-card__body { padding: 6px 7px 7px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
    .csheet-card__title {
      font-family: var(--font-serif); font-size: var(--fs-sm, 12px); font-weight: 500; color: var(--csheet-ink);
      line-height: 1.18; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    }
    .csheet-card__meta {
      font-family: var(--font-mono); font-size: 9px; letter-spacing: var(--track-wide); color: var(--csheet-ink-mute);
      white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    }
    .csheet-card__tags { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 3px; }
    .csheet-card__tag {
      font-family: var(--font-mono); font-size: 8px; letter-spacing: var(--track-wide); text-transform: uppercase;
      color: var(--csheet-ink-mute); background: var(--surface-3, var(--surface));
      border: 1px solid var(--csheet-line); border-radius: var(--r-1, 3px); padding: 0 4px; white-space: nowrap;
    }
    .csheet-card__tag--none { font-style: italic; opacity: .8; }
    .csheet-card__tag--more { background: transparent; border-style: dashed; }

    .csheet-card__props {
      margin-top: 5px; align-self: flex-start; border: 1px solid var(--csheet-line);
      background: transparent; color: var(--csheet-ink-mute); cursor: pointer;
      font-family: var(--font-mono); font-size: 8px; letter-spacing: var(--track-wide); text-transform: uppercase;
      border-radius: var(--r-1, 3px); padding: 2px 6px;
    }
    .csheet-card__props:hover { border-color: var(--accent-brd, var(--accent)); color: var(--text); }

    /* ---- the Properties popover (category editor; writes via setDetailCategories) */
    .csheet-pop {
      position: fixed; z-index: 220; width: 248px; max-height: 70vh; overflow: auto;
      background: var(--paper-0, var(--surface-2)); color: var(--text);
      border: 1px solid var(--border-strong, var(--border)); border-radius: var(--r-3, 8px);
      box-shadow: var(--shadow-overlay, 0 18px 48px -12px rgba(0,0,0,.28)); padding: 10px 11px 11px;
    }
    .csheet-pop__t { font-family: var(--font-serif); font-size: var(--fs-md, 14px); font-weight: 500; color: var(--text); margin-bottom: 8px; }
    .csheet-pop__lbl { font-family: var(--font-mono); font-size: var(--fs-2xs, 9px); letter-spacing: var(--track-caps); text-transform: uppercase; color: var(--text-mute); margin: 9px 0 5px; }
    .csheet-pop__chips { display: flex; flex-wrap: wrap; gap: 4px; }
    .csheet-pop__none { font-size: 11px; color: var(--text-mute); font-style: italic; }
    .csheet-pop__chip {
      display: inline-flex; align-items: center; gap: 3px; background: var(--accent);
      color: var(--accent-ink, #fff); border-radius: var(--r-pill, 999px); padding: 2px 4px 2px 9px; font-size: 11px;
    }
    .csheet-pop__x { border: 0; background: transparent; color: var(--accent-ink, #fff); cursor: pointer; font-size: 13px; line-height: 1; padding: 0 2px; opacity: .85; }
    .csheet-pop__x:hover { opacity: 1; }
    .csheet-pop__sug { display: flex; flex-wrap: wrap; gap: 4px; }
    .csheet-pop__sugbtn {
      border: 1px solid var(--border-2, var(--border)); background: var(--surface-2); color: var(--text-mute);
      border-radius: var(--r-pill, 999px); padding: 3px 9px; font-family: var(--font-mono); font-size: 10px;
      text-transform: uppercase; letter-spacing: var(--track-wide); cursor: pointer; white-space: nowrap;
    }
    .csheet-pop__sugbtn:hover { border-color: var(--accent-brd, var(--accent)); color: var(--text); }
    .csheet-pop__sugbtn--on { background: var(--accent); color: var(--accent-ink, #fff); border-color: var(--accent); }
    .csheet-pop__add { display: flex; gap: 6px; margin-top: 9px; }
    .csheet-pop__input {
      flex: 1; min-width: 0; height: 26px; padding: 0 8px; border: 1px solid var(--border);
      border-radius: var(--r-1, 4px); background: var(--surface-2); color: var(--text); font: 12px var(--font-sans, system-ui);
    }
    .csheet-pop__input:focus { outline: none; border-color: var(--accent); }
    .csheet-pop__addbtn {
      padding: 0 11px; border: 1px solid var(--border); background: var(--surface-3); color: var(--text);
      border-radius: var(--r-1, 4px); cursor: pointer; font: 11px var(--font-sans, system-ui);
    }
    .csheet-pop__addbtn:hover { background: var(--accent); color: var(--accent-ink, #fff); border-color: transparent; }
    .csheet-pop__open { margin-top: 11px; border-top: 1px solid var(--border); padding-top: 9px; }
    .csheet-pop__open-btn {
      border: 0; background: transparent; color: var(--accent); cursor: pointer;
      font-family: var(--font-mono); font-size: 11px; letter-spacing: var(--track-wide); text-transform: uppercase; padding: 0;
    }
    .csheet-pop__open-btn:hover { text-decoration: underline; }
    /* ---- Copy-into-project picker (Phase 7) — inline collapsible inside the popover */
    .csheet-pop__copy { margin-top: 11px; border-top: 1px solid var(--border); padding-top: 9px; }
    .csheet-pop__copybtn {
      border: 0; background: transparent; color: var(--accent); cursor: pointer;
      font-family: var(--font-mono); font-size: 11px; letter-spacing: var(--track-wide); text-transform: uppercase; padding: 0;
    }
    .csheet-pop__copybtn:hover { text-decoration: underline; }
    .csheet-pop__copyform { display: none; flex-direction: column; gap: 4px; margin-top: 8px; }
    .csheet-pop__copy--open .csheet-pop__copyform { display: flex; }
    .csheet-pop__copylbl { font-family: var(--font-mono); font-size: var(--fs-2xs, 9px); letter-spacing: var(--track-caps); text-transform: uppercase; color: var(--text-mute); }
    .csheet-pop__copysel {
      height: 26px; padding: 0 8px; border: 1px solid var(--border); border-radius: var(--r-1, 4px);
      background: var(--surface-2); color: var(--text); font: 12px var(--font-sans, system-ui);
    }
    .csheet-pop__copysel:focus { outline: none; border-color: var(--accent); }
    .csheet-pop__copysel:disabled { opacity: .5; cursor: not-allowed; }
    .csheet-pop__copygo {
      align-self: flex-start; margin-top: 4px; padding: 0 11px; height: 26px;
      border: 1px solid var(--border); background: var(--surface-3); color: var(--text);
      border-radius: var(--r-1, 4px); cursor: pointer; font: 11px var(--font-sans, system-ui);
    }
    .csheet-pop__copygo:hover { background: var(--accent); color: var(--accent-ink, #fff); border-color: transparent; }
    .csheet-pop__copygo:disabled { opacity: .5; cursor: not-allowed; background: var(--surface-3); color: var(--text); border-color: var(--border); }

    /* =====================================================================
       detail-cards-redesign (2026-07-05) — the GALLERY card style.
       FFF-inspired stacked-paper cards over the same .csheet page: slight
       rotation, offset sheet edges behind, hairline border-inside-a-border,
       outlined Anton display number + name, mono caption with leading dash.
       Hover straightens the card + fans the stack + fills the outline solid.
       Click → the FLIP expand overlay (.fcs-ov) — the same paper travels.
       Token-driven across all 5 themes (reads the --csheet-* tokens above);
       the classic card CSS above is untouched (the view toggle swaps DOM).
       Mockup + spec: PlannedBuilds/detail-cards-redesign/.
       ===================================================================== */
    .csheet--gallery, .hm-wall__grid--gallery, .hm-pcard__minigal {
      /* local knobs: --fcs-size is set inline from localStorage (150–300px);
         --fcs-scale lets narrow hosts (per-project column, Home wall, project
         mini-gallery) shrink uniformly. */
      --fcs-min:       calc(var(--fcs-size, 200px) * var(--fcs-scale, 1));
      --fcs-line:      color-mix(in srgb, var(--csheet-ink) 78%, transparent);
      --fcs-line-soft: color-mix(in srgb, var(--csheet-ink) 32%, transparent);
      --fcs-display:   'Anton', 'Arial Narrow', sans-serif;
      --fcs-dur:       .34s;
      --fcs-ease:      cubic-bezier(.22, .9, .3, 1);
    }
    .proj-col--details .csheet--gallery { --fcs-scale: .62; }

    /* the small discrete view bar above the cards (both styles) */
    .csheet__viewbar {
      display: flex; justify-content: flex-end; align-items: center; gap: 10px;
      margin: 0 0 14px; min-height: 18px;
    }
    .csheet__viewtog {
      border: 1px solid var(--csheet-line); background: transparent; cursor: pointer;
      color: var(--csheet-ink-mute); font-family: var(--font-mono); font-size: 9px;
      letter-spacing: var(--track-caps, .12em); text-transform: uppercase;
      border-radius: var(--r-pill, 999px); padding: 3px 10px;
      transition: color var(--fcs-dur, .2s) var(--fcs-ease, ease), border-color var(--fcs-dur, .2s) var(--fcs-ease, ease);
    }
    .csheet__viewtog:hover { color: var(--csheet-ink); border-color: var(--fcs-line, var(--csheet-ink)); }
    .csheet__szlbl {
      font-family: var(--font-mono); font-size: 9px; letter-spacing: var(--track-caps, .12em);
      text-transform: uppercase; color: var(--csheet-ink-mute);
    }
    .csheet__size { width: 96px; accent-color: var(--accent); cursor: pointer; }

    /* the gallery grid — auto-fill on the one size knob; top padding gives the
       hanging outlined numbers + pills room; overflow stays visible. */
    .csheet__grid--gallery {
      grid-template-columns: repeat(auto-fill, minmax(var(--fcs-min, 200px), 1fr));
      gap: calc(var(--fcs-min, 200px) * .30) calc(var(--fcs-min, 200px) * .22);
      padding: calc(var(--fcs-min, 200px) * .12) 8px 8px;
      align-content: start;
    }

    /* ---- the card: a rotated stack of papers -------------------------------- */
    .fcs-card { position: relative; cursor: pointer; outline: none; -webkit-tap-highlight-color: transparent; }
    .fcs-card__tilt {
      position: relative;
      transform: rotate(var(--rot, 0deg));
      transition: transform var(--fcs-dur) var(--fcs-ease);
    }
    .fcs-card:hover .fcs-card__tilt,
    .fcs-card:focus-visible .fcs-card__tilt { transform: rotate(0deg) translateY(-5px); }
    .fcs-card:focus-visible .fcs-card__paper { box-shadow: 0 0 0 3px var(--focus-ring, color-mix(in srgb, var(--accent) 40%, transparent)); }

    .fcs-sheet {
      position: absolute; inset: 0;
      background: var(--csheet-page);
      border: 1px solid var(--fcs-line);
      transition: transform var(--fcs-dur) var(--fcs-ease);
    }
    .fcs-sheet--1 { transform: translate(4px, 5px) rotate(.5deg); }
    .fcs-sheet--2 { transform: translate(8px, 10px) rotate(1.1deg); }
    .fcs-card:hover .fcs-sheet--1, .fcs-card:focus-visible .fcs-sheet--1 { transform: translate(7px, 8px) rotate(1.6deg); }
    .fcs-card:hover .fcs-sheet--2, .fcs-card:focus-visible .fcs-sheet--2 { transform: translate(13px, 15px) rotate(3deg); }

    .fcs-card__paper {
      position: relative; overflow: hidden;
      background: var(--csheet-page);
      border: 1px solid var(--fcs-line);
      aspect-ratio: 4 / 5;
      transition: box-shadow var(--fcs-dur) var(--fcs-ease);
    }
    .fcs-card__paper::after {           /* the hairline border inside the border */
      content: ''; position: absolute; inset: 5.5%;
      border: 1px solid var(--fcs-line-soft);
      pointer-events: none;
      transition: border-color var(--fcs-dur) var(--fcs-ease);
    }
    .fcs-card:hover .fcs-card__paper::after { border-color: var(--fcs-line); }

    /* the drawing sits in the upper zone; the print caption owns the bottom band */
    .fcs-card__img { position: absolute; inset: 8% 11% 24%; width: 78%; height: 68%; object-fit: contain; display: block; }
    .fcs-ov__paper .fcs-card__img { inset: 11%; width: 78%; height: 78%; }   /* overlay: full frame (no on-paper caption there) */
    .fcs-card .fcs-card__ph, .fcs-ov .fcs-card__ph {
      position: absolute; inset: 0; display: grid; place-items: center;
      font-family: var(--font-mono); font-size: 8px; letter-spacing: var(--track-wide, .08em);
      text-transform: uppercase; color: var(--csheet-ink-mute);
    }

    /* the print caption ON the paper: project name + sketch number, outlined
       display type, centred along the bottom (fills solid on hover). */
    .fcs-card__foot {
      position: absolute; left: 4%; right: 4%; bottom: 6.5%;
      text-align: center; pointer-events: none;
      transition: transform var(--fcs-dur) var(--fcs-ease);
    }
    .fcs-card:hover .fcs-card__foot,
    .fcs-card:focus-visible .fcs-card__foot { transform: translateY(-2px) scale(1.02); }
    .fcs-card__proj {
      font-family: var(--fcs-display); font-weight: 400;
      font-size: clamp(11px, calc(var(--fcs-min, 200px) * .105), 28px);
      line-height: .98; text-transform: uppercase; letter-spacing: .03em;
      color: transparent;
      -webkit-text-stroke: 1px var(--csheet-ink);
      white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
      transition: color var(--fcs-dur) var(--fcs-ease);
    }
    .fcs-card__src {
      margin-top: .3em;
      font-family: var(--fcs-display); font-weight: 400;
      font-size: clamp(8px, calc(var(--fcs-min, 200px) * .062), 17px);
      line-height: 1; text-transform: uppercase; letter-spacing: .06em;
      color: transparent;
      -webkit-text-stroke: .8px var(--csheet-ink);
      white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
      transition: color var(--fcs-dur) var(--fcs-ease);
    }
    .fcs-card:hover .fcs-card__proj, .fcs-card:focus-visible .fcs-card__proj,
    .fcs-card:hover .fcs-card__src,  .fcs-card:focus-visible .fcs-card__src { color: var(--csheet-ink); }

    /* the outlined index number hanging off the top-left corner */
    .fcs-card__num {
      position: absolute; top: -.62em; left: -.3em; z-index: 3;
      font-family: var(--fcs-display); font-weight: 400;
      font-size: clamp(15px, calc(var(--fcs-min, 200px) * .16), 38px);
      letter-spacing: .04em;
      color: transparent;
      -webkit-text-stroke: 1px var(--csheet-ink);
      pointer-events: none;
      transition: color var(--fcs-dur) var(--fcs-ease), -webkit-text-stroke-color var(--fcs-dur) var(--fcs-ease);
    }
    .fcs-card:hover .fcs-card__num { color: var(--accent); -webkit-text-stroke-color: var(--accent); }

    /* outline unsupported (old engines): show the type faint instead of invisible */
    @supports not (-webkit-text-stroke: 1px black) {
      .fcs-card__proj, .fcs-card__src, .fcs-card__num, .fcs-ov__num { color: var(--csheet-ink); opacity: .18; }
    }

    /* status pill straddling the top-right corner */
    .fcs-pill {
      position: absolute; top: -9px; right: -7px; z-index: 3;
      font-family: var(--font-mono); font-size: 8px; letter-spacing: var(--track-caps, .12em);
      text-transform: uppercase; border-radius: var(--r-pill, 999px);
      padding: 3px 8px; transform: rotate(3deg); pointer-events: none;
    }
    .fcs-pill--new { background: var(--accent); color: var(--accent-ink, #fff); }
    .fcs-pill--edit { background: var(--paper-3, var(--surface-3)); color: var(--csheet-ink); border: 1px solid var(--fcs-line-soft); }

    /* mono caption with the leading dash */
    .fcs-card__caption {
      margin-top: calc(12px + var(--fcs-min, 200px) * .02);
      padding-left: 4%;
      font-family: var(--font-mono);
      font-size: clamp(8px, calc(var(--fcs-min, 200px) * .048), 11px);
      letter-spacing: var(--track-caps, .12em); text-transform: uppercase;
      color: var(--csheet-ink-mute);
      display: flex; align-items: center; gap: 7px;
      white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
      transition: color var(--fcs-dur) var(--fcs-ease);
    }
    .fcs-card__caption::before {
      content: ''; width: 14px; height: 1px; background: var(--csheet-ink-mute); flex: none;
      transition: width var(--fcs-dur) var(--fcs-ease), background var(--fcs-dur) var(--fcs-ease);
    }
    .fcs-card:hover .fcs-card__caption { color: var(--csheet-ink); }
    .fcs-card:hover .fcs-card__caption::before { width: 24px; background: var(--csheet-ink); }

    /* Home deep-link flash (shares the classic keyframe) */
    .fcs-card--flash .fcs-card__paper { animation: csheetFlash 2.2s var(--ease-out, ease-out) 1; }

    /* ---- the expand overlay (FLIP) ------------------------------------------ */
    .fcs-ov {
      position: fixed; inset: 0; z-index: 200;   /* below .csheet-pop (220) so Properties stacks above */
      display: grid; place-items: center;
      padding: 5vh 5vw;
      --fcs-line:      color-mix(in srgb, var(--csheet-ink) 78%, transparent);
      --fcs-line-soft: color-mix(in srgb, var(--csheet-ink) 32%, transparent);
      --fcs-display:   'Anton', 'Arial Narrow', sans-serif;
      --fcs-dur:       .34s;
      --fcs-ease:      cubic-bezier(.22, .9, .3, 1);
    }
    .fcs-ov__backdrop {
      position: absolute; inset: 0;
      background: var(--csheet-surround, var(--surface));
      opacity: 0;
      transition: opacity .38s var(--fcs-ease);
    }
    .fcs-ov--on .fcs-ov__backdrop { opacity: .97; }
    .fcs-ov__close {
      position: absolute; top: 22px; right: 30px; z-index: 2;
      border: 0; background: transparent; cursor: pointer;
      font-family: var(--font-mono); font-size: 10px; letter-spacing: var(--track-caps, .12em);
      text-transform: uppercase; color: var(--csheet-ink-mute); padding: 10px;
      transition: color .2s var(--fcs-ease);
    }
    .fcs-ov__close:hover { color: var(--csheet-ink); }

    .fcs-ov__wrap {
      position: relative; z-index: 1;
      display: grid; grid-template-columns: minmax(230px, 40%) 1fr;
      gap: clamp(28px, 5vw, 80px);
      width: min(980px, 100%);
      align-items: center;
    }
    @media (max-width: 760px) { .fcs-ov__wrap { grid-template-columns: 1fr; gap: 30px; } }

    .fcs-ov__left { position: relative; }
    .fcs-ov__left .fcs-sheet { opacity: 0; transition: opacity .3s ease; }
    .fcs-ov__left .fcs-sheet--1 { transform: translate(6px, 7px) rotate(.8deg); }
    .fcs-ov__left .fcs-sheet--2 { transform: translate(12px, 14px) rotate(1.8deg); }
    .fcs-ov--on .fcs-ov__left .fcs-sheet { opacity: 1; transition-delay: .35s; }

    .fcs-ov__paper {
      position: relative; overflow: hidden;
      background: var(--csheet-page);
      border: 1px solid var(--fcs-line);
      aspect-ratio: 4 / 5;
      transform-origin: top left;
      will-change: transform;
    }
    .fcs-ov__paper--anim { transition: transform .5s var(--fcs-ease); }
    .fcs-ov__paper::after {
      content: ''; position: absolute; inset: 5.5%;
      border: 1px solid var(--fcs-line-soft); pointer-events: none;
    }

    .fcs-ov__info { position: relative; min-width: 0; }
    .fcs-ov__info > * { opacity: 0; transform: translateY(14px); }
    .fcs-ov--on .fcs-ov__info > * { animation: fcsRise .5s var(--fcs-ease) forwards; }
    .fcs-ov--on .fcs-ov__info > *:nth-child(1) { animation-delay: .16s; }
    .fcs-ov--on .fcs-ov__info > *:nth-child(2) { animation-delay: .22s; }
    .fcs-ov--on .fcs-ov__info > *:nth-child(3) { animation-delay: .28s; }
    .fcs-ov--on .fcs-ov__info > *:nth-child(4) { animation-delay: .34s; }
    .fcs-ov--on .fcs-ov__info > *:nth-child(5) { animation-delay: .40s; }
    @keyframes fcsRise { to { opacity: 1; transform: none; } }

    .fcs-ov__num {
      font-family: var(--fcs-display); font-size: clamp(30px, 4vw, 42px);
      color: transparent; -webkit-text-stroke: 1.3px var(--csheet-ink);
      letter-spacing: .04em; line-height: 1;
    }
    .fcs-ov__name {
      font-family: var(--fcs-display); text-transform: uppercase;
      font-size: clamp(28px, 4.4vw, 52px); line-height: .96; letter-spacing: .015em;
      color: var(--csheet-ink); margin: 6px 0 14px;
      overflow-wrap: break-word;
    }
    .fcs-ov__meta {
      font-family: var(--font-mono); font-size: 10px; letter-spacing: var(--track-caps, .12em);
      text-transform: uppercase; color: var(--csheet-ink);
      border-top: 1px solid var(--fcs-line); border-bottom: 1px solid var(--fcs-line);
      padding: 9px 0; margin-bottom: 16px;
    }
    .fcs-ov__chips { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 24px; }
    .fcs-ov__chip {
      font-family: var(--font-mono); font-size: 8.5px; letter-spacing: var(--track-caps, .12em);
      text-transform: uppercase; color: var(--csheet-ink);
      border: 1px solid var(--fcs-line); border-radius: var(--r-pill, 999px); padding: 4px 11px;
    }
    .fcs-ov__chip--none { font-style: italic; color: var(--csheet-ink-mute); border-style: dashed; }
    .fcs-ov__acts { display: flex; align-items: center; gap: 14px; }
    .fcs-ov__open {
      font-family: var(--font-mono); font-size: 11px; letter-spacing: var(--track-caps, .12em);
      text-transform: uppercase; cursor: pointer;
      background: var(--csheet-ink); color: var(--csheet-page);
      border: 1px solid var(--csheet-ink); padding: 12px 22px;
      transition: background var(--fcs-dur) var(--fcs-ease), border-color var(--fcs-dur) var(--fcs-ease),
                  color var(--fcs-dur) var(--fcs-ease), transform .18s var(--fcs-ease);
    }
    .fcs-ov__open:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink, #fff); transform: translateY(-2px); }
    .fcs-ov__props {
      font-family: var(--font-mono); font-size: 9px; letter-spacing: var(--track-caps, .12em);
      text-transform: uppercase; cursor: pointer;
      background: transparent; color: var(--csheet-ink-mute);
      border: 1px solid var(--fcs-line-soft); border-radius: var(--r-pill, 999px); padding: 6px 13px;
      transition: color var(--fcs-dur) var(--fcs-ease), border-color var(--fcs-dur) var(--fcs-ease);
    }
    .fcs-ov__props:hover { color: var(--csheet-ink); border-color: var(--fcs-line); }

    /* the Home all-details wall in gallery mode (js/95b follows the same
       persisted style flag; no toggle/slider on Home — it follows the full
       page's choice; fixed ×.6 scale keeps the wall dense). Appended after
       the .hm-wall__grid media queries so auto-fill wins at every width. */
    .hm-wall__grid--gallery {
      --fcs-scale: .6;
      grid-template-columns: repeat(auto-fill, minmax(var(--fcs-min, 120px), 1fr));
      gap: calc(var(--fcs-min, 120px) * .30) calc(var(--fcs-min, 120px) * .22);
      padding: calc(var(--fcs-min, 120px) * .14) 6px 6px;
    }

    /* =====================================================================
       home-fff-redesign (2026-07-05) — the LANDING PAGE design pass.
       Same DOM, same handlers (js/95b untouched by this block) — an appended
       presentation layer in the FFF editorial language established by the
       gallery cards: Anton caps display headings with outlined counter
       numbers, one consistent mono-caps button grammar (ink-filled primary /
       hairline secondary / underlined tertiary), paper-white cards with ink
       hairlines on the creme surround, and a wider page container so the
       Projects columns breathe. Token-driven across all 5 themes.
       ===================================================================== */
    #homeScreen {
      --hm-line:        color-mix(in srgb, var(--text) 30%, transparent);
      --hm-line-strong: color-mix(in srgb, var(--text) 72%, transparent);
      --hm-display:     'Anton', 'Arial Narrow', sans-serif;
      --hm-dur:  .28s;
      --hm-ease: cubic-bezier(.22, .9, .3, 1);
    }

    /* ---- container: FLUID — the page uses the monitor it's given (capped only
       at 1920 so ultrawides don't stretch line lengths absurdly) ---- */
    .hm-stack { max-width: min(1920px, 100%); padding: 26px clamp(28px, 3.5vw, 72px) 110px; gap: 46px; counter-reset: hmsec; }
    @media (max-width: 1100px) { .hm-stack { padding: 22px 26px 90px; } }

    /* ---- hero strip ---- */
    .hm-strip { padding-bottom: 24px; border-bottom: 1px solid var(--hm-line-strong); }
    .hm-strip__h1 { font-size: clamp(26px, 2.8vw, 38px); letter-spacing: -.015em; }
    .hm-strip__eyebrow { letter-spacing: var(--track-letter, .26em); }

    /* ---- one button grammar (mono caps) ---- */
    .hm-btn {
      font-family: var(--font-mono); font-weight: 500; font-size: 11px;
      text-transform: uppercase; letter-spacing: var(--track-caps, .12em);
      border-radius: 2px;
      transition: background var(--hm-dur) var(--hm-ease), border-color var(--hm-dur) var(--hm-ease),
                  color var(--hm-dur) var(--hm-ease), transform .18s var(--hm-ease);
    }
    .hm-btn--primary {
      background: var(--text); border-color: var(--text); color: var(--paper-0, var(--surface));
      padding: 14px 24px; box-shadow: none;
    }
    .hm-btn--primary:hover:not(:disabled) {
      background: var(--accent); border-color: var(--accent); color: var(--accent-ink, #fff);
      box-shadow: none; transform: translateY(-2px);
    }
    .hm-btn--ghost {
      background: transparent; color: var(--text); border-color: var(--hm-line-strong);
      padding: 13px 20px;
    }
    .hm-btn--ghost:hover:not(:disabled) { border-color: var(--text); box-shadow: none; transform: translateY(-2px); }

    /* ---- section headers: outlined counter + Anton caps + ink rule ---- */
    .hm-sec__head { align-items: center; gap: 16px; margin-bottom: 22px; }
    .hm-sec__head::before {
      counter-increment: hmsec;
      content: counter(hmsec, decimal-leading-zero);
      font-family: var(--hm-display); font-weight: 400;
      font-size: 21px; line-height: 1; letter-spacing: .04em;
      color: transparent; -webkit-text-stroke: 1px var(--text);
      transform: translateY(-1px);
    }
    @supports not (-webkit-text-stroke: 1px black) { .hm-sec__head::before { color: var(--text); opacity: .25; } }
    .hm-sec__title {
      font-family: var(--hm-display); font-weight: 400;
      font-size: clamp(19px, 1.8vw, 26px); line-height: 1;
      text-transform: uppercase; letter-spacing: .035em; color: var(--text);
    }
    .hm-sec__rule { background: var(--hm-line-strong); }
    .hm-sec__more {
      font-family: var(--font-mono); font-size: 10px; font-weight: 500;
      text-transform: uppercase; letter-spacing: var(--track-caps, .12em);
      color: var(--text-mute); padding: 4px 0;
      border-bottom: 1px solid transparent; border-radius: 0;
      transition: color var(--hm-dur) var(--hm-ease), border-color var(--hm-dur) var(--hm-ease);
    }
    .hm-sec__more:hover { color: var(--text); border-bottom-color: var(--text); box-shadow: none; }

    /* ---- recent ribbon: little paper prints ---- */
    .hm-ribbon { gap: 16px; padding: 4px 2px 12px; }
    .hm-ribbon__tile {
      flex-basis: 138px; width: 138px;
      background: var(--paper-0, var(--surface-2));
      border: 1px solid var(--hm-line); border-radius: 2px;
      transition: transform var(--hm-dur) var(--hm-ease), border-color var(--hm-dur) var(--hm-ease);
    }
    .hm-ribbon__tile:hover { border-color: var(--hm-line-strong); box-shadow: none; transform: translateY(-4px); }
    .hm-ribbon__fig { background: var(--paper-0, var(--surface-2)); border-bottom: 1px solid var(--hm-line); }
    .hm-ribbon__cap { padding: 7px 9px 9px; }
    .hm-ribbon__lbl { letter-spacing: var(--track-caps, .12em); text-transform: uppercase; }

    /* ---- project cards: paper sheet on the creme, ink hairline frame ---- */
    .hm-projects { gap: 22px; }
    .hm-pcard {
      background: var(--paper-0, var(--surface-2));
      border: 1px solid var(--hm-line); border-radius: 2px;
      transition: border-color var(--hm-dur) var(--hm-ease);
    }
    .hm-pcard:hover { border-color: var(--hm-line-strong); }
    .hm-pcard--unfiled { background: var(--surface-2); border-style: dashed; }
    .hm-pcard__name {
      font-family: var(--hm-display); font-weight: 400;
      font-size: clamp(22px, 2vw, 30px); line-height: 1;
      text-transform: uppercase; letter-spacing: .025em;
    }
    .hm-pcard--unfiled .hm-pcard__name { font-style: normal; }
    /* the four columns get real room on the fluid page: identity | details
       preview | sketches (the workhorse, widest) | markups */
    .hm-pcard__body { grid-template-columns: minmax(185px, 250px) minmax(175px, 300px) minmax(0, 1.25fr) minmax(0, 1fr); gap: 28px 42px; }
    @media (max-width: 1080px) { .hm-pcard__body { grid-template-columns: 1fr; gap: 18px; } }
    /* column titles: discrete features of the project card — display caps on a rule */
    .hm-pcard__coltitle {
      font-family: var(--hm-display); font-weight: 400; font-size: 14px;
      letter-spacing: .06em; color: var(--text);
    }
    .hm-pcard__colhead { border-bottom: 1px solid var(--hm-line-strong); padding-bottom: 8px; margin-bottom: 4px; }
    .hm-pcard__colacts { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
    .hm-pcard__coladd--soon { opacity: .4; cursor: not-allowed; }
    .hm-pcard__coladd--soon:hover { background: transparent; color: var(--text); border-color: var(--hm-line-strong); }
    /* the mini gallery in the ALL DETAILS column (real fcs cards, small) */
    .hm-pcard__minigal {
      --fcs-size: 118px; --fcs-scale: 1;
      display: flex; gap: 20px; padding: 14px 4px 6px;
    }
    .hm-pcard__minigal .fcs-card { flex: 0 0 var(--fcs-size); width: var(--fcs-size); }
    /* the +Add / +PDF buttons: visible, on the shared grammar */
    .hm-pcard__coladd {
      font-family: var(--font-mono); font-size: 9px; font-weight: 500;
      text-transform: uppercase; letter-spacing: var(--track-caps, .12em);
      border: 1px solid var(--hm-line-strong); border-radius: 999px;
      color: var(--text); background: transparent; padding: 4px 12px;
      transition: background var(--hm-dur) var(--hm-ease), color var(--hm-dur) var(--hm-ease),
                  border-color var(--hm-dur) var(--hm-ease);
    }
    .hm-pcard__coladd:hover { background: var(--text); color: var(--paper-0, var(--surface)); border-color: var(--text); }
    .hm-pcard__open {
      font-family: var(--font-mono); font-size: 10px; font-weight: 500;
      text-transform: uppercase; letter-spacing: var(--track-caps, .12em);
      border: 1px solid var(--hm-line-strong); border-radius: 2px;
      color: var(--text); padding: 9px 16px;
      transition: background var(--hm-dur) var(--hm-ease), color var(--hm-dur) var(--hm-ease), transform .18s var(--hm-ease);
    }
    .hm-pcard__open:hover { background: var(--text); color: var(--paper-0, var(--surface)); border-color: var(--text); transform: translateY(-2px); }
    /* sketch / markup rows + the montage: paper cells, hairline frames */
    .hm-pcard__skrow, .hm-pcard__mkrow { background: var(--paper-0, var(--surface-2)); border: 1px solid var(--hm-line); border-radius: 2px; }
    .hm-pcard__skrow:hover, .hm-pcard__mkrow:hover { border-color: var(--hm-line-strong); box-shadow: none; }
    .hm-pcard__skfig, .hm-pcard__mkfig { border-color: var(--hm-line); border-radius: 2px; }
    .hm-pcard__alld { border-radius: 2px; }
    .hm-pcard__showall, .hm-pcard__alldlink, .hm-wall__showall {
      font-family: var(--font-mono); font-size: 10px; font-weight: 500;
      text-transform: uppercase; letter-spacing: var(--track-caps, .12em); color: var(--text-mute);
    }
    .hm-pcard__showall:hover, .hm-pcard__alldlink:hover, .hm-wall__showall:hover { color: var(--text); box-shadow: inset 0 -1px 0 0 var(--text); }
    /* + New project (section trailing control) */
    .hm-newproj__btn {
      appearance: none; cursor: pointer; background: transparent;
      font-family: var(--font-mono); font-size: 10px; font-weight: 500;
      text-transform: uppercase; letter-spacing: var(--track-caps, .12em);
      border: 1px solid var(--hm-line-strong); border-radius: 999px;
      color: var(--text); padding: 5px 14px;
      transition: background var(--hm-dur) var(--hm-ease), color var(--hm-dur) var(--hm-ease);
    }
    .hm-newproj__btn:hover { background: var(--text); color: var(--paper-0, var(--surface)); border-color: var(--text); }

    /* ---- the wall header controls (size knob + view toggle + full page) ---- */
    .hm-wall__headctrls { display: flex; align-items: center; gap: 16px; flex: none; }
    .hm-wall__size { display: flex; align-items: center; gap: 8px; }
    .hm-wall__sizelbl {
      font-family: var(--font-mono); font-size: 9px; font-weight: 500;
      text-transform: uppercase; letter-spacing: var(--track-caps, .12em); color: var(--text-mute);
    }
    .hm-wall__sizeinput { width: 88px; accent-color: var(--accent); cursor: pointer; }
    .hm-wall__viewtog {
      appearance: none; cursor: pointer; background: transparent;
      font-family: var(--font-mono); font-size: 9px; font-weight: 500;
      text-transform: uppercase; letter-spacing: var(--track-caps, .12em);
      border: 1px solid var(--hm-line); border-radius: 999px;
      color: var(--text-mute); padding: 4px 12px;
      transition: color var(--hm-dur) var(--hm-ease), border-color var(--hm-dur) var(--hm-ease);
    }
    .hm-wall__viewtog:hover { color: var(--text); border-color: var(--hm-line-strong); }

    /* ---- the wall filters: labeled fields with hints; search stops hogging ---- */
    .hm-wall__filters { display: flex; align-items: flex-start; gap: 22px; flex-wrap: wrap; margin-bottom: 18px; }
    .hm-wall__field { display: flex; flex-direction: column; gap: 5px; min-width: 150px; }
    .hm-wall__field--search { flex: 0 1 380px; }
    .hm-wall__flbl {
      font-family: var(--font-mono); font-size: 9px; font-weight: 500;
      text-transform: uppercase; letter-spacing: var(--track-caps, .12em); color: var(--text);
    }
    .hm-wall__fhint { font-family: var(--font-mono); font-size: 8.5px; letter-spacing: .04em; color: var(--text-faint, var(--text-mute)); }
    .hm-wall__search, .hm-wall__sel {
      border: 1px solid var(--hm-line); border-radius: 2px; background: var(--paper-0, var(--surface-2));
      font-family: var(--font-sans); font-size: var(--fs-sm, 12px); color: var(--text);
      padding: 8px 10px; width: 100%;
    }
    .hm-wall__search:focus, .hm-wall__sel:focus { outline: none; border-color: var(--text); }

    /* ---- recent ribbon: snap + edge fade so the horizontal gallery reads ---- */
    .hm-ribbon:not(.hm-ribbon--all) {
      scroll-snap-type: x proximity; scroll-behavior: smooth;
      -webkit-mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 56px), transparent 100%);
      mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 56px), transparent 100%);
      padding-right: 56px;
    }
    .hm-ribbon:not(.hm-ribbon--all) .hm-ribbon__tile { scroll-snap-align: start; }

    /* ---- the full All-Details page: cap the search, match the wall grammar ---- */
    .alld__field--grow { max-width: 460px; }

    /* ---- the full All-Details page header joins the same language ---- */
    .alld__title {
      font-family: 'Anton', 'Arial Narrow', sans-serif; font-weight: 400;
      text-transform: uppercase; letter-spacing: .03em;
    }
    .alld__back {
      font-family: var(--font-mono); font-size: 10px; font-weight: 500;
      text-transform: uppercase; letter-spacing: var(--track-caps, .12em);
    }

    /* motion off = everything instant (matches the app-wide contract) */
    @media (prefers-reduced-motion: reduce) {
      .hm-btn, .hm-sec__more, .hm-ribbon__tile, .hm-pcard, .hm-pcard__coladd, .hm-pcard__open, .hm-newproj__btn,
      .fcs-card__tilt, .fcs-sheet, .fcs-card__paper, .fcs-card__foot, .fcs-card__proj, .fcs-card__src, .fcs-card__num,
      .fcs-card__caption, .fcs-card__caption::before, .fcs-ov__backdrop, .fcs-ov__paper--anim,
      .fcs-ov__open, .fcs-ov__props, .csheet__viewtog { transition: none !important; }
      .fcs-ov__info > *, .fcs-ov--on .fcs-ov__info > * { animation: none !important; opacity: 1; transform: none; }
      .fcs-ov__left .fcs-sheet { opacity: 1; }
    }

    /* =====================================================================
       HOME v5 — "blush editorial ledger" (2026-07-06)
       Implements the Claude-Design handoff (StructuralSketch Home v3):
       accent-tinted blush paper, Anton display hero with an outlined word,
       a perforated film-strip for RECENT, ledger project blocks with black
       feature tags and internal hairline columns, square ink buttons with
       the hard-offset hover shadow, and a labelled filter bar + TYPE chips
       over the detail wall. Supersedes the PRESENTATION of the 2026-06-30
       stacked layer (.hm-strip / .hm-pcard / .hm-ribbon are now unused —
       same dead-CSS sweep bucket as the quadrant CSS). Every colour is
       color-mix'd from theme tokens (--text / --paper-0 / --accent), so
       all 5 themes hold; #homeScreen only — the drawing tool is untouched.
       ===================================================================== */
    #homeScreen {
      --hm2-ink:   var(--text);
      --hm2-bg:    color-mix(in srgb, var(--accent) 11%, var(--paper-0, #FAF6F0));
      --hm2-paper: color-mix(in srgb, var(--paper-0, #FFFDFA) 97%, #fff);
      --hm2-ghost: color-mix(in srgb, var(--text) 3%, var(--paper-0, #FBF6F1));
      --hm2-l12: color-mix(in srgb, var(--text) 12%, transparent);
      --hm2-l22: color-mix(in srgb, var(--text) 22%, transparent);
      --hm2-l28: color-mix(in srgb, var(--text) 28%, transparent);
      --hm2-l35: color-mix(in srgb, var(--text) 35%, transparent);
      --hm2-l45: color-mix(in srgb, var(--text) 45%, transparent);
      --hm2-l55: color-mix(in srgb, var(--text) 55%, transparent);
      --hm2-l75: color-mix(in srgb, var(--text) 75%, transparent);
      --hm2-mut40: color-mix(in srgb, var(--text) 40%, var(--hm2-bg));
      --hm2-mut50: color-mix(in srgb, var(--text) 50%, var(--hm2-bg));
      --hm2-mut60: color-mix(in srgb, var(--text) 60%, var(--hm2-bg));
      --hm2-shadow:    4px 4px 0 0 color-mix(in srgb, var(--text) 35%, transparent);
      --hm2-shadow-sm: 3px 3px 0 0 color-mix(in srgb, var(--text) 30%, transparent);
    }
    #homeScreen.app-screen { background: var(--hm2-bg); }

    /* ---- container ---- */
    #homeScreen .hm-stack { max-width: 2100px; padding: 44px clamp(28px, 3.2vw, 56px) 110px; gap: 0; }
    #homeScreen .hm-sec { display: block; }
    #homeScreen .hm-sec--recent { margin-top: 64px; }
    #homeScreen .hm-sec--projects, #homeScreen .hm-sec--wall { margin-top: 74px; }
    #homeScreen .hm-empty { font-family: var(--font-serif); font-style: italic; font-size: 15px; color: var(--hm2-mut60); }

    /* ---- one square mono-caps button grammar ---- */
    #homeScreen .hm2-btn {
      appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: 9px;
      height: 40px; padding: 0 18px;
      background: transparent; border: 1px solid var(--hm2-ink); border-radius: 0;
      font-family: var(--font-mono); font-size: 11px; font-weight: 500;
      letter-spacing: .15em; text-transform: uppercase; color: var(--hm2-ink);
      cursor: pointer;
      transition: transform .16s ease-out, box-shadow .16s ease-out, background .16s ease-out, color .16s ease-out;
    }
    #homeScreen .hm2-btn:hover:not(:disabled) { background: color-mix(in srgb, var(--text) 6%, transparent); }
    #homeScreen .hm2-btn:active:not(:disabled) { transform: translate(0, 0); box-shadow: none; }
    #homeScreen .hm2-btn:disabled { opacity: .45; cursor: default; }
    #homeScreen .hm2-btn--lg { height: 48px; padding: 0 24px; font-size: 12px; letter-spacing: .16em; gap: 10px; }
    #homeScreen .hm2-btn--sm { height: 34px; padding: 0 14px; font-size: 10.5px; letter-spacing: .12em; gap: 7px; }
    #homeScreen .hm2-btn--solid { background: var(--hm2-ink); border-color: var(--hm2-ink); color: var(--hm2-bg); }
    #homeScreen .hm2-btn--solid:hover:not(:disabled) {
      background: var(--hm2-ink); color: var(--hm2-bg);
      transform: translate(-2px, -2px); box-shadow: var(--hm2-shadow);
    }
    #homeScreen .hm2-btn--sm.hm2-btn--solid:hover:not(:disabled) { transform: translate(-1px, -1px); box-shadow: var(--hm2-shadow-sm); }
    #homeScreen .hm2-btn--frame:hover:not(:disabled) { background: var(--hm2-ink); color: var(--hm2-bg); }
    #homeScreen .hm2-btn--soon {
      border-style: dashed; border-color: var(--hm2-l45); color: var(--hm2-mut40);
      cursor: not-allowed; gap: 7px;
    }
    #homeScreen .hm2-btn--soon:hover { background: transparent; }
    #homeScreen .hm2-soon {
      font-size: 8.5px; letter-spacing: .1em; text-transform: uppercase;
      border: 1px solid var(--hm2-l35); border-radius: 999px; padding: 2px 7px;
    }
    #homeScreen .hm2-ulink {
      appearance: none; background: none; border: none; padding: 3px 2px;
      font-family: var(--font-mono); font-size: 10.5px; font-weight: 500;
      letter-spacing: .13em; text-transform: uppercase; color: var(--hm2-ink);
      cursor: pointer; text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 1px;
      transition: color .16s ease-out; white-space: nowrap;
    }
    #homeScreen .hm2-ulink:hover { color: var(--accent); }
    #homeScreen .hm2-ulink--dim { color: var(--hm2-mut60); }
    #homeScreen .hm2-ulink--dim:hover { color: var(--hm2-ink); }
    #homeScreen .hm2-ic { display: inline-grid; place-items: center; }
    #homeScreen .hm2-ic svg { display: block; }

    /* ---- HERO ---- */
    #homeScreen .hm-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
    #homeScreen .hm-hero__eyebrow {
      display: block; font-family: var(--font-mono); font-size: 11px; font-weight: 500;
      letter-spacing: .3em; text-transform: uppercase; color: var(--hm2-mut60);
    }
    #homeScreen .hm-hero__h1 {
      margin: 14px 0 0; font-family: 'Anton', 'Arial Narrow', sans-serif; font-weight: 400;
      font-size: clamp(38px, 4.4vw, 64px); letter-spacing: .015em; line-height: .98;
      color: var(--hm2-ink); text-transform: uppercase;
    }
    #homeScreen .hm-hero__outline { color: transparent; -webkit-text-stroke: 1.8px var(--hm2-ink); }
    @supports not (-webkit-text-stroke: 1px black) { #homeScreen .hm-hero__outline { color: var(--hm2-ink); opacity: .35; } }
    #homeScreen .hm-hero__actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding-bottom: 6px; }

    /* ---- numbered section headers ---- */
    #homeScreen .hm2-head { display: flex; align-items: flex-end; gap: 18px; min-width: 0; }
    #homeScreen .hm2-head__num {
      font-family: 'Anton', 'Arial Narrow', sans-serif; font-size: 34px; line-height: 1;
      color: transparent; -webkit-text-stroke: 1.6px color-mix(in srgb, var(--text) 80%, transparent);
    }
    @supports not (-webkit-text-stroke: 1px black) { #homeScreen .hm2-head__num { color: var(--text); opacity: .3; } }
    #homeScreen .hm2-head__title {
      margin: 0; font-family: 'Anton', 'Arial Narrow', sans-serif; font-weight: 400;
      font-size: 34px; line-height: 1; letter-spacing: .02em;
      text-transform: uppercase; color: var(--hm2-ink);
    }
    #homeScreen .hm2-head__count {
      font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .14em;
      text-transform: uppercase; color: var(--hm2-mut50); padding-bottom: 3px; white-space: nowrap;
    }
    #homeScreen .hm2-head__gap { flex: 1; }
    #homeScreen .hm2-head__aside {
      font-family: var(--font-mono); font-size: 11px; letter-spacing: .14em;
      text-transform: uppercase; color: var(--hm2-mut60); padding-bottom: 3px; white-space: nowrap;
    }

    /* ---- 01 RECENT: the film strip ---- */
    #homeScreen .hm-film { margin-top: 26px; display: flex; align-items: center; gap: 18px; }
    #homeScreen .hm-film__nav {
      appearance: none; flex: none; width: 46px; height: 46px; display: grid; place-items: center;
      background: transparent; border: 1px solid var(--hm2-ink); border-radius: 50%;
      color: var(--hm2-ink); cursor: pointer; padding: 0;
      transition: background .16s ease-out, opacity .16s ease-out;
    }
    #homeScreen .hm-film__nav:hover:not(:disabled) { background: color-mix(in srgb, var(--text) 7%, transparent); }
    #homeScreen .hm-film__nav:disabled { opacity: .3; cursor: default; }
    #homeScreen .hm-film__strip {
      flex: 1; min-width: 0; position: relative;
      border-top: 1px solid var(--hm2-l75); border-bottom: 1px solid var(--hm2-l75);
    }
    #homeScreen .hm-film__perf {
      height: 18px;
      background-image: repeating-linear-gradient(90deg,
        transparent 0 13px, var(--hm2-l28) 13px 14px,
        transparent 14px 21px, var(--hm2-l28) 21px 22px, transparent 22px 34px);
      background-size: 34px 7px; background-position: center; background-repeat: repeat-x;
    }
    #homeScreen .hm-film__perf--top { border-bottom: 1px solid var(--hm2-l28); }
    #homeScreen .hm-film__perf--bot { border-top: 1px solid var(--hm2-l28); }
    #homeScreen .hm-film__track {
      display: flex; gap: 34px; padding: 22px 26px 18px;
      overflow-x: auto; overflow-y: hidden;
      scroll-snap-type: x proximity; scroll-behavior: smooth;
      scrollbar-width: none;
    }
    #homeScreen .hm-film__track::-webkit-scrollbar { display: none; }
    #homeScreen .hm-film__strip::after {
      content: ''; position: absolute; inset: 0; pointer-events: none;
      background: linear-gradient(90deg, var(--hm2-bg) 0, transparent 40px),
                  linear-gradient(270deg, var(--hm2-bg) 0, transparent 40px);
    }
    #homeScreen .hm-film__cell { flex: none; scroll-snap-align: start; }
    #homeScreen .hm-film__cell:nth-child(3n+1) { transform: rotate(-.8deg); }
    #homeScreen .hm-film__cell:nth-child(3n)   { transform: rotate(.8deg); }
    #homeScreen .hm-film__frame {
      position: relative; display: block; width: 228px; text-align: left;
      background: none; border: none; padding: 0; cursor: pointer;
      transition: transform .22s ease-out;
    }
    #homeScreen .hm-film__frame:hover { transform: translateY(-4px); }
    #homeScreen .hm-film__ghost {
      position: absolute; inset: 0 0 22px 0;
      background: var(--hm2-ghost); border: 1px solid var(--hm2-l35);
    }
    #homeScreen .hm-film__ghost--a { transform: translate(4px, 4px) rotate(.6deg); }
    #homeScreen .hm-film__ghost--b { transform: translate(8px, 8px) rotate(1.3deg); border-color: var(--hm2-l28); }
    #homeScreen .hm-film__paper {
      position: relative; display: block;
      background: var(--hm2-paper); border: 1px solid var(--hm2-l75); padding: 9px 9px 8px;
    }
    #homeScreen .hm-film__fig {
      display: grid; place-items: center; height: 118px; overflow: hidden;
      border: 1px solid var(--hm2-l22); background: var(--paper-0, #fff);
    }
    #homeScreen .hm-film__img { width: 100%; height: 100%; object-fit: contain; display: block; }
    #homeScreen .hm-film__ph { font-family: var(--font-mono); font-size: 10px; letter-spacing: .12em; color: var(--hm2-mut40); }
    #homeScreen .hm-film__meta { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 8px 1px 0; }
    #homeScreen .hm-film__name {
      font-family: 'Anton', 'Arial Narrow', sans-serif; font-size: 13px; letter-spacing: .04em;
      color: var(--hm2-ink); text-transform: uppercase;
      white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    }
    #homeScreen .hm-film__code { font-family: var(--font-mono); font-size: 9px; letter-spacing: .06em; color: var(--hm2-mut40); white-space: nowrap; }
    #homeScreen .hm-film__cap {
      display: block; margin-top: 7px; max-width: 228px;
      font-family: var(--font-mono); font-size: 8.5px; letter-spacing: .12em;
      text-transform: uppercase; color: var(--hm2-mut60);
      white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    }
    #homeScreen .hm-film__cap::before { content: '—— '; color: var(--hm2-l35); }

    /* ---- 02 PROJECTS: ledger blocks ---- */
    #homeScreen .hm-projects { margin-top: 28px; display: flex; flex-direction: column; gap: 30px; }
    #homeScreen .hm-ledger {
      border: 1px solid var(--hm2-l75);
      background: color-mix(in srgb, var(--hm2-paper) 35%, transparent);
    }
    #homeScreen .hm-ledger--unfiled { border-style: dashed; }
    #homeScreen .hm-ledger__grid {
      display: grid; min-height: 340px;
      grid-template-columns: minmax(220px, 300px) minmax(250px, 340px) minmax(380px, 1.25fr) minmax(300px, 1fr);
    }
    #homeScreen .hm-ledger__col {
      padding: 22px 26px; min-width: 0; display: flex; flex-direction: column;
      border-right: 1px solid var(--hm2-l35);
    }
    #homeScreen .hm-ledger__col:last-child { border-right: none; }
    #homeScreen .hm-ledger__col--id { padding: 26px 28px; }
    @media (max-width: 1380px) {
      #homeScreen .hm-ledger__grid { grid-template-columns: minmax(220px, 300px) minmax(0, 1fr); }
      #homeScreen .hm-ledger__col { border-bottom: 1px solid var(--hm2-l35); }
      #homeScreen .hm-ledger__col--alld { border-right: none; }
      #homeScreen .hm-ledger__col:nth-last-child(-n+2) { border-bottom: none; }
    }
    @media (max-width: 900px) {
      #homeScreen .hm-ledger__grid { grid-template-columns: 1fr; }
      #homeScreen .hm-ledger__col { border-right: none; border-bottom: 1px solid var(--hm2-l35); }
      #homeScreen .hm-ledger__col:last-child { border-bottom: none; }
      #homeScreen .hm-ledger__col:nth-last-child(-n+2) { border-bottom: 1px solid var(--hm2-l35); }
    }
    #homeScreen .hm-ledger__name {
      font-family: 'Anton', 'Arial Narrow', sans-serif; font-weight: 400;
      font-size: clamp(24px, 1.8vw, 32px); line-height: 1.05; letter-spacing: .015em;
      color: var(--hm2-ink); text-transform: uppercase; word-break: break-word;
    }
    #homeScreen .hm-ledger__num {
      font-family: var(--font-mono); font-size: 10px; letter-spacing: .14em;
      text-transform: uppercase; color: var(--hm2-mut50); margin-top: 12px;
    }
    #homeScreen .hm-ledger__meta {
      font-family: var(--font-mono); font-size: 10px; letter-spacing: .1em;
      text-transform: uppercase; color: var(--hm2-mut60); margin-top: 5px;
    }
    #homeScreen .hm-ledger__meta::before { content: '—— '; color: var(--hm2-l35); }
    #homeScreen .hm-ledger__addr {
      font-family: var(--font-serif); font-style: italic; font-size: 12.5px;
      color: var(--hm2-mut60); margin-top: 8px; line-height: 1.4;
    }
    #homeScreen .hm-ledger__flex { flex: 1; min-height: 18px; }
    #homeScreen .hm-ledger__open { align-self: flex-start; }
    #homeScreen .hm-ledger__fhead { display: flex; align-items: center; gap: 11px; flex-wrap: wrap; }
    #homeScreen .hm-ledger__tag {
      font-family: 'Anton', 'Arial Narrow', sans-serif; font-size: 14px; letter-spacing: .06em;
      background: var(--hm2-ink); color: var(--hm2-bg); padding: 6px 11px 5px;
      text-transform: uppercase; white-space: nowrap;
    }
    #homeScreen .hm-ledger__fcount { font-family: var(--font-mono); font-size: 10px; letter-spacing: .08em; color: var(--hm2-mut50); }
    #homeScreen .hm-ledger__frule { flex: 1; height: 1px; background: var(--hm2-l35); min-width: 12px; }
    #homeScreen .hm-ledger__ffoot { margin-top: auto; padding-top: 20px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
    #homeScreen .hm-ledger__note { font-family: var(--font-serif); font-style: italic; font-size: 13.5px; color: var(--hm2-mut60); line-height: 1.4; }
    #homeScreen .hm-ledger__mkbtns { margin-top: 16px; display: flex; gap: 9px; flex-wrap: wrap; }
    #homeScreen .hm-ledger__list { margin-top: 14px; display: flex; flex-direction: column; }
    #homeScreen .hm-ledger__none { font-family: var(--font-serif); font-style: italic; font-size: 13.5px; color: var(--hm2-mut50); padding: 12px 2px; }
    #homeScreen .hm-ledger__showall { margin-top: 14px; align-self: flex-start; }

    /* the stacked-paper montage (ALL DETAILS column) */
    #homeScreen .hm-montage {
      margin-top: 20px; position: relative; width: 100%;
      background: none; border: none; padding: 0; cursor: pointer; text-align: left;
    }
    #homeScreen .hm-montage__ghost { position: absolute; inset: 0; background: var(--hm2-ghost); border: 1px solid var(--hm2-l35); }
    #homeScreen .hm-montage__ghost--a { transform: translate(4.5px, 5px) rotate(.5deg); border-color: var(--hm2-l45); }
    #homeScreen .hm-montage__ghost--b { transform: translate(9px, 10px) rotate(1.2deg); }
    #homeScreen .hm-montage__paper {
      position: relative; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr;
      gap: 7px; padding: 11px; aspect-ratio: 1.41 / 1;
      background: var(--hm2-paper); border: 1px solid var(--hm2-l75);
      transition: transform .22s ease-out;
    }
    #homeScreen .hm-montage:hover .hm-montage__paper { transform: translateY(-3px); }
    #homeScreen .hm-montage__cell {
      border: 1px solid var(--hm2-l22); display: grid; place-items: center;
      background: var(--paper-0, #fff); overflow: hidden; min-height: 0;
    }
    #homeScreen .hm-montage__cell--empty { border-style: dashed; border-color: var(--hm2-l12); background: transparent; }
    #homeScreen .hm-montage__img { width: 100%; height: 100%; object-fit: contain; display: block; }
    #homeScreen .hm-montage__paper--empty { display: grid; place-items: center; }
    #homeScreen .hm-montage__none { grid-column: 1 / -1; grid-row: 1 / -1; place-self: center; font-family: var(--font-serif); font-style: italic; font-size: 14px; color: var(--hm2-mut50); }

    /* ledger list rows (sketches + markups) */
    #homeScreen .hm-lrow {
      display: flex; align-items: center; gap: 13px; padding: 9px 2px;
      border-bottom: 1px solid var(--hm2-l22);
      animation: hm2Rise .18s ease-out;
    }
    #homeScreen .hm-lrow__grip { flex: none; cursor: grab; color: var(--hm2-mut40); font-size: 11px; }
    #homeScreen .hm-lrow--drag { opacity: .45; }
    #homeScreen .hm-lrow--over { box-shadow: inset 0 2px 0 0 var(--accent); }
    #homeScreen .hm-lrow__fig {
      appearance: none; flex: none; width: 64px; height: 45px;
      background: var(--hm2-paper); border: 1px solid var(--hm2-l45); padding: 2px;
      cursor: pointer; display: grid; place-items: center; overflow: hidden;
      transition: border-color .16s ease-out, transform .16s ease-out;
    }
    #homeScreen .hm-lrow__fig:hover { border-color: var(--hm2-ink); transform: rotate(-1deg); }
    #homeScreen .hm-lrow__fig img { width: 100%; height: 100%; object-fit: contain; display: block; }
    #homeScreen .hm-lrow__ph { font-family: var(--font-mono); font-size: 10px; color: var(--hm2-mut40); }
    #homeScreen .hm-lrow__kind {
      flex: none; display: grid; place-items: center; width: 38px; height: 38px;
      background: var(--hm2-paper); border: 1px solid var(--hm2-l55); overflow: hidden;
      font-family: var(--font-mono); font-size: 8.5px; letter-spacing: .08em; font-weight: 700; color: var(--hm2-ink);
    }
    #homeScreen .hm-lrow__kind img { width: 100%; height: 100%; object-fit: cover; display: block; }
    #homeScreen .hm-lrow__info { flex: 1; min-width: 0; }
    #homeScreen .hm-lrow__l1 { display: flex; align-items: baseline; gap: 9px; }
    #homeScreen .hm-lrow__code { font-family: var(--font-mono); font-size: 11px; letter-spacing: .06em; font-weight: 600; color: var(--hm2-ink); white-space: nowrap; }
    #homeScreen .hm-lrow__time { font-family: var(--font-mono); font-size: 9px; letter-spacing: .06em; text-transform: uppercase; color: var(--hm2-mut40); white-space: nowrap; }
    #homeScreen .hm-lrow__title { font-family: var(--font-sans); font-size: 13.5px; font-weight: 600; color: var(--hm2-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
    #homeScreen .hm-lrow__sub { font-family: var(--font-mono); font-size: 9px; letter-spacing: .08em; text-transform: uppercase; color: var(--hm2-mut50); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    #homeScreen .hm-lrow__sub::before { content: '—— '; color: var(--hm2-l28); }
    #homeScreen .hm-lrow__icon {
      appearance: none; flex: none; display: grid; place-items: center; width: 28px; height: 28px;
      background: none; border: none; padding: 0; color: var(--hm2-mut40); cursor: pointer;
      transition: color .16s ease-out;
    }
    #homeScreen .hm-lrow__icon:hover { color: var(--hm2-ink); }
    #homeScreen .hm-lrow__icon--danger:hover { color: var(--danger, #b3402a); }
    #homeScreen .hm-lrow__open { flex: none; font-size: 10px; letter-spacing: .12em; text-underline-offset: 4px; }
    #homeScreen .hm-lrow__edit {
      width: 100%; font-family: var(--font-sans); font-size: 13px; font-weight: 600;
      color: var(--hm2-ink); background: var(--hm2-paper);
      border: 1px solid var(--hm2-ink); border-radius: 0; padding: 2px 6px; outline: none; margin-top: 1px;
    }
    #homeScreen .hm-lrow__group {
      font-family: var(--font-mono); font-size: 8.5px; letter-spacing: .18em;
      text-transform: uppercase; color: var(--hm2-mut50); padding: 10px 2px 4px;
    }
    #homeScreen .hm-mkempty { margin-top: 16px; padding: 20px 18px; border: 1px dashed var(--hm2-l35); text-align: center; }
    #homeScreen .hm-mkempty__t { font-family: var(--font-serif); font-style: italic; font-size: 14.5px; color: var(--hm2-mut60); }
    #homeScreen .hm-mkempty__s { font-family: var(--font-sans); font-size: 11.5px; color: var(--hm2-mut50); margin-top: 4px; }
    @keyframes hm2Rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

    /* + New project inline form (header trailing control) */
    #homeScreen .hm-newproj__form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
    #homeScreen .hm2-input {
      height: 40px; padding: 0 12px; border: 1px solid var(--hm2-l75); border-radius: 0;
      background: var(--hm2-paper); color: var(--hm2-ink);
      font-family: var(--font-sans); font-size: 13px; outline: none;
    }
    #homeScreen .hm2-input:focus { border-color: var(--hm2-ink); }
    #homeScreen .hm2-input--name { width: 180px; }
    #homeScreen .hm2-input--num { width: 140px; font-family: var(--font-mono); }
    #homeScreen .hm2-input--addr { width: 200px; }

    /* ---- 03 ALL DETAILS: header links, labelled filters, chips, wall ---- */
    #homeScreen .hm-wall__links { display: flex; align-items: center; gap: 18px; padding-bottom: 3px; }
    #homeScreen .hm-wall__filters--v5 { margin-top: 26px; margin-bottom: 0; display: flex; align-items: flex-start; gap: 24px; flex-wrap: wrap; }
    #homeScreen .hm-wall__field { display: flex; flex-direction: column; gap: 6px; min-width: 150px; flex: 0 0 auto; }
    #homeScreen .hm-wall__field--search { flex: 0 1 340px; min-width: 240px; }
    #homeScreen .hm-wall__fspace { flex: 1; }
    #homeScreen .hm-wall__field--size { align-items: flex-end; }
    #homeScreen .hm-wall__flbl {
      font-family: var(--font-mono); font-size: 9.5px; font-weight: 500;
      letter-spacing: .2em; text-transform: uppercase; color: var(--hm2-mut60);
    }
    #homeScreen .hm-wall__fhint { font-family: var(--font-serif); font-style: italic; font-size: 12px; color: var(--hm2-mut50); }
    #homeScreen .hm-wall__inwrap { position: relative; }
    #homeScreen .hm-wall__inic { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--hm2-mut40); pointer-events: none; }
    #homeScreen .hm-wall__search, #homeScreen .hm-wall__sel {
      height: 40px; width: 100%; max-width: none; padding: 0 12px;
      border: 1px solid var(--hm2-l75); border-radius: 0;
      background: var(--hm2-paper); color: var(--hm2-ink);
      font-family: var(--font-sans); font-size: 13px;
    }
    #homeScreen .hm-wall__search { padding-left: 32px; }
    #homeScreen .hm-wall__sel { min-width: 195px; cursor: pointer; }
    #homeScreen .hm-wall__search:focus, #homeScreen .hm-wall__sel:focus { outline: none; border-color: var(--hm2-ink); box-shadow: none; }
    #homeScreen .hm-wall__sizeinput { width: 175px; accent-color: var(--hm2-ink); cursor: pointer; margin-top: 12px; }
    #homeScreen .hm-wall__chips { margin-top: 14px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
    #homeScreen .hm-wall__chipslbl { margin-right: 4px; }
    #homeScreen .hm-chip {
      appearance: none; font-family: var(--font-mono); font-size: 10px; font-weight: 500;
      letter-spacing: .12em; text-transform: uppercase; padding: 8px 14px;
      border: 1px solid var(--hm2-l45); border-radius: 0;
      background: transparent; color: var(--hm2-mut60); cursor: pointer;
      transition: background .15s ease-out, color .15s ease-out, border-color .15s ease-out;
    }
    #homeScreen .hm-chip:hover { border-color: var(--hm2-ink); color: var(--hm2-ink); }
    #homeScreen .hm-chip--on { border-color: var(--hm2-ink); background: var(--hm2-ink); color: var(--hm2-bg); }
    #homeScreen .hm-wall__rule { height: 1px; background: var(--hm2-l75); margin-top: 20px; }
    #homeScreen .hm-wall__grid { margin-top: 20px; }
    #homeScreen .hm-wall__none { grid-column: 1 / -1; padding: 52px 0; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }
    #homeScreen .hm-wall__none-t { font-family: var(--font-serif); font-style: italic; font-size: 17px; color: var(--hm2-mut60); max-width: 560px; }
    #homeScreen .hm-wall__foot { margin-top: 22px; }
    #homeScreen .hm-wall__count {
      font-family: var(--font-mono); font-size: 10px; letter-spacing: .13em;
      text-transform: uppercase; color: var(--hm2-mut50);
    }
    /* classic-view cards join the square hairline language */
    #homeScreen .hm-wall__card {
      background: var(--hm2-paper); border: 1px solid var(--hm2-l45); border-radius: 0;
      transition: border-color .16s ease-out, transform .16s ease-out, box-shadow .16s ease-out;
    }
    #homeScreen .hm-wall__card:hover { border-color: var(--hm2-ink); box-shadow: none; transform: translateY(-3px); }
    #homeScreen .hm-wall__captitle { font-family: 'Anton', 'Arial Narrow', sans-serif; font-weight: 400; font-size: 13px; letter-spacing: .03em; text-transform: uppercase; }

    /* motion off = everything instant (matches the app-wide contract) */
    @media (prefers-reduced-motion: reduce) {
      #homeScreen .hm2-btn, #homeScreen .hm2-ulink, #homeScreen .hm-film__nav, #homeScreen .hm-film__frame,
      #homeScreen .hm-montage__paper, #homeScreen .hm-lrow__fig, #homeScreen .hm-lrow__icon,
      #homeScreen .hm-chip, #homeScreen .hm-wall__card { transition: none !important; }
      #homeScreen .hm-lrow { animation: none !important; }
      #homeScreen .hm-film__track { scroll-behavior: auto; }
    }
