@floless/app 0.149.1 → 0.150.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.
Files changed (48) hide show
  1. package/dist/floless-server.cjs +101814 -88311
  2. package/dist/schemas/drawing-check.profile.v1.schema.json +45 -2
  3. package/dist/schemas/steel.model.v2.schema.json +9 -0
  4. package/dist/skills/floless-app-approval/SKILL.md +79 -4
  5. package/dist/skills/floless-app-onboarding/SKILL.md +4 -4
  6. package/dist/skills/floless-app-onboarding/references/aware-runtime.md +1 -1
  7. package/dist/skills/floless-app-onboarding/references/floless-app-tour.md +15 -13
  8. package/dist/skills/floless-app-routines/SKILL.md +4 -1
  9. package/dist/skills/floless-app-routines/references/routines-api.md +14 -2
  10. package/dist/skills/floless-app-steel-model/SKILL.md +4 -2
  11. package/dist/skills/floless-app-steel-takeoff/SKILL.md +14 -9
  12. package/dist/skills/floless-app-workflows/SKILL.md +2 -2
  13. package/dist/templates/tekla-parser.flo +13 -3
  14. package/dist/web/agents.js +887 -0
  15. package/dist/web/app.css +458 -23
  16. package/dist/web/app.js +20 -5
  17. package/dist/web/aware.js +1339 -134
  18. package/dist/web/chat.css +50 -1
  19. package/dist/web/chat.js +1582 -52
  20. package/dist/web/commands-drawing-check.js +15 -0
  21. package/dist/web/commands-revit.js +5 -0
  22. package/dist/web/commands-shell.js +761 -47
  23. package/dist/web/commands-tekla-parser.js +8 -1
  24. package/dist/web/connections.js +57 -14
  25. package/dist/web/drawing-check-editor.html +10 -2
  26. package/dist/web/drawing-check-editor.js +569 -40
  27. package/dist/web/drawing-check-overlay.js +45 -2
  28. package/dist/web/index.html +98 -27
  29. package/dist/web/instructor.js +85 -8
  30. package/dist/web/leave-guard.js +1 -0
  31. package/dist/web/left-pane.js +20 -1
  32. package/dist/web/local-discovery.js +12 -2
  33. package/dist/web/model-editor.css +32 -32
  34. package/dist/web/model-panel-bridge.js +11 -3
  35. package/dist/web/model-viewport-lighting.js +4 -2
  36. package/dist/web/model-viewport-revit-adapter.js +3 -0
  37. package/dist/web/model-viewport-toolbar.js +6 -3
  38. package/dist/web/model-viewport.js +11 -1
  39. package/dist/web/revit-editor.css +14 -14
  40. package/dist/web/revit-editor.js +64 -12
  41. package/dist/web/steel-3d-core.js +133 -0
  42. package/dist/web/steel-3d-view.js +10 -0
  43. package/dist/web/steel-editor.html +171 -39
  44. package/dist/web/steel-model-v2-client-validation.js +11 -0
  45. package/dist/web/steel-model-v2-commands.js +80 -5
  46. package/dist/web/tool-updates.js +367 -0
  47. package/dist/web/workspaces.js +679 -59
  48. package/package.json +1 -1
@@ -209,7 +209,13 @@
209
209
  if (!agent.hasProbe || !connections()) continue;
210
210
  actions.append(connections().checkButton({ agent: agent.id, label: agent.name, receiptHost, confirmHost, announce }));
211
211
  }
212
- if (hostAgents.length && !hostAgents.some((agent) => agent.hasProbe)) {
212
+ // #1986: a tool with no check whose newer version may add one says so and offers that update (in the Agent Library).
213
+ const offers = hostAgents.filter((agent) => !agent.hasProbe && agent.update && typeof agent.updateMessage === 'string');
214
+ const offerNodes = (connections() ? offers : []).map((agent) =>
215
+ connections().updateOfferNode(agent.updateMessage, agent.update, agent.updateNote, announce, 'then scan again to check it'));
216
+ // The plain line stays unless EVERY tool on the card that has no check is offered an update (each offer names its tool).
217
+ const allOffered = connections() && hostAgents.every((agent) => agent.hasProbe || offers.includes(agent));
218
+ if (hostAgents.length && !hostAgents.some((agent) => agent.hasProbe) && !allOffered) {
213
219
  card.append(make('p', 'local-discovery-route', 'This tool can’t check the connection yet.'));
214
220
  }
215
221
  if (route?.kind === 'graft' && !route.graftKind) {
@@ -234,7 +240,10 @@
234
240
  chat.type = 'button'; chat.dataset.commandId = 'shell.discovery-ask-chat';
235
241
  chat.addEventListener('click', async () => {
236
242
  const detail = [finding.label, finding.kind, finding.path, finding.version].filter(Boolean).join(' · ');
237
- const draft = `I found this local tool: ${detail}. Help me decide how to use it in this project. Do not connect to it or run anything yet.`;
243
+ // #1900: name the installed tool that connects it, so AI Chat can offer that exact connection as a card.
244
+ const via = hostAgents.map((agent) => `${agent.name} (${agent.id})`).join(', ');
245
+ const draft = `I found this local tool: ${detail}.${via ? ` FloLess can connect it with: ${via}.` : ''} `
246
+ + 'Help me decide how to use it. Do not connect to it or run anything yet.';
238
247
  try {
239
248
  await window.flolessChat.openDraft(draft);
240
249
  close(false);
@@ -243,6 +252,7 @@
243
252
  actions.append(chat);
244
253
  card.append(actions, confirmHost, receiptHost);
245
254
  if (latest) receiptHost.replaceChildren(connections().receiptNode(latest));
255
+ receiptHost.append(...offerNodes);
246
256
  return card;
247
257
  }
248
258
  /** "Services you can connect" — sign-in services and key services, from Integrations' inventory. */
@@ -50,14 +50,14 @@
50
50
 
51
51
  /* Master Steel's view band is the visual contract for every model provider. One shared card owns the
52
52
  shadow; controls are compact icons and wrap before they can cover the ViewCube. */
53
- #m3dBar.model-view-toolbar{position:absolute;inset:auto;top:12px;left:12px;right:auto;bottom:auto;display:flex;flex:0 1 auto;flex-direction:row;flex-wrap:wrap;gap:2px;align-items:center;z-index:59;max-width:calc(100% - 124px);padding:4px;background:var(--panel);border:1px solid var(--line);border-radius:9px;box-shadow:0 6px 20px rgba(0,0,0,.5);pointer-events:auto}
53
+ #m3dBar.model-view-toolbar{position:absolute;inset:auto;top:12px;left:12px;right:auto;bottom:auto;display:flex;flex:0 1 auto;flex-direction:row;flex-wrap:wrap;gap:2px;align-items:center;z-index:59;max-width:calc(100% - 124px);padding:4px;background:var(--panel);border:1px solid var(--line);border-radius:9px;box-shadow:0 6px 20px var(--model-shadow,rgba(0,0,0,.5));pointer-events:auto}
54
54
  .steel-model-editor #m3dBar.model-view-toolbar{display:none}
55
55
  .revit-model-editor #m3dBar.model-view-toolbar{display:flex}
56
56
  #m3dBar.model-view-toolbar>.m3dwrap{position:relative;display:block;width:30px;flex:none}
57
57
  #m3dBar.model-view-toolbar>.m3dwrap>button,#m3dBar.model-view-toolbar>button{width:30px;height:30px;min-width:0;min-height:0;padding:0;display:flex;align-items:center;justify-content:center;background:transparent;border:1px solid transparent;border-radius:6px;box-shadow:none;color:var(--mut,var(--muted));font-size:12px}
58
58
  #m3dBar.model-view-toolbar button:hover{background:var(--btn-hover,#22324a);color:var(--text)}
59
59
  #m3dBar.model-view-toolbar button:disabled{opacity:.38;cursor:default;background:transparent;border-color:transparent;box-shadow:none}
60
- #m3dBar.model-view-toolbar button[aria-expanded="true"],#m3dBar.model-view-toolbar button.on,#m3dBar.model-view-toolbar .m3dwrap:has(>.m3dmenu.open)>button{background:#16243d;color:var(--brand,var(--accent,#60a5fa));border-color:var(--brand,var(--accent,#60a5fa))}
60
+ #m3dBar.model-view-toolbar button[aria-expanded="true"],#m3dBar.model-view-toolbar button.on,#m3dBar.model-view-toolbar .m3dwrap:has(>.m3dmenu.open)>button{background:var(--model-active-bg,#16243d);color:var(--brand,var(--accent,#60a5fa));border-color:var(--brand,var(--accent,#60a5fa))}
61
61
  #m3dBar.model-view-toolbar svg{width:16px;height:16px;display:block;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
62
62
  #m3dBar.model-view-toolbar svg[data-for]{display:none}
63
63
  #m3dBar.model-view-toolbar [data-model-control="model.projection"][data-proj="persp"] svg[data-for="persp"],#m3dBar.model-view-toolbar [data-model-control="model.projection"][data-proj="ortho"] svg[data-for="ortho"],#m3dBar.model-view-toolbar [data-model-control="model.display-mode"][data-mode="solid"] svg[data-for="solid"],#m3dBar.model-view-toolbar [data-model-control="model.display-mode"][data-mode="wire"] svg[data-for="wire"],#m3dBar.model-view-toolbar [data-model-control="model.display-mode"][data-mode="xray"] svg[data-for="xray"],#m3dBar.model-view-toolbar [data-model-control="model.display-mode"][data-mode="realistic"] svg[data-for="realistic"],#m3dBar.model-view-toolbar [data-model-control="model.display-mode"][data-mode="shadowed"] svg[data-for="shadowed"]{display:block}
@@ -74,7 +74,7 @@
74
74
  #m3dBar.model-view-toolbar button[data-state-code]::after{content:attr(data-state-code)}
75
75
  #m3dBar.model-view-toolbar button[data-state-on]::after{content:"";position:absolute;right:2px;bottom:2px;width:6px;height:6px;border-radius:50%;background:var(--cyan,#22d3ee);box-shadow:0 0 0 2px var(--panel);pointer-events:none}
76
76
  #m3dBar.model-view-toolbar .tb-sep{width:1px;height:22px;background:color-mix(in srgb,var(--text-dim,var(--muted)) 60%,transparent);flex:0 0 auto;align-self:center;margin:0 5px}
77
- #m3dBar.model-view-toolbar .m3dmenu{display:none;position:absolute;left:0;top:calc(100% + 6px);bottom:auto;min-width:172px;padding:4px 0;background:var(--panel);border:1px solid var(--ctrl-border,var(--line));border-radius:8px;box-shadow:var(--shadow-lg,0 8px 24px rgba(0,0,0,.5));z-index:30}
77
+ #m3dBar.model-view-toolbar .m3dmenu{display:none;position:absolute;left:0;top:calc(100% + 6px);bottom:auto;min-width:172px;padding:4px 0;background:var(--panel);border:1px solid var(--ctrl-border,var(--line));border-radius:8px;box-shadow:var(--shadow-lg,0 8px 24px var(--model-shadow,rgba(0,0,0,.5)));z-index:30}
78
78
  #m3dBar.model-view-toolbar .m3dmenu.open{display:block}
79
79
  #m3dBar.model-view-toolbar .m3dmenu button{display:block;width:100%;min-height:0;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}
80
80
  #m3dBar.model-view-toolbar .m3dmenu button:hover{background:var(--btn,#172235)}
@@ -111,13 +111,13 @@
111
111
 
112
112
  /* Canonical model orientation chrome. The canvases and their interaction are created by
113
113
  model-orientation-overlay.js; both Steel and Revit use these exact dimensions and offsets. */
114
- #m3dCube,.model-view-cube-host{position:absolute;right:12px;top:12px;width:84px;height:84px;z-index:8;pointer-events:auto;cursor:pointer;filter:drop-shadow(0 6px 14px rgba(0,0,0,.5))}
115
- #m3dAxes,.model-world-axes-host,.model-axis-triad-host{position:absolute;right:15px;bottom:12px;width:78px;height:78px;z-index:8;pointer-events:none;filter:drop-shadow(0 6px 14px rgba(0,0,0,.5))}
114
+ #m3dCube,.model-view-cube-host{position:absolute;right:12px;top:12px;width:84px;height:84px;z-index:8;pointer-events:auto;cursor:pointer;filter:drop-shadow(0 6px 14px var(--model-shadow,rgba(0,0,0,.5)))}
115
+ #m3dAxes,.model-world-axes-host,.model-axis-triad-host{position:absolute;right:15px;bottom:12px;width:78px;height:78px;z-index:8;pointer-events:none;filter:drop-shadow(0 6px 14px var(--model-shadow,rgba(0,0,0,.5)))}
116
116
  .model-view-cube-host canvas,#m3dCube canvas,.model-world-axes-host canvas,.model-axis-triad-host canvas,#m3dAxes canvas{display:block;width:100%;height:100%}
117
117
  .model-view-cube-host canvas:focus-visible,#m3dCube canvas:focus-visible{outline:2px solid var(--brand,var(--accent,#60a5fa));outline-offset:3px;border-radius:8px}
118
118
  .model-view-cube-status{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
119
119
 
120
- .model-clip-list{border-top:1px solid var(--line);margin-top:8px;padding-top:4px}.model-clip-list-header{height:30px;display:flex;align-items:center;gap:7px;padding:0 5px;color:var(--text)}.model-clip-list-header strong{font-size:11px;text-transform:uppercase;letter-spacing:.08em}.model-clip-count{min-width:18px;height:18px;display:grid;place-items:center;border-radius:9px;background:var(--btn);color:var(--muted);font-size:10px}.model-clip-enable-all{width:24px;min-width:24px;min-height:24px;padding:0;border:0;background:transparent;color:var(--muted);box-shadow:none}.model-clip-enable-all[data-state="on"]{color:var(--brand,#60a5fa)}.model-clip-enable-all[data-state="mixed"]{color:#64748b}.model-clip-clear{margin-left:auto}.model-clip-list-rows{display:grid;align-content:start;gap:2px}.model-clip-row{min-height:30px;display:grid;grid-template-columns:24px minmax(0,1fr) 24px;align-items:center;gap:4px;border-radius:5px;padding:2px 3px}.model-clip-row:hover,.model-clip-row.is-selected{background:var(--accent-soft)}.model-clip-row.is-selected{outline:1px solid color-mix(in srgb,var(--brand,#3b82f6) 58%,transparent)}.model-clip-row button{min-width:0;min-height:24px;padding:2px 5px;border:0;background:transparent;color:var(--muted);box-shadow:none}.model-clip-row button:hover{background:var(--btn-hover);color:var(--text)}.model-clip-enable{width:22px;border:1px solid var(--line)!important;color:var(--brand,#60a5fa)!important}.model-clip-enable[aria-pressed="false"]{color:transparent!important}.model-clip-label{text-align:left;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--text)!important}.model-clip-remove{font-size:16px;line-height:1}.model-clip-rename{width:100%;min-width:0;height:25px;border:1px solid var(--brand,#3b82f6);border-radius:4px;background:var(--bg,#020817);color:var(--text);padding:2px 6px;font:inherit;outline:none}.model-clip-list-empty{padding:10px 7px 12px;color:var(--muted);font-size:11px;line-height:1.45}.model-clip-drag-readout{position:fixed;z-index:60;pointer-events:none;padding:5px 9px;border:1px solid var(--line);border-radius:5px;background:var(--panel);color:var(--text);box-shadow:0 3px 10px rgba(0,0,0,.45);font:11px var(--mono,monospace)}
120
+ .model-clip-list{border-top:1px solid var(--line);margin-top:8px;padding-top:4px}.model-clip-list-header{height:30px;display:flex;align-items:center;gap:7px;padding:0 5px;color:var(--text)}.model-clip-list-header strong{font-size:11px;text-transform:uppercase;letter-spacing:.08em}.model-clip-count{min-width:18px;height:18px;display:grid;place-items:center;border-radius:9px;background:var(--btn);color:var(--muted);font-size:10px}.model-clip-enable-all{width:24px;min-width:24px;min-height:24px;padding:0;border:0;background:transparent;color:var(--muted);box-shadow:none}.model-clip-enable-all[data-state="on"]{color:var(--brand,#60a5fa)}.model-clip-enable-all[data-state="mixed"]{color:#64748b}.model-clip-clear{margin-left:auto}.model-clip-list-rows{display:grid;align-content:start;gap:2px}.model-clip-row{min-height:30px;display:grid;grid-template-columns:24px minmax(0,1fr) 24px;align-items:center;gap:4px;border-radius:5px;padding:2px 3px}.model-clip-row:hover,.model-clip-row.is-selected{background:var(--accent-soft)}.model-clip-row.is-selected{outline:1px solid color-mix(in srgb,var(--brand,#3b82f6) 58%,transparent)}.model-clip-row button{min-width:0;min-height:24px;padding:2px 5px;border:0;background:transparent;color:var(--muted);box-shadow:none}.model-clip-row button:hover{background:var(--btn-hover);color:var(--text)}.model-clip-enable{width:22px;border:1px solid var(--line)!important;color:var(--brand,#60a5fa)!important}.model-clip-enable[aria-pressed="false"]{color:transparent!important}.model-clip-label{text-align:left;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--text)!important}.model-clip-remove{font-size:16px;line-height:1}.model-clip-rename{width:100%;min-width:0;height:25px;border:1px solid var(--brand,#3b82f6);border-radius:4px;background:var(--bg,#020817);color:var(--text);padding:2px 6px;font:inherit;outline:none}.model-clip-list-empty{padding:10px 7px 12px;color:var(--muted);font-size:11px;line-height:1.45}.model-clip-drag-readout{position:fixed;z-index:60;pointer-events:none;padding:5px 9px;border:1px solid var(--line);border-radius:5px;background:var(--panel);color:var(--text);box-shadow:0 3px 10px var(--model-shadow,rgba(0,0,0,.45));font:11px var(--mono,monospace)}
121
121
 
122
122
  /* Inspector seam, stub and grip are shared with master Steel. */
123
123
  .model-inspector-resizer{flex:none;width:11px;cursor:col-resize;background:transparent;position:relative;z-index:6;touch-action:none;align-self:stretch}
@@ -144,24 +144,24 @@ body:has(.model-inspector-resizer.drag) .model-inspector-panel,body:has(.model-i
144
144
  split/layout ownership; Revit uses the neutral dock wrapper below. The inner bars are identical. */
145
145
  .model-bottom-dock{position:absolute;left:12px;right:104px;bottom:12px;z-index:14;display:flex;flex-wrap:wrap;align-items:flex-end;align-content:flex-end;justify-content:flex-end;gap:8px;min-width:0;pointer-events:none}
146
146
  .model-pointer-bars{display:flex;flex-wrap:wrap;align-items:flex-end;justify-content:flex-end;gap:8px;min-width:0;max-width:100%;flex:none;pointer-events:auto}
147
- .model-select-bar,.model-snap-bar,.model-module-actions{display:flex;align-items:center;gap:2px;padding:3px;background:var(--panel);border:1px solid var(--line);border-radius:8px;box-shadow:0 4px 14px rgba(0,0,0,.45);pointer-events:auto}
147
+ .model-select-bar,.model-snap-bar,.model-module-actions{display:flex;align-items:center;gap:2px;padding:3px;background:var(--panel);border:1px solid var(--line);border-radius:8px;box-shadow:0 4px 14px var(--model-shadow,rgba(0,0,0,.45));pointer-events:auto}
148
148
  .model-select-bar[hidden],.model-snap-bar[hidden],.model-module-actions[hidden]{display:none}
149
149
  .model-select-bar .lbl,.model-snap-bar .lbl{font-size:10px;text-transform:uppercase;letter-spacing:.07em;color:var(--mut,var(--muted));padding:0 4px;user-select:none;align-self:center}
150
150
  .model-select-bar button,.model-snap-bar button{width:28px;height:28px;min-width:0;min-height:0;display:grid;place-items:center;border:0;border-radius:5px;background:transparent;opacity:.55;font-size:15px;line-height:1;cursor:pointer;padding:0;position:relative;transition:background-color .12s,opacity .12s,color .12s,box-shadow .12s}
151
151
  .model-select-bar button{color:var(--text)}
152
152
  .model-select-bar button svg{width:17px;height:17px;display:block}
153
153
  .model-select-bar button:hover,.model-snap-bar button:hover{background:rgba(148,163,184,.12);opacity:.9}
154
- .model-select-bar button.on,.model-snap-bar button.on{background:var(--brand,var(--accent,#60a5fa));color:#0f172a;opacity:1}
154
+ .model-select-bar button.on,.model-snap-bar button.on{background:var(--brand,var(--accent,#60a5fa));color:var(--model-on-ink,#0f172a);opacity:1}
155
155
  .model-select-bar button.partial{opacity:1;color:var(--brand,var(--accent,#60a5fa));box-shadow:inset 0 0 0 1.5px var(--brand,var(--accent,#60a5fa))}
156
156
  .model-select-bar button.off{opacity:.4;color:var(--mut,var(--muted))}
157
157
  .model-select-bar button:focus-visible,.model-snap-bar button:focus-visible,.model-module-actions button:focus-visible{outline:2px solid var(--brand,var(--accent,#60a5fa));outline-offset:1px}
158
158
  .model-select-bar button .car{position:absolute;right:1px;bottom:0;font-size:8px;opacity:.7;pointer-events:none}
159
159
  .model-select-bar button .seldot{position:absolute;top:2px;right:2px;width:6px;height:6px;border-radius:50%;background:var(--brand,var(--accent,#60a5fa));box-shadow:0 0 0 1.5px var(--panel)}
160
- .model-snap-bar button{color:#22d3ee}
160
+ .model-snap-bar button{color:var(--model-snap-ink,#22d3ee)}
161
161
  .model-snap-bar [data-snap3d]{font-size:11px;font-weight:700;letter-spacing:.02em;margin-left:4px;border-left:1px solid var(--line);border-radius:0 5px 5px 0;padding-left:4px;box-sizing:border-box;width:32px}
162
162
  .model-module-actions{gap:5px}
163
163
  .model-module-actions button{min-height:28px;padding:3px 9px;font-size:11px}
164
- .model-module-actions button.on{background:var(--brand,var(--accent,#60a5fa));border-color:var(--brand,var(--accent,#60a5fa));color:#0f172a}
164
+ .model-module-actions button.on{background:var(--brand,var(--accent,#60a5fa));border-color:var(--brand,var(--accent,#60a5fa));color:var(--model-on-ink,#0f172a)}
165
165
  /* One line, width-capped: a sentence-long status (a snap refusal) must never widen the actions bar enough to
166
166
  wrap the dock (#1738). The full text is in the pill's data-tip and its role=status announcement. */
167
167
  .model-dock-status{min-width:52px;max-width:320px;padding:0 5px;color:var(--mut,var(--muted));font-size:10px;text-align:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
@@ -173,23 +173,23 @@ body:has(.model-inspector-resizer.drag) .model-inspector-panel,body:has(.model-i
173
173
  .model-dim-overlay{position:absolute;inset:0;width:100%;height:100%;overflow:visible}
174
174
  .dimension-mark line,.dimension-preview line{stroke:#60a5fa;stroke-width:1.5;vector-effect:non-scaling-stroke}
175
175
  .dimension-preview line{stroke-dasharray:5 4;opacity:.82}
176
- .dimension-mark.selected .dimension-line{stroke:#22d3ee;stroke-width:2.2}
176
+ .dimension-mark.selected .dimension-line{stroke:var(--model-snap-ink,#22d3ee);stroke-width:2.2}
177
177
  .dimension-witness{opacity:.72}.dimension-tick{stroke-width:1.8}
178
- .dimension-mark text,.dimension-preview text,.model-snap-reticle text{fill:#dbeafe;paint-order:stroke;stroke:#080d18;stroke-width:4px;stroke-linejoin:round;font-size:12px;text-anchor:middle}
179
- .model-snap-reticle circle,.model-snap-reticle line{fill:none;stroke:#22d3ee;stroke-width:1.5;vector-effect:non-scaling-stroke}
178
+ .dimension-mark text,.dimension-preview text,.model-snap-reticle text{fill:var(--model-overlay-ink,#dbeafe);paint-order:stroke;stroke:var(--model-overlay-halo,#080d18);stroke-width:4px;stroke-linejoin:round;font-size:12px;text-anchor:middle}
179
+ .model-snap-reticle circle,.model-snap-reticle line{fill:none;stroke:var(--model-snap-ink,#22d3ee);stroke-width:1.5;vector-effect:non-scaling-stroke}
180
180
  .model-snap-guide{fill:none;stroke:#38bdf8;stroke-width:1;stroke-dasharray:6 4;opacity:.78;vector-effect:non-scaling-stroke}
181
- .model-snap-reticle>text{fill:#22d3ee;font-size:10px;font-weight:700}
182
- .model-snap-reticle .model-snap-readout{fill:#dbeafe;font-size:10px;text-anchor:start}
183
- .model-snap-one-pick-menu{position:fixed;z-index:120;min-width:190px;display:grid;gap:2px;padding:5px;background:var(--panel);border:1px solid var(--line);border-radius:8px;box-shadow:0 10px 30px rgba(0,0,0,.48)}
181
+ .model-snap-reticle>text{fill:var(--model-snap-ink,#22d3ee);font-size:10px;font-weight:700}
182
+ .model-snap-reticle .model-snap-readout{fill:var(--model-overlay-ink,#dbeafe);font-size:10px;text-anchor:start}
183
+ .model-snap-one-pick-menu{position:fixed;z-index:120;min-width:190px;display:grid;gap:2px;padding:5px;background:var(--panel);border:1px solid var(--line);border-radius:8px;box-shadow:0 10px 30px var(--model-shadow,rgba(0,0,0,.48))}
184
184
  .model-snap-one-pick-heading{padding:5px 8px 4px;color:var(--mut,var(--muted));font-size:10px;letter-spacing:.08em;text-transform:uppercase}
185
185
  .model-snap-one-pick-menu button{min-height:29px;width:100%;padding:4px 8px;text-align:left;background:transparent;border-color:transparent;color:var(--text)}
186
186
  .model-snap-one-pick-menu button:hover,.model-snap-one-pick-menu button:focus-visible{background:rgba(59,130,246,.16);border-color:var(--line)}
187
- .model-dimension-editor{position:fixed;z-index:121;left:50%;bottom:76px;transform:translateX(-50%);min-width:320px;display:grid;gap:10px;padding:12px;background:var(--panel);border:1px solid var(--line);border-radius:9px;box-shadow:0 12px 34px rgba(0,0,0,.52);color:var(--text)}
187
+ .model-dimension-editor{position:fixed;z-index:121;left:50%;bottom:76px;transform:translateX(-50%);min-width:320px;display:grid;gap:10px;padding:12px;background:var(--panel);border:1px solid var(--line);border-radius:9px;box-shadow:0 12px 34px var(--model-shadow,rgba(0,0,0,.52));color:var(--text)}
188
188
  .model-dimension-editor>strong{font-size:12px;letter-spacing:.07em;text-transform:uppercase}
189
189
  .model-dimension-choice{display:grid;grid-template-columns:72px repeat(5,minmax(34px,1fr));gap:4px;align-items:center}
190
190
  .model-dimension-choice>span{color:var(--mut,var(--muted));font-size:10px;text-transform:uppercase}
191
191
  .model-dimension-choice button,.model-dimension-editor-actions button{min-height:28px;padding:3px 7px;background:var(--btn,var(--panel-2,#172235));border:1px solid var(--line);border-radius:5px;color:var(--text);font:inherit}
192
- .model-dimension-choice button.on{background:var(--brand,var(--accent,#60a5fa));border-color:var(--brand,var(--accent,#60a5fa));color:#0f172a}
192
+ .model-dimension-choice button.on{background:var(--brand,var(--accent,#60a5fa));border-color:var(--brand,var(--accent,#60a5fa));color:var(--model-on-ink,#0f172a)}
193
193
  .model-dimension-choice button:focus-visible,.model-dimension-editor-actions button:focus-visible{outline:2px solid var(--brand,var(--accent,#60a5fa));outline-offset:1px}
194
194
  .model-dimension-editor-actions{display:flex;justify-content:flex-end;gap:6px;padding-top:2px}
195
195
 
@@ -204,14 +204,14 @@ body:has(.model-inspector-resizer.drag) .model-inspector-panel,body:has(.model-i
204
204
  /* Shared spatial/frame/clip/work-area panel. It extends the existing model-spatial-dialog language;
205
205
  provider-dependent actions are omitted by the JS mount instead of rendered disabled. */
206
206
  .model-spatial-hud #modelFrameStatus,.model-spatial-hud [data-model-spatial-trigger]{pointer-events:auto;min-height:0;padding:0;border:0;background:transparent;color:var(--brand,var(--accent,#60a5fa));font:inherit;font-weight:700}
207
- .model-spatial-hud #modelFrameStatus:hover,.model-spatial-hud [data-model-spatial-trigger]:hover{color:#dbeafe;background:transparent}
207
+ .model-spatial-hud #modelFrameStatus:hover,.model-spatial-hud [data-model-spatial-trigger]:hover{color:var(--selected-ink,#dbeafe);background:transparent}
208
208
  .model-spatial-hud #modelFrameStatus:focus-visible,.model-spatial-hud [data-model-spatial-trigger]:focus-visible{outline:2px solid var(--brand,var(--accent,#60a5fa));outline-offset:3px;border-radius:3px}
209
- .model-spatial-dialog.model-spatial-panel{width:min(440px,calc(100vw - 24px));max-height:min(640px,82vh);padding:11px;background:var(--panel);border:1px solid var(--line-strong,var(--line));border-radius:9px;box-shadow:0 18px 48px rgba(0,0,0,.48);color:var(--text)}
209
+ .model-spatial-dialog.model-spatial-panel{width:min(440px,calc(100vw - 24px));max-height:min(640px,82vh);padding:11px;background:var(--panel);border:1px solid var(--line-strong,var(--line));border-radius:9px;box-shadow:0 18px 48px var(--model-shadow,rgba(0,0,0,.48));color:var(--text)}
210
210
  .model-spatial-panel>.model-spatial-dialog-header{flex:0 0 auto;padding-bottom:7px;border-bottom:1px solid var(--line)}
211
211
  .model-spatial-panel>.model-spatial-dialog-header>strong{font-size:12px;letter-spacing:.08em;text-transform:uppercase}
212
212
  .model-spatial-panel>.model-spatial-dialog-header>button{width:28px;height:28px;min-width:0;min-height:0;padding:0;display:grid;place-items:center}
213
213
  .model-spatial-panel-body{min-height:0;overflow:auto;display:grid;gap:9px;padding-right:2px}
214
- .model-spatial-section{min-width:0;margin:0;padding:9px;border:1px solid var(--line);border-radius:7px;background:rgba(8,13,24,.28)}
214
+ .model-spatial-section{min-width:0;margin:0;padding:9px;border:1px solid var(--line);border-radius:7px;background:var(--model-section-bg,rgba(8,13,24,.28))}
215
215
  .model-spatial-section>legend{padding:0 5px;color:var(--mut,var(--muted));font-size:10px;letter-spacing:.08em;text-transform:uppercase}
216
216
  .model-spatial-panel-summary{min-width:0;display:grid;gap:2px;margin-bottom:7px}
217
217
  .model-spatial-panel-summary>strong{font-size:12px}.model-spatial-panel-summary>span{min-width:0;color:var(--mut,var(--muted));font:10px/1.4 ui-monospace,SFMono-Regular,Consolas,monospace;overflow-wrap:anywhere}
@@ -226,7 +226,7 @@ body:has(.model-inspector-resizer.drag) .model-inspector-panel,body:has(.model-i
226
226
  .model-spatial-panel-actions{display:flex;align-items:center;justify-content:flex-end;gap:5px;flex-wrap:wrap;margin-top:7px}
227
227
  .model-spatial-panel button{min-height:28px;padding:3px 8px;color:var(--text);background:var(--btn,var(--panel-2,#172235));border:1px solid var(--line);border-radius:5px;font:inherit;cursor:pointer}
228
228
  .model-spatial-panel button:hover{background:rgba(59,130,246,.16);border-color:var(--line-strong,var(--line))}
229
- .model-spatial-panel button[aria-pressed="true"]{color:#dbeafe;background:rgba(59,130,246,.24);border-color:var(--brand,var(--accent,#60a5fa))}
229
+ .model-spatial-panel button[aria-pressed="true"]{color:var(--selected-ink,#dbeafe);background:rgba(59,130,246,.24);border-color:var(--brand,var(--accent,#60a5fa))}
230
230
  .model-spatial-panel button:focus-visible{outline:2px solid var(--brand,var(--accent,#60a5fa));outline-offset:1px}
231
231
  .model-spatial-clip{display:grid;gap:4px;margin-top:7px;padding:7px;border:1px solid var(--line);border-radius:6px;background:var(--panel-2,var(--panel))}
232
232
  .model-spatial-clip-heading{min-width:0;display:flex;align-items:center;justify-content:space-between;gap:8px}.model-spatial-clip-heading strong{font-size:11px}.model-spatial-clip-heading code{min-width:0;color:var(--mut,var(--muted));font-size:9px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
@@ -234,28 +234,28 @@ body:has(.model-inspector-resizer.drag) .model-inspector-panel,body:has(.model-i
234
234
  @media(max-width:560px){.model-spatial-dialog.model-spatial-panel{width:calc(100vw - 16px)}.model-spatial-panel-grid{grid-template-columns:66px repeat(3,minmax(0,1fr))}.model-spatial-panel-actions{justify-content:flex-start}}
235
235
 
236
236
  /* Shared model-viewer lighting popover. Both Steel and Revit mount this exact surface. */
237
- .model-lighting-panel{position:fixed;z-index:120;max-height:calc(100vh - 24px);overflow:auto;scrollbar-width:thin;scrollbar-color:#3b4c65 #111c2d;background:var(--panel,#111c2d);border:1px solid var(--line,#2b3b52);border-radius:10px;box-shadow:0 16px 42px rgba(0,0,0,.52);padding:14px;color:var(--text,#e5edf8)}
237
+ .model-lighting-panel{position:fixed;z-index:120;max-height:calc(100vh - 24px);overflow:auto;scrollbar-width:thin;scrollbar-color:var(--scroll,#3b4c65) var(--panel,#111c2d);background:var(--panel,#111c2d);border:1px solid var(--line,#2b3b52);border-radius:10px;box-shadow:0 16px 42px var(--model-shadow,rgba(0,0,0,.52));padding:14px;color:var(--text,#e5edf8)}
238
238
  .model-lighting-panel[hidden]{display:none}
239
239
  .model-lighting-panel::-webkit-scrollbar{width:8px}
240
- .model-lighting-panel::-webkit-scrollbar-track{background:#111c2d}
241
- .model-lighting-panel::-webkit-scrollbar-thumb{background:#3b4c65;border-radius:8px;border:2px solid #111c2d}
240
+ .model-lighting-panel::-webkit-scrollbar-track{background:var(--panel,#111c2d)}
241
+ .model-lighting-panel::-webkit-scrollbar-thumb{background:var(--scroll,#3b4c65);border-radius:8px;border:2px solid var(--panel,#111c2d)}
242
242
  .model-lighting-head{display:flex;align-items:center;justify-content:space-between;gap:12px;font-size:14px}
243
243
  .model-lighting-close,.model-lighting-reset,.model-lighting-switch{font:inherit;color:inherit;border:1px solid var(--line,#2b3b52);background:var(--panel2,#17243a);border-radius:7px}
244
244
  .model-lighting-close{width:28px;height:28px;padding:0;font-size:20px;line-height:1;cursor:pointer}
245
245
  .model-lighting-copy{margin:5px 0 12px;color:var(--muted,#91a3bb);font-size:12px;line-height:1.4}
246
246
  .model-lighting-switch{display:flex;align-items:center;justify-content:space-between;width:100%;height:38px;padding:0 10px;cursor:pointer}
247
- .model-lighting-switch-track{position:relative;width:34px;height:18px;border-radius:999px;background:#334155;transition:background .15s}
248
- .model-lighting-switch-track span{position:absolute;left:2px;top:2px;width:14px;height:14px;border-radius:50%;background:#cbd5e1;transition:transform .15s,background .15s}
247
+ .model-lighting-switch-track{position:relative;width:34px;height:18px;border-radius:999px;background:var(--model-switch-track,#334155);transition:background .15s}
248
+ .model-lighting-switch-track span{position:absolute;left:2px;top:2px;width:14px;height:14px;border-radius:50%;background:var(--model-switch-thumb,#cbd5e1);transition:transform .15s,background .15s}
249
249
  .model-lighting-switch.on .model-lighting-switch-track{background:var(--accent,#3b82f6)}
250
250
  .model-lighting-switch.on .model-lighting-switch-track span{transform:translateX(16px);background:#fff}
251
251
  .model-lighting-field{display:block;margin-top:13px;color:var(--muted,#a8b6cc);font-size:12px}
252
252
  .model-lighting-field>span{display:flex;justify-content:space-between;gap:12px;margin-bottom:7px}
253
253
  .model-lighting-field output{color:var(--text,#e5edf8);font-variant-numeric:tabular-nums}
254
254
  input[type="range"]{appearance:none;-webkit-appearance:none;width:100%;height:18px;margin:0;background:transparent;cursor:pointer}
255
- input[type="range"]::-webkit-slider-runnable-track{height:4px;border-radius:999px;background:#3a4a62}
256
- input[type="range"]::-webkit-slider-thumb{-webkit-appearance:none;width:16px;height:16px;margin-top:-6px;border:2px solid #0b1220;border-radius:50%;background:var(--accent,#3b82f6);box-shadow:0 0 0 1px #60a5fa}
257
- input[type="range"]::-moz-range-track{height:4px;border-radius:999px;background:#3a4a62}
258
- input[type="range"]::-moz-range-thumb{width:14px;height:14px;border:2px solid #0b1220;border-radius:50%;background:var(--accent,#3b82f6);box-shadow:0 0 0 1px #60a5fa}
255
+ input[type="range"]::-webkit-slider-runnable-track{height:4px;border-radius:999px;background:var(--model-slider-track,#3a4a62)}
256
+ input[type="range"]::-webkit-slider-thumb{-webkit-appearance:none;width:16px;height:16px;margin-top:-6px;border:2px solid var(--model-slider-border,#0b1220);border-radius:50%;background:var(--accent,#3b82f6);box-shadow:0 0 0 1px #60a5fa}
257
+ input[type="range"]::-moz-range-track{height:4px;border-radius:999px;background:var(--model-slider-track,#3a4a62)}
258
+ input[type="range"]::-moz-range-thumb{width:14px;height:14px;border:2px solid var(--model-slider-border,#0b1220);border-radius:50%;background:var(--accent,#3b82f6);box-shadow:0 0 0 1px #60a5fa}
259
259
  @media (forced-colors: active){
260
260
  input[type="range"]{appearance:revert;-webkit-appearance:revert;width:revert;height:revert;margin:revert;background:revert}
261
261
  input[type="range"]::-webkit-slider-runnable-track{height:revert;border-radius:revert;background:revert}
@@ -266,5 +266,5 @@ input[type="range"]::-moz-range-thumb{width:14px;height:14px;border:2px solid #0
266
266
  .model-lighting-field input[type="range"]:disabled{cursor:not-allowed;opacity:.35}
267
267
  .model-lighting-foot{display:flex;justify-content:flex-end;margin-top:14px;padding-top:12px;border-top:1px solid var(--line,#2b3b52)}
268
268
  .model-lighting-reset{padding:6px 12px;cursor:pointer}
269
- .model-lighting-panel button:hover:not(:disabled){border-color:var(--accent,#3b82f6);background:#1d2d47}
269
+ .model-lighting-panel button:hover:not(:disabled){border-color:var(--accent,#3b82f6);background:var(--model-lighting-hover,#1d2d47)}
270
270
  .model-lighting-panel button:focus-visible,.model-lighting-field input[type="range"]:focus-visible{outline:2px solid var(--accent,#3b82f6);outline-offset:2px}
@@ -275,9 +275,17 @@ gridVisibility = (_action) => false, selectedSubjects = () => null, chatLinksCha
275
275
  // Ask the main window to show one of the snapshot's tabs — what a toolbar button that opens a tab does.
276
276
  reveal: (tab) => lifecycle === 'ready' && send({ type: 'reveal', tab }),
277
277
  // Ask the main window to open one AI Chat conversation at one message — an object card's Show in chat. The
278
- // project is carried so the main window refuses rather than asking for the conversation in another scope.
279
- openChat: (chatId, messageEventId, projectId) => typeof chatId === 'string' && typeof messageEventId === 'string'
280
- && typeof projectId === 'string' && !!projectId && send({ type: 'open-chat', chatId, messageEventId, projectId }),
278
+ // selected project identifies the model; the server's owner identifies where the linked conversation lives.
279
+ openChat: (chatId, messageEventId, projectId, owner = undefined) => {
280
+ if (typeof chatId !== 'string' || typeof messageEventId !== 'string' || typeof projectId !== 'string' || !projectId) return false;
281
+ const validId = (id) => typeof id === 'string' && !!id && id.length <= 200;
282
+ if (owner !== undefined && (!owner || typeof owner !== 'object'
283
+ || !(owner.kind === 'workspace' || owner.kind === 'project' && validId(owner.projectId)
284
+ || owner.kind === 'workflow' && validId(owner.workflowId)))) return false;
285
+ const home = owner === undefined ? null : owner.kind === 'workspace' ? { kind: 'workspace' }
286
+ : owner.kind === 'project' ? { kind: 'project', projectId: owner.projectId } : { kind: 'workflow', workflowId: owner.workflowId };
287
+ return send({ type: 'open-chat', chatId, messageEventId, projectId, ...(home ? { owner: home } : {}) });
288
+ },
281
289
  ready(key) { lifecycle = 'ready'; datasetKey = key; publishSnapshot(); },
282
290
  failed(message) { lifecycle = 'failed'; datasetKey = null; publishStatus(message); },
283
291
  dispose() { if (disposed) return; disposed = true; requested = false; win.removeEventListener('message', receive); },
@@ -68,10 +68,11 @@ const writePreference = (storage, profile, state) => {
68
68
  try { storage?.setItem(storageKey(profile), JSON.stringify(state)); } catch (_) {}
69
69
  };
70
70
 
71
- /** @param {{trigger: any, anchor?: any, target: {setLighting: (value: any) => any}, profile?: string, storage?: Storage, documentRef?: any, windowRef?: any, defaults?: any}} options */
71
+ /** @param {{trigger: any, anchor?: any, target: {setLighting: (value: any) => any}, profile?: string, storage?: Storage, documentRef?: any, windowRef?: any, defaults?: any, onBeforeOpen?: () => void}} options */
72
72
  export function mountModelLightingPanel({
73
73
  trigger, anchor = null, target, profile, storage = globalThis.localStorage,
74
74
  documentRef = globalThis.document, windowRef = globalThis, defaults = null,
75
+ onBeforeOpen = () => {},
75
76
  } = {}) {
76
77
  if (!trigger) throw new Error('mountModelLightingPanel: trigger is required');
77
78
  if (!target || typeof target.setLighting !== 'function') throw new Error('mountModelLightingPanel: target.setLighting is required');
@@ -127,6 +128,7 @@ export function mountModelLightingPanel({
127
128
  if (restoreFocus) focusAnchor.focus();
128
129
  };
129
130
  const show = () => {
131
+ onBeforeOpen();
130
132
  const anchorRect = focusAnchor.getBoundingClientRect();
131
133
  if (menu) { menu.classList.remove('open'); focusAnchor.setAttribute('aria-expanded', 'false'); }
132
134
  open = true; panel.hidden = false; paint(); position(anchorRect);
@@ -150,7 +152,7 @@ export function mountModelLightingPanel({
150
152
  panel.querySelector('.model-lighting-reset').addEventListener('click', () => apply(resetState));
151
153
  apply(state, false);
152
154
  return Object.freeze({
153
- open: show, close: () => close(true), toggle,
155
+ open: show, close: ({ restoreFocus = true } = {}) => close(restoreFocus), toggle,
154
156
  state: () => ({ ...state }),
155
157
  isOpen: () => open,
156
158
  destroy() {
@@ -624,6 +624,8 @@ export function revitSnapPointOccluded(point, origin, meshes, planes = [], toler
624
624
  export function createRevitViewport({ canvas, onSelect = () => {}, onOutlineBuild = () => {}, formatDistance = (valueMm) => `${Math.round(valueMm)} mm`, includeHiddenSelectionBounds = false }) {
625
625
  if (typeof formatDistance !== 'function') throw new TypeError('Model viewport distance formatter must be a function.');
626
626
  const renderer = new THREE.WebGLRenderer({ canvas, antialias: true, alpha: false }); renderer.setPixelRatio(Math.min(devicePixelRatio || 1, 2)); renderer.setClearColor(0x020817, 1); renderer.localClippingEnabled = true;
627
+ const setTheme = (theme) => renderer.setClearColor(theme === 'light' ? 0xf1f5f9 : 0x020817, 1);
628
+ setTheme(document.documentElement.dataset.theme);
627
629
  const scene = new THREE.Scene(); const gridLabelScene = new THREE.Scene(); const overlayScene = new THREE.Scene();
628
630
  const ambient = new THREE.AmbientLight(0xffffff, 1.6); scene.add(ambient);
629
631
  const key = new THREE.DirectionalLight(0xffffff, 1.4); scene.add(key); scene.add(key.target);
@@ -1266,6 +1268,7 @@ export function createRevitViewport({ canvas, onSelect = () => {}, onOutlineBuil
1266
1268
  const needSpatial = () => { if (!spatialTools) throw new Error('Shared spatial tools are not mounted.'); return spatialTools; };
1267
1269
  return Object.freeze({
1268
1270
  refreshDisplay() { if (disposed) return; if (lastClipReadout && !clipReadout.hidden) paintClipReadout(lastClipReadout); clipOverlay.render(); },
1271
+ setTheme,
1269
1272
  isReady: () => !!model,
1270
1273
  async load(bytes, ownerByNode, frameReceipt, structuralGridValue = null) { adapter.queueLoad(bytes, ownerByNode, frameReceipt, structuralGridValue); return controller.rebuild({ fit: true }); },
1271
1274
  setProjection: (value) => controller.setProjection(value), setDisplayMode: (value) => controller.setDisplayMode(value),
@@ -258,8 +258,8 @@ function defaultItems(toolbar) {
258
258
  * it exists so a module with unusual chrome is not forced to fight the default, not because anything
259
259
  * needs it today.
260
260
  */
261
- /** @param {{ toolbar: any, getItems?: (toolbar: any) => any[], port?: any }} options */
262
- export function mountToolbarChrome({ toolbar, getItems = defaultItems, port = null }) {
261
+ /** @param {{ toolbar: any, getItems?: (toolbar: any) => any[], port?: any, onBeforeOpen?: (trigger: any) => void }} options */
262
+ export function mountToolbarChrome({ toolbar, getItems = defaultItems, port = null, onBeforeOpen = () => {} }) {
263
263
  if (!toolbar) throw new Error('mountToolbarChrome: no toolbar element');
264
264
  const doc = toolbar.ownerDocument ?? globalThis.document;
265
265
  // The container's ROLE is not set here: the host owns the container (see this file's header), and a
@@ -316,6 +316,7 @@ export function mountToolbarChrome({ toolbar, getItems = defaultItems, port = nu
316
316
  listenOrdinary(trigger, 'click', (event) => {
317
317
  event.stopPropagation();
318
318
  const opening = !menu.classList.contains('open');
319
+ if (opening) { onBeforeOpen(trigger); closeVisibility(); }
319
320
  closeOrdinaryMenus(menu); menu.classList.toggle('open', opening); syncExpanded();
320
321
  });
321
322
  listenOrdinary(trigger, 'keydown', (event) => {
@@ -324,7 +325,7 @@ export function mountToolbarChrome({ toolbar, getItems = defaultItems, port = nu
324
325
  }
325
326
  if (!['ArrowDown', 'Enter', ' '].includes(event.key)) return;
326
327
  event.preventDefault(); event.stopPropagation();
327
- if (!menu.classList.contains('open')) { closeOrdinaryMenus(menu); menu.classList.add('open'); syncExpanded(); }
328
+ if (!menu.classList.contains('open')) { onBeforeOpen(trigger); closeVisibility(); closeOrdinaryMenus(menu); menu.classList.add('open'); syncExpanded(); }
328
329
  initialMenuItem(menu)?.focus();
329
330
  });
330
331
  listenOrdinary(menu, 'keydown', (event) => {
@@ -380,6 +381,7 @@ export function mountToolbarChrome({ toolbar, getItems = defaultItems, port = nu
380
381
  };
381
382
  const openVisibility = () => {
382
383
  if (!visibilityMenu) return;
384
+ onBeforeOpen(visibilityTrigger); closeOrdinaryMenus();
383
385
  visibilityMenu.classList.add('open'); syncExpanded();
384
386
  visibilityItems()[0]?.focus();
385
387
  };
@@ -508,6 +510,7 @@ export function mountToolbarChrome({ toolbar, getItems = defaultItems, port = nu
508
510
  syncVisibility();
509
511
 
510
512
  return {
513
+ closeMenus() { closeOrdinaryMenus(); closeVisibility(); },
511
514
  destroy() {
512
515
  if (observer) observer.disconnect();
513
516
  toolbar.removeEventListener('focusin', onFocusIn);
@@ -316,6 +316,7 @@ export function createModelViewportController(options) {
316
316
  let generationSequence = 0;
317
317
  let activeGeneration = null;
318
318
  const preparedGenerations = new Map();
319
+ let resyncReported = false;
319
320
  let selectionCommit = initialSelectionCommit
320
321
  ? validateSelectionCommit(initialSelectionCommit, { registry: identityRegistry })
321
322
  : immutable({ revision: 0, origin: 'programmatic', operation: 'clear', keys: [], primaryKey: null });
@@ -539,7 +540,16 @@ export function createModelViewportController(options) {
539
540
  commitSelection(commit) {
540
541
  ensureLive();
541
542
  if (commit?.revision <= selectionCommit.revision) return selectionCommit;
542
- const next = validateSelectionCommit(commit, { previousRevision: selectionCommit.revision, registry: identityRegistry });
543
+ // A commit is the coordinator's FULL selection, so a revision that skipped ahead (a replay after a
544
+ // rebuild, a commit this controller never saw) is a resync: adopt it whole rather than wedging on
545
+ // "revision must advance exactly once" for the rest of the session (#1964). Stale/equal revisions
546
+ // were already ignored above; every ordinary commit is still validated as previous + 1.
547
+ const gap = Number.isSafeInteger(commit?.revision) && commit.revision > selectionCommit.revision + 1;
548
+ const next = validateSelectionCommit(commit, { previousRevision: gap ? commit.revision - 1 : selectionCommit.revision, registry: identityRegistry });
549
+ if (gap && !resyncReported) {
550
+ resyncReported = true;
551
+ try { console.warn(`[model-viewport] selection revision jumped ${selectionCommit.revision} -> ${commit.revision}; resynced to the coordinator selection`); } catch (_) { /* logging is best-effort */ }
552
+ }
543
553
  selectionCommit = next;
544
554
  state = transitionViewportState(state, { type: 'selection', keys: next.keys, primaryKey: next.primaryKey });
545
555
  applyPresentation(); publishState(); return next;
@@ -1,4 +1,4 @@
1
- :root{color-scheme:dark;--bg:#080d18;--panel:#101827;--panel-2:#131d2e;--line:#26334a;--line-strong:#3a4a67;--text:#e7edf7;--muted:#92a0b7;--accent:#60a5fa;--accent-soft:rgba(59,130,246,.16);--danger:#fb7185;--scroll:#40506a;--scroll-hover:#586b89;--panelw:330px;--shadow:0 18px 48px rgba(0,0,0,.38);--shadow-tip:0 8px 24px rgba(0,0,0,.45)}
1
+ :root{color-scheme:dark;--bg:#080d18;--panel:#101827;--panel-2:#131d2e;--line:#26334a;--line-strong:#3a4a67;--text:#e7edf7;--muted:#92a0b7;--accent:#60a5fa;--accent-soft:rgba(59,130,246,.16);--danger:#fb7185;--scroll:#40506a;--scroll-hover:#586b89;--btn:#172235;--btn-hover:#1b2940;--authority-bg:#0d1523;--stage-bg:radial-gradient(circle at 52% 45%,#14213a 0,#0b1322 58%,#080d18 100%);--hud-bg:rgba(16,24,39,.94);--scrim-bg:rgba(8,13,24,.72);--selected-ink:#dbeafe;--model-active-bg:#16243d;--panelw:330px;--shadow:0 18px 48px rgba(0,0,0,.38);--shadow-tip:0 8px 24px rgba(0,0,0,.45)}
2
2
  *{box-sizing:border-box}
3
3
  *{scrollbar-width:thin;scrollbar-color:var(--scroll) transparent}
4
4
  *::-webkit-scrollbar{width:10px;height:10px}
@@ -7,34 +7,36 @@
7
7
  *::-webkit-scrollbar-thumb:hover{background:var(--scroll-hover);background-clip:content-box}
8
8
  *::-webkit-scrollbar-corner{background:transparent}
9
9
  html,body{width:100%;height:100%;margin:0;overflow:hidden;background:var(--bg);color:var(--text);font:13px/1.45 Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif}
10
- button{font:inherit;color:inherit;background:#172235;border:1px solid var(--line);border-radius:6px;min-height:30px;padding:5px 9px;cursor:pointer}
11
- button:hover{border-color:var(--line-strong);background:#1b2940}
10
+ button{font:inherit;color:inherit;background:var(--btn);border:1px solid var(--line);border-radius:6px;min-height:30px;padding:5px 9px;cursor:pointer}
11
+ button:hover{border-color:var(--line-strong);background:var(--btn-hover)}
12
12
  button:focus-visible,[tabindex]:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
13
13
  button:disabled{cursor:not-allowed;opacity:.48}
14
14
  input[type=checkbox]{appearance:none;-webkit-appearance:none;width:15px;height:15px;margin:0 5px 0 0;vertical-align:-2px;background:var(--bg);border:1px solid var(--line-strong);border-radius:3px}
15
15
  input[type=checkbox]:checked{background:var(--accent);border-color:var(--accent);box-shadow:inset 0 0 0 3px var(--bg)}
16
16
  input[type=number]{-moz-appearance:textfield;appearance:textfield}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}
17
- .authority-bar{height:54px;display:flex;align-items:center;gap:14px;padding:0 16px;border-bottom:1px solid var(--line);background:#0d1523;position:relative;z-index:70}
17
+ .authority-bar{height:54px;display:flex;align-items:center;gap:14px;padding:0 16px;border-bottom:1px solid var(--line);background:var(--authority-bg);position:relative;z-index:70}
18
18
  .authority-copy{display:grid;grid-template-columns:auto auto;column-gap:9px;align-items:baseline;min-width:0}.authority-kicker{grid-row:1/3;color:var(--accent);font-size:10px;letter-spacing:.12em;text-transform:uppercase}.authority-copy strong,.source-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.authority-copy strong{font-size:13px}.source-name{font-size:11px;color:var(--muted);max-width:42vw;unicode-bidi:plaintext}
19
- .authority-choices{display:flex;gap:4px;margin-left:auto}.authority-choices button{min-height:28px;font-size:11px}.authority-choices button[aria-pressed="true"]{color:#dbeafe;border-color:#3b82f6;background:var(--accent-soft)}
19
+ .authority-choices{display:flex;gap:4px;margin-left:auto}.authority-choices button{min-height:28px;font-size:11px}.authority-choices button[aria-pressed="true"]{color:var(--selected-ink);border-color:#3b82f6;background:var(--accent-soft)}
20
+ .authority-findings{min-height:28px;font-size:11px;color:var(--muted);border-style:dashed}.authority-findings:hover{color:inherit}.authority-findings[hidden]{display:none}
21
+ .authority-note{display:inline-flex;align-items:center;min-height:28px;padding:5px 9px;font-size:11px;color:var(--muted);border:1px solid transparent;border-radius:6px;white-space:nowrap}.authority-note[hidden]{display:none}
20
22
  .read-only-chip{border:1px solid var(--line);border-radius:999px;padding:3px 8px;color:var(--muted);font-size:10px;letter-spacing:.08em;text-transform:uppercase}
21
23
  .model-display-units{display:flex;align-items:center;gap:0;flex-shrink:0;font-size:11px}.model-display-units>span{margin-right:7px;color:var(--muted)}.model-display-units button{min-height:28px;padding:3px 8px;border-radius:0}.model-display-units button:first-of-type{border-radius:5px 0 0 5px}.model-display-units button:last-child{border-radius:0 5px 5px 0;margin-left:-1px}.model-display-units button[aria-pressed="true"]{background:var(--accent-soft);border-color:var(--accent);color:var(--text);position:relative}.model-property-coverage{margin:10px 0 0;color:var(--muted);font-size:10px;line-height:1.5}
22
24
  .revit-imported-property .property-value{white-space:pre-wrap}
23
25
  .model-display-units button[data-unit-choice="mm"]{border-radius:0 5px 5px 0;margin-left:-1px}.model-display-units .model-units-retry{border-radius:5px;margin-left:7px}.model-display-units .model-units-status{margin-left:7px;margin-right:0}
24
- .editor-root{height:calc(100% - 54px);display:grid;grid-template-columns:minmax(0,1fr) 6px var(--panelw);min-width:0}.model-stage{position:relative;min-width:0;overflow:hidden;container-type:inline-size;background:radial-gradient(circle at 52% 45%,#14213a 0,#0b1322 58%,#080d18 100%)}
26
+ .editor-root{height:calc(100% - 54px);display:grid;grid-template-columns:minmax(0,1fr) 6px var(--panelw);min-width:0}.model-stage{position:relative;min-width:0;overflow:hidden;container-type:inline-size;background:var(--stage-bg)}
25
27
  #modelCanvas{display:block;width:100%;height:100%;touch-action:none}
26
28
  #modelSelectionMarquee{position:absolute;z-index:18;pointer-events:none;border:1px solid var(--accent);background:rgba(37,99,235,.12)}#modelSelectionMarquee[data-mode="crossing"]{border-style:dashed;background:rgba(16,185,129,.1);border-color:#34d399}
27
- #modelHoverSummary{position:absolute;left:50%;bottom:70px;z-index:17;max-width:min(440px,70%);transform:translateX(-50%);padding:5px 9px;border:1px solid var(--line);border-radius:6px;background:rgba(16,24,39,.94);box-shadow:var(--shadow-tip);color:var(--text);font-size:11px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;pointer-events:none}
28
- .model-spatial-hud{position:absolute;right:12px;bottom:96px;z-index:16;display:flex;align-items:center;gap:8px;padding:5px 8px;border:1px solid var(--line);border-radius:6px;background:rgba(16,24,39,.9);box-shadow:var(--shadow-tip);font:10.5px/1.3 ui-monospace,SFMono-Regular,Consolas,monospace;color:var(--muted);pointer-events:none}.model-spatial-hud span:first-child{color:var(--accent);font-weight:700}.model-spatial-hud span+span{padding-left:8px;border-left:1px solid var(--line)}
29
+ #modelHoverSummary{position:absolute;left:50%;bottom:70px;z-index:17;max-width:min(440px,70%);transform:translateX(-50%);padding:5px 9px;border:1px solid var(--line);border-radius:6px;background:var(--hud-bg);box-shadow:var(--shadow-tip);color:var(--text);font-size:11px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;pointer-events:none}
30
+ .model-spatial-hud{position:absolute;right:12px;bottom:96px;z-index:16;display:flex;align-items:center;gap:8px;padding:5px 8px;border:1px solid var(--line);border-radius:6px;background:var(--hud-bg);box-shadow:var(--shadow-tip);font:10.5px/1.3 ui-monospace,SFMono-Regular,Consolas,monospace;color:var(--muted);pointer-events:none}.model-spatial-hud span:first-child{color:var(--accent);font-weight:700}.model-spatial-hud span+span{padding-left:8px;border-left:1px solid var(--line)}
29
31
  /* The Clips tab. Shown only in the main window's left Model section, whose frame it fills (createPanelHost). */
30
32
  body.model-panel-host{display:flex;flex-direction:column;background:var(--panel)}#revitPanelTabs{display:flex;flex:1 1 auto;flex-direction:column;min-height:0;padding:6px}#revitPanelTabs[hidden]{display:none}.revit-clip-list-host{display:none;flex:1 1 auto;flex-direction:column;min-height:0;overflow:hidden}.revit-clip-list-host.on{display:flex}.revit-clip-list-host.model-clip-list{margin:0;padding:0;border-top:0}.revit-clip-list-host .model-clip-list-rows{min-height:0;overflow:auto;flex:1 1 auto}
31
- .inspector-resizer{cursor:ew-resize;background:#0c1422;border-left:1px solid var(--line);border-right:1px solid transparent}.inspector-resizer:hover,.inspector-resizer.drag{background:#17243a;border-color:#36557e}.inspector-panel{min-width:0;background:var(--panel);display:flex;flex-direction:column}.inspector-body{overflow:auto;min-height:0;flex:1}.insp-head{padding:14px 14px 9px;font-weight:650;font-size:14px;border-bottom:1px solid var(--line);unicode-bidi:plaintext}.insp-note{padding:26px 16px;text-align:center;color:var(--muted)}.insp-body{padding:8px 12px 18px}.insp-section{padding:10px 0;border-bottom:1px solid var(--line)}.insp-section-heading{font-size:10px;color:var(--muted);text-transform:uppercase;letter-spacing:.1em;margin-bottom:7px}.property-row{display:grid;grid-template-columns:minmax(90px,.8fr) minmax(0,1.2fr);gap:10px;padding:3px 0}.property-key{color:var(--muted)}.property-value{min-width:0;overflow-wrap:anywhere;unicode-bidi:plaintext}.inspector-heading{display:flex}body.panel-collapsed .editor-root{grid-template-columns:minmax(0,1fr) 0 36px}body.panel-collapsed .inspector-resizer{display:none}body.panel-collapsed .inspector-panel{width:36px}body.panel-collapsed .inspector-heading{height:100%;padding:7px;align-items:flex-start}body.panel-collapsed .inspector-heading strong,body.panel-collapsed .inspector-body{display:none}
33
+ .inspector-resizer{cursor:ew-resize;background:var(--bg);border-left:1px solid var(--line);border-right:1px solid transparent}.inspector-resizer:hover,.inspector-resizer.drag{background:var(--btn-hover);border-color:var(--line-strong)}.inspector-panel{min-width:0;background:var(--panel);display:flex;flex-direction:column}.inspector-body{overflow:auto;min-height:0;flex:1}.insp-head{padding:14px 14px 9px;font-weight:650;font-size:14px;border-bottom:1px solid var(--line);unicode-bidi:plaintext}.insp-note{padding:26px 16px;text-align:center;color:var(--muted)}.insp-body{padding:8px 12px 18px}.insp-section{padding:10px 0;border-bottom:1px solid var(--line)}.insp-section-heading{font-size:10px;color:var(--muted);text-transform:uppercase;letter-spacing:.1em;margin-bottom:7px}.property-row{display:grid;grid-template-columns:minmax(90px,.8fr) minmax(0,1.2fr);gap:10px;padding:3px 0}.property-key{color:var(--muted)}.property-value{min-width:0;overflow-wrap:anywhere;unicode-bidi:plaintext}.inspector-heading{display:flex}body.panel-collapsed .editor-root{grid-template-columns:minmax(0,1fr) 0 36px}body.panel-collapsed .inspector-resizer{display:none}body.panel-collapsed .inspector-panel{width:36px}body.panel-collapsed .inspector-heading{height:100%;padding:7px;align-items:flex-start}body.panel-collapsed .inspector-heading strong,body.panel-collapsed .inspector-body{display:none}
32
34
  .revit-property-search{width:100%;min-height:32px;margin-bottom:7px;padding:6px 9px;color:var(--text);background:var(--bg);border:1px solid var(--line);border-radius:6px;font:inherit}.revit-property-search:focus-visible{outline:2px solid var(--accent);outline-offset:2px;border-color:transparent}.revit-property-group{border:1px solid var(--line);border-radius:6px;margin-top:6px;overflow:hidden}.revit-property-group-trigger{width:100%;display:flex;align-items:center;gap:8px;text-align:left;border:0;border-radius:0;background:var(--panel-2)}.revit-property-group-trigger::before{content:'›';color:var(--muted);transform:rotate(0)}.revit-property-group-trigger[aria-expanded="true"]::before{transform:rotate(90deg)}.revit-property-group-body{padding:5px 8px}.revit-imported-property{display:grid;grid-template-columns:minmax(80px,.8fr) minmax(0,1.1fr) auto;gap:4px 8px;padding:7px 0;border-bottom:1px solid var(--line)}.revit-imported-property:last-child{border-bottom:0}.revit-property-provenance{grid-column:1/3;color:var(--muted);font-size:10px}.revit-property-copy{grid-column:3;grid-row:1/3;align-self:center;min-height:25px;padding:2px 7px;font-size:10px}
33
35
  .tekla-uda-property{grid-template-columns:minmax(0,1fr) auto;grid-template-rows:auto auto;column-gap:8px;row-gap:3px}.tekla-uda-property .property-key{grid-column:1;grid-row:1;min-width:0;overflow-wrap:anywhere;font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:11px}.tekla-uda-property .property-value{grid-column:1;grid-row:2;min-width:0;white-space:pre-wrap;overflow-wrap:anywhere;color:var(--text)}.tekla-uda-property .revit-property-copy{grid-column:2;grid-row:1/3}
34
- .tekla-audit-host{display:none;flex:1 1 auto;min-height:0;overflow:hidden;flex-direction:column}.tekla-audit-host.on{display:flex}.tekla-audit-summary{position:sticky;top:0;z-index:1;display:grid;grid-template-columns:1fr 1fr;gap:6px;padding:7px 7px 6px;background:var(--panel)}.tekla-audit-summary>div{display:flex;flex-direction:column;padding:8px;border:1px solid var(--line);border-radius:6px;background:var(--panel-2)}.tekla-audit-summary strong{font-size:17px;line-height:1.1}.tekla-audit-summary span{margin-top:3px;color:var(--muted);font-size:10px}.tekla-audit-filters{display:flex;flex-wrap:wrap;gap:4px;padding:3px 7px 7px;border-bottom:1px solid var(--line)}.tekla-audit-filter{min-height:26px;padding:3px 7px;font-size:10px}.tekla-audit-filter[aria-pressed="true"]{color:#dbeafe;border-color:#3b82f6;background:var(--accent-soft)}.tekla-audit-list{flex:1 1 auto;min-height:0;overflow:auto;padding:6px 7px}.tekla-audit-row{width:100%;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:2px 8px;margin-bottom:5px;padding:8px;text-align:left;background:transparent}.tekla-audit-row[aria-selected="true"]{border-color:var(--accent);background:var(--accent-soft)}.tekla-audit-row strong,.tekla-audit-row>span:nth-child(2){min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tekla-audit-row>span:nth-child(2){grid-column:1;color:var(--muted);font-size:11px;unicode-bidi:plaintext}.tekla-audit-location{grid-column:2;grid-row:1/3;align-self:center;color:#93c5fd;font-size:10px}.tekla-audit-location.missing{color:#fda4af}.tekla-audit-state,.tekla-audit-empty{display:flex;flex-direction:column;gap:5px;padding:18px 12px;color:var(--muted);text-align:center}.tekla-audit-state strong{color:var(--text)}.tekla-audit-inspector-ok{padding:5px 0;color:var(--muted)}.tekla-audit-inspector-item{padding:8px 0;border-bottom:1px solid var(--line)}.tekla-audit-inspector-item:last-child{border-bottom:0}.tekla-audit-inspector-item p{margin:4px 0;color:var(--muted)}.tekla-audit-technical summary{cursor:pointer;color:var(--accent);font-size:11px}.tekla-audit-technical pre{max-height:180px;overflow:auto;margin:6px 0 0;padding:7px;border:1px solid var(--line);border-radius:5px;background:var(--bg);color:var(--muted);font:10px/1.4 ui-monospace,SFMono-Regular,Consolas,monospace;white-space:pre-wrap;overflow-wrap:anywhere}
36
+ .tekla-audit-host{display:none;flex:1 1 auto;min-height:0;overflow:hidden;flex-direction:column}.tekla-audit-host.on{display:flex}.tekla-audit-summary{position:sticky;top:0;z-index:1;display:grid;grid-template-columns:1fr 1fr;gap:6px;padding:7px 7px 6px;background:var(--panel)}.tekla-audit-summary>div{display:flex;flex-direction:column;padding:8px;border:1px solid var(--line);border-radius:6px;background:var(--panel-2)}.tekla-audit-summary strong{font-size:17px;line-height:1.1}.tekla-audit-summary span{margin-top:3px;color:var(--muted);font-size:10px}.tekla-audit-filters{display:flex;flex-wrap:wrap;gap:4px;padding:3px 7px 7px;border-bottom:1px solid var(--line)}.tekla-audit-filter{min-height:26px;padding:3px 7px;font-size:10px}.tekla-audit-filter[aria-pressed="true"]{color:var(--selected-ink);border-color:#3b82f6;background:var(--accent-soft)}.tekla-audit-list{flex:1 1 auto;min-height:0;overflow:auto;padding:6px 7px}.tekla-audit-row{width:100%;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:2px 8px;margin-bottom:5px;padding:8px;text-align:left;background:transparent}.tekla-audit-row[aria-selected="true"]{border-color:var(--accent);background:var(--accent-soft)}.tekla-audit-row strong,.tekla-audit-row>span:nth-child(2){min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tekla-audit-row>span:nth-child(2){grid-column:1;color:var(--muted);font-size:11px;unicode-bidi:plaintext}.tekla-audit-location{grid-column:2;grid-row:1/3;align-self:center;color:#93c5fd;font-size:10px}.tekla-audit-location.missing{color:#fda4af}.tekla-audit-state,.tekla-audit-empty{display:flex;flex-direction:column;gap:5px;padding:18px 12px;color:var(--muted);text-align:center}.tekla-audit-state strong{color:var(--text)}.tekla-audit-inspector-ok{padding:5px 0;color:var(--muted)}.tekla-audit-inspector-item{padding:8px 0;border-bottom:1px solid var(--line)}.tekla-audit-inspector-item:last-child{border-bottom:0}.tekla-audit-inspector-item p{margin:4px 0;color:var(--muted)}.tekla-audit-technical summary{cursor:pointer;color:var(--accent);font-size:11px}.tekla-audit-technical pre{max-height:180px;overflow:auto;margin:6px 0 0;padding:7px;border:1px solid var(--line);border-radius:5px;background:var(--bg);color:var(--muted);font:10px/1.4 ui-monospace,SFMono-Regular,Consolas,monospace;white-space:pre-wrap;overflow-wrap:anywhere}
35
37
  .model-selection-filter-flyout{position:fixed;z-index:95;width:286px;max-height:min(430px,60vh);display:flex;flex-direction:column;padding:8px;background:var(--panel);border:1px solid var(--line-strong);border-radius:8px;box-shadow:var(--shadow)}.model-filter-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:7px}.model-filter-actions{display:flex;gap:4px}.model-filter-actions button{min-height:25px;padding:2px 7px;font-size:10px}.model-selection-filter-flyout>input{width:100%;min-height:31px;padding:5px 8px;color:var(--text);background:var(--bg);border:1px solid var(--line);border-radius:6px;font:inherit}.model-selection-filter-flyout>input:focus-visible{outline:2px solid var(--accent);outline-offset:2px}.model-filter-list{min-height:44px;margin-top:7px;overflow:auto;border-top:1px solid var(--line);padding-top:5px}.model-filter-option{display:flex;align-items:center;gap:5px;min-height:29px;padding:4px 5px;border-radius:5px;cursor:pointer}.model-filter-option:hover{background:var(--accent-soft)}.model-filter-option span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;unicode-bidi:plaintext}
36
38
  .model-spatial-dialog{position:fixed;z-index:96;width:min(360px,calc(100vw - 24px));max-height:min(520px,75vh);display:flex;flex-direction:column;gap:8px;padding:11px;background:var(--panel);border:1px solid var(--line-strong);border-radius:9px;box-shadow:var(--shadow)}.model-spatial-dialog-header{display:flex;align-items:center;justify-content:space-between;gap:8px}.model-spatial-dialog input{width:100%;min-height:32px;padding:6px 8px;color:var(--text);background:var(--bg);border:1px solid var(--line);border-radius:6px;font:inherit}.model-spatial-dialog input:focus-visible{outline:2px solid var(--accent);outline-offset:2px}.model-spatial-dialog-actions{display:flex;justify-content:flex-end;gap:5px}.model-saved-view-list{display:grid;gap:4px;overflow:auto;min-height:42px;border-top:1px solid var(--line);padding-top:7px}.model-saved-view-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:5px}.model-saved-view-row>button:first-child{text-align:left;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.model-dialog-note{color:var(--muted);font-size:11px}
37
- .viewport-state{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:7px;text-align:center;background:rgba(8,13,24,.72);z-index:20}.viewport-state span:last-child{color:var(--muted)}.state-spinner{width:24px;height:24px;border:2px solid var(--line);border-top-color:var(--accent);border-radius:50%;animation:spin .8s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}
39
+ .viewport-state{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:7px;text-align:center;background:var(--scrim-bg);z-index:20}.viewport-state span:last-child{color:var(--muted)}.state-spinner{width:24px;height:24px;border:2px solid var(--line);border-top-color:var(--accent);border-radius:50%;animation:spin .8s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}
38
40
  /* No revision to open yet (#1522): the viewport keeps its scrim and says why, and the model-only chrome steps aside. */
39
41
  .viewport-state-empty{gap:6px;padding:24px}.viewport-state-empty .viewport-state-icon{width:32px;height:32px;margin-bottom:6px;fill:none;stroke:var(--muted);stroke-width:1.4;stroke-linecap:round;stroke-linejoin:round}.viewport-state-empty strong{font-size:14px;font-weight:600;color:var(--text)}.viewport-state-empty span{max-width:42ch;color:var(--muted)}
40
42
  /* A Tekla read with nothing drawable (#1849): the model is open, so the notice is a card, not a scrim, and takes no clicks.
@@ -45,9 +47,7 @@ body.model-panel-host{display:flex;flex-direction:column;background:var(--panel)
45
47
  status. The shared chrome stays styled only by model-editor.css (model-editor-shell.test.ts). */
46
48
  .editor-root[data-model-state="empty"]>:not(.model-stage),.editor-root[data-model-state="empty"]>.model-stage>:not(#loadingState){display:none}
47
49
  body:has(.editor-root[data-model-state="empty"]) .read-only-chip{display:none}
48
- :root[data-theme="light"]:has(.editor-root[data-model-state="empty"]){color-scheme:light;--bg:#fff;--panel:#fff;--line:#e2e8f0;--text:#0f172a;--muted:#64748b;--accent:#2563eb;--scroll:#cbd5e1;--scroll-hover:#94a3b8}
49
- :root[data-theme="light"]:has(.editor-root[data-model-state="empty"]) .authority-bar{background:#fff}
50
- :root[data-theme="light"]:has(.editor-root[data-model-state="empty"]) .model-stage{background:#f1f5f9}
50
+ :root[data-theme="light"]{color-scheme:light;--bg:#f8fafc;--panel:#fff;--panel-2:#f1f5f9;--panel2:#f1f5f9;--model-on-ink:#fff;--model-switch-track:#cbd5e1;--model-switch-thumb:#fff;--line:#e2e8f0;--line-strong:#cbd5e1;--text:#0f172a;--muted:#64748b;--accent:#2563eb;--accent-soft:rgba(37,99,235,.1);--danger:#e11d48;--scroll:#cbd5e1;--scroll-hover:#94a3b8;--btn:#f1f5f9;--btn-hover:#e2e8f0;--authority-bg:#fff;--stage-bg:#f1f5f9;--hud-bg:rgba(255,255,255,.94);--scrim-bg:rgba(241,245,249,.85);--selected-ink:#1d4ed8;--model-active-bg:#dbeafe;--cyan:#0891b2;--shadow:0 18px 48px rgba(15,23,42,.14);--shadow-tip:0 8px 24px rgba(15,23,42,.14);--shadow-lg:0 8px 24px rgba(15,23,42,.14);--model-overlay-ink:#1d4ed8;--model-overlay-halo:#f1f5f9;--model-snap-ink:#0e7490;--model-section-bg:#f8fafc;--model-shadow:rgba(15,23,42,.14);--model-slider-track:#cbd5e1;--model-slider-border:#fff;--model-lighting-hover:#e2e8f0}
51
51
  :root[data-theme="light"]:has(.editor-root[data-model-state="empty"]) .viewport-state-empty{background:transparent}
52
52
  #toast{position:fixed;left:50%;bottom:18px;transform:translateX(-50%);padding:8px 12px;border:1px solid var(--line);border-radius:7px;background:var(--panel);box-shadow:var(--shadow);opacity:0;pointer-events:none;z-index:90;transition:opacity .15s}#toast.show{opacity:1}
53
53
  #tooltip{position:fixed;z-index:100;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}#tooltip.show{opacity:1}