@floless/app 0.128.2 → 0.130.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,13 +1,186 @@
1
1
  <!doctype html><html><head><meta charset=utf-8>
2
2
  <title>Steel Model — editor</title>
3
+ <!-- Mirrors the shell's light/dark choice onto this document's <html> — see web/frame-theme.js for why it
4
+ reads localStorage rather than being poked by the parent. Classic, non-deferred and in <head> on
5
+ purpose: the attribute has to land before first paint or a light user sees a dark flash. -->
6
+ <script src="./frame-theme.js"></script>
3
7
  <style>
4
- :root{--bg:#0f172a;--panel:#1e293b;--line:#334155;--text:#e2e8f0;--mut:#94a3b8;--brand:#3b82f6}
8
+ /* THE CHROME follows the app theme; THE STAGE DOES NOT — the two halves of this palette (#727, the
9
+ recipe steel-filter.html established in #726).
10
+ Everything a user reads as app furniture — the header, the right rail, every modal, the header's own
11
+ dropdowns, toasts, tooltips, scrollbars — is themed below and goes light with the shell.
12
+ THE STAGE IS A DARK ISLAND IN BOTH THEMES. Both canvases paint geometry in colours tuned for a dark
13
+ ground: cyan dimensions and snap markers, #e2e8f0 label text, #64748b dash-dot grid lines, #f8fafc
14
+ end handles, and a three.js scene with its own clear colour. Flipping that means re-deriving the whole
15
+ drawing palette — a separate piece of work — and #602's reporter names keeping the drawing dark as the
16
+ acceptable choice as long as it is a deliberate one.
17
+ THE FURNITURE FLOATING ON THE STAGE STAYS DARK WITH IT, and that is the same rule rather than an
18
+ exception to it: a light zoom bar / 3D toolbar / legend over a dark model would put --text (near-black
19
+ in light) on fills nobody re-tinted and drop its shadow into nothing. They are re-pinned wholesale by
20
+ the ".island" block below — see it for the mechanism and the exact membership. */
21
+ :root{
22
+ color-scheme:dark; /* so the UA-drawn bits we do not style (selection, the pre-CSS canvas) agree */
23
+ --bg:#0f172a;--panel:#1e293b;--line:#334155;--text:#e2e8f0;--mut:#94a3b8;--brand:#3b82f6;
24
+ --brand-ink:#fff; /* text/glyphs on a --brand fill */
25
+ --brand-hover:#2f6fe0;
26
+ --btn:#334155; /* secondary button fill, and the menu-row hover that matches it */
27
+ --btn-hover:#475569;
28
+ --ctrl-border:#475569; /* button, field, checkbox and radio borders */
29
+ --field:#0f172a; /* the inside of an input/select — a shade BELOW the panel it sits on */
30
+ --sunken:#0b1220; /* recessed chrome: an expanded table row, a card preview, a dropzone */
31
+ --hover-soft:#33415580; /* the lighter row hover used by dense lists (kept translucent) */
32
+ --scroll:#475569;--scroll-hover:#5b6b85;
33
+ --shadow-lg:0 8px 24px rgba(0,0,0,.5); /* dropdowns and popovers */
34
+ --shadow-md:0 6px 20px rgba(0,0,0,.5); /* toasts, small popovers */
35
+ --shadow-sm:0 2px 8px rgba(0,0,0,.45); /* inline readouts */
36
+ --shadow-float:0 4px 14px rgba(0,0,0,.45); /* a control lifted off the surface behind it */
37
+ --shadow-modal:0 20px 60px rgba(0,0,0,.6);
38
+ --shadow-xl:0 24px 70px rgba(0,0,0,.7); /* the lightbox, the one panel that covers the app */
39
+ --shadow-tip:0 8px 22px rgba(0,0,0,.5); /* the tooltip keeps its own, SMALLER treatment — the same
40
+ control on four surfaces all ship 0 8px 22px, so folding
41
+ it into --shadow-lg would de-sync this one from them */
42
+ --backdrop:rgba(2,8,23,.62);
43
+ --brand-wash:rgba(59,130,246,.16); /* a selected row */
44
+ --brand-wash-soft:rgba(59,130,246,.12); /* a "you just navigated here" flash */
45
+ --brand-wash-faint:rgba(59,130,246,.08);/* an open accordion header */
46
+ --brand-wash-strong:rgba(59,130,246,.28);/* the .mck switch track when on */
47
+ --ink-max:#fff; /* the hover "brighten" one step past --text */
48
+ /* Each state carries THREE roles, and they do not collapse into one value on light: the INK (text),
49
+ the FILL it sits on when it is a pill, and the EDGE when it is an outlined chip. On dark the fill is
50
+ the deep end of the ramp and the ink the pale end; on light they swap, so a fill re-used as a border
51
+ would vanish and a border re-used as a fill would shout. */
52
+ --warn:#fbbf24;--warn-soft:#fcd34d;--warn-bg:#713f12;--warn-edge:#713f12; /* amber = "needs review", never an error */
53
+ --ok:#86efac;--ok-bg:#166534;--ok-edge:#166534;--ok-wash:rgba(22,101,52,.28); /* green = human-confirmed */
54
+ --ok-border:#16a34a;--ok-ink:#dcfce7; /* the FILLED success button (Dedupe done / Reviewed) */
55
+ --hi:#4ade80;--hi-bg:#14532d; /* the confidence report's "high" band, one stop off --ok */
56
+ --err:#fca5a5;--err-bg:#7f1d1d;--err-border:#991b1b;--err-edge:#7f1d1d;--err-ink:#fecaca;
57
+ --err-wash:rgba(127,29,29,.28);--err-underline:rgba(254,202,202,.55);
58
+ --cyan:#22d3ee;--cyan-soft:rgba(34,211,238,.10); /* the "non-default, click to act" chip */
59
+ --cyan-wash:rgba(34,211,238,.06);--cyan-edge:rgba(34,211,238,.35);
60
+ --purple:#a855f7;--purple-ink:#c4b5fd; /* detail callouts (the drawing's own purple, in chrome) */
61
+ --info-ink:#bfdbfe; /* pale-blue ink on a brand-bordered chip */
62
+ }
63
+ /* Light — the same slate/blue ramp as the shell's [data-theme="light"] (web/app.css), re-expressed in
64
+ this page's token names because a standalone page does not load app.css. No new colours: every value
65
+ is app.css's own light token or the -700/-800 stop of a ramp it already uses on light, and the seven
66
+ measured in #726's design review (--mut, --line, --ctrl-border, --warn, --ok, --err, --cyan) are
67
+ reused rather than re-derived. Every state colour steps DOWN its ramp, amber included: amber 400
68
+ measures under 2:1 on --panel, and amber here is "needs review", the state a user must not miss. */
69
+ [data-theme="light"]{
70
+ color-scheme:light;
71
+ --bg:#fff;--panel:#f1f5f9;--line:#cbd5e1;--text:#0f172a;--mut:#475569;--brand:#2563eb;
72
+ --brand-hover:#1d4ed8;
73
+ --btn:#e2e8f0;--btn-hover:#cbd5e1;--ctrl-border:#94a3b8;
74
+ --field:#fff;
75
+ --sunken:#e2e8f0; /* recessed reads DARKER than its panel on light — the mirror of #0b1220 */
76
+ --hover-soft:rgba(15,23,42,.06);
77
+ --scroll:#cbd5e1;--scroll-hover:#94a3b8;
78
+ --shadow-lg:0 8px 24px rgba(15,23,42,.14);
79
+ --shadow-md:0 6px 20px rgba(15,23,42,.14);
80
+ --shadow-sm:0 2px 8px rgba(15,23,42,.12);
81
+ --shadow-float:0 4px 14px rgba(15,23,42,.14);
82
+ --shadow-modal:0 20px 60px rgba(15,23,42,.18);
83
+ --shadow-xl:0 24px 70px rgba(15,23,42,.20);
84
+ --shadow-tip:0 8px 22px rgba(15,23,42,.14);
85
+ --backdrop:rgba(15,23,42,.42);
86
+ --brand-wash:rgba(37,99,235,.14);--brand-wash-soft:rgba(37,99,235,.10);
87
+ --brand-wash-faint:rgba(37,99,235,.07);--brand-wash-strong:rgba(37,99,235,.22);
88
+ --ink-max:#0f172a;
89
+ /* The ink/fill/edge swap named in :root, applied: ink is the -700/-800 stop (AA on --panel), the fill
90
+ is the -100 tint, and the edge is the -300 stop — visible on --panel without reading as a state fill. */
91
+ --warn:#b45309;--warn-soft:#b45309;--warn-bg:#fef3c7;--warn-edge:#b45309;
92
+ --ok:#15803d;--ok-bg:#dcfce7;--ok-edge:#15803d;--ok-wash:rgba(21,128,61,.14);
93
+ --ok-border:#16a34a;--ok-ink:#15803d;
94
+ --hi:#14532d;--hi-bg:#dcfce7; /* light keeps the two greens apart by INK depth, not a second tint */
95
+ --err:#b91c1c;--err-bg:#fee2e2;--err-border:#ef4444;--err-edge:#b91c1c;--err-ink:#b91c1c;
96
+ --err-wash:rgba(185,28,28,.12);--err-underline:rgba(185,28,28,.55);
97
+ --cyan:#155e75;--cyan-soft:rgba(21,94,117,.10);
98
+ --cyan-wash:rgba(21,94,117,.06);--cyan-edge:rgba(21,94,117,.35);
99
+ --purple:#7e22ce;--purple-ink:#6b21a8;
100
+ --info-ink:#1d4ed8;
101
+ }
102
+ /* ── THE DARK ISLAND ────────────────────────────────────────────────────────────────────────────────
103
+ The stage and every piece of furniture floating on it keep the dark palette in BOTH themes.
104
+ THE MECHANISM IS INHERITANCE, NOT A REWRITE. Custom properties cascade, so re-declaring the dark
105
+ values ON these elements re-points every `var(--…)` inside their subtrees back at the dark palette
106
+ without touching one of the ~200 rules that read them. That is deliberate: hand-renaming each of those
107
+ rules to a parallel `--stage-*` token (steel-filter.html's approach, which had exactly one floating
108
+ bar to pin) would be a 200-rule diff on this page, and every rule it missed would be a light control
109
+ stranded on the black canvas.
110
+ MEMBERSHIP IS "does it sit ON the drawing?", not "is it a popup?" — hence #propPop, #snapMenu and the
111
+ row menus (opened by right-clicking the model or a legend row) are in, while #moreMenu, .cmmenu,
112
+ #comboPop and .plan-popover — which hang off the light HEADER, exactly as steel-filter's .sheet-popover
113
+ does — are out. Toasts, banners and #tooltip are out too: they are app-level chrome that can appear
114
+ over any surface, and the sibling page already themes its own.
115
+ The 3D toolbar's own .m3dmenu dropdowns are inside #m3dBar, so they are covered by it; the ONE
116
+ .m3dmenu that lives in the ⋯ menu (#m3dInsertMenu) is not, and correctly goes light with its host —
117
+ which is why the .m3dmenu rules are tokenized rather than left as dark literals.
118
+ THE TWO COLLAPSE HANDLES LOOK INCONSISTENT AND ARE NOT: a handle follows its HOST, not its position.
119
+ #m3dLegendCollapse/#m3dLegendLauncher hang off the pinned-dark legend, so they are in; #panelToggle
120
+ hangs off the light inspector rail, so it is out — each reads as part of the thing it opens, even
121
+ though both straddle the same seam. */
122
+ [data-theme="light"] #stage,[data-theme="light"] #stage3d,[data-theme="light"] #ro2d,
123
+ [data-theme="light"] #zoombar,[data-theme="light"] #connCrumb,[data-theme="light"] #bottomDock,
124
+ [data-theme="light"] #selFly,[data-theme="light"] #m3dBar,[data-theme="light"] #m3dLegend,
125
+ [data-theme="light"] #m3dLegendCollapse,[data-theme="light"] #m3dLegendLauncher,
126
+ [data-theme="light"] #propPop,[data-theme="light"] #snapMenu,[data-theme="light"] #vwRowMenu,
127
+ [data-theme="light"] #favRowMenu,[data-theme="light"] #dimEditPop,[data-theme="light"] #cmHud,
128
+ [data-theme="light"] #m3dCube,[data-theme="light"] #m3dAxes,[data-theme="light"] #plHint,
129
+ [data-theme="light"] #gridReadout,[data-theme="light"] #gridLabelEdit,[data-theme="light"] #m3dReadout,[data-theme="light"] #m3dRubber,
130
+ [data-theme="light"] #m3dDimLabels,[data-theme="light"] #m3dMemberLabels,[data-theme="light"] #m3dHoverChip,
131
+ [data-theme="light"] #m3dPropLabelHost,[data-theme="light"] #m3dSelLenLabels,
132
+ [data-theme="light"] .dimpv,
133
+ [data-theme="light"] .leg-drag-ghost,[data-theme="light"] .tekla-drag-ghost{
134
+ color-scheme:dark;
135
+ /* RE-ANCHOR THE INHERITED COLOUR, not only the tokens. Re-declaring --text fixes every rule that
136
+ READS it, and misses every element that sets no colour at all and simply inherits <body>'s — which
137
+ in light is near-black. Measured, not reasoned: the 3D legend's Objects rows (`#m3dLegend .lrow`
138
+ declares no colour) came out #0f172a on the #1e293b panel, i.e. all but invisible, while the Views
139
+ rows beside them were fine because `.vwname` happens to say `color:var(--text)`. One declaration
140
+ here re-parents the whole subtree; without it this class of hole is invisible until someone opens
141
+ that exact tab. */
142
+ color:var(--text);
143
+ --bg:#0f172a;--panel:#1e293b;--line:#334155;--text:#e2e8f0;--mut:#94a3b8;--brand:#3b82f6;
144
+ --brand-ink:#fff;--brand-hover:#2f6fe0;
145
+ --btn:#334155;--btn-hover:#475569;--ctrl-border:#475569;--field:#0f172a;--sunken:#0b1220;
146
+ --hover-soft:#33415580;--scroll:#475569;--scroll-hover:#5b6b85;
147
+ --shadow-lg:0 8px 24px rgba(0,0,0,.5);--shadow-md:0 6px 20px rgba(0,0,0,.5);
148
+ --shadow-sm:0 2px 8px rgba(0,0,0,.45);--shadow-float:0 4px 14px rgba(0,0,0,.45);
149
+ --shadow-modal:0 20px 60px rgba(0,0,0,.6);--shadow-xl:0 24px 70px rgba(0,0,0,.7);
150
+ --shadow-tip:0 8px 22px rgba(0,0,0,.5);--backdrop:rgba(2,8,23,.62);
151
+ --brand-wash:rgba(59,130,246,.16);--brand-wash-soft:rgba(59,130,246,.12);
152
+ --brand-wash-faint:rgba(59,130,246,.08);--brand-wash-strong:rgba(59,130,246,.28);
153
+ --ink-max:#fff;
154
+ --warn:#fbbf24;--warn-soft:#fcd34d;--warn-bg:#713f12;--warn-edge:#713f12;
155
+ --ok:#86efac;--ok-bg:#166534;--ok-edge:#166534;--ok-wash:rgba(22,101,52,.28);
156
+ --ok-border:#16a34a;--ok-ink:#dcfce7;--hi:#4ade80;--hi-bg:#14532d;
157
+ --err:#fca5a5;--err-bg:#7f1d1d;--err-border:#991b1b;--err-edge:#7f1d1d;--err-ink:#fecaca;
158
+ --err-wash:rgba(127,29,29,.28);--err-underline:rgba(254,202,202,.55);
159
+ --cyan:#22d3ee;--cyan-soft:rgba(34,211,238,.10);
160
+ --cyan-wash:rgba(34,211,238,.06);--cyan-edge:rgba(34,211,238,.35);
161
+ --purple:#a855f7;--purple-ink:#c4b5fd;--info-ink:#bfdbfe;
162
+ }
163
+ /* Four one-off chrome values that are NOT worth a token, re-stated for light only. Each is a single rule
164
+ whose dark value is a hair off an existing token (a scrim at .66 where every other is .62, a hairline
165
+ at #0f1a2e, a drop-shadow at 18/48 where the siblings are 20/60). Folding them into the shared tokens
166
+ would have been tidier but would have changed dark pixels, and the point of the tokenize pass is that
167
+ the STYLE BLOCK comes out byte-identical in dark, so a screenshot diff of the editor proves it (it did:
168
+ the rendered frame matched to the byte).
169
+ That claim is about these rules, and deliberately not about the whole commit: three script-built
170
+ literals outside the editor's own surface DID change, on purpose — the whole-page empty and boot-failure
171
+ states moved from #070a0f/#e7ecf3/#9aa5b6/#ef4444 onto tokens, because a page that REPLACES <body> must
172
+ follow the theme or a light user gets a black error screen. Those three are not on any screenshot the
173
+ diff covers. */
174
+ [data-theme="light"] #ciDrop.drag{background:#dbeafe}
175
+ [data-theme="light"] .ci-row{border-bottom-color:var(--line)}
176
+ [data-theme="light"] #refImportModal .mbackdrop{background:var(--backdrop)}
177
+ [data-theme="light"] #refImportModal .ripanel{box-shadow:0 18px 48px rgba(15,23,42,.16)}
5
178
  /* Theme EVERY scrollbar — no native white default may leak (applies to the canvas, panels, and every modal list). */
6
- *{scrollbar-width:thin;scrollbar-color:#475569 transparent}
179
+ *{scrollbar-width:thin;scrollbar-color:var(--scroll) transparent}
7
180
  *::-webkit-scrollbar{width:10px;height:10px}
8
181
  *::-webkit-scrollbar-track{background:transparent}
9
- *::-webkit-scrollbar-thumb{background:#475569;border-radius:6px;border:2px solid transparent;background-clip:content-box}
10
- *::-webkit-scrollbar-thumb:hover{background:#5b6b85;background-clip:content-box}
182
+ *::-webkit-scrollbar-thumb{background:var(--scroll);border-radius:6px;border:2px solid transparent;background-clip:content-box}
183
+ *::-webkit-scrollbar-thumb:hover{background:var(--scroll-hover);background-clip:content-box}
11
184
  *::-webkit-scrollbar-corner{background:transparent}
12
185
  *{box-sizing:border-box} html{width:100%;height:100%;overflow:hidden}
13
186
  body{margin:0;background:var(--bg);color:var(--text);font:13px system-ui;width:100%;max-width:100%;height:100vh;overflow:hidden;display:flex;flex-direction:column}
@@ -15,11 +188,11 @@
15
188
  header b{font-size:14px} .stat{color:var(--mut)} .stat b{color:var(--text)}
16
189
  header .tb-sep{width:1px;height:20px;background:var(--line);flex:0 0 auto;align-self:center} /* thin divider grouping the header action clusters (history | tools | AI | more) */
17
190
  #dim3dWrap{gap:8px} /* 3D Dimension cluster in the header — display flips inline-flex/none by view (applyViewState) */
18
- button{background:#334155;color:var(--text);border:1px solid #475569;border-radius:6px;padding:5px 10px;cursor:pointer;font:13px system-ui}
19
- button:hover{background:#475569} button.on{background:var(--brand);border-color:var(--brand)}
20
- button:disabled{opacity:.4;cursor:default;background:#334155}
21
- .seg-group{display:inline-flex;border:1px solid #475569;border-radius:6px;overflow:hidden}
22
- .seg-group button{border:0;border-radius:0;border-right:1px solid #475569}
191
+ button{background:var(--btn);color:var(--text);border:1px solid var(--ctrl-border);border-radius:6px;padding:5px 10px;cursor:pointer;font:13px system-ui}
192
+ button:hover{background:var(--btn-hover)} button.on{background:var(--brand);border-color:var(--brand)}
193
+ button:disabled{opacity:.4;cursor:default;background:var(--btn)}
194
+ .seg-group{display:inline-flex;border:1px solid var(--ctrl-border);border-radius:6px;overflow:hidden}
195
+ .seg-group button{border:0;border-radius:0;border-right:1px solid var(--ctrl-border)}
23
196
  .seg-group button:last-child{border-right:0}
24
197
  #m3dDimAxis button{min-width:5.2em;white-space:nowrap;text-align:center} /* UCS Stage 5: min-width holds the longest label ("World X") so relabeling X→X′→World X across frame states keeps every segment — and the group's total width — constant (no header-cluster jitter) */
25
198
  /* The read-only ribbon (unit 5, P7d). IN FLOW under the header, not in the fixed-bottom banner slot —
@@ -47,8 +220,8 @@
47
220
  .detf{display:flex;flex-direction:column;gap:2px;flex:1;min-width:0;font-size:11px;color:var(--mut)}
48
221
  .detf input{width:100%}
49
222
  /* F14 definition-points: local-frame coord row — reuses the #csStat.local cyan wash (no new colour) */
50
- .dp-local{background:rgba(34,211,238,.06);border:1px solid rgba(34,211,238,.35);border-radius:6px;padding:4px 4px 2px}
51
- .dp-local .detf span{color:#22d3ee}
223
+ .dp-local{background:var(--cyan-wash);border:1px solid var(--cyan-edge);border-radius:6px;padding:4px 4px 2px}
224
+ .dp-local .detf span{color:var(--cyan)}
52
225
  #detOpacity{flex:1;min-width:0} /* SIZING only — the theming is the global input[type=range] rule below */
53
226
  #zoombar #zPct{min-width:40px;text-align:right;color:var(--mut);font-variant-numeric:tabular-nums}
54
227
  /* Connection Component breadcrumb (Slice A) — a floating chip over the 3D canvas, same recipe as #zoombar. */
@@ -64,7 +237,7 @@
64
237
  #panelResizer::before{content:"";position:absolute;inset:0 3px;border-radius:2px;transition:background-color .12s}
65
238
  #panelResizer:hover::before,#panelResizer.drag::before{background:var(--brand)}
66
239
  #panelResizer:focus-visible{outline:none} #panelResizer:focus-visible::before{background:var(--brand)}
67
- #panelToggle{position:absolute;right:calc(var(--panelw,240px) - 14px);top:50%;transform:translateY(-50%);z-index:12;width:28px;height:42px;padding:0;display:flex;align-items:center;justify-content:center;background:var(--panel);border-color:var(--line);box-shadow:0 4px 14px rgba(0,0,0,.45);line-height:1}
240
+ #panelToggle{position:absolute;right:calc(var(--panelw,240px) - 14px);top:50%;transform:translateY(-50%);z-index:12;width:28px;height:42px;padding:0;display:flex;align-items:center;justify-content:center;background:var(--panel);border-color:var(--line);box-shadow:var(--shadow-float);line-height:1}
68
241
  #panelToggle svg,#canvasStatusToggle svg,#m3dLegendCollapse svg,#m3dLegendLauncher svg{width:16px;height:16px;display:block;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;transition:transform .15s ease}
69
242
  #panelToggle:hover{border-color:var(--brand)}
70
243
  #panelToggle::before,#m3dLegendCollapse::before,#m3dLegendLauncher::before{content:"";position:absolute;inset:-1px -8px}
@@ -76,7 +249,7 @@
76
249
  body.panel-collapsed #panelToggle{right:16px}
77
250
  body.panel-collapsed #panelToggle svg{transform:rotate(180deg)}
78
251
  aside h3{margin:0 0 8px;font-size:12px;color:var(--mut);text-transform:uppercase;letter-spacing:.05em}
79
- select,input{background:#0f172a;color:var(--text);border:1px solid #475569;border-radius:6px;padding:6px;width:100%;font:13px system-ui}
252
+ select,input{background:var(--field);color:var(--text);border:1px solid var(--ctrl-border);border-radius:6px;padding:6px;width:100%;font:13px system-ui}
80
253
  /* The two control classes the generic rule above actively BREAKS, themed globally so anything added
81
254
  later inherits the fix instead of needing its own escape hatch (CLAUDE.md "Style EVERY control").
82
255
  Radios: with no accent-color a native radio paints in the LIGHT scheme on this dark page, and
@@ -86,12 +259,14 @@
86
259
  #confTarget suppressed it per-id and the three #csF3dFields origin inputs did not, which is the
87
260
  per-container patching the scrollbar guard's history says never holds. Global, once, for both. */
88
261
  /* appearance:none, NOT accent-color. accent-color only tints the CHECKED fill; the UNCHECKED radio
89
- stays the UA widget — a solid white disc with a grey ring on this #070a0f page — and nothing here
90
- declares `color-scheme`, so nothing pushes that widget dark. Measured in Chromium at 6x before
262
+ stays the UA widget — a solid white disc with a grey ring on a dark page. (When this was written the
263
+ file declared no `color-scheme` at all; #727 added one per theme, which pushes the UA widget to the
264
+ right scheme but still does NOT tint the unchecked fill, so the conclusion below is unchanged and the
265
+ hand-built control is still the right one.) Measured in Chromium at 6x before
91
266
  picking this route. So the radio is rebuilt the way app.css:1271 already builds .modal-check's
92
267
  checkbox: own box, own ::before dot, :checked border, focus ring. */
93
268
  input[type=radio]{appearance:none;-webkit-appearance:none;width:13px;height:13px;flex:none;padding:0;
94
- border:1px solid #475569;border-radius:50%;background:#0f172a;cursor:pointer;display:inline-grid;place-content:center;
269
+ border:1px solid var(--ctrl-border);border-radius:50%;background:var(--field);cursor:pointer;display:inline-grid;place-content:center;
95
270
  transition:border-color .12s} /* the ring animates WITH the dot, as app.css:1276 .modal-check already does — without this the border-colour snaps while the dot eases, which reads as two separate events (design review) */
96
271
  input[type=radio]::before{content:'';width:7px;height:7px;border-radius:50%;background:var(--brand);transform:scale(0);transition:transform .12s ease}
97
272
  input[type=radio]:checked{border-color:var(--brand)}
@@ -108,9 +283,9 @@
108
283
  6x, every checked box painted a solid brand square with no check in it. A guard cannot catch that
109
284
  (it reads declarations, and `width:62%` is one), so the size is stated outright. */
110
285
  input[type=checkbox]{appearance:none;-webkit-appearance:none;width:14px;height:14px;flex:none;padding:0;
111
- border:1px solid #475569;border-radius:3px;background:#0f172a;cursor:pointer;display:inline-grid;place-content:center;
286
+ border:1px solid var(--ctrl-border);border-radius:3px;background:var(--field);cursor:pointer;display:inline-grid;place-content:center;
112
287
  transition:border-color .12s,background-color .12s}
113
- input[type=checkbox]::before{content:'';width:9px;height:9px;background:#fff;transform:scale(0);transition:transform .12s ease;
288
+ input[type=checkbox]::before{content:'';width:9px;height:9px;background:var(--brand-ink);transform:scale(0);transition:transform .12s ease;
114
289
  clip-path:polygon(14% 44%,0 65%,50% 100%,100% 16%,80% 0%,43% 62%)}
115
290
  input[type=checkbox]:checked{background:var(--brand);border-color:var(--brand)}
116
291
  input[type=checkbox]:checked::before{transform:scale(1)}
@@ -207,9 +382,9 @@
207
382
  }
208
383
  input[type=number]{-moz-appearance:textfield;appearance:textfield}
209
384
  input[type=number]::-webkit-outer-spin-button,input[type=number]::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}
210
- .row{margin:8px 0} .danger{background:#7f1d1d;border-color:#991b1b} .danger:hover{background:#991b1b}
385
+ .row{margin:8px 0} .danger{background:var(--err-bg);border-color:var(--err-border)} .danger:hover{background:var(--err-border)}
211
386
  .pill{display:inline-block;padding:1px 6px;border-radius:4px;font-size:11px}
212
- .pill-clickable{cursor:pointer;text-decoration:underline dotted rgba(254,202,202,.55);text-underline-offset:2px}
387
+ .pill-clickable{cursor:pointer;text-decoration:underline dotted var(--err-underline);text-underline-offset:2px}
213
388
  .pill-clickable:hover{filter:brightness(1.18)}
214
389
  .pill-clickable:focus-visible{outline:2px solid var(--brand);outline-offset:2px}
215
390
  line.member{cursor:pointer;stroke-width:6;stroke-linecap:round} /* default (drag-move OFF): a click selects → the pointer cursor tells the truth */
@@ -261,12 +436,12 @@
261
436
  rect.marquee.window{stroke-dasharray:none} /* solid = window (L→R, fully enclose) — Tekla-style affordance */
262
437
  .legend span{display:inline-flex;align-items:center;gap:4px;margin:0 8px 4px 0;white-space:nowrap}
263
438
  .sw{width:12px;height:12px;border-radius:2px;display:inline-block}
264
- .swc{width:14px;height:14px;padding:0;border:1px solid #475569;border-radius:3px;cursor:pointer;background:none;flex:none;-webkit-appearance:none;appearance:none}
439
+ .swc{width:14px;height:14px;padding:0;border:1px solid var(--ctrl-border);border-radius:3px;cursor:pointer;background:none;flex:none;-webkit-appearance:none;appearance:none}
265
440
  .swc::-webkit-color-swatch-wrapper{padding:0} .swc::-webkit-color-swatch{border:none;border-radius:2px}
266
441
  .hint{color:var(--mut);font-size:12px;line-height:1.5}
267
442
  .seg2{display:flex;border:1px solid var(--line);border-radius:6px;overflow:hidden;height:28px;margin-top:8px}
268
443
  .seg2 button{flex:1;border:0;border-radius:0;background:transparent;color:var(--mut)}
269
- .seg2 button.on{background:var(--brand);color:#fff}
444
+ .seg2 button.on{background:var(--brand);color:var(--brand-ink)}
270
445
  /* .segico = a segmented control whose buttons stack a small canonical glyph over their label (Dimension
271
446
  style). The glyph is drawn in currentColor so it tracks the button's own muted/selected state — no new
272
447
  hue — and the LABEL STAYS, so the accessible name and "Dot vs Tick" remain unambiguous. */
@@ -274,9 +449,9 @@
274
449
  .seg2.segico button{display:flex;flex-direction:column;align-items:center;gap:3px;padding:5px 2px;font-size:11px;line-height:1.2}
275
450
  .seg2.segico svg{display:block;overflow:visible}
276
451
  .mtype-field .elab{margin-top:0}
277
- .member-type-combo{height:30px;padding-right:28px;background:#0f172a linear-gradient(45deg,transparent 48%,var(--mut) 50%,transparent 52%) right 11px center/8px 8px no-repeat}
452
+ .member-type-combo{height:30px;padding-right:28px;background:var(--field) linear-gradient(45deg,transparent 48%,var(--mut) 50%,transparent 52%) right 11px center/8px 8px no-repeat}
278
453
  #comboPop.membertypes .opt{max-width:min(220px,calc(100vw - 24px));overflow:hidden;text-overflow:ellipsis}
279
- #comboPop.membertypes .opt.add{border-top:1px solid var(--line);color:#bfdbfe}
454
+ #comboPop.membertypes .opt.add{border-top:1px solid var(--line);color:var(--info-ink)}
280
455
  .sect{font-size:10px;letter-spacing:.08em;text-transform:uppercase;color:var(--mut);margin:0 0 4px}
281
456
  .f{margin-top:8px} .unit{position:relative} .unit input{padding-right:34px}
282
457
  .unit span{position:absolute;right:8px;top:50%;transform:translateY(-50%);color:var(--mut);font-size:11px;pointer-events:none}
@@ -302,7 +477,7 @@
302
477
  .defck{display:inline-flex;align-items:center;gap:4px;font-size:10px;text-transform:uppercase;letter-spacing:.05em;color:var(--mut);cursor:pointer}
303
478
  .defck input{margin:0;cursor:pointer} /* size + theming now come from the global input[type=checkbox] rule; `width:auto` had to go — on an appearance:none box it collapses the control to nothing */
304
479
  input:disabled{opacity:.55;cursor:default}
305
- .badge{display:block;background:var(--brand);color:#fff;text-align:center;font-size:11px;letter-spacing:.08em;text-transform:uppercase;padding:5px;border-radius:6px;margin-bottom:10px}
480
+ .badge{display:block;background:var(--brand);color:var(--brand-ink);text-align:center;font-size:11px;letter-spacing:.08em;text-transform:uppercase;padding:5px;border-radius:6px;margin-bottom:10px}
306
481
  .pick{color:var(--brand)!important}
307
482
  rect.lblhot{cursor:pointer;fill:rgba(251,191,36,.10);stroke:#fbbf24;stroke-width:1;stroke-dasharray:3 3;vector-effect:non-scaling-stroke}
308
483
  rect.lblhot:hover{fill:rgba(251,191,36,.28)}
@@ -327,15 +502,15 @@
327
502
  #detailsModal,#framesModal,#rfiModal,#confModal,#askAiModal,#connModal,#connImportModal,#favConnModal,#viewGenModal{position:fixed;inset:0;z-index:20;display:none;align-items:center;justify-content:center}
328
503
  #askAiDrop:hover{border-color:var(--brand);color:var(--text)} #askAiDrop.has{border-style:solid;border-color:var(--brand)}
329
504
  .aithumb{position:relative;display:inline-flex} .aithumb img{height:60px;border-radius:4px;border:1px solid var(--line);background:#fff;display:block}
330
- .aithumb button{position:absolute;top:-5px;right:-5px;width:16px;height:16px;padding:0;border-radius:8px;font-size:10px;line-height:16px;text-align:center;background:#7f1d1d;border-color:#991b1b;color:#fecaca}
331
- #saveStat.dirty{color:#fbbf24} #saveStat.ok{color:#86efac} #saveStat.err{color:#fca5a5}
505
+ .aithumb button{position:absolute;top:-5px;right:-5px;width:16px;height:16px;padding:0;border-radius:8px;font-size:10px;line-height:16px;text-align:center;background:var(--err-bg);border-color:var(--err-border);color:var(--err-ink)}
506
+ #saveStat.dirty{color:var(--warn)} #saveStat.ok{color:var(--ok)} #saveStat.err{color:var(--err)}
332
507
  /* Save conflict — someone else wrote here since we loaded. NOT the same as .err: the user's document
333
508
  is fine, so it gets the existing cyan 'non-default, click to act' chip (same recipe as #csStat.local
334
509
  and #snapStat) rather than the red failure colour. */
335
- #saveStat.conflict{color:#22d3ee;border:1px solid #22d3ee;background:rgba(34,211,238,.10);border-radius:4px;padding:1px 6px;cursor:pointer}
336
- #csStat.local{border:1px solid #22d3ee;background:rgba(34,211,238,.10);border-radius:4px;padding:1px 6px;cursor:pointer} /* lift the chip out of the muted row when a local frame/plane is active (reuses the dim/accent cyan — no new colour); clickable → reset to global */
337
- #snapStat{cursor:pointer;border:1px solid #22d3ee;background:rgba(34,211,238,.10);border-radius:4px;padding:1px 6px} /* snap-override chip — same cyan treatment as #csStat.local; the cyan IS the snap-marker colour it restricts */
338
- #snapStat:hover b{color:#fff}
510
+ #saveStat.conflict{color:var(--cyan);border:1px solid var(--cyan);background:var(--cyan-soft);border-radius:4px;padding:1px 6px;cursor:pointer}
511
+ #csStat.local{border:1px solid var(--cyan);background:var(--cyan-soft);border-radius:4px;padding:1px 6px;cursor:pointer} /* lift the chip out of the muted row when a local frame/plane is active (reuses the dim/accent cyan — no new colour); clickable → reset to global */
512
+ #snapStat{cursor:pointer;border:1px solid var(--cyan);background:var(--cyan-soft);border-radius:4px;padding:1px 6px} /* snap-override chip — same cyan treatment as #csStat.local; the cyan IS the snap-marker colour it restricts */
513
+ #snapStat:hover b{color:var(--ink-max)}
339
514
  /* UCS stage 2 — live local-coordinate row inside the 3D cursor readout chip (steel-3d-view.js builds the element). */
340
515
  .ro-coord{font-variant-numeric:tabular-nums;color:var(--mut,#94a3b8);white-space:nowrap;font-size:12px}
341
516
  .ro-coord .ro-lbl{margin-left:9px} .ro-coord .ro-lbl:first-child{margin-left:0}
@@ -354,9 +529,9 @@
354
529
  #moreMenu .msec-hdr{display:flex;align-items:center;justify-content:space-between;font-weight:600;border-top:1px solid var(--line)} /* headers read as headers: semibold + a divider between sections */
355
530
  #moreMenu #snapHdr{border-top:0} /* first section — no divider above it */
356
531
  #moreMenu .msec-hdr .chev{color:var(--mut);font-size:10px;transition:transform .15s}
357
- #moreMenu .msec-hdr[aria-expanded=true]{background:rgba(59,130,246,.08);color:var(--brand)} /* the OPEN section's header is brand-tinted so its (indented) items read as "inside" it, not merged with the next section */
532
+ #moreMenu .msec-hdr[aria-expanded=true]{background:var(--brand-wash-faint);color:var(--brand)} /* the OPEN section's header is brand-tinted so its (indented) items read as "inside" it, not merged with the next section */
358
533
  #moreMenu .msec-hdr[aria-expanded=true] .chev{transform:rotate(90deg);color:var(--brand)}
359
- #moreMenu .msec-hdr[aria-expanded=true]:hover{background:#334155;color:var(--text)} /* keep the normal hover feedback on an open header */
534
+ #moreMenu .msec-hdr[aria-expanded=true]:hover{background:var(--btn);color:var(--text)} /* keep the normal hover feedback on an open header */
360
535
  #moreMenu .msec-body{display:none} #moreMenu .msec-body.open{display:block;padding-bottom:4px}
361
536
  #moreMenu .msec-body button,#moreMenu .msec-body .mhint{padding-left:26px} /* indent items so they sit visually UNDER their header */
362
537
  /* Insert-detail now lives in the Detailing section; its picker flies out to the LEFT of the ⋯ menu (which hugs the right edge). */
@@ -376,14 +551,14 @@
376
551
  #csF3dFields input:focus{outline:none;border-color:var(--brand)}
377
552
  #moreMenu button.msnap,#moreMenu button.dtog{display:flex;align-items:center;gap:0} /* .dtog = the Display show/hide toggles, same slider switch as Snapping (.msnap) */
378
553
  #moreMenu button.msnap.on,#moreMenu button.dtog.on{color:var(--text)} /* the switch carries the state — don't also brand the text (reads as an armed tool elsewhere in this menu) */
379
- #moreMenu .mck,.cmmenu .mck,.m3dmenu .mck{position:relative;width:26px;height:14px;margin-right:9px;border-radius:7px;border:1px solid var(--line);background:#0b1220;flex:none;transition:background-color .15s,border-color .15s} /* delicate CSS-only slider switch — shared by the ⋯ Snapping rows, the Move/Copy → Drag-to-move/copy toggle, and the Work-area toggles */
554
+ #moreMenu .mck,.cmmenu .mck,.m3dmenu .mck{position:relative;width:26px;height:14px;margin-right:9px;border-radius:7px;border:1px solid var(--line);background:var(--sunken);flex:none;transition:background-color .15s,border-color .15s} /* delicate CSS-only slider switch — shared by the ⋯ Snapping rows, the Move/Copy → Drag-to-move/copy toggle, and the Work-area toggles */
380
555
  #moreMenu .mck::after,.cmmenu .mck::after,.m3dmenu .mck::after{content:'';position:absolute;top:1px;left:1px;width:10px;height:10px;border-radius:50%;background:var(--mut);transition:transform .15s,background-color .15s}
381
- #moreMenu button.msnap.on .mck,#moreMenu button.dtog.on .mck,.cmmenu #dragMoveB.on .mck,.m3dmenu button.wtog.on .mck{background:rgba(59,130,246,.28);border-color:var(--brand)}
556
+ #moreMenu button.msnap.on .mck,#moreMenu button.dtog.on .mck,.cmmenu #dragMoveB.on .mck,.m3dmenu button.wtog.on .mck{background:var(--brand-wash-strong);border-color:var(--brand)}
382
557
  #moreMenu button.msnap.on .mck::after,#moreMenu button.dtog.on .mck::after,.cmmenu #dragMoveB.on .mck::after,.m3dmenu button.wtog.on .mck::after{transform:translateX(12px);background:var(--brand)}
383
558
  #moreMenu button.dtog:disabled{opacity:.45;cursor:default} /* e.g. the grid toggle when the model has no grid */
384
559
  .m3dmenu button.wtog{display:flex;align-items:center;justify-content:flex-start;gap:0}
385
560
  .m3dmenu button.wtog.on{color:var(--text)} /* the slider carries the on-state — don't also brand the label text */
386
- #moreMenu button.msnap .sg{display:inline-block;width:17px;color:#22d3ee;opacity:.5;flex:none;transition:opacity .15s}
561
+ #moreMenu button.msnap .sg{display:inline-block;width:17px;color:var(--cyan);opacity:.5;flex:none;transition:opacity .15s}
387
562
  #moreMenu button.msnap.on .sg{opacity:1}
388
563
  /* UCS Stage 6 — origin-grid: a plain .msnap toggle (3D-only), then a Step sub-row revealed only when it's on. */
389
564
  body:not(.v3d) #snapSect [data-s3donly]{display:none} body.v3d #snapSect [data-s3donly]{display:flex} /* body:not(.v3d) adds the specificity to beat the base #moreMenu button.msnap{display:flex} rule (else the 3D-only row leaks into the 2D menu) */
@@ -436,15 +611,15 @@
436
611
  #selFly .frow.all{font-weight:600}
437
612
  #selFly .fsep{height:1px;background:var(--line);margin:4px 6px}
438
613
  #selFly .fempty{padding:6px 8px;color:var(--mut);font-size:12px}
439
- #selFly .fck{width:15px;height:15px;flex:none;border-radius:4px;border:1.5px solid #475569;background:#0f172a;display:grid;place-items:center;transition:background .12s,border-color .12s}
614
+ #selFly .fck{width:15px;height:15px;flex:none;border-radius:4px;border:1.5px solid var(--ctrl-border);background:var(--field);display:grid;place-items:center;transition:background .12s,border-color .12s}
440
615
  #selFly .fck::after{content:"";width:4px;height:8px;border:solid #fff;border-width:0 2px 2px 0;transform:rotate(45deg);margin-top:-2px;opacity:0;transition:opacity .1s}
441
616
  #selFly .frow.checked .fck{background:var(--brand);border-color:var(--brand)}
442
617
  #selFly .frow.checked .fck::after{opacity:1}
443
618
  #selFly .frow.mixed .fck{background:linear-gradient(var(--brand),var(--brand)) center/9px 2.5px no-repeat,#0f172a;border-color:var(--brand)}
444
619
  #selFly .frow.mixed .fck::after{opacity:0}
445
- #selFly .flist{max-height:230px;overflow:auto;scrollbar-width:thin;scrollbar-color:#475569 transparent}
620
+ #selFly .flist{max-height:230px;overflow:auto;scrollbar-width:thin;scrollbar-color:var(--scroll) transparent}
446
621
  #selFly .flist::-webkit-scrollbar{width:8px}
447
- #selFly .flist::-webkit-scrollbar-thumb{background:#475569;border-radius:4px}
622
+ #selFly .flist::-webkit-scrollbar-thumb{background:var(--scroll);border-radius:4px}
448
623
  #selFly .flist::-webkit-scrollbar-track{background:transparent}
449
624
  #snapBar button{width:28px;height:28px;display:grid;place-items:center;border:0;border-radius:5px;background:transparent;color:#22d3ee;opacity:.55;font-size:15px;line-height:1;cursor:pointer;padding:0;transition:background-color .12s,opacity .12s,color .12s}
450
625
  #snapBar button:hover{background:rgba(148,163,184,.12);opacity:.9}
@@ -457,7 +632,7 @@
457
632
  body:not(.v3d) #snapSect [data-snap3d]{display:none} /* specificity to beat button.msnap{display:flex} — same 2D-leak fix as [data-s3donly] above */
458
633
  body.v3d #snapSect [data-snap3d]{display:flex}
459
634
  #moreMenu .mhint{color:var(--mut);font-size:11px;line-height:1.4;padding:4px 12px 6px;max-width:230px;white-space:normal}
460
- #rfiStat{cursor:pointer;text-decoration:underline dotted} #rfiStat:hover b{color:#fff}
635
+ #rfiStat{cursor:pointer;text-decoration:underline dotted} #rfiStat:hover b{color:var(--ink-max)}
461
636
  #confStat{cursor:pointer;text-decoration:underline dotted} #confStat:hover b{filter:brightness(1.25)}
462
637
  .conf-cats{display:grid;grid-template-columns:repeat(2,1fr);gap:10px;padding:14px;border-bottom:1px solid var(--line)}
463
638
  .ccard{background:var(--bg);border:1px solid var(--line);border-radius:8px;padding:10px 12px}
@@ -471,17 +646,21 @@
471
646
  .conf-filter .glab{font-size:10px;text-transform:uppercase;letter-spacing:.06em;color:var(--mut)}
472
647
  .conf-filter .grp{display:inline-flex;border:1px solid var(--line);border-radius:6px;overflow:hidden}
473
648
  .conf-filter .grp button{border:0;border-radius:0;background:transparent;color:var(--mut);font-size:11px;padding:4px 9px;cursor:pointer}
474
- .conf-filter .grp button.on{background:var(--brand);color:#fff}
649
+ .conf-filter .grp button.on{background:var(--brand);color:var(--brand-ink)}
475
650
  .conf-body{padding:0 14px 14px;overflow:auto;flex:1;min-height:0}
476
651
  .chip{display:inline-block;padding:1px 6px;border-radius:4px;font-size:10px;border:1px solid var(--line);color:var(--mut);margin:0 3px 3px 0}
477
- .chip.assumed,.chip.weak{border-color:#713f12;color:#fbbf24} .chip.fail{border-color:#7f1d1d;color:#fca5a5}
652
+ .chip.assumed,.chip.weak{border-color:var(--warn-edge);color:var(--warn)} .chip.fail{border-color:var(--err-edge);color:var(--err)}
478
653
  /* Human-confirmed. The same #166534/#86efac pair as the confidence report's `verified` band
479
654
  (BANDPILL.verified) and the inspector's Mark-verified button — the TOKENS are shared, not the
480
655
  treatment: this one is outlined like its .chip.fail/.chip.assumed siblings, BANDPILL's is filled. */
481
- .chip.verified{border-color:#166534;color:#86efac}
482
- tr.confrow{cursor:pointer} .conf-expand{color:var(--mut);font-size:12px;line-height:1.6;background:#0b1220}
656
+ .chip.verified{border-color:var(--ok-edge);color:var(--ok)}
657
+ /* "user" = a value a human typed. Its blue holds on BOTH grounds (3.9:1 on light --panel, a clear edge
658
+ on dark --panel), so only the INK steps down; the border is one of the few values needing no twin. */
659
+ .chip.user{border-color:#1d4ed8;color:#93c5fd}
660
+ [data-theme="light"] .chip.user{color:#1d4ed8}
661
+ tr.confrow{cursor:pointer} .conf-expand{color:var(--mut);font-size:12px;line-height:1.6;background:var(--sunken)}
483
662
  .ftab td .combo{padding:4px 6px} .ftab .rea{color:var(--mut);font-size:12px} .ftab .vcell{white-space:nowrap}
484
- .ftab-inp{background:#0f172a;color:var(--text);border:1px solid #475569;border-radius:4px;padding:4px 6px;width:100%;font:13px system-ui}
663
+ .ftab-inp{background:var(--field);color:var(--text);border:1px solid var(--ctrl-border);border-radius:4px;padding:4px 6px;width:100%;font:13px system-ui}
485
664
  .ftab-inp:focus{outline:none;border-color:var(--brand)}
486
665
  .ftab .cdel{padding:3px 7px;font-size:11px} .ftab .csrc{white-space:nowrap}
487
666
  /* What a bound detail will BUILD — the line under a Connection detail field that turns a recorded
@@ -489,12 +668,12 @@
489
668
  .drow{display:flex;align-items:center;gap:6px;flex-wrap:wrap;margin:5px 0 2px}
490
669
  .dmsg{flex:1 1 100%;min-width:0;font-size:11px;line-height:1.45;color:var(--mut)}
491
670
  .dmsg b{color:var(--text);font-weight:600}
492
- .dmsg.warn{color:#fcd34d}
671
+ .dmsg.warn{color:var(--warn-soft)}
493
672
  .drow button{flex:none}
494
673
  .dnotes{margin:2px 0 0;padding:6px 8px;background:var(--bg);border:1px solid var(--line);border-radius:6px;
495
- max-height:140px;overflow:auto;scrollbar-width:thin;scrollbar-color:#475569 transparent}
674
+ max-height:140px;overflow:auto;scrollbar-width:thin;scrollbar-color:var(--scroll) transparent}
496
675
  .dnotes::-webkit-scrollbar{width:8px;height:8px}
497
- .dnotes::-webkit-scrollbar-thumb{background:#475569;border-radius:4px}
676
+ .dnotes::-webkit-scrollbar-thumb{background:var(--scroll);border-radius:4px}
498
677
  .dnotes::-webkit-scrollbar-track{background:transparent}
499
678
  .dnotes li{font-size:11px;line-height:1.5;color:var(--mut);margin:0 0 3px 14px}
500
679
  .dnotes li:last-child{margin-bottom:0}
@@ -504,14 +683,14 @@
504
683
  /* An authoring mistake the row itself can see — unreachable, not "waiting on you". Reuses the existing
505
684
  .chip.fail tones rather than introducing a colour. */
506
685
  .cbuilds .cwarn{display:inline-block;margin-left:6px;padding:0 5px;border-radius:4px;font-size:10px;
507
- border:1px solid #7f1d1d;color:#fca5a5;cursor:default}
508
- .connset{opacity:.55} .rfichip{display:inline-block;min-width:18px;height:18px;line-height:18px;text-align:center;background:#7f1d1d;color:#fecaca;border-radius:9px;font-size:11px;padding:0 5px}
686
+ border:1px solid var(--err-edge);color:var(--err);cursor:default}
687
+ .connset{opacity:.55} .rfichip{display:inline-block;min-width:18px;height:18px;line-height:18px;text-align:center;background:var(--err-bg);color:var(--err-ink);border-radius:9px;font-size:11px;padding:0 5px}
509
688
  /* #628: a human-confirmed row's number chip goes green. Colour alone is the SCAN cue only — the row also
510
689
  carries a text "✓ Verified" pill in its own column, which is what a screen reader and a colour-blind
511
690
  reader get. Same #166534/#86efac pair as .chip.verified above. */
512
- .rfichip.verified{background:#166534;color:#86efac}
513
- .mbackdrop{position:absolute;inset:0;background:rgba(2,8,23,.62)}
514
- .mpanel{position:relative;background:var(--panel);border:1px solid var(--line);border-radius:10px;width:min(880px,92vw);max-height:86vh;display:flex;flex-direction:column;box-shadow:0 20px 60px rgba(0,0,0,.6)}
691
+ .rfichip.verified{background:var(--ok-bg);color:var(--ok)}
692
+ .mbackdrop{position:absolute;inset:0;background:var(--backdrop)}
693
+ .mpanel{position:relative;background:var(--panel);border:1px solid var(--line);border-radius:10px;width:min(880px,92vw);max-height:86vh;display:flex;flex-direction:column;box-shadow:var(--shadow-modal)}
515
694
  .mhead{display:flex;align-items:center;justify-content:space-between;padding:12px 16px;border-bottom:1px solid var(--line)}
516
695
  .mhead b{font-size:14px} .mhead button{padding:2px 9px}
517
696
  .conf-tgt{display:flex;align-items:center;gap:6px;margin-left:auto;margin-right:12px;font-size:12px;color:var(--mut)}
@@ -521,34 +700,34 @@
521
700
  #confTarget{width:54px;text-align:right;padding:4px 6px;font:13px system-ui}
522
701
  .mgrid{padding:14px;overflow:auto;display:grid;grid-template-columns:repeat(auto-fill,minmax(168px,1fr));gap:12px}
523
702
  .dcard{border:1px solid var(--line);border-radius:8px;overflow:hidden;background:var(--bg)}
524
- .dcard .dprev{height:120px;display:flex;align-items:center;justify-content:center;background:#0b1220;color:var(--mut);font-size:11px;text-align:center;padding:8px;line-height:1.4}
703
+ .dcard .dprev{height:120px;display:flex;align-items:center;justify-content:center;background:var(--sunken);color:var(--mut);font-size:11px;text-align:center;padding:8px;line-height:1.4}
525
704
  .dcard img{display:block;width:100%;height:120px;object-fit:contain;background:#fff}
526
705
  .dcard .dmeta{padding:6px 9px;border-top:1px solid var(--line)}
527
706
  .dcard .dt{font-weight:600} .dcard .ds{color:var(--mut);font-size:11px}
528
707
  .ftab{width:100%;border-collapse:collapse;font-size:13px}
529
708
  .ftab th{text-align:left;color:var(--mut);font-size:11px;text-transform:uppercase;letter-spacing:.04em;padding:7px 10px;border-bottom:1px solid var(--line)}
530
709
  .ftab td{padding:7px 10px;border-bottom:1px solid var(--line);font-variant-numeric:tabular-nums}
531
- .ftab tbody tr:hover{background:#0b1220} .ftab .gcell{font-weight:600;color:var(--brand)}
532
- tr.rfi-row-focused{background:rgba(127,29,29,.28);transition:background-color .6s ease} tr.rfi-row-focused td:first-child{box-shadow:inset 3px 0 0 #fecaca}
710
+ .ftab tbody tr:hover{background:var(--sunken)} .ftab .gcell{font-weight:600;color:var(--brand)}
711
+ tr.rfi-row-focused{background:var(--err-wash);transition:background-color .6s ease} tr.rfi-row-focused td:first-child{box-shadow:inset 3px 0 0 var(--err-ink)}
533
712
  /* #628: the focus wash is the RFI danger palette, which would say "urgent" over a row whose own chip just
534
713
  said "handled". On a verified row it becomes the verified pair instead — the row is still the one you
535
714
  arrived at, without the contradiction. Two classes beat one, so this wins without !important. */
536
- tr.rfi-row-focused.rfi-verified{background:rgba(22,101,52,.28)} tr.rfi-row-focused.rfi-verified td:first-child{box-shadow:inset 3px 0 0 #86efac}
537
- #comboPop{position:fixed;z-index:30;background:var(--panel);border:1px solid #475569;border-radius:6px;max-height:240px;overflow:auto;box-shadow:0 8px 24px rgba(0,0,0,.5);display:none}
715
+ tr.rfi-row-focused.rfi-verified{background:var(--ok-wash)} tr.rfi-row-focused.rfi-verified td:first-child{box-shadow:inset 3px 0 0 var(--ok)}
716
+ #comboPop{position:fixed;z-index:30;background:var(--panel);border:1px solid var(--ctrl-border);border-radius:6px;max-height:240px;overflow:auto;box-shadow:var(--shadow-lg);display:none}
538
717
  #comboPop .opt{padding:6px 10px;cursor:pointer;font-size:13px;color:var(--text);white-space:nowrap}
539
- #comboPop .opt:hover,#comboPop .opt.active{background:#334155}
718
+ #comboPop .opt:hover,#comboPop .opt.active{background:var(--btn)}
540
719
  /* "More" overflow menu — themed popup (reuses the #comboPop look); flat rows keep each button's id + handler. */
541
720
  /* Move/Copy split buttons + transform-suite chrome — all within the locked baseline tokens. */
542
721
  .cmwrap{position:relative;display:inline-flex}
543
722
  #xfB{white-space:nowrap}
544
- #xfB.on{background:var(--brand);border-color:var(--brand);color:#fff} /* a transform tool is armed */
723
+ #xfB.on{background:var(--brand);border-color:var(--brand);color:var(--brand-ink)} /* a transform tool is armed */
545
724
  /* Drag-to-move/copy menu item wears the shared .mck slider switch (rules above, shared with ⋯ Snapping). */
546
725
  .cmmenu #dragMoveB{display:flex;align-items:center;justify-content:flex-start;gap:0}
547
726
  .cmmenu #dragMoveB.on{color:var(--text)} /* the switch carries the state — don't also brand the text (reads as an armed tool) */
548
- .cmmenu{display:none;position:absolute;left:0;top:calc(100% + 6px);min-width:200px;background:var(--panel);border:1px solid #475569;border-radius:8px;box-shadow:0 8px 24px rgba(0,0,0,.5);padding:4px 0;z-index:30}
727
+ .cmmenu{display:none;position:absolute;left:0;top:calc(100% + 6px);min-width:200px;background:var(--panel);border:1px solid var(--ctrl-border);border-radius:8px;box-shadow:var(--shadow-lg);padding:4px 0;z-index:30}
549
728
  .cmmenu.open{display:block}
550
729
  .cmmenu button{display:flex;justify-content:space-between;gap:12px;width:100%;text-align:left;background:transparent;border:0;border-radius:0;padding:7px 12px;color:var(--text);white-space:nowrap}
551
- .cmmenu button:hover{background:#334155}
730
+ .cmmenu button:hover{background:var(--btn)}
552
731
  .cmmenu .mkbd{color:var(--mut);font-size:11px}
553
732
  .cmghost{stroke-dasharray:6 4;opacity:.4;pointer-events:none;vector-effect:non-scaling-stroke;stroke-width:3}
554
733
  .cmghostbox{fill:none;stroke:#22d3ee;stroke-dasharray:4 4;opacity:.5;pointer-events:none;vector-effect:non-scaling-stroke}
@@ -579,12 +758,12 @@ text.mlentx{fill:#e2e8f0;text-anchor:middle;dominant-baseline:central;font-famil
579
758
  #lvModal .lvrow.cur{opacity:.45;cursor:default}
580
759
  #lvModal .lvrow .lvtos{margin-left:auto;color:var(--mut);font-variant-numeric:tabular-nums;font-size:12px;white-space:nowrap}
581
760
  #moreWrap{position:relative;display:inline-flex}
582
- #moreMenu{position:absolute;right:0;top:calc(100% + 6px);min-width:210px;background:var(--panel);border:1px solid #475569;border-radius:8px;box-shadow:0 8px 24px rgba(0,0,0,.5);padding:4px 0;z-index:30;display:none}
761
+ #moreMenu{position:absolute;right:0;top:calc(100% + 6px);min-width:210px;background:var(--panel);border:1px solid var(--ctrl-border);border-radius:8px;box-shadow:var(--shadow-lg);padding:4px 0;z-index:30;display:none}
583
762
  #moreMenu.open{display:block}
584
763
  #moreMenu .mlabel,.m3dmenu .mlabel,.cmmenu .mlabel{font-size:10px;letter-spacing:.08em;text-transform:uppercase;color:var(--mut);padding:8px 12px 2px}
585
764
  #moreMenu hr{border:0;border-top:1px solid var(--line);margin:4px 0}
586
765
  #moreMenu button{display:block;width:100%;text-align:left;background:transparent;border:0;border-radius:0;padding:7px 12px;color:var(--text);white-space:nowrap}
587
- #moreMenu button:hover{background:#334155}
766
+ #moreMenu button:hover{background:var(--btn)}
588
767
  /* "Revert to an earlier version…" is a POINTER into the workspaces shell's History step, so it
589
768
  exists only when we're embedded there with a project open (boot adds body.in-workspace). Hidden
590
769
  by default: Workflows mode has no version history to point at. The #moreMenu prefix is required
@@ -607,16 +786,16 @@ text.mlentx{fill:#e2e8f0;text-anchor:middle;dominant-baseline:central;font-famil
607
786
  #srcStat{white-space:nowrap}
608
787
  #srcStat b{display:inline-block;max-width:130px;overflow:hidden;text-overflow:ellipsis;vertical-align:bottom}
609
788
  #detailNewForm input#dnName{margin:2px 0 10px}
610
- #dnDrop{border:1px dashed #475569;border-radius:8px;background:#0b1220;min-height:88px;display:flex;align-items:center;justify-content:center;gap:12px;text-align:center;color:var(--mut);cursor:pointer;padding:12px;font-size:12px}
789
+ #dnDrop{border:1px dashed var(--ctrl-border);border-radius:8px;background:var(--sunken);min-height:88px;display:flex;align-items:center;justify-content:center;gap:12px;text-align:center;color:var(--mut);cursor:pointer;padding:12px;font-size:12px}
611
790
  #dnDrop:hover{border-color:var(--brand);color:var(--text)} #dnDrop.has{border-style:solid;border-color:var(--brand)}
612
791
  #dnPrev{display:none;max-height:64px;max-width:128px;border-radius:4px;background:#fff;border:1px solid var(--line)}
613
792
  #dnBtns{display:flex;gap:8px;justify-content:flex-end;margin-top:10px} #dnBtns button{padding:6px 14px}
614
793
  #dnHint{margin-top:8px}
615
794
  .dprevwrap{height:120px} .dprevwrap[data-det]{cursor:zoom-in} .dcard:hover .dprevwrap[data-det]{filter:brightness(1.04)}
616
- .dname{width:100%;background:#0f172a;border:1px solid #475569;border-radius:4px;padding:3px 6px;font-weight:600;font-size:12px;color:var(--text)}
617
- .dname:focus{outline:none;border-color:var(--brand)} .dmeta .ds .ddel{color:#fca5a5;text-decoration:underline}
795
+ .dname{width:100%;background:var(--field);border:1px solid var(--ctrl-border);border-radius:4px;padding:3px 6px;font-weight:600;font-size:12px;color:var(--text)}
796
+ .dname:focus{outline:none;border-color:var(--brand)} .dmeta .ds .ddel{color:var(--err);text-decoration:underline}
618
797
  #lightbox{position:fixed;inset:0;z-index:40;display:none;align-items:center;justify-content:center}
619
- .lbpanel{position:relative;background:var(--panel);border:1px solid var(--line);border-radius:10px;display:flex;flex-direction:column;box-shadow:0 24px 70px rgba(0,0,0,.7)}
798
+ .lbpanel{position:relative;background:var(--panel);border:1px solid var(--line);border-radius:10px;display:flex;flex-direction:column;box-shadow:var(--shadow-xl)}
620
799
  #lbView{position:relative;overflow:hidden;background:#fff;width:88vw;height:82vh;cursor:grab;touch-action:none}
621
800
  #lbView.drag{cursor:grabbing}
622
801
  #lbImg{position:absolute;left:50%;top:50%;max-width:86vw;max-height:80vh;transform-origin:center;user-select:none;-webkit-user-drag:none}
@@ -648,11 +827,11 @@ text.mlentx{fill:#e2e8f0;text-anchor:middle;dominant-baseline:central;font-famil
648
827
  /* the dim inspector's "Pinned to member" slider — same .mck switch as the ⋯ Display rows, panel-scoped */
649
828
  #panel button.pintog{display:flex;align-items:center;background:transparent;border:none;color:var(--mut);cursor:pointer;padding:2px 0;font:12px system-ui;gap:0;text-align:left}
650
829
  #panel button.pintog.on{color:var(--text)}
651
- #panel .pintog .mck{position:relative;width:26px;height:14px;margin-right:9px;border-radius:7px;border:1px solid var(--line);background:#0b1220;flex:none;transition:background-color .15s,border-color .15s}
830
+ #panel .pintog .mck{position:relative;width:26px;height:14px;margin-right:9px;border-radius:7px;border:1px solid var(--line);background:var(--sunken);flex:none;transition:background-color .15s,border-color .15s}
652
831
  #panel .pintog .mck::after{content:'';position:absolute;top:1px;left:1px;width:10px;height:10px;border-radius:50%;background:var(--mut);transition:transform .15s,background-color .15s}
653
- #panel .pintog.on .mck{background:rgba(59,130,246,.28);border-color:var(--brand)}
832
+ #panel .pintog.on .mck{background:var(--brand-wash-strong);border-color:var(--brand)}
654
833
  #panel .pintog.on .mck::after{transform:translateX(12px);background:var(--brand)}
655
- #panel .pintog svg{margin-right:4px;color:#22d3ee;flex:none} /* the pin glyph carries the dim accent, matching the on-canvas markers */
834
+ #panel .pintog svg{margin-right:4px;color:var(--cyan);flex:none} /* the pin glyph carries the dim accent, matching the on-canvas markers */
656
835
  #panel .pintog:focus-visible{outline:2px solid var(--brand);outline-offset:2px}
657
836
  /* ── The drilled-into reference object (S2 Stage A): somebody else's IFC element, read-only.
658
837
  Property SETS are accordions because one object can carry several of them and a dozen-plus rows each
@@ -670,7 +849,7 @@ text.mlentx{fill:#e2e8f0;text-anchor:middle;dominant-baseline:central;font-famil
670
849
  border, a chevron that never turned and a count that was not muted. Same markup, same look, both
671
850
  places. */
672
851
  #panel .psethd,#m3dRefsBody .psethd{display:flex;align-items:center;gap:6px;width:100%;background:transparent;border:0;border-radius:0;box-shadow:none;color:var(--text);font:600 11px system-ui;padding:5px 2px;cursor:pointer;text-align:left}
673
- #panel .psethd:hover,#m3dRefsBody .psethd:hover{color:var(--text);background:#33415580}
852
+ #panel .psethd:hover,#m3dRefsBody .psethd:hover{color:var(--text);background:var(--hover-soft)}
674
853
  #panel .psethd[aria-expanded=true],#m3dRefsBody .psethd[aria-expanded=true]{color:var(--brand)}
675
854
  #panel .psethd:focus-visible,#m3dRefsBody .psethd:focus-visible{outline:2px solid var(--brand);outline-offset:-2px}
676
855
  #panel .psethd .chev,#m3dRefsBody .psethd .chev{color:var(--mut);font-size:10px;width:10px;flex:none;transition:transform .15s}
@@ -716,10 +895,10 @@ text.mlentx{fill:#e2e8f0;text-anchor:middle;dominant-baseline:central;font-famil
716
895
  text.gridtx{fill:#e2e8f0;font-weight:700;font-family:system-ui;text-anchor:middle;dominant-baseline:central;pointer-events:none}
717
896
  g.gridbubg:hover circle.gridbub{stroke:var(--brand);fill:#1e293b}
718
897
  body.gridpick #svg,body.gridpick line.member,body.gridpick line.seg,body.gridpick image{cursor:crosshair}
719
- .gin{width:100%;background:#0f172a;border:1px solid #475569;border-radius:6px;padding:6px 8px;color:var(--text);font:12px ui-monospace,Consolas,monospace}
898
+ .gin{width:100%;background:var(--field);border:1px solid var(--ctrl-border);border-radius:6px;padding:6px 8px;color:var(--text);font:12px ui-monospace,Consolas,monospace}
720
899
  .gin:focus{outline:none;border-color:var(--brand)}
721
900
  .gfb{color:var(--mut);font-size:11px;margin-top:3px;font-variant-numeric:tabular-nums}
722
- .gerr{color:#fca5a5;font-size:11px;margin-top:3px}
901
+ .gerr{color:var(--err);font-size:11px;margin-top:3px}
723
902
  .gbtns{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px} .gbtns button{margin:0}
724
903
  .gck{display:flex;align-items:center;gap:8px;color:var(--text);cursor:pointer;font-size:12px;padding:2px 0}
725
904
  .gck input{cursor:pointer;margin:0;width:14px;height:14px;flex:none} /* beat the panel's generic full-width input rule */
@@ -730,14 +909,14 @@ text.mlentx{fill:#e2e8f0;text-anchor:middle;dominant-baseline:central;font-famil
730
909
  #vgContext{padding:10px 14px;color:var(--mut);font-size:12px;border-bottom:1px solid var(--line)}
731
910
  #vgTabs{display:flex;gap:4px;padding:10px 14px 0}
732
911
  #vgTabs button{border:0;border-radius:5px;background:transparent;color:var(--mut);padding:6px 10px;box-shadow:none}
733
- #vgTabs button[aria-selected=true]{background:rgba(59,130,246,.16);color:var(--text);box-shadow:inset 0 -2px 0 var(--brand)}
912
+ #vgTabs button[aria-selected=true]{background:var(--brand-wash);color:var(--text);box-shadow:inset 0 -2px 0 var(--brand)}
734
913
  #vgTools{display:flex;align-items:center;gap:8px;padding:8px 14px}
735
914
  #vgTools button{padding:4px 8px;background:transparent;box-shadow:none}
736
915
  #vgCount{margin-left:auto;color:var(--mut);font-size:11px;font-variant-numeric:tabular-nums}
737
916
  #vgList{margin:0 14px;min-height:120px;max-height:260px;overflow:auto;border:1px solid var(--line);border-radius:7px;background:var(--bg);padding:5px}
738
917
  #vgList .vggroup{padding:5px 7px 3px;color:var(--mut);font-size:10px;text-transform:uppercase;letter-spacing:.07em}
739
918
  #vgList .vgrow{display:flex;align-items:center;gap:9px;padding:6px 8px;border-radius:5px;cursor:pointer}
740
- #vgList .vgrow:hover{background:#33415580}
919
+ #vgList .vgrow:hover{background:var(--hover-soft)}
741
920
  #vgList .vgrow input{width:14px;height:14px;margin:0;flex:none}
742
921
  #vgList .vgaxis{width:18px;color:var(--mut);font-size:10px;font-weight:700}
743
922
  #vgList .vgname{color:var(--text);font-size:12px}
@@ -746,12 +925,12 @@ text.mlentx{fill:#e2e8f0;text-anchor:middle;dominant-baseline:central;font-famil
746
925
  #vgSettings .vgfield label{display:block;color:var(--mut);font-size:10px;text-transform:uppercase;letter-spacing:.06em;margin-bottom:3px}
747
926
  #vgSettings input{width:100%;height:30px;background:var(--bg);color:var(--text);border:1px solid var(--line);border-radius:6px;padding:0 8px;font:12px ui-monospace,Consolas,monospace}
748
927
  #vgSettings input:focus{outline:none;border-color:var(--brand)}
749
- #vgSettings input[aria-invalid=true]{border-color:#fca5a5}
928
+ #vgSettings input[aria-invalid=true]{border-color:var(--err)}
750
929
  #vgDirection{grid-column:1/-1;display:flex;align-items:center;gap:10px}
751
930
  #vgDirection .grp{display:inline-flex;border:1px solid var(--line);border-radius:6px;overflow:hidden}
752
931
  #vgDirection .grp button{border:0;border-radius:0;background:transparent;color:var(--mut);padding:5px 10px;box-shadow:none}
753
- #vgDirection .grp button.on{background:var(--brand);color:#fff}
754
- #vgError{grid-column:1/-1;min-height:15px;color:#fca5a5;font-size:11px}
932
+ #vgDirection .grp button.on{background:var(--brand);color:var(--brand-ink)}
933
+ #vgError{grid-column:1/-1;min-height:15px;color:var(--err);font-size:11px}
755
934
  #vgFoot{display:flex;align-items:center;justify-content:flex-end;gap:8px;padding:10px 14px;border-top:1px solid var(--line)}
756
935
  #vgCreate:disabled{opacity:.45;cursor:default}
757
936
  body.dimsplit #svg,body.dimsplit line.member,body.dimsplit line.seg,body.dimsplit line.dim,body.dimsplit line.dimwit,body.dimsplit image{cursor:crosshair} /* whole-canvas crosshair while the split/extend tool is armed — you can click anywhere, not just on a line (B8) */
@@ -763,8 +942,8 @@ text.mlentx{fill:#e2e8f0;text-anchor:middle;dominant-baseline:central;font-famil
763
942
  body.geo line.seg:hover{stroke:#22d3ee;opacity:1;stroke-width:4} body.geo line.member:hover{stroke-width:8} body.geoel line.gridhit:hover{stroke:#22d3ee;opacity:.55} /* target cue on the coincident transparent hit line — colour only, KEEP its 9px width (shrinking it would shrink the pointer-events:stroke hit area and flicker the hover) */
764
943
  circle.numbg{fill:var(--brand);stroke:#fff;stroke-width:1.5;vector-effect:non-scaling-stroke;pointer-events:none}
765
944
  text.numtx{fill:#fff;font:bold 12px system-ui;text-anchor:middle;dominant-baseline:central;pointer-events:none}
766
- #dupStat.has b{color:#fca5a5} #dupB.alert{background:#7f1d1d;border-color:#991b1b} #dupB.alert:hover{background:#991b1b}
767
- #dupB.ok,#revB.ok{background:#166534;border-color:#16a34a;color:#dcfce7}
945
+ #dupStat.has b{color:var(--err)} #dupB.alert{background:var(--err-bg);border-color:var(--err-border)} #dupB.alert:hover{background:var(--err-border)}
946
+ #dupB.ok,#revB.ok{background:var(--ok-bg);border-color:var(--ok-border);color:var(--ok-ink)}
768
947
  /* Plan switcher — a themed combobox, NOT a native <select>.
769
948
  A <select>'s CLOSED state takes styling fine; its arrow and its option list do not. Those are drawn
770
949
  by the OS, so they come up as a light panel against this dark theme no matter what the rule says —
@@ -787,7 +966,7 @@ text.mlentx{fill:#e2e8f0;text-anchor:middle;dominant-baseline:central;font-famil
787
966
  but it is stated rather than assumed: `appearance: auto` on this control is the exact signature the
788
967
  QA pass matched on when it caught the <select>, and leaving it reading `auto` would have the next
789
968
  such pass re-raise a defect that is gone. */
790
- .plan-trigger{display:inline-flex;align-items:center;gap:6px;min-width:210px;max-width:320px;-webkit-appearance:none;appearance:none;background:var(--bg);border:1px solid #475569;border-radius:6px;padding:5px 8px;font:600 13px system-ui}
969
+ .plan-trigger{display:inline-flex;align-items:center;gap:6px;min-width:210px;max-width:320px;-webkit-appearance:none;appearance:none;background:var(--bg);border:1px solid var(--ctrl-border);border-radius:6px;padding:5px 8px;font:600 13px system-ui}
791
970
  /* Load-bearing, not decorative: the page's generic `button:hover{background:#475569}` would otherwise
792
971
  win on hover and flash the grey ACTION-button chrome onto a control that is a field you pick from.
793
972
  (Class beats tag, so this rule wins wherever it is declared.) */
@@ -796,7 +975,7 @@ text.mlentx{fill:#e2e8f0;text-anchor:middle;dominant-baseline:central;font-famil
796
975
  .plan-caret{color:var(--mut);flex:none;transition:transform .15s}
797
976
  .plan-trigger.open .plan-caret{transform:rotate(180deg)}
798
977
  /* Panel matched to #moreMenu/.cmmenu — the other dropdowns hanging off this same header row. */
799
- .plan-popover{position:absolute;top:calc(100% + 6px);left:0;min-width:100%;width:max-content;max-width:400px;background:var(--panel);border:1px solid #475569;border-radius:8px;box-shadow:0 8px 24px rgba(0,0,0,.5);padding:4px 0;z-index:30}
978
+ .plan-popover{position:absolute;top:calc(100% + 6px);left:0;min-width:100%;width:max-content;max-width:400px;background:var(--panel);border:1px solid var(--ctrl-border);border-radius:8px;box-shadow:var(--shadow-lg);padding:4px 0;z-index:30}
800
979
  /* This page has no global [hidden] rule, so an author `display` on a hidden element wins by ORIGIN over
801
980
  the UA's own [hidden] and `planPopover.hidden = true` would quietly do nothing. .plan-popover declares
802
981
  no `display` TODAY, so this is redundant right now — it stays as insurance, because the moment anyone
@@ -808,7 +987,7 @@ text.mlentx{fill:#e2e8f0;text-anchor:middle;dominant-baseline:central;font-famil
808
987
  it needs its own cursor/font rather than inheriting the page's button rules. The transparent
809
988
  border-left is what stops the selected row's accent shifting its text by 2px. */
810
989
  .plan-option{display:block;width:100%;cursor:pointer;background:transparent;border:none;border-left:2px solid transparent;padding:7px 12px;text-align:left;font:13px system-ui;color:var(--text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
811
- .plan-option:hover,.plan-option.active{background:#334155} /* .active = the keyboard highlight, the name #comboPop already uses for it on this page */
990
+ .plan-option:hover,.plan-option.active{background:var(--btn)} /* .active = the keyboard highlight, the name #comboPop already uses for it on this page */
812
991
  /* Left-border accent for the current plan — the shared .wf-option.selected convention, not a tick glyph:
813
992
  this page already spends ✓ on .m3dmenu's mode toggles, and blurring "pick one value" with "toggle a
814
993
  mode" is worse than keeping the two apart. */
@@ -828,6 +1007,17 @@ text.mlentx{fill:#e2e8f0;text-anchor:middle;dominant-baseline:central;font-famil
828
1007
  circle.handle.ep-start{fill:#facc15;stroke:#0b1220;stroke-width:2}
829
1008
  circle.handle.ep-end{fill:#f472b6;stroke:#0b1220;stroke-width:2}
830
1009
  .epdot{display:inline-block;width:8px;height:8px;border-radius:50%;margin-right:5px;vertical-align:middle}
1010
+ /* On dark this swatch carries its own contrast; on light the pale end of the drawing palette does not
1011
+ — #facc15 measures 1.40:1 on --panel and #f472b6 2.42:1, both under the 3:1 a non-text cue needs, so
1012
+ the dot that TELLS you which end you are editing stops being findable. The fill is the legend and
1013
+ must keep naming the on-canvas colour exactly, so the RING is what carries the contrast instead.
1014
+ --mut (7.25:1 on --panel), NOT --ctrl-border: the first cut used the control border and a second
1015
+ review measured it at 2.34:1 — still short of the 3:1 this rule exists to reach, which is the whole
1016
+ reason a "give it a border" fix is worth measuring rather than eyeballing.
1017
+ Light-only: dark keeps the borderless dot it has always had. (Codex review on #727.)
1018
+ The sibling swatch `.swc` needs nothing — being an <input type=color> it already carries a
1019
+ 1px border of its own. */
1020
+ [data-theme="light"] .epdot{box-shadow:0 0 0 1px var(--mut)}
831
1021
  /* 3D-only floating chrome (parity with AWARE viewer-3d): toolbar TL, legend BL, ViewCube BR */
832
1022
  #m3dBar{position:absolute;top:12px;left:12px;right:12px;display:none;flex-wrap:wrap;gap:6px;align-items:center;z-index:59} /* bounded to the stage so narrow windows wrap this local toolbar instead of widening the whole document; above the model-glued label chips (z:3-4, under the 3D chrome — #614), below toasts (60) */
833
1023
  #m3dBar .seg-group,#m3dBar>button{box-shadow:0 4px 14px rgba(0,0,0,.45)}
@@ -835,22 +1025,26 @@ text.mlentx{fill:#e2e8f0;text-anchor:middle;dominant-baseline:central;font-famil
835
1025
  #m3dBar .m3dwrap{position:relative;display:inline-flex}
836
1026
  #m3dBar .m3dwrap>button{font-size:12px;padding:5px 9px;box-shadow:0 4px 14px rgba(0,0,0,.45)}
837
1027
  #m3dModeBtn{min-width:8.2em;text-align:center} /* same reason as #m3dDimAxis above: reflectMode() rewrites this label live, and "Realistic ▾" is far wider than "Solid ▾" — without a min-width every mode switch shoves Isolate/Views/Clip sideways. Scoped to this button; the sibling dropdowns have no such label variance. */
838
- .m3dmenu{position:absolute;left:0;top:calc(100% + 6px);min-width:172px;background:var(--panel);border:1px solid #475569;border-radius:8px;box-shadow:0 8px 24px rgba(0,0,0,.5);padding:4px 0;z-index:30;display:none}
1028
+ /* TOKENIZED even though every .m3dmenu but one hangs off the pinned-dark 3D toolbar: #m3dInsertMenu
1029
+ lives inside the ⋯ menu, which is light chrome, so on light its rows hovered to #334155 — 1.73:1,
1030
+ i.e. unreadable exactly while you point at them. Inside the island these tokens resolve dark, so the
1031
+ toolbar's own menus are unchanged. (Review on #727.) */
1032
+ .m3dmenu{position:absolute;left:0;top:calc(100% + 6px);min-width:172px;background:var(--panel);border:1px solid var(--ctrl-border);border-radius:8px;box-shadow:var(--shadow-lg);padding:4px 0;z-index:30;display:none}
839
1033
  .m3dmenu.open{display:block}
840
1034
  .m3dmenu button{display:block;width:100%;text-align:left;background:transparent;border:0;border-radius:0;padding:7px 12px;color:var(--text);white-space:nowrap;font-size:12px;box-shadow:none}
841
- .m3dmenu button:hover{background:#334155}
1035
+ .m3dmenu button:hover{background:var(--btn)}
842
1036
  .m3dmenu button.on{color:var(--brand)} /* active choice in a radio-style menu (Camera / Display) */
843
1037
  .m3dmenu button.on:not(.wtog)::after{content:'✓';float:right;margin-left:16px;color:var(--brand)} /* radio-style tick for Camera/Display choices — NOT the .wtog slider toggles (their .mck knob carries state) */
844
1038
  .m3dmenu button:disabled{opacity:.4;cursor:default;background:transparent}
845
- .m3dmenu button.mdanger{color:#fca5a5} .m3dmenu button.mdanger:hover{background:#7f1d1d;color:#fecaca}
1039
+ .m3dmenu button.mdanger{color:var(--err)} .m3dmenu button.mdanger:hover{background:var(--err-bg);color:var(--err-ink)}
846
1040
  .m3dmenu hr{border:0;border-top:1px solid var(--line);margin:4px 0}
847
1041
  .m3dmenu label{display:flex;align-items:center;gap:7px;padding:7px 12px;color:var(--text);font-size:12px;cursor:pointer;white-space:nowrap}
848
- .m3dmenu label:hover{background:#334155}
1042
+ .m3dmenu label:hover{background:var(--btn)}
849
1043
  .m3dmenu label input{margin:0;cursor:pointer} /* the global input[type=checkbox] rule now sets the box size, so this no longer inherits input{width:100%} and no longer needs `width:auto` — which on an appearance:none box would collapse it (View / Plane / Work toggles) */
850
1044
  .m3dmenu .m3d-actions{display:flex;gap:6px;padding:4px 8px}
851
- .m3dmenu .m3d-actions button{flex:1;width:auto;text-align:center;padding:5px 9px;border:1px solid #475569;border-radius:6px;background:#334155}
852
- .m3dmenu .m3d-actions button:hover{background:#475569}
853
- .m3dmenu .m3d-actions button.mprimary{background:var(--brand);border-color:var(--brand);color:#fff}
1045
+ .m3dmenu .m3d-actions button{flex:1;width:auto;text-align:center;padding:5px 9px;border:1px solid var(--ctrl-border);border-radius:6px;background:var(--btn)}
1046
+ .m3dmenu .m3d-actions button:hover{background:var(--btn-hover)}
1047
+ .m3dmenu .m3d-actions button.mprimary{background:var(--brand);border-color:var(--brand);color:var(--brand-ink)}
854
1048
  .m3dmenu .m3d-actions button.mprimary:hover{background:var(--brand)}
855
1049
  .m3dmenu .wpprow{display:flex;gap:4px;align-items:center;padding:4px 12px}
856
1050
  .m3dmenu .wpprow button{width:auto;flex:none;padding:4px 8px;border:1px solid var(--line);border-radius:5px}
@@ -903,7 +1097,7 @@ text.mlentx{fill:#e2e8f0;text-anchor:middle;dominant-baseline:central;font-famil
903
1097
  #connImportModal .mpanel{width:min(560px,92vw)}
904
1098
  #connImportModal.pick .mpanel{width:min(720px,92vw)}
905
1099
  #ciBody{padding:16px;display:flex;flex-direction:column;gap:10px;overflow:auto;max-height:76vh}
906
- #ciDrop{border:1px dashed #475569;border-radius:8px;background:#0b1220;min-height:104px;display:flex;align-items:center;justify-content:center;text-align:center;color:var(--mut);cursor:pointer;padding:16px;font-size:12px}
1100
+ #ciDrop{border:1px dashed var(--ctrl-border);border-radius:8px;background:var(--sunken);min-height:104px;display:flex;align-items:center;justify-content:center;text-align:center;color:var(--mut);cursor:pointer;padding:16px;font-size:12px}
907
1101
  #ciDrop:hover{border-color:var(--brand);color:var(--text)}
908
1102
  #ciDrop.drag{border-style:solid;border-color:var(--brand);color:var(--text);background:#0d1526}
909
1103
  .ci-prog{display:flex;align-items:center;gap:10px;padding:22px 4px;color:var(--text);font-size:13px}
@@ -915,8 +1109,8 @@ text.mlentx{fill:#e2e8f0;text-anchor:middle;dominant-baseline:central;font-famil
915
1109
  #ciList{overflow:auto;max-height:min(52vh,360px);border:1px solid var(--line);border-radius:8px}
916
1110
  .ci-row{display:flex;align-items:center;gap:10px;min-height:34px;padding:6px 12px;cursor:pointer;border:0;border-bottom:1px solid #0f1a2e;background:transparent;text-align:left;width:100%;box-sizing:border-box}
917
1111
  .ci-row:last-child{border-bottom:0}
918
- .ci-row:hover{background:#1e293b}
919
- .ci-row.sel{background:rgba(59,130,246,.16);border-left:2px solid var(--brand);padding-left:10px}
1112
+ .ci-row:hover{background:var(--panel)}
1113
+ .ci-row.sel{background:var(--brand-wash);border-left:2px solid var(--brand);padding-left:10px}
920
1114
  .ci-row .pn{flex:1;color:var(--text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:12px}
921
1115
  .ci-row .pv{color:var(--mut);font-size:11px;font-variant-numeric:tabular-nums;white-space:nowrap;flex:none}
922
1116
  .ci-empty{color:var(--mut);font-size:12px;padding:16px;text-align:center}
@@ -924,7 +1118,7 @@ text.mlentx{fill:#e2e8f0;text-anchor:middle;dominant-baseline:central;font-famil
924
1118
  /* thin cluster divider in the 3D toolbar */
925
1119
  #m3dBar .tb-sep{width:1px;height:18px;background:var(--line);flex:0 0 auto;align-self:center}
926
1120
  /* Themed tooltip — replaces native title= so no OS-default tooltip leaks the dark theme. */
927
- #tooltip{position:fixed;z-index:80;background:var(--panel);border:1px solid var(--line);border-radius:6px;padding:5px 8px;font-size:11.5px;line-height:1.35;color:var(--text);pointer-events:none;max-width:260px;box-shadow:0 8px 22px rgba(0,0,0,.5);opacity:0;transition:opacity .12s}
1121
+ #tooltip{position:fixed;z-index:80;background:var(--panel);border:1px solid var(--line);border-radius:6px;padding:5px 8px;font-size:11.5px;line-height:1.35;color:var(--text);pointer-events:none;max-width:260px;box-shadow:var(--shadow-tip);opacity:0;transition:opacity .12s}
928
1122
  #tooltip.show{opacity:1}
929
1123
  #m3dLegend .lrow .lx{margin-left:auto;color:var(--mut);padding:0 3px;border-radius:4px;visibility:hidden;font-size:13px;line-height:1}
930
1124
  #m3dLegend .lrow:hover .lx{visibility:visible}
@@ -1001,9 +1195,9 @@ text.mlentx{fill:#e2e8f0;text-anchor:middle;dominant-baseline:central;font-famil
1001
1195
  track); no new token enters the baseline. */
1002
1196
  #m3dRefsBody .refdet .dmeas{border:1px solid var(--line);border-radius:6px;background:#0b1220;padding:6px;display:flex;flex-direction:column;gap:6px}
1003
1197
  #m3dRefsBody .refdet .lockrow{display:flex;align-items:center;gap:0;color:var(--text);font-size:11px;background:transparent;border:0;padding:2px 0;cursor:pointer;box-shadow:none}
1004
- #m3dRefsBody .refdet .lockrow .mck{position:relative;width:26px;height:14px;margin-right:9px;border-radius:7px;border:1px solid var(--line);background:#0b1220;flex:none;transition:background-color .15s,border-color .15s}
1198
+ #m3dRefsBody .refdet .lockrow .mck{position:relative;width:26px;height:14px;margin-right:9px;border-radius:7px;border:1px solid var(--line);background:var(--sunken);flex:none;transition:background-color .15s,border-color .15s}
1005
1199
  #m3dRefsBody .refdet .lockrow .mck::after{content:'';position:absolute;top:1px;left:1px;width:10px;height:10px;border-radius:50%;background:#64748b;transition:transform .15s,background-color .15s}
1006
- #m3dRefsBody .refdet .lockrow.on .mck{background:rgba(59,130,246,.28);border-color:var(--brand)}
1200
+ #m3dRefsBody .refdet .lockrow.on .mck{background:var(--brand-wash-strong);border-color:var(--brand)}
1007
1201
  #m3dRefsBody .refdet .lockrow.on .mck::after{transform:translateX(12px);background:var(--brand)}
1008
1202
  /* ── Reference colour: File / Grey / your own.
1009
1203
  THE SWATCH IS THE THIRD SEGMENT, not a control beside one. Picking a colour and choosing "custom"
@@ -1059,16 +1253,16 @@ text.mlentx{fill:#e2e8f0;text-anchor:middle;dominant-baseline:central;font-famil
1059
1253
  #refImportModal .mhead{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:12px 14px;border-bottom:1px solid var(--line)}
1060
1254
  #refImportModal .ribody{padding:14px;overflow:auto;min-height:0}
1061
1255
  #refImportModal .rifoot{display:flex;justify-content:flex-end;gap:8px;padding:10px 14px;border-top:1px solid var(--line)}
1062
- #riDrop{border:1px dashed #475569;border-radius:8px;padding:26px 14px;text-align:center;color:var(--mut);font-size:12px;line-height:1.6;cursor:pointer}
1256
+ #riDrop{border:1px dashed var(--ctrl-border);border-radius:8px;padding:26px 14px;text-align:center;color:var(--mut);font-size:12px;line-height:1.6;cursor:pointer}
1063
1257
  #riDrop:hover,#riDrop.drag{border-color:var(--brand);color:var(--text);background:rgba(59,130,246,.07)}
1064
- #riDropErr{display:none;margin-top:8px;color:#fca5a5;font-size:11.5px;line-height:1.5}
1258
+ #riDropErr{display:none;margin-top:8px;color:var(--err);font-size:11.5px;line-height:1.5}
1065
1259
  #riProgTxt{color:var(--mut);font-size:12px;line-height:1.6;text-align:center;padding:22px 6px}
1066
1260
  #refImportModal .rirow{display:flex;align-items:baseline;justify-content:space-between;gap:12px;padding:3px 0;font-size:12px}
1067
1261
  #refImportModal .rirow .pn{color:var(--mut)}
1068
1262
  #refImportModal .rirow .pv{color:var(--text);font-variant-numeric:tabular-nums}
1069
1263
  #riSays{margin:2px 0 10px;font-size:12.5px;color:var(--text);line-height:1.6}
1070
1264
  #riSays b{color:var(--mut);font-weight:600}
1071
- #riVerdict{display:none;margin-top:10px;padding:8px 10px;border:1px solid #713f12;border-radius:7px;color:#fbbf24;font-size:11.5px;line-height:1.55}
1265
+ #riVerdict{display:none;margin-top:10px;padding:8px 10px;border:1px solid var(--warn-edge);border-radius:7px;color:var(--warn);font-size:11.5px;line-height:1.55}
1072
1266
  #riVerdict button{margin-top:7px}
1073
1267
  /* ── The storey / type picker (S2 Stage C) — load ONE FLOOR of a building you cannot afford whole.
1074
1268
  A section INSIDE the confirm stage rather than a fourth stage: that stage already means "here are
@@ -1083,7 +1277,7 @@ text.mlentx{fill:#e2e8f0;text-anchor:middle;dominant-baseline:central;font-famil
1083
1277
  #riPickToggle{margin-top:10px}
1084
1278
  #refImportModal .reftree{max-height:168px;overflow:auto;border:1px solid var(--line);border-radius:7px;background:var(--bg);padding:3px 2px;margin-bottom:8px}
1085
1279
  #refImportModal .ripick-row{display:flex;align-items:center;gap:6px;padding:2px 4px;border-radius:5px;font-size:11.5px;color:var(--text);cursor:pointer;user-select:none}
1086
- #refImportModal .ripick-row:hover{background:#33415580}
1280
+ #refImportModal .ripick-row:hover{background:var(--hover-soft)}
1087
1281
  #refImportModal .ripick-row .rpname{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis}
1088
1282
  #refImportModal .ripick-row .rpcount{flex:none;color:var(--mut);font-variant-numeric:tabular-nums;font-size:10px}
1089
1283
  /* The storey-less row. NOT a disabled checkbox — a disabled control says "you may not do this yet",
@@ -1095,14 +1289,14 @@ text.mlentx{fill:#e2e8f0;text-anchor:middle;dominant-baseline:central;font-famil
1095
1289
  #riPickNote,#riNoBreak{color:var(--mut);font-size:11px;line-height:1.5;margin:8px 0}
1096
1290
  /* The live count's two loud states, in the tokens this file already uses — #riVerdict's amber and
1097
1291
  #riDropErr's red. No new colour is introduced by this feature. */
1098
- #riConfirmErr{display:none;margin-top:10px;color:#fca5a5;font-size:11.5px;line-height:1.5}
1292
+ #riConfirmErr{display:none;margin-top:10px;color:var(--err);font-size:11.5px;line-height:1.5}
1099
1293
  /* Two ids, deliberately: `#riElements.warn` alone is specificity (1,1,0) and loses to
1100
1294
  `#refImportModal .rirow .pv` (1,2,0) above, so the colour was authored and never rendered. An
1101
1295
  independent QA pass found it by reading the computed colour — asserting the class name, which
1102
1296
  is what this session's own E2E did, passes with the pixel still wrong. */
1103
- #refImportModal #riElements.warn{color:#fbbf24} #refImportModal #riElements.refuse{color:#fca5a5}
1297
+ #refImportModal #riElements.warn{color:var(--warn)} #refImportModal #riElements.refuse{color:var(--err)}
1104
1298
  #riFootNote{display:none;flex:1;align-self:center;font-size:11px;line-height:1.4;text-align:left}
1105
- #riFootNote.warn{color:#fbbf24} #riFootNote.refuse{color:#fca5a5}
1299
+ #riFootNote.warn{color:var(--warn)} #riFootNote.refuse{color:var(--err)}
1106
1300
  #riInsert[disabled]{opacity:.5;cursor:not-allowed}
1107
1301
  /* ── Favourites tab (#m3dFavBody) — the Views-tab row/search recipe. No create button (★ lives in the
1108
1302
  Inspector); a kind-filter + search header, per-row kind swatch + portability badge + row-click-to-arm. ── */
@@ -1142,7 +1336,7 @@ text.mlentx{fill:#e2e8f0;text-anchor:middle;dominant-baseline:central;font-famil
1142
1336
  .ghostw.faved{color:var(--brand);border-color:var(--brand)} /* the ★ Save button once this recipe is in the library */
1143
1337
  /* #favConnModal — a small sibling modal (askAiModal sizing); Kind is a read-only chip row, not an input. */
1144
1338
  #favConnModal .mpanel{width:min(460px,92vw)}
1145
- #favConnModal .favkindfield{display:flex;align-items:center;gap:8px;background:#0f172a;border:1px solid #475569;border-radius:6px;padding:6px 8px;min-height:34px}
1339
+ #favConnModal .favkindfield{display:flex;align-items:center;gap:8px;background:var(--field);border:1px solid var(--ctrl-border);border-radius:6px;padding:6px 8px;min-height:34px}
1146
1340
  #favConnModal .favkindfield .chip{margin:0}
1147
1341
  #m3dLegend .lhint{color:var(--mut);font-size:10px;margin-bottom:4px;max-width:230px;white-space:normal} /* wrap-guard: the hint never drives the panel wider than the rows, so it can't clip on any font */
1148
1342
  #m3dLegend .lrow{display:flex;align-items:center;gap:7px;cursor:default;user-select:none;padding:2px 4px;border-radius:5px;white-space:nowrap} /* only the left-hand box toggles now (it sets cursor:pointer); the row still isolates on dbl-click + right-clicks for the menu */
@@ -1501,10 +1695,10 @@ text.mlentx{fill:#e2e8f0;text-anchor:middle;dominant-baseline:central;font-famil
1501
1695
  <span class=tb-sep></span>
1502
1696
  <!-- Section -->
1503
1697
  <div class=m3dwrap>
1504
- <button id=m3dClip data-tip="Clip planes and boxes — section to see inside a connection">Clip ▾</button>
1698
+ <button id=m3dClip data-tip="Clip planes and boxes — section your model to see inside">Clip ▾</button>
1505
1699
  <div id=m3dClipMenu class=m3dmenu role=menu>
1506
1700
  <button data-clip=plane data-tip="Click a model face to cut the view there (Shift+X)">Add clip plane</button>
1507
- <button data-clip=box data-tip="Section a box around the selection (or whole model) (Shift+B)">Add clip box</button>
1701
+ <button data-clip=box data-tip="Click two corners, then a height, to cut away everything outside (Shift+B)">Add clip box</button>
1508
1702
  <hr>
1509
1703
  <button data-clip=clear class=mdanger data-tip="Remove every clip">Clear all clips</button>
1510
1704
  </div>
@@ -1512,7 +1706,7 @@ text.mlentx{fill:#e2e8f0;text-anchor:middle;dominant-baseline:central;font-famil
1512
1706
  <div class=m3dwrap>
1513
1707
  <button id=m3dWp data-tip="Working plane — every 3D pick (Move/Copy, next: drawing) lands on it. Set it from a face, 3 points, or a principal plane.">◇ Plane ▾</button>
1514
1708
  <div id=m3dWpMenu class=m3dmenu role=menu>
1515
- <button data-wp=face data-tip="One click on any member face — the plane lands on it">Pick a face…</button>
1709
+ <button data-wp=face data-tip="One click on any face — yours or a reference model's — the plane lands on it">Pick a face…</button>
1516
1710
  <button data-wp=3pt data-tip="Three snapped points: origin, X direction, a point on the Y side">3 points…</button>
1517
1711
  <hr>
1518
1712
  <div class=mlabel>Principal + offset</div>
@@ -1741,8 +1935,8 @@ text.mlentx{fill:#e2e8f0;text-anchor:middle;dominant-baseline:central;font-famil
1741
1935
  <div class=mpanel style="width:min(560px,92vw)">
1742
1936
  <div class=mhead><b>Ask the AI</b><button id=askAiClose>✕</button></div>
1743
1937
  <div style="padding:14px;display:flex;flex-direction:column;gap:10px">
1744
- <textarea id=askAiText rows=4 placeholder="Describe the change — e.g. 'this bay is missing two W12x19 infills'" style="width:100%;resize:vertical;background:#0f172a;color:var(--text);border:1px solid #475569;border-radius:6px;padding:8px;font:13px system-ui;min-height:72px"></textarea>
1745
- <div id=askAiDrop style="border:1px dashed #475569;border-radius:8px;background:#0b1220;min-height:72px;display:flex;align-items:center;justify-content:center;gap:10px;flex-wrap:wrap;text-align:center;color:var(--mut);cursor:pointer;padding:10px;font-size:12px">
1938
+ <textarea id=askAiText rows=4 placeholder="Describe the change — e.g. 'this bay is missing two W12x19 infills'" style="width:100%;resize:vertical;background:var(--field);color:var(--text);border:1px solid var(--ctrl-border);border-radius:6px;padding:8px;font:13px system-ui;min-height:72px"></textarea>
1939
+ <div id=askAiDrop style="border:1px dashed var(--ctrl-border);border-radius:8px;background:var(--sunken);min-height:72px;display:flex;align-items:center;justify-content:center;gap:10px;flex-wrap:wrap;text-align:center;color:var(--mut);cursor:pointer;padding:10px;font-size:12px">
1746
1940
  <span id=askAiDropTxt>Paste or drop a screenshot (Ctrl+V) — optional</span>
1747
1941
  </div>
1748
1942
  <input id=askAiFile type=file accept="image/*" multiple hidden>
@@ -2006,7 +2200,7 @@ const queueWrite = (fn) => (writeQueue = writeQueue.then(fn, fn));
2006
2200
  */
2007
2201
  function showEmpty(icon, headline, bodyText, appIdText, opts) {
2008
2202
  const wrap = document.createElement('div');
2009
- wrap.style.cssText = 'display:flex;flex-direction:column;align-items:center;justify-content:center;width:100%;height:100vh;box-sizing:border-box;text-align:center;color:#e7ecf3;font:13px system-ui,sans-serif;gap:10px;padding:24px;background:#070a0f';
2203
+ wrap.style.cssText = 'display:flex;flex-direction:column;align-items:center;justify-content:center;width:100%;height:100vh;box-sizing:border-box;text-align:center;color:var(--text);font:13px system-ui,sans-serif;gap:10px;padding:24px;background:var(--bg)';
2010
2204
  wrap.setAttribute('role', 'alert');
2011
2205
  wrap.setAttribute('aria-labelledby', 'empty-state-heading');
2012
2206
  wrap.setAttribute('aria-describedby', 'empty-state-body');
@@ -2014,14 +2208,14 @@ function showEmpty(icon, headline, bodyText, appIdText, opts) {
2014
2208
  const h = document.createElement('h1'); h.id = 'empty-state-heading'; h.style.cssText = 'font-size:15px;font-weight:600;margin:0';
2015
2209
  if (appIdText != null) { h.append(headline + ' '); const b = document.createElement('strong'); b.textContent = appIdText; h.append(b); }
2016
2210
  else { h.textContent = headline; }
2017
- const body = document.createElement('div'); body.id = 'empty-state-body'; body.style.cssText = 'font-size:12.5px;color:#9aa5b6;max-width:340px;line-height:1.55'; body.textContent = bodyText;
2211
+ const body = document.createElement('div'); body.id = 'empty-state-body'; body.style.cssText = 'font-size:12.5px;color:var(--mut);max-width:340px;line-height:1.55'; body.textContent = bodyText;
2018
2212
  // Insert the live region before populating it so assistive technology reliably announces this async
2019
2213
  // terminal state. The visual result is unchanged: all children are appended in the same microtask.
2020
2214
  document.body.replaceChildren(wrap);
2021
2215
  wrap.append(ic, h, body);
2022
2216
  if (opts && opts.detail) {
2023
2217
  const det = document.createElement('div');
2024
- det.style.cssText = 'font-size:10.5px;color:#9aa5b6;opacity:.65;margin-top:-2px';
2218
+ det.style.cssText = 'font-size:10.5px;color:var(--mut);opacity:.65;margin-top:-2px';
2025
2219
  det.textContent = opts.detail; // textContent, not innerHTML: detail may include stored/server-authored text
2026
2220
  wrap.append(det);
2027
2221
  }
@@ -4525,7 +4719,7 @@ function deleteSelGrids(){
4525
4719
  // cursor-following distance readout for grid drags (same chrome as the 3D drag readout)
4526
4720
  let gridRd=null;
4527
4721
  function gridReadout(e,main,sub){
4528
- if(!gridRd){gridRd=document.createElement('div');
4722
+ if(!gridRd){gridRd=document.createElement('div');gridRd.id='gridReadout';
4529
4723
  gridRd.style.cssText='position:fixed;display:none;pointer-events:none;z-index:60;background:var(--panel);color:var(--text);border:1px solid var(--line);border-radius:4px;padding:3px 7px;font:12px system-ui;white-space:nowrap;box-shadow:0 2px 8px rgba(0,0,0,.5)';
4530
4724
  gridRd._m=document.createElement('span');gridRd._s=document.createElement('span');gridRd._s.style.color='var(--mut)';
4531
4725
  gridRd.append(gridRd._m,gridRd._s);document.body.appendChild(gridRd);}
@@ -4539,7 +4733,7 @@ function gridRenameBubble(axis,gi,anchorEl){
4539
4733
  const gc=GC();if(!gc||!gridOf())return;
4540
4734
  const geo=gridGeo();const lines=axis==='v'?geo.v:axis==='h'?geo.h:(geo.lines||[]);const line=lines[gi];if(!line||!anchorEl)return;
4541
4735
  const cur=line.label,r=anchorEl.getBoundingClientRect();
4542
- const inp=document.createElement('input');inp.value=cur;inp.className='gin';
4736
+ const inp=document.createElement('input');inp.value=cur;inp.className='gin';inp.id='gridLabelEdit'; // the id is for CSS only: it puts THIS floating instance in the dark island (#727), while the same .gin class inside the light #panel stays light
4543
4737
  inp.style.cssText='position:fixed;z-index:70;width:72px;text-align:center;left:'+(r.left+r.width/2-36)+'px;top:'+(r.top+r.height/2-14)+'px;padding:4px;border-color:var(--brand);box-shadow:0 4px 14px rgba(0,0,0,.5)';
4544
4738
  document.body.appendChild(inp);inp.focus();inp.select();
4545
4739
  let done=false;
@@ -4793,7 +4987,7 @@ function renderGridPanel(p){
4793
4987
  wire('gLY',(v)=>{if(v!==(g.labels_y||''))editGrid(()=>{ModelCmd.patchGrid(gridOf(),{labels_y:v});});});
4794
4988
  document.querySelectorAll('[data-zlabel]').forEach(el=>{const orig=el.value;el.addEventListener('input',()=>{const limited=gc.truncateText(el.value,40);if(limited!==el.value)el.value=limited;});el.addEventListener('keydown',ev=>{ev.stopPropagation();if(ev.key==='Enter'){ev.preventDefault();el.blur();}else if(ev.key==='Escape'){ev.preventDefault();el.value=orig;}});el.addEventListener('change',()=>{const i=+el.dataset.zlabel,nv=gc.truncateText(el.value.trim(),40),labels=zNormalizedLabels.labels.slice();if(labels[i]===nv&&g.z===normZ)return;labels[i]=nv;editGridZLabels(normZ,g,{labels_z:labels});});});
4795
4989
  document.querySelectorAll('[data-zvisible]').forEach(el=>el.addEventListener('change',()=>{const lv=zParsed.levels[+el.dataset.zvisible];if(!lv)return;const key=gc.gridLevelKey(lv.mm),next=hiddenZ.filter(mm=>gc.gridLevelKey(mm)!==key);if(!el.checked)next.push(lv.mm);const hidden=gc.normalizeHiddenLevels(next,zParsed.levels);editGrid(()=>{ModelCmd.patchGrid(gridOf(),{hidden_z:hidden.length?hidden:undefined});});}));
4796
- wire('gExt',(v,el)=>{const mm=gc.parseLen(v);if(!isFinite(mm)||mm<0){el.style.borderColor='#fca5a5';return;}el.style.borderColor='';if(Math.abs(mm-(isFinite(g.ext)?g.ext:1524))>0.5)editGrid(()=>{ModelCmd.patchGrid(gridOf(),{ext:mm});});});
4990
+ wire('gExt',(v,el)=>{const mm=gc.parseLen(v);if(!isFinite(mm)||mm<0){el.style.borderColor='var(--err)';return;}el.style.borderColor='';if(Math.abs(mm-(isFinite(g.ext)?g.ext:1524))>0.5)editGrid(()=>{ModelCmd.patchGrid(gridOf(),{ext:mm});});});
4797
4991
  // The ORIGIN, typed (unit 5, P7d). v1 sets it by clicking the 1-A corner on the plan; a v2 model has no
4798
4992
  // plan canvas to click (§1), so "move the grid" would have had no gesture at all — and moving it is one of
4799
4993
  // the edits this unit exists to give the human. Both coordinates commit as ONE edit: writing X and then Y
@@ -5393,7 +5587,7 @@ function panel(){
5393
5587
  ${cmArrayMode?`<div class=sect style="margin-top:12px">Array counts</div><div class=elab>Direction A</div><input id=cmNA inputmode=numeric value="${cmCountA}" autocomplete=off><div class=elab>Direction B</div><input id=cmNB inputmode=numeric value="${cmCountB}" autocomplete=off><div class=hint id=cmCapHint style="margin-top:4px">Counts include the original — 4 × 6 fills a 4-by-6 grid (max 100).</div>`:''}
5394
5588
  <div class=hint style="margin-top:8px">${refTarget?'1 reference model selected.':nsel+' member'+(nsel===1?'':'s')+' selected.'} ${view3d?'<b>Shift</b>=straight · <b>X/Y/Z</b> lock (press again to release · <b>F</b> clears; lock two to snap to whichever you drag toward) · <b>Alt</b>=lock out-of-plane':'<b>Shift</b>=straight · <b>X/Y/F</b> axis · <b>Alt</b>=no snap'} · type after the first pick for an exact value · <b>Esc</b> cancels.${refTarget?'':' Connections don’t copy.'}</div>`;
5395
5589
  const wireN=(id,set)=>{const i=document.getElementById(id);if(i)i.onchange=e=>{const n=Math.max(1,Math.min(99,Math.round(Number(e.target.value)||1)));set(n);e.target.value=n;
5396
- const ch=document.getElementById('cmCapHint');if(ch)ch.style.color=(cmArrayMode&&cmCountA*cmCountB>100)?'#fca5a5':'';cmRefreshPrev();};};
5590
+ const ch=document.getElementById('cmCapHint');if(ch)ch.style.color=(cmArrayMode&&cmCountA*cmCountB>100)?'var(--err)':'';cmRefreshPrev();};};
5397
5591
  wireN('cmN',n=>cmCount=n);wireN('cmNA',n=>cmCountA=n);wireN('cmNB',n=>cmCountB=n);
5398
5592
  return;}
5399
5593
  if(dimMode){p.innerHTML=`<span class=badge>Dimension</span>
@@ -5541,7 +5735,7 @@ function panel(){
5541
5735
  if(isBP)body=sec('Plate')+kv('Size',sz)+kv('Thickness',plate?dim(plate.thickness):dim(pp.thickness))+sec('Anchors')+kv('Grid (cols × rows)',esc(`${pp.boltCols||2} × ${pp.boltRows||2}`))+kv('Diameter',pp.boltDia?dim(pp.boltDia):dim(24));
5542
5736
  else body=sec('Plate')+kv('Size',sz)+kv('Thickness',plate?dim(plate.thickness):dim(pp.plateThickness))+sec('Bolts')+kv('Grid (cols × rows)',esc(`${pp.boltCols||1} × ${pp.boltRows||3}`))+kv('Diameter',pp.boltDia?dim(pp.boltDia):dim(20))+sec('Weld')+kv('Leg',pp.weldLeg?dim(pp.weldLeg):dim(6));
5543
5737
  p.innerHTML=`<span class=badge>${connKindLabel(cs.kind)}</span>
5544
- <div class=row style="margin:0 0 6px"><span class=chip style="border-color:var(--brand);color:#bfdbfe">Parametric — editable</span></div>
5738
+ <div class=row style="margin:0 0 6px"><span class=chip style="border-color:var(--brand);color:var(--info-ink)">Parametric — editable</span></div>
5545
5739
  <div class="row hint" style="margin:0 0 2px">On <button class=pilllink id=cmpMember data-tip="Select ${esc(j.main)}">${esc(j.main)}</button> · ${cs.childIds.length} parts</div>
5546
5740
  <div class="row hint" style="margin:0 0 6px;font-size:11px">Double-click to enter and pick a part · <b>Esc</b> steps back.</div>
5547
5741
  ${body}
@@ -5693,8 +5887,8 @@ function panel(){
5693
5887
  <div class="row hint" style="margin-top:0">Edits apply to <b>all ${arr.length}</b> selected · a blank <b>Varies</b> field is left unchanged.</div>
5694
5888
  ${memberTypeField('mTypeM',arr)}
5695
5889
  <div class="f"><div class=elab>Profile</div><input id=pf class=combo data-src=profiles placeholder="${VV(profAgg)?'Varies':''}" value="${VV(profAgg)?'':esc(profAgg||'')}" autocomplete=off></div>
5696
- <div class="row hint">Total length <b>${totalL} ft</b>${totalW!=null?` · <b>${totalW.toLocaleString()} lb</b>`:''}${dupSel?` · <span style="color:#fca5a5">${dupSel} duplicate${dupSel>1?'s':''}</span> (overlap a kept member — deleting these dedupes)`:''}</div>
5697
- <div class=row><button class=ghostw id=verifyBtn${allVerified?' style="border-color:#166534;color:#86efac"':''}>${allVerified?'✓ All verified — click to unverify':'Mark all verified'}</button></div>
5890
+ <div class="row hint">Total length <b>${totalL} ft</b>${totalW!=null?` · <b>${totalW.toLocaleString()} lb</b>`:''}${dupSel?` · <span style="color:var(--err)">${dupSel} duplicate${dupSel>1?'s':''}</span> (overlap a kept member — deleting these dedupes)`:''}</div>
5891
+ <div class=row><button class=ghostw id=verifyBtn${allVerified?' style="border-color:var(--ok-edge);color:var(--ok)"':''}>${allVerified?'✓ All verified — click to unverify':'Mark all verified'}</button></div>
5698
5892
  ${elev}
5699
5893
  ${!allCol?`<div class=divrow><hr><span class=sect style="margin:0" data-tip="${POSTIP.head(hOk.length>0)}">Profile Position <span style="opacity:.45;font-weight:400">ⓘ</span></span><hr></div>
5700
5894
  <div class=elab style="margin-top:0">Vertical</div>
@@ -5784,7 +5978,7 @@ function panel(){
5784
5978
  // fallback. Readonly combo → pick only, no free typing; the connrows source shows every row.
5785
5979
  const cFld=(id,o)=>{const row=o.conn?connRowById(o.conn):null;
5786
5980
  const cap=row?`<span class=edec style="text-align:left">${esc(row.type||'?')}${row.detail?' · '+esc(row.detail):''} — ${esc(row.source||'user')}</span>`
5787
- :(o.conn?'<span class=edec style="text-align:left;color:#fca5a5">references a missing row — re-pick</span>':'');
5981
+ :(o.conn?'<span class=edec style="text-align:left;color:var(--err)">references a missing row — re-pick</span>':'');
5788
5982
  return `<div class=elab>Connection</div><input id=${id} class=combo data-src=connrows readonly placeholder="— none — (pick from the library)" value="${esc(row?connLabel(row):'')}" autocomplete=off>${cap}`;};
5789
5983
  const fb=(o,html)=>`<div class="${o.conn?'connset':''}">${html}</div>`; // dim the note/detail fallback when a library row is referenced
5790
5984
  // What this end's detail will BUILD. Silent until there is a callout or a library reference to talk
@@ -5848,7 +6042,7 @@ function panel(){
5848
6042
  ${pFld('plateWidth','Plate width "N"','auto','mm')}${pFld('plateDepth','Plate depth "B"','auto','mm')}${pFld('thickness','Thickness','1"','mm')}${pFld('weldLeg','Weld leg','5/16"','mm')}
5849
6043
  <div class=elab style="margin-top:7px;opacity:.7">Anchor kit</div>
5850
6044
  ${pFld('boltCols','Bolt columns','2','')}${pFld('boltRows','Bolt rows','2','')}${pFld('boltDia','Bolt ⌀','1"','mm')}${pFld('embedment','Embedment','auto','mm')}${pFld('grout','Grout','auto','mm')}
5851
- <div class="row f"><button class="ghostw" id=bpTrim data-tip="Pick a point on ${esc(m.id)} — trim or extend the column so its base seats there (snaps to framing levels)">⭶ Trim / Extend column to base…</button><button class="ghostw" id=bpRemove data-tip="Delete this column's base plate" style="color:#fca5a5;border-color:#7f1d1d">Remove base plate</button></div>`:'';
6045
+ <div class="row f"><button class="ghostw" id=bpTrim data-tip="Pick a point on ${esc(m.id)} — trim or extend the column so its base seats there (snaps to framing levels)">⭶ Trim / Extend column to base…</button><button class="ghostw" id=bpRemove data-tip="Delete this column's base plate" style="color:var(--err);border-color:var(--err-edge)">Remove base plate</button></div>`:'';
5852
6046
  // This BEAM's shear-plate joints — one params block per detailed END (start/end). Mirrors bpSect but
5853
6047
  // per-end (a beam can be detailed at both ends), and adds the clearance + web-side + stiffener controls.
5854
6048
  // Both parametric END kinds. A gusset reaching this panel and finding no section for it was a dead end:
@@ -5874,7 +6068,7 @@ function panel(){
5874
6068
  <div class=seg2 style="margin-top:0"><button id="spg_e${e}_325" class="${(j.params&&j.params.boltGrade==='A490')?'':'on'}">A325</button><button id="spg_e${e}_490" class="${(j.params&&j.params.boltGrade==='A490')?'on':''}">A490</button></div>
5875
6069
  <div class=hint style="margin:4px 0 0">Bolt length auto-sizes from the grip (AISC) → shown on the bolt callout.</div>
5876
6070
  ${gus?`<div class=hint style="margin:4px 0 0">The brace is set back to the support face automatically — a gusset has no erection gap to enter.</div>`:`<div class=elabrow><span class=elab>Opposite stiffener</span><label class=defck><input type=checkbox id="spck_e${e}"${st?' checked':''}>add</label></div>`}
5877
- <div class="row f"><button class="ghostw" id="sprm_e${e}" data-tip="Delete this end's ${gus?'gusset':'shear plate'}" style="color:#fca5a5;border-color:#7f1d1d">Remove ${gus?'gusset':'shear plate'}</button></div>`;};
6071
+ <div class="row f"><button class="ghostw" id="sprm_e${e}" data-tip="Delete this end's ${gus?'gusset':'shear plate'}" style="color:var(--err);border-color:var(--err-edge)">Remove ${gus?'gusset':'shear plate'}</button></div>`;};
5878
6072
  // The intro reads per-KIND: a gusset has no erection clearance to explain and does not lap a web, so the
5879
6073
  // fin-plate wording above a gusset block was describing controls that are not there.
5880
6074
  const spAllGus=spjs.length>0&&spjs.every(x=>x.j.kind==='brace-gusset');
@@ -5939,7 +6133,7 @@ function panel(){
5939
6133
  const _dpIn=(id,lbl,vin)=>{const v=Math.abs(vin)<1e-6?0:vin;return `<label class=detf><span>${lbl}</span><input id=${id} inputmode=decimal placeholder="${_dpPH}" value="${esc(fmtFtIn(v))}" autocomplete=off></label>`;}; // snap float-noise to 0 (no "-0"" from a local round-trip)
5940
6134
  const _dpBlock=(i,head)=>{const g=_dpGlobal(i),loc=_dpLocal?_dpToLocal(g):null;
5941
6135
  const grow=`<div class=detrow>${_dpAxes.map((ax,a)=>_dpIn('dpG_'+i+'_'+a,ax,g[a])).join('')}</div>`;
5942
- const lrow=loc?`<div class=elab style="color:#22d3ee;margin:4px 0 0">Local frame</div><div class="detrow dp-local">${_dpAxes.map((ax,a)=>_dpIn('dpL_'+i+'_'+a,ax+'′',loc[a])).join('')}</div>`:'';
6136
+ const lrow=loc?`<div class=elab style="color:var(--cyan);margin:4px 0 0">Local frame</div><div class="detrow dp-local">${_dpAxes.map((ax,a)=>_dpIn('dpL_'+i+'_'+a,ax+'′',loc[a])).join('')}</div>`:'';
5943
6137
  return head+(loc?'<div class=elab style="margin:2px 0 0">Global</div>':'')+grow+lrow;};
5944
6138
  const defPts=`<div class=divrow><hr><span class=sect style="margin:0" data-tip="The member's two work points in global coordinates${_dpLocal?' and the current local frame':''}. Type a value to move that point.">Definition points</span><hr></div>`
5945
6139
  +(col
@@ -5960,12 +6154,12 @@ function panel(){
5960
6154
  p.innerHTML=`<h3>Member ${esc(m.id)}</h3>
5961
6155
  ${typeFilterHTML()}
5962
6156
  ${memberTypeField('mTypeS',[m])}
5963
- <div class="f"><div class=elab>Profile</div><div style="display:flex;gap:6px"><input id=pf class=combo data-src=profiles value="${esc(m.profile)}" style="flex:1" autocomplete=off><button id=pickProf class="ghost${(picking&&pickKind==='profile')?' on':''}" data-tip="Pick profile by clicking a label in the drawing">⌖ pick</button></div>${(picking&&pickKind==='profile')?'<div class="hint" style="margin-top:4px;font-style:italic;color:var(--brand)">Click a profile label in the drawing…</div>':(picking&&pickKind==='detail')?'<div class="hint" style="margin-top:4px;font-style:italic;color:#a855f7">Click a detail callout in the drawing…</div>':''}</div>
6157
+ <div class="f"><div class=elab>Profile</div><div style="display:flex;gap:6px"><input id=pf class=combo data-src=profiles value="${esc(m.profile)}" style="flex:1" autocomplete=off><button id=pickProf class="ghost${(picking&&pickKind==='profile')?' on':''}" data-tip="Pick profile by clicking a label in the drawing">⌖ pick</button></div>${(picking&&pickKind==='profile')?'<div class="hint" style="margin-top:4px;font-style:italic;color:var(--brand)">Click a profile label in the drawing…</div>':(picking&&pickKind==='detail')?'<div class="hint" style="margin-top:4px;font-style:italic;color:var(--purple)">Click a detail callout in the drawing…</div>':''}</div>
5964
6158
  ${appearanceSect}
5965
6159
  ${braceSect}
5966
- <div class="row hint">Length <b>${L} ft</b> · ${wpf==null?'<span id=rfiPill class="pill pill-clickable" role=button tabindex=0 data-tip="Open the RFI list, focused on this member" style="background:#7f1d1d">RFI — size unresolved</span>':'Weight <b>'+(_lenFt(m)*wpf).toFixed(0)+' lb</b> · '+wpf+' lb/ft'}</div>
5967
- <div class=row><button class=ghostw id=verifyBtn${m.verified?' style="border-color:#166534;color:#86efac"':''} data-tip="Mark this member human-confirmed → 100% in the confidence report">${m.verified?'✓ Verified — human-confirmed':'Mark verified'}</button></div>
5968
- ${mfSug.length?`<div class="row" style="border:1px solid #a855f7;border-radius:6px;padding:7px 8px;background:rgba(168,85,247,.07)"><div class=elab style="color:#c4b5fd;margin:0">Moment-frame girder · ${_lvl==='roof'?'roof':'2nd floor'} (from Frames)</div><div style="display:flex;flex-wrap:wrap;gap:5px;margin-top:5px">${mfSug.map(s=>`<button class="ghost mfsug${s===m.profile?' on':''}" data-s="${esc(s)}">${esc(s)}</button>`).join('')}</div></div>`:''}
6160
+ <div class="row hint">Length <b>${L} ft</b> · ${wpf==null?'<span id=rfiPill class="pill pill-clickable" role=button tabindex=0 data-tip="Open the RFI list, focused on this member" style="background:var(--err-bg)">RFI — size unresolved</span>':'Weight <b>'+(_lenFt(m)*wpf).toFixed(0)+' lb</b> · '+wpf+' lb/ft'}</div>
6161
+ <div class=row><button class=ghostw id=verifyBtn${m.verified?' style="border-color:var(--ok-edge);color:var(--ok)"':''} data-tip="Mark this member human-confirmed → 100% in the confidence report">${m.verified?'✓ Verified — human-confirmed':'Mark verified'}</button></div>
6162
+ ${mfSug.length?`<div class="row" style="border:1px solid var(--purple);border-radius:6px;padding:7px 8px;background:rgba(168,85,247,.07)"><div class=elab style="color:var(--purple-ink);margin:0">Moment-frame girder · ${_lvl==='roof'?'roof':'2nd floor'} (from Frames)</div><div style="display:flex;flex-wrap:wrap;gap:5px;margin-top:5px">${mfSug.map(s=>`<button class="ghost mfsug${s===m.profile?' on':''}" data-s="${esc(s)}">${esc(s)}</button>`).join('')}</div></div>`:''}
5969
6163
  ${elev}
5970
6164
  ${defPts}
5971
6165
  ${bpSect}${spSect}${copeSect}
@@ -6106,7 +6300,7 @@ function panel(){
6106
6300
  {const dpWire=(id,i,a,isLocal)=>{const inp=document.getElementById(id);if(!inp)return;const orig=inp.value;
6107
6301
  inp.onkeydown=e=>{e.stopPropagation();if(e.key==='Enter'){e.preventDefault();inp.blur();}else if(e.key==='Escape'){e.preventDefault();inp.value=orig;inp.blur();}};
6108
6302
  inp.onchange=()=>{const vin=parseLen(inp.value);
6109
- if(vin==null||!Number.isFinite(vin)){inp.style.borderColor='#fca5a5';return;} // bad parse → flag, don't commit
6303
+ if(vin==null||!Number.isFinite(vin)){inp.style.borderColor='var(--err)';return;} // bad parse → flag, don't commit
6110
6304
  inp.style.borderColor='';
6111
6305
  const g=_dpGlobal(i);let Pt;
6112
6306
  if(isLocal){const loc=_dpToLocal(g)||[0,0,0];loc[a]=vin;Pt=_dpFromLocal(loc);}
@@ -7348,7 +7542,7 @@ function updCS(){const s=document.getElementById('csStat');const r=document.getE
7348
7542
  // `sticky` holds the toast up with no timer — for an operation whose result the user must see land
7349
7543
  // (the Tekla send takes seconds); the next plain toast() replaces the text and re-arms the timer.
7350
7544
  function toast(msg,sticky){let t=document.getElementById('toast');
7351
- if(!t){t=document.createElement('div');t.id='toast';t.style.cssText='position:fixed;left:50%;bottom:18px;transform:translateX(-50%);background:var(--panel);color:var(--text);border:1px solid var(--line);border-radius:8px;padding:8px 14px;box-shadow:0 6px 20px rgba(0,0,0,.5);z-index:60;font:13px system-ui;opacity:0;transition:opacity .2s;pointer-events:none';document.body.appendChild(t);}
7545
+ if(!t){t=document.createElement('div');t.id='toast';t.style.cssText='position:fixed;left:50%;bottom:18px;transform:translateX(-50%);background:var(--panel);color:var(--text);border:1px solid var(--line);border-radius:8px;padding:8px 14px;box-shadow:var(--shadow-md);z-index:60;font:13px system-ui;opacity:0;transition:opacity .2s;pointer-events:none';document.body.appendChild(t);}
7352
7546
  t.setAttribute('role','status');t.setAttribute('aria-live','polite');t.setAttribute('aria-atomic','true');
7353
7547
  t.textContent=msg;t.style.opacity='1';clearTimeout(t._h);if(!sticky)t._h=setTimeout(()=>{t.style.opacity='0';},2600);}
7354
7548
  // --- pointer: select(+ctrl toggle / box) + group-move + endpoint (Shift = ortho) ---
@@ -9371,7 +9565,7 @@ document.getElementById('viewGenModal').addEventListener('keydown',e=>{e.stopPro
9371
9565
  const focusable=[...document.querySelectorAll('#viewGenModal button:not(:disabled),#viewGenModal input:not(:disabled)')].filter(el=>el.offsetParent!==null);if(!focusable.length)return;const first=focusable[0],last=focusable[focusable.length-1];if(e.shiftKey&&document.activeElement===first){e.preventDefault();last.focus();}else if(!e.shiftKey&&document.activeElement===last){e.preventDefault();first.focus();}});
9372
9566
  // A themed undo toast (extends toast(): an inline "Undo" action + a ~5s window). Baseline tokens only.
9373
9567
  function undoToast(msg,onUndo){let t=document.getElementById('undoToast');
9374
- if(!t){t=document.createElement('div');t.id='undoToast';t.style.cssText='position:fixed;left:50%;bottom:18px;transform:translateX(-50%);display:flex;align-items:center;gap:12px;background:var(--panel);color:var(--text);border:1px solid var(--line);border-radius:8px;padding:8px 14px;box-shadow:0 6px 20px rgba(0,0,0,.5);z-index:60;font:13px system-ui;opacity:0;transition:opacity .2s';document.body.appendChild(t);}
9568
+ if(!t){t=document.createElement('div');t.id='undoToast';t.style.cssText='position:fixed;left:50%;bottom:18px;transform:translateX(-50%);display:flex;align-items:center;gap:12px;background:var(--panel);color:var(--text);border:1px solid var(--line);border-radius:8px;padding:8px 14px;box-shadow:var(--shadow-md);z-index:60;font:13px system-ui;opacity:0;transition:opacity .2s';document.body.appendChild(t);}
9375
9569
  t.replaceChildren();t.appendChild(document.createTextNode(msg));
9376
9570
  const btn=document.createElement('button');btn.type='button';btn.textContent='Undo';btn.style.cssText='background:transparent;border:0;color:var(--brand);cursor:pointer;font:600 13px system-ui;padding:0;box-shadow:none';
9377
9571
  btn.addEventListener('click',()=>{clearTimeout(t._h);t.style.opacity='0';try{onUndo();}catch(e){console.error(e);}});
@@ -9423,7 +9617,7 @@ function favSuggestName(j){if(!j)return '';
9423
9617
  function favFillModal({title,kind,name,category,portable,hint}){
9424
9618
  document.getElementById('favModalTitle').textContent=title;
9425
9619
  const kf=document.getElementById('favKind');kf.className='chip';kf.textContent=FAV_KIND_LABEL[kind]||kind;
9426
- kf.style.borderColor=portable?'var(--brand)':'var(--line)';kf.style.color=portable?'#bfdbfe':'var(--mut)';
9620
+ kf.style.borderColor=portable?'var(--brand)':'var(--line)';kf.style.color=portable?'var(--info-ink)':'var(--mut)'; // --info-ink, not the raw #bfdbfe: this chip sits on --field, which is #fff on light (1.42:1)
9427
9621
  document.getElementById('favName').value=name||'';
9428
9622
  document.getElementById('favCat').value=category||'';
9429
9623
  favCatKind=kind; // what COMBO_SRC.favcats offers — set before the field can be focused
@@ -9563,6 +9757,17 @@ async function deleteFav(f){const idx=steelFavourites.findIndex(x=>x.id===f.id);
9563
9757
  // item is replaced by a sentence saying what unlocks it — the server refuses the verbs there too, with
9564
9758
  // the same words, so a direct API hit and a click get the same answer.
9565
9759
  const refGeom=new Map(); // id -> { objects, dropped } once the geometry route has answered
9760
+ /**
9761
+ * Is a progressive preview session open, and what is it called?
9762
+ *
9763
+ * TWO VARIABLES, because they answer different questions and only one may be trusted as the claim.
9764
+ * `refPreviewBusy` is the mutual-exclusion flag — the 3D layer holds ONE preview group, so a second
9765
+ * overlapping session would draw into the first's placement. `refPreviewFor` is only the label the
9766
+ * References tab prints, and a reference whose name is missing would make it falsy — which is exactly
9767
+ * how a name-as-claim silently stops excluding anything.
9768
+ */
9769
+ let refPreviewBusy=false;
9770
+ let refPreviewFor=null;
9566
9771
  const refLoading=new Set(); // ids with a geometry fetch in flight — the row shows it, and it dedupes
9567
9772
  const refFailed=new Map(); // id -> why its geometry could not be fetched (see loadReferenceGeometry)
9568
9773
  const refEmpty=new Set(); // ids the reader answered for, with nothing drawable in the answer
@@ -9654,6 +9859,158 @@ function pushReferences(){
9654
9859
  if(refSelectedId&&v.selectReference&&(!v.selectedReference||v.selectedReference()!==refSelectedId))v.selectReference(refSelectedId);
9655
9860
  }
9656
9861
 
9862
+ /**
9863
+ * Open a progress channel and draw the model as AWARE tessellates it (aware-aeco/aware#405).
9864
+ *
9865
+ * WHY A SESSION AND NOT JUST A STREAM: the server mints the id, so there is no ordering problem. Were
9866
+ * the client to choose it, we would have to either subscribe before the server knew it existed or POST
9867
+ * before subscribing and lose the early batches. Here the session is real the moment the POST below
9868
+ * returns, so we subscribe to something that exists and only then start the import.
9869
+ *
9870
+ * EVERYTHING HERE IS OPTIONAL. A server too old to know the route, a blocked EventSource, a filtered
9871
+ * read (which never produces segments) — every one of them returns null or simply never calls back,
9872
+ * and the import proceeds exactly as it did before this existed. It must never be able to fail one.
9873
+ *
9874
+ * Returns `{progressId, close}`; `close()` is idempotent and MUST be called on every exit, because it
9875
+ * is what removes the preview from the scene.
9876
+ */
9877
+ async function refPreviewOpen(placement,displayName){
9878
+ const V=window.Steel3DView;
9879
+ if(!V||!V.appendReferencePreview)return null;
9880
+ // ONE PREVIEW AT A TIME, and the second caller simply goes without.
9881
+ //
9882
+ // The 3D layer holds a SINGLE preview group with one placement matrix, so two overlapping sessions
9883
+ // would append into each other: the second reference's objects drawn at the first's placement, and
9884
+ // whichever finished first calling `clearReferencePreview()` on both. Overlap is reachable — an
9885
+ // insert can start while a cold-cache `loadReferenceGeometry` is still streaming. Refusing the second
9886
+ // is honest and costs it only the preview; its import is untouched and it draws normally at the end.
9887
+ // (Codex review; the alternative — a per-session group — buys nothing a user can perceive, since two
9888
+ // previews at once is not a state worth rendering.)
9889
+ if(refPreviewBusy)return null;
9890
+ // CLAIMED SYNCHRONOUSLY, before the first `await`. Claiming after the POST would leave the guard above
9891
+ // useless: two callers would both read false, both suspend on the fetch, and both proceed — precisely
9892
+ // the overlap the guard exists to prevent.
9893
+ // The CLAIM is taken now; the LABEL is not. `refPreviewFor` drives a sentence asserting that grey
9894
+ // geometry is on the canvas, and at this instant none is — the first batch is seconds away, and on a
9895
+ // FILTERED import none ever arrives, because `wantsSegments` refuses to segment those at all. Setting
9896
+ // it here would point that sentence at an empty canvas for the whole import. It is set on the first
9897
+ // batch instead, where the claim becomes true. (Code + UX review.)
9898
+ refPreviewBusy=true;refPreviewFor=null;
9899
+ const label=displayName||null;
9900
+ const giveUp=()=>{refPreviewBusy=false;refPreviewFor=null;return null;};
9901
+ let sessionId=null;
9902
+ try{
9903
+ const res=await fetch(refApi('/progress'),{method:'POST',headers:{'content-type':'application/json'}});
9904
+ const d=await res.json().catch(()=>({}));
9905
+ if(!res.ok||!d.ok||!d.sessionId)return giveUp();
9906
+ sessionId=d.sessionId;
9907
+ }catch(e){return giveUp();} // an unreachable/older server gets today's behaviour
9908
+ let es=null,done=false,painted=0;
9909
+ // THE NOTE IS BORROWED, NOT OWNED, so it is put back. `#riProgNote` carries authored copy ("You can
9910
+ // close this — FloLess will keep importing this model.") that nothing else ever rewrites; without a
9911
+ // restore, the first preview replaces that affordance for the rest of the page's life, and a preview
9912
+ // run from `loadReferenceGeometry` — which has no modal open — leaves a stale count behind that the
9913
+ // NEXT import shows, about a different model. (Silent-failure review.)
9914
+ const noteEl=document.getElementById('riProgNote');
9915
+ const noteWas=noteEl?noteEl.textContent:null;
9916
+ const close=()=>{
9917
+ if(done)return;done=true;
9918
+ try{es&&es.close();}catch(e){}
9919
+ // CLEARED BEFORE the authoritative geometry is built by `pushReferences`, never after, so peak GPU
9920
+ // is the larger of preview and real rather than their sum.
9921
+ try{V.clearReferencePreview&&V.clearReferencePreview();}catch(e){console.error('[reference] preview dispose failed',e);}
9922
+ // Put the borrowed note back exactly as it was, so the next import starts from the authored copy.
9923
+ if(noteEl&&noteWas!==null)noteEl.textContent=noteWas;
9924
+ refPreviewBusy=false;refPreviewFor=null;
9925
+ // The panel is showing preview copy that is no longer true; repaint it. Guarded because `close()`
9926
+ // also runs on paths where the tab was never the references one.
9927
+ try{if(legendTab==='refs')renderRefsTab();}catch(e){}
9928
+ };
9929
+ try{
9930
+ es=new EventSource(refApi('/progress/'+encodeURIComponent(sessionId)));
9931
+ es.onmessage=(ev)=>{
9932
+ if(done)return;
9933
+ let m=null;try{m=JSON.parse(ev.data);}catch(e){return;}
9934
+ if(!m)return;
9935
+ if(m.type==='stopped'){
9936
+ // TERMINAL. The server says so for a crossed cap, a suppressed channel, an overflow or the import
9937
+ // answering. The geometry stays on screen until `close()`, which the caller runs the moment it has
9938
+ // the real thing; only the STREAM ends here.
9939
+ //
9940
+ // AND THE LINE MUST BE CORRECTED, which this branch previously did not do. It closed the stream and
9941
+ // returned, leaving "…the rest are still being prepared" frozen on screen — a sentence that becomes
9942
+ // FALSE the instant the channel stops, because the rest of the preview is never coming even though
9943
+ // the import genuinely is still running. The comment here used to describe that exact failure as
9944
+ // the thing to avoid while the code committed it. (UX review.)
9945
+ try{es.close();}catch(e){}
9946
+ // ONLY WHEN DELIVERY STOPPED EARLY, which is what the reason distinguishes. A normal finish also
9947
+ // ends this channel — the pump is aborted the moment the read returns — and rewriting the line
9948
+ // then would flash "the live preview stopped there, but the import is still running" on EVERY
9949
+ // successful import, a second before the modal closes. True for that second and useless: the
9950
+ // sentence exists for the case where the preview stops and the wait genuinely continues.
9951
+ // INVERTED, so a reason nobody listed here is SAFE rather than silent. The first cut named the
9952
+ // three early stops explicitly — and omitted `error`, which is what a failed segment transfer
9953
+ // emits and so the likeliest early stop of all, plus `expired`. Those fell through to "say
9954
+ // nothing", freezing "…the rest are still being prepared" on screen for the remaining minutes of
9955
+ // the read: exactly the false sentence this branch was rewritten to prevent, reintroduced by an
9956
+ // allowlist. Only the two reasons that mean THE READ ITSELF ended stay quiet; anything else is an
9957
+ // early stop until proven otherwise. (Silent-failure review.)
9958
+ if(m.reason!=='aborted'&&m.reason!=='done')refPreviewStopped(painted);
9959
+ return;
9960
+ }
9961
+ if(m.type!=='batch'||!Array.isArray(m.objects))return;
9962
+ try{
9963
+ V.appendReferencePreview(m.objects,placement||null);
9964
+ // Once, on the first batch — a model at real site coordinates would otherwise preview entirely
9965
+ // off-screen, which for this feature is indistinguishable from it not working.
9966
+ V.frameReferencePreview&&V.frameReferencePreview();
9967
+ const first=painted===0;
9968
+ painted=m.painted||painted;
9969
+ refPreviewNote(painted);
9970
+ // The label goes up with the FIRST batch — the moment its sentence becomes true — and the panel is
9971
+ // repainted once, then never again per batch, which would be pure churn.
9972
+ if(first){refPreviewFor=label;if(legendTab==='refs')renderRefsTab();}
9973
+ }catch(e){console.error('[reference] preview batch failed',e);}
9974
+ };
9975
+ // An EventSource error is ordinary here (the server ends the stream when the import answers) and
9976
+ // must stay silent: the import owns the outcome and is about to report it.
9977
+ es.onerror=()=>{};
9978
+ }catch(e){return {progressId:sessionId,close};}
9979
+ return {progressId:sessionId,close};
9980
+ }
9981
+
9982
+ /**
9983
+ * Say what the preview is showing, in the modal's own progress line.
9984
+ *
9985
+ * A count rather than a bar: the total is not known until the walk ends (that is the whole reason this
9986
+ * feature exists), so a percentage would be invented. "Showing 1,300 objects so far" is true.
9987
+ */
9988
+ function refPreviewNote(painted){
9989
+ const el=document.getElementById('riProgNote');
9990
+ if(!el||!painted)return;
9991
+ el.textContent='Showing '+painted.toLocaleString('en-US')+' object'+(painted===1?'':'s')+' so far — the rest are still being prepared.';
9992
+ }
9993
+
9994
+ /**
9995
+ * The preview stream has ended while the import continues — say so, precisely.
9996
+ *
9997
+ * THE SENTENCE MUST STOP PROMISING. "…the rest are still being prepared" is true only while batches
9998
+ * are still coming; once the channel is done it describes something that will never happen, on a modal
9999
+ * that is otherwise scrupulous about claiming only what it can back up. The import is genuinely still
10000
+ * running, so the copy has to separate the two: the PREVIEW stopped, the IMPORT did not.
10001
+ *
10002
+ * Two cases, because they are different facts. Some geometry arrived and then delivery ended (the cap,
10003
+ * a suppressed channel, an overflow) — name what is on screen and that it stops there. Or none ever
10004
+ * arrived, in which case saying "showing 0 objects" would be worse than saying nothing about a count.
10005
+ */
10006
+ function refPreviewStopped(painted){
10007
+ const el=document.getElementById('riProgNote');
10008
+ if(!el)return;
10009
+ el.textContent=painted>0
10010
+ ? 'Showing '+painted.toLocaleString('en-US')+' object'+(painted===1?'':'s')+' — the live preview stopped there, but the import is still running.'
10011
+ : "A live preview isn't available for this import — it's still converting in the background.";
10012
+ }
10013
+
9657
10014
  /**
9658
10015
  * Fetch one reference's geometry.
9659
10016
  *
@@ -9668,11 +10025,17 @@ function pushReferences(){
9668
10025
  async function loadReferenceGeometry(id,opts){
9669
10026
  if(refGeom.has(id)||refLoading.has(id))return;
9670
10027
  refLoading.add(id);if(legendTab==='refs')renderRefsTab();
10028
+ // THE COLD-CACHE PATH IS WHERE THIS MATTERS MOST. The geometry cache is reserved-internal, so every
10029
+ // imported or duplicated project arrives with nothing cached and rebuilds here — someone opening a
10030
+ // shared project waits the whole read before a single triangle appears. The preview uses the stored
10031
+ // placement so it lands where the finished reference will.
10032
+ const pv=await refPreviewOpen((refById(id)||{}).placement||null,(refById(id)||{}).name||null).catch(()=>null);
9671
10033
  try{
9672
10034
  // INSIDE the suffix, not appended after. `refApi` already adds `?project=` and picks its own
9673
10035
  // separator from whether the suffix carries a `?` — appending afterwards produced a second `?`
9674
10036
  // and a 400, which is exactly what the browser pass caught.
9675
- const res=await fetch(refApi('/'+encodeURIComponent(id)+'/geometry'+((opts&&opts.rebuild)?'?rebuild=1':'')));
10037
+ const q=[(opts&&opts.rebuild)?'rebuild=1':'',pv?'progressId='+encodeURIComponent(pv.progressId):''].filter(Boolean).join('&');
10038
+ const res=await fetch(refApi('/'+encodeURIComponent(id)+'/geometry'+(q?'?'+q:'')));
9676
10039
  const d=await res.json().catch(()=>({}));
9677
10040
  // A LATE RESPONSE FOR A REMOVED REFERENCE IS DROPPED. These bodies can be hundreds of megabytes, and
9678
10041
  // repopulating `refGeom` under an id the contract no longer holds leaks all of it while making the
@@ -9714,7 +10077,11 @@ async function loadReferenceGeometry(id,opts){
9714
10077
  // here destroys an in-progress edit: a member selected, a value half-typed and not yet blurred, and any
9715
10078
  // reference finishing its fetch removes the focused input and restores the old value. `loadAllReferences`
9716
10079
  // fires one of these per uncached reference at boot, so it is not a rare race. (Both halves: Codex.)
9717
- finally{refLoading.delete(id);pushReferences();if(legendTab==='refs')renderRefsTab();if(refSelectedObjIdx!==null)panel();}
10080
+ // `pv.close()` FIRST, so the preview is gone before `pushReferences()` builds the authoritative
10081
+ // meshes — the two must never be in the scene together, and disposing first is what keeps peak GPU
10082
+ // at the larger of them rather than their sum. It runs on every exit, including the arms above that
10083
+ // return early for a removed reference.
10084
+ finally{if(pv)pv.close();refLoading.delete(id);pushReferences();if(legendTab==='refs')renderRefsTab();if(refSelectedObjIdx!==null)panel();}
9718
10085
  }
9719
10086
  /** Pull every reference's geometry once the 3D view is up. Sequential: one AWARE run at a time anyway. */
9720
10087
  async function loadAllReferences(){for(const r of refList())await loadReferenceGeometry(r.id);}
@@ -10002,7 +10369,14 @@ function renderRefsTab(){const host=document.getElementById('m3dRefsBody');if(!h
10002
10369
 
10003
10370
  const all=refList();
10004
10371
  if(!all.length){const e=Object.assign(document.createElement('div'),{className:'refempty'});
10005
- e.textContent='No reference models yet — add somebody else’s IFC to see it beside your steel and snap to it. It never enters your BOM, an export, or the lock.';
10372
+ // A PREVIEW ON THE CANVAS MAKES THE PERMANENT COPY READ AS A CONTRADICTION. "No reference models yet"
10373
+ // is literally true while an import is still running — nothing is committed, which is the whole point
10374
+ // of the preview being kept out of `refGeom` and `xrefById` — but a user looking at a grey building on
10375
+ // screen is being told it is not there. Both facts are said instead: it is a preview, and it becomes a
10376
+ // row when the import finishes. (UX review.)
10377
+ e.textContent=refPreviewFor
10378
+ ? 'Reading “'+refPreviewFor+'” — the grey model on the canvas is a live preview. It will appear here as a reference once the import finishes.'
10379
+ : 'No reference models yet — add somebody else’s IFC to see it beside your steel and snap to it. It never enters your BOM, an export, or the lock.';
10006
10380
  host.appendChild(e);return;}
10007
10381
  for(const r of all){host.appendChild(buildRefRow(r));if(r.id===refSelectedId)host.appendChild(buildRefDetail(r));}
10008
10382
  // …and put the caret back where it was. Done here rather than in buildRefMeasureCard because focus only
@@ -11605,6 +11979,10 @@ function adoptReferenceWrite(etag){if(!etag)return;const prev=serverEtag;serverE
11605
11979
  const riOriginShift=takeOrigin&&riProbeCentre?riProbeCentre.map((v,i)=>riNative[i]-v):null;
11606
11980
  riStage('prog');ri$('riTitle').textContent='Converting into 3D viewer geometry';ri$('riProgNote').style.display='block';ri$('riCancel').textContent='Continue in background';riProg('Converting “'+riName+'” into 3D viewer geometry…','AWARE is tessellating objects and preparing the viewer file. Whole-building models can take several minutes; FloLess will add the reference when that completes.');
11607
11981
  let mid=null;
11982
+ // OPENED BEFORE THE POST, which is the whole ordering requirement: batches announced early would
11983
+ // otherwise be published to a session nobody had attached to yet. Null whenever a preview is not
11984
+ // available — an older server, a blocked EventSource, or a filtered read, which never segments.
11985
+ const riPreview=await refPreviewOpen(takeOrigin&&riOriginShift?{origin:riOriginShift}:null,riName).catch(()=>null);
11608
11986
  try{
11609
11987
  mid=newMutationId();riMutationId=mid;claimMutation(mid);
11610
11988
  const res=await fetch(refApi(''),{method:'POST',signal,headers:{'content-type':'application/json','x-floless-mutation-id':mid},
@@ -11616,7 +11994,10 @@ function adoptReferenceWrite(etag){if(!etag)return;const prev=serverEtag;serverE
11616
11994
  // part of what the user decided in this modal, so it belongs inside the point of no return
11617
11995
  // rather than in a PUT afterwards. `undefined` here means the whole file — never an empty list,
11618
11996
  // which the reader would read as "select nothing".
11619
- body:JSON.stringify({sha:riSha,name:riName,...(riFilterBody?{filter:riFilterBody}:{}),...(takeOrigin&&riOriginShift?{placement:{origin:riOriginShift}}:{})})});
11997
+ // `progressId` binds this import to the channel opened above. The server refuses a session
11998
+ // belonging to another app or project, and ignores an absent one — so an older server, or a
11999
+ // request without it, is simply the behaviour that shipped before this feature.
12000
+ body:JSON.stringify({sha:riSha,name:riName,...(riPreview?{progressId:riPreview.progressId}:{}),...(riFilterBody?{filter:riFilterBody}:{}),...(takeOrigin&&riOriginShift?{placement:{origin:riOriginShift}}:{})})});
11620
12001
  d=await res.json().catch(()=>({}));
11621
12002
  if(mine!==riRun){
11622
12003
  // Cancelled while this was in flight. The server refuses to commit for a client that has gone
@@ -11659,7 +12040,13 @@ function adoptReferenceWrite(etag){if(!etag)return;const prev=serverEtag;serverE
11659
12040
  if(mine!==riRun||(e&&e.name==='AbortError')){if(mid)releaseMutation(mid);if(riMutationId===mid)riMutationId=null;return;}
11660
12041
  if(riBackgrounded)toast('Reference import failed — the model could not be added.');
11661
12042
  riClearSoft();riStage('drop');riErr('Could not add that reference.');console.error('[reference] insert failed',e);return;}
11662
- finally{if(mine===riRun){riBusy=false;riAbort=null;riBackgrounded=false;ri$('riCancel').textContent='Cancel';}if(riMutationId===mid)riMutationId=null;}
12043
+ finally{
12044
+ // EVERY EXIT — committed, refused, cancelled, thrown. The preview is standing in for a model
12045
+ // that has now either arrived or been refused, so leaving it on screen would show geometry
12046
+ // beside the real thing, or geometry for an import that was rejected. This runs BEFORE
12047
+ // `pushReferences()` below builds the authoritative meshes, so the two never coexist.
12048
+ if(riPreview)riPreview.close();
12049
+ if(mine===riRun){riBusy=false;riAbort=null;riBackgrounded=false;ri$('riCancel').textContent='Cancel';}if(riMutationId===mid)riMutationId=null;}
11663
12050
  // ── PAST THE POINT OF NO RETURN. Everything above is the transaction; everything below is showing
11664
12051
  // it. They were one try, and a throw in the presentation half ran riErr() on a modal riClose() had
11665
12052
  // already hidden — so the user saw NOTHING while the reference was committed and on disk, and the
@@ -12551,7 +12938,7 @@ function runApplyAllDetails(force){
12551
12938
  body.append(el('div','font-size:12px;line-height:1.5;color:var(--mut);margin-bottom:'+(order.length?'10px':'0'),head.join(' ')));
12552
12939
  if(order.length){
12553
12940
  const lab=el('div',null,'Left alone — '+res.skipped.length);lab.className='elab';body.append(lab);
12554
- const list=el('div','max-height:220px;overflow:auto;scrollbar-width:thin;scrollbar-color:#475569 transparent;border:1px solid var(--line);border-radius:6px;padding:6px 8px');
12941
+ const list=el('div','max-height:220px;overflow:auto;scrollbar-width:thin;scrollbar-color:var(--scroll) transparent;border:1px solid var(--line);border-radius:6px;padding:6px 8px');
12555
12942
  list.className='dnotes';
12556
12943
  for(const k of order){
12557
12944
  const g=groups[k];
@@ -12577,7 +12964,7 @@ function renderConnTable(){const tb=document.getElementById('connBody');if(!tb)r
12577
12964
  const rows=C.connections||[];
12578
12965
  if(!rows.length){tb.innerHTML='<tr><td colspan=5 style="text-align:center;padding:32px;color:var(--mut);font-size:12px">No connections defined — click + New row to add the first.</td></tr>';updConnBtn();return;}
12579
12966
  const dupKeys=new Set(dupDetailKeys()); // detail numbers that two or more rows share, once for the whole table
12580
- const srcChip=s=>s==='drawing'?'<span class="chip assumed">drawing</span>':s==='company-rules'?'<span class=chip>company-rules</span>':'<span class=chip style="border-color:#1d4ed8;color:#93c5fd">user</span>';
12967
+ const srcChip=s=>s==='drawing'?'<span class="chip assumed">drawing</span>':s==='company-rules'?'<span class=chip>company-rules</span>':'<span class="chip user">user</span>';
12581
12968
  tb.innerHTML=rows.map(r=>`<tr data-id="${esc(r.id)}">`
12582
12969
  +`<td><input class="combo ftab-inp" data-src=conntypes data-f=type value="${esc(r.type||'')}" placeholder="moment" autocomplete=off></td>`
12583
12970
  +`<td><input class="combo ftab-inp" data-src=details data-f=detail value="${esc(r.detail||'')}" placeholder="e.g. 50S504" autocomplete=off>`
@@ -12752,8 +13139,8 @@ document.getElementById('rfiBackdrop').onclick=closeRFI;
12752
13139
  // Deterministic: scores ONLY observable evidence already in the contract, never a model self-report.
12753
13140
  const BANDW={verified:1,high:.9,med:.65,low:.35,rfi:0};
12754
13141
  const BANDLAB={verified:'Verified',high:'High',med:'Medium',low:'Low',rfi:'RFI'};
12755
- const BANDC={verified:'#86efac',high:'#4ade80',med:'#fbbf24',low:'#fca5a5',rfi:'#fca5a5'};
12756
- const BANDPILL={verified:'background:#166534;color:#86efac',high:'background:#14532d;color:#4ade80',med:'background:#713f12;color:#fbbf24',low:'background:#7f1d1d;color:#fca5a5',rfi:'background:#7f1d1d;color:#fca5a5'};
13142
+ const BANDC={verified:'var(--ok)',high:'var(--hi)',med:'var(--warn)',low:'var(--err)',rfi:'var(--err)'};
13143
+ const BANDPILL={verified:'background:var(--ok-bg);color:var(--ok)',high:'background:var(--hi-bg);color:var(--hi)',med:'background:var(--warn-bg);color:var(--warn)',low:'background:var(--err-bg);color:var(--err)',rfi:'background:var(--err-bg);color:var(--err)'};
12757
13144
  // The AISC catalogue weight — the only way most of the catalogue can be weighed at all. Nothing in
12758
13145
  // "HSS4X4X3/8" encodes 17.27 lb/ft, so before the table carried weights every hollow section, angle
12759
13146
  // and double angle read as "not in the AISC table", was flagged RFI, and contributed 0 lb to the
@@ -14513,7 +14900,7 @@ function askAiAddFile(file) {
14513
14900
  askAiSetStatus('Encoding image…');
14514
14901
  readImageCompressed(file, b64 => {
14515
14902
  try {
14516
- if (!b64) { askAiSetStatus('Could not read that image — try another.', '#fca5a5'); return; }
14903
+ if (!b64) { askAiSetStatus('Could not read that image — try another.', 'var(--err)'); return; }
14517
14904
  askAiSnapshots.push({ name, dataUrl: 'data:image/jpeg;base64,' + b64 });
14518
14905
  askAiRenderThumbs();
14519
14906
  askAiSetStatus('');
@@ -14563,14 +14950,14 @@ document.addEventListener('paste', e => {
14563
14950
  // Send handler
14564
14951
  document.getElementById('askAiSend').onclick = async () => {
14565
14952
  const instruction = document.getElementById('askAiText').value.trim();
14566
- if (!instruction) { askAiSetStatus('Please enter an instruction.', '#fca5a5'); return; }
14953
+ if (!instruction) { askAiSetStatus('Please enter an instruction.', 'var(--err)'); return; }
14567
14954
  const sendBtn = document.getElementById('askAiSend');
14568
14955
  sendBtn.disabled = true;
14569
14956
  askAiSetStatus('Saving contract…', 'var(--mut)');
14570
14957
  try {
14571
14958
  await window.flushContract();
14572
14959
  } catch (err) {
14573
- askAiSetStatus('Could not save the contract — check the server and try again.', '#fca5a5');
14960
+ askAiSetStatus('Could not save the contract — check the server and try again.', 'var(--err)');
14574
14961
  sendBtn.disabled = false;
14575
14962
  return;
14576
14963
  }
@@ -14588,23 +14975,23 @@ document.getElementById('askAiSend').onclick = async () => {
14588
14975
  });
14589
14976
  if (res.ok) {
14590
14977
  askAiClearForm();
14591
- askAiSetStatus('Queued — the request is waiting for your terminal AI session to pick it up.', '#86efac');
14978
+ askAiSetStatus('Queued — the request is waiting for your terminal AI session to pick it up.', 'var(--ok)');
14592
14979
  // leave the panel open so the user can read the confirmation, then close manually
14593
14980
  } else {
14594
14981
  let errText = 'Request failed (' + res.status + ')';
14595
14982
  try { const body = await res.json(); if (body && body.error) errText = body.error; } catch (_) {}
14596
- askAiSetStatus(errText, '#fca5a5');
14983
+ askAiSetStatus(errText, 'var(--err)');
14597
14984
  sendBtn.disabled = false;
14598
14985
  }
14599
14986
  } catch (err) {
14600
- askAiSetStatus('Network error — check the server and try again.', '#fca5a5');
14987
+ askAiSetStatus('Network error — check the server and try again.', 'var(--err)');
14601
14988
  sendBtn.disabled = false;
14602
14989
  }
14603
14990
  };
14604
14991
  // Esc closes the Ask-AI panel (inserted before other modal Esc checks in the existing keydown handler)
14605
14992
  document.getElementById('reloadB').onclick = () => location.reload();
14606
14993
  } // end main()
14607
- boot().catch(err => { document.body.replaceChildren(Object.assign(document.createElement('p'), { textContent: 'Failed to load: ' + err.message, style: 'padding:24px;color:#ef4444' })); });
14994
+ boot().catch(err => { document.body.replaceChildren(Object.assign(document.createElement('p'), { textContent: 'Failed to load: ' + err.message, style: 'padding:24px;color:var(--err)' })); });
14608
14995
 
14609
14996
  // Themed tooltips (replaces native title=) for the 3D toolbar — one shared element, shown on
14610
14997
  // data-tip hover after a short delay, positioned below the control and clamped to the viewport.