@floless/app 0.117.1 → 0.119.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.
@@ -12,8 +12,16 @@ Usage:
12
12
 
13
13
  python vision_to_contract.py vision-out.json sketch.png --out contract.json
14
14
  python vision_to_contract.py vision-out2.json page2.png --merge-into contract.json
15
+ python vision_to_contract.py vision-out.json scan.png --geometry cv.json --out contract.json
15
16
 
16
17
  --merge-into appends the extraction as the next sheet of an existing contract (multi-image sets).
18
+
19
+ --geometry takes the sheet's GEOMETRY from classify_and_trace.py instead of from the model, and
20
+ keeps only the model's TEXT. That is the measured split: on a real framing plan the model placed
21
+ geometry at centerline F1 0.008 against the sheet's own CAD data while the CV tracer scored 0.73,
22
+ and the model read the labels correctly where the CV tracer produces none at all. They fail in
23
+ opposite directions, so each keeps what it is good at. Without the flag this behaves exactly as
24
+ before.
17
25
  Requires PyMuPDF (used only to read the image/PDF pixel size).
18
26
  """
19
27
 
@@ -40,7 +48,52 @@ def unwrap(payload):
40
48
  return result["elements"], model
41
49
 
42
50
 
43
- def to_sheet(elements, image_path):
51
+ def load_cv_geometry(path, expect_w=None, expect_h=None):
52
+ """Geometry elements from classify_and_trace.py, already in the image's pixel frame.
53
+
54
+ The CV tracer measures the ink, so unlike the model it needs no 0..1000 remap. Text is
55
+ dropped if present -- this path exists precisely because the model owns text.
56
+ """
57
+ with open(path, encoding="utf-8") as f:
58
+ doc = json.load(f)
59
+ els = doc.get("elements")
60
+ if els is None and isinstance(doc.get("sheets"), list) and doc["sheets"]:
61
+ els = doc["sheets"][0].get("elements")
62
+ if not isinstance(els, list):
63
+ sys.exit(f"{path}: no elements[] — is this classify_and_trace.py output?")
64
+ # The tracer records the image it measured. If that is not the image being converted, the
65
+ # geometry lands in a different frame from the text and the page box, silently — trace a
66
+ # downsampled copy and hand over the original and everything still "works".
67
+ img = doc.get("image") or {}
68
+ if expect_w and img.get("w") and (int(img["w"]) != int(expect_w) or int(img["h"]) != int(expect_h)):
69
+ sys.exit(f"{path} was traced from a {img.get('w')}x{img.get('h')} image but the image "
70
+ f"given here is {expect_w}x{expect_h} — geometry and text would be in "
71
+ f"different frames. Trace and convert the SAME image.")
72
+ if doc.get("output_frame") not in (None, "original"):
73
+ sys.exit(f"{path}: output_frame is {doc['output_frame']!r}, not 'original' — the editor "
74
+ f"and the raster backdrop both use the original frame.")
75
+ out = []
76
+ for el in els:
77
+ if el.get("kind") == "text":
78
+ continue
79
+ e = {"kind": el["kind"]}
80
+ if el.get("d"):
81
+ e["d"] = el["d"]
82
+ elif el.get("pts"):
83
+ e["pts"] = [[round(float(p[0]), 1), round(float(p[1]), 1)] for p in el["pts"]]
84
+ else:
85
+ continue
86
+ out.append(e)
87
+ if not out:
88
+ # An empty trace with --geometry would emit a text-only contract still CLAIMING measured
89
+ # geometry, and the editor would tell the user the linework was measured from the ink
90
+ # over a drawing with no linework in it.
91
+ sys.exit(f"{path} contains no geometry — the trace found nothing. Re-run the tracer "
92
+ f"(try --ink-method otsu), or drop --geometry to use the vision-only path.")
93
+ return out, doc.get("method", "opencv/centerline")
94
+
95
+
96
+ def to_sheet(elements, image_path, geometry=None):
44
97
  # Images only: a multi-page PDF has no single 0..1000 frame, so the caller rasterizes each
45
98
  # PDF page to its own image first (SKILL.md step 3b) and runs one extraction per image.
46
99
  if image_path.lower().endswith(".pdf"):
@@ -50,10 +103,14 @@ def to_sheet(elements, image_path):
50
103
  w, h = float(pix.width), float(pix.height)
51
104
  sx, sy = w / 1000.0, h / 1000.0
52
105
 
53
- out = []
106
+ out = list(geometry or [])
54
107
  for el in elements:
55
108
  kind = el.get("kind")
56
109
  conf = el.get("confidence")
110
+ # With CV geometry in hand the model contributes TEXT ONLY. Letting its lines through
111
+ # as well would put two conflicting sets of coordinates in one contract.
112
+ if geometry is not None and kind != "text":
113
+ continue
57
114
  if kind == "text":
58
115
  bbox = el.get("bbox")
59
116
  if not el.get("text") or not bbox or len(bbox) != 4:
@@ -88,6 +145,73 @@ def to_sheet(elements, image_path):
88
145
  return {"page": {"w": round(w, 2), "h": round(h, 2)}, "elements": out}
89
146
 
90
147
 
148
+ def selftest():
149
+ """Pin the --geometry contract. Every case here is one a review found or asked for."""
150
+ import tempfile
151
+ tmp = tempfile.mkdtemp(prefix="v2c_")
152
+ fails = []
153
+
154
+ def check(name, cond, detail=""):
155
+ print(f" {'ok ' if cond else 'FAIL'} {name}" + ("" if cond else f" -> {detail}"))
156
+ if not cond:
157
+ fails.append(name)
158
+
159
+ # a 200x100 white PNG, written with PyMuPDF so no extra dependency is needed
160
+ img = os.path.join(tmp, "img.png")
161
+ pm = fitz.Pixmap(fitz.csRGB, fitz.IRect(0, 0, 200, 100), False)
162
+ pm.clear_with(255)
163
+ pm.save(img)
164
+
165
+ def write(name, obj):
166
+ q = os.path.join(tmp, name)
167
+ with open(q, "w", encoding="utf-8") as f:
168
+ json.dump(obj, f)
169
+ return q
170
+
171
+ cv_ok = write("cv.json", {"method": "opencv/centerline", "output_frame": "original",
172
+ "image": {"w": 200, "h": 100},
173
+ "elements": [{"kind": "line", "pts": [[0, 0], [100, 0]]},
174
+ {"kind": "arc", "d": "M0 0 A5 5 0 1 1 10 0"}]})
175
+ vis = write("vis.json", {"result": {"elements": [
176
+ {"kind": "text", "text": "BEAM", "bbox": [100, 100, 300, 200], "confidence": 0.9},
177
+ {"kind": "line", "pts": [[0, 0], [900, 900]]}]}, "model": "m1"})
178
+
179
+ geom, method = load_cv_geometry(cv_ok, 200, 100)
180
+ check("geometry loads from tracer output", len(geom) == 2 and method == "opencv/centerline",
181
+ (len(geom), method))
182
+ sheet = to_sheet([{"kind": "text", "text": "BEAM", "bbox": [100, 100, 300, 200]},
183
+ {"kind": "line", "pts": [[0, 0], [900, 900]]}], img, geom)
184
+ kinds = [e["kind"] for e in sheet["elements"]]
185
+ check("model GEOMETRY is dropped when --geometry is given",
186
+ kinds.count("line") == 1 and kinds.count("text") == 1, kinds)
187
+ check("ids are unique across the combined set",
188
+ len({e["id"] for e in sheet["elements"]}) == len(sheet["elements"]))
189
+ check("CV geometry is NOT rescaled (it is already in pixels)",
190
+ sheet["elements"][0]["pts"] == [[0.0, 0.0], [100.0, 0.0]], sheet["elements"][0])
191
+ check("model text IS rescaled from the 0..1000 frame",
192
+ sheet["elements"][2]["bbox"][0] == 20.0, sheet["elements"][2]["bbox"])
193
+
194
+ # a trace of a DIFFERENT image must be refused, not silently combined
195
+ bad_frame = write("bad.json", {"method": "opencv/centerline", "image": {"w": 400, "h": 200},
196
+ "elements": [{"kind": "line", "pts": [[0, 0], [1, 1]]}]})
197
+ try:
198
+ load_cv_geometry(bad_frame, 200, 100)
199
+ check("a trace of a different-sized image is refused", False, "no exit")
200
+ except SystemExit:
201
+ check("a trace of a different-sized image is refused", True)
202
+
203
+ empty = write("empty.json", {"method": "opencv/centerline", "image": {"w": 200, "h": 100},
204
+ "elements": []})
205
+ try:
206
+ load_cv_geometry(empty, 200, 100)
207
+ check("an EMPTY trace is refused, not shipped as text-only", False, "no exit")
208
+ except SystemExit:
209
+ check("an EMPTY trace is refused, not shipped as text-only", True)
210
+
211
+ print(f"\nselftest: {len(fails)} failure(s)")
212
+ return 1 if fails else 0
213
+
214
+
91
215
  def main():
92
216
  for stream in (sys.stdout, sys.stderr):
93
217
  try:
@@ -95,17 +219,40 @@ def main():
95
219
  except AttributeError:
96
220
  pass
97
221
  ap = argparse.ArgumentParser(description=__doc__)
98
- ap.add_argument("vision_json", help="output of `aware agent invoke vision extract --json`")
99
- ap.add_argument("image", help="the raster image the extraction ran on (rasterize PDF pages first)")
222
+ ap.add_argument("vision_json", nargs="?",
223
+ help="output of `aware agent invoke vision extract --json`; may be "
224
+ "OMITTED when --geometry is given, which emits measured geometry "
225
+ "with no text at all")
226
+ ap.add_argument("image", nargs="?",
227
+ help="the raster image the extraction ran on (rasterize PDF pages first)")
100
228
  ap.add_argument("--out", help="write a NEW one-sheet contract here")
101
229
  ap.add_argument("--merge-into", help="append as the next sheet of this existing contract")
230
+ ap.add_argument("--selftest", action="store_true")
231
+ ap.add_argument("--geometry", help="classify_and_trace.py output: take GEOMETRY from the "
232
+ "CV tracer and keep only the model's TEXT")
102
233
  args = ap.parse_args()
234
+ if args.selftest:
235
+ sys.exit(selftest())
236
+ if not args.image:
237
+ sys.exit("an image is required")
103
238
  if bool(args.out) == bool(args.merge_into):
104
239
  sys.exit("pass exactly one of --out / --merge-into")
105
240
 
106
- with open(args.vision_json, encoding="utf-8") as f:
107
- elements, model = unwrap(json.load(f))
108
- sheet = to_sheet(elements, args.image)
241
+ if not args.vision_json and not args.geometry:
242
+ sys.exit("pass a vision output, or --geometry for a measured-geometry-only contract")
243
+ if args.vision_json:
244
+ with open(args.vision_json, encoding="utf-8") as f:
245
+ elements, model = unwrap(json.load(f))
246
+ else:
247
+ # The geometry-only fallback: the tracer ran, the vision CLI/credential did not. The
248
+ # contract carries measured linework and NO text, and says so in `extractor` so the
249
+ # editor cannot imply a model was involved.
250
+ elements, model = [], None
251
+ geometry, cv_method = (None, None)
252
+ if args.geometry:
253
+ pix0 = fitz.Pixmap(args.image)
254
+ geometry, cv_method = load_cv_geometry(args.geometry, pix0.width, pix0.height)
255
+ sheet = to_sheet(elements, args.image, geometry)
109
256
  stem = os.path.splitext(os.path.basename(args.image))[0]
110
257
 
111
258
  if args.merge_into:
@@ -135,7 +282,13 @@ def main():
135
282
  "kind": "image",
136
283
  "sha256": digest,
137
284
  "read_at": datetime.now(timezone.utc).isoformat(timespec="seconds"),
138
- "extractor": f"vision.extract@{model}",
285
+ # The extractor string IS the provenance the editor reads to word its
286
+ # confidence note, so a hybrid must say so: geometry measured from the ink,
287
+ # text read by the model. Claiming either alone would be a false statement
288
+ # about how the drawing was read.
289
+ "extractor": (
290
+ (f"{cv_method}+vision.text@{model}" if model else f"{cv_method}")
291
+ if geometry is not None else f"vision.extract@{model}"),
139
292
  },
140
293
  "sheets": [sheet],
141
294
  }
@@ -144,7 +297,21 @@ def main():
144
297
  with open(path, "w", encoding="utf-8") as f:
145
298
  json.dump(contract, f, ensure_ascii=False)
146
299
  weak = sum(1 for e in sheet["elements"] if (e.get("confidence") or 1) < 0.5)
147
- print(f"{path}: sheet {sheet['id']} ({stem}), {len(sheet['elements'])} element(s), {weak} weak", file=sys.stderr)
300
+ # Geometry and text are counted SEPARATELY: one undifferentiated total let a contract with
301
+ # zero linework and a handful of labels read as a healthy result.
302
+ n_text = sum(1 for e in sheet["elements"] if e.get("kind") == "text")
303
+ n_geom = len(sheet["elements"]) - n_text
304
+ print(f"{path}: sheet {sheet['id']} ({stem}), {n_geom} geometry + {n_text} text "
305
+ f"element(s), {weak} weak", file=sys.stderr)
306
+ if args.merge_into and contract.get("source", {}).get("extractor") and geometry is not None:
307
+ # Provenance is top-level, so a multi-sheet job that used different paths per sheet can
308
+ # only carry one claim. Say so rather than let the first sheet speak for all of them.
309
+ prev = contract["source"]["extractor"]
310
+ now = (f"{cv_method}+vision.text@{model}" if model else cv_method)
311
+ if prev != now:
312
+ print(f" ! this sheet was read as {now!r} but the contract says {prev!r}; provenance "
313
+ f"is per-CONTRACT, so the editor will show one claim for every sheet.",
314
+ file=sys.stderr)
148
315
 
149
316
 
150
317
  if __name__ == "__main__":
@@ -2,7 +2,7 @@
2
2
  name: reading-structural-drawings
3
3
  description: This skill should be used BEFORE modelling anything from a structural/architectural drawing SET (PDF). Use it whenever turning drawings into a 3D frame, takeoff, IFC, or Tekla model — it is the prerequisite reading discipline for the `floless-app-steel-takeoff` reader (and the `floless-app-steel-model` guide that orchestrates the full flow). Triggers on "read this drawing set", "model this structure from the PDF", "take off this steel", "build a model from these drawings", or any pure-PDF → structure task. It encodes the method that stops the classic failures (missing that a set is TWO buildings, missing a curved/sloped roof, conflating grids across sheets, tracing dimension lines as members) — establish MASSING + COORDINATE FRAME first (from the index + elevations + sections), members LAST; deterministic geometry feeds the reasoning; cross-validate every view; verify before presenting.
4
4
  metadata:
5
- version: 0.2.1
5
+ version: 0.3.0
6
6
  ---
7
7
 
8
8
  # Reading a structural drawing set — the discipline (do this BEFORE you model anything)
@@ -255,8 +255,40 @@ any external count.
255
255
  A 2-point fit gives `real = A·pixel + b`. Check the grid is orthogonal / skewed / radial — don't
256
256
  assume 90°. **Each sheet may have its own origin/orientation — re-anchor per sheet; never carry one
257
257
  sheet's grid onto another** (this conflation is a top failure).
258
- - **Levels:** OCR the level/T.O.STEEL tags from an elevation/section into a datum table
259
- (L1 +0'-0", L2 +16'-6", Roof …). Members snap to these.
258
+ - **Levels — hunt down the T.O.S. callouts BEFORE assuming any level is flat.** Sweep everywhere they
259
+ hide: the framing plans themselves, the frame elevations, and **every section view** — a section is
260
+ often the only place a level is ever stated, so always open them if the set has any. OCR them into a
261
+ datum table (L1 +0'-0", L2 +16'-6", Roof …) and let members snap to it **only where the level really
262
+ is flat** — establish that, don't assume it.
263
+ - **A level reading `VARIES`/`SLOPES`, or carrying several different T.O.S. values, has NO single
264
+ elevation, and no default may be substituted for one.** Those callouts are **WORKING POINTS**: each
265
+ fixes top-of-steel at a known location, so every member framing at that point sits there, and the
266
+ level lies on the surface the points define. Derive it from the points:
267
+ 1. **Trace every leader to its real endpoint.** A T.O.S. leader commonly lands on a **column point**,
268
+ not on a beam — and a column is shared by two to four beams. Where those beams belong to one
269
+ continuous surface the callout fixes them all at once, which is what makes it powerful. It is not
270
+ a licence to propagate blindly: stepped framing, a dropped bay, secondary steel or two roof facets
271
+ meeting can put different elevations at one plan point. Propagate only to members shown to share
272
+ the surface, and stop at anything the drawing separates.
273
+ 2. **Let the points tell you the surface — never assume its shape.** Tabulate `(location → value)` and
274
+ test the candidates: flat; a function of ONE axis (a one-way slope, so callouts sharing that
275
+ coordinate must agree); a general plane varying in both (`z = ax + by + c`); several independent
276
+ surfaces (separate structures, or facets meeting at a ridge/valley); or stepped/warped/cambered,
277
+ which no single fit describes. **Quote the residuals** — a tight fit is evidence, a poor one means
278
+ your surface model is wrong, not that the drawing is.
279
+ 3. **Read every other member off that surface, and be honest about how.** Interpolating between two
280
+ callouts that bracket the member is sound. **Extrapolating past the outermost callout is not**:
281
+ allow it only within the same continuous facet, only for a short reach against the callout spacing
282
+ you fitted (a fraction of a bay, never a new one), and only when nothing suggests the surface
283
+ changes out there. Past that, the elevation is unresolved — **RFI it** rather than stretching the
284
+ plane. Record which values were derived rather than measured; a model format may not carry that
285
+ distinction for you, so the read log is usually the only place it survives.
286
+ 4. **A member running across the fall has a DIFFERENT elevation at each end.** Record both. Never
287
+ collapse a sloping member to one number, and never average it.
288
+
289
+ If the points do not determine the surface, say so and **RFI it** — inventing a level is exactly the
290
+ failure this pass exists to prevent. Expect the slope to be stated ONLY by these point elevations:
291
+ there is often no slope arrow, no `SLOPE` text and no note anywhere in the set.
260
292
 
261
293
  ### Pass 3 — MEMBERS (now, and only now), per building, per level
262
294
  - Tile big sheets: **always include a low-DPI full-sheet overview alongside overlapping high-DPI
@@ -2,7 +2,7 @@
2
2
  name: steel-drawing-abbreviations
3
3
  description: Default legend of standard US (AISC, imperial) structural-steel drawing abbreviations, note conventions, and shape designations — the fallback meaning when a drawing set omits or only partially supplies its own abbreviations/legend sheet. This skill should be used while reading a structural steel drawing whenever an abbreviation, note code, or profile designation needs expanding (TYP, TOS, UON, EQ, (E)/(N), SIM, HSS, WT, and so on), or when the steel reader (floless-app-steel-takeoff / floless-app-steel-model) meets a note or label whose meaning is not defined on the supplied sheets. The project's own legend always overrides these defaults.
4
4
  metadata:
5
- version: "0.2.1"
5
+ version: "0.3.0"
6
6
  ---
7
7
 
8
8
  # Steel drawing abbreviations — default legend
@@ -270,7 +270,11 @@ When reading the General Notes and plan notes, these drive member geometry/metad
270
270
  - **`TYP`** — a value/detail shown once applies to all like conditions. A "TYP" profile or spacing in
271
271
  the notes is the **default** for unlabeled members of that kind.
272
272
  - **`TOS` / `TOC` / `TOF` / `BOS`** — top/bottom-of-steel/concrete/footing elevations. A plan default
273
- TOS ("ALL STEEL T.O.S. = 16'-6" UON") sets every member's elevation unless a local callout overrides.
273
+ TOS ("ALL STEEL T.O.S. = 16'-6" UON") sets every member's elevation unless a local callout overrides —
274
+ **but that order only holds for a level that is genuinely FLAT.** Where the level varies (`VARIES`,
275
+ `SLOPES`, or simply several different T.O.S. values on the sheet), the individual callouts are not
276
+ exceptions to the note: they are **working points** that define the surface. Collect them ALL and fit
277
+ the surface FIRST, before reaching for any default — see `reading-structural-drawings`.
274
278
  - **`UON` / `UNO`** — the stated value holds everywhere *unless* a local note says otherwise. Treat a
275
279
  "TYP … UON" note as the fallback and watch for the exceptions.
276
280
  - **`EQ`** — equally-spaced members between two references (no explicit dimension).
package/dist/web/app.css CHANGED
@@ -161,6 +161,12 @@
161
161
  background-repeat: no-repeat;
162
162
  background-position: right 10px center;
163
163
  }
164
+ /* A <select> upgraded by themeSelect() (app.js) is no longer a rendered control — it is the
165
+ value model behind a .sel-combo, and it is hidden because the styling above can only reach
166
+ its CLOSED state. Its OPEN option list is drawn by the OS and cannot be themed at all, which
167
+ is the whole reason the combobox exists (same call steel-editor.html and steel-filter.html
168
+ already made). Leaving it visible would show two controls for one value. */
169
+ select.sel-native { display: none; }
164
170
  select:hover, button:hover { border-color: var(--accent-dim); }
165
171
  /* Keyboard focus ring (the global outline:none above kills it for mouse users;
166
172
  restore it for keyboard nav across every control, incl. JS-built buttons). */
@@ -2074,14 +2080,20 @@
2074
2080
 
2075
2081
  /* Add/edit form */
2076
2082
  .modal.routine-edit { width: 540px; max-width: 92vw; max-height: 90vh; overflow-y: auto; }
2077
- #rtn-workflow, .rtn-kind-select { min-width: 0; width: 100%; }
2078
2083
  .rtn-days { display: flex; flex-wrap: wrap; gap: 5px; }
2079
2084
  .rtn-day { text-transform: capitalize; }
2080
- /* Time picker: two app-styled selects (replaces the native time input so it
2081
- matches the dark baseline instead of the OS picker). */
2082
- .rtn-time { display: flex; align-items: center; gap: 8px; }
2083
- .rtn-time select { min-width: 0; width: auto; flex: 0 0 auto; }
2084
- .rtn-time-sep { color: var(--text-dim); font-family: var(--mono); }
2085
+ /* Time picker: two themed comboboxes, sized to their content (00–23 / 00–59) rather than
2086
+ stretched across the field like the full-width ones above. Replaces the native time input,
2087
+ which draws the OS picker. */
2088
+ .rtn-time { display: flex; align-items: flex-start; gap: 8px; }
2089
+ .rtn-time .sel-combo { width: auto; flex: 0 0 auto; }
2090
+ .rtn-time .sel-combo .wf-trigger { width: auto; min-width: 74px; }
2091
+ /* The hour/minute popovers sit side by side; keep each one over its own trigger rather than
2092
+ letting the in-line flow push the second one down a row. */
2093
+ .rtn-time .sel-combo .fm-select-popover { min-width: 100%; }
2094
+ /* flex-start above (an open popover flows in-line and makes its column tall); the padding
2095
+ keeps the ":" on the triggers' text line instead of riding the top edge. */
2096
+ .rtn-time-sep { color: var(--text-dim); font-family: var(--mono); padding: 8px 0; }
2085
2097
  #rtn-cron { font-family: var(--mono); letter-spacing: 0.02em; }
2086
2098
  .rtn-cron-hint { margin-top: 7px; font-size: 10.5px; color: var(--text-dim); line-height: 1.55; }
2087
2099
  .rtn-cron-hint code { font-family: var(--mono); color: var(--text-muted); background: var(--surface-2); padding: 0 3px; border-radius: 3px; }
@@ -3777,6 +3789,44 @@ body.mode-workspaces #menu .menu-item[data-action="bake"] { display:none; }
3777
3789
  display:flex; align-items:center; justify-content:center; position:relative; color:var(--accent); font-size:24px; }
3778
3790
  .ws-card .ws-kind { position:absolute; top:8px; left:8px; font-size:9px; text-transform:uppercase; letter-spacing:.1em;
3779
3791
  color:var(--accent-bright); background:var(--surface); border:1px solid var(--accent-dim); padding:2px 7px; border-radius:4px; }
3792
+ /* ── Project thumbnail (the picture on the card) ──────────────────────────────────────────────
3793
+ With a picture the 88px band becomes a real <button> — the ONE place on the card where a click
3794
+ does something other than open the project. That deviation is only fair if it is announced BEFORE
3795
+ the click, which is what the ⤢ chip and the zoom-in cursor are for; without them the region would
3796
+ look identical to the rest of the card and behave differently, which is the worst of both.
3797
+ The .ws-kind badge needs no change to survive an arbitrary photo underneath: it is already an
3798
+ OPAQUE chip (--surface + a border), so its contrast is with its own background, not the image.
3799
+ The ring is inset (outline-offset:-2px) because .ws-card sets overflow:hidden and would otherwise
3800
+ clip a keyboard focus ring drawn outside the band. */
3801
+ .ws-card button.ws-thumb { appearance:none; width:100%; padding:0; overflow:hidden; cursor:zoom-in;
3802
+ border:0; border-bottom:1px solid var(--border); font:inherit; }
3803
+ .ws-card button.ws-thumb:focus-visible { outline:2px solid var(--accent); outline-offset:-2px; }
3804
+ .ws-card .ws-thumb img { width:100%; height:100%; object-fit:cover; display:block; }
3805
+ .ws-card .ws-thumb-expand { position:absolute; right:8px; bottom:8px; width:22px; height:22px;
3806
+ display:flex; align-items:center; justify-content:center; border-radius:5px; font-size:12px;
3807
+ background:color-mix(in srgb, var(--bg) 70%, transparent); border:1px solid var(--border-strong);
3808
+ color:var(--text); opacity:0; transition:opacity .12s ease; pointer-events:none; }
3809
+ .ws-card button.ws-thumb:hover .ws-thumb-expand,
3810
+ .ws-card button.ws-thumb:focus-visible .ws-thumb-expand { opacity:1; }
3811
+ @media (prefers-reduced-motion: reduce) { .ws-card .ws-thumb-expand { transition:none; } }
3812
+ /* A stored picture that will not decode. Degrades to a muted line rather than leaving a broken-image
3813
+ glyph in a card that otherwise claims to have one — same treatment, and the same lowercase voice,
3814
+ as .e-thumb-failed on the render preview. The element is swapped back to a plain <span>, so the
3815
+ "view larger" affordance disappears with the thing it would have shown. */
3816
+ .ws-card .ws-thumb-failed { font-size:11px; color:var(--text-dim); cursor:pointer; }
3817
+
3818
+ /* The enlarge viewer. Sized to the picture (width:auto) rather than the modal's fixed 480px, and
3819
+ capped so a tall image scrolls nothing — it just fits. */
3820
+ .modal.ws-thumb-viewer { width:auto; max-width:min(920px, 92vw); max-height:88vh; padding:0;
3821
+ display:flex; flex-direction:column; overflow:hidden; }
3822
+ .ws-thumb-head { display:flex; align-items:center; justify-content:space-between; gap:12px;
3823
+ padding:12px 14px; border-bottom:1px solid var(--border); background:var(--surface-2); }
3824
+ .ws-thumb-head .modal-title { margin-bottom:0; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
3825
+ #ws-thumb-close { font-size:18px; line-height:1; padding:4px 10px; flex:none; }
3826
+ .ws-thumb-stage { min-height:0; display:flex; align-items:center; justify-content:center;
3827
+ padding:14px; background:var(--bg); }
3828
+ /* contain, not cover: this view exists precisely to see the whole picture undistorted. */
3829
+ .ws-thumb-stage img { max-width:100%; max-height:calc(88vh - 110px); object-fit:contain; display:block; border-radius:4px; }
3780
3830
  .ws-card .ws-body { padding:11px 13px 13px; display:flex; align-items:flex-start; justify-content:space-between; gap:8px; }
3781
3831
  /* The project NAME is user-supplied and unbounded, and CSS Grid stretches every card in a row to the
3782
3832
  tallest — so one long name reflows the whole grid. Measured: a 69-character name wrapped to two